@salla.sa/ui-ai-kit-core 1.1.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ai-agent-error.cjs.entry.js +41 -0
- package/dist/cjs/ai-card.cjs.entry.js +3 -3
- package/dist/cjs/ai-chat-container.cjs.entry.js +3 -3
- package/dist/cjs/ai-chat-header.cjs.entry.js +6 -6
- package/dist/cjs/ai-chat-message.cjs.entry.js +2 -2
- package/dist/cjs/ai-conversation-list.cjs.entry.js +2 -2
- package/dist/cjs/ai-conversation-summary.cjs.entry.js +3 -3
- package/dist/cjs/ai-icon.cjs.entry.js +1 -1
- package/dist/cjs/ai-link.cjs.entry.js +2 -2
- package/dist/cjs/ai-loading.cjs.entry.js +1 -1
- package/dist/cjs/ai-message-input.cjs.entry.js +1 -1
- package/dist/cjs/ai-rating.cjs.entry.js +1 -1
- package/dist/cjs/ai-route-decision.cjs.entry.js +2 -2
- package/dist/cjs/ai-suggestion.cjs.entry.js +3 -3
- package/dist/cjs/ai-voice-input.cjs.entry.js +16 -10
- package/dist/cjs/{index-BkNg07SW.js → index-Bs23yVuF.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/ui-ai-kit.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ai-agent-error/ai-agent-error.css +154 -0
- package/dist/collection/components/ai-agent-error/ai-agent-error.js +197 -0
- package/dist/collection/components/ai-card/ai-card.js +2 -2
- package/dist/collection/components/ai-chat-container/ai-chat-container.css +2 -7
- package/dist/collection/components/ai-chat-container/ai-chat-container.js +1 -1
- package/dist/collection/components/ai-chat-header/ai-chat-header.js +6 -6
- package/dist/collection/components/ai-chat-message/ai-chat-message.js +1 -1
- package/dist/collection/components/ai-conversation-list/ai-conversation-list.js +1 -1
- package/dist/collection/components/ai-conversation-summary/ai-conversation-summary.js +4 -4
- package/dist/collection/components/ai-link/ai-link.js +1 -1
- package/dist/collection/components/ai-route-decision/ai-route-decision.js +1 -1
- package/dist/collection/components/ai-suggestion/ai-suggestion.js +2 -2
- package/dist/collection/components/ai-voice-input/ai-voice-input.css +1 -1
- package/dist/collection/components/ai-voice-input/ai-voice-input.js +14 -8
- package/dist/components/ai-agent-error.d.ts +11 -0
- package/dist/components/ai-agent-error.js +1 -0
- package/dist/components/ai-card.js +1 -1
- package/dist/components/ai-chat-container.js +1 -1
- package/dist/components/ai-chat-header.js +1 -1
- package/dist/components/ai-chat-message.js +2 -2
- package/dist/components/ai-conversation-list.js +1 -1
- package/dist/components/ai-conversation-summary.js +1 -1
- package/dist/components/ai-icon.js +1 -1
- package/dist/components/ai-link.js +1 -1
- package/dist/components/ai-loading.js +1 -1
- package/dist/components/ai-message-input.js +1 -1
- package/dist/components/ai-rating.js +1 -1
- package/dist/components/ai-route-decision.js +1 -1
- package/dist/components/ai-suggestion.js +1 -1
- package/dist/components/ai-voice-input.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-Dr2tAPV7.js → p-Bbmjx9lq.js} +1 -1
- package/dist/components/p-C5gkZloN.js +1 -0
- package/dist/components/p-CAnlgwx0.js +1 -0
- package/dist/esm/ai-agent-error.entry.js +39 -0
- package/dist/esm/ai-card.entry.js +3 -3
- package/dist/esm/ai-chat-container.entry.js +3 -3
- package/dist/esm/ai-chat-header.entry.js +6 -6
- package/dist/esm/ai-chat-message.entry.js +2 -2
- package/dist/esm/ai-conversation-list.entry.js +2 -2
- package/dist/esm/ai-conversation-summary.entry.js +3 -3
- package/dist/esm/ai-icon.entry.js +1 -1
- package/dist/esm/ai-link.entry.js +2 -2
- package/dist/esm/ai-loading.entry.js +1 -1
- package/dist/esm/ai-message-input.entry.js +1 -1
- package/dist/esm/ai-rating.entry.js +1 -1
- package/dist/esm/ai-route-decision.entry.js +2 -2
- package/dist/esm/ai-suggestion.entry.js +3 -3
- package/dist/esm/ai-voice-input.entry.js +16 -10
- package/dist/esm/{index-B0yIzgh4.js → index-hxWjzqcH.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/ui-ai-kit.js +3 -3
- package/dist/types/components/ai-agent-error/ai-agent-error.d.ts +19 -0
- package/dist/types/components/ai-chat-header/ai-chat-header.d.ts +1 -1
- package/dist/types/components/ai-conversation-summary/ai-conversation-summary.d.ts +1 -1
- package/dist/types/components.d.ts +112 -13
- package/dist/ui-ai-kit/{p-b28af13a.entry.js → p-1cce63d4.entry.js} +1 -1
- package/dist/ui-ai-kit/p-1e7608ee.entry.js +1 -0
- package/dist/ui-ai-kit/p-2342431f.entry.js +1 -0
- package/dist/ui-ai-kit/p-27bf454d.entry.js +1 -0
- package/dist/ui-ai-kit/{p-eb0c7e7a.entry.js → p-2a49ee93.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-5c9e9822.entry.js → p-3268aa48.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-eec6f083.entry.js → p-5ea933a4.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-87e9739b.entry.js → p-6b61d00f.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-74c5c83f.entry.js → p-6b9b1022.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-5caf1c38.entry.js → p-889c6b00.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-2955439f.entry.js → p-999dd7c8.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-ef07638f.entry.js → p-9a4b8c7e.entry.js} +2 -2
- package/dist/ui-ai-kit/{p-a099fcfb.entry.js → p-a424e69b.entry.js} +1 -1
- package/dist/ui-ai-kit/{p-d1bb1ad0.entry.js → p-b33e92ea.entry.js} +1 -1
- package/dist/ui-ai-kit/p-ccaec7b4.entry.js +1 -0
- package/dist/ui-ai-kit/p-hxWjzqcH.js +2 -0
- package/dist/ui-ai-kit/ui-ai-kit.css +1 -1
- package/dist/ui-ai-kit/ui-ai-kit.esm.js +1 -1
- package/package.json +1 -1
- package/dist/components/p-DCr8F_XV.js +0 -1
- package/dist/components/p-DnO4dikr.js +0 -1
- package/dist/ui-ai-kit/p-21c4fc1f.entry.js +0 -1
- package/dist/ui-ai-kit/p-6d3505e9.entry.js +0 -1
- package/dist/ui-ai-kit/p-B0yIzgh4.js +0 -2
- package/dist/ui-ai-kit/p-a9e4eaef.entry.js +0 -1
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.icon-wrap {
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
line-height: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/* ── Card ─────────────────────────────────────────────── */
|
|
13
|
+
|
|
14
|
+
@keyframes fade-in {
|
|
15
|
+
from {
|
|
16
|
+
opacity: 0;
|
|
17
|
+
transform: translateY(4px);
|
|
18
|
+
}
|
|
19
|
+
to {
|
|
20
|
+
opacity: 1;
|
|
21
|
+
transform: translateY(0);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.error-card {
|
|
26
|
+
background: var(--ai-danger-bg);
|
|
27
|
+
border: 1px solid var(--ai-danger-border);
|
|
28
|
+
border-radius: 16px;
|
|
29
|
+
box-shadow: var(--ai-shadow-error);
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
animation: fade-in 0.3s ease;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* ── Body row ─────────────────────────────────────────── */
|
|
35
|
+
|
|
36
|
+
.error-body {
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: flex-start;
|
|
39
|
+
gap: 12px;
|
|
40
|
+
padding: 16px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* ── Error icon ───────────────────────────────────────── */
|
|
44
|
+
|
|
45
|
+
.error-icon-wrap {
|
|
46
|
+
width: 36px;
|
|
47
|
+
height: 36px;
|
|
48
|
+
border-radius: 9999px;
|
|
49
|
+
background: var(--ai-bg-card);
|
|
50
|
+
border: 1px solid var(--ai-danger-border);
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
flex-shrink: 0;
|
|
55
|
+
color: var(--ai-danger-text);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* ── Text content ─────────────────────────────────────── */
|
|
59
|
+
|
|
60
|
+
.error-content {
|
|
61
|
+
flex: 1;
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
gap: 6px;
|
|
65
|
+
min-width: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.error-headline-row {
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
gap: 8px;
|
|
72
|
+
flex-wrap: wrap;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.error-headline {
|
|
76
|
+
font-size: 14px;
|
|
77
|
+
font-weight: 600;
|
|
78
|
+
color: var(--ai-danger-text);
|
|
79
|
+
line-height: 1.4;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.error-code-badge {
|
|
83
|
+
font-size: 11px;
|
|
84
|
+
font-weight: 500;
|
|
85
|
+
color: var(--ai-danger-text);
|
|
86
|
+
background: var(--ai-bg-card);
|
|
87
|
+
border: 1px solid var(--ai-danger-border);
|
|
88
|
+
padding: 1px 7px;
|
|
89
|
+
border-radius: 9999px;
|
|
90
|
+
white-space: nowrap;
|
|
91
|
+
flex-shrink: 0;
|
|
92
|
+
opacity: 0.85;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.error-message {
|
|
96
|
+
margin: 0;
|
|
97
|
+
font-size: 13px;
|
|
98
|
+
font-weight: 400;
|
|
99
|
+
color: var(--ai-text-secondary);
|
|
100
|
+
line-height: 1.5;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* ── Dismiss button ───────────────────────────────────── */
|
|
104
|
+
|
|
105
|
+
.dismiss-btn {
|
|
106
|
+
display: inline-flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
background: none;
|
|
110
|
+
border: none;
|
|
111
|
+
padding: 4px;
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
color: var(--ai-danger-text);
|
|
114
|
+
opacity: 0.6;
|
|
115
|
+
flex-shrink: 0;
|
|
116
|
+
border-radius: 6px;
|
|
117
|
+
transition: opacity 0.15s ease, background 0.15s ease;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.dismiss-btn:hover {
|
|
121
|
+
opacity: 1;
|
|
122
|
+
background: var(--ai-hover-overlay);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* ── Footer / retry ───────────────────────────────────── */
|
|
126
|
+
|
|
127
|
+
.error-footer {
|
|
128
|
+
padding: 0 16px 14px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.retry-btn {
|
|
132
|
+
display: inline-flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
gap: 6px;
|
|
135
|
+
background: var(--ai-bg-card);
|
|
136
|
+
border: 1px solid var(--ai-danger-border);
|
|
137
|
+
border-radius: 9999px;
|
|
138
|
+
padding: 6px 14px;
|
|
139
|
+
font-size: 13px;
|
|
140
|
+
font-weight: 500;
|
|
141
|
+
color: var(--ai-danger-text);
|
|
142
|
+
cursor: pointer;
|
|
143
|
+
transition: box-shadow 0.15s ease, opacity 0.15s ease;
|
|
144
|
+
font-family: inherit;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.retry-btn:hover {
|
|
148
|
+
box-shadow: var(--ai-shadow-active);
|
|
149
|
+
opacity: 0.9;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.retry-btn:active {
|
|
153
|
+
opacity: 0.75;
|
|
154
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { iconRegistry } from "../../utils/icon-registry";
|
|
3
|
+
export class AiAgentError {
|
|
4
|
+
/** Error card title */
|
|
5
|
+
headline = 'حدث خطأ أثناء التنفيذ';
|
|
6
|
+
/** Descriptive error message shown below the title */
|
|
7
|
+
message = '';
|
|
8
|
+
/** Optional error code / identifier shown as a small badge */
|
|
9
|
+
errorCode = '';
|
|
10
|
+
/** Show a retry button */
|
|
11
|
+
retryable = true;
|
|
12
|
+
/** Retry button label */
|
|
13
|
+
retryLabel = 'إعادة المحاولة';
|
|
14
|
+
/** Show a dismiss (×) button */
|
|
15
|
+
dismissible = false;
|
|
16
|
+
retryClick;
|
|
17
|
+
dismissClick;
|
|
18
|
+
renderIcon(name, width, height) {
|
|
19
|
+
const icon = iconRegistry[name];
|
|
20
|
+
if (!icon)
|
|
21
|
+
return null;
|
|
22
|
+
const svg = `<svg width="${width}" height="${height}" viewBox="${icon.viewBox}" fill="none" xmlns="http://www.w3.org/2000/svg">${icon.content}</svg>`;
|
|
23
|
+
return h("span", { class: "icon-wrap", innerHTML: svg });
|
|
24
|
+
}
|
|
25
|
+
render() {
|
|
26
|
+
return (h(Host, { key: '938a7d7ea8f1af9c4523eaf2a4944c4d1d7fb6a2' }, h("div", { key: 'ad4f04819ac44e4541405674c903f5e2a2ec5e6e', class: "error-card" }, h("div", { key: 'be863a0a24342ab7c8704e3a9ee0ad2b44633c4d', class: "error-body" }, h("div", { key: '0572130fca12b6d341f0e727a5f7f72f281d5cf7', class: "error-icon-wrap" }, this.renderIcon('warning', 20, 20)), h("div", { key: '53bbccb1da858d0f85c50609c2d6ab79d8bdd3cf', class: "error-content" }, h("div", { key: '76bbe45588ea39a29f72c4267881d39cc1767ad0', class: "error-headline-row" }, h("span", { key: '077fe71637fe1621b5ee532e8634657ff1b5f1ac', class: "error-headline" }, this.headline), this.errorCode && (h("span", { key: '45307d3a8f43c3d17daa44e0df7dc7643a9af7da', class: "error-code-badge" }, this.errorCode))), this.message && (h("p", { key: '6848d16db67c2ced84785e7762b79a1fac9a4d14', class: "error-message" }, this.message))), this.dismissible && (h("button", { key: 'c06661ef9c19dbcb9cb6620c9bec69e2a6a35205', class: "dismiss-btn", "aria-label": "\u0625\u063A\u0644\u0627\u0642", onClick: () => this.dismissClick.emit() }, this.renderIcon('cancel', 16, 16)))), this.retryable && (h("div", { key: '3b1ed90ee58f872a22f790abd0e5c9acd1480a36', class: "error-footer" }, h("button", { key: 'd50096dd81d9098c827f564f5c6e120dafe56dac', class: "retry-btn", onClick: () => this.retryClick.emit() }, this.renderIcon('reload', 16, 16), h("span", { key: '0ef79b60c4de040f57dfd6c7c71fd1d1863baa33' }, this.retryLabel)))))));
|
|
27
|
+
}
|
|
28
|
+
static get is() { return "ai-agent-error"; }
|
|
29
|
+
static get encapsulation() { return "shadow"; }
|
|
30
|
+
static get originalStyleUrls() {
|
|
31
|
+
return {
|
|
32
|
+
"$": ["ai-agent-error.css"]
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
static get styleUrls() {
|
|
36
|
+
return {
|
|
37
|
+
"$": ["ai-agent-error.css"]
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
static get properties() {
|
|
41
|
+
return {
|
|
42
|
+
"headline": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"mutable": false,
|
|
45
|
+
"complexType": {
|
|
46
|
+
"original": "string",
|
|
47
|
+
"resolved": "string",
|
|
48
|
+
"references": {}
|
|
49
|
+
},
|
|
50
|
+
"required": false,
|
|
51
|
+
"optional": false,
|
|
52
|
+
"docs": {
|
|
53
|
+
"tags": [],
|
|
54
|
+
"text": "Error card title"
|
|
55
|
+
},
|
|
56
|
+
"getter": false,
|
|
57
|
+
"setter": false,
|
|
58
|
+
"reflect": false,
|
|
59
|
+
"attribute": "headline",
|
|
60
|
+
"defaultValue": "'\u062D\u062F\u062B \u062E\u0637\u0623 \u0623\u062B\u0646\u0627\u0621 \u0627\u0644\u062A\u0646\u0641\u064A\u0630'"
|
|
61
|
+
},
|
|
62
|
+
"message": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"mutable": false,
|
|
65
|
+
"complexType": {
|
|
66
|
+
"original": "string",
|
|
67
|
+
"resolved": "string",
|
|
68
|
+
"references": {}
|
|
69
|
+
},
|
|
70
|
+
"required": false,
|
|
71
|
+
"optional": false,
|
|
72
|
+
"docs": {
|
|
73
|
+
"tags": [],
|
|
74
|
+
"text": "Descriptive error message shown below the title"
|
|
75
|
+
},
|
|
76
|
+
"getter": false,
|
|
77
|
+
"setter": false,
|
|
78
|
+
"reflect": false,
|
|
79
|
+
"attribute": "message",
|
|
80
|
+
"defaultValue": "''"
|
|
81
|
+
},
|
|
82
|
+
"errorCode": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"mutable": false,
|
|
85
|
+
"complexType": {
|
|
86
|
+
"original": "string",
|
|
87
|
+
"resolved": "string",
|
|
88
|
+
"references": {}
|
|
89
|
+
},
|
|
90
|
+
"required": false,
|
|
91
|
+
"optional": false,
|
|
92
|
+
"docs": {
|
|
93
|
+
"tags": [],
|
|
94
|
+
"text": "Optional error code / identifier shown as a small badge"
|
|
95
|
+
},
|
|
96
|
+
"getter": false,
|
|
97
|
+
"setter": false,
|
|
98
|
+
"reflect": false,
|
|
99
|
+
"attribute": "error-code",
|
|
100
|
+
"defaultValue": "''"
|
|
101
|
+
},
|
|
102
|
+
"retryable": {
|
|
103
|
+
"type": "boolean",
|
|
104
|
+
"mutable": false,
|
|
105
|
+
"complexType": {
|
|
106
|
+
"original": "boolean",
|
|
107
|
+
"resolved": "boolean",
|
|
108
|
+
"references": {}
|
|
109
|
+
},
|
|
110
|
+
"required": false,
|
|
111
|
+
"optional": false,
|
|
112
|
+
"docs": {
|
|
113
|
+
"tags": [],
|
|
114
|
+
"text": "Show a retry button"
|
|
115
|
+
},
|
|
116
|
+
"getter": false,
|
|
117
|
+
"setter": false,
|
|
118
|
+
"reflect": false,
|
|
119
|
+
"attribute": "retryable",
|
|
120
|
+
"defaultValue": "true"
|
|
121
|
+
},
|
|
122
|
+
"retryLabel": {
|
|
123
|
+
"type": "string",
|
|
124
|
+
"mutable": false,
|
|
125
|
+
"complexType": {
|
|
126
|
+
"original": "string",
|
|
127
|
+
"resolved": "string",
|
|
128
|
+
"references": {}
|
|
129
|
+
},
|
|
130
|
+
"required": false,
|
|
131
|
+
"optional": false,
|
|
132
|
+
"docs": {
|
|
133
|
+
"tags": [],
|
|
134
|
+
"text": "Retry button label"
|
|
135
|
+
},
|
|
136
|
+
"getter": false,
|
|
137
|
+
"setter": false,
|
|
138
|
+
"reflect": false,
|
|
139
|
+
"attribute": "retry-label",
|
|
140
|
+
"defaultValue": "'\u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629'"
|
|
141
|
+
},
|
|
142
|
+
"dismissible": {
|
|
143
|
+
"type": "boolean",
|
|
144
|
+
"mutable": false,
|
|
145
|
+
"complexType": {
|
|
146
|
+
"original": "boolean",
|
|
147
|
+
"resolved": "boolean",
|
|
148
|
+
"references": {}
|
|
149
|
+
},
|
|
150
|
+
"required": false,
|
|
151
|
+
"optional": false,
|
|
152
|
+
"docs": {
|
|
153
|
+
"tags": [],
|
|
154
|
+
"text": "Show a dismiss (\u00D7) button"
|
|
155
|
+
},
|
|
156
|
+
"getter": false,
|
|
157
|
+
"setter": false,
|
|
158
|
+
"reflect": false,
|
|
159
|
+
"attribute": "dismissible",
|
|
160
|
+
"defaultValue": "false"
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
static get events() {
|
|
165
|
+
return [{
|
|
166
|
+
"method": "retryClick",
|
|
167
|
+
"name": "retryClick",
|
|
168
|
+
"bubbles": true,
|
|
169
|
+
"cancelable": true,
|
|
170
|
+
"composed": true,
|
|
171
|
+
"docs": {
|
|
172
|
+
"tags": [],
|
|
173
|
+
"text": ""
|
|
174
|
+
},
|
|
175
|
+
"complexType": {
|
|
176
|
+
"original": "void",
|
|
177
|
+
"resolved": "void",
|
|
178
|
+
"references": {}
|
|
179
|
+
}
|
|
180
|
+
}, {
|
|
181
|
+
"method": "dismissClick",
|
|
182
|
+
"name": "dismissClick",
|
|
183
|
+
"bubbles": true,
|
|
184
|
+
"cancelable": true,
|
|
185
|
+
"composed": true,
|
|
186
|
+
"docs": {
|
|
187
|
+
"tags": [],
|
|
188
|
+
"text": ""
|
|
189
|
+
},
|
|
190
|
+
"complexType": {
|
|
191
|
+
"original": "void",
|
|
192
|
+
"resolved": "void",
|
|
193
|
+
"references": {}
|
|
194
|
+
}
|
|
195
|
+
}];
|
|
196
|
+
}
|
|
197
|
+
}
|
|
@@ -5,11 +5,11 @@ export class AiCard {
|
|
|
5
5
|
/** Remove the shadow */
|
|
6
6
|
noShadow = false;
|
|
7
7
|
render() {
|
|
8
|
-
return (h(Host, { key: '
|
|
8
|
+
return (h(Host, { key: 'de29e6d9cef8b521fdf6ac6a3f02732b80a8ebfe' }, h("div", { key: 'b6b097e595977af04497bf64e68f3b89854bc710', class: {
|
|
9
9
|
card: true,
|
|
10
10
|
'card--no-padding': this.noPadding,
|
|
11
11
|
'card--no-shadow': this.noShadow,
|
|
12
|
-
} }, h("slot", { key: '
|
|
12
|
+
} }, h("slot", { key: '4a0af40b21edd47f187c8eaad0d6487575f1a6eb' }))));
|
|
13
13
|
}
|
|
14
14
|
static get is() { return "ai-card"; }
|
|
15
15
|
static get encapsulation() { return "shadow"; }
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
.watermark ai-icon {
|
|
102
|
-
opacity: 0.8;
|
|
103
|
-
filter: var(--ai-shadow-watermark);
|
|
102
|
+
opacity: var(--ai-watermark-opacity, 0.8);
|
|
103
|
+
filter: var(--ai-watermark-filter, var(--ai-shadow-watermark));
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
/* ── Mobile ──────────────────────────────────────────────────────────────── */
|
|
@@ -133,8 +133,3 @@
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
/* ── Dark mode watermark tweak ───────────────────────────────────────────── */
|
|
137
|
-
|
|
138
|
-
:host(.dark) .watermark ai-icon {
|
|
139
|
-
opacity: 0.6;
|
|
140
|
-
}
|
|
@@ -143,7 +143,7 @@ export class ChatContainer {
|
|
|
143
143
|
return false;
|
|
144
144
|
}
|
|
145
145
|
render() {
|
|
146
|
-
return (h(Host, { key: '
|
|
146
|
+
return (h(Host, { key: 'cd4fad0fb3c4e06b8efd4481aef825f4bfc521a2', class: { dark: this.isDark() } }, h("div", { key: '4ebc198e353d9e78a4f733bdd728d13a3f7ceade', class: this.getContainerClasses(), style: this.getContainerStyle(), ref: el => (this.containerRef = el) }, this.showWatermark && (h("div", { key: '3c67cd62b37489274e0f246194a35d1e26d7ae05', class: "watermark" }, h("ai-icon", { key: 'fd3482b93e53b43f59bd96b995f3ff0472444f05', name: "watermark", size: 133 }))), h("slot", { key: '783c04dafaeecd563c05196620e3b888669614a9', name: "header" }), h("div", { key: 'cd44c7e5ca42e659d29cf74720eaf5c1a4264f4e', class: "messages-area", ref: el => (this.messagesAreaRef = el) }, h("slot", { key: 'f1f61eed5585ad3e4d23c16368ad37cfe1b216be' })), h("slot", { key: 'fecfd1d232a324ab468b69eed15865a699af956a', name: "footer" }))));
|
|
147
147
|
}
|
|
148
148
|
static get is() { return "ai-chat-container"; }
|
|
149
149
|
static get encapsulation() { return "shadow"; }
|
|
@@ -24,7 +24,7 @@ export class AiChatHeader {
|
|
|
24
24
|
/** Title / chevron click → open conversation list (agent mode) */
|
|
25
25
|
dropdownClick;
|
|
26
26
|
/** More options button */
|
|
27
|
-
|
|
27
|
+
positionClick;
|
|
28
28
|
/** Back-arrow button (human mode) */
|
|
29
29
|
backClick;
|
|
30
30
|
/**
|
|
@@ -56,18 +56,18 @@ export class AiChatHeader {
|
|
|
56
56
|
return [
|
|
57
57
|
this.renderDragBtn(),
|
|
58
58
|
h("div", { class: "content agent dropdown-trigger", role: "button", onClick: () => this.dropdownClick.emit(), "aria-haspopup": "listbox", "aria-expanded": false, "aria-label": `${this.conversation}, افتح قائمة المحادثات` }, h("span", { class: "title" }, this.conversation), h("span", { class: "dropdown-chevron" }, this.renderIcon('chevron-down', 24, 24))),
|
|
59
|
-
h("div", { class: "actions" }, h("button", { class: "action-btn", "aria-label": "\u062A\u0639\u062F\u064A\u0644 / Edit", onClick: () => this.editClick.emit() }, this.renderIcon('pencil-edit', 22, 22)), h("button", { class: "action-btn", "aria-label": "\u0627\u0644\
|
|
59
|
+
h("div", { class: "actions" }, h("button", { class: "action-btn", "aria-label": "\u062A\u0639\u062F\u064A\u0644 / Edit", onClick: () => this.editClick.emit() }, this.renderIcon('pencil-edit', 22, 22)), h("button", { class: "action-btn", "aria-label": "\u0627\u0644\u0639\u0631\u0636 / Position", onClick: () => this.positionClick.emit() }, this.renderIcon('hand', 22, 22)), h("button", { class: "action-btn", "aria-label": "\u0625\u063A\u0644\u0627\u0642 / Close", onClick: () => this.closeClick.emit() }, this.renderIcon('cancel', 22, 22))),
|
|
60
60
|
];
|
|
61
61
|
}
|
|
62
62
|
renderHumanMode() {
|
|
63
63
|
return [
|
|
64
64
|
this.renderDragBtn(),
|
|
65
65
|
h("div", { class: "content human" }, this.showBack && (h("button", { class: "back-btn", "aria-label": "\u0631\u062C\u0648\u0639 / Back", onClick: () => this.backClick.emit() }, this.renderIcon('arrow-right', 24, 24))), h("div", { class: "avatar-wrapper" }, this.renderAvatar(), h("span", { class: `online-dot status-${this.statusIndicator}` }, this.renderIcon('online-dot', 10, 10))), h("div", { class: "text-block" }, h("span", { class: "agent-name" }, this.agentName), this.agentStatus && h("span", { class: "agent-status" }, this.agentStatus))),
|
|
66
|
-
h("div", { class: "actions" }, h("button", { class: "action-btn", "aria-label": "\u0627\u0644\
|
|
66
|
+
h("div", { class: "actions" }, h("button", { class: "action-btn", "aria-label": "\u0627\u0644\u0639\u0631\u0636 / Position", onClick: () => this.positionClick.emit() }, this.renderIcon('hand', 22, 22)), h("button", { class: "action-btn", "aria-label": "\u0625\u063A\u0644\u0627\u0642 / Close", onClick: () => this.closeClick.emit() }, this.renderIcon('cancel', 22, 22))),
|
|
67
67
|
];
|
|
68
68
|
}
|
|
69
69
|
render() {
|
|
70
|
-
return (h(Host, { key: '
|
|
70
|
+
return (h(Host, { key: '66ad39b3b123aebf528b675e9b26a3004693a137' }, h("div", { key: '355be9c94e460c995a9fc58484c891c071ed9604', class: "header-container" }, this.mode === 'agent' ? this.renderAgentMode() : this.renderHumanMode())));
|
|
71
71
|
}
|
|
72
72
|
static get is() { return "ai-chat-header"; }
|
|
73
73
|
static get encapsulation() { return "shadow"; }
|
|
@@ -297,8 +297,8 @@ export class AiChatHeader {
|
|
|
297
297
|
"references": {}
|
|
298
298
|
}
|
|
299
299
|
}, {
|
|
300
|
-
"method": "
|
|
301
|
-
"name": "
|
|
300
|
+
"method": "positionClick",
|
|
301
|
+
"name": "positionClick",
|
|
302
302
|
"bubbles": true,
|
|
303
303
|
"cancelable": true,
|
|
304
304
|
"composed": true,
|
|
@@ -195,7 +195,7 @@ export class AiChatMessage {
|
|
|
195
195
|
} })), h("slot", null), showActions && this.renderActionsBar()), (this.agentName || this.timestamp) && (h("div", { class: "agent-info" }, this.agentName && h("span", { class: "agent-info-name" }, this.agentName), this.agentName && this.timestamp && this.renderIcon('eclipse', 10), this.timestamp && h("span", { class: "agent-info-time" }, this.getRelativeTime()))))));
|
|
196
196
|
}
|
|
197
197
|
render() {
|
|
198
|
-
return h(Host, { key: '
|
|
198
|
+
return h(Host, { key: 'ceb0df75b3fc5ba2bd7494e150e679960707b891' }, this.role === 'user' ? this.renderUserMessage() : this.renderAgentMessage());
|
|
199
199
|
}
|
|
200
200
|
static get is() { return "ai-chat-message"; }
|
|
201
201
|
static get encapsulation() { return "shadow"; }
|
|
@@ -54,7 +54,7 @@ export class AiConversationList {
|
|
|
54
54
|
}
|
|
55
55
|
render() {
|
|
56
56
|
const list = this.getItems();
|
|
57
|
-
return (h(Host, { key: '
|
|
57
|
+
return (h(Host, { key: '8c3d6b60fbd6fbc9e073d5dcada95a04bf6b22eb' }, h("div", { key: 'e11e29b8fb0247617b00fca7ab5d76bd547efc69', class: "conversation-list" }, h("div", { key: 'a24920fd77797e113fe91c96fe033c8301f01d58', class: "list-scroll", role: "list" }, this.loading
|
|
58
58
|
? this.renderSkeleton()
|
|
59
59
|
: list.map(item => {
|
|
60
60
|
const isActive = item.id === this.activeId;
|
|
@@ -2,7 +2,7 @@ import { Host, h } from "@stencil/core";
|
|
|
2
2
|
import { iconRegistry } from "../../utils/icon-registry";
|
|
3
3
|
export class AiConversationSummary {
|
|
4
4
|
/** Card heading */
|
|
5
|
-
|
|
5
|
+
conversation = 'ملخص المحادثة';
|
|
6
6
|
/** Summary body text */
|
|
7
7
|
summary = '';
|
|
8
8
|
/** Total message count shown as a badge */
|
|
@@ -17,7 +17,7 @@ export class AiConversationSummary {
|
|
|
17
17
|
return h("span", { class: "icon-wrap", innerHTML: svg });
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
|
-
return (h(Host, { key: '
|
|
20
|
+
return (h(Host, { key: '7d24574485e990986d6325bbf6f04b52b65e6a2d' }, h("div", { key: 'd55f22088754c266516c242228028c486ec94796', class: "summary-card" }, h("div", { key: 'b60b8f661a7edbb8a3b133f4a4998eb0ae57371c', class: "summary-header" }, h("div", { key: '1a1ce3df47afcf2b92caf2a8fc4dd2c7baca3370', class: "sparkle-avatar" }, this.renderIcon('sparkle', 14, 14)), h("span", { key: 'fbebe5e290dfa41a607e32f7159778b5ddb6250c', class: "summary-title" }, this.conversation), h("div", { key: '662436df14966ae975116c54dec54bb70ee887f5', class: "summary-badges" }, this.messageCount > 0 && (h("span", { key: 'ad3cc08fc5ba060deccafbebe39c53201d520192', class: "badge" }, this.renderIcon('list', 12, 12), this.messageCount)), this.language && (h("span", { key: 'c1fb40de5cce02913770604508aceae616bf50c4', class: "badge lang-badge" }, this.language)))), this.summary && (h("p", { key: 'd555295af336a739ede2f3453cba567630eaafe1', class: "summary-body", ref: el => el && (el.textContent = this.summary) })), h("div", { key: '4cb6f52194b37a037029da491153624749cd9bef', class: "summary-slot" }, h("slot", { key: '53cbd9e4d53ae8a51e43960369d7a5b45d7d491d' })))));
|
|
21
21
|
}
|
|
22
22
|
static get is() { return "ai-conversation-summary"; }
|
|
23
23
|
static get encapsulation() { return "shadow"; }
|
|
@@ -33,7 +33,7 @@ export class AiConversationSummary {
|
|
|
33
33
|
}
|
|
34
34
|
static get properties() {
|
|
35
35
|
return {
|
|
36
|
-
"
|
|
36
|
+
"conversation": {
|
|
37
37
|
"type": "string",
|
|
38
38
|
"mutable": false,
|
|
39
39
|
"complexType": {
|
|
@@ -50,7 +50,7 @@ export class AiConversationSummary {
|
|
|
50
50
|
"getter": false,
|
|
51
51
|
"setter": false,
|
|
52
52
|
"reflect": false,
|
|
53
|
-
"attribute": "
|
|
53
|
+
"attribute": "conversation",
|
|
54
54
|
"defaultValue": "'\u0645\u0644\u062E\u0635 \u0627\u0644\u0645\u062D\u0627\u062F\u062B\u0629'"
|
|
55
55
|
},
|
|
56
56
|
"summary": {
|
|
@@ -18,7 +18,7 @@ export class AiLink {
|
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
20
|
const rel = this.rel || (this.target === '_blank' ? 'noopener noreferrer' : undefined);
|
|
21
|
-
return (h(Host, { key: '
|
|
21
|
+
return (h(Host, { key: 'fbcd3760a7715aafa99b695597570de03c627014' }, h("span", { key: '8583d3c2576ea89dd95ffe57dc3a6c25afa6c9c1', class: "link__label" }, this.label, h("slot", { key: '272e44ad77cc4534b50e3ccdc34aac3fe43dcf02' })), h("a", { key: 'f5527c895f5d309c67da2a3b81accd9b2a263212', class: "link", href: this.href, target: this.target, rel: rel }, this.renderShareIcon())));
|
|
22
22
|
}
|
|
23
23
|
static get is() { return "ai-link"; }
|
|
24
24
|
static get encapsulation() { return "shadow"; }
|
|
@@ -31,7 +31,7 @@ export class AiRouteDecision {
|
|
|
31
31
|
this.routeExpand.emit(this._expanded);
|
|
32
32
|
}
|
|
33
33
|
render() {
|
|
34
|
-
return (h(Host, { key: '
|
|
34
|
+
return (h(Host, { key: '0dd7087ca8ffd500789fadbb6f33eeeac254348d' }, h("div", { key: '24b40d8747448030454300dcdceafc197232fd19', class: `route-pill ${this._expanded ? 'expanded' : ''}` }, h("button", { key: 'a5eabc6ac356b6f0bd4cce34257420b003f28ede', class: "route-pill-main", onClick: () => this.handleToggle() }, h("span", { key: '27e858ed0b66a7edaa2966ea626bd6fe849c04f4', class: "route-icon" }, this.renderIcon('route', 14, 14)), h("span", { key: '140bf4bcdb42501e446c0805a5011d652b3581e3', class: "agent-label" }, this.agentIcon && h("span", { key: 'ded6e4a619e7c4ae9d0affaf57b4e68d9ba8f2ea', class: "agent-emoji", "aria-hidden": "true" }, this.agentIcon), this.selectedAgent), this.confidence > 0 && (h("span", { key: 'd9f59152d831eb001c01ddffdba52b683b706671', class: "confidence-badge" }, this.confidence, "%")), h("span", { key: '4c290789b2bc8e3eace308bc81d9dad61b44d095', class: `expand-icon ${this._expanded ? 'expanded' : ''}` }, this.renderIcon('arrow-right', 12, 12))), this._expanded && (h("div", { key: 'e87b890275e49320579cc20e9a9a9c6cbb5f7522', class: "route-details" }, this.reason && h("p", { key: '47178ce7ea2d73a9699099185afa0d2002db3b96', class: "reason-text" }, this.reason), this.confidence > 0 && (h("div", { key: 'ad0fa3ba59e968e07bbc467eab1f5a9bba632f34', class: "confidence-bar-wrap" }, h("div", { key: '5c38961fb4b4b68b663cfaf1fddc0d6e35c880f8', class: "confidence-bar", style: { width: `${this.confidence}%` } }))), this.detectedLanguage && (h("div", { key: 'a33864e670395af9a1545d590cff0142094bca7d', class: "meta-row" }, this.renderIcon('list', 12, 12), h("span", { key: '2685871e51bf706709d8ff06beed9f7cb2f414ba', class: "lang-chip" }, this.detectedLanguage))))))));
|
|
35
35
|
}
|
|
36
36
|
static get is() { return "ai-route-decision"; }
|
|
37
37
|
static get encapsulation() { return "shadow"; }
|
|
@@ -11,10 +11,10 @@ export class AiSuggestion {
|
|
|
11
11
|
this.suggestionClick.emit(this.label);
|
|
12
12
|
}
|
|
13
13
|
render() {
|
|
14
|
-
return (h(Host, { key: '
|
|
14
|
+
return (h(Host, { key: '6fe8c72e8cb7f039ec86c6e8cecf2f683fa1a815' }, h("button", { key: '8c452cabba9714ef32a6dbd333bd3fe5ee6eabfe', class: {
|
|
15
15
|
chip: true,
|
|
16
16
|
'chip--disabled': this.disabled,
|
|
17
|
-
}, disabled: this.disabled, onClick: () => this.handleClick() }, h("span", { key: '
|
|
17
|
+
}, disabled: this.disabled, onClick: () => this.handleClick() }, h("span", { key: '93b9d1089133e7e03939173cb739ae069c4af022', class: "chip__label" }, this.label, h("slot", { key: 'f9d093ee7f63b578060557e4288d7c91827a2d1e' })))));
|
|
18
18
|
}
|
|
19
19
|
static get is() { return "ai-suggestion"; }
|
|
20
20
|
static get encapsulation() { return "shadow"; }
|
|
@@ -188,21 +188,15 @@ export class VoiceInput {
|
|
|
188
188
|
const ctx = canvas.getContext('2d');
|
|
189
189
|
if (!ctx)
|
|
190
190
|
return;
|
|
191
|
-
const barCount = 100;
|
|
192
191
|
const barWidth = 1;
|
|
193
192
|
const gap = 2;
|
|
193
|
+
const minHeight = 4;
|
|
194
194
|
const bufferLength = this.analyserRef.frequencyBinCount;
|
|
195
195
|
const dataArray = new Uint8Array(bufferLength);
|
|
196
|
-
const binsPerBar = Math.max(1, Math.floor(bufferLength / barCount));
|
|
197
|
-
const minHeight = 4;
|
|
198
196
|
// Resolve waveform color from prop → CSS var → fallback
|
|
199
197
|
const resolvedColor = this.waveformColor ||
|
|
200
198
|
getComputedStyle(this.el).getPropertyValue('--ai-waveform-color').trim() ||
|
|
201
199
|
'#9ca3af';
|
|
202
|
-
// Initialize lerp state
|
|
203
|
-
if (this.prevHeights.length !== barCount) {
|
|
204
|
-
this.prevHeights = new Array(barCount).fill(minHeight);
|
|
205
|
-
}
|
|
206
200
|
const drawRoundRect = (x, y, w, h, r) => {
|
|
207
201
|
ctx.beginPath();
|
|
208
202
|
if (typeof ctx.roundRect === 'function') {
|
|
@@ -227,6 +221,18 @@ export class VoiceInput {
|
|
|
227
221
|
if (this.state !== 'recording')
|
|
228
222
|
return;
|
|
229
223
|
this.animationFrameId = requestAnimationFrame(draw);
|
|
224
|
+
// Sync canvas buffer to actual rendered size so it never overflows
|
|
225
|
+
const renderedWidth = canvas.offsetWidth;
|
|
226
|
+
if (renderedWidth > 0 && canvas.width !== renderedWidth) {
|
|
227
|
+
canvas.width = renderedWidth;
|
|
228
|
+
}
|
|
229
|
+
// Recompute barCount each frame based on actual canvas width
|
|
230
|
+
const barCount = Math.min(100, Math.floor(canvas.width / (barWidth + gap)));
|
|
231
|
+
const binsPerBar = Math.max(1, Math.floor(bufferLength / barCount));
|
|
232
|
+
// Re-initialize lerp state when barCount changes
|
|
233
|
+
if (this.prevHeights.length !== barCount) {
|
|
234
|
+
this.prevHeights = new Array(barCount).fill(minHeight);
|
|
235
|
+
}
|
|
230
236
|
this.analyserRef.getByteFrequencyData(dataArray);
|
|
231
237
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
232
238
|
const centerY = canvas.height / 2;
|
|
@@ -263,7 +269,7 @@ export class VoiceInput {
|
|
|
263
269
|
};
|
|
264
270
|
render() {
|
|
265
271
|
const remaining = MAX_RECORDING_TIME - this.recordingDuration;
|
|
266
|
-
return (h(Host, { key: '
|
|
272
|
+
return (h(Host, { key: '8af076ad1ec6bf3ed6a09bb06e03baab91e1bed4' }, h("div", { key: 'f0ccb0576accd8f6ab47db2b06dd426ab7606c02', class: "wrapper" }, h("div", { key: 'c95052b95e0f859c406bdeb0991b87cb25b68f9f', class: `glow${this.state === 'recording' ? ' visible' : ''}`, "aria-hidden": "true" }), h("div", { key: '56ab65197d34e2f39c1b73a407561c65f40996f6', class: "input-container" }, this.state === 'idle' ? (h("div", { class: "recording-row" }, h("button", { type: "button", class: "submit-button", onClick: this.startRecording, disabled: this.disabled, "aria-label": "Start recording" }, h("ai-icon", { name: "mic", size: 16 })), this.error && (h("div", { class: "error-message", role: "alert" }, this.error)))) : (h("div", { class: "recording-row" }, h("button", { type: "button", class: "cancel-button", onClick: this.cancelRecording, "aria-label": "Cancel" }, h("ai-icon", { name: "cancel", size: 14 })), h("div", { class: `timer${remaining <= 5 ? ' warning' : ''}` }, this.formatDuration(this.recordingDuration)), this.showWaveform && h("canvas", { ref: el => (this.canvasRef = el), class: "waveform", height: "32" }), h("button", { type: "button", class: `submit-button${this.submitPulse ? ' pulse' : ''}`, onClick: this.stopRecording, "aria-label": "Send" }, h("ai-icon", { name: "arrow-up", size: 14 }))))))));
|
|
267
273
|
}
|
|
268
274
|
static get is() { return "ai-voice-input"; }
|
|
269
275
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface AiAgentError extends Components.AiAgentError, HTMLElement {}
|
|
4
|
+
export const AiAgentError: {
|
|
5
|
+
prototype: AiAgentError;
|
|
6
|
+
new (): AiAgentError;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,t as r,H as a,c as i,h as s,d as t}from"./p-CAnlgwx0.js";import{i as o}from"./p-SJZ6Ujn9.js";const d=e(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.retryClick=i(this,"retryClick"),this.dismissClick=i(this,"dismissClick")}headline="حدث خطأ أثناء التنفيذ";message="";errorCode="";retryable=!0;retryLabel="إعادة المحاولة";dismissible=!1;retryClick;dismissClick;renderIcon(e,r,a){const i=o[e];return i?s("span",{class:"icon-wrap",innerHTML:`<svg width="${r}" height="${a}" viewBox="${i.viewBox}" fill="none" xmlns="http://www.w3.org/2000/svg">${i.content}</svg>`}):null}render(){return s(t,{key:"938a7d7ea8f1af9c4523eaf2a4944c4d1d7fb6a2"},s("div",{key:"ad4f04819ac44e4541405674c903f5e2a2ec5e6e",class:"error-card"},s("div",{key:"be863a0a24342ab7c8704e3a9ee0ad2b44633c4d",class:"error-body"},s("div",{key:"0572130fca12b6d341f0e727a5f7f72f281d5cf7",class:"error-icon-wrap"},this.renderIcon("warning",20,20)),s("div",{key:"53bbccb1da858d0f85c50609c2d6ab79d8bdd3cf",class:"error-content"},s("div",{key:"76bbe45588ea39a29f72c4267881d39cc1767ad0",class:"error-headline-row"},s("span",{key:"077fe71637fe1621b5ee532e8634657ff1b5f1ac",class:"error-headline"},this.headline),this.errorCode&&s("span",{key:"45307d3a8f43c3d17daa44e0df7dc7643a9af7da",class:"error-code-badge"},this.errorCode)),this.message&&s("p",{key:"6848d16db67c2ced84785e7762b79a1fac9a4d14",class:"error-message"},this.message)),this.dismissible&&s("button",{key:"c06661ef9c19dbcb9cb6620c9bec69e2a6a35205",class:"dismiss-btn","aria-label":"إغلاق",onClick:()=>this.dismissClick.emit()},this.renderIcon("cancel",16,16))),this.retryable&&s("div",{key:"3b1ed90ee58f872a22f790abd0e5c9acd1480a36",class:"error-footer"},s("button",{key:"d50096dd81d9098c827f564f5c6e120dafe56dac",class:"retry-btn",onClick:()=>this.retryClick.emit()},this.renderIcon("reload",16,16),s("span",{key:"0ef79b60c4de040f57dfd6c7c71fd1d1863baa33"},this.retryLabel)))))}static get style(){return":host{display:block}.icon-wrap{display:inline-flex;align-items:center;justify-content:center;line-height:0}@keyframes fade-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.error-card{background:var(--ai-danger-bg);border:1px solid var(--ai-danger-border);border-radius:16px;box-shadow:var(--ai-shadow-error);overflow:hidden;animation:fade-in 0.3s ease}.error-body{display:flex;align-items:flex-start;gap:12px;padding:16px}.error-icon-wrap{width:36px;height:36px;border-radius:9999px;background:var(--ai-bg-card);border:1px solid var(--ai-danger-border);display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--ai-danger-text)}.error-content{flex:1;display:flex;flex-direction:column;gap:6px;min-width:0}.error-headline-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.error-headline{font-size:14px;font-weight:600;color:var(--ai-danger-text);line-height:1.4}.error-code-badge{font-size:11px;font-weight:500;color:var(--ai-danger-text);background:var(--ai-bg-card);border:1px solid var(--ai-danger-border);padding:1px 7px;border-radius:9999px;white-space:nowrap;flex-shrink:0;opacity:0.85}.error-message{margin:0;font-size:13px;font-weight:400;color:var(--ai-text-secondary);line-height:1.5}.dismiss-btn{display:inline-flex;align-items:center;justify-content:center;background:none;border:none;padding:4px;cursor:pointer;color:var(--ai-danger-text);opacity:0.6;flex-shrink:0;border-radius:6px;transition:opacity 0.15s ease, background 0.15s ease}.dismiss-btn:hover{opacity:1;background:var(--ai-hover-overlay)}.error-footer{padding:0 16px 14px}.retry-btn{display:inline-flex;align-items:center;gap:6px;background:var(--ai-bg-card);border:1px solid var(--ai-danger-border);border-radius:9999px;padding:6px 14px;font-size:13px;font-weight:500;color:var(--ai-danger-text);cursor:pointer;transition:box-shadow 0.15s ease, opacity 0.15s ease;font-family:inherit}.retry-btn:hover{box-shadow:var(--ai-shadow-active);opacity:0.9}.retry-btn:active{opacity:0.75}"}},[513,"ai-agent-error",{headline:[1],message:[1],errorCode:[1,"error-code"],retryable:[4],retryLabel:[1,"retry-label"],dismissible:[4]}]),n=d,c=function(){"undefined"!=typeof customElements&&["ai-agent-error"].forEach((e=>{"ai-agent-error"===e&&(customElements.get(r(e))||customElements.define(r(e),d))}))};export{n as AiAgentError,c as defineCustomElement}
|