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CsD,UAAU,2FACbpK,MAAM,CAAEyH,YAAa,CAAC,4CAAmC4C,QAAQ,oGAEvDD,UAAU,kFAC5BC,QAAQ,4BAC7ChC,eAAe,kDAA+C1I,OAAO,CAAE0I,eAAgB,CAAC,YAAU,EAAE,wGAIrGC,OAAO,+CAA4C3I,OAAO,CAAE2I,OAAQ,CAAC,YAAU,EAAE,2MAI/B8B,UAAU,gQAG3DG,iBAAiB,+FAGsBD,aAAa,GAAG,yCAAyC,GAAG,EAAE,iCAC/FA,aAAa,GAAG,yDAAyD,GAAGF,UAAU,4IAI3FE,aAAa,GAAGnK,EAAE,CAAEC,IAAI,EAAE,mBAAoB,CAAC,GAAGD,EAAE,CAAEC,IAAI,EAAE,cAAe,CAAC,+VAQjF;EAEH,OAAOuG,SAAS;AACjB,CAAC","sources":["webpack://@gravatar-com/hovercards/webpack/bootstrap","webpack://@gravatar-com/hovercards/webpack/runtime/define property getters","webpack://@gravatar-com/hovercards/webpack/runtime/hasOwnProperty shorthand","webpack://@gravatar-com/hovercards/./src/compute-position.ts","webpack://@gravatar-com/hovercards/./src/sanitizer.ts","webpack://@gravatar-com/hovercards/./src/i18n.ts","webpack://@gravatar-com/hovercards/./src/core.ts","webpack://@gravatar-com/hovercards/./src/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","export type Placement =\n\t| 'top'\n\t| 'top-start'\n\t| 'top-end'\n\t| 'bottom'\n\t| 'bottom-start'\n\t| 'bottom-end'\n\t| 'left'\n\t| 'left-start'\n\t| 'left-end'\n\t| 'right'\n\t| 'right-start'\n\t| 'right-end';\n\ntype Options = Partial< {\n\tplacement: Placement;\n\toffset: number;\n\tautoFlip: boolean;\n} >;\n\ninterface ReturnValues {\n\tx: number;\n\ty: number;\n\tpadding: 'paddingBottom' | 'paddingTop' | 'paddingRight' | 'paddingLeft';\n\tpaddingValue: number;\n}\n\nconst paddingMap: Record< string, ReturnValues[ 'padding' ] > = {\n\ttop: 'paddingBottom',\n\tbottom: 'paddingTop',\n\tleft: 'paddingRight',\n\tright: 'paddingLeft',\n};\n\n/**\n * Computes the position of a card relative to a ref element.\n *\n * @param {HTMLElement}    ref          - The ref element.\n * @param {HTMLDivElement} card         - The card element.\n * @param {Options}        [options={}] - The placement, offset, and auto-flip options.\n * @return {ReturnValues}               - The computed position values.\n */\nexport default function computingPosition(\n\tref: HTMLElement,\n\tcard: HTMLDivElement,\n\t{ placement = 'right', offset = 0, autoFlip = true }: Options = {}\n): ReturnValues {\n\tconst refRect = ref.getBoundingClientRect();\n\tconst cardRect = card.getBoundingClientRect();\n\tconst refScrollT = refRect.top + scrollY;\n\tconst refScrollB = refRect.bottom + scrollY;\n\tconst refScrollR = refRect.right + scrollX;\n\tconst refScrollL = refRect.left + scrollX;\n\tlet x = 0;\n\tlet y = 0;\n\tlet [ dir, align ] = placement.split( '-' );\n\toffset = Math.max( 0, offset );\n\n\t// Auto flip the card if there's not enough space\n\t// If both sides have not enough space, then the card will be placed on the side with more space\n\tif ( autoFlip ) {\n\t\tconst topSpace = refRect.top;\n\t\tconst bottomSpace = innerHeight - refRect.bottom;\n\t\tconst leftSpace = refRect.left;\n\t\tconst rightSpace = innerWidth - refRect.right;\n\t\tconst floatingSpaceV = cardRect.height + offset;\n\t\tconst floatingSpaceH = cardRect.width + offset;\n\n\t\tif ( dir === 'top' && topSpace < floatingSpaceV && bottomSpace > topSpace ) {\n\t\t\tdir = 'bottom';\n\t\t}\n\n\t\tif ( dir === 'bottom' && bottomSpace < floatingSpaceV && topSpace > bottomSpace ) {\n\t\t\tdir = 'top';\n\t\t}\n\n\t\tif ( dir === 'left' && leftSpace < floatingSpaceH && rightSpace > leftSpace ) {\n\t\t\tdir = 'right';\n\t\t}\n\n\t\tif ( dir === 'right' && rightSpace < floatingSpaceH && leftSpace > rightSpace ) {\n\t\t\tdir = 'left';\n\t\t}\n\t}\n\n\t// Calculate the position of the card\n\tif ( dir === 'top' || dir === 'bottom' ) {\n\t\tx = refScrollL + refRect.width / 2 - cardRect.width / 2;\n\t\t// The bottom offset will be filled with the card's padding\n\t\ty = dir === 'top' ? refScrollT - cardRect.height - offset : refScrollB;\n\n\t\tif ( align === 'start' ) {\n\t\t\tx = refScrollL;\n\t\t}\n\n\t\tif ( align === 'end' ) {\n\t\t\tx = refScrollR - cardRect.width;\n\t\t}\n\t} else {\n\t\t// The right offset will be filled with the card's padding\n\t\tx = dir === 'right' ? refScrollR : refScrollL - cardRect.width - offset;\n\t\ty = refScrollT + refRect.height / 2 - cardRect.height / 2;\n\n\t\tif ( align === 'start' ) {\n\t\t\ty = refScrollT;\n\t\t}\n\n\t\tif ( align === 'end' ) {\n\t\t\ty = refScrollB - cardRect.height;\n\t\t}\n\t}\n\n\treturn { x, y, padding: paddingMap[ dir ], paddingValue: offset };\n}\n","export function escHtml( str: string ) {\n\tconst htmlEntities: Record< string, string > = {\n\t\t'&': '&amp;',\n\t\t'<': '&lt;',\n\t\t'>': '&gt;',\n\t\t'\"': '&quot;',\n\t\t\"'\": '&#39;',\n\t\t'`': '&#x60;',\n\t};\n\n\t// Don't escape if already escaped.\n\treturn str.replace( /&(amp|lt|gt|quot|#39|x60);|[\\&<>\"'`]/g, ( match ) =>\n\t\tmatch[ 0 ] === '&' ? match : htmlEntities[ match ]\n\t);\n}\n\nexport function escUrl( url: string ) {\n\treturn encodeURI( url );\n}\n","export default function __( i18n: Record< string, string >, key: string ) {\n\treturn i18n[ key ] || key;\n}\n","import type { Placement } from './compute-position';\nimport computePosition from './compute-position';\nimport { escUrl, escHtml } from './sanitizer';\nimport __ from './i18n';\n\nexport type Account = Record< 'url' | 'shortname' | 'iconUrl' | 'name', string >;\n\nexport interface ProfileData {\n\thash: string;\n\tpreferredUsername: string;\n\tthumbnailUrl: string;\n\tdisplayName: string;\n\tcurrentLocation?: string;\n\taboutMe?: string;\n\taccounts?: Account[];\n}\n\nexport type CreateHovercard = (\n\tprofileData: ProfileData,\n\toptions?: { additionalClass?: string; myHash?: string; i18n?: Record< string, string > }\n) => HTMLDivElement;\n\nexport type Attach = ( target: HTMLElement, options?: { dataAttributeName?: string; ignoreSelector?: string } ) => void;\n\nexport type Detach = () => void;\n\nexport type OnQueryHovercardRef = ( ref: HTMLElement ) => HTMLElement;\n\nexport type OnFetchProfileStart = ( hash: string ) => void;\n\nexport type OnFetchProfileSuccess = ( hash: string, profileData: ProfileData ) => void;\n\nexport type OnFetchProfileFailure = ( hash: string, error: Error ) => void;\n\nexport type OnHovercardShown = ( hash: string, hovercard: HTMLDivElement ) => void;\n\nexport type OnHovercardHidden = ( hash: string, hovercard: HTMLDivElement ) => void;\n\nexport type Options = Partial< {\n\tplacement: Placement;\n\toffset: number;\n\tautoFlip: boolean;\n\tdelayToShow: number;\n\tdelayToHide: number;\n\tadditionalClass: string;\n\tmyHash: string;\n\ti18n: Record< string, string >;\n\tonQueryHovercardRef: OnQueryHovercardRef;\n\tonFetchProfileStart: OnFetchProfileStart;\n\tonFetchProfileSuccess: OnFetchProfileSuccess;\n\tonFetchProfileFailure: OnFetchProfileFailure;\n\tonHovercardShown: OnHovercardShown;\n\tonHovercardHidden: OnHovercardHidden;\n} >;\n\ninterface HovercardRef {\n\tid: string;\n\thash: string;\n\tparams: string;\n\tref: HTMLElement;\n}\n\nconst BASE_API_URL = 'https://secure.gravatar.com';\n\nconst socialLinksOrder = [ 'wordpress', 'mastodon', 'tumblr', 'github', 'twitter' ];\nconst dc = document;\n\nexport default class Hovercards {\n\t// Options\n\t_placement: Placement;\n\t_offset: number;\n\t_autoFlip: boolean;\n\t_delayToShow: number;\n\t_delayToHide: number;\n\t_additionalClass: string;\n\t_myHash: string;\n\t_onQueryHovercardRef: OnQueryHovercardRef;\n\t_onFetchProfileStart: OnFetchProfileStart;\n\t_onFetchProfileSuccess: OnFetchProfileSuccess;\n\t_onFetchProfileFailure: OnFetchProfileFailure;\n\t_onHovercardShown: OnHovercardShown;\n\t_onHovercardHidden: OnHovercardHidden;\n\t_i18n: Record< string, string > = {};\n\n\t// Variables\n\t_hovercardRefs: HovercardRef[] = [];\n\t_showHovercardTimeoutIds = new Map< string, ReturnType< typeof setTimeout > >();\n\t_hideHovercardTimeoutIds = new Map< string, ReturnType< typeof setTimeout > >();\n\t_cachedProfiles = new Map< string, ProfileData >();\n\n\tconstructor( {\n\t\tplacement = 'right',\n\t\tautoFlip = true,\n\t\toffset = 10,\n\t\tdelayToShow = 500,\n\t\tdelayToHide = 300,\n\t\tadditionalClass = '',\n\t\tmyHash = '',\n\t\tonQueryHovercardRef = ( ref ) => ref,\n\t\tonFetchProfileStart = () => {},\n\t\tonFetchProfileSuccess = () => {},\n\t\tonFetchProfileFailure = () => {},\n\t\tonHovercardShown = () => {},\n\t\tonHovercardHidden = () => {},\n\t\ti18n = {},\n\t}: Options = {} ) {\n\t\tthis._placement = placement;\n\t\tthis._autoFlip = autoFlip;\n\t\tthis._offset = offset;\n\t\tthis._delayToShow = delayToShow;\n\t\tthis._delayToHide = delayToHide;\n\t\tthis._additionalClass = additionalClass;\n\t\tthis._myHash = myHash;\n\t\tthis._onQueryHovercardRef = onQueryHovercardRef;\n\t\tthis._onFetchProfileStart = onFetchProfileStart;\n\t\tthis._onFetchProfileSuccess = onFetchProfileSuccess;\n\t\tthis._onFetchProfileFailure = onFetchProfileFailure;\n\t\tthis._onHovercardShown = onHovercardShown;\n\t\tthis._onHovercardHidden = onHovercardHidden;\n\t\tthis._i18n = i18n;\n\t}\n\n\t/**\n\t * Queries hovercard refs on or within the target element\n\t *\n\t * @param {HTMLElement} target            - The element to query.\n\t * @param {string}      dataAttributeName - Data attribute name associated with Gravatar hashes.\n\t * @param {string}      [ignoreSelector]  - The selector to ignore certain elements.\n\t * @return {HTMLElement[]} - The queried hovercard refs.\n\t * @private\n\t */\n\t_queryHovercardRefs( target: HTMLElement, dataAttributeName: string, ignoreSelector?: string ) {\n\t\tlet refs: HTMLElement[] = [];\n\t\tconst camelAttrName = dataAttributeName.replace( /-([a-z])/g, ( g ) => g[ 1 ].toUpperCase() );\n\t\tconst ignoreRefs = ignoreSelector ? Array.from( dc.querySelectorAll( ignoreSelector ) ) : [];\n\t\tconst matchPath = 'gravatar.com/avatar/';\n\n\t\tif (\n\t\t\ttarget.dataset[ camelAttrName ] ||\n\t\t\t( target.tagName === 'IMG' && ( target as HTMLImageElement ).src.includes( matchPath ) )\n\t\t) {\n\t\t\trefs = [ target ];\n\t\t} else {\n\t\t\trefs = Array.from( target.querySelectorAll( `img[src*=\"${ matchPath }\"]` ) );\n\n\t\t\tif ( dataAttributeName ) {\n\t\t\t\trefs = [\n\t\t\t\t\t// Filter out images that already have the data attribute\n\t\t\t\t\t...refs.filter( ( img ) => ! img.hasAttribute( `data-${ dataAttributeName }` ) ),\n\t\t\t\t\t...Array.from< HTMLElement >( target.querySelectorAll( `[data-${ dataAttributeName }]` ) ),\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\n\t\tthis._hovercardRefs = refs\n\t\t\t.map( ( ref, idx ) => {\n\t\t\t\tif ( ignoreRefs.includes( ref ) ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tlet hash;\n\t\t\t\tlet params;\n\t\t\t\tconst dataAttrValue = ref.dataset[ camelAttrName ];\n\n\t\t\t\tif ( dataAttrValue ) {\n\t\t\t\t\thash = dataAttrValue.split( '?' )[ 0 ];\n\t\t\t\t\tparams = dataAttrValue;\n\t\t\t\t} else if ( ref.tagName === 'IMG' ) {\n\t\t\t\t\thash = ( ref as HTMLImageElement ).src.split( '/' ).pop().split( '?' )[ 0 ];\n\t\t\t\t\tparams = ( ref as HTMLImageElement ).src;\n\t\t\t\t}\n\n\t\t\t\tif ( ! hash ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tconst p = new URLSearchParams( params );\n\t\t\t\tconst d = p.get( 'd' ) || p.get( 'default' );\n\t\t\t\tconst f = p.get( 'f' ) || p.get( 'forcedefault' );\n\t\t\t\tconst r = p.get( 'r' ) || p.get( 'rating' );\n\t\t\t\tparams = [ d && `d=${ d }`, f && `f=${ f }`, r && `r=${ r }` ].filter( Boolean ).join( '&' );\n\n\t\t\t\treturn {\n\t\t\t\t\tid: `gravatar-hovercard-${ hash }-${ idx }`,\n\t\t\t\t\thash,\n\t\t\t\t\tparams: params ? `?${ params }` : '',\n\t\t\t\t\tref: this._onQueryHovercardRef( ref ) || ref,\n\t\t\t\t};\n\t\t\t} )\n\t\t\t.filter( Boolean );\n\n\t\treturn this._hovercardRefs;\n\t}\n\n\t/**\n\t * Creates a skeleton hovercard element.\n\t *\n\t * @return {HTMLDivElement} The created skeleton hovercard element.\n\t */\n\t_createHovercardSkeleton() {\n\t\tconst hovercard = dc.createElement( 'div' );\n\t\thovercard.className = `gravatar-hovercard gravatar-hovercard--skeleton${\n\t\t\tthis._additionalClass ? ` ${ this._additionalClass }` : ''\n\t\t}`;\n\n\t\thovercard.innerHTML = `\n\t\t\t<div class=\"gravatar-hovercard__inner\">\n\t\t\t\t<div class=\"gravatar-hovercard__header\">\n\t\t\t\t\t<div class=\"gravatar-hovercard__avatar-link\"></div>\n\t\t\t\t\t<div class=\"gravatar-hovercard__name-location-link\"></div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"gravatar-hovercard__footer\">\n\t\t\t\t\t<div class=\"gravatar-hovercard__social-link\"></div>\n\t\t\t\t\t<div class=\"gravatar-hovercard__profile-link\"\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n    `;\n\n\t\treturn hovercard;\n\t}\n\n\t/**\n\t * Creates a hovercard element with the provided profile data.\n\t *\n\t * @param {ProfileData} profileData               - The profile data to populate the hovercard.\n\t * @param {Object}      [options]                 - Optional parameters for the hovercard.\n\t * @param {string}      [options.additionalClass] - Additional CSS class for the hovercard.\n\t * @param {string}      [options.myHash]          - The hash of the current user.\n\t * @param {Object}      [options.i18n]            - The i18n object.\n\t * @return {HTMLDivElement}               - The created hovercard element.\n\t */\n\tstatic createHovercard: CreateHovercard = ( profileData, { additionalClass, myHash, i18n = {} } = {} ) => {\n\t\tconst {\n\t\t\thash,\n\t\t\tthumbnailUrl,\n\t\t\tpreferredUsername,\n\t\t\tdisplayName,\n\t\t\tcurrentLocation,\n\t\t\taboutMe,\n\t\t\taccounts = [],\n\t\t} = profileData;\n\n\t\tconst hovercard = dc.createElement( 'div' );\n\t\thovercard.className = `gravatar-hovercard${ additionalClass ? ` ${ additionalClass }` : '' }`;\n\n\t\tconst profileUrl = escUrl( `https://gravatar.com/${ preferredUsername }?utm_source=hovercard` );\n\t\tconst username = escHtml( displayName );\n\t\tconst isEditProfile = ! aboutMe && myHash === hash;\n\t\tconst renderSocialLinks = accounts\n\t\t\t.reduce( ( links, { url, shortname, iconUrl, name } ) => {\n\t\t\t\tconst idx = socialLinksOrder.indexOf( shortname );\n\n\t\t\t\tif ( idx !== -1 ) {\n\t\t\t\t\tlinks[ idx ] = `\n\t\t\t\t\t\t<a class=\"gravatar-hovercard__social-link\" href=\"${ escUrl( url ) }\" target=\"_blank\" data-service-name=\"${ shortname }\">\n\t\t\t\t\t\t\t<img class=\"gravatar-hovercard__social-icon\" src=\"${ escUrl( iconUrl ) }\" width=\"32\" height=\"32\" alt=\"${ escHtml(\n\t\t\t\t\t\tname\n\t\t\t\t\t) }\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t`;\n\t\t\t\t}\n\n\t\t\t\treturn links;\n\t\t\t}, [] )\n\t\t\t.join( '' );\n\n\t\thovercard.innerHTML = `\n\t\t\t<div class=\"gravatar-hovercard__inner\">\n\t\t\t\t<div class=\"gravatar-hovercard__header\">\n\t\t\t\t\t<a class=\"gravatar-hovercard__avatar-link\" href=\"${ profileUrl }\" target=\"_blank\">\n\t\t\t\t\t\t<img class=\"gravatar-hovercard__avatar\" src=\"${ escUrl( thumbnailUrl ) }\" width=\"56\" height=\"56\" alt=\"${ username }\" />\n\t\t\t\t\t</a>\n\t\t\t\t\t<a class=\"gravatar-hovercard__name-location-link\" href=\"${ profileUrl }\" target=\"_blank\">\n\t\t\t\t\t\t<h4 class=\"gravatar-hovercard__name\">${ username }</h4>\n\t\t\t\t\t\t${ currentLocation ? `<p class=\"gravatar-hovercard__location\">${ escHtml( currentLocation ) }</p>` : '' }\n\t\t\t\t\t</a>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"gravatar-hovercard__body\">\n\t\t\t\t\t${ aboutMe ? `<p class=\"gravatar-hovercard__about\">${ escHtml( aboutMe ) }</p>` : '' }\n\t\t\t\t</div>\n\t\t\t\t<div class=\"gravatar-hovercard__footer\">\n\t\t\t\t\t<div class=\"gravatar-hovercard__social-links\">\n\t\t\t\t\t\t<a class=\"gravatar-hovercard__social-link\" href=\"${ profileUrl }\" target=\"_blank\" data-service-name=\"gravatar\">\n\t\t\t\t\t\t\t<img class=\"gravatar-hovercard__social-icon\" src=\"https://secure.gravatar.com/icons/gravatar.svg\" width=\"32\" height=\"32\" alt=\"Gravatar\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t${ renderSocialLinks }\n\t\t\t\t\t</div>\n\t\t\t\t\t<a\n\t\t\t\t\t\tclass=\"gravatar-hovercard__profile-link${ isEditProfile ? ' gravatar-hovercard__profile-link--edit' : '' }\"\n\t\t\t\t\t\thref=\"${ isEditProfile ? 'https://gravatar.com/profiles/edit?utm_source=hovercard' : profileUrl }\"\n\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"gravatar-hovercard__profile-link-text\">\n\t\t\t\t\t\t\t${ isEditProfile ? __( i18n, 'Edit your profile' ) : __( i18n, 'View profile' ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t\t\t\t\t<path d=\"M12.6667 8.33338L9.16666 12.1667M12.6667 8.33338L2.66666 8.33338M12.6667 8.33338L9.16666 4.83338\" stroke-width=\"1.5\"/>\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</a>\n\t\t\t\t</div>\n\t\t\t</div>\n    `;\n\n\t\treturn hovercard;\n\t};\n\n\t/**\n\t * Waits for a specified delay and fetches the user's profile data,\n\t * then shows the hovercard relative to the ref element.\n\t *\n\t * @param {HovercardRef} hovercardRef - The hovercard ref object.\n\t * @return {void}\n\t * @private\n\t */\n\t_showHovercard( { id, hash, params, ref }: HovercardRef ) {\n\t\tconst timeoutId = setTimeout( () => {\n\t\t\tif ( dc.getElementById( id ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet hovercard: HTMLDivElement;\n\n\t\t\tif ( this._cachedProfiles.has( hash ) ) {\n\t\t\t\tconst profile = this._cachedProfiles.get( hash );\n\n\t\t\t\thovercard = Hovercards.createHovercard(\n\t\t\t\t\t{ ...profile, thumbnailUrl: profile.thumbnailUrl + params },\n\t\t\t\t\t{\n\t\t\t\t\t\tadditionalClass: this._additionalClass,\n\t\t\t\t\t\tmyHash: this._myHash,\n\t\t\t\t\t\ti18n: this._i18n,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\thovercard = this._createHovercardSkeleton();\n\n\t\t\t\tthis._onFetchProfileStart( hash );\n\n\t\t\t\tfetch( `${ BASE_API_URL }/${ hash }.json` )\n\t\t\t\t\t.then( ( res ) => res.json() )\n\t\t\t\t\t.then( ( data ) => {\n\t\t\t\t\t\t// API error handling\n\t\t\t\t\t\tif ( ! data?.entry ) {\n\t\t\t\t\t\t\t// The data will be an error message\n\t\t\t\t\t\t\tthrow new Error( data );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\thash: fetchedHash,\n\t\t\t\t\t\t\tthumbnailUrl,\n\t\t\t\t\t\t\tpreferredUsername,\n\t\t\t\t\t\t\tdisplayName,\n\t\t\t\t\t\t\tcurrentLocation,\n\t\t\t\t\t\t\taboutMe,\n\t\t\t\t\t\t\taccounts,\n\t\t\t\t\t\t} = data.entry[ 0 ];\n\n\t\t\t\t\t\tthis._cachedProfiles.set( hash, {\n\t\t\t\t\t\t\thash: fetchedHash,\n\t\t\t\t\t\t\tthumbnailUrl,\n\t\t\t\t\t\t\tpreferredUsername,\n\t\t\t\t\t\t\tdisplayName,\n\t\t\t\t\t\t\tcurrentLocation,\n\t\t\t\t\t\t\taboutMe,\n\t\t\t\t\t\t\taccounts: accounts?.map( ( { url, shortname, iconUrl, name }: Account ) => ( {\n\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t\tshortname,\n\t\t\t\t\t\t\t\ticonUrl,\n\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t} ) ),\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tconst profile = this._cachedProfiles.get( hash );\n\t\t\t\t\t\tconst hovercardInner = Hovercards.createHovercard(\n\t\t\t\t\t\t\t{ ...profile, thumbnailUrl: profile.thumbnailUrl + params },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tadditionalClass: this._additionalClass,\n\t\t\t\t\t\t\t\tmyHash: this._myHash,\n\t\t\t\t\t\t\t\ti18n: this._i18n,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t).firstElementChild;\n\n\t\t\t\t\t\thovercard.classList.remove( 'gravatar-hovercard--skeleton' );\n\t\t\t\t\t\thovercard.replaceChildren( hovercardInner );\n\n\t\t\t\t\t\tthis._onFetchProfileSuccess( hash, this._cachedProfiles.get( hash ) );\n\t\t\t\t\t} )\n\t\t\t\t\t.catch( ( error ) => {\n\t\t\t\t\t\thovercard.firstElementChild.classList.add( 'gravatar-hovercard__inner--error' );\n\t\t\t\t\t\thovercard.firstElementChild.innerHTML = `\n\t\t\t\t\t\t\t<img class=\"gravatar-hovercard__avatar\" src=\"https://2.gravatar.com/avatar/${ hash }${ params }\" width=\"56\" height=\"56\" alt=\"Avatar\" />\n\t\t\t\t\t\t\t<i class=\"gravatar-hovercard__error-message\">${\n\t\t\t\t\t\t\t\terror.message === 'User not found'\n\t\t\t\t\t\t\t\t\t? __( this._i18n, 'Sorry, we are unable to load this Gravatar profile.' )\n\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\tthis._i18n,\n\t\t\t\t\t\t\t\t\t\t\t'Sorry, we are unable to load this Gravatar profile. Please check your internet connection.'\n\t\t\t\t\t\t\t\t\t  )\n\t\t\t\t\t\t\t}</i>\n\t\t\t\t\t\t`;\n\n\t\t\t\t\t\tthis._onFetchProfileFailure( hash, error as Error );\n\t\t\t\t\t} );\n\t\t\t}\n\n\t\t\t// Set the hovercard ID here to avoid the show / hide side effect\n\t\t\thovercard.id = id;\n\t\t\t// Don't hide the hovercard when the mouse is over the hovercard from the ref\n\t\t\thovercard.addEventListener( 'mouseenter', () => clearInterval( this._hideHovercardTimeoutIds.get( id ) ) );\n\t\t\thovercard.addEventListener( 'mouseleave', () => this._hideHovercard( id ) );\n\n\t\t\t// Placing the hovercard at the top-level of the dc to avoid being clipped by overflow\n\t\t\tdc.body.appendChild( hovercard );\n\n\t\t\tconst { x, y, padding, paddingValue } = computePosition( ref, hovercard, {\n\t\t\t\tplacement: this._placement,\n\t\t\t\toffset: this._offset,\n\t\t\t\tautoFlip: this._autoFlip,\n\t\t\t} );\n\n\t\t\thovercard.style.position = 'absolute';\n\t\t\thovercard.style.left = `${ x }px`;\n\t\t\thovercard.style.top = `${ y }px`;\n\t\t\t// To bridge the gap between the ref and the hovercard,\n\t\t\t// ensuring that the hovercard remains visible when the mouse hovers over the gap\n\t\t\thovercard.style[ padding ] = `${ paddingValue }px`;\n\n\t\t\tthis._onHovercardShown( hash, hovercard );\n\t\t}, this._delayToShow );\n\n\t\tthis._showHovercardTimeoutIds.set( id, timeoutId );\n\t}\n\n\t/**\n\t * Waits for a specified delay and hides the hovercard.\n\t *\n\t * @param {string} id - The ID associated with the hovercard.\n\t * @return {void}\n\t * @private\n\t */\n\t_hideHovercard( id: string ) {\n\t\tconst timeoutId = setTimeout( () => {\n\t\t\tconst hovercard = dc.getElementById( id );\n\n\t\t\tif ( hovercard ) {\n\t\t\t\thovercard.remove();\n\t\t\t\tthis._onHovercardHidden( id, hovercard as HTMLDivElement );\n\t\t\t}\n\t\t}, this._delayToHide );\n\n\t\tthis._hideHovercardTimeoutIds.set( id, timeoutId );\n\t}\n\n\t/**\n\t * Handles the mouseenter event for hovercard refs.\n\t *\n\t * @param {MouseEvent} e            - The mouseenter event object.\n\t * @param              hovercardRef - The hovercard ref object.\n\t * @return {void}\n\t * @private\n\t */\n\t_handleMouseEnter( e: MouseEvent, hovercardRef: HovercardRef ) {\n\t\te.stopImmediatePropagation();\n\n\t\t// Don't hide the hovercard when the mouse is over the ref from the hovercard\n\t\tclearInterval( this._hideHovercardTimeoutIds.get( hovercardRef.id ) );\n\t\tthis._showHovercard( hovercardRef );\n\t}\n\n\t/**\n\t * Handles the mouseleave event for hovercard refs.\n\t *\n\t * @param {MouseEvent} e               - The mouseleave event object.\n\t * @param              hovercardRef    - The hovercard ref object.\n\t * @param              hovercardRef.id - The ID associated with the hovercard.\n\t * @return {void}\n\t * @private\n\t */\n\t_handleMouseLeave( e: MouseEvent, { id }: HovercardRef ) {\n\t\te.stopImmediatePropagation();\n\n\t\tclearInterval( this._showHovercardTimeoutIds.get( id ) );\n\t\tthis._hideHovercard( id );\n\t}\n\n\t/**\n\t * Attaches event listeners on or within the target element.\n\t *\n\t * @param {HTMLElement} target                    - The target element to set.\n\t * @param {Object}      [options={}]              - The optional parameters.\n\t * @param               options.dataAttributeName - Data attribute name associated with Gravatar hashes.\n\t * @param               options.ignoreSelector    - The selector to ignore certain elements.\n\t * @return {void}\n\t */\n\tattach: Attach = ( target, { dataAttributeName = 'gravatar-hash', ignoreSelector } = {} ) => {\n\t\tif ( ! target ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.detach();\n\n\t\tthis._queryHovercardRefs( target, dataAttributeName, ignoreSelector ).forEach( ( hovercardRef ) => {\n\t\t\thovercardRef.ref.addEventListener( 'mouseenter', ( e ) => this._handleMouseEnter( e, hovercardRef ) );\n\t\t\thovercardRef.ref.addEventListener( 'mouseleave', ( e ) => this._handleMouseLeave( e, hovercardRef ) );\n\t\t} );\n\t};\n\n\t/**\n\t * Removes event listeners from hovercard refs and resets the stored list of these refs.\n\t *\n\t * @return {void}\n\t */\n\tdetach: Detach = () => {\n\t\tif ( ! this._hovercardRefs.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._hovercardRefs.forEach( ( { ref } ) => {\n\t\t\tref.removeEventListener( 'mouseenter', () => this._handleMouseEnter );\n\t\t\tref.removeEventListener( 'mouseleave', () => this._handleMouseLeave );\n\t\t} );\n\n\t\tthis._hovercardRefs = [];\n\t};\n}\n","export type { Placement } from './compute-position';\nexport type {\n\tAccount,\n\tProfileData,\n\tCreateHovercard,\n\tAttach,\n\tDetach,\n\tOnQueryHovercardRef,\n\tOnFetchProfileStart,\n\tOnFetchProfileSuccess,\n\tOnFetchProfileFailure,\n\tOnHovercardShown,\n\tOnHovercardHidden,\n\tOptions,\n} from './core';\n\nexport { default as Hovercards } from './core';\n"],"names":["paddingMap","top","bottom","left","right","computingPosition","ref","card","_temp","_ref","_ref$placement","placement","_ref$offset","offset","_ref$autoFlip","autoFlip","refRect","getBoundingClientRect","cardRect","refScrollT","scrollY","refScrollB","refScrollR","scrollX","refScrollL","x","y","_placement$split","split","dir","align","Math","max","topSpace","bottomSpace","innerHeight","leftSpace","rightSpace","innerWidth","floatingSpaceV","height","floatingSpaceH","width","padding","paddingValue","escHtml","str","htmlEntities","replace","match","escUrl","url","encodeURI","__","i18n","key","computePosition","BASE_API_URL","socialLinksOrder","dc","document","Hovercards","_this","_ref$delayToShow","delayToShow","_ref$delayToHide","delayToHide","_ref$additionalClass","additionalClass","_ref$myHash","myHash","_ref$onQueryHovercard","onQueryHovercardRef","_ref$onFetchProfileSt","onFetchProfileStart","_ref$onFetchProfileSu","onFetchProfileSuccess","_ref$onFetchProfileFa","onFetchProfileFailure","_ref$onHovercardShown","onHovercardShown","_ref$onHovercardHidde","onHovercardHidden","_ref$i18n","_i18n","_hovercardRefs","_showHovercardTimeoutIds","Map","_hideHovercardTimeoutIds","_cachedProfiles","attach","target","_temp2","_ref2","_ref2$dataAttributeNa","dataAttributeName","ignoreSelector","detach","_queryHovercardRefs","forEach","hovercardRef","addEventListener","e","_handleMouseEnter","_handleMouseLeave","length","_ref3","removeEventListener","_placement","_autoFlip","_offset","_delayToShow","_delayToHide","_additionalClass","_myHash","_onQueryHovercardRef","_onFetchProfileStart","_onFetchProfileSuccess","_onFetchProfileFailure","_onHovercardShown","_onHovercardHidden","_proto","prototype","_this2","refs","camelAttrName","g","toUpperCase","ignoreRefs","Array","from","querySelectorAll","matchPath","dataset","tagName","src","includes","concat","filter","img","hasAttribute","map","idx","hash","params","dataAttrValue","pop","p","URLSearchParams","d","get","f","r","Boolean","join","id","_createHovercardSkeleton","hovercard","createElement","className","innerHTML","_showHovercard","_ref4","_this3","timeoutId","setTimeout","getElementById","has","profile","createHovercard","_extends","thumbnailUrl","fetch","then","res","json","data","entry","Error","_data$entry$","fetchedHash","preferredUsername","displayName","currentLocation","aboutMe","accounts","set","_ref5","shortname","iconUrl","name","hovercardInner","firstElementChild","classList","remove","replaceChildren","error","add","message","clearInterval","_hideHovercard","body","appendChild","_computePosition","style","position","_this4","stopImmediatePropagation","_ref6","profileData","_temp3","_ref7","_ref7$i18n","_profileData$accounts","profileUrl","username","isEditProfile","renderSocialLinks","reduce","links","_ref8","indexOf","default"],"sourceRoot":""}