@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/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import * as lit_html from 'lit-html';
2
+ import * as lit from 'lit';
3
3
  import { LitElement } from 'lit';
4
4
 
5
5
  /**
@@ -223,84 +223,6 @@ declare function detectThemeFromColor(bgColor?: string): "dark" | "light";
223
223
  */
224
224
  declare function constructCdnUrl(baseUrl: string, extCustomerId: string, sizeLabel: "80" | "120" | "240" | "480" | "960", theme: "dark" | "light", hostname: string): string;
225
225
 
226
- declare class ProfilePicture$1 extends LitElement {
227
- private static stylesInjected;
228
- private static cdnBaseUrl;
229
- private static instances;
230
- /**
231
- * Set global CDN base URL for all ProfilePicture instances
232
- * @example ProfilePicture.setCdnBaseUrl('https://api.example.com')
233
- */
234
- static setCdnBaseUrl(url: string): void;
235
- /**
236
- * Get current CDN base URL
237
- */
238
- static getCdnBaseUrl(): string;
239
- protected createRenderRoot(): this;
240
- private static injectStylesOnce;
241
- src: string;
242
- alt: string;
243
- extCustomerId?: string;
244
- size: Size | string;
245
- variant: Variant;
246
- shadow: ShadowPreset;
247
- border: boolean;
248
- borderWidth: 1 | 2 | 3 | 4 | 5 | 6 | 8;
249
- borderColor: string;
250
- rotation: number;
251
- bgColor?: string;
252
- bgGradient?: string;
253
- ring?: RingConfig;
254
- presence?: PresenceConfig;
255
- glow?: GlowConfig;
256
- badge?: BadgeConfig;
257
- loading: LoadingStrategy;
258
- placeholder: PlaceholderType;
259
- placeholderColor: string;
260
- fallback?: string;
261
- interactive?: InteractionConfig;
262
- private isLoaded;
263
- private hasError;
264
- private cdnImageUrl?;
265
- private cdnLoadFailed;
266
- private previousSrc;
267
- private previousExtCustomerId?;
268
- private retryTimeoutId?;
269
- private readonly RETRY_DELAY_MS;
270
- private get pixelSize();
271
- connectedCallback(): void;
272
- disconnectedCallback(): void;
273
- protected firstUpdated(): void;
274
- protected updated(changedProperties: Map<string, unknown>): void;
275
- protected willUpdate(changedProperties: Map<string, unknown>): void;
276
- private handleLoad;
277
- private handleError;
278
- /**
279
- * Construct CDN URL for profile picture using ext-customer-id
280
- * Uses direct image src binding - browser handles redirects automatically
281
- */
282
- private loadCdnImage;
283
- private getContainerStyles;
284
- private renderPlaceholder;
285
- private renderFallback;
286
- private renderImage;
287
- private renderRing;
288
- /**
289
- * Calculate corner offset based on variant
290
- * Returns the inset from container edge where badges/presence should be positioned
291
- */
292
- private getCornerOffset;
293
- private renderPresence;
294
- private renderBadge;
295
- render(): lit_html.TemplateResult<1>;
296
- }
297
-
298
- declare global {
299
- interface HTMLElementTagNameMap {
300
- "profile-picture": ProfilePicture$1;
301
- }
302
- }
303
-
304
226
  declare class ProfilePictureGroup$1 extends LitElement {
305
227
  protected createRenderRoot(): this;
306
228
  max: 4;
@@ -352,7 +274,7 @@ declare class ProfilePictureGroup$1 extends LitElement {
352
274
  private renderDropdownItem;
353
275
  private formatStatus;
354
276
  protected updated(changedProperties: Map<PropertyKey, unknown>): void;
355
- render(): lit_html.TemplateResult<1>;
277
+ render(): lit.TemplateResult<1>;
356
278
  }
357
279
 
358
280
  declare global {
@@ -462,6 +384,15 @@ declare const ProfilePictureGroup: React.ForwardRefExoticComponent<ProfilePictur
462
384
  * ```
463
385
  */
464
386
 
387
+ /**
388
+ * Set global CDN base URL for all ProfilePicture instances
389
+ * @example setCdnBaseUrl('https://api.example.com')
390
+ */
391
+ declare function setCdnBaseUrl(url: string): void;
392
+ /**
393
+ * Get current CDN base URL
394
+ */
395
+ declare function getCdnBaseUrl(): string;
465
396
  /**
466
397
  * React-specific props extending the core ProfilePictureProps
467
398
  */
@@ -517,4 +448,4 @@ declare namespace ProfilePicture {
517
448
  var displayName: string;
518
449
  }
519
450
 
520
- export { type BadgeConfig, type ProfilePictureGroupProps$1 as CoreProfilePictureGroupProps, type ProfilePictureProps$1 as CoreProfilePictureProps, type DropdownConfig, type GlowConfig, type GroupUserData, type InteractionConfig, type LoadingStrategy, type PlaceholderType, type Position, type PresenceConfig, type PresenceStatus, ProfilePicture, ProfilePictureGroup, type ProfilePictureGroupProps, type ProfilePictureProps, type RingConfig, type ShadowPreset, type Size, type StackDirection, type TooltipConfig, type TooltipPosition, type Variant, constructCdnUrl, detectThemeFromColor, getCdnSizeLabel };
451
+ export { type BadgeConfig, type ProfilePictureGroupProps$1 as CoreProfilePictureGroupProps, type ProfilePictureProps$1 as CoreProfilePictureProps, type DropdownConfig, type GlowConfig, type GroupUserData, type InteractionConfig, type LoadingStrategy, type PlaceholderType, type Position, type PresenceConfig, type PresenceStatus, ProfilePicture, ProfilePictureGroup, type ProfilePictureGroupProps, type ProfilePictureProps, type RingConfig, type ShadowPreset, type Size, type StackDirection, type TooltipConfig, type TooltipPosition, type Variant, constructCdnUrl, detectThemeFromColor, getCdnBaseUrl, getCdnSizeLabel, setCdnBaseUrl };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import * as lit_html from 'lit-html';
2
+ import * as lit from 'lit';
3
3
  import { LitElement } from 'lit';
4
4
 
5
5
  /**
@@ -223,84 +223,6 @@ declare function detectThemeFromColor(bgColor?: string): "dark" | "light";
223
223
  */
224
224
  declare function constructCdnUrl(baseUrl: string, extCustomerId: string, sizeLabel: "80" | "120" | "240" | "480" | "960", theme: "dark" | "light", hostname: string): string;
225
225
 
226
- declare class ProfilePicture$1 extends LitElement {
227
- private static stylesInjected;
228
- private static cdnBaseUrl;
229
- private static instances;
230
- /**
231
- * Set global CDN base URL for all ProfilePicture instances
232
- * @example ProfilePicture.setCdnBaseUrl('https://api.example.com')
233
- */
234
- static setCdnBaseUrl(url: string): void;
235
- /**
236
- * Get current CDN base URL
237
- */
238
- static getCdnBaseUrl(): string;
239
- protected createRenderRoot(): this;
240
- private static injectStylesOnce;
241
- src: string;
242
- alt: string;
243
- extCustomerId?: string;
244
- size: Size | string;
245
- variant: Variant;
246
- shadow: ShadowPreset;
247
- border: boolean;
248
- borderWidth: 1 | 2 | 3 | 4 | 5 | 6 | 8;
249
- borderColor: string;
250
- rotation: number;
251
- bgColor?: string;
252
- bgGradient?: string;
253
- ring?: RingConfig;
254
- presence?: PresenceConfig;
255
- glow?: GlowConfig;
256
- badge?: BadgeConfig;
257
- loading: LoadingStrategy;
258
- placeholder: PlaceholderType;
259
- placeholderColor: string;
260
- fallback?: string;
261
- interactive?: InteractionConfig;
262
- private isLoaded;
263
- private hasError;
264
- private cdnImageUrl?;
265
- private cdnLoadFailed;
266
- private previousSrc;
267
- private previousExtCustomerId?;
268
- private retryTimeoutId?;
269
- private readonly RETRY_DELAY_MS;
270
- private get pixelSize();
271
- connectedCallback(): void;
272
- disconnectedCallback(): void;
273
- protected firstUpdated(): void;
274
- protected updated(changedProperties: Map<string, unknown>): void;
275
- protected willUpdate(changedProperties: Map<string, unknown>): void;
276
- private handleLoad;
277
- private handleError;
278
- /**
279
- * Construct CDN URL for profile picture using ext-customer-id
280
- * Uses direct image src binding - browser handles redirects automatically
281
- */
282
- private loadCdnImage;
283
- private getContainerStyles;
284
- private renderPlaceholder;
285
- private renderFallback;
286
- private renderImage;
287
- private renderRing;
288
- /**
289
- * Calculate corner offset based on variant
290
- * Returns the inset from container edge where badges/presence should be positioned
291
- */
292
- private getCornerOffset;
293
- private renderPresence;
294
- private renderBadge;
295
- render(): lit_html.TemplateResult<1>;
296
- }
297
-
298
- declare global {
299
- interface HTMLElementTagNameMap {
300
- "profile-picture": ProfilePicture$1;
301
- }
302
- }
303
-
304
226
  declare class ProfilePictureGroup$1 extends LitElement {
305
227
  protected createRenderRoot(): this;
306
228
  max: 4;
@@ -352,7 +274,7 @@ declare class ProfilePictureGroup$1 extends LitElement {
352
274
  private renderDropdownItem;
353
275
  private formatStatus;
354
276
  protected updated(changedProperties: Map<PropertyKey, unknown>): void;
355
- render(): lit_html.TemplateResult<1>;
277
+ render(): lit.TemplateResult<1>;
356
278
  }
357
279
 
358
280
  declare global {
@@ -462,6 +384,15 @@ declare const ProfilePictureGroup: React.ForwardRefExoticComponent<ProfilePictur
462
384
  * ```
463
385
  */
464
386
 
387
+ /**
388
+ * Set global CDN base URL for all ProfilePicture instances
389
+ * @example setCdnBaseUrl('https://api.example.com')
390
+ */
391
+ declare function setCdnBaseUrl(url: string): void;
392
+ /**
393
+ * Get current CDN base URL
394
+ */
395
+ declare function getCdnBaseUrl(): string;
465
396
  /**
466
397
  * React-specific props extending the core ProfilePictureProps
467
398
  */
@@ -517,4 +448,4 @@ declare namespace ProfilePicture {
517
448
  var displayName: string;
518
449
  }
519
450
 
520
- export { type BadgeConfig, type ProfilePictureGroupProps$1 as CoreProfilePictureGroupProps, type ProfilePictureProps$1 as CoreProfilePictureProps, type DropdownConfig, type GlowConfig, type GroupUserData, type InteractionConfig, type LoadingStrategy, type PlaceholderType, type Position, type PresenceConfig, type PresenceStatus, ProfilePicture, ProfilePictureGroup, type ProfilePictureGroupProps, type ProfilePictureProps, type RingConfig, type ShadowPreset, type Size, type StackDirection, type TooltipConfig, type TooltipPosition, type Variant, constructCdnUrl, detectThemeFromColor, getCdnSizeLabel };
451
+ export { type BadgeConfig, type ProfilePictureGroupProps$1 as CoreProfilePictureGroupProps, type ProfilePictureProps$1 as CoreProfilePictureProps, type DropdownConfig, type GlowConfig, type GroupUserData, type InteractionConfig, type LoadingStrategy, type PlaceholderType, type Position, type PresenceConfig, type PresenceStatus, ProfilePicture, ProfilePictureGroup, type ProfilePictureGroupProps, type ProfilePictureProps, type RingConfig, type ShadowPreset, type Size, type StackDirection, type TooltipConfig, type TooltipPosition, type Variant, constructCdnUrl, detectThemeFromColor, getCdnBaseUrl, getCdnSizeLabel, setCdnBaseUrl };
package/dist/index.js CHANGED
@@ -795,10 +795,10 @@ ${Je}`;var a=class extends LitElement{constructor(){super(...arguments);this.src
795
795
  style=${styleMap({width:`${t}px`,height:`${t}px`,backgroundColor:o,bottom:`${i}px`,right:`${i}px`,color:o})}
796
796
  title=${this.presence.status}>
797
797
  </div>
798
- `}renderBadge(){if(!this.badge)return nothing;let e=this.badge.position??"bottom-right",t=this.badge.content!==void 0,o=this.badge.icon!==void 0,i=t||o,{size:p,fontSize:d}=he(this.pixelSize,i),g=this.badge.bgColor??"#22c55e",m=this.badge.color??"#ffffff",h=this.badge.borderRadius??"9999px",b=t&&this.badge.content!==void 0?xe(this.badge.content,this.badge.max):null,v=o?this.badge.icon:null,T=d*.9,c=`${-this.getCornerOffset()}px`,M={"top-left":{top:c,left:c},"top-center":{top:c,left:"50%",transform:"translateX(-50%)"},"top-right":{top:c,right:c},"bottom-left":{bottom:c,left:c},"bottom-center":{bottom:c,left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:c,right:c}};return html`
798
+ `}renderBadge(){if(!this.badge)return nothing;let e=this.badge.position??"bottom-right",t=this.badge.content!==void 0,o=this.badge.icon!==void 0,i=t||o,{size:p,fontSize:d}=he(this.pixelSize,i),g=this.badge.bgColor??"#22c55e",m=this.badge.color??"#ffffff",h=this.badge.borderRadius??"9999px",b=t&&this.badge.content!==void 0?xe(this.badge.content,this.badge.max):null,v=o?this.badge.icon:null,T=d*.9,c=`${-this.getCornerOffset()}px`,U={"top-left":{top:c,left:c},"top-center":{top:c,left:"50%",transform:"translateX(-50%)"},"top-right":{top:c,right:c},"bottom-left":{bottom:c,left:c},"bottom-center":{bottom:c,left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:c,right:c}};return html`
799
799
  <div
800
800
  class=${A("pp-badge",this.badge.pulse&&"pp-badge-pulse",this.badge.glow&&"pp-badge-glow",o&&"pp-badge-with-icon")}
801
- style=${styleMap({width:i?"auto":`${p}px`,minWidth:`${p}px`,height:`${p}px`,padding:i?"0 6px":"0",fontSize:`${d}px`,backgroundColor:g,color:m,borderRadius:h,"--pp-badge-glow-color":g,gap:o&&t?"4px":"0",...M[e]})}>
801
+ style=${styleMap({width:i?"auto":`${p}px`,minWidth:`${p}px`,height:`${p}px`,padding:i?"0 6px":"0",fontSize:`${d}px`,backgroundColor:g,color:m,borderRadius:h,"--pp-badge-glow-color":g,gap:o&&t?"4px":"0",...U[e]})}>
802
802
  ${v?html`<span class="pp-badge-icon" style=${styleMap({fontSize:`${T}px`})}>${v}</span>`:nothing}
803
803
  ${b??nothing}
804
804
  </div>
@@ -855,7 +855,7 @@ ${Je}`;var a=class extends LitElement{constructor(){super(...arguments);this.src
855
855
  ${e.map(D=>this.renderDropdownItem(D))}
856
856
  </div>
857
857
  </div>
858
- `;render(y,this.portalContainer);return}let h=g-t.bottom-o,b=t.top-o,v=d-t.left,T=t.right,x=this.dropdownPosition;x==="bottom"&&h<p&&b>h?x="top":x==="top"&&b<p&&h>b&&(x="bottom");let c;v>=i?c=t.left:T>=i?c=t.right-i:c=(d-i)/2,c=Math.max(8,Math.min(c,d-i-8));let M=x==="bottom"?t.bottom+o:void 0,U=x==="top"?g-t.top+o:void 0,j=html`
858
+ `;render(y,this.portalContainer);return}let h=g-t.bottom-o,b=t.top-o,v=d-t.left,T=t.right,x=this.dropdownPosition;x==="bottom"&&h<p&&b>h?x="top":x==="top"&&b<p&&h>b&&(x="bottom");let c;v>=i?c=t.left:T>=i?c=t.right-i:c=(d-i)/2,c=Math.max(8,Math.min(c,d-i-8));let U=x==="bottom"?t.bottom+o:void 0,B=x==="top"?g-t.top+o:void 0,j=html`
859
859
  <div
860
860
  class="ppg-backdrop"
861
861
  style="pointer-events: auto;"
@@ -864,7 +864,7 @@ ${Je}`;var a=class extends LitElement{constructor(){super(...arguments);this.src
864
864
  ></div>
865
865
  <div
866
866
  class="ppg-dropdown ppg-dropdown-portal"
867
- style=${styleMap({position:"fixed",pointerEvents:"auto",top:M!==void 0?`${M}px`:"auto",bottom:U!==void 0?`${U}px`:"auto",left:`${c}px`,width:`${i}px`})}
867
+ style=${styleMap({position:"fixed",pointerEvents:"auto",top:U!==void 0?`${U}px`:"auto",bottom:B!==void 0?`${B}px`:"auto",left:`${c}px`,width:`${i}px`})}
868
868
  data-position=${x}
869
869
  role="menu"
870
870
  aria-label="Hidden users"
@@ -1009,5 +1009,5 @@ ${Je}`;var a=class extends LitElement{constructor(){super(...arguments);this.src
1009
1009
  <!-- Tooltip -->
1010
1010
  ${this.renderTooltip()}
1011
1011
  </div>
1012
- `}};s([property({type:Number})],f.prototype,"max",2),s([property({type:String})],f.prototype,"direction",2),s([property({type:Number})],f.prototype,"overlap",2),s([property({type:String})],f.prototype,"size",2),s([property({type:Number})],f.prototype,"spacing",2),s([property({type:Object})],f.prototype,"tooltip",2),s([property({type:Object})],f.prototype,"dropdown",2),s([property({type:Boolean,attribute:"show-add-button"})],f.prototype,"showAddButton",2),s([property({type:String,attribute:"add-button-label"})],f.prototype,"addButtonLabel",2),s([property({type:Boolean})],f.prototype,"animated",2),s([property({type:Number,attribute:"rotation-amount"})],f.prototype,"rotationAmount",2),s([state()],f.prototype,"users",2),s([state()],f.prototype,"dropdownOpen",2),s([state()],f.prototype,"tooltipData",2),f=s([customElement("profile-picture-group")],f);var le=Le.forwardRef(({max:r,direction:n,overlap:e,size:t,spacing:o,tooltip:i,dropdown:p,showAddButton:d,addButtonLabel:g,animated:m,rotationAmount:h,onAvatarClick:b,onAvatarHover:v,onCounterClick:T,onDropdownItemClick:x,onAddClick:c,className:M,style:U,children:j},y)=>{let D=useRef(null),B=useCallback(l=>{b?.(l.detail.user);},[b]),O=useCallback(l=>{v?.(l.detail.user);},[v]),G=useCallback(l=>{let k=l;T?.(k.detail.hiddenUsers,k.detail.open);},[T]),P=useCallback(l=>{x?.(l.detail.user);},[x]),V=useCallback(()=>{c?.();},[c]);return useEffect(()=>{let l=D.current;if(l)return l.addEventListener("avatar-click",B),l.addEventListener("avatar-hover",O),l.addEventListener("counter-click",G),l.addEventListener("dropdown-item-click",P),l.addEventListener("add-click",V),()=>{l.removeEventListener("avatar-click",B),l.removeEventListener("avatar-hover",O),l.removeEventListener("counter-click",G),l.removeEventListener("dropdown-item-click",P),l.removeEventListener("add-click",V);}},[B,O,G,P,V]),useEffect(()=>{typeof y=="function"?y(D.current):y&&(y.current=D.current);},[y]),Le.createElement("profile-picture-group",{ref:D,max:r,direction:n,overlap:e,size:t,spacing:o,tooltip:i?JSON.stringify(i):void 0,dropdown:p?JSON.stringify(p):void 0,"show-add-button":d||void 0,"add-button-label":g,animated:m,"rotation-amount":h,class:M,style:U},j)});le.displayName="ProfilePictureGroup";function Be({src:r,alt:n,extCustomerId:e,size:t,variant:o,shadow:i,border:p,borderWidth:d,borderColor:g,rotation:m,bgColor:h,bgGradient:b,glow:v,ring:T,presence:x,badge:c,loading:M,placeholder:U,placeholderColor:j,fallback:y,interactive:D,onLoad:B,onError:O,onCdnError:G,className:P,style:V,ref:l}){let k=useRef(null),Z=useCallback(()=>{B?.();},[B]),Q=useCallback(()=>{O?.();},[O]),_=useCallback(R=>{G?.(R.detail);},[G]);return useEffect(()=>{let R=k.current;if(R)return R.addEventListener("load",Z),R.addEventListener("error",Q),R.addEventListener("cdn-error",_),()=>{R.removeEventListener("load",Z),R.removeEventListener("error",Q),R.removeEventListener("cdn-error",_);}},[Z,Q,_]),useEffect(()=>{typeof l=="function"?l(k.current):l&&(l.current=k.current);},[l]),Le.createElement("profile-picture",{ref:k,src:r||void 0,alt:n,"ext-customer-id":e,size:t,variant:o,shadow:i,border:p||void 0,"border-width":d,"border-color":g,rotation:m,"bg-color":h,"bg-gradient":b,glow:v?JSON.stringify(v):void 0,ring:T?JSON.stringify(T):void 0,presence:x?JSON.stringify(x):void 0,badge:c?JSON.stringify(c):void 0,loading:M,placeholder:U,"placeholder-color":j,fallback:y,interactive:D?JSON.stringify(D):void 0,class:P,style:V})}Be.displayName="ProfilePicture";ge();export{Be as ProfilePicture,le as ProfilePictureGroup,ae as constructCdnUrl,ie as detectThemeFromColor,oe as getCdnSizeLabel};//# sourceMappingURL=index.js.map
1012
+ `}};s([property({type:Number})],f.prototype,"max",2),s([property({type:String})],f.prototype,"direction",2),s([property({type:Number})],f.prototype,"overlap",2),s([property({type:String})],f.prototype,"size",2),s([property({type:Number})],f.prototype,"spacing",2),s([property({type:Object})],f.prototype,"tooltip",2),s([property({type:Object})],f.prototype,"dropdown",2),s([property({type:Boolean,attribute:"show-add-button"})],f.prototype,"showAddButton",2),s([property({type:String,attribute:"add-button-label"})],f.prototype,"addButtonLabel",2),s([property({type:Boolean})],f.prototype,"animated",2),s([property({type:Number,attribute:"rotation-amount"})],f.prototype,"rotationAmount",2),s([state()],f.prototype,"users",2),s([state()],f.prototype,"dropdownOpen",2),s([state()],f.prototype,"tooltipData",2),f=s([customElement("profile-picture-group")],f);var le=Le.forwardRef(({max:r,direction:n,overlap:e,size:t,spacing:o,tooltip:i,dropdown:p,showAddButton:d,addButtonLabel:g,animated:m,rotationAmount:h,onAvatarClick:b,onAvatarHover:v,onCounterClick:T,onDropdownItemClick:x,onAddClick:c,className:U,style:B,children:j},y)=>{let D=useRef(null),M=useCallback(l=>{b?.(l.detail.user);},[b]),O=useCallback(l=>{v?.(l.detail.user);},[v]),G=useCallback(l=>{let k=l;T?.(k.detail.hiddenUsers,k.detail.open);},[T]),P=useCallback(l=>{x?.(l.detail.user);},[x]),V=useCallback(()=>{c?.();},[c]);return useEffect(()=>{let l=D.current;if(l)return l.addEventListener("avatar-click",M),l.addEventListener("avatar-hover",O),l.addEventListener("counter-click",G),l.addEventListener("dropdown-item-click",P),l.addEventListener("add-click",V),()=>{l.removeEventListener("avatar-click",M),l.removeEventListener("avatar-hover",O),l.removeEventListener("counter-click",G),l.removeEventListener("dropdown-item-click",P),l.removeEventListener("add-click",V);}},[M,O,G,P,V]),useEffect(()=>{typeof y=="function"?y(D.current):y&&(y.current=D.current);},[y]),Le.createElement("profile-picture-group",{ref:D,max:r,direction:n,overlap:e,size:t,spacing:o,tooltip:i?JSON.stringify(i):void 0,dropdown:p?JSON.stringify(p):void 0,"show-add-button":d||void 0,"add-button-label":g,animated:m,"rotation-amount":h,class:U,style:B},j)});le.displayName="ProfilePictureGroup";function rt(r){a.setCdnBaseUrl(r);}function nt(){return a.getCdnBaseUrl()}function Me({src:r,alt:n,extCustomerId:e,size:t,variant:o,shadow:i,border:p,borderWidth:d,borderColor:g,rotation:m,bgColor:h,bgGradient:b,glow:v,ring:T,presence:x,badge:c,loading:U,placeholder:B,placeholderColor:j,fallback:y,interactive:D,onLoad:M,onError:O,onCdnError:G,className:P,style:V,ref:l}){let k=useRef(null),Z=useCallback(()=>{M?.();},[M]),Q=useCallback(()=>{O?.();},[O]),_=useCallback(R=>{G?.(R.detail);},[G]);return useEffect(()=>{let R=k.current;if(R)return R.addEventListener("load",Z),R.addEventListener("error",Q),R.addEventListener("cdn-error",_),()=>{R.removeEventListener("load",Z),R.removeEventListener("error",Q),R.removeEventListener("cdn-error",_);}},[Z,Q,_]),useEffect(()=>{typeof l=="function"?l(k.current):l&&(l.current=k.current);},[l]),Le.createElement("profile-picture",{ref:k,src:r||void 0,alt:n,"ext-customer-id":e,size:t,variant:o,shadow:i,border:p||void 0,"border-width":d,"border-color":g,rotation:m,"bg-color":h,"bg-gradient":b,glow:v?JSON.stringify(v):void 0,ring:T?JSON.stringify(T):void 0,presence:x?JSON.stringify(x):void 0,badge:c?JSON.stringify(c):void 0,loading:U,placeholder:B,"placeholder-color":j,fallback:y,interactive:D?JSON.stringify(D):void 0,class:P,style:V})}Me.displayName="ProfilePicture";ge();export{Me as ProfilePicture,le as ProfilePictureGroup,ae as constructCdnUrl,ie as detectThemeFromColor,nt as getCdnBaseUrl,oe as getCdnSizeLabel,rt as setCdnBaseUrl};//# sourceMappingURL=index.js.map
1013
1013
  //# sourceMappingURL=index.js.map