Liferay.Loader.define("item-selector-taglib@5.2.9/item_selector_preview/js/Carousel.es",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/tabs","liferay!frontend-js-react-web$react","./NoPreview.es","./PreviewImage.es","./PreviewVideo.es"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=s(a("@frontend-taglib-clay$clayui/button")),r=s(a("@frontend-taglib-clay$clayui/icon")),n=s(a("@frontend-taglib-clay$clayui/tabs")),d=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var a={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=l?Object.getOwnPropertyDescriptor(e,r):null;n&&(n.get||n.set)?Object.defineProperty(a,r,n):a[r]=e[r]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react")),c=s(a("./NoPreview.es")),i=s(a("./PreviewImage.es")),u=s(a("./PreviewVideo.es"));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function s(e){return e&&e.__esModule?e:{default:e}}const e=({direction:e,handleClick:t})=>d.default.createElement("div",{className:"pull-".concat(e)},d.default.createElement(l.default,{borderless:!0,className:"icon-arrow",displayType:"secondary",onClick:t,size:"lg"},d.default.createElement(r.default,{symbol:"angle-".concat(e)}))),m=({metadata:e})=>{const[t,a]=(0,d.useState)(0),l=JSON.parse(e),r=l.groups.map(((e,l)=>d.default.createElement(n.default.Item,{active:t===l,key:e.title,onClick:()=>a(l)},e.title))),c=l.groups.map(((e,t)=>{const a=e.data.map((e=>d.default.createElement(d.default.Fragment,{key:e.key},d.default.createElement("dt",{className:"sidebar-dt"},e.key),d.default.createElement("dd",{className:"sidebar-dd"},e.value))));return d.default.createElement(n.default.TabPane,{"aria-labelledby":"tab-".concat(t),key:"tabPane-".concat(t)},d.default.createElement("dl",{className:"sidebar-dl sidebar-section"},a))}));return d.default.createElement("div",{className:"info-panel sidenav-menu-slider"},d.default.createElement("div",{className:"sidebar sidenav-menu"},d.default.createElement("div",{className:"sidebar-header"},d.default.createElement(n.default,null,r)),d.default.createElement("div",{className:"sidebar-body"},d.default.createElement(n.default.Content,{activeIndex:t,fade:!0},c))))};var f=({currentItem:t,handleClickNext:a,handleClickPrevious:l,isImage:r,showArrows:n=!0})=>{var o;const s="video"===t.type;let f=s&&(null==t||null===(o=t.value)||void 0===o?void 0:o.html);return s&&"string"==typeof t.value&&(f=JSON.parse(t.value).html),d.default.createElement("div",{className:"carousel closed sidenav-container"},d.default.createElement(m,{metadata:t.metadata}),d.default.createElement("div",{className:"sidenav-content"},n&&d.default.createElement(e,{direction:"left",handleClick:l}),s?d.default.createElement(u.default,{html:f}):r?d.default.createElement(i.default,{src:t.url||t.base64,title:t.title}):d.default.createElement(c.default,null),n&&d.default.createElement(e,{direction:"right",handleClick:a})))};t.default=f}}));
//# sourceMappingURL=Carousel.es.js.map