@behold/widget 0.1.29 → 0.1.30
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{ErrorMessage-iukAy4KE.js → ErrorMessage-dZizXp4B.js} +1 -1
- package/dist/GalleryWall-LWkZ6rV3.js +1 -0
- package/dist/Grid-XrVo9P1h.js +1 -0
- package/dist/PopoverGallery-bPrpZaCR.js +1 -0
- package/dist/Widget-k0vrivbv.js +1 -0
- package/dist/Widget.js +1 -1
- package/dist/base-kejrZ9Qe.js +1 -0
- package/dist/elements/BasePost.d.ts +2 -0
- package/dist/elements/BasePost.d.ts.map +1 -1
- package/dist/elements/PopoverGallery.d.ts.map +1 -1
- package/dist/elements/PopoverSlideAlbum.d.ts +1 -1
- package/dist/elements/PopoverSlideAlbum.d.ts.map +1 -1
- package/dist/elements/PopoverSlideVideo.d.ts.map +1 -1
- package/dist/lib/utils.d.ts +1 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/widgets/GalleryWall.d.ts.map +1 -1
- package/dist/widgets/Grid.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/GalleryWall-YjqK_Fsr.js +0 -1
- package/dist/Grid-UXYoSdwm.js +0 -1
- package/dist/PopoverGallery-hU36eE7J.js +0 -1
- package/dist/Widget-D9I4vSzG.js +0 -1
- package/dist/base-SePYPKrr.js +0 -1
@@ -1 +1 @@
|
|
1
|
-
import{B as e,c as t,s}from"./Widget-
|
1
|
+
import{B as e,c as t,s}from"./Widget-k0vrivbv.js";var n=":host{align-items:center;background:#f1f1f1 url(https://behold.pictures/widget:error-background.webp) 0 no-repeat;background-size:auto 100%;border:none;border-radius:20px;box-shadow:none;box-sizing:border-box;color:#000;display:flex;height:200px;justify-content:space-between;margin:0;max-width:750px;min-width:50px;outline:none;overflow:hidden;width:100%}:host *{box-sizing:border-box}:host(.large){height:180px}:host(.medium),:host(.small){background:#f1f1f1 url(https://behold.pictures/widget:error-background-small.webp) top no-repeat;background-size:auto 186px;flex-direction:column;height:auto}.logo{align-items:center;background:linear-gradient(90deg,rgba(0,0,0,.75) 10%,rgba(0,0,0,.5) 75%,transparent);display:flex;flex-grow:0;flex-shrink:0;height:100%;justify-content:center;padding:0 10px 5px 0;width:220px}.logo svg{height:40px;width:auto}:host(.large) .logo{width:180px}:host(.large) .logo svg{height:35px}:host(.medium) .logo,:host(.small) .logo{background:linear-gradient(180deg,rgba(0,0,0,.75) 10%,rgba(0,0,0,.5) 40%,transparent);height:150px;width:100%}.message{align-items:center;display:flex;flex-direction:column;flex-grow:1;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:16px;gap:15px;justify-content:center;line-height:1.5;padding:20px 60px 20px 80px;text-align:center}.message a{color:#000;display:inline-block;text-decoration:underline}:host(.large) .message{font-size:15px;gap:10px;padding:20px 30px 20px 70px}:host(.medium) .message{font-size:16px;gap:15px;padding:40px 30px}:host(.small) .message{font-size:15px;gap:15px;padding:30px 20px}.message__title{align-items:center;display:flex;font-size:20px;font-weight:500;justify-content:center}.message__title svg{height:25px;margin-right:15px;width:25px}:host(.large) .message__title{font-size:18px}:host(.large) .message__title svg{height:20px;margin-right:10px;width:20px}:host(.medium) .message__title,:host(.small) .message__title{flex-direction:column;font-size:17px}:host(.medium) .message__title svg,:host(.small) .message__title svg{margin-bottom:7px;margin-right:0}";class l extends e{label="ErrorMessage";shadow;logoEl;styleEl;errorTitleEl;errorMessageEl;errorMessageTextEl;errorMessage;constructor(){super(),this.shadow=this.attachShadow({mode:"open"}),this.onPropChange(this.handlePropChange,["errorMessage"]),this.onConnect((()=>{this.onResize(this,this,this.handleResize)})),this.onConnect((()=>{this.render()}))}handlePropChange({changedProp:e}){this.render()}render(){if(!this.errorMessage)return;let e='<?xml version="1.0" encoding="utf-8"?>\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 20.5 20.5" enable-background="new 0 0 20.5 20.5" xml:space="preserve">\n<g>\n\t<path fill="#010101" d="M10.2,20.5c-1.2,0-2.4-0.2-3.8-0.5c-2.9-0.7-5.3-3.1-6-6.1C0.2,12.7,0,11.4,0,10.3C0,9.2,0.1,8,0.4,6.8\n\t\tC1.1,3.6,3.7,1,6.9,0.4c2.4-0.5,4.4-0.5,6.8,0c3.3,0.7,5.8,3.2,6.5,6.5c0.2,1.1,0.4,2.3,0.4,3.3c0,1.1-0.1,2.3-0.4,3.5l0,0\n\t\tc-0.7,3.2-3.2,5.7-6.4,6.4C12.5,20.4,11.3,20.5,10.2,20.5z M10.2,1.5c-0.9,0-2,0.1-3,0.3C4.5,2.4,2.5,4.5,1.9,7.1\n\t\tc-0.2,1.1-0.4,2.2-0.4,3.1c0,1,0.1,2.2,0.4,3.4c0.6,2.4,2.5,4.4,4.9,5c2.3,0.6,4.2,0.6,6.6,0.1c2.6-0.6,4.7-2.7,5.2-5.3\n\t\tc0.2-1.1,0.3-2.1,0.3-3.2c0-1-0.1-2-0.3-3c-0.5-2.7-2.6-4.7-5.3-5.3C12.2,1.6,11.2,1.5,10.2,1.5z"/>\n</g>\n<g>\n\t<g>\n\t\t<path fill="#010101" d="M10.2,13.5c0.6,0,1,0.5,1,1.1c0,0.6-0.5,1.1-1,1.1s-1-0.5-1-1.1C9.2,14,9.7,13.5,10.2,13.5z M9.6,12.3\n\t\t\tL9.3,4.7h1.9l-0.3,7.5H9.6z"/>\n\t</g>\n</g>\n</svg>',s="Error";this.errorMessage.includes("Upgrade")&&(e='<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17.54 17.54"><path d="M8.77,17.54c-2.35,0-4.7-.81-6.33-2.44C-.81,11.84-.81,5.69,2.44,2.44,5.69-.81,11.84-.81,15.1,2.44c3.26,3.25,3.25,9.4,0,12.66-1.63,1.63-3.98,2.44-6.33,2.44ZM8.77,1.51c-1.97,0-3.94,.67-5.27,1.99C.84,6.16,.84,11.38,3.5,14.04c2.66,2.66,7.88,2.66,10.54,0,2.66-2.66,2.66-7.88,0-10.54-1.33-1.33-3.3-1.99-5.27-1.99Z"/><path d="M8.76,13.02c-.41,0-.75-.34-.75-.75V5.26c0-.41,.34-.75,.75-.75s.75,.34,.75,.75v7.01c0,.41-.34,.75-.75,.75Z"/><path d="M6.36,8.42c-.19,0-.38-.07-.53-.22-.29-.29-.29-.77,0-1.06l2.41-2.41c.29-.29,.77-.29,1.06,0s.29,.77,0,1.06l-2.41,2.41c-.15,.15-.34,.22-.53,.22Z"/><path d="M11.17,8.42c-.19,0-.38-.07-.53-.22l-2.41-2.41c-.29-.29-.29-.77,0-1.06s.77-.29,1.06,0l2.41,2.41c.29,.29,.29,.77,0,1.06-.15,.15-.34,.22-.53,.22Z"/></svg>',s="Upgrade Required"),this.logoEl=t({type:"a",classes:"logo",contents:'<?xml version="1.0" encoding="utf-8"?>\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 91.5 29.5" enable-background="new 0 0 91.5 29.5" xml:space="preserve">\n<g>\n\t<path fill="#3BA566" d="M12,11.7c0.8,0,1.8,0.1,2.8,0.3c1.3,0.3,2.4,1.3,2.6,2.6c0.2,1,0.3,1.9,0.3,2.8s-0.1,1.9-0.3,2.9\n\t\tc-0.3,1.3-1.3,2.3-2.6,2.6c-1,0.2-2,0.4-2.8,0.4c-0.9,0-1.9-0.1-3-0.4s-2-1.2-2.3-2.3s-0.4-2.1-0.4-3c0-0.8,0.1-1.8,0.3-2.8\n\t\tc0.3-1.3,1.3-2.4,2.6-2.6C10.2,11.9,11.2,11.7,12,11.7 M12,5.5c-1.4,0-2.8,0.2-4,0.5c-3.8,0.7-6.7,3.6-7.5,7.4\n\t\tC0.2,14.7,0,16.1,0,17.5c0,1.6,0.2,3.1,0.6,4.5c0.8,3.4,3.5,6.1,6.9,7c1.4,0.3,2.9,0.5,4.5,0.5c1.5,0,2.9-0.2,4.2-0.5\n\t\tc3.7-0.8,6.5-3.7,7.3-7.4c0.3-1.3,0.5-2.7,0.5-4.2c0-1.4-0.2-2.8-0.4-4c-0.8-3.8-3.7-6.6-7.5-7.4C14.8,5.7,13.4,5.5,12,5.5L12,5.5z\n\t\t"/>\n</g>\n<g id="type">\n\t<path fill="#FFFFFF" d="M42.2,20.8c0,2.6-1.9,4.3-5.1,4.3h-5.2c0.5-1.4,0.6-2.5,0.6-3.9v-7.7c0-1.4-0.1-2.5-0.6-3.9H37\n\t\tc2.4,0,4.7,1,4.7,3.6c0,2.1-1.4,3.4-3.1,3.9C40.5,17.5,42.2,18.5,42.2,20.8z M35.2,10.4c0,1.1-0.1,2-0.1,3v3.4h1.4\n\t\tc1.7,0,2.5-1.2,2.5-3.1c0-2.2-1-3.4-3.2-3.4C35.6,10.4,35.4,10.4,35.2,10.4z M39.5,21.3c0-2.4-1.4-3.6-3.3-3.6\n\t\tc-0.2,0-0.6,0-1.1,0.1v3.5c0,0.9,0,2,0.1,2.9c0.5,0.1,0.9,0.1,1.4,0.1C38.6,24.3,39.5,23.2,39.5,21.3z"/>\n\t<path fill="#FFFFFF" d="M52.7,19.1h-6.5c0.2,2.5,1.2,4.1,3.8,4.1c1.1,0,1.8-0.3,2.6-0.9c-0.2,1.6-1.5,3.1-3.9,3.1c-3,0-5-2.4-5-6.2\n\t\tc0-3.4,1.6-6.4,5-6.4c2.9,0,4,2.1,4,4.5C52.7,17.3,52.7,19.1,52.7,19.1z M50.2,17.3c0-2.5-0.7-3.6-1.8-3.6c-1.3,0-2.1,1.5-2.1,4.3\n\t\tv0.3h3C50,18.4,50.2,18.3,50.2,17.3z"/>\n\t<path fill="#FFFFFF" d="M64,25.2h-2.8c-0.2-1.1-0.3-2.4-0.3-3.8v-4.6c0-1.4-0.5-2.1-1.5-2.1c-0.6,0-1.3,0.2-2.1,1.2v5.6\n\t\tc0,1.3,0.1,2.3,0.6,3.6h-3.6c0.5-1.3,0.6-2.3,0.6-3.6v-8.2c0-1.5,0-2.9-0.6-4c1.1-0.3,2-0.7,3-1.2v7c0.9-1.6,2.2-2.2,3.4-2.2\n\t\tc1.6,0,2.6,1,2.6,3.4v5C63.4,22.7,63.5,23.8,64,25.2z"/>\n\t<path fill="#FFFFFF" d="M65.4,19.2c0-3.8,2-6.3,5-6.3c2.9,0,4.8,2.7,4.8,6.3c0,3.8-2,6.3-5,6.3C67.3,25.4,65.4,22.8,65.4,19.2z\n\t\t M72.4,19.9c0-3.1-0.7-6.1-2.4-6.1c-1.3,0-1.9,1.7-1.9,4.6c0,3.2,0.7,6.1,2.4,6.1C71.8,24.5,72.4,23,72.4,19.9z"/>\n\t<path fill="#FFFFFF" d="M77.3,21.5v-8.2c0-1.5,0-2.9-0.6-4c1.1-0.3,2-0.7,3-1.2v13.4c0,1.3,0.1,2.3,0.6,3.6h-3.6\n\t\tC77.2,23.8,77.3,22.8,77.3,21.5z"/>\n\t<path fill="#FFFFFF" d="M89,25.2c-0.2-0.3-0.4-0.8-0.4-1.4c-0.7,1.1-1.6,1.5-2.8,1.5c-2.2,0-4-1.9-4-5.6c0-4.4,2.4-6.8,5-6.8\n\t\tc0.7,0,1.2,0.1,1.7,0.4l0,0c0-1.4,0-2.9-0.6-3.9c1.1-0.3,2-0.7,3-1.2v13.3c0,1.3,0.1,2.2,0.6,3.6H89V25.2z M88.5,23.1v-6.6\n\t\tc0-2-0.8-2.6-1.7-2.6c-1.4,0-2.3,1.5-2.3,4.8c0,3.4,1.1,4.9,2.8,4.9C87.8,23.5,88.2,23.4,88.5,23.1z"/>\n</g>\n<g>\n\t<path fill="#FFFFFF" d="M32.3,4.7V0.1h2.2c1,0,1.6,0.7,1.6,1.5c0,0.8-0.6,1.5-1.6,1.5h-1.2v1.7H32.3z M34.3,0.9h-1.1v1.3h1.1\n\t\tC34.7,2.2,35,2,35,1.6C35,1.2,34.7,0.9,34.3,0.9z"/>\n\t<path fill="#FFFFFF" d="M39.5,0C41,0,42,1,42,2.4c0,1.4-1,2.4-2.4,2.4c-1.4,0-2.4-1-2.4-2.4C37.1,1,38.1,0,39.5,0z M39.5,0.9\n\t\tc-0.9,0-1.4,0.7-1.4,1.5c0,0.9,0.6,1.5,1.4,1.5S41,3.3,41,2.4C41,1.5,40.4,0.9,39.5,0.9z"/>\n\t<path fill="#FFFFFF" d="M46.8,4.7L46,1.5l-0.8,3.2h-1.1l-1.3-4.7h1.1l0.8,3.4l0.9-3.4h0.8l0.9,3.4l0.8-3.4h1.1l-1.3,4.7H46.8z"/>\n\t<path fill="#FFFFFF" d="M50.4,4.7V0.1h3.3v0.9h-2.3v1h2.3v0.9h-2.3v1.1h2.3v0.9H50.4z"/>\n\t<path fill="#FFFFFF" d="M57.8,4.7l-0.9-1.7h-0.7v1.7h-1V0.1h2.2c1,0,1.6,0.6,1.6,1.5c0,0.8-0.5,1.3-1,1.4l1.1,1.8H57.8z M57.2,0.9\n\t\th-1v1.3h1c0.4,0,0.7-0.3,0.7-0.6C57.9,1.2,57.6,0.9,57.2,0.9z"/>\n\t<path fill="#FFFFFF" d="M60.4,4.7V0.1h3.3v0.9h-2.3v1h2.3v0.9h-2.3v1.1h2.3v0.9H60.4z"/>\n\t<path fill="#FFFFFF" d="M65.1,4.7V0.1H67c1.5,0,2.5,0.9,2.5,2.3c0,1.4-1,2.3-2.5,2.3H65.1z M66.1,3.9H67c0.9,0,1.5-0.7,1.5-1.5\n\t\tC68.4,1.6,67.9,1,67,1h-0.8V3.9z"/>\n\t<path fill="#FFFFFF" d="M73.3,4.7V0.1h2.5c0.9,0,1.3,0.6,1.3,1.2c0,0.6-0.4,1-0.8,1.1c0.5,0.1,0.9,0.6,0.9,1.1\n\t\tc0,0.7-0.5,1.3-1.4,1.3H73.3z M74.3,2h1.2c0.3,0,0.5-0.2,0.5-0.5c0-0.3-0.2-0.5-0.5-0.5h-1.2V2z M74.3,3.9h1.3\n\t\tc0.4,0,0.6-0.2,0.6-0.6c0-0.3-0.2-0.5-0.6-0.5h-1.3V3.9z"/>\n\t<path fill="#FFFFFF" d="M79.8,4.7V2.8L78,0.1h1.1L80.3,2l1.1-1.9h1.1l-1.8,2.8v1.9H79.8z"/>\n</g>\n</svg>',attributes:{href:"https://behold.so",target:"_blank","aria-label":"behold"}}),this.errorTitleEl=t({classes:"message__title",contents:[e,s]}),this.errorMessageTextEl=t({classes:"message__inner"}),this.errorMessageTextEl.innerHTML=this.errorMessage?.replace("Upgrade your plan",'<a href="https://app.behold.so/account" target="blank">Upgrade your plan</a>'),this.errorMessageEl=t({classes:"message",contents:[this.errorTitleEl,this.errorMessageTextEl]}),this.styleEl=t({type:"style",contents:n.toString()}),this.shadow.replaceChildren(this.logoEl,this.errorMessageEl,this.styleEl)}handleResize(e){const t=e?.borderBoxSize?.[0]?.inlineSize||0;let n="xlarge";t<600&&(n="large"),t<500&&(n="medium"),t<250&&(n="small");["small","medium","large","xlarge"].forEach((e=>{s(this,{[`${e}`]:e===n})}))}static register(e="behold-error-message"){return customElements.get(e)||customElements.define(e,l),e}}export{l as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{c as t,s as e,a as s,f as i,t as a}from"./Widget-k0vrivbv.js";import{B as o,I as n,V as l,A as h,s as r,g as d}from"./base-kejrZ9Qe.js";class p extends o{label="GalleryWall";widgetSettings;feedMetadata;posts;previewLoadingColors=null;containerEl;heightRefEl;postEls;popoverGalleryEl;appliedBreakpoint;medianPaletteHSL;setupIsComplete=!1;popupGallery;constructor(){super(),this.onPropChange(this.handlePropChange,["widgetSettings","feedMetadata","posts","previewLoadingColors"],["widgetSettings","feedMetadata","posts"]),n.register(),l.register(),h.register(),this.handlePostClick=this.handlePostClick.bind(this),this.addEventListener("post-focus-next",this.handleFocusNextPost),this.addEventListener("post-focus-previous",this.handleFocusPreviousPost),this.onConnect((()=>{this.style.opacity="0",this.heightRefEl=t({classes:"height-ref"}),this.containerEl=t({type:"figure",classes:"posts",contents:[this.heightRefEl]}),this.renderWidget(this.containerEl,[r,".posts{display:block;min-height:100%;width:100%}.height-ref{position:relative}.post{-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;border:none;color:inherit;display:block;font:inherit;height:100px;left:0;line-height:normal;overflow:hidden;position:absolute;top:0;transform-origin:top left;transition:background .3s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100px}.post--placeholder{background-color:#dedede;position:absolute}"]),this.setAttribute("tabindex","0"),this.setAttribute("aria-label","Gallery of Instagram posts. Shift + arrow keys to navigate"),this.onResize(this,this.containerEl,this.handleResize)}))}handlePropChange({changedProp:t}){switch(this.setupIsComplete||(this.setup(),this.setupIsComplete=!0),t){case"posts":this.handlePostsChange();break;case"widgetSettings":this.handleSettingsChange();break;case"feedMetadata":this.handleMetadataChange();break;case"previewLoadingColors":this.postEls.forEach((t=>{t.previewLoadingColors=this.previewLoadingColors})),e(this,{"is-previewing-loading-colors":!!this.previewLoadingColors})}}handlePostsChange(){this.postEls=[],this.renderBreakpoint(this.appliedBreakpoint,!0),this.popoverGalleryEl&&(this.popoverGalleryEl.posts=this.posts)}handleSettingsChange(){"openPopupGallery"===this.widgetSettings.onPostClick&&this.enablePopoverGallery(),this.renderBreakpoint(this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings.breakpoints)),this.postEls.forEach((t=>{t.widgetSettings=this.widgetSettings}))}handleMetadataChange(){let t=`from @${this.feedMetadata.username}`;this.feedMetadata.hashtags?.length&&(t=`from hashtag${this.feedMetadata.hashtags.length>1?"s":""} ${this.feedMetadata.hashtags.join(", ")}`),this.setAttribute("aria-label",`Gallery of Instagram posts ${t}. Shift + arrow keys to navigate`),this.postEls.forEach((t=>{t.feedMetadata=this.feedMetadata}))}setup(){if("transparent"!==this.widgetSettings.loadingColor){const t=this.posts.filter((t=>t.colorPalette)).map((t=>t.colorPalette));this.medianPaletteHSL=d(t,this.widgetSettings.loadingColor)}const t=this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings.breakpoints);this.renderBreakpoint(t),this.style.opacity=""}async enablePopoverGallery(){const{default:t}=await import("./PopoverGallery-bPrpZaCR.js");t.register(),this.popoverGalleryEl=document.createElement("behold-popover-gallery"),Object.assign(this.popoverGalleryEl,{widgetSettings:this.widgetSettings,feedMetadata:this.feedMetadata,posts:this.posts,closeFocusEl:this,onSlideChange:t=>{this.popoverGalleryEl.closeFocusEl=this.postEls[t]}})}handleResize(t){const e=t.contentBoxSize?.[0]?.inlineSize,s=this.widgetSettings.breakpoints,i=this.getMatchingBreakpoint(e,s);this.renderBreakpoint(i)}handleFocusPreviousPost(){if(!this.postEls.length)return;let t=[...this.heightRefEl.children].indexOf(this.shadow.activeElement?.parentElement);t>0?t-=1:t=this.postEls.length-1,this.postEls[t].focus()}handleFocusNextPost(){if(!this.postEls.length)return;let t=[...this.heightRefEl.children].indexOf(this.shadow.activeElement?.parentElement);t>-1&&t<this.postEls.length-1?t+=1:t=0,this.postEls[t].focus()}handlePostClick(t){this.popoverGalleryEl.open(this.postEls.indexOf(t),t)}renderPosts(t){this.cancelRaf("renderPosts"),this.postEls=this.createPostEls(t),this.raf((()=>{this.heightRefEl.replaceChildren(...this.postEls)}),"renderPosts")}getMatchingBreakpoint(t,e){return Object.entries(e).map((([t,e])=>({width:t,...e}))).filter((t=>"default"!==t.width)).sort(((t,e)=>e.width.localeCompare(t.width))).reduce(((e,s)=>t<=parseInt(s.width)?s:e),{...e.default,numPosts:e.default.galleryWallLayout.length})}renderBreakpoint(t,e=!1){this.cancelRaf("setContainerHeight"),this.postEls||(e=!0);const a=this.appliedBreakpoint;this.appliedBreakpoint=t;const{gap:o,borderRadius:n,numPosts:l,galleryWallLayout:h,galleryWallNamedLayout:r}=t;switch(this.widgetSettings.alignment){case"left":this.style.justifyContent="flex-start";break;case"right":this.style.justifyContent="flex-end";break;default:this.style.justifyContent="center"}this.widgetSettings.maxWidth&&this.widgetSettings.constrainWidth&&this.containerEl.style.maxWidth!==`${this.widgetSettings.maxWidth}px`&&(this.containerEl.style.maxWidth=`${this.widgetSettings.maxWidth}px`),this.widgetSettings.constrainWidth||(this.containerEl.style.maxWidth=""),this.containerEl.setAttribute("data-hover-effect",this.widgetSettings.hoverEffect),s(this.containerEl,"--post-border-radius",`${n}%`),(a?.numPosts!==l||a?.galleryWallNamedLayout!==r.toString()||e)&&this.renderPosts(t);const d=this.containerEl.offsetWidth,p=parseInt(o.x)/1e3*d,g=parseInt(o.y)/1e3*d;this.postEls.forEach(((t,e)=>{const[s,i,a,o]=h?.[e]?h[e].split(",").map((t=>parseInt(t))):[0,0,10,10],n=s*(d/100)+p/2,l=i*(d/100);t.style.transform=`translate(${n}px, ${l}px`,t.style.width=a*(d/100)-p+"px",t.style.height=o*(d/100)-g+"px"})),i(),this.raf((()=>{this.setContainerHeight()}),"setContainerHeight")}createPostEls(e){const{gap:s}=e,i=e?.numPosts||this.posts?.length||200,a=this.posts.filter(((t,e)=>e<i)).map(((e,i,a)=>{let o="behold-image-post";"VIDEO"===e.mediaType&&(o="behold-video-post"),"CAROUSEL_ALBUM"===e.mediaType&&(o="behold-album-post");return t({type:o,props:{post:e,widgetSettings:this.widgetSettings,feedMetadata:this.feedMetadata,medianPaletteHSL:this.medianPaletteHSL,onClick:this.handlePostClick,hasRowGap:"0"!=`${s.y}`,index:i,totalPosts:a.length}})}));return a.length<e.galleryWallLayout.length&&e.galleryWallLayout.filter(((t,e)=>e>=a.length)).forEach((e=>{const s=t({classes:"post post--placeholder"});a.push(s)})),a}setContainerHeight=a((()=>{this.style.height=`${this.heightRefEl.scrollHeight}px`}),10,this);static register(t="behold-gallery-wall"){return customElements.get(t)||customElements.define(t,p),t}}export{p as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{c as t,s as e,f as s,a as i}from"./Widget-k0vrivbv.js";import{B as a,I as o,V as n,A as h,s as l,g as r}from"./base-kejrZ9Qe.js";class d extends a{label="Grid";widgetSettings;feedMetadata;posts;previewLoadingColors=null;containerEl;postEls;popoverGalleryEl;appliedBreakpoint;medianPaletteHSL;setupIsComplete=!1;popupGallery;constructor(){super(),this.onPropChange(this.handlePropChange,["widgetSettings","feedMetadata","posts","previewLoadingColors"],["widgetSettings","feedMetadata","posts"]),o.register(),n.register(),h.register(),this.handlePostClick=this.handlePostClick.bind(this),this.addEventListener("post-focus-next",this.handleFocusNextPost),this.addEventListener("post-focus-previous",this.handleFocusPreviousPost),this.onConnect((()=>{this.containerEl=t({type:"figure",classes:"posts"}),this.renderWidget(this.containerEl,[l]),this.setAttribute("tabindex","0"),this.setAttribute("aria-label","Gallery of Instagram posts. Shift + arrow keys to navigate"),this.onResize(this,this,this.handleResize)}))}handlePropChange({changedProp:t}){switch(this.setupIsComplete||(this.setup(),this.setupIsComplete=!0),t){case"posts":this.handlePostsChange();break;case"widgetSettings":this.handleSettingsChange();break;case"feedMetadata":this.handleMetadataChange();break;case"previewLoadingColors":this.postEls.forEach((t=>{t.previewLoadingColors=this.previewLoadingColors})),e(this,{"is-previewing-loading-colors":!!this.previewLoadingColors})}}handlePostsChange(){this.postEls=[],this.renderBreakpoint(this.appliedBreakpoint,!0),this.popoverGalleryEl&&(this.popoverGalleryEl.posts=this.posts)}handleSettingsChange(){"openPopupGallery"===this.widgetSettings.onPostClick&&this.enablePopoverGallery();const t=this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings.breakpoints);this.renderBreakpoint(t),this.postEls.forEach((t=>{t.widgetSettings=this.widgetSettings}))}handleMetadataChange(){let t=`from @${this.feedMetadata.username}`;this.feedMetadata.hashtags?.length&&(t=`from hashtag${this.feedMetadata.hashtags.length>1?"s":""} ${this.feedMetadata.hashtags.join(", ")}`),this.setAttribute("aria-label",`Gallery of Instagram posts ${t}. Shift + arrow keys to navigate`),this.postEls.forEach((t=>{t.feedMetadata=this.feedMetadata}))}setup(){if("transparent"!==this.widgetSettings.loadingColor){const t=this.posts.filter((t=>t.colorPalette)).map((t=>t.colorPalette));this.medianPaletteHSL=r(t,this.widgetSettings.loadingColor)}const t=this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings.breakpoints);this.renderBreakpoint(t),this.postEls.forEach((t=>{t.widgetSettings=this.widgetSettings,t.feedMetadata=this.feedMetadata}))}async enablePopoverGallery(){const{default:t}=await import("./PopoverGallery-bPrpZaCR.js");t.register(),this.popoverGalleryEl=document.createElement("behold-popover-gallery"),Object.assign(this.popoverGalleryEl,{widgetSettings:this.widgetSettings,feedMetadata:this.feedMetadata,posts:this.posts,closeFocusEl:this,onSlideChange:t=>{this.popoverGalleryEl.closeFocusEl=this.postEls[t]}})}handleResize(t){const e=t.contentBoxSize?.[0]?.inlineSize,s=this.widgetSettings.breakpoints,i=this.getMatchingBreakpoint(e,s);this.renderBreakpoint(i)}handleFocusPreviousPost(){if(!this.postEls.length)return;let t=[...this.containerEl.children].indexOf(this.shadow.activeElement?.parentElement);t>0?t-=1:t=this.postEls.length-1,this.postEls[t].focus()}handleFocusNextPost(){if(!this.postEls.length)return;let t=[...this.containerEl.children].indexOf(this.shadow.activeElement?.parentElement);t>-1&&t<this.postEls.length-1?t+=1:t=0,this.postEls[t].focus()}handlePostClick(t){this.popoverGalleryEl.open(this.postEls.indexOf(t),t)}renderPosts(t){this.cancelRaf("renderPosts"),this.postEls=this.createPostEls(t),this.raf((()=>{this.containerEl.replaceChildren(...this.postEls)}),"renderPosts")}getMatchingBreakpoint(t,e){return Object.entries(e).map((([t,e])=>({width:t,...e}))).filter((t=>"default"!==t.width)).sort(((t,e)=>e.width.localeCompare(t.width))).reduce(((e,s)=>t<=parseInt(s.width)?s:e),{...e.default,numPosts:this.posts.length})}renderBreakpoint(t,e=!1){this.postEls||(e=!0);const a=this.appliedBreakpoint,{numColumns:o,gap:n,borderRadius:h,numPosts:l}=t;switch(a?.numPosts>l&&(this.containerEl.replaceChildren(),s()),this.widgetSettings.alignment){case"left":this.style.justifyContent="flex-start";break;case"right":this.style.justifyContent="flex-end";break;default:this.style.justifyContent="center"}this.widgetSettings.maxWidth&&this.widgetSettings.constrainWidth&&this.containerEl.style.maxWidth!==`${this.widgetSettings.maxWidth}px`&&(this.containerEl.style.maxWidth=`${this.widgetSettings.maxWidth}px`),this.widgetSettings.constrainWidth||(this.containerEl.style.maxWidth=""),this.containerEl.style.gridTemplateColumns=`repeat(${o}, 1fr)`,this.containerEl.style.gap=`${n.y}px ${n.x}px`,this.containerEl.setAttribute("data-hover-effect",this.widgetSettings.hoverEffect),i(this.containerEl,"--post-border-radius",`${h}%`),(a?.numPosts!==l||e)&&this.renderPosts(t),this.postEls.forEach(((e,s)=>{e.hasRowGap="0"!=`${t.gap.y}`})),this.appliedBreakpoint=t}createPostEls(e){const{numPosts:s,numColumns:i,gap:a}=e;return this.posts.filter(((t,s)=>s<(e?.numPosts||this.posts?.length||200))).map(((e,o,n)=>{const h=Math.ceil((s||this.posts.length)/i);let l="behold-image-post";"VIDEO"===e.mediaType&&(l="behold-video-post"),"CAROUSEL_ALBUM"===e.mediaType&&(l="behold-album-post");return t({type:l,props:{post:e,widgetSettings:this.widgetSettings,feedMetadata:this.feedMetadata,medianPaletteHSL:this.medianPaletteHSL,onClick:this.handlePostClick,hasRowGap:"0"!=`${a.y}`,isLastRow:Math.ceil((o+1)/i)===h,index:o,totalPosts:n.length}})}))}static register(t="behold-grid"){return customElements.get(t)||customElements.define(t,d),t}}export{d as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{b as e,c as t,s as i,t as s,d as r,B as a,e as o,f as n,i as l}from"./Widget-k0vrivbv.js";import{a as h,b as d,R as c}from"./base-kejrZ9Qe.js";let u=document,p=null,b=new Set,m=new Set,g=new MutationObserver((function(e){e.some((e=>"attributes"===e.type||![...e.addedNodes,...e.removedNodes].every((e=>e.tabIndex>=0))&&void 0))&&w({include:[p],merge:!0})})),v=!1;function f(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){return e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),i=[];let s=null;for(;s=t.nextNode();)i.push(s);return i}function x(e){return new Promise((async t=>{if(e.disabled)return void t(!1);const i=await function(e){return new Promise((t=>{const i=new IntersectionObserver((e=>{t(e[0].isIntersecting),i.disconnect()}));i.observe(e)}))}(e);t(!!i&&[...m].every((t=>!t.contains(e))))}))}async function E(){return(await Promise.all([...b].map((async e=>!!await x(e)&&e)))).filter((e=>!!e))}function y(e){!["Tab","ArrowDown","ArrowUp"].includes(e.code)||e.ctrlKey||e.altKey||e.metaKey||(e.preventDefault(),"Tab"===e.code&&e.shiftKey||"ArrowUp"===e.code?async function(){const e=await E();let t=e.indexOf(u.activeElement)-1;t<0&&(t=e.length-1),e[t]?.focus()}():async function(){const e=await E();let t=e.indexOf(u.activeElement)+1;(t>e.length-1||t<0)&&(t=0),e[t]?.focus()}())}function w({include:e=[],exclude:t=[],merge:i=!1}){i?(e.forEach((e=>{m.delete(e),f(e).forEach((e=>{b.has(e)||b.add(e)}))})),t.forEach((e=>m.add(e)))):(b=new Set(e.flatMap((e=>f(e)))),m=new Set(t))}function C(e){v&&(v=!1,e=e??document.body,document.removeEventListener("keydown",y),g.disconnect(),b.clear(),m.clear(),p=null,e&&e.focus())}const _=e=>e instanceof ShadowRoot;class k{initialized;keyboardNav;dynamicBreadCrumbsCutoff;breadcrumbDiameter;dragLimit;index;slides;rootEl=document;containerEl;innerEl;breadcrumbsContainerEl;breadcrumbsInnerEl;breadcrumbsCurrent;previousEl;nextEl;slideEls;breadcrumbs;raf;focusRaf;st;transitionSt;isDragging;dragStartPoint;lastDragPoint;currentPixelTranslation;currentPercentTranslation;progressToNextSlide;resizeObserver;onSlideChange;virtualize=!1;constructor({slides:e,containerEl:t,breadcrumbsContainerEl:i,previousEl:s,nextEl:r,onSlideChange:a,breadcrumbDiameter:o=7,keyboardNav:n=!0,dynamicBreadCrumbsCutoff:l=10,dragLimit:h=.15,virtualize:d=!1}){this.initialized=!1,this.keyboardNav=n,this.dynamicBreadCrumbsCutoff=l,this.breadcrumbDiameter=o,this.dragLimit=h,this.virtualize=d,this.index=0,this.slides=e,this.containerEl=t,this.innerEl=null,this.breadcrumbsContainerEl=i,this.previousEl=s,this.nextEl=r,this.slideEls=null,this.breadcrumbs=null,this.raf=null,this.st=null,this.transitionSt=null,this.isDragging=!1,this.dragStartPoint={x:0,y:0},this.lastDragPoint={x:0,y:0},this.currentPixelTranslation=0,this.currentPercentTranslation=0,this.progressToNextSlide=0,this.resizeObserver=new ResizeObserver((e=>this.handleResize(e))),this.onSlideChange=a,this.init=this.init.bind(this),this.destroy=this.destroy.bind(this),this.goTo=this.goTo.bind(this),this.retreat=this.retreat.bind(this),this.advance=this.advance.bind(this),this.handlePrevClick=this.handlePrevClick.bind(this),this.handleNextClick=this.handleNextClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.mouseDrag=this.mouseDrag.bind(this),this.touchDrag=this.touchDrag.bind(this),this.drag=this.drag.bind(this),this.startMouseDrag=this.startMouseDrag.bind(this),this.startTouchDrag=this.startTouchDrag.bind(this),this.startDrag=this.startDrag.bind(this),this.endDrag=this.endDrag.bind(this),this.updateBreadcrumbs=this.updateBreadcrumbs.bind(this),this.updateBreadcrumbClasses=this.updateBreadcrumbClasses.bind(this),this.handleResize=this.handleResize.bind(this),this.addEventListeners=this.addEventListeners.bind(this),this.removeEventListeners=this.removeEventListeners.bind(this)}addEventListeners(){this.innerEl.addEventListener("mousedown",this.startMouseDrag,{passive:!0}),this.innerEl.addEventListener("touchstart",this.startTouchDrag,{passive:!0}),document.body.addEventListener("mousemove",this.mouseDrag,{passive:!0}),document.body.addEventListener("mouseup",this.endDrag,{passive:!0}),document.body.addEventListener("mouseleave",this.endDrag,{passive:!0}),document.body.addEventListener("touchmove",this.touchDrag,{passive:!0}),document.body.addEventListener("touchend",this.endDrag,{passive:!0}),this.previousEl&&this.previousEl.addEventListener("click",this.handlePrevClick),this.nextEl&&this.nextEl.addEventListener("click",this.handleNextClick),this.keyboardNav&&document.addEventListener("keydown",this.handleKeyDown)}removeEventListeners(){this.innerEl.removeEventListener("mousedown",this.startMouseDrag),this.innerEl.removeEventListener("touchstart",this.startTouchDrag),document.body.removeEventListener("mousemove",this.mouseDrag),document.body.removeEventListener("mouseup",this.endDrag),document.body.removeEventListener("mouseleave",this.endDrag),document.body.removeEventListener("touchmove",this.touchDrag),document.body.removeEventListener("touchend",this.endDrag),this.previousEl&&this.previousEl.removeEventListener("click",this.handlePrevClick),this.nextEl&&this.nextEl.removeEventListener("click",this.handleNextClick),this.keyboardNav&&document.removeEventListener("keydown",this.handleKeyDown)}init(i=0){this.initialized||(this.initialized=!0,this.rootEl=e(this.containerEl),this.slideEls=this.slides.map(((e,i)=>t({classes:"hg-slide",contents:e}))),this.breadcrumbs=this.slides.map(((e,i)=>t({classes:"hg-breadcrumb",listeners:{click:()=>this.goTo({index:i})}}))),this.breadcrumbsCurrent=t({classes:"hg-breadcrumbs-current"}),this.breadcrumbsInnerEl=t({classes:"hg-breadcrumbs",contents:[...this.breadcrumbs,this.breadcrumbsCurrent]}),this.innerEl=t({classes:"hg-container",contents:this.slideEls}),this.containerEl.appendChild(this.innerEl),this.breadcrumbsContainerEl&&(this.breadcrumbsContainerEl.style.setProperty("--breadCrumbDiameter",this.breadcrumbDiameter+"px"),this.breadcrumbsContainerEl.appendChild(this.breadcrumbsInnerEl)),this.addEventListeners(),this.slides.length<2&&(this.breadcrumbsInnerEl.style.display="none",this.previousEl.style.display="none",this.nextEl.style.display="none"),this.resizeObserver?.observe(this.containerEl),this.updateBreadcrumbs(this.index,this.index,!1),this.goTo({index:i,animate:!1,forceUpdate:!0}))}destroy(){this.initialized&&(clearTimeout(this.st),clearTimeout(this.transitionSt),cancelAnimationFrame(this.raf),cancelAnimationFrame(this.focusRaf),this.resizeObserver.disconnect(),this.removeEventListeners(),this.breadcrumbs=null,this.breadcrumbsCurrent=null,this.breadcrumbsInnerEl.remove(),this.breadcrumbsInnerEl=null,this.innerEl.remove(),this.innerEl=null,this.initialized=!1)}handleResize(e){if(!e?.[0])return;const t=e?.[0]?.borderBoxSize?.[0]?.inlineSize||0;t&&(this.currentPixelTranslation=t*this.index*-1)}updateBreadcrumbClasses(e,t=!0){if(this.breadcrumbs.length>=this.dynamicBreadCrumbsCutoff&&this.breadcrumbsContainerEl){i(this.breadcrumbsInnerEl,{"no-transition":!t}),requestAnimationFrame((()=>{this.breadcrumbsInnerEl.classList.remove("no-transition")}));const s=this.breadcrumbsInnerEl.offsetWidth/2-this.breadcrumbDiameter/2-this.breadcrumbs[e].offsetLeft;this.breadcrumbsInnerEl.style.transform=`translateX(${s}px)`,this.breadcrumbs.forEach(((t,s)=>{i(t,{"hg-breadcrumb--hidden":s<=e-5||s>=e+5,"hg-breadcrumb--4":s===e-4||s===e+4,"hg-breadcrumb--3":s===e-3||s===e+3,"hg-breadcrumb--2":s===e-2||s===e+2,"hg-breadcrumb--1":s===e-1||s===e+1})}))}}updateBreadcrumbs(e,t,i){this.breadcrumbs?.length&&(this.updateBreadcrumbClasses(e,i),this.breadcrumbsContainerEl&&(!i||this.breadcrumbs.length>=10&&Math.abs(e-t)>1?e>t?(this.breadcrumbsCurrent.style.left="",this.breadcrumbsCurrent.style.right=this.breadcrumbsInnerEl.offsetWidth-(this.breadcrumbs[e].offsetLeft+this.breadcrumbDiameter)+"px"):(this.breadcrumbsCurrent.style.right="",this.breadcrumbsCurrent.style.left=this.breadcrumbs[e].offsetLeft+"px"):(e<t?(this.breadcrumbsCurrent.style.left="",this.breadcrumbsCurrent.style.right=this.breadcrumbsInnerEl.offsetWidth-this.breadcrumbs[t]?.offsetLeft-this.breadcrumbDiameter+"px"):(this.breadcrumbsCurrent.style.right="",this.breadcrumbsCurrent.style.left=this.breadcrumbs[t]?.offsetLeft+"px"),S(),this.raf=requestAnimationFrame((()=>{this.breadcrumbsCurrent.style.width=e>t?`${this.breadcrumbs[e]?.offsetLeft-this.breadcrumbsCurrent.offsetLeft+this.breadcrumbDiameter}px`:this.breadcrumbsCurrent.offsetLeft+this.breadcrumbsCurrent.offsetWidth-this.breadcrumbs[e]?.offsetLeft+"px"})),this.st=setTimeout((()=>{e>t?(this.breadcrumbsCurrent.style.left="",this.breadcrumbsCurrent.style.right=this.breadcrumbsInnerEl.offsetWidth-(this.breadcrumbs[e].offsetLeft+this.breadcrumbDiameter)+"px"):(this.breadcrumbsCurrent.style.right="",this.breadcrumbsCurrent.style.left=this.breadcrumbs[e].offsetLeft+"px"),S(),this.raf=requestAnimationFrame((()=>{this.breadcrumbsCurrent.style.width=""}))}),200))))}goTo({index:e,animate:t=!0,forceUpdate:i=!1,easing:s="ease"}){if(!this.slideEls?.[e])return;if(!this.initialized)return;cancelAnimationFrame(this.focusRaf);const r=e,a=this.index;this.index=r,clearTimeout(this.transitionSt),this.virtualize&&this.slideEls.forEach(((e,t)=>{Math.abs(this.index-t)>1&&t!==a?e.hasChildNodes()&&e.replaceChildren():e.hasChildNodes()||e.replaceChildren(this.slides[t])})),window.matchMedia("(prefers-reduced-motion)").matches&&(t=!1),this.isDragging=!1,this.progressToNextSlide=0,r!==a||i?(cancelAnimationFrame(this.raf),clearTimeout(this.st),this.updateBreadcrumbs(r,a,t),this.onSlideChange&&this.onSlideChange(r)):this.breadcrumbsCurrent.style.width="",this.innerEl.style.transition=t?`transform 0.4s ${s}`:"",this.innerEl.style.transform=`translateX(${-100*r}%)`,this.currentPixelTranslation=this.innerEl.scrollWidth/this.slideEls.length*r*-1,this.currentPercentTranslation=-100*r,this.previousEl&&(r<1?(this.rootEl.activeElement===this.previousEl&&(this.focusRaf=requestAnimationFrame((()=>{this.nextEl.focus()}))),this.previousEl.setAttribute("disabled","true")):this.previousEl.removeAttribute("disabled")),this.nextEl&&(r>=this.slideEls.length-1?(this.rootEl.activeElement===this.nextEl&&(this.focusRaf=requestAnimationFrame((()=>{this.previousEl.focus()}))),this.nextEl.setAttribute("disabled","true")):this.nextEl.removeAttribute("disabled")),this.transitionSt=setTimeout((()=>{this.innerEl.style.transition=""}),400)}handlePrevClick(){this.retreat()}handleNextClick(){this.advance()}retreat(e="ease"){"string"!=typeof e&&(e="ease"),this.index<1?this.goTo({index:this.index}):this.goTo({index:this.index-1,easing:e})}advance(e="ease"){"string"!=typeof e&&(e="ease"),this.index>=this.slideEls.length-1?this.goTo({index:this.index}):this.goTo({index:this.index+1,easing:e})}handleKeyDown(e){"ArrowRight"===e.code&&(e.preventDefault(),this.advance()),"ArrowLeft"===e.code&&(e.preventDefault(),this.retreat())}startMouseDrag(e){e.stopPropagation(),e.button>0||this.startDrag({x:e.clientX,y:e.clientY})}startTouchDrag(e){e.stopPropagation(),this.startDrag({x:e.touches.item(0).clientX,y:e.touches.item(0).clientY})}startDrag(e){this.slides.length<2||!this.initialized||(this.isDragging=!0,clearTimeout(this.transitionSt),cancelAnimationFrame(this.raf),this.progressToNextSlide=0,this.currentPixelTranslation=L(this.innerEl),this.breadcrumbsCurrent.style.transition="none",this.dragStartPoint=e,this.lastDragPoint=this.dragStartPoint)}mouseDrag(e){s(this.drag,10,this)({x:e.clientX,y:e.clientY})}touchDrag(e){s(this.drag,10,this)({x:e.touches.item(0).clientX,y:e.touches.item(0).clientY},!0)}drag(e,t=!1){if(this.slides.length<2||!this.isDragging||!this.initialized)return;this.currentPixelTranslation=L(this.innerEl);const i=this.containerEl.offsetWidth*this.dragLimit;let s=e.x-this.dragStartPoint.x,r=e.y-this.dragStartPoint.y,a=Math.abs(r)/Math.abs(s);if(t&&a>.85)return void this.endDrag();const o=e.x-this.lastDragPoint.x;this.progressToNextSlide=Math.abs(s/i);let n=this.currentPixelTranslation+o;const l=0===this.index&&s>0||this.index===this.slideEls.length-1&&s<0;if(l){let e=o*Math.max(1-Math.abs(s)/(.5*this.containerEl.offsetWidth),.1);n=this.currentPixelTranslation+e,this.progressToNextSlide=Math.abs(s/i)}this.lastDragPoint=e,this.currentPixelTranslation=n,this.currentPercentTranslation=this.currentPixelTranslation/this.containerEl.offsetWidth*100,s>0?(this.breadcrumbsCurrent.style.left="",this.breadcrumbsCurrent.style.right=this.breadcrumbsInnerEl.offsetWidth-(this.breadcrumbs[this.index].offsetLeft+this.breadcrumbDiameter)+"px"):(this.breadcrumbsCurrent.style.right="",this.breadcrumbsCurrent.style.left=`${this.breadcrumbs[this.index].offsetLeft}px`),this.breadcrumbsCurrent.style.width=l?`${this.breadcrumbDiameter+Math.abs(4*this.breadcrumbDiameter*(this.currentPercentTranslation+100*this.index)/100)}px`:`${Math.min(2.75*this.breadcrumbDiameter,this.breadcrumbDiameter+Math.abs(4*this.breadcrumbDiameter*(this.currentPercentTranslation+100*this.index)/100))}px`,this.innerEl.style.transform=`translateX(${this.currentPercentTranslation}%)`,this.innerEl.style.transition=""}endDrag(){this.isDragging=!1,this.breadcrumbsCurrent.style.transition="",this.innerEl.style.transition="",this.dragStartPoint={x:0,y:0},this.lastDragPoint={x:0,y:0},this.progressToNextSlide>=1?this.currentPercentTranslation+100*this.index<0?this.raf=requestAnimationFrame((()=>this.advance("cubic-bezier(0.25, .25, 0.5, 1)"))):this.raf=requestAnimationFrame((()=>this.retreat("cubic-bezier(0.25, .25, 0.5, 1)"))):this.raf=requestAnimationFrame((()=>this.goTo({index:this.index})))}}function S(){return document.body.offsetTop}function L(e){if(!e)return;const t=e.getBoundingClientRect(),i=e.parentNode.getBoundingClientRect();return t.left-i.left}var P='.behold-ps-container{display:flex;height:100vh;justify-content:center;overflow:auto;pointer-events:all;scrollbar-width:none;width:100%}.behold-ps-container::-webkit-scrollbar{width:0!important}.behold-ps-inner{max-width:400px}.behold-ps-inner:before{height:10px}.behold-ps-inner:after,.behold-ps-inner:before{content:"";display:block;pointer-events:none;width:100%}.behold-ps-inner:after{height:90px}';class D{initialized;slides;currentSlide;containerEl;scrollContainerEl;innerEl;onSlideChange;onRequestClose;constructor({slides:e,containerEl:t,onSlideChange:i,onRequestClose:s=null}){this.initialized=!1,this.slides=e,this.currentSlide=null,this.containerEl=t,this.scrollContainerEl=null,this.innerEl=null,this.onSlideChange=i,this.init=this.init.bind(this),this.destroy=this.destroy.bind(this),this.onBackGroundClick=this.onBackGroundClick.bind(this),this.onRequestClose=s,this.handleScroll=this.handleScroll.bind(this)}init(e=0){this.initialized||(this.initialized=!0,this.innerEl=t({classes:z("inner"),contents:this.slides}),this.scrollContainerEl=t({classes:z("container"),contents:this.innerEl}),this.containerEl.appendChild(this.scrollContainerEl),this.scrollContainerEl.addEventListener("click",this.onBackGroundClick),this.scrollContainerEl.addEventListener("scroll",this.handleScroll,{passive:!0}),this.goTo({index:e,animate:!1}))}destroy(){this.initialized&&(this.initialized=!1,this.scrollContainerEl.removeEventListener("click",this.onBackGroundClick),this.scrollContainerEl.removeEventListener("scroll",this.handleScroll),this.scrollContainerEl.remove(),this.scrollContainerEl=null)}handleScroll(e){r(this.slides).then((e=>{this.currentSlide!==e&&(this.currentSlide=e,this.onSlideChange&&this.onSlideChange(this.currentSlide))}))}onBackGroundClick(e){e.target===this.scrollContainerEl&&this.onRequestClose&&this.onRequestClose()}goTo({index:e,animate:t=!0}){if(!this.slides?.[e])return;const i=this.slides[e].offsetTop;this.currentSlide=e,this.onSlideChange&&this.onSlideChange(this.currentSlide),this.scrollContainerEl?.scrollTo({top:i-10,behavior:t?"smooth":"instant"})}}function z(e){return"behold-ps-"+e}var M='<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">\n<path fill-rule="evenodd" clip-rule="evenodd" fill="#FFFFFF" d="M4.4,7.3C4.2,7.3,4,7.5,4,7.7v4.6c0,0.2,0.2,0.4,0.4,0.4h2.2\n\tl3.2,3.2c0.2,0.2,0.6,0.1,0.6-0.2v-2.4c0-0.1-0.1-0.2-0.1-0.3L4.8,7.4C4.7,7.4,4.6,7.3,4.5,7.3C4.5,7.3,4.4,7.3,4.4,7.3z M16.1,15.2\n\tl-1.4-1.4c0.5-0.7,1.3-1.9,1.3-3.8c0-2.8-1.8-4.3-1.8-4.3c-0.1-0.2-0.4-0.2-0.6,0L13.3,6c-0.1,0.2-0.1,0.4,0,0.6\n\tc0,0,1.4,1.2,1.4,3.4c0,1.4-0.5,2.3-0.9,2.9L12.9,12c0.3-0.4,0.6-1.1,0.6-2c0-1.7-1-2.6-1-2.6c-0.1-0.2-0.4-0.2-0.6,0l-0.4,0.3\n\tc-0.1,0.2-0.1,0.4,0,0.6c0,0,0.7,0.5,0.7,1.7c0,0.4-0.1,0.8-0.2,1.1l-1.6-1.6V4.3c0-0.3-0.4-0.5-0.6-0.2L7.4,6.5L4.8,3.9\n\tc-0.1-0.1-0.4-0.1-0.5,0L4,4.3C3.8,4.4,3.8,4.7,4,4.8l1,1.1l6.7,6.7l3.5,3.5c0.1,0.1,0.4,0.1,0.5,0l0.4-0.4\n\tC16.2,15.6,16.2,15.3,16.1,15.2z"/>\n</svg>',T='<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">\n<path fill="#FFFFFF" d="M12.5,7.3c-0.3-0.4-0.8-0.4-1.1-0.2C11,7.4,11,7.9,11.2,8.3l0,0c0.4,0.5,0.6,1.1,0.6,1.7\n\tc0,0.6-0.2,1.2-0.6,1.7c-0.3,0.4-0.2,0.9,0.1,1.1c0.4,0.3,0.9,0.2,1.1-0.1c0,0,0,0,0,0c0.6-0.8,0.9-1.7,0.9-2.7\n\tC13.4,9,13.1,8.1,12.5,7.3z M14.6,6c-0.3-0.4-0.8-0.4-1.1-0.1C13.1,6.2,13,6.7,13.3,7c0,0,0,0,0,0c0.7,0.8,1.1,1.9,1.1,3\n\tc0,1.1-0.4,2.1-1.1,3c-0.3,0.4-0.2,0.9,0.1,1.1c0.3,0.3,0.8,0.2,1.1-0.1c0.9-1.1,1.4-2.5,1.4-4C16,8.5,15.5,7.1,14.6,6z M9.7,4\n\tC9.5,4,9.2,4,9.1,4.1L6.3,6.7H4.5C4.2,6.7,4,7,4,7.3v5.5c0,0.3,0.2,0.5,0.5,0.5h1.8l2.7,2.6l0,0c0.2,0.2,0.6,0.2,0.8,0\n\tc0.1-0.1,0.2-0.3,0.2-0.4l0-10.8C10,4.3,9.9,4.1,9.7,4z"/>\n</svg>';class I extends a{label="PopoverSlideVideo";videoEl;imageEl;soundControlEl;isPlaying=!1;post;constructor(){super(),h.register(),d.register(),this.onLoad=this.onLoad.bind(this),this.onPlay=this.onPlay.bind(this),this.onPause=this.onPause.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.togglePlayback=this.togglePlayback.bind(this),this.toggleSound=this.toggleSound.bind(this),this.showSoundControl=this.showSoundControl.bind(this),this.hideSoundControl=this.hideSoundControl.bind(this),this.onPropChange(this.handlePropChange,["isPlaying"],[]),this.onStateChange(this.handleStateChange),this.onConnect((()=>{this.post.mediaUrl?(this.videoEl=t({type:"behold-video",classes:"video",props:{mediaUrl:this.post.mediaUrl,sizes:this.post.sizes},listeners:{click:this.togglePlayback,load:this.onLoad,play:this.onPlay,pause:this.onPause}}),this.soundControlEl=t({type:"button",classes:"video-mute",contents:this.state.isMuted?M:T,listeners:{click:this.toggleSound},attributes:{"aria-label":this.state.isMuted?"unmute":"mute"}}),this.state.isMuted?this.videoEl.mute():this.videoEl.unmute(),this.classList.add("video-container","video-container--paused"),this.replaceChildren(this.videoEl,this.soundControlEl)):(this.imageEl=t({type:"behold-image",props:{sizes:this.post.sizes,mediaUrl:this.post.thumbnailUrl,isSquare:!1},listeners:{load:this.onLoad}}),this.replaceChildren(this.imageEl))}))}handlePropChange({changedProp:e,newValue:t}){if("isPlaying"===e)t&&this.videoEl?.isLoaded&&!this.videoEl.isPlaying&&this.videoEl.play()}handleStateChange({changedProps:e,newState:t}){e.includes("isMuted")&&this.videoEl&&this.soundControlEl&&(t.isMuted?(this.videoEl.mute(),this.soundControlEl.innerHTML=M):(this.videoEl.unmute(),this.soundControlEl.innerHTML=T))}onLoad(){this.dispatchEvent(new Event("load")),this.classList.add("is-loaded"),this.videoEl&&this.isPlaying&&!this.videoEl.isPlaying&&this.videoEl.play()}onPlay(){this.classList.remove("video-container--paused")}onPause(){this.classList.add("video-container--paused")}play(){this.isPlaying=!0}pause(){this.isConnected&&this.videoEl?.isPlaying&&this.videoEl.pause()}togglePlayback(){this.videoEl&&(this.videoEl.isPlaying?this.pause():this.play())}toggleSound(){this.videoEl&&(this.videoEl.muted?this.updateState({isMuted:!1}):this.updateState({isMuted:!0}))}showSoundControl(){this.isConnected&&this.soundControlEl&&this.soundControlEl.classList.add("video-mute--visible")}hideSoundControl(){this.isConnected&&this.soundControlEl&&this.soundControlEl.classList.remove("video-mute--visible")}preload(){this.videoEl?.preload()}static register(e="behold-popover-slide-video"){return customElements.get(e)||customElements.define(e,I),e}}var B='<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 5.83 10.15"><path d="M.22,5.61s.02,.01,.03,.02l4.3,4.3c.29,.29,.77,.29,1.06,0s.29-.77,0-1.06L1.81,5.08,5.61,1.28c.29-.29,.29-.77,0-1.06-.15-.15-.34-.22-.53-.22s-.38,.07-.53,.22L.25,4.52s-.02,.01-.03,.02C.07,4.69,0,4.88,0,5.08c0,.19,.07,.39,.22,.54Z" fill="#081b10"/></svg>',F='<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 5.83 10.15"><path d="M5.61,4.54s-.02-.01-.03-.02L1.28,.22C.99-.07,.51-.07,.22,.22S-.07,.99,.22,1.28l3.79,3.79L.22,8.87c-.29,.29-.29,.77,0,1.06,.15,.15,.34,.22,.53,.22s.38-.07,.53-.22L5.58,5.63s.02-.01,.03-.02c.15-.15,.22-.34,.22-.54,0-.19-.07-.39-.22-.54Z" fill="#081b10"/></svg>';class A extends a{label="PopoverSlideAlbum";containerEl;spaceholderEl;childEls;previousEl;nextEl;breadcrumbsEl;childCarousel;currentSlideIndex=0;post;constructor(){super(),this.onPropChange((()=>{}),["post"]),d.register(),I.register(),this.handleSlideChange=this.handleSlideChange.bind(this),this.onConnect((()=>{this.childEls=this.buildSlideEls(),this.spaceholderEl=t({type:"img",classes:"slide__carousel-spaceholder",attributes:{src:`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='${this.post.sizes?.full?.width}' height='${this.post.sizes?.full?.height}'%3E%3C/svg%3E%0A`,height:this.post.sizes?.full?.height,width:this.post.sizes?.full?.width}}),this.previousEl=t({type:"button",classes:"slide__carousel-previous",attributes:{"aria-label":"Previous album slide"},contents:B}),this.nextEl=t({type:"button",classes:"slide__carousel-next",attributes:{"aria-label":"Next album slide"},contents:F}),this.breadcrumbsEl=t({classes:"slide__carousel-breadcrumbs"}),this.containerEl=t({classes:"slide__carousel",contents:[...this.childEls,this.previousEl,this.nextEl,this.breadcrumbsEl]}),this.replaceChildren(this.spaceholderEl,this.containerEl),this.childCarousel=new k({slides:this.childEls,containerEl:this.containerEl,keyboardNav:!1,breadcrumbsContainerEl:this.breadcrumbsEl,dynamicBreadCrumbsCutoff:7,previousEl:this.previousEl,nextEl:this.nextEl,dragLimit:.2,onSlideChange:this.handleSlideChange,virtualize:!0})})),this.onDisconnect((()=>{this.childCarousel.destroy(),this.childCarousel=null}))}activate(){this.childCarousel.init(0),this.handleSlideChange(this.currentSlideIndex)}updateTabbable(){w({include:[this.childEls[this.currentSlideIndex]],exclude:this.childEls.filter(((e,t)=>t!==this.currentSlideIndex)),merge:!0})}handleSlideChange(e){e!==this.currentSlideIndex&&o(`Slide ${e+1} of ${this.childEls.length} in Album`),this.currentSlideIndex=e,this.childEls.forEach(((t,i)=>{R(t)&&(i===e?(t.showSoundControl(),t.play()):(t.hideSoundControl(),t.pause()))}));const t=this.childEls[e-1],i=this.childEls[e+1];t&&t.preload(),i&&i.preload();const s=c(this.post.children[e].colorPalette?.dominant||"100,100,100").map((e=>Math.round(e)));this.style.backgroundColor=`hsl(${s[0]} ${Math.min(s[1],35)}% ${Math.min(s[2],13)}%)`;const r=c(this.post.children[e].colorPalette?.dominant||"255,255,255").map((e=>Math.round(e))),a=`hsl(${r[0]} ${r[1]}% ${Math.max(r[2],50)}%)`;this.style.setProperty("--uib-color",a),this.updateTabbable(),this.updateState({popoverOverlayColor:`hsl(${s[0]} ${Math.min(s[1],50)}% ${Math.min(s[2],15)}% / .85)`})}buildSlideEls(){return this.post.children.map((e=>{let i=null;switch(e.mediaType){case"IMAGE":i=t({type:"behold-image",classes:"slide__carousel-slide",props:{sizes:e.sizes,mediaUrl:e.mediaUrl,isSquare:!1,showLoader:!0}});break;case"VIDEO":i=t({type:"behold-popover-slide-video",classes:"slide__carousel-slide",props:{post:e}})}return i}))}play(){const e=this.childEls[this.currentSlideIndex];R(e)&&(e.showSoundControl(),e.play())}pause(){this.childEls.filter(R).forEach((e=>{e.hideSoundControl(),e.pause()}))}preload(){this.childEls?.[0]?.preload()}static register(e="behold-popover-slide-album"){return customElements.get(e)||customElements.define(e,A),e}}const R=e=>"BEHOLD-POPOVER-SLIDE-VIDEO"===e.tagName;var N='<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<g>\n\t<path fill="#262626" d="M13.8,5.9H3.2c-0.4,0-0.7-0.3-0.7-0.7s0.3-0.7,0.7-0.7h10.6c0.4,0,0.7,0.3,0.7,0.7S14.1,5.9,13.8,5.9z"/>\n</g>\n<g>\n\t<path fill="#262626" d="M12.8,10.8H2.2c-0.4,0-0.7-0.3-0.7-0.7s0.3-0.7,0.7-0.7h10.6c0.4,0,0.7,0.3,0.7,0.7S13.2,10.8,12.8,10.8z"\n\t\t/>\n</g>\n<g>\n\t<path fill="#262626" d="M8.9,15.3c0,0-0.1,0-0.1,0c-0.4-0.1-0.6-0.4-0.5-0.8l2.4-13.3c0.1-0.4,0.4-0.6,0.8-0.5\n\t\tc0.4,0.1,0.6,0.4,0.5,0.8L9.6,14.8C9.5,15.1,9.2,15.3,8.9,15.3z"/>\n</g>\n<g>\n\t<path fill="#262626" d="M4.7,15.3c0,0-0.1,0-0.1,0c-0.4-0.1-0.6-0.4-0.5-0.8L6.4,1.2c0.1-0.4,0.4-0.6,0.8-0.5\n\t\tc0.4,0.1,0.6,0.4,0.5,0.8L5.3,14.8C5.3,15.1,5,15.3,4.7,15.3z"/>\n</g>\n</svg>';class $ extends a{label="PopoverGallerySlide";innerEl;avatarImageEl;headerText;avatarEl;headerEl;captionEl;footerLinkEl;footerEl;textEl;mediaEl;moreEl;post;feedMetadata;constructor(){super(),this.onPropChange(this.handlePropChange,["post","feedMetadata"]),d.register(),I.register(),A.register(),this.expandCaption=this.expandCaption.bind(this),this.onConnect((()=>{this.render()}))}render(){this.classList.remove("is-loaded");const e=c(this.post.colorPalette?.dominant||"100,100,100").map((e=>Math.round(e))),i=`hsl(${e[0]} ${Math.min(e[1],35)}% ${Math.min(e[2],13)}%)`,s=c(this.post.colorPalette?.dominant||"255,255,255").map((e=>Math.round(e))),r=`hsl(${s[0]} ${s[1]}% ${Math.max(s[2],50)}%)`;switch(this.style.setProperty("--uib-color",r),this.post.mediaType){case"IMAGE":this.mediaEl=t({type:"behold-image",classes:"slide__media",style:{backgroundColor:i},props:{sizes:this.post.sizes,mediaUrl:this.post.mediaUrl,isSquare:!1,showLoader:!0}});break;case"VIDEO":this.mediaEl=t({type:"behold-popover-slide-video",classes:"slide__media",style:{backgroundColor:i},props:{post:this.post}});break;case"CAROUSEL_ALBUM":this.mediaEl=t({type:"behold-popover-slide-album",classes:"slide__media",style:{backgroundColor:i},props:{post:this.post}})}this.avatarImageEl=this.feedMetadata?.profilePictureUrl?t({type:"img",attributes:{src:this.feedMetadata.profilePictureUrl}}):null,this.headerText="@"+this.feedMetadata.username,this.feedMetadata.hashtags&&(this.avatarImageEl=N,this.headerText=this.feedMetadata.hashtags.join(", ")),this.avatarEl=this.avatarImageEl?t({classes:"slide__avatar",contents:this.avatarImageEl,attributes:{"aria-label":this.feedMetadata.hashtags?"hashtags":"username"}}):null,this.headerEl=t({classes:"slide__header",contents:[this.avatarEl,this.headerText]}),this.captionEl=this.post?.caption?.trim()?.length?t({classes:"slide__caption",contents:this.post.caption}):null,this.footerLinkEl=this.post.permalink?t({type:"a",attributes:{href:this.post.permalink,target:"_blank"},classes:"slide__footer-link",contents:["Go to post",'<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">\n<g>\n\t<path d="M16,19.8H4c-2.1,0-3.8-1.7-3.8-3.8V4c0-2.1,1.7-3.8,3.8-3.8h12c2.1,0,3.8,1.7,3.8,3.8v12C19.8,18.1,18.1,19.8,16,19.8z\n\t\t M4,1.8c-1.2,0-2.2,1-2.2,2.2v12c0,1.2,1,2.2,2.2,2.2h12c1.2,0,2.2-1,2.2-2.2V4c0-1.2-1-2.2-2.2-2.2H4z"/>\n</g>\n<path d="M14.4,5.6v7.5h-1.5V8.2l-6,6l-1.1-1.1l6-6H6.9V5.6H14.4z"/>\n</svg>']}):"",this.footerEl=t({classes:"slide__footer",contents:[this.footerLinkEl]}),this.textEl=t({classes:"slide__text",contents:[this.headerEl,this.captionEl,this.footerEl]}),this.innerEl=t({classes:"slide__inner",contents:[this.mediaEl,this.textEl]}),this.moreEl=t({type:"button",classes:"slide__more",contents:"… more",listeners:{click:this.expandCaption}}),this.replaceChildren(this.innerEl),n(),this.to((()=>{this.classList.add("is-loaded")}),10,"onConnect")}handlePropChange({changedProp:e}){if("feedMetadata"===e){if(!this.isConnected)return;this.avatarImageEl.src=this.feedMetadata.profilePictureUrl,this.headerText="@"+this.feedMetadata.username,this.feedMetadata.hashtags&&(this.avatarImageEl=N,this.headerText=this.feedMetadata.hashtags.join(", ")),this.avatarEl.replaceChildren(this.avatarImageEl),this.avatarEl.setAttribute("aria-label",this.feedMetadata.hashtags?"hashtags":"username")}}activate(){if("VIDEO"===this.post.mediaType&&this.mediaEl){const e=this.mediaEl;e.play(),e.showSoundControl()}if("CAROUSEL_ALBUM"===this.post.mediaType&&this.mediaEl){this.mediaEl.activate()}}deactivate(){if("VIDEO"===this.post.mediaType&&this.mediaEl){this.mediaEl.pause()}if("CAROUSEL_ALBUM"===this.post.mediaType&&this.mediaEl){this.mediaEl.pause()}}preload(){this.mediaEl.preload()}expandCaption(){this.captionEl&&(this.captionEl.style.transition="",this.captionEl.style.height=this.captionEl.offsetHeight+"px",this.captionEl.innerHTML=this.post?.caption||"",n(),this.raf((()=>{this.captionEl.style.transition="height .3s ease",this.captionEl.style.height=this.captionEl.scrollHeight+"px",this.to((()=>{this.captionEl.style.transition="",this.captionEl.style.height=""}),300,"expandCaption")}),"expandCaption"))}collapseCaption(){if(!this.captionEl)return;const e=l({text:this.post.caption,maxChars:120,maxLines:4});this.captionEl.innerHTML=e,e?.length<this.post?.caption?.length&&this.captionEl.appendChild(this.moreEl)}static register(e="behold-popover-gallery-slide"){return customElements.get(e)||customElements.define(e,$),e}}var O=":host{--icon-play:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 35 35' xml:space='preserve'%3E%3Cpath fill='%23FFF' d='M28.4 14.9 9.5 4.2C7.5 3.1 5 4.6 5 6.8v21.3c0 2.3 2.5 3.7 4.5 2.6l19-10.7c2-1 2-4-.1-5.1z'/%3E%3C/svg%3E\");--icon-gallery:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 35 35' xml:space='preserve'%3E%3Cpath fill='%23FFF' d='M27.3 22.7v-17c0-2.6-2.1-4.7-4.7-4.7H5.7C3.1 1 1 3.1 1 5.7v17c0 2.6 2.1 4.7 4.7 4.7h17c2.5-.1 4.6-2.2 4.6-4.7zm4-13.4v14.6c0 4.1-3.4 7.4-7.4 7.4H9.2c-.5 0-.8.6-.5 1 .9 1 2.2 1.6 3.7 1.6h12.1c5.2 0 9.3-4.2 9.3-9.3V12.5c0-1.5-.6-2.8-1.6-3.7-.3-.4-.9 0-.9.5z'/%3E%3C/svg%3E\");--bottomPadding:60px;--height:min(calc(100vh - 120px - var(--bottomPadding)),1400px);--width:calc(100vw - 120px);--text-width:400px;--text-color:#262626;--text-background:#fff;--text-size:15px;--border-color:#ededed;--ease-out-back:cubic-bezier(0.085,1.735,0.285,0.995);align-items:center;box-sizing:border-box;height:100vh;justify-content:flex-start;left:0;overflow:hidden;pointer-events:none;position:fixed;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:99999}:host *{box-sizing:border-box}@media (max-width:1200px){:host{--text-width:300px;--text-size:13px}}:host(.is-scroller){--text-width:100%;--height:auto;--width:calc(100vw - 40px)}@media (prefers-color-scheme:dark){:host(.theme--auto){--text-color:#f2f2f2;--text-background:#1a1a1a;--border-color:#292929}}:host(.theme--dark){--text-color:#f2f2f2;--text-background:#1a1a1a;--border-color:#292929}:host(.is-visible){pointer-events:all}.overlay{-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);background-color:rgba(0,0,0,.6);display:block;height:100%;left:0;opacity:0;pointer-events:none;position:absolute;top:0;transition:all .3s ease;width:100%;will-change:opacity,background-color}:host(.is-visible) .overlay{opacity:1;pointer-events:all}.inner{display:flex;height:calc(100% - var(--bottomPadding));justify-content:center;pointer-events:none;position:relative;width:100%;z-index:1}:host(.is-scroller) .inner{height:100%}behold-popover-gallery-slide{align-items:center;display:flex;flex-grow:0;flex-shrink:0;height:calc(100% - var(--bottomPadding));justify-content:center;margin:0;opacity:0;padding:0;pointer-events:none;transform:scale(.99);transition:transform .2s ease-out,opacity .2s ease-out;width:100%}@media (min-width:901px){behold-popover-gallery-slide:active{cursor:grabbing}}@media (prefers-reduced-motion){behold-popover-gallery-slide{transform:none;transition:none}}:host(.is-visible) behold-popover-gallery-slide.is-loaded{opacity:1;transform:none}:host(.is-scroller) behold-popover-gallery-slide{height:auto;margin-top:10px}.slide__inner{align-items:center;background-color:var(--text-background);display:flex;justify-content:center;max-height:var(--height);max-width:var(--width);overflow:hidden;pointer-events:all;position:relative}:host(.is-scroller) .slide__inner{border-radius:4px;flex-direction:column}.slide__media{align-items:center;display:flex;flex-shrink:1;height:var(--height);justify-content:center;max-height:var(--height);overflow:hidden;position:relative;transition:background-color .3s ease;z-index:1}.slide__media img,.slide__media video{height:auto;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;-o-object-position:center center;object-position:center center;opacity:0;position:relative;transition:opacity .4s ease;width:auto;z-index:1}behold-image{pointer-events:none;position:relative}behold-image.is-loaded img{opacity:1}.slide__carousel{height:100%;left:0;position:absolute;top:0;width:100%}.slide__carousel:before{background:linear-gradient(0deg,rgba(0,0,0,.4),transparent);bottom:0;height:60px;left:0;width:100%;z-index:1}.slide__carousel:after,.slide__carousel:before{content:\"\";pointer-events:none;position:absolute;transform:translateZ(0)}.slide__carousel:after{background:var(--icon-gallery);height:20px;left:20px;opacity:.75;top:20px;width:20px;z-index:2}:host(.is-scroller) .slide__carousel:after{left:auto;right:15px;top:15px}img.slide__carousel-spaceholder{height:auto;max-height:100%;max-width:100%;opacity:0;pointer-events:none;visibility:hidden;width:auto}.slide__carousel-breadcrumbs{bottom:30px;height:10px;left:50%;position:absolute;transform:translateX(-50%);z-index:2}:host(.is-scroller) .slide__carousel-breadcrumbs{bottom:10px}.slide__carousel-next,.slide__carousel-previous{align-items:center;background-color:hsla(0,0%,100%,.95);border:none;border-radius:50%;box-shadow:0 0 10px rgba(0,0,0,.2);display:flex;height:30px;justify-content:center;opacity:.75;outline:none;position:absolute;top:50%;transform:translateY(-50%) translateZ(0);transition:opacity .3s ease;width:30px;z-index:2}:host(.keyboard-nav) .slide__carousel-next:focus,:host(.keyboard-nav) .slide__carousel-previous:focus{background-color:#000;box-shadow:0 0 10px rgba(0,0,0,.2),0 0 0 2px #4169e1,0 0 0 3px #fff;opacity:1}:host(.keyboard-nav) .slide__carousel-next:focus svg path,:host(.keyboard-nav) .slide__carousel-previous:focus svg path{fill:#fff}.slide__carousel-next:not(:disabled),.slide__carousel-previous:not(:disabled){cursor:pointer}.slide__carousel-next:not(:disabled):hover,.slide__carousel-previous:not(:disabled):hover{opacity:1}.slide__carousel-next:disabled,.slide__carousel-previous:disabled{opacity:.25}.slide__carousel-next:before,.slide__carousel-previous:before{content:\"\";height:60px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:60px}.slide__carousel-next svg,.slide__carousel-previous svg{height:12px;position:absolute;width:12px}.slide__carousel-next svg path,.slide__carousel-previous svg path{fill:#000}:host(.is-scroller) .slide__carousel-next,:host(.is-scroller) .slide__carousel-previous{background-color:transparent;box-shadow:none;height:20px;width:20px}:host(.is-scroller) .slide__carousel-next svg path,:host(.is-scroller) .slide__carousel-previous svg path{fill:#fff}.slide__carousel-previous{left:20px}.slide__carousel-previous svg{transform:translateX(-1px)}:host(.is-scroller) .slide__carousel-previous{left:10px}.slide__carousel-next{right:20px}.slide__carousel-next svg{transform:translateX(1px)}:host(.is-scroller) .slide__carousel-next{right:10px}.slide__carousel-slide{cursor:grab;display:flex;height:var(--height);overflow:hidden;width:auto}.slide__carousel-slide:active{cursor:grabbing}.slide__carousel-slide-media{height:auto;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;pointer-events:none;width:auto}.video-container{align-items:center;cursor:pointer;display:flex;height:var(--height);justify-content:center;overflow:hidden;position:relative}.video-container:after{background:var(--icon-play);content:\"\";filter:drop-shadow(1px 1px 1px rgba(0,0,0,.1));height:80px;left:calc(50% - 40px);opacity:0;pointer-events:none;position:absolute;top:calc(50% - 40px);transform:scale(.5);transition:all .15s ease;width:80px;z-index:2}.video-container.video-container--paused:after{opacity:.8;transform:none;transition:opacity .2s ease,transform .3s var(--ease-out-back)}.video-container:active{cursor:grabbing}behold-video{align-items:center;display:flex;height:100%;width:100%}behold-video.is-loaded video{opacity:1}.video-mute{align-items:center;background:transparent;border:none;bottom:0;cursor:pointer;display:flex;height:60px;justify-content:center;margin:0;opacity:0;outline:none;padding:0;position:absolute;right:0;transform:translateZ(0);transition:opacity .1s ease;width:60px;z-index:2}.video-mute.video-mute--visible{opacity:1;transition:opacity .2s ease .2s}.video-mute:before{background-color:rgba(0,0,0,.5);border-radius:50%;content:\"\";height:28px;left:calc(50% - 14px);position:absolute;top:calc(50% - 14px);width:28px}:host(.keyboard-nav) .video-mute:focus:before{background-color:#000;box-shadow:0 0 10px rgba(0,0,0,.2),0 0 0 2px #4169e1,0 0 0 4px #fff}.video-mute svg{height:20px;left:calc(50% - 10px);position:absolute;top:calc(50% - 10px);width:20px}.slide__text{align-items:stretch;border-left:1px solid var(--border-color);color:var(--text-color);display:flex;flex-direction:column;flex-shrink:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:var(--text-size);height:var(--height);justify-content:flex-start;min-width:none;pointer-events:none;width:var(--text-width)}.slide__header{align-items:center;border-bottom:1px solid var(--border-color);display:flex;font-weight:600;line-height:1.25;padding:30px}@media (prefers-color-scheme:dark){.theme--auto .slide__header{border-color:#292929}}.slide__header.theme--dark{border-color:#292929}@media (max-width:1200px){.slide__header{padding:20px}}.slide__avatar{align-items:center;border-radius:50%;display:flex;flex-shrink:0;height:42px;justify-content:center;margin-right:10px;overflow:hidden;position:relative;width:42px}.slide__avatar:before{background:radial-gradient(circle farthest-corner at 32% 106%,#ffe17d 0,#ffcd69 10%,#fa9137 28%,#eb4141 42%,transparent 82%),linear-gradient(135deg,#c33cbe 12%,#c33cbe 58%);height:100%;left:0;top:0;width:100%}.slide__avatar:after,.slide__avatar:before{border-radius:50%;content:\"\";position:absolute}.slide__avatar:after{background-color:var(--text-background);height:calc(100% - 4px);left:2px;top:2px;width:calc(100% - 4px)}@media (prefers-color-scheme:dark){.theme--auto .slide__avatar{background-color:#333}}.slide__avatar.theme--dark{background-color:#333}.slide__avatar img{border-radius:50%;height:calc(100% - 8px);position:relative;width:calc(100% - 8px);z-index:1}.slide__avatar svg{height:15px;position:relative;width:15px;z-index:1}.slide__avatar svg path{fill:var(--text-color)}:host(.is-scroller) .slide__avatar{height:32px;width:32px}:host(.is-scroller) .slide__avatar svg{height:12px;width:12px}.slide__caption{line-height:1.5;overflow:auto;padding:30px;scrollbar-width:none;white-space:pre-wrap;word-break:break-word}:host(.is-visible) .slide__caption{pointer-events:all}.slide__caption::-webkit-scrollbar{width:0!important}:host(.is-scroller) .slide__caption{overflow:hidden}.slide__more{background:transparent;border:none;color:var(--text-color);cursor:pointer;margin:0;opacity:.75;padding:0}.slide__more:hover{opacity:1;text-decoration:underline}.slide__footer{border-top:1px solid var(--border-color);margin-top:auto}:host(.is-visible) .slide__footer{pointer-events:all}.slide__footer-link{align-items:center;color:var(--text-color);cursor:pointer;display:flex;font-size:.9333em;font-weight:600;padding:30px;text-decoration:none;transition:background .3s ease}:host(.keyboard-nav) .slide__footer-link:focus{background-color:var(--border-color);border:none;box-shadow:inset 0 0 0 1px #fff,inset 0 0 0 3px #4169e1;outline:none;transition:background .1s ease}.slide__footer-link:hover{background-color:var(--border-color)}.slide__footer-link svg{height:17px;margin-left:auto;width:17px}.slide__footer-link svg path{fill:var(--text-color)}@media (max-width:1200px){.slide__footer-link{padding:20px}}.breadcrumbs{align-items:center;bottom:calc(var(--bottomPadding)/2 + 30px - (var(--breadCrumbDiameter) + 10px)/2);display:flex;gap:calc(var(--breadCrumbDiameter)*.75);height:calc(var(--breadCrumbDiameter) + 10px);justify-content:center;left:50%;opacity:0;position:absolute;transform:translateX(-50%);width:auto;z-index:2}:host(.is-visible) .breadcrumbs{opacity:1}.breadcrumbs-current{background-color:#fff;border-radius:calc(var(--breadCrumbDiameter)/2);height:var(--breadCrumbDiameter);position:absolute;top:5px;transition:width .3s ease;width:var(--breadCrumbDiameter);will-change:left,right,width}.breadcrumb{background-color:hsla(0,0%,100%,.4);border-radius:50%;cursor:pointer;display:block;height:7px;transition:all .3s ease;width:7px}.breadcrumb:hover{background-color:#fff}.close{align-items:center;background:none;border:none;cursor:pointer;display:flex;height:30px;justify-content:center;margin:0;opacity:0;padding:0;position:absolute;right:15px;top:15px;width:30px;z-index:2}:host(.is-visible) .close{opacity:.75;transition:opacity .3s ease}:host(.is-visible) .close:hover{opacity:1}:host(.keyboard-nav) .close:focus{box-shadow:0 0 0 2px #4169e1,0 0 0 3px #fff;opacity:1}.close:focus{border:none;outline:none}.close:before{content:\"\";height:60px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:60px}.close svg{height:20px;width:20px}.close svg path{fill:#fff}:host(.is-scroller) .close{background-color:hsla(0,0%,97%,.85);border-radius:50%;opacity:1;right:5px;top:5px}:host(.is-scroller) .close svg{height:14px;width:14px}:host(.is-scroller) .close svg path{fill:#000}.next,.previous{align-items:center;background:none;border:none;cursor:pointer;display:flex;height:60px;justify-content:center;margin:0;opacity:0;padding:0;position:absolute;top:calc(50% - var(--bottomPadding)/2);transform:translateY(-50%);width:60px;z-index:2}:host(.is-visible) .next,:host(.is-visible) .previous{opacity:.75;transition:opacity .3s ease}:host(.is-visible) .next:focus,:host(.is-visible) .previous:focus{border:none;outline:none}:host(.is-visible) .next:hover,:host(.is-visible) .previous:hover{opacity:1}:host(.is-visible) .next:disabled,:host(.is-visible) .previous:disabled{cursor:default;opacity:.15}:host(.is-visible) .next:disabled:hover,:host(.is-visible) .previous:disabled:hover{opacity:.15}:host(.keyboard-nav) .next:focus,:host(.keyboard-nav) .previous:focus{box-shadow:0 0 0 2px #4169e1,0 0 0 3px #fff;opacity:1}.next svg,.previous svg{height:16px;width:16px}.next svg path,.previous svg path{fill:#fff}.previous{left:0}.next{right:0}.ldr{--uib-size:50px;--uib-speed:1s;--uib-stroke:2px;--uib-bg-opacity:0.1;align-items:center;border-radius:calc(var(--uib-stroke)/2);contain:strict;display:none;height:var(--uib-stroke);justify-content:center;left:calc(50% - 15px);overflow:hidden;position:absolute;top:calc(50% - 15px);transform:translateZ(0);width:var(--uib-size)}.ldr.ldr--visible{display:flex}behold-image.is-loaded .ldr{display:none}.ldr:before{left:0;opacity:var(--uib-bg-opacity);position:absolute;top:0}.ldr:after,.ldr:before{background-color:var(--uib-color);content:\"\";height:100%;transition:background-color .3s ease;width:100%}.ldr:after{animation:wobble var(--uib-speed) ease-in-out infinite;border-radius:calc(var(--uib-stroke)/2);transform:translateX(-95%)}@keyframes wobble{0%,to{transform:translateX(-95%)}50%{transform:translateX(95%)}}",j='.hg-container{align-items:flex-start;backface-visibility:hidden;contain:layout style;justify-content:flex-start;-webkit-user-select:none;-moz-user-select:none;user-select:none;will-change:transform}.hg-container,.hg-slide{display:flex;height:100%;width:100%}.hg-slide{contain:strict;flex-grow:0;flex-shrink:0}.hg-breadcrumbs,.hg-slide{align-items:center;justify-content:center}.hg-breadcrumbs{--ease:cubic-bezier(0.215,0.61,0.355,1);display:flex;gap:calc(var(--breadCrumbDiameter)*.75);height:calc(var(--breadCrumbDiameter) + 10px);pointer-events:all;position:relative;transition:transform .4s var(--ease);width:auto;will-change:transform}.hg-breadcrumbs.no-transition{transition:none}@media (prefers-reduced-motion){.hg-breadcrumbs{transition:none}}.hg-breadcrumbs-current,.hg-breadcrumbs-current:empty{background-color:#fff;border-radius:calc(var(--breadCrumbDiameter)/2);display:block;height:var(--breadCrumbDiameter);position:absolute;top:5px;transition:width .3s var(--ease);width:var(--breadCrumbDiameter);will-change:left,right,width}.hg-breadcrumb,.hg-breadcrumb:empty{cursor:pointer;display:block;flex-shrink:0;height:var(--breadCrumbDiameter);position:relative;width:var(--breadCrumbDiameter)}.hg-breadcrumb:before,.hg-breadcrumb:empty:before{content:"";height:60px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:calc(var(--breadCrumbDiameter)*1.75)}.hg-breadcrumb:after,.hg-breadcrumb:empty:after{background-color:hsla(0,0%,100%,.4);border-radius:50%;content:"";height:100%;left:0;position:absolute;top:0;transition:all .3s var(--ease);width:100%}.no-transition .hg-breadcrumb:after,.no-transition .hg-breadcrumb:empty:after{transition:none}@media (prefers-reduced-motion){.hg-breadcrumb:after,.hg-breadcrumb:empty:after{transition:none}}.hg-breadcrumb.hg-breadcrumb--1:after,.hg-breadcrumb:empty.hg-breadcrumb--1:after{transform:scale(.85)}.hg-breadcrumb.hg-breadcrumb--2:after,.hg-breadcrumb:empty.hg-breadcrumb--2:after{opacity:.75;transform:scale(.7)}.hg-breadcrumb.hg-breadcrumb--3:after,.hg-breadcrumb:empty.hg-breadcrumb--3:after{opacity:.5;transform:scale(.55)}.hg-breadcrumb.hg-breadcrumb--4:after,.hg-breadcrumb:empty.hg-breadcrumb--4:after{opacity:.25;transform:scale(.4)}.hg-breadcrumb.hg-breadcrumb--hidden,.hg-breadcrumb:empty.hg-breadcrumb--hidden{pointer-events:none}.hg-breadcrumb.hg-breadcrumb--hidden:after,.hg-breadcrumb:empty.hg-breadcrumb--hidden:after{opacity:0;transform:scale(0)}.hg-breadcrumb:empty:hover:after,.hg-breadcrumb:hover:after{background-color:#fff;opacity:1;transform:none}';class U extends a{label="PopoverGallery";verticalScrollBreakpoint=900;shadow;fragment;styleEl;stylesAdded;overlayEl;previousEl;nextEl;closeEl;breadcrumbContainer;innerEl;postEls;hurdyGurdy;popoverScroller;currentPostIndex=0;posts;widgetSettings;feedMetadata;closeFocusEl=document.body;onSlideChange;constructor(){super(),this.shadow=this.attachShadow({mode:"open"}),this.onPropChange((()=>{}),["posts","widgetSettings","feedMetadata"]),$.register(),this.handleSlideChange=this.handleSlideChange.bind(this),this.close=this.close.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.onStateChange((()=>{i(this,{"keyboard-nav":this.state.keyboardNavEnabled})})),this.onConnect((()=>{this.classList.add(`theme--${this.widgetSettings.popupColorTheme||"auto"}`),i(this,{"keyboard-nav":this.state.keyboardNavEnabled}),this.overlayEl=t({classes:"overlay",listeners:{click:this.close}}),this.previousEl=t({type:"button",classes:"previous",attributes:{"aria-label":"Previous post"},contents:B}),this.nextEl=t({type:"button",classes:"next",attributes:{"aria-label":"Next post"},contents:F}),this.closeEl=t({type:"button",classes:"close",contents:'<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">\n<path fill-rule="evenodd" clip-rule="evenodd" fill="#081B10" d="M11.6,10.1l5.5-5.7c0.5-0.5,0.5-1.1,0-1.6c-0.5-0.5-1.1-0.5-1.6,0\n\tl-5.5,5.6L4.4,2.8C4,2.4,3.3,2.4,2.8,2.8S2.4,4,2.8,4.4L8.4,10l-5.5,5.6c-0.5,0.5-0.5,1.1,0,1.6c0.5,0.5,1.1,0.5,1.6,0l5.5-5.6\n\tl5.5,5.6c0.5,0.5,1.1,0.5,1.6,0c0.5-0.5,0.5-1.1,0-1.6C17,15.6,11.6,10.1,11.6,10.1z"/>\n</svg>',attributes:{"aria-label":"Close"},listeners:{click:e=>{e.preventDefault(),this.close()}}}),this.breadcrumbContainer=t({classes:"breadcrumbs"}),this.postEls=this.posts.map((e=>{const t=document.createElement("behold-popover-gallery-slide");return t.post=e,t.feedMetadata=this.feedMetadata,t})),this.innerEl=t({classes:"inner",contents:this.postEls}),this.fragment=document.createDocumentFragment(),this.fragment.replaceChildren(this.overlayEl,this.innerEl,this.breadcrumbContainer,this.previousEl,this.nextEl,this.closeEl),this.styleEl=t({type:"style",contents:[O.toString(),j.toString(),P.toString()]}),this.hurdyGurdy=new k({slides:this.postEls,containerEl:this.innerEl,breadcrumbsContainerEl:this.breadcrumbContainer,previousEl:this.previousEl,nextEl:this.nextEl,onSlideChange:this.handleSlideChange,breadcrumbDiameter:this.postEls.length>9?9:8,virtualize:!0}),this.popoverScroller=new D({slides:this.postEls,containerEl:this.innerEl,onSlideChange:this.handleSlideChange,onRequestClose:()=>{this.close()}}),this.onStateChange(this.handleStateChange),this.onResize(this,this,this.handleResize)})),this.onDisconnect((()=>{document.removeEventListener("keydown",this.handleKeydown),C(this.closeFocusEl),this.hurdyGurdy.destroy(),this.popoverScroller.destroy(),this.hurdyGurdy=null,this.popoverScroller=null}))}handleStateChange({changedProps:e,newState:t}){e.includes("popoverOverlayColor")&&(this.overlayEl.style.backgroundColor=t.popoverOverlayColor)}handleKeydown(e){"Escape"===e.code&&(e.preventDefault(),this.close())}open(e,t){this.currentPostIndex=e,this.cancelRaf("open"),this.closeFocusEl=t,this.render(),n(),this.raf((()=>{this.classList.add("is-visible"),async function(e,t=[],i=0){p=e,u=_(e)?e:document,v=!0,w({include:[e],exclude:t}),document.addEventListener("keydown",y),g.observe(e,{subtree:!0,attributes:!0,attributeFilter:["disabled"],childList:!0});const s=await E();s[i]?.focus()}(this.shadow,this.postEls.filter(((t,i)=>i!==e)),1),this.checkSize(this.offsetWidth),this.postEls[e].activate(),document.addEventListener("keydown",this.handleKeydown)}),"open")}close(){this.cancelTo("close"),this.classList.remove("is-visible"),this.to(this.remove.bind(this),300,"close"),C(this.closeFocusEl),document.removeEventListener("keydown",this.handleKeydown)}handleSlideChange(e){this.currentPostIndex=e;let t="image";switch(this.posts[e].mediaType){case"VIDEO":t=this.posts[e].isReel?"reel":"video";break;case"CAROUSEL_ALBUM":t="album";break;default:t="image"}o(`${t}, post ${e+1} of ${this.postEls.length} in gallery`),w({include:[this.shadow],exclude:this.postEls.filter(((t,i)=>i!==e)),merge:!1}),this.onSlideChange&&this.onSlideChange(e),this.postEls.forEach(((t,i)=>{i===e?t.activate():t.deactivate()}));const i=this.postEls[e-1]??null,s=this.postEls[e+1]??null;if(i&&this.raf((()=>i.preload()),"preload"),s&&this.raf((()=>s.preload()),"preload"),"CAROUSEL_ALBUM"!==this.posts[e].mediaType){const t=c(this.posts[e]?.colorPalette?.dominant||"100,100,100").map((e=>Math.round(e)));this.updateState({popoverOverlayColor:`hsl(${t[0]} ${Math.min(t[1],50)}% ${Math.min(t[2],15)}% / .85)`})}}checkSize(e){e>this.verticalScrollBreakpoint?(this.classList.remove("is-scroller"),this.previousEl.style.display="",this.nextEl.style.display="",this.popoverScroller.destroy(),this.hurdyGurdy.init(this.currentPostIndex),this.postEls.forEach((e=>e.expandCaption()))):(this.classList.add("is-scroller"),this.hurdyGurdy.destroy(),this.popoverScroller.init(this.currentPostIndex),this.postEls.forEach((e=>e.collapseCaption())),this.previousEl.disabled=!1,this.previousEl.style.display="none",this.nextEl.disabled=!1,this.nextEl.style.display="none")}handleResize(e){const t=e?.borderBoxSize?.[0]?.inlineSize||0;this.checkSize(t)}render(){document.body.append(this),this.shadow.replaceChildren(this.fragment,this.styleEl)}static register(e="behold-popover-gallery"){return customElements.get(e)||customElements.define(e,U),e}}export{U as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
function e(e){return JSON.parse(JSON.stringify(e,((e,t)=>void 0===t?null:t)))}function t(){return document.body.offsetTop}async function s(e,t){const s=document.createElement(e);return new Promise(((r,n)=>{switch(e){case"img":s.addEventListener("load",(()=>{r(t)}));break;case"video":s.addEventListener("loadeddata",(()=>r(t)))}s.addEventListener("error",(e=>{n(e)})),s.src=t}))}function r({text:e,maxLines:t=2,maxChars:s=50}){if(!e)return;const r=e.match(/.*/g).filter((e=>e.length>0)).slice(0,t).join("").length,n=Math.min(r,s);return e.slice(0,n)}function n(e,t){return`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='${e}' height='${t}'%3E%3C/svg%3E%0A`}function o(e){return new Promise((t=>{let s=new IntersectionObserver((e=>{let r=e.reduce(((e,t,s)=>t.intersectionRatio>e.intersectionRatio?{index:s,intersectionRatio:t.intersectionRatio}:e),{intersectionRatio:0,index:null});s.disconnect(),s=null,t(r.index)}));e.forEach((e=>s.observe(e)))}))}function i(e){return e.isConnected?"#document"===e.nodeName||e instanceof ShadowRoot?e:i(e.parentNode):document}function a(e,t,s=null,r=!1){let n=r,o=null;return(...r)=>{n?(clearTimeout(o),o=setTimeout((()=>{n=!1,e.apply(s,r)}),t)):(e.apply(s,r),n=!0,setTimeout((()=>{n=!1}),t))}}function d(e,t){Object.entries(t).forEach((([t,s])=>{s?e.classList.add(t):e.classList.remove(t)}))}function l(e,t,s){e.style.setProperty(t,s)}function c(e,t,s){return"string"==typeof s&&(s=[s]),s.reduce(((s,r)=>!u(e?.[r],t?.[r])||s),!1)}function u(e,t,s=!1,r=!1){if(r&&(Array.isArray(e)&&(e=e.sort()),Array.isArray(t)&&(t=t.sort())),s&&("number"==typeof e&&(e=e.toString()),"number"==typeof t&&(t=t.toString())),typeof e!=typeof t)return!1;if(null===e&&null===t)return!0;if(null===e&&null!==t)return!1;if(null!==e&&null===t)return!1;if(void 0===e&&void 0===t)return!0;if(void 0===e&&void 0!==t)return!1;if(void 0!==e&&void 0===t)return!1;if("object"==typeof e)return Object.keys(e).length===Object.keys(t).length&&Object.entries(e).reduce(((e,[n,o])=>!!u(o,t[n],s,r)&&e),!0);if(Array.isArray(e)){let n=!0;return e.forEach(((e,o)=>{u(e,t[o],s,r)||(n=!1)})),n}return e===t}function h(e){const t=document.createElement("div");t.innerHTML=e,t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),requestAnimationFrame((()=>{document.body.appendChild(t),setTimeout((()=>{t.remove()}),500)}))}let p={isMuted:!0,popoverOverlayColor:"rgba(0, 0, 0, 0.6)",keyboardNavEnabled:!1},g=!1,f=null,m=null;const b=new Map,w=new Map,y=new Set;class v extends HTMLElement{label="BaseElement";storedProperties=new Map;requiredProperties=[];hasRequiredProps=!1;propChangeHandlers=new Map;queuedPropUpdates=new Set;connectHandlers=new Set;disconnectHandlers=new Set;rafs=new Map;timeouts=new Map;constructor(){super(),this.globalHandleKeydown=this.globalHandleKeydown.bind(this),this.globalHandleMousedown=this.globalHandleMousedown.bind(this),this.globalHandleMousemove=this.globalHandleMousemove.bind(this),f||(f=new ResizeObserver((e=>{e.forEach((e=>{const t=b.get(e.target);t&&t(e)}))}))),m||(m=new IntersectionObserver((e=>{e.forEach((e=>{const t=w.get(e.target);t&&t(e)}))}))),g||(g=!0,document.addEventListener("keydown",this.globalHandleKeydown),document.addEventListener("mousedown",this.globalHandleMousedown),document.addEventListener("mousemove",this.globalHandleMousemove,{passive:!0}))}connectedCallback(){this.connectHandlers.forEach((e=>e()))}disconnectedCallback(){this.rafs.forEach((e=>cancelAnimationFrame(e))),this.rafs.clear(),this.timeouts.forEach((e=>clearTimeout(e))),this.timeouts.clear(),this.disconnectHandlers.forEach((e=>e()))}onConnect(e){this.connectHandlers.add(e)}onDisconnect(e){this.disconnectHandlers.add(e)}onResize(e,t,s){b.set(t,s.bind(e)),f.observe(t),this.disconnectHandlers.add((()=>{b.delete(t),f.unobserve(t)}))}onIntersection(e,t){w.set(e,t),m.observe(e),this.disconnectHandlers.add((()=>{w.delete(e),m.unobserve(e)}))}onPropChange(t,s,r=null){r?this.requiredProperties.push(...r):this.requiredProperties.push(...s),s.forEach((s=>{void 0!==this[s]&&this.storedProperties.set(s,this[s]),this.propChangeHandlers.get(s)||this.propChangeHandlers.set(s,[]),this.propChangeHandlers.get(s).push(t),Object.defineProperty(this,s,{set(t){void 0===t&&(t=null,console.warn(`Attempted to set value of ${s} as "undefined" on ${this.label}. ${s} was coered to null instead.`)),t=e(t);const r=this.storedProperties.has(s)?e(this.storedProperties.get(s)):null;this.storedProperties.set(s,t),this.queueHandlers({prop:s,oldValue:r,newValue:t,context:this})},get(){return this.storedProperties.get(s)}})})),this.queueMissingPropsCheck()}queueHandlers({prop:e,oldValue:t,newValue:s}){this.hasRequiredProps=this.requiredProperties.every((e=>this.storedProperties.has(e))),this.hasRequiredProps?(this.queuedPropUpdates.size&&(this.queuedPropUpdates.delete(e),this.runQueuedPropHandlers()),this.propChangeHandlers.get(e).forEach((r=>{r.call(this,{changedProp:e,oldValue:t,newValue:s})}))):this.queuedPropUpdates.add(e)}runQueuedPropHandlers(){this.queuedPropUpdates.forEach((e=>{this.propChangeHandlers.get(e).forEach((t=>{t.call(this,{changedProp:e,oldValue:null,newValue:this[e]})}))})),this.queuedPropUpdates.clear()}globalHandleKeydown(e){"Tab"===e.key&&this.updateState({keyboardNavEnabled:!0})}globalHandleMousedown(e){0===e.clientX&&0===e.clientY||this.updateState({keyboardNavEnabled:!1})}globalHandleMousemove(e){e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||0===e.movementX||0===e.movementY||this.updateState({keyboardNavEnabled:!1})}get state(){return p}set state(e){throw new Error("Shared state cannot be set directly. Use this.updateState() instead.")}updateState(t){const s=e(p);p={...p,...t},y.forEach((e=>e({changedProps:Object.keys(t),oldState:s,newState:p})))}onStateChange(e){this.connectHandlers.add((()=>{const t=e.bind(this);y.add(t),this.disconnectHandlers.add((()=>y.delete(t)))}))}raf(e,t){const s=requestAnimationFrame((()=>{e(),this.rafs.delete(t)}));return this.rafs.set(t,s),s}cancelRaf(e){cancelAnimationFrame(this.rafs.get(e)),this.rafs.delete(e)}to(e,t,s){const r=setTimeout((()=>{e(),this.timeouts.delete(s)}),t);return this.timeouts.set(s,r),r}cancelTo(e){clearTimeout(this.timeouts.get(e)),this.timeouts.delete(e)}queueMissingPropsCheck(){queueMicrotask((()=>{if(this.requiredProperties.length&&!this.hasRequiredProps){const e=this.requiredProperties.filter((e=>!this.storedProperties.has(e)));console.error(`${this.label||this.tagName} is missing required props: ${e.join(", ")}`)}}))}}function E(e){let{type:t="div",classes:s=[],contents:r=[],attributes:n={},props:o={},style:i={},listeners:a={}}=e;s=Array.isArray(s)?s:[s];const d=document.createElement(t);return Array.isArray(r)||(r=[r]),r=r.filter((e=>null!=e)).map((e=>{if("string"==typeof e&&e.includes("</svg>")){const t=document.createElement("template");return t.innerHTML=e,t.content}return e})),d.replaceChildren(...r),s.length&&(d.className=s.join(" ")),Object.keys(n).forEach((e=>{d.setAttribute(e,n[e])})),Object.assign(d,o),Object.keys(i).forEach((e=>{d.style[e]=i[e]})),Object.keys(a).forEach((e=>{d.addEventListener(e,a[e])})),d}class P extends v{label="BeholdWidget";#e;#t;#s;static get observedAttributes(){return["feed-id"]}constructor(){super(),this.#e=this.attachShadow({mode:"open"}),this.#t=null,this.onPropChange(this.handlePropChange,["widgetSettings","feedMetadata","posts","previewLoadingColors","errorMessage"],[])}attributeChangedCallback(e,t,s){"feed-id"===e&&s!==t&&this.#r(s)}handlePropChange({changedProp:e,oldValue:t,newValue:s}){"errorMessage"!==e||t||!s?"widgetSettings"===e&&c(s,t,"type")?this.#n(s?.type):this.#s&&!u(s,t)&&(this.#s[e]=s):this.#n("ErrorMessage")}async#n(e){"classic"===e&&(e="grid");const t=(await this.#o(e.replace(/.?/,(e=>e.toUpperCase())))).register(),s=E({type:t}),r=E({type:"style",contents:":host{align-items:center;box-sizing:border-box;display:flex;flex-wrap:wrap;justify-content:center;margin:0;min-width:50px;overflow:hidden;position:relative;width:100%}:host *{box-sizing:border-box}:host([hidden]){display:none}".toString()});this.#e.replaceChildren(s,r),this.#s=this.#e.querySelector(t),this.#s.widgetSettings=this.widgetSettings,this.#s.feedMetadata=this.feedMetadata,this.#s.posts=this.posts,this.#s.errorMessage=this.errorMessage||null,window.dispatchEvent(new CustomEvent("behold:widget-loaded",{detail:{id:this["feed-id"]}}))}async#r(e){if(e){this.#t&&this.#t.abort(),this.#t=new AbortController;try{const t=await fetch(`https://feeds.behold.so/${e}`,{mode:"cors",signal:this.#t.signal});if(t.ok){const e=await t.json();this.widgetSettings=e.widgetSettings,this.feedMetadata={username:e.username,profilePictureUrl:e.profilePictureUrl,website:e.website,followersCount:e.followersCount,hashtags:e.hashtags},this.posts=e.media}else{const e=await t.text();this.errorMessage=e}}catch(e){"The user aborted a request."!==e.message&&(this.errorMessage=e.message)}}else this.errorMessage="No feed ID provided"}async#o(e){const{default:t}=await function(e){switch(e){case"./widgets/ErrorMessage.ts":return import("./ErrorMessage-dZizXp4B.js");case"./widgets/GalleryWall.ts":return import("./GalleryWall-LWkZ6rV3.js");case"./widgets/Grid.ts":return import("./Grid-XrVo9P1h.js");default:return new Promise((function(t,s){("function"==typeof queueMicrotask?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+e)))}))}}(`./widgets/${e}.ts`);return t}static register(e="behold-widget"){return customElements.get(e)||customElements.define(e,class extends P{}),e}}export{v as B,l as a,i as b,E as c,o as d,h as e,t as f,n as g,c as h,r as i,P as j,s as p,d as s,a as t};
|
package/dist/Widget.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export{
|
1
|
+
export{j as default}from"./Widget-k0vrivbv.js";
|
@@ -0,0 +1 @@
|
|
1
|
+
import{B as e,s as t,h as o,a as s,c as i,g as a,f as r,t as n,p as h}from"./Widget-k0vrivbv.js";function l(e){if(!e)return e;let[t,o,s]=e.split(",");t/=255,o/=255,s/=255;const i=Math.max(t,o,s),a=i-Math.min(t,o,s),r=a?i===t?(o-s)/a:i===o?2+(s-t)/a:4+(t-o)/a:0;return[60*r<0?60*r+360:60*r,100*(a?i<=.5?a/(2*i-a):a/(2-(2*i-a)):0),100*(2*i-a)/2]}function d(e,t){const o=(s=e,i="dominant",s.filter((e=>e[i])).map((e=>e[i]))).map((e=>l(e).join(",")));var s,i;return[c(p(o,0)),c(p(o,1)),c(p(o,2))]}function c(e){const t=[...e];t.sort((function(e,t){return e-t}));const o=Math.floor((t.length-1)/2);return t.length%2?t[o]:(t[o]+t[o+1])/2}function p(e,t){return e.map((e=>parseInt(e.split(",")[t])))}class f extends e{label="BaseWidget";shadow;styleEl;stylesAdded;contents;constructor(){super(),this.shadow=this.attachShadow({mode:"open"}),this.handleKeydown=this.handleKeydown.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleFocusout=this.handleFocusout.bind(this),this.handleShadowFocusout=this.handleShadowFocusout.bind(this),this.onStateChange((()=>{t(this,{"keyboard-nav":this.state.keyboardNavEnabled})})),this.onConnect((()=>{this.styleEl=document.createElement("style"),t(this,{"keyboard-nav":this.state.keyboardNavEnabled}),this.addEventListener("focus",this.handleFocus),this.addEventListener("focusout",this.handleFocusout),this.shadowRoot.addEventListener("focusout",this.handleShadowFocusout),this.addEventListener("keydown",this.handleKeydown)}))}focusPreviousPost(){this.dispatchEvent(new CustomEvent("post-focus-previous"))}focusNextPost(){this.dispatchEvent(new CustomEvent("post-focus-next"))}handleKeydown(e){"ArrowLeft"===e.key&&e.shiftKey&&this.focusPreviousPost(),"ArrowRight"===e.key&&e.shiftKey&&this.focusNextPost(),this.shadowRoot.activeElement&&this.classList.remove("has-focus")}handleFocus(e){this.shadow.activeElement||this.classList.add("has-focus")}handleFocusout(){this.classList.remove("has-focus")}handleShadowFocusout(e){e.relatedTarget===this&&this.classList.add("has-focus")}renderWidget(e,t){this.stylesAdded&&this.contents?this.contents.replaceWith(e):(this.contents=e,this.styleEl.replaceChildren(...t.map((e=>e.toString()))),this.shadow.replaceChildren(this.contents,this.styleEl),this.stylesAdded=!0)}}function v(e,t,o,s){let i="";switch(e){case"dominant":case"vibrant":case"muted":case"vibrantLight":case"mutedLight":case"vibrantDark":case"mutedDark":i=t?`rgb(${t[e]})`:m(s);break;case"tone":if(o){const e=o.split(",");if(t){const o=(a=1.6,r=l(t.dominant)[2]-s[2],Math.log(Math.abs(r))/Math.log(a)*Math.sign(r));i=`hsl(${e[0]},${e[1]}%,${parseInt(e[2])+o}%)`}else i=`hsl(${e[0]},${e[1]}%,${e[2]}%, ${Math.max(1*Math.random(),.3)})`}else i=m(s)}var a,r;return i}function m(e){return e?`hsl(${e[0]}, ${e[1]}%, ${e[2]}%, ${Math.max(1*Math.random(),.3)})`:""}class b extends e{label="BasePost";post;widgetSettings;feedMetadata;medianPaletteHSL;hasRowGap=!1;isLastRow=!1;onClick;previewLoadingColors=null;index;totalPosts;innerEl;captionEl;sizeClass="post--xlarge";constructor(){super(),this.onPropChange(this.baseHandlePropChange,["post","widgetSettings","feedMetadata","medianPaletteHSL","hasRowGap","isLastRow","previewLoadingColors","index","totalPosts"],["post","widgetSettings","feedMetadata","medianPaletteHSL","index","totalPosts"]),this.handleButtonClick=this.handleButtonClick.bind(this),this.onConnect((()=>{this.onResize(this,this,this.handleResize)}))}baseHandlePropChange({changedProp:e,oldValue:t,newValue:s}){switch(e){case"widgetSettings":s.loadingColor===t?.loadingColor&&s.loadingColorTone===t?.loadingColorTone||this.setBackgroundColor(),o(s,t,["onHover","linkTarget","previewVideosOnHover","onPostClick","customLinkURL"])&&this.renderPost(),o(s,t,["hoverOverlayColor","hoverOverlayCustomColor","hoverOverlayOpacity"])&&this.setOverlayColor(),this.setContainerStyles();break;case"previewLoadingColors":this.setBackgroundColor();break;case"hasRowGap":case"isLastRow":this.setContainerStyles()}}setOverlayColor(){let e="rgba(0, 0, 0, 0.3)",t=this.widgetSettings.hoverOverlayCustomColor??"0,0,0",o=this.widgetSettings.hoverOverlayOpacity??65;if("auto"===this.widgetSettings.hoverOverlayColor){const t=l(this.post.colorPalette?.dominant||"100,100,100").map((e=>Math.round(e)));e=`hsl(${t[0]} ${Math.min(t[1],50)}% ${Math.min(t[2],40)}% / ${o/100})`}if("custom"===this.widgetSettings.hoverOverlayColor){const s=t.split(",");e=`hsl(${s[0]} ${s[1]}% ${s[2]}% / ${o/100})`}s(this,"--overlay-color",e)}setContainerStyles(){t(this,{post:!0,"post--hover-icon":"showIcon"===this.widgetSettings.onHover,"post--hover-caption":"showCaption"===this.widgetSettings.onHover,"post--has-row-gap":this.hasRowGap,"post--last-row":this.isLastRow}),this.setOverlayColor()}renderPost(e){if(!e){e=[...this.innerEl.children].filter((e=>e!==this.captionEl))[0]}let t="div",o=this.post.permalink;this.setContainerStyles(),"linkToProfile"===this.widgetSettings.onPostClick&&this.feedMetadata.username&&(o=`https://instagram.com/${this.feedMetadata.username}`),"customLink"===this.widgetSettings.onPostClick&&this.widgetSettings.customLinkURL&&(o=this.widgetSettings?.customLinkURL),this.widgetSettings.onPostClick.toLowerCase().includes("link")&&(t="a"),this.widgetSettings.onPostClick.toLowerCase().includes("popup")&&(t="button");let s=null;if("showCaption"===this.widgetSettings.onHover){const e=i({contents:this.post.prunedCaption?.length?this.post.prunedCaption:this.post.caption,classes:"post-caption__inner"});s=i({contents:e,classes:"post-caption"})}let a="image";switch(this.post.mediaType){case"VIDEO":a=this.post.isReel?"reel":"video";break;case"CAROUSEL_ALBUM":a="album";break;default:a="image"}this.innerEl=i({type:t,contents:[e,s||""],attributes:{"aria-label":`${a}, post ${this.index+1} of ${this.totalPosts}`,tabindex:-1,..."a"===t?{href:o,target:this.widgetSettings.linkTarget}:{}},listeners:{..."button"===t?{click:this.handleButtonClick}:{}}}),this.replaceChildren(this.innerEl)}setBackgroundColor(){const e=this.previewLoadingColors??this.widgetSettings.loadingColor;this.style.backgroundColor=v(e,this.post.colorPalette,this.widgetSettings.loadingColorTone,this.medianPaletteHSL)}focus(){this.innerEl.focus()}handleResize(e){const o=e?.borderBoxSize?.[0]?.inlineSize||0;let s="xlarge";o<600&&(s="large"),o<400&&(s="medium"),o<250&&(s="small"),o<175&&(s="xsmall");["xsmall","small","medium","large","xlarge"].forEach((e=>{this.sizeClass=`post--${e}`,t(this,{[this.sizeClass]:e===s})}))}handleButtonClick(){this.onClick&&this.onClick(this)}}class u extends e{label="Image";sizes;mediaUrl;isSquare=!1;showLoader=!1;imageSrc;imageSize;imageEl;ldrEl;isVisible=!1;loaderIsShowing=!1;isLoaded=!1;constructor(){super(),this.onPropChange(this.handlePropChange,["sizes","mediaUrl","imageSrc","imageSize","isSquare","showLoader","loaderIsShowing"],["sizes","mediaUrl","isSquare"]),this.handleIntersection=this.handleIntersection.bind(this),this.handleImageLoad=this.handleImageLoad.bind(this),this.handleImageError=this.handleImageError.bind(this),this.onConnect((()=>{const e=this.sizes.full.height,t=this.sizes.full.width;this.imageEl=i({type:"img",attributes:{alt:"",role:"presentation",height:this.isSquare?"100px":e+"px",width:this.isSquare?"100px":t+"px",tabindex:-1,src:a(t,e)},listeners:{load:this.handleImageLoad,error:this.handleImageError}}),this.showLoader?(this.ldrEl=i({classes:"ldr"}),this.replaceChildren(this.ldrEl,this.imageEl)):this.replaceChildren(this.imageEl),r(),this.raf((()=>{this.onResize(this,this,n(this.handleResize,50,this,!0)),this.onIntersection(this,this.handleIntersection)}),"connect")}))}handlePropChange({changedProp:e,oldValue:o,newValue:s}){switch(e){case"imageSize":if(!o||o.width<s.width||!this.isLoaded){const e=this.mediaUrl;this.imageSrc=s?.mediaUrl||e}break;case"imageSrc":this.imageEl&&this.isVisible&&this.imageSrc!==this.imageEl.src&&(this.isLoaded=!1,this.imageEl.src=this.imageSrc);break;case"showLoader":!o&&s&&this.imageEl&&(this.ldrEl=i({classes:"ldr"}),this.replaceChildren(this.ldrEl,this.imageEl));break;case"loaderIsShowing":this.ldrEl&&t(this.ldrEl,{"ldr--visible":s&&!this.isLoaded})}}handleIntersection(e){e.isIntersecting?(this.isVisible=!0,!this.isLoaded&&this.showLoader&&this.to((()=>{this.loaderIsShowing=!0}),50,"loader"),this.imageSrc&&this.imageEl.src!==this.imageSrc&&(this.imageEl.src=this.imageSrc)):this.isVisible=!1}handleResize(e){const t=e?.borderBoxSize?.[0]?.inlineSize||0,o=Object.values(this.sizes).reduce((function(e,o){return Math.abs(o.width/2-t)<Math.abs(e.width/2-t)?o:e}));this.imageSize=o}handleImageLoad(){this.imageEl.src===this.imageSrc&&(this.loaderIsShowing=!1,this.cancelTo("loader"),this.isLoaded=!0,this.dispatchEvent(new Event("load")),this.classList.add("is-loaded"))}handleImageError(){this.imageSrc!==this.mediaUrl&&(this.imageSrc=this.mediaUrl)}preload(){this.isLoaded||this.imageSrc&&this.imageEl.src!==this.imageSrc&&(this.imageEl.src=this.imageSrc)}static register(e="behold-image"){return customElements.get(e)||customElements.define(e,u),e}}class g extends b{label="ImagePost";imageEl;constructor(){super(),this.onPropChange(this.handlePropChange,["post"]),u.register()}handlePropChange({changedProp:e}){if("post"===e){const{sizes:e,mediaUrl:t}=this.post,o=i({type:"behold-image",props:{sizes:e,mediaUrl:t,isSquare:!0}});this.renderPost(o)}}static register(e="behold-image-post"){return customElements.get(e)||customElements.define(e,g),e}}class y extends e{label="Video";mediaUrl;sizes;videoEl;imageEl;isLoaded=!1;isMuted=!0;constructor(){super(),this.onPropChange((()=>{}),["mediaUrl","sizes"]),this.handleIntersection=this.handleIntersection.bind(this),this.handleVideoLoad=this.handleVideoLoad.bind(this),this.handlePageVisibility=this.handlePageVisibility.bind(this),this.handlePlay=this.handlePlay.bind(this),this.handlePause=this.handlePause.bind(this),document.addEventListener("visibilitychange",this.handlePageVisibility),this.onIntersection(this,this.handleIntersection),this.onConnect((()=>{this.render()})),this.onDisconnect((()=>{document.removeEventListener("visibilitychange",this.handlePageVisibility),this.videoEl.removeEventListener("play",this.handlePlay),this.videoEl.removeEventListener("pause",this.handlePause)}))}get isPlaying(){return!!(this.videoEl.currentTime>0&&!this.videoEl.paused&&!this.videoEl.ended&&this.videoEl.readyState>2)}get paused(){return this.videoEl?.paused}get muted(){return this.videoEl?.muted}render(){this.videoEl=i({type:"video",attributes:{loop:!0,playsinline:!0,crossorigin:"anonymous",tabIndex:-1,disablePictureInPicture:!0,disableremoteplayback:!0,height:this.sizes.full.height,width:this.sizes.full.width},props:{muted:this.isMuted},listeners:{play:this.handlePlay,pause:this.handlePause}}),this.imageEl=i({type:"img",attributes:{height:this.sizes.full.height,width:this.sizes.full.width,src:a(this.sizes.full.width,this.sizes.full.height)}}),this.replaceChildren(this.imageEl)}handleIntersection(e){e.isIntersecting?this.videoEl.src!==this.mediaUrl&&(this.videoEl.addEventListener("loadeddata",this.handleVideoLoad,{once:!0}),this.videoEl.src=this.mediaUrl):this.pause()}handleVideoLoad(){this.isLoaded=!0,this.videoEl.currentTime=.25,this.videoEl.pause(),this.dispatchEvent(new Event("load")),this.replaceChildren(this.videoEl),r(),this.raf((()=>{this.classList.add("is-loaded")}),"handleVideoLoad")}handlePlay(){this.dispatchEvent(new Event("play"))}handlePause(){this.dispatchEvent(new Event("pause"))}async play(){if(this.videoEl)try{await this.videoEl.play()}catch(e){}}pause(){this.videoEl&&this.videoEl.pause()}mute(){this.isMuted=!0,this.videoEl&&(this.videoEl.muted=!0)}unmute(){this.isMuted=!1,this.videoEl&&(this.videoEl.muted=!1)}handlePageVisibility(){document.hidden&&this.pause()}preload(){this.isLoaded||h("video",this.mediaUrl)}static register(e="behold-video"){return customElements.get(e)||customElements.define(e,y),e}}class w extends b{label="VideoPost";videoEl;imageEl;constructor(){super(),this.onPropChange(this.handlePropChange,["post","widgetSettings"]),y.register(),u.register(),this.handleMouseover=this.handleMouseover.bind(this),this.handleMouseleave=this.handleMouseleave.bind(this),this.onDisconnect((()=>{this.removeEventListener("mouseover",this.handleMouseover),this.removeEventListener("mouseleave",this.handleMouseleave)}))}handlePropChange({changedProp:e,oldValue:t,newValue:s}){if("post"===e||"widgetSettings"===e&&o(t,s,["previewVideosOnHover"])){const{sizes:e,mediaUrl:t,thumbnailUrl:o}=this.post;this.widgetSettings.previewVideosOnHover&&t?(this.videoEl=i({type:"behold-video",props:{mediaUrl:t,sizes:e}}),this.addEventListener("mouseover",this.handleMouseover,{passive:!0}),this.addEventListener("mouseleave",this.handleMouseleave,{passive:!0}),this.renderPost(this.videoEl)):(this.imageEl=i({type:"behold-image",props:{sizes:e,mediaUrl:o,isSquare:!0}}),this.renderPost(this.imageEl))}}handleMouseover(){this.videoEl?.play()}handleMouseleave(){this.videoEl?.pause()}static register(e="behold-video-post"){return customElements.get(e)||customElements.define(e,w),e}}class k extends b{label="AlbumPost";imageEl;constructor(){super(),u.register(),this.onPropChange(this.handlePropChange,["post"])}handlePropChange({changedProp:e}){if("post"===e){const{sizes:e,mediaUrl:t}=this.post,o=i({type:"behold-image",props:{sizes:e,mediaUrl:t,isSquare:!0}});this.renderPost(o)}}static register(e="behold-album-post"){return customElements.get(e)||customElements.define(e,k),e}}var z=":host{--icon-instagram:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 35 35' xml:space='preserve'%3E%3Cpath fill='%23FFF' d='M17.6 3.2c4.7 0 5.2 0 7.1.1 1.7.1 2.6.4 3.2.6.8.3 1.4.7 2 1.3.6.6 1 1.2 1.3 2 .2.6.5 1.5.6 3.3.1 1.8.1 2.4.1 7.1s0 5.2-.1 7.1c-.1 1.7-.4 2.6-.6 3.2-.6 1.5-1.8 2.7-3.3 3.3-.6.2-1.5.5-3.2.6-1.8.1-2.4.1-7.1.1s-5.2 0-7.1-.1c-1.7-.1-2.6-.4-3.2-.6-.8-.3-1.4-.7-2-1.3-.6-.6-1-1.2-1.3-2-.2-.6-.5-1.5-.6-3.2-.1-1.8-.1-2.4-.1-7.1s0-5.2.1-7.1c0-1.8.3-2.7.6-3.3.3-.8.7-1.4 1.3-2 .6-.6 1.2-1 2-1.3.6-.2 1.5-.5 3.2-.6 1.9-.1 2.4-.1 7.1-.1m0-3.2c-4.8 0-5.3 0-7.2.1-1.9.1-3.2.4-4.3.8C5 1.4 3.9 2 3 2.9c-.9.9-1.5 2-2 3.1C.6 7.1.3 8.4.2 10.2c-.1 1.9-.1 2.5-.1 7.2s0 5.3.1 7.2c.1 2 .4 3.2.8 4.4.4 1.2 1.1 2.2 2 3.1.9.9 1.9 1.6 3.1 2 1.1.4 2.4.7 4.2.8s2.5.1 7.2.1 5.3 0 7.2-.1c1.9-.1 3.1-.4 4.2-.8 2.3-.9 4.2-2.8 5.1-5.1.4-1.1.7-2.4.8-4.2.1-1.9.1-2.5.1-7.2s0-5.3-.1-7.2c-.1-1.9-.4-3.1-.8-4.2-.4-1.2-1.1-2.2-2-3.1-.9-.9-1.9-1.6-3.1-2-1.1-.4-2.4-.7-4.2-.8-1.8-.3-2.4-.3-7.1-.3z'/%3E%3Cpath fill='%23FFF' d='M17.6 8.5c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 14.8c-3.2 0-5.8-2.6-5.8-5.8s2.6-5.8 5.8-5.8 5.8 2.6 5.8 5.8-2.6 5.8-5.8 5.8z'/%3E%3Ccircle fill='%23FFF' cx='26.9' cy='8.2' r='2.1'/%3E%3C/svg%3E\");--icon-video:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 35 35' xml:space='preserve'%3E%3Cpath fill='%23FFF' d='M30.1 15.5 7.2 2.3c-1.5-.9-3.5.2-3.5 1.9v26.5c0 1.7 1.9 2.9 3.4 1.9L30 19.4c1.7-.8 1.7-3 .1-3.9z'/%3E%3C/svg%3E\");--icon-album:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 35 35' xml:space='preserve'%3E%3Cpath fill='%23FFF' d='M27.3 22.7v-17c0-2.6-2.1-4.7-4.7-4.7H5.7C3.1 1 1 3.1 1 5.7v17c0 2.6 2.1 4.7 4.7 4.7h17c2.5-.1 4.6-2.2 4.6-4.7zm4-13.4v14.6c0 4.1-3.4 7.4-7.4 7.4H9.2c-.5 0-.8.6-.5 1 .9 1 2.2 1.6 3.7 1.6h12.1c5.2 0 9.3-4.2 9.3-9.3V12.5c0-1.5-.6-2.8-1.6-3.7-.3-.4-.9 0-.9.5z'/%3E%3C/svg%3E\");align-items:center;border:none;box-shadow:none;box-sizing:border-box;display:flex;flex-wrap:wrap;justify-content:center;margin:0;min-width:50px;outline:none;position:relative;width:100%}:host *{box-sizing:border-box}:host(.keyboard-nav.has-focus){outline:none}:host(.keyboard-nav.has-focus):before{background-color:rgba(0,0,0,.25);border-radius:6px;content:\"\";display:block;height:100%;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:100%;z-index:1}:host(.keyboard-nav.has-focus):after{background-color:#222;border-radius:6px;box-shadow:0 0 0 2px #4169e1,0 0 0 3px #fff,0 .6px .4px rgba(0,0,0,.042),0 1.3px 1px rgba(0,0,0,.061),0 2.5px 1.9px rgba(0,0,0,.075),0 4.5px 3.4px rgba(0,0,0,.089),0 8.4px 6.3px rgba(0,0,0,.108),0 20px 15px rgba(0,0,0,.15);color:#fff;content:\"Shift + arrow keys to navigate posts\";font-family:sans-serif;font-size:16px;max-width:80%;padding:15px;position:absolute;text-align:center;z-index:1}@media (max-width:1300px){:host(.keyboard-nav.has-focus):after{font-size:15px}}:host(.keyboard-nav.has-focus) .posts{opacity:.65}.posts{display:grid;margin:0;padding:0;width:100%}.post{-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;align-self:stretch;border:none;border-radius:var(--post-border-radius);color:inherit;font:inherit;isolation:isolate;line-height:normal;margin:0 0 -1px;overflow:hidden;transform:translateZ(0);transition:background .3s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:calc(100% + .5px)}:host(.keyboard-nav) .post.post:focus-within{box-shadow:0 0 0 1px #fff,0 0 0 3px #4169e1,0 0 0 4px #fff;z-index:1}:host(.is-previewing-loading-colors) .post *{opacity:0}.post.post--has-row-gap,.post.post--last-row{margin:0}.post:before{background-color:transparent;border-radius:var(--post-border-radius);content:\"\";height:100%;left:0;pointer-events:none;position:absolute;top:0;transition:all 2s cubic-bezier(.215,.61,.355,1);width:100%;z-index:2}@supports ((-webkit-backdrop-filter:blur(3px)) or (backdrop-filter:blur(3px))){[data-hover-effect*=blur i] .post:before{height:calc(100% - 1px);left:0;opacity:0;top:0;transition:all .6s cubic-bezier(.215,.61,.355,1);width:100%}}.post.post--hover-icon:after{background-image:var(--icon);background-position:50%;background-repeat:no-repeat;background-size:auto 100%;border-radius:var(--post-border-radius);content:\"\";height:12%;left:0;max-height:30px;min-height:20px;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%) scale(.75);transition:all .6s cubic-bezier(.215,.61,.355,1);width:100%;will-change:transform;z-index:3}@media (prefers-reduced-motion){.post.post--hover-icon:after{transition:none}}.post>a,.post>button,.post>div{background-color:transparent;border:0;box-shadow:none;color:inherit;display:block;font:inherit;height:100%;line-height:inherit;outline:none;padding:0;transition:opacity .3s ease;width:100%}.post a,.post button{cursor:pointer}behold-image-post{--icon:var(--icon-instagram)}behold-video-post{--icon:var(--icon-video)}behold-album-post{--icon:var(--icon-album)}.post-caption{align-items:center;background-color:var(--overlay-color);display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:15px;height:100%;justify-content:center;left:0;line-height:1.5;opacity:0;padding:15%;position:absolute;top:0;transition:opacity .4s ease;width:100%;z-index:2}.post:hover .post-caption,:host(:host(.keyboard-nav)) .post:focus-within .post-caption{opacity:1}.post--xlarge .post-caption{--lines:12;--innerScale:scale(0.98);padding:20%}.post--large .post-caption{--lines:9;--innerScale:scale(0.98)}.post--medium .post-caption{--lines:6;--innerScale:scale(0.97);font-size:14px}.post--small .post-caption{--lines:4;--innerScale:scale(0.95);font-size:13px;line-height:1.25}.post--xsmall .post-caption{--lines:3;--innerScale:scale(0.95);font-size:12px;line-height:1.25}.post-caption__inner{-webkit-line-clamp:var(--lines);-webkit-box-orient:vertical;color:#fff;display:-webkit-box;opacity:0;overflow:hidden;text-align:center;transform:var(--innerScale);transition:all .3s ease;white-space:pre-line;will-change:transform,opacity;word-break:none}@media (prefers-reduced-motion){.post-caption__inner{transform:none}}.post:hover .post-caption__inner,:host(.keyboard-nav) .post:focus-within .post-caption__inner{opacity:1;transform:none;transition:all .3s ease}:host(.keyboard-nav) .post:focus-within:before{background-color:var(--overlay-color);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) .post:focus-within:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=fade] .post:focus-within:before,[data-hover-effect=fade] .post:hover:before{background-color:var(--overlay-color);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) [data-hover-effect=fade] .post:focus-within:after,[data-hover-effect=fade] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within behold-image img,:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within behold-video video,[data-hover-effect=zoomFade] .post:hover behold-image img,[data-hover-effect=zoomFade] .post:hover behold-video video{transform:scale(1.05)}@media (prefers-reduced-motion){:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within behold-image img,:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within behold-video video,[data-hover-effect=zoomFade] .post:hover behold-image img,[data-hover-effect=zoomFade] .post:hover behold-video video{transform:none}}:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within:before,[data-hover-effect=zoomFade] .post:hover:before{background-color:var(--overlay-color);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within:after,[data-hover-effect=zoomFade] .post:hover:after{opacity:1;transform:translateY(-50%)}@supports not ((-webkit-backdrop-filter:blur(3px)) or (backdrop-filter:blur(3px))){:host(.keyboard-nav) [data-hover-effect=blur] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=blur] .post:focus-within behold-video,[data-hover-effect=blur] .post:hover behold-image,[data-hover-effect=blur] .post:hover behold-video{filter:brightness(97%) blur(3px);transition:all .6s cubic-bezier(.215,.61,.355,1)}}@supports ((-webkit-backdrop-filter:blur(3px)) or (backdrop-filter:blur(3px))){:host(.keyboard-nav) [data-hover-effect=blur] .post:focus-within:before,[data-hover-effect=blur] .post:hover:before{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background-color:rgba(0,0,0,.002);opacity:1}}:host(.keyboard-nav) [data-hover-effect=blur] .post:focus-within:after,[data-hover-effect=blur] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-video,[data-hover-effect=zoomBlur] .post:hover behold-image,[data-hover-effect=zoomBlur] .post:hover behold-video{transform:scale(1.05);transition:all .6s cubic-bezier(.215,.61,.355,1)}@media (prefers-reduced-motion){:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-video,[data-hover-effect=zoomBlur] .post:hover behold-image,[data-hover-effect=zoomBlur] .post:hover behold-video{transform:none}}@supports not ((-webkit-backdrop-filter:blur(3px)) or (backdrop-filter:blur(3px))){:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-video,[data-hover-effect=zoomBlur] .post:hover behold-image,[data-hover-effect=zoomBlur] .post:hover behold-video{filter:brightness(97%) blur(3px)}}@supports ((-webkit-backdrop-filter:blur(3px)) or (backdrop-filter:blur(3px))){:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within:before,[data-hover-effect=zoomBlur] .post:hover:before{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background-color:rgba(0,0,0,.002);opacity:1}}:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within:after,[data-hover-effect=zoomBlur] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=toGreyscale] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=toGreyscale] .post:focus-within behold-video,[data-hover-effect=toGreyscale] .post:hover behold-image,[data-hover-effect=toGreyscale] .post:hover behold-video{filter:grayscale(100%);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) [data-hover-effect=toGreyscale] .post:focus-within:after,[data-hover-effect=toGreyscale] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=zoomToGreyscale] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=zoomToGreyscale] .post:focus-within behold-video,[data-hover-effect=zoomToGreyscale] .post:hover behold-image,[data-hover-effect=zoomToGreyscale] .post:hover behold-video{filter:grayscale(100%);transform:scale(1.05);transition:all .6s cubic-bezier(.215,.61,.355,1)}@media (prefers-reduced-motion){:host(.keyboard-nav) [data-hover-effect=zoomToGreyscale] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=zoomToGreyscale] .post:focus-within behold-video,[data-hover-effect=zoomToGreyscale] .post:hover behold-image,[data-hover-effect=zoomToGreyscale] .post:hover behold-video{transform:none}}:host(.keyboard-nav) [data-hover-effect=zoomToGreyscale] .post:focus-within:after,[data-hover-effect=zoomToGreyscale] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post,[data-hover-effect=fromGreyscale] .post{filter:grayscale(100%)}:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post:focus,:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post:hover,[data-hover-effect=fromGreyscale] .post:focus,[data-hover-effect=fromGreyscale] .post:hover{filter:grayscale(0);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post:focus:after,:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post:hover:after,[data-hover-effect=fromGreyscale] .post:focus:after,[data-hover-effect=fromGreyscale] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post,[data-hover-effect=zoomFromGreyscale] .post{filter:grayscale(100%)}:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover,[data-hover-effect=zoomFromGreyscale] .post:focus,[data-hover-effect=zoomFromGreyscale] .post:hover{filter:grayscale(0)}:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus behold-image,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus behold-video,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover behold-image,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover behold-video,[data-hover-effect=zoomFromGreyscale] .post:focus behold-image,[data-hover-effect=zoomFromGreyscale] .post:focus behold-video,[data-hover-effect=zoomFromGreyscale] .post:hover behold-image,[data-hover-effect=zoomFromGreyscale] .post:hover behold-video{opacity:.5;transform:scale(1.05);transition:all .6s cubic-bezier(.215,.61,.355,1)}@media (prefers-reduced-motion){:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus behold-image,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus behold-video,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover behold-image,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover behold-video,[data-hover-effect=zoomFromGreyscale] .post:focus behold-image,[data-hover-effect=zoomFromGreyscale] .post:focus behold-video,[data-hover-effect=zoomFromGreyscale] .post:hover behold-image,[data-hover-effect=zoomFromGreyscale] .post:hover behold-video{transform:none}}:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus:after,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover:after,[data-hover-effect=zoomFromGreyscale] .post:focus:after,[data-hover-effect=zoomFromGreyscale] .post:hover:after{opacity:1;transform:translateY(-50%)}behold-image{display:block;height:0;overflow:hidden;padding:0 0 100%;position:relative;transition:all .6s cubic-bezier(.215,.61,.355,1);width:100%}behold-image img{border-radius:0;height:100%;left:0;-o-object-fit:cover;object-fit:cover;-o-object-position:center center;object-position:center center;opacity:0;position:absolute;top:0;transition:all .6s cubic-bezier(.215,.61,.355,1),opacity .6s ease;vertical-align:middle;width:100%;will-change:transform;z-index:1}@supports not ((-webkit-backdrop-filter:blur(3px)) or (backdrop-filter:blur(3px))){[data-hover-effect=blur] behold-image img,[data-hover-effect=zoomBlur] behold-image img{height:calc(100% + 6px);left:-3px;top:-3px;width:calc(100% + 6px)}}.post--reel behold-image img{-o-object-position:center 25%;object-position:center 25%}behold-image.is-loaded img{opacity:1}behold-video{display:block;height:0;overflow:hidden;padding:0 0 100%;position:relative;transition:all .6s cubic-bezier(.215,.61,.355,1);width:100%}behold-video video{height:100%;left:0;-o-object-fit:cover;object-fit:cover;-o-object-position:center center;object-position:center center;opacity:0;pointer-events:none;position:absolute;top:0;transition:all .6s cubic-bezier(.215,.61,.355,1),opacity .6s ease;vertical-align:middle;width:100%;will-change:transform}.post--reel behold-video video{-o-object-position:center 25%;object-position:center 25%}behold-video.is-loaded video{opacity:1}";export{k as A,f as B,g as I,l as R,w as V,y as a,u as b,d as g,z as s};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"BasePost.d.ts","sourceRoot":"","sources":["../../src/elements/BasePost.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAA;AAMvC;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,WAAW;IAC/C,KAAK,SAAa;IAGlB,IAAI,EAAE,IAAI,CAAA;IACV,cAAc,EAAE,cAAc,CAAA;IAC9B,YAAY,EAAE,YAAY,CAAA;IAC1B,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAC/B,SAAS,EAAE,OAAO,CAAQ;IAC1B,SAAS,EAAE,OAAO,CAAQ;IAC1B,OAAO,EAAE,QAAQ,CAAA;IACjB,oBAAoB,EAAE,MAAM,CAAO;
|
1
|
+
{"version":3,"file":"BasePost.d.ts","sourceRoot":"","sources":["../../src/elements/BasePost.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAA;AAMvC;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,WAAW;IAC/C,KAAK,SAAa;IAGlB,IAAI,EAAE,IAAI,CAAA;IACV,cAAc,EAAE,cAAc,CAAA;IAC9B,YAAY,EAAE,YAAY,CAAA;IAC1B,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAC/B,SAAS,EAAE,OAAO,CAAQ;IAC1B,SAAS,EAAE,OAAO,CAAQ;IAC1B,OAAO,EAAE,QAAQ,CAAA;IACjB,oBAAoB,EAAE,MAAM,CAAO;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAGlB,OAAO,EAAE,WAAW,CAAA;IACpB,SAAS,EAAE,WAAW,CAAA;IACtB,SAAS,EAAE,MAAM,CAAiB;;IAwClC,oBAAoB,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE;;;;KAAA;IA6CxD,eAAe,IAAI,IAAI;IA8BvB,kBAAkB;IAelB,UAAU,CAAC,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI;IA6FhD,kBAAkB,IAAI,IAAI;IAU1B,KAAK,IAAI,IAAI;IAOb,YAAY,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI;IAmB9C;;OAEG;IACH,iBAAiB;CAKlB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PopoverGallery.d.ts","sourceRoot":"","sources":["../../src/elements/PopoverGallery.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAA;AAKvC,OAAO,UAAU,MAAM,mBAAmB,CAAA;AAC1C,OAAO,eAAe,MAAM,wBAAwB,CAAA;AACpD,OAAO,mBAAmB,MAAM,uBAAuB,CAAA;AAQvD;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,WAAW;IACrD,KAAK,SAAmB;IAGxB,wBAAwB,SAAM;IAC9B,MAAM,EAAE,UAAU,CAAA;IAClB,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,OAAO,EAAE,gBAAgB,CAAA;IACzB,WAAW,EAAE,OAAO,CAAA;IACpB,SAAS,EAAE,WAAW,CAAA;IACtB,UAAU,EAAE,iBAAiB,CAAA;IAC7B,MAAM,EAAE,iBAAiB,CAAA;IACzB,OAAO,EAAE,iBAAiB,CAAA;IAC1B,mBAAmB,EAAE,WAAW,CAAA;IAChC,OAAO,EAAE,WAAW,CAAA;IACpB,OAAO,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAA;IACnC,UAAU,EAAE,UAAU,CAAA;IACtB,eAAe,EAAE,eAAe,CAAA;IAChC,gBAAgB,EAAE,MAAM,CAAI;IAG5B,KAAK,EAAE,KAAK,CAAA;IACZ,cAAc,EAAE,cAAc,CAAA;IAC9B,YAAY,EAAE,YAAY,CAAA;IAC1B,YAAY,EAAE,WAAW,CAAgB;IACzC,aAAa,EAAE,QAAQ,CAAA;;IAoIvB;;OAEG;IACH,iBAAiB,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE;;;KAAA;IAM5C;;OAEG;IACH,aAAa,CAAC,GAAG,EAAE,aAAa;IAOhC;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW;IAqB7C;;OAEG;IACH,KAAK;IAQL;;OAEG;IACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM;
|
1
|
+
{"version":3,"file":"PopoverGallery.d.ts","sourceRoot":"","sources":["../../src/elements/PopoverGallery.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAA;AAKvC,OAAO,UAAU,MAAM,mBAAmB,CAAA;AAC1C,OAAO,eAAe,MAAM,wBAAwB,CAAA;AACpD,OAAO,mBAAmB,MAAM,uBAAuB,CAAA;AAQvD;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,WAAW;IACrD,KAAK,SAAmB;IAGxB,wBAAwB,SAAM;IAC9B,MAAM,EAAE,UAAU,CAAA;IAClB,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,OAAO,EAAE,gBAAgB,CAAA;IACzB,WAAW,EAAE,OAAO,CAAA;IACpB,SAAS,EAAE,WAAW,CAAA;IACtB,UAAU,EAAE,iBAAiB,CAAA;IAC7B,MAAM,EAAE,iBAAiB,CAAA;IACzB,OAAO,EAAE,iBAAiB,CAAA;IAC1B,mBAAmB,EAAE,WAAW,CAAA;IAChC,OAAO,EAAE,WAAW,CAAA;IACpB,OAAO,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAA;IACnC,UAAU,EAAE,UAAU,CAAA;IACtB,eAAe,EAAE,eAAe,CAAA;IAChC,gBAAgB,EAAE,MAAM,CAAI;IAG5B,KAAK,EAAE,KAAK,CAAA;IACZ,cAAc,EAAE,cAAc,CAAA;IAC9B,YAAY,EAAE,YAAY,CAAA;IAC1B,YAAY,EAAE,WAAW,CAAgB;IACzC,aAAa,EAAE,QAAQ,CAAA;;IAoIvB;;OAEG;IACH,iBAAiB,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE;;;KAAA;IAM5C;;OAEG;IACH,aAAa,CAAC,GAAG,EAAE,aAAa;IAOhC;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW;IAqB7C;;OAEG;IACH,KAAK;IAQL;;OAEG;IACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM;IA8DlC;;OAEG;IACH,SAAS,CAAC,cAAc,EAAE,MAAM;IAoBhC,YAAY,CAAC,KAAK,EAAE,mBAAmB;IAQvC,MAAM,IAAI,IAAI;IAQd,MAAM,CAAC,QAAQ,CAAC,IAAI,SAA2B;CAMhD;AAKD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,wBAAwB,EAAE,cAAc,CAAA;KACzC;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PopoverSlideAlbum.d.ts","sourceRoot":"","sources":["../../src/elements/PopoverSlideAlbum.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAA;
|
1
|
+
{"version":3,"file":"PopoverSlideAlbum.d.ts","sourceRoot":"","sources":["../../src/elements/PopoverSlideAlbum.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAA;AAKvC,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,iBAAiB,MAAM,qBAAqB,CAAA;AACnD,OAAO,UAAU,MAAM,mBAAmB,CAAA;AAI1C;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,WAAW;IACxD,KAAK,SAAsB;IAG3B,WAAW,EAAE,WAAW,CAAA;IACxB,aAAa,EAAE,WAAW,CAAA;IAC1B,QAAQ,EAAE,KAAK,CAAC,KAAK,GAAG,iBAAiB,CAAC,CAAA;IAC1C,UAAU,EAAE,WAAW,CAAA;IACvB,MAAM,EAAE,WAAW,CAAA;IACnB,aAAa,EAAE,WAAW,CAAA;IAC1B,aAAa,EAAE,UAAU,CAAA;IACzB,iBAAiB,EAAE,MAAM,CAAI;IAG7B,IAAI,EAAE,IAAI,CAAA;;IA+EV;;OAEG;IACH,QAAQ;IAKR;;OAEG;IACH,cAAc;IAQd;;OAEG;IACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM;IAoDlC;;OAEG;IACH,aAAa,IAAI,KAAK,CAAC,KAAK,GAAG,iBAAiB,CAAC;IAgCjD;;OAEG;IACH,IAAI;IAQJ;;OAEG;IACH,KAAK;IAOL;;OAEG;IACH,OAAO;IAOP,MAAM,CAAC,QAAQ,CAAC,IAAI,SAA+B;CAMpD;AAKD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,4BAA4B,EAAE,iBAAiB,CAAA;KAChD;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PopoverSlideVideo.d.ts","sourceRoot":"","sources":["../../src/elements/PopoverSlideVideo.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,KAAK,MAAM,SAAS,CAAA;AAI3B;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,WAAW;IACxD,KAAK,SAAsB;IAG3B,OAAO,EAAE,KAAK,CAAA;IACd,OAAO,EAAE,KAAK,CAAA;IACd,cAAc,EAAE,WAAW,CAAA;IAC3B,SAAS,EAAE,OAAO,CAAQ;IAG1B,IAAI,EAAE,IAAI,CAAA;;
|
1
|
+
{"version":3,"file":"PopoverSlideVideo.d.ts","sourceRoot":"","sources":["../../src/elements/PopoverSlideVideo.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,KAAK,MAAM,SAAS,CAAA;AAI3B;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,WAAW;IACxD,KAAK,SAAsB;IAG3B,OAAO,EAAE,KAAK,CAAA;IACd,OAAO,EAAE,KAAK,CAAA;IACd,cAAc,EAAE,WAAW,CAAA;IAC3B,SAAS,EAAE,OAAO,CAAQ;IAG1B,IAAI,EAAE,IAAI,CAAA;;IA2EV,gBAAgB,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE;;;KAAA;IAU1C,iBAAiB,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE;;;KAAA;IAc5C,MAAM;IAQN,MAAM;IAIN,OAAO;IAIP,IAAI;IAIJ,KAAK;IAOL,cAAc;IASd,WAAW;IASX,gBAAgB;IAKhB,gBAAgB;IAKhB;;OAEG;IACH,OAAO;IAOP,MAAM,CAAC,QAAQ,CAAC,IAAI,SAA+B;CAMpD;AAKD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,4BAA4B,EAAE,iBAAiB,CAAA;KAChD;CACF"}
|
package/dist/lib/utils.d.ts
CHANGED
@@ -85,4 +85,5 @@ export declare function hasChanges(obj1: object, obj2: object, props: string | s
|
|
85
85
|
* Check if two values are the same
|
86
86
|
*/
|
87
87
|
export declare function isEqual(a: any, b: any, fuzzyNumbers?: boolean, sortArrays?: boolean): any;
|
88
|
+
export declare function announceToScreenReader(text: string): void;
|
88
89
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/lib/utils.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAOtD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,oBAmBpE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,QAAY,EAAE,QAAa,EAAE;;;;CAAA,OAUrE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAEhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBvE;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,EAAE,EAAE,IAAI,GACP,QAAQ,GAAG,UAAU,CAYvB;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,MAAO,EACd,aAAa,UAAQ,GACpB,QAAQ,CAoBV;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,OAAO,EACf,OAAO,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,QASpC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAExE;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,WAUzB;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CACrB,CAAC,EAAE,GAAG,EACN,CAAC,EAAE,GAAG,EACN,YAAY,UAAQ,EACpB,UAAU,UAAQ,OAkCnB"}
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAOtD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,oBAmBpE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,QAAY,EAAE,QAAa,EAAE;;;;CAAA,OAUrE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAEhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBvE;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,EAAE,EAAE,IAAI,GACP,QAAQ,GAAG,UAAU,CAYvB;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,MAAO,EACd,aAAa,UAAQ,GACpB,QAAQ,CAoBV;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,OAAO,EACf,OAAO,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,QASpC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAExE;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,WAUzB;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CACrB,CAAC,EAAE,GAAG,EACN,CAAC,EAAE,GAAG,EACN,YAAY,UAAQ,EACpB,UAAU,UAAQ,OAkCnB;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,QAYlD"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"GalleryWall.d.ts","sourceRoot":"","sources":["../../src/widgets/GalleryWall.ts"],"names":[],"mappings":"AAGA,OAAO,IAAI,MAAM,2BAA2B,CAAA;AAI5C,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AAOnD,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,IAAI;IAC3C,KAAK,SAAgB;IAGrB,cAAc,EAAE,cAAc,CAAA;IAC9B,YAAY,EAAE,YAAY,CAAA;IAC1B,KAAK,EAAE,KAAK,CAAA;IACZ,oBAAoB,EAAE,MAAM,CAAO;IAGnC,WAAW,EAAE,WAAW,CAAA;IACxB,WAAW,EAAE,WAAW,CAAA;IACxB,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;IACxB,gBAAgB,EAAE,cAAc,CAAA;IAChC,iBAAiB,EAAE,UAAU,CAAA;IAC7B,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAC/B,eAAe,EAAE,OAAO,CAAQ;IAChC,YAAY,EAAE,QAAQ,CAAA;;IAqDtB,gBAAgB,CAAC,EAAE,WAAW,EAAE;;KAAA;IAgChC,iBAAiB;IAYjB,oBAAoB;IAkBpB,oBAAoB;
|
1
|
+
{"version":3,"file":"GalleryWall.d.ts","sourceRoot":"","sources":["../../src/widgets/GalleryWall.ts"],"names":[],"mappings":"AAGA,OAAO,IAAI,MAAM,2BAA2B,CAAA;AAI5C,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AAOnD,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,IAAI;IAC3C,KAAK,SAAgB;IAGrB,cAAc,EAAE,cAAc,CAAA;IAC9B,YAAY,EAAE,YAAY,CAAA;IAC1B,KAAK,EAAE,KAAK,CAAA;IACZ,oBAAoB,EAAE,MAAM,CAAO;IAGnC,WAAW,EAAE,WAAW,CAAA;IACxB,WAAW,EAAE,WAAW,CAAA;IACxB,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;IACxB,gBAAgB,EAAE,cAAc,CAAA;IAChC,iBAAiB,EAAE,UAAU,CAAA;IAC7B,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAC/B,eAAe,EAAE,OAAO,CAAQ;IAChC,YAAY,EAAE,QAAQ,CAAA;;IAqDtB,gBAAgB,CAAC,EAAE,WAAW,EAAE;;KAAA;IAgChC,iBAAiB;IAYjB,oBAAoB;IAkBpB,oBAAoB;IAoBpB,KAAK;IAwBL;;OAEG;IACG,oBAAoB;IAoB1B,YAAY,CAAC,KAAK,EAAE,mBAAmB;IAUvC;;OAEG;IACH,uBAAuB;IAevB;;OAEG;IACH,mBAAmB;IAenB;;OAEG;IACH,eAAe,CAAC,IAAI,EAAE,QAAQ;IAO9B,WAAW,CAAC,UAAU,EAAE,UAAU;IAYlC,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW;;;;;;;;;;;IAqB7D,gBAAgB,CAAC,UAAU,EAAE,UAAU,EAAE,WAAW,GAAE,OAAe;IAmFrE,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC;IAkDtD,kBAAkB,WAMjB;IAKD,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAwB,GAAG,MAAM;CAMtD;AAKD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,WAAW,CAAA;KACnC;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../src/widgets/Grid.ts"],"names":[],"mappings":"AAGA,OAAO,IAAI,MAAM,2BAA2B,CAAA;AAI5C,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AAMnD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,IAAI;IACpC,KAAK,SAAS;IAGd,cAAc,EAAE,cAAc,CAAA;IAC9B,YAAY,EAAE,YAAY,CAAA;IAC1B,KAAK,EAAE,KAAK,CAAA;IACZ,oBAAoB,EAAE,MAAM,CAAO;IAGnC,WAAW,EAAE,WAAW,CAAA;IACxB,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;IACxB,gBAAgB,EAAE,cAAc,CAAA;IAChC,iBAAiB,EAAE,UAAU,CAAA;IAC7B,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAC/B,eAAe,EAAE,OAAO,CAAQ;IAChC,YAAY,EAAE,QAAQ,CAAA;;IA+CtB,gBAAgB,CAAC,EAAE,WAAW,EAAE;;KAAA;IAgChC,iBAAiB;IAYjB,oBAAoB;IAoBpB,oBAAoB;
|
1
|
+
{"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../src/widgets/Grid.ts"],"names":[],"mappings":"AAGA,OAAO,IAAI,MAAM,2BAA2B,CAAA;AAI5C,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AAMnD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,IAAI;IACpC,KAAK,SAAS;IAGd,cAAc,EAAE,cAAc,CAAA;IAC9B,YAAY,EAAE,YAAY,CAAA;IAC1B,KAAK,EAAE,KAAK,CAAA;IACZ,oBAAoB,EAAE,MAAM,CAAO;IAGnC,WAAW,EAAE,WAAW,CAAA;IACxB,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;IACxB,gBAAgB,EAAE,cAAc,CAAA;IAChC,iBAAiB,EAAE,UAAU,CAAA;IAC7B,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAC/B,eAAe,EAAE,OAAO,CAAQ;IAChC,YAAY,EAAE,QAAQ,CAAA;;IA+CtB,gBAAgB,CAAC,EAAE,WAAW,EAAE;;KAAA;IAgChC,iBAAiB;IAYjB,oBAAoB;IAoBpB,oBAAoB;IAoBpB,KAAK;IA4BL;;OAEG;IACG,oBAAoB;IAoB1B,YAAY,CAAC,KAAK,EAAE,mBAAmB;IAUvC;;OAEG;IACH,uBAAuB;IAevB;;OAEG;IACH,mBAAmB;IAenB;;OAEG;IACH,eAAe,CAAC,IAAI,EAAE,QAAQ;IAO9B,WAAW,CAAC,UAAU,EAAE,UAAU;IAYlC,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW;;;;;;;;;;;IAkB7D,gBAAgB,CAAC,UAAU,EAAE,UAAU,EAAE,WAAW,GAAE,OAAe;IA+DrE,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC;IAwCtD,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAgB,GAAG,MAAM;CAM9C;AAKD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,IAAI,CAAA;KACpB;CACF"}
|
package/package.json
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
import{c as t,s as e,a as s,f as i,t as o}from"./Widget-D9I4vSzG.js";import{B as a,I as n,V as l,A as h,s as r,g as d}from"./base-SePYPKrr.js";class p extends a{label="GalleryWall";widgetSettings;feedMetadata;posts;previewLoadingColors=null;containerEl;heightRefEl;postEls;popoverGalleryEl;appliedBreakpoint;medianPaletteHSL;setupIsComplete=!1;popupGallery;constructor(){super(),this.onPropChange(this.handlePropChange,["widgetSettings","feedMetadata","posts","previewLoadingColors"],["widgetSettings","feedMetadata","posts"]),n.register(),l.register(),h.register(),this.handlePostClick=this.handlePostClick.bind(this),this.addEventListener("post-focus-next",this.handleFocusNextPost),this.addEventListener("post-focus-previous",this.handleFocusPreviousPost),this.onConnect((()=>{this.style.opacity="0",this.heightRefEl=t({classes:"height-ref"}),this.containerEl=t({type:"figure",classes:"posts",contents:[this.heightRefEl]}),this.renderWidget(this.containerEl,[r,".posts{display:block;min-height:100%;width:100%}.height-ref{position:relative}.post{-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;border:none;color:inherit;display:block;font:inherit;height:100px;left:0;line-height:normal;overflow:hidden;position:absolute;top:0;transform-origin:top left;transition:background .3s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100px}.post--placeholder{background-color:#dedede;position:absolute}"]),this.setAttribute("tabindex","0"),this.setAttribute("aria-label","Gallery of Instagram posts. Shift + arrow keys to navigate"),this.onResize(this,this.containerEl,this.handleResize)}))}handlePropChange({changedProp:t}){switch(this.setupIsComplete||(this.setup(),this.setupIsComplete=!0),t){case"posts":this.handlePostsChange();break;case"widgetSettings":this.handleSettingsChange();break;case"feedMetadata":this.handleMetadataChange();break;case"previewLoadingColors":this.postEls.forEach((t=>{t.previewLoadingColors=this.previewLoadingColors})),e(this,{"is-previewing-loading-colors":!!this.previewLoadingColors})}}handlePostsChange(){this.postEls=[],this.renderBreakpoint(this.appliedBreakpoint,!0),this.popoverGalleryEl&&(this.popoverGalleryEl.posts=this.posts)}handleSettingsChange(){"openPopupGallery"===this.widgetSettings.onPostClick&&this.enablePopoverGallery(),this.renderBreakpoint(this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings.breakpoints)),this.postEls.forEach((t=>{t.widgetSettings=this.widgetSettings}))}handleMetadataChange(){this.postEls.forEach((t=>{t.feedMetadata=this.feedMetadata}))}setup(){if("transparent"!==this.widgetSettings.loadingColor){const t=this.posts.filter((t=>t.colorPalette)).map((t=>t.colorPalette));this.medianPaletteHSL=d(t,this.widgetSettings.loadingColor)}const t=this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings.breakpoints);this.renderBreakpoint(t),this.style.opacity=""}async enablePopoverGallery(){const{default:t}=await import("./PopoverGallery-hU36eE7J.js");t.register(),this.popoverGalleryEl=document.createElement("behold-popover-gallery"),Object.assign(this.popoverGalleryEl,{widgetSettings:this.widgetSettings,feedMetadata:this.feedMetadata,posts:this.posts,closeFocusEl:this,onSlideChange:t=>{this.popoverGalleryEl.closeFocusEl=this.postEls[t]}})}handleResize(t){const e=t.contentBoxSize?.[0]?.inlineSize,s=this.widgetSettings.breakpoints,i=this.getMatchingBreakpoint(e,s);this.renderBreakpoint(i)}handleFocusPreviousPost(){if(!this.postEls.length)return;let t=[...this.heightRefEl.children].indexOf(this.shadow.activeElement?.parentElement);t>0?t-=1:t=this.postEls.length-1,this.postEls[t].focus()}handleFocusNextPost(){if(!this.postEls.length)return;let t=[...this.heightRefEl.children].indexOf(this.shadow.activeElement?.parentElement);t>-1&&t<this.postEls.length-1?t+=1:t=0,this.postEls[t].focus()}handlePostClick(t){this.popoverGalleryEl.open(this.postEls.indexOf(t),t)}renderPosts(t){this.cancelRaf("renderPosts"),this.postEls=this.createPostEls(t),this.raf((()=>{this.heightRefEl.replaceChildren(...this.postEls)}),"renderPosts")}getMatchingBreakpoint(t,e){return Object.entries(e).map((([t,e])=>({width:t,...e}))).filter((t=>"default"!==t.width)).sort(((t,e)=>e.width.localeCompare(t.width))).reduce(((e,s)=>t<=parseInt(s.width)?s:e),{...e.default,numPosts:e.default.galleryWallLayout.length})}renderBreakpoint(t,e=!1){this.cancelRaf("setContainerHeight"),this.postEls||(e=!0);const o=this.appliedBreakpoint;this.appliedBreakpoint=t;const{gap:a,borderRadius:n,numPosts:l,galleryWallLayout:h,galleryWallNamedLayout:r}=t;switch(this.widgetSettings.alignment){case"left":this.style.justifyContent="flex-start";break;case"right":this.style.justifyContent="flex-end";break;default:this.style.justifyContent="center"}this.widgetSettings.maxWidth&&this.widgetSettings.constrainWidth&&this.containerEl.style.maxWidth!==`${this.widgetSettings.maxWidth}px`&&(this.containerEl.style.maxWidth=`${this.widgetSettings.maxWidth}px`),this.widgetSettings.constrainWidth||(this.containerEl.style.maxWidth=""),this.containerEl.setAttribute("data-hover-effect",this.widgetSettings.hoverEffect),s(this.containerEl,"--post-border-radius",`${n}%`),(o?.numPosts!==l||o?.galleryWallNamedLayout!==r.toString()||e)&&this.renderPosts(t);const d=this.containerEl.offsetWidth,p=parseInt(a.x)/1e3*d,g=parseInt(a.y)/1e3*d;this.postEls.forEach(((t,e)=>{const[s,i,o,a]=h?.[e]?h[e].split(",").map((t=>parseInt(t))):[0,0,10,10],n=s*(d/100)+p/2,l=i*(d/100);t.style.transform=`translate(${n}px, ${l}px`,t.style.width=o*(d/100)-p+"px",t.style.height=a*(d/100)-g+"px"})),i(),this.raf((()=>{this.setContainerHeight()}),"setContainerHeight")}createPostEls(e){const{gap:s}=e,i=e?.numPosts||this.posts?.length||200,o=this.posts.filter(((t,e)=>e<i)).map((e=>{let i="behold-image-post";"VIDEO"===e.mediaType&&(i="behold-video-post"),"CAROUSEL_ALBUM"===e.mediaType&&(i="behold-album-post");return t({type:i,props:{post:e,widgetSettings:this.widgetSettings,feedMetadata:this.feedMetadata,medianPaletteHSL:this.medianPaletteHSL,onClick:this.handlePostClick,hasRowGap:"0"!=`${s.y}`}})}));return o.length<e.galleryWallLayout.length&&e.galleryWallLayout.filter(((t,e)=>e>=o.length)).forEach((e=>{const s=t({classes:"post post--placeholder"});o.push(s)})),o}setContainerHeight=o((()=>{this.style.height=`${this.heightRefEl.scrollHeight}px`}),10,this);static register(t="behold-gallery-wall"){return customElements.get(t)||customElements.define(t,p),t}}export{p as default};
|
package/dist/Grid-UXYoSdwm.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
import{c as t,s as e,f as s,a as i}from"./Widget-D9I4vSzG.js";import{B as a,I as o,V as n,A as h,s as l,g as r}from"./base-SePYPKrr.js";class d extends a{label="Grid";widgetSettings;feedMetadata;posts;previewLoadingColors=null;containerEl;postEls;popoverGalleryEl;appliedBreakpoint;medianPaletteHSL;setupIsComplete=!1;popupGallery;constructor(){super(),this.onPropChange(this.handlePropChange,["widgetSettings","feedMetadata","posts","previewLoadingColors"],["widgetSettings","feedMetadata","posts"]),o.register(),n.register(),h.register(),this.handlePostClick=this.handlePostClick.bind(this),this.addEventListener("post-focus-next",this.handleFocusNextPost),this.addEventListener("post-focus-previous",this.handleFocusPreviousPost),this.onConnect((()=>{this.containerEl=t({type:"figure",classes:"posts"}),this.renderWidget(this.containerEl,[l]),this.setAttribute("tabindex","0"),this.setAttribute("aria-label","Gallery of Instagram posts. Shift + arrow keys to navigate"),this.onResize(this,this,this.handleResize)}))}handlePropChange({changedProp:t}){switch(this.setupIsComplete||(this.setup(),this.setupIsComplete=!0),t){case"posts":this.handlePostsChange();break;case"widgetSettings":this.handleSettingsChange();break;case"feedMetadata":this.handleMetadataChange();break;case"previewLoadingColors":this.postEls.forEach((t=>{t.previewLoadingColors=this.previewLoadingColors})),e(this,{"is-previewing-loading-colors":!!this.previewLoadingColors})}}handlePostsChange(){this.postEls=[],this.renderBreakpoint(this.appliedBreakpoint,!0),this.popoverGalleryEl&&(this.popoverGalleryEl.posts=this.posts)}handleSettingsChange(){"openPopupGallery"===this.widgetSettings.onPostClick&&this.enablePopoverGallery();const t=this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings.breakpoints);this.renderBreakpoint(t),this.postEls.forEach((t=>{t.widgetSettings=this.widgetSettings}))}handleMetadataChange(){this.postEls.forEach((t=>{t.feedMetadata=this.feedMetadata}))}setup(){if("transparent"!==this.widgetSettings.loadingColor){const t=this.posts.filter((t=>t.colorPalette)).map((t=>t.colorPalette));this.medianPaletteHSL=r(t,this.widgetSettings.loadingColor)}const t=this.getMatchingBreakpoint(this.offsetWidth,this.widgetSettings.breakpoints);this.renderBreakpoint(t),this.postEls.forEach((t=>{t.widgetSettings=this.widgetSettings,t.feedMetadata=this.feedMetadata}))}async enablePopoverGallery(){const{default:t}=await import("./PopoverGallery-hU36eE7J.js");t.register(),this.popoverGalleryEl=document.createElement("behold-popover-gallery"),Object.assign(this.popoverGalleryEl,{widgetSettings:this.widgetSettings,feedMetadata:this.feedMetadata,posts:this.posts,closeFocusEl:this,onSlideChange:t=>{this.popoverGalleryEl.closeFocusEl=this.postEls[t]}})}handleResize(t){const e=t.contentBoxSize?.[0]?.inlineSize,s=this.widgetSettings.breakpoints,i=this.getMatchingBreakpoint(e,s);this.renderBreakpoint(i)}handleFocusPreviousPost(){if(!this.postEls.length)return;let t=[...this.containerEl.children].indexOf(this.shadow.activeElement?.parentElement);t>0?t-=1:t=this.postEls.length-1,this.postEls[t].focus()}handleFocusNextPost(){if(!this.postEls.length)return;let t=[...this.containerEl.children].indexOf(this.shadow.activeElement?.parentElement);t>-1&&t<this.postEls.length-1?t+=1:t=0,this.postEls[t].focus()}handlePostClick(t){this.popoverGalleryEl.open(this.postEls.indexOf(t),t)}renderPosts(t){this.cancelRaf("renderPosts"),this.postEls=this.createPostEls(t),this.raf((()=>{this.containerEl.replaceChildren(...this.postEls)}),"renderPosts")}getMatchingBreakpoint(t,e){return Object.entries(e).map((([t,e])=>({width:t,...e}))).filter((t=>"default"!==t.width)).sort(((t,e)=>e.width.localeCompare(t.width))).reduce(((e,s)=>t<=parseInt(s.width)?s:e),{...e.default,numPosts:this.posts.length})}renderBreakpoint(t,e=!1){this.postEls||(e=!0);const a=this.appliedBreakpoint,{numColumns:o,gap:n,borderRadius:h,numPosts:l}=t;switch(a?.numPosts>l&&(this.containerEl.replaceChildren(),s()),this.widgetSettings.alignment){case"left":this.style.justifyContent="flex-start";break;case"right":this.style.justifyContent="flex-end";break;default:this.style.justifyContent="center"}this.widgetSettings.maxWidth&&this.widgetSettings.constrainWidth&&this.containerEl.style.maxWidth!==`${this.widgetSettings.maxWidth}px`&&(this.containerEl.style.maxWidth=`${this.widgetSettings.maxWidth}px`),this.widgetSettings.constrainWidth||(this.containerEl.style.maxWidth=""),this.containerEl.style.gridTemplateColumns=`repeat(${o}, 1fr)`,this.containerEl.style.gap=`${n.y}px ${n.x}px`,this.containerEl.setAttribute("data-hover-effect",this.widgetSettings.hoverEffect),i(this.containerEl,"--post-border-radius",`${h}%`),(a?.numPosts!==l||e)&&this.renderPosts(t),this.postEls.forEach(((e,s)=>{e.hasRowGap="0"!=`${t.gap.y}`})),this.appliedBreakpoint=t}createPostEls(e){const{numPosts:s,numColumns:i,gap:a}=e;return this.posts.filter(((t,s)=>s<(e?.numPosts||this.posts?.length||200))).map(((e,o)=>{const n=Math.ceil((s||this.posts.length)/i);let h="behold-image-post";"VIDEO"===e.mediaType&&(h="behold-video-post"),"CAROUSEL_ALBUM"===e.mediaType&&(h="behold-album-post");return t({type:h,props:{post:e,widgetSettings:this.widgetSettings,feedMetadata:this.feedMetadata,medianPaletteHSL:this.medianPaletteHSL,onClick:this.handlePostClick,hasRowGap:"0"!=`${a.y}`,isLastRow:Math.ceil((o+1)/i)===n}})}))}static register(t="behold-grid"){return customElements.get(t)||customElements.define(t,d),t}}export{d as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{b as e,c as t,s as i,t as s,d as r,B as a,f as o,e as n}from"./Widget-D9I4vSzG.js";import{a as l,b as h,R as d}from"./base-SePYPKrr.js";let c=document,u=null,p=new Set,b=new Set,m=new MutationObserver((function(e){e.some((e=>"attributes"===e.type||![...e.addedNodes,...e.removedNodes].every((e=>e.tabIndex>=0))&&void 0))&&y({include:[u],merge:!0})})),g=!1;function v(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){return e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),i=[];let s=null;for(;s=t.nextNode();)i.push(s);return i}function f(e){return new Promise((async t=>{if(e.disabled)return void t(!1);const i=await function(e){return new Promise((t=>{const i=new IntersectionObserver((e=>{t(e[0].isIntersecting),i.disconnect()}));i.observe(e)}))}(e);t(!!i&&[...b].every((t=>!t.contains(e))))}))}async function x(){return(await Promise.all([...p].map((async e=>!!await f(e)&&e)))).filter((e=>!!e))}function E(e){!["Tab","ArrowDown","ArrowUp"].includes(e.code)||e.ctrlKey||e.altKey||e.metaKey||(e.preventDefault(),"Tab"===e.code&&e.shiftKey||"ArrowUp"===e.code?async function(){const e=await x();let t=e.indexOf(c.activeElement)-1;t<0&&(t=e.length-1),e[t]?.focus()}():async function(){const e=await x();let t=e.indexOf(c.activeElement)+1;(t>e.length-1||t<0)&&(t=0),e[t]?.focus()}())}function y({include:e=[],exclude:t=[],merge:i=!1}){i?(e.forEach((e=>{b.delete(e),v(e).forEach((e=>{p.has(e)||p.add(e)}))})),t.forEach((e=>b.add(e)))):(p=new Set(e.flatMap((e=>v(e)))),b=new Set(t))}function w(e){g&&(g=!1,e=e??document.body,document.removeEventListener("keydown",E),m.disconnect(),p.clear(),b.clear(),u=null,e&&e.focus())}const C=e=>e instanceof ShadowRoot;class _{initialized;keyboardNav;dynamicBreadCrumbsCutoff;breadcrumbDiameter;dragLimit;index;slides;rootEl=document;containerEl;innerEl;breadcrumbsContainerEl;breadcrumbsInnerEl;breadcrumbsCurrent;previousEl;nextEl;slideEls;breadcrumbs;raf;focusRaf;st;transitionSt;isDragging;dragStartPoint;lastDragPoint;currentPixelTranslation;currentPercentTranslation;progressToNextSlide;resizeObserver;onSlideChange;virtualize=!1;constructor({slides:e,containerEl:t,breadcrumbsContainerEl:i,previousEl:s,nextEl:r,onSlideChange:a,breadcrumbDiameter:o=7,keyboardNav:n=!0,dynamicBreadCrumbsCutoff:l=10,dragLimit:h=.15,virtualize:d=!1}){this.initialized=!1,this.keyboardNav=n,this.dynamicBreadCrumbsCutoff=l,this.breadcrumbDiameter=o,this.dragLimit=h,this.virtualize=d,this.index=0,this.slides=e,this.containerEl=t,this.innerEl=null,this.breadcrumbsContainerEl=i,this.previousEl=s,this.nextEl=r,this.slideEls=null,this.breadcrumbs=null,this.raf=null,this.st=null,this.transitionSt=null,this.isDragging=!1,this.dragStartPoint={x:0,y:0},this.lastDragPoint={x:0,y:0},this.currentPixelTranslation=0,this.currentPercentTranslation=0,this.progressToNextSlide=0,this.resizeObserver=new ResizeObserver((e=>this.handleResize(e))),this.onSlideChange=a,this.init=this.init.bind(this),this.destroy=this.destroy.bind(this),this.goTo=this.goTo.bind(this),this.retreat=this.retreat.bind(this),this.advance=this.advance.bind(this),this.handlePrevClick=this.handlePrevClick.bind(this),this.handleNextClick=this.handleNextClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.mouseDrag=this.mouseDrag.bind(this),this.touchDrag=this.touchDrag.bind(this),this.drag=this.drag.bind(this),this.startMouseDrag=this.startMouseDrag.bind(this),this.startTouchDrag=this.startTouchDrag.bind(this),this.startDrag=this.startDrag.bind(this),this.endDrag=this.endDrag.bind(this),this.updateBreadcrumbs=this.updateBreadcrumbs.bind(this),this.updateBreadcrumbClasses=this.updateBreadcrumbClasses.bind(this),this.handleResize=this.handleResize.bind(this),this.addEventListeners=this.addEventListeners.bind(this),this.removeEventListeners=this.removeEventListeners.bind(this)}addEventListeners(){this.innerEl.addEventListener("mousedown",this.startMouseDrag,{passive:!0}),this.innerEl.addEventListener("touchstart",this.startTouchDrag,{passive:!0}),document.body.addEventListener("mousemove",this.mouseDrag,{passive:!0}),document.body.addEventListener("mouseup",this.endDrag,{passive:!0}),document.body.addEventListener("mouseleave",this.endDrag,{passive:!0}),document.body.addEventListener("touchmove",this.touchDrag,{passive:!0}),document.body.addEventListener("touchend",this.endDrag,{passive:!0}),this.previousEl&&this.previousEl.addEventListener("click",this.handlePrevClick),this.nextEl&&this.nextEl.addEventListener("click",this.handleNextClick),this.keyboardNav&&document.addEventListener("keydown",this.handleKeyDown)}removeEventListeners(){this.innerEl.removeEventListener("mousedown",this.startMouseDrag),this.innerEl.removeEventListener("touchstart",this.startTouchDrag),document.body.removeEventListener("mousemove",this.mouseDrag),document.body.removeEventListener("mouseup",this.endDrag),document.body.removeEventListener("mouseleave",this.endDrag),document.body.removeEventListener("touchmove",this.touchDrag),document.body.removeEventListener("touchend",this.endDrag),this.previousEl&&this.previousEl.removeEventListener("click",this.handlePrevClick),this.nextEl&&this.nextEl.removeEventListener("click",this.handleNextClick),this.keyboardNav&&document.removeEventListener("keydown",this.handleKeyDown)}init(i=0){this.initialized||(this.initialized=!0,this.rootEl=e(this.containerEl),this.slideEls=this.slides.map(((e,i)=>t({classes:"hg-slide",contents:e}))),this.breadcrumbs=this.slides.map(((e,i)=>t({classes:"hg-breadcrumb",listeners:{click:()=>this.goTo({index:i})}}))),this.breadcrumbsCurrent=t({classes:"hg-breadcrumbs-current"}),this.breadcrumbsInnerEl=t({classes:"hg-breadcrumbs",contents:[...this.breadcrumbs,this.breadcrumbsCurrent]}),this.innerEl=t({classes:"hg-container",contents:this.slideEls}),this.containerEl.appendChild(this.innerEl),this.breadcrumbsContainerEl&&(this.breadcrumbsContainerEl.style.setProperty("--breadCrumbDiameter",this.breadcrumbDiameter+"px"),this.breadcrumbsContainerEl.appendChild(this.breadcrumbsInnerEl)),this.addEventListeners(),this.slides.length<2&&(this.breadcrumbsInnerEl.style.display="none",this.previousEl.style.display="none",this.nextEl.style.display="none"),this.resizeObserver?.observe(this.containerEl),this.updateBreadcrumbs(this.index,this.index,!1),this.goTo({index:i,animate:!1,forceUpdate:!0}))}destroy(){this.initialized&&(clearTimeout(this.st),clearTimeout(this.transitionSt),cancelAnimationFrame(this.raf),cancelAnimationFrame(this.focusRaf),this.resizeObserver.disconnect(),this.removeEventListeners(),this.breadcrumbs=null,this.breadcrumbsCurrent=null,this.breadcrumbsInnerEl.remove(),this.breadcrumbsInnerEl=null,this.innerEl.remove(),this.innerEl=null,this.initialized=!1)}handleResize(e){if(!e?.[0])return;const t=e?.[0]?.borderBoxSize?.[0]?.inlineSize||0;t&&(this.currentPixelTranslation=t*this.index*-1)}updateBreadcrumbClasses(e,t=!0){if(this.breadcrumbs.length>=this.dynamicBreadCrumbsCutoff&&this.breadcrumbsContainerEl){i(this.breadcrumbsInnerEl,{"no-transition":!t}),requestAnimationFrame((()=>{this.breadcrumbsInnerEl.classList.remove("no-transition")}));const s=this.breadcrumbsInnerEl.offsetWidth/2-this.breadcrumbDiameter/2-this.breadcrumbs[e].offsetLeft;this.breadcrumbsInnerEl.style.transform=`translateX(${s}px)`,this.breadcrumbs.forEach(((t,s)=>{i(t,{"hg-breadcrumb--hidden":s<=e-5||s>=e+5,"hg-breadcrumb--4":s===e-4||s===e+4,"hg-breadcrumb--3":s===e-3||s===e+3,"hg-breadcrumb--2":s===e-2||s===e+2,"hg-breadcrumb--1":s===e-1||s===e+1})}))}}updateBreadcrumbs(e,t,i){this.breadcrumbs?.length&&(this.updateBreadcrumbClasses(e,i),this.breadcrumbsContainerEl&&(!i||this.breadcrumbs.length>=10&&Math.abs(e-t)>1?e>t?(this.breadcrumbsCurrent.style.left="",this.breadcrumbsCurrent.style.right=this.breadcrumbsInnerEl.offsetWidth-(this.breadcrumbs[e].offsetLeft+this.breadcrumbDiameter)+"px"):(this.breadcrumbsCurrent.style.right="",this.breadcrumbsCurrent.style.left=this.breadcrumbs[e].offsetLeft+"px"):(e<t?(this.breadcrumbsCurrent.style.left="",this.breadcrumbsCurrent.style.right=this.breadcrumbsInnerEl.offsetWidth-this.breadcrumbs[t]?.offsetLeft-this.breadcrumbDiameter+"px"):(this.breadcrumbsCurrent.style.right="",this.breadcrumbsCurrent.style.left=this.breadcrumbs[t]?.offsetLeft+"px"),k(),this.raf=requestAnimationFrame((()=>{this.breadcrumbsCurrent.style.width=e>t?`${this.breadcrumbs[e]?.offsetLeft-this.breadcrumbsCurrent.offsetLeft+this.breadcrumbDiameter}px`:this.breadcrumbsCurrent.offsetLeft+this.breadcrumbsCurrent.offsetWidth-this.breadcrumbs[e]?.offsetLeft+"px"})),this.st=setTimeout((()=>{e>t?(this.breadcrumbsCurrent.style.left="",this.breadcrumbsCurrent.style.right=this.breadcrumbsInnerEl.offsetWidth-(this.breadcrumbs[e].offsetLeft+this.breadcrumbDiameter)+"px"):(this.breadcrumbsCurrent.style.right="",this.breadcrumbsCurrent.style.left=this.breadcrumbs[e].offsetLeft+"px"),k(),this.raf=requestAnimationFrame((()=>{this.breadcrumbsCurrent.style.width=""}))}),200))))}goTo({index:e,animate:t=!0,forceUpdate:i=!1,easing:s="ease"}){if(!this.slideEls?.[e])return;if(!this.initialized)return;cancelAnimationFrame(this.focusRaf);const r=e,a=this.index;this.index=r,clearTimeout(this.transitionSt),this.virtualize&&this.slideEls.forEach(((e,t)=>{Math.abs(this.index-t)>1&&t!==a?e.hasChildNodes()&&e.replaceChildren():e.hasChildNodes()||e.replaceChildren(this.slides[t])})),window.matchMedia("(prefers-reduced-motion)").matches&&(t=!1),this.isDragging=!1,this.progressToNextSlide=0,r!==a||i?(cancelAnimationFrame(this.raf),clearTimeout(this.st),this.updateBreadcrumbs(r,a,t),this.onSlideChange&&this.onSlideChange(r)):this.breadcrumbsCurrent.style.width="",this.innerEl.style.transition=t?`transform 0.4s ${s}`:"",this.innerEl.style.transform=`translateX(${-100*r}%)`,this.currentPixelTranslation=this.innerEl.scrollWidth/this.slideEls.length*r*-1,this.currentPercentTranslation=-100*r,this.previousEl&&(r<1?(this.rootEl.activeElement===this.previousEl&&(this.focusRaf=requestAnimationFrame((()=>{this.nextEl.focus()}))),this.previousEl.setAttribute("disabled","true")):this.previousEl.removeAttribute("disabled")),this.nextEl&&(r>=this.slideEls.length-1?(this.rootEl.activeElement===this.nextEl&&(this.focusRaf=requestAnimationFrame((()=>{this.previousEl.focus()}))),this.nextEl.setAttribute("disabled","true")):this.nextEl.removeAttribute("disabled")),this.transitionSt=setTimeout((()=>{this.innerEl.style.transition=""}),400)}handlePrevClick(){this.retreat()}handleNextClick(){this.advance()}retreat(e="ease"){"string"!=typeof e&&(e="ease"),this.index<1?this.goTo({index:this.index}):this.goTo({index:this.index-1,easing:e})}advance(e="ease"){"string"!=typeof e&&(e="ease"),this.index>=this.slideEls.length-1?this.goTo({index:this.index}):this.goTo({index:this.index+1,easing:e})}handleKeyDown(e){"ArrowRight"===e.code&&(e.preventDefault(),this.advance()),"ArrowLeft"===e.code&&(e.preventDefault(),this.retreat())}startMouseDrag(e){e.stopPropagation(),e.button>0||this.startDrag({x:e.clientX,y:e.clientY})}startTouchDrag(e){e.stopPropagation(),this.startDrag({x:e.touches.item(0).clientX,y:e.touches.item(0).clientY})}startDrag(e){this.slides.length<2||!this.initialized||(this.isDragging=!0,clearTimeout(this.transitionSt),cancelAnimationFrame(this.raf),this.progressToNextSlide=0,this.currentPixelTranslation=S(this.innerEl),this.breadcrumbsCurrent.style.transition="none",this.dragStartPoint=e,this.lastDragPoint=this.dragStartPoint)}mouseDrag(e){s(this.drag,10,this)({x:e.clientX,y:e.clientY})}touchDrag(e){s(this.drag,10,this)({x:e.touches.item(0).clientX,y:e.touches.item(0).clientY},!0)}drag(e,t=!1){if(this.slides.length<2||!this.isDragging||!this.initialized)return;this.currentPixelTranslation=S(this.innerEl);const i=this.containerEl.offsetWidth*this.dragLimit;let s=e.x-this.dragStartPoint.x,r=e.y-this.dragStartPoint.y,a=Math.abs(r)/Math.abs(s);if(t&&a>.85)return void this.endDrag();const o=e.x-this.lastDragPoint.x;this.progressToNextSlide=Math.abs(s/i);let n=this.currentPixelTranslation+o;const l=0===this.index&&s>0||this.index===this.slideEls.length-1&&s<0;if(l){let e=o*Math.max(1-Math.abs(s)/(.5*this.containerEl.offsetWidth),.1);n=this.currentPixelTranslation+e,this.progressToNextSlide=Math.abs(s/i)}this.lastDragPoint=e,this.currentPixelTranslation=n,this.currentPercentTranslation=this.currentPixelTranslation/this.containerEl.offsetWidth*100,s>0?(this.breadcrumbsCurrent.style.left="",this.breadcrumbsCurrent.style.right=this.breadcrumbsInnerEl.offsetWidth-(this.breadcrumbs[this.index].offsetLeft+this.breadcrumbDiameter)+"px"):(this.breadcrumbsCurrent.style.right="",this.breadcrumbsCurrent.style.left=`${this.breadcrumbs[this.index].offsetLeft}px`),this.breadcrumbsCurrent.style.width=l?`${this.breadcrumbDiameter+Math.abs(4*this.breadcrumbDiameter*(this.currentPercentTranslation+100*this.index)/100)}px`:`${Math.min(2.75*this.breadcrumbDiameter,this.breadcrumbDiameter+Math.abs(4*this.breadcrumbDiameter*(this.currentPercentTranslation+100*this.index)/100))}px`,this.innerEl.style.transform=`translateX(${this.currentPercentTranslation}%)`,this.innerEl.style.transition=""}endDrag(){this.isDragging=!1,this.breadcrumbsCurrent.style.transition="",this.innerEl.style.transition="",this.dragStartPoint={x:0,y:0},this.lastDragPoint={x:0,y:0},this.progressToNextSlide>=1?this.currentPercentTranslation+100*this.index<0?this.raf=requestAnimationFrame((()=>this.advance("cubic-bezier(0.25, .25, 0.5, 1)"))):this.raf=requestAnimationFrame((()=>this.retreat("cubic-bezier(0.25, .25, 0.5, 1)"))):this.raf=requestAnimationFrame((()=>this.goTo({index:this.index})))}}function k(){return document.body.offsetTop}function S(e){if(!e)return;const t=e.getBoundingClientRect(),i=e.parentNode.getBoundingClientRect();return t.left-i.left}var L='.behold-ps-container{display:flex;height:100vh;justify-content:center;overflow:auto;pointer-events:all;scrollbar-width:none;width:100%}.behold-ps-container::-webkit-scrollbar{width:0!important}.behold-ps-inner{max-width:400px}.behold-ps-inner:before{height:10px}.behold-ps-inner:after,.behold-ps-inner:before{content:"";display:block;pointer-events:none;width:100%}.behold-ps-inner:after{height:90px}';class P{initialized;slides;currentSlide;containerEl;scrollContainerEl;innerEl;onSlideChange;onRequestClose;constructor({slides:e,containerEl:t,onSlideChange:i,onRequestClose:s=null}){this.initialized=!1,this.slides=e,this.currentSlide=null,this.containerEl=t,this.scrollContainerEl=null,this.innerEl=null,this.onSlideChange=i,this.init=this.init.bind(this),this.destroy=this.destroy.bind(this),this.onBackGroundClick=this.onBackGroundClick.bind(this),this.onRequestClose=s,this.handleScroll=this.handleScroll.bind(this)}init(e=0){this.initialized||(this.initialized=!0,this.innerEl=t({classes:D("inner"),contents:this.slides}),this.scrollContainerEl=t({classes:D("container"),contents:this.innerEl}),this.containerEl.appendChild(this.scrollContainerEl),this.scrollContainerEl.addEventListener("click",this.onBackGroundClick),this.scrollContainerEl.addEventListener("scroll",this.handleScroll,{passive:!0}),this.goTo({index:e,animate:!1}))}destroy(){this.initialized&&(this.initialized=!1,this.scrollContainerEl.removeEventListener("click",this.onBackGroundClick),this.scrollContainerEl.removeEventListener("scroll",this.handleScroll),this.scrollContainerEl.remove(),this.scrollContainerEl=null)}handleScroll(e){r(this.slides).then((e=>{this.currentSlide!==e&&(this.currentSlide=e,this.onSlideChange&&this.onSlideChange(this.currentSlide))}))}onBackGroundClick(e){e.target===this.scrollContainerEl&&this.onRequestClose&&this.onRequestClose()}goTo({index:e,animate:t=!0}){if(!this.slides?.[e])return;const i=this.slides[e].offsetTop;this.currentSlide=e,this.onSlideChange&&this.onSlideChange(this.currentSlide),this.scrollContainerEl?.scrollTo({top:i-10,behavior:t?"smooth":"instant"})}}function D(e){return"behold-ps-"+e}var z='<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">\n<path fill-rule="evenodd" clip-rule="evenodd" fill="#FFFFFF" d="M4.4,7.3C4.2,7.3,4,7.5,4,7.7v4.6c0,0.2,0.2,0.4,0.4,0.4h2.2\n\tl3.2,3.2c0.2,0.2,0.6,0.1,0.6-0.2v-2.4c0-0.1-0.1-0.2-0.1-0.3L4.8,7.4C4.7,7.4,4.6,7.3,4.5,7.3C4.5,7.3,4.4,7.3,4.4,7.3z M16.1,15.2\n\tl-1.4-1.4c0.5-0.7,1.3-1.9,1.3-3.8c0-2.8-1.8-4.3-1.8-4.3c-0.1-0.2-0.4-0.2-0.6,0L13.3,6c-0.1,0.2-0.1,0.4,0,0.6\n\tc0,0,1.4,1.2,1.4,3.4c0,1.4-0.5,2.3-0.9,2.9L12.9,12c0.3-0.4,0.6-1.1,0.6-2c0-1.7-1-2.6-1-2.6c-0.1-0.2-0.4-0.2-0.6,0l-0.4,0.3\n\tc-0.1,0.2-0.1,0.4,0,0.6c0,0,0.7,0.5,0.7,1.7c0,0.4-0.1,0.8-0.2,1.1l-1.6-1.6V4.3c0-0.3-0.4-0.5-0.6-0.2L7.4,6.5L4.8,3.9\n\tc-0.1-0.1-0.4-0.1-0.5,0L4,4.3C3.8,4.4,3.8,4.7,4,4.8l1,1.1l6.7,6.7l3.5,3.5c0.1,0.1,0.4,0.1,0.5,0l0.4-0.4\n\tC16.2,15.6,16.2,15.3,16.1,15.2z"/>\n</svg>',M='<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">\n<path fill="#FFFFFF" d="M12.5,7.3c-0.3-0.4-0.8-0.4-1.1-0.2C11,7.4,11,7.9,11.2,8.3l0,0c0.4,0.5,0.6,1.1,0.6,1.7\n\tc0,0.6-0.2,1.2-0.6,1.7c-0.3,0.4-0.2,0.9,0.1,1.1c0.4,0.3,0.9,0.2,1.1-0.1c0,0,0,0,0,0c0.6-0.8,0.9-1.7,0.9-2.7\n\tC13.4,9,13.1,8.1,12.5,7.3z M14.6,6c-0.3-0.4-0.8-0.4-1.1-0.1C13.1,6.2,13,6.7,13.3,7c0,0,0,0,0,0c0.7,0.8,1.1,1.9,1.1,3\n\tc0,1.1-0.4,2.1-1.1,3c-0.3,0.4-0.2,0.9,0.1,1.1c0.3,0.3,0.8,0.2,1.1-0.1c0.9-1.1,1.4-2.5,1.4-4C16,8.5,15.5,7.1,14.6,6z M9.7,4\n\tC9.5,4,9.2,4,9.1,4.1L6.3,6.7H4.5C4.2,6.7,4,7,4,7.3v5.5c0,0.3,0.2,0.5,0.5,0.5h1.8l2.7,2.6l0,0c0.2,0.2,0.6,0.2,0.8,0\n\tc0.1-0.1,0.2-0.3,0.2-0.4l0-10.8C10,4.3,9.9,4.1,9.7,4z"/>\n</svg>';class T extends a{label="PopoverSlideVideo";videoEl;imageEl;soundControlEl;isPlaying=!1;post;constructor(){super(),l.register(),h.register(),this.onLoad=this.onLoad.bind(this),this.onPlay=this.onPlay.bind(this),this.onPause=this.onPause.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.togglePlayback=this.togglePlayback.bind(this),this.toggleSound=this.toggleSound.bind(this),this.showSoundControl=this.showSoundControl.bind(this),this.hideSoundControl=this.hideSoundControl.bind(this),this.onPropChange(this.handlePropChange,["isPlaying"],[]),this.onStateChange(this.handleStateChange),this.onConnect((()=>{this.post.mediaUrl?(this.videoEl=t({type:"behold-video",classes:"video",props:{mediaUrl:this.post.mediaUrl,sizes:this.post.sizes},listeners:{click:this.togglePlayback,load:this.onLoad,play:this.onPlay,pause:this.onPause}}),this.soundControlEl=t({type:"button",classes:"video-mute",contents:this.state.isMuted?z:M,listeners:{click:this.toggleSound}}),this.state.isMuted?this.videoEl.mute():this.videoEl.unmute(),this.classList.add("video-container","video-container--paused"),this.replaceChildren(this.videoEl,this.soundControlEl)):(this.imageEl=t({type:"behold-image",props:{sizes:this.post.sizes,mediaUrl:this.post.thumbnailUrl,isSquare:!1},listeners:{load:this.onLoad}}),this.replaceChildren(this.imageEl))}))}handlePropChange({changedProp:e,newValue:t}){if("isPlaying"===e)t&&this.videoEl?.isLoaded&&!this.videoEl.isPlaying&&this.videoEl.play()}handleStateChange({changedProps:e,newState:t}){e.includes("isMuted")&&this.videoEl&&this.soundControlEl&&(t.isMuted?(this.videoEl.mute(),this.soundControlEl.innerHTML=z):(this.videoEl.unmute(),this.soundControlEl.innerHTML=M))}onLoad(){this.dispatchEvent(new Event("load")),this.classList.add("is-loaded"),this.videoEl&&this.isPlaying&&!this.videoEl.isPlaying&&this.videoEl.play()}onPlay(){this.classList.remove("video-container--paused")}onPause(){this.classList.add("video-container--paused")}play(){this.isPlaying=!0}pause(){this.isConnected&&this.videoEl?.isPlaying&&this.videoEl.pause()}togglePlayback(){this.videoEl&&(this.videoEl.isPlaying?this.pause():this.play())}toggleSound(){this.videoEl&&(this.videoEl.muted?this.updateState({isMuted:!1}):this.updateState({isMuted:!0}))}showSoundControl(){this.isConnected&&this.soundControlEl&&this.soundControlEl.classList.add("video-mute--visible")}hideSoundControl(){this.isConnected&&this.soundControlEl&&this.soundControlEl.classList.remove("video-mute--visible")}preload(){this.videoEl?.preload()}static register(e="behold-popover-slide-video"){return customElements.get(e)||customElements.define(e,T),e}}var I='<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 5.83 10.15"><path d="M.22,5.61s.02,.01,.03,.02l4.3,4.3c.29,.29,.77,.29,1.06,0s.29-.77,0-1.06L1.81,5.08,5.61,1.28c.29-.29,.29-.77,0-1.06-.15-.15-.34-.22-.53-.22s-.38,.07-.53,.22L.25,4.52s-.02,.01-.03,.02C.07,4.69,0,4.88,0,5.08c0,.19,.07,.39,.22,.54Z" fill="#081b10"/></svg>',F='<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 5.83 10.15"><path d="M5.61,4.54s-.02-.01-.03-.02L1.28,.22C.99-.07,.51-.07,.22,.22S-.07,.99,.22,1.28l3.79,3.79L.22,8.87c-.29,.29-.29,.77,0,1.06,.15,.15,.34,.22,.53,.22s.38-.07,.53-.22L5.58,5.63s.02-.01,.03-.02c.15-.15,.22-.34,.22-.54,0-.19-.07-.39-.22-.54Z" fill="#081b10"/></svg>';class B extends a{label="PopoverSlideAlbum";containerEl;spaceholderEl;childEls;previousEl;nextEl;breadcrumbsEl;childCarousel;currentSlideIndex=0;post;constructor(){super(),this.onPropChange((()=>{}),["post"]),h.register(),T.register(),this.handleSlideChange=this.handleSlideChange.bind(this),this.onConnect((()=>{this.childEls=this.buildSlideEls(),this.spaceholderEl=t({type:"img",classes:"slide__carousel-spaceholder",attributes:{src:`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='${this.post.sizes?.full?.width}' height='${this.post.sizes?.full?.height}'%3E%3C/svg%3E%0A`,height:this.post.sizes?.full?.height,width:this.post.sizes?.full?.width}}),this.previousEl=t({type:"button",classes:"slide__carousel-previous",attributes:{"aria-label":"Previous slide"},contents:I}),this.nextEl=t({type:"button",classes:"slide__carousel-next",attributes:{"aria-label":"Next slide"},contents:F}),this.breadcrumbsEl=t({classes:"slide__carousel-breadcrumbs"}),this.containerEl=t({classes:"slide__carousel",contents:[...this.childEls,this.previousEl,this.nextEl,this.breadcrumbsEl]}),this.replaceChildren(this.spaceholderEl,this.containerEl),this.childCarousel=new _({slides:this.childEls,containerEl:this.containerEl,keyboardNav:!1,breadcrumbsContainerEl:this.breadcrumbsEl,dynamicBreadCrumbsCutoff:7,previousEl:this.previousEl,nextEl:this.nextEl,dragLimit:.2,onSlideChange:this.handleSlideChange,virtualize:!0})})),this.onDisconnect((()=>{this.childCarousel.destroy(),this.childCarousel=null}))}activate(){this.childCarousel.init(0),this.handleSlideChange(this.currentSlideIndex)}updateTabbable(){y({include:[this.childEls[this.currentSlideIndex]],exclude:this.childEls.filter(((e,t)=>t!==this.currentSlideIndex)),merge:!0})}handleSlideChange(e){this.currentSlideIndex=e,this.childEls.forEach(((t,i)=>{A(t)&&(i===e?(t.showSoundControl(),t.play()):(t.hideSoundControl(),t.pause()))}));const t=this.childEls[e-1],i=this.childEls[e+1];t&&t.preload(),i&&i.preload();const s=d(this.post.children[e].colorPalette?.dominant||"100,100,100").map((e=>Math.round(e)));this.style.backgroundColor=`hsl(${s[0]} ${Math.min(s[1],35)}% ${Math.min(s[2],13)}%)`;const r=d(this.post.children[e].colorPalette?.dominant||"255,255,255").map((e=>Math.round(e))),a=`hsl(${r[0]} ${r[1]}% ${Math.max(r[2],50)}%)`;this.style.setProperty("--uib-color",a),this.updateTabbable(),this.updateState({popoverOverlayColor:`hsl(${s[0]} ${Math.min(s[1],50)}% ${Math.min(s[2],15)}% / .85)`})}buildSlideEls(){return this.post.children.map((e=>{let i=null;switch(e.mediaType){case"IMAGE":i=t({type:"behold-image",classes:"slide__carousel-slide",props:{sizes:e.sizes,mediaUrl:e.mediaUrl,isSquare:!1,showLoader:!0}});break;case"VIDEO":i=t({type:"behold-popover-slide-video",classes:"slide__carousel-slide",props:{post:e}})}return i}))}play(){const e=this.childEls[this.currentSlideIndex];A(e)&&(e.showSoundControl(),e.play())}pause(){this.childEls.filter(A).forEach((e=>{e.hideSoundControl(),e.pause()}))}preload(){this.childEls?.[0]?.preload()}static register(e="behold-popover-slide-album"){return customElements.get(e)||customElements.define(e,B),e}}const A=e=>"BEHOLD-POPOVER-SLIDE-VIDEO"===e.tagName;var N='<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<g>\n\t<path fill="#262626" d="M13.8,5.9H3.2c-0.4,0-0.7-0.3-0.7-0.7s0.3-0.7,0.7-0.7h10.6c0.4,0,0.7,0.3,0.7,0.7S14.1,5.9,13.8,5.9z"/>\n</g>\n<g>\n\t<path fill="#262626" d="M12.8,10.8H2.2c-0.4,0-0.7-0.3-0.7-0.7s0.3-0.7,0.7-0.7h10.6c0.4,0,0.7,0.3,0.7,0.7S13.2,10.8,12.8,10.8z"\n\t\t/>\n</g>\n<g>\n\t<path fill="#262626" d="M8.9,15.3c0,0-0.1,0-0.1,0c-0.4-0.1-0.6-0.4-0.5-0.8l2.4-13.3c0.1-0.4,0.4-0.6,0.8-0.5\n\t\tc0.4,0.1,0.6,0.4,0.5,0.8L9.6,14.8C9.5,15.1,9.2,15.3,8.9,15.3z"/>\n</g>\n<g>\n\t<path fill="#262626" d="M4.7,15.3c0,0-0.1,0-0.1,0c-0.4-0.1-0.6-0.4-0.5-0.8L6.4,1.2c0.1-0.4,0.4-0.6,0.8-0.5\n\t\tc0.4,0.1,0.6,0.4,0.5,0.8L5.3,14.8C5.3,15.1,5,15.3,4.7,15.3z"/>\n</g>\n</svg>';class R extends a{label="PopoverGallerySlide";innerEl;avatarImageEl;headerText;avatarEl;headerEl;captionEl;footerLinkEl;footerEl;textEl;mediaEl;moreEl;post;feedMetadata;constructor(){super(),this.onPropChange(this.handlePropChange,["post","feedMetadata"]),h.register(),T.register(),B.register(),this.expandCaption=this.expandCaption.bind(this),this.onConnect((()=>{this.render()}))}render(){this.classList.remove("is-loaded");const e=d(this.post.colorPalette?.dominant||"100,100,100").map((e=>Math.round(e))),i=`hsl(${e[0]} ${Math.min(e[1],35)}% ${Math.min(e[2],13)}%)`,s=d(this.post.colorPalette?.dominant||"255,255,255").map((e=>Math.round(e))),r=`hsl(${s[0]} ${s[1]}% ${Math.max(s[2],50)}%)`;switch(this.style.setProperty("--uib-color",r),this.post.mediaType){case"IMAGE":this.mediaEl=t({type:"behold-image",classes:"slide__media",style:{backgroundColor:i},props:{sizes:this.post.sizes,mediaUrl:this.post.mediaUrl,isSquare:!1,showLoader:!0}});break;case"VIDEO":this.mediaEl=t({type:"behold-popover-slide-video",classes:"slide__media",style:{backgroundColor:i},props:{post:this.post}});break;case"CAROUSEL_ALBUM":this.mediaEl=t({type:"behold-popover-slide-album",classes:"slide__media",style:{backgroundColor:i},props:{post:this.post}})}this.avatarImageEl=this.feedMetadata?.profilePictureUrl?t({type:"img",attributes:{src:this.feedMetadata.profilePictureUrl}}):null,this.headerText="@"+this.feedMetadata.username,this.feedMetadata.hashtags&&(this.avatarImageEl=N,this.headerText=this.feedMetadata.hashtags.join(", ")),this.avatarEl=this.avatarImageEl?t({classes:"slide__avatar",contents:this.avatarImageEl,attributes:{"aria-label":this.feedMetadata.hashtags?"hashtags":"username"}}):null,this.headerEl=t({classes:"slide__header",contents:[this.avatarEl,this.headerText]}),this.captionEl=this.post?.caption?.trim()?.length?t({classes:"slide__caption",contents:this.post.caption}):null,this.footerLinkEl=this.post.permalink?t({type:"a",attributes:{href:this.post.permalink,target:"_blank"},classes:"slide__footer-link",contents:["Go to post",'<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">\n<g>\n\t<path d="M16,19.8H4c-2.1,0-3.8-1.7-3.8-3.8V4c0-2.1,1.7-3.8,3.8-3.8h12c2.1,0,3.8,1.7,3.8,3.8v12C19.8,18.1,18.1,19.8,16,19.8z\n\t\t M4,1.8c-1.2,0-2.2,1-2.2,2.2v12c0,1.2,1,2.2,2.2,2.2h12c1.2,0,2.2-1,2.2-2.2V4c0-1.2-1-2.2-2.2-2.2H4z"/>\n</g>\n<path d="M14.4,5.6v7.5h-1.5V8.2l-6,6l-1.1-1.1l6-6H6.9V5.6H14.4z"/>\n</svg>']}):"",this.footerEl=t({classes:"slide__footer",contents:[this.footerLinkEl]}),this.textEl=t({classes:"slide__text",contents:[this.headerEl,this.captionEl,this.footerEl]}),this.innerEl=t({classes:"slide__inner",contents:[this.mediaEl,this.textEl]}),this.moreEl=t({type:"button",classes:"slide__more",contents:"… more",listeners:{click:this.expandCaption}}),this.replaceChildren(this.innerEl),o(),this.to((()=>{this.classList.add("is-loaded")}),10,"onConnect")}handlePropChange({changedProp:e}){if("feedMetadata"===e){if(!this.isConnected)return;this.avatarImageEl.src=this.feedMetadata.profilePictureUrl,this.headerText="@"+this.feedMetadata.username,this.feedMetadata.hashtags&&(this.avatarImageEl=N,this.headerText=this.feedMetadata.hashtags.join(", ")),this.avatarEl.replaceChildren(this.avatarImageEl),this.avatarEl.setAttribute("aria-label",this.feedMetadata.hashtags?"hashtags":"username")}}activate(){if("VIDEO"===this.post.mediaType&&this.mediaEl){const e=this.mediaEl;e.play(),e.showSoundControl()}if("CAROUSEL_ALBUM"===this.post.mediaType&&this.mediaEl){this.mediaEl.activate()}}deactivate(){if("VIDEO"===this.post.mediaType&&this.mediaEl){this.mediaEl.pause()}if("CAROUSEL_ALBUM"===this.post.mediaType&&this.mediaEl){this.mediaEl.pause()}}preload(){this.mediaEl.preload()}expandCaption(){this.captionEl&&(this.captionEl.style.transition="",this.captionEl.style.height=this.captionEl.offsetHeight+"px",this.captionEl.innerHTML=this.post?.caption||"",o(),this.raf((()=>{this.captionEl.style.transition="height .3s ease",this.captionEl.style.height=this.captionEl.scrollHeight+"px",this.to((()=>{this.captionEl.style.transition="",this.captionEl.style.height=""}),300,"expandCaption")}),"expandCaption"))}collapseCaption(){if(!this.captionEl)return;const e=n({text:this.post.caption,maxChars:120,maxLines:4});this.captionEl.innerHTML=e,e?.length<this.post?.caption?.length&&this.captionEl.appendChild(this.moreEl)}static register(e="behold-popover-gallery-slide"){return customElements.get(e)||customElements.define(e,R),e}}var $=":host{--icon-play:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 35 35' xml:space='preserve'%3E%3Cpath fill='%23FFF' d='M28.4 14.9 9.5 4.2C7.5 3.1 5 4.6 5 6.8v21.3c0 2.3 2.5 3.7 4.5 2.6l19-10.7c2-1 2-4-.1-5.1z'/%3E%3C/svg%3E\");--icon-gallery:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 35 35' xml:space='preserve'%3E%3Cpath fill='%23FFF' d='M27.3 22.7v-17c0-2.6-2.1-4.7-4.7-4.7H5.7C3.1 1 1 3.1 1 5.7v17c0 2.6 2.1 4.7 4.7 4.7h17c2.5-.1 4.6-2.2 4.6-4.7zm4-13.4v14.6c0 4.1-3.4 7.4-7.4 7.4H9.2c-.5 0-.8.6-.5 1 .9 1 2.2 1.6 3.7 1.6h12.1c5.2 0 9.3-4.2 9.3-9.3V12.5c0-1.5-.6-2.8-1.6-3.7-.3-.4-.9 0-.9.5z'/%3E%3C/svg%3E\");--bottomPadding:60px;--height:min(calc(100vh - 120px - var(--bottomPadding)),1400px);--width:calc(100vw - 120px);--text-width:400px;--text-color:#262626;--text-background:#fff;--text-size:15px;--border-color:#ededed;--ease-out-back:cubic-bezier(0.085,1.735,0.285,0.995);align-items:center;box-sizing:border-box;height:100vh;justify-content:flex-start;left:0;overflow:hidden;pointer-events:none;position:fixed;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%;z-index:99999}:host *{box-sizing:border-box}@media (max-width:1200px){:host{--text-width:300px;--text-size:13px}}:host(.is-scroller){--text-width:100%;--height:auto;--width:calc(100vw - 40px)}@media (prefers-color-scheme:dark){:host(.theme--auto){--text-color:#f2f2f2;--text-background:#1a1a1a;--border-color:#292929}}:host(.theme--dark){--text-color:#f2f2f2;--text-background:#1a1a1a;--border-color:#292929}:host(.is-visible){pointer-events:all}.overlay{-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);background-color:rgba(0,0,0,.6);display:block;height:100%;left:0;opacity:0;pointer-events:none;position:absolute;top:0;transition:all .3s ease;width:100%;will-change:opacity,background-color}:host(.is-visible) .overlay{opacity:1;pointer-events:all}.inner{display:flex;height:calc(100% - var(--bottomPadding));justify-content:center;pointer-events:none;position:relative;width:100%;z-index:1}:host(.is-scroller) .inner{height:100%}behold-popover-gallery-slide{align-items:center;display:flex;flex-grow:0;flex-shrink:0;height:calc(100% - var(--bottomPadding));justify-content:center;margin:0;opacity:0;padding:0;pointer-events:none;transform:scale(.99);transition:transform .2s ease-out,opacity .2s ease-out;width:100%}@media (min-width:901px){behold-popover-gallery-slide:active{cursor:grabbing}}@media (prefers-reduced-motion){behold-popover-gallery-slide{transform:none;transition:none}}:host(.is-visible) behold-popover-gallery-slide.is-loaded{opacity:1;transform:none}:host(.is-scroller) behold-popover-gallery-slide{height:auto;margin-top:10px}.slide__inner{align-items:center;background-color:var(--text-background);display:flex;justify-content:center;max-height:var(--height);max-width:var(--width);overflow:hidden;pointer-events:all;position:relative}:host(.is-scroller) .slide__inner{border-radius:4px;flex-direction:column}.slide__media{align-items:center;display:flex;flex-shrink:1;height:var(--height);justify-content:center;max-height:var(--height);overflow:hidden;position:relative;transition:background-color .3s ease;z-index:1}.slide__media img,.slide__media video{height:auto;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;-o-object-position:center center;object-position:center center;opacity:0;position:relative;transition:opacity .4s ease;width:auto;z-index:1}behold-image{pointer-events:none;position:relative}behold-image.is-loaded img{opacity:1}.slide__carousel{height:100%;left:0;position:absolute;top:0;width:100%}.slide__carousel:before{background:linear-gradient(0deg,rgba(0,0,0,.4),transparent);bottom:0;height:60px;left:0;width:100%;z-index:1}.slide__carousel:after,.slide__carousel:before{content:\"\";pointer-events:none;position:absolute;transform:translateZ(0)}.slide__carousel:after{background:var(--icon-gallery);height:20px;left:20px;opacity:.75;top:20px;width:20px;z-index:2}:host(.is-scroller) .slide__carousel:after{left:auto;right:15px;top:15px}img.slide__carousel-spaceholder{height:auto;max-height:100%;max-width:100%;opacity:0;pointer-events:none;visibility:hidden;width:auto}.slide__carousel-breadcrumbs{bottom:30px;height:10px;left:50%;position:absolute;transform:translateX(-50%);z-index:2}:host(.is-scroller) .slide__carousel-breadcrumbs{bottom:10px}.slide__carousel-next,.slide__carousel-previous{align-items:center;background-color:hsla(0,0%,100%,.95);border:none;border-radius:50%;box-shadow:0 0 10px rgba(0,0,0,.2);display:flex;height:30px;justify-content:center;opacity:.75;outline:none;position:absolute;top:50%;transform:translateY(-50%) translateZ(0);transition:opacity .3s ease;width:30px;z-index:2}:host(.keyboard-nav) .slide__carousel-next:focus,:host(.keyboard-nav) .slide__carousel-previous:focus{background-color:#000;box-shadow:0 0 10px rgba(0,0,0,.2),0 0 0 2px #4169e1,0 0 0 3px #fff;opacity:1}:host(.keyboard-nav) .slide__carousel-next:focus svg path,:host(.keyboard-nav) .slide__carousel-previous:focus svg path{fill:#fff}.slide__carousel-next:not(:disabled),.slide__carousel-previous:not(:disabled){cursor:pointer}.slide__carousel-next:not(:disabled):hover,.slide__carousel-previous:not(:disabled):hover{opacity:1}.slide__carousel-next:disabled,.slide__carousel-previous:disabled{opacity:.25}.slide__carousel-next:before,.slide__carousel-previous:before{content:\"\";height:60px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:60px}.slide__carousel-next svg,.slide__carousel-previous svg{height:12px;position:absolute;width:12px}.slide__carousel-next svg path,.slide__carousel-previous svg path{fill:#000}:host(.is-scroller) .slide__carousel-next,:host(.is-scroller) .slide__carousel-previous{background-color:transparent;box-shadow:none;height:20px;width:20px}:host(.is-scroller) .slide__carousel-next svg path,:host(.is-scroller) .slide__carousel-previous svg path{fill:#fff}.slide__carousel-previous{left:20px}.slide__carousel-previous svg{transform:translateX(-1px)}:host(.is-scroller) .slide__carousel-previous{left:10px}.slide__carousel-next{right:20px}.slide__carousel-next svg{transform:translateX(1px)}:host(.is-scroller) .slide__carousel-next{right:10px}.slide__carousel-slide{cursor:grab;display:flex;height:var(--height);overflow:hidden;width:auto}.slide__carousel-slide:active{cursor:grabbing}.slide__carousel-slide-media{height:auto;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;pointer-events:none;width:auto}.video-container{align-items:center;cursor:pointer;display:flex;height:var(--height);justify-content:center;overflow:hidden;position:relative}.video-container:after{background:var(--icon-play);content:\"\";filter:drop-shadow(1px 1px 1px rgba(0,0,0,.1));height:80px;left:calc(50% - 40px);opacity:0;pointer-events:none;position:absolute;top:calc(50% - 40px);transform:scale(.5);transition:all .15s ease;width:80px;z-index:2}.video-container.video-container--paused:after{opacity:.8;transform:none;transition:opacity .2s ease,transform .3s var(--ease-out-back)}.video-container:active{cursor:grabbing}behold-video{align-items:center;display:flex;height:100%;width:100%}behold-video.is-loaded video{opacity:1}.video-mute{align-items:center;background:transparent;border:none;bottom:0;cursor:pointer;display:flex;height:60px;justify-content:center;margin:0;opacity:0;outline:none;padding:0;position:absolute;right:0;transform:translateZ(0);transition:opacity .1s ease;width:60px;z-index:2}.video-mute.video-mute--visible{opacity:1;transition:opacity .2s ease .2s}.video-mute:before{background-color:rgba(0,0,0,.5);border-radius:50%;content:\"\";height:28px;left:calc(50% - 14px);position:absolute;top:calc(50% - 14px);width:28px}:host(.keyboard-nav) .video-mute:focus:before{background-color:#000;box-shadow:0 0 10px rgba(0,0,0,.2),0 0 0 2px #4169e1,0 0 0 4px #fff}.video-mute svg{height:20px;left:calc(50% - 10px);position:absolute;top:calc(50% - 10px);width:20px}.slide__text{align-items:stretch;border-left:1px solid var(--border-color);color:var(--text-color);display:flex;flex-direction:column;flex-shrink:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:var(--text-size);height:var(--height);justify-content:flex-start;min-width:none;pointer-events:none;width:var(--text-width)}.slide__header{align-items:center;border-bottom:1px solid var(--border-color);display:flex;font-weight:600;line-height:1.25;padding:30px}@media (prefers-color-scheme:dark){.theme--auto .slide__header{border-color:#292929}}.slide__header.theme--dark{border-color:#292929}@media (max-width:1200px){.slide__header{padding:20px}}.slide__avatar{align-items:center;border-radius:50%;display:flex;flex-shrink:0;height:42px;justify-content:center;margin-right:10px;overflow:hidden;position:relative;width:42px}.slide__avatar:before{background:radial-gradient(circle farthest-corner at 32% 106%,#ffe17d 0,#ffcd69 10%,#fa9137 28%,#eb4141 42%,transparent 82%),linear-gradient(135deg,#c33cbe 12%,#c33cbe 58%);height:100%;left:0;top:0;width:100%}.slide__avatar:after,.slide__avatar:before{border-radius:50%;content:\"\";position:absolute}.slide__avatar:after{background-color:var(--text-background);height:calc(100% - 4px);left:2px;top:2px;width:calc(100% - 4px)}@media (prefers-color-scheme:dark){.theme--auto .slide__avatar{background-color:#333}}.slide__avatar.theme--dark{background-color:#333}.slide__avatar img{border-radius:50%;height:calc(100% - 8px);position:relative;width:calc(100% - 8px);z-index:1}.slide__avatar svg{height:15px;position:relative;width:15px;z-index:1}.slide__avatar svg path{fill:var(--text-color)}:host(.is-scroller) .slide__avatar{height:32px;width:32px}:host(.is-scroller) .slide__avatar svg{height:12px;width:12px}.slide__caption{line-height:1.5;overflow:auto;padding:30px;scrollbar-width:none;white-space:pre-wrap;word-break:break-word}:host(.is-visible) .slide__caption{pointer-events:all}.slide__caption::-webkit-scrollbar{width:0!important}:host(.is-scroller) .slide__caption{overflow:hidden}.slide__more{background:transparent;border:none;color:var(--text-color);cursor:pointer;margin:0;opacity:.75;padding:0}.slide__more:hover{opacity:1;text-decoration:underline}.slide__footer{border-top:1px solid var(--border-color);margin-top:auto}:host(.is-visible) .slide__footer{pointer-events:all}.slide__footer-link{align-items:center;color:var(--text-color);cursor:pointer;display:flex;font-size:.9333em;font-weight:600;padding:30px;text-decoration:none;transition:background .3s ease}:host(.keyboard-nav) .slide__footer-link:focus{background-color:var(--border-color);border:none;box-shadow:inset 0 0 0 1px #fff,inset 0 0 0 3px #4169e1;outline:none;transition:background .1s ease}.slide__footer-link:hover{background-color:var(--border-color)}.slide__footer-link svg{height:17px;margin-left:auto;width:17px}.slide__footer-link svg path{fill:var(--text-color)}@media (max-width:1200px){.slide__footer-link{padding:20px}}.breadcrumbs{align-items:center;bottom:calc(var(--bottomPadding)/2 + 30px - (var(--breadCrumbDiameter) + 10px)/2);display:flex;gap:calc(var(--breadCrumbDiameter)*.75);height:calc(var(--breadCrumbDiameter) + 10px);justify-content:center;left:50%;opacity:0;position:absolute;transform:translateX(-50%);width:auto;z-index:2}:host(.is-visible) .breadcrumbs{opacity:1}.breadcrumbs-current{background-color:#fff;border-radius:calc(var(--breadCrumbDiameter)/2);height:var(--breadCrumbDiameter);position:absolute;top:5px;transition:width .3s ease;width:var(--breadCrumbDiameter);will-change:left,right,width}.breadcrumb{background-color:hsla(0,0%,100%,.4);border-radius:50%;cursor:pointer;display:block;height:7px;transition:all .3s ease;width:7px}.breadcrumb:hover{background-color:#fff}.close{align-items:center;background:none;border:none;cursor:pointer;display:flex;height:30px;justify-content:center;margin:0;opacity:0;padding:0;position:absolute;right:15px;top:15px;width:30px;z-index:2}:host(.is-visible) .close{opacity:.75;transition:opacity .3s ease}:host(.is-visible) .close:hover{opacity:1}:host(.keyboard-nav) .close:focus{box-shadow:0 0 0 2px #4169e1,0 0 0 3px #fff;opacity:1}.close:focus{border:none;outline:none}.close:before{content:\"\";height:60px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:60px}.close svg{height:20px;width:20px}.close svg path{fill:#fff}:host(.is-scroller) .close{background-color:hsla(0,0%,97%,.85);border-radius:50%;opacity:1;right:5px;top:5px}:host(.is-scroller) .close svg{height:14px;width:14px}:host(.is-scroller) .close svg path{fill:#000}.next,.previous{align-items:center;background:none;border:none;cursor:pointer;display:flex;height:60px;justify-content:center;margin:0;opacity:0;padding:0;position:absolute;top:calc(50% - var(--bottomPadding)/2);transform:translateY(-50%);width:60px;z-index:2}:host(.is-visible) .next,:host(.is-visible) .previous{opacity:.75;transition:opacity .3s ease}:host(.is-visible) .next:focus,:host(.is-visible) .previous:focus{border:none;outline:none}:host(.is-visible) .next:hover,:host(.is-visible) .previous:hover{opacity:1}:host(.is-visible) .next:disabled,:host(.is-visible) .previous:disabled{cursor:default;opacity:.15}:host(.is-visible) .next:disabled:hover,:host(.is-visible) .previous:disabled:hover{opacity:.15}:host(.keyboard-nav) .next:focus,:host(.keyboard-nav) .previous:focus{box-shadow:0 0 0 2px #4169e1,0 0 0 3px #fff;opacity:1}.next svg,.previous svg{height:16px;width:16px}.next svg path,.previous svg path{fill:#fff}.previous{left:0}.next{right:0}.ldr{--uib-size:50px;--uib-speed:1s;--uib-stroke:2px;--uib-bg-opacity:0.1;align-items:center;border-radius:calc(var(--uib-stroke)/2);contain:strict;display:none;height:var(--uib-stroke);justify-content:center;left:calc(50% - 15px);overflow:hidden;position:absolute;top:calc(50% - 15px);transform:translateZ(0);width:var(--uib-size)}.ldr.ldr--visible{display:flex}behold-image.is-loaded .ldr{display:none}.ldr:before{left:0;opacity:var(--uib-bg-opacity);position:absolute;top:0}.ldr:after,.ldr:before{background-color:var(--uib-color);content:\"\";height:100%;transition:background-color .3s ease;width:100%}.ldr:after{animation:wobble var(--uib-speed) ease-in-out infinite;border-radius:calc(var(--uib-stroke)/2);transform:translateX(-95%)}@keyframes wobble{0%,to{transform:translateX(-95%)}50%{transform:translateX(95%)}}",j='.hg-container{align-items:flex-start;backface-visibility:hidden;contain:layout style;justify-content:flex-start;-webkit-user-select:none;-moz-user-select:none;user-select:none;will-change:transform}.hg-container,.hg-slide{display:flex;height:100%;width:100%}.hg-slide{contain:strict;flex-grow:0;flex-shrink:0}.hg-breadcrumbs,.hg-slide{align-items:center;justify-content:center}.hg-breadcrumbs{--ease:cubic-bezier(0.215,0.61,0.355,1);display:flex;gap:calc(var(--breadCrumbDiameter)*.75);height:calc(var(--breadCrumbDiameter) + 10px);pointer-events:all;position:relative;transition:transform .4s var(--ease);width:auto;will-change:transform}.hg-breadcrumbs.no-transition{transition:none}@media (prefers-reduced-motion){.hg-breadcrumbs{transition:none}}.hg-breadcrumbs-current,.hg-breadcrumbs-current:empty{background-color:#fff;border-radius:calc(var(--breadCrumbDiameter)/2);display:block;height:var(--breadCrumbDiameter);position:absolute;top:5px;transition:width .3s var(--ease);width:var(--breadCrumbDiameter);will-change:left,right,width}.hg-breadcrumb,.hg-breadcrumb:empty{cursor:pointer;display:block;flex-shrink:0;height:var(--breadCrumbDiameter);position:relative;width:var(--breadCrumbDiameter)}.hg-breadcrumb:before,.hg-breadcrumb:empty:before{content:"";height:60px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:calc(var(--breadCrumbDiameter)*1.75)}.hg-breadcrumb:after,.hg-breadcrumb:empty:after{background-color:hsla(0,0%,100%,.4);border-radius:50%;content:"";height:100%;left:0;position:absolute;top:0;transition:all .3s var(--ease);width:100%}.no-transition .hg-breadcrumb:after,.no-transition .hg-breadcrumb:empty:after{transition:none}@media (prefers-reduced-motion){.hg-breadcrumb:after,.hg-breadcrumb:empty:after{transition:none}}.hg-breadcrumb.hg-breadcrumb--1:after,.hg-breadcrumb:empty.hg-breadcrumb--1:after{transform:scale(.85)}.hg-breadcrumb.hg-breadcrumb--2:after,.hg-breadcrumb:empty.hg-breadcrumb--2:after{opacity:.75;transform:scale(.7)}.hg-breadcrumb.hg-breadcrumb--3:after,.hg-breadcrumb:empty.hg-breadcrumb--3:after{opacity:.5;transform:scale(.55)}.hg-breadcrumb.hg-breadcrumb--4:after,.hg-breadcrumb:empty.hg-breadcrumb--4:after{opacity:.25;transform:scale(.4)}.hg-breadcrumb.hg-breadcrumb--hidden,.hg-breadcrumb:empty.hg-breadcrumb--hidden{pointer-events:none}.hg-breadcrumb.hg-breadcrumb--hidden:after,.hg-breadcrumb:empty.hg-breadcrumb--hidden:after{opacity:0;transform:scale(0)}.hg-breadcrumb:empty:hover:after,.hg-breadcrumb:hover:after{background-color:#fff;opacity:1;transform:none}';class O extends a{label="PopoverGallery";verticalScrollBreakpoint=900;shadow;fragment;styleEl;stylesAdded;overlayEl;previousEl;nextEl;closeEl;breadcrumbContainer;innerEl;postEls;hurdyGurdy;popoverScroller;currentPostIndex=0;posts;widgetSettings;feedMetadata;closeFocusEl=document.body;onSlideChange;constructor(){super(),this.shadow=this.attachShadow({mode:"open"}),this.onPropChange((()=>{}),["posts","widgetSettings","feedMetadata"]),R.register(),this.handleSlideChange=this.handleSlideChange.bind(this),this.close=this.close.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.onStateChange((()=>{i(this,{"keyboard-nav":this.state.keyboardNavEnabled})})),this.onConnect((()=>{this.classList.add(`theme--${this.widgetSettings.popupColorTheme||"auto"}`),i(this,{"keyboard-nav":this.state.keyboardNavEnabled}),this.overlayEl=t({classes:"overlay",listeners:{click:this.close}}),this.previousEl=t({type:"button",classes:"previous",attributes:{"aria-label":"Previous slide"},contents:I}),this.nextEl=t({type:"button",classes:"next",attributes:{"aria-label":"Next slide"},contents:F}),this.closeEl=t({type:"button",classes:"close",contents:'<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">\n<path fill-rule="evenodd" clip-rule="evenodd" fill="#081B10" d="M11.6,10.1l5.5-5.7c0.5-0.5,0.5-1.1,0-1.6c-0.5-0.5-1.1-0.5-1.6,0\n\tl-5.5,5.6L4.4,2.8C4,2.4,3.3,2.4,2.8,2.8S2.4,4,2.8,4.4L8.4,10l-5.5,5.6c-0.5,0.5-0.5,1.1,0,1.6c0.5,0.5,1.1,0.5,1.6,0l5.5-5.6\n\tl5.5,5.6c0.5,0.5,1.1,0.5,1.6,0c0.5-0.5,0.5-1.1,0-1.6C17,15.6,11.6,10.1,11.6,10.1z"/>\n</svg>',attributes:{"aria-label":"Close"},listeners:{click:e=>{e.preventDefault(),this.close()}}}),this.breadcrumbContainer=t({classes:"breadcrumbs"}),this.postEls=this.posts.map((e=>{const t=document.createElement("behold-popover-gallery-slide");return t.post=e,t.feedMetadata=this.feedMetadata,t})),this.innerEl=t({classes:"inner",contents:this.postEls}),this.fragment=document.createDocumentFragment(),this.fragment.replaceChildren(this.overlayEl,this.innerEl,this.breadcrumbContainer,this.previousEl,this.nextEl,this.closeEl),this.styleEl=t({type:"style",contents:[$.toString(),j.toString(),L.toString()]}),this.hurdyGurdy=new _({slides:this.postEls,containerEl:this.innerEl,breadcrumbsContainerEl:this.breadcrumbContainer,previousEl:this.previousEl,nextEl:this.nextEl,onSlideChange:this.handleSlideChange,breadcrumbDiameter:this.postEls.length>9?9:8,virtualize:!0}),this.popoverScroller=new P({slides:this.postEls,containerEl:this.innerEl,onSlideChange:this.handleSlideChange,onRequestClose:()=>{this.close()}}),this.onStateChange(this.handleStateChange),this.onResize(this,this,this.handleResize)})),this.onDisconnect((()=>{document.removeEventListener("keydown",this.handleKeydown),w(this.closeFocusEl),this.hurdyGurdy.destroy(),this.popoverScroller.destroy(),this.hurdyGurdy=null,this.popoverScroller=null}))}handleStateChange({changedProps:e,newState:t}){e.includes("popoverOverlayColor")&&(this.overlayEl.style.backgroundColor=t.popoverOverlayColor)}handleKeydown(e){"Escape"===e.code&&(e.preventDefault(),this.close())}open(e,t){this.currentPostIndex=e,this.cancelRaf("open"),this.closeFocusEl=t,this.render(),o(),this.raf((()=>{this.classList.add("is-visible"),async function(e,t=[],i=0){u=e,c=C(e)?e:document,g=!0,y({include:[e],exclude:t}),document.addEventListener("keydown",E),m.observe(e,{subtree:!0,attributes:!0,attributeFilter:["disabled"],childList:!0});const s=await x();s[i]?.focus()}(this.shadow,this.postEls.filter(((t,i)=>i!==e)),1),this.checkSize(this.offsetWidth),this.postEls[e].activate(),document.addEventListener("keydown",this.handleKeydown)}),"open")}close(){this.cancelTo("close"),this.classList.remove("is-visible"),this.to(this.remove.bind(this),300,"close"),w(this.closeFocusEl),document.removeEventListener("keydown",this.handleKeydown)}handleSlideChange(e){this.currentPostIndex=e,y({include:[this.shadow],exclude:this.postEls.filter(((t,i)=>i!==e)),merge:!1}),this.onSlideChange&&this.onSlideChange(e),this.postEls.forEach(((t,i)=>{i===e?t.activate():t.deactivate()}));const t=this.postEls[e-1]??null,i=this.postEls[e+1]??null;if(t&&this.raf((()=>t.preload()),"preload"),i&&this.raf((()=>i.preload()),"preload"),"CAROUSEL_ALBUM"!==this.posts[e].mediaType){const t=d(this.posts[e]?.colorPalette?.dominant||"100,100,100").map((e=>Math.round(e)));this.updateState({popoverOverlayColor:`hsl(${t[0]} ${Math.min(t[1],50)}% ${Math.min(t[2],15)}% / .85)`})}}checkSize(e){e>this.verticalScrollBreakpoint?(this.classList.remove("is-scroller"),this.previousEl.style.display="",this.nextEl.style.display="",this.popoverScroller.destroy(),this.hurdyGurdy.init(this.currentPostIndex),this.postEls.forEach((e=>e.expandCaption()))):(this.classList.add("is-scroller"),this.hurdyGurdy.destroy(),this.popoverScroller.init(this.currentPostIndex),this.postEls.forEach((e=>e.collapseCaption())),this.previousEl.disabled=!1,this.previousEl.style.display="none",this.nextEl.disabled=!1,this.nextEl.style.display="none")}handleResize(e){const t=e?.borderBoxSize?.[0]?.inlineSize||0;this.checkSize(t)}render(){document.body.append(this),this.shadow.replaceChildren(this.fragment,this.styleEl)}static register(e="behold-popover-gallery"){return customElements.get(e)||customElements.define(e,O),e}}export{O as default};
|
package/dist/Widget-D9I4vSzG.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
function e(e){return JSON.parse(JSON.stringify(e,((e,t)=>void 0===t?null:t)))}function t(){return document.body.offsetTop}async function s(e,t){const s=document.createElement(e);return new Promise(((r,n)=>{switch(e){case"img":s.addEventListener("load",(()=>{r(t)}));break;case"video":s.addEventListener("loadeddata",(()=>r(t)))}s.addEventListener("error",(e=>{n(e)})),s.src=t}))}function r({text:e,maxLines:t=2,maxChars:s=50}){if(!e)return;const r=e.match(/.*/g).filter((e=>e.length>0)).slice(0,t).join("").length,n=Math.min(r,s);return e.slice(0,n)}function n(e,t){return`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='${e}' height='${t}'%3E%3C/svg%3E%0A`}function o(e){return new Promise((t=>{let s=new IntersectionObserver((e=>{let r=e.reduce(((e,t,s)=>t.intersectionRatio>e.intersectionRatio?{index:s,intersectionRatio:t.intersectionRatio}:e),{intersectionRatio:0,index:null});s.disconnect(),s=null,t(r.index)}));e.forEach((e=>s.observe(e)))}))}function i(e){return e.isConnected?"#document"===e.nodeName||e instanceof ShadowRoot?e:i(e.parentNode):document}function a(e,t,s=null,r=!1){let n=r,o=null;return(...r)=>{n?(clearTimeout(o),o=setTimeout((()=>{n=!1,e.apply(s,r)}),t)):(e.apply(s,r),n=!0,setTimeout((()=>{n=!1}),t))}}function d(e,t){Object.entries(t).forEach((([t,s])=>{s?e.classList.add(t):e.classList.remove(t)}))}function l(e,t,s){e.style.setProperty(t,s)}function c(e,t,s){return"string"==typeof s&&(s=[s]),s.reduce(((s,r)=>!h(e?.[r],t?.[r])||s),!1)}function h(e,t,s=!1,r=!1){if(r&&(Array.isArray(e)&&(e=e.sort()),Array.isArray(t)&&(t=t.sort())),s&&("number"==typeof e&&(e=e.toString()),"number"==typeof t&&(t=t.toString())),typeof e!=typeof t)return!1;if(null===e&&null===t)return!0;if(null===e&&null!==t)return!1;if(null!==e&&null===t)return!1;if(void 0===e&&void 0===t)return!0;if(void 0===e&&void 0!==t)return!1;if(void 0!==e&&void 0===t)return!1;if("object"==typeof e)return Object.keys(e).length===Object.keys(t).length&&Object.entries(e).reduce(((e,[n,o])=>!!h(o,t[n],s,r)&&e),!0);if(Array.isArray(e)){let n=!0;return e.forEach(((e,o)=>{h(e,t[o],s,r)||(n=!1)})),n}return e===t}let u={isMuted:!0,popoverOverlayColor:"rgba(0, 0, 0, 0.6)",keyboardNavEnabled:!1},p=!1,g=null,f=null;const m=new Map,b=new Map,w=new Set;class y extends HTMLElement{label="BaseElement";storedProperties=new Map;requiredProperties=[];hasRequiredProps=!1;propChangeHandlers=new Map;queuedPropUpdates=new Set;connectHandlers=new Set;disconnectHandlers=new Set;rafs=new Map;timeouts=new Map;constructor(){super(),this.globalHandleKeydown=this.globalHandleKeydown.bind(this),this.globalHandleMousedown=this.globalHandleMousedown.bind(this),this.globalHandleMousemove=this.globalHandleMousemove.bind(this),g||(g=new ResizeObserver((e=>{e.forEach((e=>{const t=m.get(e.target);t&&t(e)}))}))),f||(f=new IntersectionObserver((e=>{e.forEach((e=>{const t=b.get(e.target);t&&t(e)}))}))),p||(p=!0,document.addEventListener("keydown",this.globalHandleKeydown),document.addEventListener("mousedown",this.globalHandleMousedown),document.addEventListener("mousemove",this.globalHandleMousemove,{passive:!0}))}connectedCallback(){this.connectHandlers.forEach((e=>e()))}disconnectedCallback(){this.rafs.forEach((e=>cancelAnimationFrame(e))),this.rafs.clear(),this.timeouts.forEach((e=>clearTimeout(e))),this.timeouts.clear(),this.disconnectHandlers.forEach((e=>e()))}onConnect(e){this.connectHandlers.add(e)}onDisconnect(e){this.disconnectHandlers.add(e)}onResize(e,t,s){m.set(t,s.bind(e)),g.observe(t),this.disconnectHandlers.add((()=>{m.delete(t),g.unobserve(t)}))}onIntersection(e,t){b.set(e,t),f.observe(e),this.disconnectHandlers.add((()=>{b.delete(e),f.unobserve(e)}))}onPropChange(t,s,r=null){r?this.requiredProperties.push(...r):this.requiredProperties.push(...s),s.forEach((s=>{void 0!==this[s]&&this.storedProperties.set(s,this[s]),this.propChangeHandlers.get(s)||this.propChangeHandlers.set(s,[]),this.propChangeHandlers.get(s).push(t),Object.defineProperty(this,s,{set(t){void 0===t&&(t=null,console.warn(`Attempted to set value of ${s} as "undefined" on ${this.label}. ${s} was coered to null instead.`)),t=e(t);const r=this.storedProperties.has(s)?e(this.storedProperties.get(s)):null;this.storedProperties.set(s,t),this.queueHandlers({prop:s,oldValue:r,newValue:t,context:this})},get(){return this.storedProperties.get(s)}})})),this.queueMissingPropsCheck()}queueHandlers({prop:e,oldValue:t,newValue:s}){this.hasRequiredProps=this.requiredProperties.every((e=>this.storedProperties.has(e))),this.hasRequiredProps?(this.queuedPropUpdates.size&&(this.queuedPropUpdates.delete(e),this.runQueuedPropHandlers()),this.propChangeHandlers.get(e).forEach((r=>{r.call(this,{changedProp:e,oldValue:t,newValue:s})}))):this.queuedPropUpdates.add(e)}runQueuedPropHandlers(){this.queuedPropUpdates.forEach((e=>{this.propChangeHandlers.get(e).forEach((t=>{t.call(this,{changedProp:e,oldValue:null,newValue:this[e]})}))})),this.queuedPropUpdates.clear()}globalHandleKeydown(e){"Tab"===e.key&&this.updateState({keyboardNavEnabled:!0})}globalHandleMousedown(e){0===e.clientX&&0===e.clientY||this.updateState({keyboardNavEnabled:!1})}globalHandleMousemove(e){e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||0===e.movementX||0===e.movementY||this.updateState({keyboardNavEnabled:!1})}get state(){return u}set state(e){throw new Error("Shared state cannot be set directly. Use this.updateState() instead.")}updateState(t){const s=e(u);u={...u,...t},w.forEach((e=>e({changedProps:Object.keys(t),oldState:s,newState:u})))}onStateChange(e){this.connectHandlers.add((()=>{const t=e.bind(this);w.add(t),this.disconnectHandlers.add((()=>w.delete(t)))}))}raf(e,t){const s=requestAnimationFrame((()=>{e(),this.rafs.delete(t)}));return this.rafs.set(t,s),s}cancelRaf(e){cancelAnimationFrame(this.rafs.get(e)),this.rafs.delete(e)}to(e,t,s){const r=setTimeout((()=>{e(),this.timeouts.delete(s)}),t);return this.timeouts.set(s,r),r}cancelTo(e){clearTimeout(this.timeouts.get(e)),this.timeouts.delete(e)}queueMissingPropsCheck(){queueMicrotask((()=>{if(this.requiredProperties.length&&!this.hasRequiredProps){const e=this.requiredProperties.filter((e=>!this.storedProperties.has(e)));console.error(`${this.label||this.tagName} is missing required props: ${e.join(", ")}`)}}))}}function v(e){let{type:t="div",classes:s=[],contents:r=[],attributes:n={},props:o={},style:i={},listeners:a={}}=e;s=Array.isArray(s)?s:[s];const d=document.createElement(t);return Array.isArray(r)||(r=[r]),r=r.filter((e=>null!=e)).map((e=>{if("string"==typeof e&&e.includes("</svg>")){const t=document.createElement("template");return t.innerHTML=e,t.content}return e})),d.replaceChildren(...r),s.length&&(d.className=s.join(" ")),Object.keys(n).forEach((e=>{d.setAttribute(e,n[e])})),Object.assign(d,o),Object.keys(i).forEach((e=>{d.style[e]=i[e]})),Object.keys(a).forEach((e=>{d.addEventListener(e,a[e])})),d}class E extends y{label="BeholdWidget";#e;#t;#s;static get observedAttributes(){return["feed-id"]}constructor(){super(),this.#e=this.attachShadow({mode:"open"}),this.#t=null,this.onPropChange(this.handlePropChange,["widgetSettings","feedMetadata","posts","previewLoadingColors","errorMessage"],[])}attributeChangedCallback(e,t,s){"feed-id"===e&&s!==t&&this.#r(s)}handlePropChange({changedProp:e,oldValue:t,newValue:s}){"errorMessage"!==e||t||!s?"widgetSettings"===e&&c(s,t,"type")?this.#n(s?.type):this.#s&&!h(s,t)&&(this.#s[e]=s):this.#n("ErrorMessage")}async#n(e){"classic"===e&&(e="grid");const t=(await this.#o(e.replace(/.?/,(e=>e.toUpperCase())))).register(),s=v({type:t}),r=v({type:"style",contents:":host{align-items:center;box-sizing:border-box;display:flex;flex-wrap:wrap;justify-content:center;margin:0;min-width:50px;overflow:hidden;position:relative;width:100%}:host *{box-sizing:border-box}:host([hidden]){display:none}".toString()});this.#e.replaceChildren(s,r),this.#s=this.#e.querySelector(t),this.#s.widgetSettings=this.widgetSettings,this.#s.feedMetadata=this.feedMetadata,this.#s.posts=this.posts,this.#s.errorMessage=this.errorMessage||null,window.dispatchEvent(new CustomEvent("behold:widget-loaded",{detail:{id:this["feed-id"]}}))}async#r(e){if(e){this.#t&&this.#t.abort(),this.#t=new AbortController;try{const t=await fetch(`https://feeds.behold.so/${e}`,{mode:"cors",signal:this.#t.signal});if(t.ok){const e=await t.json();this.widgetSettings=e.widgetSettings,this.feedMetadata={username:e.username,profilePictureUrl:e.profilePictureUrl,website:e.website,followersCount:e.followersCount,hashtags:e.hashtags},this.posts=e.media}else{const e=await t.text();this.errorMessage=e}}catch(e){"The user aborted a request."!==e.message&&(this.errorMessage=e.message)}}else this.errorMessage="No feed ID provided"}async#o(e){const{default:t}=await function(e){switch(e){case"./widgets/ErrorMessage.ts":return import("./ErrorMessage-iukAy4KE.js");case"./widgets/GalleryWall.ts":return import("./GalleryWall-YjqK_Fsr.js");case"./widgets/Grid.ts":return import("./Grid-UXYoSdwm.js");default:return new Promise((function(t,s){("function"==typeof queueMicrotask?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+e)))}))}}(`./widgets/${e}.ts`);return t}static register(e="behold-widget"){return customElements.get(e)||customElements.define(e,class extends E{}),e}}export{y as B,l as a,i as b,v as c,o as d,r as e,t as f,n as g,c as h,E as i,s as p,d as s,a as t};
|
package/dist/base-SePYPKrr.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
import{B as e,s as t,h as o,a as s,c as i,g as a,f as r,t as n,p as h}from"./Widget-D9I4vSzG.js";function l(e){if(!e)return e;let[t,o,s]=e.split(",");t/=255,o/=255,s/=255;const i=Math.max(t,o,s),a=i-Math.min(t,o,s),r=a?i===t?(o-s)/a:i===o?2+(s-t)/a:4+(t-o)/a:0;return[60*r<0?60*r+360:60*r,100*(a?i<=.5?a/(2*i-a):a/(2-(2*i-a)):0),100*(2*i-a)/2]}function d(e,t){const o=(s=e,i="dominant",s.filter((e=>e[i])).map((e=>e[i]))).map((e=>l(e).join(",")));var s,i;return[c(p(o,0)),c(p(o,1)),c(p(o,2))]}function c(e){const t=[...e];t.sort((function(e,t){return e-t}));const o=Math.floor((t.length-1)/2);return t.length%2?t[o]:(t[o]+t[o+1])/2}function p(e,t){return e.map((e=>parseInt(e.split(",")[t])))}class f extends e{label="BaseWidget";shadow;styleEl;stylesAdded;contents;constructor(){super(),this.shadow=this.attachShadow({mode:"open"}),this.handleKeydown=this.handleKeydown.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleFocusout=this.handleFocusout.bind(this),this.handleShadowFocusout=this.handleShadowFocusout.bind(this),this.onStateChange((()=>{t(this,{"keyboard-nav":this.state.keyboardNavEnabled})})),this.onConnect((()=>{this.styleEl=document.createElement("style"),t(this,{"keyboard-nav":this.state.keyboardNavEnabled}),this.addEventListener("focus",this.handleFocus),this.addEventListener("focusout",this.handleFocusout),this.shadowRoot.addEventListener("focusout",this.handleShadowFocusout),this.addEventListener("keydown",this.handleKeydown)}))}focusPreviousPost(){this.dispatchEvent(new CustomEvent("post-focus-previous"))}focusNextPost(){this.dispatchEvent(new CustomEvent("post-focus-next"))}handleKeydown(e){"ArrowLeft"===e.key&&e.shiftKey&&this.focusPreviousPost(),"ArrowRight"===e.key&&e.shiftKey&&this.focusNextPost(),this.shadowRoot.activeElement&&this.classList.remove("has-focus")}handleFocus(e){this.shadow.activeElement||this.classList.add("has-focus")}handleFocusout(){this.classList.remove("has-focus")}handleShadowFocusout(e){e.relatedTarget===this&&this.classList.add("has-focus")}renderWidget(e,t){this.stylesAdded&&this.contents?this.contents.replaceWith(e):(this.contents=e,this.styleEl.replaceChildren(...t.map((e=>e.toString()))),this.shadow.replaceChildren(this.contents,this.styleEl),this.stylesAdded=!0)}}function v(e,t,o,s){let i="";switch(e){case"dominant":case"vibrant":case"muted":case"vibrantLight":case"mutedLight":case"vibrantDark":case"mutedDark":i=t?`rgb(${t[e]})`:m(s);break;case"tone":if(o){const e=o.split(",");if(t){const o=(a=1.6,r=l(t.dominant)[2]-s[2],Math.log(Math.abs(r))/Math.log(a)*Math.sign(r));i=`hsl(${e[0]},${e[1]}%,${parseInt(e[2])+o}%)`}else i=`hsl(${e[0]},${e[1]}%,${e[2]}%, ${Math.max(1*Math.random(),.3)})`}else i=m(s)}var a,r;return i}function m(e){return e?`hsl(${e[0]}, ${e[1]}%, ${e[2]}%, ${Math.max(1*Math.random(),.3)})`:""}class b extends e{label="BasePost";post;widgetSettings;feedMetadata;medianPaletteHSL;hasRowGap=!1;isLastRow=!1;onClick;previewLoadingColors=null;innerEl;captionEl;sizeClass="post--xlarge";constructor(){super(),this.onPropChange(this.baseHandlePropChange,["post","widgetSettings","feedMetadata","medianPaletteHSL","hasRowGap","isLastRow","previewLoadingColors"],["post","widgetSettings","feedMetadata","medianPaletteHSL"]),this.handleButtonClick=this.handleButtonClick.bind(this),this.onConnect((()=>{this.onResize(this,this,this.handleResize)}))}baseHandlePropChange({changedProp:e,oldValue:t,newValue:s}){switch(e){case"widgetSettings":s.loadingColor===t?.loadingColor&&s.loadingColorTone===t?.loadingColorTone||this.setBackgroundColor(),o(s,t,["onHover","linkTarget","previewVideosOnHover","onPostClick","customLinkURL"])&&this.renderPost(),o(s,t,["hoverOverlayColor","hoverOverlayCustomColor","hoverOverlayOpacity"])&&this.setOverlayColor(),this.setContainerStyles();break;case"previewLoadingColors":this.setBackgroundColor();break;case"hasRowGap":case"isLastRow":this.setContainerStyles()}}setOverlayColor(){let e="rgba(0, 0, 0, 0.3)",t=this.widgetSettings.hoverOverlayCustomColor??"0,0,0",o=this.widgetSettings.hoverOverlayOpacity??65;if("auto"===this.widgetSettings.hoverOverlayColor){const t=l(this.post.colorPalette?.dominant||"100,100,100").map((e=>Math.round(e)));e=`hsl(${t[0]} ${Math.min(t[1],50)}% ${Math.min(t[2],40)}% / ${o/100})`}if("custom"===this.widgetSettings.hoverOverlayColor){const s=t.split(",");e=`hsl(${s[0]} ${s[1]}% ${s[2]}% / ${o/100})`}s(this,"--overlay-color",e)}setContainerStyles(){t(this,{post:!0,"post--hover-icon":"showIcon"===this.widgetSettings.onHover,"post--hover-caption":"showCaption"===this.widgetSettings.onHover,"post--has-row-gap":this.hasRowGap,"post--last-row":this.isLastRow}),this.setOverlayColor()}renderPost(e){if(!e){e=[...this.innerEl.children].filter((e=>e!==this.captionEl))[0]}let t="div",o=this.post.permalink;this.setContainerStyles(),"linkToProfile"===this.widgetSettings.onPostClick&&this.feedMetadata.username&&(o=`https://instagram.com/${this.feedMetadata.username}`),"customLink"===this.widgetSettings.onPostClick&&this.widgetSettings.customLinkURL&&(o=this.widgetSettings?.customLinkURL),this.widgetSettings.onPostClick.toLowerCase().includes("link")&&(t="a"),this.widgetSettings.onPostClick.toLowerCase().includes("popup")&&(t="button");let s=null;if("showCaption"===this.widgetSettings.onHover){const e=i({contents:this.post.prunedCaption?.length?this.post.prunedCaption:this.post.caption,classes:"post-caption__inner"});s=i({contents:e,classes:"post-caption"})}this.innerEl=i({type:t,contents:[e,s||""],attributes:{"aria-label":"Instagram post",tabindex:-1,..."a"===t?{href:o,target:this.widgetSettings.linkTarget}:{}},listeners:{..."button"===t?{click:this.handleButtonClick}:{}}}),this.replaceChildren(this.innerEl)}setBackgroundColor(){const e=this.previewLoadingColors??this.widgetSettings.loadingColor;this.style.backgroundColor=v(e,this.post.colorPalette,this.widgetSettings.loadingColorTone,this.medianPaletteHSL)}focus(){this.innerEl.focus()}handleResize(e){const o=e?.borderBoxSize?.[0]?.inlineSize||0;let s="xlarge";o<600&&(s="large"),o<400&&(s="medium"),o<250&&(s="small"),o<175&&(s="xsmall");["xsmall","small","medium","large","xlarge"].forEach((e=>{this.sizeClass=`post--${e}`,t(this,{[this.sizeClass]:e===s})}))}handleButtonClick(){this.onClick&&this.onClick(this)}}class u extends e{label="Image";sizes;mediaUrl;isSquare=!1;showLoader=!1;imageSrc;imageSize;imageEl;ldrEl;isVisible=!1;loaderIsShowing=!1;isLoaded=!1;constructor(){super(),this.onPropChange(this.handlePropChange,["sizes","mediaUrl","imageSrc","imageSize","isSquare","showLoader","loaderIsShowing"],["sizes","mediaUrl","isSquare"]),this.handleIntersection=this.handleIntersection.bind(this),this.handleImageLoad=this.handleImageLoad.bind(this),this.handleImageError=this.handleImageError.bind(this),this.onConnect((()=>{const e=this.sizes.full.height,t=this.sizes.full.width;this.imageEl=i({type:"img",attributes:{alt:"",role:"presentation",height:this.isSquare?"100px":e+"px",width:this.isSquare?"100px":t+"px",tabindex:-1,src:a(t,e)},listeners:{load:this.handleImageLoad,error:this.handleImageError}}),this.showLoader?(this.ldrEl=i({classes:"ldr"}),this.replaceChildren(this.ldrEl,this.imageEl)):this.replaceChildren(this.imageEl),r(),this.raf((()=>{this.onResize(this,this,n(this.handleResize,50,this,!0)),this.onIntersection(this,this.handleIntersection)}),"connect")}))}handlePropChange({changedProp:e,oldValue:o,newValue:s}){switch(e){case"imageSize":if(!o||o.width<s.width||!this.isLoaded){const e=this.mediaUrl;this.imageSrc=s?.mediaUrl||e}break;case"imageSrc":this.imageEl&&this.isVisible&&this.imageSrc!==this.imageEl.src&&(this.isLoaded=!1,this.imageEl.src=this.imageSrc);break;case"showLoader":!o&&s&&this.imageEl&&(this.ldrEl=i({classes:"ldr"}),this.replaceChildren(this.ldrEl,this.imageEl));break;case"loaderIsShowing":this.ldrEl&&t(this.ldrEl,{"ldr--visible":s&&!this.isLoaded})}}handleIntersection(e){e.isIntersecting?(this.isVisible=!0,!this.isLoaded&&this.showLoader&&this.to((()=>{this.loaderIsShowing=!0}),50,"loader"),this.imageSrc&&this.imageEl.src!==this.imageSrc&&(this.imageEl.src=this.imageSrc)):this.isVisible=!1}handleResize(e){const t=e?.borderBoxSize?.[0]?.inlineSize||0,o=Object.values(this.sizes).reduce((function(e,o){return Math.abs(o.width/2-t)<Math.abs(e.width/2-t)?o:e}));this.imageSize=o}handleImageLoad(){this.imageEl.src===this.imageSrc&&(this.loaderIsShowing=!1,this.cancelTo("loader"),this.isLoaded=!0,this.dispatchEvent(new Event("load")),this.classList.add("is-loaded"))}handleImageError(){this.imageSrc!==this.mediaUrl&&(this.imageSrc=this.mediaUrl)}preload(){this.isLoaded||this.imageSrc&&this.imageEl.src!==this.imageSrc&&(this.imageEl.src=this.imageSrc)}static register(e="behold-image"){return customElements.get(e)||customElements.define(e,u),e}}class g extends b{label="ImagePost";imageEl;constructor(){super(),this.onPropChange(this.handlePropChange,["post"]),u.register()}handlePropChange({changedProp:e}){if("post"===e){const{sizes:e,mediaUrl:t}=this.post,o=i({type:"behold-image",props:{sizes:e,mediaUrl:t,isSquare:!0}});this.renderPost(o)}}static register(e="behold-image-post"){return customElements.get(e)||customElements.define(e,g),e}}class y extends e{label="Video";mediaUrl;sizes;videoEl;imageEl;isLoaded=!1;isMuted=!0;constructor(){super(),this.onPropChange((()=>{}),["mediaUrl","sizes"]),this.handleIntersection=this.handleIntersection.bind(this),this.handleVideoLoad=this.handleVideoLoad.bind(this),this.handlePageVisibility=this.handlePageVisibility.bind(this),this.handlePlay=this.handlePlay.bind(this),this.handlePause=this.handlePause.bind(this),document.addEventListener("visibilitychange",this.handlePageVisibility),this.onIntersection(this,this.handleIntersection),this.onConnect((()=>{this.render()})),this.onDisconnect((()=>{document.removeEventListener("visibilitychange",this.handlePageVisibility),this.videoEl.removeEventListener("play",this.handlePlay),this.videoEl.removeEventListener("pause",this.handlePause)}))}get isPlaying(){return!!(this.videoEl.currentTime>0&&!this.videoEl.paused&&!this.videoEl.ended&&this.videoEl.readyState>2)}get paused(){return this.videoEl?.paused}get muted(){return this.videoEl?.muted}render(){this.videoEl=i({type:"video",attributes:{loop:!0,playsinline:!0,crossorigin:"anonymous",tabIndex:-1,disablePictureInPicture:!0,disableremoteplayback:!0,height:this.sizes.full.height,width:this.sizes.full.width},props:{muted:this.isMuted},listeners:{play:this.handlePlay,pause:this.handlePause}}),this.imageEl=i({type:"img",attributes:{height:this.sizes.full.height,width:this.sizes.full.width,src:a(this.sizes.full.width,this.sizes.full.height)}}),this.replaceChildren(this.imageEl)}handleIntersection(e){e.isIntersecting?this.videoEl.src!==this.mediaUrl&&(this.videoEl.addEventListener("loadeddata",this.handleVideoLoad,{once:!0}),this.videoEl.src=this.mediaUrl):this.pause()}handleVideoLoad(){this.isLoaded=!0,this.videoEl.currentTime=.25,this.videoEl.pause(),this.dispatchEvent(new Event("load")),this.replaceChildren(this.videoEl),r(),this.raf((()=>{this.classList.add("is-loaded")}),"handleVideoLoad")}handlePlay(){this.dispatchEvent(new Event("play"))}handlePause(){this.dispatchEvent(new Event("pause"))}async play(){if(this.videoEl)try{await this.videoEl.play()}catch(e){}}pause(){this.videoEl&&this.videoEl.pause()}mute(){this.isMuted=!0,this.videoEl&&(this.videoEl.muted=!0)}unmute(){this.isMuted=!1,this.videoEl&&(this.videoEl.muted=!1)}handlePageVisibility(){document.hidden&&this.pause()}preload(){this.isLoaded||h("video",this.mediaUrl)}static register(e="behold-video"){return customElements.get(e)||customElements.define(e,y),e}}class w extends b{label="VideoPost";videoEl;imageEl;constructor(){super(),this.onPropChange(this.handlePropChange,["post","widgetSettings"]),y.register(),u.register(),this.handleMouseover=this.handleMouseover.bind(this),this.handleMouseleave=this.handleMouseleave.bind(this),this.onDisconnect((()=>{this.removeEventListener("mouseover",this.handleMouseover),this.removeEventListener("mouseleave",this.handleMouseleave)}))}handlePropChange({changedProp:e,oldValue:t,newValue:s}){if("post"===e||"widgetSettings"===e&&o(t,s,["previewVideosOnHover"])){const{sizes:e,mediaUrl:t,thumbnailUrl:o}=this.post;this.widgetSettings.previewVideosOnHover&&t?(this.videoEl=i({type:"behold-video",props:{mediaUrl:t,sizes:e}}),this.addEventListener("mouseover",this.handleMouseover,{passive:!0}),this.addEventListener("mouseleave",this.handleMouseleave,{passive:!0}),this.renderPost(this.videoEl)):(this.imageEl=i({type:"behold-image",props:{sizes:e,mediaUrl:o,isSquare:!0}}),this.renderPost(this.imageEl))}}handleMouseover(){this.videoEl?.play()}handleMouseleave(){this.videoEl?.pause()}static register(e="behold-video-post"){return customElements.get(e)||customElements.define(e,w),e}}class k extends b{label="AlbumPost";imageEl;constructor(){super(),u.register(),this.onPropChange(this.handlePropChange,["post"])}handlePropChange({changedProp:e}){if("post"===e){const{sizes:e,mediaUrl:t}=this.post,o=i({type:"behold-image",props:{sizes:e,mediaUrl:t,isSquare:!0}});this.renderPost(o)}}static register(e="behold-album-post"){return customElements.get(e)||customElements.define(e,k),e}}var z=":host{--icon-instagram:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 35 35' xml:space='preserve'%3E%3Cpath fill='%23FFF' d='M17.6 3.2c4.7 0 5.2 0 7.1.1 1.7.1 2.6.4 3.2.6.8.3 1.4.7 2 1.3.6.6 1 1.2 1.3 2 .2.6.5 1.5.6 3.3.1 1.8.1 2.4.1 7.1s0 5.2-.1 7.1c-.1 1.7-.4 2.6-.6 3.2-.6 1.5-1.8 2.7-3.3 3.3-.6.2-1.5.5-3.2.6-1.8.1-2.4.1-7.1.1s-5.2 0-7.1-.1c-1.7-.1-2.6-.4-3.2-.6-.8-.3-1.4-.7-2-1.3-.6-.6-1-1.2-1.3-2-.2-.6-.5-1.5-.6-3.2-.1-1.8-.1-2.4-.1-7.1s0-5.2.1-7.1c0-1.8.3-2.7.6-3.3.3-.8.7-1.4 1.3-2 .6-.6 1.2-1 2-1.3.6-.2 1.5-.5 3.2-.6 1.9-.1 2.4-.1 7.1-.1m0-3.2c-4.8 0-5.3 0-7.2.1-1.9.1-3.2.4-4.3.8C5 1.4 3.9 2 3 2.9c-.9.9-1.5 2-2 3.1C.6 7.1.3 8.4.2 10.2c-.1 1.9-.1 2.5-.1 7.2s0 5.3.1 7.2c.1 2 .4 3.2.8 4.4.4 1.2 1.1 2.2 2 3.1.9.9 1.9 1.6 3.1 2 1.1.4 2.4.7 4.2.8s2.5.1 7.2.1 5.3 0 7.2-.1c1.9-.1 3.1-.4 4.2-.8 2.3-.9 4.2-2.8 5.1-5.1.4-1.1.7-2.4.8-4.2.1-1.9.1-2.5.1-7.2s0-5.3-.1-7.2c-.1-1.9-.4-3.1-.8-4.2-.4-1.2-1.1-2.2-2-3.1-.9-.9-1.9-1.6-3.1-2-1.1-.4-2.4-.7-4.2-.8-1.8-.3-2.4-.3-7.1-.3z'/%3E%3Cpath fill='%23FFF' d='M17.6 8.5c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 14.8c-3.2 0-5.8-2.6-5.8-5.8s2.6-5.8 5.8-5.8 5.8 2.6 5.8 5.8-2.6 5.8-5.8 5.8z'/%3E%3Ccircle fill='%23FFF' cx='26.9' cy='8.2' r='2.1'/%3E%3C/svg%3E\");--icon-video:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 35 35' xml:space='preserve'%3E%3Cpath fill='%23FFF' d='M30.1 15.5 7.2 2.3c-1.5-.9-3.5.2-3.5 1.9v26.5c0 1.7 1.9 2.9 3.4 1.9L30 19.4c1.7-.8 1.7-3 .1-3.9z'/%3E%3C/svg%3E\");--icon-album:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 35 35' xml:space='preserve'%3E%3Cpath fill='%23FFF' d='M27.3 22.7v-17c0-2.6-2.1-4.7-4.7-4.7H5.7C3.1 1 1 3.1 1 5.7v17c0 2.6 2.1 4.7 4.7 4.7h17c2.5-.1 4.6-2.2 4.6-4.7zm4-13.4v14.6c0 4.1-3.4 7.4-7.4 7.4H9.2c-.5 0-.8.6-.5 1 .9 1 2.2 1.6 3.7 1.6h12.1c5.2 0 9.3-4.2 9.3-9.3V12.5c0-1.5-.6-2.8-1.6-3.7-.3-.4-.9 0-.9.5z'/%3E%3C/svg%3E\");align-items:center;border:none;box-shadow:none;box-sizing:border-box;display:flex;flex-wrap:wrap;justify-content:center;margin:0;min-width:50px;outline:none;position:relative;width:100%}:host *{box-sizing:border-box}:host(.keyboard-nav.has-focus){outline:none}:host(.keyboard-nav.has-focus):before{background-color:rgba(0,0,0,.25);border-radius:6px;content:\"\";display:block;height:100%;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:100%;z-index:1}:host(.keyboard-nav.has-focus):after{background-color:#222;border-radius:6px;box-shadow:0 0 0 2px #4169e1,0 0 0 3px #fff,0 .6px .4px rgba(0,0,0,.042),0 1.3px 1px rgba(0,0,0,.061),0 2.5px 1.9px rgba(0,0,0,.075),0 4.5px 3.4px rgba(0,0,0,.089),0 8.4px 6.3px rgba(0,0,0,.108),0 20px 15px rgba(0,0,0,.15);color:#fff;content:\"Shift + arrow keys to navigate posts\";font-family:sans-serif;font-size:16px;max-width:80%;padding:15px;position:absolute;text-align:center;z-index:1}@media (max-width:1300px){:host(.keyboard-nav.has-focus):after{font-size:15px}}:host(.keyboard-nav.has-focus) .posts{opacity:.65}.posts{display:grid;margin:0;padding:0;width:100%}.post{-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;align-self:stretch;border:none;border-radius:var(--post-border-radius);color:inherit;font:inherit;isolation:isolate;line-height:normal;margin:0 0 -1px;overflow:hidden;transform:translateZ(0);transition:background .3s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:calc(100% + .5px)}:host(.keyboard-nav) .post.post:focus-within{box-shadow:0 0 0 1px #fff,0 0 0 3px #4169e1,0 0 0 4px #fff;z-index:1}:host(.is-previewing-loading-colors) .post *{opacity:0}.post.post--has-row-gap,.post.post--last-row{margin:0}.post:before{background-color:transparent;border-radius:var(--post-border-radius);content:\"\";height:100%;left:0;pointer-events:none;position:absolute;top:0;transition:all 2s cubic-bezier(.215,.61,.355,1);width:100%;z-index:2}@supports ((-webkit-backdrop-filter:blur(3px)) or (backdrop-filter:blur(3px))){[data-hover-effect*=blur i] .post:before{height:calc(100% - 1px);left:0;opacity:0;top:0;transition:all .6s cubic-bezier(.215,.61,.355,1);width:100%}}.post.post--hover-icon:after{background-image:var(--icon);background-position:50%;background-repeat:no-repeat;background-size:auto 100%;border-radius:var(--post-border-radius);content:\"\";height:12%;left:0;max-height:30px;min-height:20px;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%) scale(.75);transition:all .6s cubic-bezier(.215,.61,.355,1);width:100%;will-change:transform;z-index:3}@media (prefers-reduced-motion){.post.post--hover-icon:after{transition:none}}.post>a,.post>button,.post>div{background-color:transparent;border:0;box-shadow:none;color:inherit;display:block;font:inherit;height:100%;line-height:inherit;outline:none;padding:0;transition:opacity .3s ease;width:100%}.post a,.post button{cursor:pointer}behold-image-post{--icon:var(--icon-instagram)}behold-video-post{--icon:var(--icon-video)}behold-album-post{--icon:var(--icon-album)}.post-caption{align-items:center;background-color:var(--overlay-color);display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:15px;height:100%;justify-content:center;left:0;line-height:1.5;opacity:0;padding:15%;position:absolute;top:0;transition:opacity .4s ease;width:100%;z-index:2}.post:hover .post-caption,:host(:host(.keyboard-nav)) .post:focus-within .post-caption{opacity:1}.post--xlarge .post-caption{--lines:12;--innerScale:scale(0.98);padding:20%}.post--large .post-caption{--lines:9;--innerScale:scale(0.98)}.post--medium .post-caption{--lines:6;--innerScale:scale(0.97);font-size:14px}.post--small .post-caption{--lines:4;--innerScale:scale(0.95);font-size:13px;line-height:1.25}.post--xsmall .post-caption{--lines:3;--innerScale:scale(0.95);font-size:12px;line-height:1.25}.post-caption__inner{-webkit-line-clamp:var(--lines);-webkit-box-orient:vertical;color:#fff;display:-webkit-box;opacity:0;overflow:hidden;text-align:center;transform:var(--innerScale);transition:all .3s ease;white-space:pre-line;will-change:transform,opacity;word-break:none}@media (prefers-reduced-motion){.post-caption__inner{transform:none}}.post:hover .post-caption__inner,:host(.keyboard-nav) .post:focus-within .post-caption__inner{opacity:1;transform:none;transition:all .3s ease}:host(.keyboard-nav) .post:focus-within:before{background-color:var(--overlay-color);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) .post:focus-within:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=fade] .post:focus-within:before,[data-hover-effect=fade] .post:hover:before{background-color:var(--overlay-color);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) [data-hover-effect=fade] .post:focus-within:after,[data-hover-effect=fade] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within behold-image img,:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within behold-video video,[data-hover-effect=zoomFade] .post:hover behold-image img,[data-hover-effect=zoomFade] .post:hover behold-video video{transform:scale(1.05)}@media (prefers-reduced-motion){:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within behold-image img,:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within behold-video video,[data-hover-effect=zoomFade] .post:hover behold-image img,[data-hover-effect=zoomFade] .post:hover behold-video video{transform:none}}:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within:before,[data-hover-effect=zoomFade] .post:hover:before{background-color:var(--overlay-color);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) [data-hover-effect=zoomFade] .post:focus-within:after,[data-hover-effect=zoomFade] .post:hover:after{opacity:1;transform:translateY(-50%)}@supports not ((-webkit-backdrop-filter:blur(3px)) or (backdrop-filter:blur(3px))){:host(.keyboard-nav) [data-hover-effect=blur] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=blur] .post:focus-within behold-video,[data-hover-effect=blur] .post:hover behold-image,[data-hover-effect=blur] .post:hover behold-video{filter:brightness(97%) blur(3px);transition:all .6s cubic-bezier(.215,.61,.355,1)}}@supports ((-webkit-backdrop-filter:blur(3px)) or (backdrop-filter:blur(3px))){:host(.keyboard-nav) [data-hover-effect=blur] .post:focus-within:before,[data-hover-effect=blur] .post:hover:before{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background-color:rgba(0,0,0,.002);opacity:1}}:host(.keyboard-nav) [data-hover-effect=blur] .post:focus-within:after,[data-hover-effect=blur] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-video,[data-hover-effect=zoomBlur] .post:hover behold-image,[data-hover-effect=zoomBlur] .post:hover behold-video{transform:scale(1.05);transition:all .6s cubic-bezier(.215,.61,.355,1)}@media (prefers-reduced-motion){:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-video,[data-hover-effect=zoomBlur] .post:hover behold-image,[data-hover-effect=zoomBlur] .post:hover behold-video{transform:none}}@supports not ((-webkit-backdrop-filter:blur(3px)) or (backdrop-filter:blur(3px))){:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within behold-video,[data-hover-effect=zoomBlur] .post:hover behold-image,[data-hover-effect=zoomBlur] .post:hover behold-video{filter:brightness(97%) blur(3px)}}@supports ((-webkit-backdrop-filter:blur(3px)) or (backdrop-filter:blur(3px))){:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within:before,[data-hover-effect=zoomBlur] .post:hover:before{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background-color:rgba(0,0,0,.002);opacity:1}}:host(.keyboard-nav) [data-hover-effect=zoomBlur] .post:focus-within:after,[data-hover-effect=zoomBlur] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=toGreyscale] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=toGreyscale] .post:focus-within behold-video,[data-hover-effect=toGreyscale] .post:hover behold-image,[data-hover-effect=toGreyscale] .post:hover behold-video{filter:grayscale(100%);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) [data-hover-effect=toGreyscale] .post:focus-within:after,[data-hover-effect=toGreyscale] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=zoomToGreyscale] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=zoomToGreyscale] .post:focus-within behold-video,[data-hover-effect=zoomToGreyscale] .post:hover behold-image,[data-hover-effect=zoomToGreyscale] .post:hover behold-video{filter:grayscale(100%);transform:scale(1.05);transition:all .6s cubic-bezier(.215,.61,.355,1)}@media (prefers-reduced-motion){:host(.keyboard-nav) [data-hover-effect=zoomToGreyscale] .post:focus-within behold-image,:host(.keyboard-nav) [data-hover-effect=zoomToGreyscale] .post:focus-within behold-video,[data-hover-effect=zoomToGreyscale] .post:hover behold-image,[data-hover-effect=zoomToGreyscale] .post:hover behold-video{transform:none}}:host(.keyboard-nav) [data-hover-effect=zoomToGreyscale] .post:focus-within:after,[data-hover-effect=zoomToGreyscale] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post,[data-hover-effect=fromGreyscale] .post{filter:grayscale(100%)}:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post:focus,:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post:hover,[data-hover-effect=fromGreyscale] .post:focus,[data-hover-effect=fromGreyscale] .post:hover{filter:grayscale(0);transition:all .6s cubic-bezier(.215,.61,.355,1)}:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post:focus:after,:host(.keyboard-nav) [data-hover-effect=fromGreyscale] .post:hover:after,[data-hover-effect=fromGreyscale] .post:focus:after,[data-hover-effect=fromGreyscale] .post:hover:after{opacity:1;transform:translateY(-50%)}:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post,[data-hover-effect=zoomFromGreyscale] .post{filter:grayscale(100%)}:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover,[data-hover-effect=zoomFromGreyscale] .post:focus,[data-hover-effect=zoomFromGreyscale] .post:hover{filter:grayscale(0)}:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus behold-image,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus behold-video,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover behold-image,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover behold-video,[data-hover-effect=zoomFromGreyscale] .post:focus behold-image,[data-hover-effect=zoomFromGreyscale] .post:focus behold-video,[data-hover-effect=zoomFromGreyscale] .post:hover behold-image,[data-hover-effect=zoomFromGreyscale] .post:hover behold-video{opacity:.5;transform:scale(1.05);transition:all .6s cubic-bezier(.215,.61,.355,1)}@media (prefers-reduced-motion){:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus behold-image,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus behold-video,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover behold-image,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover behold-video,[data-hover-effect=zoomFromGreyscale] .post:focus behold-image,[data-hover-effect=zoomFromGreyscale] .post:focus behold-video,[data-hover-effect=zoomFromGreyscale] .post:hover behold-image,[data-hover-effect=zoomFromGreyscale] .post:hover behold-video{transform:none}}:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:focus:after,:host(.keyboard-nav) [data-hover-effect=zoomFromGreyscale] .post:hover:after,[data-hover-effect=zoomFromGreyscale] .post:focus:after,[data-hover-effect=zoomFromGreyscale] .post:hover:after{opacity:1;transform:translateY(-50%)}behold-image{display:block;height:0;overflow:hidden;padding:0 0 100%;position:relative;transition:all .6s cubic-bezier(.215,.61,.355,1);width:100%}behold-image img{border-radius:0;height:100%;left:0;-o-object-fit:cover;object-fit:cover;-o-object-position:center center;object-position:center center;opacity:0;position:absolute;top:0;transition:all .6s cubic-bezier(.215,.61,.355,1),opacity .6s ease;vertical-align:middle;width:100%;will-change:transform;z-index:1}@supports not ((-webkit-backdrop-filter:blur(3px)) or (backdrop-filter:blur(3px))){[data-hover-effect=blur] behold-image img,[data-hover-effect=zoomBlur] behold-image img{height:calc(100% + 6px);left:-3px;top:-3px;width:calc(100% + 6px)}}.post--reel behold-image img{-o-object-position:center 25%;object-position:center 25%}behold-image.is-loaded img{opacity:1}behold-video{display:block;height:0;overflow:hidden;padding:0 0 100%;position:relative;transition:all .6s cubic-bezier(.215,.61,.355,1);width:100%}behold-video video{height:100%;left:0;-o-object-fit:cover;object-fit:cover;-o-object-position:center center;object-position:center center;opacity:0;pointer-events:none;position:absolute;top:0;transition:all .6s cubic-bezier(.215,.61,.355,1),opacity .6s ease;vertical-align:middle;width:100%;will-change:transform}.post--reel behold-video video{-o-object-position:center 25%;object-position:center 25%}behold-video.is-loaded video{opacity:1}";export{k as A,f as B,g as I,l as R,w as V,y as a,u as b,d as g,z as s};
|