@grasco/profile-picture 0.1.7 → 0.1.8
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/angular.cjs +1012 -1
- package/dist/angular.cjs.map +1 -1
- package/dist/angular.d.cts +71 -81
- package/dist/angular.d.ts +71 -81
- package/dist/angular.js +1012 -1
- package/dist/angular.js.map +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -81
- package/dist/index.d.ts +12 -81
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +1013 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.cts +407 -0
- package/dist/react.d.ts +407 -0
- package/dist/react.js +1013 -0
- package/dist/react.js.map +1 -0
- package/dist/standalone.d.ts +3 -3
- package/dist/standalone.standalone.js.map +1 -1
- package/dist/svelte.cjs +1012 -1
- package/dist/svelte.cjs.map +1 -1
- package/dist/svelte.d.cts +67 -81
- package/dist/svelte.d.ts +67 -81
- package/dist/svelte.js +1012 -1
- package/dist/svelte.js.map +1 -1
- package/dist/vue.cjs +1012 -1
- package/dist/vue.cjs.map +1 -1
- package/dist/vue.d.cts +83 -81
- package/dist/vue.d.ts +83 -81
- package/dist/vue.js +1012 -1
- package/dist/vue.js.map +1 -1
- package/package.json +11 -1
package/dist/angular.cjs
CHANGED
|
@@ -1,2 +1,1013 @@
|
|
|
1
|
-
'use strict';var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;var r="grasco-profile-picture-styles",
|
|
1
|
+
'use strict';var lit=require('lit'),decorators_js=require('lit/decorators.js'),styleMap_js=require('lit/directives/style-map.js');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;var wt=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var s=(r,n,t,e)=>{for(var o=e>1?void 0:e?vt(n,t):n,i=r.length-1,p;i>=0;i--)(p=r[i])&&(o=(e?p(n,t,o):p(o))||o);return e&&o&&wt(n,t,o),o};var G="grasco-profile-picture-styles",T=false,J=false;function K(){if(T||typeof document>"u")return;if(document.getElementById(G)){T=true;return}if(document.querySelector('link[href*="profile-picture"][href$="styles.css"]')){T=true;return}J||(J=true,yt());}function yt(){(typeof requestIdleCallback<"u"?requestIdleCallback:n=>setTimeout(n,1))(()=>Ct());}function Ct(){if(T||typeof document>"u")return;if(document.getElementById(G)){T=true;return}let r=St();if(!r)return;let n=document.createElement("link");n.id=G,n.rel="stylesheet",n.href=r,document.head.appendChild(n),T=true;}function St(){if(typeof window<"u"&&window.__GRASCO_PROFILE_PICTURE_CSS__)return window.__GRASCO_PROFILE_PICTURE_CSS__;try{let n=(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('angular.cjs', document.baseURI).href));if(n)return `${n.substring(0,n.lastIndexOf("/")+1)}dist/styles.css`}catch{}let r=document.currentScript;if(r?.src){let n=new URL(r.src);return `${n.href.substring(0,n.href.lastIndexOf("/")+1)}dist/styles.css`}return null}var E={"2xs":20,xs:24,sm:32,md:40,lg:48,xl:64,"2xl":80,"3xl":120},X={online:"#30D158",away:"#FFD60A",busy:"#FF453A",offline:"#8E8E93",dnd:"#FF453A"},Z={none:"none",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",glow:"0 0 20px 0 rgba(99, 102, 241, 0.3)"},v={size:"md",variant:"circle",loading:"lazy",placeholder:"shimmer",borderWidth:2,borderColor:"#ffffff",placeholderColor:"#f3f4f6",shadow:"sm"};var A={circle:"9999px",rounded:"12px",squircle:"30%",square:"0px"},y={max:4,direction:"ltr",overlap:.3,size:"md",tooltipDelay:300,dropdownMaxHeight:280,animated:true};function k(...r){return r.filter(Boolean).join(" ")}function N(r){return /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(r)}function B(r){let t=r.trim().replace(/[^\w\s]/g,"").split(/\s+/).filter(Boolean);return t.length===0?"?":t.length===1?t[0].slice(0,1).toUpperCase():(t[0][0]+(t.at(-1)?.[0]??"")).toUpperCase()}function j(r){return Math.round(r*.38)}function Q(r,n){let t;if(n){let o=Math.round(r*.31);t=Math.min(24,Math.max(14,o));}else {let o=Math.round(r*.22);t=Math.min(14,Math.max(8,o));}let e=Math.max(9,Math.round(t*.55));return {size:t,fontSize:e}}function _(r,n){let t=Math.min(16,Math.max(8,Math.round(r*.2)));return Math.min(18,t+(n-1)*2)}function P(r,n){return typeof r=="string"?r:n&&r>n?`${n}+`:r.toString()}function tt(r){return r.length===0?"transparent":r.length===1?r[0]:`conic-gradient(${r.map((t,e)=>{let o=e/r.length*360,i=(e+1)/r.length*360;return `${t} ${o}deg ${i}deg`}).join(", ")})`}function kt(r){let n=0;for(let t=0;t<r.length;t++){let e=r.charCodeAt(t);n=(n<<5)-n+e,n&=n;}return Math.abs(n)}function et(r,n,t){let o=Math.max(0,Math.min(100,r))/100*360;return `conic-gradient(from 270deg, ${n} 0deg ${o}deg, ${t} ${o}deg 360deg)`}function M(r){let n=["linear-gradient(135deg, #667eea 0%, #764ba2 100%)","linear-gradient(135deg, #f093fb 0%, #f5576c 100%)","linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)","linear-gradient(135deg, #43e97b 0%, #38f9d7 100%)","linear-gradient(135deg, #fa709a 0%, #fee140 100%)","linear-gradient(135deg, #a8edea 0%, #fed6e3 100%)","linear-gradient(135deg, #d299c2 0%, #fef9d7 100%)","linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%)","linear-gradient(135deg, #cd9cf2 0%, #f6f3ff 100%)","linear-gradient(135deg, #fddb92 0%, #d1fdff 100%)"],t=kt(r)%n.length;return n[t]}function rt(r){return typeof r=="number"?r:E[r]??E[y.size]}function H(r,n,t){let e=t?n-1:n;if(r<=e)return {visible:r,hidden:0,showCounter:false};let o=e-1,i=r-o;return {visible:o,hidden:i,showCounter:true}}function U(r,n,t,e,o){let i=o??n*(1-t);return r*i}function nt(r,n,t){return t==="ltr"?n-r:r+1}function ot(r,n,t,e){if(r===0)return 0;if(r===1)return n;let o=e??n*(1-t);return n+o*(r-1)}function it(r){return r>99?"+99":`+${r}`}function at(r){return r<=80?"80":r<=120?"120":r<=240?"240":r<=480?"480":"960"}function st(r){if(!(r&&N(r)))return "light";let n=r.replace("#","");n.length===3&&(n=n.split("").map(p=>p+p).join(""));let t=Number.parseInt(n.slice(0,2),16),e=Number.parseInt(n.slice(2,4),16),o=Number.parseInt(n.slice(4,6),16);return (.299*t+.587*e+.114*o)/255>.5?"light":"dark"}function pt(r,n,t,e,o){let i=r.endsWith("/")?r.slice(0,-1):r,p=`${n}_${t}_${e}.webp`;return `${i}/api/profile-picture/cdn/${p}?hostname=${o}`}function dt(r){return {circle:"np:rounded-full",rounded:"np:rounded-xl",squircle:"np:rounded-[30%]",square:"np:rounded-none"}[r]}function lt(r,n){return {className:{1:"np:border",2:"np:border-2",3:"np:border-[3px]",4:"np:border-4",5:"np:border-[5px]",6:"np:border-[6px]",8:"np:border-8"}[r],style:{borderColor:n,borderStyle:"solid"}}}function ct(r,n){return n?{className:"",style:{background:n}}:r?r.includes("gradient")?{className:"",style:{background:r}}:{className:"",style:{backgroundColor:r}}:{className:"",style:{backgroundColor:"#e7e7e7"}}}function gt(r){return {boxShadow:Z[r]}}var $t={shimmer:`
|
|
2
|
+
@keyframes pp-shimmer {
|
|
3
|
+
0% { transform: translateX(-100%); }
|
|
4
|
+
100% { transform: translateX(100%); }
|
|
5
|
+
}`,pulse:`
|
|
6
|
+
@keyframes pp-pulse {
|
|
7
|
+
0%, 100% { opacity: 1; transform: scale(1); }
|
|
8
|
+
50% { opacity: 0.7; transform: scale(0.98); }
|
|
9
|
+
}`,skeleton:`
|
|
10
|
+
@keyframes pp-skeleton {
|
|
11
|
+
0%, 100% { opacity: 1; }
|
|
12
|
+
50% { opacity: 0.5; }
|
|
13
|
+
}`,badgeBounce:`
|
|
14
|
+
@keyframes pp-badge-bounce {
|
|
15
|
+
0% { transform: scale(0) translateY(10px); opacity: 0; }
|
|
16
|
+
50% { transform: scale(1.2) translateY(-2px); }
|
|
17
|
+
100% { transform: scale(1) translateY(0); opacity: 1; }
|
|
18
|
+
}`,ringRotate:`
|
|
19
|
+
@keyframes pp-ring-rotate {
|
|
20
|
+
from { transform: rotate(0deg); }
|
|
21
|
+
to { transform: rotate(360deg); }
|
|
22
|
+
}`,presencePulse:`
|
|
23
|
+
@keyframes pp-presence-pulse {
|
|
24
|
+
0%, 100% { box-shadow: 0 0 0 0 currentColor; }
|
|
25
|
+
50% { box-shadow: 0 0 0 4px transparent; }
|
|
26
|
+
}`,glow:`
|
|
27
|
+
@keyframes pp-glow {
|
|
28
|
+
0%, 100% { box-shadow: 0 0 20px 0 var(--pp-glow-color, rgba(99, 102, 241, 0.3)); }
|
|
29
|
+
50% { box-shadow: 0 0 30px 5px var(--pp-glow-color, rgba(99, 102, 241, 0.5)); }
|
|
30
|
+
}`,fadeIn:`
|
|
31
|
+
@keyframes pp-fade-in {
|
|
32
|
+
from { opacity: 0; }
|
|
33
|
+
to { opacity: 1; }
|
|
34
|
+
}`,scaleIn:`
|
|
35
|
+
@keyframes pp-scale-in {
|
|
36
|
+
0% { transform: scale(0.8); opacity: 0; }
|
|
37
|
+
50% { transform: scale(1.05); }
|
|
38
|
+
100% { transform: scale(1); opacity: 1; }
|
|
39
|
+
}`},It=Object.values($t).join(`
|
|
40
|
+
`),zt=`
|
|
41
|
+
/* Profile Picture Component Styles */
|
|
42
|
+
.pp-container {
|
|
43
|
+
--pp-transition-duration: 200ms;
|
|
44
|
+
--pp-transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
|
|
45
|
+
--pp-spring-timing: cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
46
|
+
position: relative;
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
user-select: none;
|
|
51
|
+
-webkit-user-select: none;
|
|
52
|
+
flex-shrink: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Inner container for image clipping - allows badges/rings to overflow */
|
|
56
|
+
.pp-inner {
|
|
57
|
+
position: absolute;
|
|
58
|
+
inset: 0;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
border-radius: inherit;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* Interactive states */
|
|
64
|
+
.pp-interactive {
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
transition: transform var(--pp-transition-duration) var(--pp-spring-timing),
|
|
67
|
+
box-shadow var(--pp-transition-duration) var(--pp-transition-timing);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.pp-interactive:hover {
|
|
71
|
+
transform: scale(1.05);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.pp-interactive:active {
|
|
75
|
+
transform: scale(0.95);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.pp-interactive:focus-visible {
|
|
79
|
+
outline: none;
|
|
80
|
+
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.5);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* Image styles */
|
|
84
|
+
.pp-image {
|
|
85
|
+
position: absolute;
|
|
86
|
+
inset: 0;
|
|
87
|
+
width: 100%;
|
|
88
|
+
height: 100%;
|
|
89
|
+
object-fit: cover;
|
|
90
|
+
transition: opacity var(--pp-transition-duration) var(--pp-transition-timing);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.pp-image-loading {
|
|
94
|
+
opacity: 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.pp-image-loaded {
|
|
98
|
+
opacity: 1;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Fallback styles */
|
|
102
|
+
.pp-fallback {
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
width: 100%;
|
|
107
|
+
height: 100%;
|
|
108
|
+
font-weight: 500;
|
|
109
|
+
color: rgba(255, 255, 255, 0.9);
|
|
110
|
+
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
111
|
+
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
|
|
112
|
+
letter-spacing: 0.02em;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.pp-fallback-icon {
|
|
116
|
+
color: rgba(156, 163, 175, 0.8);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* Shimmer placeholder */
|
|
120
|
+
.pp-shimmer {
|
|
121
|
+
position: absolute;
|
|
122
|
+
inset: 0;
|
|
123
|
+
overflow: hidden;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.pp-shimmer::after {
|
|
127
|
+
content: '';
|
|
128
|
+
position: absolute;
|
|
129
|
+
inset: 0;
|
|
130
|
+
background: linear-gradient(
|
|
131
|
+
90deg,
|
|
132
|
+
transparent 0%,
|
|
133
|
+
rgba(255, 255, 255, 0.4) 50%,
|
|
134
|
+
transparent 100%
|
|
135
|
+
);
|
|
136
|
+
animation: pp-shimmer 1.5s infinite;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* Pulse placeholder */
|
|
140
|
+
.pp-pulse {
|
|
141
|
+
animation: pp-pulse 2s ease-in-out infinite;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Skeleton placeholder */
|
|
145
|
+
.pp-skeleton {
|
|
146
|
+
background: linear-gradient(90deg, #e5e7eb 0%, #f3f4f6 50%, #e5e7eb 100%);
|
|
147
|
+
background-size: 200% 100%;
|
|
148
|
+
animation: pp-skeleton 1.5s ease-in-out infinite;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* Badge styles */
|
|
152
|
+
.pp-badge {
|
|
153
|
+
position: absolute;
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
justify-content: center;
|
|
157
|
+
font-weight: 600;
|
|
158
|
+
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
|
|
159
|
+
line-height: 1;
|
|
160
|
+
animation: pp-badge-bounce 0.4s var(--pp-spring-timing);
|
|
161
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.pp-badge-with-icon {
|
|
165
|
+
gap: 4px;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.pp-badge-icon {
|
|
169
|
+
display: inline-flex;
|
|
170
|
+
align-items: center;
|
|
171
|
+
justify-content: center;
|
|
172
|
+
line-height: 1;
|
|
173
|
+
flex-shrink: 0;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.pp-badge-pulse {
|
|
177
|
+
animation: pp-badge-bounce 0.4s var(--pp-spring-timing),
|
|
178
|
+
pp-presence-pulse 2s ease-in-out infinite 0.4s;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.pp-badge-glow {
|
|
182
|
+
box-shadow: 0 0 10px 2px var(--pp-badge-glow-color, currentColor);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* Ring effect (Instagram-style) */
|
|
186
|
+
.pp-ring {
|
|
187
|
+
position: absolute;
|
|
188
|
+
inset: -4px;
|
|
189
|
+
border-radius: inherit;
|
|
190
|
+
padding: 3px;
|
|
191
|
+
background: var(--pp-ring-color, linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888));
|
|
192
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
193
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
194
|
+
-webkit-mask-composite: xor;
|
|
195
|
+
mask-composite: exclude;
|
|
196
|
+
transition: background 0.3s ease;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.pp-ring-animated {
|
|
200
|
+
animation: pp-ring-rotate 3s linear infinite;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.pp-ring-progress {
|
|
204
|
+
/* Progress rings should not animate rotation */
|
|
205
|
+
animation: none;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/* Presence indicator */
|
|
209
|
+
.pp-presence {
|
|
210
|
+
position: absolute;
|
|
211
|
+
bottom: 0;
|
|
212
|
+
right: 0;
|
|
213
|
+
border-radius: 9999px;
|
|
214
|
+
border: 2px solid white;
|
|
215
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.pp-presence-animated {
|
|
219
|
+
animation: pp-presence-pulse 2s ease-in-out infinite;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/* Glow effect */
|
|
223
|
+
.pp-glow {
|
|
224
|
+
animation: pp-glow 2s ease-in-out infinite;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* Reduced motion support */
|
|
228
|
+
@media (prefers-reduced-motion: reduce) {
|
|
229
|
+
.pp-container,
|
|
230
|
+
.pp-interactive,
|
|
231
|
+
.pp-image,
|
|
232
|
+
.pp-shimmer::after,
|
|
233
|
+
.pp-pulse,
|
|
234
|
+
.pp-skeleton,
|
|
235
|
+
.pp-badge,
|
|
236
|
+
.pp-ring-animated,
|
|
237
|
+
.pp-presence-animated,
|
|
238
|
+
.pp-glow {
|
|
239
|
+
animation: none !important;
|
|
240
|
+
transition: none !important;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
`,ut=`${It}
|
|
244
|
+
${zt}`,ht=`
|
|
245
|
+
@keyframes np-shimmer {
|
|
246
|
+
0% { background-position: -200% 0; }
|
|
247
|
+
100% { background-position: 200% 0; }
|
|
248
|
+
}
|
|
249
|
+
.np-shimmer {
|
|
250
|
+
background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
|
|
251
|
+
background-size: 200% 100%;
|
|
252
|
+
animation: np-shimmer 1.5s infinite;
|
|
253
|
+
}
|
|
254
|
+
`;function ft(r,n=.3){if(N(r)){let t=Number.parseInt(r.slice(1,3),16),e=Number.parseInt(r.slice(3,5),16),o=Number.parseInt(r.slice(5,7),16);return `0 0 20px 0 rgba(${t}, ${e}, ${o}, ${n})`}return `0 0 20px 0 ${r}`}var Tt=`
|
|
255
|
+
@keyframes ppg-tooltip-in {
|
|
256
|
+
from {
|
|
257
|
+
opacity: 0;
|
|
258
|
+
transform: translateX(-50%) translateY(4px) scale(0.96);
|
|
259
|
+
}
|
|
260
|
+
to {
|
|
261
|
+
opacity: 1;
|
|
262
|
+
transform: translateX(-50%) translateY(0) scale(1);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
@keyframes ppg-dropdown-in {
|
|
267
|
+
from {
|
|
268
|
+
opacity: 0;
|
|
269
|
+
transform: translateY(-6px) scale(0.95);
|
|
270
|
+
}
|
|
271
|
+
to {
|
|
272
|
+
opacity: 1;
|
|
273
|
+
transform: translateY(0) scale(1);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
@keyframes ppg-avatar-lift {
|
|
278
|
+
from {
|
|
279
|
+
transform: translateY(0) scale(1);
|
|
280
|
+
}
|
|
281
|
+
to {
|
|
282
|
+
transform: translateY(-4px) scale(1.08);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
@keyframes ppg-modal-in {
|
|
287
|
+
from {
|
|
288
|
+
opacity: 0;
|
|
289
|
+
transform: translate(-50%, -50%) scale(0.9);
|
|
290
|
+
}
|
|
291
|
+
to {
|
|
292
|
+
opacity: 1;
|
|
293
|
+
transform: translate(-50%, -50%) scale(1);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
@keyframes ppg-backdrop-in {
|
|
298
|
+
from {
|
|
299
|
+
opacity: 0;
|
|
300
|
+
}
|
|
301
|
+
to {
|
|
302
|
+
opacity: 1;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
`,Et=`
|
|
306
|
+
/* Profile Picture Group Container */
|
|
307
|
+
.ppg-container {
|
|
308
|
+
--ppg-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
309
|
+
--ppg-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
310
|
+
--ppg-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
311
|
+
--ppg-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
312
|
+
--ppg-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
|
|
313
|
+
--ppg-radius: 12px;
|
|
314
|
+
--ppg-counter-bg: #f5f5f7;
|
|
315
|
+
--ppg-counter-text: #1d1d1f;
|
|
316
|
+
--ppg-add-bg: #f5f5f7;
|
|
317
|
+
--ppg-add-hover: #e8e8ed;
|
|
318
|
+
--ppg-add-icon: #86868b;
|
|
319
|
+
--ppg-border: rgba(0, 0, 0, 0.08);
|
|
320
|
+
--ppg-tooltip-bg: rgba(29, 29, 31, 0.95);
|
|
321
|
+
--ppg-tooltip-text: #ffffff;
|
|
322
|
+
--ppg-dropdown-bg: #ffffff;
|
|
323
|
+
--ppg-dropdown-hover: #f5f5f7;
|
|
324
|
+
|
|
325
|
+
position: relative;
|
|
326
|
+
display: inline-flex;
|
|
327
|
+
align-items: center;
|
|
328
|
+
isolation: isolate;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/* Avatar wrapper for positioning */
|
|
332
|
+
.ppg-avatar-wrapper {
|
|
333
|
+
position: absolute;
|
|
334
|
+
top: 0;
|
|
335
|
+
transition: transform var(--ppg-spring), z-index 0s;
|
|
336
|
+
cursor: pointer;
|
|
337
|
+
border-radius: 9999px;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.ppg-avatar-wrapper:focus-visible {
|
|
341
|
+
outline: none;
|
|
342
|
+
box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.4);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/* Hover lift animation */
|
|
346
|
+
.ppg-animated .ppg-avatar-wrapper:hover {
|
|
347
|
+
z-index: 100 !important;
|
|
348
|
+
animation: ppg-avatar-lift var(--ppg-spring) forwards;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.ppg-avatar-wrapper:hover {
|
|
352
|
+
z-index: 100 !important;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/* Nested profile-picture styling */
|
|
356
|
+
.ppg-avatar-wrapper profile-picture {
|
|
357
|
+
display: block;
|
|
358
|
+
width: 100%;
|
|
359
|
+
height: 100%;
|
|
360
|
+
border-radius: inherit;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/* Counter button */
|
|
364
|
+
.ppg-counter {
|
|
365
|
+
position: absolute;
|
|
366
|
+
top: 0;
|
|
367
|
+
display: flex;
|
|
368
|
+
align-items: center;
|
|
369
|
+
justify-content: center;
|
|
370
|
+
border-radius: 9999px;
|
|
371
|
+
background: var(--ppg-counter-bg);
|
|
372
|
+
color: var(--ppg-counter-text);
|
|
373
|
+
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
|
|
374
|
+
font-weight: 600;
|
|
375
|
+
font-size: 13px;
|
|
376
|
+
letter-spacing: -0.01em;
|
|
377
|
+
cursor: pointer;
|
|
378
|
+
border: none;
|
|
379
|
+
box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.95), var(--ppg-shadow-sm);
|
|
380
|
+
transition: transform var(--ppg-spring), background-color var(--ppg-transition);
|
|
381
|
+
user-select: none;
|
|
382
|
+
-webkit-user-select: none;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.ppg-counter:hover {
|
|
386
|
+
background: #ebebed;
|
|
387
|
+
transform: scale(1.05);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.ppg-counter:active {
|
|
391
|
+
transform: scale(0.98);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.ppg-counter:focus-visible {
|
|
395
|
+
outline: none;
|
|
396
|
+
box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.95), 0 0 0 4px rgba(0, 122, 255, 0.4);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/* Add button */
|
|
400
|
+
.ppg-add-button {
|
|
401
|
+
position: absolute;
|
|
402
|
+
top: 0;
|
|
403
|
+
display: flex;
|
|
404
|
+
align-items: center;
|
|
405
|
+
justify-content: center;
|
|
406
|
+
border-radius: 9999px;
|
|
407
|
+
background: var(--ppg-add-bg);
|
|
408
|
+
border: 2px dashed var(--ppg-border);
|
|
409
|
+
cursor: pointer;
|
|
410
|
+
transition: all var(--ppg-spring);
|
|
411
|
+
box-shadow: var(--ppg-shadow-sm);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.ppg-add-button:hover {
|
|
415
|
+
background: var(--ppg-add-hover);
|
|
416
|
+
border-color: rgba(0, 0, 0, 0.15);
|
|
417
|
+
transform: scale(1.05);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.ppg-add-button:active {
|
|
421
|
+
transform: scale(0.98);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.ppg-add-button:focus-visible {
|
|
425
|
+
outline: none;
|
|
426
|
+
box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.4);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.ppg-add-icon {
|
|
430
|
+
color: var(--ppg-add-icon);
|
|
431
|
+
transition: color var(--ppg-transition);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.ppg-add-button:hover .ppg-add-icon {
|
|
435
|
+
color: #1d1d1f;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
/* Tooltip */
|
|
439
|
+
.ppg-tooltip {
|
|
440
|
+
position: absolute;
|
|
441
|
+
z-index: 9999;
|
|
442
|
+
padding: 6px 12px;
|
|
443
|
+
background: var(--ppg-tooltip-bg);
|
|
444
|
+
color: var(--ppg-tooltip-text);
|
|
445
|
+
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
|
|
446
|
+
font-size: 13px;
|
|
447
|
+
font-weight: 500;
|
|
448
|
+
border-radius: 8px;
|
|
449
|
+
box-shadow: var(--ppg-shadow-lg);
|
|
450
|
+
pointer-events: none;
|
|
451
|
+
white-space: nowrap;
|
|
452
|
+
transform: translateX(-50%);
|
|
453
|
+
animation: ppg-tooltip-in 150ms ease-out forwards;
|
|
454
|
+
backdrop-filter: blur(20px);
|
|
455
|
+
-webkit-backdrop-filter: blur(20px);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.ppg-tooltip::after {
|
|
459
|
+
content: '';
|
|
460
|
+
position: absolute;
|
|
461
|
+
width: 8px;
|
|
462
|
+
height: 8px;
|
|
463
|
+
background: inherit;
|
|
464
|
+
transform: rotate(45deg);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.ppg-tooltip[data-position="top"]::after {
|
|
468
|
+
bottom: -4px;
|
|
469
|
+
left: 50%;
|
|
470
|
+
margin-left: -4px;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.ppg-tooltip[data-position="bottom"]::after {
|
|
474
|
+
top: -4px;
|
|
475
|
+
left: 50%;
|
|
476
|
+
margin-left: -4px;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/* Dropdown */
|
|
480
|
+
.ppg-dropdown {
|
|
481
|
+
position: absolute;
|
|
482
|
+
z-index: 9998;
|
|
483
|
+
right: 0;
|
|
484
|
+
min-width: 220px;
|
|
485
|
+
max-width: 300px;
|
|
486
|
+
background: var(--ppg-dropdown-bg);
|
|
487
|
+
border-radius: 14px;
|
|
488
|
+
box-shadow:
|
|
489
|
+
0 4px 24px rgba(0, 0, 0, 0.12),
|
|
490
|
+
0 1px 4px rgba(0, 0, 0, 0.08),
|
|
491
|
+
0 0 0 1px var(--ppg-border);
|
|
492
|
+
overflow: hidden;
|
|
493
|
+
animation: ppg-dropdown-in 200ms cubic-bezier(0.32, 0.72, 0, 1) forwards;
|
|
494
|
+
transform-origin: top right;
|
|
495
|
+
backdrop-filter: blur(20px);
|
|
496
|
+
-webkit-backdrop-filter: blur(20px);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.ppg-dropdown[data-position="bottom"] {
|
|
500
|
+
top: calc(100% + 10px);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
.ppg-dropdown[data-position="top"] {
|
|
504
|
+
bottom: calc(100% + 10px);
|
|
505
|
+
transform-origin: bottom right;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
/* Modal style for mobile */
|
|
509
|
+
.ppg-dropdown[data-position="modal"] {
|
|
510
|
+
transform-origin: center center;
|
|
511
|
+
animation: ppg-modal-in 250ms cubic-bezier(0.32, 0.72, 0, 1) forwards;
|
|
512
|
+
border-radius: 20px;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
.ppg-backdrop-visible {
|
|
516
|
+
background: rgba(0, 0, 0, 0.4);
|
|
517
|
+
animation: ppg-backdrop-in 200ms ease-out forwards;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
.ppg-dropdown-header {
|
|
521
|
+
padding: 14px 16px 10px;
|
|
522
|
+
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
|
|
523
|
+
font-size: 11px;
|
|
524
|
+
font-weight: 600;
|
|
525
|
+
color: #86868b;
|
|
526
|
+
text-transform: uppercase;
|
|
527
|
+
letter-spacing: 0.06em;
|
|
528
|
+
background: linear-gradient(to bottom, rgba(0,0,0,0.02), transparent);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
.ppg-dropdown-list {
|
|
532
|
+
overflow-y: auto;
|
|
533
|
+
padding: 6px;
|
|
534
|
+
scrollbar-width: thin;
|
|
535
|
+
scrollbar-color: rgba(0,0,0,0.2) transparent;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.ppg-dropdown-list::-webkit-scrollbar {
|
|
539
|
+
width: 6px;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
.ppg-dropdown-list::-webkit-scrollbar-track {
|
|
543
|
+
background: transparent;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
.ppg-dropdown-list::-webkit-scrollbar-thumb {
|
|
547
|
+
background: rgba(0,0,0,0.15);
|
|
548
|
+
border-radius: 3px;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
.ppg-dropdown-item {
|
|
552
|
+
display: flex;
|
|
553
|
+
align-items: center;
|
|
554
|
+
gap: 12px;
|
|
555
|
+
padding: 10px 12px;
|
|
556
|
+
cursor: pointer;
|
|
557
|
+
border-radius: 10px;
|
|
558
|
+
transition: all 150ms ease;
|
|
559
|
+
margin: 2px 0;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
.ppg-dropdown-item:hover {
|
|
563
|
+
background: var(--ppg-dropdown-hover);
|
|
564
|
+
transform: translateX(2px);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
.ppg-dropdown-item:focus-visible {
|
|
568
|
+
outline: none;
|
|
569
|
+
background: var(--ppg-dropdown-hover);
|
|
570
|
+
box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
.ppg-dropdown-item:active {
|
|
574
|
+
transform: scale(0.98);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.ppg-dropdown-avatar {
|
|
578
|
+
flex-shrink: 0;
|
|
579
|
+
width: 36px;
|
|
580
|
+
height: 36px;
|
|
581
|
+
border-radius: 9999px;
|
|
582
|
+
object-fit: cover;
|
|
583
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
584
|
+
border: 2px solid rgba(255, 255, 255, 0.8);
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
.ppg-dropdown-avatar-fallback {
|
|
588
|
+
flex-shrink: 0;
|
|
589
|
+
width: 36px;
|
|
590
|
+
height: 36px;
|
|
591
|
+
border-radius: 9999px;
|
|
592
|
+
display: flex;
|
|
593
|
+
align-items: center;
|
|
594
|
+
justify-content: center;
|
|
595
|
+
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
|
|
596
|
+
font-size: 13px;
|
|
597
|
+
font-weight: 600;
|
|
598
|
+
color: white;
|
|
599
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
600
|
+
border: 2px solid rgba(255, 255, 255, 0.3);
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
.ppg-dropdown-info {
|
|
604
|
+
flex: 1;
|
|
605
|
+
min-width: 0;
|
|
606
|
+
padding-right: 4px;
|
|
607
|
+
text-align: left;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
.ppg-dropdown-name {
|
|
611
|
+
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
|
|
612
|
+
font-size: 14px;
|
|
613
|
+
font-weight: 500;
|
|
614
|
+
color: #1d1d1f;
|
|
615
|
+
white-space: nowrap;
|
|
616
|
+
overflow: hidden;
|
|
617
|
+
text-overflow: ellipsis;
|
|
618
|
+
line-height: 1.3;
|
|
619
|
+
text-align: left;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
.ppg-dropdown-status {
|
|
623
|
+
display: flex;
|
|
624
|
+
align-items: center;
|
|
625
|
+
gap: 5px;
|
|
626
|
+
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
|
|
627
|
+
font-size: 12px;
|
|
628
|
+
color: #86868b;
|
|
629
|
+
margin-top: 2px;
|
|
630
|
+
line-height: 1.2;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
.ppg-dropdown-presence {
|
|
634
|
+
width: 7px;
|
|
635
|
+
height: 7px;
|
|
636
|
+
border-radius: 9999px;
|
|
637
|
+
flex-shrink: 0;
|
|
638
|
+
box-shadow: 0 0 0 1.5px var(--ppg-dropdown-bg);
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
.ppg-dropdown-presence[data-status="online"] {
|
|
642
|
+
background: #30D158;
|
|
643
|
+
box-shadow: 0 0 0 1.5px var(--ppg-dropdown-bg), 0 0 6px rgba(48, 209, 88, 0.5);
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
.ppg-dropdown-presence[data-status="away"] {
|
|
647
|
+
background: #FFD60A;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
.ppg-dropdown-presence[data-status="busy"],
|
|
651
|
+
.ppg-dropdown-presence[data-status="dnd"] {
|
|
652
|
+
background: #FF453A;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
.ppg-dropdown-presence[data-status="offline"] {
|
|
656
|
+
background: #8E8E93;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/* Backdrop for dropdown */
|
|
660
|
+
.ppg-backdrop {
|
|
661
|
+
position: fixed;
|
|
662
|
+
inset: 0;
|
|
663
|
+
z-index: 9997;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
/* Reduced motion */
|
|
667
|
+
@media (prefers-reduced-motion: reduce) {
|
|
668
|
+
.ppg-container,
|
|
669
|
+
.ppg-avatar-wrapper,
|
|
670
|
+
.ppg-counter,
|
|
671
|
+
.ppg-add-button,
|
|
672
|
+
.ppg-tooltip,
|
|
673
|
+
.ppg-dropdown {
|
|
674
|
+
animation: none !important;
|
|
675
|
+
transition: none !important;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
.ppg-animated .ppg-avatar-wrapper:hover {
|
|
679
|
+
animation: none !important;
|
|
680
|
+
transform: none !important;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
/* Dark mode support */
|
|
685
|
+
@media (prefers-color-scheme: dark) {
|
|
686
|
+
.ppg-container {
|
|
687
|
+
--ppg-counter-bg: #2c2c2e;
|
|
688
|
+
--ppg-counter-text: #ffffff;
|
|
689
|
+
--ppg-add-bg: #2c2c2e;
|
|
690
|
+
--ppg-add-hover: #3a3a3c;
|
|
691
|
+
--ppg-add-icon: #98989d;
|
|
692
|
+
--ppg-border: rgba(255, 255, 255, 0.1);
|
|
693
|
+
--ppg-dropdown-bg: #2c2c2e;
|
|
694
|
+
--ppg-dropdown-hover: #3a3a3c;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
.ppg-avatar-wrapper profile-picture {
|
|
698
|
+
box-shadow: 0 0 6px 1.5px rgb(28 28 30 / 16%), var(--ppg-shadow-sm);
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
.ppg-counter {
|
|
702
|
+
box-shadow: 0 0 0 1.5px rgba(28, 28, 30, 0.95), var(--ppg-shadow-sm);
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
.ppg-counter:hover {
|
|
706
|
+
background: #3a3a3c;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
.ppg-dropdown {
|
|
710
|
+
background: rgba(44, 44, 46, 0.95);
|
|
711
|
+
box-shadow:
|
|
712
|
+
0 4px 24px rgba(0, 0, 0, 0.4),
|
|
713
|
+
0 1px 4px rgba(0, 0, 0, 0.2),
|
|
714
|
+
0 0 0 1px rgba(255, 255, 255, 0.08);
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
.ppg-dropdown-name {
|
|
718
|
+
color: #ffffff;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
.ppg-dropdown-header {
|
|
722
|
+
color: #98989d;
|
|
723
|
+
background: linear-gradient(to bottom, rgba(255,255,255,0.03), transparent);
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.ppg-dropdown-avatar {
|
|
727
|
+
border-color: rgba(255, 255, 255, 0.15);
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
.ppg-dropdown-avatar-fallback {
|
|
731
|
+
border-color: rgba(255, 255, 255, 0.1);
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
.ppg-dropdown-list {
|
|
735
|
+
scrollbar-color: rgba(255,255,255,0.35) transparent;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
.ppg-dropdown-list::-webkit-scrollbar-thumb {
|
|
739
|
+
background: rgba(255,255,255,0.35);
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
.ppg-dropdown-presence {
|
|
743
|
+
box-shadow: 0 0 0 1.5px rgba(44, 44, 46, 0.95);
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
.ppg-dropdown-presence[data-status="online"] {
|
|
747
|
+
box-shadow: 0 0 0 1.5px rgba(44, 44, 46, 0.95), 0 0 6px rgba(48, 209, 88, 0.5);
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
`,mt=`${Tt}
|
|
751
|
+
${Et}`;var a=class extends lit.LitElement{constructor(){super(...arguments);this.src="";this.alt="";this.size=v.size;this.variant=v.variant;this.shadow=v.shadow;this.border=false;this.borderWidth=v.borderWidth;this.borderColor=v.borderColor;this.rotation=0;this.loading=v.loading;this.placeholder=v.placeholder;this.placeholderColor=v.placeholderColor;this.isLoaded=false;this.hasError=false;this.cdnLoadFailed=false;this.previousSrc="";this.RETRY_DELAY_MS=3e4;}static setCdnBaseUrl(t){a.cdnBaseUrl=t,a.instances.forEach(e=>{e.extCustomerId&&!e.cdnImageUrl&&(e.cdnLoadFailed=false,e.retryTimeoutId&&(clearTimeout(e.retryTimeoutId),e.retryTimeoutId=void 0),e.previousExtCustomerId||(e.previousExtCustomerId=e.extCustomerId),e.loadCdnImage());});}static getCdnBaseUrl(){return a.cdnBaseUrl}createRenderRoot(){return a.injectStylesOnce(),this}static injectStylesOnce(){if(a.stylesInjected||typeof document>"u")return;(typeof requestIdleCallback<"u"?requestIdleCallback:e=>setTimeout(e,1))(()=>{if(a.stylesInjected)return;let e=document.createElement("style");e.textContent=ut,document.head.appendChild(e),a.stylesInjected=true;});}get pixelSize(){let t=this.size;return typeof t=="number"?t:E[t]??E[v.size]}connectedCallback(){super.connectedCallback(),a.instances.add(this);}disconnectedCallback(){super.disconnectedCallback(),a.instances.delete(this),this.retryTimeoutId&&(clearTimeout(this.retryTimeoutId),this.retryTimeoutId=void 0);}firstUpdated(){this.extCustomerId&&a.cdnBaseUrl&&(this.previousExtCustomerId=this.extCustomerId,this.loadCdnImage());}updated(t){super.updated(t),this.extCustomerId&&a.cdnBaseUrl&&!this.cdnImageUrl&&(this.cdnLoadFailed||!this.previousExtCustomerId)&&(this.previousExtCustomerId||(this.previousExtCustomerId=this.extCustomerId),this.cdnLoadFailed=false,this.loadCdnImage());}willUpdate(t){t.has("src")&&this.src!==this.previousSrc&&(this.isLoaded=false,this.hasError=false,this.previousSrc=this.src),(t.has("extCustomerId")||t.has("size")||t.has("bgColor"))&&this.extCustomerId!==this.previousExtCustomerId&&(this.previousExtCustomerId=this.extCustomerId,this.cdnImageUrl=void 0,this.cdnLoadFailed=false,this.isLoaded=false,this.hasError=false,this.retryTimeoutId&&(clearTimeout(this.retryTimeoutId),this.retryTimeoutId=void 0),this.loadCdnImage());}handleLoad(){this.isLoaded=true,this.dispatchEvent(new CustomEvent("load",{bubbles:true,composed:true}));}handleError(){if(this.cdnImageUrl&&!this.cdnLoadFailed){this.cdnLoadFailed=true,this.cdnImageUrl=void 0,this.dispatchEvent(new CustomEvent("cdn-error",{bubbles:true,composed:true,detail:{error:"Image load failed"}})),this.retryTimeoutId&&clearTimeout(this.retryTimeoutId),this.retryTimeoutId=setTimeout(()=>{this.retryTimeoutId=void 0,this.extCustomerId&&a.cdnBaseUrl&&(this.cdnLoadFailed=false,this.hasError=false,this.isLoaded=false,this.loadCdnImage());},this.RETRY_DELAY_MS);return}this.hasError=true,this.isLoaded=true,this.dispatchEvent(new CustomEvent("error",{bubbles:true,composed:true}));}loadCdnImage(){if(!(this.extCustomerId&&a.cdnBaseUrl)){this.cdnLoadFailed=true;return}let t=at(this.pixelSize),e=st(this.bgColor),o=typeof window<"u"?window.location.hostname:"localhost";this.cdnImageUrl=pt(a.cdnBaseUrl,this.extCustomerId,t,e,o);}getContainerStyles(){let t=ct(this.bgColor,this.bgGradient),e=this.border?lt(this.borderWidth,this.borderColor):null,o=gt(this.shadow),i={};if(this.glow){let d=this.glow.color??this.borderColor??"#6366f1";i={"--pp-glow-color":d,boxShadow:ft(d,this.glow.intensity??.3)};}let p=this.interactive?.hoverable||this.interactive?.pressable;return {classes:k("pp-container",dt(this.variant),t.className,e?.className,p&&"pp-interactive",this.glow?.animate&&"pp-glow"),styles:{width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,borderRadius:A[this.variant],...t.style,...e?.style,...o,...i,cursor:this.interactive?.cursor??(p?"pointer":"default"),transform:this.rotation?`rotate(${this.rotation}deg)`:void 0}}}renderPlaceholder(){if(this.isLoaded||this.placeholder==="none")return lit.nothing;let t={shimmer:"pp-shimmer",pulse:"pp-pulse",skeleton:"pp-skeleton",blur:"",none:""}[this.placeholder];return lit.html`
|
|
752
|
+
${this.placeholder==="shimmer"?lit.html`<style>${ht}</style>`:lit.nothing}
|
|
753
|
+
<div
|
|
754
|
+
class=${k("np:absolute np:inset-0",t)}
|
|
755
|
+
style=${styleMap_js.styleMap({backgroundColor:this.placeholderColor,borderRadius:"inherit"})}>
|
|
756
|
+
</div>
|
|
757
|
+
`}renderFallback(){if(this.fallback)return lit.html`
|
|
758
|
+
<span
|
|
759
|
+
class="pp-fallback"
|
|
760
|
+
style=${styleMap_js.styleMap({fontSize:`${j(this.pixelSize)}px`})}>
|
|
761
|
+
${this.fallback}
|
|
762
|
+
</span>
|
|
763
|
+
`;if(this.alt){let e=M(this.alt);return lit.html`
|
|
764
|
+
<div
|
|
765
|
+
class="pp-fallback np:absolute np:inset-0"
|
|
766
|
+
style=${styleMap_js.styleMap({background:this.bgColor??e,fontSize:`${j(this.pixelSize)}px`})}>
|
|
767
|
+
${B(this.alt)}
|
|
768
|
+
</div>
|
|
769
|
+
`}let t=this.pixelSize*.5;return lit.html`
|
|
770
|
+
<svg
|
|
771
|
+
class="pp-fallback-icon"
|
|
772
|
+
style="width: ${t}px; height: ${t}px;"
|
|
773
|
+
fill="currentColor"
|
|
774
|
+
viewBox="0 0 24 24">
|
|
775
|
+
<path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" />
|
|
776
|
+
</svg>
|
|
777
|
+
`}renderImage(){let t=!!(this.extCustomerId&&a.cdnBaseUrl),e;return this.cdnImageUrl?e=this.cdnImageUrl:(!t||this.cdnLoadFailed)&&(e=this.src),this.hasError||!e?this.renderFallback():lit.html`
|
|
778
|
+
<img
|
|
779
|
+
src=${e}
|
|
780
|
+
alt=${this.alt}
|
|
781
|
+
loading=${this.loading}
|
|
782
|
+
decoding="async"
|
|
783
|
+
@load=${this.handleLoad}
|
|
784
|
+
@error=${this.handleError}
|
|
785
|
+
class=${k("pp-image",this.isLoaded?"pp-image-loaded":"pp-image-loading")}
|
|
786
|
+
draggable="false" />
|
|
787
|
+
`}renderRing(){if(!this.ring?.show)return lit.nothing;let t=this.ring.width??3,e=this.ring.gap??3,o=t+e,i,p=this.ring.progress!==void 0;if(p){let d=this.ring.progress??0,u=this.ring.color??"#30D158",h=this.ring.emptyColor??"#8E8E93";i=et(d,u,h);}else this.ring.gradient&&this.ring.gradient.length>0?i=tt(this.ring.gradient):i=this.ring.color??"linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888)";return lit.html`
|
|
788
|
+
<div
|
|
789
|
+
class=${k("pp-ring",this.ring.animate&&!p&&"pp-ring-animated",p&&"pp-ring-progress")}
|
|
790
|
+
style=${styleMap_js.styleMap({inset:`-${o}px`,padding:`${t}px`,background:i,borderRadius:A[this.variant]})}>
|
|
791
|
+
</div>
|
|
792
|
+
`}getCornerOffset(){let t=this.border?this.borderWidth:0,e=this.pixelSize*.08,i={circle:1,square:.5,rounded:.8,squircle:1.2}[this.variant];return Math.round(e*i-t*.5)}renderPresence(){if(!this.presence)return lit.nothing;let t=this.presence.thickness??2,e=_(this.pixelSize,t),o=X[this.presence.status],i=this.getCornerOffset();return lit.html`
|
|
793
|
+
<div
|
|
794
|
+
class=${k("pp-presence",this.presence.animate&&"pp-presence-animated")}
|
|
795
|
+
style=${styleMap_js.styleMap({width:`${e}px`,height:`${e}px`,backgroundColor:o,bottom:`${i}px`,right:`${i}px`,color:o})}
|
|
796
|
+
title=${this.presence.status}>
|
|
797
|
+
</div>
|
|
798
|
+
`}renderBadge(){if(!this.badge)return lit.nothing;let t=this.badge.position??"bottom-right",e=this.badge.content!==void 0,o=this.badge.icon!==void 0,i=e||o,{size:p,fontSize:d}=Q(this.pixelSize,i),u=this.badge.bgColor??"#22c55e",h=this.badge.color??"#ffffff",f=this.badge.borderRadius??"9999px",m=e&&this.badge.content!==void 0?P(this.badge.content,this.badge.max):null,z=o?this.badge.icon:null,O=d*.9,g=`${-this.getCornerOffset()}px`,R={"top-left":{top:g,left:g},"top-center":{top:g,left:"50%",transform:"translateX(-50%)"},"top-right":{top:g,right:g},"bottom-left":{bottom:g,left:g},"bottom-center":{bottom:g,left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:g,right:g}};return lit.html`
|
|
799
|
+
<div
|
|
800
|
+
class=${k("pp-badge",this.badge.pulse&&"pp-badge-pulse",this.badge.glow&&"pp-badge-glow",o&&"pp-badge-with-icon")}
|
|
801
|
+
style=${styleMap_js.styleMap({width:i?"auto":`${p}px`,minWidth:`${p}px`,height:`${p}px`,padding:i?"0 6px":"0",fontSize:`${d}px`,backgroundColor:u,color:h,borderRadius:f,"--pp-badge-glow-color":u,gap:o&&e?"4px":"0",...R[t]})}>
|
|
802
|
+
${z?lit.html`<span class="pp-badge-icon" style=${styleMap_js.styleMap({fontSize:`${O}px`})}>${z}</span>`:lit.nothing}
|
|
803
|
+
${m??lit.nothing}
|
|
804
|
+
</div>
|
|
805
|
+
`}render(){let t=this.getContainerStyles(),e=this.interactive?.focusable||this.interactive?.pressable?0:void 0;return lit.html`
|
|
806
|
+
<div
|
|
807
|
+
class=${t.classes}
|
|
808
|
+
style=${styleMap_js.styleMap(t.styles)}
|
|
809
|
+
tabindex=${e??lit.nothing}
|
|
810
|
+
role=${this.interactive?.pressable?"button":lit.nothing}
|
|
811
|
+
aria-label=${this.alt||lit.nothing}
|
|
812
|
+
data-profile-picture>
|
|
813
|
+
|
|
814
|
+
<!-- Ring Effect (behind everything) -->
|
|
815
|
+
${this.renderRing()}
|
|
816
|
+
|
|
817
|
+
<!-- Inner container for image clipping -->
|
|
818
|
+
<div
|
|
819
|
+
class="pp-inner"
|
|
820
|
+
style=${styleMap_js.styleMap({borderRadius:A[this.variant]})}>
|
|
821
|
+
<!-- Placeholder -->
|
|
822
|
+
${this.renderPlaceholder()}
|
|
823
|
+
|
|
824
|
+
<!-- Main Image or Fallback -->
|
|
825
|
+
${this.renderImage()}
|
|
826
|
+
</div>
|
|
827
|
+
|
|
828
|
+
<!-- Badge -->
|
|
829
|
+
${this.renderBadge()}
|
|
830
|
+
|
|
831
|
+
<!-- Presence Indicator -->
|
|
832
|
+
${this.renderPresence()}
|
|
833
|
+
</div>
|
|
834
|
+
`}};a.stylesInjected=false,a.cdnBaseUrl="",a.instances=new Set,s([decorators_js.property({type:String})],a.prototype,"src",2),s([decorators_js.property({type:String})],a.prototype,"alt",2),s([decorators_js.property({type:String,attribute:"ext-customer-id"})],a.prototype,"extCustomerId",2),s([decorators_js.property({type:String})],a.prototype,"size",2),s([decorators_js.property({type:String})],a.prototype,"variant",2),s([decorators_js.property({type:String})],a.prototype,"shadow",2),s([decorators_js.property({type:Boolean})],a.prototype,"border",2),s([decorators_js.property({type:Number,attribute:"border-width"})],a.prototype,"borderWidth",2),s([decorators_js.property({type:String,attribute:"border-color"})],a.prototype,"borderColor",2),s([decorators_js.property({type:Number})],a.prototype,"rotation",2),s([decorators_js.property({type:String,attribute:"bg-color"})],a.prototype,"bgColor",2),s([decorators_js.property({type:String,attribute:"bg-gradient"})],a.prototype,"bgGradient",2),s([decorators_js.property({type:Object,attribute:"ring",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],a.prototype,"ring",2),s([decorators_js.property({type:Object,attribute:"presence",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],a.prototype,"presence",2),s([decorators_js.property({type:Object,attribute:"glow",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],a.prototype,"glow",2),s([decorators_js.property({type:Object,attribute:"badge",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],a.prototype,"badge",2),s([decorators_js.property({type:String})],a.prototype,"loading",2),s([decorators_js.property({type:String})],a.prototype,"placeholder",2),s([decorators_js.property({type:String,attribute:"placeholder-color"})],a.prototype,"placeholderColor",2),s([decorators_js.property({type:String})],a.prototype,"fallback",2),s([decorators_js.property({type:Object,attribute:"interactive",converter:{fromAttribute:t=>{if(t)try{return JSON.parse(t)}catch{return}},toAttribute:t=>t?JSON.stringify(t):null}})],a.prototype,"interactive",2),s([decorators_js.state()],a.prototype,"isLoaded",2),s([decorators_js.state()],a.prototype,"hasError",2),s([decorators_js.state()],a.prototype,"cdnImageUrl",2),s([decorators_js.state()],a.prototype,"cdnLoadFailed",2),a=s([decorators_js.customElement("profile-picture")],a);var q=false;function Mt(){if(q||typeof document>"u")return;(typeof requestIdleCallback<"u"?requestIdleCallback:n=>setTimeout(n,1))(()=>{if(q)return;let n=document.createElement("style");n.textContent=mt,document.head.appendChild(n),q=true;});}var c=class extends lit.LitElement{constructor(){super(...arguments);this.max=y.max;this.direction=y.direction;this.overlap=y.overlap;this.size=y.size;this.showAddButton=false;this.addButtonLabel="Add user";this.animated=y.animated;this.rotationAmount=0;this.users=[];this.dropdownOpen=false;this.tooltipData=null;this.tooltipTimeout=null;this.slotObserver=null;this.portalContainer=null;this.counterRef=null;this.handleBackdropClick=()=>{this.dropdownOpen=false,this.destroyPortal();};}createRenderRoot(){return Mt(),this}get pixelSize(){return rt(this.size)}get tooltipEnabled(){return this.tooltip?.enabled!==false}get tooltipPosition(){return this.tooltip?.position??"top"}get tooltipDelay(){return this.tooltip?.delay??y.tooltipDelay}get dropdownMaxHeight(){return this.dropdown?.maxHeight??y.dropdownMaxHeight}get showPresence(){return this.dropdown?.showPresence!==false}get dropdownPosition(){return this.dropdown?.position??"bottom"}connectedCallback(){super.connectedCallback(),this.updateUsers(),this.setupSlotObserver();}disconnectedCallback(){super.disconnectedCallback(),this.slotObserver?.disconnect(),this.clearTooltipTimeout(),this.destroyPortal();}setupSlotObserver(){this.slotObserver=new MutationObserver(()=>{this.updateUsers();}),this.slotObserver.observe(this,{childList:true,subtree:true,attributes:true,attributeFilter:["src","alt","ext-customer-id","data-user-id","data-status","variant","shadow","border","border-width","border-color","bg-color","bg-gradient"]});}updateUsers(){let t=Array.from(this.children).filter(e=>e.tagName.toLowerCase()==="profile-picture"&&e.getAttribute("slot")!=="internal");this.users=t.map((e,o)=>{let i=(u,h)=>{let f=h??u,m=e[u];return m!=null&&m!==""?String(m):e.getAttribute(f)??void 0},p=i("borderWidth","border-width"),d=p?Number.parseInt(String(p),10):void 0;return {id:i("dataUserId","data-user-id"),name:i("alt")??`User ${o+1}`,src:i("src"),extCustomerId:i("extCustomerId","ext-customer-id"),status:i("dataStatus","data-status"),element:e,index:o,variant:i("variant"),shadow:i("shadow"),border:!!(e.border??e.hasAttribute("border")),borderWidth:d,borderColor:i("borderColor","border-color"),bgColor:i("bgColor","bg-color"),bgGradient:i("bgGradient","bg-gradient")}});for(let e of this.users)e.element&&(e.element.style.display="none");}createPortal(){this.portalContainer||(this.portalContainer=document.createElement("div"),this.portalContainer.className="ppg-portal",this.portalContainer.style.cssText="position: fixed; z-index: 99999; pointer-events: none;",document.body.appendChild(this.portalContainer),document.body.style.overflow="hidden");}destroyPortal(){this.portalContainer&&(lit.render(lit.nothing,this.portalContainer),this.portalContainer.remove(),this.portalContainer=null,document.body.style.overflow="");}updatePortalContent(t){if(!(this.portalContainer&&this.counterRef))return;let e=this.counterRef.getBoundingClientRect(),o=10,i=280,p=Math.min(this.dropdownMaxHeight+60,t.length*56+60),d=window.innerWidth,u=window.innerHeight;if(d<480){let F=lit.html`
|
|
835
|
+
<div
|
|
836
|
+
class="ppg-backdrop ppg-backdrop-visible"
|
|
837
|
+
style="pointer-events: auto; background: rgba(0,0,0,0.5);"
|
|
838
|
+
@click=${this.handleBackdropClick}
|
|
839
|
+
aria-hidden="true"
|
|
840
|
+
></div>
|
|
841
|
+
<div
|
|
842
|
+
class="ppg-dropdown ppg-dropdown-modal"
|
|
843
|
+
style=${styleMap_js.styleMap({position:"fixed",pointerEvents:"auto",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"calc(100vw - 32px)",maxWidth:"320px",maxHeight:"70vh"})}
|
|
844
|
+
data-position="modal"
|
|
845
|
+
role="menu"
|
|
846
|
+
aria-label="Hidden users"
|
|
847
|
+
>
|
|
848
|
+
<div class="ppg-dropdown-header">
|
|
849
|
+
${t.length} more
|
|
850
|
+
</div>
|
|
851
|
+
<div
|
|
852
|
+
class="ppg-dropdown-list"
|
|
853
|
+
style=${styleMap_js.styleMap({maxHeight:"calc(70vh - 60px)"})}
|
|
854
|
+
>
|
|
855
|
+
${t.map(xt=>this.renderDropdownItem(xt))}
|
|
856
|
+
</div>
|
|
857
|
+
</div>
|
|
858
|
+
`;lit.render(F,this.portalContainer);return}let f=u-e.bottom-o,m=e.top-o,z=d-e.left,O=e.right,I=this.dropdownPosition;I==="bottom"&&f<p&&m>f?I="top":I==="top"&&m<p&&f>m&&(I="bottom");let g;z>=i?g=e.left:O>=i?g=e.right-i:g=(d-i)/2,g=Math.max(8,Math.min(g,d-i-8));let R=I==="bottom"?e.bottom+o:void 0,Y=I==="top"?u-e.top+o:void 0,bt=lit.html`
|
|
859
|
+
<div
|
|
860
|
+
class="ppg-backdrop"
|
|
861
|
+
style="pointer-events: auto;"
|
|
862
|
+
@click=${this.handleBackdropClick}
|
|
863
|
+
aria-hidden="true"
|
|
864
|
+
></div>
|
|
865
|
+
<div
|
|
866
|
+
class="ppg-dropdown ppg-dropdown-portal"
|
|
867
|
+
style=${styleMap_js.styleMap({position:"fixed",pointerEvents:"auto",top:R!==void 0?`${R}px`:"auto",bottom:Y!==void 0?`${Y}px`:"auto",left:`${g}px`,width:`${i}px`})}
|
|
868
|
+
data-position=${I}
|
|
869
|
+
role="menu"
|
|
870
|
+
aria-label="Hidden users"
|
|
871
|
+
>
|
|
872
|
+
<div class="ppg-dropdown-header">
|
|
873
|
+
${t.length} more
|
|
874
|
+
</div>
|
|
875
|
+
<div
|
|
876
|
+
class="ppg-dropdown-list"
|
|
877
|
+
style=${styleMap_js.styleMap({maxHeight:`${this.dropdownMaxHeight}px`})}
|
|
878
|
+
>
|
|
879
|
+
${t.map(F=>this.renderDropdownItem(F))}
|
|
880
|
+
</div>
|
|
881
|
+
</div>
|
|
882
|
+
`;lit.render(bt,this.portalContainer);}handleAvatarClick(t){this.dispatchEvent(new CustomEvent("avatar-click",{detail:{user:t},bubbles:true,composed:true}));}handleAvatarHover(t,e){if(!this.tooltipEnabled)return;this.clearTooltipTimeout();let o=e.currentTarget;this.tooltipTimeout=window.setTimeout(()=>{this.tooltipData={user:t,rect:o.getBoundingClientRect()};},this.tooltipDelay),this.dispatchEvent(new CustomEvent("avatar-hover",{detail:{user:t},bubbles:true,composed:true}));}handleAvatarLeave(){this.clearTooltipTimeout(),this.tooltipData=null;}clearTooltipTimeout(){this.tooltipTimeout&&(window.clearTimeout(this.tooltipTimeout),this.tooltipTimeout=null);}handleCounterClick(t){this.dropdownOpen=!this.dropdownOpen,this.dropdownOpen?(this.createPortal(),this.updatePortalContent(t)):this.destroyPortal(),this.dispatchEvent(new CustomEvent("counter-click",{detail:{hiddenUsers:t,open:this.dropdownOpen},bubbles:true,composed:true}));}handleDropdownItemClick(t){this.dropdownOpen=false,this.destroyPortal(),this.dispatchEvent(new CustomEvent("dropdown-item-click",{detail:{user:t},bubbles:true,composed:true}));}handleAddClick(){this.dispatchEvent(new CustomEvent("add-click",{bubbles:true,composed:true}));}handleKeyDown(t,e){(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),e());}renderAvatar(t,e,o){let i=U(e,this.pixelSize,this.overlap,this.direction,this.spacing),p=nt(e,o,this.direction),d=t.variant??"circle",u=t.shadow??"none",h=this.rotationAmount?e%2===0?-this.rotationAmount:this.rotationAmount:0;return lit.html`
|
|
883
|
+
<div
|
|
884
|
+
class="ppg-avatar-wrapper"
|
|
885
|
+
style=${styleMap_js.styleMap({left:`${i}px`,zIndex:String(p),width:`${this.pixelSize}px`,height:`${this.pixelSize}px`})}
|
|
886
|
+
tabindex="0"
|
|
887
|
+
role="button"
|
|
888
|
+
aria-label=${t.name}
|
|
889
|
+
@click=${()=>this.handleAvatarClick(t)}
|
|
890
|
+
@mouseenter=${f=>this.handleAvatarHover(t,f)}
|
|
891
|
+
@mouseleave=${this.handleAvatarLeave}
|
|
892
|
+
@keydown=${f=>this.handleKeyDown(f,()=>this.handleAvatarClick(t))}
|
|
893
|
+
>
|
|
894
|
+
${this.renderProfilePicture(t,d,u,h)}
|
|
895
|
+
</div>
|
|
896
|
+
`}renderProfilePicture(t,e,o,i){return lit.html`
|
|
897
|
+
<profile-picture
|
|
898
|
+
.src=${t.src||void 0}
|
|
899
|
+
.alt=${t.name}
|
|
900
|
+
.size=${this.pixelSize}
|
|
901
|
+
.variant=${e}
|
|
902
|
+
.shadow=${o}
|
|
903
|
+
.rotation=${i}
|
|
904
|
+
.extCustomerId=${t.extCustomerId}
|
|
905
|
+
?border=${t.border}
|
|
906
|
+
.borderWidth=${t.border?t.borderWidth??2:2}
|
|
907
|
+
.borderColor=${t.border?t.borderColor??"#ffffff":"#ffffff"}
|
|
908
|
+
.bgColor=${t.bgGradient?void 0:t.bgColor??"#ffffff"}
|
|
909
|
+
.bgGradient=${t.bgGradient??void 0}
|
|
910
|
+
data-user-id=${t.id??""}
|
|
911
|
+
data-status=${t.status??""}
|
|
912
|
+
></profile-picture>
|
|
913
|
+
`}renderCounter(t,e,o){return lit.html`
|
|
914
|
+
<button
|
|
915
|
+
class="ppg-counter"
|
|
916
|
+
style=${styleMap_js.styleMap({left:`${e}px`,width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,zIndex:"1"})}
|
|
917
|
+
aria-label=${`${t} more users`}
|
|
918
|
+
aria-expanded=${this.dropdownOpen}
|
|
919
|
+
aria-haspopup="true"
|
|
920
|
+
@click=${()=>this.handleCounterClick(o)}
|
|
921
|
+
>
|
|
922
|
+
${it(t)}
|
|
923
|
+
</button>
|
|
924
|
+
`}renderAddButton(t){let e=Math.round(this.pixelSize*.4);return lit.html`
|
|
925
|
+
<button
|
|
926
|
+
class="ppg-add-button"
|
|
927
|
+
style=${styleMap_js.styleMap({left:`${t}px`,width:`${this.pixelSize}px`,height:`${this.pixelSize}px`,zIndex:"1"})}
|
|
928
|
+
aria-label=${this.addButtonLabel}
|
|
929
|
+
@click=${this.handleAddClick}
|
|
930
|
+
>
|
|
931
|
+
<svg
|
|
932
|
+
class="ppg-add-icon"
|
|
933
|
+
width=${e}
|
|
934
|
+
height=${e}
|
|
935
|
+
viewBox="0 0 24 24"
|
|
936
|
+
fill="none"
|
|
937
|
+
stroke="currentColor"
|
|
938
|
+
stroke-width="2.5"
|
|
939
|
+
stroke-linecap="round"
|
|
940
|
+
stroke-linejoin="round"
|
|
941
|
+
>
|
|
942
|
+
<line x1="12" y1="5" x2="12" y2="19"></line>
|
|
943
|
+
<line x1="5" y1="12" x2="19" y2="12"></line>
|
|
944
|
+
</svg>
|
|
945
|
+
</button>
|
|
946
|
+
`}renderTooltip(){if(!this.tooltipData)return lit.nothing;let{user:t,rect:e}=this.tooltipData,o=8,i=this.getBoundingClientRect(),p=e.left-i.left+e.width/2,d=e.top-i.top,u=e.bottom-i.top,h=this.tooltipPosition==="top";return lit.html`
|
|
947
|
+
<div
|
|
948
|
+
class="ppg-tooltip"
|
|
949
|
+
style=${styleMap_js.styleMap({top:h?"auto":`${u+o}px`,bottom:h?`${i.height-d+o}px`:"auto",left:`${p}px`})}
|
|
950
|
+
data-position=${this.tooltipPosition}
|
|
951
|
+
role="tooltip"
|
|
952
|
+
>
|
|
953
|
+
${t.name}
|
|
954
|
+
</div>
|
|
955
|
+
`}renderDropdownItem(t){let e=M(t.name),o=t.src||t.extCustomerId;return lit.html`
|
|
956
|
+
<div
|
|
957
|
+
class="ppg-dropdown-item"
|
|
958
|
+
role="menuitem"
|
|
959
|
+
tabindex="0"
|
|
960
|
+
@click=${()=>this.handleDropdownItemClick(t)}
|
|
961
|
+
@keydown=${i=>this.handleKeyDown(i,()=>this.handleDropdownItemClick(t))}
|
|
962
|
+
>
|
|
963
|
+
${o?lit.html`<profile-picture
|
|
964
|
+
class="ppg-dropdown-avatar"
|
|
965
|
+
.src=${t.src||void 0}
|
|
966
|
+
.alt=${t.name}
|
|
967
|
+
.extCustomerId=${t.extCustomerId}
|
|
968
|
+
.size=${40}
|
|
969
|
+
variant="circle"
|
|
970
|
+
shadow="none"
|
|
971
|
+
></profile-picture>`:lit.html`<div
|
|
972
|
+
class="ppg-dropdown-avatar-fallback"
|
|
973
|
+
style=${styleMap_js.styleMap({background:e})}
|
|
974
|
+
>
|
|
975
|
+
${B(t.name)}
|
|
976
|
+
</div>`}
|
|
977
|
+
<div class="ppg-dropdown-info">
|
|
978
|
+
<div class="ppg-dropdown-name">${t.name}</div>
|
|
979
|
+
${this.showPresence&&t.status?lit.html`
|
|
980
|
+
<div class="ppg-dropdown-status">
|
|
981
|
+
<span
|
|
982
|
+
class="ppg-dropdown-presence"
|
|
983
|
+
data-status=${t.status}
|
|
984
|
+
></span>
|
|
985
|
+
${this.formatStatus(t.status)}
|
|
986
|
+
</div>
|
|
987
|
+
`:lit.nothing}
|
|
988
|
+
</div>
|
|
989
|
+
</div>
|
|
990
|
+
`}formatStatus(t){return {online:"Online",away:"Away",busy:"Busy",offline:"Offline",dnd:"Do not disturb"}[t]??t}updated(t){super.updated(t);let e=this.querySelector(".ppg-counter");if(e&&(this.counterRef=e),this.dropdownOpen&&this.portalContainer){let{visible:o}=H(this.users.length,this.max,this.showAddButton),i=this.users.slice(o);this.updatePortalContent(i);}}render(){let{visible:t,hidden:e,showCounter:o}=H(this.users.length,this.max,this.showAddButton),i=this.direction==="ltr"?this.users.slice(0,t):this.users.slice(0,t).reverse(),p=this.users.slice(t),d=t;o&&d++,this.showAddButton&&d++;let u=ot(d,this.pixelSize,this.overlap,this.spacing),h=o?U(t,this.pixelSize,this.overlap,this.direction,this.spacing):0,f=U(t+(o?1:0),this.pixelSize,this.overlap,this.direction,this.spacing);return lit.html`
|
|
991
|
+
<div
|
|
992
|
+
class=${k("ppg-container",this.animated&&"ppg-animated")}
|
|
993
|
+
style=${styleMap_js.styleMap({width:`${u}px`,height:`${this.pixelSize}px`})}
|
|
994
|
+
role="group"
|
|
995
|
+
aria-label="User avatars"
|
|
996
|
+
>
|
|
997
|
+
<!-- Hidden slot for original children -->
|
|
998
|
+
<slot style="display: none;"></slot>
|
|
999
|
+
|
|
1000
|
+
<!-- Visible avatars -->
|
|
1001
|
+
${i.map((m,z)=>this.renderAvatar(m,z,t))}
|
|
1002
|
+
|
|
1003
|
+
<!-- Counter -->
|
|
1004
|
+
${o?this.renderCounter(e,h,p):lit.nothing}
|
|
1005
|
+
|
|
1006
|
+
<!-- Add button -->
|
|
1007
|
+
${this.showAddButton?this.renderAddButton(f):lit.nothing}
|
|
1008
|
+
|
|
1009
|
+
<!-- Tooltip -->
|
|
1010
|
+
${this.renderTooltip()}
|
|
1011
|
+
</div>
|
|
1012
|
+
`}};s([decorators_js.property({type:Number})],c.prototype,"max",2),s([decorators_js.property({type:String})],c.prototype,"direction",2),s([decorators_js.property({type:Number})],c.prototype,"overlap",2),s([decorators_js.property({type:String})],c.prototype,"size",2),s([decorators_js.property({type:Number})],c.prototype,"spacing",2),s([decorators_js.property({type:Object})],c.prototype,"tooltip",2),s([decorators_js.property({type:Object})],c.prototype,"dropdown",2),s([decorators_js.property({type:Boolean,attribute:"show-add-button"})],c.prototype,"showAddButton",2),s([decorators_js.property({type:String,attribute:"add-button-label"})],c.prototype,"addButtonLabel",2),s([decorators_js.property({type:Boolean})],c.prototype,"animated",2),s([decorators_js.property({type:Number,attribute:"rotation-amount"})],c.prototype,"rotationAmount",2),s([decorators_js.state()],c.prototype,"users",2),s([decorators_js.state()],c.prototype,"dropdownOpen",2),s([decorators_js.state()],c.prototype,"tooltipData",2),c=s([decorators_js.customElement("profile-picture-group")],c);function pe(r){a.setCdnBaseUrl(r);}function de(){return a.getCdnBaseUrl()}K();exports.getCdnBaseUrl=de;exports.setCdnBaseUrl=pe;//# sourceMappingURL=angular.cjs.map
|
|
2
1013
|
//# sourceMappingURL=angular.cjs.map
|