@jaaq/jaaq-sdk-js 1.0.1 → 1.1.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/README.md +733 -92
- package/dist/embed/embed-collection.html +275 -0
- package/dist/embed/embed.html +270 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/jaaq-sdk.min.js.map +1 -1
- package/dist/ui/index.cjs +5051 -0
- package/dist/ui/index.cjs.map +1 -0
- package/dist/ui/index.d.ts +378 -0
- package/dist/ui/index.mjs +5044 -0
- package/dist/ui/index.mjs.map +1 -0
- package/dist/ui/jaaq-ui-bundled.min.js +8 -0
- package/dist/ui/jaaq-ui-bundled.min.js.map +1 -0
- package/dist/ui/jaaq-ui.min.js +8 -0
- package/dist/ui/jaaq-ui.min.js.map +1 -0
- package/dist/ui/react/index.cjs +4756 -0
- package/dist/ui/react/index.cjs.map +1 -0
- package/dist/ui/react/index.d.ts +182 -0
- package/dist/ui/react/index.mjs +4735 -0
- package/dist/ui/react/index.mjs.map +1 -0
- package/dist/ui/react/jaaq-ui-react.min.js +8 -0
- package/dist/ui/react/jaaq-ui-react.min.js.map +1 -0
- package/dist/ui/vanilla/index.cjs +5052 -0
- package/dist/ui/vanilla/index.cjs.map +1 -0
- package/dist/ui/vanilla/index.d.ts +465 -0
- package/dist/ui/vanilla/index.mjs +5044 -0
- package/dist/ui/vanilla/index.mjs.map +1 -0
- package/dist/ui/vanilla/jaaq-vanilla-bundled.min.js +8 -0
- package/dist/ui/vanilla/jaaq-vanilla-bundled.min.js.map +1 -0
- package/dist/ui/vanilla/jaaq-vanilla.min.js +8 -0
- package/dist/ui/vanilla/jaaq-vanilla.min.js.map +1 -0
- package/dist/ui/webcomponents/index.cjs +4619 -0
- package/dist/ui/webcomponents/index.cjs.map +1 -0
- package/dist/ui/webcomponents/index.d.ts +288 -0
- package/dist/ui/webcomponents/index.mjs +4614 -0
- package/dist/ui/webcomponents/index.mjs.map +1 -0
- package/dist/ui/webcomponents/jaaq-webcomponents-bundled.min.js +8 -0
- package/dist/ui/webcomponents/jaaq-webcomponents-bundled.min.js.map +1 -0
- package/dist/ui/webcomponents/jaaq-webcomponents.min.js +8 -0
- package/dist/ui/webcomponents/jaaq-webcomponents.min.js.map +1 -0
- package/package.json +42 -2
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("hls.js")):"function"==typeof define&&define.amd?define(["exports","react","hls.js"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).JaaqUIReact={},e.React,e.Hls)}(this,function(e,t,n){"use strict";function i(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var o=i(t);function s(e){const{baseUrl:t,apiKey:n,clientId:i,fetch:o}=e,s=o??globalThis.fetch;if(!s)throw new Error("No fetch implementation found. Provide one in SDKConfig.fetch for Node or custom environments.");const a={"Content-Type":"application/json","x-api-key":n},r=e=>function(e,t,n){if(/^https?:\/\//i.test(n))return n;const i=e.replace(/\/+$/,""),o=n.replace(/^\/+/,"");return`${i}/b2b/v1/subscription/${encodeURIComponent(t)}${o.startsWith("/")?o:`/${o}`}`}(t,i,e),l=async(e,t,n,i)=>{const o={method:e,headers:{...a,...n?.headers},...n};void 0!==i&&(o.body=JSON.stringify(i));return async function(e){if(!e.ok){const t=await e.text().catch(()=>"");throw new Error(`HTTP ${e.status}: ${t||e.statusText}`)}if(204!==e.status)return e.json()}(await s(r(t),o))};return{get:(e,t)=>l("GET",e,t),post:(e,t,n)=>l("POST",e,n,t),put:(e,t,n)=>l("PUT",e,n,t),patch:(e,t,n)=>l("PATCH",e,n,t),delete:(e,t)=>l("DELETE",e,t)}}const a="https://api.jaaq.app";class r{constructor(e){this.videos=function(e){return{async getById(t){const n=`/videos/${encodeURIComponent(t)}`;return(await e.get(n)).video}}}(e),this.collections=function(e){return{list:async()=>(await e.get("/collections")).collections,async getById(t){const n=`/collections/${encodeURIComponent(t)}`;return(await e.get(n)).collection}}}(e)}static fromHttp(e){return new r(e)}static init(e){return l(e)}}function l(e){const{baseUrl:t=a,apiKey:n,clientId:i,fetch:o}=e,l=s({baseUrl:t,apiKey:n,clientId:i,fetch:o??globalThis.fetch});return r.fromHttp(l)}function c(e,t,n){return Math.max(t,Math.min(n,e))}var d=".jaaq-video-player {\n position: relative;\n width: 100%;\n max-width: none;\n margin: 0;\n background: #000;\n border-radius: 12px;\n overflow: hidden;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n aspect-ratio: 9 / 16;\n}\n\n.jaaq-video-player video {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: block;\n background: #000;\n object-fit: cover;\n}\n\n.jaaq-video-player.fullscreen {\n max-width: 100%;\n border-radius: 0;\n aspect-ratio: auto;\n}\n\n.jaaq-controls {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);\n padding: 40px 16px 16px;\n opacity: 1;\n z-index: 5;\n}\n\n.jaaq-progress-bar {\n width: 100%;\n flex: 1 1 0;\n min-width: 80px;\n height: 4px;\n background: rgba(255, 255, 255, 0.3);\n border-radius: 2px;\n cursor: pointer;\n position: relative;\n}\n\n.jaaq-progress-filled {\n height: 100%;\n background: #007bff;\n border-radius: 2px;\n width: 0%;\n transition: width 0.1s linear;\n}\n\n.jaaq-progress-bar:hover .jaaq-progress-filled {\n background: #0056b3;\n}\n\n.jaaq-controls-bottom {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 12px;\n color: white;\n}\n\n.jaaq-control-btn {\n background: transparent;\n border: none;\n color: white;\n cursor: pointer;\n padding: 8px;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: transform 0.2s;\n font-size: 20px;\n line-height: 1;\n}\n\n.jaaq-control-btn:hover {\n transform: scale(1.1);\n}\n\n.jaaq-control-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.jaaq-loading {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 50px;\n height: 50px;\n border: 4px solid rgba(255, 255, 255, 0.3);\n border-top-color: #007bff;\n border-radius: 50%;\n animation: jaaq-spin 1s linear infinite;\n}\n\n@keyframes jaaq-spin {\n to {\n transform: translate(-50%, -50%) rotate(360deg);\n }\n}\n\n.jaaq-error {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: rgba(220, 53, 69, 0.9);\n color: white;\n padding: 16px 24px;\n border-radius: 8px;\n max-width: 80%;\n text-align: center;\n font-size: 14px;\n}\n\n.jaaq-video-info {\n padding: 16px;\n background: #f8f9fa;\n border-radius: 0 0 12px 12px;\n margin-top: -12px;\n}\n\n.jaaq-video-info h3 {\n margin: 0 0 8px 0;\n color: #333;\n font-size: 18px;\n font-weight: 600;\n}\n\n.jaaq-video-info p {\n margin: 4px 0;\n color: #666;\n font-size: 14px;\n}\n\n.jaaq-video-info strong {\n color: #333;\n}\n\n.jaaq-logo {\n position: absolute;\n top: 20px;\n left: 22px;\n color: white;\n font-size: 16px;\n font-weight: 600;\n z-index: 10;\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n letter-spacing: 0.5px;\n pointer-events: none;\n}\n\n.jaaq-center-play-btn {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 84px;\n height: 84px;\n background: transparent;\n border: none;\n cursor: pointer;\n z-index: 15;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: transform 0.2s;\n padding: 0;\n}\n\n.jaaq-center-play-btn:hover {\n transform: translate(-50%, -50%) scale(1.1);\n}\n\n.jaaq-center-play-btn svg {\n width: 100%;\n height: 100%;\n filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));\n}\n\n.jaaq-video-player.is-playing .jaaq-center-play-btn {\n display: none;\n}\n\n.jaaq-gradient-overlay {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(180deg, transparent 0%, #0f0f0f 100%);\n padding: 80px 22px 85px;\n pointer-events: none;\n z-index: 5;\n}\n\n.jaaq-caption-display {\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n font-weight: 400;\n font-size: 16px;\n line-height: 20px;\n color: white;\n background: rgba(0, 0, 0, 0.8);\n padding: 8px 16px;\n margin-bottom: 12px;\n border-radius: 4px;\n text-align: center;\n max-width: 90%;\n margin-left: auto;\n margin-right: auto;\n}\n\n.jaaq-video-title {\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n font-weight: 600;\n font-size: 18.695px;\n line-height: 21.5px;\n color: white;\n margin-bottom: 8px;\n letter-spacing: 0.37px;\n}\n\n.jaaq-video-author {\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n font-weight: 500;\n font-size: 14.021px;\n line-height: 16.825px;\n color: white;\n opacity: 0.7;\n margin-bottom: 8px;\n letter-spacing: -0.14px;\n}\n\n.jaaq-video-description {\n font-family:\n 'Archivo',\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n Roboto,\n sans-serif;\n font-weight: 400;\n font-size: 11px;\n line-height: 16px;\n color: #aaa8aa;\n letter-spacing: -0.11px;\n}\n\n.jaaq-description-text {\n color: #aaa8aa;\n}\n\n.jaaq-read-more {\n color: white;\n cursor: pointer;\n pointer-events: auto;\n}\n\n.jaaq-read-more:hover {\n text-decoration: underline;\n}\n\n.jaaq-progress-bar {\n background: rgba(255, 255, 255, 0.2);\n}\n\n.jaaq-progress-filled {\n background: white;\n}\n\n.jaaq-captions-btn {\n font-size: 14px;\n font-weight: 600;\n border: 1.5px solid white;\n border-radius: 3px;\n padding: 4px 6px;\n line-height: 1;\n}\n\n.jaaq-captions-btn.active {\n background: white;\n color: #000;\n}\n";class u{constructor(e,t){if(this.client=null,this.hls=null,this.videoElement=null,this.listeners=new Map,this.captionCues=[],this.elements={},this.container="string"==typeof e?document.querySelector(e):e,!this.container)throw new Error("Container element not found");if(this.config=t,this.state={isPlaying:!1,currentTime:0,duration:0,volume:1,isMuted:!1,isFullscreen:!1,isLoading:!0,error:null,videoData:null,captionsEnabled:!1},t.client)this.client=t.client;else{if(!t.apiKey||!t.clientId)throw new Error("Please provide either a client instance or apiKey and clientId");this.client=function(e){return l(e)}({apiKey:t.apiKey,clientId:t.clientId,baseUrl:t.baseUrl})}this.init()}async init(){this.createDOM(),await this.loadVideo(),this.attachEventListeners()}createDOM(){this.container.innerHTML="";const e=document.createElement("div");e.style.width=this.config.width||"100%",e.style.height=this.config.height||"auto";const t=document.createElement("div");t.className=`jaaq-video-player jaaq-vanilla-player ${this.config.className||""}`,this.elements.player=t;const n=document.createElement("video");this.videoElement=n,t.appendChild(n);const i=document.createElement("div");i.className="jaaq-logo",i.innerHTML='\n <svg xmlns="http://www.w3.org/2000/svg" width="50" height="15" viewBox="0 0 50 15" fill="none">\n <path d="M48.0329 10.7826C48.7578 9.6622 49.1402 8.37108 49.1402 7.02322C49.1402 3.19784 46.0283 0.0859375 42.2029 0.0859375C38.3775 0.0859375 35.2656 3.19784 35.2656 7.02322C35.2656 10.8486 38.3753 13.9578 42.1985 13.9605C42.1991 13.9605 42.2002 13.9605 42.2007 13.9605H42.2029C43.8475 13.9605 45.4305 13.3687 46.6698 12.3285L49.9971 14.56V12.0999L48.0334 10.7826H48.0329ZM37.309 7.02322C37.309 4.32479 39.5045 2.12927 42.2035 2.12927C44.9024 2.12927 47.0974 4.32479 47.0974 7.02322C47.0974 7.96252 46.8345 8.862 46.3359 9.64475L43.9817 8.06561C43.4531 7.71378 42.8373 7.52778 42.2002 7.52778C40.4394 7.52778 39.0054 8.95036 38.9846 10.7062C37.9586 9.80839 37.3084 8.49053 37.3084 7.02322H37.309ZM42.2035 11.9172C42.2035 11.9172 42.2002 11.9172 42.1985 11.9172C41.5527 11.9161 41.0274 11.3903 41.0274 10.7439C41.0274 10.0975 41.5538 9.57056 42.2007 9.57056C42.4331 9.57056 42.6578 9.6382 42.8493 9.76584L44.8714 11.1224C44.0853 11.633 43.1586 11.9172 42.2029 11.9172H42.2035Z" fill="white"/>\n <path d="M31.0751 0.686201C30.9856 0.579834 30.8858 0.483286 30.7767 0.39983C30.4374 0.138004 30.0283 0 29.5946 0C29.161 0 28.7524 0.138549 28.4126 0.39983C28.2304 0.540561 28.0755 0.711838 27.9533 0.909844C27.8835 1.02276 27.8257 1.14003 27.7815 1.25785L23.1172 13.7317H25.4551L29.5946 2.66135L33.7342 13.7317H36.0721L31.4078 1.25785C31.3303 1.05003 31.218 0.858024 31.0745 0.686746L31.0751 0.686201Z" fill="white"/>\n <path d="M17.4969 0.686201C17.4075 0.579834 17.3076 0.483286 17.1986 0.39983C16.8593 0.138004 16.4502 0 16.0165 0C15.5829 0 15.1743 0.138549 14.8345 0.39983C14.6523 0.540561 14.4974 0.711838 14.3752 0.909844C14.3054 1.02276 14.2476 1.14003 14.2034 1.25785L9.53906 13.7317H11.8769L16.0165 2.66135L20.1561 13.7317H22.494L17.8302 1.25731C17.7527 1.04948 17.6404 0.857478 17.4969 0.686201Z" fill="white"/>\n <path d="M9.86046 0.511825V0.371094H7.82204V9.02333C7.82204 10.6248 6.51891 11.928 4.91741 11.928C3.47028 11.928 2.23261 10.849 2.03897 9.41771L2.01988 9.27807L1.88024 9.29716L0.13964 9.5328L0 9.5519L0.0190914 9.69154C0.348555 12.1292 2.45462 13.9669 4.91741 13.9669C7.64313 13.9669 9.86046 11.7496 9.86046 9.02388V0.511825Z" fill="white"/>\n </svg>\n ',this.elements.logo=i,t.appendChild(i);const o=document.createElement("button");o.className="jaaq-center-play-btn",o.innerHTML='\n <svg viewBox="0 0 84 84" fill="none">\n <circle cx="42" cy="42" r="42" fill="white" fill-opacity="0.9"/>\n <path d="M33 28L56 42L33 56V28Z" fill="#000"/>\n </svg>\n ',o.setAttribute("aria-label","Play video"),this.elements.centerPlayBtn=o,t.appendChild(o);const s=document.createElement("div");s.className="jaaq-gradient-overlay",this.elements.gradientOverlay=s;const a=document.createElement("div");a.className="jaaq-caption-display",a.style.display="none",this.elements.captionDisplay=a,s.appendChild(a);const r=document.createElement("div");r.className="jaaq-video-title",this.elements.videoTitle=r,s.appendChild(r);const l=document.createElement("div");l.className="jaaq-video-author",this.elements.videoAuthor=l,s.appendChild(l);const c=document.createElement("div");c.className="jaaq-video-description",this.elements.videoDescription=c,s.appendChild(c),t.appendChild(s);const d=document.createElement("div");d.className="jaaq-loading",this.elements.loading=d,t.appendChild(d);const u=document.createElement("div");u.className="jaaq-error",u.style.display="none",this.elements.error=u,t.appendChild(u);const p=document.createElement("div");p.className="jaaq-controls",this.elements.controls=p;const h=document.createElement("div");h.className="jaaq-controls-bottom";const f=document.createElement("button");f.className="jaaq-control-btn",f.textContent="▶",f.setAttribute("aria-label","Play"),this.elements.playPauseBtn=f,h.appendChild(f);const m=document.createElement("button");m.className="jaaq-control-btn",m.innerHTML='\n <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" viewBox="0 0 22 20" fill="none">\n <path d="M11.2168 19.9287L4.20801 13.7031H0V6.22559H4.20898L11.2168 0V19.9287ZM14.0215 0.150391C16.2405 0.150468 18.1409 1.39074 19.4385 3.17676C20.7365 4.9634 21.499 7.36811 21.499 9.96484C21.499 12.5613 20.7363 14.9654 19.4385 16.752C18.1409 18.538 16.2405 19.7792 14.0215 19.7793V17.1025C15.2032 17.1025 16.3824 16.4464 17.3135 15.165C18.2442 13.8839 18.8593 12.0493 18.8594 9.96484C18.8594 7.88034 18.2442 6.04581 17.3135 4.76465C16.3824 3.4832 15.2033 2.82723 14.0215 2.82715V0.150391ZM14.0215 5.75879C15.5701 5.75896 16.8252 7.64189 16.8252 9.96484C16.8251 12.2877 15.57 14.1707 14.0215 14.1709V5.75879Z" fill="white"/>\n </svg>\n ',m.setAttribute("aria-label","Mute"),this.elements.volumeBtn=m,h.appendChild(m);const g=document.createElement("div");g.className="jaaq-progress-bar",this.elements.progressBar=g;const v=document.createElement("div");v.className="jaaq-progress-filled",this.elements.progressFilled=v,g.appendChild(v),h.appendChild(g);const y=document.createElement("button");y.className="jaaq-control-btn jaaq-captions-btn",y.innerHTML="CC",y.setAttribute("aria-label","Captions"),this.elements.captionsBtn=y,h.appendChild(y);const b=document.createElement("button");b.className="jaaq-control-btn",b.textContent="⛶",b.setAttribute("aria-label","Fullscreen"),this.elements.fullscreenBtn=b,h.appendChild(b),p.appendChild(h),t.appendChild(p),e.appendChild(t),this.container.appendChild(e),this.updateControlsVisibility()}updateControlsVisibility(){const e=!1!==this.config.controls;this.elements.controls&&(this.elements.controls.style.display=e?"":"none")}async loadVideo(){if(this.client&&this.videoElement)try{this.setState({isLoading:!0,error:null});const e=await this.client.videos.getById(this.config.videoId);this.setState({videoData:e}),e.subtitle&&(this.captionCues=this.parseWebVTT(e.subtitle)),this.updateOverlayContent(e),this.emit("loaded",e);const t=e.videoUrl;if(t.includes(".m3u8"))if(n.isSupported()){this.hls&&this.hls.destroy();const e=new n({enableWorker:!0,lowLatencyMode:!0});e.loadSource(t),e.attachMedia(this.videoElement),e.on(n.Events.MANIFEST_PARSED,()=>{this.setState({isLoading:!1}),this.elements.loading&&(this.elements.loading.style.display="none"),this.config.autoplay&&this.play()}),e.on(n.Events.ERROR,(e,t)=>{if(t.fatal){const e=`HLS Error: ${t.type} - ${t.details}`;this.showError(e),this.emit("error",new Error(e))}}),this.hls=e}else{if(!this.videoElement.canPlayType("application/vnd.apple.mpegurl"))throw new Error("HLS is not supported in this browser");this.videoElement.src=t,this.setState({isLoading:!1}),this.elements.loading&&(this.elements.loading.style.display="none"),this.config.autoplay&&this.play()}else this.videoElement.src=t,this.setState({isLoading:!1}),this.elements.loading&&(this.elements.loading.style.display="none"),this.config.autoplay&&this.play()}catch(e){const t=e instanceof Error?e.message:"Failed to load video";this.showError(t),this.setState({isLoading:!1}),this.emit("error",e instanceof Error?e:new Error(t))}}parseWebVTT(e){const t=[],n=e.split("\n");let i=0;for(;i<n.length;){const e=n[i].trim();if(e.includes("--\x3e")){const[o,s]=e.split("--\x3e").map(e=>e.trim()),a=e=>{const t=e.split(":");if(3===t.length){return 3600*parseFloat(t[0])+60*parseFloat(t[1])+parseFloat(t[2])}if(2===t.length){return 60*parseFloat(t[0])+parseFloat(t[1])}return 0},r=a(o),l=a(s);i++;const c=[];for(;i<n.length&&""!==n[i].trim();)c.push(n[i].trim()),i++;c.length>0&&t.push({start:r,end:l,text:c.join(" ")})}i++}return t}updateOverlayContent(e){const t=!1!==this.config.showLogo,n=!1!==this.config.showTitle,i=!1!==this.config.showAuthor,o=!1!==this.config.showDescription,s=!1!==this.config.showCaptions;if(this.elements.logo&&(this.elements.logo.style.display=t?"block":"none"),this.elements.videoTitle&&(this.elements.videoTitle.textContent=e.question||"",this.elements.videoTitle.style.display=n&&e.question?"block":"none"),this.elements.videoAuthor){const t=e.author||e.creator||e.userName||"";this.elements.videoAuthor.textContent=t,this.elements.videoAuthor.style.display=i&&t?"block":"none"}if(this.elements.videoDescription){if(e.description){const t=150,n=e.description.length>t?e.description.substring(0,t)+"...":e.description;this.elements.videoDescription.innerHTML=`\n <span class="jaaq-description-text">${n}</span>\n ${e.description.length>t?'<span class="jaaq-read-more"> Read more</span>':""}\n `}this.elements.videoDescription.style.display=o&&e.description?"block":"none"}this.elements.captionsBtn&&(this.elements.captionsBtn.style.display=s?"flex":"none")}attachEventListeners(){this.videoElement&&(this.videoElement.addEventListener("play",()=>{this.setState({isPlaying:!0}),this.updatePlayPauseButton(),this.elements.centerPlayBtn&&(this.elements.centerPlayBtn.style.display="none"),this.emit("play",void 0)}),this.videoElement.addEventListener("pause",()=>{this.setState({isPlaying:!1}),this.updatePlayPauseButton(),this.elements.centerPlayBtn&&(this.elements.centerPlayBtn.style.display="flex"),this.emit("pause",void 0)}),this.videoElement.addEventListener("timeupdate",()=>{this.setState({currentTime:this.videoElement.currentTime}),this.updateProgress(),this.updateCaptions(),this.emit("timeupdate",this.videoElement.currentTime)}),this.videoElement.addEventListener("durationchange",()=>{this.setState({duration:this.videoElement.duration})}),this.videoElement.addEventListener("volumechange",()=>{this.setState({volume:this.videoElement.volume,isMuted:this.videoElement.muted}),this.updateVolumeUI(),this.emit("volumechange",this.videoElement.volume)}),this.videoElement.addEventListener("ended",()=>{this.emit("ended",void 0)}),this.elements.playPauseBtn?.addEventListener("click",()=>{this.togglePlayPause()}),this.elements.centerPlayBtn?.addEventListener("click",()=>{this.play(),this.elements.centerPlayBtn&&(this.elements.centerPlayBtn.style.display="none")}),this.elements.progressBar?.addEventListener("click",e=>{this.handleSeek(e)}),this.elements.volumeBtn?.addEventListener("click",()=>{this.toggleMute()}),this.elements.captionsBtn?.addEventListener("click",()=>{this.toggleCaptions()}),this.elements.fullscreenBtn?.addEventListener("click",()=>{this.toggleFullscreen()}),document.addEventListener("fullscreenchange",()=>{const e=!!document.fullscreenElement;this.setState({isFullscreen:e}),this.elements.player?.classList.toggle("fullscreen",e),this.emit("fullscreenchange",e)}),this.elements.player?.addEventListener("mousemove",()=>{this.elements.player?.classList.remove("is-paused")}),this.videoElement.addEventListener("pause",()=>{this.elements.player?.classList.add("is-paused")}),this.videoElement.addEventListener("play",()=>{this.elements.player?.classList.remove("is-paused")}))}setState(e){this.state={...this.state,...e}}updatePlayPauseButton(){this.elements.playPauseBtn&&(this.elements.playPauseBtn.textContent=this.state.isPlaying?"⏸":"▶",this.elements.playPauseBtn.setAttribute("aria-label",this.state.isPlaying?"Pause":"Play"))}updateProgress(){if(this.elements.progressFilled&&this.state.duration>0){const e=this.state.currentTime/this.state.duration*100;this.elements.progressFilled.style.width=`${e}%`}}updateVolumeUI(){if(this.elements.volumeBtn){const{isMuted:e,volume:t}=this.state;this.elements.volumeBtn.innerHTML=e||0===t?'\n <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" viewBox="0 0 22 20" fill="none">\n <path d="M11.2168 19.9287L4.20801 13.7031H0V6.22559H4.20898L11.2168 0V19.9287Z" fill="white"/>\n </svg>\n ':'\n <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" viewBox="0 0 22 20" fill="none">\n <path d="M11.2168 19.9287L4.20801 13.7031H0V6.22559H4.20898L11.2168 0V19.9287ZM14.0215 0.150391C16.2405 0.150468 18.1409 1.39074 19.4385 3.17676C20.7365 4.9634 21.499 7.36811 21.499 9.96484C21.499 12.5613 20.7363 14.9654 19.4385 16.752C18.1409 18.538 16.2405 19.7792 14.0215 19.7793V17.1025C15.2032 17.1025 16.3824 16.4464 17.3135 15.165C18.2442 13.8839 18.8593 12.0493 18.8594 9.96484C18.8594 7.88034 18.2442 6.04581 17.3135 4.76465C16.3824 3.4832 15.2033 2.82723 14.0215 2.82715V0.150391ZM14.0215 5.75879C15.5701 5.75896 16.8252 7.64189 16.8252 9.96484C16.8251 12.2877 15.57 14.1707 14.0215 14.1709V5.75879Z" fill="white"/>\n </svg>\n '}}updateCaptions(){if(!this.elements.captionDisplay||!this.state.captionsEnabled)return void(this.elements.captionDisplay&&(this.elements.captionDisplay.style.display="none"));const e=this.state.currentTime,t=this.captionCues.find(t=>e>=t.start&&e<=t.end);t?(this.elements.captionDisplay.textContent=t.text,this.elements.captionDisplay.style.display="block"):this.elements.captionDisplay.style.display="none"}handleSeek(e){if(!this.videoElement||!this.state.duration||!this.elements.progressBar)return;const t=this.elements.progressBar.getBoundingClientRect(),n=(e.clientX-t.left)/t.width;this.videoElement.currentTime=this.state.duration*c(n,0,1)}showError(e){this.setState({error:e,isLoading:!1}),this.elements.error&&(this.elements.error.textContent=e,this.elements.error.style.display="block"),this.elements.loading&&(this.elements.loading.style.display="none")}togglePlayPause(){this.state.isPlaying?this.pause():this.play()}toggleCaptions(){this.setState({captionsEnabled:!this.state.captionsEnabled}),this.updateCaptionsButton(),this.updateCaptions()}updateCaptionsButton(){this.elements.captionsBtn&&(this.state.captionsEnabled?this.elements.captionsBtn.classList.add("active"):this.elements.captionsBtn.classList.remove("active"))}toggleFullscreen(){var e;this.elements.player&&(e=this.elements.player,document.fullscreenElement?document.exitFullscreen():e.requestFullscreen())}play(){this.videoElement?.play()}pause(){this.videoElement?.pause()}setVolume(e){this.videoElement&&(this.videoElement.volume=c(e,0,1),this.videoElement.muted=0===e)}toggleMute(){this.videoElement&&(this.videoElement.muted=!this.videoElement.muted)}seek(e){this.videoElement&&(this.videoElement.currentTime=c(e,0,this.state.duration))}setFeatures(e){this.config={...this.config,...e},void 0!==e.controls&&this.updateControlsVisibility(),this.state.videoData?this.updateOverlayContent(this.state.videoData):(void 0!==e.showLogo&&this.elements.logo&&(this.elements.logo.style.display=e.showLogo?"block":"none"),void 0!==e.showCaptions&&this.elements.captionsBtn&&(this.elements.captionsBtn.style.display=e.showCaptions?"flex":"none"))}getState(){return{...this.state}}on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t)}off(e,t){const n=this.listeners.get(e);n&&n.delete(t)}emit(e,t){const n=this.listeners.get(e);n&&n.forEach(e=>e(t))}destroy(){this.hls&&(this.hls.destroy(),this.hls=null),this.videoElement&&(this.videoElement.pause(),this.videoElement.src="",this.videoElement=null),this.listeners.clear(),this.container.innerHTML=""}}class p extends HTMLElement{static get observedAttributes(){return["video-id","api-key","client-id","autoplay","base-url","width","height","controls","show-logo","show-title","show-author","show-description","show-captions"]}constructor(){super(),this.player=null,this.container=null,this.clientInstance=null,this.connected=!1,this.attachShadow({mode:"open"})}connectedCallback(){this.connected=!0,this.render(),this.initPlayer()}disconnectedCallback(){this.connected=!1,this.destroyPlayer()}attributeChangedCallback(e,t,n){if(this.connected&&t!==n)if("video-id"===e&&this.player)this.destroyPlayer(),this.initPlayer();else if("width"===e||"height"===e)this.updateContainerStyles();else if(("controls"===e||"show-logo"===e||"show-title"===e||"show-author"===e||"show-description"===e||"show-captions"===e)&&this.player){const t={};"controls"===e?t.controls=!this.hasAttribute("controls")||"false"!==this.getAttribute("controls"):"show-logo"===e?t.showLogo=!this.hasAttribute("show-logo")||"false"!==this.getAttribute("show-logo"):"show-title"===e?t.showTitle=!this.hasAttribute("show-title")||"false"!==this.getAttribute("show-title"):"show-author"===e?t.showAuthor=!this.hasAttribute("show-author")||"false"!==this.getAttribute("show-author"):"show-description"===e?t.showDescription=!this.hasAttribute("show-description")||"false"!==this.getAttribute("show-description"):"show-captions"===e&&(t.showCaptions=!this.hasAttribute("show-captions")||"false"!==this.getAttribute("show-captions")),this.player.setFeatures(t)}}render(){if(!this.shadowRoot)return;const e=document.createElement("style");e.textContent=`\n ${d}\n .jaaq-vanilla-player {\n user-select: none;\n}\n\n.jaaq-vanilla-player video {\n outline: none;\n}\n\n.jaaq-collection-player {\n width: 100%;\n max-width: 1400px;\n margin: 0 auto;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n}\n\n.jaaq-collection-loading {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 400px;\n}\n\n.jaaq-collection-spinner {\n width: 50px;\n height: 50px;\n border: 4px solid rgba(0, 123, 255, 0.3);\n border-top-color: #007bff;\n border-radius: 50%;\n animation: jaaq-collection-spin 1s linear infinite;\n}\n\n@keyframes jaaq-collection-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n.jaaq-collection-error {\n background: rgba(220, 53, 69, 0.9);\n color: white;\n padding: 16px 24px;\n border-radius: 8px;\n text-align: center;\n font-size: 14px;\n margin: 20px;\n}\n\n.jaaq-collection-carousel .splide__track {\n padding: 40px 0;\n}\n\n.jaaq-collection-carousel .splide__slide {\n opacity: 0.7;\n transition: all 0.3s ease;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.jaaq-collection-carousel .splide__slide.is-active {\n opacity: 1;\n}\n\n.jaaq-collection-carousel .splide__slide jaaq-video-player {\n width: 100%;\n max-width: 600px;\n transition: all 0.3s ease;\n}\n\n.jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 800px;\n}\n\n.jaaq-collection-carousel .splide__arrow {\n background: rgba(0, 0, 0, 0.5);\n border: none;\n width: 48px;\n height: 48px;\n border-radius: 50%;\n color: white;\n cursor: pointer;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 20px;\n}\n\n.jaaq-collection-carousel .splide__arrow:hover {\n background: rgba(0, 0, 0, 0.8);\n transform: scale(1.1);\n}\n\n.jaaq-collection-carousel .splide__arrow:disabled {\n opacity: 0.3;\n cursor: not-allowed;\n}\n\n.jaaq-collection-carousel .splide__arrow svg {\n fill: white;\n width: 20px;\n height: 20px;\n}\n\n.jaaq-collection-carousel .splide__pagination {\n bottom: -30px;\n}\n\n.jaaq-collection-carousel .splide__pagination__page {\n background: #ccc;\n border: none;\n width: 10px;\n height: 10px;\n margin: 0 4px;\n border-radius: 50%;\n transition: all 0.2s;\n cursor: pointer;\n}\n\n.jaaq-collection-carousel .splide__pagination__page.is-active {\n background: #007bff;\n transform: scale(1.3);\n}\n\n@media (max-width: 1024px) {\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 500px;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 650px;\n }\n}\n\n@media (max-width: 768px) {\n .jaaq-collection-carousel .splide__track {\n padding: 20px 0;\n }\n\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 400px;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 500px;\n }\n\n .jaaq-collection-carousel .splide__arrow {\n width: 40px;\n height: 40px;\n }\n}\n\n@media (max-width: 480px) {\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 100%;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 100%;\n }\n}\n\n \n:host {\n display: block;\n width: 100%;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n `,this.container=document.createElement("div"),this.container.className="jaaq-webcomponent-container",this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.container),this.updateContainerStyles()}updateContainerStyles(){if(!this.container)return;const e=this.getAttribute("width")||"100%",t=this.getAttribute("height")||"auto";this.container.style.width=e,this.container.style.height=t}async initPlayer(){if(!this.container||this.player)return;const e=this.getAttribute("video-id");if(!e)return void this.emitError(new Error("video-id attribute is required"));const t=this.getAttribute("api-key"),n=this.getAttribute("client-id"),i=this.getAttribute("base-url")||void 0,o=this.hasAttribute("autoplay")&&"false"!==this.getAttribute("autoplay"),s=!this.hasAttribute("controls")||"false"!==this.getAttribute("controls"),a=!this.hasAttribute("show-logo")||"false"!==this.getAttribute("show-logo"),r=!this.hasAttribute("show-title")||"false"!==this.getAttribute("show-title"),l=!this.hasAttribute("show-author")||"false"!==this.getAttribute("show-author"),c=!this.hasAttribute("show-description")||"false"!==this.getAttribute("show-description"),d=!this.hasAttribute("show-captions")||"false"!==this.getAttribute("show-captions");if(this.clientInstance||t||n)try{this.player=new u(this.container,{videoId:e??void 0,apiKey:t??void 0,clientId:n??void 0,client:this.clientInstance||void 0,baseUrl:i,autoplay:o,controls:s,showLogo:a,showTitle:r,showAuthor:l,showDescription:c,showCaptions:d}),this.attachPlayerEvents()}catch(e){this.emitError(e instanceof Error?e:new Error("Failed to initialize player"))}else this.emitError(new Error("Either client property or api-key and client-id attributes are required"))}attachPlayerEvents(){this.player&&(this.player.on("loaded",e=>{this.dispatchEvent(new CustomEvent("jaaq:loaded",{detail:e,bubbles:!0,composed:!0}))}),this.player.on("play",()=>{this.dispatchEvent(new CustomEvent("jaaq:play",{bubbles:!0,composed:!0}))}),this.player.on("pause",()=>{this.dispatchEvent(new CustomEvent("jaaq:pause",{bubbles:!0,composed:!0}))}),this.player.on("timeupdate",e=>{this.dispatchEvent(new CustomEvent("jaaq:timeupdate",{detail:e,bubbles:!0,composed:!0}))}),this.player.on("volumechange",e=>{this.dispatchEvent(new CustomEvent("jaaq:volumechange",{detail:e,bubbles:!0,composed:!0}))}),this.player.on("ended",()=>{this.dispatchEvent(new CustomEvent("jaaq:ended",{bubbles:!0,composed:!0}))}),this.player.on("error",e=>{this.emitError(e)}),this.player.on("fullscreenchange",e=>{this.dispatchEvent(new CustomEvent("jaaq:fullscreenchange",{detail:e,bubbles:!0,composed:!0}))}))}emitError(e){this.dispatchEvent(new CustomEvent("jaaq:error",{detail:e,bubbles:!0,composed:!0}))}destroyPlayer(){this.player&&(this.player.destroy(),this.player=null)}get client(){return this.clientInstance}set client(e){this.clientInstance=e,this.connected&&(this.destroyPlayer(),this.initPlayer())}get videoId(){return this.getAttribute("video-id")}set videoId(e){e?this.setAttribute("video-id",e):this.removeAttribute("video-id")}play(){this.player?.play()}pause(){this.player?.pause()}setVolume(e){this.player?.setVolume(e)}toggleMute(){this.player?.toggleMute()}seek(e){this.player?.seek(e)}getState(){return this.player?.getState()||null}destroy(){this.destroyPlayer()}}function h(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}
|
|
2
|
+
/*!
|
|
3
|
+
* Splide.js
|
|
4
|
+
* Version : 4.1.4
|
|
5
|
+
* License : MIT
|
|
6
|
+
* Copyright: 2022 Naotoshi Fujita
|
|
7
|
+
*/var f="(prefers-reduced-motion: reduce)",m={CREATED:1,MOUNTED:2,IDLE:3,MOVING:4,SCROLLING:5,DRAGGING:6,DESTROYED:7};function g(e){e.length=0}function v(e,t,n){return Array.prototype.slice.call(e,t,n)}function y(e){return e.bind.apply(e,[null].concat(v(arguments,1)))}var b=setTimeout,w=function(){};function x(e){return requestAnimationFrame(e)}function _(e,t){return typeof t===e}function E(e){return!L(e)&&_("object",e)}var C=Array.isArray,j=y(_,"function"),q=y(_,"string"),k=y(_,"undefined");function L(e){return null===e}function S(e){try{return e instanceof(e.ownerDocument.defaultView||window).HTMLElement}catch(e){return!1}}function A(e){return C(e)?e:[e]}function P(e,t){A(e).forEach(t)}function I(e,t){return e.indexOf(t)>-1}function M(e,t){return e.push.apply(e,A(t)),e}function T(e,t,n){e&&P(t,function(t){t&&e.classList[n?"add":"remove"](t)})}function D(e,t){T(e,q(t)?t.split(" "):t,!0)}function B(e,t){P(t,e.appendChild.bind(e))}function N(e,t){P(e,function(e){var n=(t||e).parentNode;n&&n.insertBefore(e,t)})}function z(e,t){return S(e)&&(e.msMatchesSelector||e.matches).call(e,t)}function F(e,t){var n=e?v(e.children):[];return t?n.filter(function(e){return z(e,t)}):n}function H(e,t){return t?F(e,t)[0]:e.firstElementChild}var R=Object.keys;function O(e,t,n){return e&&(n?R(e).reverse():R(e)).forEach(function(n){"__proto__"!==n&&t(e[n],n)}),e}function V(e){return v(arguments,1).forEach(function(t){O(t,function(n,i){e[i]=t[i]})}),e}function U(e){return v(arguments,1).forEach(function(t){O(t,function(t,n){C(t)?e[n]=t.slice():E(t)?e[n]=U({},E(e[n])?e[n]:{},t):e[n]=t})}),e}function $(e,t){P(t||R(e),function(t){delete e[t]})}function K(e,t){P(e,function(e){P(t,function(t){e&&e.removeAttribute(t)})})}function W(e,t,n){E(t)?O(t,function(t,n){W(e,n,t)}):P(e,function(e){L(n)||""===n?K(e,t):e.setAttribute(t,String(n))})}function X(e,t,n){var i=document.createElement(e);return t&&(q(t)?D(i,t):W(i,t)),n&&B(n,i),i}function Z(e,t,n){if(k(n))return getComputedStyle(e)[t];L(n)||(e.style[t]=""+n)}function G(e,t){Z(e,"display",t)}function Y(e){e.setActive&&e.setActive()||e.focus({preventScroll:!0})}function J(e,t){return e.getAttribute(t)}function Q(e,t){return e&&e.classList.contains(t)}function ee(e){return e.getBoundingClientRect()}function te(e){P(e,function(e){e&&e.parentNode&&e.parentNode.removeChild(e)})}function ne(e){return H((new DOMParser).parseFromString(e,"text/html").body)}function ie(e,t){e.preventDefault(),t&&(e.stopPropagation(),e.stopImmediatePropagation())}function oe(e,t){return e&&e.querySelector(t)}function se(e,t){return t?v(e.querySelectorAll(t)):[]}function ae(e,t){T(e,t,!1)}function re(e){return e.timeStamp}function le(e){return q(e)?e:e?e+"px":""}var ce="splide",de="data-"+ce;function ue(e,t){if(!e)throw new Error("["+ce+"] "+(t||""))}var pe=Math.min,he=Math.max,fe=Math.floor,me=Math.ceil,ge=Math.abs;function ve(e,t,n){return ge(e-t)<n}function ye(e,t,n,i){var o=pe(t,n),s=he(t,n);return i?o<e&&e<s:o<=e&&e<=s}function be(e,t,n){var i=pe(t,n),o=he(t,n);return pe(he(i,e),o)}function we(e){return+(e>0)-+(e<0)}function xe(e,t){return P(t,function(t){e=e.replace("%s",""+t)}),e}function _e(e){return e<10?"0"+e:""+e}var Ee={};function Ce(){var e=[];function t(e,t,n){P(e,function(e){e&&P(t,function(t){t.split(" ").forEach(function(t){var i=t.split(".");n(e,i[0],i[1])})})})}return{bind:function(n,i,o,s){t(n,i,function(t,n,i){var a="addEventListener"in t,r=a?t.removeEventListener.bind(t,n,o,s):t.removeListener.bind(t,o);a?t.addEventListener(n,o,s):t.addListener(o),e.push([t,n,i,o,r])})},unbind:function(n,i,o){t(n,i,function(t,n,i){e=e.filter(function(e){return!!(e[0]!==t||e[1]!==n||e[2]!==i||o&&e[3]!==o)||(e[4](),!1)})})},dispatch:function(e,t,n){var i,o=!0;return"function"==typeof CustomEvent?i=new CustomEvent(t,{bubbles:o,detail:n}):(i=document.createEvent("CustomEvent")).initCustomEvent(t,o,!1,n),e.dispatchEvent(i),i},destroy:function(){e.forEach(function(e){e[4]()}),g(e)}}}var je="mounted",qe="ready",ke="move",Le="moved",Se="click",Ae="active",Pe="inactive",Ie="visible",Me="hidden",Te="refresh",De="updated",Be="resize",Ne="resized",ze="scroll",Fe="scrolled",He="destroy",Re="arrows:mounted",Oe="navigation:mounted",Ve="autoplay:play",Ue="autoplay:pause",$e="lazyload:loaded",Ke="sk",We="sh",Xe="ei";function Ze(e){var t=e?e.event.bus:document.createDocumentFragment(),n=Ce();return e&&e.event.on(He,n.destroy),V(n,{bus:t,on:function(e,i){n.bind(t,A(e).join(" "),function(e){i.apply(i,C(e.detail)?e.detail:[])})},off:y(n.unbind,t),emit:function(e){n.dispatch(t,e,v(arguments,1))}})}function Ge(e,t,n,i){var o,s,a=Date.now,r=0,l=!0,c=0;function d(){if(!l){if(r=e?pe((a()-o)/e,1):1,n&&n(r),r>=1&&(t(),o=a(),i&&++c>=i))return u();s=x(d)}}function u(){l=!0}function p(){s&&cancelAnimationFrame(s),r=0,s=0,l=!0}return{start:function(t){t||p(),o=a()-(t?r*e:0),l=!1,s=x(d)},rewind:function(){o=a(),r=0,n&&n(r)},pause:u,cancel:p,set:function(t){e=t},isPaused:function(){return l}}}var Ye="Arrow",Je=Ye+"Left",Qe=Ye+"Right",et=Ye+"Up",tt=Ye+"Down",nt="ttb",it={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[et,Qe],ArrowRight:[tt,Je]};var ot="role",st="tabindex",at="aria-",rt=at+"controls",lt=at+"current",ct=at+"selected",dt=at+"label",ut=at+"labelledby",pt=at+"hidden",ht=at+"orientation",ft=at+"roledescription",mt=at+"live",gt=at+"busy",vt=at+"atomic",yt=[ot,st,"disabled",rt,lt,dt,ut,pt,ht,ft],bt=ce+"__",wt="is-",xt=ce,_t=bt+"track",Et=bt+"list",Ct=bt+"slide",jt=Ct+"--clone",qt=Ct+"__container",kt=bt+"arrows",Lt=bt+"arrow",St=Lt+"--prev",At=Lt+"--next",Pt=bt+"pagination",It=Pt+"__page",Mt=bt+"progress"+"__bar",Tt=bt+"toggle",Dt=bt+"sr",Bt=wt+"initialized",Nt=wt+"active",zt=wt+"prev",Ft=wt+"next",Ht=wt+"visible",Rt=wt+"loading",Ot=wt+"focus-in",Vt=wt+"overflow",Ut=[Nt,Ht,zt,Ft,Rt,Ot,Vt],$t={slide:Ct,clone:jt,arrows:kt,arrow:Lt,prev:St,next:At,pagination:Pt,page:It,spinner:bt+"spinner"};var Kt="touchstart mousedown",Wt="touchmove mousemove",Xt="touchend touchcancel mouseup click";var Zt="slide",Gt="loop",Yt="fade";function Jt(e,t,n,i){var o,s=Ze(e),a=s.on,r=s.emit,l=s.bind,c=e.Components,d=e.root,u=e.options,p=u.isNavigation,h=u.updateOnMove,f=u.i18n,m=u.pagination,g=u.slideFocus,v=c.Direction.resolve,b=J(i,"style"),w=J(i,dt),x=n>-1,_=H(i,"."+qt);function E(){var o=e.splides.map(function(e){var n=e.splide.Components.Slides.getAt(t);return n?n.slide.id:""}).join(" ");W(i,dt,xe(f.slideX,(x?n:t)+1)),W(i,rt,o),W(i,ot,g?"button":""),g&&K(i,ft)}function C(){o||j()}function j(){if(!o){var n=e.index;(s=q())!==Q(i,Nt)&&(T(i,Nt,s),W(i,lt,p&&s||""),r(s?Ae:Pe,k)),function(){var t=function(){if(e.is(Yt))return q();var t=ee(c.Elements.track),n=ee(i),o=v("left",!0),s=v("right",!0);return fe(t[o])<=me(n[o])&&fe(n[s])<=me(t[s])}(),n=!t&&(!q()||x);e.state.is([4,5])||W(i,pt,n||"");W(se(i,u.focusableNodes||""),st,n?-1:""),g&&W(i,st,n?-1:0);t!==Q(i,Ht)&&(T(i,Ht,t),r(t?Ie:Me,k));if(!t&&document.activeElement===i){var o=c.Slides.getAt(e.index);o&&Y(o.slide)}}(),T(i,zt,t===n-1),T(i,Ft,t===n+1)}var s}function q(){var i=e.index;return i===t||u.cloneStatus&&i===n}var k={index:t,slideIndex:n,slide:i,container:_,isClone:x,mount:function(){x||(i.id=d.id+"-slide"+_e(t+1),W(i,ot,m?"tabpanel":"group"),W(i,ft,f.slide),W(i,dt,w||xe(f.slideLabel,[t+1,e.length]))),l(i,"click",y(r,Se,k)),l(i,"keydown",y(r,Ke,k)),a([Le,We,Fe],j),a(Oe,E),h&&a(ke,C)},destroy:function(){o=!0,s.destroy(),ae(i,Ut),K(i,yt),W(i,"style",b),W(i,dt,w||"")},update:j,style:function(e,t,n){Z(n&&_||i,e,t)},isWithin:function(n,i){var o=ge(n-t);return x||!u.rewind&&!e.is(Gt)||(o=pe(o,e.length-o)),o<=i}};return k}var Qt=de+"-interval";var en={passive:!1,capture:!0};var tn={Spacebar:" ",Right:Qe,Left:Je,Up:et,Down:tt};function nn(e){return e=q(e)?e:e.key,tn[e]||e}var on="keydown";var sn=de+"-lazy",an=sn+"-srcset",rn="["+sn+"], ["+an+"]";var ln=[" ","Enter"];var cn=Object.freeze({__proto__:null,Media:function(e,t,n){var i=e.state,o=n.breakpoints||{},s=n.reducedMotion||{},a=Ce(),r=[];function l(e){e&&a.destroy()}function c(e,t){var n=matchMedia(t);a.bind(n,"change",d),r.push([e,n])}function d(){var t=i.is(7),o=n.direction,s=r.reduce(function(e,t){return U(e,t[1].matches?t[0]:{})},{});$(n),u(s),n.destroy?e.destroy("completely"===n.destroy):t?(l(!0),e.mount()):o!==n.direction&&e.refresh()}function u(t,o,s){U(n,t),o&&U(Object.getPrototypeOf(n),t),!s&&i.is(1)||e.emit(De,n)}return{setup:function(){var e="min"===n.mediaQuery;R(o).sort(function(t,n){return e?+t-+n:+n-+t}).forEach(function(t){c(o[t],"("+(e?"min":"max")+"-width:"+t+"px)")}),c(s,f),d()},destroy:l,reduce:function(e){matchMedia(f).matches&&(e?U(n,s):$(n,R(s)))},set:u}},Direction:function(e,t,n){return{resolve:function(e,t,i){var o="rtl"!==(i=i||n.direction)||t?i===nt?0:-1:1;return it[e]&&it[e][o]||e.replace(/width|left|right/i,function(e,t){var n=it[e.toLowerCase()][o]||e;return t>0?n.charAt(0).toUpperCase()+n.slice(1):n})},orient:function(e){return e*("rtl"===n.direction?1:-1)}}},Elements:function(e,t,n){var i,o,s,a=Ze(e),r=a.on,l=a.bind,c=e.root,d=n.i18n,u={},p=[],h=[],f=[];function m(){i=b("."+_t),o=H(i,"."+Et),ue(i&&o,"A track/list element is missing."),M(p,F(o,"."+Ct+":not(."+jt+")")),O({arrows:kt,pagination:Pt,prev:St,next:At,bar:Mt,toggle:Tt},function(e,t){u[t]=b("."+e)}),V(u,{root:c,track:i,list:o,slides:p}),function(){var e=c.id||(s=ce,""+s+_e(Ee[s]=(Ee[s]||0)+1)),t=n.role;var s;c.id=e,i.id=i.id||e+"-track",o.id=o.id||e+"-list",!J(c,ot)&&"SECTION"!==c.tagName&&t&&W(c,ot,t);W(c,ft,d.carousel),W(o,ot,"presentation")}(),y()}function v(e){var t=yt.concat("style");g(p),ae(c,h),ae(i,f),K([i,o],t),K(c,e?t:["style",ft])}function y(){ae(c,h),ae(i,f),h=w(xt),f=w(_t),D(c,h),D(i,f),W(c,dt,n.label),W(c,ut,n.labelledby)}function b(e){var t=oe(c,e);return t&&function(e,t){if(j(e.closest))return e.closest(t);for(var n=e;n&&1===n.nodeType&&!z(n,t);)n=n.parentElement;return n}(t,"."+xt)===c?t:void 0}function w(e){return[e+"--"+n.type,e+"--"+n.direction,n.drag&&e+"--draggable",n.isNavigation&&e+"--nav",e===xt&&Nt]}return V(u,{setup:m,mount:function(){r(Te,v),r(Te,m),r(De,y),l(document,Kt+" keydown",function(e){s="keydown"===e.type},{capture:!0}),l(c,"focusin",function(){T(c,Ot,!!s)})},destroy:v})},Slides:function(e,t,n){var i=Ze(e),o=i.on,s=i.emit,a=i.bind,r=t.Elements,l=r.slides,c=r.list,d=[];function u(){l.forEach(function(e,t){h(e,t,-1)})}function p(){m(function(e){e.destroy()}),g(d)}function h(t,n,i){var o=Jt(e,n,i,t);o.mount(),d.push(o),d.sort(function(e,t){return e.index-t.index})}function f(e){return e?v(function(e){return!e.isClone}):d}function m(e,t){f(t).forEach(e)}function v(e){return d.filter(j(e)?e:function(t){return q(e)?z(t.slide,e):I(A(e),t.index)})}return{mount:function(){u(),o(Te,p),o(Te,u)},destroy:p,update:function(){m(function(e){e.update()})},register:h,get:f,getIn:function(e){var i=t.Controller,o=i.toIndex(e),s=i.hasFocus()?1:n.perPage;return v(function(e){return ye(e.index,o,o+s-1)})},getAt:function(e){return v(e)[0]},add:function(e,t){P(e,function(e){if(q(e)&&(e=ne(e)),S(e)){var i=l[t];i?N(e,i):B(c,e),D(e,n.classes.slide),o=e,r=y(s,Be),d=se(o,"img"),(u=d.length)?d.forEach(function(e){a(e,"load error",function(){--u||r()})}):r()}var o,r,d,u}),s(Te)},remove:function(e){te(v(e).map(function(e){return e.slide})),s(Te)},forEach:m,filter:v,style:function(e,t,n){m(function(i){i.style(e,t,n)})},getLength:function(e){return e?l.length:d.length},isEnough:function(){return d.length>n.perPage}}},Layout:function(e,t,n){var i,o,s,a=Ze(e),r=a.on,l=a.bind,c=a.emit,d=t.Slides,u=t.Direction.resolve,p=t.Elements,h=p.root,f=p.track,m=p.list,g=d.getAt,v=d.style;function b(){i=n.direction===nt,Z(h,"maxWidth",le(n.width)),Z(f,u("paddingLeft"),x(!1)),Z(f,u("paddingRight"),x(!0)),w(!0)}function w(e){var t=ee(h);(e||o.width!==t.width||o.height!==t.height)&&(Z(f,"height",function(){var e="";i&&(ue(e=_(),"height or heightRatio is missing."),e="calc("+e+" - "+x(!1)+" - "+x(!0)+")");return e}()),v(u("marginRight"),le(n.gap)),v("width",n.autoWidth?null:le(n.fixedWidth)||(i?"":C())),v("height",le(n.fixedHeight)||(i?n.autoHeight?null:C():_()),!0),o=t,c(Ne),s!==(s=A())&&(T(h,Vt,s),c("overflow",s)))}function x(e){var t=n.padding,i=u(e?"right":"left");return t&&le(t[i]||(E(t)?0:t))||"0px"}function _(){return le(n.height||ee(m).width*n.heightRatio)}function C(){var e=le(n.gap);return"calc((100%"+(e&&" + "+e)+")/"+(n.perPage||1)+(e&&" - "+e)+")"}function j(){return ee(m)[u("width")]}function q(e,t){var n=g(e||0);return n?ee(n.slide)[u("width")]+(t?0:S()):0}function k(e,t){var n=g(e);if(n){var i=ee(n.slide)[u("right")],o=ee(m)[u("left")];return ge(i-o)+(t?0:S())}return 0}function L(t){return k(e.length-1)-k(0)+q(0,t)}function S(){var e=g(0);return e&&parseFloat(Z(e.slide,u("marginRight")))||0}function A(){return e.is(Yt)||L(!0)>j()}return{mount:function(){var e,t;b(),l(window,"resize load",(e=y(c,Be),t=Ge(0,e,null,1),function(){t.isPaused()&&t.start()})),r([De,Te],b),r(Be,w)},resize:w,listSize:j,slideSize:q,sliderSize:L,totalSize:k,getPadding:function(e){return parseFloat(Z(f,u("padding"+(e?"Right":"Left"))))||0},isOverflow:A}},Clones:function(e,t,n){var i,o=Ze(e),s=o.on,a=t.Elements,r=t.Slides,l=t.Direction.resolve,c=[];function d(){s(Te,u),s([De,Be],h),(i=f())&&(!function(t){var i=r.get().slice(),o=i.length;if(o){for(;i.length<t;)M(i,i);M(i.slice(-t),i.slice(0,t)).forEach(function(s,l){var d=l<t,u=function(t,i){var o=t.cloneNode(!0);return D(o,n.classes.clone),o.id=e.root.id+"-clone"+_e(i+1),o}(s.slide,l);d?N(u,i[0].slide):B(a.list,u),M(c,u),r.register(u,l-t+(d?0:o),s.index)})}}(i),t.Layout.resize(!0))}function u(){p(),d()}function p(){te(c),g(c),o.destroy()}function h(){var e=f();i!==e&&(i<e||!e)&&o.emit(Te)}function f(){var i=n.clones;if(e.is(Gt)){if(k(i)){var o=n[l("fixedWidth")]&&t.Layout.slideSize(0);i=o&&me(ee(a.track)[l("width")]/o)||n[l("autoWidth")]&&e.length||2*n.perPage}}else i=0;return i}return{mount:d,destroy:p}},Move:function(e,t,n){var i,o=Ze(e),s=o.on,a=o.emit,r=e.state.set,l=t.Layout,c=l.slideSize,d=l.getPadding,u=l.totalSize,p=l.listSize,h=l.sliderSize,f=t.Direction,m=f.resolve,g=f.orient,v=t.Elements,y=v.list,b=v.track;function w(){t.Controller.isBusy()||(t.Scroll.cancel(),x(e.index),t.Slides.update())}function x(e){_(q(e,!0))}function _(n,i){if(!e.is(Yt)){var o=i?n:function(n){if(e.is(Gt)){var i=j(n),o=i>t.Controller.getEnd();(i<0||o)&&(n=E(n,o))}return n}(n);Z(y,"transform","translate"+m("X")+"("+o+"px)"),n!==o&&a(We)}}function E(e,t){var n=e-S(t),i=h();return e-=g(i*(me(ge(n)/i)||1))*(t?1:-1)}function C(){_(L(),!0),i.cancel()}function j(e){for(var n=t.Slides.get(),i=0,o=1/0,s=0;s<n.length;s++){var a=n[s].index,r=ge(q(a,!0)-e);if(!(r<=o))break;o=r,i=a}return i}function q(t,i){var o=g(u(t-1)-function(e){var t=n.focus;return"center"===t?(p()-c(e,!0))/2:+t*c(e)||0}(t));return i?function(t){n.trimSpace&&e.is(Zt)&&(t=be(t,0,g(h(!0)-p())));return t}(o):o}function L(){var e=m("left");return ee(y)[e]-ee(b)[e]+g(d(!1))}function S(e){return q(e?t.Controller.getEnd():0,!!n.trimSpace)}return{mount:function(){i=t.Transition,s([je,Ne,De,Te],w)},move:function(e,t,n,o){var s,l;e!==t&&(s=e>n,l=g(E(L(),s)),s?l>=0:l<=y[m("scrollWidth")]-ee(b)[m("width")])&&(C(),_(E(L(),e>n),!0)),r(4),a(ke,t,n,e),i.start(t,function(){r(3),a(Le,t,n,e),o&&o()})},jump:x,translate:_,shift:E,cancel:C,toIndex:j,toPosition:q,getPosition:L,getLimit:S,exceededLimit:function(e,t){t=k(t)?L():t;var n=!0!==e&&g(t)<g(S(!1)),i=!1!==e&&g(t)>g(S(!0));return n||i},reposition:w}},Controller:function(e,t,n){var i,o,s,a,r=Ze(e),l=r.on,c=r.emit,d=t.Move,u=d.getPosition,p=d.getLimit,h=d.toPosition,f=t.Slides,m=f.isEnough,g=f.getLength,v=n.omitEnd,b=e.is(Gt),w=e.is(Zt),x=y(S,!1),_=y(S,!0),E=n.start||0,C=E;function j(){o=g(!0),s=n.perMove,a=n.perPage,i=I();var e=be(E,0,v?i:o-1);e!==E&&(E=e,d.reposition())}function L(){i!==I()&&c(Xe)}function S(e,t){var n=s||(B()?1:a),o=A(E+n*(e?-1:1),E,!(s||B()));return-1===o&&w&&!ve(u(),p(!e),1)?e?0:i:t?o:P(o)}function A(t,r,l){if(m()||B()){var c=function(t){if(w&&"move"===n.trimSpace&&t!==E)for(var i=u();i===h(t,!0)&&ye(t,0,e.length-1,!n.rewind);)t<E?--t:++t;return t}(t);c!==t&&(r=t,t=c,l=!1),t<0||t>i?t=s||!ye(0,t,r,!0)&&!ye(i,r,t,!0)?b?l?t<0?-(o%a||a):o:t:n.rewind?t<0?i:0:-1:M(T(t)):l&&t!==r&&(t=M(T(r)+(t<r?-1:1)))}else t=-1;return t}function P(e){return b?(e+o)%o||0:e}function I(){for(var e=o-(B()||b&&s?1:a);v&&e-- >0;)if(h(o-1,!0)!==h(e,!0)){e++;break}return be(e,0,o-1)}function M(e){return be(B()?e:a*e,0,i)}function T(e){return B()?pe(e,i):fe((e>=i?o-1:e)/a)}function D(e){e!==E&&(C=E,E=e)}function B(){return!k(n.focus)||n.isNavigation}function N(){return e.state.is([4,5])&&!!n.waitForTransition}return{mount:function(){j(),l([De,Te,Xe],j),l(Ne,L)},go:function(e,t,n){if(!N()){var o=function(e){var t=E;if(q(e)){var n=e.match(/([+\-<>])(\d+)?/)||[],o=n[1],s=n[2];"+"===o||"-"===o?t=A(E+ +(""+o+(+s||1)),E):">"===o?t=s?M(+s):x(!0):"<"===o&&(t=_(!0))}else t=b?e:be(e,0,i);return t}(e),s=P(o);s>-1&&(t||s!==E)&&(D(s),d.move(o,s,C,n))}},scroll:function(e,n,o,s){t.Scroll.scroll(e,n,o,function(){var e=P(d.toIndex(u()));D(v?pe(e,i):e),s&&s()})},getNext:x,getPrev:_,getAdjacent:S,getEnd:I,setIndex:D,getIndex:function(e){return e?C:E},toIndex:M,toPage:T,toDest:function(e){var t=d.toIndex(e);return w?be(t,0,i):t},hasFocus:B,isBusy:N}},Arrows:function(e,t,n){var i,o,s=Ze(e),a=s.on,r=s.bind,l=s.emit,c=n.classes,d=n.i18n,u=t.Elements,p=t.Controller,h=u.arrows,f=u.track,m=h,g=u.prev,v=u.next,b={};function w(){!function(){var e=n.arrows;!e||g&&v||(m=h||X("div",c.arrows),g=C(!0),v=C(!1),i=!0,B(m,[g,v]),!h&&N(m,f));g&&v&&(V(b,{prev:g,next:v}),G(m,e?"":"none"),D(m,o=kt+"--"+n.direction),e&&(a([je,Le,Te,Fe,Xe],j),r(v,"click",y(E,">")),r(g,"click",y(E,"<")),j(),W([g,v],rt,f.id),l(Re,g,v)))}(),a(De,x)}function x(){_(),w()}function _(){s.destroy(),ae(m,o),i?(te(h?[g,v]:m),g=v=null):K([g,v],yt)}function E(e){p.go(e,!0)}function C(e){return ne('<button class="'+c.arrow+" "+(e?c.prev:c.next)+'" type="button"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40" focusable="false"><path d="'+(n.arrowPath||"m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z")+'" />')}function j(){if(g&&v){var t=e.index,n=p.getPrev(),i=p.getNext(),o=n>-1&&t<n?d.last:d.prev,s=i>-1&&t>i?d.first:d.next;g.disabled=n<0,v.disabled=i<0,W(g,dt,o),W(v,dt,s),l("arrows:updated",g,v,n,i)}}return{arrows:b,mount:w,destroy:_,update:j}},Autoplay:function(e,t,n){var i,o,s=Ze(e),a=s.on,r=s.bind,l=s.emit,c=Ge(n.interval,e.go.bind(e,">"),function(e){var t=u.bar;t&&Z(t,"width",100*e+"%"),l("autoplay:playing",e)}),d=c.isPaused,u=t.Elements,p=t.Elements,h=p.root,f=p.toggle,m=n.autoplay,g="pause"===m;function v(){d()&&t.Slides.isEnough()&&(c.start(!n.resetProgress),o=i=g=!1,w(),l(Ve))}function y(e){void 0===e&&(e=!0),g=!!e,w(),d()||(c.pause(),l(Ue))}function b(){g||(i||o?y(!1):v())}function w(){f&&(T(f,Nt,!g),W(f,dt,n.i18n[g?"play":"pause"]))}function x(e){var i=t.Slides.getAt(e);c.set(i&&+J(i.slide,Qt)||n.interval)}return{mount:function(){m&&(!function(){n.pauseOnHover&&r(h,"mouseenter mouseleave",function(e){i="mouseenter"===e.type,b()});n.pauseOnFocus&&r(h,"focusin focusout",function(e){o="focusin"===e.type,b()});f&&r(f,"click",function(){g?v():y(!0)});a([ke,ze,Te],c.rewind),a(ke,x)}(),f&&W(f,rt,u.track.id),g||v(),w())},destroy:c.cancel,play:v,pause:y,isPaused:d}},Cover:function(e,t,n){var i=Ze(e).on;function o(e){t.Slides.forEach(function(t){var n=H(t.container||t.slide,"img");n&&n.src&&s(e,n,t)})}function s(e,t,n){n.style("background",e?'center/cover no-repeat url("'+t.src+'")':"",!0),G(t,e?"none":"")}return{mount:function(){n.cover&&(i($e,y(s,!0)),i([je,De,Te],y(o,!0)))},destroy:y(o,!1)}},Scroll:function(e,t,n){var i,o,s=Ze(e),a=s.on,r=s.emit,l=e.state.set,c=t.Move,d=c.getPosition,u=c.getLimit,p=c.exceededLimit,h=c.translate,f=e.is(Zt),m=1;function g(e,n,s,a,u){var h=d();if(w(),s&&(!f||!p())){var g=t.Layout.sliderSize(),x=we(e)*g*fe(ge(e)/g)||0;e=c.toPosition(t.Controller.toDest(e%g))+x}var _=ve(h,e,1);m=1,n=_?0:n||he(ge(e-h)/1.5,800),o=a,i=Ge(n,v,y(b,h,e,u),1),l(5),r(ze),i.start()}function v(){l(3),o&&o(),r(Fe)}function b(e,t,i,s){var a,r,l=d(),c=(e+(t-e)*(a=s,(r=n.easingFunc)?r(a):1-Math.pow(1-a,4))-l)*m;h(l+c),f&&!i&&p()&&(m*=.6,ge(c)<10&&g(u(p(!0)),600,!1,o,!0))}function w(){i&&i.cancel()}function x(){i&&!i.isPaused()&&(w(),v())}return{mount:function(){a(ke,w),a([De,Te],x)},destroy:w,scroll:g,cancel:x}},Drag:function(e,t,n){var i,o,s,a,r,l,c,d,u=Ze(e),p=u.on,h=u.emit,f=u.bind,m=u.unbind,g=e.state,v=t.Move,y=t.Scroll,b=t.Controller,x=t.Elements.track,_=t.Media.reduce,C=t.Direction,j=C.resolve,q=C.orient,k=v.getPosition,L=v.exceededLimit,S=!1;function A(){var e=n.drag;O(!e),a="free"===e}function P(e){if(l=!1,!c){var t=R(e);i=e.target,o=n.noDrag,z(i,"."+It+", ."+Lt)||o&&z(i,o)||!t&&e.button||(b.isBusy()?ie(e,!0):(d=t?x:window,r=g.is([4,5]),s=null,f(d,Wt,I,en),f(d,Xt,M,en),v.cancel(),y.cancel(),D(e)))}var i,o}function I(t){if(g.is(6)||(g.set(6),h("drag")),t.cancelable)if(r){v.translate(i+B(t)/(S&&e.is(Zt)?5:1));var o=N(t)>200,s=S!==(S=L());(o||s)&&D(t),l=!0,h("dragging"),ie(t)}else(function(e){return ge(B(e))>ge(B(e,!0))})(t)&&(r=function(e){var t=n.dragMinThreshold,i=E(t),o=i&&t.mouse||0,s=(i?t.touch:+t)||10;return ge(B(e))>(R(e)?s:o)}(t),ie(t))}function M(i){g.is(6)&&(g.set(3),h("dragged")),r&&(!function(i){var o=function(t){if(e.is(Gt)||!S){var n=N(t);if(n&&n<200)return B(t)/n}return 0}(i),s=function(e){return k()+we(e)*pe(ge(e)*(n.flickPower||600),a?1/0:t.Layout.listSize()*(n.flickMaxPages||1))}(o),r=n.rewind&&n.rewindByDrag;_(!1),a?b.scroll(s,0,n.snap):e.is(Yt)?b.go(q(we(o))<0?r?"<":"-":r?">":"+"):e.is(Zt)&&S&&r?b.go(L(!0)?">":"<"):b.go(b.toDest(s),!0);_(!0)}(i),ie(i)),m(d,Wt,I),m(d,Xt,M),r=!1}function T(e){!c&&l&&ie(e,!0)}function D(e){s=o,o=e,i=k()}function B(e,t){return H(e,t)-H(F(e),t)}function N(e){return re(e)-re(F(e))}function F(e){return o===e&&s||o}function H(e,t){return(R(e)?e.changedTouches[0]:e)["page"+j(t?"Y":"X")]}function R(e){return"undefined"!=typeof TouchEvent&&e instanceof TouchEvent}function O(e){c=e}return{mount:function(){f(x,Wt,w,en),f(x,Xt,w,en),f(x,Kt,P,en),f(x,"click",T,{capture:!0}),f(x,"dragstart",ie),p([je,De],A)},disable:O,isDragging:function(){return r}}},Keyboard:function(e,t,n){var i,o,s=Ze(e),a=s.on,r=s.bind,l=s.unbind,c=e.root,d=t.Direction.resolve;function u(){var e=n.keyboard;e&&(i="global"===e?window:c,r(i,on,f))}function p(){l(i,on)}function h(){var e=o;o=!0,b(function(){o=e})}function f(t){if(!o){var n=nn(t);n===d(Je)?e.go("<"):n===d(Qe)&&e.go(">")}}return{mount:function(){u(),a(De,p),a(De,u),a(ke,h)},destroy:p,disable:function(e){o=e}}},LazyLoad:function(e,t,n){var i=Ze(e),o=i.on,s=i.off,a=i.bind,r=i.emit,l="sequential"===n.lazyLoad,c=[Le,Fe],d=[];function u(){g(d),t.Slides.forEach(function(e){se(e.slide,rn).forEach(function(t){var i=J(t,sn),o=J(t,an);if(i!==t.src||o!==t.srcset){var s=n.classes.spinner,a=t.parentElement,r=H(a,"."+s)||X("span",s,a);d.push([t,e,r]),t.src||G(t,"none")}})}),l?m():(s(c),o(c,p),p())}function p(){(d=d.filter(function(t){var i=n.perPage*((n.preloadPages||1)+1)-1;return!t[1].isWithin(e.index,i)||h(t)})).length||s(c)}function h(e){var t=e[0];D(e[1].slide,Rt),a(t,"load error",y(f,e)),W(t,"src",J(t,sn)),W(t,"srcset",J(t,an)),K(t,sn),K(t,an)}function f(e,t){var n=e[0],i=e[1];ae(i.slide,Rt),"error"!==t.type&&(te(e[2]),G(n,""),r($e,n,i),r(Be)),l&&m()}function m(){d.length&&h(d.shift())}return{mount:function(){n.lazyLoad&&(u(),o(Te,u))},destroy:y(g,d),check:p}},Pagination:function(e,t,n){var i,o,s=Ze(e),a=s.on,r=s.emit,l=s.bind,c=t.Slides,d=t.Elements,u=t.Controller,p=u.hasFocus,h=u.getIndex,f=u.go,m=t.Direction.resolve,b=d.pagination,w=[];function x(){i&&(te(b?v(i.children):i),ae(i,o),g(w),i=null),s.destroy()}function _(e){f(">"+e,!0)}function E(e,t){var n=w.length,i=nn(t),o=C(),s=-1;i===m(Qe,!1,o)?s=++e%n:i===m(Je,!1,o)?s=(--e+n)%n:"Home"===i?s=0:"End"===i&&(s=n-1);var a=w[s];a&&(Y(a.button),f(">"+s),ie(t,!0))}function C(){return n.paginationDirection||n.direction}function j(e){return w[u.toPage(e)]}function q(){var e=j(h(!0)),t=j(h());if(e){var n=e.button;ae(n,Nt),K(n,ct),W(n,st,-1)}if(t){var o=t.button;D(o,Nt),W(o,ct,!0),W(o,st,"")}r("pagination:updated",{list:i,items:w},e,t)}return{items:w,mount:function t(){x(),a([De,Te,Xe],t);var s=n.pagination;b&&G(b,s?"":"none"),s&&(a([ke,ze,Fe],q),function(){var t=e.length,s=n.classes,a=n.i18n,r=n.perPage,h=p()?u.getEnd()+1:me(t/r);D(i=b||X("ul",s.pagination,d.track.parentElement),o=Pt+"--"+C()),W(i,ot,"tablist"),W(i,dt,a.select),W(i,ht,C()===nt?"vertical":"");for(var f=0;f<h;f++){var m=X("li",null,i),g=X("button",{class:s.page,type:"button"},m),v=c.getIn(f).map(function(e){return e.slide.id}),x=!p()&&r>1?a.pageX:a.slideX;l(g,"click",y(_,f)),n.paginationKeyboard&&l(g,"keydown",y(E,f)),W(m,ot,"presentation"),W(g,ot,"tab"),W(g,rt,v.join(" ")),W(g,dt,xe(x,f+1)),W(g,st,-1),w.push({li:m,button:g,page:f})}}(),q(),r("pagination:mounted",{list:i,items:w},j(e.index)))},destroy:x,getAt:j,update:q}},Sync:function(e,t,n){var i=n.isNavigation,o=n.slideFocus,s=[];function a(){var t,n;e.splides.forEach(function(t){t.isParent||(l(e,t.splide),l(t.splide,e))}),i&&(t=Ze(e),(n=t.on)(Se,d),n(Ke,u),n([je,De],c),s.push(t),t.emit(Oe,e.splides))}function r(){s.forEach(function(e){e.destroy()}),g(s)}function l(e,t){var n=Ze(e);n.on(ke,function(e,n,i){t.go(t.is(Gt)?i:e)}),s.push(n)}function c(){W(t.Elements.list,ht,n.direction===nt?"vertical":"")}function d(t){e.go(t.index)}function u(e,t){I(ln,nn(t))&&(d(e),ie(t))}return{setup:y(t.Media.set,{slideFocus:k(o)?i:o},!0),mount:a,destroy:r,remount:function(){r(),a()}}},Wheel:function(e,t,n){var i=Ze(e).bind,o=0;function s(i){if(i.cancelable){var s=i.deltaY,a=s<0,r=re(i),l=n.wheelMinThreshold||0,c=n.wheelSleep||0;ge(s)>l&&r-o>c&&(e.go(a?"<":">"),o=r),function(i){return!n.releaseWheel||e.state.is(4)||-1!==t.Controller.getAdjacent(i)}(a)&&ie(i)}}return{mount:function(){n.wheel&&i(t.Elements.track,"wheel",s,en)}}},Live:function(e,t,n){var i=Ze(e).on,o=t.Elements.track,s=n.live&&!n.isNavigation,a=X("span",Dt),r=Ge(90,y(l,!1));function l(e){W(o,gt,e),e?(B(o,a),r.start()):(te(a),r.cancel())}function c(e){s&&W(o,mt,e?"off":"polite")}return{mount:function(){s&&(c(!t.Autoplay.isPaused()),W(o,vt,!0),a.textContent="…",i(Ve,y(c,!0)),i(Ue,y(c,!1)),i([Le,Fe],y(l,!0)))},disable:c,destroy:function(){K(o,[mt,vt,gt]),te(a)}}}}),dn={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:$t,i18n:{prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function un(e,t,n){var i=t.Slides;function o(){i.forEach(function(e){e.style("transform","translateX(-"+100*e.index+"%)")})}return{mount:function(){Ze(e).on([je,Te],o)},start:function(e,t){i.style("transition","opacity "+n.speed+"ms "+n.easing),b(t)},cancel:w}}function pn(e,t,n){var i,o=t.Move,s=t.Controller,a=t.Scroll,r=t.Elements.list,l=y(Z,r,"transition");function c(){l(""),a.cancel()}return{mount:function(){Ze(e).bind(r,"transitionend",function(e){e.target===r&&i&&(c(),i())})},start:function(t,r){var c=o.toPosition(t,!0),d=o.getPosition(),u=function(t){var i=n.rewindSpeed;if(e.is(Zt)&&i){var o=s.getIndex(!0),a=s.getEnd();if(0===o&&t>=a||o>=a&&0===t)return i}return n.speed}(t);ge(c-d)>=1&&u>=1?n.useScroll?a.scroll(c,u,!1,r):(l("transform "+u+"ms "+n.easing),o.translate(c,!0),i=r):(o.jump(t),r())},cancel:c}}var hn=function(){function e(t,n){var i;this.event=Ze(),this.Components={},this.state=(i=1,{set:function(e){i=e},is:function(e){return I(A(e),i)}}),this.splides=[],this._o={},this._E={};var o=q(t)?oe(document,t):t;ue(o,o+" is invalid."),this.root=o,n=U({label:J(o,dt)||"",labelledby:J(o,ut)||""},dn,e.defaults,n||{});try{U(n,JSON.parse(J(o,de)))}catch(e){ue(!1,"Invalid JSON")}this._o=Object.create(U({},n))}var t=e.prototype;return t.mount=function(e,t){var n=this,i=this.state,o=this.Components;return ue(i.is([1,7]),"Already mounted!"),i.set(1),this._C=o,this._T=t||this._T||(this.is(Yt)?un:pn),this._E=e||this._E,O(V({},cn,this._E,{Transition:this._T}),function(e,t){var i=e(n,o,n._o);o[t]=i,i.setup&&i.setup()}),O(o,function(e){e.mount&&e.mount()}),this.emit(je),D(this.root,Bt),i.set(3),this.emit(qe),this},t.sync=function(e){return this.splides.push({splide:e}),e.splides.push({splide:this,isParent:!0}),this.state.is(3)&&(this._C.Sync.remount(),e.Components.Sync.remount()),this},t.go=function(e){return this._C.Controller.go(e),this},t.on=function(e,t){return this.event.on(e,t),this},t.off=function(e){return this.event.off(e),this},t.emit=function(e){var t;return(t=this.event).emit.apply(t,[e].concat(v(arguments,1))),this},t.add=function(e,t){return this._C.Slides.add(e,t),this},t.remove=function(e){return this._C.Slides.remove(e),this},t.is=function(e){return this._o.type===e},t.refresh=function(){return this.emit(Te),this},t.destroy=function(e){void 0===e&&(e=!0);var t=this.event,n=this.state;return n.is(1)?Ze(this).on(qe,this.destroy.bind(this,e)):(O(this._C,function(t){t.destroy&&t.destroy(e)},!0),t.emit(He),t.destroy(),e&&g(this.splides),n.set(7)),this},h(e,[{key:"options",get:function(){return this._o},set:function(e){this._C.Media.set(e,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),e}(),fn=hn;fn.defaults={},fn.STATES=m;class mn extends HTMLElement{static get observedAttributes(){return["collection-id","api-key","client-id","subscription-id","base-url","autoplay","show-arrows","show-dots"]}constructor(){super(),this.splide=null,this.container=null,this.carouselElement=null,this.clientInstance=null,this.connected=!1,this.collectionData=null,this.autoplayTimeoutId=null,this.attachShadow({mode:"open"})}connectedCallback(){this.connected=!0,this.render(),this.initCarousel()}disconnectedCallback(){this.connected=!1,this.destroyCarousel()}attributeChangedCallback(e,t,n){this.connected&&t!==n&&("collection-id"===e&&(this.destroyCarousel(),this.initCarousel()),"show-arrows"!==e&&"show-dots"!==e||(this.destroyCarousel(),this.initCarousel()))}getBooleanAttr(e,t){const n=this.getAttribute(e);return null===n?t:"false"!==n}render(){if(!this.shadowRoot)return;const e=document.createElement("style");e.textContent=`\n ${d}\n .jaaq-collection-player {\n width: 100%;\n max-width: 1400px;\n margin: 0 auto;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n}\n\n.jaaq-collection-loading {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 400px;\n}\n\n.jaaq-collection-spinner {\n width: 50px;\n height: 50px;\n border: 4px solid rgba(0, 123, 255, 0.3);\n border-top-color: #007bff;\n border-radius: 50%;\n animation: jaaq-collection-spin 1s linear infinite;\n}\n\n@keyframes jaaq-collection-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n.jaaq-collection-error {\n background: rgba(220, 53, 69, 0.9);\n color: white;\n padding: 16px 24px;\n border-radius: 8px;\n text-align: center;\n font-size: 14px;\n margin: 20px;\n}\n\n.jaaq-collection-carousel .splide__track {\n padding: 40px 0;\n}\n\n.jaaq-collection-carousel .splide__slide {\n opacity: 0.7;\n transition: all 0.3s ease;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.jaaq-collection-carousel .splide__slide.is-active {\n opacity: 1;\n}\n\n.jaaq-collection-carousel .splide__slide jaaq-video-player {\n width: 100%;\n max-width: 600px;\n transition: all 0.3s ease;\n}\n\n.jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 800px;\n}\n\n.jaaq-collection-carousel .splide__arrow {\n background: rgba(0, 0, 0, 0.5);\n border: none;\n width: 48px;\n height: 48px;\n border-radius: 50%;\n color: white;\n cursor: pointer;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 20px;\n}\n\n.jaaq-collection-carousel .splide__arrow:hover {\n background: rgba(0, 0, 0, 0.8);\n transform: scale(1.1);\n}\n\n.jaaq-collection-carousel .splide__arrow:disabled {\n opacity: 0.3;\n cursor: not-allowed;\n}\n\n.jaaq-collection-carousel .splide__arrow svg {\n fill: white;\n width: 20px;\n height: 20px;\n}\n\n.jaaq-collection-carousel .splide__pagination {\n bottom: -30px;\n}\n\n.jaaq-collection-carousel .splide__pagination__page {\n background: #ccc;\n border: none;\n width: 10px;\n height: 10px;\n margin: 0 4px;\n border-radius: 50%;\n transition: all 0.2s;\n cursor: pointer;\n}\n\n.jaaq-collection-carousel .splide__pagination__page.is-active {\n background: white;\n transform: scale(1.3);\n}\n\n@media (max-width: 1024px) {\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 500px;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 650px;\n }\n}\n\n@media (max-width: 768px) {\n .jaaq-collection-carousel .splide__track {\n padding: 20px 0;\n }\n\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 400px;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 500px;\n }\n\n .jaaq-collection-carousel .splide__arrow {\n width: 40px;\n height: 40px;\n }\n}\n\n@media (max-width: 480px) {\n .jaaq-collection-carousel .splide__slide jaaq-video-player {\n max-width: 100%;\n }\n\n .jaaq-collection-carousel .splide__slide.is-active jaaq-video-player {\n max-width: 100%;\n }\n}\n\n .splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide:not(.is-overflow) .splide__pagination{display:none}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #999;border-left-color:transparent;border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0}@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list>.splide__slide{margin:0!important;opacity:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__arrow{-ms-flex-align:center;align-items:center;background:#ccc;border:0;border-radius:50%;cursor:pointer;display:-ms-flexbox;display:flex;height:2em;-ms-flex-pack:center;justify-content:center;opacity:.7;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:2em;z-index:1}.splide__arrow svg{fill:#000;height:1.2em;width:1.2em}.splide__arrow:hover:not(:disabled){opacity:.9}.splide__arrow:disabled{opacity:.3}.splide__arrow:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide__arrow--prev{left:1em}.splide__arrow--prev svg{transform:scaleX(-1)}.splide__arrow--next{right:1em}.splide.is-focus-in .splide__arrow:focus{outline:3px solid #0bf;outline-offset:3px}.splide__pagination{bottom:.5em;left:0;padding:0 1em;position:absolute;right:0;z-index:1}.splide__pagination__page{background:#ccc;border:0;border-radius:50%;display:inline-block;height:8px;margin:3px;opacity:.7;padding:0;position:relative;transition:transform .2s linear;width:8px}.splide__pagination__page.is-active{background:#fff;transform:scale(1.4);z-index:1}.splide__pagination__page:hover{cursor:pointer;opacity:.9}.splide__pagination__page:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__pagination__page:focus{outline:3px solid #0bf;outline-offset:3px}.splide__progress__bar{background:#ccc;height:3px}.splide__slide{-webkit-tap-highlight-color:rgba(0,0,0,0)}.splide__slide:focus{outline:0}@supports(outline-offset:-3px){.splide__slide:focus-visible{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide__slide:focus-visible{border:3px solid #0bf}}@supports(outline-offset:-3px){.splide.is-focus-in .splide__slide:focus{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide.is-focus-in .splide__slide:focus{border:3px solid #0bf}.splide.is-focus-in .splide__track>.splide__list>.splide__slide:focus{border-color:#0bf}}.splide__toggle{cursor:pointer}.splide__toggle:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__toggle:focus{outline:3px solid #0bf;outline-offset:3px}.splide__track--nav>.splide__list>.splide__slide{border:3px solid transparent;cursor:pointer}.splide__track--nav>.splide__list>.splide__slide.is-active{border:3px solid #000}.splide__arrows--rtl .splide__arrow--prev{left:auto;right:1em}.splide__arrows--rtl .splide__arrow--prev svg{transform:scaleX(1)}.splide__arrows--rtl .splide__arrow--next{left:1em;right:auto}.splide__arrows--rtl .splide__arrow--next svg{transform:scaleX(-1)}.splide__arrows--ttb .splide__arrow{left:50%;transform:translate(-50%)}.splide__arrows--ttb .splide__arrow--prev{top:1em}.splide__arrows--ttb .splide__arrow--prev svg{transform:rotate(-90deg)}.splide__arrows--ttb .splide__arrow--next{bottom:1em;top:auto}.splide__arrows--ttb .splide__arrow--next svg{transform:rotate(90deg)}.splide__pagination--ttb{bottom:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;left:auto;padding:1em 0;right:.5em;top:0}\n \n:host {\n display: block;\n width: 100%;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n `,this.container=document.createElement("div"),this.container.className="jaaq-collection-player",this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.container)}async initCarousel(){if(!this.container)return;const e=this.getAttribute("collection-id");if(!e)return void this.emitError(new Error("collection-id attribute is required"));const t=this.getAttribute("api-key"),n=this.getAttribute("client-id"),i=this.getAttribute("base-url")||void 0;if(this.clientInstance||t||n){this.showLoading();try{const o=this.clientInstance||r.init({apiKey:t,clientId:n,baseUrl:i||a});if(this.collectionData=await o.collections.getById(e),!this.collectionData.videos||0===this.collectionData.videos.length)return void this.emitError(new Error("No videos found in collection"));this.renderCarousel(),this.initSplide(),this.dispatchEvent(new CustomEvent("jaaq:collection:loaded",{detail:this.collectionData,bubbles:!0,composed:!0}))}catch(e){this.emitError(e instanceof Error?e:new Error("Failed to load collection"))}}else this.emitError(new Error("Either client property or api-key and client-id attributes are required"))}showLoading(){this.container&&(this.container.innerHTML='\n <div class="jaaq-collection-loading">\n <div class="jaaq-collection-spinner"></div>\n </div>\n ')}renderCarousel(){if(!this.container||!this.collectionData)return;this.container.innerHTML="",this.carouselElement=document.createElement("div"),this.carouselElement.className="splide jaaq-collection-carousel";const e=document.createElement("div");e.className="splide__track";const t=document.createElement("ul");t.className="splide__list";const n=this.getAttribute("api-key"),i=this.getAttribute("client-id"),o=this.getAttribute("base-url");this.collectionData.videos.forEach(e=>{const s=document.createElement("li");s.className="splide__slide";const a=document.createElement("jaaq-video-player");a.setAttribute("video-id",e.videoId),n&&a.setAttribute("api-key",n),i&&a.setAttribute("client-id",i),o&&a.setAttribute("base-url",o),a.setAttribute("autoplay","false"),a.setAttribute("width","100%"),s.appendChild(a),t.appendChild(s)}),e.appendChild(t),this.carouselElement.appendChild(e),this.container.appendChild(this.carouselElement)}initSplide(){if(!this.carouselElement)return;const e=this.getBooleanAttr("show-arrows",!0),t=this.getBooleanAttr("show-dots",!0);this.splide=new fn(this.carouselElement,{type:"loop",perPage:3,focus:"center",gap:"0.5rem",perMove:1,autoHeight:!0,updateOnMove:!0,padding:"5 rem",breakpoints:{768:{perPage:1},1024:{perPage:2}},arrows:e,pagination:t,autoplay:!1}),this.splide.on("moved",e=>{console.log("[CollectionPlayer] Splide moved event",{newIndex:e,splideIndex:this.splide?.index,Components:this.splide?.Components}),this.handleSlideChange(e),this.dispatchEvent(new CustomEvent("jaaq:collection:slidechange",{detail:{index:e,video:this.collectionData?.videos[e]},bubbles:!0,composed:!0}))}),this.splide.mount(),console.log("[CollectionPlayer] After mount",{splideIndex:this.splide.index,length:this.splide.length}),setTimeout(()=>{this.splide&&(console.log("[CollectionPlayer] Initial handleSlideChange after DOM update"),this.handleSlideChange(this.splide.index))},100)}handleSlideChange(e){if(!this.carouselElement)return;const t=this.hasAttribute("autoplay")&&"false"!==this.getAttribute("autoplay");console.log("[CollectionPlayer] handleSlideChange called",{activeIndex:e,isAutoplayEnabled:t}),null!==this.autoplayTimeoutId&&(console.log("[CollectionPlayer] Clearing existing autoplay timeout",{timeoutId:this.autoplayTimeoutId}),clearTimeout(this.autoplayTimeoutId),this.autoplayTimeoutId=null);const n=this.carouselElement.querySelector(".splide__slide.is-active:not(.splide__slide--clone)"),i=n?.querySelector("jaaq-video-player"),o=i?.getAttribute("video-id");console.log("[CollectionPlayer] Active slide from DOM:",{activeIndex:e,activeVideoId:o,foundActiveSlide:!!n});const s=this.carouselElement.querySelectorAll(".splide__slide:not(.splide__slide--clone)");Array.from(s).map((e,t)=>{const n=e.querySelector("jaaq-video-player");return{index:t,videoId:n?.getAttribute("video-id")||"unknown",isActive:e.classList.contains("is-active")}}),s.forEach((e,n)=>{const i=e.querySelector("jaaq-video-player");if(!i)return;const o=i.getAttribute("video-id");e.classList.contains("is-active")?t&&(this.autoplayTimeoutId=window.setTimeout(()=>{console.log("[CollectionPlayer] 1s delay complete, playing video",{index:n,videoId:o}),i.play?.()},1e3)):i.pause?.()})}destroyCarousel(){null!==this.autoplayTimeoutId&&(clearTimeout(this.autoplayTimeoutId),this.autoplayTimeoutId=null),this.splide&&(this.splide.destroy(),this.splide=null),this.container&&(this.container.innerHTML=""),this.collectionData=null}emitError(e){this.container&&(this.container.innerHTML=`\n <div class="jaaq-collection-error">\n ${e.message}\n </div>\n `),this.dispatchEvent(new CustomEvent("jaaq:collection:error",{detail:e,bubbles:!0,composed:!0}))}get client(){return this.clientInstance}set client(e){this.clientInstance=e,this.connected&&(this.destroyCarousel(),this.initCarousel())}get collectionId(){return this.getAttribute("collection-id")}set collectionId(e){e?this.setAttribute("collection-id",e):this.removeAttribute("collection-id")}refresh(){this.destroyCarousel(),this.initCarousel()}next(){this.splide?.go("+1")}prev(){this.splide?.go("-1")}go(e){this.splide?.go(e)}destroy(){this.destroyCarousel()}getCollection(){return this.collectionData}}const gn="jaaq-video-player",vn="jaaq-collection-player";function yn(){"undefined"!=typeof window&&"undefined"!=typeof customElements?(customElements.get(gn)||customElements.define(gn,p),customElements.get(vn)||customElements.define(vn,mn)):console.warn("Custom Elements API is not available. Web components cannot be registered.")}function bn({videoId:e,apiKey:n,clientId:i,client:s,baseUrl:a,autoplay:r=!1,controls:l=!0,width:c="100%",height:d="auto",className:u="",showLogo:p=!0,showTitle:h=!0,showAuthor:f=!0,showDescription:m=!0,showCaptions:g=!0,onPlay:v,onPause:y,onError:b,onLoaded:w,onTimeUpdate:x,onVolumeChange:_,onEnded:E,onFullscreenChange:C,showInfo:j=!1},q){const k=t.useRef(null),L=t.useRef(null);t.useImperativeHandle(q,()=>({play:()=>k.current?.play(),pause:()=>k.current?.pause(),setVolume:e=>k.current?.setVolume(e),toggleMute:()=>k.current?.toggleMute(),seek:e=>k.current?.seek(e),getState:()=>k.current?.getState()||null,destroy:()=>k.current?.destroy()}));const S=e=>{const t=e.detail;L.current=t,w?.(t)},A=()=>v?.(),P=()=>y?.(),I=e=>{const t=e.detail;x?.(t)},M=e=>{const t=e.detail;_?.(t)},T=()=>E?.(),D=e=>{const t=e.detail;b?.(t)},B=e=>{const t=e.detail;C?.(t)};return t.useEffect(()=>{const e=k.current;if(e)return s&&(e.client=s),e.addEventListener("jaaq:loaded",S),e.addEventListener("jaaq:play",A),e.addEventListener("jaaq:pause",P),e.addEventListener("jaaq:timeupdate",I),e.addEventListener("jaaq:volumechange",M),e.addEventListener("jaaq:ended",T),e.addEventListener("jaaq:error",D),e.addEventListener("jaaq:fullscreenchange",B),()=>{e.removeEventListener("jaaq:loaded",S),e.removeEventListener("jaaq:play",A),e.removeEventListener("jaaq:pause",P),e.removeEventListener("jaaq:timeupdate",I),e.removeEventListener("jaaq:volumechange",M),e.removeEventListener("jaaq:ended",T),e.removeEventListener("jaaq:error",D),e.removeEventListener("jaaq:fullscreenchange",B)}},[s,v,y,b,w,x,_,E,C]),o.createElement("div",{style:{width:c,height:d},className:u},o.createElement("jaaq-video-player",{ref:k,"video-id":e,"api-key":n,"client-id":i,"base-url":a,autoplay:r?"true":"false",controls:l?"true":"false","show-logo":p?"true":"false","show-title":h?"true":"false","show-author":f?"true":"false","show-description":m?"true":"false","show-captions":g?"true":"false",width:"100%",height:"auto"}),j&&L.current&&o.createElement("div",{className:"jaaq-video-info",style:{marginTop:"16px",padding:"16px",background:"#f8f9fa",borderRadius:"8px"}},o.createElement("h3",{style:{margin:"0 0 12px 0",fontSize:"18px"}},L.current.question||L.current.description||"Untitled Video"),o.createElement("p",{style:{margin:"0 0 8px 0"}},o.createElement("strong",null,"Video ID:")," ",L.current.id),o.createElement("p",{style:{margin:"0 0 8px 0"}},o.createElement("strong",null,"Duration:")," ",L.current.duration||"Unknown"," seconds")))}"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{yn()}):yn()),"undefined"!=typeof window&&yn(),bn.displayName="VideoPlayer";const wn=t.forwardRef(bn);function xn({collectionId:e,apiKey:n,clientId:i,subscriptionId:s,client:a,baseUrl:r,autoplay:l=!1,showArrows:c=!0,showDots:d=!0,className:u="",onLoaded:p,onError:h,onSlideChange:f},m){const g=t.useRef(null);t.useImperativeHandle(m,()=>({refresh:()=>g.current?.refresh(),next:()=>g.current?.next(),prev:()=>g.current?.prev(),go:e=>g.current?.go(e),destroy:()=>g.current?.destroy(),getCollection:()=>g.current?.getCollection()||null}));const v=e=>{const t=e.detail;p?.(t)},y=e=>{const t=e.detail;h?.(t)},b=e=>{const t=e.detail;f?.(t)};return t.useEffect(()=>{const e=g.current;if(e)return a&&(e.client=a),e.addEventListener("jaaq:collection:loaded",v),e.addEventListener("jaaq:collection:error",y),e.addEventListener("jaaq:collection:slidechange",b),()=>{e.removeEventListener("jaaq:collection:loaded",v),e.removeEventListener("jaaq:collection:error",y),e.removeEventListener("jaaq:collection:slidechange",b)}},[a,p,h,f]),o.createElement("div",{className:u},o.createElement("jaaq-collection-player",{ref:g,"collection-id":e,"api-key":n,"client-id":i,"subscription-id":s,"base-url":r,autoplay:l?"true":"false","show-arrows":c?"true":"false","show-dots":d?"true":"false"}))}"undefined"!=typeof window&&yn(),xn.displayName="CollectionPlayer";const _n=t.forwardRef(xn);e.CollectionPlayer=_n,e.VideoPlayer=wn});
|
|
8
|
+
//# sourceMappingURL=jaaq-ui-react.min.js.map
|