@admin-highlit/web-sdk 0.0.0-stage → 0.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/LICENSE +8 -0
- package/NOTICE +17 -0
- package/README.md +117 -2
- package/dist/chunks/activate-banner.facade-BxuEF7R4.js +1 -0
- package/dist/chunks/astonished-DWjAE_Ui.js +1 -0
- package/dist/chunks/banner.view-Bi95J_KM.js +95 -0
- package/dist/chunks/blush-BLongC-7.js +1 -0
- package/dist/chunks/clap-CbaE59gk.js +1 -0
- package/dist/chunks/confetti-DtRbyKIF.js +1 -0
- package/dist/chunks/cover-loader.view-DrbnwnL2.js +1 -0
- package/dist/chunks/cover-scene.view-Dvb1B30Q.js +7 -0
- package/dist/chunks/cry-C0PCH3iy.js +1 -0
- package/dist/chunks/exploding-head-Brtj2e9w.js +1 -0
- package/dist/chunks/extras.facade-CxAEdzIq.js +1 -0
- package/dist/chunks/fire-ClpzuxLG.js +1 -0
- package/dist/chunks/grimacing-tlnKCEK5.js +1 -0
- package/dist/chunks/heart-C40aXMPt.js +1 -0
- package/dist/chunks/heart-eyes-DclZxFsJ.js +1 -0
- package/dist/chunks/heart-hands-CuquXiSP.js +1 -0
- package/dist/chunks/hundred-__POba_3.js +1 -0
- package/dist/chunks/index-CgpZJ9F1.js +20 -0
- package/dist/chunks/interactions-CuKVTm2-.js +1 -0
- package/dist/chunks/joy-CxXSvmb4.js +1 -0
- package/dist/chunks/live-runtime.facade-BcNbq_AT.js +1 -0
- package/dist/chunks/muscle-CVxbTlKP.js +1 -0
- package/dist/chunks/party-BKRjljRG.js +1 -0
- package/dist/chunks/partying-CDN5dHQ_.js +1 -0
- package/dist/chunks/playback-LHHueU9L.js +1 -0
- package/dist/chunks/playback.model-B3GGnQl1.js +1 -0
- package/dist/chunks/player-intent.model-DYNpcx0-.js +1 -0
- package/dist/chunks/player-runtime.facade-DSr_xgud.js +1 -0
- package/dist/chunks/player.view-CcU9MlBb.js +202 -0
- package/dist/chunks/pleading-BXYTcBme.js +1 -0
- package/dist/chunks/rage-B_bPm3xU.js +1 -0
- package/dist/chunks/raised-hands-cjht_WgS.js +1 -0
- package/dist/chunks/rofl-DhFudVS8.js +1 -0
- package/dist/chunks/scene.model-D4YsQd4q.js +1 -0
- package/dist/chunks/scene.view-CNMs6pLN.js +598 -0
- package/dist/chunks/sleeping-B-fw70UQ.js +1 -0
- package/dist/chunks/smiling-hearts-Cag9nkNL.js +1 -0
- package/dist/chunks/smirk-B_vPoQtF.js +1 -0
- package/dist/chunks/sparkles-CPawB-gv.js +1 -0
- package/dist/chunks/star-struck-CkXEUyJ8.js +1 -0
- package/dist/chunks/story-rail.view-A9dFtvyv.js +87 -0
- package/dist/chunks/sunglasses-CrEQeWEm.js +1 -0
- package/dist/chunks/sweat-smile-CEvqKKSO.js +1 -0
- package/dist/chunks/thinking-CChn6QQp.js +1 -0
- package/dist/chunks/thumbs-down-gYSCnsk2.js +1 -0
- package/dist/chunks/thumbs-up-DDWDsBzf.js +1 -0
- package/dist/chunks/tracking-runtime.facade-BYxLLTv0.js +1 -0
- package/dist/chunks/updatable-view.model-4968zd29.js +1 -0
- package/dist/index.d.ts +189 -0
- package/dist/index.js +1 -0
- package/package.json +68 -4
|
@@ -0,0 +1,598 @@
|
|
|
1
|
+
import{LitElement as e,unsafeCSS as t,html as i,nothing as n}from"lit";import{repeat as s}from"lit/directives/repeat.js";import{styleMap as o}from"lit/directives/style-map.js";import{M as r,k as a}from"./index-CgpZJ9F1.js";import{c as l,r as d,t as c,a as p,n as h,q as u,M as f}from"./updatable-view.model-4968zd29.js";const g={x:0,y:0,rotate:0,opacity:1},m=e=>{if("none"===e.type)return null;const t=e.durationMs??500,i=e.delayMs??0;if(t<=0)return null;const n="bounce"===e.type?"cubic-bezier(0.34, 1.56, 0.64, 1)":"cubic-bezier(0.22, 1, 0.36, 1)",s=(e=>{if("fade"===e.type){const t=e.direction??"up",i={rotate:0,opacity:0};return"up"===t?{x:0,y:24,...i}:"down"===t?{x:0,y:-24,...i}:"left"===t?{x:24,y:0,...i}:{x:-24,y:0,...i}}return"rotate"===e.type?{x:0,y:0,opacity:1,rotate:"left"===e.direction?-90:90}:{x:0,y:32,rotate:0,opacity:1}})(e),o=i+t,r=i/o;if(0===i)return{type:e.type,totalMs:o,keyframes:[{offset:0,pose:s,easing:n},{offset:1,pose:g}]};const a="fade"===e.type?s:g,l="fade"===e.type?[{offset:0,pose:a},{offset:r,pose:s,easing:n},{offset:1,pose:g}]:[{offset:0,pose:g},{offset:r,pose:g},{offset:r,pose:s,easing:n},{offset:1,pose:g}];return{type:e.type,totalMs:o,keyframes:l}},b=(e,t)=>e.filter(e=>((e,t)=>e.frame.visible&&t>=e.frame.startS&&t<e.frame.endS)(e,t)).sort((e,t)=>e.frame.layerOrder-t.frame.layerOrder),v=(e,t)=>{const i=e.trim();if(!/^#[0-9a-fA-F]{6}$/.test(i))return e;const n=e=>Number.parseInt(i.slice(e,e+2),16);return`rgba(${String(n(1))},${String(n(3))},${String(n(5))},${String(t)})`},y={sm:.85,md:1,lg:1.15},x=e=>"aborted"!==e,w=e=>"number"!=typeof e||!Number.isFinite(e)||e<0?0:e,$=(e,t,i)=>{const n=Math.max(0,w(e)),s=w(t),o=w(i);return s>n?o>0?Math.min(s,o):s:o>n?o:n+.05},k={muted:!1,unlocked:!1},S=e=>e.unlocked?e:{...e,unlocked:!0},C=e=>({muted:!e.muted,unlocked:!0}),j=(e,t)=>e.muted||t&&!e.unlocked,I=e=>e.muted,E=(e,t)=>{e.dispatchEvent(new CustomEvent("hl-interactive-answer",{detail:t,bubbles:!0,composed:!0}))},P=(e,t)=>{e.dispatchEvent(new CustomEvent("hl-interactive-retry",{detail:t,bubbles:!0,composed:!0}))},M=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),z=e=>{if(!(e instanceof CustomEvent))return null;const t=e.detail;return M(t)?t:null},q=e=>{const t=z(e);if(null===t)return null;const{elementId:i,response:n}=t;if("string"!=typeof i||!M(n))return null;const{kind:s,optionId:o,text:r,value:a,reactionIds:l}=n;return"poll_vote"===s&&"string"==typeof o?{elementId:i,response:{kind:"poll_vote",optionId:o}}:"quiz_answer"===s&&"string"==typeof o?{elementId:i,response:{kind:"quiz_answer",optionId:o}}:"emoji_slider"===s&&"number"==typeof a?{elementId:i,response:{kind:"emoji_slider",value:a}}:"emoji_reactions"===s&&Array.isArray(l)&&l.every(e=>"string"==typeof e)?{elementId:i,response:{kind:"emoji_reactions",reactionIds:l}}:"question_submit"===s&&"string"==typeof r?{elementId:i,response:{kind:"question_submit",text:r}}:null},T=e=>{const t=z(e);return null!==t&&"string"==typeof t.elementId?{elementId:t.elementId}:null},B=(e,t)=>{e.dispatchEvent(new CustomEvent("hl-interactive-focus",{detail:{active:t},bubbles:!0,composed:!0}))},L=e=>{const t=z(e);return null!==t&&"boolean"==typeof t.active?{active:t.active}:null},R=":host{display:block;width:100%;height:100%}*,*:before,*:after{box-sizing:border-box}:focus-visible{outline:2px solid rgba(255,255,255,.85);outline-offset:2px}.countdown{display:flex;width:100%;height:100%;flex-direction:column;overflow:hidden}.countdown .title{flex:none;margin:0;overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap;font-weight:600}.countdown .units{display:flex;min-height:0;flex:1;align-items:center;justify-content:center}.unit{display:flex;min-width:0;flex:1;flex-direction:column;align-items:center;justify-content:center;max-height:100%}.unit b{font-weight:700;font-variant-numeric:tabular-nums}.unit small{font-weight:400;text-transform:uppercase}.colon{flex:none;align-self:flex-start;font-weight:700}.notify{display:block;margin:0 auto;padding:4px 8px;border:0;background:none;color:inherit;font:600 12px system-ui,sans-serif;text-decoration:underline;cursor:pointer}.promo{display:flex;width:100%;height:100%;align-items:center;justify-content:space-between;overflow:hidden;border-style:dashed;text-align:start;cursor:pointer;font:inherit}.promo .code{min-width:0;flex:1;overflow:hidden;font-family:ui-monospace,Menlo,Consolas,monospace;font-weight:700;text-overflow:ellipsis;white-space:nowrap}.promo .end{display:flex;flex:none;align-items:center}.promo .divider{width:0;height:100%;border-inline-start:1px dashed currentColor;opacity:.25}.promo svg{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.promo .status{overflow:hidden;font-weight:500;transition:max-width .2s,opacity .2s}@media(prefers-reduced-motion:reduce){.promo .status{transition:none}}.choice{display:flex;width:100%;height:100%;flex-direction:column;overflow:hidden}.choice .question{flex:none;margin:0;overflow-wrap:anywhere;font-weight:600}.choice[data-quiz=true] .question{font-weight:500}.choice .options{display:flex;min-height:0;flex:1;flex-direction:column}.choice .options[data-side=true]{flex:none;flex-direction:row;align-items:stretch;overflow:hidden;min-height:0;transition:height .38s cubic-bezier(.22,1,.36,1)}.option{position:relative;display:flex;min-width:0;min-height:44px;flex:1;align-items:center;overflow:hidden;border:0;font:inherit;text-align:start;transition:box-shadow .2s ease,transform .12s ease,flex-grow .38s cubic-bezier(.22,1,.36,1)}.option[aria-disabled=false]:active{transform:scale(.97)}.options[data-side=true] .option{justify-content:center;min-height:0;font-weight:700;letter-spacing:-.15px;transition:flex-grow .38s cubic-bezier(.22,1,.36,1),background-color .18s ease,transform .12s ease}.options[data-side=true] .label{flex:none;overflow:hidden;font-weight:700;text-overflow:ellipsis;white-space:nowrap}.options[data-side=true] .divider{width:1px;flex:none;align-self:center;height:42%}.option .fill{position:absolute;inset-block:0;inset-inline-start:0;pointer-events:none;transition:width .38s cubic-bezier(.22,1,.36,1)}.option .label{position:relative;min-width:0;flex:1;overflow-wrap:anywhere}.option .percent{position:relative;flex:none;font-weight:700;font-variant-numeric:tabular-nums}.option .badge{position:relative;display:inline-flex;flex:none;align-items:center;justify-content:center;border-radius:50%;font-weight:500}.choice .retry{flex:none;align-self:flex-start;min-height:32px;padding:4px 0;border:0;background:transparent;font:inherit;text-decoration:underline;cursor:pointer}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media(prefers-reduced-motion:reduce){.option,.option .fill,.options[data-side=true]{transition:none}}.question-card{display:flex;width:100%;height:100%;flex-direction:column;justify-content:center;overflow:hidden;box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a}.question-card .question{flex:none;margin:0;overflow-wrap:anywhere;font-weight:600}.question-card .row{display:flex;min-width:0;align-items:center}.question-card .field{min-width:0;min-height:44px;flex:1;font:inherit}.question-card .field:disabled{opacity:.7}.question-card .field::placeholder{color:currentcolor;opacity:.55}.question-card .send{flex:none;min-height:44px;font:inherit;font-weight:500;cursor:pointer}.question-card .send:disabled{opacity:.5;cursor:default}.question-card .sent{margin:0;overflow-wrap:anywhere;opacity:.85}.question-card .retry{align-self:flex-start}.slider-card{display:flex;width:100%;height:100%;flex-direction:column;overflow:hidden}.slider-card .question{flex:none;margin:0;overflow-wrap:anywhere}.slider-card .track{position:relative;width:100%;flex:none;cursor:grab;touch-action:none}.slider-card .track[aria-disabled=true]{cursor:default}.slider-card .track[data-dragging=true]{cursor:grabbing}.slider-card .rail,.slider-card .fill{position:absolute;inset-inline-start:0;top:50%;transform:translateY(-50%);border-radius:999px}.slider-card .rail{inset-inline-end:0}.slider-card .thumb{position:absolute;top:50%;transform:translateY(-50%);pointer-events:none;filter:drop-shadow(0 2px 2px rgba(0,0,0,.06)) drop-shadow(0 4px 3px rgba(0,0,0,.07))}.slider-card .retry{margin-top:8px;align-self:flex-start;min-height:32px;padding:4px 0;border:0;background:transparent;font:inherit;text-decoration:underline;cursor:pointer}.reactions-card{display:flex;width:100%;height:100%;flex-direction:column;overflow:hidden}.reactions-card .question{flex:none;margin:0;font-weight:600}.reactions-card .centered{text-align:center}.reaction-row{display:flex;min-height:0;width:100%;flex:1}.reaction-cell{display:flex;min-width:0;height:100%;flex:1;align-items:center;justify-content:center;container-type:size}.reaction{display:flex;width:min(100cqw,100cqh);height:min(100cqw,100cqh);min-width:32px;min-height:32px;flex:none;flex-direction:column;align-items:center;justify-content:center;padding:0;border:0;border-radius:50%;font:inherit;container-type:size;transition:transform .2s ease,box-shadow .2s ease}.reaction img{pointer-events:none}.reaction .count{margin-top:4cqmin;font-size:22cqmin;line-height:1;pointer-events:none}.reactions-card .retry{margin-top:4px;align-self:flex-start;border:0;background:transparent;font:inherit;text-decoration:underline;cursor:pointer}@media(prefers-reduced-motion:reduce){.reaction{transition:none}}",H="hl-choice",A="#ef4444",U=(e,t)=>{const i=e.trim().replace("#","");if(!/^[0-9a-fA-F]{6}$/.test(i))return e;const n=e=>Number.parseInt(i.slice(e,e+2),16),s=e=>Math.round(e+(255-e)*t).toString(16).padStart(2,"0");return`#${s(n(0))}${s(n(2))}${s(n(4))}`};class D extends e{constructor(){super(...arguments),this.content=null,this.interaction=void 0,this.answerable=!1}static{this.properties={content:{attribute:!1},interaction:{attribute:!1},answerable:{type:Boolean}}}static{this.styles=t(R)}#e(e,t,i){if(i.stopPropagation(),"open"!==e.mode&&"failed"!==e.mode)return;const n=this.content?.kind;void 0!==n&&E(this,{elementId:this.dataset.elementId??"",response:"poll"===n?{kind:"poll_vote",optionId:String(t)}:{kind:"quiz_answer",optionId:String(t)}})}#t(e){e.stopPropagation(),P(this,{elementId:this.dataset.elementId??""})}#i(e,t){if("failed"===t.mode)return r.answerFailed;if("answered"!==t.mode||null===t.selected)return"";const i=e.options[t.selected]??"";return"poll"===e.kind?r.voted(i):!0===t.selectedCorrect?r.correct(i):!1===t.selectedCorrect?r.incorrect(i):r.answered(i)}render(){const e=this.content;if(null===e)return i``;const t=l(e.options.length,this.interaction,this.answerable),s=y[e.size],a=e=>`${String(Math.round(e*s))}px`,d="light"===e.preset,c="quiz"===e.kind,p=d?"#18181b":e.textColor,h=d?"#ffffff":e.backgroundColor,u=d?"#e4e4e7":c?"#3f3f46":"transparent",f=d?c?"#fafafa":"#f4f4f5":c?"#1f2228":v("#ffffff",.1),g="answered"===t.mode,m=g&&e.showResultPercentage&&null!==t.percentages,b="open"===t.mode||"failed"===t.mode,x="poll"===e.kind&&"side-by-side"===e.layout,w=`q-${this.dataset.elementId??""}`,$=(s,l)=>{const h=t.selected===l,u=t.percentages?.[l]??0,v=t.correct.includes(l),y=g&&c&&e.markCorrectAnswer&&v,w=g&&c&&h&&!1===t.selectedCorrect,$=l===e.options.length-1,k=x&&m;let S;!h||c||x||(S=`inset 0 0 0 1.5px ${e.accentColor}`),y&&(S=`inset 0 0 0 1px ${e.accentColor}`),w?S=`inset 0 0 0 1px ${A}`:c&&h&&!0===t.selectedCorrect&&(S=`inset 0 0 0 1px ${e.accentColor}`);const C=y?r.correctOption:w?r.incorrectOption:"",j=a(0===l||$||!k?18:8);return i`<button
|
|
2
|
+
type="button"
|
|
3
|
+
role="radio"
|
|
4
|
+
class="option"
|
|
5
|
+
data-selected=${String(h)}
|
|
6
|
+
aria-checked=${String(h)}
|
|
7
|
+
aria-label=${""===C?s:`${s}, ${C}`}
|
|
8
|
+
aria-disabled=${String(!b)}
|
|
9
|
+
style=${o({backgroundColor:x?k&&h?d?"#f2f3f5":U(e.backgroundColor,.14):"transparent":f,borderRadius:x?"0":a(10),padding:x?`0 ${j}`:`${a(c?10:12)} ${a(c?12:16)}`,gap:x?"0":a(c?12:8),boxShadow:S,color:p,outlineColor:e.accentColor,cursor:b?"pointer":"default",flexGrow:x&&m?String(u):"1",flexDirection:k?"column":"row",alignItems:x&&k?0===l?"flex-start":$?"flex-end":"center":"center",textAlign:x?k?$?"end":0===l?"start":"center":"center":"start"})}
|
|
10
|
+
@click=${e=>{this.#e(t,l,e)}}
|
|
11
|
+
>
|
|
12
|
+
${m&&!x?i`<span
|
|
13
|
+
class="fill"
|
|
14
|
+
aria-hidden="true"
|
|
15
|
+
style=${o({width:`${String(u)}%`,backgroundColor:c&&!v?"#71717a":e.accentColor,opacity:h?"0.35":"0.18"})}
|
|
16
|
+
></span>`:n}
|
|
17
|
+
${c?i`<span
|
|
18
|
+
class="badge"
|
|
19
|
+
aria-hidden="true"
|
|
20
|
+
style=${o({width:a(24),height:a(24),fontSize:a(10),backgroundColor:y?e.accentColor:w?A:d?"#e4e4e7":"#3f3f46",color:y||w?"#ffffff":p})}
|
|
21
|
+
>${y?"✓":w?"✕":"ABCDEFGHIJKLMNOPQRSTUVWXYZ"[l]??String(l+1)}</span
|
|
22
|
+
>`:n}
|
|
23
|
+
<span
|
|
24
|
+
class="label"
|
|
25
|
+
style=${o({fontSize:a(k?13:14),lineHeight:a(20),letterSpacing:x?"-0.15px":void 0})}
|
|
26
|
+
>${s}</span
|
|
27
|
+
>
|
|
28
|
+
${m?i`<span
|
|
29
|
+
class="percent"
|
|
30
|
+
style=${o({fontSize:a(x?18:12),lineHeight:a(20),marginTop:x?a(2):"0",color:x?d?"#18181b":"#fafafa":c?p:e.accentColor})}
|
|
31
|
+
>${String(u)}%</span
|
|
32
|
+
>`:n}
|
|
33
|
+
</button>`};return i`<div
|
|
34
|
+
class="choice"
|
|
35
|
+
data-quiz=${String(c)}
|
|
36
|
+
data-mode=${t.mode}
|
|
37
|
+
style=${o({backgroundColor:h,border:`1px solid ${u}`,borderRadius:a(12),padding:a(c?12:x?16:17),gap:a(12),color:p})}
|
|
38
|
+
>
|
|
39
|
+
<p
|
|
40
|
+
id=${w}
|
|
41
|
+
class="question"
|
|
42
|
+
style=${o({fontSize:a(14),lineHeight:a(20),fontWeight:c?void 0:d?"600":"500",letterSpacing:x?"-0.15px":void 0})}
|
|
43
|
+
>
|
|
44
|
+
${e.question}
|
|
45
|
+
</p>
|
|
46
|
+
<div
|
|
47
|
+
class="options"
|
|
48
|
+
role="radiogroup"
|
|
49
|
+
aria-labelledby=${w}
|
|
50
|
+
data-side=${String(x)}
|
|
51
|
+
style=${o(x?{gap:"0",height:a(m?58:48),borderRadius:a(16),backgroundColor:d?"#ffffff":e.backgroundColor,border:`1px solid ${d?"#ececee":U(e.backgroundColor,.12)}`}:{gap:a(8)})}
|
|
52
|
+
>
|
|
53
|
+
${e.options.map((t,s)=>i`
|
|
54
|
+
${x&&s>0&&!m?i`<span
|
|
55
|
+
class="divider"
|
|
56
|
+
aria-hidden="true"
|
|
57
|
+
style=${o({backgroundColor:d?"#d4d4d8":U(e.backgroundColor,.24)})}
|
|
58
|
+
></span>`:n}
|
|
59
|
+
${$(t,s)}
|
|
60
|
+
`)}
|
|
61
|
+
</div>
|
|
62
|
+
${"failed"===t.mode?i`<button
|
|
63
|
+
type="button"
|
|
64
|
+
class="retry"
|
|
65
|
+
style=${o({fontSize:a(12),color:p})}
|
|
66
|
+
@click=${e=>{this.#t(e)}}
|
|
67
|
+
>
|
|
68
|
+
${r.answerFailed} ${r.retry}
|
|
69
|
+
</button>`:n}
|
|
70
|
+
<span class="sr-only" aria-live="polite">${this.#i(e,t)}</span>
|
|
71
|
+
</div>`}}const F=/* @__PURE__ */Object.assign({"../../../assets/emoji/astonished.png":()=>import("./astonished-DWjAE_Ui.js").then(e=>e.default),"../../../assets/emoji/blush.png":()=>import("./blush-BLongC-7.js").then(e=>e.default),"../../../assets/emoji/clap.png":()=>import("./clap-CbaE59gk.js").then(e=>e.default),"../../../assets/emoji/confetti.png":()=>import("./confetti-DtRbyKIF.js").then(e=>e.default),"../../../assets/emoji/cry.png":()=>import("./cry-C0PCH3iy.js").then(e=>e.default),"../../../assets/emoji/exploding-head.png":()=>import("./exploding-head-Brtj2e9w.js").then(e=>e.default),"../../../assets/emoji/fire.png":()=>import("./fire-ClpzuxLG.js").then(e=>e.default),"../../../assets/emoji/grimacing.png":()=>import("./grimacing-tlnKCEK5.js").then(e=>e.default),"../../../assets/emoji/heart-eyes.png":()=>import("./heart-eyes-DclZxFsJ.js").then(e=>e.default),"../../../assets/emoji/heart-hands.png":()=>import("./heart-hands-CuquXiSP.js").then(e=>e.default),"../../../assets/emoji/heart.png":()=>import("./heart-C40aXMPt.js").then(e=>e.default),"../../../assets/emoji/hundred.png":()=>import("./hundred-__POba_3.js").then(e=>e.default),"../../../assets/emoji/joy.png":()=>import("./joy-CxXSvmb4.js").then(e=>e.default),"../../../assets/emoji/muscle.png":()=>import("./muscle-CVxbTlKP.js").then(e=>e.default),"../../../assets/emoji/party.png":()=>import("./party-BKRjljRG.js").then(e=>e.default),"../../../assets/emoji/partying.png":()=>import("./partying-CDN5dHQ_.js").then(e=>e.default),"../../../assets/emoji/pleading.png":()=>import("./pleading-BXYTcBme.js").then(e=>e.default),"../../../assets/emoji/rage.png":()=>import("./rage-B_bPm3xU.js").then(e=>e.default),"../../../assets/emoji/raised-hands.png":()=>import("./raised-hands-cjht_WgS.js").then(e=>e.default),"../../../assets/emoji/rofl.png":()=>import("./rofl-DhFudVS8.js").then(e=>e.default),"../../../assets/emoji/sleeping.png":()=>import("./sleeping-B-fw70UQ.js").then(e=>e.default),"../../../assets/emoji/smiling-hearts.png":()=>import("./smiling-hearts-Cag9nkNL.js").then(e=>e.default),"../../../assets/emoji/smirk.png":()=>import("./smirk-B_vPoQtF.js").then(e=>e.default),"../../../assets/emoji/sparkles.png":()=>import("./sparkles-CPawB-gv.js").then(e=>e.default),"../../../assets/emoji/star-struck.png":()=>import("./star-struck-CkXEUyJ8.js").then(e=>e.default),"../../../assets/emoji/sunglasses.png":()=>import("./sunglasses-CrEQeWEm.js").then(e=>e.default),"../../../assets/emoji/sweat-smile.png":()=>import("./sweat-smile-CEvqKKSO.js").then(e=>e.default),"../../../assets/emoji/thinking.png":()=>import("./thinking-CChn6QQp.js").then(e=>e.default),"../../../assets/emoji/thumbs-down.png":()=>import("./thumbs-down-gYSCnsk2.js").then(e=>e.default),"../../../assets/emoji/thumbs-up.png":()=>import("./thumbs-up-DDWDsBzf.js").then(e=>e.default)}),_=/* @__PURE__ */new Map,O=e=>{const t=_.get(e);if(void 0!==t)return t;const i=F[`../../../assets/emoji/${e}.png`],n=void 0===i?Promise.resolve(null):i().catch(()=>null);return _.set(e,n),n},W=e=>e.replace(/-/g," ");class N{#n;#s=/* @__PURE__ */new Map;#o=/* @__PURE__ */new Set;constructor(e){this.#n=e}want(e){for(const t of e)this.#o.has(t)||(this.#o.add(t),O(t).then(e=>{null!==e&&(this.#s.set(t,e),this.#n.requestUpdate())}))}url(e){return this.#s.get(e)}}const V="hl-emoji-reactions";class Y extends e{constructor(){super(...arguments),this.content=null,this.interaction=void 0,this.answerable=!1,this.#r=new N(this)}static{this.properties={content:{attribute:!1},interaction:{attribute:!1},answerable:{type:Boolean}}}static{this.styles=t(R)}#r;willUpdate(e){e.has("content")&&null!==this.content&&this.#r.want(this.content.emojis)}render(){const e=this.content;if(null===e)return i``;const t=d(this.interaction,this.answerable,e.emojis),s="open"===t.mode||"failed"===t.mode,a=y[e.size],l=e=>`${String(Math.round(e*a))}px`,p="light"===e.preset,h=p?"#18181b":e.textColor,u=""!==e.question.trim(),f=e.showReactionCount&&null!==t.counts,g=`q-${this.dataset.elementId??""}`;return i`<div
|
|
72
|
+
class="reactions-card"
|
|
73
|
+
data-mode=${t.mode}
|
|
74
|
+
style=${o({backgroundColor:p?"#ffffff":e.backgroundColor,borderRadius:l(12),padding:l(16),boxShadow:"inset 0 0 0 1px "+(p?"#e4e4e7":"#3f3f46"),color:h})}
|
|
75
|
+
>
|
|
76
|
+
${u?i`<p
|
|
77
|
+
id=${g}
|
|
78
|
+
class="question centered"
|
|
79
|
+
style=${o({fontSize:l(14),lineHeight:l(20)})}
|
|
80
|
+
>
|
|
81
|
+
${e.question}
|
|
82
|
+
</p>`:n}
|
|
83
|
+
<div
|
|
84
|
+
class="reaction-row"
|
|
85
|
+
role="group"
|
|
86
|
+
aria-labelledby=${u?g:n}
|
|
87
|
+
aria-label=${u?n:r.reactions}
|
|
88
|
+
style=${o({gap:l(8),paddingTop:u?l(12):"0"})}
|
|
89
|
+
>
|
|
90
|
+
${e.emojis.map(a=>{const l=t.selected.includes(a),d=this.#r.url(a),u=t.counts?.get(a)??0;return i`<div class="reaction-cell">
|
|
91
|
+
<button
|
|
92
|
+
type="button"
|
|
93
|
+
class="reaction"
|
|
94
|
+
aria-pressed=${String(l)}
|
|
95
|
+
aria-label=${f?r.reactionCount(W(a),u):W(a)}
|
|
96
|
+
aria-disabled=${String(!s)}
|
|
97
|
+
data-on=${String(l)}
|
|
98
|
+
style=${o({backgroundColor:p?"#f4f4f5":"#27272a",boxShadow:l?`inset 0 0 0 1.5px ${h}`:void 0,transform:l&&s?"scale(1.06)":void 0,color:p?"#71717a":"#a1a1aa",cursor:s?"pointer":"default"})}
|
|
99
|
+
@pointerdown=${e=>{e.stopPropagation()}}
|
|
100
|
+
@click=${i=>{i.stopPropagation(),s&&E(this,{elementId:this.dataset.elementId??"",response:{kind:"emoji_reactions",reactionIds:c(t.selected,a,e.allowMultiple)}})}}
|
|
101
|
+
>
|
|
102
|
+
${void 0===d?n:i`<img
|
|
103
|
+
src=${d}
|
|
104
|
+
alt=""
|
|
105
|
+
draggable="false"
|
|
106
|
+
style=${o({width:f?"42cqmin":"46cqmin",height:f?"42cqmin":"46cqmin"})}
|
|
107
|
+
/>`}
|
|
108
|
+
${f?i`<span class="count" aria-hidden="true">${String(u)}</span>`:n}
|
|
109
|
+
</button>
|
|
110
|
+
</div>`})}
|
|
111
|
+
</div>
|
|
112
|
+
${"failed"===t.mode?i`<button
|
|
113
|
+
type="button"
|
|
114
|
+
class="retry"
|
|
115
|
+
style=${o({fontSize:l(12),color:h})}
|
|
116
|
+
@click=${e=>{e.stopPropagation(),P(this,{elementId:this.dataset.elementId??""})}}
|
|
117
|
+
>
|
|
118
|
+
${r.answerFailed} ${r.retry}
|
|
119
|
+
</button>`:n}
|
|
120
|
+
</div>`}}const X="hl-emoji-slider",G=.05,K=e=>Math.min(1,Math.max(0,e));class J extends e{constructor(){super(...arguments),this.content=null,this.interaction=void 0,this.answerable=!1,this.drag=null,this.#r=new N(this),this.#a=null}static{this.properties={content:{attribute:!1},interaction:{attribute:!1},answerable:{type:Boolean},drag:{state:!0}}}static{this.styles=t(R)}#r;#a;connectedCallback(){super.connectedCallback();const e=this.getRootNode();this.#a=e instanceof ShadowRoot?e.host:null}disconnectedCallback(){null!==this.drag&&null!==this.#a&&B(this.#a,!1),this.drag=null,super.disconnectedCallback()}willUpdate(e){e.has("content")&&null!==this.content&&this.#r.want([this.content.emoji])}#l(e){E(this,{elementId:this.dataset.elementId??"",response:{kind:"emoji_slider",value:Math.round(100*K(e))}})}#d(e,t){const i=e.getBoundingClientRect();if(i.width<=0)return 0;const n=K((t-i.left)/i.width);return this.#c?1-n:n}get#c(){return"rtl"===getComputedStyle(this).direction}#p(e,t){t&&e.currentTarget instanceof HTMLElement&&(e.stopPropagation(),e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),this.drag=this.#d(e.currentTarget,e.clientX),B(this,!0))}#h(e){null!==this.drag&&e.currentTarget instanceof HTMLElement&&(e.stopPropagation(),this.drag=this.#d(e.currentTarget,e.clientX))}#u(e){if(null===this.drag||!(e.currentTarget instanceof HTMLElement))return;e.stopPropagation();const t=this.#d(e.currentTarget,e.clientX);this.drag=null,this.#l(t),B(this,!1)}#f(){null!==this.drag&&(this.drag=null,B(this,!1))}#g(e,t,i){if(!i)return;let n=null;"ArrowRight"===e.key||"ArrowLeft"===e.key?n=t+("ArrowRight"===e.key!==this.#c?G:-.05):"ArrowUp"===e.key?n=t+G:"ArrowDown"===e.key?n=t-G:"Home"===e.key?n=0:"End"===e.key&&(n=1),null!==n&&(e.preventDefault(),e.stopPropagation(),this.#l(n))}render(){const e=this.content;if(null===e)return i``;const t=p(this.interaction,this.answerable,e.value),s=K(this.drag??t.fraction),a="open"===t.mode||"failed"===t.mode,l=y[e.size],d=e=>`${String(Math.round(e*l))}px`,c="light"===e.preset,h=Math.round(100*s),u=this.#r.url(e.emoji),f=Math.round(24*l);return i`<div
|
|
121
|
+
class="slider-card"
|
|
122
|
+
data-mode=${t.mode}
|
|
123
|
+
style=${o({backgroundColor:e.backgroundColor,border:"1px solid "+(c?"#e4e4e7":"#3f3f46"),borderRadius:d(12),padding:d(16),color:e.textColor})}
|
|
124
|
+
>
|
|
125
|
+
<p class="question" style=${o({fontSize:d(14),lineHeight:d(20)})}>
|
|
126
|
+
${e.question}
|
|
127
|
+
</p>
|
|
128
|
+
<div
|
|
129
|
+
class="track"
|
|
130
|
+
role="slider"
|
|
131
|
+
aria-label=${e.question}
|
|
132
|
+
aria-valuemin="0"
|
|
133
|
+
aria-valuemax="100"
|
|
134
|
+
aria-valuenow=${String(h)}
|
|
135
|
+
aria-valuetext=${`${String(h)}%`}
|
|
136
|
+
aria-disabled=${String(!a)}
|
|
137
|
+
tabindex=${a?"0":"-1"}
|
|
138
|
+
data-dragging=${String(null!==this.drag)}
|
|
139
|
+
style=${o({height:`${String(f)}px`,marginTop:d(16)})}
|
|
140
|
+
@pointerdown=${e=>{this.#p(e,a)}}
|
|
141
|
+
@pointermove=${e=>{this.#h(e)}}
|
|
142
|
+
@pointerup=${e=>{this.#u(e)}}
|
|
143
|
+
@pointercancel=${()=>{this.#f()}}
|
|
144
|
+
@click=${e=>{e.stopPropagation()}}
|
|
145
|
+
@keydown=${e=>{this.#g(e,s,a)}}
|
|
146
|
+
>
|
|
147
|
+
<span
|
|
148
|
+
class="rail"
|
|
149
|
+
style=${o({height:d(8),backgroundColor:c?"#d1d9e0":"#21252b"})}
|
|
150
|
+
></span>
|
|
151
|
+
${s>0?i`<span
|
|
152
|
+
class="fill"
|
|
153
|
+
style=${o({height:d(8),width:`${String(100*s)}%`,background:`linear-gradient(to right, ${e.startColor}, ${e.endColor})`})}
|
|
154
|
+
></span>`:n}
|
|
155
|
+
${void 0===u?n:i`<img
|
|
156
|
+
class="thumb"
|
|
157
|
+
src=${u}
|
|
158
|
+
alt=""
|
|
159
|
+
draggable="false"
|
|
160
|
+
style=${o({width:`${String(f)}px`,height:`${String(f)}px`,insetInlineStart:`calc(${String(100*s)}% - ${String(f/2)}px)`})}
|
|
161
|
+
/>`}
|
|
162
|
+
</div>
|
|
163
|
+
${"failed"===t.mode?i`<button
|
|
164
|
+
type="button"
|
|
165
|
+
class="retry"
|
|
166
|
+
style=${o({fontSize:d(12),color:e.textColor})}
|
|
167
|
+
@click=${e=>{e.stopPropagation(),P(this,{elementId:this.dataset.elementId??""})}}
|
|
168
|
+
>
|
|
169
|
+
${r.answerFailed} ${r.retry}
|
|
170
|
+
</button>`:n}
|
|
171
|
+
</div>`}}const Q="hl-question",Z={light:{background:"rgba(255,255,255,0.8)",border:"#d4d4d8"},dark:{background:"rgba(63,63,70,0.5)",border:"#3f3f46"}};class ee extends e{constructor(){super(...arguments),this.content=null,this.interaction=void 0,this.answerable=!1,this.draft="",this.confirmation=!1,this.#m=!1,this.#a=null}static{this.properties={content:{attribute:!1},interaction:{attribute:!1},answerable:{type:Boolean},draft:{state:!0},confirmation:{state:!0}}}static{this.styles=t(R)}#m;#a;connectedCallback(){super.connectedCallback();const e=this.getRootNode();this.#a=e instanceof ShadowRoot?e.host:null}disconnectedCallback(){this.#m&&null!==this.#a&&B(this.#a,!1),this.#m=!1,super.disconnectedCallback()}willUpdate(e){if(!e.has("interaction"))return;const t=e.get("interaction"),i=this.interaction;"submitting"===t?.phase&&"ready"===i?.phase?(!0!==this.content?.allowOneResponse&&(this.draft=""),this.confirmation=!0):"submitting"===i?.phase&&(this.confirmation=!1)}#b(e){e.preventDefault(),e.stopPropagation();const t=h(this.draft);null!==t&&E(this,{elementId:this.dataset.elementId??"",response:{kind:"question_submit",text:t}})}#v(){this.#m=!0,B(this,!0)}#y(){this.#m=!1,B(this,!1)}render(){const e=this.content;if(null===e)return i``;const t=u(this.interaction,this.answerable),s=y[e.size],a=e=>`${String(Math.round(e*s))}px`,l=Z[e.preset??"dark"],d="answered"===t.mode,c=("open"===t.mode||"failed"===t.mode)&&null!==h(this.draft),p=`q-${this.dataset.elementId??""}`;return i`<form
|
|
172
|
+
class="question-card"
|
|
173
|
+
data-mode=${t.mode}
|
|
174
|
+
style=${o({backgroundColor:e.backgroundColor,borderRadius:a(16),padding:a(16),gap:a(12),color:e.textColor})}
|
|
175
|
+
@submit=${e=>{this.#b(e)}}
|
|
176
|
+
@keydown=${e=>{"Escape"!==e.key&&"Tab"!==e.key&&e.stopPropagation()}}
|
|
177
|
+
>
|
|
178
|
+
<p id=${p} class="question" style=${o({fontSize:a(14),lineHeight:a(20)})}>
|
|
179
|
+
${e.question}
|
|
180
|
+
</p>
|
|
181
|
+
${d?i`<p class="sent" style=${o({fontSize:a(12),lineHeight:a(16)})}>
|
|
182
|
+
${r.sentText(t.sentText??"")}
|
|
183
|
+
</p>`:i`<div class="row" style=${o({gap:a(8)})}>
|
|
184
|
+
<input
|
|
185
|
+
type="text"
|
|
186
|
+
class="field"
|
|
187
|
+
aria-labelledby=${p}
|
|
188
|
+
autocomplete="off"
|
|
189
|
+
maxlength=${String(f)}
|
|
190
|
+
placeholder=${e.placeholder}
|
|
191
|
+
.value=${this.draft}
|
|
192
|
+
?disabled=${"inert"===t.mode||"loading"===t.mode}
|
|
193
|
+
?readonly=${"saving"===t.mode}
|
|
194
|
+
style=${o({backgroundColor:l.background,border:`1px solid ${l.border}`,borderRadius:a(10),padding:`${a(9)} ${a(13)}`,color:e.textColor,fontSize:a(14),lineHeight:a(20),outlineColor:v(e.textColor,.6)})}
|
|
195
|
+
@input=${e=>{e.target instanceof HTMLInputElement&&(this.draft=e.target.value)}}
|
|
196
|
+
@focus=${()=>{this.#v()}}
|
|
197
|
+
@blur=${()=>{this.#y()}}
|
|
198
|
+
@pointerdown=${e=>{e.stopPropagation()}}
|
|
199
|
+
@click=${e=>{e.stopPropagation()}}
|
|
200
|
+
/>
|
|
201
|
+
<button
|
|
202
|
+
type="submit"
|
|
203
|
+
class="send"
|
|
204
|
+
?disabled=${!c}
|
|
205
|
+
style=${o({color:e.textColor,backgroundColor:l.background,border:`1px solid ${l.border}`,borderRadius:a(10),padding:`${a(8)} ${a(12)}`,fontSize:a(14),lineHeight:a(20)})}
|
|
206
|
+
@click=${e=>{e.stopPropagation()}}
|
|
207
|
+
>
|
|
208
|
+
${"saving"===t.mode?r.sending:r.send}
|
|
209
|
+
</button>
|
|
210
|
+
</div>`}
|
|
211
|
+
${"failed"===t.mode?i`<button
|
|
212
|
+
type="button"
|
|
213
|
+
class="retry"
|
|
214
|
+
style=${o({fontSize:a(12),color:e.textColor})}
|
|
215
|
+
@click=${e=>{e.stopPropagation(),P(this,{elementId:this.dataset.elementId??""})}}
|
|
216
|
+
>
|
|
217
|
+
${r.answerFailed} ${r.retry}
|
|
218
|
+
</button>`:n}
|
|
219
|
+
<span class="sr-only" aria-live="polite"
|
|
220
|
+
>${d||this.confirmation?r.responseSent:"failed"===t.mode?r.answerFailed:""}</span
|
|
221
|
+
>
|
|
222
|
+
</form>`}}const te=(e,t)=>{e.dispatchEvent(new CustomEvent("hl-cta-activate",{detail:t,bubbles:!0,composed:!0}))},ie=e=>{if(!(e instanceof CustomEvent))return null;const t=e.detail;if("object"!=typeof t||null===t)return null;const i=Object.fromEntries(Object.entries(t)),{elementId:n,trackingId:s,url:o,productId:r}=i;return"string"!=typeof n||"string"!=typeof s?null:{elementId:n,trackingId:s,url:"string"==typeof o?o:null,productId:"string"==typeof r?r:null}},ne="hl-countdown",se={days:"DAYS",hours:"HRS",minutes:"MIN",seconds:"SEC"};class oe extends e{constructor(){super(...arguments),this.content=null,this.active=!1,this.now=Date.now(),this.#x=null}static{this.properties={content:{attribute:!1},active:{type:Boolean},now:{state:!0}}}static{this.styles=t(R)}#x;connectedCallback(){super.connectedCallback(),this.now=Date.now()}disconnectedCallback(){this.#w(),super.disconnectedCallback()}updated(){this.active&&null===this.#x?(this.now=Date.now(),this.#x=setInterval(()=>{this.now=Date.now()},1e3)):this.active||this.#w()}#w(){null!==this.#x&&clearInterval(this.#x),this.#x=null}render(){const e=this.content;if(null===e)return i``;const t=((e,t)=>{const i=Date.parse(e),n=Number.isNaN(i)?0:Math.max(0,i-t),s=Math.floor(n/1e3);return{days:Math.floor(s/86400),hours:Math.floor(s%86400/3600),minutes:Math.floor(s%3600/60),seconds:s%60,expired:s<=0}})(e.endAt,this.now),s=y[e.size],a="light"===e.preset,l=a?"#18181b":e.textColor,d=v(l,.53),c=a?"#f4f4f5":v(e.backgroundColor,.8),p=(e=>e.expired||e.days>0?["days","hours","minutes","seconds"]:["hours","minutes","seconds"])(t),h=e=>`${String(Math.round(e*s))}px`,u=t.expired?`${e.title}. ${r.ended}.`:`${e.title}. ${String(t.days)} days, ${String(t.hours)} hours, ${String(t.minutes)} minutes, ${String(t.seconds)} seconds remaining.`;return i`<div
|
|
223
|
+
class="countdown"
|
|
224
|
+
role="timer"
|
|
225
|
+
aria-label=${u}
|
|
226
|
+
aria-live="off"
|
|
227
|
+
style=${o({backgroundColor:a?"#ffffff":e.backgroundColor,border:"1px solid "+(a?"#e4e4e7":"#3f3f46"),borderRadius:h(12),padding:h(17),gap:h(12),color:l})}
|
|
228
|
+
>
|
|
229
|
+
<p class="title" style=${o({fontSize:h(14),lineHeight:h(20)})}>
|
|
230
|
+
${t.expired?r.ended:e.title}
|
|
231
|
+
</p>
|
|
232
|
+
<div class="units" style=${o({gap:h(6)})}>
|
|
233
|
+
${p.map((e,s)=>{return i`<div
|
|
234
|
+
class="unit"
|
|
235
|
+
style=${o({backgroundColor:c,borderRadius:h(10),height:h(56)})}
|
|
236
|
+
>
|
|
237
|
+
<b style=${o({fontSize:h(20),lineHeight:h(28)})}
|
|
238
|
+
>${r=t.expired?0:t[e],String(Math.max(0,Math.floor(r))).padStart(2,"0")}</b
|
|
239
|
+
>
|
|
240
|
+
<small
|
|
241
|
+
style=${o({fontSize:h(8),lineHeight:h(12),letterSpacing:"0.4px",color:d})}
|
|
242
|
+
>${se[e]}</small
|
|
243
|
+
>
|
|
244
|
+
</div>
|
|
245
|
+
${s<p.length-1?i`<span
|
|
246
|
+
class="colon"
|
|
247
|
+
aria-hidden="true"
|
|
248
|
+
style=${o({fontSize:h(20),lineHeight:h(28),color:d,paddingBottom:h(12)})}
|
|
249
|
+
>:</span
|
|
250
|
+
>`:n}`;var r})}
|
|
251
|
+
</div>
|
|
252
|
+
${null===e.notificationUrl||t.expired?n:i`<button
|
|
253
|
+
type="button"
|
|
254
|
+
class="notify"
|
|
255
|
+
@click=${t=>{t.stopPropagation(),te(this,{elementId:this.dataset.elementId??"",trackingId:e.trackingId,url:e.notificationUrl,productId:null})}}
|
|
256
|
+
>
|
|
257
|
+
${r.notifyMe}
|
|
258
|
+
</button>`}
|
|
259
|
+
</div>`}}const re=e=>{if(!(e instanceof CustomEvent))return null;const t=e.detail;if("object"!=typeof t||null===t)return null;const{elementId:i,trackingId:n}=Object.fromEntries(Object.entries(t));return"string"==typeof i&&"string"==typeof n?{elementId:i,trackingId:n}:null},ae="hl-promocode";class le extends e{constructor(){super(...arguments),this.content=null,this.copied=!1,this.failed=!1,this.#x=null}static{this.properties={content:{attribute:!1},copied:{state:!0},failed:{state:!0}}}static{this.styles=t(R)}#x;disconnectedCallback(){null!==this.#x&&clearTimeout(this.#x),super.disconnectedCallback()}async#$(e){let t=!1;try{await navigator.clipboard.writeText(e.code.trim()),t=!0}catch{t=!1}const i=((e,t)=>""===e.trim()?"empty":t?"copied":"failed")(e.code,t);var n;this.failed="failed"===i,this.copied="copied"===i,"failed"===i&&this.#k(),"copied"===i&&(n={elementId:this.dataset.elementId??"",trackingId:e.trackingId},this.dispatchEvent(new CustomEvent("hl-promocode-copy",{detail:n,bubbles:!0,composed:!0}))),null!==this.#x&&clearTimeout(this.#x),this.#x=setTimeout(()=>{this.copied=!1,this.failed=!1},1500)}#k(){const e=this.renderRoot.querySelector(".code"),t=window.getSelection();if(null===e||null===t)return;const i=document.createRange();i.selectNodeContents(e),t.removeAllRanges(),t.addRange(i)}render(){const e=this.content;if(null===e)return i``;const t=y[e.size],n="light"===e.preset,s=n?"#18181b":e.textColor,a=e=>`${String(Math.round(e*t))}px`,l=this.copied?r.copied:this.failed?r.copyFailed:"";return i`<button
|
|
260
|
+
type="button"
|
|
261
|
+
class="promo"
|
|
262
|
+
aria-label=${this.copied?r.copied:r.copyCode(e.code)}
|
|
263
|
+
style=${o({backgroundColor:n?"#ffffff":e.backgroundColor,borderColor:s,borderWidth:`${String(Math.max(2,Math.round(2*t)))}px`,borderRadius:a(10),paddingInline:a(22),color:s})}
|
|
264
|
+
@click=${t=>{t.stopPropagation(),t.preventDefault(),this.#$(e)}}
|
|
265
|
+
>
|
|
266
|
+
<span
|
|
267
|
+
class="code"
|
|
268
|
+
style=${o({fontSize:a(16),lineHeight:a(24),letterSpacing:`${String(.8*t)}px`})}
|
|
269
|
+
>${e.code}</span
|
|
270
|
+
>
|
|
271
|
+
<span class="end" aria-hidden="true">
|
|
272
|
+
<span style=${o({height:a(32),paddingInline:a(12)})}
|
|
273
|
+
><span class="divider" style="display:block"></span
|
|
274
|
+
></span>
|
|
275
|
+
<svg viewBox="0 0 24 24" style=${o({width:a(16),height:a(16)})}>
|
|
276
|
+
${this.copied?i`<path d="M5 12l5 5 9-10" />`:i`<rect x="9" y="9" width="11" height="11" rx="2" /><path d="M5 15V6a2 2 0 0 1 2-2h9" />`}
|
|
277
|
+
</svg>
|
|
278
|
+
<span
|
|
279
|
+
class="status"
|
|
280
|
+
style=${o({fontSize:a(12),maxWidth:""===l?"0":"72px",marginInlineStart:""===l?"0":"4px",opacity:""===l?"0":"1"})}
|
|
281
|
+
>${l}</span
|
|
282
|
+
>
|
|
283
|
+
</span>
|
|
284
|
+
<span
|
|
285
|
+
class="status-live"
|
|
286
|
+
role="status"
|
|
287
|
+
style="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)"
|
|
288
|
+
>${l}</span
|
|
289
|
+
>
|
|
290
|
+
</button>`}}const de=':host{display:block;width:100%;height:100%}*,*:before,*:after{box-sizing:border-box}button,[role=button],[role=link]{font:inherit;cursor:pointer}:focus-visible{outline:2px solid rgba(255,255,255,.85);outline-offset:2px}[aria-disabled=true]{cursor:default}.press{transition:transform .1s,opacity .1s}.press[data-pressed=true]{transform:scale(.96)}.btn{display:flex;width:100%;height:100%;align-items:center;justify-content:center;padding:0 20px;overflow:hidden;line-height:1;text-overflow:ellipsis;white-space:nowrap}.link{display:flex;width:100%;height:100%;align-items:center;justify-content:center}.link span{overflow:hidden;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px;text-overflow:ellipsis;white-space:nowrap;transition:text-decoration-thickness .1s,filter .1s}.link[data-pressed=true] span{text-decoration-thickness:2px;filter:brightness(1.25)}.swipe{display:flex;width:100%;height:100%;flex-direction:column;align-items:center;justify-content:center;gap:4px;touch-action:none;user-select:none}.swipe svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .2s}.swipe[data-bouncing=true] svg{transform:translateY(-6px)}.swipe span{font-size:14px;line-height:1}.image-cta{display:flex;width:100%;height:100%;align-items:center;justify-content:center;overflow:hidden;border-style:solid}.image-cta img{width:100%;height:100%;object-fit:cover}.image-cta .placeholder{display:grid;width:100%;height:100%;place-items:center;background:#ffffffeb;color:#00000080;font:12px system-ui,sans-serif}.social{display:flex;width:100%;height:100%;flex-direction:column;overflow:hidden;border:1px solid rgba(0,0,0,.1);border-radius:12px;background:#fff;color:#000}.social .media{position:relative;flex:1;min-height:0;background:#e5e7eb}.social .media img,.social .media video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.social .badge{position:absolute;inset-block-start:8px;inset-inline-end:8px;padding:2px 8px;border-radius:999px;background:#0000008c;color:#fff;font:600 10px system-ui,sans-serif;text-transform:capitalize}.social .caption{display:-webkit-box;margin:0;padding:10px 12px;overflow:hidden;font:13px/18px system-ui,sans-serif;-webkit-box-orient:vertical;-webkit-line-clamp:2}.row{display:flex;width:100%;height:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;cursor:grab}.row::-webkit-scrollbar{display:none}:host([data-dragging="true"]) .row{cursor:grabbing;user-select:none}.row[data-kind=product-tag]{--bleed-top: 16px;--bleed-x: 26px;--bleed-bottom: 36px;position:relative;top:calc(-1 * var(--bleed-top));left:calc(-1 * var(--bleed-x));width:calc(100% + 2 * var(--bleed-x));height:calc(100% + var(--bleed-top) + var(--bleed-bottom));padding:var(--bleed-top) var(--bleed-x) var(--bleed-bottom);pointer-events:none}.row[data-kind=product-tag] .tag{pointer-events:auto}:host(hl-cta-products){cursor:grab}.tag{display:flex;height:100%;flex:none;align-items:flex-start;width:314px}.tag .circle{position:relative;z-index:1;display:grid;width:40px;height:40px;flex:none;place-items:center;border-radius:50%;box-shadow:0 4px 10px #00000040}.tag .circle svg,.icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.tag .body{display:flex;min-width:260px;flex:1;flex-direction:column;gap:8px;margin-inline-start:8px;padding:12px 16px;border-radius:16px;background:#f0f2f5;box-shadow:0 10px 24px #0003;color:#101114}.tag .name{overflow:hidden;font:500 16px/20px system-ui,sans-serif;text-overflow:ellipsis;white-space:nowrap}.tag .prices{display:flex;align-items:center;justify-content:flex-end;gap:8px}.old{color:#5b6270;font:14px system-ui,sans-serif;text-decoration:line-through}.tag .price{padding:2px 12px;border-radius:999px;background:#101114;color:#f0f2f5;font:600 16px/27px system-ui,sans-serif}.card{display:flex;height:100%;flex:none;flex-direction:column;overflow:hidden;background:#fff;box-shadow:0 4px 10px #0000002e;color:#000}.card .photo{display:grid;height:49%;flex:none;place-items:center;background:#f4f4f5}.card .photo img{width:100%;height:100%;object-fit:cover}.card .info{display:flex;min-height:0;flex:1;flex-direction:column;gap:4px;padding:8px}.card .title{overflow:hidden;font:500 12px system-ui,sans-serif;text-overflow:ellipsis;text-transform:capitalize;white-space:nowrap}.card .cost{font:700 14px system-ui,sans-serif}.card .old{display:block;font-size:12px}.buy{margin-top:auto;height:28px;border:0;border-radius:999px;background:#000;color:#fff;font:600 11px system-ui,sans-serif}.bar-item{display:flex;width:275px;height:92px;flex:none;flex-direction:column;justify-content:center;gap:8px;align-self:center;padding:8px;border-radius:12px;background:#f0f2f5;color:#101114}.bar-item .top{display:flex;gap:8px}.bar-item .thumb{display:grid;width:40px;height:40px;flex:none;place-items:center;overflow:hidden;border-radius:10px;background:#e5e7eb}.bar-item .thumb img{width:100%;height:100%;object-fit:cover}.bar-item .text{display:flex;min-width:0;flex:1;flex-direction:column;gap:4px}.bar-item .title{overflow:hidden;font:500 14px/16px system-ui,sans-serif;text-overflow:ellipsis;white-space:nowrap}.bar-item .cost{display:flex;align-items:center;gap:4px;font:700 14px/17px system-ui,sans-serif}.bar-item .old{font-size:12px}.bar-item .end{display:flex;justify-content:flex-end}.bar-item .buy{height:auto;margin:0;padding:6px 12px;border-radius:10px;font-size:10px;line-height:16px}@media(prefers-reduced-motion:reduce){.press,.link span,.swipe svg{transition:none}}',ce="hl-cta-products",pe={sm:.85,md:1,lg:1.15},he={"shopping-bag":i`<svg viewBox="0 0 24 24">
|
|
291
|
+
<path d="M6 8h12l1 12H5zM9 8a3 3 0 0 1 6 0" />
|
|
292
|
+
</svg>`,tag:i`<svg viewBox="0 0 24 24"><path d="M3 12V4h8l10 10-8 8zM8 8h.01" /></svg>`,"shopping-cart":i`<svg viewBox="0 0 24 24">
|
|
293
|
+
<path d="M3 4h2l2 11h11l2-8H6M9 20h.01M17 20h.01" />
|
|
294
|
+
</svg>`,percent:i`<svg viewBox="0 0 24 24"><path d="M19 5 5 19M7 7h.01M17 17h.01" /></svg>`,"map-pin":i`<svg viewBox="0 0 24 24">
|
|
295
|
+
<path d="M12 21s-7-6-7-11a7 7 0 0 1 14 0c0 5-7 11-7 11zM12 10h.01" />
|
|
296
|
+
</svg>`},ue=e=>"SAR"===e?"ر.س":e;class fe extends e{constructor(){super(),this.content=null,this.pressed=null,this.#S=null,this.#x=null,this.#C=e=>{const t=this.#j();null===t||e.composedPath()[0]instanceof HTMLButtonElement||(this.#S={x:e.clientX,scroll:t.scrollLeft,moved:!1})},this.#I=e=>{const t=this.#S,i=this.#j();if(null===t||null===i)return;const n=e.clientX-t.x;!t.moved&&Math.abs(n)>6&&(t.moved=!0,this.setPointerCapture(e.pointerId),this.dataset.dragging="true"),t.moved&&(i.scrollLeft=t.scroll-n)},this.#E=()=>{delete this.dataset.dragging,setTimeout(()=>{this.#S=null},0)},this.addEventListener("pointerdown",this.#C),this.addEventListener("pointermove",this.#I),this.addEventListener("pointerup",this.#E),this.addEventListener("pointercancel",this.#E),this.addEventListener("click",e=>{e.stopPropagation()})}static{this.properties={content:{attribute:!1},pressed:{state:!0}}}static{this.styles=t(de)}#S;#x;disconnectedCallback(){null!==this.#x&&clearTimeout(this.#x),super.disconnectedCallback()}#P(e,t){!0!==this.#S?.moved&&(this.pressed=t.id,null!==this.#x&&clearTimeout(this.#x),this.#x=setTimeout(()=>{this.pressed=null},120),te(this,{elementId:this.dataset.elementId??"",trackingId:e.trackingId,url:t.url??e.url,productId:t.id}))}#j(){return this.renderRoot.querySelector(".row")}#C;#I;#E;#M(e,t){return i`<div
|
|
297
|
+
class="tag press"
|
|
298
|
+
role="button"
|
|
299
|
+
tabindex="0"
|
|
300
|
+
data-pressed=${String(this.pressed===t.id)}
|
|
301
|
+
aria-label=${`${t.name} — ${t.price} ${ue(t.currency)}`}
|
|
302
|
+
@click=${i=>{i.stopPropagation(),this.#P(e,t)}}
|
|
303
|
+
@keydown=${i=>{"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),i.stopPropagation(),this.#P(e,t))}}
|
|
304
|
+
>
|
|
305
|
+
<div
|
|
306
|
+
class="circle"
|
|
307
|
+
style=${o({backgroundColor:e.fillColor,color:e.iconColor})}
|
|
308
|
+
>
|
|
309
|
+
${he[e.icon]}
|
|
310
|
+
</div>
|
|
311
|
+
<div class="body" aria-hidden="true">
|
|
312
|
+
<span class="name">${t.name}</span>
|
|
313
|
+
<div class="prices">
|
|
314
|
+
${""===t.oldPrice?n:i`<span class="old">${t.oldPrice} ${ue(t.currency)}</span>`}
|
|
315
|
+
<span class="price">${t.price} ${ue(t.currency)}</span>
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
318
|
+
</div>`}#z(e,t){const s=pe[e.size];return i`<div
|
|
319
|
+
class="card"
|
|
320
|
+
style=${o({width:`${String(150*s)}px`,borderRadius:"rounded"===e.format?"16px":"4px",marginInlineEnd:`${String(8*s)}px`})}
|
|
321
|
+
>
|
|
322
|
+
<div class="photo">
|
|
323
|
+
${null===t.imageUrl?n:i`<img src=${t.imageUrl} alt="" draggable="false" />`}
|
|
324
|
+
</div>
|
|
325
|
+
<div class="info">
|
|
326
|
+
<span class="title">${t.name}</span>
|
|
327
|
+
<div>
|
|
328
|
+
<span class="cost">${t.price} ${t.currency}</span>
|
|
329
|
+
${""===t.oldPrice?n:i`<span class="old">${t.oldPrice} ${t.currency}</span>`}
|
|
330
|
+
</div>
|
|
331
|
+
<button
|
|
332
|
+
type="button"
|
|
333
|
+
class="buy press"
|
|
334
|
+
data-pressed=${String(this.pressed===t.id)}
|
|
335
|
+
aria-label=${`${e.ctaButtonLabel}: ${t.name}`}
|
|
336
|
+
@click=${i=>{i.stopPropagation(),this.#P(e,t)}}
|
|
337
|
+
>
|
|
338
|
+
${e.ctaButtonLabel}
|
|
339
|
+
</button>
|
|
340
|
+
</div>
|
|
341
|
+
</div>`}#q(e,t){return i`<div class="bar-item" style="margin-inline-end:8px">
|
|
342
|
+
<div class="top">
|
|
343
|
+
<div class="thumb">
|
|
344
|
+
${null===t.imageUrl?n:i`<img src=${t.imageUrl} alt="" draggable="false" />`}
|
|
345
|
+
</div>
|
|
346
|
+
<div class="text">
|
|
347
|
+
<span class="title">${t.name}</span>
|
|
348
|
+
<div class="cost">
|
|
349
|
+
<span>${t.price} ${t.currency}</span>
|
|
350
|
+
${""===t.oldPrice?n:i`<span class="old">${t.oldPrice} ${t.currency}</span>`}
|
|
351
|
+
</div>
|
|
352
|
+
</div>
|
|
353
|
+
</div>
|
|
354
|
+
<div class="end">
|
|
355
|
+
<button
|
|
356
|
+
type="button"
|
|
357
|
+
class="buy press"
|
|
358
|
+
data-pressed=${String(this.pressed===t.id)}
|
|
359
|
+
style=${o({backgroundColor:e.buttonColor,color:e.buttonTextColor})}
|
|
360
|
+
aria-label=${`${e.buttonLabel}: ${t.name}`}
|
|
361
|
+
@click=${i=>{i.stopPropagation(),this.#P(e,t)}}
|
|
362
|
+
>
|
|
363
|
+
${e.buttonLabel}
|
|
364
|
+
</button>
|
|
365
|
+
</div>
|
|
366
|
+
</div>`}render(){const e=this.content;if(null===e||0===e.products.length)return i``;const t=e.products.map(t=>{switch(e.kind){case"product-tag":return this.#M(e,t);case"product-card":return this.#z(e,t);case"product-bar":return this.#q(e,t)}});return i`<div
|
|
367
|
+
class="row"
|
|
368
|
+
role="region"
|
|
369
|
+
aria-label=${r.products}
|
|
370
|
+
data-kind=${e.kind}
|
|
371
|
+
style=${"product-tag"===e.kind?"gap:12px":""}
|
|
372
|
+
>
|
|
373
|
+
${t}
|
|
374
|
+
</div>`}}const ge="hl-cta-simple",me={sm:.85,md:1,lg:1.15};class be extends e{constructor(){super(...arguments),this.content=null,this.pressed=!1,this.bouncing=!1,this.#x=null,this.#T=null}static{this.properties={content:{attribute:!1},pressed:{state:!0},bouncing:{state:!0}}}static{this.styles=t(de)}#x;#T;disconnectedCallback(){null!==this.#x&&clearTimeout(this.#x),super.disconnectedCallback()}#B(){return this.dataset.elementId??""}#P(e){this.pressed=!0,null!==this.#x&&clearTimeout(this.#x),this.#x=setTimeout(()=>{this.pressed=!1},120),te(this,{elementId:this.#B(),trackingId:e.trackingId,url:e.url,productId:null})}#L(e){return t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),this.#P(e))}}#R(e,t){return null===t.url?`${e} ${r.noLink}`:e}#H(e){const t=me[e.size],n=""===e.text.trim()?r.button:e.text;return"link"===e.variant?i`<div
|
|
375
|
+
class="link"
|
|
376
|
+
role="link"
|
|
377
|
+
tabindex="0"
|
|
378
|
+
data-pressed=${String(this.pressed)}
|
|
379
|
+
aria-label=${this.#R(n,e)}
|
|
380
|
+
aria-disabled=${String(null===e.url)}
|
|
381
|
+
@click=${t=>{t.stopPropagation(),this.#P(e)}}
|
|
382
|
+
@keydown=${this.#L(e)}
|
|
383
|
+
>
|
|
384
|
+
<span
|
|
385
|
+
style=${o({color:e.textColor,fontWeight:"bold"===e.textStyle?"700":"400",fontSize:`${String(14*t)}px`})}
|
|
386
|
+
>${e.text}</span
|
|
387
|
+
>
|
|
388
|
+
</div>`:i`<span
|
|
389
|
+
class="btn press"
|
|
390
|
+
role="button"
|
|
391
|
+
tabindex="0"
|
|
392
|
+
data-pressed=${String(this.pressed)}
|
|
393
|
+
aria-label=${this.#R(n,e)}
|
|
394
|
+
aria-disabled=${String(null===e.url)}
|
|
395
|
+
style=${o({backgroundColor:e.fillColor,color:e.textColor,borderRadius:`${String(e.borderRadius)}px`,fontWeight:"bold"===e.textStyle?"700":"400",fontSize:`${String(Math.round(.35*this.clientHeight*t)||14)}px`})}
|
|
396
|
+
@click=${t=>{t.stopPropagation(),this.#P(e)}}
|
|
397
|
+
@keydown=${this.#L(e)}
|
|
398
|
+
>${e.text}</span
|
|
399
|
+
>`}#A(e){const t=t=>{const i=this.#T;if(this.#T=null,null===i)return;const n=Math.max(0,Math.min(i-t,48));(n>=28||n<=6)&&(this.bouncing=!0,setTimeout(()=>{this.bouncing=!1},280),te(this,{elementId:this.#B(),trackingId:e.trackingId,url:e.url,productId:null}))};return i`<div
|
|
400
|
+
class="swipe"
|
|
401
|
+
role="button"
|
|
402
|
+
tabindex="0"
|
|
403
|
+
data-bouncing=${String(this.bouncing)}
|
|
404
|
+
aria-label=${`${r.swipeUp}: ${e.swipeText}`}
|
|
405
|
+
style=${o({color:e.textColor})}
|
|
406
|
+
@pointerdown=${e=>{e.stopPropagation(),e.preventDefault(),this.#T=e.clientY;const i=e=>{window.removeEventListener("pointerup",i),window.removeEventListener("pointercancel",n),t(e.clientY)},n=()=>{window.removeEventListener("pointerup",i),window.removeEventListener("pointercancel",n),this.#T=null};window.addEventListener("pointerup",i),window.addEventListener("pointercancel",n)}}
|
|
407
|
+
@click=${e=>{e.stopPropagation()}}
|
|
408
|
+
@keydown=${t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),te(this,{elementId:this.#B(),trackingId:e.trackingId,url:e.url,productId:null}))}}
|
|
409
|
+
>
|
|
410
|
+
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 19V5M5 12l7-7 7 7" /></svg>
|
|
411
|
+
<span style=${o({fontWeight:"bold"===e.textStyle?"700":"400"})}
|
|
412
|
+
>${e.swipeText}</span
|
|
413
|
+
>
|
|
414
|
+
</div>`}#U(e){const t=""===e.altText.trim()?r.imageLink:e.altText;return i`<div
|
|
415
|
+
class="image-cta press"
|
|
416
|
+
role="button"
|
|
417
|
+
tabindex="0"
|
|
418
|
+
data-pressed=${String(this.pressed)}
|
|
419
|
+
aria-label=${this.#R(t,e)}
|
|
420
|
+
aria-disabled=${String(null===e.url)}
|
|
421
|
+
style=${o({borderRadius:`${String(e.borderRadius)}px`,borderWidth:`${String(e.borderWidth)}px`,borderColor:e.borderColor})}
|
|
422
|
+
@click=${t=>{t.stopPropagation(),this.#P(e)}}
|
|
423
|
+
@keydown=${this.#L(e)}
|
|
424
|
+
>
|
|
425
|
+
${null===e.imageUrl?i`<div class="placeholder">${e.altText}</div>`:i`<img src=${e.imageUrl} alt="" draggable="false" />`}
|
|
426
|
+
</div>`}#D(e){const t=""===e.caption.trim()?e.platform:e.caption;return i`<div
|
|
427
|
+
class="press"
|
|
428
|
+
style="width:100%;height:100%"
|
|
429
|
+
role="link"
|
|
430
|
+
tabindex="0"
|
|
431
|
+
data-pressed=${String(this.pressed)}
|
|
432
|
+
aria-label=${this.#R(t,e)}
|
|
433
|
+
aria-disabled=${String(null===e.url)}
|
|
434
|
+
@click=${t=>{t.stopPropagation(),this.#P(e)}}
|
|
435
|
+
@keydown=${this.#L(e)}
|
|
436
|
+
>
|
|
437
|
+
<div class="social">
|
|
438
|
+
<div class="media">
|
|
439
|
+
${null===e.mediaUrl?n:"video"===e.mediaKind?i`<video src=${e.mediaUrl} muted playsinline preload="metadata"></video>`:i`<img src=${e.mediaUrl} alt="" draggable="false" />`}
|
|
440
|
+
<span class="badge">${e.platform}</span>
|
|
441
|
+
</div>
|
|
442
|
+
${""===e.caption.trim()?n:i`<p class="caption" dir="auto">${e.caption}</p>`}
|
|
443
|
+
</div>
|
|
444
|
+
</div>`}render(){const e=this.content;if(null===e)return i``;switch(e.kind){case"button":return this.#H(e);case"swipe-up":return this.#A(e);case"image-cta":return this.#U(e);case"social-post":return this.#D(e)}}}const ve="hl-media-buffering",ye="hl-media-failed",xe="hl-media-started",we="hl-media-hint",$e="hl-media-gesture",ke=(e,t,i)=>{e.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0,composed:!0}))},Se=e=>{if(!(e instanceof CustomEvent))return null;const t=e.detail;return"object"==typeof t&&null!==t?Object.fromEntries(Object.entries(t)):null},Ce=["network","timeout","decode","unsupported_format","not_found","forbidden","server_error","rate_limited","aborted","unknown"],je=e=>{const t=Se(e);return"boolean"==typeof t?.buffering?{buffering:t.buffering}:null},Ie=e=>{const t=Se(e),i=Ce.find(e=>e===t?.category);return"string"==typeof t?.id&&void 0!==i?{id:t.id,category:i}:null},Ee=e=>{const t=Se(e)?.id;return"string"==typeof t?t:null},Pe=e=>{const t=Se(e)?.hint;return"tap-video"===t||"tap-audio"===t?{hint:t}:null};class Me{#F;#_;#O;#W=null;#N=!1;#V=!1;#Y=!1;constructor(e,t,i){this.#F=e,this.#_=t,this.#O=i,e.loop=!1;for(const n of["waiting","stalled"])e.addEventListener(n,this.#X);for(const n of["playing","canplay","pause","ended"])e.addEventListener(n,this.#G);e.addEventListener("playing",this.#K),e.addEventListener("timeupdate",this.#J),e.addEventListener("error",this.#Q),e.addEventListener("loadedmetadata",this.#Z)}update(e){if(this.#V)return;this.#W=e;const t=this.#F;if(t.volume=Math.min(Math.max(e.volume/100,0),1),t.playbackRate=e.rate,t.muted=e.muted,!e.shouldPlay)return t.pause(),void this.#ee(!1);const i=$(e.trimStart,e.trimEnd,t.duration);(t.currentTime<e.trimStart||t.currentTime>=i)&&(t.currentTime=e.trimStart),t.play().catch(e=>{e instanceof DOMException&&"AbortError"===e.name||this.#_.onBlocked()})}dispose(){if(this.#V)return;this.#V=!0;const e=this.#F;e.removeEventListener("waiting",this.#X),e.removeEventListener("stalled",this.#X);for(const t of["playing","canplay","pause","ended"])e.removeEventListener(t,this.#G);e.removeEventListener("playing",this.#K),e.removeEventListener("timeupdate",this.#J),e.removeEventListener("error",this.#Q),e.removeEventListener("loadedmetadata",this.#Z),e.pause(),null!==this.#W&&e.readyState>0&&(e.currentTime=this.#W.trimStart),this.#ee(!1)}#ee(e){this.#N!==e&&(this.#N=e,this.#_.onBuffering(e))}#X=()=>{!0===this.#W?.shouldPlay&&this.#ee(!0)};#K=()=>{this.#Y||(this.#Y=!0,this.#_.onStarted?.())};#G=()=>{this.#ee(!1)};#J=()=>{const e=this.#W;if(null===e)return;const t=this.#F;if(this.#_.onTime?.(t.currentTime),!e.shouldPlay)return;const i=$(e.trimStart,e.trimEnd,t.duration),n=(s=t.currentTime,o=e.trimStart,r=i,a=e.loop,s<o?{action:"seek",to:o}:s>=r?a?{action:"loop",to:o}:{action:"end"}:{action:"continue"});var s,o,r,a;"seek"===n.action||"loop"===n.action?t.currentTime=n.to:"end"===n.action&&(t.pause(),this.#_.onEnded())};#Q=()=>{this.#ee(!1),this.#_.onFailed((()=>{switch(this.#F.error?.code??null){case 1:return"aborted";case 2:return"network";case 3:return"decode";case 4:return"unsupported_format";default:return"unknown"}})())};#Z=()=>{this.#O&&this.#F instanceof HTMLVideoElement&&this.#F.duration>0&&0===this.#F.videoWidth&&this.#_.onFailed("unsupported_format")}}const ze=":host{display:block;width:100%;height:100%}*,*:before,*:after{box-sizing:border-box}.frame{position:relative;width:100%;height:100%;overflow:hidden;cursor:pointer}.frame:focus-visible{outline:2px solid #fff;outline-offset:-2px}video{display:block;width:100%;height:100%;object-fit:cover}.play{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none;transition:opacity .15s}.play span{display:grid;width:48px;height:48px;place-items:center;border-radius:50%;background:#00000073;color:#fafafa}.play svg{width:18px;height:18px;fill:currentColor}.broken,.empty{display:grid;width:100%;height:100%;place-content:center;justify-items:center;gap:4px;padding:8px;overflow:hidden;text-align:center;font:11px/1.4 system-ui,sans-serif}.empty{background:#e2e8f0;color:#64748b}.broken{position:absolute;inset:0;background:#000000e6;color:#f59e0b}.voice{display:flex;width:100%;height:100%;overflow:hidden;background:#27272a;color:#fafafa}.voice.minimal{align-items:center;gap:10px;padding:0 10px}.voice.waveform{flex-direction:column;justify-content:center;gap:4px;padding:6px 8px}.voice.icon-only{align-items:center;justify-content:center}.disc{position:relative;display:grid;flex:none;width:28px;height:28px;place-items:center;border-radius:50%;background:#3f3f46}.disc svg{position:absolute;width:10px;height:10px;fill:currentColor;transition:opacity .15s}.track{position:relative;flex:1;height:4px;min-width:0;overflow:hidden;border-radius:999px;background:#3f3f46}.track>span{position:absolute;inset-block:0;inset-inline-start:0;border-radius:999px;background:#a1a1aa}.time{flex:none;font:12px system-ui,sans-serif;font-variant-numeric:tabular-nums}.wave{display:flex;flex:1;height:20px;min-width:0;align-items:flex-end;justify-content:center;gap:1px}.wave span{flex:none;width:3px;border-radius:2px;background:#71717a}.row{display:flex;min-width:0;align-items:center;gap:8px}.name{padding-inline-start:4px;overflow:hidden;color:#a1a1aa;font:10px/15px system-ui,sans-serif;text-overflow:ellipsis;white-space:nowrap}.hidden-player{display:grid;width:100%;height:100%;place-items:center;color:#71717a}.hidden-player svg{width:16px;height:16px;fill:currentColor}@media(prefers-reduced-motion:reduce){.play,.disc svg{transition:none}}.time:before,.name:before{content:attr(data-text)}",qe="hl-media-track";class Te extends e{constructor(){super(...arguments),this.kind="video",this.url="",this.fallback="",this.active=!1,this.sound=k,this.failed=null,this.#te=null}static{this.properties={kind:{type:String},url:{type:String},fallback:{type:String},active:{type:Boolean},sound:{attribute:!1},failed:{state:!0}}}static{this.styles=t(ze)}#te;disconnectedCallback(){this.#te?.dispose(),this.#te=null,super.disconnectedCallback()}updated(){const e=this.renderRoot.querySelector("video, audio");null!==e&&(this.#te??=new Me(e,{onBuffering:e=>{ke(this,ve,{id:"video"===this.kind?"background":"audio",buffering:e})},onFailed:e=>{this.failed=e,x(e)&&ke(this,ye,{id:"video"===this.kind?"background":"audio",category:e})},onEnded:()=>{},onBlocked:()=>{"audio"===this.kind&&ke(this,we,{hint:"tap-audio"})}},"video"===this.kind),this.#te.update({shouldPlay:this.active&&null===this.failed,trimStart:0,trimEnd:0,volume:100,rate:1,loop:!0,muted:"video"===this.kind?j(this.sound,!0):I(this.sound)}))}render(){return"audio"===this.kind?i`<audio src=${this.url} preload="auto" style="display:none"></audio>`:i`<div style="position:absolute;inset:0;background:${this.fallback}"></div>
|
|
445
|
+
${null===this.failed?i`<video src=${this.url} playsinline preload="auto" aria-hidden="true" style="position:absolute;inset:0"></video>`:i``}`}}const Be="hl-media-video";class Le extends e{constructor(){super(...arguments),this.content=null,this.active=!1,this.sound=k,this.wantsPlay=!1,this.failed=null,this.#te=null}static{this.properties={content:{attribute:!1},active:{type:Boolean},sound:{attribute:!1},wantsPlay:{state:!0},failed:{state:!0}}}static{this.styles=t(ze)}#te;connectedCallback(){super.connectedCallback(),this.wantsPlay=this.content?.autoplay??!1}disconnectedCallback(){this.#te?.dispose(),this.#te=null,super.disconnectedCallback()}updated(){const e=this.content,t=this.renderRoot.querySelector("video");null!==e&&null!==t&&(this.#te??=new Me(t,{onBuffering:e=>{ke(this,ve,{id:this.#ie(),buffering:e})},onFailed:e=>{this.failed=e,x(e)&&ke(this,ye,{id:this.#ie(),category:e})},onStarted:()=>{ke(this,xe,{id:this.#ie()})},onEnded:()=>{this.wantsPlay=!1},onBlocked:()=>{this.wantsPlay=!1,ke(this,we,{hint:"tap-video"})}},!0),this.#te.update({shouldPlay:this.wantsPlay&&this.active&&null===this.failed,trimStart:e.trimStartSeconds,trimEnd:e.trimEndSeconds,volume:100,rate:1,loop:!1,muted:j(this.sound,e.autoplay)}))}#ie(){return this.dataset.elementId??"video"}#ne(){ke(this,$e,{}),this.wantsPlay=!this.wantsPlay}render(){const e=this.content;if(null===e)return i``;const t=`${String(e.borderRadius)}px`;if(null===e.url)return i`<div class="empty" style="border-radius:${t}">${r.videoLabel}</div>`;const s=this.wantsPlay&&this.active&&null===this.failed;return i`<div
|
|
446
|
+
class="frame"
|
|
447
|
+
style="border-radius:${t}"
|
|
448
|
+
role="button"
|
|
449
|
+
tabindex="0"
|
|
450
|
+
aria-label=${s?r.pauseVideo:r.playVideo}
|
|
451
|
+
aria-pressed=${String(s)}
|
|
452
|
+
@click=${e=>{e.stopPropagation(),this.#ne()}}
|
|
453
|
+
@keydown=${e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),this.#ne())}}
|
|
454
|
+
>
|
|
455
|
+
<video
|
|
456
|
+
src=${e.url}
|
|
457
|
+
poster=${s||null===e.posterUrl?n:e.posterUrl}
|
|
458
|
+
playsinline
|
|
459
|
+
preload="metadata"
|
|
460
|
+
?muted=${j(this.sound,e.autoplay)}
|
|
461
|
+
></video>
|
|
462
|
+
<div class="play" style="opacity:${s?0:1}" aria-hidden="true">
|
|
463
|
+
<span
|
|
464
|
+
><svg viewBox="0 0 10 10"><path d="M2.5 1.25v7.5L8.5 5 2.5 1.25z" /></svg
|
|
465
|
+
></span>
|
|
466
|
+
</div>
|
|
467
|
+
${"unsupported_format"===this.failed||"decode"===this.failed?i`<div class="broken" role="alert">
|
|
468
|
+
<strong>${r.codecUnsupported}</strong
|
|
469
|
+
><span>${r.codecUnsupportedHelp}</span>
|
|
470
|
+
</div>`:n}
|
|
471
|
+
</div>`}}const Re="hl-media-voice",He=[.35,.7,.45,.9,.55,.75,.4,.65,.5,.85,.6,.35],Ae=i`<svg viewBox="0 0 10 10"><path d="M2 1.5v7l6-3.5L2 1.5z" /></svg>`,Ue=i`<svg viewBox="0 0 10 10">
|
|
472
|
+
<path d="M2.5 1.5h1.5v7H2.5v-7zm3.5 0h1.5v7H6v-7z" />
|
|
473
|
+
</svg>`,De=i`<svg viewBox="0 0 16 16">
|
|
474
|
+
<path d="M3 6.5v3c0 .55.45 1 1 1h2l3 2.5V3L6 5.5H4c-.55 0-1 .45-1 1z" />
|
|
475
|
+
</svg>`;class Fe extends e{constructor(){super(...arguments),this.content=null,this.active=!1,this.sound=k,this.wantsPlay=!1,this.failed=null,this.seconds=0,this.#te=null}static{this.properties={content:{attribute:!1},active:{type:Boolean},sound:{attribute:!1},wantsPlay:{state:!0},failed:{state:!0},seconds:{state:!0}}}static{this.styles=t(ze)}#te;connectedCallback(){super.connectedCallback(),this.wantsPlay=this.content?.autoplay??!1,this.seconds=this.content?.trimStartSeconds??0}disconnectedCallback(){this.#te?.dispose(),this.#te=null,super.disconnectedCallback()}updated(){const e=this.content,t=this.renderRoot.querySelector("audio");null!==e&&null!==t&&(this.#te??=new Me(t,{onBuffering:e=>{ke(this,ve,{id:this.#ie(),buffering:e})},onFailed:e=>{this.failed=e,x(e)&&ke(this,ye,{id:this.#ie(),category:e})},onStarted:()=>{ke(this,xe,{id:this.#ie()})},onEnded:()=>{this.wantsPlay=!1},onBlocked:()=>{this.wantsPlay=!1,ke(this,we,{hint:"tap-audio"})},onTime:e=>{this.seconds=e}},!1),this.#te.update({shouldPlay:this.wantsPlay&&this.active&&null===this.failed,trimStart:e.trimStartSeconds,trimEnd:e.trimEndSeconds,volume:e.volume,rate:e.playbackSpeed,loop:e.loop,muted:I(this.sound)}))}#ie(){return this.dataset.elementId??"voice"}get#se(){const e=this.content;return null!==e&&(e.showPlayer||e.playOnInteraction)}#ne(){this.#se&&(ke(this,$e,{}),this.wantsPlay=!this.wantsPlay)}#oe(e){return i`<span class="disc"
|
|
476
|
+
><span style="display:contents">${e?Ue:Ae}</span></span
|
|
477
|
+
>`}#re(e,t){const n=`border-radius:${String(e.borderRadius)}px`;if(!e.showPlayer)return i`<div class="hidden-player" style=${n}>${De}</div>`;if("icon-only"===e.playerStyle)return i`<div class="voice icon-only" style=${n}>${this.#oe(t)}</div>`;if("waveform"===e.playerStyle)return i`<div class="voice waveform" aria-hidden="true" style=${n}>
|
|
478
|
+
<div class="row">
|
|
479
|
+
${this.#oe(t)}
|
|
480
|
+
<div class="wave">
|
|
481
|
+
${He.map(e=>i`<span style=${o({height:`${String(Math.max(4,20*e))}px`})}></span>`)}
|
|
482
|
+
</div>
|
|
483
|
+
</div>
|
|
484
|
+
<span class="name" data-text=${e.filename}></span>
|
|
485
|
+
</div>`;const s=e.trimStartSeconds,r=Math.max(s+.05,e.trimEndSeconds),a=Math.min(Math.max(this.seconds-s,0),r-s);return i`<div class="voice minimal" aria-hidden="true" style=${n}>
|
|
486
|
+
${this.#oe(t)}
|
|
487
|
+
<div class="track">
|
|
488
|
+
<span style=${o({width:`${String(a/(r-s)*100)}%`})}></span>
|
|
489
|
+
</div>
|
|
490
|
+
<span class="time" data-text=${l=a,!Number.isFinite(l)||l<0?"0:00":`${String(Math.floor(l/60))}:${String(Math.floor(l%60)).padStart(2,"0")}`}></span>
|
|
491
|
+
</div>`;var l}render(){const e=this.content;if(null===e)return i``;if(null===e.url)return i`<div class="empty" style="border-radius:${String(e.borderRadius)}px">
|
|
492
|
+
${r.audioLabel}
|
|
493
|
+
</div>`;const t=this.wantsPlay&&this.active&&null===this.failed,s=this.#se;return i`<div
|
|
494
|
+
class="frame"
|
|
495
|
+
style=${s?"":"cursor:default"}
|
|
496
|
+
role=${s?"button":n}
|
|
497
|
+
tabindex=${s?"0":n}
|
|
498
|
+
aria-label=${s?t?r.pauseMedia(e.filename):r.playMedia(e.filename):n}
|
|
499
|
+
aria-pressed=${s?String(t):n}
|
|
500
|
+
@click=${e=>{s&&(e.stopPropagation(),this.#ne())}}
|
|
501
|
+
@keydown=${e=>{!s||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),this.#ne())}}
|
|
502
|
+
>
|
|
503
|
+
<audio src=${e.url} preload="metadata" style="display:none"></audio>
|
|
504
|
+
${this.#re(e,t)}
|
|
505
|
+
</div>`}}class _e{#ae;constructor(e,t,i){this.#ae=e.animate(t.keyframes.map(e=>{return{offset:e.offset,...(t=e.pose,{transform:`translate(${String(t.x)}px, ${String(t.y)}px) rotate(${String(t.rotate)}deg)`,opacity:String(t.opacity)}),...void 0===e.easing?{}:{easing:e.easing}};var t}),{duration:t.totalMs,fill:"both"}),i&&this.#ae.pause()}setPaused(e){"finished"!==this.#ae.playState&&(e?this.#ae.pause():this.#ae.play())}cancel(){this.#ae.cancel()}}const Oe="hl-scene";class We extends e{constructor(){super(...arguments),this.scene=null,this.progress=0,this.paused=!1,this.staticPreview=!1,this.sound=k,this.interactions=/* @__PURE__ */new Map,this.answerable=!1,this.#N=/* @__PURE__ */new Set,this.#le=/* @__PURE__ */new Set,this.#de=/* @__PURE__ */new Set,this.#ce=0,this.#pe=/* @__PURE__ */new Map,this.#he=null,this.#ue="",this.#fe=null,this.#ge=!1,this.#me=e=>{const t=(e=>{const t=Se(e);return"string"==typeof t?.id&&"boolean"==typeof t.buffering?{id:t.id,buffering:t.buffering}:null})(e);if(null===t)return;const i=this.#N.size>0;t.buffering?this.#N.add(t.id):this.#N.delete(t.id);const n=this.#N.size>0;i!==n&&ke(this,"hl-scene-buffering",{buffering:n})}}static{this.properties={scene:{attribute:!1},progress:{type:Number},paused:{type:Boolean},staticPreview:{type:Boolean},sound:{attribute:!1},interactions:{attribute:!1},answerable:{type:Boolean}}}static{this.styles=t(":host{display:block;position:relative;width:100%;overflow:hidden;background:#14161b;aspect-ratio:var(--hl-aspect, 430 / 932);pointer-events:none}*,*:before,*:after{box-sizing:border-box}.stage{position:absolute;top:var(--hl-oy, 0px);left:var(--hl-ox, 0px);width:var(--hl-canvas-w);height:var(--hl-canvas-h);overflow:hidden;transform:scale(var(--hl-scale, 1));transform-origin:top left}:host(:dir(rtl)) .stage{left:auto;right:var(--hl-ox, 0px);transform-origin:top right}.background{position:absolute;inset:0;width:100%;height:100%}img.background{object-fit:cover}.slot{position:absolute;pointer-events:none}.slot[data-interactive=true]{pointer-events:auto}:host([inert]) .slot{pointer-events:none}.shell{position:relative;width:100%;height:100%}.inner{width:100%;height:100%}.text{display:flex;width:100%;height:100%;overflow:hidden}.text>span{width:100%;white-space:pre-wrap;overflow-wrap:break-word}.picture{width:100%;height:100%;overflow:hidden}.picture img{width:100%;height:100%;display:block}.picture[data-empty=true]{background:#e2e8f0}")}#N;#le;#de;#ce;#pe;#he;#ue;#fe;#ge;connectedCallback(){super.connectedCallback(),customElements.get(Be)||customElements.define(Be,Le),customElements.get(Re)||customElements.define(Re,Fe),customElements.get(qe)||customElements.define(qe,Te),customElements.get(ge)||customElements.define(ge,be),customElements.get(ce)||customElements.define(ce,fe),customElements.get(ne)||customElements.define(ne,oe),customElements.get(ae)||customElements.define(ae,le),customElements.get(H)||customElements.define(H,D),customElements.get(Q)||customElements.define(Q,ee),customElements.get(X)||customElements.define(X,J),customElements.get(V)||customElements.define(V,Y),this.addEventListener(ve,this.#me),this.#ge=matchMedia("(prefers-reduced-motion: reduce)").matches,this.#he=new ResizeObserver(()=>{this.#be()}),this.#he.observe(this)}disconnectedCallback(){this.#he?.disconnect(),this.#he=null,this.removeEventListener(ve,this.#me),this.#ve(),super.disconnectedCallback()}#me;#ye(e){this.staticPreview||this.#de.has(e)||(this.#de.add(e),ke(this,"hl-element-touched",{id:e}))}#be(){const e=this.scene;if(null===e||0===e.canvas.width||0===e.canvas.height)return;const{clientWidth:t,clientHeight:i}=this;if(0===t||0===i)return;const n=Math.max(t/e.canvas.width,i/e.canvas.height),s=(t-e.canvas.width*n)/2,o=(i-e.canvas.height*n)/2,r=`${String(n)}|${String(s)}|${String(o)}`;r!==this.#ue&&(this.#ue=r,this.style.setProperty("--hl-scale",String(n)),this.style.setProperty("--hl-ox",`${String(s)}px`),this.style.setProperty("--hl-oy",`${String(o)}px`))}#ve(){for(const e of this.#pe.values())e.cancel();this.#pe.clear()}willUpdate(e){this.toggleAttribute("inert",this.staticPreview);const t=this.scene;null!==t&&e.has("scene")&&t.snapshotId!==this.#fe&&(this.#fe=t.snapshotId,this.#le.clear(),this.#de.clear(),this.#ve(),this.style.setProperty("--hl-aspect",`${String(t.canvas.width)} / ${String(t.canvas.height)}`),this.style.setProperty("--hl-canvas-w",`${String(t.canvas.width)}px`),this.style.setProperty("--hl-canvas-h",`${String(t.canvas.height)}px`))}updated(e){if(this.#be(),null===this.scene||this.staticPreview)return;this.progress<this.#ce&&(this.#le.clear(),this.#de.clear()),this.#ce=this.progress;const t=/* @__PURE__ */new Set;for(const i of this.renderRoot.querySelectorAll(".slot[data-id]")){const e=i.dataset.id;if(void 0===e)continue;if(t.add(e),this.#le.has(e)||(this.#le.add(e),ke(this,"hl-element-visible",{id:e})),this.#pe.has(e)||this.#ge)continue;const n=this.scene.elements.find(t=>t.id===e),s=void 0===n?null:m(n.frame.animation);null!==s&&this.#pe.set(e,new _e(i,s,this.paused))}for(const i of this.#le)t.has(i)||this.#le.delete(i);for(const[i,n]of this.#pe)t.has(i)||(n.cancel(),this.#pe.delete(i));if(e.has("paused"))for(const i of this.#pe.values())i.setPaused(this.paused)}#xe(e){const{background:t}=e;if("image"===t.kind)return i`<img
|
|
506
|
+
class="background"
|
|
507
|
+
src=${t.url}
|
|
508
|
+
alt=""
|
|
509
|
+
draggable="false"
|
|
510
|
+
decoding="async"
|
|
511
|
+
/>`;if("video"===t.kind&&!this.staticPreview)return i`<hl-media-track
|
|
512
|
+
class="background"
|
|
513
|
+
kind="video"
|
|
514
|
+
.url=${t.url}
|
|
515
|
+
.fallback=${t.fallbackCss}
|
|
516
|
+
.active=${!this.paused}
|
|
517
|
+
.sound=${this.sound}
|
|
518
|
+
></hl-media-track>`;const n="video"===t.kind?t.fallbackCss:t.css;return i`<div class="background" style=${o({background:n})}></div>`}render(){const e=this.scene;if(null===e)return i``;const t=((e,t)=>{const i=(e=>e>0?e:5)(t);return e>=1?Math.max(0,i-.001):Math.min(i,Math.max(0,e)*i)})(this.progress,e.durationSeconds),r=b(e.elements,t);return i`<div class="stage" aria-hidden=${this.staticPreview?"true":n}>
|
|
519
|
+
${this.#xe(e)}
|
|
520
|
+
${null===e.audioUrl||this.staticPreview?n:i`<hl-media-track
|
|
521
|
+
kind="audio"
|
|
522
|
+
.url=${e.audioUrl}
|
|
523
|
+
.active=${!this.paused}
|
|
524
|
+
.sound=${this.sound}
|
|
525
|
+
></hl-media-track>`}
|
|
526
|
+
${s(r,e=>e.id,e=>{return i`<div
|
|
527
|
+
class="slot"
|
|
528
|
+
data-id=${e.id}
|
|
529
|
+
data-interactive=${this.staticPreview?"false":String((t=e.content,"video"===t.kind||("voice"===t.kind?t.showPlayer||t.playOnInteraction:"text"!==t.kind&&"image"!==t.kind)))}
|
|
530
|
+
@pointerdown=${()=>{this.#ye(e.id)}}
|
|
531
|
+
@focusin=${()=>{this.#ye(e.id)}}
|
|
532
|
+
style=${o({left:`${String(e.frame.x)}px`,top:`${String(e.frame.y)}px`,width:`${String(e.frame.width)}px`,height:`${String(e.frame.height)}px`,zIndex:String(e.frame.layerOrder)})}
|
|
533
|
+
>
|
|
534
|
+
<div
|
|
535
|
+
class="shell"
|
|
536
|
+
style=${o({transform:`rotate(${String(e.frame.rotation)}deg)`})}
|
|
537
|
+
>
|
|
538
|
+
<div class="inner" style=${o({opacity:String(e.frame.opacity)})}>
|
|
539
|
+
${((e,t)=>{switch(e.kind){case"text":return(e=>{const t="center"===e.alignment,n={backgroundColor:"transparent"===e.backgroundColor?void 0:e.backgroundColor,color:e.textColor,fontFamily:a(e.fontFamily),fontSize:`${String(e.fontSize)}px`,fontWeight:String(e.fontWeight),textAlign:e.alignment,lineHeight:String(e.lineHeight),letterSpacing:`${String(e.letterSpacing)}px`,direction:"auto"===e.textDirection?void 0:e.textDirection,borderWidth:e.borderWidth>0?`${String(e.borderWidth)}px`:void 0,borderStyle:e.borderWidth>0?"solid":void 0,borderColor:"transparent"===e.borderColor?void 0:e.borderColor,borderRadius:e.borderRadius>0?`${String(e.borderRadius)}px`:void 0,alignItems:t?"center":"flex-start",justifyContent:t?"center":"flex-start"};return i`<div class="text" style=${o(n)}><span>${e.content}</span></div>`})(e);case"image":return(e=>i`<div
|
|
540
|
+
class="picture"
|
|
541
|
+
data-empty=${String(null===e.url)}
|
|
542
|
+
style=${o({borderRadius:`${String(e.borderRadius)}px`})}
|
|
543
|
+
>
|
|
544
|
+
${null===e.url?"":i`<img
|
|
545
|
+
src=${e.url}
|
|
546
|
+
alt=""
|
|
547
|
+
draggable="false"
|
|
548
|
+
decoding="async"
|
|
549
|
+
style=${o({objectFit:e.fitMode})}
|
|
550
|
+
/>`}
|
|
551
|
+
</div>`)(e);case"video":return i`<hl-media-video
|
|
552
|
+
data-element-id=${t.elementId}
|
|
553
|
+
.content=${e}
|
|
554
|
+
.active=${t.active}
|
|
555
|
+
.sound=${t.sound}
|
|
556
|
+
></hl-media-video>`;case"product-tag":case"product-card":case"product-bar":return i`<hl-cta-products
|
|
557
|
+
data-element-id=${t.elementId}
|
|
558
|
+
.content=${e}
|
|
559
|
+
></hl-cta-products>`;case"button":case"swipe-up":case"image-cta":case"social-post":return i`<hl-cta-simple
|
|
560
|
+
data-element-id=${t.elementId}
|
|
561
|
+
.content=${e}
|
|
562
|
+
></hl-cta-simple>`;case"countdown":return i`<hl-countdown
|
|
563
|
+
data-element-id=${t.elementId}
|
|
564
|
+
.content=${e}
|
|
565
|
+
.active=${t.active}
|
|
566
|
+
></hl-countdown>`;case"promocode":return i`<hl-promocode
|
|
567
|
+
data-element-id=${t.elementId}
|
|
568
|
+
.content=${e}
|
|
569
|
+
></hl-promocode>`;case"poll":case"quiz":return i`<hl-choice
|
|
570
|
+
data-element-id=${t.elementId}
|
|
571
|
+
.content=${e}
|
|
572
|
+
.interaction=${t.interactions.get(t.elementId)}
|
|
573
|
+
.answerable=${t.answerable}
|
|
574
|
+
></hl-choice>`;case"question":return i`<hl-question
|
|
575
|
+
data-element-id=${t.elementId}
|
|
576
|
+
.content=${e}
|
|
577
|
+
.interaction=${t.interactions.get(t.elementId)}
|
|
578
|
+
.answerable=${t.answerable}
|
|
579
|
+
></hl-question>`;case"emoji-slider":return i`<hl-emoji-slider
|
|
580
|
+
data-element-id=${t.elementId}
|
|
581
|
+
.content=${e}
|
|
582
|
+
.interaction=${t.interactions.get(t.elementId)}
|
|
583
|
+
.answerable=${t.answerable}
|
|
584
|
+
></hl-emoji-slider>`;case"emoji-reactions":return i`<hl-emoji-reactions
|
|
585
|
+
data-element-id=${t.elementId}
|
|
586
|
+
.content=${e}
|
|
587
|
+
.interaction=${t.interactions.get(t.elementId)}
|
|
588
|
+
.answerable=${t.answerable}
|
|
589
|
+
></hl-emoji-reactions>`;case"voice":return i`<hl-media-voice
|
|
590
|
+
data-element-id=${t.elementId}
|
|
591
|
+
.content=${e}
|
|
592
|
+
.active=${t.active}
|
|
593
|
+
.sound=${t.sound}
|
|
594
|
+
></hl-media-voice>`}})(e.content,{active:!this.paused,sound:this.sound,elementId:e.id,interactions:this.interactions,answerable:this.answerable})}
|
|
595
|
+
</div>
|
|
596
|
+
</div>
|
|
597
|
+
</div>`;var t})}
|
|
598
|
+
</div>`}}const Ne=()=>{customElements.get(Oe)||customElements.define(Oe,We)};export{k as I,Ie as a,Ee as b,re as c,Ne as d,q as e,L as f,T as g,ie as h,Pe as i,je as r,C as t,S as u,b as v};
|