Version Description
- January 18, 2022 =
- Fix: Chapters not showing in timeline for Vimeo videos.
- Fix: Dynamic text not being replaced in Watermark.
- Fix: Issue where muted autoplay videos requiring double-tap on iOS to play.
- Fix: Hide logo option not showing in preview.
Download this release
Release Info
Developer | 2winfactor |
Plugin | The Ultimate Video Player For WordPress – by Presto Player |
Version | 1.8.3 |
Comparing to | |
See all releases |
Code changes from version 1.8.2 to 1.8.3
dist/blocks/admin-15afa29d.js
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
/*!
|
2 |
-
*
|
3 |
-
* Presto Player
|
4 |
-
*
|
5 |
-
* @author Presto Made, Inc
|
6 |
-
* @version 0.1.0
|
7 |
-
* @link undefined
|
8 |
-
* @license GPL
|
9 |
-
*
|
10 |
-
* Copyright (c) 2022 Presto Made, Inc
|
11 |
-
*
|
12 |
-
* This software is released under the GPL License
|
13 |
-
* https://opensource.org/licenses/GPL
|
14 |
-
*
|
15 |
-
* Compiled with the help of https://wpack.io
|
16 |
-
* A zero setup Webpack Bundler Script for WordPress
|
17 |
-
*/
|
18 |
-
(window.wpackioprestoPlayerblocksJsonp=window.wpackioprestoPlayerblocksJsonp||[]).push([[0],[,,,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},,,,,function(e,t,r){"use strict";r.d(t,"f",(function(){return l})),r.d(t,"d",(function(){return c})),r.d(t,"e",(function(){return i})),r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return p})),r.d(t,"a",(function(){return u}));var n=wp.element,a=n.useRef,o=n.useEffect;function l(e){var t=a();return o((function(){t.current=e})),t.current}function c(e){var t=e.status,r=void 0===t?"success":t,n=e.message;wp.data.dispatch("core/notices").createNotice(r,n,{type:"snackbar"})}function i(e){var t,r=e.split(":");return r.length>1&&(t=60*parseInt(r[0])),parseInt(r[1])+parseInt(t)}function s(e){var t=parseInt(e,10),r=Math.floor(t/60);return t<10&&(t="0"+t),r+":"+t}function p(e){var t=e;if(!(t=t.replace(/[^\d\d:\d\d.-]/g,"")).includes(":"))return"".concat(t,":00");0===t.substr(0,t.indexOf(":")).length&&(t="0".concat(t));var r=t.indexOf(":");return t=t.substring(0,r+3)}function u(e){if(e){if(e.match(/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/))return"youtube";if(e.match(/(https?:\/\/)?(www\.)?(player\.)?vimeo\.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/))return"vimeo";if(e.indexOf("https://vz-")>-1&&e.indexOf("b-cdn.net")>-1)return"bunny";if(e.indexOf(".mp3")>-1)return"audio"}return"self-hosted"}},function(e,t,r){"use strict";var n=wp.i18n.__;t.a=function(){return React.createElement("div",{className:"presto-player__pro-badge"},n("Pro","presto-player"))}},,function(e,t,r){"use strict";var n=r(1),a=r(0),o=wp.components,l=o.ColorPicker,c=o.ColorIndicator,i=o.Popover,s=o.Button,p=(o.Flex,wp.element),u=p.useState,d=p.useEffect,b=wp.i18n.__;t.a=function(e){var t=e.color,r=e.setColor,o=e.onFocus,p=u(!1),m=Object(n.a)(p,2),y=m[0],v=m[1],f=u(t),h=Object(n.a)(f,2),O=h[0],g=h[1];return d((function(){y&&t&&g(t)}),[y]),Object(a.b)("span",null,Object(a.b)(c,{css:{width:"25px",height:"25px",borderRadius:"9999px"},colorValue:t,onClick:function(){v(!y),o&&o()}}),!!y&&Object(a.b)(i,{position:"bottom left",focusOnMount:!0,onFocusOutside:function(e){v(!1)}},Object(a.b)(l,{color:t||"",onChangeComplete:function(e){return(null==e?void 0:e.hex)&&r(e)},disableAlpha:!0}),Object(a.b)("div",{css:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px"}},Object(a.b)(s,{css:{margin:"0 5px"},isTertiary:!0,onClick:function(){r({hex:null}),v(!1)}},b("Reset","presto-player")),Object(a.b)("div",{css:{display:"flex",justifyContent:"flex-end",padding:"10px"}},Object(a.b)(s,{css:{margin:"0 5px"},isTertiary:!0,onClick:function(){r({hex:O}),v(!1)}},b("Cancel","presto-player")),Object(a.b)(s,{isPrimary:!0,onClick:function(){return v(!1)}},b("Apply","presto-player"))))))}},function(e,t){e.exports=window.wp.element},function(e,t,r){"use strict";var n=r(5),a=r(23),o=r(9);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var i=wp.data.useSelect;t.a=function(e){var t,r,n,l=e.src,s=e.classes,p=e.preset,u=e.branding,d=e.attributes,b=e.adminPreview,m=e.currentTime,y=e.preload,v=void 0===y?"metadata":y,f=e.overlays,h=e.type,O=d.chapters,g=d.mutedOverlay,j=d.mutedPreview,w=i((function(e){var t;return null===(t=e("presto-player/player"))||void 0===t?void 0:t.youtube()})),_=i((function(e){var t;return null===(t=e("presto-player/player"))||void 0===t?void 0:t.playerCSS()}));return React.createElement("div",{className:"wp-block-video presto-block-video",style:"audio"===h?c(c(c({"--presto-player-border-radius":"".concat(null==p?void 0:p.border_radius,"px")},null!=p&&p.background_color?{"--plyr-audio-controls-background":p.background_color}:{"--plyr-audio-controls-background":null==u?void 0:u.color}),null!=p&&p.control_color?{"--plyr-audio-control-color":p.control_color,"--plyr-range-thumb-background":p.control_color,"--plyr-range-fill-background":p.control_color,"--plyr-audio-progress-buffered-background":function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=e.replace("#","");3===r.length&&(r=r[0]+r[0]+r[1]+r[1]+r[2]+r[2]);var n=parseInt(r.substring(0,2),16),a=parseInt(r.substring(2,4),16),o=parseInt(r.substring(4,6),16);return t>1&&t<=100&&(t/=100),"rgba("+n+","+a+","+o+","+t+")"}(p.control_color||(null==u?void 0:u.color)||"#00b3ff",.5)}:{"--plyr-audio-control-color":"#ffffff","--plyr-range-thumb-background":"#ffffff","--plyr-range-fill-background":"#ffffff"}),{},{"--plyr-range-thumb-shadow":"0px"}):c(c(c({"--presto-player-border-radius":"".concat(null==p?void 0:p.border_radius,"px")},null!=p&&p.caption_background?{"--plyr-captions-background":p.caption_background}:{}),null!=u&&u.color?{"--plyr-color-main":u.color}:{}),{},{"--presto-player-email-border-radius":"".concat((null==p||null===(t=p.email_collection)||void 0===t?void 0:t.border_radius)||0,"px"),"--presto-player-logo-width":"".concat((null==u?void 0:u.logo_width)||75,"px")})},React.createElement(a.c,{src:l,css:_,classes:s,currentTime:m,overlays:f,isAdmin:!0,preload:v,preset:p,bunny:{thumbnail:null==d?void 0:d.previewThumbnail,preview:null==d?void 0:d.preview},youtube:{channelId:null==w?void 0:w.channel_id},tracks:!(null==p||!p.captions)&&[{kind:"captions",label:"English",srclang:"en",src:"/path/to/captions.en.vtt",default:!0}],branding:u,chapters:O,blockAttributes:d,poster:d.poster,provider:"audio"===h?"audio":Object(o.a)(l),mediaTitle:d.title},React.createElement("div",{slot:"player-end"},(null==j?void 0:j.enabled)&&(null==g?void 0:g.enabled)&&React.createElement("div",{className:"presto-player__overlay is-image",style:{position:"absolute",width:"".concat((null==g?void 0:g.width)||100,"%"),left:"".concat(100*((null==g||null===(r=g.focalPoint)||void 0===r?void 0:r.x)||.5),"%"),top:"".concat(100*((null==g||null===(n=g.focalPoint)||void 0===n?void 0:n.y)||.5),"%")}},React.createElement("img",{src:null==g?void 0:g.src,style:{transform:"translateX(-50%) translateY(-50%)"}})),b)))}},function(e,t,r){"use strict";var n={setUrlPrivate:function(){var e=-1===window.location.href.indexOf("?")?"?":"&",t=window.location.href+e+"presto_video_type=private";window.history.pushState({path:t},"",t)},setUrlPublic:function(){var e=-1===window.location.href.indexOf("?")?"?":"&",t=window.location.href+e+"presto_video_type=public";window.history.pushState({path:t},"",t)},unsetUrlParams:function(){var e=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=new URL(e);return t.forEach((function(e){r.searchParams.delete(e)})),r.href}(window.location.href,["presto_video_type"]);window.history.pushState({path:e},"",e)}};t.a=n},function(e,t){e.exports=window.wp.data},function(e,t,r){"use strict";var n,a=r(5),o=(n={visibility:{type:String,default:"public"},color:{type:String,default:"#00b3ff"},blockAlignment:{type:String},mutedPreview:{type:Object,default:{enabled:!1,captions:!1}},mutedOverlay:{type:Object,default:{enabled:!1,src:"",width:200,focalPoint:{x:.5,y:.5}}},mutedPreviewCaptions:{type:Boolean},mutedOverlayType:{type:String,default:"text"},mutedOverlayText:{type:String,default:"Click to play"},mutedOverlaySrc:{type:String},mutedOverlayImageWidth:{type:Number,default:200},mutedOverlayFocalPoint:{type:Object}},Object(a.a)(n,"mutedOverlay",{type:Object,default:{enabled:!1,type:"text",text:"",src:"",width:200,focalPoint:{x:.5,y:.5}}}),Object(a.a)(n,"autoplay",{type:Boolean}),Object(a.a)(n,"preload",{type:String}),Object(a.a)(n,"playsInline",{type:Boolean}),Object(a.a)(n,"id",{type:Number}),Object(a.a)(n,"attachment_id",{type:Number}),Object(a.a)(n,"src",{type:String}),Object(a.a)(n,"imageID",{type:Number}),Object(a.a)(n,"poster",{type:String}),Object(a.a)(n,"content",{type:Boolean}),Object(a.a)(n,"preset",{type:Number}),Object(a.a)(n,"chapters",{type:Array,default:[]}),Object(a.a)(n,"overlays",{type:Array,default:[]}),Object(a.a)(n,"tracks",{type:"array",items:{type:"object"},default:[]}),n);t.a={attributes:o,category:"presto",supports:{align:!0},save:function(){return null}}},function(e,t,r){"use strict";function n(e){var t,r=(e||"").match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);return r&&11===(null==r||null===(t=r[2])||void 0===t?void 0:t.length)?r[2]:null}function a(e){var t=/^.*(vimeo\.com\/)((channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/))?([0-9]+)/.exec(e||"");return(null==t?void 0:t[5])||""}function o(e){var t=a(e);if(t)return{video_id:t,type:"vimeo"};var r=n(e);return r?{video_id:r,type:"youtube"}:{$video_id:0,$type:"none"}}function l(e){return"string"==typeof e&&e.includes(".m3u8")}r.d(t,"c",(function(){return n})),r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return o})),r.d(t,"d",(function(){return l}))},,function(e,t,r){"use strict";var n=r(5),a=r(7),o=r(1),l=r(2),c=r.n(l),i=r(9),s=r(33);function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d=wp.compose.createHigherOrderComponent,b=wp.element,m=b.useEffect,y=b.useState;t.a=function(){return d((function(e){return function(t){var r=t.presets,n=t.attributes,l=t.setAttributes,p=t.defaultPreset,d=t.isSelected,b=t.branding,v=y({}),f=Object(o.a)(v,2),h=f[0],O=f[1],g=y(1),j=Object(o.a)(g,2),w=j[0],E=j[1],R=n.poster,k=n.chapters;m((function(){d&&null!=n&&n.id&&wp.data.dispatch("core/edit-post").openGeneralSidebar("edit-post/block")}),[d]),m((function(){d&&null!=n&&n.selectionOverrideClientId&&wp.data.dispatch("core/block-editor").selectBlock(null==n?void 0:n.selectionOverrideClientId)}),[d]),m((function(){if(r&&r.length){var e=r.find((function(e){return e.id===(null==n?void 0:n.preset)}));e?O(e):(O(p),l({preset:null==p?void 0:p.id}))}}),[r,null==n?void 0:n.preset]),m((function(){P()}),[R,h,k,b.logo]);var P=function(){E(w+1)},C=Object(i.f)(k);m((function(){var e=null==k?void 0:k.map((function(e){return e.time})),t=null==C?void 0:C.map((function(e){return e.time}));_.difference(e,t).length&&P()}),[k]);var x=function(){var e=Object(a.a)(c.a.mark((function e(t){var r,n,a,o,i,p,d;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.src,n=t.external_id,a=t.attachment_id,o=t.type,i=t.title,r||n||a){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,Object(s.a)({method:"POST",path:"/presto-player/v1/videos",data:u(u({attachment_id:a,post_id:wp.data.select("core/editor").getCurrentPostId(),external_id:n},i?{title:i}:{}),{},{src:r,type:o})});case 5:p=e.sent,d=p.id,l({id:d});case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return null!=n&&n.preset||l({preset:null==p?void 0:p.id}),React.createElement(e,Object.assign({},t,{lockSave:function(){return wp.data.dispatch("core/editor").lockPostSaving("presto-player")},unlockSave:function(){return wp.data.dispatch("core/editor").unlockPostSaving("presto-player")},createVideo:x,onUpdate:P,onRemoveSrc:function(){confirm("Remove this video?")&&l(u(u(u(u({src:"",id:void 0},null!=n&&n.thumbnail?{thumbnail:null}:{}),null!=n&&n.preview?{preview:null}:{}),null!=n&&n.previewSrc?{previewSrc:null}:{}),null!=n&&n.previewThumbnail?{previewThumbnail:null}:{}))},presetData:h,setPresetData:O,renderKey:w}))}}),"withPlayerEdit")}},function(e,t,r){"use strict";var n=wp.data.withSelect;t.a=function(e){return n((function(e){return{branding:e("presto-player/player").branding(),loading:e("presto-player/player").isResolving("getPresets"),presets:e("presto-player/player").getPresets(),defaultPreset:e("presto-player/player").getDefaultPreset()}}))}},function(e,t,r){"use strict";var n,a=r(29),o=r(39),l=r(10),c=r(6),i=r(1),s=r(50),p=r(0),u=wp.i18n.__,d=wp.element.useState,b=wp.data,m=(b.useSelect,b.dispatch),y=wp.components,v=(y.withNotices,y.BaseControl),f=(y.Spinner,y.Button),h=function(e){var t,r=e.setAttributes,a=e.attributes,o=a.overlays,b=d(!1),y=Object(i.a)(b,2),h=y[0],O=y[1];return Object(p.b)(React.Fragment,null,Object(p.b)(v,null,Object(p.b)(f,{isPrimary:!0,onClick:function(){var e;null!==(e=prestoPlayer)&&void 0!==e&&e.isPremium?O(!0):m("presto-player/player").setProModal(!0)}},o.length?u("Update Overlays","presto-player"):u("Add Overlay","presto-player"),!!o.length&&Object(p.b)("div",{css:Object(p.a)(n||(n=Object(c.a)(["\n font-size: 10px;\n background: #fff;\n color: var(--wp-admin-theme-color);\n font-weight: bold;\n display: inline-block;\n line-height: 6px;\n padding: 5px;\n border-radius: 9999px;\n margin-left: 10px;\n "])))},o.length)),!(null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium)&&Object(p.b)(l.a,null)),h&&Object(p.b)(s.a,{closeModal:function(){return O(!1)},attributes:a,setAttributes:r,updateOverlayAttribute:function(e){r({overlays:e})}}))},O=r(7),g=r(5),j=r(2),w=r.n(j),_=r(9),E=r(31),R=r(35),k=r(40),P=wp.i18n.__,C=wp.components,x=C.ToggleControl,S=C.BaseControl,N=C.HorizontalRule,T=C.__experimentalAlignmentMatrixControl,D=C.SelectControl,B=function(e){var t=e.state,r=e.updateState,n=e.className;return React.createElement("div",{className:n},React.createElement(S,null,React.createElement("h3",null,P("Behavior","presto-player"))),React.createElement(S,null,React.createElement(x,{label:P("Auto-Hide Controls","presto-player"),help:P("Hide video controls automatically after 2 seconds of no mouse movement.","presto-player"),onChange:function(e){r({auto_hide:e})},checked:t.auto_hide})),React.createElement(S,null,React.createElement(x,{label:P("Save Play Position","presto-player"),help:P("Saves the user's play position so when they come back to the page they can continue the video from where they left off.","presto-player"),onChange:function(e){r({save_player_position:e})},checked:t.save_player_position})),React.createElement(S,null,React.createElement(x,{label:P("Captions On By Default","presto-player"),help:P("Toggles if captions should be active by default.","presto-player"),onChange:function(e){r({captions_enabled:e})},checked:t.captions_enabled})),React.createElement(S,null,React.createElement(x,{label:P("Focus Mode","presto-player"),help:P("Play only when tab is visible and video is in viewport.","presto-player"),onChange:function(e){r({play_video_viewport:e})},checked:t.play_video_viewport})),React.createElement(S,null,React.createElement(x,{label:P("Sticky On Scroll","presto-player"),help:P("Stick videos to the side of the screen when the page is scrolled and the video is playing.","presto-player"),onChange:function(e){r({sticky_scroll:e})},checked:t.sticky_scroll})),!!t.sticky_scroll&&React.createElement(React.Fragment,null,React.createElement(S,{label:P("Choose a position for your sticky player.","presto-player")},React.createElement(T,{value:t.sticky_scroll_position,onChange:function(e){r({sticky_scroll_position:e})}}))),React.createElement(S,null,React.createElement(D,{label:P("On Video End","presto-player"),value:t.on_video_end,options:[{value:"select",label:P("Select","presto-player")},{value:"loop",label:P("Loop","presto-player")},{value:"go-to-start",label:P("Go to start","presto-player")}],onChange:function(e){r({on_video_end:e})}})),React.createElement(N,null),React.createElement(S,null),React.createElement(S,null,React.createElement("h3",null,P("Youtube","presto-player"))),React.createElement(S,null,React.createElement(x,{label:P("Hide Youtube UI (Experimental)","presto-player"),help:P("Hides the Youtube logo and related videos.","presto-player"),onChange:function(e){r({hide_youtube:e})},checked:t.hide_youtube})),React.createElement(S,null,React.createElement(x,{label:P("Lazy Load Videos","presto-player"),help:P("Improves page loading performance by only loading the video when clicked.","presto-player"),onChange:function(e){r({lazy_load_youtube:e})},checked:t.lazy_load_youtube})))},A=wp.i18n.__,L=wp.components,I=L.ToggleControl,F=L.BaseControl,V=function(e){var t=e.state,r=e.updateState,n=e.className;return React.createElement("div",{className:n},React.createElement(F,null,React.createElement("h3",null,A("Controls","presto-player"))),React.createElement(F,{className:"presto-player__control--large-play"},React.createElement(I,{label:A("Large Play Button","presto-player"),help:A("Adds a large play button over the top of the player.","presto-player"),onChange:function(e){r({"play-large":e})},checked:t["play-large"]})),React.createElement(F,{className:"presto-player__control--rewind"},React.createElement(I,{label:A("Rewind","presto-player"),help:A("Adds a 10 second rewind button to the player.","presto-player"),onChange:function(e){r({rewind:e})},checked:t.rewind})),React.createElement(F,{className:"presto-player__control--play"},React.createElement(I,{label:A("Small Play Button","presto-player"),help:A("Adds a small play button to the bottom of the player.","presto-player"),onChange:function(e){r({play:e})},checked:t.play})),React.createElement(F,{className:"presto-player__control--fast-forward"},React.createElement(I,{label:A("Fast Forward","presto-player"),help:A("Adds a 10 second rewind button to the player.","presto-player"),onChange:function(e){r({"fast-forward":e})},checked:t["fast-forward"]})),React.createElement(F,{className:"presto-player__control--progress"},React.createElement(I,{label:A("Progress Bar","presto-player"),help:A("Shows a seekable progress bar.","presto-player"),onChange:function(e){r({progress:e})},checked:t.progress})),React.createElement(F,{className:"presto-player__control--current-time"},React.createElement(I,{label:A("Current Time","presto-player"),help:A("Shows the video timestamp.","presto-player"),onChange:function(e){r({"current-time":e})},checked:t["current-time"]})),React.createElement(F,{className:"presto-player__control--volume"},React.createElement(I,{label:A("Volume","presto-player"),help:A("Shows a volume bar.","presto-player"),onChange:function(e){r({volume:e,mute:e})},checked:t.volume})),React.createElement(F,{className:"presto-player__control--speed"},React.createElement(I,{label:A("Speed","presto-player"),help:A("Shows playback speed controls.","presto-player"),onChange:function(e){r({speed:e})},checked:t.speed})),React.createElement(F,{className:"presto-player__control--pip"},React.createElement(I,{label:A("Picture In Picture (HTML5 only)","presto-player"),help:A("Allows users to dock the player on their screen and watch when using other app on their computer.","presto-player"),onChange:function(e){r({pip:e})},checked:t.pip})),React.createElement(F,{className:"presto-player__control--fullscreen"},React.createElement(I,{label:A("Fullscreen","presto-player"),help:A("Adds a button to allow the player to be fullscreen.","presto-player"),onChange:function(e){r({fullscreen:e})},checked:t.fullscreen})),React.createElement(F,{className:"presto-player__control--captions"},React.createElement(I,{label:A("Captions","presto-player"),help:A("Shows a dedicated caption toggle button.","presto-player"),onChange:function(e){r({captions:e})},checked:t.captions})))},U=r(36),M=r(12);function z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function W(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach((function(t){Object(g.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var H,Y,G=wp.i18n.__,q=wp.components,Z=q.ToggleControl,K=q.BaseControl,Q=q.RadioControl,X=q.Flex,$=q.RangeControl,J=wp.element.useEffect,ee=function(e){var t=e.state,r=e.updateState,n=e.className,a=t.watermark,o={text:G("Enter your watermark text.","presto-player"),position:"top-right",color:"#fff",backgroundColor:"#333",opacity:80};J((function(){Object.keys(o).forEach((function(e){var r;void 0===(null==t||null===(r=t.watermark)||void 0===r?void 0:r[e])&&l(Object(g.a)({},e,o[e]))}))}),[t]);var l=function(e){r(W(W({},t),{},{watermark:W(W({},a),e)}))};return React.createElement("div",{className:n},React.createElement(K,null,React.createElement("h3",null,G("Dynamic Watermark Text","presto-player"))),React.createElement(K,{className:"presto-player__control--watermark"},React.createElement(Z,{label:G("Enable","presto-player"),help:G("Add a simulated dynamic watermark over your video.","presto-player"),onChange:function(e){l({enabled:e})},checked:null==a?void 0:a.enabled})),(null==a?void 0:a.enabled)&&React.createElement("div",null,React.createElement(U.a,{text:null==a?void 0:a.text,update:function(e){var t=e.text;l({text:t})}}),React.createElement(K,{className:n},React.createElement(Q,{label:G("Position","presto-player"),options:[{label:"Top Right",value:"top-right"},{label:"Top Left",value:"top-left"},{label:"Change Every 10 Seconds",value:"randomize"}],selected:(null==a?void 0:a.position)||"top-right",onChange:function(e){return l({position:e})}})),React.createElement(K,{className:"presto-player__control-text-color"},React.createElement(X,null,React.createElement(K.VisualLabel,null,G("Text Color","presto-player")),React.createElement(M.a,{color:(null==a?void 0:a.color)||"#fff",setColor:function(e){return l({color:e&&e.hex})}}))),React.createElement(K,{className:"presto-player__control-text-color"},React.createElement(X,null,React.createElement(K.VisualLabel,null,G("Background Color","presto-player")),React.createElement(M.a,{color:(null==a?void 0:a.backgroundColor)||"#333",setColor:function(e){return l({backgroundColor:e&&e.hex})}}))),React.createElement(K,null,React.createElement($,{label:G("Opacity","presto-player"),help:G("Opacity percentage of the watermark.","presto-player"),value:(null==a?void 0:a.opacity)||100,onChange:function(e){return l({opacity:e})},min:0,max:100}))))},te=r(32),re=r(38),ne=wp.i18n.__,ae=wp.components,oe=ae.ToggleControl,le=ae.BaseControl,ce=ae.RangeControl,ie=ae.SelectControl,se=ae.ColorPicker,pe=function(e){var t=e.state,r=e.updateState,n=e.className;return React.createElement("div",{className:n},React.createElement(le,null,React.createElement("h3",null,ne("Style","presto-player"))),React.createElement(le,null,React.createElement(oe,{label:ne("Hide Logo","presto-player"),help:ne("Hides the logo on this video.","presto-player"),onChange:function(e){r({hide_logo:e})},checked:t.hide_logo})),React.createElement(le,null,React.createElement(ce,{label:ne("Round Corners","presto-player"),help:ne("Player border radius size.","presto-player"),value:(null==t?void 0:t.border_radius)||0,onChange:function(e){return r({border_radius:e})},min:0,max:25})),React.createElement(le,null,React.createElement(ie,{label:ne("Caption Style","presto-player"),labelPosition:"top",value:null==t?void 0:t.caption_style,options:[{label:ne("Default","presto-player"),value:"default"},{label:ne("Full","presto-player"),value:"full"}],onChange:function(e){r({caption_style:e})}})),React.createElement(le,null,React.createElement(le.VisualLabel,null,React.createElement("p",null,ne("Caption Background","presto-player"))),React.createElement(se,{color:(null==t?void 0:t.caption_background)||"#000000",onChangeComplete:function(e){r({caption_background:e.hex})},disableAlpha:!0})))};function ue(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function de(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ue(Object(r),!0).forEach((function(t){Object(g.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ue(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var be=wp.i18n.__,me=wp.components,ye=me.TextControl,ve=me.BaseControl,fe=me.Icon,he=me.Notice,Oe=me.Button,ge=me.Flex,je=me.FlexItem,we=me.SelectControl,_e=me.FlexBlock,Ee=me.Modal,Re=wp.element,ke=Re.useState,Pe=Re.useEffect,Ce=wp.data,xe=Ce.useSelect,Se=Ce.dispatch;var Ne=function(e){var t=e.type,r=void 0===t?"new":t,n=e.closeModal,a=e.addPreset,o=e.onSave,l=e.updatePreset,s=e.name,u=void 0===s?"":s,d=e.preset,b=void 0===d?{"play-large":!0,rewind:!0,play:!0,"fast-forward":!0,progress:!0,"current-time":!0,mute:!0,volume:!0,speed:!1,pip:!1,fullscreen:!0,captions:!1,save_player_position:!1,reset_on_end:!1,auto_hide:!0,sticky_scroll:!1,hide_logo:!1,border_radius:0,skin:"default",caption_style:"default",caption_background:"#000000",hide_youtube:!1,lazy_load_youtube:!1,cta:{},email_collection:{},action_bar:{}}:d,m=ke(!1),y=Object(i.a)(m,2),v=y[0],f=y[1],h=ke(""),g=Object(i.a)(h,2),j=g[0],P=g[1],C=ke(""),x=Object(i.a)(C,2),S=x[0],N=x[1],T=ke(u),D=Object(i.a)(T,2),A=D[0],L=D[1],I=ke(b),F=Object(i.a)(I,2),U=F[0],M=F[1],z=xe((function(e){return e("presto-player/player").branding()})),W=ke(""),G=Object(i.a)(W,2),q=G[0],Z=G[1],K={message:be("The preset could not be saved. Please reload the page and try again.","presto-player")},Q=xe((function(e){return e("presto-player/player").youtube()}));Pe((function(){Z(Q.channel_id)}),[null==Q?void 0:Q.channel_id]);var X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};M(de(de({},U),e))},$=function(){var e=Object(O.a)(w.a.mark((function e(){var t,r,a,c;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f(!0),e.prev=1,t=de(de({},U),{name:A}),e.next=5,wp.apiFetch({method:"POST",url:wp.url.addQueryArgs("".concat(prestoPlayer.root).concat(prestoPlayer.prestoVersionString,"preset/").concat(b.id),{_method:"PUT"}),data:t});case 5:if(r=e.sent){e.next=8;break}throw K;case 8:l(r),n(),o&&o(r),Object(_.d)({message:be("Preset updated!","presto-player")}),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),P(null!==e.t0&&void 0!==e.t0&&e.t0.message?e.t0.message:K);case 17:return e.prev=17,f(!1),e.finish(17);case 20:return Se("presto-player/player").updateYoutube({channel_id:q}),a=de(de({},Q),{channel_id:q}),e.prev=22,e.next=25,wp.apiFetch({path:"wp/v2/settings",method:"POST",data:{presto_player_youtube:a}});case 25:null!=(c=e.sent)&&c.presto_player_youtube&&(Se("presto-player/player").setYoutube(null==c?void 0:c.presto_player_youtube),onClose()),e.next=32;break;case 29:e.prev=29,e.t1=e.catch(22),console.log(e.t1);case 32:case"end":return e.stop()}}),e,null,[[1,14,17,20],[22,29]])})));return function(){return e.apply(this,arguments)}}(),J=function(){var e=Object(O.a)(w.a.mark((function e(){var t;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f(!0),e.prev=1,e.next=4,wp.apiFetch({method:"POST",url:prestoPlayer.root+prestoPlayer.prestoVersionString+"preset",data:de(de({},{name:A}),U)});case 4:if(t=e.sent){e.next=7;break}throw K;case 7:a(t),n(),o&&o(t),Object(_.d)({message:be("Preset created!","presto-player")}),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),P(null!==e.t0&&void 0!==e.t0&&e.t0.message?e.t0.message:K);case 16:return e.prev=16,f(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[1,13,16,19]])})));return function(){return e.apply(this,arguments)}}(),ne=[{name:"controls",title:be("Controls","presto-player"),icon:Object(p.b)(fe,{icon:"admin-settings"}),component:Object(p.b)(V,{updateState:X,state:U})},{name:"behavior",title:be("Behavior","presto-player"),icon:Object(p.b)(fe,{icon:"admin-generic"}),component:Object(p.b)(B,{updateState:X,state:U})},{name:"style",title:be("Style","presto-player"),icon:Object(p.b)(fe,{icon:"admin-customizer"}),component:Object(p.b)(pe,{updateState:X,state:U})},{name:"email",title:be("Email Capture","presto-player"),icon:Object(p.b)(fe,{icon:"email"}),component:Object(p.b)(re.a,{updateState:X,state:U})},{name:"cta",title:be("Call To Action","presto-player"),icon:Object(p.b)(fe,{icon:"megaphone"}),component:Object(p.b)(te.a,{updateState:X,state:U})},{name:"action_bar",title:be("Action Bar","presto-player"),icon:Object(p.b)(fe,{icon:"cover-image"}),component:Object(p.b)(k.a,{updateState:X,state:U,value:q,setValue:Z})},{name:"watermark",title:be("Dynamic Watermark","presto-player"),icon:Object(p.b)(fe,{icon:"lock"}),component:Object(p.b)(ee,{updateState:X,state:U})}];return Object(p.b)(Ee,{title:be("edit"==r?"Edit A Video Preset":"Create A New Video Preset","presto-player"),onRequestClose:n,className:"presto-player__modal-presets",overlayClassName:"presto-player__modal-presets-overlay"},Object(p.b)("div",{className:"presto-player__preset-options","data-cy":"preset-modal"},Object(p.b)(ye,{value:A,hideLabelFromVision:!0,label:be("Preset Name","presto-player"),onChange:function(e){return L(e)},placeholder:be("Enter a preset name...","presto-player"),className:"presto-player__modal--style-name",autoFocus:!0}),Object(p.b)(ge,{align:"stretch",className:"presto-player__style-preview-area"},Object(p.b)(je,{className:"presto-player__style-sidebar"},Object(p.b)("div",null,Object(p.b)(E.a,{items:ne,title:be("Customize","presto-player"),onSelect:N},(function(e){return e.component})))),Object(p.b)(_e,{className:"presto-player__style-preview-panel"},Object(p.b)("div",{style:{position:"absolute",top:0,left:0,padding:"20px"}},Object(p.b)(we,{label:be("Skin","presto-player"),labelPosition:"side",value:null==U?void 0:U.skin,hideLabelFromVision:!0,options:[{label:be("Basic","presto-player"),value:"default"},{label:be("Stacked","presto-player"),value:"stacked"}],onChange:function(e){X({skin:e})}})),Object(p.b)(R.a,{poster:"https://source.unsplash.com/daily",state:U,branding:z,menu:S}))),Object(p.b)("br",null),j&&Object(p.b)(ve,null,Object(p.b)(he,{className:"presto-player__modal--error-notice",status:"error",isDismissible:!1,style:{margin:0}},j.replace(/(<([^>]+)>)/gi,""))),Object(p.b)("div",{css:Object(p.a)(H||(H=Object(c.a)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n "])))},Object(p.b)("div",{css:Object(p.a)(Y||(Y=Object(c.a)(["\n opacity: 0.5;\n font-size: 12px;\n "])))},"Preset ID: ",b.id),Object(p.b)("div",null,Object(p.b)(Oe,{isTertiary:!0,onClick:n,style:{margin:"0 6px"}},be("Cancel","presto-player")),Object(p.b)(Oe,{isPrimary:!0,isBusy:v,disabled:v,onClick:function(){if(A)return"edit"===r?$():J();P(be("You must enter a name for the preset.","presto-player"))},"data-cy":"submit-preset"},be("edit"==r?"Update Preset":"Create Preset","presto-player"))))))},Te=wp.i18n.__,De=wp.components,Be=De.Icon,Ae=De.Spinner,Le=De.Modal,Ie=De.Button,Fe=De.ButtonGroup,Ve=wp.element.useState,Ue=function(e){var t,r,n=e.preset,a=e.index,o=e.isActive,l=e.remove,c=e.setPreset,s=e.onEdit,p=Ve(!1),u=Object(i.a)(p,2),d=u[0],b=u[1],m=Ve(!1),y=Object(i.a)(m,2),v=y[0],f=y[1],h=function(){return f(!1)},g=function(){var e=Object(O.a)(w.a.mark((function e(){return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.id){e.next=3;break}return l(n),e.abrupt("return");case 3:return e.prev=3,b(!0),e.next=7,wp.apiFetch({method:"POST",url:wp.url.addQueryArgs("".concat(prestoPlayer.root).concat(prestoPlayer.prestoVersionString,"preset/").concat(n.id),{_method:"DELETE"})});case 7:e.sent&&(l(n),wp.data.dispatch("core/notices").createNotice("success",Te("Preset trashed.","presto-player"),{type:"snackbar",isDismissible:!0})),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(3),console.error(e.t0),null!==e.t0&&void 0!==e.t0&&e.t0.message&&wp.data.dispatch("core/notices").createNotice("error",e.t0.message,{type:"snackbar",isDismissible:!0});case 15:return e.prev=15,f(!1),b(!1),e.finish(15);case 19:case"end":return e.stop()}}),e,null,[[3,11,15,19]])})));return function(){return e.apply(this,arguments)}}();return d?React.createElement("div",{className:"block-editor-block-styles__item",role:"button",tabIndex:a,"aria-label":"Fill",style:{color:o?"var(--wp-admin-theme-color)":"inherit"}},React.createElement("div",{className:"block-editor-block-styles__item-preview",style:{border:o?"2px solid var(--wp-admin-theme-color)":"2px solid #e3e3e3",margin:0,display:"flex","align-items":"center","justify-content":"center"}},React.createElement(Ae,null))):React.createElement("div",{className:"block-editor-block-styles__item presto-preset-".concat(n.slug),onClick:function(){c(n)},role:"button",tabIndex:a,"aria-label":"Fill",style:{color:o?"var(--wp-admin-theme-color)":"inherit"}},React.createElement("div",{className:"block-editor-block-styles__item-preview",style:{border:o?"2px solid var(--wp-admin-theme-color)":"2px solid #e3e3e3",margin:0}},React.createElement("div",{style:{textAlign:"center",width:"100%",color:o?"var(--wp-admin-theme-color)":"inherit",opacity:o?1:.75}},null!=n&&n.icon?React.createElement(Be,{icon:null==n?void 0:n.icon,style:{fontSize:"30px",width:"30px",height:"30px"}}):React.createElement("h1",{style:{opacity:.75}},(null==n||null===(t=n.name)||void 0===t||null===(r=t.charAt(0))||void 0===r?void 0:r.toUpperCase())||"Untitled"))),React.createElement("div",{className:"block-editor-block-styles__item-label",style:{fontWeight:"bold",textTransform:"capitalize"}},(null==n?void 0:n.name)||"Untitled"),!(null!=n&&n.is_locked)&&React.createElement("div",{className:"block-editor-block-styles__item-edit"},React.createElement("div",{className:"block-editor-block-styles__item-edit-icon",onClick:s},React.createElement(Be,{icon:"edit"})),React.createElement("div",{className:"block-editor-block-styles__item-edit-icon",onClick:function(){return f(!0)}},React.createElement(Be,{icon:"trash"}))),v&&React.createElement(Le,{title:Te("Trash Preset?","presto-player"),onRequestClose:h,style:{maxWidth:"250px"}},React.createElement("p",null,React.createElement("strong",null,Te("Warning!","presto-player")," "),Te("Any videos assigned to this preset will automatically use the default preset.","presto-player")),React.createElement(Fe,null,React.createElement(Ie,{isDestructive:!0,onClick:g,style:{margin:"0 4px"}},Te("Trash","presto-player")),React.createElement(Ie,{isTertiary:!0,onClick:h,style:{margin:"0 4px",boxShadow:"none"}},Te("Cancel","presto-player")))))},Me=wp.i18n.__,ze=wp.components,We=ze.withNotices,He=ze.BaseControl,Ye=ze.Spinner,Ge=ze.Button,qe=wp.element,Ze=qe.useState,Ke=(qe.useEffect,wp.data),Qe=Ke.useSelect,Xe=Ke.dispatch;var $e=We((function(e){var t,r=e.attributes,n=e.setAttributes,a=Ze(!1),o=Object(i.a)(a,2),c=o[0],s=o[1],p=function(){return s(!1)},u=Ze(null),d=Object(i.a)(u,2),b=d[0],m=d[1],y=Ze(null),v=Object(i.a)(y,2),f=v[0],h=v[1],O=Qe((function(e){return{presets:e("presto-player/player").getPresets(),loading:e("presto-player/player").isResolving("getPresets")}})),g=O.presets,j=O.loading,w=function(e){Xe("presto-player/player").addPreset(e)},_=function(e){Xe("presto-player/player").removePreset(e)},E=function(e){n({preset:e.id})};return j?React.createElement("div",{className:"presto-settings__loading"},React.createElement(Ye,null)):React.createElement(React.Fragment,null,g.length?React.createElement("p",null,Me("Select a video configuration preset, or add your own.","presto-player")):"",React.createElement(He,null,React.createElement("div",{className:"block-editor-block-styles"},(g||[]).length?g.map((function(e,t){return React.createElement(Ue,{setPreset:E,index:t,isActive:(null==r?void 0:r.preset)===e.id,preset:e,key:e.id,onEdit:function(){h(e.name),m(e),s("edit")},remove:_})})):Me("No style presets. You can create a new style by clicking 'Add New Style'.","presto-plugin"))),React.createElement(He,null,React.createElement(Ge,{isPrimary:!0,"data-cy":"add-new-preset",onClick:function(){var e;null!==(e=prestoPlayer)&&void 0!==e&&e.isPremium?s("new"):Xe("presto-player/player").setProModal(!0)}},Me("Add New Preset","presto-player")),!(null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium)&&React.createElement(l.a,null)),"new"==c&&React.createElement(Ne,{closeModal:p,addPreset:w,type:"new",onSave:E}),"edit"==c&&React.createElement(Ne,{closeModal:p,addPreset:w,updatePreset:function(e){Xe("presto-player/player").updatePreset(e)},type:"edit",preset:b,name:f}))})),Je=r(18);function et(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?et(Object(r),!0).forEach((function(t){Object(g.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):et(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var rt=wp.i18n.__,nt=wp.components,at=(nt.PanelRow,nt.TextControl,nt.SelectControl,nt.BaseControl),ot=nt.Button,lt=nt.FocalPointPicker,ct=nt.RangeControl,it=wp.blockEditor,st=it.MediaUpload,pt=it.MediaUploadCheck,ut=(wp.element.useState,["image"]),dt=function(e){var t=e.attributes,r=e.setAttributes,n=e.instanceId,a=t.mutedOverlay,o="video-block__overlay-image-description-".concat(n);return React.createElement(React.Fragment,null,React.createElement(pt,null,React.createElement(at,{className:"editor-video-overlay-control"},React.createElement(at.VisualLabel,null,React.createElement("p",null,rt("Overlay Image","presto-player"))),React.createElement(st,{title:rt("Select overlay image","presto-player"),onSelect:function(e){r({mutedOverlay:tt(tt({},a),{src:e.url})})},allowedTypes:ut,render:function(e){var t=e.open;return React.createElement(ot,{className:"presto-setting__poster",isPrimary:!0,onClick:t},null!=a&&a.src?rt("Replace","presto-player"):rt("Select","presto-player"))}}),React.createElement("p",{id:o,hidden:!0},null!=a&&a.src?sprintf(rt("The current overlay image url is %s","presto-player"),null==a?void 0:a.src):rt("There is no overlay image currently selected","presto-player")),!(null==a||!a.src)&&React.createElement(ot,{onClick:function(){r({mutedOverlay:tt(tt({},a),{src:""})})},className:"presto-setting__remove-poster",isTertiary:!0},rt("Remove","presto-player")))),!(null==a||!a.src)&&React.createElement(lt,{url:"",dimensions:{width:160,height:90},value:null==a?void 0:a.focalPoint,onChange:function(e){return r({mutedOverlay:tt(tt({},a),{focalPoint:e})})}}),!(null==a||!a.src)&&React.createElement(ct,{label:rt("Max Width (%)","presto-player"),value:null==a?void 0:a.width,onChange:function(e){return r({mutedOverlay:tt(tt({},a),{width:e})})},min:1,max:100}))};function bt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bt(Object(r),!0).forEach((function(t){Object(g.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var yt=wp.i18n.__,vt=wp.components,ft=vt.ToggleControl,ht=vt.SelectControl,Ot=vt.BaseControl,gt=vt.Button,jt=vt.PanelRow,wt=vt.Icon,_t=vt.Flex,Et=wp.data.dispatch,Rt=wp.blockEditor,kt=Rt.MediaUpload,Pt=Rt.MediaUploadCheck,Ct=["image"],xt=wp.compose.useInstanceId,St=function e(t){var r=t.setAttributes,n=t.attributes,a=n.mutedPreview,o=n.autoplay,c=n.playsInline,i=n.preload,s=n.poster,p=n.mutedOverlay,u=xt(e),d="video-block__poster-image-description-".concat(u),b=function(e){return function(t){r(Object(g.a)({},e,t))}};var m,y;return React.createElement(React.Fragment,null,!o&&React.createElement(React.Fragment,null,React.createElement(ft,{label:React.createElement(React.Fragment,null,yt("Muted Autoplay Preview","presto-player")," ",!(null!==(m=prestoPlayer)&&void 0!==m&&m.isPremium)&&React.createElement(l.a,null)),onChange:function(e){var t;null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium?r({mutedPreview:mt(mt({},a),{enabled:e})}):Et("presto-player/player").setProModal(!0)},checked:null==a?void 0:a.enabled,className:"presto-setting__mutedPreview",help:yt("Shows a muted preview of the video.","presto-player")}),!(null==a||!a.enabled)&&!(null!=n&&n.video_id)&&React.createElement(jt,null,React.createElement(ft,{label:yt("Muted Preview Captions","presto-player"),onChange:function(e){r({mutedPreview:mt(mt({},a),{captions:e})})},checked:null==a?void 0:a.captions,className:"presto-setting__mutedPreviewCaptions",help:yt("Play captions during muted autoplay","presto-player")})),!!a.enabled&&React.createElement(jt,null,React.createElement(ft,{label:React.createElement(React.Fragment,null,yt("Muted Preview Overlay","presto-player")," ",!(null!==(y=prestoPlayer)&&void 0!==y&&y.isPremium)&&React.createElement(l.a,null)),onChange:function(e){var t;null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium?r({mutedOverlay:mt(mt({},p),{enabled:e})}):Et("presto-player/player").setProModal(!0)},checked:null==p?void 0:p.enabled,className:"presto-setting__mutedOverlay",help:yt("Show an image over the top of the video either before or after the video.","presto-player")})),(null==p?void 0:p.enabled)&&(null==a?void 0:a.enabled)&&React.createElement(dt,{attributes:n,setAttributes:r})),!(null!=a&&a.enabled)&&React.createElement(ft,{label:yt("Autoplay","presto-player"),className:"presto-setting__autoplay",onChange:b("autoplay"),checked:o,help:function(e){return e?yt("Note: Autoplaying videos may cause usability issues for some visitors.","presto-player"):null}}),React.createElement(jt,null,React.createElement(ft,{label:yt("Play inline","presto-player"),className:"presto-setting__playsInline","data-cy":"playsInline",onChange:b("playsInline"),checked:c,help:yt("On mobile browsers, play the video on the page instead of opening it up fullscreen.","presto-player")})),!(null!=n&&n.video_id)&&React.createElement(jt,null,React.createElement(ht,{label:React.createElement(_t,null,React.createElement("div",null,yt("Performance Preference","presto-player")),React.createElement("a",{href:"https://prestoplayer.com/docs/performance-preferences-explained",target:"_blank",style:{textDecoration:"none"}},React.createElement(wt,{icon:"editor-help"}))),className:"presto-setting__preload",value:i,onChange:function(e){return r({preload:e})},help:(!!(null!=n&&n.src&&Object(Je.d)(null==n?void 0:n.src)&&["metadata","none"].includes(i))||"none"===i&&!s)&&yt("A poster image is recommended for this setting.","presto-player"),options:[{value:"auto",label:yt("Video Playback Speed","presto-player")},{value:"metadata",label:yt("Page Load Speed","presto-player")},{value:"none",label:yt("Page Load Speed (Extreme)","presto-player")}]})),React.createElement(Pt,null,React.createElement(Ot,{className:"editor-video-poster-control"},React.createElement(Ot.VisualLabel,null,React.createElement("p",null,yt("Poster image","presto-player"))),React.createElement(kt,{title:yt("Select poster image","presto-player"),onSelect:function(e){r({poster:e.url})},allowedTypes:Ct,render:function(e){var t=e.open;return React.createElement(gt,{className:"presto-setting__poster",isPrimary:!0,onClick:t,"aria-describedby":d},yt(s?"Replace":"Select","presto-player"))}}),React.createElement("p",{id:d,hidden:!0},s?sprintf(yt("The current poster image url is %s","presto-player"),s):yt("There is no poster image currently selected","presto-player")),!!s&&React.createElement(gt,{onClick:function(){r({poster:""})},className:"presto-setting__remove-poster",isTertiary:!0},yt("Remove","presto-player")))))},Nt=wp.components.PanelBody,Tt=wp.i18n.__;t.a=function(e){var t,r,n,c,i=e.attributes,s=e.setAttributes;return React.createElement(React.Fragment,null,React.createElement(Nt,{title:React.createElement(React.Fragment,null,Tt("Chapters","presto-player")," ",!(null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium)&&React.createElement(l.a,null)),initialOpen:null===(r=prestoPlayer)||void 0===r?void 0:r.isPremium},React.createElement(o.a,{setAttributes:s,attributes:i})),React.createElement(Nt,{title:React.createElement(React.Fragment,null,Tt("Overlays","presto-player")," ",!(null!==(n=prestoPlayer)&&void 0!==n&&n.isPremium)&&React.createElement(l.a,null)),initialOpen:null===(c=prestoPlayer)||void 0===c?void 0:c.isPremium},React.createElement(h,{setAttributes:s,attributes:i})),React.createElement(Nt,{title:Tt("Video settings","presto-player")},React.createElement(St,{setAttributes:s,attributes:i})),React.createElement(Nt,{title:Tt("Video Preset","presto-player")},React.createElement($e,{setAttributes:s,attributes:i})),React.createElement(Nt,{title:Tt("Global Player Branding","presto-player"),initialOpen:!1},React.createElement(a.a,{setAttributes:s,attributes:i})))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return j})),r.d(t,"b",(function(){return w})),r.d(t,"c",(function(){return _}));var n=r(46),a=r(47),o=r(53),l=r(54),c=r(44),i=r(26),s=r.n(i),p=function(e){return e.replace(/([A-Z])/g,(function(e){return"-".concat(e[0].toLowerCase())}))},u=r(48),d=function(e,t,r){var n=t.className||t.class,a=r.className||r.class,o=y(e),l=y(n?n.split(" "):[]),c=y(a?a.split(" "):[]),i=[];return o.forEach((function(e){l.has(e)?(i.push(e),l.delete(e)):c.has(e)||i.push(e)})),l.forEach((function(e){return i.push(e)})),i.join(" ")},b=function(e){if("undefined"==typeof document)return!0;var t="on"+e,r=t in document;if(!r){var n=document.createElement("div");n.setAttribute(t,"return;"),r="function"==typeof n[t]}return r},m=function(e,t,r){var n=e.__events||(e.__events={}),a=n[t];a&&e.removeEventListener(t,a),e.addEventListener(t,n[t]=function(e){r&&r.call(this,e)})},y=function(e){var t=new Map;return e.forEach((function(e){return t.set(e,e)})),t},v=function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)},f=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){t.forEach((function(t){v(t,e)}))}};function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Object(c.a)(e);if(t){var a=Object(c.a)(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return Object(l.a)(this,r)}}var O=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},g=function(e,t,r,l){void 0!==l&&l();var c=e.toLowerCase().split("-").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join(""),i=function(t){Object(o.a)(i,t);var l=h(i);function i(e){var t;return Object(n.a)(this,i),(t=l.call(this,e)).setComponentElRef=function(e){t.componentEl=e},t}return Object(a.a)(i,[{key:"componentDidMount",value:function(){this.componentDidUpdate(this.props)}},{key:"componentDidUpdate",value:function(e){!function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e instanceof Element){var n=d(e.classList,t,r);""!==n&&(e.className=n),Object.keys(t).forEach((function(r){if("children"!==r&&"style"!==r&&"ref"!==r&&"class"!==r&&"className"!==r&&"forwardedRef"!==r)if(0===r.indexOf("on")&&r[2]===r[2].toUpperCase()){var n=r.substring(2),a=n[0].toLowerCase()+n.substring(1);b(a)||m(e,a,t[r])}else{e[r]=t[r],"string"===Object(u.a)(t[r])&&e.setAttribute(p(r),t[r])}}))}}(this.componentEl,this.props,e)}},{key:"render",value:function(){var t=this.props,n=t.children,a=t.forwardedRef,o=t.style,l=(t.className,t.ref,O(t,["children","forwardedRef","style","className","ref"])),c=Object.keys(l).reduce((function(e,t){if(0===t.indexOf("on")&&t[2]===t[2].toUpperCase()){var r=t.substring(2).toLowerCase();"undefined"!=typeof document&&b(r)&&(e[t]=l[t])}else e[t]=l[t];return e}),{});r&&(c=r(this.props,c));var i=Object.assign(Object.assign({},c),{ref:f(a,this.setComponentElRef),style:o});return s.a.createElement(e,i,n)}}],[{key:"displayName",get:function(){return c}}]),i}(s.a.Component);return t&&(i.contextType=t),function(e,t){var r=function(t,r){return s.a.createElement(e,Object.assign({},t,{forwardedRef:r}))};return r.displayName=t,s.a.forwardRef(r)}(i,c)},j=g("presto-cta-overlay-ui"),w=g("presto-email-overlay-ui"),_=g("presto-player")},function(e,t){e.exports=window.wp.blockEditor},function(e,t,r){"use strict";var n,a,o,l,c,i,s=r(6),p=r(5),u=r(1),d=r(0);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){Object(p.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var y=wp.i18n.__,v=wp.components,f=v.Button,h=v.Popover,O=v.Icon,g=wp.blockEditor.__experimentalLinkControl,j=wp.element.useState,w=wp.url.prependHTTP;t.a=function(e){var t=e.setSettings,r=e.settings,p=j(!1),b=Object(u.a)(p,2),v=b[0],_=b[1],E=r.url,R=j(),k=Object(u.a)(R,2),P=k[0],C=k[1],x=m({url:null==r?void 0:r.url,type:null==r?void 0:r.type,id:null==r?void 0:r.id,opensInNewTab:null==r?void 0:r.opensInNewTab},P),S=function(e){e=m(m({},P),e);var r=x.opensInNewTab!==e.opensInNewTab&&x.url===e.url&&void 0===e.url;if(C(r?e:void 0),!r){var n=w(e.url);t({url:n,type:e.type,id:void 0!==e.id&&null!==e.id?String(e.id):void 0,opensInNewTab:e.opensInNewTab})}};return Object(d.b)("span",null,E?Object(d.b)("div",{css:Object(d.a)(n||(n=Object(s.a)(["\n display: flex;\n justify-content: space-between;\n "])))},Object(d.b)("div",{css:Object(d.a)(a||(a=Object(s.a)(["\n max-width: 85%;\n overflow: hidden;\n display: flex;\n align-items: center;\n "])))},Object(d.b)("a",{href:"#",css:Object(d.a)(o||(o=Object(s.a)(["\n padding: 10px;\n background: #f3f3f3;\n border-radius: 4px;\n width: 100%;\n display: inline-flex;\n align-items: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n text-decoration: none;\n "]))),onClick:function(){return _(!v)}},Object(d.b)(O,{icon:"edit",css:Object(d.a)(l||(l=Object(s.a)(["\n cursor: pointer;\n opacity: 0.75;\n margin: 0 2px;\n font-size: 16px;\n width: 16px;\n height: 16px;\n text-decoration: none;\n "])))}),E),v&&Object(d.b)(h,{position:"bottom center",onClose:function(){return _(!1)}},Object(d.b)(g,{value:r,onChange:S}))),Object(d.b)("div",{css:Object(d.a)(c||(c=Object(s.a)(["\n display: flex;\n align-items: center;\n "])))},Object(d.b)(O,{onClick:function(){confirm(y("Are you sure you wish to remove this link?","presto-player"))&&t({})},icon:"trash",className:"presto-icon",css:Object(d.a)(i||(i=Object(s.a)(["\n cursor: pointer;\n opacity: 0.75;\n margin: 0 2px;\n fontsize: 18px;\n width: 18px;\n height: 18px;\n\n &:hover {\n color: #cc1818;\n }\n "])))}))):Object(d.b)("span",null,Object(d.b)(f,{isPrimary:!0,isSmall:!0,onClick:function(){return _(!v)}},y("Add Link","presto-player")),v&&Object(d.b)(h,{position:"bottom center",onClose:function(){return _(!1)}},Object(d.b)(g,{value:r,onChange:S}))))}},,,,function(e,t,r){"use strict";var n=r(7),a=r(1),o=r(2),l=r.n(o),c=r(10),i=wp.i18n.__,s=wp.components,p=s.ColorPicker,u=s.Button,d=s.withNotices,b=s.BaseControl,m=s.RangeControl,y=wp.blockEditor,v=y.MediaUpload,f=y.MediaUploadCheck,h=wp.compose.useInstanceId,O=wp.element.useState,g=wp.data,j=g.dispatch,w=g.useSelect,_=["image"];t.a=d((function e(t){t.setAttributes,t.attributes;var r,o=t.type,s=h(e),d=O(1),y=Object(a.a)(d,2),g=y[0],E=y[1],R=w((function(e){return e("presto-player/player").branding()})),k=function(){var e=Object(n.a)(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j("presto-player/player").saveOptions({branding:R});case 2:wp.data.dispatch("core/notices").createNotice("success","Player branding saved.",{type:"snackbar",isDismissible:!0});case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return React.createElement("div",{className:"presto-player__panel--branding"},"audio"!==o&&React.createElement("p",null,i("Here you can select the global player branding This will apply to all players on the site.","presto-player")),React.createElement(f,null,React.createElement(b,{className:"editor-video-poster-control"},"audio"!==o&&React.createElement(React.Fragment,null,React.createElement(b.VisualLabel,null,React.createElement("p",null,i("Logo Overlay","presto-player")," ",!(null!==(r=prestoPlayer)&&void 0!==r&&r.isPremium)&&React.createElement(c.a,null))),React.createElement(v,{title:i("Select logo overlay image","presto-player"),onSelect:function(e){j("presto-player/player").updateBranding("logo",e.url)},allowedTypes:_,render:function(e){var t=e.open;return React.createElement(u,{className:"presto-setting__logo",isSecondary:!0,onClick:function(){var e;null!==(e=prestoPlayer)&&void 0!==e&&e.isPremium?t():j("presto-player/player").setProModal(!0)},"aria-describedby":"video-block__logo-image-description-".concat(s)},null!=R&&R.logo?i("Replace","presto-player"):i("Select","presto-player"))}})),React.createElement("p",{id:"video-block__logo-image-description-".concat(s),hidden:!0},null!=R&&R.logo?sprintf(i("The current logo image url is %s","presto-player"),null==R?void 0:R.logo):i("There is no logo image currently selected","presto-player")),!(null==R||!R.logo)&&React.createElement(u,{onClick:function(){j("presto-player/player").updateBranding("logo","")},isTertiary:!0},i("Remove","presto-player")))),!(null==R||!R.logo)&&React.createElement(m,{label:i("Logo Max Width","presto-player"),value:(null==R?void 0:R.logo_width)||150,onChange:function(e){return j("presto-player/player").updateBranding("logo_width",e)},min:1,max:400}),React.createElement(p,{color:null==R?void 0:R.color,onChangeComplete:function(e){j("presto-player/player").updateBranding("color",e.hex)},key:g,disableAlpha:!0}),(null==R?void 0:R.color)&&React.createElement(b,null,React.createElement(u,{isSecondary:!0,onClick:function(){var e,t;j("presto-player/player").updateBranding("color",(null===(e=prestoPlayer)||void 0===e||null===(t=e.defaults)||void 0===t?void 0:t.color)||"#00b3ff"),E(g+1)}},i("Reset Color","presto-player"))),React.createElement(u,{isPrimary:!0,onClick:k},i("Save Branding","presto-player")))}))},function(e,t){e.exports=window.wp.compose},function(e,t,r){"use strict";var n=r(5),a=r(1),o=r(19),l=r.n(o),c=wp.i18n.__,i=wp.element,s=i.useState,p=i.useEffect,u=lodash,d=u.partial,b=u.noop,m=u.find,y=wp.components,v=y.NavigableMenu,f=y.Animate;t.a=function(e){var t,r=e.className,o=e.children,i=e.items,u=e.title,y=e.orientation,h=void 0===y?"horizontal":y,O=e.activeClass,g=void 0===O?"is-active":O,j=e.onSelect,w=void 0===j?b:j,_=s(null),E=Object(a.a)(_,2),R=E[0],k=E[1],P=s("left"),C=Object(a.a)(P,2),x=(C[0],C[1]),S=function(e){k(e),w&&w(e)},N=function(e,t){t.click()},T=m(i,{name:R}),D="".concat(null!==(t=null==T?void 0:T.name)&&void 0!==t?t:"none");return p((function(){x(R?"right":"left")}),[R]),React.createElement("div",{className:r},React.createElement(f,{type:"slide-in",origin:T?"right":"left"},(function(e){var t=e.className;return T?React.createElement("div",{key:D,"aria-labelledby":D,role:"itempanel",id:"".concat(D,"-view"),className:l()(t,"presto-player__menu-content")},React.createElement("div",{className:"presto-player__menu-items"},React.createElement("div",{className:"presto-player__menu-item is-back-button",onClick:function(){return S("")}},React.createElement("svg",{class:"back-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",role:"img","aria-hidden":"true",focusable:"false"},React.createElement("path",{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),c("Back","presto-player"))),o(T)):React.createElement("div",{className:l()(t,"is-from-right")},!!u&&React.createElement("h2",null,u),React.createElement(v,{role:"itemlist",orientation:h,onNavigate:N,className:l()("presto-player__menu-items")},i.map((function(e){return React.createElement("div",{className:l()("presto-player__menu-item",e.className,Object(n.a)({},g,e.name===R)),itemId:"".concat(e.name),"aria-controls":"".concat(e.name,"-view"),selected:e.name===R,key:e.name,onClick:d(S,e.name)},!!e.icon&&React.createElement("div",{class:"presto-player__menu-icon"},e.icon),e.title,React.createElement("svg",{className:"submenu-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",role:"img",ariaHidden:"true",focusable:"false"},React.createElement("path",{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})))}))))})))}},function(e,t,r){"use strict";var n,a,o=r(6),l=r(5),c=r(3),i=r(4),s=r(13),p=r(16),u=r(25),d=r(12),b=r(0);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){Object(l.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function v(e){var t=e.state,r=e.updateState,m=e.className,v=t.cta,f=t.email_collection,h=Object(p.useSelect)((function(e){return e("presto-player/player").branding()})),O={percentage:100,show_rewatch:!0,show_skip:!0,headline:Object(c.__)("Want to learn more?","presto-player"),show_button:!0,button_text:Object(c.__)("Click Here","presto-player"),button_link:{opensInNewTab:!0}};Object(s.useEffect)((function(){Object.keys(O).forEach((function(e){var r;void 0===(null==t||null===(r=t.cta)||void 0===r?void 0:r[e])&&g(Object(l.a)({},e,O[e]))}))}),[t]);var g=function(e){r(y(y({},t),{},{cta:y(y({},v),e)}))};return Object(b.b)("div",{className:m},Object(b.b)(i.BaseControl,null,Object(b.b)("h3",null,Object(c.__)("Call To Action","presto-player"))),Object(b.b)(i.BaseControl,{className:"presto-player__control--large-play"},Object(b.b)(i.ToggleControl,{label:Object(c.__)("Enable","presto-player"),help:Object(c.__)("Show an email collection form and message over your player.","presto-player"),onChange:function(e){g({enabled:e})},checked:null==v?void 0:v.enabled})),!(null==v||!v.enabled)&&Object(b.b)(React.Fragment,null,Object(b.b)(i.BaseControl,{className:"presto-player__control--percentage-watched"},Object(b.b)(i.RangeControl,{label:Object(c.__)("Display At (Percentage)","presto-player"),labelPosition:"top",onChange:function(e){g({percentage:e})},marks:[{value:0,label:Object(c.__)("Start","presto-player")},{value:50,label:Object(c.__)("50% Watched","presto-player")},{value:100,label:Object(c.__)("End","presto-player")}],shiftStep:5,value:null==v?void 0:v.percentage})),(null==f?void 0:f.enabled)&&(null==f?void 0:f.percentage)===(null==v?void 0:v.percentage)&&Object(b.b)(i.Notice,{css:Object(b.a)(n||(n=Object(o.a)(["\n margin: 0 0 30px 0 !important;\n "]))),status:"warning",isDismissible:!1},Object(c.__)("You already have an email capture set display at the same time.","presto-player"),Object(b.b)(i.Button,{onClick:function(){r(y(y({},t),{},{email_collection:y(y({},f),{enabled:!1})}))},isLink:!0,css:Object(b.a)(a||(a=Object(o.a)(["\n margin-top: 10px !important;\n "])))},Object(c.__)("Disable Email Capture","presto-player"))),100===(null==v?void 0:v.percentage)?Object(b.b)(i.BaseControl,{className:"presto-player__control--show-rewatch"},Object(b.b)(i.ToggleControl,{label:Object(c.__)("Show Rewatch Button","presto-player"),help:Object(c.__)("Show a rewatch button at the end of the player.","presto-player"),onChange:function(e){g({show_rewatch:e})},checked:null==v?void 0:v.show_rewatch})):Object(b.b)(i.BaseControl,{className:"presto-player__control--show-skip"},Object(b.b)(i.ToggleControl,{label:Object(c.__)("Allow Skipping","presto-player"),help:Object(c.__)("Let the user continue watching the player.","presto-player"),onChange:function(e){g({show_skip:e})},checked:null==v?void 0:v.show_skip})),Object(b.b)(i.BaseControl,{className:"presto-player__control--button-link"},Object(b.b)(i.BaseControl.VisualLabel,null,Object(b.b)("p",null," ",Object(c.__)("Link","presto-player"))),Object(b.b)(u.a,{setSettings:function(e){g({button_link:e})},settings:(null==v?void 0:v.button_link)||{}})),Object(b.b)(i.BaseControl,{className:"presto-player__control--headline"},Object(b.b)(i.TextareaControl,{label:Object(c.__)("Headline","presto-player"),help:Object(c.__)("The headline for your form.","presto-player"),value:null==v?void 0:v.headline,onChange:function(e){g({headline:e})}})),Object(b.b)(i.BaseControl,{className:"presto-player__control--bottom-text"},Object(b.b)(i.TextareaControl,{label:Object(c.__)("Bottom Text","presto-player"),help:Object(c.__)("Text displayed below the form. HTML allowed.","presto-player"),value:null==v?void 0:v.bottom_text,onChange:function(e){g({bottom_text:e})}})),Object(b.b)(i.BaseControl,{className:"presto-player__control--show-button"},Object(b.b)(i.ToggleControl,{label:Object(c.__)("Show Button","presto-player"),help:Object(c.__)("Show a call to action button.","presto-player"),onChange:function(e){g({show_button:e})},checked:null==v?void 0:v.show_button})),!(null==v||!v.show_button)&&Object(b.b)("div",null,Object(b.b)(i.BaseControl,{className:"presto-player__control--button-text"},Object(b.b)(i.TextControl,{label:Object(c.__)("Button Text","presto-player"),help:Object(b.b)("p",null,Object(c.__)("Button text for the Call To Action","presto-player")),value:null==v?void 0:v.button_text,onChange:function(e){return g({button_text:e})}})),Object(b.b)("h3",null,Object(c.__)("Style","presto-player")),Object(b.b)(i.BaseControl,null,Object(b.b)(i.RangeControl,{label:Object(c.__)("Round Corners","presto-player"),help:Object(c.__)("Border radius of form elements.","presto-player"),value:(null==v?void 0:v.button_radius)||0,onChange:function(e){return g({button_radius:e})},min:0,max:25})),Object(b.b)(i.BaseControl,{className:"presto-player__control--button-color"},Object(b.b)(i.Flex,null,Object(b.b)(i.BaseControl.VisualLabel,null,Object(c.__)("Button Color","presto-player")),Object(b.b)(d.a,{color:(null==v?void 0:v.button_color)||(null==h?void 0:h.color),setColor:function(e){return g({button_color:e&&e.hex})}}))),Object(b.b)(i.BaseControl,{className:"presto-player__control--button-text-color"},Object(b.b)(i.Flex,null,Object(b.b)(i.BaseControl.VisualLabel,null,Object(c.__)("Button Text Color","presto-player")),Object(b.b)(d.a,{color:(null==v?void 0:v.button_text_color)||"#ffffff",setColor:function(e){return g({button_text_color:e&&e.hex})}})))),Object(b.b)(i.BaseControl,null,Object(b.b)(i.RangeControl,{label:Object(c.__)("Background Opacity","presto-player"),help:Object(c.__)("Opacity percentage of the cover background.","presto-player"),value:(null==v?void 0:v.background_opacity)||75,onChange:function(e){return g({background_opacity:e})},min:0,max:100}))))}v.defaultProps={catName:"Sandy",eyeColor:"deepblue",age:"120"},t.a=v},function(e,t,r){"use strict";var n=wp.apiFetch;n.use(n.createNonceMiddleware(prestoPlayer.nonce)),n.use(n.createRootURLMiddleware(prestoPlayer.root+prestoPlayer.prestoVersionString)),t.a=n},function(e,t,r){"use strict";r.d(t,"a",(function(){return N}));var n=r(8),a=r(49),o=r(1),l=r(5);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){Object(l.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var s=wp.i18n,p=s.__,u=s.sprintf,d=wp.components,b=d.NavigableMenu,m=d.MenuItem,y=d.FormFileUpload,v=d.MenuGroup,f=d.ToolbarGroup,h=d.ToolbarButton,O=d.Dropdown,g=(d.SVG,d.Rect,d.Path,d.Button),j=d.TextControl,w=(d.SelectControl,wp.blockEditor),_=w.MediaUpload,E=w.MediaUploadCheck,R=wp.data.useSelect,k=wp.element.useState,P=["text/vtt"],C=React.createElement("svg",{viewBox:"0 0 29 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.5014 20.2854H28.6316V0.764648H0.110825V20.2854H11.241L14.3712 24.2854L17.5014 20.2854ZM14.3712 21.0401L16.5269 18.2854H26.6316V2.76465H2.11082V18.2854H12.2155L14.3712 21.0401Z"}),React.createElement("path",{d:"M10.4503 14.9446C9.56226 14.9446 8.76226 14.7606 8.05026 14.3926C7.33826 14.0166 6.77826 13.4966 6.37026 12.8326C5.97026 12.1606 5.77026 11.4006 5.77026 10.5526C5.77026 9.70464 5.97026 8.94864 6.37026 8.28464C6.77826 7.61264 7.33826 7.09264 8.05026 6.72464C8.76226 6.34864 9.56226 6.16064 10.4503 6.16064C11.2663 6.16064 11.9943 6.30464 12.6343 6.59264C13.2743 6.88064 13.8023 7.29664 14.2183 7.84064L12.4303 9.43664C11.9103 8.78064 11.2983 8.45264 10.5943 8.45264C10.0023 8.45264 9.52626 8.64464 9.16626 9.02864C8.80626 9.40464 8.62626 9.91264 8.62626 10.5526C8.62626 11.1926 8.80626 11.7046 9.16626 12.0886C9.52626 12.4646 10.0023 12.6526 10.5943 12.6526C11.2983 12.6526 11.9103 12.3246 12.4303 11.6686L14.2183 13.2646C13.8023 13.8086 13.2743 14.2246 12.6343 14.5126C11.9943 14.8006 11.2663 14.9446 10.4503 14.9446Z"}),React.createElement("path",{d:"M19.2042 14.9446C18.3162 14.9446 17.5162 14.7606 16.8042 14.3926C16.0922 14.0166 15.5322 13.4966 15.1242 12.8326C14.7242 12.1606 14.5242 11.4006 14.5242 10.5526C14.5242 9.70464 14.7242 8.94864 15.1242 8.28464C15.5322 7.61264 16.0922 7.09264 16.8042 6.72464C17.5162 6.34864 18.3162 6.16064 19.2042 6.16064C20.0202 6.16064 20.7482 6.30464 21.3882 6.59264C22.0282 6.88064 22.5562 7.29664 22.9722 7.84064L21.1842 9.43664C20.6642 8.78064 20.0522 8.45264 19.3482 8.45264C18.7562 8.45264 18.2802 8.64464 17.9202 9.02864C17.5602 9.40464 17.3802 9.91264 17.3802 10.5526C17.3802 11.1926 17.5602 11.7046 17.9202 12.0886C18.2802 12.4646 18.7562 12.6526 19.3482 12.6526C20.0522 12.6526 20.6642 12.3246 21.1842 11.6686L22.9722 13.2646C22.5562 13.8086 22.0282 14.2246 21.3882 14.5126C20.7482 14.8006 20.0202 14.9446 19.2042 14.9446Z"}));function x(e){var t,r=e.tracks,n=e.onEditPress;return t=0===r.length?React.createElement("p",{className:"block-library-video-tracks-editor__tracks-informative-message"},p("Captions are .vtt files that help make your content more accesible to a wider range of users.","presto-player")):r.map((function(e,t){return React.createElement("div",{key:t,className:"block-library-video-tracks-editor__track-list-track"},React.createElement("span",null,e.label," "),React.createElement(g,{isTertiary:!0,onClick:function(){return n(t)},"aria-label":u(p("Edit %s","presto-player"),e.label)},p("Edit","presto-player")))})),React.createElement(v,{label:p("Captions","presto-player"),className:"block-library-video-tracks-editor__track-list"},t)}function S(e){var t=e.track,r=e.onChange,n=e.onClose,a=e.onRemove,o=t.src,l=void 0===o?"":o,c=t.label,s=void 0===c?"":c,u=t.srcLang,d=void 0===u?"":u,m=(t.kind,l.startsWith("blob:")?"":l.substring(l.lastIndexOf("/")+1));return React.createElement(b,null,React.createElement("div",{className:"block-library-video-tracks-editor__single-track-editor"},React.createElement("span",{className:"block-library-video-tracks-editor__single-track-editor-edit-track-label"},p("Edit caption track","presto-player")),React.createElement("span",null,p("File","presto-player"),": ",React.createElement("b",null,m)),React.createElement("div",{className:"block-library-video-tracks-editor__single-track-editor-label-language"},React.createElement(j,{autoFocus:!0,onChange:function(e){return r(i(i({},t),{},{label:e}))},label:p("Label","presto-player"),value:s,help:p("Title of track","presto-player")}),React.createElement(j,{onChange:function(e){return r(i(i({},t),{},{srcLang:e}))},label:p("Source language","presto-player"),value:d,help:p("Language tag (en, fr, etc.)","presto-player")})),React.createElement("div",{className:"block-library-video-tracks-editor__single-track-editor-buttons-container"},React.createElement(g,{isSecondary:!0,onClick:function(){var e={},a=!1;""===s&&(e.label=p("English","presto-player"),a=!0),""===d&&(e.srcLang="en",a=!0),a&&r(i(i({},t),e)),n()}},p("Close","presto-player")),React.createElement(g,{isDestructive:!0,isLink:!0,onClick:a},p("Remove track","presto-player")))))}function N(e){var t=e.tracks,r=void 0===t?[]:t,l=e.onChange,c=R((function(e){return e("core/block-editor").getSettings().mediaUpload}),[]),s=k(null),u=Object(o.a)(s,2),d=u[0],g=u[1];return c?React.createElement(O,{contentClassName:"block-library-video-tracks-editor",renderToggle:function(e){var t=e.isOpen,r=e.onToggle;return React.createElement(f,null,React.createElement(h,{label:p("Captions","presto-player"),showTooltip:!0,"aria-expanded":t,"aria-haspopup":"true",onClick:r,icon:C}))},renderContent:function(e){return Object(a.a)(e),null!==d?React.createElement(S,{track:r[d],onChange:function(e){var t=Object(n.a)(r);t[d]=e,l(t)},onClose:function(){return g(null)},onRemove:function(){l(r.filter((function(e,t){return t!==d}))),g(null)}}):React.createElement(React.Fragment,null,React.createElement(b,null,React.createElement(x,{tracks:r,onEditPress:g}),React.createElement(v,{className:"block-library-video-tracks-editor__add-tracks-container",label:p("Add caption languages","presto-player")},React.createElement(_,{onSelect:function(e){var t=e.url,a=r.length;l([].concat(Object(n.a)(r),[{src:t}])),g(a)},allowedTypes:P,render:function(e){var t=e.open;return React.createElement(m,{icon:"media",onClick:t},p("Open Media Library","presto-player"))}}),React.createElement(E,null,React.createElement(y,{onChange:function(e){var t=e.target.files,a=r.length;c({allowedTypes:P,filesList:t,onFileChange:function(e){var t=Object(o.a)(e,1)[0].url,c=Object(n.a)(r);c[a]||(c[a]={}),c[a]=i(i({},r[a]),{},{src:t}),l(c),g(a)}})},accept:".vtt,text/vtt",render:function(e){var t=e.openFileDialog;return React.createElement(m,{icon:"upload",onClick:function(){t()}},p("Upload","presto-player"))}})))))}}):null}},function(e,t,r){"use strict";var n=r(5),a=r(1),o=r(23),l=r(9),c=r(14);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=wp.i18n.__,u=wp.components.Disabled,d=wp.element,b=d.useState,m=d.useEffect;t.a=function(e){var t,r,n,i=e.state,d=e.branding,y=e.menu,v=e.src,f=e.poster,h=e.currentTime,O=e.preload,g=e.overlays,j=e.isDisabled,w=void 0===j||j,_=b(1),E=Object(a.a)(_,2),R=E[0],k=E[1],P=i.email_collection,C=i.cta;m((function(){k(R+1)}),[i.skin,i["play-large"],i.rewind,i.play,i["fast-forward"],i.progress,i["current-time"],i.mute,i.volume,i.speed,i.pip,i.fullscreen,i.captions,i.hide_logo]);var x={email:!(null==P||!P.enabled)&&React.createElement(o.b,{className:"email-overlay",slot:"player-end",headline:null==P?void 0:P.headline,style:s(s({"--presto-player-email-border-radiuss":"".concat(null==P?void 0:P.button_radius,"px"),"--plyr-color-main":(null==i?void 0:i.background_color)||(null==d?void 0:d.color)},P.button_color?{"--presto-player-button-color":"".concat(P.button_color)}:{}),P.button_text_color?{"--presto-player-button-text":"".concat(P.button_text_color)}:{}),defaultHeadline:p("Enter your email to play.","presto-player"),bottomText:null==P?void 0:P.bottom_text,allowSkip:null==P?void 0:P.allow_skip,skipText:p("Skip","presto-player"),buttonText:null==P?void 0:P.button_text,placeholder:p("Email address","presto-player"),i18n:window.prestoPlayer.i18n}),cta:!(null==C||!C.enabled)&&React.createElement(o.a,{className:"cta-overlay",style:s(s(s({"--presto-player-button-border-radius":"".concat(C.button_radius,"px")},null!=C&&C.background_opacity?{"--presto-player-cta-background-opacity":"".concat((null==C?void 0:C.background_opacity)/100)}:{}),C.button_color?{"--presto-player-button-color":"".concat(C.button_color)}:{}),C.button_text_color?{"--presto-player-button-text":"".concat(C.button_text_color)}:{}),slot:"player-end",headline:null==C?void 0:C.headline,"bottom-text":null==C?void 0:C.bottom_text,"button-link":null==C?void 0:C.button_link,"allow-skip":100!==(null==C?void 0:C.percentage)&&(null==C?void 0:C.show_skip),borderRadius:null==C?void 0:C.border_radius,"allow-rewatch":100===(null==C?void 0:C.percentage)&&(null==C?void 0:C.show_rewatch),"skip-text":p("Skip","presto-player"),"show-button":null==C?void 0:C.show_button,"button-text":null==C?void 0:C.button_text,i18n:null===(t=window)||void 0===t||null===(r=t.prestoPlayer)||void 0===r?void 0:r.i18n})};return React.createElement(u,{isDisabled:w,className:"disable-player"},React.createElement("div",{className:"presto-player__wrapper"},React.createElement(c.a,{src:v||"",className:"\n ".concat("cta"===y&&!(null==C||!C.enabled)&&"cta-active"," \n ").concat("email"===y&&!(null==P||!P.enabled)&&"email-active"),preset:i,branding:d,i18n:null===(n=prestoPlayerAdmin)||void 0===n?void 0:n.i18n,preload:O,attributes:{chapters:[],poster:f},currentTime:h?Object(l.e)(h):"",overlays:g,key:R,adminPreview:(null==x?void 0:x[y])||""})))}},function(e,t,r){"use strict";var n=r(1),a=wp.i18n.__,o=wp.components.TextareaControl,l=wp.element.useState;t.a=function(e){var t=e.text,r=e.update,c=e.onFocus,i=l(!1),s=Object(n.a)(i,2),p=s[0],u=s[1];return React.createElement("div",{style:{display:"block",width:"100%"}},React.createElement(o,{label:"Text",help:React.createElement("span",null,a("This field accepts","presto-player")," ",React.createElement("a",{href:"#",onClick:function(e){u(!p),e.preventDefault()}},a("Dynamic Data","presto-player")),!!p&&React.createElement("div",{style:{marginTop:"20px"}},a("This field will also accept dynamic values that we will replace with dynamic content: {user.user_login}, {user.user_nicename}, {user.user_email}, {user.user_url},{user.user_registered}, {user.display_name}, {site.url}, {site.name}, {ip_address}","presto-player"))),className:"presto-player__overlay--text",placeholder:a("Enter some text.","presto-player"),value:t||"",onChange:function(e){return r({text:e})},autoComplete:"off",onFocus:c}))}},function(e,t,r){"use strict";var n=r(1),a=wp.components,o=a.Button,l=a.Placeholder,c=a.TextControl,i=a.Flex,s=a.FlexItem,p=a.FlexBlock,u=wp.element.useState,d=wp.i18n.__;t.a=function(e){var t=e.attributes,r=(e.setAttributes,e.icon),a=e.onSelectURL,b=e.label,m=e.instructions,y=e.placeholder,v=t.src,f=u({src:v}),h=Object(n.a)(f,2),O=h[0],g=h[1];return React.createElement(l,{icon:r,label:b||d("Presto Embedded Video","presto-player"),instructions:m||d("Enter video URL","presto-player")},React.createElement("form",{onSubmit:function(e){e.preventDefault(),a(O.url)}},React.createElement(i,{style:{width:"100%",maxWidth:"400px"}},React.createElement(p,null,React.createElement(c,{type:"url",className:"presto-link-placeholder-input",placeholder:y||d("Youtube URL","presto-player"),value:O.url,onChange:function(e){return g({url:e})}})),React.createElement(s,null,React.createElement(o,{isPrimary:!0,style:{marginBottom:"8px"},type:"submit"},d("Add Video","presto-player"))))))}},function(e,t,r){"use strict";var n,a,o=r(6),l=r(5),c=r(3),i=r(4),s=r(16),p=r(8),u=r(7),d=r(1),b=r(2),m=r.n(b),y=function(){return React.createElement("div",null,React.createElement("presto-player-skeleton",{style:{width:"30%",marginBottom:"10px"}}),React.createElement("presto-player-skeleton",{style:{height:"2rem",marginBottom:"20px"}}))},v=wp.i18n.__,f=wp.components,h=f.SelectControl,O=f.TextControl,g=f.Notice,j=wp.element,w=j.useEffect,_=j.useState,E=function(e){var t=e.options,r=e.updateEmailState,n=_(!1),a=Object(d.a)(n,2),o=a[0],l=a[1],c=_([{value:null,label:v("Choose an audience","presto-player")}]),i=Object(d.a)(c,2),s=i[0],b=i[1],f=_(""),j=Object(d.a)(f,2),E=j[0],R=j[1],k=function(){var e=Object(u.a)(m.a.mark((function e(){var t,r;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/mailchimp/lists"});case 4:t=e.sent,r=s,(t||[]).forEach((function(e){r=[].concat(Object(p.a)(r),[{value:e.id,label:e.name}])})),b(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&e.t0.message&&R(e.t0.message);case 13:return e.prev=13,l(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(){return e.apply(this,arguments)}}();return w((function(){k()}),[]),o?React.createElement("div",null,React.createElement(y,null),React.createElement(y,null)):E?React.createElement(g,{className:"presto-notice",status:"error",isDismissible:!1},E):React.createElement("div",null,React.createElement(h,{label:v("Choose an audience","presto-player"),value:null==t?void 0:t.provider_list,options:s,onChange:function(e){return r({provider_list:e})}}),React.createElement(O,{label:v("Tag","presto-player"),help:React.createElement("p",null,v("Give this contact an optional tag when they are added to the list.","presto-player")),value:null==t?void 0:t.provider_tag,onChange:function(e){return r({provider_tag:e})}}))},R=wp.i18n.__,k=wp.components,P=k.SelectControl,C=k.Notice,x=wp.element,S=x.useEffect,N=x.useState,T=function(e){var t=e.options,r=e.updateEmailState,n=N(!1),a=Object(d.a)(n,2),o=a[0],l=a[1],c=N([{value:null,label:R("Choose a group","presto-player")}]),i=Object(d.a)(c,2),s=i[0],b=i[1],v=N(""),f=Object(d.a)(v,2),h=f[0],O=f[1],g=function(){var e=Object(u.a)(m.a.mark((function e(){var t,r;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/mailerlite/groups"});case 4:t=e.sent,r=s,(t||[]).forEach((function(e){r=[].concat(Object(p.a)(r),[{value:e.id,label:e.name}])})),b(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&e.t0.message&&O(e.t0.message);case 13:return e.prev=13,l(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(){return e.apply(this,arguments)}}();return S((function(){g()}),[]),o?React.createElement(y,null):h?React.createElement(C,{className:"presto-notice",status:"error",isDismissible:!1},h):React.createElement("div",null,React.createElement(P,{label:R("Choose a group","presto-player"),value:null==t?void 0:t.provider_list,options:s,onChange:function(e){return r({provider_list:e})}}))},D=wp.i18n.__,B=wp.components,A=B.SelectControl,L=B.Notice,I=wp.element,F=I.useEffect,V=I.useState,U=function(e){var t=e.options,r=e.updateEmailState,n=V(!1),a=Object(d.a)(n,2),o=a[0],l=a[1],c=V(!1),i=Object(d.a)(c,2),s=i[0],b=i[1],v=V([{value:null,label:D("Choose a list","presto-player")}]),f=Object(d.a)(v,2),h=f[0],O=f[1],g=V([{value:null,label:D("Choose a tag","presto-player")}]),j=Object(d.a)(g,2),w=j[0],_=j[1],E=V(""),R=Object(d.a)(E,2),k=R[0],P=R[1],C=function(){var e=Object(u.a)(m.a.mark((function e(){var t,r;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/activecampaign/lists"});case 4:t=e.sent,r=h,(t||[]).forEach((function(e){r=[].concat(Object(p.a)(r),[{value:e.id,label:e.name||D("Default list","presto-player")}])})),O(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&e.t0.message&&P(e.t0.message);case 13:return e.prev=13,l(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(){return e.apply(this,arguments)}}(),x=function(){var e=Object(u.a)(m.a.mark((function e(){var t,r;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/activecampaign/tags"});case 4:t=e.sent,r=w,(t||[]).forEach((function(e){r=[].concat(Object(p.a)(r),[{value:e.id,label:e.tag}])})),_(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&e.t0.message&&P(e.t0.message);case 13:return e.prev=13,b(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(){return e.apply(this,arguments)}}();return F((function(){C(),x()}),[]),k?React.createElement(L,{className:"presto-notice",status:"error",isDismissible:!1},k):React.createElement("div",null,o?React.createElement(y,null):h.length>1&&React.createElement(A,{label:D("Choose a list","presto-player"),value:null==t?void 0:t.provider_list,options:h,onChange:function(e){return r({provider_list:e})}}),s?React.createElement(y,null):w.length>1&&React.createElement(A,{label:D("Choose a tag","presto-player"),value:null==t?void 0:t.provider_tag,options:w,onChange:function(e){return r({provider_tag:e})}}))},M=wp.i18n.__,z=wp.components,W=z.SelectControl,H=z.Notice,Y=wp.element,G=Y.useEffect,q=Y.useState,Z=function(e){var t=e.options,r=e.updateEmailState,n=q(!1),a=Object(d.a)(n,2),o=a[0],l=a[1],c=q(!1),i=Object(d.a)(c,2),s=i[0],b=i[1],v=q([{value:null,label:M("Choose a list","presto-player")}]),f=Object(d.a)(v,2),h=f[0],O=f[1],g=q([{value:null,label:M("Choose a tag","presto-player")}]),j=Object(d.a)(g,2),w=j[0],_=j[1],E=q(""),R=Object(d.a)(E,2),k=R[0],P=R[1],C=function(){var e=Object(u.a)(m.a.mark((function e(){var t,r;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/fluentcrm/lists"});case 4:t=e.sent,r=h,(t||[]).forEach((function(e){r=[].concat(Object(p.a)(r),[{value:e.id,label:e.title||e.slug}])})),O(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&e.t0.message&&P(e.t0.message);case 13:return e.prev=13,l(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(){return e.apply(this,arguments)}}(),x=function(){var e=Object(u.a)(m.a.mark((function e(){var t,r;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/fluentcrm/tags"});case 4:t=e.sent,r=w,(t||[]).forEach((function(e){r=[].concat(Object(p.a)(r),[{value:e.id,label:e.title||e.slug}])})),_(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&e.t0.message&&P(e.t0.message);case 13:return e.prev=13,b(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(){return e.apply(this,arguments)}}();return G((function(){C(),x()}),[]),k?React.createElement(H,{className:"presto-notice",status:"error",isDismissible:!1},k):React.createElement("div",null,o?React.createElement(y,null):h.length>1&&React.createElement(W,{label:M("Choose a list","presto-player"),value:null==t?void 0:t.provider_list,options:h,onChange:function(e){return r({provider_list:e})}}),s?React.createElement(y,null):w.length>1&&React.createElement(W,{label:M("Choose a tag","presto-player"),value:null==t?void 0:t.provider_tag,options:w,onChange:function(e){return r({provider_tag:e})}}))},K=wp.i18n.__,Q=wp.components,X=Q.SelectControl,$=Q.Button,J=Q.Flex,ee=Q.Icon,te=wp.element,re=te.useEffect,ne=te.useState,ae=function(e){var t=e.options,r=e.updateEmailState,n=ne(!1),a=Object(d.a)(n,2),o=a[0],l=a[1],c=ne([{value:"none",label:K("None","presto-player")}]),i=Object(d.a)(c,2),s=i[0],b=i[1],v=ne(""),f=Object(d.a)(v,2),h=f[0],O=f[1],g={presto_player_activecampaign:{label:"ActiveCampaign",value:"activecampaign"},presto_player_mailchimp:{label:"MailChimp",value:"mailchimp"},presto_player_mailerlite:{label:"MailerLite",value:"mailerlite"},presto_player_fluentcrm:{label:"FluentCRM",value:"fluentcrm"}},j=function(){var e=Object(u.a)(m.a.mark((function e(){var t,r;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l(!0),O(""),e.prev=2,e.next=5,wp.apiFetch({path:"wp/v2/settings"});case 5:t=e.sent,r=s,Object.keys(t).forEach((function(e){var n;null!=g&&g[e]&&null!==(n=t[e])&&void 0!==n&&n.connected&&(r=[].concat(Object(p.a)(r),[g[e]]))})),b(r),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),null!==e.t0&&void 0!==e.t0&&e.t0.message&&O(e.t0.message);case 14:return e.prev=14,l(!1),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[2,11,14,17]])})));return function(){return e.apply(this,arguments)}}();re((function(){j()}),[]);return o?React.createElement(y,null):React.createElement("div",null,h,s.length>1?React.createElement("div",null,React.createElement(X,{label:K("Choose an email provider","presto-player"),value:null==t?void 0:t.provider,options:s,onChange:function(e){return r({provider:e})}}),function(){var e=s.find((function(e){return e.value===(null==t?void 0:t.provider)}));if(Object.keys(e||{}).length)switch(null==t?void 0:t.provider){case"mailchimp":return React.createElement(E,{options:t,updateEmailState:r});case"mailerlite":return React.createElement(T,{options:t,updateEmailState:r});case"activecampaign":return React.createElement(U,{options:t,updateEmailState:r});case"fluentcrm":return React.createElement(Z,{options:t,updateEmailState:r})}}()):React.createElement(J,null,React.createElement($,{target:"_blank",href:"/wp-admin/edit.php?post_type=pp_video_block&page=presto-player-settings#/integrations",isSecondary:!0,isSmall:!0},K("Connect a provider","presto-player")),React.createElement($,{isSmall:!0,onClick:function(e){e.preventDefault(),j()}},React.createElement(ee,{icon:"update"}))))},oe=r(12),le=r(0);function ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ie(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(r),!0).forEach((function(t){Object(l.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.state,r=e.updateState,l=e.className,p=t.email_collection,u=t.cta,d=Object(s.useSelect)((function(e){return e("presto-player/player").branding()})),b=function(e){r(ie(ie({},t),{},{email_collection:ie(ie({},p),e)}))};return Object(le.b)("div",{className:l},Object(le.b)(i.BaseControl,null,Object(le.b)("h3",null,Object(c.__)("Email Capture","presto-player"))),Object(le.b)(i.BaseControl,{className:"presto-player__control--large-play"},Object(le.b)(i.ToggleControl,{label:Object(c.__)("Enable","presto-player"),help:Object(c.__)("Show an email collection form and message over your player.","presto-player"),onChange:function(e){b({enabled:e})},checked:null==p?void 0:p.enabled})),!(null==p||!p.enabled)&&Object(le.b)(React.Fragment,null,Object(le.b)(i.BaseControl,{className:"presto-player__control--percentage-watched"},Object(le.b)(i.RangeControl,{label:Object(c.__)("Display At (Percentage)","presto-player"),labelPosition:"top",onChange:function(e){b({percentage:e})},marks:[{value:0,label:Object(c.__)("Start","presto-player")},{value:50,label:Object(c.__)("50% Watched","presto-player")},{value:100,label:Object(c.__)("End","presto-player")}],shiftStep:5,value:(null==p?void 0:p.percentage)||0})),(null==u?void 0:u.enabled)&&(null==p?void 0:p.percentage)===(null==u?void 0:u.percentage)&&Object(le.b)(i.Notice,{css:Object(le.a)(n||(n=Object(o.a)(["\n margin: 0 0 30px 0 !important;\n "]))),status:"warning",isDismissible:!1},Object(c.__)("You already have a Call To Action set display at the same time.","presto-player"),Object(le.b)(i.Button,{onClick:function(){r(ie(ie({},t),{},{cta:ie(ie({},u),{enabled:!1})}))},isLink:!0,css:Object(le.a)(a||(a=Object(o.a)(["\n margin-top: 10px !important;\n "])))},Object(c.__)("Disable Call To Action","presto-player"))),Object(le.b)(i.BaseControl,{className:"presto-player__control--large-play"},Object(le.b)(i.ToggleControl,{label:Object(c.__)("Allow Skipping","presto-player"),help:Object(c.__)("Let the viewer skip","presto-player"),onChange:function(e){b({allow_skip:e})},checked:null==p?void 0:p.allow_skip})),Object(le.b)(i.BaseControl,{className:"presto-player__control--large-play"},Object(le.b)(i.TextareaControl,{label:Object(c.__)("Headline","presto-player"),help:Object(c.__)("The headline for your form.","presto-player"),value:null==p?void 0:p.headline,onChange:function(e){b({headline:e})}})),Object(le.b)(i.BaseControl,{className:"presto-player__control--large-play"},Object(le.b)(i.TextareaControl,{label:Object(c.__)("Bottom Text","presto-player"),help:Object(c.__)("Text displayed below the form. HTML allowed.","presto-player"),value:null==p?void 0:p.bottom_text,onChange:function(e){b({bottom_text:e})}})),Object(le.b)(i.BaseControl,{className:"presto-player__control--large-play"},Object(le.b)(i.TextControl,{label:Object(c.__)("Play Button Text","presto-player"),help:Object(le.b)("p",null,Object(c.__)("Submit button text","presto-player")),value:null==p?void 0:p.button_text,onChange:function(e){return b({button_text:e})}})),Object(le.b)(i.BaseControl,{className:"presto-player__control--button-color"},Object(le.b)(i.Flex,null,Object(le.b)(i.BaseControl.VisualLabel,null,Object(c.__)("Button Color","presto-player")),Object(le.b)(oe.a,{color:(null==u?void 0:u.button_color)||(null==d?void 0:d.color),setColor:function(e){return b({button_color:e&&e.hex})}}))),Object(le.b)(i.BaseControl,{className:"presto-player__control--button-text-color"},Object(le.b)(i.Flex,null,Object(le.b)(i.BaseControl.VisualLabel,null,Object(c.__)("Button Text Color","presto-player")),Object(le.b)(oe.a,{color:(null==u?void 0:u.button_text_color)||"#ffffff",setColor:function(e){return b({button_text_color:e&&e.hex})}}))),Object(le.b)("h3",null,Object(c.__)("Integrate","presto-player")),Object(le.b)(i.BaseControl,null,Object(le.b)(ae,{updateEmailState:b,options:p})),Object(le.b)("h3",null,Object(c.__)("Style","presto-player")),Object(le.b)(i.BaseControl,null,Object(le.b)(i.RangeControl,{label:Object(c.__)("Round Corners","presto-player"),help:Object(c.__)("Border radius of form elements.","presto-player"),value:(null==p?void 0:p.border_radius)||0,onChange:function(e){return b({border_radius:e})},min:0,max:25}))))}},function(e,t,r){"use strict";var n=r(8),a=r(5),o=r(1),l=r(9),c=wp.i18n.__,i=wp.components,s=i.Flex,p=i.FlexItem,u=i.FlexBlock,d=i.TextControl,b=i.Button,m=wp.element.useState,y=function(e){var t=e.update,r=e.add,n=e.remove,i=e.className,y=e.time,v=e.title,f=(e.disabled,e.showNotice,m(y)),h=Object(o.a)(f,2),O=h[0],g=h[1];return React.createElement(s,{align:"center",className:i},React.createElement(p,null,React.createElement(d,Object(a.a)({className:"presto-player__caption--time",style:{width:"60px"},placeholder:"0:00",value:O,onChange:function(e){return g(e)},onBlur:function(){var e=Object(l.b)(O);t({time:e}),g(e)},autoComplete:"off"},"placeholder","0:00"))),React.createElement(u,null,React.createElement(d,{className:"presto-player__caption--title",placeholder:c("Title","presto-player"),value:v||"",onChange:function(e){return t({title:e})},autoComplete:"off"})),React.createElement(p,null,n&&React.createElement(b,{icon:"minus",className:"ph-chapter__remove",style:{marginBottom:"8px"},label:c("Remove Chapter","presto-player"),onClick:n}),r&&React.createElement(b,{icon:"plus-alt",className:"ph-chapter__add",label:c("Add Chapter","presto-player"),style:{marginBottom:"8px"},onClick:function(){r(),g("")}})))};function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){Object(a.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}wp.i18n.__;var h=wp.element.useState,O=wp.data.dispatch;t.a=function(e){var t,r=e.setAttributes,a=e.attributes,l=function(){O("presto-player/player").setProModal(!0)};if(null===(t=prestoPlayer)||void 0===t||!t.isPremium)return React.createElement(y,{disabled:!0,className:"ph-chapter is-new",time:"",title:"",update:function(){},showNotice:l,add:l});var c=a.chapters,i=h({title:"",time:""}),s=Object(o.a)(i,2),p=s[0],u=s[1];return React.createElement(React.Fragment,null,(c||[]).sort((function(e,t){return parseInt(e.time.split(":")[0])-parseInt(t.time.split(":")[0])==0?parseInt(e.time.split(":")[1])-parseInt(t.time.split(":")[1]):parseInt(e.time.split(":")[0])-parseInt(t.time.split(":")[0])})).map((function(e,t){return React.createElement(y,{key:"".concat(t,"-").concat(e.time),className:"ph-chapter",time:e.time,title:e.title,chapter:e,update:function(t){!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=c.indexOf(e),a=c.map((function(e,r){return r!==n?e:f(f({},e),t)}));r({chapters:a})}(e,t)},remove:function(){!function(e){var t=c.indexOf(e);r({chapters:c.filter((function(e,r){return r!==t}))})}(e)}})})),React.createElement(y,{className:"ph-chapter is-new",time:p.time,title:p.title,update:function(e){u(f(f({},p),e))},add:function(){p.time&&p.title&&(r({chapters:[].concat(Object(n.a)(c||[]),[{time:p.time,title:p.title}])}),u({title:"",time:""}))}}))}},function(e,t,r){"use strict";var n,a,o,l=r(5),c=r(1),i=r(12),s=r(25),p=r(6),u=r(7),d=r(2),b=r.n(d),m=r(0);function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){Object(l.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f=wp.i18n.__,h=wp.components,O=h.TextControl,g=h.ExternalLink,j=h.Button,w=(h.Flex,wp.element),_=w.useState,E=w.useEffect,R=wp.data,k=R.useSelect,P=R.dispatch,C=function(e){var t=e.onClose,r=e.value,l=e.setValue,i=_(!1),s=Object(c.a)(i,2),d=s[0],y=s[1],h=wp.data.useSelect((function(e){return e("core").canUser("read","settings")})),w=k((function(e){return e("presto-player/player").youtube()}));E((function(){l(w.channel_id)}),[null==w?void 0:w.channel_id]);var R=function(){var e=Object(u.a)(b.a.mark((function e(n){var a,o;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.preventDefault(),y(!0),P("presto-player/player").updateYoutube({channel_id:r}),a=v(v({},w),{channel_id:r}),e.prev=4,e.next=7,wp.apiFetch({path:"wp/v2/settings",method:"POST",data:{presto_player_youtube:a}});case 7:null!=(o=e.sent)&&o.presto_player_youtube&&(P("presto-player/player").setYoutube(null==o?void 0:o.presto_player_youtube),t()),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(4);case 13:return e.prev=13,y(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[4,11,13,16]])})));return function(t){return e.apply(this,arguments)}}();return h?Object(m.b)("form",{onSubmit:R},Object(m.b)(O,{css:Object(m.a)(n||(n=Object(p.a)(["\n margin-bottom: 0 !important;\n "]))),label:f("Youtube Channel ID","presto-player"),help:Object(m.b)("p",null,Object(m.b)(g,{href:"https://support.google.com/youtube/answer/3250431?hl=en"},f("Find my channel id","presto-player"))),value:r,onChange:function(e){return l(e)}}),Object(m.b)(j,{disabled:d,isBusy:d,css:Object(m.a)(a||(a=Object(p.a)(["\n margin-bottom: 1em;\n "]))),isPrimary:!0,type:"submot"},f("Save","presto-player")),Object(m.b)(j,{onClick:t,css:Object(m.a)(o||(o=Object(p.a)(["\n margin-bottom: 1em;\n "]))),isTertiary:!0},f("Cancel","presto-player"))):""};function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){Object(l.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var N=wp.i18n.__,T=wp.components,D=T.ToggleControl,B=T.Flex,A=T.Button,L=T.BaseControl,I=T.RangeControl,F=T.TextControl,V=T.SelectControl,U=T.TextareaControl,M=wp.element,z=M.useEffect,W=M.useState,H=wp.data.useSelect;t.a=function(e){var t=e.state,r=e.updateState,n=e.className,a=e.value,o=e.setValue,l=t.action_bar,p=W(!1),u=Object(c.a)(p,2),d=u[0],b=u[1],m=H((function(e){return e("presto-player/player").branding()})),y=H((function(e){return e("presto-player/player").youtube()})),v=function(e){r(S(S({},t),{},{action_bar:S(S({},l),e)}))};z((function(){null!=l&&l.text||v({text:"Like this?"}),null!=l&&l.button_type||v({button_type:"custom"}),null!=l&&l.button_text||v({button_text:"Click Here"})}),[t]);return React.createElement("div",{className:n},React.createElement(L,null,React.createElement("h3",null,N("Action Bar","presto-player"))),React.createElement(L,{className:"presto-player__control--large-play"},React.createElement(D,{label:N("Enable","presto-player"),help:N("Show an action bar below your player while it's playing.","presto-player"),onChange:function(e){v({enabled:e})},checked:null==l?void 0:l.enabled})),!(null==l||!l.enabled)&&React.createElement(React.Fragment,null,React.createElement(L,{className:"presto-player__control--percentage-watched"},React.createElement(I,{label:N("Display At (Percentage)","presto-player"),labelPosition:"top",onChange:function(e){v({percentage_start:e})},marks:[{value:0,label:N("Start","presto-player")},{value:50,label:N("50% Watched","presto-player")},{value:100,label:N("End","presto-player")}],shiftStep:5,value:(null==l?void 0:l.percentage_start)||0})),React.createElement(L,{className:"presto-player__control--large-play"},React.createElement(U,{label:N("Text","presto-player"),help:N("Action bar text.","presto-player"),value:null==l?void 0:l.text,onChange:function(e){return v({text:e})}})),React.createElement(L,{className:"presto-player__control--large-play"},React.createElement(B,null,React.createElement(L.VisualLabel,null,N("Action Bar Background","presto-player")),React.createElement(i.a,{color:(null==l?void 0:l.background_color)||"#1d1d1d",setColor:function(e){return v({background_color:e&&e.hex})}}))),React.createElement(L,null,React.createElement("h3",null,N("Button","presto-player"))),React.createElement(L,{className:"presto-player__control--button-type"},React.createElement(V,{label:N("Button Type","presto-player"),value:null==l?void 0:l.button_type,options:[{value:"custom",label:N("Custom","presto-player")},{value:"youtube",label:N("YouTube Subscribe","presto-player")},{value:"none",label:N("None","presto-player")}],onChange:function(e){return v({button_type:e})}})),"youtube"===(null==l?void 0:l.button_type)&&(null==y?void 0:y.channel_id)&&React.createElement(D,{label:N("Show Count","presto-player"),help:N("Show your follower count.","presto-player"),onChange:function(e){v({button_count:e})},checked:null==l?void 0:l.button_count}),function(){if("youtube"===(null==l?void 0:l.button_type))return d?React.createElement(C,{onClose:function(){return b(!1)},value:a,setValue:o}):React.createElement("div",null,React.createElement(A,{isSecondary:!0,onClick:function(e){e.preventDefault(),b(!0)}},null!=y&&y.channel_id?N("Update Youtube Channel Id","presto-player"):N("Add Youtube Channel Id","presto-player")),React.createElement("br",null),React.createElement("br",null),React.createElement("br",null))}(),"custom"===(null==l?void 0:l.button_type)&&React.createElement("div",null,React.createElement(L,{className:"presto-player__control--button-text"},React.createElement(F,{label:N("Button Text","presto-player"),help:React.createElement("p",null,N("Submit button text","presto-player")),value:null==l?void 0:l.button_text,onChange:function(e){return v({button_text:e})}})),React.createElement(L,{className:"presto-player__control--button-text"},React.createElement(L.VisualLabel,null,React.createElement("p",null," ",N("Button Link","presto-player"))),React.createElement(s.a,{setSettings:function(e){v({button_link:e})},settings:(null==l?void 0:l.button_link)||{}})),React.createElement(L,{className:"presto-player__control--button-radius"},React.createElement(I,{label:N("Round Corners","presto-player"),help:N("Border radius of the button","presto-player"),value:(null==l?void 0:l.button_radius)||0,onChange:function(e){return v({button_radius:e})},min:0,max:25})),React.createElement(L,{className:"presto-player__control--button-color"},React.createElement(B,null,React.createElement(L.VisualLabel,null,N("Button Color","presto-player")),React.createElement(i.a,{color:(null==l?void 0:l.button_color)||(null==m?void 0:m.color),setColor:function(e){return v({button_color:e&&e.hex})}}))),React.createElement(L,{className:"presto-player__control--button-text-color"},React.createElement(B,null,React.createElement(L.VisualLabel,null,N("Button Text Color","presto-player")),React.createElement(i.a,{color:(null==l?void 0:l.button_text_color)||"#ffffff",setColor:function(e){return v({button_text_color:e&&e.hex})}}))))))}},,,function(e,t){e.exports=window.wp.editor},,,,,,,function(e,t,r){"use strict";(function(e){var n,a,o=r(6),l=r(8),c=r(5),i=r(1),s=r(52),p=r(0),u=r(35),d=r(51);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){Object(c.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var y=wp.i18n.__,v=wp.components,f=v.Button,h=v.Flex,O=v.FlexItem,g=v.FlexBlock,j=v.Modal,w=wp.element,_=w.useState,E=w.useEffect,R=wp.data.useSelect;t.a=function(t){var r=t.closeModal,c=t.attributes,b=t.setAttributes,v=t.updateOverlayAttribute,w=_(!1),k=Object(i.a)(w,2),P=k[0],C=k[1],x=_(""),S=Object(i.a)(x,2),N=S[0],T=S[1],D=c.overlays,B=c.preset,A=c.src,L=c.poster,I=c.previewSrc,F=R((function(e){return e("presto-player/player").branding()})),V=R((function(e){return e("presto-player/player").getPreset(B)}));E((function(){D.length||U()}),[]);var U=function(){var e={startTime:"0:00",endTime:"0:05",text:y("Here's a link to click!","presto-player"),link:{},position:"top-right",color:"#fff",backgroundColor:"#000",opacity:75};D[D.length-1]&&(e=m({},D[D.length-1]));e.id=Object(s.a)(10),b({overlays:[].concat(Object(l.a)(D||[]),[e])})};return Object(p.b)(j,{title:y("Manage Video Overlays","presto-player"),onRequestClose:r,className:"presto-player__modal-presets",overlayClassName:"presto-player__modal-presets-overlay",shouldCloseOnClickOutside:!1},Object(p.b)("div",{className:"presto-player__preset-options","data-cy":"preset-modal"},Object(p.b)(h,{align:"stretch",className:"presto-player__style-preview-area"},Object(p.b)(O,{className:"presto-player__style-sidebar"},Object(p.b)("div",{css:{padding:"3px"}},(D||[]).sort((function(e,t){return parseInt(e.startTime.split(":")[0])-parseInt(t.startTime.split(":")[0])==0?parseInt(e.startTime.split(":")[1])-parseInt(t.startTime.split(":")[1]):parseInt(e.startTime.split(":")[0])-parseInt(t.startTime.split(":")[0])})).map((function(t,r){return Object(p.b)(d.a,{key:"".concat(r,"-").concat(t.startTime),overlayIndex:r,className:"presto-player__overlay",startTime:t.startTime,endTime:t.endTime,text:t.text,link:t.link,position:t.position,color:t.color,backgroundColor:t.backgroundColor,opacity:t.opacity,overlay:t,update:function(e){!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=D.indexOf(e),n=D.map((function(e,n){return n!==r?e:m(m({},e),t)}));b({overlays:n})}(t,e)},remove:function(){!function(e){var t=D.indexOf(e);b({overlays:D.filter((function(e,r){return r!==t}))})}(t)},updateCurrentTime:function(t){!function(t){T(""),e.nextTick((function(){T(t)}))}(t)}})})),Object(p.b)(f,{isPrimary:!0,onClick:U},y("Add An Overlay","presto-player")))),Object(p.b)(g,{className:"presto-player__style-preview-panel"},Object(p.b)(u.a,{preload:"auto",currentTime:N,src:I||A,isDisabled:!1,state:m(m({},V),{},{lazy_load_youtube:!1,invert_time:!1}),branding:F,poster:L,overlays:D}))),Object(p.b)("br",null),Object(p.b)("div",{css:Object(p.a)(n||(n=Object(o.a)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n "])))},Object(p.b)("div",{css:Object(p.a)(a||(a=Object(o.a)(["\n opacity: 0.5;\n font-size: 12px;\n "])))}),Object(p.b)("div",null,Object(p.b)(f,{isTertiary:!0,onClick:r,style:{margin:"0 6px"}},y("Cancel","presto-player")),Object(p.b)(f,{isPrimary:!0,isBusy:P,disabled:P,onClick:function(){C(!0),v(D),C(!1),r()},"data-cy":"submit-preset"},y("Save Overlays","presto-player"))))))}}).call(this,r(66))},function(e,t,r){"use strict";var n=r(1),a=r(0),o=r(9),l=r(25),c=r(36),i=r(12),s=wp.i18n.__,p=wp.components,u=p.Flex,d=p.FlexItem,b=p.TextControl,m=p.Button,y=p.BaseControl,v=p.RadioControl,f=p.RangeControl,h=(p.withFocusReturn,wp.element),O=h.useRef,g=h.useEffect,j=wp.element.useState;t.a=function(e){var t=e.overlayIndex,r=e.update,p=e.remove,h=e.className,w=e.startTime,_=e.endTime,E=e.text,R=e.link,k=e.position,P=e.color,C=e.backgroundColor,x=e.opacity,S=e.updateCurrentTime,N=j(w),T=Object(n.a)(N,2),D=T[0],B=T[1],A=j(_),L=Object(n.a)(A,2),I=L[0],F=L[1],V=j(k),U=Object(n.a)(V,2),M=U[0],z=U[1],W=O();g((function(){if(Object(o.e)(w)>=Object(o.e)(_)){var e=Object(o.b)(w),t=Object(o.e)(e)+1;e=Object(o.b)(Object(o.c)(t)),r({endTime:e}),F(e)}}),[w,_]);var H=function(){var e=Object(o.b)(D);r({startTime:e}),B(e),S(e)};return Object(a.b)("div",null,Object(a.b)(u,{align:"center",className:h},Object(a.b)(d,null,Object(a.b)(b,{ref:W,id:"start-time-".concat(t),label:s("Start Time","presto-player"),className:"presto-player__overlay--start-time",value:D,onChange:function(e){return B(e)},onBlur:H,onFocus:H,autoComplete:"off",placeholder:"0:00"})),Object(a.b)(d,null,Object(a.b)(b,{label:s("End Time","presto-player"),className:"presto-player__overlay--end-time",value:I,onChange:F,onBlur:function(){var e=Object(o.b)(I);r({endTime:e}),F(e)},autoComplete:"off",placeholder:"0:00"}))),Object(a.b)(c.a,{text:E,update:r,onFocus:function(){S(Object(o.b)(D))}}),Object(a.b)(y,{style:{width:"100%"}},Object(a.b)(y.VisualLabel,null,Object(a.b)("p",null," ",s("Link","presto-player"))),Object(a.b)(l.a,{onFocus:function(){S(Object(o.b)(D))},setSettings:function(e){return r({link:e})},settings:R||{}})),Object(a.b)(y,{className:h},Object(a.b)(v,{label:s("Position","presto-player"),options:[{label:"Top Right",value:"top-right"},{label:"Top Left",value:"top-left"}],selected:M||"right",onFocus:function(){S(Object(o.b)(D))},onChange:function(e){r({position:e}),z(e),S(Object(o.b)(D))}})),Object(a.b)(y,{className:"presto-player__control--overlay-text-color"},Object(a.b)(u,null,Object(a.b)(y.VisualLabel,null,s("Text Color","presto-player")),Object(a.b)(i.a,{onFocus:function(){S(Object(o.b)(D))},color:P,setColor:function(e){r({color:e&&e.hex})}}))),Object(a.b)(y,{className:"presto-player__control--overlay-background-color"},Object(a.b)(u,null,Object(a.b)(y.VisualLabel,null,s("Background Color","presto-player")),Object(a.b)(i.a,{onFocus:function(){S(Object(o.b)(D))},color:C,setColor:function(e){r({backgroundColor:e&&e.hex})}}))),Object(a.b)(y,null,Object(a.b)(f,{label:s("Opacity","presto-player"),help:s("Opacity percentage of the overlay.","presto-player"),value:x,onChange:function(e){return r({opacity:e})},min:0,max:100})),p&&Object(a.b)(y,{className:h},Object(a.b)(u,{justify:"flex-end"},Object(a.b)(m,{isDestructive:!0,isSmall:!0,onClick:p},s("Remove Overlay","presto-player")))),Object(a.b)("hr",{css:{marginBottom:"20px"}}))}},,,,function(e,t,r){r(56),e.exports=r(71)},,,,function(e,t,r){var n={"./audio/index.js":70,"./bunny/index.js":69,"./hosted/index.js":73,"./reusable-display/index.js":74,"./reusable-edit/index.js":67,"./vimeo/index.js":75,"./youtube/index.js":76};function a(e){var t=o(e);return r(t)}function o(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}a.keys=function(){return Object.keys(n)},a.resolve=o,e.exports=a,a.id=59},,,,,,,,function(e,t,r){"use strict";r.r(t),r.d(t,"name",(function(){return v})),r.d(t,"options",(function(){return f}));var n=wp.i18n.__,a=wp.blockEditor,o=a.InnerBlocks,l=a.useBlockProps,c=wp.data,i=c.useSelect,s=c.dispatch,p=wp.components,u=p.Button,d=p.Placeholder,b=wp.plugins,m=(b.getPlugins,b.unregisterPlugin),y=wp.element.useEffect,v="presto-player/reusable-edit",f={title:"Reusable Block Container",category:"presto",supports:{inserter:!1,reusable:!1,html:!1},icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("circle",{cx:"12",cy:"12",r:"10"}),React.createElement("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),React.createElement("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})),edit:function(e){var t=l(),r=e.clientId,a=e.isSelected,c=i((function(e){return e("core/block-editor").getBlock(r).innerBlocks}));y((function(){a&&wp.data.dispatch("core/edit-post").openGeneralSidebar("edit-post/block")}),[a]),s("core/block-editor").setTemplateValidity(!0),y((function(){m("presto-player")}),[]);var p,b=function(e){var t=wp.blocks.createBlock("presto-player/".concat(e));return s("core/block-editor").insertBlock(t,0,r)};return null!=c&&c.length?React.createElement("div",null,React.createElement("div",t,React.createElement(o,{templateLock:!1,renderAppender:function(){return 0===c.length&&React.createElement(o.ButtonBlockAppender,null)}}))):React.createElement("div",null,React.createElement("div",t,React.createElement(d,{icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("polygon",{points:"23 7 16 12 23 17 23 7"}),React.createElement("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2",ry:"2"})),instructions:n("Choose a video type to get started.","presto-player"),label:n("Choose a Video Type","presto-player")},React.createElement(u,{isPrimary:!0,onClick:function(){b("self-hosted")}},n("Video","presto-player")),React.createElement(u,{isPrimary:!0,onClick:function(){b("youtube")}},n("Youtube","presto-player")),React.createElement(u,{isPrimary:!0,onClick:function(){b("vimeo")}},n("Vimeo","presto-player")),null!==(p=prestoPlayer)&&void 0!==p&&p.isPremium?React.createElement(u,{isPrimary:!0,onClick:function(){b("bunny")}},n("Bunny.net","presto-player")):"",React.createElement(u,{isPrimary:!0,onClick:function(){b("audio")}},n("Audio","presto-player"))),React.createElement(o,{templateLock:!1,renderAppender:function(){return!1}})))},save:function(){var e=l.save();return React.createElement("div",e,React.createElement(o.Content,null))}}},function(e,t,r){var n={"./reusable-videos/index.js":72};function a(e){var t=o(e);return r(t)}function o(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}a.keys=function(){return Object.keys(n)},a.resolve=o,e.exports=a,a.id=68},function(e,t,r){"use strict";r.r(t),r.d(t,"name",(function(){return xa})),r.d(t,"options",(function(){return Sa}));var n={};r.r(n),r.d(n,"videos",(function(){return Q})),r.d(n,"collections",(function(){return X})),r.d(n,"uploads",(function(){return $})),r.d(n,"isPrivate",(function(){return J})),r.d(n,"isLoading",(function(){return ee})),r.d(n,"errors",(function(){return te})),r.d(n,"videosFetched",(function(){return re})),r.d(n,"currentCollection",(function(){return ne})),r.d(n,"ui",(function(){return ae})),r.d(n,"requestType",(function(){return oe}));var a={};r.r(a),r.d(a,"setVideos",(function(){return le})),r.d(a,"addVideos",(function(){return ce})),r.d(a,"removeVideo",(function(){return ie})),r.d(a,"setCollections",(function(){return se})),r.d(a,"addCollection",(function(){return pe})),r.d(a,"setIsPrivate",(function(){return ue})),r.d(a,"setSearch",(function(){return de})),r.d(a,"setCollectionRequest",(function(){return be})),r.d(a,"setUploads",(function(){return me})),r.d(a,"addUploads",(function(){return ye})),r.d(a,"removeUpload",(function(){return ve})),r.d(a,"setVideosFetched",(function(){return fe})),r.d(a,"setLoading",(function(){return he})),r.d(a,"setUI",(function(){return Oe})),r.d(a,"addError",(function(){return ge})),r.d(a,"removeError",(function(){return je}));var o,l,c=r(5),i=r(7),s=r(1),p=r(2),u=r.n(p),d=function(){var e=Object(i.a)(u.a.mark((function e(t){var r;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,wp.apiFetch({path:"presto-player/v1/bunny/sign",method:"POST",data:{url:t,id:0}});case 4:return r=e.sent,e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),b=r(20),m=r(21),y=r(34),v=function(e){var t=e.file,r=e.path,n=e.onProgress,a=e.onComplete,o=e.onError,l=0,c=!1,s=Math.min(prestoPlayerAdmin.wp_max_upload_size-1e6,159e5),p=Math.max(s,19e5);p=Math.min(p,104857600);var d=function(){var e=Object(i.a)(u.a.mark((function e(i){var s,b,m,y,v;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=i+p+1,b=t.slice(i,s),m=Math.ceil(t.size/(p+1)),l++,n(l/m*100),(y=new FormData).append("file",b),y.append("name",t.name),y.append("chunk",l),y.append("chunks",m),e.prev=10,e.next=13,wp.apiFetch({path:r,method:"POST",body:y});case 13:if(v=e.sent,!c){e.next=17;break}return console.log("cancelled"),e.abrupt("return");case 17:s<t.size?(n(void 0),d(s)):a(v),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(10),o(e.t0),console.error(e.t0);case 24:case"end":return e.stop()}}),e,null,[[10,20]])})));return function(t){return e.apply(this,arguments)}}();return l=0,new FileReader,d(0),{cancel:function(){c=!0}}},f=r(6),h=function(e){var t=e.item,r=e.onClick,n=e.className;var a,o=function(){return!(null==t||!t.encodeProgress)&&100!==t.encodeProgress};return React.createElement("div",{className:"presto-player__media-list-item ".concat(n),onClick:r},React.createElement("div",{className:"presto-player__media-list-item-icon"},React.createElement("svg",Object(c.a)({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"},"strokeLinecap","round"),React.createElement("polygon",{points:"23 7 16 12 23 17 23 7"}),React.createElement("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2",ry:"2"}))),React.createElement("div",{className:"presto-player__media-list-item-title"},null==t?void 0:t.title),o()&&React.createElement("div",{className:"presto-player__media-list-item-size"},"Encoding..."),!o()&&React.createElement("div",{className:"presto-player__media-list-item-size"},function(e){if(0==e)return"0 Byte";var t=parseInt(Math.floor(Math.log(e)/Math.log(1024)));return Math.round(e/Math.pow(1024,t),2)+" "+["Bytes","KB","MB","GB","TB"][t]}(null==t?void 0:t.size)),!o()&&React.createElement("div",{className:"presto-player__media-list-item-modified"},(a=t.updated_at,new Date(a).toLocaleString())))},O=function(e){var t,r=e.item,n=e.onClick,a=e.className;return React.createElement("div",{className:"presto-player__media-list-item ".concat(a),onClick:n},React.createElement("div",{className:"presto-player__media-list-item-icon"},React.createElement("svg",Object(c.a)({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"},"strokeLinecap","round"),React.createElement("polygon",{points:"23 7 16 12 23 17 23 7"}),React.createElement("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2",ry:"2"}))),React.createElement("div",{className:"presto-player__media-list-item-title"},null==r?void 0:r.title),React.createElement("div",{className:"presto-player__media-list-item-size"},function(e){if(0==e)return"0 Byte";var t=parseInt(Math.floor(Math.log(e)/Math.log(1024)));return Math.round(e/Math.pow(1024,t),2)+" "+["Bytes","KB","MB","GB","TB"][t]}(null==r?void 0:r.size)),React.createElement("div",{className:"presto-player__media-list-item-modified"},(t=r.updated_at,new Date(t).toLocaleString())))},g=r(0),j=wp.i18n.__,w=wp.components,_=w.Modal,E=w.Spinner,R=w.Button,k=w.BaseControl,P=w.Flex,C=w.FlexBlock,x=w.Notice,S=w.Card,N=w.CardBody,T=w.Disabled,D=w.DropZone,B=w.FormFileUpload,A=w.DropZoneProvider,L=wp.element,I=L.useEffect,F=L.useState,V=L.useRef,U=function(e){var t=e.onClose,r=e.title,n=e.header,a=e.onLoad,c=e.items,i=e.folders,p=e.fetching,u=e.progressMessage,d=e.onSelect,b=e.error,m=e.onDelete,y=e.onUpload,v=e.progress,w=F({}),L=Object(s.a)(w,2),U=L[0],M=L[1],z=F(!1),W=Object(s.a)(z,2),H=W[0],Y=W[1],G=V();I((function(){a&&a()}),[]);var q,Z,K,Q,X=function(){m(U),Y(!1)},$=function(){return Object.keys(U||{}).length};return Object(g.b)(_,{title:n||j("Add Media","presto-player"),onRequestClose:t,className:"presto-player__media-modal presto-player__full-modal",overlayClassName:"presto-player__modal-overlay"},Object(g.b)("div",{className:"presto-player__media-modal-layout","data-cy":"media-modal"},Object(g.b)("div",{className:"presto-player__media-modal-header"},Object(g.b)("div",{className:"presto-player__media-modal-upload",css:Object(g.a)(o||(o=Object(f.a)(["\n display: flex;\n align-items: center;\n "])))},Object(g.b)(B,{isPrimary:!0,accept:"video/mp4,video/x-m4v,video/*",onChange:function(e){e.target.files&&(y(e.target.files),jQuery(e.target).val(null))}},j("Upload New Video","presto-player")),Object(g.b)("div",{css:Object(g.a)(l||(l=Object(f.a)(["\n margin-left: 10px;\n "])))},j("Or drag a file here to upload.","presto-player"))),b&&Object(g.b)(x,{status:"error",isDismissible:!1},b)),Object(g.b)("div",{className:"presto-player__media-modal-content"},Object(g.b)(A,null,p?Object(g.b)(P,{className:"presto-player__media-loading"},Object(g.b)(C,{style:{textAlign:"center"}},v?Object(g.b)(React.Fragment,null,Object(g.b)("div",null,Object(g.b)("strong",null,u||j("Uploading","presto-player"))),Object(g.b)("div",null,j("Please don't navigate away from this page.","presto-player")),Object(g.b)("progress",{className:"presto-progress",max:"100",value:v,style:{width:"100px"}})):Object(g.b)(E,null))):null!=c&&c.length?Object(g.b)("div",{className:"presto-player__media-list"},Object(g.b)("h2",null,r),i&&Object(g.b)("div",{className:"presto-player__media-list-folders"},i.map((function(e){return Object(g.b)(O,{key:e.id,item:e})}))),Object(g.b)("div",{className:"presto-player__media-list-items"},c.map((function(e){return Object(g.b)(h,{item:e,key:e.id,onClick:function(){M(U===e?{}:e)},className:U===e?"is-selected":""})})))):Object(g.b)(P,{"align-items":"center",className:"presto-player__media-not-found"},Object(g.b)("div",null,Object(g.b)("h2",null,"Drop video files here to upload"),Object(g.b)("p",null,"or browse for a video"),Object(g.b)(B,{isSecondary:!0,accept:"video/mp4,video/x-m4v,video/*",onChange:function(e){e.target.files&&(y(e.target.files),jQuery(e.target).val(null))}},j("Upload New Video","presto-player")))),Object(g.b)(D,{label:"Drop files",onFilesDrop:y}))),Object(g.b)("div",{className:"presto-player__media-modal-sidebar"},$()?Object(g.b)("div",{className:"presto-player__media-modal-sidebar-content"},Object(g.b)(k,null,Object(g.b)(T,{key:U.id},null!=U&&U.thumbnail?Object(g.b)("img",{src:null==U?void 0:U.thumbnail,style:{maxWidth:"100%"}}):Object(g.b)("video",{preload:"metadata"},Object(g.b)("source",{src:U.previewUrl})))),Object(g.b)(k,null,Object(g.b)(k.VisualLabel,null,j("Name","presto-player")),Object(g.b)("h3",{style:{marginTop:"5px"}},U.title)),!(null==U||!U.visibility)&&Object(g.b)(k,null,Object(g.b)(k.VisualLabel,null,j("Visibility","presto-player")),Object(g.b)("h3",{style:{marginTop:"5px"}},U.visibility)),Object(g.b)(k,null,Object(g.b)(k.VisualLabel,null,j("Size","presto-player")),Object(g.b)("h3",{style:{marginTop:"5px"}},function(e){if(0==e)return"0 Byte";var t=parseInt(Math.floor(Math.log(e)/Math.log(1024)));return Math.round(e/Math.pow(1024,t),2)+" "+["Bytes","KB","MB","GB","TB"][t]}((null==U?void 0:U.size)||0))),Object(g.b)(k,null,Object(g.b)(k.VisualLabel,null,j("Created","presto-player")),Object(g.b)("h3",{style:{marginTop:"5px"}},(q=null==U?void 0:U.created_at,Z=(q=new Date(q)).getHours(),K=q.getMinutes(),Q=Z>=12?"pm":"am",Z=(Z%=12)||12,K=K<10?"0"+K:K,q.getDate()+"-"+(q.getMonth()+1)+"-"+q.getFullYear()+" at "+Z+":"+K+Q))),Object(g.b)(k,null,H?Object(g.b)(S,null,Object(g.b)(N,null,Object(g.b)("p",null,Object(g.b)("strong",null,"Are you sure?")),Object(g.b)("p",null,"Are you sure you want to delete this video?"),Object(g.b)(R,{isDestructive:!0,onClick:X},"Yes"),Object(g.b)(R,{onClick:function(){return Y(!1)}},"Cancel"))):Object(g.b)(R,{isDestructive:!0,onClick:function(){Y(!H)}},j("Delete video","presto-player")))):Object(g.b)(React.Fragment,null)),Object(g.b)("div",{className:"presto-player__media-modal-footer"},Object(g.b)(R,{isPrimary:!0,disabled:!$(),onClick:function(){U&&(d(U),t())},ref:G},j("Choose","presto-player")))))},M=wp.i18n.__,z=wp.element,W=z.useState,H=z.useEffect,Y=function(e){var t=e.closePopup,r=e.noticeOperations,n=e.onSelect,a=e.isPrivate,o=W([]),l=Object(s.a)(o,2),c=l[0],p=l[1],d=W(!1),b=Object(s.a)(d,2),m=b[0],y=b[1],f=W(0),h=Object(s.a)(f,2),O=h[0],g=h[1],j=W(""),w=Object(s.a)(j,2),_=w[0],E=w[1],R=W(""),k=Object(s.a)(R,2),P=k[0],C=k[1],x=a?"private-videos":"public-videos";H((function(){g(0),C("")}),[]);var S=function(){var e=Object(i.a)(u.a.mark((function e(t){return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:C(""),y(!0),E(M("Uploading","presto-player")),v({file:t[0],path:"presto-player/v1/bunny/upload",onProgress:function(e){g(e-10)},onComplete:N,onError:function(e){C(e.message),g(0),y(!1)}});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),N=function(){var e=Object(i.a)(u.a.mark((function e(t){var r,n,a;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.path,n=t.name,E(M("Storing","presto-player")),e.prev=2,e.next=5,wp.apiFetch({path:"presto-player/v1/bunny/".concat(x),method:"POST",data:{path:r,name:n}});case 5:a=e.sent,p(a),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(2),C(e.t0.message),console.error(e.t0);case 13:return e.prev=13,g(0),y(!1),e.finish(13);case 17:case"end":return e.stop()}}),e,null,[[2,9,13,17]])})));return function(t){return e.apply(this,arguments)}}(),T=function(){var e=Object(i.a)(u.a.mark((function e(t){return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,p((c||[]).filter((function(e){return e!==t}))),e.next=4,wp.apiFetch({path:"presto-player/v1/bunny/".concat(x),method:"DELETE",data:{name:null==t?void 0:t.title}});case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),C(e.t0.message);case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),D=function(){var e=Object(i.a)(u.a.mark((function e(){var t;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,y(!0),e.next=4,wp.apiFetch({path:"presto-player/v1/bunny/".concat(x)});case 4:t=e.sent,p(t),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),C(e.t0.message);case 11:return e.prev=11,y(!1),e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[0,8,11,14]])})));return function(){return e.apply(this,arguments)}}();return React.createElement(U,{onClose:t,progressMessage:_,fetching:m,error:P,onUpload:S,onLoad:D,items:c,progress:O,onDelete:T,onSelect:n,onError:function(e){r.removeAllNotices(),r.createErrorNotice(e)},header:M(a?"Bunny.net Private Video Storage":"Bunny.net Public Video Storage","presto-player"),title:M(a?"Private Video Library":"Public Video Library","presto-player")})},G=r(8);function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q(Object(r),!0).forEach((function(t){Object(c.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var K=(0,wp.data.combineReducers)({videosReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_VIDEOS":return t.value;case"ADD_VIDEOS":return[].concat(Object(G.a)(e),Object(G.a)(t.value));case"ADD_VIDEO":return[].concat(Object(G.a)(e),[t.value]);case"UPDATE_VIDEO":return e.map((function(e,r){var n;return e.id!==(null===(n=t.value)||void 0===n?void 0:n.id)?e:Z(Z({},e),t.value)}));case"REMOVE_VIDEO":return e.filter((function(e){return e.guid!==t.value.guid}))}return e},collectionsReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_COLLECTIONS":return t.value;case"ADD_COLLECTION":return[].concat(Object(G.a)(e),[t.value]);case"UPDATE_COLLECTION":return e.map((function(e,r){var n;return e.id!==(null===(n=t.value)||void 0===n?void 0:n.id)?e:Z(Z({},e),t.value)}));case"REMOVE_COLLECTION":return e.filter((function(e){return e!==t.value}))}return e},uploadsReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_UPLOADS":return t.value;case"ADD_UPLOADS":return[].concat(Object(G.a)(e),Object(G.a)(t.value));case"ADD_UPLOAD":return[].concat(Object(G.a)(e),[t.value]);case"UPDATE_UPLOAD":return e.map((function(e,r){var n;return e.id!==(null===(n=t.value)||void 0===n?void 0:n.id)?e:Z(Z({},e),t.value)}));case"REMOVE_UPLOAD":return e.filter((function(e){return e!==t.value}))}return e},requestReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{private:!1,collection:"",search:""},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_PRIVATE_REQUEST":return Z(Z({},e),{},{private:t.value});case"SET_SEARCH_REQUEST":return Z(Z({},e),{},{search:t.value});case"SET_COLLECTION_REQUEST":return Z(Z({},e),{},{collection:t.value})}return e},UIReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{loading:!1,videosFetched:!1,createCollection:!1,selectedId:null},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_LOADING":return Z(Z({},e),{},{loading:t.value});case"SET_VIDEOS_FETCHED":return Z(Z({},e),{},{videosFetched:t.value});case"SET_UI_ITEM":return Z(Z({},e),{},Object(c.a)({},t.item,t.value))}return e},errorReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_ERROR":return[].concat(Object(G.a)(e),[t.value]);case"REMOVE_ERROR":return e.filter((function(e){return e!==t.value}))}return e}});function Q(e){return(null==e?void 0:e.videosReducer)||[]}function X(e){return(null==e?void 0:e.collectionsReducer)||[]}function $(e){return(null==e?void 0:e.uploadsReducer)||[]}function J(e){var t;return!(null==e||null===(t=e.requestReducer)||void 0===t||!t.private)}function ee(e){var t;return(null==e||null===(t=e.UIReducer)||void 0===t?void 0:t.loading)||!1}function te(e){return(null==e?void 0:e.errorReducer)||[]}function re(e){var t;return(null==e||null===(t=e.UIReducer)||void 0===t?void 0:t.videosFetched)||!1}function ne(e){var t;return null==e||null===(t=e.requestReducer)||void 0===t?void 0:t.collection}function ae(e,t){var r;return null==e||null===(r=e.UIReducer)||void 0===r?void 0:r[t]}function oe(e){var t;return null!=e&&null!==(t=e.requestReducer)&&void 0!==t&&t.private?"private":"public"}function le(e){return{type:"SET_VIDEOS",value:e}}function ce(e){return{type:"ADD_VIDEOS",value:e}}function ie(e){return{type:"REMOVE_VIDEO",value:e}}function se(e){return{type:"SET_COLLECTIONS",value:e}}function pe(e){return{type:"ADD_COLLECTION",value:e}}function ue(e){return{type:"SET_PRIVATE_REQUEST",value:e}}function de(e){return{type:"SET_SEARCH",value:e}}function be(e){return{type:"SET_COLLECTION_REQUEST",value:e}}function me(e){return{type:"SET_UPLOADS",value:e}}function ye(e){return{type:"ADD_UPLOADS",value:e}}function ve(e){return{type:"REMOVE_UPLOAD",value:e}}function fe(e){return{type:"SET_VIDEOS_FETCHED",value:e}}function he(e){return{type:"SET_LOADING",value:e}}function Oe(e,t){return{type:"SET_UI_ITEM",item:e,value:t}}function ge(e){return{type:"ADD_ERROR",value:e}}function je(e){return{type:"REMOVE_ERROR",value:e}}(0,wp.data.registerStore)("presto-player/bunny-popup",{reducer:K,selectors:n,actions:a});var we,_e,Ee,Re,ke,Pe,Ce,xe,Se,Ne,Te,De,Be,Ae,Le,Ie,Fe,Ve,Ue,Me,ze,We=function(e){return 3==(null==e?void 0:e.status)&&(null==e?void 0:e.availableResolutions.length)},He=function(e){return We(e)||4===(null==e?void 0:e.status)},Ye=function(e){return 0==(null==e?void 0:e.status)?"Processing":1==(null==e?void 0:e.status)?"Uploaded":2==(null==e?void 0:e.status)?"Processing":We(e)?"Playable":3==(null==e?void 0:e.status)?"Encoding":4==(null==e?void 0:e.status)?"Live":5==(null==e?void 0:e.status)?"Error":6==(null==e?void 0:e.status)?"Upload Failed":void 0},Ge=function(e){return null==e||null==e?"":new Date(1e3*e).toISOString().substr(11,8)},qe=function(e){if(null==e||0==e)return"Unknown";if(0==e)return"0 b";var t=parseInt(Math.floor(Math.log(e)/Math.log(1024)).toString());return(e/Math.pow(1024,t)).toFixed(2)+" "+["b","KB","MB","GB","TB"][t]},Ze=wp.i18n.__,Ke=wp.components,Qe=Ke.Button,Xe=Ke.BaseControl,$e=Ke.Disabled,Je=Ke.Card,et=Ke.CardBody,tt=wp.element,rt=tt.useState,nt=(tt.useContext,tt.useEffect),at=wp.data,ot=at.dispatch,lt=at.useSelect,ct=function(){var e=rt(!1),t=Object(s.a)(e,2),r=t[0],n=t[1],a=rt(!1),o=Object(s.a)(a,2),l=o[0],c=o[1],p=rt(null),d=Object(s.a)(p,2),b=d[0],m=d[1],y=lt((function(e){return e("presto-player/bunny-popup").isPrivate()})),v=lt((function(e){return e("presto-player/bunny-popup").ui("selectedId")})),h=lt((function(e){return e("presto-player/bunny-popup").videos()}));nt((function(){m(v?h.find((function(e){return e.guid===v})):null)}),[h,v]);var O=function(){var e=Object(i.a)(u.a.mark((function e(){return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,wp.apiFetch({path:"presto-player/v1/bunny/stream/videos/".concat(b.id),method:"DELETE",data:{type:y?"private":"public"}});case 2:ot("presto-player/bunny-popup").removeVideo(b),ot("presto-player/bunny-popup").setUI("selectedId",null),c(!1),n(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),j=Object(g.a)(we||(we=Object(f.a)(["\n margin-top: 5px;\n "])));if(!b)return"";var w,_,E,R,k=function(e){return y?null==e?void 0:e.webPURLSigned:null==e?void 0:e.webPURL};return b&&Object(g.b)("div",{className:"presto-player__media-modal-sidebar-content"},Object(g.b)(Xe,{css:Object(g.a)(_e||(_e=Object(f.a)(["\n position: relative;\n "])))},Object(g.b)($e,{key:b.id},He(b)&&k(b)&&Object(g.b)("img",{src:k(b),css:{maxWidth:"100%"}})),Object(g.b)(Qe,{isSmall:!0,isPrimary:!0,isBusy:!He(b),css:Object(g.a)(Ee||(Ee=Object(f.a)(["\n ","\n top: 8px;\n right: 8px;\n font-size: 11px;\n color: #ffffff;\n padding: 2px 10px;\n border-radius: 9999px;\n "])),He(b)?"position: absolute;":"")},Ye(b))),Object(g.b)(Xe,null,Object(g.b)(Xe.VisualLabel,null,Ze("Name","presto-player")),Object(g.b)("h3",{css:j},b.title)),!(null==b||!b.visibility)&&Object(g.b)(Xe,null,Object(g.b)(Xe.VisualLabel,null,Ze("Visibility","presto-player")),Object(g.b)("h3",{css:j},b.visibility)),Object(g.b)(Xe,null,Object(g.b)(Xe.VisualLabel,null,Ze("Size","presto-player")),Object(g.b)("h3",{css:j},qe((null==b?void 0:b.size)||0))),Object(g.b)(Xe,null,Object(g.b)(Xe.VisualLabel,null,Ze("Length","presto-player")),Object(g.b)("h3",{css:j},Ge(null==b?void 0:b.length))),Object(g.b)(Xe,null,Object(g.b)(Xe.VisualLabel,null,Ze("Created","presto-player")),Object(g.b)("h3",{css:j},(w=null==b?void 0:b.created_at,_=(w=new Date(w)).getHours(),E=w.getMinutes(),R=_>=12?"pm":"am",_=(_%=12)||12,E=E<10?"0"+E:E,w.getDate()+"-"+(w.getMonth()+1)+"-"+w.getFullYear()+" at "+_+":"+E+R))),Object(g.b)(Xe,null,r?Object(g.b)(Je,null,Object(g.b)(et,null,Object(g.b)("p",null,Object(g.b)("strong",null,Ze("Are you sure?","presto-player"))),Object(g.b)("p",null,Ze("Are you sure you want to delete this video?","presto-player")),Object(g.b)(Qe,{isDestructive:!0,disabled:l,isBusy:l,onClick:function(e){e.preventDefault(),O(),c(!0)}},Ze("Yes","presto-player")),Object(g.b)(Qe,{onClick:function(){return n(!1)}},Ze("Cancel","presto-player")))):Object(g.b)(Qe,{isDestructive:!0,onClick:function(){n(!r)}},Ze("Delete video","presto-player"))))},it=function(e){var t=e.className,r=e.progress;return Object(g.b)("div",{className:t},Object(g.b)("div",{css:Object(g.a)(Re||(Re=Object(f.a)(["\n height: 100%;\n background-color: var(--wp-admin-theme-color, #007cba);\n "]))),style:{width:"".concat(r,"%")}}))},st=function(e){var t=e.progress;return Object(g.b)("div",{css:Object(g.a)(ke||(ke=Object(f.a)(["\n max-width: 100%;\n object-fit: cover;\n width: 100%;\n height: 140px;\n background-color: #222;\n color: white;\n text-decoration: none;\n text-align: center;\n box-sizing: border-box;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n "])))},Object(g.b)(it,{progress:t,css:Object(g.a)(Pe||(Pe=Object(f.a)(["\n width: 100%;\n border-radius: 0px;\n margin: 0 15px;\n background-color: #e3e3e3;\n height: 3px;\n "])))}))},pt=function(e){var t=e.thumbnail,r=e.title,n=e.footer,a=e.badge,o=e.before,l=e.after;return Object(g.b)("div",Object.assign({className:"presto-player__video-thumb",css:Object(g.a)(Ce||(Ce=Object(f.a)(["\n cursor: pointer;\n user-select: none;\n display: inline-block;\n position: relative;\n margin-right: 20px;\n font-weight: bold;\n margin-bottom: 20px;\n width: 220px;\n flex: 0 0 220px;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n overflow: hidden;\n "])))},e),!!o&&o,!!t&&t,Object(g.b)("div",{css:Object(g.a)(xe||(xe=Object(f.a)(["\n margin: 14px;\n "])))},!!a&&Object(g.b)("div",{css:Object(g.a)(Se||(Se=Object(f.a)(["\n position: absolute;\n top: 8px;\n right: 8px;\n "])))},a),!!r&&Object(g.b)("span",{css:Object(g.a)(Ne||(Ne=Object(f.a)(["\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n width: 100%;\n max-width: 100%;\n display: inline-block;\n margin-bottom: 7px;\n font-size: 13px;\n "])))},r),!!n&&Object(g.b)("div",{css:Object(g.a)(Te||(Te=Object(f.a)(["\n font-size: 12px;\n opacity: 0.75;\n margin-bottom: 7px;\n "])))},n)),!!l&&l)},ut=wp.components,dt=ut.Icon,bt=ut.Button,mt=wp.element,yt=mt.useEffect,vt=mt.useState,ft=wp.data,ht=ft.useSelect,Ot=ft.dispatch,gt=function(e){var t=e.video,r=vt(),n=Object(s.a)(r,2),a=n[0],o=n[1],l=ht((function(e){return e("presto-player/bunny-popup").isPrivate()})),c=ht((function(e){return e("presto-player/bunny-popup").ui("selectedId")}));yt((function(){o(c?c===t.guid:null)}),[c]);return Object(g.b)(pt,{onClick:function(){Ot("presto-player/bunny-popup").setUI("selectedId",null==t?void 0:t.guid)},css:Object(g.a)(Ue||(Ue=Object(f.a)(["\n ","\n border: 1px solid\n ",";\n "])),a&&"box-shadow: 0 0 0 0px #fff, 0 0 0 3px var(--wp-admin-theme-color, #007cba);",a?"var(--wp-admin-theme-color, #007cba)":"#e0e0e0"),thumbnail:function(){if(t.status<3)return Object(g.b)(st,{progress:t.encodeProgress});var e=l?null==t?void 0:t.thumbnailURLSigned:null==t?void 0:t.thumbnailURL;return e?Object(g.b)("img",{css:Object(g.a)(Be||(Be=Object(f.a)(["\n max-width: 100%;\n object-fit: cover;\n width: 100%;\n height: 140px;\n display: block;\n "]))),src:e}):void 0}(),badge:Object(g.b)(bt,{isSmall:!0,isPrimary:!0,isBusy:!He(t),css:Object(g.a)(De||(De=Object(f.a)(["\n font-size: 11px;\n color: #ffffff;\n padding: 2px 10px;\n border-radius: 9999px;\n "])))},Ye(t)),title:t.title,footer:Object(g.b)("div",{css:Object(g.a)(Ae||(Ae=Object(f.a)(["\n display: flex;\n align-items: center;\n "])))},Object(g.b)("span",{css:Object(g.a)(Le||(Le=Object(f.a)(["\n margin-right: 10px;\n display: flex;\n align-items: center;\n "])))},Object(g.b)(dt,{css:Object(g.a)(Ie||(Ie=Object(f.a)(["\n width: 14px;\n height: 14px;\n font-size: 14px;\n margin-right: 5px;\n opacity: 0.5;\n "]))),icon:"clock",size:14}),Object(g.b)("span",null,Ge(t.length))),Object(g.b)("span",{css:Object(g.a)(Fe||(Fe=Object(f.a)(["\n display: flex;\n align-items: center;\n "])))},Object(g.b)(dt,{css:Object(g.a)(Ve||(Ve=Object(f.a)(["\n opacity: 0.5;\n width: 14px;\n height: 14px;\n font-size: 14px;\n margin-right: 5px;\n "]))),icon:"database",size:14}),Object(g.b)("span",null,qe(t.storageSize)))),after:3===t.status?Object(g.b)(it,{css:Object(g.a)(Me||(Me=Object(f.a)(["\n width: 100%;\n border-radius: 0px;\n margin: 0;\n background-color: #e3e3e3;\n height: 3px;\n "]))),progress:t.encodeProgress}):""})},jt=wp.components,wt=jt.Flex,_t=jt.FlexBlock,Et=jt.Spinner,Rt=function(e){var t=e.className;return Object(g.b)(wt,{className:t},Object(g.b)(_t,{css:{textAlign:"center"}},Object(g.b)(Et,null)))};function kt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kt(Object(r),!0).forEach((function(t){Object(c.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ct,xt,St,Nt,Tt,Dt,Bt,At,Lt,It,Ft=wp.i18n.__,Vt=wp.element,Ut=Vt.useState,Mt=Vt.useEffect,zt=Vt.Fragment,Wt=wp.components,Ht=Wt.Flex,Yt=Wt.FormFileUpload,Gt=Wt.Notice,qt=wp.data,Zt=qt.dispatch,Kt=qt.useSelect,Qt=function(){var e=Ut(!1),t=Object(s.a)(e,2),r=t[0],n=t[1],a=Ut(""),o=Object(s.a)(a,2),l=o[0],c=o[1],p=Kt((function(e){return e("presto-player/bunny-popup").videosFetched()})),d=Kt((function(e){return e("presto-player/bunny-popup").videos()})),b=Kt((function(e){return e("presto-player/bunny-popup").requestType()})),m=Kt((function(e){return e("presto-player/bunny-popup").currentCollection()}));Mt((function(){p||y()}),[p]),Mt((function(){var e=setInterval((function(){y({sync:!0})}),3e3);return function(){return clearInterval(e)}}),[p]);var y=function(){var e=Object(i.a)(u.a.mark((function e(){var t,r,n,a,o=arguments;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{sync:!1},r=t.sync,e.prev=1,e.next=4,wp.apiFetch({path:wp.url.addQueryArgs("presto-player/v1/bunny/stream/videos",Pt(Pt({type:b},null!=m&&m.guid?{collection:null==m?void 0:m.guid}:{}),{},{items_per_page:500}))});case 4:n=e.sent,Zt("presto-player/bunny-popup").setVideos(null==n?void 0:n.items),c(""),e.next=15;break;case 9:if(e.prev=9,e.t0=e.catch(1),401!==(null===e.t0||void 0===e.t0||null===(a=e.t0.data)||void 0===a?void 0:a.status)){e.next=14;break}return c(Ft("Please wait. Pullzone cache is clearing. This may take a minute or two...")),e.abrupt("return");case 14:r||Zt("presto-player/bunny-popup").addError(e.t0.message);case 15:return e.prev=15,Zt("presto-player/bunny-popup").setVideosFetched(!0),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[1,9,15,18]])})));return function(){return e.apply(this,arguments)}}();return l?Object(g.b)(Gt,{status:"warning",isDismissible:!1},Object(g.b)("div",{css:{display:"flex",alignItems:"center"}},Object(g.b)(Rt,{css:{flex:1}}),l)):p?Object(g.b)(zt,null,d&&d.length?Object(g.b)("div",null,!(null!=m&&m.guid)&&Object(g.b)("h2",null,Ft("Videos","presto-player")),d.map((function(e){if((null==e?void 0:e.collectionId)===((null==m?void 0:m.guid)||""))return Object(g.b)(gt,{key:e.id,video:e,onClick:function(){n(r.guid===e.guid?{}:e)},selected:r.guid===e.guid})}))):Object(g.b)(Ht,{align:"center",justify:"center",css:Object(g.a)(ze||(ze=Object(f.a)(["\n height: 100%;\n text-align: center;\n "])))},Object(g.b)("div",null,Object(g.b)("h2",null,Ft("Drop video files here to upload","presto-player")),Object(g.b)("p",null,Ft("or browse for a video","presto-player")),Object(g.b)(Yt,{isSecondary:!0,accept:"video/mp4,video/x-m4v,video/*",onChange:function(e){e.target.files&&(Zt("presto-player/bunny-popup").addUploads(e.target.files),jQuery(e.target).val(null))}},Ft("Upload New Video","presto-player"))))):Object(g.b)(Rt,{css:{flex:1}})},Xt=wp.components.Icon,$t=wp.data.dispatch,Jt=function(e){var t=e.collection;return Object(g.b)(pt,{onClick:function(e){e.preventDefault(),$t("presto-player/bunny-popup").setCollectionRequest(t),$t("presto-player/bunny-popup").setVideosFetched(!1)},title:Object(g.b)("div",null,Object(g.b)(Xt,{icon:"open-folder",css:Object(g.a)(Ct||(Ct=Object(f.a)(["\n color: var(--wp-admin-theme-color);\n margin-right: 10px;\n "])))}),t.name),footer:Object(g.b)("div",null,t.videoCount," Videos")})},er=wp.i18n.__,tr=wp.element.useEffect,rr=wp.data,nr=rr.useSelect,ar=rr.dispatch,or=function(){var e=nr((function(e){return e("presto-player/bunny-popup").collections()})),t=nr((function(e){return e("presto-player/bunny-popup").requestType()})),r=function(){var e=Object(i.a)(u.a.mark((function e(){var r,n;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,wp.apiFetch({path:wp.url.addQueryArgs("presto-player/v1/bunny/stream/collections",{type:t})});case 3:r=e.sent,ar("presto-player/bunny-popup").setCollections(null==r?void 0:r.items),e.next=12;break;case 7:if(e.prev=7,e.t0=e.catch(0),401!==(null===e.t0||void 0===e.t0||null===(n=e.t0.data)||void 0===n?void 0:n.status)){e.next=11;break}return e.abrupt("return");case 11:ar("presto-player/bunny-popup").addError(e.t0.message);case 12:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}();return tr((function(){r()}),[]),!!e.length&&Object(g.b)("div",null,Object(g.b)("h2",null,er("Collections","presto-player")),Object(g.b)("div",{css:Object(g.a)(xt||(xt=Object(f.a)(["\n display: flex;\n align-items: stretch;\n overflow: auto;\n "])))},e.map((function(e){return Object(g.b)(Jt,{collection:e,key:e.guid})}))))},lr=wp.i18n.__,cr=wp.components,ir=cr.Button,sr=cr.TextControl,pr=cr.Modal,ur=cr.BaseControl,dr=wp.element,br=dr.useState,mr=dr.Fragment,yr=wp.data,vr=yr.dispatch,fr=yr.useSelect,hr=function(){var e=br(""),t=Object(s.a)(e,2),r=t[0],n=t[1],a=br(!1),o=Object(s.a)(a,2),l=o[0],c=o[1],p=fr((function(e){return e("presto-player/bunny-popup").requestType()})),d=fr((function(e){return e("presto-player/bunny-popup").ui("createCollection")})),b=function(e){vr("presto-player/bunny-popup").setUI("createCollection",e)},m=function(){var e=Object(i.a)(u.a.mark((function e(){var t;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/bunny/stream/collections",method:"POST",data:{type:p,name:r}});case 4:t=e.sent,vr("presto-player/bunny-popup").addCollection(t),vr("presto-player/bunny-popup").setCollectionRequest(t),vr("presto-player/bunny-popup").setVideosFetched(!1),n(""),b(!1),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),console.error(e.t0);case 15:return e.prev=15,c(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[1,12,15,18]])})));return function(){return e.apply(this,arguments)}}();return Object(g.b)(mr,null,Object(g.b)(ir,{isSecondary:!0,onClick:function(){return b(!0)}},lr("Create Collection","presto-player")),d&&Object(g.b)(pr,{overlayClassName:"presto-modal",title:"Create New Collection",shouldCloseOnClickOutside:!1,isDismissible:!1},Object(g.b)(sr,{css:Object(g.a)(St||(St=Object(f.a)(["\n margin-bottom: 15px;\n "]))),tabIndex:"0",placeholder:lr("Enter a collection name","presto-player"),value:r,onChange:function(e){return n(e)}}),Object(g.b)(ur,null,Object(g.b)(ir,{isBusy:l,disabled:l,isPrimary:!0,onClick:function(){m()}},lr("Create","presto-player"))," ",Object(g.b)(ir,{onClick:function(){return b(!1)}},lr("Cancel","presto-player")))))},Or=wp.i18n.__,gr=wp.components,jr=gr.Flex,wr=gr.FlexBlock,_r=gr.FlexItem,Er=(gr.Button,gr.FormFileUpload),Rr=wp.data.dispatch,kr=function(e){var t=e.afterUpload;return Object(g.b)(jr,null,Object(g.b)(wr,null,Object(g.b)(jr,{justify:"flex-start"},Object(g.b)(Er,{multiple:!0,isPrimary:!0,accept:"video/mp4,video/x-m4v,video/*",onChange:function(e){e.target.files&&(Rr("presto-player/bunny-popup").addUploads(e.target.files),jQuery(e.target).val(null))}},Or("Upload Videos","presto-player"))," ",Object(g.b)(hr,null),!!t&&t)),Object(g.b)(_r,null))},Pr=wp.i18n.__,Cr=wp.components.Button,xr=wp.element,Sr=xr.useState,Nr=xr.useEffect,Tr=wp.data.useSelect,Dr=function(e){var t=e.onChoose,r=Sr(null),n=Object(s.a)(r,2),a=n[0],o=n[1],l=Sr(!1),c=Object(s.a)(l,2),i=c[0],p=c[1],u=Tr((function(e){return e("presto-player/bunny-popup").ui("selectedId")})),d=Tr((function(e){return e("presto-player/bunny-popup").videos()}));return Nr((function(){o(u?d.find((function(e){return e.guid===u})):null)}),[d,u]),Nr((function(){3==(null==a?void 0:a.status)&&null!=a&&a.availableResolutions.length?p(!0):p((null==a?void 0:a.status)>3&&(null==a?void 0:a.status)<5)}),[null==a?void 0:a.availableResolutions]),React.createElement(Cr,{isPrimary:!0,disabled:!i,onClick:function(){return t(a)}},null!=a&&a.id&&!i?Pr("Please wait, video is encoding...","presto-player"):Pr("Choose","presto-player"))},Br=wp.components.Icon,Ar=function(e){var t=e.children,r=e.onClick;return Object(g.b)("span",{onClick:r,css:Object(g.a)(Nt||(Nt=Object(f.a)(["\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n color: var(--wp-admin-theme-color, #007cba);\n padding: 6px 0;\n "])))},Object(g.b)(Br,{css:Object(g.a)(Tt||(Tt=Object(f.a)(["\n width: 14px;\n height: 14px;\n font-size: 14px;\n margin-right: 5px;\n "]))),icon:"arrow-left-alt",size:14}),Object(g.b)("span",null,t))},Lr=wp.i18n.__,Ir=wp.element.useState,Fr=wp.data,Vr=Fr.dispatch,Ur=Fr.useSelect,Mr=wp.components,zr=Mr.Button,Wr=Mr.Modal,Hr=Mr.BaseControl,Yr=function(){var e=Ir(!1),t=Object(s.a)(e,2),r=t[0],n=t[1],a=Ir(!1),o=Object(s.a)(a,2),l=o[0],c=o[1],p=Ir(""),d=Object(s.a)(p,2),b=(d[0],d[1],Ur((function(e){return e("presto-player/bunny-popup").currentCollection()}))),m=Ur((function(e){return e("presto-player/bunny-popup").requestType()})),y=function(){var e=Object(i.a)(u.a.mark((function e(){return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/bunny/stream/collections/".concat(null==b?void 0:b.guid),method:"DELETE",data:{type:m}});case 4:n(!1),Vr("presto-player/bunny-popup").setCollectionRequest(""),Vr("presto-player/bunny-popup").setVideosFetched(!1),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(1),n(!1),Vr("presto-player/bunny-popup").addError(e.t0.message);case 13:return e.prev=13,c(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,9,13,16]])})));return function(){return e.apply(this,arguments)}}();return Object(g.b)("div",{css:Object(g.a)(Dt||(Dt=Object(f.a)(["\n margin-bottom: 2em;\n display: flex;\n align-items: center;\n justify-content: space-between;\n "])))},Object(g.b)("div",null,Object(g.b)(Ar,{onClick:function(){Vr("presto-player/bunny-popup").setCollectionRequest(""),Vr("presto-player/bunny-popup").setVideosFetched(!1)}},Lr("Back To Main Folder","presto-player")),Object(g.b)("h2",null,b.name)),Object(g.b)(zr,{isDestructive:!0,onClick:function(){return n(!0)}},Lr("Delete Collection","presto-player")),r&&Object(g.b)(Wr,{shouldCloseOnClickOutside:!1,overlayClassName:"presto-modal",title:"Delete Collection",onRequestClose:function(){return n(!1)}},Object(g.b)("h2",null,Lr("Are you sure you want to delete the collection? ","presto-player")),Object(g.b)("p",null,Lr("This will also delete all videos inside of the collection.","presto-player")),Object(g.b)(Hr,null,Object(g.b)(zr,{isDestructive:!0,disabled:l,isBusy:l,onClick:y},Lr("Delete","presto-player"))," ",Object(g.b)(zr,{onClick:function(){return n(!1)}},Lr("Cancel","presto-player")))))};function Gr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function qr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gr(Object(r),!0).forEach((function(t){Object(c.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}wp.components.Icon;var Zr,Kr,Qr,Xr,$r,Jr,en,tn,rn,nn,an,on,ln,cn=wp.element,sn=cn.useState,pn=cn.useEffect,un=(cn.useContext,wp.data),dn=un.useSelect,bn=(un.dispatch,wp.i18n.__),mn=function(e){var t,r=e.file,n=e.name,a=e.onComplete,o=sn(0),l=Object(s.a)(o,2),c=l[0],p=l[1],d=sn(bn("Uploading","presto-player")),b=Object(s.a)(d,2),m=(b[0],b[1]),y=sn(""),h=Object(s.a)(y,2),O=h[0],j=h[1],w=sn(!1),_=Object(s.a)(w,2),E=_[0],R=_[1],k=dn((function(e){return e("presto-player/bunny-popup").requestType()})),P=dn((function(e){return e("presto-player/bunny-popup").currentCollection()})),C=function(){var e=Object(i.a)(u.a.mark((function e(){return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:m(bn("Uploading","presto-player")),t=v({file:null!=r&&r[0]?null==r?void 0:r[0]:r,path:"presto-player/v1/bunny/stream/upload",onProgress:function(e){p(e)},onComplete:x,onError:function(e){j(e.message),m(bn("Error","presto-player")),p(0)}});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),x=function(){var e=Object(i.a)(u.a.mark((function e(t){var r,n,a;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.path,n=t.name,m(bn("Creating","presto-player")),e.prev=2,e.next=5,wp.apiFetch({path:"presto-player/v1/bunny/stream/videos",method:"POST",data:qr({type:k,name:n},null!=P&&P.guid?{collection:P.guid}:{})});case 5:a=e.sent,R(!0),S({path:r,video:a}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),j(e.t0.message);case 13:return e.prev=13,p(0),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[2,10,13,16]])})));return function(t){return e.apply(this,arguments)}}(),S=function(){var e=Object(i.a)(u.a.mark((function e(t){var r,n;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.path,n=t.video,e.next=3,wp.apiFetch({path:"presto-player/v1/bunny/stream/store",method:"POST",data:{type:k,path:r,guid:n.guid}});case 3:a();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return pn((function(){return C(),function(){t&&t.cancel()}}),[]),E?"":Object(g.b)("div",{css:Object(g.a)(Bt||(Bt=Object(f.a)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n animation: components-button__busy-animation 2500ms infinite linear;\n opacity: 1;\n padding: 6px 12px;\n border-radius: 99999px;\n border: 1px solid #dddddd;\n background-size: 100px 100%;\n background-image: linear-gradient(\n -45deg,\n #ffffff 33%,\n #f3f3f3 33%,\n #f3f3f3 70%,\n #ffffff 70%\n );\n "])))},Object(g.b)("div",{css:Object(g.a)(At||(At=Object(f.a)(["\n flex: 1;\n white-space: nowrap;\n overflow: hidden;\n max-width: 150px;\n text-overflow: ellipsis;\n font-weight: bold;\n "])))},!!O&&O,!!n&&n," ",r.name,"..."),Object(g.b)("div",{css:Object(g.a)(Lt||(Lt=Object(f.a)(["\n display: flex;\n align-items: center;\n "])))},Object(g.b)(it,{css:Object(g.a)(It||(It=Object(f.a)(["\n width: 50px;\n height: 3px;\n margin: 0 5px;\n background: #e3e3e3;\n border-radius: 9999px;\n overflow: hidden;\n "]))),progress:c})))},yn=wp.data.useSelect,vn=function(e){var t=e.removeUpload,r=(e.isPrivate,yn((function(e){return e("presto-player/bunny-popup").uploads()})));return r.length?Object(g.b)("div",{css:Object(g.a)(Zr||(Zr=Object(f.a)(["\n overflow: auto;\n display: flex;\n align-items: center;\n position: relative;\n "])))},r.length&&r.map((function(e){return Object(g.b)(mn,{css:Object(g.a)(Kr||(Kr=Object(f.a)(["\n margin-right: 0px;\n "]))),file:e,onComplete:function(){return t(e)}})}))):""},fn=wp.i18n.__,hn=wp.components.Modal,On=function(e){var t=e.onClose,r=e.title,n=e.header,a=e.error,o=e.mainContent,l=e.sidebar,c=e.footer;return Object(g.b)(hn,{title:r||fn("Add Media","presto-player"),onRequestClose:t,css:Object(g.a)(Qr||(Qr=Object(f.a)(["\n width: 100%;\n height: 100%;\n max-width: calc(100% - 32px);\n max-height: calc(100% - 32px);\n\n .components-modal__content {\n position: relative;\n display: flex;\n flex-direction: column;\n }\n "]))),overlayClassName:"presto-player__modal-overlay"},Object(g.b)("div",{css:Object(g.a)(Xr||(Xr=Object(f.a)(['\n @media screen and (min-width: 780px) {\n margin: -24px;\n display: grid;\n flex: 1;\n max-height: calc(100vh - 68px);\n grid-template-columns: 1fr 1fr minmax(0px, 267px);\n grid-template-rows: minmax(50px, auto) 1fr 60px;\n grid-template-areas:\n "header header sidebar"\n "main main sidebar"\n "footer footer footer";\n overflow: hidden;\n }\n ']))),"data-cy":"media-modal"},Object(g.b)("div",{css:Object(g.a)($r||($r=Object(f.a)(["\n grid-area: header;\n padding: 24px 24px 12px 24px;\n "])))},Object(g.b)("div",{css:Object(g.a)(Jr||(Jr=Object(f.a)(["\n display: flex;\n align-items: center;\n\n > * {\n margin-right: 10px;\n }\n "])))},n),a),Object(g.b)("div",{css:Object(g.a)(en||(en=Object(f.a)(["\n grid-area: main;\n display: grid;\n overflow: hidden;\n\n .components-drop-zone__provider {\n overflow: hidden;\n display: grid;\n }\n\n .components-drop-zone {\n z-index: 99;\n }\n "])))},o),Object(g.b)("div",{css:Object(g.a)(tn||(tn=Object(f.a)(["\n display: none;\n grid-area: sidebar;\n padding: 0 16px;\n z-index: 75;\n background: #f3f3f3;\n border-left: 1px solid #ddd;\n overflow: auto;\n\n @media screen and (min-width: 780px) {\n display: block;\n }\n\n .sidebar-content {\n padding: 16px 0;\n }\n "])))},l),Object(g.b)("div",{css:Object(g.a)(rn||(rn=Object(f.a)(["\n grid-area: footer;\n border-top: 1px solid #ddd;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n padding: 8px;\n "])))},c)))},gn=wp.i18n.__,jn=wp.components,wn=(jn.Button,jn.DropZone),_n=jn.DropZoneProvider,En=jn.Notice,Rn=wp.element,kn=(Rn.useState,Rn.useEffect),Pn=(Rn.Fragment,wp.data),Cn=Pn.dispatch,xn=Pn.useSelect,Sn=function(e){var t=e.onClose,r=e.onChoose,n=xn((function(e){return e("presto-player/bunny-popup").isPrivate()})),a=xn((function(e){return e("presto-player/bunny-popup").uploads()})),o=xn((function(e){return e("presto-player/bunny-popup").currentCollection()})),l=xn((function(e){return e("presto-player/bunny-popup").errors()}));kn((function(){Cn("presto-player/bunny-popup").setVideosFetched(!1),Cn("presto-player/bunny-popup").setCollections([]),Cn("presto-player/bunny-popup").setVideos([])}),[]);var c=function(e){Cn("presto-player/bunny-popup").addUploads(e)},i=gn(n?"Private Stream Library":"Public Stream Library","presto-player"),s=Object(g.b)(kr,{afterUpload:Object(g.b)(vn,{uploads:a,removeUpload:function(e){Cn("presto-player/bunny-popup").removeUpload(e)},isPrivate:n})}),p=Object(g.b)(ct,null),u=Object(g.b)(Dr,{onChoose:r});return Object(g.b)(On,{title:i,header:s,mainContent:Object(g.b)(_n,{css:Object(g.a)(nn||(nn=Object(f.a)(["\n overflow: auto;\n display: flex;\n flex-direction: column;\n "])))},Object(g.b)("div",{css:Object(g.a)(an||(an=Object(f.a)(["\n padding: 12px 24px;\n overflow: auto;\n display: flex;\n flex-direction: column;\n "])))},!!l.length&&l.map((function(e){return Object(g.b)(En,{css:Object(g.a)(on||(on=Object(f.a)(["\n margin: 0 0 20px 0;\n "]))),status:"error",onRemove:function(){return Cn("presto-player/bunny-popup").removeError(e)}},e)})),o?Object(g.b)(Yr,null):Object(g.b)(or,null),Object(g.b)("div",{css:Object(g.a)(ln||(ln=Object(f.a)(["\n display: flex;\n align-items: stretch;\n "])))},Object(g.b)(Qt,null)),Object(g.b)(wn,{label:"Drop files",onFilesDrop:c}))),onClose:function(){a.length?confirm("Discard your uploads?")&&(t(),Cn("presto-player/bunny-popup").setUploads([])):t()},footer:u,sidebar:p})},Nn=wp.i18n.__,Tn=wp.element.useEffect,Dn=wp.data.dispatch,Bn=function(e){var t=e.closePopup,r=e.onSelect,n=e.isPrivate;return Tn((function(){Dn("presto-player/bunny-popup").setIsPrivate(n)}),[n]),React.createElement(Sn,{onClose:t,onChoose:function(e){e.url=e.playlistURL,e.thumbnail=e.thumbnailURL,e.preview=e.webPURL,r(e)},header:Nn(n?"Private Stream Library":"Public Stream Library","presto-player"),title:Nn(n?"Private Video Stream":"Public Video Stream","presto-player")})},An=wp.i18n.__,Ln=wp.element.useState,In="".concat(prestoPlayer.root).concat(prestoPlayer.prestoVersionString,"bunny/"),Fn=wp.i18n.__,Vn=wp.element.useState,Un="".concat(prestoPlayer.root).concat(prestoPlayer.prestoVersionString,"bunny/stream/"),Mn=wp.i18n.__,zn=wp.components,Wn=zn.Button,Hn=zn.TextControl,Yn=zn.Placeholder,Gn=zn.Flex,qn=zn.FlexBlock,Zn=zn.ExternalLink,Kn=zn.Spinner,Qn=zn.FlexItem,Xn=zn.Notice,$n=wp.element.useEffect,Jn=function(e){var t=e.onRefetch,r=e.type,n=e.autoSubmit,a="stream"===r?function(e){var t=Vn(""),r=Object(s.a)(t,2),n=r[0],a=r[1],o=Vn(""),l=Object(s.a)(o,2),c=l[0],p=l[1],d=Vn(!1),b=Object(s.a)(d,2),m=b[0],y=b[1],v=Vn(0),f=Object(s.a)(v,2),h=f[0],O=f[1],g=Vn(""),j=Object(s.a)(g,2),w=j[0],_=j[1],E=function(e){return e.includes("Authorization has been denied")?"Your API key is incorrect. Please double-check to make sure you've copied it correctly.":e.includes("localhost")?"You cannot use a CDN on a local site. Please use Bunny.net on a live, publicly accessible site.":e};return{saveKey:function(){var t=Object(i.a)(u.a.mark((function t(){var r,a;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return _(""),t.prev=1,y(!0),O(0),p(Fn("Validating API Key...","presto-player")),t.next=7,wp.apiFetch({url:"".concat(Un,"api-key"),method:"POST",data:{api_key:n}});case 7:if(r=t.sent,r.success){t.next=11;break}throw{message:"Could not save the API key. Please double check it to make sure it's correct."};case 11:t.next=18;break;case 13:return t.prev=13,t.t0=t.catch(1),O(0),_(null!==t.t0&&void 0!==t.t0&&t.t0.message?E(t.t0.message):"Something went wrong. Please try again"),t.abrupt("return");case 18:return t.prev=18,O(1),y(!1),p(""),t.finish(18);case 23:return t.prev=23,y(!0),p(Fn("Setting up public video library. This make take a few moments...","presto-player")),t.next=28,wp.apiFetch({url:"".concat(Un,"library"),method:"POST",data:{type:"public"}});case 28:a=t.sent,a.id,t.next=37;break;case 32:return t.prev=32,t.t1=t.catch(23),O(0),_(null!==t.t1&&void 0!==t.t1&&t.t1.message?E(t.t1.message):"Something went wrong. Please try again"),t.abrupt("return");case 37:return t.prev=37,O(2),y(!1),p(""),t.finish(37);case 42:return t.prev=42,y(!0),p(Fn("Setting up private video library. This make take a few moments...","presto-player")),t.next=47,wp.apiFetch({url:"".concat(Un,"library"),method:"POST",data:{type:"private"}});case 47:t.next=54;break;case 49:return t.prev=49,t.t2=t.catch(42),O(0),_(null!==t.t2&&void 0!==t.t2&&t.t2.message?E(t.t2.message):"Something went wrong. Please try again"),t.abrupt("return");case 54:return t.prev=54,O(2),y(!1),p(""),t.finish(54);case 59:e();case 60:case"end":return t.stop()}}),t,null,[[1,13,18,23],[23,32,37,42],[42,49,54,59]])})));return function(){return t.apply(this,arguments)}}(),setApikey:a,step:h,saveMessage:c,saving:m,error:w,totalSteps:3}}(t):function(e){var t=Ln(""),r=Object(s.a)(t,2),n=r[0],a=r[1],o=Ln(""),l=Object(s.a)(o,2),c=l[0],p=l[1],d=Ln(!1),b=Object(s.a)(d,2),m=b[0],y=b[1],v=Ln(0),f=Object(s.a)(v,2),h=f[0],O=f[1],g=Ln(""),j=Object(s.a)(g,2),w=j[0],_=j[1],E=function(e){return e.includes("Authorization has been denied")?"Your API key is incorrect. Please double-check to make sure you've copied it correctly.":e.includes("localhost")?"You cannot use a CDN on a local site. Please use Bunny.net on a live, publicly accessible site.":e};return{saveKey:function(){var t=Object(i.a)(u.a.mark((function t(){var r,a,o;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return _(""),t.prev=1,y(!0),O(0),p(An("Validating API Key...","presto-player")),t.next=7,wp.apiFetch({url:"".concat(In,"api-key"),method:"POST",data:{api_key:n}});case 7:if(r=t.sent,r.success){t.next=11;break}throw{message:"Could not save the API key. Please double check it to make sure it's correct."};case 11:t.next=18;break;case 13:return t.prev=13,t.t0=t.catch(1),O(0),_(null!==t.t0&&void 0!==t.t0&&t.t0.message?E(t.t0.message):"Something went wrong. Please try again"),t.abrupt("return");case 18:return t.prev=18,O(1),y(!1),p(""),t.finish(18);case 23:return t.prev=23,y(!0),p(An("Setting up storage zones. This make take a few minutes...","presto-player")),t.next=28,wp.apiFetch({url:"".concat(In,"storage-zones"),method:"POST"});case 28:a=t.sent,a.id,t.next=37;break;case 32:return t.prev=32,t.t1=t.catch(23),O(0),_(null!==t.t1&&void 0!==t.t1&&t.t1.message?E(t.t1.message):"Something went wrong. Please try again"),t.abrupt("return");case 37:return t.prev=37,O(2),y(!1),p(""),t.finish(37);case 42:return t.prev=42,y(!0),p(An("Setting up pull zones. This make take a few minutes...","presto-player")),t.next=47,wp.apiFetch({url:"".concat(In,"pull-zones"),method:"POST"});case 47:o=t.sent,o.id,t.next=56;break;case 51:return t.prev=51,t.t2=t.catch(42),O(0),_(null!==t.t2&&void 0!==t.t2&&t.t2.message?E(t.t2.message):"Something went wrong. Please try again"),t.abrupt("return");case 56:return t.prev=56,O(3),y(!1),p(""),t.finish(56);case 61:e();case 62:case"end":return t.stop()}}),t,null,[[1,13,18,23],[23,32,37,42],[42,51,56,61]])})));return function(){return t.apply(this,arguments)}}(),setApikey:a,step:h,saveMessage:c,saving:m,error:w,totalSteps:3}}(t),o=a.saveKey,l=a.apikey,c=a.setApikey,p=a.saveMessage,d=a.saving,b=a.totalSteps,m=a.step,y=a.error;return $n((function(){n&&o()}),[n]),React.createElement(Yn,{label:Mn("Bunny.net Video","presto-player"),instructions:React.createElement(React.Fragment,null,Mn("Enter your Bunny.net API key, which can be found on your Bunny CDN Account page.","presto-player")," ",React.createElement(Zn,{href:"https://bunnycdn.com/dashboard/account"},Mn("Get My API Key","presto-player")))},d?React.createElement(Gn,null,React.createElement(Qn,null,React.createElement(Kn,null)),React.createElement(qn,null,p,React.createElement("progress",{className:"presto-progress",max:b,value:m,style:{width:"100%"}}))):React.createElement("form",{onSubmit:function(e){e.preventDefault(),o()}},y&&React.createElement(Gn,{style:{width:"100%"}},React.createElement(qn,null,React.createElement(Xn,{status:"error",isDismissible:!1},y))),React.createElement(Gn,{style:{width:"100%",maxWidth:"400px"}},React.createElement(qn,null,React.createElement(Hn,{value:l,onChange:function(e){return c(e)},className:"presto-link-placeholder-input",type:"password",autoComplete:"off",placeholder:Mn("Your Bunny.net API Key","presto-player"),required:!0})),React.createElement(Qn,null,React.createElement(Wn,{isPrimary:!0,style:{marginBottom:"8px"},type:"submit"},Mn("Next","presto-player")," →")))))},ea=r(22),ta=r(14);function ra(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function na(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ra(Object(r),!0).forEach((function(t){Object(c.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ra(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var aa=wp.components,oa=aa.Button,la=aa.Disabled,ca=aa.DropdownMenu,ia=aa.Spinner,sa=aa.Toolbar,pa=aa.withNotices,ua=aa.BaseControl,da=aa.Placeholder,ba=aa.ToggleControl,ma=wp.editor,ya=ma.BlockControls,va=ma.InspectorControls,fa=wp.i18n.__,ha=wp.compose.compose,Oa=wp.element,ga=Oa.useEffect,ja=Oa.useState,wa=Oa.Fragment,_a=wp.data.dispatch,Ea=ha([Object(m.a)(),Object(b.a)()])(pa((function(e){var t,r,n=e.attributes,a=e.setAttributes,o=e.noticeOperations,l=e.branding,c=(e.isSelected,e.presetData),p=e.createVideo,b=e.lockSave,m=e.unlockSave,v=e.onRemoveSrc,f=e.renderKey,h=e.defaultPreset,O=n.poster,g=n.src,j=n.id,w=n.tracks,_=n.visibility,E=n.previewSrc,R=n.thumbnail,k=ja(""),P=Object(s.a)(k,2),C=P[0],x=P[1],S=ja(!1),N=Object(s.a)(S,2),T=N[0],D=N[1],B=ja(""),A=Object(s.a)(B,2),L=A[0],I=A[1],F=ja({stream:!1,storage:!1}),V=Object(s.a)(F,2),U=V[0],M=V[1],z=ja(!1),W=Object(s.a)(z,2),H=W[0],G=W[1],q=ja(!1),Z=Object(s.a)(q,2),K=Z[0],Q=Z[1],X=ja(!1),$=Object(s.a)(X,2),J=($[0],$[1]),ee=ja(!1),te=Object(s.a)(ee,2),re=te[0],ne=te[1],ae=wp.data.useSelect((function(e){return e("core").canUser("read","settings")})),oe="private"===_,le=null===(t=prestoPlayerAdmin)||void 0===t||null===(r=t.bunny)||void 0===r?void 0:r.disable_legacy_storage;function ce(e){e.url?(a(na(na({src:e.url,preset:null==h?void 0:h.id},null!=e&&e.thumbnail?{thumbnail:e.thumbnail}:{}),null!=e&&e.preview?{preview:e.preview}:{})),D(!0),b(),p(na({src:e.url,type:"bunny",title:e.title},null!=e&&e.guid?{external_id:e.guid}:{})).catch((function(e){a({src:""}),console.error(e)})).finally((function(){m(),D(!1)}))):a({src:void 0,id:void 0})}ga((function(){_a("presto-player/bunny-popup").setIsPrivate("private"===_)}),[_]),ga((function(){var e,t,r,n,a,o;M({storage:null===(e=prestoPlayerAdmin)||void 0===e||null===(t=e.isSetup)||void 0===t||null===(r=t.bunny)||void 0===r?void 0:r.storage,stream:null===(n=prestoPlayerAdmin)||void 0===n||null===(a=n.isSetup)||void 0===a||null===(o=a.bunny)||void 0===o?void 0:o.stream})}),[]);var ie=function(){var e=Object(i.a)(u.a.mark((function e(){var t,r,n,a,o,l,c,i;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,wp.apiFetch({path:"wp/v2/settings"});case 3:t=e.sent,r=t.presto_player_bunny_pull_zones,n=t.presto_player_bunny_storage_zones,a=t.presto_player_bunny_stream_private,o=t.presto_player_bunny_stream_public,Q(!0),a||G(!0),c=(l=function(e){return!(null==e||!e.private_id||null==e||!e.public_id)})(r)||l(n),i=(null==a?void 0:a.pull_zone_url)&&(null==o?void 0:o.pull_zone_url),M({storage:c,stream:i}),I(c||i?"":"stream");case 15:return e.prev=15,J(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[0,,15,18]])})));return function(){return e.apply(this,arguments)}}();ga((function(){ae?ie():Q(!0)}),[ae]);var se=function(){var e=Object(i.a)(u.a.mark((function e(){var t;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!oe){e.next=7;break}return e.next=3,d(g);case 3:t=e.sent,a({previewSrc:t}),e.next=8;break;case 7:a({previewSrc:g});case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();ga((function(){se()}),[g]);var pe=function(){var e=Object(i.a)(u.a.mark((function e(){var t;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!oe){e.next=7;break}return e.next=3,d(R);case 3:(t=e.sent)&&a({previewThumbnail:t}),e.next=8;break;case 7:a({previewThumbnail:R});case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();ga((function(){pe()}),[R]);var ue=function(){var e=[];return!H&&e.push({title:U.stream?fa("Reconnect Stream","presto-player"):fa("Connect Stream","presto-player"),onClick:function(){I("stream"),ne(!1)}}),!le&&e.push({title:U.storage?fa("Reconnect Storage (Classic)","presto-player"):fa("Connect Storage (Classic)","presto-player"),onClick:function(){return I("storage")}}),React.createElement(ca,{icon:"ellipsis",label:fa("Connection Options","presto-player"),controls:e})};return T||!K?React.createElement(da,{className:"presto-player__placeholder is-loading"},React.createElement(ia,null)):"stream"===L?React.createElement(Jn,{type:"stream",autoSubmit:re,onRefetch:function(){Q(!1),ie()}}):"storage"===L?React.createElement(Jn,{type:"storage",onRefetch:function(){Q(!1),ie()}}):j?React.createElement(React.Fragment,null,React.createElement(ya,null,React.createElement(y.a,{tracks:w,onChange:function(e){a({tracks:e})}}),React.createElement(sa,null,React.createElement(oa,{onClick:function(){return v()}},fa("Replace","presto-player")))),React.createElement(va,null,React.createElement(ea.a,{setAttributes:a,attributes:n})),React.createElement("figure",{className:"wp-block-video"},React.createElement(la,null,React.createElement(ta.a,{poster:O,src:E,id:j,type:"bunny",attributes:n,setAttributes:a,preset:c,branding:l,key:f})))):React.createElement("div",null,React.createElement(da,{label:fa(oe?"Bunny.net Private Video":"Bunny.net Video","presto-player"),icon:oe?React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})):React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("polyline",{points:"8 17 12 21 16 17"}),React.createElement("line",{x1:"12",y1:"12",x2:"12",y2:"21"}),React.createElement("path",{d:"M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29"})),instructions:React.createElement(React.Fragment,null,fa("Add or select a Bunny.net video","presto-player"))},React.createElement(ua,{className:"presto-player__placeholder-control"},React.createElement(ba,{label:"Private Video",help:oe?"Video is only accessible to those who are logged in.":"Video is accessible to everyone.",checked:oe,onChange:function(e){a({visibility:e?"private":"public"})}})),React.createElement(wa,null,U.stream&&React.createElement(oa,{isPrimary:!0,onClick:function(){return x("stream")}},fa(oe?"Add/Select Private Video Stream":"Add/Select Video Stream","presto-player")),!le&&U.storage&&React.createElement(oa,{isSecondary:U.stream,isPrimary:!U.stream,onClick:function(){return x("storage")}},fa(oe?"Add/Select Private Video (Classic)":"Add/Select Video (Classic)","presto-player")),!U.stream&&!H&&U.storage&&React.createElement(oa,{isSecondary:!0,onClick:function(){ne(!0),I("stream")}},fa("Enable Bunny.net Stream!","presto-player")),!!ae&&ue())),"storage"===C&&React.createElement(Y,{isPrivate:oe,closePopup:function(){return x("")},noticeOperations:o,onSelect:ce}),"stream"===C&&React.createElement(Bn,{isPrivate:oe,closePopup:function(){return x("")},noticeOperations:o,onSelect:ce}))}))),Ra=r(17);function ka(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ka(Object(r),!0).forEach((function(t){Object(c.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ka(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ca=wp.i18n.__,xa="presto-player/bunny",Sa=Pa(Pa({},Ra.a),{},{attributes:Pa(Pa({},Ra.a.attributes),{thumbnail:{type:String,default:""},preview:{type:String,default:""}}),premium:!0,title:Ca("Presto Bunny.net Video","presto-player"),description:Ca("Serve video through Bunny.net CDN.","presto-player"),variations:[{name:"public",isDefault:!0,title:Ca("Presto Bunny.net Video","presto-player"),description:Ca("Serve public video through Bunny.net CDN.","presto-player"),attributes:{visibility:"public"}},{name:"private",title:Ca("Presto Bunny.net Private Video","presto-player"),icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})),description:Ca("Serve private, secure video through Bunny.net CDN.","presto-player"),attributes:{visibility:"private"}}],icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("polyline",{points:"8 17 12 21 16 17"}),React.createElement("line",{x1:"12",y1:"12",x2:"12",y2:"21"}),React.createElement("path",{d:"M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29"})),edit:Ea})},function(e,t,r){"use strict";r.r(t),r.d(t,"name",(function(){return ot})),r.d(t,"options",(function(){return lt}));var n=r(8),a=r(5),o=r(3),l=r(1),c=r(19),i=r.n(c),s=r(15),p=r(4),u=r(13),d=r(16),b=r(24),m=window.location.href,y=function(e){var t=e.src,r=e.onChange,n=e.onSubmit,a=e.onClose;return React.createElement(b.URLPopover,{onClose:a},React.createElement("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n},React.createElement("input",{"data-cy":"url-input",className:"block-editor-media-placeholder__url-input-field",type:"url","aria-label":Object(o.__)("URL","presto-player"),placeholder:Object(o.__)("Paste an mp3 URL","presto-player"),onChange:r,value:t}),React.createElement(p.Button,{"data-cy":"url-submit",className:"block-editor-media-placeholder__url-input-submit-button",icon:"editor-break",label:Object(o.__)("Apply","presto-player"),type:"submit"})))};var v=Object(p.withFilters)("editor.MediaPlaceholder")((function(e){var t=e.value,r=void 0===t?{}:t,n=e.allowedTypes,a=void 0===n?[]:n,c=e.className,v=e.icon,f=e.url,h=void 0===f||f,O=e.labels,g=void 0===O?{}:O,j=e.mediaPreview,w=e.notices,_=e.isAppender,E=e.isPrivate,R=e.addToGallery,k=e.onSelect,P=e.onCancel,C=e.onSelectURL,x=e.onDoubleClick,S=e.children,N=e.allowURLs,T=Object(d.useSelect)((function(e){return(0,e("core/block-editor").getSettings)().mediaUpload}),[]),D=Object(u.useState)(""),B=Object(l.a)(D,2),A=B[0],L=B[1],I=Object(u.useState)(!1),F=Object(l.a)(I,2),V=F[0],U=F[1];Object(u.useEffect)((function(){var e;L(null!==(e=null==r?void 0:r.src)&&void 0!==e?e:"")}),[r]);var M=function(e){L(e.target.value)},z=function(){U(!0)},W=function(){U(!1)},H=function(e){e.preventDefault(),A&&C&&(C(A),W())},Y=function(e,t){var r=g.instructions,n=g.title;T||C||(r=Object(o.__)("To edit this block, you need permission to upload media.","presto-player"));var a=i()("block-editor-media-placeholder",c,{"is-appender":_});return React.createElement(p.Placeholder,{icon:v,label:n,instructions:r,className:a,notices:w,onClick:t,onDoubleClick:x,preview:j},S,e)},G=function(){return C&&React.createElement("div",{className:"block-editor-media-placeholder__url-input-container"},h&&!1===E&&React.createElement(p.Button,{className:"block-editor-media-placeholder__button",onClick:z,isPressed:V,isTertiary:!0},Object(o.__)("Audio URL","presto-player")),V&&React.createElement(y,{src:A,onChange:M,onSubmit:H,onClose:W}))};return React.createElement(b.MediaUploadCheck,{fallback:Y(G())},function(){var e=React.createElement(b.MediaUpload,{title:E?Object(o.__)("Select or Upload Private Audio","presto-player"):Object(o.__)("Select or Upload Audio","presto-player"),addToGallery:R,gallery:!1,multiple:!1,onSelect:function(e){s.a.unsetUrlParams(),k(e)},onClose:function(){s.a.unsetUrlParams()},allowedTypes:a,value:Array.isArray(r)?r.map((function(e){return e.id})):r.id,render:function(e){var t=e.open;return React.createElement(p.Button,{isPrimary:!0,onClick:function(e){e.stopPropagation(),s.a.unsetUrlParams(),E?s.a.setUrlPrivate(m):s.a.setUrlPublic(m),t()}},E?Object(o.__)("Add/Select Private Audio","presto-player"):Object(o.__)("Add/Select Audio","presto-player"))}});if(T){var t=React.createElement(React.Fragment,null,e,!!N&&G(),P&&React.createElement(p.Button,{className:"block-editor-media-placeholder__cancel-button",title:Object(o.__)("Cancel","presto-player"),isLink:!0,onClick:P},Object(o.__)("Cancel","presto-player")));return Y(t)}return Y(e)}())})),f=r(10),h=wp.i18n.__,O=wp.components,g=(O.withNotices,O.BaseControl),j=O.ToggleControl,w=O.Notice,E=["audio"],R=function(e){var t,r,n=e.attributes,o=e.setAttributes,l=e.onSelectURL,c=e.onSelect,i=e.children,s="private"===n.visibility;return React.createElement(v,(r={icon:s?React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),React.createElement("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})):React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"presto-block-icon"},React.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"})),labels:{title:h("Presto Audio","presto-player"),instructions:h("Upload a audio file, or pick one from your media library.","presto-player")},accept:"audio/*",setAttributes:o,allowedTypes:E,switcher:!0,isPrivate:s,allowURLs:!s,onSelectURL:l,onSelect:c,value:n},Object(a.a)(r,"allowURLs",!0),Object(a.a)(r,"onError",(function(){return console.log("error")})),r),React.createElement("div",{style:{width:"100%"}},React.createElement(g,{className:"presto-player__placeholder-control"},React.createElement(j,{label:React.createElement("div",null,h("Make Private","presto-player")," ",!(null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium)&&React.createElement(f.a,null)),help:h(s?"This audio is only accessible to those who are logged in.":"This audio is currently accessible to everyone.","presto-player"),checked:s,onChange:function(e){var t;null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium?o({visibility:e?"private":"public"}):dispatch("presto-player/player").setProModal(!0)}})),!!i&&React.createElement("div",{style:{width:"100%"}},i),!!s&&React.createElement(w,{status:"warning",isDismissible:!1},React.createElement("div",null,React.createElement("div",null,React.createElement("strong",null,h("Note","presto-player"))),h("Private audio uses php to stream your audio. Keep in mind this will use up disk space and bandwidth so it may not be an appropriate choice for some hosts.","presto-player")))))},k=r(43),P=r(29),C=r(30),x=r(39),S=r(6),N=r(7),T=r(2),D=r.n(T),B=r(9),A=r(31),L=r(0),I=r(23),F=r(14);function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){Object(a.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var M,z,W=function(e){var t,r=e.state,n=e.branding,a=e.menu,c=e.src,i=e.poster,s=e.currentTime,d=e.preload,b=e.mediaTitle,m=e.overlays,y=e.isDisabled,v=void 0===y||y,f=Object(u.useState)(1),h=Object(l.a)(f,2),O=h[0],g=h[1],j=r.email_collection,w=r.cta;Object(u.useEffect)((function(){g(O+1)}),[r.skin,r["play-large"],r.rewind,r.play,r["fast-forward"],r.progress,r["current-time"],r.mute,r.volume,r.speed,r.pip,r.fullscreen,r.captions,r.hide_logo]);var _={email:!(null==j||!j.enabled)&&React.createElement(I.b,{className:"email-overlay",slot:"player-end",headline:null==j?void 0:j.headline,style:U(U({"--presto-player-email-border-radiuss":"".concat(null==j?void 0:j.button_radius,"px"),"--plyr-color-main":(null==r?void 0:r.background_color)||(null==n?void 0:n.color)},j.button_color?{"--presto-player-button-color":"".concat(j.button_color)}:{}),j.button_text_color?{"--presto-player-button-text":"".concat(j.button_text_color)}:{}),defaultHeadline:Object(o.__)("Enter your email to play.","presto-player"),bottomText:null==j?void 0:j.bottom_text,allowSkip:null==j?void 0:j.allow_skip,skipText:Object(o.__)("Skip","presto-player"),buttonText:null==j?void 0:j.button_text,placeholder:Object(o.__)("Email address","presto-player"),i18n:window.prestoPlayer.i18n,type:"audio"}),cta:!(null==w||!w.enabled)&&React.createElement(I.a,{className:"cta-overlay",style:U(U(U({"--presto-player-button-border-radius":"".concat(w.button_radius,"px")},null!=w&&w.background_opacity?{"--presto-player-cta-background-opacity":"".concat((null==w?void 0:w.background_opacity)/100)}:{}),w.button_color?{"--presto-player-button-color":"".concat(w.button_color)}:{}),w.button_text_color?{"--presto-player-button-text":"".concat(w.button_text_color)}:{}),slot:"player-end",headline:null==w?void 0:w.headline,"bottom-text":null==w?void 0:w.bottom_text,"button-link":null==w?void 0:w.button_link,"allow-skip":100!==(null==w?void 0:w.percentage)&&(null==w?void 0:w.show_skip),borderRadius:null==w?void 0:w.border_radius,"allow-rewatch":100===(null==w?void 0:w.percentage)&&(null==w?void 0:w.show_rewatch),"skip-text":Object(o.__)("Skip","presto-player"),"show-button":null==w?void 0:w.show_button,"button-text":null==w?void 0:w.button_text,i18n:window.prestoPlayer.i18n,type:"audio"})};return React.createElement(p.Disabled,{isDisabled:v,className:"disable-player"},React.createElement("div",{className:"presto-player__wrapper"},React.createElement(F.a,{src:c||"http://something.mp3",classes:"\n ".concat("cta"===a&&!(null==w||!w.enabled)&&"cta-active"," \n ").concat("email"===a&&!(null==j||!j.enabled)&&"email-active"),preset:r,branding:n,i18n:null===(t=prestoPlayerAdmin)||void 0===t?void 0:t.i18n,preload:d,attributes:{chapters:[],poster:i,title:b},type:"audio",currentTime:s?Object(B.e)(s):"",overlays:m,key:O,adminPreview:(null==_?void 0:_[a])||""})))},H=wp.i18n.__,Y=wp.components,G=Y.ToggleControl,q=Y.BaseControl,Z=(Y.HorizontalRule,Y.__experimentalAlignmentMatrixControl,Y.SelectControl),K=function(e){var t=e.state,r=e.updateState,n=e.className;return React.createElement("div",{className:n},React.createElement(q,null,React.createElement("h3",null,H("Behavior","presto-player"))),React.createElement(q,null,React.createElement(G,{label:H("Save Play Position","presto-player"),help:H("Saves the user's play position so when they come back to the page they can continue the audio from where they left off.","presto-player"),onChange:function(e){r({save_player_position:e})},checked:t.save_player_position})),React.createElement(q,null,React.createElement(G,{label:H("Focus Mode","presto-player"),help:H("Play only when tab is visible and audio is in viewport.","presto-player"),onChange:function(e){r({play_video_viewport:e})},checked:t.play_video_viewport})),React.createElement(q,null,React.createElement(G,{label:H("Sticky On Scroll","presto-player"),help:H("Stick audios to the side of the screen when the page is scrolled and the audio is playing.","presto-player"),onChange:function(e){r({sticky_scroll:e})},checked:t.sticky_scroll})),React.createElement(q,null,React.createElement(Z,{label:H("On Audio End","presto-player"),value:t.on_video_end,options:[{value:"select",label:H("Select","presto-player")},{value:"loop",label:H("Loop","presto-player")},{value:"go-to-start",label:H("Go to start","presto-player")}],onChange:function(e){r({on_video_end:e})}})))},Q=wp.i18n.__,X=wp.components,$=X.ToggleControl,J=X.BaseControl,ee=function(e){var t=e.state,r=e.updateState,n=e.className;return React.createElement("div",{className:n},React.createElement(J,null,React.createElement("h3",null,Q("Controls","presto-player"))),React.createElement(J,{className:"presto-player__control--large-play"},React.createElement($,{label:Q("Large Play Button","presto-player"),help:Q("Adds a large play button over the top of the player.","presto-player"),onChange:function(e){r({"play-large":e})},checked:t["play-large"]})),React.createElement(J,{className:"presto-player__control--rewind"},React.createElement($,{label:Q("Rewind","presto-player"),help:Q("Adds a 10 second rewind button to the player.","presto-player"),onChange:function(e){r({rewind:e})},checked:t.rewind})),React.createElement(J,{className:"presto-player__control--play"},React.createElement($,{label:Q("Small Play Button","presto-player"),help:Q("Adds a small play button to the bottom of the player.","presto-player"),onChange:function(e){r({play:e})},checked:t.play})),React.createElement(J,{className:"presto-player__control--fast-forward"},React.createElement($,{label:Q("Fast Forward","presto-player"),help:Q("Adds a 10 second rewind button to the player.","presto-player"),onChange:function(e){r({"fast-forward":e})},checked:t["fast-forward"]})),React.createElement(J,{className:"presto-player__control--progress"},React.createElement($,{label:Q("Progress Bar","presto-player"),help:Q("Shows a seekable progress bar.","presto-player"),onChange:function(e){r({progress:e})},checked:t.progress})),React.createElement(J,{className:"presto-player__control--current-time"},React.createElement($,{label:Q("Current Time","presto-player"),help:Q("Shows the audio timestamp.","presto-player"),onChange:function(e){r({"current-time":e})},checked:t["current-time"]})),React.createElement(J,{className:"presto-player__control--volume"},React.createElement($,{label:Q("Volume","presto-player"),help:Q("Shows a volume bar.","presto-player"),onChange:function(e){r({volume:e,mute:e})},checked:t.volume})),React.createElement(J,{className:"presto-player__control--speed"},React.createElement($,{label:Q("Speed","presto-player"),help:Q("Shows playback speed controls.","presto-player"),onChange:function(e){r({speed:e})},checked:t.speed})))},te=r(12),re=function(e){var t=e.state,r=e.updateState,n=e.className;return React.createElement("div",{className:n},React.createElement(p.BaseControl,null,React.createElement("h3",null,Object(o.__)("Style","presto-player"))),React.createElement(p.BaseControl,null,React.createElement(p.RangeControl,{label:Object(o.__)("Round Corners","presto-player"),help:Object(o.__)("Player border radius size.","presto-player"),value:(null==t?void 0:t.border_radius)||0,onChange:function(e){return r({border_radius:e})},min:0,max:25})),React.createElement(p.BaseControl,null,React.createElement(p.Flex,null,React.createElement(p.BaseControl.VisualLabel,null,React.createElement("p",null,Object(o.__)("Background Color","presto-player"))),React.createElement(te.a,{color:(null==t?void 0:t.background_color)||"#000000",setColor:function(e){r({background_color:e.hex})}}))),React.createElement(p.BaseControl,null,React.createElement(p.Flex,null,React.createElement(p.BaseControl.VisualLabel,null,React.createElement("p",null,Object(o.__)("Control Color","presto-player"))),React.createElement(te.a,{color:(null==t?void 0:t.control_color)||"#000000",setColor:function(e){r({control_color:e.hex})}}))))},ne=r(40),ae=r(32),oe=r(38);function le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ce(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?le(Object(r),!0).forEach((function(t){Object(a.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):le(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ie=wp.i18n.__,se=wp.components,pe=se.TextControl,ue=se.BaseControl,de=se.Icon,be=se.Notice,me=se.Button,ye=se.Flex,ve=se.FlexItem,fe=se.SelectControl,he=se.FlexBlock,Oe=se.Modal,ge=wp.element,je=ge.useState,we=ge.useEffect,_e=wp.data,Ee=_e.useSelect,Re=_e.dispatch;var ke=function(e){var t=e.type,r=void 0===t?"new":t,n=e.closeModal,a=e.addPreset,o=e.onSave,c=e.updatePreset,i=e.name,s=void 0===i?"":i,p=e.attributes,u=e.preset,d=void 0===u?{"play-large":!0,rewind:!0,play:!0,"fast-forward":!0,progress:!0,"current-time":!0,mute:!0,volume:!0,speed:!1,pip:!1,save_player_position:!1,reset_on_end:!1,sticky_scroll:!1,hide_logo:!1,border_radius:0,skin:"default",background_color:"",control_color:"",cta:{},email_collection:{},action_bar:{}}:u,b=je(!1),m=Object(l.a)(b,2),y=m[0],v=m[1],f=je(""),h=Object(l.a)(f,2),O=h[0],g=h[1],j=je(""),w=Object(l.a)(j,2),_=w[0],E=w[1],R=je(s),k=Object(l.a)(R,2),P=k[0],C=k[1],x=je(d),T=Object(l.a)(x,2),I=T[0],F=T[1],V=Ee((function(e){return e("presto-player/player").branding()})),U=je(""),H=Object(l.a)(U,2),Y=H[0],G=H[1],q={message:ie("The preset could not be saved. Please reload the page and try again.","presto-player")},Z=Ee((function(e){return e("presto-player/player").youtube()}));we((function(){G(Z.channel_id)}),[null==Z?void 0:Z.channel_id]);var Q=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};F(ce(ce({},I),e))},X=function(){var e=Object(N.a)(D.a.mark((function e(){var t,r,a,l;return D.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),e.prev=1,t=ce(ce({},I),{name:P}),e.next=5,wp.apiFetch({method:"POST",url:wp.url.addQueryArgs("".concat(prestoPlayer.root).concat(prestoPlayer.prestoVersionString,"audio-preset/").concat(d.id),{_method:"PUT"}),data:t});case 5:if(r=e.sent){e.next=8;break}throw q;case 8:c(r),n(),o&&o(r),Object(B.d)({message:ie("Preset updated!","presto-player")}),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),g(null!==e.t0&&void 0!==e.t0&&e.t0.message?e.t0.message:q);case 17:return e.prev=17,v(!1),e.finish(17);case 20:return Re("presto-player/player").updateYoutube({channel_id:Y}),a=ce(ce({},Z),{channel_id:Y}),e.prev=22,e.next=25,wp.apiFetch({path:"wp/v2/settings",method:"POST",data:{presto_player_youtube:a}});case 25:null!=(l=e.sent)&&l.presto_player_youtube&&(Re("presto-player/player").setYoutube(null==l?void 0:l.presto_player_youtube),onClose()),e.next=32;break;case 29:e.prev=29,e.t1=e.catch(22),console.log(e.t1);case 32:case"end":return e.stop()}}),e,null,[[1,14,17,20],[22,29]])})));return function(){return e.apply(this,arguments)}}(),$=function(){var e=Object(N.a)(D.a.mark((function e(){var t;return D.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),e.prev=1,e.next=4,wp.apiFetch({method:"POST",url:prestoPlayer.root+prestoPlayer.prestoVersionString+"audio-preset",data:ce(ce({},{name:P}),I)});case 4:if(t=e.sent){e.next=7;break}throw q;case 7:a(t),n(),o&&o(t),Object(B.d)({message:ie("Preset created!","presto-player")}),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),g(null!==e.t0&&void 0!==e.t0&&e.t0.message?e.t0.message:q);case 16:return e.prev=16,v(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[1,13,16,19]])})));return function(){return e.apply(this,arguments)}}(),J=[{name:"controls",title:ie("Controls","presto-player"),icon:Object(L.b)(de,{icon:"admin-settings"}),component:Object(L.b)(ee,{updateState:Q,state:I})},{name:"behavior",title:ie("Behavior","presto-player"),icon:Object(L.b)(de,{icon:"admin-generic"}),component:Object(L.b)(K,{updateState:Q,state:I})},{name:"style",title:ie("Style","presto-player"),icon:Object(L.b)(de,{icon:"admin-customizer"}),component:Object(L.b)(re,{updateState:Q,state:I})},{name:"email",title:ie("Email Capture","presto-player"),icon:Object(L.b)(de,{icon:"email"}),component:Object(L.b)(oe.a,{updateState:Q,state:I})},{name:"cta",title:ie("Call To Action","presto-player"),icon:Object(L.b)(de,{icon:"megaphone"}),component:Object(L.b)(ae.a,{updateState:Q,state:I})},{name:"action_bar",title:ie("Action Bar","presto-player"),icon:Object(L.b)(de,{icon:"cover-image"}),component:Object(L.b)(ne.a,{updateState:Q,state:I,value:Y,setValue:G})}];return Object(L.b)(Oe,{title:ie("edit"==r?"Edit A Audio Preset":"Create A New Audio Preset","presto-player"),onRequestClose:n,className:"presto-player__modal-presets",overlayClassName:"presto-player__modal-presets-overlay"},Object(L.b)("div",{className:"presto-player__preset-options","data-cy":"preset-modal"},Object(L.b)(pe,{value:P,hideLabelFromVision:!0,label:ie("Preset Name","presto-player"),onChange:function(e){return C(e)},placeholder:ie("Enter a preset name...","presto-player"),className:"presto-player__modal--style-name",autoFocus:!0}),Object(L.b)(ye,{align:"stretch",className:"presto-player__style-preview-area"},Object(L.b)(ve,{className:"presto-player__style-sidebar"},Object(L.b)("div",null,Object(L.b)(A.a,{items:J,title:ie("Customize","presto-player"),onSelect:E},(function(e){return e.component})))),Object(L.b)(he,{className:"presto-player__style-preview-panel"},Object(L.b)("div",{style:{position:"absolute",top:0,left:0,padding:"20px"}},Object(L.b)(fe,{label:ie("Skin","presto-player"),labelPosition:"side",value:null==I?void 0:I.skin,hideLabelFromVision:!0,options:[{label:ie("Basic","presto-player"),value:"default"},{label:ie("Stacked","presto-player"),value:"stacked"}],onChange:function(e){Q({skin:e})}})),Object(L.b)(W,{poster:p.poster,src:p.src,state:I,branding:V,menu:_,mediaTitle:p.title}))),Object(L.b)("br",null),O&&Object(L.b)(ue,null,Object(L.b)(be,{className:"presto-player__modal--error-notice",status:"error",isDismissible:!1,style:{margin:0}},O.replace(/(<([^>]+)>)/gi,""))),Object(L.b)("div",{css:Object(L.a)(M||(M=Object(S.a)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n "])))},Object(L.b)("div",{css:Object(L.a)(z||(z=Object(S.a)(["\n opacity: 0.5;\n font-size: 12px;\n "])))},"Preset ID: ",d.id),Object(L.b)("div",null,Object(L.b)(me,{isTertiary:!0,onClick:n,style:{margin:"0 6px"}},ie("Cancel","presto-player")),Object(L.b)(me,{isPrimary:!0,isBusy:y,disabled:y,onClick:function(){if(P)return"edit"===r?X():$();g(ie("You must enter a name for the preset.","presto-player"))},"data-cy":"submit-preset"},ie("edit"==r?"Update Preset":"Create Preset","presto-player"))))))},Pe=wp.i18n.__,Ce=wp.components,xe=Ce.Icon,Se=Ce.Spinner,Ne=Ce.Modal,Te=Ce.Button,De=Ce.ButtonGroup,Be=wp.element.useState,Ae=function(e){var t,r,n=e.preset,a=e.index,o=e.isActive,c=e.remove,i=e.setPreset,s=e.onEdit,p=Be(!1),u=Object(l.a)(p,2),d=u[0],b=u[1],m=Be(!1),y=Object(l.a)(m,2),v=y[0],f=y[1],h=function(){return f(!1)},O=function(){var e=Object(N.a)(D.a.mark((function e(){return D.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.id){e.next=3;break}return c(n),e.abrupt("return");case 3:return e.prev=3,b(!0),e.next=7,wp.apiFetch({method:"POST",url:wp.url.addQueryArgs("".concat(prestoPlayer.root).concat(prestoPlayer.prestoVersionString,"audio-preset/").concat(n.id),{_method:"DELETE"})});case 7:e.sent&&(c(n),wp.data.dispatch("core/notices").createNotice("success",Pe("Preset trashed.","presto-player"),{type:"snackbar",isDismissible:!0})),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(3),console.error(e.t0),null!==e.t0&&void 0!==e.t0&&e.t0.message&&wp.data.dispatch("core/notices").createNotice("error",e.t0.message,{type:"snackbar",isDismissible:!0});case 15:return e.prev=15,f(!1),b(!1),e.finish(15);case 19:case"end":return e.stop()}}),e,null,[[3,11,15,19]])})));return function(){return e.apply(this,arguments)}}();return d?React.createElement("div",{className:"block-editor-block-styles__item",role:"button",tabIndex:a,"aria-label":"Fill",style:{color:o?"var(--wp-admin-theme-color)":"inherit"}},React.createElement("div",{className:"block-editor-block-styles__item-preview",style:{border:o?"2px solid var(--wp-admin-theme-color)":"2px solid #e3e3e3",margin:0,display:"flex","align-items":"center","justify-content":"center"}},React.createElement(Se,null))):React.createElement("div",{className:"block-editor-block-styles__item presto-preset-".concat(n.slug),onClick:function(){i(n)},role:"button",tabIndex:a,"aria-label":"Fill",style:{color:o?"var(--wp-admin-theme-color)":"inherit"}},React.createElement("div",{className:"block-editor-block-styles__item-preview",style:{border:o?"2px solid var(--wp-admin-theme-color)":"2px solid #e3e3e3",margin:0}},React.createElement("div",{style:{textAlign:"center",width:"100%",color:o?"var(--wp-admin-theme-color)":"inherit",opacity:o?1:.75}},null!=n&&n.icon?React.createElement(xe,{icon:null==n?void 0:n.icon,style:{fontSize:"30px",width:"30px",height:"30px"}}):React.createElement("h1",{style:{opacity:.75}},(null==n||null===(t=n.name)||void 0===t||null===(r=t.charAt(0))||void 0===r?void 0:r.toUpperCase())||"Untitled"))),React.createElement("div",{className:"block-editor-block-styles__item-label",style:{fontWeight:"bold",textTransform:"capitalize"}},(null==n?void 0:n.name)||"Untitled"),!(null!=n&&n.is_locked)&&React.createElement("div",{className:"block-editor-block-styles__item-edit"},React.createElement("div",{className:"block-editor-block-styles__item-edit-icon",onClick:s},React.createElement(xe,{icon:"edit"})),React.createElement("div",{className:"block-editor-block-styles__item-edit-icon",onClick:function(){return f(!0)}},React.createElement(xe,{icon:"trash"}))),v&&React.createElement(Ne,{title:Pe("Trash Preset?","presto-player"),onRequestClose:h,style:{maxWidth:"250px"}},React.createElement("p",null,React.createElement("strong",null,Pe("Warning!","presto-player")," "),Pe("Any audios assigned to this preset will automatically use the default preset.","presto-player")),React.createElement(De,null,React.createElement(Te,{isDestructive:!0,onClick:O,style:{margin:"0 4px"}},Pe("Trash","presto-player")),React.createElement(Te,{isTertiary:!0,onClick:h,style:{margin:"0 4px",boxShadow:"none"}},Pe("Cancel","presto-player")))))},Le=wp.i18n.__,Ie=wp.components,Fe=Ie.withNotices,Ve=Ie.BaseControl,Ue=Ie.Spinner,Me=Ie.Button,ze=wp.element,We=ze.useState,He=(ze.useEffect,wp.data),Ye=He.useSelect,Ge=He.dispatch;var qe=Fe((function(e){var t,r=e.attributes,n=e.setAttributes,a=We(!1),o=Object(l.a)(a,2),c=o[0],i=o[1],s=function(){return i(!1)},p=We(null),u=Object(l.a)(p,2),d=u[0],b=u[1],m=We(null),y=Object(l.a)(m,2),v=y[0],h=y[1],O=Ye((function(e){return{presets:e("presto-player/player").getAudioPresets(),loading:e("presto-player/player").isResolving("getAudioPresets")}})),g=O.presets,j=O.loading,w=function(e){Ge("presto-player/player").addAudioPreset(e)},_=function(e){Ge("presto-player/player").removeAudioPreset(e)},E=function(e){n({preset:e.id})};return j?React.createElement("div",{className:"presto-settings__loading"},React.createElement(Ue,null)):React.createElement(React.Fragment,null,g.length?React.createElement("p",null,Le("Select a audio configuration preset, or add your own.","presto-player")):"",React.createElement(Ve,null,React.createElement("div",{className:"block-editor-block-styles"},(g||[]).length?g.map((function(e,t){return React.createElement(Ae,{setPreset:E,index:t,isActive:(null==r?void 0:r.preset)===e.id,preset:e,key:e.id,onEdit:function(){h(e.name),b(e),i("edit")},remove:_})})):Le("No style presets. You can create a new style by clicking 'Add New Style'.","presto-plugin"))),React.createElement(Ve,null,React.createElement(Me,{isPrimary:!0,"data-cy":"add-new-preset",onClick:function(){var e;null!==(e=prestoPlayer)&&void 0!==e&&e.isPremium?i("new"):Ge("presto-player/player").setProModal(!0)}},Le("Add New Preset","presto-player")),!(null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium)&&React.createElement(f.a,null)),"new"==c&&React.createElement(ke,{closeModal:s,addPreset:w,type:"new",onSave:E,attributes:r}),"edit"==c&&React.createElement(ke,{closeModal:s,addPreset:w,updatePreset:function(e){Ge("presto-player/player").updateAudioPreset(e)},type:"edit",preset:d,name:v,attributes:r}))})),Ze=["image"];var Ke=function e(t){var r,n,a=t.attributes,l=t.setAttributes,c=Object(C.useInstanceId)(e),i="audio-block__poster-image-description-".concat(c),s=a.autoplay,u=a.poster,d=a.preload,m=a.title;return React.createElement(React.Fragment,null,React.createElement(p.PanelBody,{title:React.createElement(React.Fragment,null,Object(o.__)("Title","presto-player")," "),initialOpen:!0},React.createElement(p.FlexBlock,null,React.createElement(p.TextControl,{className:"presto-player__caption--title",placeholder:Object(o.__)("Title","presto-player"),value:m||"",onChange:function(e){return l({title:e})},autoComplete:"off"}))),React.createElement(p.PanelBody,{title:React.createElement(React.Fragment,null,Object(o.__)("Chapters","presto-player")," ",!(null!==(r=prestoPlayer)&&void 0!==r&&r.isPremium)&&React.createElement(f.a,null)),initialOpen:null===(n=prestoPlayer)||void 0===n?void 0:n.isPremium},React.createElement(x.a,{setAttributes:l,attributes:a})),React.createElement(p.PanelBody,{title:React.createElement(React.Fragment,null,Object(o.__)("Audio Settings","presto-player")," ")},React.createElement(p.ToggleControl,{label:React.createElement(React.Fragment,null,Object(o.__)("Autoplay","presto-player")," "),checked:s,onChange:function(e){l({autoplay:e})}}),React.createElement(p.PanelRow,null,React.createElement(p.SelectControl,{label:React.createElement(p.Flex,null,React.createElement("div",null,Object(o.__)("Performance Preference","presto-player")),React.createElement("a",{href:"https://prestoplayer.com/docs/performance-preferences-explained",target:"_blank",style:{textDecoration:"none"}},React.createElement(p.Icon,{icon:"editor-help"}))),className:"presto-setting__preload",value:d,onChange:function(e){return l({preload:e})},options:[{value:"auto",label:Object(o.__)("Audio Playback Speed","presto-player")},{value:"metadata",label:Object(o.__)("Page Load Speed","presto-player")},{value:"none",label:Object(o.__)("Page Load Speed (Extreme)","presto-player")}]})),React.createElement(b.MediaUploadCheck,null,React.createElement(p.BaseControl,{className:"editor-video-poster-control"},React.createElement(p.BaseControl.VisualLabel,null,React.createElement("p",null,Object(o.__)("Poster image","presto-player"))),React.createElement(b.MediaUpload,{title:Object(o.__)("Select poster image","presto-player"),onSelect:function(e){l({poster:e.url})},allowedTypes:Ze,render:function(e){var t=e.open;return React.createElement(p.Button,{className:"presto-setting__poster",isPrimary:!0,onClick:t,"aria-describedby":i},u?Object(o.__)("Replace","presto-player"):Object(o.__)("Select","presto-player"))}}),React.createElement("p",{id:i,hidden:!0},u?sprintf(Object(o.__)("The current poster image url is %s","presto-player"),u):Object(o.__)("There is no poster image currently selected","presto-player")),!!u&&React.createElement(p.Button,{onClick:function(){l({poster:""})},className:"presto-setting__remove-poster",isTertiary:!0},Object(o.__)("Remove","presto-player"))))),React.createElement(p.PanelBody,{title:Object(o.__)("Audio Preset","presto-player")},React.createElement(qe,{setAttributes:l,attributes:a})),React.createElement(p.PanelBody,{title:React.createElement(React.Fragment,null,Object(o.__)("Global Player Branding","presto-player")),initialOpen:!1},React.createElement(P.a,{setAttributes:l,attributes:a,type:"audio"})))},Qe=r(33);function Xe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $e(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xe(Object(r),!0).forEach((function(t){Object(a.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Je=wp.data.withSelect;function et(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?et(Object(r),!0).forEach((function(t){Object(a.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):et(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var rt,nt,at=(0,wp.compose.compose)([Je((function(e){return{branding:e("presto-player/player").branding(),loading:e("presto-player/player").isResolving("getAudioPresets"),presets:e("presto-player/player").getAudioPresets(),defaultPreset:e("presto-player/player").getDefaultAudioPreset()}})),Object(C.createHigherOrderComponent)((function(e){return function(t){var r=t.presets,n=t.attributes,a=t.setAttributes,c=t.defaultPreset,i=t.isSelected,s=t.branding,p=Object(u.useState)({}),b=Object(l.a)(p,2),m=b[0],y=b[1],v=Object(u.useState)(1),f=Object(l.a)(v,2),h=f[0],O=f[1],g=n.poster,j=n.chapters;Object(u.useEffect)((function(){i&&null!=n&&n.id&&Object(d.dispatch)("core/edit-post").openGeneralSidebar("edit-post/block")}),[i]),Object(u.useEffect)((function(){i&&null!=n&&n.selectionOverrideClientId&&Object(d.dispatch)("core/block-editor").selectBlock(null==n?void 0:n.selectionOverrideClientId)}),[i]),Object(u.useEffect)((function(){if(r&&r.length){var e=r.find((function(e){return e.id===(null==n?void 0:n.preset)}));e?y(e):(y(c),a({preset:null==c?void 0:c.id}))}}),[r,null==n?void 0:n.preset]),Object(u.useEffect)((function(){w()}),[g,m,j,s.logo]);var w=function(){O(h+1)},E=Object(B.f)(j);Object(u.useEffect)((function(){var e=null==j?void 0:j.map((function(e){return e.time})),t=null==E?void 0:E.map((function(e){return e.time}));_.difference(e,t).length&&w()}),[j]);var R=function(){var e=Object(N.a)(D.a.mark((function e(t){var r,n,o,l,c,i,s;return D.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.src,n=t.external_id,o=t.attachment_id,l=t.type,c=t.title,r||n||o){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,Object(Qe.a)({method:"POST",path:"/presto-player/v1/videos",data:$e($e({attachment_id:o,post_id:wp.data.select("core/editor").getCurrentPostId(),external_id:n},c?{title:c}:{}),{},{src:r,type:l})});case 5:i=e.sent,s=i.id,a({id:s});case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return null!=n&&n.preset||a({preset:null==c?void 0:c.id}),React.createElement(e,Object.assign({},t,{lockSave:function(){return Object(d.dispatch)("core/editor").lockPostSaving("presto-player")},unlockSave:function(){return Object(d.dispatch)("core/editor").unlockPostSaving("presto-player")},createVideo:R,onUpdate:w,onRemoveSrc:function(){confirm(Object(o.__)("Remove this","presto-player"))&&a({src:"",id:void 0})},presetData:m,setPresetData:y,renderKey:h}))}}),"withPlayerEdit")])(Object(p.withNotices)((function(e){var t=e.attributes,r=e.setAttributes,n=e.branding,a=e.presetData,l=e.renderKey,c=e.defaultPreset,i=e.lockSave,s=e.unlockSave,u=e.loading,d=e.createVideo,b=e.onRemoveSrc,m=t.poster,y=t.src,v=t.id;return y?u||!v?React.createElement(p.Placeholder,{className:"presto-player__placeholder is-loading"},React.createElement(p.Spinner,null)):React.createElement(React.Fragment,null,React.createElement(k.BlockControls,null,React.createElement(p.Toolbar,null,React.createElement(p.Button,{onClick:function(){return b()}},Object(o.__)("Replace","presto-player")))),React.createElement(k.InspectorControls,null,React.createElement(Ke,{attributes:t,setAttributes:r})),React.createElement("figure",null,React.createElement(p.Disabled,null,React.createElement(F.a,{poster:m,src:y,id:v,type:"audio",attributes:t,setAttributes:r,preset:a,branding:n,key:l})))):React.createElement(React.Fragment,null,React.createElement(R,{attributes:t,setAttributes:r,onSelectURL:function(e){r(tt(tt({},t),{},{src:e,title:e,preset:null==c?void 0:c.id})),i(),d({src:e,type:"link"}).catch((function(e){r({src:""}),showNotice(e)})).finally(s)},onSelect:function(e){e&&e.url?e.title?(r({src:e.url,preset:null==c?void 0:c.id,title:e.title,attachment_id:e.id}),i(),d({src:e.url,type:"attachment",attachment_id:e.id}).catch((function(e){r({src:""}),showNotice(e)})).finally(s)):r({src:e.url,title:e.url,preset:null==c?void 0:c.id}):r({src:void 0,id:void 0})}}))}))),ot="presto-player/audio",lt={category:"presto",attributes:(rt={src:{type:"string"},autoplay:{type:Boolean,default:!1},poster:{type:"string"},chapters:{type:"array",default:[]},preload:{type:"string"},title:{type:"string"},tracks:{type:"array",items:{type:"object"},default:[]},preset:{type:Number},id:{type:Number},attachment_id:{type:Number}},Object(a.a)(rt,"src",{type:String}),Object(a.a)(rt,"visibility",{type:String,default:"public"}),rt),title:Object(o.__)("Presto Audio","presto-player"),description:Object(o.__)("A audio player wrapper.","presto-player"),variations:[{name:"public",isDefault:!0,title:Object(o.__)("Presto Audio","presto-player"),description:Object(o.__)("Presto self-hosted audio block.","presto-player"),attributes:{visibility:"public"}}].concat(Object(n.a)(null!==(nt=prestoPlayer)&&void 0!==nt&&nt.isPremium?[{name:"private",title:Object(o.__)("Presto Private Audio","presto-player"),icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),React.createElement("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})),description:Object(o.__)("Private self-hosted audio block.","presto-player"),attributes:{visibility:"private"}}]:[])),icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"presto-block-icon"},React.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"})),edit:at}},function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"getPresets",(function(){return v})),r.d(n,"getAudioPresets",(function(){return f})),r.d(n,"getPreset",(function(){return h})),r.d(n,"getReusableVideos",(function(){return O})),r.d(n,"getReusableVideo",(function(){return g})),r.d(n,"getDefaultPreset",(function(){return j})),r.d(n,"getDefaultAudioPreset",(function(){return w})),r.d(n,"presetsLoading",(function(){return _})),r.d(n,"branding",(function(){return E})),r.d(n,"playerCSS",(function(){return R})),r.d(n,"youtube",(function(){return k})),r.d(n,"proModal",(function(){return P}));var a={};r.r(a),r.d(a,"setPresetLoading",(function(){return x})),r.d(a,"setVideosLoading",(function(){return S})),r.d(a,"setProModal",(function(){return N})),r.d(a,"setVideos",(function(){return T})),r.d(a,"updateVideos",(function(){return D})),r.d(a,"appendVideos",(function(){return B})),r.d(a,"addVideo",(function(){return A})),r.d(a,"setPresets",(function(){return L})),r.d(a,"addPreset",(function(){return I})),r.d(a,"updatePreset",(function(){return F})),r.d(a,"removePreset",(function(){return V})),r.d(a,"setAudioPresets",(function(){return U})),r.d(a,"addAudioPreset",(function(){return M})),r.d(a,"updateAudioPreset",(function(){return z})),r.d(a,"removeAudioPreset",(function(){return W})),r.d(a,"setBranding",(function(){return H})),r.d(a,"updateBranding",(function(){return Y})),r.d(a,"saveOptions",(function(){return G})),r.d(a,"fetchOptions",(function(){return q})),r.d(a,"fetchFromAPI",(function(){return Z})),r.d(a,"fetchFromWPAPI",(function(){return K})),r.d(a,"setYoutube",(function(){return Q})),r.d(a,"updateYoutube",(function(){return X})),r.d(a,"setPresetSettings",(function(){return $})),r.d(a,"setPresetAudioSettings",(function(){return J}));var o=r(5),l=r(8);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){Object(o.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var s=wp.data,p=s.combineReducers,u=s.dispatch,d=wp.apiFetch,b=lodash.pick,m=function(e,t){return e.find((function(e){return e.id===t.id}))?e:[].concat(Object(l.a)(e),[t])},y=p({presetReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_PRESET":return t.value;case"ADD_PRESET":return[].concat(Object(l.a)(e),[t.value]);case"UPDATE_PRESET":return e.map((function(e,r){var n;return e.id!==(null===(n=t.value)||void 0===n?void 0:n.id)?e:i(i({},e),t.value)}));case"REMOVE_PRESET":return e.filter((function(e){return e!==t.value}))}return e},audioPresetReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_AUDIO_PRESET":case"SET_AUDIO_PRESET":return t.value;case"ADD_AUDIO_PRESET":return[].concat(Object(l.a)(e),[t.value]);case"UPDATE_AUDIO_PRESET":return e.map((function(e,r){var n;return e.id!==(null===(n=t.value)||void 0===n?void 0:n.id)?e:i(i({},e),t.value)}));case"REMOVE_AUDIO_PRESET":return e.filter((function(e){return e!==t.value}))}return e},presetLoadingReducer:function(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"SET_PRESET_LOADING":return e.value}},videosLoadingReducer:function(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"SET_VIDEOS_LOADING":return e.value}},videosReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{total:0,total_pages:0,videos:[],hasResolved:!1,isError:!1},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_VIDEOS":return t.value;case"UPDATE_VIDEOS":return i(i({},e),t.value);case"APPEND_VIDEOS":var r=e;return(t.value||[]).forEach((function(e){r.videos=m(r.videos,e)})),r;case"ADD_VIDEO":return i(i({},e),{},{videos:m(e.videos,t.value)});case"UPDATE_VIDEO":return i(i({},e),{},{videos:e.videos.map((function(e,r){var n;return e.id!==(null===(n=t.value)||void 0===n?void 0:n.id)?e:i(i({},e),t.value)}))});case"REMOVE_VIDEO":return i(i({},e),{},{videos:e.videos.filter((function(e){return e!==t.value}))})}return e},proModalReducer:function(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"SET_PRO_MODAL":return e.value}},brandingReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_BRANDING":return t.value;case"UPDATE_BRANDING":return i(i({},e),{},Object(o.a)({},t.name,t.value))}return e},youtubeReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_YOUTUBE":return t.value;case"UPDATE_YOUTUBE":return i(i({},e),{},Object(o.a)({},t.name,t.value))}return e},presetSettingsReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_PRESET_SETTINGS":return t.value}return e},optionsApi:function(e,t){switch(t.type){case"FETCH_OPTIONS":return d({path:"/presto-player/v1/settings/"}).then((function(e){u("presto-player/player").setBranding(e.presto_player_branding),u("presto-player/player").setYoutube(e.presto_player_youtube),u("presto-player/player").setPresetSettings(e.presto_player_presets),u("presto-player/player").setPresetAudioSettings(e.presto_player_audio_presets)}));case"SAVE_OPTIONS":var r={presto_player_branding:b(null==t?void 0:t.branding,["logo","color","logo_width","player_css"])};return Object.keys(r).forEach((function(e){return(null==r[e]||!Object.keys((null==r?void 0:r[e])||{}).length)&&delete r[e]})),d({path:"/presto-player/v1/settings",method:"POST",data:r}),r}},audioPresetSettingsReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_PRESET_AUDIO_SETTINGS":return t.value}return e}});function v(e){return(null==e?void 0:e.presetReducer)||[]}function f(e){return(null==e?void 0:e.audioPresetReducer)||[]}function h(e,t){var r;return null!=e&&null!==(r=e.presetReducer)&&void 0!==r&&r.length?null==e?void 0:e.presetReducer.find((function(e){return e.id===t})):[]}function O(e){return(null==e?void 0:e.videosReducer)||[]}function g(e,t){var r,n;return(null==e||null===(r=e.videosReducer)||void 0===r||null===(n=r.videos)||void 0===n?void 0:n.find((function(e){return(null==e?void 0:e.id)===t})))||[]}function j(e){var t,r=null==e||null===(t=e.presetSettingsReducer)||void 0===t?void 0:t.default_player_preset,n=r&&((null==e?void 0:e.presetReducer)||[]).find((function(e){return e.id&&e.id===r}));return n||(n=((null==e?void 0:e.presetReducer)||[]).find((function(e){return"default"==e.slug}))),n||(n=((null==e?void 0:e.presetReducer)||[])[0]),n}function w(e){var t,r=null==e||null===(t=e.audioPresetSettingsReducer)||void 0===t?void 0:t.default_player_preset,n=r&&((null==e?void 0:e.audioPresetReducer)||[]).find((function(e){return e.id&&e.id===r}));return n||(n=((null==e?void 0:e.audioPresetReducer)||[]).find((function(e){return"default"==e.slug}))),n||(n=((null==e?void 0:e.audioPresetReducer)||[])[0]),n}function _(e){return!(null==e||!e.presetLoadingReducer)}function E(e){return null==e?void 0:e.brandingReducer}function R(e){var t;return null==e||null===(t=e.brandingReducer)||void 0===t?void 0:t.player_css}function k(e){return null==e?void 0:e.youtubeReducer}function P(e){return null==e?void 0:e.proModalReducer}function C(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){return{type:"SET_PRESET_LOADING",value:e}}function S(e){return{type:"SET_VIDEOS_LOADING",value:e}}function N(e){return{type:"SET_PRO_MODAL",value:e}}function T(e){return{type:"SET_VIDEOS",value:e}}function D(e){return{type:"UPDATE_VIDEOS",value:e}}function B(e){return{type:"APPEND_VIDEOS",value:e}}function A(e){return{type:"ADD_VIDEO",value:e}}function L(e){return{type:"SET_PRESET",value:e}}function I(e){return{type:"ADD_PRESET",value:e}}function F(e){return{type:"UPDATE_PRESET",value:e}}function V(e){return{type:"REMOVE_PRESET",value:e}}function U(e){return{type:"SET_AUDIO_PRESET",value:e}}function M(e){return{type:"ADD_AUDIO_PRESET",value:e}}function z(e){return{type:"UPDATE_AUDIO_PRESET",value:e}}function W(e){return{type:"REMOVE_AUDIO_PRESET",value:e}}function H(e){return{type:"SET_BRANDING",value:e}}function Y(e,t){return{type:"UPDATE_BRANDING",name:e,value:t}}function G(e){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?C(Object(r),!0).forEach((function(t){Object(o.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({type:"SAVE_OPTIONS"},e)}function q(){return{type:"FETCH_OPTIONS"}}function Z(e){return{type:"FETCH_FROM_API",path:e}}function K(e,t){return{type:"FETCH_FROM_WP_API",path:e,args:t}}function Q(e){return{type:"SET_YOUTUBE",value:e}}function X(e,t){return{type:"UPDATE_YOUTUBE",name:e,value:t}}function $(e){return{type:"SET_PRESET_SETTINGS",value:e}}function J(e){return{type:"SET_PRESET_AUDIO_SETTINGS",value:e}}var ee=r(7),te=r(2),re=r.n(te);function ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ae(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(r),!0).forEach((function(t){Object(o.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ne(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var oe=wp.apiFetch,le={FETCH_FROM_API:function(e){return oe({url:prestoPlayer.root+prestoPlayer.prestoVersionString+e.path})},FETCH_FROM_WP_API:function(e){return Object(ee.a)(re.a.mark((function t(){var r,n,a,o,l,c,i;return re.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.args,n=e.path,a=void 0===n?"":n,t.next=3,oe(ae(ae(ae({path:wp.url.addQueryArgs("wp/v2/".concat(a),null==r?void 0:r.query)},null!=r&&r.data?{data:r.data}:{}),null==r?void 0:r.options),{},{parse:!1}));case 3:return o=t.sent,t.next=6,o.json();case 6:return l=t.sent,c=o.headers&&o.headers.get("X-WP-Total"),i=o.headers&&o.headers.get("X-WP-TotalPages"),t.abrupt("return",new Promise((function(e,t){e({data:l,total:c,total_pages:i})})));case 10:case"end":return t.stop()}}),t)})))()}},ce={getPresets:re.a.mark((function e(){var t;return re.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Z("preset");case 2:return t=e.sent,e.abrupt("return",L(t));case 4:case"end":return e.stop()}}),e)})),getAudioPresets:re.a.mark((function e(){var t;return re.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Z("audio-preset");case 2:return t=e.sent,e.abrupt("return",U(t));case 4:case"end":return e.stop()}}),e)})),getReusableVideo:re.a.mark((function e(t){var r,n;return re.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="presto-videos/".concat(t),e.next=3,K(r,{});case 3:return n=e.sent,e.abrupt("return",A((null==n?void 0:n.data)||{}));case 5:case"end":return e.stop()}}),e)}))},ie=(0,wp.data.registerStore)("presto-player/player",{reducer:y,selectors:n,actions:a,controls:le,resolvers:ce}),se=r(10),pe=wp.components,ue=pe.Modal,de=pe.Button,be=wp.data,me=be.dispatch,ye=be.useSelect,ve=function(){return ye((function(e){return e("presto-player/player").proModal()}))?React.createElement(ue,{title:"Pro Feature",onRequestClose:function(){me("presto-player/player").setProModal(!1)}},React.createElement("h2",null,"Unlock Presto Player ",React.createElement(se.a,null)),React.createElement("p",null,"Get this feature and more with the Pro version of Presto Player!"),React.createElement(de,{href:"https://prestoplayer.com",target:"_blank",isPrimary:!0},"Learn More")):""},fe=wp.blocks,he=fe.registerBlockType,Oe=fe.unregisterBlockType,ge=wp.plugins,je=ge.registerPlugin,we=ge.unregisterPlugin,_e=wp.data,Ee=_e.select,Re=_e.dispatch,ke=wp.element.render,Pe=function(){return null},Ce=function(e){var t=e.getContext,r=e.register,n=e.unregister,a=e.before,o=void 0===a?Pe:a,l=e.after,c=void 0===l?Pe:l,i={};!function(){o();var e=t(),a=[];e.keys().forEach((function(t){var o=e(t);o!==i[t]&&(i[t]&&n(i[t]),r(o),a.push(o.name),i[t]=o)})),c(a)}()},xe=null;Ce({getContext:function(){return r(59)},register:function(e){var t,r=e.name,n=e.options;null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium?he(r,n):n.premium||he(r,n)},unregister:function(e){var t=e.name;return Oe(t)},before:function(){xe=Ee("core/editor").getSelectedBlockClientId(),Re("core/editor").clearSelectedBlock()},after:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Ee("core/editor").getBlocks().forEach((function(t){var r=t.name,n=t.clientId;e.includes(r)&&Re("core/editor").selectBlock(n)})),xe?Re("core/editor").selectBlock(xe):Re("core/editor").clearSelectedBlock(),xe=null}}),Ce({getContext:function(){return r(68)},register:function(e){var t=e.name,r=e.options;return je(t,r)},unregister:function(e){var t=e.name;return we(t)}}),jQuery("body").append('<div id="presto-plugin-app"></div>'),ke(React.createElement(ve,null),document.getElementById("presto-plugin-app")),Re("presto-player/player").fetchOptions();var Se=!1;wp.data.subscribe((function(){var e=wp.data.select("core/editor").isSavingPost(),t=wp.data.select("core/editor").isAutosavingPost();if(e&&!t){if(Se)return;Se=!0;var r=ie.getState().brandingReducer;Re("presto-player/player").saveOptions({branding:r}).then((function(){Se=!1}))}}))},function(e,t,r){"use strict";r.r(t),r.d(t,"name",(function(){return W})),r.d(t,"options",(function(){return H}));var n=r(7),a=r(1),o=r(2),l=r.n(o),c=(r(19),wp.compose.useInstanceId),i=wp.i18n.__,s=wp.components,p=s.VisuallyHidden,u=s.Button,d=s.Icon,b=wp.element.useRef;var m=function e(t){t.className;var r=t.onChange,n=t.value,a=t.placeholder,o=c(e),l=b();return React.createElement("div",{className:"block-editor-inserter__search",style:{padding:0}},React.createElement(p,{as:"label",htmlFor:"block-editor-inserter__search-".concat(o)},a),React.createElement("input",{ref:l,className:"block-editor-inserter__search-input",id:"block-editor-inserter__search-".concat(o),type:"search",placeholder:a,onChange:function(e){return r(e.target.value)},autoComplete:"off",value:n||""}),React.createElement("div",{className:"block-editor-inserter__search-icon"},!!n&&React.createElement(u,{icon:"close-small",label:i("Reset search","presto-player"),onClick:function(){r(""),l.current.focus()}}),!n&&React.createElement(d,{icon:"search"})))},y=r(3),v=r(4);function f(e){return h.apply(this,arguments)}function h(){return(h=Object(n.a)(l.a.mark((function e(t){var r,n,a,o;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=document.getElementById("presto-shortcode-input").value,n=t.currentTarget,a=n.textContent,t.currentTarget.textContent=Object(y.__)("Copied!","presto-player"),setTimeout((function(){n.textContent=a}),1500),!navigator.clipboard||!window.isSecureContext){e.next=9;break}return e.abrupt("return",navigator.clipboard.writeText(r));case 9:return(o=document.createElement("textarea")).value=r,o.style.position="fixed",o.style.left="-999999px",o.style.top="-999999px",document.body.appendChild(o),o.focus(),o.select(),e.abrupt("return",new Promise((function(e,t){document.execCommand("copy")?e():t(),o.remove()})));case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var O=function(){return React.createElement(v.PanelBody,{title:Object(y.__)("Timestamp Shortcode","presto-player")},React.createElement("div",{className:"block-editor-inserter__shortcode-input"},React.createElement("p",null,Object(y.__)("Add convenient links to skip the player to a specific timestamp.","presto-player")),React.createElement("input",{id:"presto-shortcode-input",style:{width:"100%",fontSize:"11px",marginBottom:"10px"},type:"text",readOnly:!0,value:'[pptime time="1:00"]Optional Text[/pptime]'}),React.createElement("button",{type:"button",className:"components-button is-primary",onClick:f},Object(y.__)("Copy to clipboard","presto-player"))))},g=function(e){var t=e.icon,r=e.title,n=e.id,a=e.selectBlock,o=e.i;return React.createElement("button",{type:"button",id:"video-".concat(n),tabIndex:o,onClick:a,role:"option",className:"components-button block-editor-block-types-list__item editor-block-list-item-kadence-spacer"},React.createElement("span",{className:"block-editor-block-types-list__item-icon"},React.createElement("span",{className:"block-editor-block-icon has-colors"},t)),React.createElement("span",{className:"block-editor-block-types-list__item-title"},r))},j=wp.i18n.__,w=wp.components,E=(w.Panel,w.PanelBody),R=w.Button,k=w.Spinner,P=wp.editPost,C=P.PluginSidebar,x=P.PluginSidebarMoreMenuItem,S=wp.element,N=S.Fragment,T=S.useEffect,D=S.useState,B=S.useCallback,A=wp.data,L=A.dispatch,I=A.useSelect,F=wp.blocks,V=F.createBlock,U=F.getBlockType,M=wp.apiFetch,z=wp.blockSerializationDefaultParser.parse;var W="presto-player",H={render:function(){var e,t,r,o=(e=D(0),(t=Object(a.a)(e,2))[0],r=t[1],function(){return r((function(e){return e+1}))}),c=React.createElement("svg",{viewBox:"0 0 35 34",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",null,React.createElement("path",{d:"M23.3722 16.9766L33.2059 11.2991L33.2059 22.6541L23.3722 16.9766Z",fillOpacity:"0.7"}),React.createElement("path",{d:"M23.3745 5.6227L33.2082 11.3002L23.3745 16.9776L23.3745 5.6227Z",fillOpacity:"0.75"}),React.createElement("path",{d:"M23.3745 5.62242L23.3745 16.9773L13.5409 11.2999L23.3745 5.62242Z",fillOpacity:"0.8"}),React.createElement("path",{d:"M23.399 5.613L13.5654 11.2905L13.5654 -0.0644536L23.399 5.613Z",fillOpacity:"0.85"}),React.createElement("path",{d:"M13.5699 11.3038L13.5699 22.6587L3.73623 16.9813L13.5699 11.3038Z",fillOpacity:"0.8"}),React.createElement("path",{d:"M13.5699 -0.0245525L13.5699 11.3304L3.73623 5.6529L13.5699 -0.0245525Z",fillOpacity:"0.9"}),React.createElement("path",{d:"M13.5699 22.6451L13.5699 34L3.73623 28.3226L13.5699 22.6451Z",fillOpacity:"0.7"}),React.createElement("path",{d:"M23.3745 16.9774L33.2082 22.6549L23.3745 28.3323L23.3745 16.9774Z",fillOpacity:"0.65"}),React.createElement("path",{d:"M3.73774 16.9774L13.5714 22.6549L3.73774 28.3323L3.73774 16.9774Z",fillOpacity:"0.75"}),React.createElement("path",{d:"M3.73774 5.63149L13.5714 11.3089L3.73774 16.9864L3.73774 5.63149Z",fillOpacity:"0.85"}),React.createElement("path",{d:"M23.3745 16.9772L23.3745 28.3321L13.5409 22.6546L23.3745 16.9772Z",fillOpacity:"0.6"})),React.createElement("defs",null,React.createElement("clipPath",{id:"clip0"},React.createElement("rect",{width:"35",height:"34",fill:"white"})))),i=D(!1),s=Object(a.a)(i,2),p=s[0],u=s[1],d=D(1),b=Object(a.a)(d,2),y=b[0],v=b[1],f=D(!1),h=Object(a.a)(f,2),w=h[0],P=h[1],S=D(""),A=Object(a.a)(S,2),F=A[0],W=A[1],H=B(_.debounce((function(e){K({replace:!0,term:e})}),250),[]);T((function(){H(F)}),[F]),T((function(){P(!0),K({replace:!1})}),[y]);var Y=I((function(e){return e("presto-player/player").getReusableVideos()}),[F,y]),G=Y.videos,q=Y.total_pages,Z=Y.hasResolved,K=function(){var e=Object(n.a)(l.a.mark((function e(t){var r,n,a,c,i,s;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.replace,n=t.term,e.next=3,M({path:wp.url.addQueryArgs("wp/v2/presto-videos",{search:n,page:y,per_page:10}),parse:!1});case 3:return a=e.sent,e.next=6,a.json();case 6:c=e.sent,i=a.headers&&parseInt(a.headers.get("X-WP-Total")),s=a.headers&&parseInt(a.headers.get("X-WP-TotalPages")),r?L("presto-player/player").updateVideos({videos:c,hasResolved:!0,total:i,total_pages:s}):(L("presto-player/player").appendVideos(c),L("presto-player/player").updateVideos({hasResolved:!0,total:i,total_pages:s})),o(),P(!1);case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();T((function(){u(y<q)}),[y,q]);var Q=function(){var e=y+1;v(e=e>q?q:e)},X=function(e){var t,r,n,a,o=z(null==e||null===(t=e.content)||void 0===t?void 0:t.raw);if(null!=o&&null!==(r=o[0])&&void 0!==r&&null!==(n=r.innerBlocks)&&void 0!==n&&null!==(a=n[0])&&void 0!==a&&a.blockName){var l,c,i,s,p=U(null==o||null===(l=o[0])||void 0===l||null===(c=l.innerBlocks)||void 0===c||null===(i=c[0])||void 0===i?void 0:i.blockName);return null!=p&&null!==(s=p.icon)&&void 0!==s&&s.src?p.icon.src:""}return""};return React.createElement(N,null,React.createElement(x,{target:"presto-player-sidebar",icon:c},j("Presto Player","presto-player")),React.createElement(C,{name:"presto-player-sidebar",title:j("Presto Player","presto-player"),icon:c},React.createElement(O,null),React.createElement(E,{title:j("Media Hub","presto-player")},React.createElement(m,{placeholder:"Search media...",value:F,onChange:function(e){return t=e,v(1),void W(t);var t}}),React.createElement("div",{className:"block-editor-inserter__panel-content"},Z?React.createElement("div",{role:"listbox",className:"block-editor-block-types-list presto-player__panel-grid-list",style:{display:"flex",flexWrap:"wrap"},"aria-label":j("Media Hub","presto-player")},G.length?G.map((function(e,t){var r;return React.createElement(g,{selectBlock:function(t){L("core/editor").insertBlock(V("presto-player/reusable-display",{id:null==e?void 0:e.id}))},icon:X(e),title:(null==e||null===(r=e.title)||void 0===r?void 0:r.raw)||"Untitled",id:null==e?void 0:e.id,i:t,key:null==e?void 0:e.id})})):function(){if(!G.length)return F?React.createElement("p",null,j("No videos found.","presto-player")):React.createElement(R,{href:"post-new.php?post_type=pp_video_block",isSecondary:!0},j("Create A Reusable Video","presto-player"))}(),!F&&p&&G.length?React.createElement("div",{style:{"margin-top":"20px","text-align":"center",display:"flex","justify-content":"center",width:"100%"}},React.createElement(R,{isSecondary:!0,isSmall:!0,onClick:Q,isBusy:w},"Load More")):""):React.createElement(k,null)))))}}},function(e,t,r){"use strict";r.r(t),r.d(t,"name",(function(){return ye})),r.d(t,"options",(function(){return ve}));var n=r(8),a=r(5),o=r(1),l=r(18),c=r(20),i=r(21),s=r(19),p=r.n(s),u=r(15),d=(lodash.noop,window.location.href),b=wp.components,m=b.Button,y=(b.Notice,b.Placeholder),v=(b.DropZone,b.withFilters),f=(b.BaseControl,b.ToggleControl,b.FormFileUpload,wp.i18n.__),h=wp.element,O=h.useState,g=h.useEffect,j=wp.data.useSelect,w=(wp.deprecated,wp.editor),_=w.MediaUpload,E=w.MediaUploadCheck,R=w.URLPopover,k=function(e){var t=e.src,r=e.onChange,n=e.onSubmit,a=e.onClose;return React.createElement(R,{onClose:a},React.createElement("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n},React.createElement("input",{"data-cy":"url-input",className:"block-editor-media-placeholder__url-input-field",type:"url","aria-label":f("URL","presto-player"),placeholder:f("Paste or type a Youtube, Vimeo or .mp4 video URL","presto-player"),onChange:r,value:t}),React.createElement(m,{"data-cy":"url-submit",className:"block-editor-media-placeholder__url-input-submit-button",icon:"editor-break",label:f("Apply","presto-player"),type:"submit"})))};var P,C=v("editor.MediaPlaceholder")((function(e){var t=e.value,r=void 0===t?{}:t,n=e.allowedTypes,a=void 0===n?[]:n,l=e.className,c=e.icon,i=e.url,s=void 0===i||i,b=e.labels,v=void 0===b?{}:b,h=e.mediaPreview,w=e.notices,R=e.isAppender,P=e.isPrivate,C=e.addToGallery,x=e.onSelect,S=e.onCancel,N=e.onSelectURL,T=e.onDoubleClick,D=e.children,B=e.allowURLs,A=j((function(e){return(0,e("core/block-editor").getSettings)().mediaUpload}),[]),L=O(""),I=Object(o.a)(L,2),F=I[0],V=I[1],U=O(!1),M=Object(o.a)(U,2),z=M[0],W=M[1];g((function(){var e;V(null!==(e=null==r?void 0:r.src)&&void 0!==e?e:"")}),[r]);var H=function(e){V(e.target.value)},Y=function(){W(!0)},G=function(){W(!1)},q=function(e){e.preventDefault(),F&&N&&(N(F),G())},Z=function(e,t){var r=v.instructions,n=v.title;A||N||(r=f("To edit this block, you need permission to upload media.","presto-player"));var a=p()("block-editor-media-placeholder",l,{"is-appender":R});return React.createElement(y,{icon:c,label:n,instructions:r,className:a,notices:w,onClick:t,onDoubleClick:T,preview:h},D,e)},K=function(){return N&&React.createElement("div",{className:"block-editor-media-placeholder__url-input-container"},s&&React.createElement(m,{"data-cy":"video-url",className:"block-editor-media-placeholder__button",onClick:Y,isPressed:z,isTertiary:!0},f("Video URL","presto-player")),z&&React.createElement(k,{src:F,onChange:H,onSubmit:q,onClose:G}))};return React.createElement(E,{fallback:Z(K())},function(){var e=React.createElement(_,{title:f(P?"Select or Upload Private Video":"Select or Upload Video","presto-player"),addToGallery:C,gallery:!1,multiple:!1,onSelect:function(e){u.a.unsetUrlParams(),x(e)},onClose:function(){u.a.unsetUrlParams()},allowedTypes:a,value:Array.isArray(r)?r.map((function(e){return e.id})):r.id,render:function(e){var t=e.open;return React.createElement(m,{"data-cy":"add-video",isPrimary:!0,onClick:function(e){e.stopPropagation(),u.a.unsetUrlParams(),P?u.a.setUrlPrivate(d):u.a.setUrlPublic(d),t()}},f(P?"Add/Select Private Video":"Add/Select Video","presto-player"))}});if(A){var t=React.createElement(React.Fragment,null,e,!!B&&K(),S&&React.createElement(m,{className:"block-editor-media-placeholder__cancel-button",title:f("Cancel","presto-player"),isLink:!0,onClick:S},f("Cancel","presto-player")));return Z(t)}return Z(e)}())})),x=r(10),S=wp.i18n.__,N=wp.components,T=N.withNotices,D=N.BaseControl,B=N.ToggleControl,A=N.Notice,L=wp.data.dispatch,I=["video"],F=T((function(e){var t,r=e.noticeUI,n=e.onSelect,a=e.children,o=e.onSelectURL,l=e.onUploadError,c=e.setAttributes,i=e.attributes,s="private"===i.visibility;return React.createElement("div",null,React.createElement(C,{icon:s?React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),React.createElement("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})):React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("polygon",{points:"23 7 16 12 23 17 23 7"}),React.createElement("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2",ry:"2"})),labels:{title:S(s?"Presto Private Video":"Presto Video","presto-player"),instructions:S(s?"Upload a video file, or pick one from your media library.":"Upload a video file, pick one from your media library, or add one with a URL.","presto-player")},onSelect:n,onSelectURL:o,switcher:!0,isPrivate:s,allowURLs:!s,accept:"video/*",setAttributes:c,allowedTypes:I,value:i,notices:r,onError:l},React.createElement("div",{style:{width:"100%"}},React.createElement(D,{className:"presto-player__placeholder-control"},React.createElement(B,{label:React.createElement("div",null,S("Make Private","presto-player")," ",!(null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium)&&React.createElement(x.a,null)),help:S(s?"This video is only accessible to those who are logged in.":"This video is currently accessible to everyone.","presto-player"),checked:s,onChange:function(e){var t;null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium?c({visibility:e?"private":"public"}):L("presto-player/player").setProModal(!0)}})),!!a&&React.createElement("div",{style:{width:"100%"}},a),!!s&&React.createElement(A,{status:"warning",isDismissible:!1},React.createElement("div",null,React.createElement("div",null,React.createElement("strong",null,S("Note","presto-player"))),S("Private videos use php to stream your video. Keep in mind this will use up disk space and bandwidth so it may not be an appropriate choice for some hosts.","presto-player"))))))})),V=r(34),U=r(22),M=r(14),z=wp.i18n.__,W=wp.blob,H=W.getBlobByURL,Y=W.isBlobURL,G=wp.components,q=G.Button,Z=G.Disabled,K=G.Toolbar,Q=G.Notice,X=G.withNotices,$=G.Placeholder,J=G.Spinner,ee=wp.editor,te=ee.BlockControls,re=ee.InspectorControls,ne=wp.compose.compose,ae=wp.element,oe=ae.useEffect,le=ae.useState,ce=wp.data.dispatch,ie=wp.blocks.createBlock,se=["video"],pe=ne([Object(i.a)(),Object(c.a)()])(X((function(e){e.noticeUI;var t=e.attributes,r=e.setAttributes,n=(e.isSelected,e.noticeOperations),a=e.branding,c=e.loading,i=e.presetData,s=e.createVideo,p=e.onRemoveSrc,u=e.renderKey,d=e.lockSave,b=e.unlockSave,m=e.clientId,y=e.defaultPreset,v=t.poster,f=t.src,h=t.id,O=t.tracks,g=le(""),j=Object(o.a)(g,2),w=j[0],_=j[1],E=function(e){n.removeAllNotices(),n.createErrorNotice(null==e?void 0:e.message)};return oe((function(){if(!h&&Y(f)){var e=H(f);e&&mediaUpload({filesList:[e],onFileChange:function(e){var t=Object(o.a)(e,1)[0].url;r({src:t})},onError:function(e){n.createErrorNotice(e)},allowedTypes:se})}}),[]),f?c||!h?React.createElement($,{className:"presto-player__placeholder is-loading"},React.createElement(J,null)):React.createElement("div",null,React.createElement(te,null,React.createElement(V.a,{tracks:O,onChange:function(e){r({tracks:e})}}),React.createElement(K,null,React.createElement(q,{onClick:function(){return p()}},z("Replace","presto-player")))),React.createElement(re,null,React.createElement(U.a,{setAttributes:r,attributes:t})),React.createElement("figure",null,React.createElement(Z,null,React.createElement(M.a,{poster:v,src:f,id:h,type:"hosted",attributes:t,setAttributes:r,preset:i,branding:a,key:u})))):React.createElement("div",null,React.createElement(F,{onSelect:function(e){e&&e.url?(r({src:e.url,preset:null==y?void 0:y.id,attachment_id:e.id}),d(),s({src:e.url,type:"attachment",attachment_id:e.id}).catch((function(e){r({src:""}),E(e)})).finally(b)):r({src:void 0,id:void 0})},onSelectURL:function(e){var t;if(r({attachment_id:null}),e&&Object(l.d)(e)&&(null===(t=prestoPlayer)||void 0===t||!t.isPremium))return void _(React.createElement(Q,{status:"info",onRemove:function(){return _("")}},React.createElement("div",null,React.createElement("div",null,React.createElement("strong",null,z("Get HLS Streaming and more with Presto Player Pro!","presto-player"))),z("Stream HLS links and more with Presto Player Pro.","presto-player"),React.createElement("div",{style:{marginTop:"1em"}},React.createElement(q,{isPrimary:!0},z("Upgrade","presto-player"))))));if(e!==f){var n=Object(l.a)(e).type;if("youtube"===n){var a=ie("presto-player/youtube",{src:e});return void ce("core/editor").replaceBlock(m,a)}if("vimeo"===n){var o=ie("presto-player/vimeo",{src:e});return void ce("core/editor").replaceBlock(m,o)}r({src:e,attachmend_id:null}),r({preset:null==y?void 0:y.id}),d(),s({src:e,type:"link"}).catch((function(e){r({src:""}),E(e)})).finally(b)}},setAttributes:r,attributes:t,onError:function(e){n.removeAllNotices(),n.createErrorNotice(e)}},w))}))),ue=r(17);function de(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?de(Object(r),!0).forEach((function(t){Object(a.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):de(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var me=wp.i18n.__,ye="presto-player/self-hosted",ve=be(be({},ue.a),{},{title:me("Presto Video","presto-player"),description:me("Presto Self-hosted video block.","presto-player"),variations:[{name:"public",isDefault:!0,title:me("Presto Video","presto-player"),description:me("Presto Self-hosted video block.","presto-player"),attributes:{visibility:"public"}}].concat(Object(n.a)(null!==(P=prestoPlayer)&&void 0!==P&&P.isPremium?[{name:"private",title:me("Presto Private Video","presto-player"),icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),React.createElement("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})),description:me("Private video self-hosted block.","presto-player"),attributes:{visibility:"private"}}]:[])),icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("polygon",{points:"23 7 16 12 23 17 23 7"}),React.createElement("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2",ry:"2"})),edit:pe})},function(e,t,r){"use strict";r.r(t),r.d(t,"name",(function(){return E})),r.d(t,"options",(function(){return R}));var n=r(1),a=wp.i18n.__,o=wp.blockEditor,l=o.InnerBlocks,c=o.useBlockProps,i=wp.editor,s=(i.BlockControls,i.InspectorControls),p=wp.components,u=p.Disabled,d=(p.Toolbar,p.Button),b=p.PanelBody,m=(p.Panel,p.Placeholder),y=p.Spinner,v=wp.data,f=v.useSelect,h=v.dispatch,O=wp.element,g=O.useState,j=O.useEffect,w=wp.blockSerializationDefaultParser.parse,_=wp.blockEditor,E=(_.InnerBlocks,_.useBlockProps,"presto-player/reusable-display"),R={title:"Reusable Block Display",category:"presto",attributes:{id:Number},supports:{align:!0,inserter:!1,reusable:!1,html:!1},icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("circle",{cx:"12",cy:"12",r:"10"}),React.createElement("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),React.createElement("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})),edit:function(e){var t,r=e.attributes,o=e.isSelected,i=e.clientId,p=r.id,v=c(),O=g(!1),_=Object(n.a)(O,2),E=_[0],R=_[1],k=g([]),P=Object(n.a)(k,2),C=P[0],x=P[1],S=g(""),N=Object(n.a)(S,2),T=N[0],D=N[1],B=f((function(e){if(p)return e("presto-player/player").getReusableVideo(p)}));j((function(){wp.data.dispatch("core/block-editor").selectBlock(i)}),[E]);var A=f((function(e){return e("core/editor").getBlocksByClientId(i)[0].innerBlocks}));return A&&null!=B&&B.id&&A.forEach((function(e){h("core/editor").updateBlockAttributes(e.clientId,{selectionOverrideClientId:i})})),j((function(){if(B.id){var e,t,r;R(!0);var n=w(null==B||null===(e=B.content)||void 0===e?void 0:e.raw);x([null==n||null===(t=n[0])||void 0===t?void 0:t.innerBlocks[0].blockName,null==n||null===(r=n[0])||void 0===r?void 0:r.innerBlocks[0].attrs]),D("post.php?post=".concat(B.id,"&action=edit"))}}),[B]),E?C?React.createElement(React.Fragment,null,React.createElement(s,null,React.createElement(b,null,React.createElement("p",null,"This is a reusable video that you can edit once and place anywhere."),React.createElement(d,{isSecondary:!0,href:"edit.php?post_type=pp_video_block"},a("Manage Media Hub","presto-player")))),React.createElement("div",{className:"block-library-block__reusable-block-container"},React.createElement("div",v,o&&React.createElement("div",{className:"reusable-block-edit-panel"},React.createElement("b",{className:"reusable-block-edit-panel__info"},null==B||null===(t=B.title)||void 0===t?void 0:t.raw),React.createElement(d,{isSecondary:!0,href:T,className:"reusable-block-edit-panel__button"},a("Edit Reusable Video","presto-player"))),React.createElement(u,null,React.createElement(l,{template:[C],templateLock:"all",renderAppender:!1}))))):void 0:React.createElement("div",v,React.createElement(m,null,React.createElement(y,null)))},save:function(){return null}}},function(e,t,r){"use strict";r.r(t),r.d(t,"name",(function(){return C})),r.d(t,"options",(function(){return x}));var n=r(5),a=r(20),o=r(21),l=r(22),c=r(14),i=r(37),s=r(18),p=r(9),u=wp.components,d=u.Button,b=u.Disabled,m=u.Toolbar,y=u.Placeholder,v=u.Spinner,f=u.withNotices,h=wp.editor,O=h.BlockControls,g=h.InspectorControls,j=wp.element.useEffect,w=wp.i18n.__,_=(0,wp.compose.compose)([Object(o.a)(),Object(a.a)()])(f((function(e){var t=e.attributes,r=e.setAttributes,n=e.branding,a=e.noticeOperations,o=e.loading,u=e.createVideo,f=e.lockSave,h=e.unlockSave,_=e.presetData,E=e.onRemoveSrc,R=e.renderKey,k=t.poster,P=t.src,C=t.id,x=Object(p.f)(P);return j((function(){x&&r({id:0});var e=Object(s.b)(P);r({video_id:e}),f(),u({src:P,external_id:e,type:"vimeo"}).catch((function(e){r({src:""}),function(e){a.removeAllNotices(),a.createErrorNotice(null==e?void 0:e.message)}(e)})).finally(h)}),[P]),P?o||!C?React.createElement(y,{className:"presto-player__placeholder is-loading"},React.createElement(v,null)):React.createElement(React.Fragment,null,React.createElement(O,null,React.createElement(m,null,React.createElement(d,{onClick:function(){return E()}},w("Replace","presto-player")))),React.createElement(g,null,React.createElement(l.a,{setAttributes:r,attributes:t})),React.createElement("figure",null,React.createElement(b,null,React.createElement(c.a,{poster:k,src:P,type:"vimeo",id:C,attributes:t,setAttributes:r,preset:_,branding:n,key:R})))):React.createElement("div",null,React.createElement(i.a,{icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("path",{d:"M22.875 10.063c-2.442 5.217-8.337 12.319-12.063 12.319-3.672 0-4.203-7.831-6.208-13.043-.987-2.565-1.624-1.976-3.474-.681l-1.128-1.455c2.698-2.372 5.398-5.127 7.057-5.28 1.868-.179 3.018 1.098 3.448 3.832.568 3.593 1.362 9.17 2.748 9.17 1.08 0 3.741-4.424 3.878-6.006.243-2.316-1.703-2.386-3.392-1.663 2.673-8.754 13.793-7.142 9.134 2.807z"})),label:w("Presto Vimeo Video","presto-player"),instructions:w("Enter Vimeo Video URL","presto-player"),placeholder:w("Vimeo URL","presto-player"),attributes:t,setAttributes:r,onSelectURL:function(e){e!==P&&r({src:e})}}))}))),E=r(17);function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var P=wp.i18n.__,C="presto-player/vimeo",x=k(k({},E.a),{},{attributes:k(k({},E.a.attributes),{},{video_id:{type:String}}),title:P("Presto Vimeo Video","presto-player"),description:P("A vimeo video wrapped in an awesome player.","presto-player"),icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("path",{d:"M22.875 10.063c-2.442 5.217-8.337 12.319-12.063 12.319-3.672 0-4.203-7.831-6.208-13.043-.987-2.565-1.624-1.976-3.474-.681l-1.128-1.455c2.698-2.372 5.398-5.127 7.057-5.28 1.868-.179 3.018 1.098 3.448 3.832.568 3.593 1.362 9.17 2.748 9.17 1.08 0 3.741-4.424 3.878-6.006.243-2.316-1.703-2.386-3.392-1.663 2.673-8.754 13.793-7.142 9.134 2.807z"})),edit:_})},function(e,t,r){"use strict";r.r(t),r.d(t,"name",(function(){return C})),r.d(t,"options",(function(){return x}));var n=r(5),a=r(20),o=r(21),l=r(22),c=r(14),i=r(37),s=r(18),p=r(9),u=wp.components,d=u.Button,b=u.Disabled,m=u.Toolbar,y=u.Placeholder,v=u.Spinner,f=u.withNotices,h=wp.editor,O=h.BlockControls,g=h.InspectorControls,j=wp.element.useEffect,w=wp.i18n.__,_=(0,wp.compose.compose)([Object(o.a)(),Object(a.a)()])(f((function(e){var t=e.attributes,r=e.setAttributes,n=e.noticeOperations,a=e.branding,o=e.createVideo,u=e.loading,f=e.presetData,h=e.onRemoveSrc,_=e.lockSave,E=e.unlockSave,R=e.renderKey,k=t.poster,P=t.src,C=t.id,x=Object(p.f)(P);return j((function(){x&&r({id:0});var e=Object(s.c)(P);r({video_id:e}),_(),o({src:P,external_id:e,type:"youtube"}).catch((function(e){r({src:""}),function(e){n.removeAllNotices(),n.createErrorNotice(null==e?void 0:e.message)}(e)})).finally(E)}),[P]),P?u||!C?React.createElement(y,{className:"presto-player__placeholder is-loading"},React.createElement(v,null)):React.createElement(React.Fragment,null,React.createElement(O,null,React.createElement(m,null,React.createElement(d,{onClick:function(){return h()}},w("Replace","presto-player")))),React.createElement(g,null,React.createElement(l.a,{setAttributes:r,attributes:t})),React.createElement("figure",null,React.createElement(b,null,React.createElement(c.a,{poster:k,src:P,type:"youtube",id:C,attributes:t,setAttributes:r,preset:f,branding:a,key:R})))):React.createElement("div",null,React.createElement(i.a,{icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("path",{d:"M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2 29 29 0 0 0 .46-5.25 29 29 0 0 0-.46-5.33z"}),React.createElement("polygon",{points:"9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02"})),label:w("Presto Youtube Video","presto-player"),instructions:w("Enter Youtube Video URL","presto-player"),placeholder:w("Youtube URL","presto-player"),attributes:t,setAttributes:r,onSelectURL:function(e){e!==P&&r({src:e})}}))}))),E=r(17);function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var P=wp.i18n.__,C="presto-player/youtube",x=k(k({},E.a),{},{attributes:k(k({},E.a.attributes),{},{video_id:{type:String}}),title:P("Presto Youtube Video","presto-player"),description:P("A youtube video wrapped in an awesome player.","presto-player"),icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("path",{d:"M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2 29 29 0 0 0 .46-5.25 29 29 0 0 0-.46-5.33z"}),React.createElement("polygon",{points:"9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02"})),edit:_})}],[[55,1,2]]]);
|
19 |
-
//# sourceMappingURL=admin-15afa29d.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dist/blocks/admin-15afa29d.js.map
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"version":3,"sources":["webpack:///external [\"wp\",\"i18n\"]","webpack:///external [\"wp\",\"components\"]","webpack:///./src/admin/blocks/util.js","webpack:///./src/admin/blocks/shared/components/ProBadge.js","webpack:///./src/admin/blocks/shared/components/ColorPopup.js","webpack:///external [\"wp\",\"element\"]","webpack:///./src/admin/blocks/shared/Player.js","webpack:///./src/admin/blocks/shared/helpers.js","webpack:///external [\"wp\",\"data\"]","webpack:///./src/admin/blocks/blocks/attributes.js","webpack:///./src/admin/blocks/blocks/block-options.js","webpack:///./src/shared/util.js","webpack:///./src/admin/blocks/blocks/with-player-edit.js","webpack:///./src/admin/blocks/blocks/with-player-data.js","webpack:///./src/admin/blocks/shared/overlays/index.js","webpack:///./src/admin/blocks/shared/presets/Behavior.js","webpack:///./src/admin/blocks/shared/presets/Controls.js","webpack:///./src/admin/blocks/shared/presets/Watermark.js","webpack:///./src/admin/blocks/shared/presets/Style.js","webpack:///./src/admin/blocks/shared/presets/Edit.js","webpack:///./src/admin/blocks/shared/presets/Preset.js","webpack:///./src/admin/blocks/shared/presets/index.js","webpack:///./src/admin/blocks/shared/settings/MutedPreviewOptions.js","webpack:///./src/admin/blocks/shared/settings/index.js","webpack:///./src/admin/blocks/shared/BlockInspectorControls.js","webpack:///../../../src/components/react-component-lib/utils/case.ts","webpack:///../../../src/components/react-component-lib/utils/attachProps.ts","webpack:///../../../src/components/react-component-lib/utils/index.tsx","webpack:///../../src/components/react-component-lib/createComponent.tsx","webpack:///../src/components/index.ts","webpack:///external [\"wp\",\"blockEditor\"]","webpack:///./src/admin/blocks/shared/components/UrlSelect.js","webpack:///./src/admin/blocks/shared/branding/index.js","webpack:///external [\"wp\",\"compose\"]","webpack:///./src/admin/ui/Menu.js","webpack:///./src/admin/blocks/shared/presets/CTA.js","webpack:///./src/shared/services/fetch.js","webpack:///./src/admin/blocks/shared/tracks/TracksEditor.js","webpack:///./src/admin/blocks/shared/Preview.js","webpack:///./src/admin/blocks/shared/overlays/components/DynamicText.js","webpack:///./src/admin/blocks/shared/LinkPlaceholder.js","webpack:///./src/admin/blocks/shared/components/LoadSelect.js","webpack:///./src/admin/blocks/shared/presets/parts/MailchimpConfig.js","webpack:///./src/admin/blocks/shared/presets/parts/MailerLiteConfig.js","webpack:///./src/admin/blocks/shared/presets/parts/ActiveCampaignConfig.js","webpack:///./src/admin/blocks/shared/presets/parts/FluentCRMConfig.js","webpack:///./src/admin/blocks/shared/presets/parts/ChooseProvider.js","webpack:///./src/admin/blocks/shared/presets/Email.js","webpack:///./src/admin/blocks/shared/chapters/components/Chapter.js","webpack:///./src/admin/blocks/shared/chapters/index.js","webpack:///./src/admin/blocks/shared/presets/parts/YoutubeChannelId.js","webpack:///./src/admin/blocks/shared/presets/ActionBar.js","webpack:///external [\"wp\",\"editor\"]","webpack:///./src/admin/blocks/shared/overlays/Edit.js","webpack:///./src/admin/blocks/shared/overlays/components/Overlay.js","webpack:///./src/admin/blocks/blocks sync index\\.js$","webpack:///./src/admin/blocks/blocks/reusable-edit/index.js","webpack:///./src/admin/blocks/plugins sync index\\.js$","webpack:///./src/admin/blocks/shared/services/bunny.js","webpack:///./src/admin/blocks/shared/media/chunk-upload.js","webpack:///./src/admin/blocks/shared/media/MediaItem.js","webpack:///./src/admin/blocks/shared/media/MediaFolder.js","webpack:///./src/admin/blocks/shared/media/MediaPopup.js","webpack:///./src/admin/blocks/blocks/bunny/StorageMedia.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/store/reducer.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/store/selectors.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/store/actions.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/store/store.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/utils.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/Sidebar.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/ProgressBar.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/ProgressOverlay.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/ThumbTemplate.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/video/Video.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/Loading.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/video/Videos.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/collections/Collection.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/collections/Collections.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/collections/CreateCollection.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/Header.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/Footer.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/BackButton.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/CollectionHeader.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/upload/Upload.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/upload/Uploads.js","webpack:///./src/admin/blocks/shared/media/MediaPopupTemplate.js","webpack:///./src/admin/blocks/blocks/bunny/popup/stream/Popup.js","webpack:///./src/admin/blocks/blocks/bunny/StreamMedia.js","webpack:///./src/admin/blocks/blocks/bunny/useStorageConnection.js","webpack:///./src/admin/blocks/blocks/bunny/useStreamConnection.js","webpack:///./src/admin/blocks/blocks/bunny/APIPlaceholder.js","webpack:///./src/admin/blocks/blocks/bunny/edit.js","webpack:///./src/admin/blocks/blocks/bunny/index.js","webpack:///./src/admin/blocks/shared/audio-placeholder.js","webpack:///./src/admin/blocks/blocks/audio/HostedAudioPlaceholder.js","webpack:///./src/admin/blocks/shared/audioPresets/Preview.js","webpack:///./src/admin/blocks/shared/audioPresets/Behavior.js","webpack:///./src/admin/blocks/shared/audioPresets/Controls.js","webpack:///./src/admin/blocks/shared/audioPresets/Style.js","webpack:///./src/admin/blocks/shared/audioPresets/Edit.js","webpack:///./src/admin/blocks/shared/audioPresets/Preset.js","webpack:///./src/admin/blocks/shared/audioPresets/index.js","webpack:///./src/admin/blocks/blocks/audio/AudioBlockInspectorControl.js","webpack:///./src/admin/blocks/blocks/audio/with-player-edit.js","webpack:///./src/admin/blocks/blocks/audio/with-player-data.js","webpack:///./src/admin/blocks/blocks/audio/edit.js","webpack:///./src/admin/blocks/blocks/audio/index.js","webpack:///./src/admin/blocks/store/player/reducer.js","webpack:///./src/admin/blocks/store/player/selectors.js","webpack:///./src/admin/blocks/store/player/actions.js","webpack:///./src/admin/blocks/store/player/controls.js","webpack:///./src/admin/blocks/store/player/resolvers.js","webpack:///./src/admin/blocks/store/player/index.js","webpack:///./src/admin/blocks/shared/ProUpgradeModal.js","webpack:///./src/admin/blocks/blocks.js","webpack:///./src/admin/blocks/plugins/reusable-videos/SearchForm.js","webpack:///./src/admin/blocks/plugins/reusable-videos/ShortcodeInput.js","webpack:///./src/admin/blocks/plugins/reusable-videos/Video.js","webpack:///./src/admin/blocks/plugins/reusable-videos/render.js","webpack:///./src/admin/blocks/plugins/reusable-videos/index.js","webpack:///./src/admin/blocks/shared/placeholder.js","webpack:///./src/admin/blocks/blocks/hosted/HostedPlaceholder.js","webpack:///./src/admin/blocks/blocks/hosted/edit.js","webpack:///./src/admin/blocks/blocks/hosted/index.js","webpack:///./src/admin/blocks/blocks/reusable-display/edit.js","webpack:///./src/admin/blocks/blocks/reusable-display/index.js","webpack:///./src/admin/blocks/blocks/vimeo/edit.js","webpack:///./src/admin/blocks/blocks/vimeo/index.js","webpack:///./src/admin/blocks/blocks/youtube/edit.js","webpack:///./src/admin/blocks/blocks/youtube/index.js"],"names":["module","exports","window","wp","element","useRef","useEffect","usePrevious","value","ref","current","snackbarNotice","status","message","data","dispatch","createNotice","type","timeToSeconds","time","seconds","pieces","split","length","parseInt","secondsToTime","number","minutes","Math","floor","sanitizeTime","draft","replace","includes","substr","indexOf","index","substring","getProvider","src","match","__","i18n","className","components","ColorPicker","ColorIndicator","Popover","Button","Flex","useState","color","setColor","onFocus","open","setOpen","original","setOriginal","css","width","height","borderRadius","colorValue","onClick","position","focusOnMount","onFocusOutside","e","onChangeComplete","hex","disableAlpha","display","alignItems","justifyContent","padding","margin","isTertiary","isPrimary","useSelect","classes","preset","branding","attributes","adminPreview","currentTime","preload","overlays","chapters","mutedOverlay","mutedPreview","youtube","select","playerCSS","style","border_radius","background_color","control_color","hexCode","opacity","r","g","b","convertHex","caption_background","email_collection","logo_width","isAdmin","bunny","thumbnail","previewThumbnail","preview","channelId","channel_id","tracks","captions","kind","label","srclang","default","blockAttributes","poster","provider","mediaTitle","title","slot","enabled","left","focalPoint","x","top","y","transform","helpers","setUrlPrivate","separator","location","href","newurl","history","pushState","path","setUrlPublic","unsetUrlParams","removed","url","parameters","parsedUrl","URL","forEach","param","searchParams","delete","removeURLParameters","visibility","String","blockAlignment","Object","mutedPreviewCaptions","Boolean","mutedOverlayType","mutedOverlayText","mutedOverlaySrc","mutedOverlayImageWidth","Number","mutedOverlayFocalPoint","text","Array","items","category","supports","align","save","getYoutubeId","getVimeoId","parseUrl","exec","determineVideoUrlType","youtube_id","video_id","vimeo_id","$video_id","$type","isHLS","createHigherOrderComponent","compose","WrappedComponent","props","presets","setAttributes","defaultPreset","isSelected","presetData","setPresetData","count","setCount","id","openGeneralSidebar","selectionOverrideClientId","selectBlock","thisPreset","find","onUpdate","logo","prevChapters","times","map","item","prevTimes","_","difference","createVideo","a","external_id","attachment_id","apiFetch","method","post_id","getCurrentPostId","lockSave","lockPostSaving","unlockSave","unlockPostSaving","onRemoveSrc","confirm","undefined","previewSrc","renderKey","withSelect","loading","isResolving","getPresets","getDefaultPreset","BaseControl","withNotices","Spinner","VideoOverlays","modal","setModal","prestoPlayer","isPremium","setProModal","ProBadge","Edit","closeModal","updateOverlayAttribute","ToggleControl","HorizontalRule","AlignmentMatrixControl","__experimentalAlignmentMatrixControl","SelectControl","state","updateState","help","onChange","auto_hide","checked","save_player_position","captions_enabled","play_video_viewport","sticky_scroll","sticky_scroll_position","on_video_end","options","hide_youtube","lazy_load_youtube","play","rewind","progress","volume","mute","speed","pip","fullscreen","RadioControl","RangeControl","watermark","defaults","backgroundColor","keys","key","updateWatermarkState","updated","DynamicText","update","selected","VisualLabel","ColorPopup","min","max","hide_logo","labelPosition","caption_style","TextControl","Icon","Notice","FlexItem","FlexBlock","Modal","EditPlayerPreset","addPreset","onSave","updatePreset","name","reset_on_end","skin","cta","action_bar","setLoading","error","setError","menu","setMenu","thisName","setThisName","setState","setValue","genericError","putPreset","addQueryArgs","root","prestoVersionString","_method","saved","updateYoutube","presto_player_youtube","response","setYoutube","onClose","console","log","createPreset","tabs","icon","component","Controls","Behavior","Style","Email","CTA","ActionBar","Watermark","onRequestClose","overlayClassName","data-cy","hideLabelFromVision","placeholder","autoFocus","Menu","onSelect","Preview","isDismissible","isBusy","disabled","ButtonGroup","isActive","remove","setPreset","onEdit","confirmOpen","setConfirmOpen","closeConfirm","trashPreset","role","tabIndex","aria-label","border","slug","textAlign","fontSize","charAt","toUpperCase","fontWeight","textTransform","is_locked","maxWidth","isDestructive","boxShadow","setName","removePreset","i","Preset","PanelRow","FocalPointPicker","blockEditor","MediaUpload","MediaUploadCheck","VIDEO_OVERLAY_ALLOWED_MEDIA_TYPES","instanceId","videoOverlayDescription","image","allowedTypes","render","hidden","sprintf","dimensions","VIDEO_POSTER_ALLOWED_MEDIA_TYPES","useInstanceId","VideoSettings","autoplay","playsInline","videoPosterDescription","toggleAttribute","attribute","newValue","MutedPreviewOptions","target","textDecoration","aria-describedby","PanelBody","initialOpen","eventNameSuffix","LinkControl","__experimentalLinkControl","prependHTTP","setSettings","settings","visible","setVisible","nextLinkValue","setNextLinkValue","linkValue","opensInNewTab","onChangeLink","nextValue","didToggleSettingForNewLink","newUrl","isSmall","VIDEO_LOGO_ALLOWED_MEDIA_TYPES","PlayerSettings","pickerRender","setPickerRender","saveOptions","updateBranding","isSecondary","lodash","partial","noop","NavigableMenu","Animate","children","orientation","activeClass","setSelected","setOrigin","handleClick","itemKey","onNavigate","childIndex","child","click","selectedTab","selectedId","origin","aria-labelledby","classnames","class","xmlns","viewBox","aria-hidden","focusable","d","itemId","aria-controls","ariaHidden","percentage","show_rewatch","show_skip","headline","show_button","button_text","button_link","updateCTAState","marks","shiftStep","isLink","val","bottom_text","button_radius","button_color","button_text_color","background_opacity","defaultProps","catName","eyeColor","age","use","createNonceMiddleware","nonce","createRootURLMiddleware","MenuItem","FormFileUpload","MenuGroup","ToolbarGroup","ToolbarButton","Dropdown","SVG","Rect","Path","ALLOWED_TYPES","captionIcon","fill","fillRule","clipRule","TrackList","content","onEditPress","track","SingleTrackEditor","onRemove","srcLang","fileName","startsWith","lastIndexOf","newLabel","newSrcLang","changes","hasChanges","TracksEditor","mediaUpload","getSettings","trackBeingEdited","setTrackBeingEdited","contentClassName","renderToggle","isOpen","onToggle","showTooltip","aria-expanded","aria-haspopup","renderContent","newTrack","newTracks","filter","_track","trackIndex","event","files","filesList","onFileChange","accept","openFileDialog","Disabled","isDisabled","setRenderKey","previews","email","defaultHeadline","bottomText","allowSkip","allow_skip","skipText","buttonText","bottom-text","button-link","allow-skip","allow-rewatch","skip-text","show-button","button-text","prestoPlayerAdmin","TextareaControl","more","setMore","preventDefault","marginTop","autoComplete","Placeholder","onSelectURL","instructions","onSubmit","marginBottom","updateEmailState","fetching","setFetching","lists","setLists","fetchLists","fetched","listOptions","list","LoadSelect","provider_list","provider_tag","groups","setGroups","fetchGroups","fetchingLists","setFetchingLists","fetchingTags","setFetchingTags","tags","setTags","fetchTags","tagOptions","tag","optionsMap","presto_player_activecampaign","presto_player_mailchimp","presto_player_mailerlite","presto_player_fluentcrm","fetchSettings","settingsToSet","connected","found","setting","MailchimpConfig","MailerLiteConfig","ActiveCampaignConfig","FluentCRMConfig","emailProviderOptions","ChooseProvider","Chapter","add","showNotice","draftTime","setDraftTime","onBlur","setDraft","sort","chapter","itemIndex","updateChapter","removeChapter","ExternalLink","saving","setSaving","userCanReadSettings","canUser","handleSubmit","editYoutube","setEditYoutube","updateActionBar","button_type","percentage_start","button_count","YoutubeChannelId","renderYoutubeChannelForm","UrlSelect","EditOverlay","setCurrentTime","getPreset","addOverlay","defaultOverlay","startTime","endTime","link","nanoid","shouldCloseOnClickOutside","overlay","overlayIndex","updateOverlay","removeOverlay","updateCurrentTime","process","nextTick","updateCurrentTimeState","invert_time","withFocusReturn","Overlay","draftStartTime","setDraftStartTime","draftEndTime","setDraftEndTime","draftPosition","setDraftPosition","startControl","updateStartTime","justify","webpackContext","req","webpackContextResolve","__webpack_require__","o","Error","code","resolve","InnerBlocks","useBlockProps","plugins","unregisterPlugin","getPlugins","inserter","reusable","html","stroke","strokeWidth","strokeLinecap","strokeLinejoin","cx","cy","x1","y1","x2","y2","edit","blockProps","clientId","innerBlocks","getBlock","setTemplateValidity","insertBlockType","block","blocks","createBlock","insertBlock","templateLock","renderAppender","ButtonBlockAppender","points","rx","ry","Content","signURL","file","onProgress","onComplete","onError","chunk","cancelled","max_request_size","wp_max_upload_size","slice_size","upload_file","start","next_slice","blob","slice","chunks","ceil","size","body","FormData","append","file_url","percent_done","FileReader","cancel","date","isEncoding","encodeProgress","bytes","round","pow","bytesToSize","updated_at","Date","toLocaleString","Card","CardBody","DropZone","DropZoneProvider","header","onLoad","folders","progressMessage","onDelete","onUpload","deleteConfirm","setDeleteConfirm","buttonRef","hours","ampm","deleteSelected","jQuery","folder","MediaFolder","MediaItem","align-items","onFilesDrop","previewUrl","created_at","getHours","getMinutes","getDate","getMonth","getFullYear","closePopup","noticeOperations","isPrivate","videos","setVideos","setProgress","setProgressMessage","endpoint","uploadFile","chunkUpload","percent","storeFile","deleteVideo","video","loadVideos","MediaPopup","removeAllNotices","createErrorNotice","combineReducers","videosReducer","action","guid","collectionsReducer","uploadsReducer","requestReducer","private","collection","search","UIReducer","videosFetched","createCollection","errorReducer","collections","uploads","isLoading","errors","currentCollection","ui","arg","requestType","addVideos","removeVideo","setCollections","addCollection","setIsPrivate","setSearch","setCollectionRequest","setUploads","addUploads","removeUpload","setVideosFetched","setUI","addError","removeError","registerStore","reducer","selectors","actions","isPlayable","availableResolutions","isSelectable","getStatusText","getLengthToTime","toISOString","toString","toFixed","useContext","deleting","setDeleting","setVideo","controlCSS","getThumbnail","webPURLSigned","webPURL","ProgressBar","footer","badge","before","after","ProgressOverlay","thumbnailURLSigned","thumbnailURL","renderThumbnail","storageSize","Fragment","notice","setNotice","fetch","interval","setInterval","sync","clearInterval","items_per_page","Loading","flex","collectionId","Video","videoCount","fetchCollections","Collection","busy","setBusy","onCreate","afterUpload","multiple","CreateCollection","onChoose","canSelect","setCanSelect","deleteCollection","BackButton","uploader","setMessage","created","setCreated","upload","storeVideo","Upload","mainContent","sidebar","addUpload","Header","Uploads","Sidebar","Footer","MediaPopupTemplate","CollectionHeader","Collections","Videos","playlistURL","baseUrl","onRefetch","autoSubmit","apikey","setApikey","saveMessage","setSaveMessage","step","setStep","getError","errorString","saveKey","api_key","success","totalSteps","useStreamConnection","useStorageConnection","required","DropdownMenu","Toolbar","editor","BlockControls","InspectorControls","withPlayerData","withPlayerEdit","mediaPopup","setMediaPopup","setup","setSetup","stream","storage","isSetup","setIsSetup","disableStream","setDisableStream","isAPILoaded","setIsAPILoaded","setFetchingSettings","autoSubmitStream","setAutoSubmitStream","disableLegacyStorage","disable_legacy_storage","selectVideo","media","catch","finally","presto_player_bunny_pull_zones","presto_player_bunny_storage_zones","presto_player_bunny_stream_private","presto_player_bunny_stream_public","storageSetup","option","private_id","public_id","streamSetup","pull_zone_url","setPreview","setThumbnail","moreButtons","controls","push","APIPlaceholder","BlockInspectorControls","Player","StorageMedia","StreamMedia","blockOptions","premium","description","variations","isDefault","baseCurrentUrl","InsertFromURLPopover","withFilters","labels","mediaPreview","notices","isAppender","addToGallery","onCancel","onDoubleClick","allowURLs","setSrc","isURLInputVisible","setIsURLInputVisible","onChangeSrc","openURLInput","closeURLInput","onSubmitSrc","renderPlaceholder","placeholderClassName","renderUrlSelectionUI","isPressed","fallback","mediaLibraryButton","gallery","isArray","stopPropagation","renderMediaUploadChecked","ALLOWED_MEDIA_TYPES","switcher","getAudioPresets","addAudioPreset","removeAudioPreset","updateAudioPreset","AUDIO_POSTER_ALLOWED_MEDIA_TYPES","AudioBlockInspectorControl","audioPosterDescription","getDefaultAudioPreset","HostedAudioPlaceholder","audio","pick","addVideo","presetReducer","audioPresetReducer","presetLoadingReducer","videosLoadingReducer","total","total_pages","hasResolved","isError","proModalReducer","brandingReducer","youtubeReducer","presetSettingsReducer","optionsApi","then","setBranding","presto_player_branding","setPresetSettings","presto_player_presets","setPresetAudioSettings","presto_player_audio_presets","audioPresetSettingsReducer","getReusableVideos","getReusableVideo","default_preset","default_player_preset","presetsLoading","player_css","proModal","setPresetLoading","setVideosLoading","updateVideos","appendVideos","setPresets","setAudioPresets","args","fetchOptions","fetchFromAPI","fetchFromWPAPI","FETCH_FROM_API","FETCH_FROM_WP_API","query","parse","res","json","headers","get","Promise","reject","resolvers","registerBlockType","unregisterBlockType","registerPlugin","autoload","getContext","register","unregister","cache","context","changedNames","loadModules","selectedBlockId","require","getSelectedBlockClientId","clearSelectedBlock","getBlocks","ProUpgradeModal","document","getElementById","subscribe","isSavingPost","isAutosavingPost","store","getState","VisuallyHidden","InserterSearchForm","searchInput","as","htmlFor","focus","copyTextToClipboard","textToCopy","btn","currentTarget","textContent","setTimeout","navigator","clipboard","isSecureContext","writeText","textArea","createElement","appendChild","rej","execCommand","InserterShortcodeInput","readOnly","Panel","editPost","PluginSidebar","PluginSidebarMoreMenuItem","useCallback","getBlockType","blockSerializationDefaultParser","forceUpdate","fillOpacity","hasMore","setHasMore","page","setPage","setIsLoading","debounceOnSearch","debounce","term","doFetch","per_page","nextPage","newPage","getIcon","raw","blockName","SearchForm","flexWrap","emptyPlaceholder","deprecated","URLPopover","noticeUI","onUploadError","getBlobByURL","isBlobURL","upgradeNotice","setUpgradeNotice","HostedPlaceholder","newSrc","youtubeBlock","replaceBlock","vimeoBlock","attachmend_id","setHasResolved","setBlock","setLink","getBlocksByClientId","updateBlockAttributes","attrs","template","prevSrc","LinkPlaceholder"],"mappings":";;;;;;;;;;;;;;;;;8GAAcA,EAAOC,QAAUC,OAAW,GAAQ,M,cCApCF,EAAOC,QAAUC,OAAW,GAAc,Y,iCCAxD,kNAA8BC,GAAGC,QAAzBC,EAAR,EAAQA,OAAQC,EAAhB,EAAgBA,UAET,SAASC,EAAYC,GAC1B,IAAMC,EAAMJ,IAIZ,OAHAC,GAAU,WACRG,EAAIC,QAAUF,KAETC,EAAIC,QAGN,SAASC,EAAT,GAA0D,IAAD,IAA/BC,cAA+B,MAAtB,UAAsB,EAAXC,EAAW,EAAXA,QACnDV,GAAGW,KAAKC,SAAS,gBAAgBC,aAC/BJ,EACAC,EACA,CAAEI,KAAM,aAkCL,SAASC,EAAcC,GAC5B,IACIC,EADAC,EAASF,EAAKG,MAAM,KAKxB,OAHID,EAAOE,OAAS,IAClBH,EAAgC,GAAtBI,SAASH,EAAO,KAErBG,SAASH,EAAO,IAAMG,SAASJ,GAGjC,SAASK,EAAcC,GAC5B,IAAIN,EAAUI,SAASE,EAAQ,IAC3BC,EAAUC,KAAKC,MAAMT,EAAU,IAInC,OAHIA,EAAU,KACZA,EAAU,IAAMA,GAEXO,EAAU,IAAMP,EAGlB,SAASU,EAAaX,GAC3B,IAAIY,EAAQZ,EAIZ,KAFAY,EAAQA,EAAMC,QAAQ,kBAAmB,KAE9BC,SAAS,KAClB,MAAM,GAAN,OAAUF,EAAV,OAIiD,IAA/CA,EAAMG,OAAO,EAAGH,EAAMI,QAAQ,MAAMZ,SACtCQ,EAAK,WAAOA,IAId,IAAIK,EAAQL,EAAM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SAAUA,EACVsM,IAAKrD,OAvEX,+BACE,oBAAC06B,EAAA,EAAD,CACEh0B,KACE,2BACE4H,MAAM,6BACN7Y,MAAM,KACNC,OAAO,KACP6Y,QAAQ,YACR2C,KAAK,OACLwL,OAAO,eACPC,YAAY,IACZC,cAAc,QACdC,eAAe,QACfpoB,UAAU,qBAEV,4BAAMia,EAAE,sQACR,+BAASwP,OAAO,gDAGpBhlB,MAAO3E,EAAG,uBAAwB,iBAClC+gB,aAAc/gB,EAAG,0BAA2B,iBAC5CgT,YAAahT,EAAG,cAAe,iBAC/ByC,WAAYA,EACZ0G,cAAeA,EACf2X,YAhCR,SAAqBwkB,GACfA,IAAWxlC,GACbqJ,EAAc,CAAErJ,IAAKwlC,Y,ilBCxE/B,IAAQtlC,EAAOtC,GAAGuC,KAAVD,GAOKqQ,EAAO,wBAKPxC,EAAO,OACfssB,KADe,IAGlB13B,WAAW,EAAD,KACL03B,IAAa13B,YADR,IAERgG,SAAU,CACRjK,KAAMyI,UAIV/B,MAAOlF,EAAG,uBAAwB,iBAElCq6B,YAAar6B,EACX,gDACA,iBAGFmS,KACE,2BACE4H,MAAM,6BACN7Y,MAAM,KACNC,OAAO,KACP6Y,QAAQ,YACR2C,KAAK,OACLwL,OAAO,eACPC,YAAY,IACZC,cAAc,QACdC,eAAe,QACfpoB,UAAU,qBAEV,4BAAMia,EAAE,sQACR,+BAASwP,OAAO,gDAIpBd,W","file":"blocks/admin-15afa29d.js","sourcesContent":["(function() { module.exports = window[\"wp\"][\"i18n\"]; }());","(function() { module.exports = window[\"wp\"][\"components\"]; }());","const { useRef, useEffect } = wp.element;\n\nexport function usePrevious(value) {\n const ref = useRef();\n useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n}\n\nexport function snackbarNotice({ status = \"success\", message }) {\n wp.data.dispatch(\"core/notices\").createNotice(\n status, // Can be one of: success, info, warning, error.\n message, // Text string to display.\n { type: \"snackbar\" }\n );\n}\n\nexport const bytesToSize = (bytes) => {\n var sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n if (bytes == 0) return \"0 Byte\";\n var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));\n return Math.round(bytes / Math.pow(1024, i), 2) + \" \" + sizes[i];\n};\n\nexport const toDate = (d) => {\n d = new Date(d);\n var hours = d.getHours();\n var minutes = d.getMinutes();\n var ampm = hours >= 12 ? \"pm\" : \"am\";\n hours = hours % 12;\n hours = hours ? hours : 12;\n minutes = minutes < 10 ? \"0\" + minutes : minutes;\n\n return (\n d.getDate() +\n \"-\" +\n (d.getMonth() + 1) +\n \"-\" +\n d.getFullYear() +\n \" at \" +\n hours +\n \":\" +\n minutes +\n ampm\n );\n};\n\nexport function timeToSeconds(time) {\n let pieces = time.split(\":\");\n let seconds;\n if (pieces.length > 1) {\n seconds = parseInt(pieces[0]) * 60;\n }\n return parseInt(pieces[1]) + parseInt(seconds);\n}\n\nexport function secondsToTime(number) {\n let seconds = parseInt(number, 10);\n let minutes = Math.floor(seconds / 60);\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n return minutes + \":\" + seconds;\n}\n\nexport function sanitizeTime(time) {\n let draft = time;\n // remove any letters\n draft = draft.replace(/[^\\d\\d:\\d\\d.-]/g, \"\");\n // make sure we have :\n if (!draft.includes(\":\")) {\n return `${draft}:00`;\n }\n\n // must have something before :00\n if (draft.substr(0, draft.indexOf(\":\")).length === 0) {\n draft = `0${draft}`;\n }\n\n // only allow 2 characters after :\n let index = draft.indexOf(\":\");\n draft = draft.substring(0, index + 3);\n return draft;\n}\n\nexport function getProvider(src) {\n const provider = \"self-hosted\";\n\n if (src) {\n const yt_rx = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11})(?:\\S+)?$/;\n const has_match_youtube = src.match(yt_rx);\n\n if (has_match_youtube) {\n return \"youtube\";\n }\n\n const vm_rx = /(https?:\\/\\/)?(www\\.)?(player\\.)?vimeo\\.com\\/([a-z]*\\/)*([0-9]{6,11})[?]?.*/;\n const has_match_vimeo = src.match(vm_rx);\n\n if (has_match_vimeo) {\n return \"vimeo\";\n }\n\n if (src.indexOf(\"https://vz-\") > -1 && src.indexOf(\"b-cdn.net\") > -1) {\n return \"bunny\";\n }\n\n if (src.indexOf(\".mp3\") > -1) {\n return \"audio\";\n }\n }\n return provider;\n}\n","const { __ } = wp.i18n;\n\nexport default function () {\n return (\n <div className=\"presto-player__pro-badge\">{__(\"Pro\", \"presto-player\")}</div>\n );\n}\n","/** @jsx jsx */\nconst { ColorPicker, ColorIndicator, Popover, Button, Flex } = wp.components;\nconst { useState, useEffect } = wp.element;\nconst { __ } = wp.i18n;\nimport { jsx } from \"@emotion/core\";\n\nexport default ({ color, setColor, onFocus }) => {\n const [open, setOpen] = useState(false);\n const [original, setOriginal] = useState(color);\n\n useEffect(() => {\n if (open && color) {\n setOriginal(color);\n }\n }, [open]);\n\n return (\n <span>\n <ColorIndicator\n css={{ width: \"25px\", height: \"25px\", borderRadius: \"9999px\" }}\n colorValue={color}\n onClick={() => {\n setOpen(!open);\n onFocus && onFocus();\n }}\n />\n {!!open && (\n <Popover\n position=\"bottom left\"\n focusOnMount\n onFocusOutside={(e) => {\n setOpen(false);\n }}\n >\n <ColorPicker\n color={color || \"\"}\n onChangeComplete={(value) => value?.hex && setColor(value)}\n disableAlpha\n />\n <div\n css={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n padding: \"10px\",\n }}\n >\n <Button\n css={{ margin: \"0 5px\" }}\n isTertiary\n onClick={() => {\n setColor({ hex: null });\n setOpen(false);\n }}\n >\n {__(\"Reset\", \"presto-player\")}\n </Button>\n <div\n css={{\n display: \"flex\",\n justifyContent: \"flex-end\",\n padding: \"10px\",\n }}\n >\n <Button\n css={{ margin: \"0 5px\" }}\n isTertiary\n onClick={() => {\n setColor({ hex: original });\n setOpen(false);\n }}\n >\n {__(\"Cancel\", \"presto-player\")}\n </Button>\n <Button isPrimary onClick={() => setOpen(false)}>\n {__(\"Apply\", \"presto-player\")}\n </Button>\n </div>\n </div>\n </Popover>\n )}\n </span>\n );\n};\n","(function() { module.exports = window[\"wp\"][\"element\"]; }());","import { PrestoPlayer } from \"@presto-player/react\";\nimport { getProvider } from \"../util\";\nconst { useSelect } = wp.data;\n\nexport default ({\n src,\n classes,\n preset,\n branding,\n attributes,\n adminPreview,\n currentTime,\n preload = \"metadata\",\n overlays,\n type,\n}) => {\n const { chapters, mutedOverlay, mutedPreview } = attributes;\n\n const youtube = useSelect((select) => {\n return select(\"presto-player/player\")?.youtube();\n });\n\n const css = useSelect((select) => {\n return select(\"presto-player/player\")?.playerCSS();\n });\n\n const convertHex = (hexCode, opacity = 1) => {\n var hex = hexCode.replace(\"#\", \"\");\n\n if (hex.length === 3) {\n hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];\n }\n\n var r = parseInt(hex.substring(0, 2), 16),\n g = parseInt(hex.substring(2, 4), 16),\n b = parseInt(hex.substring(4, 6), 16);\n\n /* Backward compatibility for whole number based opacity values. */\n if (opacity > 1 && opacity <= 100) {\n opacity = opacity / 100;\n }\n\n return \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + opacity + \")\";\n };\n\n const mutedOverlayContent = () => {\n return (\n <div\n className=\"presto-player__overlay is-image\"\n style={{\n position: \"absolute\",\n width: `${mutedOverlay?.width || 100}%`,\n left: `${(mutedOverlay?.focalPoint?.x || 0.5) * 100}%`,\n top: `${(mutedOverlay?.focalPoint?.y || 0.5) * 100}%`,\n }}\n >\n <img\n src={mutedOverlay?.src}\n style={{\n transform: \"translateX(-50%) translateY(-50%)\",\n }}\n />\n </div>\n );\n };\n\n return (\n <div\n className={\"wp-block-video presto-block-video\"}\n style={\n type === \"audio\"\n ? {\n \"--presto-player-border-radius\": `${preset?.border_radius}px`,\n ...(preset?.background_color\n ? {\n \"--plyr-audio-controls-background\": preset.background_color,\n }\n : { \"--plyr-audio-controls-background\": branding?.color }),\n ...(preset?.control_color\n ? {\n \"--plyr-audio-control-color\": preset.control_color,\n \"--plyr-range-thumb-background\": preset.control_color,\n \"--plyr-range-fill-background\": preset.control_color,\n \"--plyr-audio-progress-buffered-background\": convertHex(\n preset.control_color || branding?.color || \"#00b3ff\",\n 0.5\n ),\n }\n : {\n \"--plyr-audio-control-color\": \"#ffffff\",\n \"--plyr-range-thumb-background\": \"#ffffff\",\n \"--plyr-range-fill-background\": \"#ffffff\",\n }),\n \"--plyr-range-thumb-shadow\": `0px`,\n }\n : {\n \"--presto-player-border-radius\": `${preset?.border_radius}px`,\n ...(preset?.caption_background\n ? { \"--plyr-captions-background\": preset.caption_background }\n : {}),\n ...(branding?.color\n ? { \"--plyr-color-main\": branding.color }\n : {}),\n \"--presto-player-email-border-radius\": `${\n preset?.email_collection?.border_radius || 0\n }px`,\n \"--presto-player-logo-width\": `${branding?.logo_width || 75}px`,\n }\n }\n >\n <PrestoPlayer\n src={src}\n css={css}\n classes={classes}\n currentTime={currentTime}\n overlays={overlays}\n isAdmin={true}\n preload={preload}\n preset={preset}\n bunny={{\n thumbnail: attributes?.previewThumbnail,\n preview: attributes?.preview,\n }}\n youtube={{\n channelId: youtube?.channel_id,\n }}\n tracks={\n !!preset?.captions && [\n {\n kind: \"captions\",\n label: \"English\",\n srclang: \"en\",\n src: \"/path/to/captions.en.vtt\",\n default: true,\n },\n ]\n }\n branding={branding}\n chapters={chapters}\n blockAttributes={attributes}\n poster={attributes.poster}\n provider={type === \"audio\" ? \"audio\" : getProvider(src)}\n mediaTitle={attributes.title}\n >\n <div slot=\"player-end\">\n {mutedPreview?.enabled &&\n mutedOverlay?.enabled &&\n mutedOverlayContent()}\n {adminPreview}\n </div>\n </PrestoPlayer>\n </div>\n );\n};\n","const helpers = {\n setUrlPrivate: () => {\n const separator = window.location.href.indexOf(\"?\") === -1 ? \"?\" : \"&\";\n const newurl =\n window.location.href + separator + \"presto_video_type=private\";\n window.history.pushState({ path: newurl }, \"\", newurl);\n },\n setUrlPublic: () => {\n const separator = window.location.href.indexOf(\"?\") === -1 ? \"?\" : \"&\";\n const newurl =\n window.location.href + separator + \"presto_video_type=public\";\n window.history.pushState({ path: newurl }, \"\", newurl);\n },\n unsetUrlParams: () => {\n let removed = removeURLParameters(window.location.href, [\n \"presto_video_type\",\n ]);\n window.history.pushState({ path: removed }, \"\", removed);\n },\n};\n\nfunction removeURLParameters(url, parameters = []) {\n const parsedUrl = new URL(url);\n parameters.forEach((param) => {\n parsedUrl.searchParams.delete(param);\n });\n\n return parsedUrl.href;\n}\n\nexport default helpers;\n","(function() { module.exports = window[\"wp\"][\"data\"]; }());","export default {\n visibility: {\n type: String,\n default: \"public\",\n },\n color: {\n type: String,\n default: \"#00b3ff\",\n },\n blockAlignment: {\n type: String,\n },\n mutedPreview: {\n type: Object,\n default: {\n enabled: false,\n captions: false,\n },\n },\n mutedOverlay: {\n type: Object,\n default: {\n enabled: false,\n src: \"\",\n width: 200,\n focalPoint: {\n x: 0.5,\n y: 0.5,\n },\n },\n },\n mutedPreviewCaptions: {\n type: Boolean,\n },\n mutedOverlayType: {\n type: String,\n default: \"text\",\n },\n mutedOverlayText: {\n type: String,\n default: \"Click to play\",\n },\n mutedOverlaySrc: {\n type: String,\n },\n mutedOverlayImageWidth: {\n type: Number,\n default: 200,\n },\n mutedOverlayFocalPoint: {\n type: Object,\n },\n mutedOverlay: {\n type: Object,\n default: {\n enabled: false,\n type: \"text\",\n text: \"\",\n src: \"\",\n width: 200,\n focalPoint: {\n x: 0.5,\n y: 0.5,\n },\n },\n },\n autoplay: {\n type: Boolean,\n },\n preload: {\n type: String,\n },\n playsInline: {\n type: Boolean,\n },\n id: {\n type: Number,\n },\n attachment_id: {\n type: Number,\n },\n src: {\n type: String,\n },\n imageID: {\n type: Number,\n },\n poster: {\n type: String,\n },\n content: {\n type: Boolean,\n },\n preset: {\n type: Number,\n },\n chapters: {\n type: Array,\n default: [],\n },\n overlays: {\n type: Array,\n default: [],\n },\n tracks: {\n type: \"array\",\n items: {\n type: \"object\",\n },\n default: [],\n },\n};\n","import attributes from \"./attributes\";\n\nexport default {\n attributes,\n\n category: \"presto\",\n\n supports: {\n align: true,\n },\n\n // dynamic save function\n save: function () {\n return null;\n },\n};\n","export function getYoutubeId(url) {\n const regExp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|&v=)([^#&?]*).*/;\n const match = (url || \"\").match(regExp);\n return match && match?.[2]?.length === 11 ? match[2] : null;\n}\n\nexport function getVimeoId(url) {\n const regExp = /^.*(vimeo\\.com\\/)((channels\\/[A-z]+\\/)|(groups\\/[A-z]+\\/videos\\/))?([0-9]+)/;\n const parseUrl = regExp.exec(url || \"\");\n return parseUrl?.[5] || \"\";\n}\n\nexport function saveAttachment({ video_id, src, type }) {\n return new Promise((resolve, reject) => {\n jQuery.post(\n prestoPlayer.ajaxurl,\n {\n action: \"presto_save_external_attachment\",\n _wpnonce: prestoPlayer.nonce,\n post_id: wp.data.select(\"core/editor\").getCurrentPostId(),\n video_id,\n src,\n type,\n },\n function ({ data }) {\n resolve(data);\n }\n );\n });\n}\n\nexport function determineVideoUrlType(url) {\n const youtube_id = getVimeoId(url);\n if (youtube_id) {\n return {\n video_id: youtube_id,\n type: \"vimeo\",\n };\n }\n\n const vimeo_id = getYoutubeId(url);\n if (vimeo_id) {\n return {\n video_id: vimeo_id,\n type: \"youtube\",\n };\n }\n\n return {\n $video_id: 0,\n $type: \"none\",\n };\n}\n\nexport function convertChapter(chapter) {\n let draft = time;\n // remove any letters\n draft = draft.replace(/[^\\d\\d:\\d\\d.-]/g, \"\");\n // make sure we have :\n if (!draft.includes(\":\")) {\n return `${draft}:00`;\n }\n\n // must have something before :00\n if (draft.substr(0, draft.indexOf(\":\")).length === 0) {\n draft = `0${draft}`;\n }\n\n // only allow 2 characters after :\n let index = draft.indexOf(\":\");\n draft = draft.substring(0, index + 3);\n return draft;\n}\n\n// get file extension\nexport function getFileExtension(url) {\n return url.split(/[#?]/)[0].split(\".\").pop().trim();\n}\n\n// is the source hls?\nexport function isHLS(url) {\n return typeof url === \"string\" && url.includes(\".m3u8\");\n}\n","/**\n * WordPress dependencies\n */\nconst { createHigherOrderComponent } = wp.compose;\nconst { useEffect, useState } = wp.element;\nimport { usePrevious } from \"@/admin/blocks/util\";\nimport apiFetch from \"@/shared/services/fetch\";\n\n/**\n * Higher order component factory for injecting the editor colors as the\n * `colors` prop in the `withColors` HOC.\n *\n * @return {Function} The higher order component.\n */\nexport default () =>\n createHigherOrderComponent(\n (WrappedComponent) => (props) => {\n const {\n presets,\n attributes,\n setAttributes,\n defaultPreset,\n isSelected,\n branding,\n } = props;\n const [presetData, setPresetData] = useState({});\n const [count, setCount] = useState(1);\n let { poster, chapters } = attributes;\n\n useEffect(() => {\n if (isSelected && attributes?.id) {\n wp.data\n .dispatch(\"core/edit-post\")\n .openGeneralSidebar(\"edit-post/block\");\n }\n }, [isSelected]);\n\n // don't allow selection if there is an override\n useEffect(() => {\n if (isSelected && attributes?.selectionOverrideClientId) {\n wp.data\n .dispatch(\"core/block-editor\")\n .selectBlock(attributes?.selectionOverrideClientId);\n }\n }, [isSelected]);\n\n // set preset data when presets are loaded\n useEffect(() => {\n if (presets && presets.length) {\n const thisPreset = presets.find((preset) => {\n return preset.id === attributes?.preset;\n });\n if (thisPreset) {\n setPresetData(thisPreset);\n } else {\n setPresetData(defaultPreset);\n setAttributes({ preset: defaultPreset?.id });\n }\n }\n }, [presets, attributes?.preset]);\n\n // re-render the player if presetdata, poster or chapters change\n useEffect(() => {\n onUpdate();\n }, [poster, presetData, chapters, branding.logo]);\n\n // increment update key\n const onUpdate = () => {\n setCount(count + 1);\n };\n\n // re-render only if times change\n const prevChapters = usePrevious(chapters);\n useEffect(() => {\n let times = chapters?.map((item) => item.time);\n let prevTimes = prevChapters?.map((item) => item.time);\n if (_.difference(times, prevTimes).length) {\n onUpdate();\n }\n }, [chapters]);\n\n const createVideo = async ({\n src,\n external_id,\n attachment_id,\n type,\n title,\n }) => {\n if (!src && !external_id && !attachment_id) {\n return;\n }\n const { id } = await apiFetch({\n method: \"POST\",\n path: \"/presto-player/v1/videos\",\n data: {\n attachment_id,\n post_id: wp.data.select(\"core/editor\").getCurrentPostId(),\n external_id,\n ...(title ? { title } : {}),\n src,\n type,\n },\n });\n setAttributes({ id });\n };\n\n const lock = () => {\n return wp.data.dispatch(\"core/editor\").lockPostSaving(\"presto-player\");\n };\n\n const unlock = () => {\n return wp.data\n .dispatch(\"core/editor\")\n .unlockPostSaving(\"presto-player\");\n };\n\n function onRemoveSrc() {\n let r = confirm(\"Remove this video?\");\n if (r) {\n setAttributes({\n src: \"\",\n id: undefined,\n ...(attributes?.thumbnail ? { thumbnail: null } : {}),\n ...(attributes?.preview ? { preview: null } : {}),\n ...(attributes?.previewSrc ? { previewSrc: null } : {}),\n ...(attributes?.previewThumbnail ? { previewThumbnail: null } : {}),\n });\n }\n }\n\n // make sure it's the default\n if (!attributes?.preset) {\n setAttributes({ preset: defaultPreset?.id });\n }\n\n return (\n <WrappedComponent\n {...props}\n lockSave={lock}\n unlockSave={unlock}\n createVideo={createVideo}\n onUpdate={onUpdate}\n onRemoveSrc={onRemoveSrc}\n presetData={presetData}\n setPresetData={setPresetData}\n renderKey={count}\n />\n );\n },\n \"withPlayerEdit\"\n );\n","const { withSelect } = wp.data;\n\nexport default function (props) {\n return withSelect((select) => {\n return {\n branding: select(\"presto-player/player\").branding(),\n loading: select(\"presto-player/player\").isResolving(\"getPresets\"),\n presets: select(\"presto-player/player\").getPresets(),\n defaultPreset: select(\"presto-player/player\").getDefaultPreset(),\n };\n });\n}\n","/** @jsx jsx */\n\nconst { __ } = wp.i18n;\nconst { useState } = wp.element;\nconst { useSelect, dispatch } = wp.data;\nconst { withNotices, BaseControl, Spinner, Button } = wp.components;\n\nimport ProBadge from \"@/admin/blocks/shared/components/ProBadge\";\nimport EditOverlay from \"./Edit\";\n\nimport { css, jsx } from \"@emotion/core\";\n\nconst VideoOverlays = ({ setAttributes, attributes }) => {\n // modal\n const { overlays } = attributes;\n const [modal, setModal] = useState(false);\n const openModal = () => setModal(true);\n const closeModal = () => setModal(false);\n\n const updateOverlayAttribute = (overlays) => {\n setAttributes({ overlays: overlays });\n };\n\n return (\n <>\n <BaseControl>\n <Button\n isPrimary\n onClick={() => {\n if (!prestoPlayer?.isPremium) {\n dispatch(\"presto-player/player\").setProModal(true);\n return;\n }\n openModal(\"new\");\n }}\n >\n {!!overlays.length\n ? __(\"Update Overlays\", \"presto-player\")\n : __(\"Add Overlay\", \"presto-player\")}\n {!!overlays.length && (\n <div\n css={css`\n font-size: 10px;\n background: #fff;\n color: var(--wp-admin-theme-color);\n font-weight: bold;\n display: inline-block;\n line-height: 6px;\n padding: 5px;\n border-radius: 9999px;\n margin-left: 10px;\n `}\n >\n {overlays.length}\n </div>\n )}\n </Button>\n\n {!prestoPlayer?.isPremium && <ProBadge />}\n </BaseControl>\n\n {modal && (\n <EditOverlay\n closeModal={closeModal}\n attributes={attributes}\n setAttributes={setAttributes}\n updateOverlayAttribute={updateOverlayAttribute}\n />\n )}\n </>\n );\n};\n\nexport default VideoOverlays;\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst {\n ToggleControl,\n BaseControl,\n HorizontalRule,\n __experimentalAlignmentMatrixControl: AlignmentMatrixControl,\n SelectControl,\n} = wp.components;\n\nexport default function ({ state, updateState, className }) {\n return (\n <div className={className}>\n <BaseControl>\n <h3>{__(\"Behavior\", \"presto-player\")}</h3>\n </BaseControl>\n <BaseControl>\n <ToggleControl\n label={__(\"Auto-Hide Controls\", \"presto-player\")}\n help={__(\n \"Hide video controls automatically after 2 seconds of no mouse movement.\",\n \"presto-player\"\n )}\n onChange={(auto_hide) => {\n updateState({ auto_hide });\n }}\n checked={state.auto_hide}\n />\n </BaseControl>\n {/* <BaseControl>\n <ToggleControl\n label={__(\"Reset On End\", \"presto-player\")}\n help={__(\n \"Reset the video to the beginning when it completes.\",\n \"presto-player\"\n )}\n onChange={(reset_on_end) => {\n updateState({ reset_on_end });\n }}\n checked={state.reset_on_end}\n />\n </BaseControl> */}\n <BaseControl>\n <ToggleControl\n label={__(\"Save Play Position\", \"presto-player\")}\n help={__(\n \"Saves the user's play position so when they come back to the page they can continue the video from where they left off.\",\n \"presto-player\"\n )}\n onChange={(save_player_position) => {\n updateState({ save_player_position });\n }}\n checked={state.save_player_position}\n />\n </BaseControl>\n <BaseControl>\n <ToggleControl\n label={__(\"Captions On By Default\", \"presto-player\")}\n help={__(\n \"Toggles if captions should be active by default.\",\n \"presto-player\"\n )}\n onChange={(captions_enabled) => {\n updateState({ captions_enabled });\n }}\n checked={state.captions_enabled}\n />\n </BaseControl>\n <BaseControl>\n <ToggleControl\n label={__(\"Focus Mode\", \"presto-player\")}\n help={__(\n \"Play only when tab is visible and video is in viewport.\",\n \"presto-player\"\n )}\n onChange={(play_video_viewport) => {\n updateState({ play_video_viewport });\n }}\n checked={state.play_video_viewport}\n />\n </BaseControl>\n\n <BaseControl>\n <ToggleControl\n label={__(\"Sticky On Scroll\", \"presto-player\")}\n help={__(\n \"Stick videos to the side of the screen when the page is scrolled and the video is playing.\",\n \"presto-player\"\n )}\n onChange={(sticky_scroll) => {\n updateState({ sticky_scroll });\n }}\n checked={state.sticky_scroll}\n />\n </BaseControl>\n {!!state.sticky_scroll && (\n <>\n <BaseControl\n label={__(\n \"Choose a position for your sticky player.\",\n \"presto-player\"\n )}\n >\n <AlignmentMatrixControl\n value={state.sticky_scroll_position}\n onChange={(sticky_scroll_position) => {\n updateState({ sticky_scroll_position });\n }}\n />\n </BaseControl>\n </>\n )}\n <BaseControl>\n <SelectControl\n label={__(\"On Video End\", \"presto-player\")}\n value={state.on_video_end}\n options={[\n {\n value: \"select\",\n label: __(\"Select\", \"presto-player\"),\n },\n {\n value: \"loop\",\n label: __(\"Loop\", \"presto-player\"),\n },\n {\n value: \"go-to-start\",\n label: __(\"Go to start\", \"presto-player\"),\n },\n ]}\n onChange={(on_video_end) => {\n updateState({ on_video_end });\n }}\n />\n </BaseControl>\n\n <HorizontalRule />\n <BaseControl />\n <BaseControl>\n <h3>{__(\"Youtube\", \"presto-player\")}</h3>\n </BaseControl>\n <BaseControl>\n <ToggleControl\n label={__(\"Hide Youtube UI (Experimental)\", \"presto-player\")}\n help={__(\n \"Hides the Youtube logo and related videos.\",\n \"presto-player\"\n )}\n onChange={(hide_youtube) => {\n updateState({ hide_youtube });\n }}\n checked={state.hide_youtube}\n />\n </BaseControl>\n <BaseControl>\n <ToggleControl\n label={__(\"Lazy Load Videos\", \"presto-player\")}\n help={__(\n \"Improves page loading performance by only loading the video when clicked.\",\n \"presto-player\"\n )}\n onChange={(lazy_load_youtube) => {\n updateState({ lazy_load_youtube });\n }}\n checked={state.lazy_load_youtube}\n />\n </BaseControl>\n </div>\n );\n}\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst { ToggleControl, BaseControl } = wp.components;\n\nexport default function ({ state, updateState, className }) {\n return (\n <div className={className}>\n <BaseControl>\n <h3>{__(\"Controls\", \"presto-player\")}</h3>\n </BaseControl>\n <BaseControl className=\"presto-player__control--large-play\">\n <ToggleControl\n label={__(\"Large Play Button\", \"presto-player\")}\n help={__(\n \"Adds a large play button over the top of the player.\",\n \"presto-player\"\n )}\n onChange={(play) => {\n updateState({ \"play-large\": play });\n }}\n checked={state[\"play-large\"]}\n />\n </BaseControl>\n <BaseControl className=\"presto-player__control--rewind\">\n <ToggleControl\n label={__(\"Rewind\", \"presto-player\")}\n help={__(\n \"Adds a 10 second rewind button to the player.\",\n \"presto-player\"\n )}\n onChange={(rewind) => {\n updateState({ rewind });\n }}\n checked={state.rewind}\n />\n </BaseControl>\n <BaseControl className=\"presto-player__control--play\">\n <ToggleControl\n label={__(\"Small Play Button\", \"presto-player\")}\n help={__(\n \"Adds a small play button to the bottom of the player.\",\n \"presto-player\"\n )}\n onChange={(play) => {\n updateState({ play });\n }}\n checked={state.play}\n />\n </BaseControl>\n <BaseControl className=\"presto-player__control--fast-forward\">\n <ToggleControl\n label={__(\"Fast Forward\", \"presto-player\")}\n help={__(\n \"Adds a 10 second rewind button to the player.\",\n \"presto-player\"\n )}\n onChange={(value) => {\n updateState({ \"fast-forward\": value });\n }}\n checked={state[\"fast-forward\"]}\n />\n </BaseControl>\n <BaseControl className=\"presto-player__control--progress\">\n <ToggleControl\n label={__(\"Progress Bar\", \"presto-player\")}\n help={__(\"Shows a seekable progress bar.\", \"presto-player\")}\n onChange={(progress) => {\n updateState({ progress });\n }}\n checked={state.progress}\n />\n </BaseControl>\n <BaseControl className=\"presto-player__control--current-time\">\n <ToggleControl\n label={__(\"Current Time\", \"presto-player\")}\n help={__(\"Shows the video timestamp.\", \"presto-player\")}\n onChange={(value) => {\n updateState({ \"current-time\": value });\n }}\n checked={state[\"current-time\"]}\n />\n </BaseControl>\n <BaseControl className=\"presto-player__control--volume\">\n <ToggleControl\n label={__(\"Volume\", \"presto-player\")}\n help={__(\"Shows a volume bar.\", \"presto-player\")}\n onChange={(value) => {\n updateState({ volume: value, mute: value });\n }}\n checked={state.volume}\n />\n </BaseControl>\n <BaseControl className=\"presto-player__control--speed\">\n <ToggleControl\n label={__(\"Speed\", \"presto-player\")}\n help={__(\"Shows playback speed controls.\", \"presto-player\")}\n onChange={(speed) => {\n updateState({ speed });\n }}\n checked={state.speed}\n />\n </BaseControl>\n <BaseControl className=\"presto-player__control--pip\">\n <ToggleControl\n label={__(\"Picture In Picture (HTML5 only)\", \"presto-player\")}\n help={__(\n \"Allows users to dock the player on their screen and watch when using other app on their computer.\",\n \"presto-player\"\n )}\n onChange={(pip) => {\n updateState({ pip });\n }}\n checked={state.pip}\n />\n </BaseControl>\n <BaseControl className=\"presto-player__control--fullscreen\">\n <ToggleControl\n label={__(\"Fullscreen\", \"presto-player\")}\n help={__(\n \"Adds a button to allow the player to be fullscreen.\",\n \"presto-player\"\n )}\n onChange={(fullscreen) => {\n updateState({ fullscreen });\n }}\n checked={state.fullscreen}\n />\n </BaseControl>\n <BaseControl className=\"presto-player__control--captions\">\n <ToggleControl\n label={__(\"Captions\", \"presto-player\")}\n help={__(\"Shows a dedicated caption toggle button.\", \"presto-player\")}\n onChange={(value) => {\n updateState({ captions: value });\n }}\n checked={state[\"captions\"]}\n />\n </BaseControl>\n </div>\n );\n}\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\n\nconst {\n ToggleControl,\n BaseControl,\n RadioControl,\n Flex,\n RangeControl,\n} = wp.components;\n\nconst { useEffect } = wp.element;\n\nimport DynamicText from \"../overlays/components/DynamicText\";\n\nimport ColorPopup from \"../components/ColorPopup\";\n\nexport default ({ state, updateState, className }) => {\n const { watermark } = state;\n\n const defaults = {\n text: __(\"Enter your watermark text.\", \"presto-player\"),\n position: \"top-right\",\n color: \"#fff\",\n backgroundColor: \"#333\",\n opacity: 80,\n };\n useEffect(() => {\n Object.keys(defaults).forEach((key) => {\n if (state?.watermark?.[key] === undefined) {\n updateWatermarkState({\n [key]: defaults[key],\n });\n }\n });\n }, [state]);\n\n const updateWatermarkState = (updated) => {\n updateState({\n ...state,\n watermark: {\n ...watermark,\n ...updated,\n },\n });\n };\n\n return (\n <div className={className}>\n <BaseControl>\n <h3>{__(\"Dynamic Watermark Text\", \"presto-player\")}</h3>\n </BaseControl>\n <BaseControl className=\"presto-player__control--watermark\">\n <ToggleControl\n label={__(\"Enable\", \"presto-player\")}\n help={__(\n \"Add a simulated dynamic watermark over your video.\",\n \"presto-player\"\n )}\n onChange={(enabled) => {\n updateWatermarkState({\n enabled,\n });\n }}\n checked={watermark?.enabled}\n />\n </BaseControl>\n\n {watermark?.enabled && (\n <div>\n <DynamicText\n text={watermark?.text}\n update={({ text }) => {\n updateWatermarkState({\n text,\n });\n }}\n />\n\n <BaseControl className={className}>\n <RadioControl\n label={__(\"Position\", \"presto-player\")}\n options={[\n { label: \"Top Right\", value: \"top-right\" },\n { label: \"Top Left\", value: \"top-left\" },\n { label: \"Change Every 10 Seconds\", value: \"randomize\" },\n ]}\n selected={watermark?.position || \"top-right\"}\n onChange={(position) =>\n updateWatermarkState({\n position,\n })\n }\n />\n </BaseControl>\n\n <BaseControl className=\"presto-player__control-text-color\">\n <Flex>\n <BaseControl.VisualLabel>\n {__(\"Text Color\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <ColorPopup\n color={watermark?.color || \"#fff\"}\n setColor={(value) =>\n updateWatermarkState({\n color: value && value.hex,\n })\n }\n />\n </Flex>\n </BaseControl>\n\n <BaseControl className=\"presto-player__control-text-color\">\n <Flex>\n <BaseControl.VisualLabel>\n {__(\"Background Color\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <ColorPopup\n color={watermark?.backgroundColor || \"#333\"}\n setColor={(value) =>\n updateWatermarkState({\n backgroundColor: value && value.hex,\n })\n }\n />\n </Flex>\n </BaseControl>\n\n <BaseControl>\n <RangeControl\n label={__(\"Opacity\", \"presto-player\")}\n help={__(\"Opacity percentage of the watermark.\", \"presto-player\")}\n value={watermark?.opacity || 100}\n onChange={(opacity) => updateWatermarkState({ opacity })}\n min={0}\n max={100}\n />\n </BaseControl>\n </div>\n )}\n </div>\n );\n};\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst {\n ToggleControl,\n BaseControl,\n RangeControl,\n SelectControl,\n ColorPicker,\n} = wp.components;\n\nexport default function ({ state, updateState, className }) {\n return (\n <div className={className}>\n <BaseControl>\n <h3>{__(\"Style\", \"presto-player\")}</h3>\n </BaseControl>\n <BaseControl>\n <ToggleControl\n label={__(\"Hide Logo\", \"presto-player\")}\n help={__(\"Hides the logo on this video.\", \"presto-player\")}\n onChange={(hide_logo) => {\n updateState({ hide_logo });\n }}\n checked={state.hide_logo}\n />\n </BaseControl>\n <BaseControl>\n <RangeControl\n label={__(\"Round Corners\", \"presto-player\")}\n help={__(\"Player border radius size.\", \"presto-player\")}\n value={state?.border_radius || 0}\n onChange={(border_radius) => updateState({ border_radius })}\n min={0}\n max={25}\n />\n </BaseControl>\n\n <BaseControl>\n <SelectControl\n label={__(\"Caption Style\", \"presto-player\")}\n labelPosition=\"top\"\n value={state?.caption_style}\n options={[\n { label: __(\"Default\", \"presto-player\"), value: \"default\" },\n { label: __(\"Full\", \"presto-player\"), value: \"full\" },\n ]}\n onChange={(caption_style) => {\n updateState({ caption_style });\n }}\n />\n </BaseControl>\n <BaseControl>\n <BaseControl.VisualLabel>\n <p>{__(\"Caption Background\", \"presto-player\")}</p>\n </BaseControl.VisualLabel>\n\n <ColorPicker\n color={state?.caption_background || \"#000000\"}\n onChangeComplete={(value) => {\n updateState({ caption_background: value.hex });\n }}\n disableAlpha\n />\n </BaseControl>\n </div>\n );\n}\n","/** @jsx jsx */\n/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst {\n TextControl,\n BaseControl,\n Icon,\n Notice,\n Button,\n Flex,\n FlexItem,\n SelectControl,\n FlexBlock,\n Modal,\n} = wp.components;\nconst { useState, useEffect } = wp.element;\nconst { useSelect, dispatch } = wp.data;\n\nimport { snackbarNotice } from \"@/admin/blocks/util\";\nimport Menu from \"@/admin/ui/Menu\";\nimport { css, jsx } from \"@emotion/core\";\nimport Preview from \"../Preview\";\nimport ActionBar from \"./ActionBar\";\nimport Behavior from \"./Behavior\";\nimport Controls from \"./Controls\";\nimport Watermark from \"./Watermark\";\nimport CTA from \"./CTA\";\nimport Email from \"./Email\";\nimport Style from \"./Style\";\n\nfunction EditPlayerPreset({\n type = \"new\",\n closeModal,\n addPreset,\n onSave,\n updatePreset,\n name = \"\",\n preset = {\n \"play-large\": true,\n rewind: true,\n play: true,\n \"fast-forward\": true,\n progress: true,\n \"current-time\": true,\n mute: true,\n volume: true,\n speed: false,\n pip: false,\n fullscreen: true,\n captions: false,\n // behavior\n save_player_position: false,\n reset_on_end: false,\n auto_hide: true,\n sticky_scroll: false,\n // style\n hide_logo: false,\n border_radius: 0,\n skin: \"default\",\n caption_style: \"default\",\n caption_background: \"#000000\",\n // youtube\n hide_youtube: false,\n lazy_load_youtube: false,\n\n // features\n cta: {},\n email_collection: {},\n action_bar: {},\n },\n}) {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState(\"\");\n const [menu, setMenu] = useState(\"\");\n const [thisName, setThisName] = useState(name);\n const [state, setState] = useState(preset);\n const branding = useSelect((select) => {\n return select(\"presto-player/player\").branding();\n });\n\n const [value, setValue] = useState(\"\");\n\n const genericError = {\n message: __(\n \"The preset could not be saved. Please reload the page and try again.\",\n \"presto-player\"\n ),\n };\n\n //you tube feature\n const youtube = useSelect((select) => {\n return select(\"presto-player/player\").youtube();\n });\n\n useEffect(() => {\n setValue(youtube.channel_id);\n }, [youtube?.channel_id]);\n\n // update state\n const updateState = (updated = {}) => {\n setState({ ...state, ...updated });\n };\n\n const putPreset = async () => {\n setLoading(true);\n try {\n const data = {\n ...state,\n ...{ name: thisName },\n };\n let saved = await wp.apiFetch({\n method: \"POST\",\n url: wp.url.addQueryArgs(\n `${prestoPlayer.root}${prestoPlayer.prestoVersionString}preset/${preset.id}`,\n { _method: \"PUT\" }\n ),\n data,\n });\n\n if (!saved) {\n throw genericError;\n }\n\n // update or create here\n updatePreset(saved);\n closeModal();\n !!onSave && onSave(saved);\n snackbarNotice({ message: __(\"Preset updated!\", \"presto-player\") });\n } catch (e) {\n setError(e?.message ? e.message : genericError);\n } finally {\n setLoading(false);\n }\n\n // youtube id save\n dispatch(\"presto-player/player\").updateYoutube({ channel_id: value });\n\n const data = {\n ...youtube,\n ...{ channel_id: value },\n };\n\n try {\n let response = await wp.apiFetch({\n path: \"wp/v2/settings\",\n method: \"POST\",\n data: {\n presto_player_youtube: data,\n },\n });\n if (response?.presto_player_youtube) {\n dispatch(\"presto-player/player\").setYoutube(\n response?.presto_player_youtube\n );\n onClose();\n }\n } catch (e) {\n console.log(e);\n }\n };\n\n const createPreset = async () => {\n setLoading(true);\n try {\n let saved = await wp.apiFetch({\n method: \"POST\",\n url: prestoPlayer.root + prestoPlayer.prestoVersionString + \"preset\",\n data: {\n ...{ name: thisName },\n ...state,\n },\n });\n if (!saved) {\n throw genericError;\n }\n\n // update or create here\n addPreset(saved);\n closeModal();\n !!onSave && onSave(saved);\n snackbarNotice({ message: __(\"Preset created!\", \"presto-player\") });\n } catch (e) {\n setError(e?.message ? e.message : genericError);\n } finally {\n setLoading(false);\n }\n };\n\n // validate and save\n const save = () => {\n if (!thisName) {\n setError(__(\"You must enter a name for the preset.\", \"presto-player\"));\n return;\n }\n return type === \"edit\" ? putPreset() : createPreset();\n };\n\n const tabs = [\n {\n name: \"controls\",\n title: __(\"Controls\", \"presto-player\"),\n icon: <Icon icon=\"admin-settings\" />,\n component: <Controls updateState={updateState} state={state} />,\n },\n {\n name: \"behavior\",\n title: __(\"Behavior\", \"presto-player\"),\n icon: <Icon icon=\"admin-generic\" />,\n component: <Behavior updateState={updateState} state={state} />,\n },\n {\n name: \"style\",\n title: __(\"Style\", \"presto-player\"),\n icon: <Icon icon=\"admin-customizer\" />,\n component: <Style updateState={updateState} state={state} />,\n },\n {\n name: \"email\",\n title: __(\"Email Capture\", \"presto-player\"),\n icon: <Icon icon=\"email\" />,\n component: <Email updateState={updateState} state={state} />,\n },\n {\n name: \"cta\",\n title: __(\"Call To Action\", \"presto-player\"),\n icon: <Icon icon=\"megaphone\" />,\n component: <CTA updateState={updateState} state={state} />,\n },\n {\n name: \"action_bar\",\n title: __(\"Action Bar\", \"presto-player\"),\n icon: <Icon icon=\"cover-image\" />,\n component: (\n <ActionBar\n updateState={updateState}\n state={state}\n value={value}\n setValue={setValue}\n />\n ),\n },\n {\n name: \"watermark\",\n title: __(\"Dynamic Watermark\", \"presto-player\"),\n icon: <Icon icon=\"lock\" />,\n component: <Watermark updateState={updateState} state={state} />,\n },\n // {\n // name: \"cta\",\n // title: __(\"Call to Action\", \"presto-player\"),\n // icon: <Icon icon=\"megaphone\" />,\n // },\n ];\n\n return (\n <Modal\n title={\n type == \"edit\"\n ? __(\"Edit A Video Preset\", \"presto-player\")\n : __(\"Create A New Video Preset\", \"presto-player\")\n }\n onRequestClose={closeModal}\n className=\"presto-player__modal-presets\"\n overlayClassName=\"presto-player__modal-presets-overlay\"\n >\n <div className=\"presto-player__preset-options\" data-cy=\"preset-modal\">\n <TextControl\n value={thisName}\n hideLabelFromVision={true}\n label={__(\"Preset Name\", \"presto-player\")}\n onChange={(name) => setThisName(name)}\n placeholder={__(\"Enter a preset name...\", \"presto-player\")}\n className=\"presto-player__modal--style-name\"\n autoFocus\n />\n\n <Flex align=\"stretch\" className=\"presto-player__style-preview-area\">\n <FlexItem className=\"presto-player__style-sidebar\">\n <div>\n <Menu\n items={tabs}\n title={__(\"Customize\", \"presto-player\")}\n onSelect={setMenu}\n >\n {(item) => item.component}\n </Menu>\n </div>\n </FlexItem>\n <FlexBlock className=\"presto-player__style-preview-panel\">\n <div\n style={{ position: \"absolute\", top: 0, left: 0, padding: \"20px\" }}\n >\n <SelectControl\n label={__(\"Skin\", \"presto-player\")}\n labelPosition=\"side\"\n value={state?.skin}\n hideLabelFromVision={true}\n options={[\n { label: __(\"Basic\", \"presto-player\"), value: \"default\" },\n { label: __(\"Stacked\", \"presto-player\"), value: \"stacked\" },\n ]}\n onChange={(skin) => {\n updateState({ skin });\n }}\n />\n </div>\n {/*\n Disable the video tag so the user clicking on it won't play the\n video when the controls are enabled.\n\t\t\t\t*/}\n\n <Preview\n poster=\"https://source.unsplash.com/daily\"\n state={state}\n branding={branding}\n menu={menu}\n />\n </FlexBlock>\n </Flex>\n\n <br />\n\n {error && (\n <BaseControl>\n <Notice\n className=\"presto-player__modal--error-notice\"\n status=\"error\"\n isDismissible={false}\n style={{ margin: 0 }}\n >\n {error.replace(/(<([^>]+)>)/gi, \"\")}\n </Notice>\n </BaseControl>\n )}\n <div\n css={css`\n display: flex;\n align-items: center;\n justify-content: space-between;\n `}\n >\n <div\n css={css`\n opacity: 0.5;\n font-size: 12px;\n `}\n >\n Preset ID: {preset.id}\n </div>\n <div>\n <Button isTertiary onClick={closeModal} style={{ margin: \"0 6px\" }}>\n {__(\"Cancel\", \"presto-player\")}\n </Button>\n <Button\n isPrimary\n isBusy={loading}\n disabled={loading}\n onClick={save}\n data-cy=\"submit-preset\"\n >\n {type == \"edit\"\n ? __(\"Update Preset\", \"presto-player\")\n : __(\"Create Preset\", \"presto-player\")}\n </Button>\n </div>\n </div>\n </div>\n </Modal>\n );\n}\nexport default EditPlayerPreset;\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst { Icon, Spinner, Modal, Button, ButtonGroup } = wp.components;\nconst { useState } = wp.element;\n\nexport default function ({\n preset,\n index,\n isActive,\n remove,\n setPreset,\n onEdit,\n}) {\n const [loading, setLoading] = useState(false);\n const [confirmOpen, setConfirmOpen] = useState(false);\n\n const openConfirm = () => setConfirmOpen(true);\n const closeConfirm = () => setConfirmOpen(false);\n\n const untrashPreset = async () => {};\n\n const trashPreset = async () => {\n // remove unsaved\n if (!preset.id) {\n remove(preset);\n return;\n }\n\n try {\n setLoading(true);\n let deleted = await wp.apiFetch({\n method: \"POST\",\n url: wp.url.addQueryArgs(\n `${prestoPlayer.root}${prestoPlayer.prestoVersionString}preset/${preset.id}`,\n { _method: \"DELETE\" }\n ),\n });\n if (deleted) {\n remove(preset);\n wp.data.dispatch(\"core/notices\").createNotice(\n \"success\", // Can be one of: success, info, warning, error.\n __(\"Preset trashed.\", \"presto-player\"),\n {\n type: \"snackbar\",\n isDismissible: true,\n // actions: [\n // {\n // label: __(\"Undo\", \"presto-player\"),\n // onClick: () => {\n // console.log(\"untrash\");\n // },\n // },\n // ],\n }\n );\n }\n } catch (e) {\n console.error(e);\n if (e?.message) {\n wp.data.dispatch(\"core/notices\").createNotice(\n \"error\", // Can be one of: success, info, warning, error.\n e.message,\n {\n type: \"snackbar\",\n isDismissible: true, // Whether the user can dismiss the notice.\n }\n );\n }\n } finally {\n setConfirmOpen(false);\n setLoading(false);\n }\n };\n\n if (loading) {\n return (\n <div\n className=\"block-editor-block-styles__item\"\n role=\"button\"\n tabIndex={index}\n aria-label=\"Fill\"\n style={{ color: isActive ? \"var(--wp-admin-theme-color)\" : \"inherit\" }}\n >\n <div\n className=\"block-editor-block-styles__item-preview\"\n style={{\n border: isActive\n ? \"2px solid var(--wp-admin-theme-color)\"\n : \"2px solid #e3e3e3\",\n margin: 0,\n display: \"flex\",\n \"align-items\": \"center\",\n \"justify-content\": \"center\",\n }}\n >\n <Spinner />\n </div>\n </div>\n );\n }\n\n return (\n <div\n className={`block-editor-block-styles__item presto-preset-${preset.slug}`}\n onClick={() => {\n setPreset(preset);\n }}\n role=\"button\"\n tabIndex={index}\n aria-label=\"Fill\"\n style={{ color: isActive ? \"var(--wp-admin-theme-color)\" : \"inherit\" }}\n >\n <div\n className=\"block-editor-block-styles__item-preview\"\n style={{\n border: isActive\n ? \"2px solid var(--wp-admin-theme-color)\"\n : \"2px solid #e3e3e3\",\n margin: 0,\n }}\n >\n <div\n style={{\n textAlign: \"center\",\n width: \"100%\",\n color: isActive ? \"var(--wp-admin-theme-color)\" : \"inherit\",\n opacity: isActive ? 1 : 0.75,\n }}\n >\n {preset?.icon ? (\n <Icon\n icon={preset?.icon}\n style={{\n fontSize: \"30px\",\n width: \"30px\",\n height: \"30px\",\n }}\n />\n ) : (\n <h1 style={{ opacity: 0.75 }}>\n {preset?.name?.charAt(0)?.toUpperCase() || \"Untitled\"}\n </h1>\n )}\n </div>\n </div>\n <div\n className=\"block-editor-block-styles__item-label\"\n style={{ fontWeight: \"bold\", textTransform: \"capitalize\" }}\n >\n {preset?.name || \"Untitled\"}\n </div>\n\n {!preset?.is_locked && (\n <div className=\"block-editor-block-styles__item-edit\">\n <div\n className=\"block-editor-block-styles__item-edit-icon\"\n onClick={onEdit}\n >\n <Icon icon=\"edit\" />\n </div>\n <div\n className=\"block-editor-block-styles__item-edit-icon\"\n onClick={openConfirm}\n >\n <Icon icon=\"trash\" />\n </div>\n </div>\n )}\n\n {confirmOpen && (\n <Modal\n title={__(\"Trash Preset?\", \"presto-player\")}\n onRequestClose={closeConfirm}\n style={{ maxWidth: \"250px\" }}\n >\n <p>\n <strong>{__(\"Warning!\", \"presto-player\")} </strong>\n {__(\n \"Any videos assigned to this preset will automatically use the default preset.\",\n \"presto-player\"\n )}\n </p>\n\n <ButtonGroup>\n <Button\n isDestructive\n onClick={trashPreset}\n style={{ margin: \"0 4px\" }}\n >\n {__(\"Trash\", \"presto-player\")}\n </Button>\n <Button\n isTertiary\n onClick={closeConfirm}\n style={{ margin: \"0 4px\", boxShadow: \"none\" }}\n >\n {__(\"Cancel\", \"presto-player\")}\n </Button>\n </ButtonGroup>\n </Modal>\n )}\n </div>\n );\n}\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst { withNotices, BaseControl, Spinner, Button } = wp.components;\nconst { useState, useEffect } = wp.element;\nconst { useSelect, dispatch } = wp.data;\n\nimport ProBadge from \"@/admin/blocks/shared/components/ProBadge\";\nimport EditPreset from \"./Edit\";\nimport Preset from \"./Preset\";\n\nfunction PlayerPresets({ attributes, setAttributes }) {\n // modal\n const [modal, setModal] = useState(false);\n const openModal = (type) => setModal(type);\n const closeModal = () => setModal(false);\n const [presetData, setPresetData] = useState(null);\n const [name, setName] = useState(null);\n\n // preset data\n const { presets, loading } = useSelect((select) => {\n return {\n presets: select(\"presto-player/player\").getPresets(),\n loading: select(\"presto-player/player\").isResolving(\"getPresets\"),\n };\n });\n\n // preset actions\n const addPreset = (preset) => {\n dispatch(\"presto-player/player\").addPreset(preset);\n };\n const updatePreset = (preset) => {\n dispatch(\"presto-player/player\").updatePreset(preset);\n };\n const removePreset = (preset) => {\n dispatch(\"presto-player/player\").removePreset(preset);\n };\n\n // set this preset id\n const setPreset = (preset) => {\n setAttributes({ preset: preset.id });\n };\n\n if (loading) {\n return (\n <div className=\"presto-settings__loading\">\n <Spinner />\n </div>\n );\n }\n\n return (\n <>\n {presets.length ? (\n <p>\n {__(\n \"Select a video configuration preset, or add your own.\",\n \"presto-player\"\n )}\n </p>\n ) : (\n \"\"\n )}\n\n <BaseControl>\n <div className=\"block-editor-block-styles\">\n {(presets || []).length\n ? presets.map((preset, i) => {\n return (\n <Preset\n setPreset={setPreset}\n index={i}\n isActive={attributes?.preset === preset.id}\n preset={preset}\n key={preset.id}\n onEdit={() => {\n setName(preset.name);\n setPresetData(preset);\n setModal(\"edit\");\n }}\n remove={removePreset}\n />\n );\n })\n : __(\n \"No style presets. You can create a new style by clicking 'Add New Style'.\",\n \"presto-plugin\"\n )}\n </div>\n </BaseControl>\n <BaseControl>\n <Button\n isPrimary\n data-cy=\"add-new-preset\"\n onClick={() => {\n if (!prestoPlayer?.isPremium) {\n dispatch(\"presto-player/player\").setProModal(true);\n return;\n }\n openModal(\"new\");\n }}\n >\n {__(\"Add New Preset\", \"presto-player\")}\n </Button>\n {!prestoPlayer?.isPremium && <ProBadge />}\n </BaseControl>\n {modal == \"new\" && (\n <EditPreset\n closeModal={closeModal}\n addPreset={addPreset}\n type=\"new\"\n onSave={setPreset}\n />\n )}\n {modal == \"edit\" && (\n <EditPreset\n closeModal={closeModal}\n addPreset={addPreset}\n updatePreset={updatePreset}\n type=\"edit\"\n preset={presetData}\n name={name}\n />\n )}\n </>\n );\n}\n\nexport default withNotices(PlayerPresets);\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst {\n PanelRow,\n TextControl,\n SelectControl,\n BaseControl,\n Button,\n FocalPointPicker,\n RangeControl,\n} = wp.components;\nconst { MediaUpload, MediaUploadCheck } = wp.blockEditor;\nconst { useState } = wp.element;\n\nconst VIDEO_OVERLAY_ALLOWED_MEDIA_TYPES = [\"image\"];\n\n// import font for text\nimport \"./settings-styles.css\";\n\nexport default ({ attributes, setAttributes, instanceId }) => {\n const { mutedOverlay } = attributes;\n\n const videoOverlayDescription = `video-block__overlay-image-description-${instanceId}`;\n\n // handle poster select\n function onSelectOverlay(image) {\n setAttributes({\n mutedOverlay: {\n ...mutedOverlay,\n ...{ src: image.url },\n },\n });\n }\n\n function onRemoveOverlay() {\n setAttributes({\n mutedOverlay: {\n ...mutedOverlay,\n ...{ src: \"\" },\n },\n });\n }\n\n return (\n <>\n <MediaUploadCheck>\n <BaseControl className=\"editor-video-overlay-control\">\n <BaseControl.VisualLabel>\n <p>{__(\"Overlay Image\", \"presto-player\")}</p>\n </BaseControl.VisualLabel>\n <MediaUpload\n title={__(\"Select overlay image\", \"presto-player\")}\n onSelect={onSelectOverlay}\n allowedTypes={VIDEO_OVERLAY_ALLOWED_MEDIA_TYPES}\n render={({ open }) => (\n <Button\n className=\"presto-setting__poster\"\n isPrimary\n onClick={open}\n >\n {!mutedOverlay?.src\n ? __(\"Select\", \"presto-player\")\n : __(\"Replace\", \"presto-player\")}\n </Button>\n )}\n />\n <p id={videoOverlayDescription} hidden>\n {mutedOverlay?.src\n ? sprintf(\n __(\"The current overlay image url is %s\", \"presto-player\"),\n mutedOverlay?.src\n )\n : __(\n \"There is no overlay image currently selected\",\n \"presto-player\"\n )}\n </p>\n {!!mutedOverlay?.src && (\n <Button\n onClick={onRemoveOverlay}\n className=\"presto-setting__remove-poster\"\n isTertiary\n >\n {__(\"Remove\", \"presto-player\")}\n </Button>\n )}\n </BaseControl>\n </MediaUploadCheck>\n {!!mutedOverlay?.src && (\n <FocalPointPicker\n url={\"\"}\n dimensions={{ width: 160, height: 90 }}\n value={mutedOverlay?.focalPoint}\n onChange={(focalPoint) =>\n setAttributes({\n mutedOverlay: {\n ...mutedOverlay,\n ...{ focalPoint },\n },\n })\n }\n />\n )}\n {!!mutedOverlay?.src && (\n <RangeControl\n label={__(\"Max Width (%)\", \"presto-player\")}\n value={mutedOverlay?.width}\n onChange={(width) =>\n setAttributes({\n mutedOverlay: {\n ...mutedOverlay,\n ...{ width },\n },\n })\n }\n min={1}\n max={100}\n />\n )}\n </>\n );\n};\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst {\n ToggleControl,\n SelectControl,\n BaseControl,\n Button,\n PanelRow,\n Icon,\n Flex,\n} = wp.components;\nconst { dispatch } = wp.data;\nimport { isHLS } from \"@/shared/util\";\n\nconst { MediaUpload, MediaUploadCheck } = wp.blockEditor;\nimport ProBadge from \"@/admin/blocks/shared/components/ProBadge\";\nimport MutedPreviewOptions from \"./MutedPreviewOptions\";\n\nconst VIDEO_POSTER_ALLOWED_MEDIA_TYPES = [\"image\"];\n\nconst { useInstanceId } = wp.compose;\n\nconst VideoSettings = ({ setAttributes, attributes }) => {\n const {\n mutedPreview,\n autoplay,\n playsInline,\n preload,\n poster,\n mutedOverlay,\n } = attributes;\n\n const instanceId = useInstanceId(VideoSettings);\n\n const videoPosterDescription = `video-block__poster-image-description-${instanceId}`;\n\n const getAutoplayHelp = (checked) => {\n return checked\n ? __(\n \"Note: Autoplaying videos may cause usability issues for some visitors.\",\n \"presto-player\"\n )\n : null;\n };\n\n const posterRecommended = () => {\n // if is hls and we've selected metadata or none, recommend a poster\n if (\n attributes?.src &&\n isHLS(attributes?.src) &&\n [\"metadata\", \"none\"].includes(preload)\n ) {\n return true;\n }\n\n return preload === \"none\" && !poster;\n };\n\n const toggleAttribute = (attribute) => {\n return (newValue) => {\n setAttributes({ [attribute]: newValue });\n };\n };\n\n // handle poster select\n function onSelectPoster(image) {\n setAttributes({ poster: image.url });\n }\n\n function onRemovePoster() {\n setAttributes({ poster: \"\" });\n }\n\n const mutedPreviewControls = () => {\n return (\n <>\n <ToggleControl\n label={\n <>\n {__(\"Muted Autoplay Preview\", \"presto-player\")}{\" \"}\n {!prestoPlayer?.isPremium && <ProBadge />}\n </>\n }\n onChange={(value) => {\n if (!prestoPlayer?.isPremium) {\n dispatch(\"presto-player/player\").setProModal(true);\n return;\n }\n setAttributes({\n mutedPreview: {\n ...mutedPreview,\n ...{ enabled: value },\n },\n });\n }}\n checked={mutedPreview?.enabled}\n className=\"presto-setting__mutedPreview\"\n help={__(\"Shows a muted preview of the video.\", \"presto-player\")}\n />\n {!!mutedPreview?.enabled && !attributes?.video_id && (\n <PanelRow>\n <ToggleControl\n label={__(\"Muted Preview Captions\", \"presto-player\")}\n onChange={(value) => {\n setAttributes({\n mutedPreview: {\n ...mutedPreview,\n ...{ captions: value },\n },\n });\n }}\n checked={mutedPreview?.captions}\n className=\"presto-setting__mutedPreviewCaptions\"\n help={__(\"Play captions during muted autoplay\", \"presto-player\")}\n />\n </PanelRow>\n )}\n\n {!!mutedPreview.enabled && (\n <PanelRow>\n <ToggleControl\n label={\n <>\n {__(\"Muted Preview Overlay\", \"presto-player\")}{\" \"}\n {!prestoPlayer?.isPremium && <ProBadge />}\n </>\n }\n onChange={(value) => {\n if (!prestoPlayer?.isPremium) {\n dispatch(\"presto-player/player\").setProModal(true);\n return;\n }\n setAttributes({\n mutedOverlay: {\n ...mutedOverlay,\n ...{ enabled: value },\n },\n });\n }}\n checked={mutedOverlay?.enabled}\n className=\"presto-setting__mutedOverlay\"\n help={__(\n \"Show an image over the top of the video either before or after the video.\",\n \"presto-player\"\n )}\n />\n </PanelRow>\n )}\n {mutedOverlay?.enabled && mutedPreview?.enabled && (\n <MutedPreviewOptions\n attributes={attributes}\n setAttributes={setAttributes}\n />\n )}\n </>\n );\n };\n\n return (\n <>\n {!autoplay && mutedPreviewControls()}\n\n {!mutedPreview?.enabled && (\n <ToggleControl\n label={__(\"Autoplay\", \"presto-player\")}\n className=\"presto-setting__autoplay\"\n onChange={toggleAttribute(\"autoplay\")}\n checked={autoplay}\n help={getAutoplayHelp}\n />\n )}\n <PanelRow>\n <ToggleControl\n label={__(\"Play inline\", \"presto-player\")}\n className=\"presto-setting__playsInline\"\n data-cy={\"playsInline\"}\n onChange={toggleAttribute(\"playsInline\")}\n checked={playsInline}\n help={__(\n \"On mobile browsers, play the video on the page instead of opening it up fullscreen.\",\n \"presto-player\"\n )}\n />\n </PanelRow>\n {!attributes?.video_id && (\n <PanelRow>\n <SelectControl\n label={\n <Flex>\n <div>{__(\"Performance Preference\", \"presto-player\")}</div>\n <a\n href=\"https://prestoplayer.com/docs/performance-preferences-explained\"\n target=\"_blank\"\n style={{ textDecoration: \"none\" }}\n >\n <Icon icon=\"editor-help\" />\n </a>\n </Flex>\n }\n className=\"presto-setting__preload\"\n value={preload}\n onChange={(value) => setAttributes({ preload: value })}\n help={\n posterRecommended() &&\n __(\n \"A poster image is recommended for this setting.\",\n \"presto-player\"\n )\n }\n options={[\n {\n value: \"auto\",\n label: __(\"Video Playback Speed\", \"presto-player\"),\n },\n {\n value: \"metadata\",\n label: __(\"Page Load Speed\", \"presto-player\"),\n },\n {\n value: \"none\",\n label: __(\"Page Load Speed (Extreme)\", \"presto-player\"),\n },\n ]}\n />\n </PanelRow>\n )}\n <MediaUploadCheck>\n <BaseControl className=\"editor-video-poster-control\">\n <BaseControl.VisualLabel>\n <p>{__(\"Poster image\", \"presto-player\")}</p>\n </BaseControl.VisualLabel>\n <MediaUpload\n title={__(\"Select poster image\", \"presto-player\")}\n onSelect={onSelectPoster}\n allowedTypes={VIDEO_POSTER_ALLOWED_MEDIA_TYPES}\n render={({ open }) => (\n <Button\n className=\"presto-setting__poster\"\n isPrimary\n onClick={open}\n aria-describedby={videoPosterDescription}\n >\n {!poster\n ? __(\"Select\", \"presto-player\")\n : __(\"Replace\", \"presto-player\")}\n </Button>\n )}\n />\n <p id={videoPosterDescription} hidden>\n {poster\n ? sprintf(\n __(\"The current poster image url is %s\", \"presto-player\"),\n poster\n )\n : __(\n \"There is no poster image currently selected\",\n \"presto-player\"\n )}\n </p>\n {!!poster && (\n <Button\n onClick={onRemovePoster}\n className=\"presto-setting__remove-poster\"\n isTertiary\n >\n {__(\"Remove\", \"presto-player\")}\n </Button>\n )}\n </BaseControl>\n </MediaUploadCheck>\n </>\n );\n};\n\nexport default VideoSettings;\n","const { PanelBody } = wp.components;\nconst { __ } = wp.i18n;\nimport VideoBranding from \"@/admin/blocks/shared/branding\";\nimport VideoChapters from \"@/admin/blocks/shared/chapters\";\nimport ProBadge from \"@/admin/blocks/shared/components/ProBadge\";\nimport VideoOverlays from \"@/admin/blocks/shared/overlays\";\nimport VideoPresets from \"@/admin/blocks/shared/presets\";\nimport VideoSettings from \"@/admin/blocks/shared/settings\";\n\nexport default function ({ attributes, setAttributes }) {\n return (\n <>\n <PanelBody\n title={\n <>\n {__(\"Chapters\", \"presto-player\")}{\" \"}\n {!prestoPlayer?.isPremium && <ProBadge />}\n </>\n }\n initialOpen={prestoPlayer?.isPremium}\n >\n <VideoChapters setAttributes={setAttributes} attributes={attributes} />\n </PanelBody>\n\n <PanelBody\n title={\n <>\n {__(\"Overlays\", \"presto-player\")}{\" \"}\n {!prestoPlayer?.isPremium && <ProBadge />}\n </>\n }\n initialOpen={prestoPlayer?.isPremium}\n >\n <VideoOverlays setAttributes={setAttributes} attributes={attributes} />\n </PanelBody>\n\n <PanelBody title={__(\"Video settings\", \"presto-player\")}>\n <VideoSettings setAttributes={setAttributes} attributes={attributes} />\n </PanelBody>\n\n <PanelBody title={__(\"Video Preset\", \"presto-player\")}>\n <VideoPresets setAttributes={setAttributes} attributes={attributes} />\n </PanelBody>\n\n <PanelBody\n title={__(\"Global Player Branding\", \"presto-player\")}\n initialOpen={false}\n >\n <VideoBranding setAttributes={setAttributes} attributes={attributes} />\n </PanelBody>\n </>\n );\n}\n","export const dashToPascalCase = (str) => str\n .toLowerCase()\n .split('-')\n .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))\n .join('');\nexport const camelToDashCase = (str) => str.replace(/([A-Z])/g, (m) => `-${m[0].toLowerCase()}`);\n//# sourceMappingURL=case.js.map","import { camelToDashCase } from './case';\nexport const attachProps = (node, newProps, oldProps = {}) => {\n // some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first\n if (node instanceof Element) {\n // add any classes in className to the class list\n const className = getClassName(node.classList, newProps, oldProps);\n if (className !== '') {\n node.className = className;\n }\n Object.keys(newProps).forEach((name) => {\n if (name === 'children' ||\n name === 'style' ||\n name === 'ref' ||\n name === 'class' ||\n name === 'className' ||\n name === 'forwardedRef') {\n return;\n }\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2);\n const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);\n if (!isCoveredByReact(eventNameLc)) {\n syncEvent(node, eventNameLc, newProps[name]);\n }\n }\n else {\n node[name] = newProps[name];\n const propType = typeof newProps[name];\n if (propType === 'string') {\n node.setAttribute(camelToDashCase(name), newProps[name]);\n }\n }\n });\n }\n};\nexport const getClassName = (classList, newProps, oldProps) => {\n const newClassProp = newProps.className || newProps.class;\n const oldClassProp = oldProps.className || oldProps.class;\n // map the classes to Maps for performance\n const currentClasses = arrayToMap(classList);\n const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);\n const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);\n const finalClassNames = [];\n // loop through each of the current classes on the component\n // to see if it should be a part of the classNames added\n currentClasses.forEach((currentClass) => {\n if (incomingPropClasses.has(currentClass)) {\n // add it as its already included in classnames coming in from newProps\n finalClassNames.push(currentClass);\n incomingPropClasses.delete(currentClass);\n }\n else if (!oldPropClasses.has(currentClass)) {\n // add it as it has NOT been removed by user\n finalClassNames.push(currentClass);\n }\n });\n incomingPropClasses.forEach((s) => finalClassNames.push(s));\n return finalClassNames.join(' ');\n};\n/**\n * Checks if an event is supported in the current execution environment.\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\nexport const isCoveredByReact = (eventNameSuffix) => {\n if (typeof document === 'undefined') {\n return true;\n }\n else {\n const eventName = 'on' + eventNameSuffix;\n let isSupported = eventName in document;\n if (!isSupported) {\n const element = document.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof element[eventName] === 'function';\n }\n return isSupported;\n }\n};\nexport const syncEvent = (node, eventName, newEventHandler) => {\n const eventStore = node.__events || (node.__events = {});\n const oldEventHandler = eventStore[eventName];\n // Remove old listener so they don't double up.\n if (oldEventHandler) {\n node.removeEventListener(eventName, oldEventHandler);\n }\n // Bind new listener.\n node.addEventListener(eventName, (eventStore[eventName] = function handler(e) {\n if (newEventHandler) {\n newEventHandler.call(this, e);\n }\n }));\n};\nconst arrayToMap = (arr) => {\n const map = new Map();\n arr.forEach((s) => map.set(s, s));\n return map;\n};\n//# sourceMappingURL=attachProps.js.map","import React from 'react';\nexport const setRef = (ref, value) => {\n if (typeof ref === 'function') {\n ref(value);\n }\n else if (ref != null) {\n // Cast as a MutableRef so we can assign current\n ref.current = value;\n }\n};\nexport const mergeRefs = (...refs) => {\n return (value) => {\n refs.forEach(ref => {\n setRef(ref, value);\n });\n };\n};\nexport const createForwardRef = (ReactComponent, displayName) => {\n const forwardRef = (props, ref) => {\n return React.createElement(ReactComponent, Object.assign({}, props, { forwardedRef: ref }));\n };\n forwardRef.displayName = displayName;\n return React.forwardRef(forwardRef);\n};\nexport const defineCustomElement = (tagName, customElement) => {\n if (customElement !== undefined &&\n typeof customElements !== 'undefined' &&\n !customElements.get(tagName)) {\n customElements.define(tagName, customElement);\n }\n};\nexport * from './attachProps';\nexport * from './case';\n//# sourceMappingURL=index.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport React from 'react';\nimport { attachProps, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs, } from './utils';\nexport const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFunction, defineCustomElement) => {\n if (defineCustomElement !== undefined) {\n defineCustomElement();\n }\n const displayName = dashToPascalCase(tagName);\n const ReactComponent = class extends React.Component {\n constructor(props) {\n super(props);\n this.setComponentElRef = (element) => {\n this.componentEl = element;\n };\n }\n componentDidMount() {\n this.componentDidUpdate(this.props);\n }\n componentDidUpdate(prevProps) {\n attachProps(this.componentEl, this.props, prevProps);\n }\n render() {\n const _a = this.props, { children, forwardedRef, style, className, ref } = _a, cProps = __rest(_a, [\"children\", \"forwardedRef\", \"style\", \"className\", \"ref\"]);\n let propsToPass = Object.keys(cProps).reduce((acc, name) => {\n if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {\n const eventName = name.substring(2).toLowerCase();\n if (typeof document !== 'undefined' && isCoveredByReact(eventName)) {\n acc[name] = cProps[name];\n }\n }\n else {\n acc[name] = cProps[name];\n }\n return acc;\n }, {});\n if (manipulatePropsFunction) {\n propsToPass = manipulatePropsFunction(this.props, propsToPass);\n }\n const newProps = Object.assign(Object.assign({}, propsToPass), { ref: mergeRefs(forwardedRef, this.setComponentElRef), style });\n return React.createElement(tagName, newProps, children);\n }\n static get displayName() {\n return displayName;\n }\n };\n // If context was passed to createReactComponent then conditionally add it to the Component Class\n if (ReactComponentContext) {\n ReactComponent.contextType = ReactComponentContext;\n }\n return createForwardRef(ReactComponent, displayName);\n};\n//# sourceMappingURL=createComponent.js.map","/* eslint-disable */\n/* tslint:disable */\n/* auto-generated react proxies */\nimport { createReactComponent } from './react-component-lib';\nexport const PrestoActionBar = /*@__PURE__*/ createReactComponent('presto-action-bar');\nexport const PrestoActionBarController = /*@__PURE__*/ createReactComponent('presto-action-bar-controller');\nexport const PrestoActionBarUi = /*@__PURE__*/ createReactComponent('presto-action-bar-ui');\nexport const PrestoAudio = /*@__PURE__*/ createReactComponent('presto-audio');\nexport const PrestoBunny = /*@__PURE__*/ createReactComponent('presto-bunny');\nexport const PrestoCtaOverlay = /*@__PURE__*/ createReactComponent('presto-cta-overlay');\nexport const PrestoCtaOverlayController = /*@__PURE__*/ createReactComponent('presto-cta-overlay-controller');\nexport const PrestoCtaOverlayUi = /*@__PURE__*/ createReactComponent('presto-cta-overlay-ui');\nexport const PrestoDynamicOverlayUi = /*@__PURE__*/ createReactComponent('presto-dynamic-overlay-ui');\nexport const PrestoDynamicOverlays = /*@__PURE__*/ createReactComponent('presto-dynamic-overlays');\nexport const PrestoEmailOverlay = /*@__PURE__*/ createReactComponent('presto-email-overlay');\nexport const PrestoEmailOverlayController = /*@__PURE__*/ createReactComponent('presto-email-overlay-controller');\nexport const PrestoEmailOverlayUi = /*@__PURE__*/ createReactComponent('presto-email-overlay-ui');\nexport const PrestoMutedOverlay = /*@__PURE__*/ createReactComponent('presto-muted-overlay');\nexport const PrestoPlayer = /*@__PURE__*/ createReactComponent('presto-player');\nexport const PrestoPlayerButton = /*@__PURE__*/ createReactComponent('presto-player-button');\nexport const PrestoPlayerSkeleton = /*@__PURE__*/ createReactComponent('presto-player-skeleton');\nexport const PrestoPlayerSpinner = /*@__PURE__*/ createReactComponent('presto-player-spinner');\nexport const PrestoTimestamp = /*@__PURE__*/ createReactComponent('presto-timestamp');\nexport const PrestoVideo = /*@__PURE__*/ createReactComponent('presto-video');\nexport const PrestoVideoCurtainUi = /*@__PURE__*/ createReactComponent('presto-video-curtain-ui');\nexport const PrestoVimeo = /*@__PURE__*/ createReactComponent('presto-vimeo');\nexport const PrestoYoutube = /*@__PURE__*/ createReactComponent('presto-youtube');\nexport const PrestoYoutubeSubscribeButton = /*@__PURE__*/ createReactComponent('presto-youtube-subscribe-button');\n//# sourceMappingURL=index.js.map","(function() { module.exports = window[\"wp\"][\"blockEditor\"]; }());","/** @jsx jsx */\nconst { __ } = wp.i18n;\nconst { Button, Popover, Icon } = wp.components;\n\nconst { __experimentalLinkControl: LinkControl } = wp.blockEditor;\nconst { useState } = wp.element;\nconst { prependHTTP } = wp.url;\n\nimport { css, jsx } from \"@emotion/core\";\n\nexport default ({ setSettings, settings }) => {\n const [visible, setVisible] = useState(false);\n const { url } = settings;\n\n /**\n * Pending settings to be applied to the next link. When inserting a new\n * link, toggle values cannot be applied immediately, because there is not\n * yet a link for them to apply to. Thus, they are maintained in a state\n * value until the time that the link can be inserted or edited.\n *\n * @type {[Object|undefined,Function]}\n */\n const [nextLinkValue, setNextLinkValue] = useState();\n\n const linkValue = {\n url: settings?.url,\n type: settings?.type,\n id: settings?.id,\n opensInNewTab: settings?.opensInNewTab,\n ...nextLinkValue,\n };\n\n const onChangeLink = (nextValue) => {\n // Merge with values from state, both for the purpose of assigning the\n // next state value, and for use in constructing the new link format if\n // the link is ready to be applied.\n nextValue = {\n ...nextLinkValue,\n ...nextValue,\n };\n\n // LinkControl calls `onChange` immediately upon the toggling a setting.\n const didToggleSetting =\n linkValue.opensInNewTab !== nextValue.opensInNewTab &&\n linkValue.url === nextValue.url;\n\n // If change handler was called as a result of a settings change during\n // link insertion, it must be held in state until the link is ready to\n // be applied.\n const didToggleSettingForNewLink =\n didToggleSetting && nextValue.url === undefined;\n\n // If link will be assigned, the state value can be considered flushed.\n // Otherwise, persist the pending changes.\n setNextLinkValue(didToggleSettingForNewLink ? nextValue : undefined);\n\n if (didToggleSettingForNewLink) {\n return;\n }\n\n const newUrl = prependHTTP(nextValue.url);\n setSettings({\n url: newUrl,\n type: nextValue.type,\n id:\n nextValue.id !== undefined && nextValue.id !== null\n ? String(nextValue.id)\n : undefined,\n opensInNewTab: nextValue.opensInNewTab,\n });\n };\n\n const confirmTrash = () => {\n const r = confirm(\n __(\"Are you sure you wish to remove this link?\", \"presto-player\")\n );\n if (r) {\n setSettings({});\n }\n };\n\n return (\n <span>\n {url ? (\n <div\n css={css`\n display: flex;\n justify-content: space-between;\n `}\n >\n <div\n css={css`\n max-width: 85%;\n overflow: hidden;\n display: flex;\n align-items: center;\n `}\n >\n <a\n href=\"#\"\n css={css`\n padding: 10px;\n background: #f3f3f3;\n border-radius: 4px;\n width: 100%;\n display: inline-flex;\n align-items: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n text-decoration: none;\n `}\n onClick={() => setVisible(!visible)}\n >\n <Icon\n icon=\"edit\"\n css={css`\n cursor: pointer;\n opacity: 0.75;\n margin: 0 2px;\n font-size: 16px;\n width: 16px;\n height: 16px;\n text-decoration: none;\n `}\n />\n {url}\n </a>\n {visible && (\n <Popover\n position=\"bottom center\"\n onClose={() => setVisible(false)}\n >\n <LinkControl value={settings} onChange={onChangeLink} />\n </Popover>\n )}\n </div>\n <div\n css={css`\n display: flex;\n align-items: center;\n `}\n >\n <Icon\n onClick={confirmTrash}\n icon=\"trash\"\n className=\"presto-icon\"\n css={css`\n cursor: pointer;\n opacity: 0.75;\n margin: 0 2px;\n fontsize: 18px;\n width: 18px;\n height: 18px;\n\n &:hover {\n color: #cc1818;\n }\n `}\n />\n </div>\n </div>\n ) : (\n <span>\n <Button isPrimary isSmall onClick={() => setVisible(!visible)}>\n {__(\"Add Link\", \"presto-player\")}\n </Button>\n {visible && (\n <Popover position=\"bottom center\" onClose={() => setVisible(false)}>\n <LinkControl value={settings} onChange={onChangeLink} />\n </Popover>\n )}\n </span>\n )}\n </span>\n );\n};\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst {\n ColorPicker,\n Button,\n withNotices,\n BaseControl,\n RangeControl,\n} = wp.components;\nconst { MediaUpload, MediaUploadCheck } = wp.blockEditor;\nconst { useInstanceId } = wp.compose;\nconst { useState } = wp.element;\nconst { dispatch, useSelect } = wp.data;\nimport ProBadge from \"@/admin/blocks/shared/components/ProBadge\";\n\nconst VIDEO_LOGO_ALLOWED_MEDIA_TYPES = [\"image\"];\n\nfunction PlayerSettings({ setAttributes, attributes, type }) {\n const instanceId = useInstanceId(PlayerSettings);\n const [pickerRender, setPickerRender] = useState(1);\n\n // get branding options\n const branding = useSelect((select) => {\n return select(\"presto-player/player\").branding();\n });\n // save options\n const saveOptions = async () => {\n await dispatch(\"presto-player/player\").saveOptions({\n branding,\n });\n wp.data.dispatch(\"core/notices\").createNotice(\n \"success\", // Can be one of: success, info, warning, error.\n \"Player branding saved.\", // Text string to display.\n {\n type: \"snackbar\",\n isDismissible: true, // Whether the user can dismiss the notice.\n // Any actions the user can perform.\n }\n );\n };\n\n function onSelectLogo(image) {\n dispatch(\"presto-player/player\").updateBranding(\"logo\", image.url);\n }\n\n function onRemoveLogo() {\n dispatch(\"presto-player/player\").updateBranding(\"logo\", \"\");\n }\n\n return (\n <div className=\"presto-player__panel--branding\">\n {type !== \"audio\" && (\n <p>\n {__(\n \"Here you can select the global player branding This will apply to all players on the site.\",\n \"presto-player\"\n )}\n </p>\n )}\n\n <MediaUploadCheck>\n <BaseControl className=\"editor-video-poster-control\">\n {type !== \"audio\" && (\n <>\n <BaseControl.VisualLabel>\n <p>\n {__(\"Logo Overlay\", \"presto-player\")}{\" \"}\n {!prestoPlayer?.isPremium && <ProBadge />}\n </p>\n </BaseControl.VisualLabel>\n <MediaUpload\n title={__(\"Select logo overlay image\", \"presto-player\")}\n onSelect={onSelectLogo}\n allowedTypes={VIDEO_LOGO_ALLOWED_MEDIA_TYPES}\n render={({ open }) => (\n <Button\n className=\"presto-setting__logo\"\n isSecondary\n onClick={() => {\n if (!prestoPlayer?.isPremium) {\n dispatch(\"presto-player/player\").setProModal(true);\n return;\n }\n open();\n }}\n aria-describedby={`video-block__logo-image-description-${instanceId}`}\n >\n {!branding?.logo\n ? __(\"Select\", \"presto-player\")\n : __(\"Replace\", \"presto-player\")}\n </Button>\n )}\n />\n </>\n )}\n\n <p id={`video-block__logo-image-description-${instanceId}`} hidden>\n {branding?.logo\n ? sprintf(\n /* translators: %s: poster image URL. */\n __(\"The current logo image url is %s\", \"presto-player\"),\n branding?.logo\n )\n : __(\n \"There is no logo image currently selected\",\n \"presto-player\"\n )}\n </p>\n {!!branding?.logo && (\n <Button onClick={onRemoveLogo} isTertiary>\n {__(\"Remove\", \"presto-player\")}\n </Button>\n )}\n </BaseControl>\n </MediaUploadCheck>\n\n {!!branding?.logo && (\n <RangeControl\n label={__(\"Logo Max Width\", \"presto-player\")}\n value={branding?.logo_width || 150}\n onChange={(width) =>\n dispatch(\"presto-player/player\").updateBranding(\"logo_width\", width)\n }\n min={1}\n max={400}\n />\n )}\n\n <ColorPicker\n color={branding?.color}\n onChangeComplete={(value) => {\n dispatch(\"presto-player/player\").updateBranding(\"color\", value.hex);\n }}\n key={pickerRender}\n disableAlpha\n />\n\n {branding?.color && (\n <BaseControl>\n <Button\n isSecondary\n onClick={() => {\n dispatch(\"presto-player/player\").updateBranding(\n \"color\",\n prestoPlayer?.defaults?.color || \"#00b3ff\"\n );\n setPickerRender(pickerRender + 1);\n }}\n >\n {__(\"Reset Color\", \"presto-player\")}\n </Button>\n </BaseControl>\n )}\n\n <Button isPrimary onClick={saveOptions}>\n {__(\"Save Branding\", \"presto-player\")}\n </Button>\n </div>\n );\n}\n\nexport default withNotices(PlayerSettings);\n","(function() { module.exports = window[\"wp\"][\"compose\"]; }());","/**\n * External dependencies\n */\nimport classnames from \"classnames\";\n\n/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst { useState, useEffect } = wp.element;\n\nconst { partial, noop, find } = lodash;\n\n/**\n * WordPress components\n */\nconst { NavigableMenu, Animate } = wp.components;\n\nexport default ({\n className,\n children,\n items,\n title,\n orientation = \"horizontal\",\n activeClass = \"is-active\",\n onSelect = noop,\n}) => {\n const [selected, setSelected] = useState(null);\n const [origin, setOrigin] = useState(\"left\");\n\n const handleClick = (itemKey) => {\n setSelected(itemKey);\n onSelect && onSelect(itemKey);\n };\n\n const onNavigate = (childIndex, child) => {\n child.click();\n };\n\n const selectedTab = find(items, { name: selected });\n const selectedId = `${selectedTab?.name ?? \"none\"}`;\n\n useEffect(() => {\n setOrigin(selected ? \"right\" : \"left\");\n }, [selected]);\n\n return (\n <div className={className}>\n <Animate type=\"slide-in\" origin={!!selectedTab ? \"right\" : \"left\"}>\n {({ className }) =>\n !selectedTab ? (\n <div className={classnames(className, \"is-from-right\")}>\n {!!title && <h2>{title}</h2>}\n <NavigableMenu\n role=\"itemlist\"\n orientation={orientation}\n onNavigate={onNavigate}\n className={classnames(\"presto-player__menu-items\")}\n >\n {items.map((item) => (\n <div\n className={classnames(\n \"presto-player__menu-item\",\n item.className,\n {\n [activeClass]: item.name === selected,\n }\n )}\n itemId={`${item.name}`}\n aria-controls={`${item.name}-view`}\n selected={item.name === selected}\n key={item.name}\n onClick={partial(handleClick, item.name)}\n >\n {!!item.icon && (\n <div class=\"presto-player__menu-icon\">{item.icon}</div>\n )}\n {item.title}\n <svg\n className=\"submenu-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width=\"24\"\n height=\"24\"\n role=\"img\"\n ariaHidden=\"true\"\n focusable=\"false\"\n >\n <path d=\"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z\"></path>\n </svg>\n </div>\n ))}\n </NavigableMenu>\n </div>\n ) : (\n <div\n key={selectedId}\n aria-labelledby={selectedId}\n role=\"itempanel\"\n id={`${selectedId}-view`}\n className={classnames(className, \"presto-player__menu-content\")}\n >\n <div className=\"presto-player__menu-items\">\n <div\n className=\"presto-player__menu-item is-back-button\"\n onClick={() => handleClick(\"\")}\n >\n <svg\n class=\"back-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width=\"24\"\n height=\"24\"\n role=\"img\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path d=\"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z\"></path>\n </svg>\n {__(\"Back\", \"presto-player\")}\n </div>\n </div>\n {children(selectedTab)}\n </div>\n )\n }\n </Animate>\n </div>\n );\n};\n","/** @jsx jsx */\n\n/**\n * WordPress dependencies\n */\nimport { __ } from \"@wordpress/i18n\";\nimport {\n ToggleControl,\n BaseControl,\n RangeControl,\n TextControl,\n Flex,\n Button,\n TextareaControl,\n Notice,\n} from \"@wordpress/components\";\nimport { useEffect } from \"@wordpress/element\";\nimport { useSelect } from \"@wordpress/data\";\n\nimport UrlSelect from \"../components/UrlSelect\";\nimport ColorPopup from \"../components/ColorPopup\";\n\nimport { css, jsx } from \"@emotion/core\";\n\nfunction CTA({ state, updateState, className }) {\n const { cta, email_collection } = state;\n\n const branding = useSelect((select) => {\n return select(\"presto-player/player\").branding();\n });\n\n // set defaults\n const defaults = {\n percentage: 100,\n show_rewatch: true,\n show_skip: true,\n headline: __(\"Want to learn more?\", \"presto-player\"),\n show_button: true,\n button_text: __(\"Click Here\", \"presto-player\"),\n button_link: {\n opensInNewTab: true,\n },\n };\n useEffect(() => {\n Object.keys(defaults).forEach((key) => {\n if (state?.cta?.[key] === undefined) {\n updateCTAState({\n [key]: defaults[key],\n });\n }\n });\n }, [state]);\n\n const updateCTAState = (updated) => {\n updateState({\n ...state,\n cta: {\n ...cta,\n ...updated,\n },\n });\n };\n\n const disableEmailCapture = () => {\n updateState({\n ...state,\n email_collection: {\n ...email_collection,\n ...{ enabled: false },\n },\n });\n };\n\n return (\n <div className={className}>\n <BaseControl>\n <h3>{__(\"Call To Action\", \"presto-player\")}</h3>\n </BaseControl>\n <BaseControl className=\"presto-player__control--large-play\">\n <ToggleControl\n label={__(\"Enable\", \"presto-player\")}\n help={__(\n \"Show an email collection form and message over your player.\",\n \"presto-player\"\n )}\n onChange={(enabled) => {\n updateCTAState({\n enabled,\n });\n }}\n checked={cta?.enabled}\n />\n </BaseControl>\n {!!cta?.enabled && (\n <>\n <BaseControl className=\"presto-player__control--percentage-watched\">\n <RangeControl\n label={__(\"Display At (Percentage)\", \"presto-player\")}\n labelPosition=\"top\"\n onChange={(percentage) => {\n updateCTAState({\n percentage,\n });\n }}\n marks={[\n {\n value: 0,\n label: __(\"Start\", \"presto-player\"),\n },\n {\n value: 50,\n label: __(\"50% Watched\", \"presto-player\"),\n },\n {\n value: 100,\n label: __(\"End\", \"presto-player\"),\n },\n ]}\n shiftStep={5}\n value={cta?.percentage}\n />\n </BaseControl>\n\n {email_collection?.enabled &&\n email_collection?.percentage === cta?.percentage && (\n <Notice\n css={css`\n margin: 0 0 30px 0 !important;\n `}\n status=\"warning\"\n isDismissible={false}\n >\n {__(\n \"You already have an email capture set display at the same time.\",\n \"presto-player\"\n )}\n <Button\n onClick={disableEmailCapture}\n isLink\n css={css`\n margin-top: 10px !important;\n `}\n >\n {__(\"Disable Email Capture\", \"presto-player\")}\n </Button>\n </Notice>\n )}\n\n {cta?.percentage === 100 ? (\n <BaseControl className=\"presto-player__control--show-rewatch\">\n <ToggleControl\n label={__(\"Show Rewatch Button\", \"presto-player\")}\n help={__(\n \"Show a rewatch button at the end of the player.\",\n \"presto-player\"\n )}\n onChange={(show_rewatch) => {\n updateCTAState({\n show_rewatch,\n });\n }}\n checked={cta?.show_rewatch}\n />\n </BaseControl>\n ) : (\n <BaseControl className=\"presto-player__control--show-skip\">\n <ToggleControl\n label={__(\"Allow Skipping\", \"presto-player\")}\n help={__(\n \"Let the user continue watching the player.\",\n \"presto-player\"\n )}\n onChange={(show_skip) => {\n updateCTAState({\n show_skip,\n });\n }}\n checked={cta?.show_skip}\n />\n </BaseControl>\n )}\n\n <BaseControl className=\"presto-player__control--button-link\">\n <BaseControl.VisualLabel>\n <p> {__(\"Link\", \"presto-player\")}</p>\n </BaseControl.VisualLabel>\n <UrlSelect\n setSettings={(val) => {\n updateCTAState({\n button_link: val,\n });\n }}\n settings={cta?.button_link || {}}\n />\n </BaseControl>\n\n <BaseControl className=\"presto-player__control--headline\">\n <TextareaControl\n label={__(\"Headline\", \"presto-player\")}\n help={__(\"The headline for your form.\", \"presto-player\")}\n value={cta?.headline}\n onChange={(headline) => {\n updateCTAState({\n headline,\n });\n }}\n />\n </BaseControl>\n\n <BaseControl className=\"presto-player__control--bottom-text\">\n <TextareaControl\n label={__(\"Bottom Text\", \"presto-player\")}\n help={__(\n \"Text displayed below the form. HTML allowed.\",\n \"presto-player\"\n )}\n value={cta?.bottom_text}\n onChange={(bottom_text) => {\n updateCTAState({\n bottom_text,\n });\n }}\n />\n </BaseControl>\n\n <BaseControl className=\"presto-player__control--show-button\">\n <ToggleControl\n label={__(\"Show Button\", \"presto-player\")}\n help={__(\"Show a call to action button.\", \"presto-player\")}\n onChange={(show_button) => {\n updateCTAState({\n show_button,\n });\n }}\n checked={cta?.show_button}\n />\n </BaseControl>\n\n {!!cta?.show_button && (\n <div>\n <BaseControl className=\"presto-player__control--button-text\">\n <TextControl\n label={__(\"Button Text\", \"presto-player\")}\n help={\n <p>\n {__(\n \"Button text for the Call To Action\",\n \"presto-player\"\n )}\n </p>\n }\n value={cta?.button_text}\n onChange={(button_text) => updateCTAState({ button_text })}\n />\n </BaseControl>\n\n <h3>{__(\"Style\", \"presto-player\")}</h3>\n\n <BaseControl>\n <RangeControl\n label={__(\"Round Corners\", \"presto-player\")}\n help={__(\"Border radius of form elements.\", \"presto-player\")}\n value={cta?.button_radius || 0}\n onChange={(button_radius) =>\n updateCTAState({ button_radius })\n }\n min={0}\n max={25}\n />\n </BaseControl>\n\n <BaseControl className=\"presto-player__control--button-color\">\n <Flex>\n <BaseControl.VisualLabel>\n {__(\"Button Color\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <ColorPopup\n color={cta?.button_color || branding?.color}\n setColor={(value) =>\n updateCTAState({\n button_color: value && value.hex,\n })\n }\n />\n </Flex>\n </BaseControl>\n <BaseControl className=\"presto-player__control--button-text-color\">\n <Flex>\n <BaseControl.VisualLabel>\n {__(\"Button Text Color\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <ColorPopup\n color={cta?.button_text_color || \"#ffffff\"}\n setColor={(value) =>\n updateCTAState({\n button_text_color: value && value.hex,\n })\n }\n />\n </Flex>\n </BaseControl>\n </div>\n )}\n <BaseControl>\n <RangeControl\n label={__(\"Background Opacity\", \"presto-player\")}\n help={__(\n \"Opacity percentage of the cover background.\",\n \"presto-player\"\n )}\n value={cta?.background_opacity || 75}\n onChange={(background_opacity) =>\n updateCTAState({ background_opacity })\n }\n min={0}\n max={100}\n />\n </BaseControl>\n </>\n )}\n </div>\n );\n}\n\nCTA.defaultProps = {\n catName: \"Sandy\",\n eyeColor: \"deepblue\",\n age: \"120\",\n};\n\nexport default CTA;\n","// import apiFetch from \"@wordpress/api-fetch\";\nconst { apiFetch } = wp;\n\n// nonce and root\napiFetch.use(apiFetch.createNonceMiddleware(prestoPlayer.nonce));\napiFetch.use(\n apiFetch.createRootURLMiddleware(\n prestoPlayer.root + prestoPlayer.prestoVersionString\n )\n);\n\nexport default apiFetch;\n","/**\n * WordPress dependencies\n */\n// import { __, sprintf } from '@wordpress/i18n';\nconst { __, sprintf } = wp.i18n;\nconst {\n NavigableMenu,\n MenuItem,\n FormFileUpload,\n MenuGroup,\n ToolbarGroup,\n ToolbarButton,\n Dropdown,\n SVG,\n Rect,\n Path,\n Button,\n TextControl,\n SelectControl,\n} = wp.components;\nconst { MediaUpload, MediaUploadCheck } = wp.blockEditor;\nconst { useSelect } = wp.data;\nconst { useState } = wp.element;\n\nconst ALLOWED_TYPES = [\"text/vtt\"];\n\nconst DEFAULT_KIND = \"subtitles\";\n\n// const KIND_OPTIONS = [\n// { label: __(\"Subtitles\"), value: \"subtitles\" },\n// { label: __(\"Captions\"), value: \"captions\" },\n// { label: __(\"Descriptions\"), value: \"descriptions\" },\n// { label: __(\"Chapters\"), value: \"chapters\" },\n// { label: __(\"Metadata\"), value: \"metadata\" },\n// ];\n\nconst captionIcon = (\n <svg viewBox=\"0 0 29 25\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M17.5014 20.2854H28.6316V0.764648H0.110825V20.2854H11.241L14.3712 24.2854L17.5014 20.2854ZM14.3712 21.0401L16.5269 18.2854H26.6316V2.76465H2.11082V18.2854H12.2155L14.3712 21.0401Z\"\n />\n <path d=\"M10.4503 14.9446C9.56226 14.9446 8.76226 14.7606 8.05026 14.3926C7.33826 14.0166 6.77826 13.4966 6.37026 12.8326C5.97026 12.1606 5.77026 11.4006 5.77026 10.5526C5.77026 9.70464 5.97026 8.94864 6.37026 8.28464C6.77826 7.61264 7.33826 7.09264 8.05026 6.72464C8.76226 6.34864 9.56226 6.16064 10.4503 6.16064C11.2663 6.16064 11.9943 6.30464 12.6343 6.59264C13.2743 6.88064 13.8023 7.29664 14.2183 7.84064L12.4303 9.43664C11.9103 8.78064 11.2983 8.45264 10.5943 8.45264C10.0023 8.45264 9.52626 8.64464 9.16626 9.02864C8.80626 9.40464 8.62626 9.91264 8.62626 10.5526C8.62626 11.1926 8.80626 11.7046 9.16626 12.0886C9.52626 12.4646 10.0023 12.6526 10.5943 12.6526C11.2983 12.6526 11.9103 12.3246 12.4303 11.6686L14.2183 13.2646C13.8023 13.8086 13.2743 14.2246 12.6343 14.5126C11.9943 14.8006 11.2663 14.9446 10.4503 14.9446Z\" />\n <path d=\"M19.2042 14.9446C18.3162 14.9446 17.5162 14.7606 16.8042 14.3926C16.0922 14.0166 15.5322 13.4966 15.1242 12.8326C14.7242 12.1606 14.5242 11.4006 14.5242 10.5526C14.5242 9.70464 14.7242 8.94864 15.1242 8.28464C15.5322 7.61264 16.0922 7.09264 16.8042 6.72464C17.5162 6.34864 18.3162 6.16064 19.2042 6.16064C20.0202 6.16064 20.7482 6.30464 21.3882 6.59264C22.0282 6.88064 22.5562 7.29664 22.9722 7.84064L21.1842 9.43664C20.6642 8.78064 20.0522 8.45264 19.3482 8.45264C18.7562 8.45264 18.2802 8.64464 17.9202 9.02864C17.5602 9.40464 17.3802 9.91264 17.3802 10.5526C17.3802 11.1926 17.5602 11.7046 17.9202 12.0886C18.2802 12.4646 18.7562 12.6526 19.3482 12.6526C20.0522 12.6526 20.6642 12.3246 21.1842 11.6686L22.9722 13.2646C22.5562 13.8086 22.0282 14.2246 21.3882 14.5126C20.7482 14.8006 20.0202 14.9446 19.2042 14.9446Z\" />\n </svg>\n);\n\nfunction TrackList({ tracks, onEditPress }) {\n let content;\n if (tracks.length === 0) {\n content = (\n <p className=\"block-library-video-tracks-editor__tracks-informative-message\">\n {__(\n \"Captions are .vtt files that help make your content more accesible to a wider range of users.\",\n \"presto-player\"\n )}\n </p>\n );\n } else {\n content = tracks.map((track, index) => {\n return (\n <div\n key={index}\n className=\"block-library-video-tracks-editor__track-list-track\"\n >\n <span>{track.label} </span>\n <Button\n isTertiary\n onClick={() => onEditPress(index)}\n aria-label={sprintf(\n /* translators: %s: Label of the video text track e.g: \"French subtitles\" */\n __(\"Edit %s\", \"presto-player\"),\n track.label\n )}\n >\n {__(\"Edit\", \"presto-player\")}\n </Button>\n </div>\n );\n });\n }\n return (\n <MenuGroup\n label={__(\"Captions\", \"presto-player\")}\n className=\"block-library-video-tracks-editor__track-list\"\n >\n {content}\n </MenuGroup>\n );\n}\n\nfunction SingleTrackEditor({ track, onChange, onClose, onRemove }) {\n const { src = \"\", label = \"\", srcLang = \"\", kind = DEFAULT_KIND } = track;\n const fileName = src.startsWith(\"blob:\")\n ? \"\"\n : src.substring(src.lastIndexOf(\"/\") + 1);\n return (\n <NavigableMenu>\n <div className=\"block-library-video-tracks-editor__single-track-editor\">\n <span className=\"block-library-video-tracks-editor__single-track-editor-edit-track-label\">\n {__(\"Edit caption track\", \"presto-player\")}\n </span>\n <span>\n {__(\"File\", \"presto-player\")}: <b>{fileName}</b>\n </span>\n <div className=\"block-library-video-tracks-editor__single-track-editor-label-language\">\n <TextControl\n /* eslint-disable jsx-a11y/no-autofocus */\n autoFocus\n /* eslint-enable jsx-a11y/no-autofocus */\n onChange={(newLabel) =>\n onChange({\n ...track,\n label: newLabel,\n })\n }\n label={__(\"Label\", \"presto-player\")}\n value={label}\n help={__(\"Title of track\", \"presto-player\")}\n />\n <TextControl\n onChange={(newSrcLang) =>\n onChange({\n ...track,\n srcLang: newSrcLang,\n })\n }\n label={__(\"Source language\", \"presto-player\")}\n value={srcLang}\n help={__(\"Language tag (en, fr, etc.)\", \"presto-player\")}\n />\n </div>\n {/* <SelectControl\n className=\"block-library-video-tracks-editor__single-track-editor-kind-select\"\n options={KIND_OPTIONS}\n value={kind}\n label={__(\"Kind\")}\n onChange={(newKind) => {\n if (newKind === DEFAULT_KIND) {\n newKind = undefined;\n }\n onChange({\n ...track,\n kind: newKind,\n });\n }}\n /> */}\n <div className=\"block-library-video-tracks-editor__single-track-editor-buttons-container\">\n <Button\n isSecondary\n onClick={() => {\n const changes = {};\n let hasChanges = false;\n if (label === \"\") {\n changes.label = __(\"English\", \"presto-player\");\n hasChanges = true;\n }\n if (srcLang === \"\") {\n changes.srcLang = \"en\";\n hasChanges = true;\n }\n if (hasChanges) {\n onChange({\n ...track,\n ...changes,\n });\n }\n onClose();\n }}\n >\n {__(\"Close\", \"presto-player\")}\n </Button>\n <Button isDestructive isLink onClick={onRemove}>\n {__(\"Remove track\", \"presto-player\")}\n </Button>\n </div>\n </div>\n </NavigableMenu>\n );\n}\n\nexport default function TracksEditor({ tracks = [], onChange }) {\n const mediaUpload = useSelect((select) => {\n return select(\"core/block-editor\").getSettings().mediaUpload;\n }, []);\n const [trackBeingEdited, setTrackBeingEdited] = useState(null);\n\n if (!mediaUpload) {\n return null;\n }\n return (\n <Dropdown\n contentClassName=\"block-library-video-tracks-editor\"\n renderToggle={({ isOpen, onToggle }) => (\n <ToolbarGroup>\n <ToolbarButton\n label={__(\"Captions\", \"presto-player\")}\n showTooltip\n aria-expanded={isOpen}\n aria-haspopup=\"true\"\n onClick={onToggle}\n icon={captionIcon}\n />\n </ToolbarGroup>\n )}\n renderContent={({}) => {\n if (trackBeingEdited !== null) {\n return (\n <SingleTrackEditor\n track={tracks[trackBeingEdited]}\n onChange={(newTrack) => {\n const newTracks = [...tracks];\n newTracks[trackBeingEdited] = newTrack;\n onChange(newTracks);\n }}\n onClose={() => setTrackBeingEdited(null)}\n onRemove={() => {\n onChange(\n tracks.filter((_track, index) => index !== trackBeingEdited)\n );\n setTrackBeingEdited(null);\n }}\n />\n );\n }\n return (\n <>\n <NavigableMenu>\n <TrackList tracks={tracks} onEditPress={setTrackBeingEdited} />\n <MenuGroup\n className=\"block-library-video-tracks-editor__add-tracks-container\"\n label={__(\"Add caption languages\", \"presto-player\")}\n >\n <MediaUpload\n onSelect={({ url }) => {\n const trackIndex = tracks.length;\n onChange([...tracks, { src: url }]);\n setTrackBeingEdited(trackIndex);\n }}\n allowedTypes={ALLOWED_TYPES}\n render={({ open }) => (\n <MenuItem icon={\"media\"} onClick={open}>\n {__(\"Open Media Library\", \"presto-player\")}\n </MenuItem>\n )}\n />\n <MediaUploadCheck>\n <FormFileUpload\n onChange={(event) => {\n const files = event.target.files;\n const trackIndex = tracks.length;\n mediaUpload({\n allowedTypes: ALLOWED_TYPES,\n filesList: files,\n onFileChange: ([{ url }]) => {\n const newTracks = [...tracks];\n if (!newTracks[trackIndex]) {\n newTracks[trackIndex] = {};\n }\n newTracks[trackIndex] = {\n ...tracks[trackIndex],\n src: url,\n };\n onChange(newTracks);\n setTrackBeingEdited(trackIndex);\n },\n });\n }}\n accept=\".vtt,text/vtt\"\n render={({ openFileDialog }) => {\n return (\n <MenuItem\n icon={\"upload\"}\n onClick={() => {\n openFileDialog();\n }}\n >\n {__(\"Upload\", \"presto-player\")}\n </MenuItem>\n );\n }}\n />\n </MediaUploadCheck>\n </MenuGroup>\n </NavigableMenu>\n </>\n );\n }}\n />\n );\n}\n","const { __ } = wp.i18n;\nconst { Disabled } = wp.components;\nimport { PrestoCtaOverlayUi, PrestoEmailOverlayUi } from \"@presto-player/react\";\nimport { timeToSeconds } from \"../util\";\nimport Player from \"./Player\";\nconst { useState, useEffect } = wp.element;\n\nexport default ({\n state,\n branding,\n menu,\n src,\n poster,\n currentTime,\n preload,\n overlays,\n isDisabled = true,\n}) => {\n const [renderKey, setRenderKey] = useState(1);\n const { email_collection, cta } = state;\n\n useEffect(() => {\n setRenderKey(renderKey + 1);\n }, [\n state.skin,\n state[\"play-large\"],\n state.rewind,\n state.play,\n state[\"fast-forward\"],\n state.progress,\n state[\"current-time\"],\n state.mute,\n state.volume,\n state.speed,\n state.pip,\n state.fullscreen,\n state.captions,\n state.hide_logo,\n ]);\n\n const previews = {\n email: !!email_collection?.enabled && (\n <PrestoEmailOverlayUi\n className=\"email-overlay\"\n slot=\"player-end\"\n headline={email_collection?.headline}\n style={{\n \"--presto-player-email-border-radiuss\": `${email_collection?.button_radius}px`,\n \"--plyr-color-main\": state?.background_color || branding?.color,\n ...(email_collection.button_color\n ? {\n \"--presto-player-button-color\": `${email_collection.button_color}`,\n }\n : {}),\n ...(email_collection.button_text_color\n ? {\n \"--presto-player-button-text\": `${email_collection.button_text_color}`,\n }\n : {}),\n }}\n defaultHeadline={__(\"Enter your email to play.\", \"presto-player\")}\n bottomText={email_collection?.bottom_text}\n allowSkip={email_collection?.allow_skip}\n skipText={__(\"Skip\", \"presto-player\")}\n buttonText={email_collection?.button_text}\n placeholder={__(\"Email address\", \"presto-player\")}\n i18n={window.prestoPlayer.i18n}\n />\n ),\n cta: !!cta?.enabled && (\n <PrestoCtaOverlayUi\n className=\"cta-overlay\"\n style={{\n \"--presto-player-button-border-radius\": `${cta.button_radius}px`,\n ...(cta?.background_opacity\n ? {\n \"--presto-player-cta-background-opacity\": `${\n cta?.background_opacity / 100\n }`,\n }\n : {}),\n ...(cta.button_color\n ? {\n \"--presto-player-button-color\": `${cta.button_color}`,\n }\n : {}),\n ...(cta.button_text_color\n ? {\n \"--presto-player-button-text\": `${cta.button_text_color}`,\n }\n : {}),\n }}\n slot=\"player-end\"\n headline={cta?.headline}\n bottom-text={cta?.bottom_text}\n button-link={cta?.button_link}\n allow-skip={cta?.percentage !== 100 && cta?.show_skip}\n borderRadius={cta?.border_radius}\n allow-rewatch={cta?.percentage === 100 && cta?.show_rewatch}\n skip-text={__(\"Skip\", \"presto-player\")}\n show-button={cta?.show_button}\n button-text={cta?.button_text}\n i18n={window?.prestoPlayer?.i18n}\n />\n ),\n };\n\n return (\n <Disabled isDisabled={isDisabled} className=\"disable-player\">\n <div className=\"presto-player__wrapper\">\n <Player\n src={src || \"\"}\n className={`\n ${menu === \"cta\" && !!cta?.enabled && \"cta-active\"} \n ${\n menu === \"email\" && !!email_collection?.enabled && \"email-active\"\n }`}\n preset={state}\n branding={branding}\n i18n={prestoPlayerAdmin?.i18n}\n preload={preload}\n attributes={{\n chapters: [],\n poster: poster,\n }}\n currentTime={currentTime ? timeToSeconds(currentTime) : \"\"}\n overlays={overlays}\n key={renderKey}\n adminPreview={previews?.[menu] || \"\"}\n />\n </div>\n </Disabled>\n );\n};\n","const { __ } = wp.i18n;\nconst { TextareaControl } = wp.components;\nconst { useState } = wp.element;\n\nexport default ({ text, update, onFocus }) => {\n const [more, setMore] = useState(false);\n\n return (\n <div style={{ display: \"block\", width: \"100%\" }}>\n <TextareaControl\n label=\"Text\"\n help={\n <span>\n {__(\"This field accepts\", \"presto-player\")}{\" \"}\n <a\n href=\"#\"\n onClick={(e) => {\n setMore(!more);\n e.preventDefault();\n }}\n >\n {__(\"Dynamic Data\", \"presto-player\")}\n </a>\n {!!more && (\n <div style={{ marginTop: \"20px\" }}>\n {__(\n \"This field will also accept dynamic values that we will replace with dynamic content: {user.user_login}, {user.user_nicename}, {user.user_email}, {user.user_url},{user.user_registered}, {user.display_name}, {site.url}, {site.name}, {ip_address}\",\n \"presto-player\"\n )}\n </div>\n )}\n </span>\n }\n className={\"presto-player__overlay--text\"}\n placeholder={__(\"Enter some text.\", \"presto-player\")}\n value={text || \"\"}\n onChange={(text) => update({ text })}\n autoComplete=\"off\"\n onFocus={onFocus}\n />\n </div>\n );\n};\n","const {\n Button,\n Placeholder,\n TextControl,\n Flex,\n FlexItem,\n FlexBlock,\n} = wp.components;\nconst { useState } = wp.element;\nconst { __ } = wp.i18n;\n\nexport default function ({\n attributes,\n setAttributes,\n icon,\n onSelectURL,\n label,\n instructions,\n placeholder,\n}) {\n const { src } = attributes;\n const [state, setState] = useState({ src });\n return (\n <Placeholder\n icon={icon}\n label={label || __(\"Presto Embedded Video\", \"presto-player\")}\n instructions={instructions || __(\"Enter video URL\", \"presto-player\")}\n >\n <form\n onSubmit={(e) => {\n e.preventDefault();\n onSelectURL(state.url);\n }}\n >\n <Flex style={{ width: \"100%\", maxWidth: \"400px\" }}>\n <FlexBlock>\n <TextControl\n type=\"url\"\n className={\"presto-link-placeholder-input\"}\n placeholder={placeholder || __(\"Youtube URL\", \"presto-player\")}\n value={state.url}\n onChange={(url) => setState({ url })}\n />\n </FlexBlock>\n <FlexItem>\n <Button isPrimary style={{ marginBottom: \"8px\" }} type=\"submit\">\n {__(\"Add Video\", \"presto-player\")}\n </Button>\n </FlexItem>\n </Flex>\n </form>\n </Placeholder>\n );\n}\n","export default () => {\n return (\n <div>\n <presto-player-skeleton\n style={{ width: \"30%\", marginBottom: \"10px\" }}\n ></presto-player-skeleton>\n <presto-player-skeleton\n style={{ height: \"2rem\", marginBottom: \"20px\" }}\n ></presto-player-skeleton>\n </div>\n );\n};\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst { SelectControl, TextControl, Notice } = wp.components;\nconst { useEffect, useState } = wp.element;\nimport LoadSelect from \"../../components/LoadSelect\";\n\nexport default ({ options, updateEmailState }) => {\n const [fetching, setFetching] = useState(false);\n const [lists, setLists] = useState([\n { value: null, label: __(\"Choose an audience\", \"presto-player\") },\n ]);\n const [error, setError] = useState(\"\");\n\n const fetchLists = async () => {\n setFetching(true);\n try {\n const fetched = await wp.apiFetch({\n path: \"presto-player/v1/mailchimp/lists\",\n });\n\n let listOptions = lists;\n (fetched || []).forEach((list) => {\n listOptions = [\n ...listOptions,\n ...[\n {\n value: list.id,\n label: list.name,\n },\n ],\n ];\n });\n setLists(listOptions);\n } catch (e) {\n if (e?.message) {\n setError(e.message);\n }\n } finally {\n setFetching(false);\n }\n };\n\n useEffect(() => {\n fetchLists();\n }, []);\n\n if (fetching) {\n return (\n <div>\n <LoadSelect />\n <LoadSelect />\n </div>\n );\n }\n\n if (error) {\n return (\n <Notice className=\"presto-notice\" status=\"error\" isDismissible={false}>\n {error}\n </Notice>\n );\n }\n\n return (\n <div>\n <SelectControl\n label={__(\"Choose an audience\", \"presto-player\")}\n value={options?.provider_list}\n options={lists}\n onChange={(provider_list) => updateEmailState({ provider_list })}\n />\n <TextControl\n label={__(\"Tag\", \"presto-player\")}\n help={\n <p>\n {__(\n \"Give this contact an optional tag when they are added to the list.\",\n \"presto-player\"\n )}\n </p>\n }\n value={options?.provider_tag}\n onChange={(provider_tag) => updateEmailState({ provider_tag })}\n />\n </div>\n );\n};\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst { SelectControl, Notice } = wp.components;\nconst { useEffect, useState } = wp.element;\nimport LoadSelect from \"../../components/LoadSelect\";\n\nexport default ({ options, updateEmailState }) => {\n const [fetching, setFetching] = useState(false);\n const [groups, setGroups] = useState([\n { value: null, label: __(\"Choose a group\", \"presto-player\") },\n ]);\n const [error, setError] = useState(\"\");\n\n const fetchGroups = async () => {\n setFetching(true);\n try {\n const fetched = await wp.apiFetch({\n path: \"presto-player/v1/mailerlite/groups\",\n });\n\n let listOptions = groups;\n (fetched || []).forEach((list) => {\n listOptions = [\n ...listOptions,\n ...[\n {\n value: list.id,\n label: list.name,\n },\n ],\n ];\n });\n setGroups(listOptions);\n } catch (e) {\n if (e?.message) {\n setError(e.message);\n }\n } finally {\n setFetching(false);\n }\n };\n\n useEffect(() => {\n fetchGroups();\n }, []);\n\n if (fetching) {\n return <LoadSelect />;\n }\n\n if (error) {\n return (\n <Notice className=\"presto-notice\" status=\"error\" isDismissible={false}>\n {error}\n </Notice>\n );\n }\n\n return (\n <div>\n <SelectControl\n label={__(\"Choose a group\", \"presto-player\")}\n value={options?.provider_list}\n options={groups}\n onChange={(provider_list) => updateEmailState({ provider_list })}\n />\n </div>\n );\n};\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst { SelectControl, Notice } = wp.components;\nconst { useEffect, useState } = wp.element;\nimport LoadSelect from \"../../components/LoadSelect\";\n\nexport default ({ options, updateEmailState }) => {\n const [fetchingLists, setFetchingLists] = useState(false);\n const [fetchingTags, setFetchingTags] = useState(false);\n\n const [lists, setLists] = useState([\n { value: null, label: __(\"Choose a list\", \"presto-player\") },\n ]);\n const [tags, setTags] = useState([\n { value: null, label: __(\"Choose a tag\", \"presto-player\") },\n ]);\n const [error, setError] = useState(\"\");\n\n const fetchLists = async () => {\n setFetchingLists(true);\n try {\n const fetched = await wp.apiFetch({\n path: \"presto-player/v1/activecampaign/lists\",\n });\n\n let listOptions = lists;\n (fetched || []).forEach((list) => {\n listOptions = [\n ...listOptions,\n ...[\n {\n value: list.id,\n label: list.name || __(\"Default list\", \"presto-player\"),\n },\n ],\n ];\n });\n setLists(listOptions);\n } catch (e) {\n if (e?.message) {\n setError(e.message);\n }\n } finally {\n setFetchingLists(false);\n }\n };\n\n const fetchTags = async () => {\n setFetchingTags(true);\n try {\n const fetched = await wp.apiFetch({\n path: \"presto-player/v1/activecampaign/tags\",\n });\n\n let tagOptions = tags;\n (fetched || []).forEach((tag) => {\n tagOptions = [\n ...tagOptions,\n ...[\n {\n value: tag.id,\n label: tag.tag,\n },\n ],\n ];\n });\n setTags(tagOptions);\n } catch (e) {\n if (e?.message) {\n setError(e.message);\n }\n } finally {\n setFetchingTags(false);\n }\n };\n\n useEffect(() => {\n fetchLists();\n fetchTags();\n }, []);\n\n if (error) {\n return (\n <Notice className=\"presto-notice\" status=\"error\" isDismissible={false}>\n {error}\n </Notice>\n );\n }\n\n return (\n <div>\n {fetchingLists ? (\n <LoadSelect />\n ) : (\n lists.length > 1 && (\n <SelectControl\n label={__(\"Choose a list\", \"presto-player\")}\n value={options?.provider_list}\n options={lists}\n onChange={(provider_list) => updateEmailState({ provider_list })}\n />\n )\n )}\n\n {fetchingTags ? (\n <LoadSelect />\n ) : (\n tags.length > 1 && (\n <SelectControl\n label={__(\"Choose a tag\", \"presto-player\")}\n value={options?.provider_tag}\n options={tags}\n onChange={(provider_tag) => updateEmailState({ provider_tag })}\n />\n )\n )}\n </div>\n );\n};\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst { SelectControl, Notice } = wp.components;\nconst { useEffect, useState } = wp.element;\nimport LoadSelect from \"../../components/LoadSelect\";\n\nexport default ({ options, updateEmailState }) => {\n const [fetchingLists, setFetchingLists] = useState(false);\n const [fetchingTags, setFetchingTags] = useState(false);\n\n const [lists, setLists] = useState([\n { value: null, label: __(\"Choose a list\", \"presto-player\") },\n ]);\n const [tags, setTags] = useState([\n { value: null, label: __(\"Choose a tag\", \"presto-player\") },\n ]);\n const [error, setError] = useState(\"\");\n\n const fetchLists = async () => {\n setFetchingLists(true);\n try {\n const fetched = await wp.apiFetch({\n path: \"presto-player/v1/fluentcrm/lists\",\n });\n\n let listOptions = lists;\n (fetched || []).forEach((list) => {\n listOptions = [\n ...listOptions,\n ...[\n {\n value: list.id,\n label: list.title || list.slug,\n },\n ],\n ];\n });\n setLists(listOptions);\n } catch (e) {\n if (e?.message) {\n setError(e.message);\n }\n } finally {\n setFetchingLists(false);\n }\n };\n\n const fetchTags = async () => {\n setFetchingTags(true);\n try {\n const fetched = await wp.apiFetch({\n path: \"presto-player/v1/fluentcrm/tags\",\n });\n\n let tagOptions = tags;\n (fetched || []).forEach((tag) => {\n tagOptions = [\n ...tagOptions,\n ...[\n {\n value: tag.id,\n label: tag.title || tag.slug,\n },\n ],\n ];\n });\n setTags(tagOptions);\n } catch (e) {\n if (e?.message) {\n setError(e.message);\n }\n } finally {\n setFetchingTags(false);\n }\n };\n\n useEffect(() => {\n fetchLists();\n fetchTags();\n }, []);\n\n if (error) {\n return (\n <Notice className=\"presto-notice\" status=\"error\" isDismissible={false}>\n {error}\n </Notice>\n );\n }\n\n return (\n <div>\n {fetchingLists ? (\n <LoadSelect />\n ) : (\n lists.length > 1 && (\n <SelectControl\n label={__(\"Choose a list\", \"presto-player\")}\n value={options?.provider_list}\n options={lists}\n onChange={(provider_list) => updateEmailState({ provider_list })}\n />\n )\n )}\n\n {fetchingTags ? (\n <LoadSelect />\n ) : (\n tags.length > 1 && (\n <SelectControl\n label={__(\"Choose a tag\", \"presto-player\")}\n value={options?.provider_tag}\n options={tags}\n onChange={(provider_tag) => updateEmailState({ provider_tag })}\n />\n )\n )}\n </div>\n );\n};\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst { SelectControl, Button, Flex, Icon } = wp.components;\nconst { useEffect, useState } = wp.element;\nimport LoadSelect from \"../../components/LoadSelect\";\n\nimport MailchimpConfig from \"./MailchimpConfig\";\nimport MailerLiteConfig from \"./MailerLiteConfig\";\nimport ActiveCampaignConfig from \"./ActiveCampaignConfig\";\nimport FluentCRMConfig from \"./FluentCRMConfig\";\n\nexport default ({ options, updateEmailState }) => {\n const [fetching, setFetching] = useState(false);\n const [settings, setSettings] = useState([\n { value: \"none\", label: __(\"None\", \"presto-player\") },\n ]);\n const [error, setError] = useState(\"\");\n\n const optionsMap = {\n presto_player_activecampaign: {\n label: \"ActiveCampaign\",\n value: \"activecampaign\",\n },\n presto_player_mailchimp: {\n label: \"MailChimp\",\n value: \"mailchimp\",\n },\n presto_player_mailerlite: {\n label: \"MailerLite\",\n value: \"mailerlite\",\n },\n presto_player_fluentcrm: {\n label: \"FluentCRM\",\n value: \"fluentcrm\",\n },\n };\n\n const fetchSettings = async () => {\n setFetching(true);\n setError(\"\");\n try {\n const fetched = await wp.apiFetch({\n path: \"wp/v2/settings\",\n });\n let settingsToSet = settings;\n Object.keys(fetched).forEach((key) => {\n if (optionsMap?.[key] && fetched[key]?.connected) {\n settingsToSet = [...settingsToSet, ...[optionsMap[key]]];\n }\n });\n setSettings(settingsToSet);\n } catch (e) {\n if (e?.message) {\n setError(e.message);\n }\n } finally {\n setFetching(false);\n }\n };\n\n const addProvider = () => {\n return (\n <Flex>\n <Button\n target=\"_blank\"\n href=\"/wp-admin/edit.php?post_type=pp_video_block&page=presto-player-settings#/integrations\"\n isSecondary\n isSmall\n >\n {__(\"Connect a provider\", \"presto-player\")}\n </Button>\n <Button\n isSmall\n onClick={(e) => {\n e.preventDefault();\n fetchSettings();\n }}\n >\n <Icon icon=\"update\" />\n </Button>\n </Flex>\n );\n };\n\n useEffect(() => {\n fetchSettings();\n }, []);\n\n const emailProviderOptions = () => {\n const found = settings.find(\n (setting) => setting.value === options?.provider\n );\n if (!Object.keys(found || {}).length) {\n return;\n }\n\n switch (options?.provider) {\n case \"mailchimp\":\n return (\n <MailchimpConfig\n options={options}\n updateEmailState={updateEmailState}\n />\n );\n case \"mailerlite\":\n return (\n <MailerLiteConfig\n options={options}\n updateEmailState={updateEmailState}\n />\n );\n case \"activecampaign\":\n return (\n <ActiveCampaignConfig\n options={options}\n updateEmailState={updateEmailState}\n />\n );\n case \"fluentcrm\":\n return (\n <FluentCRMConfig\n options={options}\n updateEmailState={updateEmailState}\n />\n );\n }\n };\n\n if (fetching) {\n return <LoadSelect />;\n }\n\n return (\n <div>\n {error}\n {settings.length > 1 ? (\n <div>\n <SelectControl\n label={__(\"Choose an email provider\", \"presto-player\")}\n value={options?.provider}\n options={settings}\n onChange={(provider) => updateEmailState({ provider })}\n />\n {emailProviderOptions()}\n </div>\n ) : (\n addProvider()\n )}\n </div>\n );\n};\n","/** @jsx jsx */\n/**\n * WordPress dependencies\n */\nimport { __ } from \"@wordpress/i18n\";\nimport {\n ToggleControl,\n BaseControl,\n RangeControl,\n TextControl,\n Button,\n Flex,\n TextareaControl,\n Notice,\n} from \"@wordpress/components\";\nimport { useSelect } from \"@wordpress/data\";\n\nimport ChooseProvider from \"./parts/ChooseProvider\";\nimport ColorPopup from \"../components/ColorPopup\";\n\nimport { css, jsx } from \"@emotion/core\";\n\nexport default function ({ state, updateState, className }) {\n const { email_collection, cta } = state;\n\n const branding = useSelect((select) => {\n return select(\"presto-player/player\").branding();\n });\n\n const updateEmailState = (updated) => {\n updateState({\n ...state,\n email_collection: {\n ...email_collection,\n ...updated,\n },\n });\n };\n\n const disableCTA = () => {\n updateState({\n ...state,\n cta: {\n ...cta,\n ...{ enabled: false },\n },\n });\n };\n\n return (\n <div className={className}>\n <BaseControl>\n <h3>{__(\"Email Capture\", \"presto-player\")}</h3>\n </BaseControl>\n <BaseControl className=\"presto-player__control--large-play\">\n <ToggleControl\n label={__(\"Enable\", \"presto-player\")}\n help={__(\n \"Show an email collection form and message over your player.\",\n \"presto-player\"\n )}\n onChange={(enabled) => {\n updateEmailState({\n enabled,\n });\n }}\n checked={email_collection?.enabled}\n />\n </BaseControl>\n {!!email_collection?.enabled && (\n <>\n <BaseControl className=\"presto-player__control--percentage-watched\">\n <RangeControl\n label={__(\"Display At (Percentage)\", \"presto-player\")}\n labelPosition=\"top\"\n onChange={(percentage) => {\n updateEmailState({\n percentage,\n });\n }}\n marks={[\n {\n value: 0,\n label: __(\"Start\", \"presto-player\"),\n },\n {\n value: 50,\n label: __(\"50% Watched\", \"presto-player\"),\n },\n {\n value: 100,\n label: __(\"End\", \"presto-player\"),\n },\n ]}\n shiftStep={5}\n value={email_collection?.percentage || 0}\n />\n </BaseControl>\n\n {cta?.enabled && email_collection?.percentage === cta?.percentage && (\n <Notice\n css={css`\n margin: 0 0 30px 0 !important;\n `}\n status=\"warning\"\n isDismissible={false}\n >\n {__(\n \"You already have a Call To Action set display at the same time.\",\n \"presto-player\"\n )}\n <Button\n onClick={disableCTA}\n isLink\n css={css`\n margin-top: 10px !important;\n `}\n >\n {__(\"Disable Call To Action\", \"presto-player\")}\n </Button>\n </Notice>\n )}\n\n <BaseControl className=\"presto-player__control--large-play\">\n <ToggleControl\n label={__(\"Allow Skipping\", \"presto-player\")}\n help={__(\"Let the viewer skip\", \"presto-player\")}\n onChange={(allow_skip) => {\n updateEmailState({\n allow_skip,\n });\n }}\n checked={email_collection?.allow_skip}\n />\n </BaseControl>\n\n <BaseControl className=\"presto-player__control--large-play\">\n <TextareaControl\n label={__(\"Headline\", \"presto-player\")}\n help={__(\"The headline for your form.\", \"presto-player\")}\n value={email_collection?.headline}\n onChange={(headline) => {\n updateEmailState({\n headline,\n });\n }}\n />\n </BaseControl>\n\n <BaseControl className=\"presto-player__control--large-play\">\n <TextareaControl\n label={__(\"Bottom Text\", \"presto-player\")}\n help={__(\n \"Text displayed below the form. HTML allowed.\",\n \"presto-player\"\n )}\n value={email_collection?.bottom_text}\n onChange={(bottom_text) => {\n updateEmailState({\n bottom_text,\n });\n }}\n />\n </BaseControl>\n\n <BaseControl className=\"presto-player__control--large-play\">\n <TextControl\n label={__(\"Play Button Text\", \"presto-player\")}\n help={<p>{__(\"Submit button text\", \"presto-player\")}</p>}\n value={email_collection?.button_text}\n onChange={(button_text) => updateEmailState({ button_text })}\n />\n </BaseControl>\n\n <BaseControl className=\"presto-player__control--button-color\">\n <Flex>\n <BaseControl.VisualLabel>\n {__(\"Button Color\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <ColorPopup\n color={cta?.button_color || branding?.color}\n setColor={(value) =>\n updateEmailState({\n button_color: value && value.hex,\n })\n }\n />\n </Flex>\n </BaseControl>\n <BaseControl className=\"presto-player__control--button-text-color\">\n <Flex>\n <BaseControl.VisualLabel>\n {__(\"Button Text Color\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <ColorPopup\n color={cta?.button_text_color || \"#ffffff\"}\n setColor={(value) =>\n updateEmailState({\n button_text_color: value && value.hex,\n })\n }\n />\n </Flex>\n </BaseControl>\n\n <h3>{__(\"Integrate\", \"presto-player\")}</h3>\n <BaseControl>\n <ChooseProvider\n updateEmailState={updateEmailState}\n options={email_collection}\n />\n </BaseControl>\n\n <h3>{__(\"Style\", \"presto-player\")}</h3>\n\n <BaseControl>\n <RangeControl\n label={__(\"Round Corners\", \"presto-player\")}\n help={__(\"Border radius of form elements.\", \"presto-player\")}\n value={email_collection?.border_radius || 0}\n onChange={(border_radius) => updateEmailState({ border_radius })}\n min={0}\n max={25}\n />\n </BaseControl>\n </>\n )}\n </div>\n );\n}\n","const { __ } = wp.i18n;\nconst { Flex, FlexItem, FlexBlock, TextControl, Button } = wp.components;\nconst { useState } = wp.element;\n\nimport { sanitizeTime } from \"../../../util\";\n\nconst Chapter = ({\n update,\n add,\n remove,\n className,\n time,\n title,\n disabled,\n showNotice,\n}) => {\n const [draftTime, setDraftTime] = useState(time);\n\n return (\n <Flex align=\"center\" className={className}>\n <FlexItem>\n <TextControl\n className={\"presto-player__caption--time\"}\n style={{ width: \"60px\" }}\n placeholder={\"0:00\"}\n value={draftTime}\n onChange={(time) => setDraftTime(time)}\n onBlur={() => {\n let time = sanitizeTime(draftTime);\n update({ time });\n setDraftTime(time);\n }}\n autoComplete=\"off\"\n placeholder=\"0:00\"\n />\n </FlexItem>\n\n <FlexBlock>\n <TextControl\n className={\"presto-player__caption--title\"}\n placeholder={__(\"Title\", \"presto-player\")}\n value={title || \"\"}\n onChange={(title) => update({ title })}\n autoComplete=\"off\"\n />\n </FlexBlock>\n\n <FlexItem>\n {remove && (\n <Button\n icon=\"minus\"\n className=\"ph-chapter__remove\"\n style={{ marginBottom: \"8px\" }}\n label={__(\"Remove Chapter\", \"presto-player\")}\n onClick={remove}\n />\n )}\n {add && (\n <Button\n icon=\"plus-alt\"\n className=\"ph-chapter__add\"\n label={__(\"Add Chapter\", \"presto-player\")}\n style={{ marginBottom: \"8px\" }}\n onClick={() => {\n add();\n setDraftTime(\"\");\n }}\n />\n )}\n </FlexItem>\n </Flex>\n );\n};\n\nexport default Chapter;\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst { useState } = wp.element;\nconst { dispatch } = wp.data;\nimport Chapter from \"./components/Chapter\";\n\nconst VideoSettings = ({ setAttributes, attributes }) => {\n const showNotice = () => {\n dispatch(\"presto-player/player\").setProModal(true);\n };\n if (!prestoPlayer?.isPremium) {\n return (\n <Chapter\n disabled={true}\n className=\"ph-chapter is-new\"\n time={\"\"}\n title={\"\"}\n update={() => {}}\n showNotice={showNotice}\n add={showNotice}\n />\n );\n }\n\n const { chapters } = attributes;\n\n let [draft, setDraft] = useState({\n title: \"\",\n time: \"\",\n });\n\n const updateChapter = (chapter, data = {}) => {\n let itemIndex = chapters.indexOf(chapter);\n let updated = chapters.map((item, index) => {\n // This isn't the item we care about - keep it as-is\n if (index !== itemIndex) {\n return item;\n }\n // Otherwise, this is the one we want - return an updated value\n return {\n ...item,\n ...data,\n };\n });\n setAttributes({ chapters: updated });\n };\n\n const removeChapter = (chapter) => {\n let index = chapters.indexOf(chapter);\n setAttributes({ chapters: chapters.filter((_, i) => i !== index) });\n };\n\n const addChapter = () => {\n if (!draft.time || !draft.title) {\n return;\n }\n setAttributes({\n chapters: [\n ...(chapters || []),\n ...[{ time: draft.time, title: draft.title }],\n ],\n });\n setDraft({\n title: \"\",\n time: \"\",\n });\n };\n\n const sorted = () => {\n return (chapters || []).sort(function (a, b) {\n if (\n parseInt(a.time.split(\":\")[0]) - parseInt(b.time.split(\":\")[0]) ===\n 0\n ) {\n return parseInt(a.time.split(\":\")[1]) - parseInt(b.time.split(\":\")[1]);\n } else {\n return parseInt(a.time.split(\":\")[0]) - parseInt(b.time.split(\":\")[0]);\n }\n });\n };\n\n return (\n <>\n {sorted().map((chapter, i) => {\n return (\n <Chapter\n key={`${i}-${chapter.time}`}\n className=\"ph-chapter\"\n time={chapter.time}\n title={chapter.title}\n chapter={chapter}\n update={(data) => {\n updateChapter(chapter, data);\n }}\n remove={() => {\n removeChapter(chapter);\n }}\n />\n );\n })}\n\n <Chapter\n className=\"ph-chapter is-new\"\n time={draft.time}\n title={draft.title}\n update={(data) => {\n setDraft({ ...draft, ...data });\n }}\n add={addChapter}\n />\n </>\n );\n};\n\nexport default VideoSettings;\n","/** @jsx jsx */\n/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst { TextControl, ExternalLink, Button, Flex } = wp.components;\nconst { useState, useEffect } = wp.element;\nconst { useSelect, dispatch } = wp.data;\n\nimport { css, jsx } from \"@emotion/core\";\n\nexport default ({ onClose, value, setValue }) => {\n const [saving, setSaving] = useState(false);\n\n const userCanReadSettings = wp.data.useSelect((select) =>\n select(\"core\").canUser(\"read\", \"settings\")\n );\n\n const youtube = useSelect((select) => {\n return select(\"presto-player/player\").youtube();\n });\n\n useEffect(() => {\n setValue(youtube.channel_id);\n }, [youtube?.channel_id]);\n\n const handleSubmit = async (e) => {\n e.preventDefault();\n setSaving(true);\n dispatch(\"presto-player/player\").updateYoutube({ channel_id: value });\n\n const data = {\n ...youtube,\n ...{ channel_id: value },\n };\n\n try {\n let response = await wp.apiFetch({\n path: \"wp/v2/settings\",\n method: \"POST\",\n data: {\n presto_player_youtube: data,\n },\n });\n if (response?.presto_player_youtube) {\n dispatch(\"presto-player/player\").setYoutube(\n response?.presto_player_youtube\n );\n onClose();\n }\n } catch (e) {\n } finally {\n setSaving(false);\n }\n };\n\n // use must be able to read settings\n if (!userCanReadSettings) {\n return \"\";\n }\n\n return (\n <form onSubmit={handleSubmit}>\n <TextControl\n css={css`\n margin-bottom: 0 !important;\n `}\n label={__(\"Youtube Channel ID\", \"presto-player\")}\n help={\n <p>\n <ExternalLink href=\"https://support.google.com/youtube/answer/3250431?hl=en\">\n {__(\"Find my channel id\", \"presto-player\")}\n </ExternalLink>\n </p>\n }\n value={value}\n onChange={(channel_id) => setValue(channel_id)}\n // required\n />\n\n <Button\n disabled={saving}\n isBusy={saving}\n css={css`\n margin-bottom: 1em;\n `}\n isPrimary\n type=\"submot\"\n >\n {__(\"Save\", \"presto-player\")}\n </Button>\n <Button\n onClick={onClose}\n css={css`\n margin-bottom: 1em;\n `}\n isTertiary\n >\n {__(\"Cancel\", \"presto-player\")}\n </Button>\n </form>\n );\n};\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst {\n ToggleControl,\n Flex,\n Button,\n BaseControl,\n RangeControl,\n TextControl,\n SelectControl,\n TextareaControl,\n} = wp.components;\n\nconst { useEffect, useState } = wp.element;\nconst { useSelect } = wp.data;\n\nimport ColorPopup from \"../components/ColorPopup\";\nimport UrlSelect from \"../components/UrlSelect\";\nimport YoutubeChannelId from \"./parts/YoutubeChannelId\";\n\nexport default function ({ state, updateState, className, value, setValue }) {\n const { action_bar } = state;\n const [editYoutube, setEditYoutube] = useState(false);\n\n const branding = useSelect((select) => {\n return select(\"presto-player/player\").branding();\n });\n const youtube = useSelect((select) => {\n return select(\"presto-player/player\").youtube();\n });\n\n const updateActionBar = (updated) => {\n updateState({\n ...state,\n action_bar: {\n ...action_bar,\n ...updated,\n },\n });\n };\n\n useEffect(() => {\n if (!action_bar?.text) {\n updateActionBar({\n text: \"Like this?\",\n });\n }\n if (!action_bar?.button_type) {\n updateActionBar({\n button_type: \"custom\",\n });\n }\n\n if (!action_bar?.button_text) {\n updateActionBar({\n button_text: \"Click Here\",\n });\n }\n }, [state]);\n\n const renderYoutubeChannelForm = () => {\n if (action_bar?.button_type !== \"youtube\") {\n return;\n }\n\n return editYoutube ? (\n <YoutubeChannelId\n onClose={() => setEditYoutube(false)}\n value={value}\n setValue={setValue}\n />\n ) : (\n <div>\n <Button\n isSecondary\n onClick={(e) => {\n e.preventDefault();\n setEditYoutube(true);\n }}\n >\n {youtube?.channel_id\n ? __(\"Update Youtube Channel Id\", \"presto-player\")\n : __(\"Add Youtube Channel Id\", \"presto-player\")}\n </Button>\n <br />\n <br />\n <br />\n </div>\n );\n };\n\n return (\n <div className={className}>\n <BaseControl>\n <h3>{__(\"Action Bar\", \"presto-player\")}</h3>\n </BaseControl>\n <BaseControl className=\"presto-player__control--large-play\">\n <ToggleControl\n label={__(\"Enable\", \"presto-player\")}\n help={__(\n \"Show an action bar below your player while it's playing.\",\n \"presto-player\"\n )}\n onChange={(enabled) => {\n updateActionBar({\n enabled,\n });\n }}\n checked={action_bar?.enabled}\n />\n </BaseControl>\n {!!action_bar?.enabled && (\n <>\n <BaseControl className=\"presto-player__control--percentage-watched\">\n <RangeControl\n label={__(\"Display At (Percentage)\", \"presto-player\")}\n labelPosition=\"top\"\n onChange={(percentage_start) => {\n updateActionBar({\n percentage_start,\n });\n }}\n marks={[\n {\n value: 0,\n label: __(\"Start\", \"presto-player\"),\n },\n {\n value: 50,\n label: __(\"50% Watched\", \"presto-player\"),\n },\n {\n value: 100,\n label: __(\"End\", \"presto-player\"),\n },\n ]}\n shiftStep={5}\n value={action_bar?.percentage_start || 0}\n />\n </BaseControl>\n\n <BaseControl className=\"presto-player__control--large-play\">\n <TextareaControl\n label={__(\"Text\", \"presto-player\")}\n help={__(\"Action bar text.\", \"presto-player\")}\n value={action_bar?.text}\n onChange={(text) =>\n updateActionBar({\n text,\n })\n }\n />\n </BaseControl>\n\n <BaseControl className=\"presto-player__control--large-play\">\n <Flex>\n <BaseControl.VisualLabel>\n {__(\"Action Bar Background\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <ColorPopup\n color={action_bar?.background_color || \"#1d1d1d\"}\n setColor={(value) =>\n updateActionBar({\n background_color: value && value.hex,\n })\n }\n />\n </Flex>\n </BaseControl>\n\n <BaseControl>\n <h3>{__(\"Button\", \"presto-player\")}</h3>\n </BaseControl>\n\n <BaseControl className=\"presto-player__control--button-type\">\n <SelectControl\n label={__(\"Button Type\", \"presto-player\")}\n value={action_bar?.button_type}\n options={[\n {\n value: \"custom\",\n label: __(\"Custom\", \"presto-player\"),\n },\n {\n value: \"youtube\",\n label: __(\"YouTube Subscribe\", \"presto-player\"),\n },\n {\n value: \"none\",\n label: __(\"None\", \"presto-player\"),\n },\n ]}\n onChange={(button_type) =>\n updateActionBar({\n button_type,\n })\n }\n />\n </BaseControl>\n\n {action_bar?.button_type === \"youtube\" && youtube?.channel_id && (\n <ToggleControl\n label={__(\"Show Count\", \"presto-player\")}\n help={__(\"Show your follower count.\", \"presto-player\")}\n onChange={(button_count) => {\n updateActionBar({\n button_count,\n });\n }}\n checked={action_bar?.button_count}\n />\n )}\n\n {renderYoutubeChannelForm()}\n\n {action_bar?.button_type === \"custom\" && (\n <div>\n <BaseControl className=\"presto-player__control--button-text\">\n <TextControl\n label={__(\"Button Text\", \"presto-player\")}\n help={<p>{__(\"Submit button text\", \"presto-player\")}</p>}\n value={action_bar?.button_text}\n onChange={(button_text) => updateActionBar({ button_text })}\n />\n </BaseControl>\n <BaseControl className=\"presto-player__control--button-text\">\n <BaseControl.VisualLabel>\n <p> {__(\"Button Link\", \"presto-player\")}</p>\n </BaseControl.VisualLabel>\n <UrlSelect\n setSettings={(val) => {\n updateActionBar({\n button_link: val,\n });\n }}\n settings={action_bar?.button_link || {}}\n />\n </BaseControl>\n <BaseControl className=\"presto-player__control--button-radius\">\n <RangeControl\n label={__(\"Round Corners\", \"presto-player\")}\n help={__(\"Border radius of the button\", \"presto-player\")}\n value={action_bar?.button_radius || 0}\n onChange={(button_radius) =>\n updateActionBar({ button_radius })\n }\n min={0}\n max={25}\n />\n </BaseControl>\n <BaseControl className=\"presto-player__control--button-color\">\n <Flex>\n <BaseControl.VisualLabel>\n {__(\"Button Color\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <ColorPopup\n color={action_bar?.button_color || branding?.color}\n setColor={(value) =>\n updateActionBar({\n button_color: value && value.hex,\n })\n }\n />\n </Flex>\n </BaseControl>\n <BaseControl className=\"presto-player__control--button-text-color\">\n <Flex>\n <BaseControl.VisualLabel>\n {__(\"Button Text Color\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <ColorPopup\n color={action_bar?.button_text_color || \"#ffffff\"}\n setColor={(value) =>\n updateActionBar({\n button_text_color: value && value.hex,\n })\n }\n />\n </Flex>\n </BaseControl>\n </div>\n )}\n </>\n )}\n </div>\n );\n}\n","(function() { module.exports = window[\"wp\"][\"editor\"]; }());","/** @jsx jsx */\n/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst { Button, Flex, FlexItem, FlexBlock, Modal } = wp.components;\nconst { useState, useEffect } = wp.element;\nconst { useSelect } = wp.data;\nimport { nanoid } from \"nanoid\";\n\nimport { css, jsx } from \"@emotion/core\";\nimport Preview from \"../Preview\";\nimport Overlay from \"./components/Overlay\";\n\nconst EditOverlay = ({\n closeModal,\n attributes,\n setAttributes,\n updateOverlayAttribute,\n}) => {\n const [loading, setLoading] = useState(false);\n const [currentTime, setCurrentTime] = useState(\"\");\n const { overlays, preset, src, poster, previewSrc } = attributes;\n\n const branding = useSelect((select) => {\n return select(\"presto-player/player\").branding();\n });\n\n const state = useSelect((select) =>\n select(\"presto-player/player\").getPreset(preset)\n );\n\n // maybe add a default so it's not empty.\n useEffect(() => {\n if (!overlays.length) {\n addOverlay();\n }\n }, []);\n\n // update an existing overlay.\n const updateOverlay = (overlay, data = {}) => {\n let itemIndex = overlays.indexOf(overlay);\n let updated = overlays.map((item, index) => {\n // This isn't the item we care about - keep it as-is\n if (index !== itemIndex) {\n return item;\n }\n // Otherwise, this is the one we want - return an updated value\n return {\n ...item,\n ...data,\n };\n });\n\n setAttributes({ overlays: updated });\n };\n\n // remove overlay.\n const removeOverlay = (overlay) => {\n let index = overlays.indexOf(overlay);\n setAttributes({ overlays: overlays.filter((_, i) => i !== index) });\n };\n\n // add overlay with custom default.\n const addOverlay = () => {\n let defaultOverlay = {\n startTime: \"0:00\",\n endTime: \"0:05\",\n text: __(\"Here's a link to click!\", \"presto-player\"),\n link: {},\n position: \"top-right\",\n color: \"#fff\",\n backgroundColor: \"#000\",\n opacity: 75,\n };\n\n if (overlays[overlays.length - 1]) {\n const lastOverlay = overlays[overlays.length - 1];\n defaultOverlay = { ...lastOverlay }; // make a shallow clone.\n }\n\n defaultOverlay.id = nanoid(10);\n\n setAttributes({\n overlays: [...(overlays || []), ...[defaultOverlay]],\n });\n };\n\n // sort the overlays by time.\n const sorted = () => {\n return (overlays || []).sort(function (a, b) {\n if (\n parseInt(a.startTime.split(\":\")[0]) -\n parseInt(b.startTime.split(\":\")[0]) ===\n 0\n ) {\n return (\n parseInt(a.startTime.split(\":\")[1]) -\n parseInt(b.startTime.split(\":\")[1])\n );\n } else {\n return (\n parseInt(a.startTime.split(\":\")[0]) -\n parseInt(b.startTime.split(\":\")[0])\n );\n }\n });\n };\n\n // make sure we always update.\n const updateCurrentTimeState = (time) => {\n setCurrentTime(\"\");\n process.nextTick(() => {\n setCurrentTime(time);\n });\n };\n\n // validate and save\n const save = () => {\n setLoading(true);\n updateOverlayAttribute(overlays);\n setLoading(false);\n closeModal();\n };\n\n return (\n <Modal\n title={__(\"Manage Video Overlays\", \"presto-player\")}\n onRequestClose={closeModal}\n className=\"presto-player__modal-presets\"\n overlayClassName=\"presto-player__modal-presets-overlay\"\n shouldCloseOnClickOutside={false}\n >\n <div className=\"presto-player__preset-options\" data-cy=\"preset-modal\">\n <Flex align=\"stretch\" className=\"presto-player__style-preview-area\">\n <FlexItem className=\"presto-player__style-sidebar\">\n <div css={{ padding: \"3px\" }}>\n {sorted().map((overlay, i) => {\n return (\n <Overlay\n key={`${i}-${overlay.startTime}`}\n overlayIndex={i}\n className=\"presto-player__overlay\"\n startTime={overlay.startTime}\n endTime={overlay.endTime}\n text={overlay.text}\n link={overlay.link}\n position={overlay.position}\n color={overlay.color}\n backgroundColor={overlay.backgroundColor}\n opacity={overlay.opacity}\n overlay={overlay}\n update={(data) => {\n updateOverlay(overlay, data);\n }}\n remove={() => {\n removeOverlay(overlay);\n }}\n updateCurrentTime={(data) => {\n updateCurrentTimeState(data);\n }}\n />\n );\n })}\n <Button isPrimary onClick={addOverlay}>\n {__(\"Add An Overlay\", \"presto-player\")}\n </Button>\n </div>\n </FlexItem>\n <FlexBlock className=\"presto-player__style-preview-panel\">\n <Preview\n preload=\"auto\"\n currentTime={currentTime}\n src={previewSrc || src}\n isDisabled={false}\n state={{\n ...state,\n lazy_load_youtube: false, // don't lazy load.\n invert_time: false,\n }}\n branding={branding}\n poster={poster}\n overlays={overlays}\n />\n </FlexBlock>\n </Flex>\n\n <br />\n\n <div\n css={css`\n display: flex;\n align-items: center;\n justify-content: space-between;\n `}\n >\n <div\n css={css`\n opacity: 0.5;\n font-size: 12px;\n `}\n ></div>\n <div>\n <Button isTertiary onClick={closeModal} style={{ margin: \"0 6px\" }}>\n {__(\"Cancel\", \"presto-player\")}\n </Button>\n <Button\n isPrimary\n isBusy={loading}\n disabled={loading}\n onClick={save}\n data-cy=\"submit-preset\"\n >\n {__(\"Save Overlays\", \"presto-player\")}\n </Button>\n </div>\n </div>\n </div>\n </Modal>\n );\n};\nexport default EditOverlay;\n","/** @jsx jsx */\nconst { __ } = wp.i18n;\nconst {\n Flex,\n FlexItem,\n TextControl,\n Button,\n BaseControl,\n RadioControl,\n RangeControl,\n withFocusReturn,\n} = wp.components;\nconst { useRef, useEffect } = wp.element;\nimport { css, jsx } from \"@emotion/core\";\n\nimport { sanitizeTime, timeToSeconds, secondsToTime } from \"../../../util\";\nimport UrlSelect from \"../../components/UrlSelect\";\nimport DynamicText from \"./DynamicText\";\nimport ColorPopup from \"../../components/ColorPopup\";\n\nconst { useState } = wp.element;\n\nconst Overlay = ({\n overlayIndex,\n update,\n remove,\n className,\n startTime,\n endTime,\n text,\n link,\n position,\n color,\n backgroundColor,\n opacity,\n updateCurrentTime,\n}) => {\n const [draftStartTime, setDraftStartTime] = useState(startTime);\n const [draftEndTime, setDraftEndTime] = useState(endTime);\n const [draftPosition, setDraftPosition] = useState(position);\n const startControl = useRef();\n\n useEffect(() => {\n if (timeToSeconds(startTime) >= timeToSeconds(endTime)) {\n let endTime = sanitizeTime(startTime);\n let seconds = timeToSeconds(endTime) + 1;\n endTime = sanitizeTime(secondsToTime(seconds));\n update({ endTime });\n setDraftEndTime(endTime);\n }\n }, [startTime, endTime]);\n\n const updateStartTime = () => {\n const startTime = sanitizeTime(draftStartTime);\n update({ startTime });\n setDraftStartTime(startTime);\n updateCurrentTime(startTime);\n };\n\n const updateEndTime = () => {\n const endTime = sanitizeTime(draftEndTime);\n update({ endTime });\n setDraftEndTime(endTime);\n };\n\n return (\n <div>\n <Flex align=\"center\" className={className}>\n <FlexItem>\n <TextControl\n ref={startControl}\n id={`start-time-${overlayIndex}`}\n label={__(\"Start Time\", \"presto-player\")}\n className=\"presto-player__overlay--start-time\"\n value={draftStartTime}\n onChange={(startTime) => setDraftStartTime(startTime)}\n onBlur={updateStartTime}\n onFocus={updateStartTime}\n autoComplete=\"off\"\n placeholder=\"0:00\"\n />\n </FlexItem>\n\n <FlexItem>\n <TextControl\n label={__(\"End Time\", \"presto-player\")}\n className=\"presto-player__overlay--end-time\"\n value={draftEndTime}\n onChange={setDraftEndTime}\n onBlur={updateEndTime}\n autoComplete=\"off\"\n placeholder=\"0:00\"\n />\n </FlexItem>\n </Flex>\n\n <DynamicText\n text={text}\n update={update}\n onFocus={() => {\n updateCurrentTime(sanitizeTime(draftStartTime));\n }}\n />\n\n <BaseControl style={{ width: \"100%\" }}>\n <BaseControl.VisualLabel>\n <p> {__(\"Link\", \"presto-player\")}</p>\n </BaseControl.VisualLabel>\n <UrlSelect\n onFocus={() => {\n updateCurrentTime(sanitizeTime(draftStartTime));\n }}\n setSettings={(link) => update({ link })}\n settings={link || {}}\n />\n </BaseControl>\n\n <BaseControl className={className}>\n <RadioControl\n label={__(\"Position\", \"presto-player\")}\n options={[\n { label: \"Top Right\", value: \"top-right\" },\n { label: \"Top Left\", value: \"top-left\" },\n ]}\n selected={draftPosition || \"right\"}\n onFocus={() => {\n updateCurrentTime(sanitizeTime(draftStartTime));\n }}\n onChange={(position) => {\n update({ position });\n setDraftPosition(position);\n updateCurrentTime(sanitizeTime(draftStartTime));\n }}\n />\n </BaseControl>\n\n <BaseControl className=\"presto-player__control--overlay-text-color\">\n <Flex>\n <BaseControl.VisualLabel>\n {__(\"Text Color\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <ColorPopup\n onFocus={() => {\n updateCurrentTime(sanitizeTime(draftStartTime));\n }}\n color={color}\n setColor={(value) => {\n update({\n color: value && value.hex,\n });\n }}\n />\n </Flex>\n </BaseControl>\n\n <BaseControl className=\"presto-player__control--overlay-background-color\">\n <Flex>\n <BaseControl.VisualLabel>\n {__(\"Background Color\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <ColorPopup\n onFocus={() => {\n updateCurrentTime(sanitizeTime(draftStartTime));\n }}\n color={backgroundColor}\n setColor={(value) => {\n update({\n backgroundColor: value && value.hex,\n });\n }}\n />\n </Flex>\n </BaseControl>\n\n <BaseControl>\n <RangeControl\n label={__(\"Opacity\", \"presto-player\")}\n help={__(\"Opacity percentage of the overlay.\", \"presto-player\")}\n value={opacity}\n onChange={(opacity) => update({ opacity })}\n min={0}\n max={100}\n />\n </BaseControl>\n\n {remove && (\n <BaseControl className={className}>\n <Flex justify=\"flex-end\">\n <Button isDestructive isSmall onClick={remove}>\n {__(\"Remove Overlay\", \"presto-player\")}\n </Button>\n </Flex>\n </BaseControl>\n )}\n\n <hr css={{ marginBottom: \"20px\" }} />\n </div>\n );\n};\n\nexport default Overlay;\n","var map = {\n\t\"./audio/index.js\": 70,\n\t\"./bunny/index.js\": 69,\n\t\"./hosted/index.js\": 73,\n\t\"./reusable-display/index.js\": 74,\n\t\"./reusable-edit/index.js\": 67,\n\t\"./vimeo/index.js\": 75,\n\t\"./youtube/index.js\": 76\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 59;","// In your application's entrypoint\nconst { __ } = wp.i18n;\nconst { InnerBlocks, useBlockProps } = wp.blockEditor;\nconst { useSelect, dispatch } = wp.data;\nconst { Button, Placeholder } = wp.components;\nconst { getPlugins, unregisterPlugin } = wp.plugins;\nconst { useEffect } = wp.element;\n\n/**\n * Block Name\n */\nexport const name = \"presto-player/reusable-edit\";\n\n/**\n * Block Options\n */\nexport const options = {\n title: \"Reusable Block Container\",\n\n category: \"presto\",\n\n supports: {\n inserter: false,\n reusable: false,\n html: false,\n },\n\n icon: (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"presto-block-icon\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n <line x1=\"2\" y1=\"12\" x2=\"22\" y2=\"12\"></line>\n <path d=\"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z\"></path>\n </svg>\n ),\n\n edit: (props) => {\n const blockProps = useBlockProps();\n const { clientId, isSelected } = props;\n const innerBlocks = useSelect(\n (select) => select(\"core/block-editor\").getBlock(clientId).innerBlocks\n );\n\n useEffect(() => {\n if (isSelected) {\n wp.data\n .dispatch(\"core/edit-post\")\n .openGeneralSidebar(\"edit-post/block\");\n }\n }, [isSelected]);\n\n // make sure we don't check template validity because is's buggy as fuck\n dispatch(\"core/block-editor\").setTemplateValidity(true);\n\n // don't add reusable videos to a reusable video\n useEffect(() => {\n unregisterPlugin(\"presto-player\");\n }, []);\n\n const insertBlockType = (type) => {\n const block = wp.blocks.createBlock(`presto-player/${type}`);\n return dispatch(\"core/block-editor\").insertBlock(block, 0, clientId);\n };\n\n const appenderToUse = () => {\n if (innerBlocks.length === 0) {\n return <InnerBlocks.ButtonBlockAppender />;\n } else {\n return false;\n }\n };\n\n if (!innerBlocks?.length) {\n return (\n <div>\n <div {...blockProps}>\n <Placeholder\n icon={\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"presto-block-icon\"\n >\n <polygon points=\"23 7 16 12 23 17 23 7\"></polygon>\n <rect x=\"1\" y=\"5\" width=\"15\" height=\"14\" rx=\"2\" ry=\"2\"></rect>\n </svg>\n }\n instructions={__(\n \"Choose a video type to get started.\",\n \"presto-player\"\n )}\n label={__(\"Choose a Video Type\", \"presto-player\")}\n >\n <Button\n isPrimary\n onClick={() => {\n insertBlockType(\"self-hosted\");\n }}\n >\n {__(\"Video\", \"presto-player\")}\n </Button>\n <Button\n isPrimary\n onClick={() => {\n insertBlockType(\"youtube\");\n }}\n >\n {__(\"Youtube\", \"presto-player\")}\n </Button>\n <Button\n isPrimary\n onClick={() => {\n insertBlockType(\"vimeo\");\n }}\n >\n {__(\"Vimeo\", \"presto-player\")}\n </Button>\n {prestoPlayer?.isPremium ? (\n <Button\n isPrimary\n onClick={() => {\n insertBlockType(\"bunny\");\n }}\n >\n {__(\"Bunny.net\", \"presto-player\")}\n </Button>\n ) : (\n \"\"\n )}\n <Button\n isPrimary\n onClick={() => {\n insertBlockType(\"audio\");\n }}\n >\n {__(\"Audio\", \"presto-player\")}\n </Button>\n </Placeholder>\n <InnerBlocks templateLock={false} renderAppender={() => false} />\n </div>\n </div>\n );\n }\n\n return (\n <div>\n <div {...blockProps}>\n <InnerBlocks\n templateLock={false}\n renderAppender={() => appenderToUse()}\n />\n </div>\n </div>\n );\n },\n\n save: () => {\n const blockProps = useBlockProps.save();\n\n return (\n <div {...blockProps}>\n <InnerBlocks.Content />\n </div>\n );\n },\n};\n","var map = {\n\t\"./reusable-videos/index.js\": 72\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 68;","// sign a private url\nexport const signURL = async (src) => {\n if (!src) {\n return;\n }\n\n const preview = await wp.apiFetch({\n path: \"presto-player/v1/bunny/sign\",\n method: \"POST\",\n data: {\n url: src,\n id: 0, // backwards compat\n },\n });\n\n return preview;\n};\n","/**\n * Upload files in chunks\n * Based on: https://github.com/deliciousbrains/wp-dbi-file-uploader\n */\nexport default function ({ file, path, onProgress, onComplete, onError }) {\n let reader = {};\n let chunk = 0;\n let cancelled = false;\n\n // get max upload size, max out at 16mb chunks\n const max_request_size = Math.min(\n prestoPlayerAdmin.wp_max_upload_size - 1000000,\n 15900000\n );\n let slice_size = Math.max(max_request_size, 1900000); // ~2MB fallback as minimum\n slice_size = Math.min(slice_size, 104857600); // make the max size 100MB\n\n // export percent done\n let percent_done;\n\n // chunk upload\n const chunkUpload = function () {\n chunk = 0;\n\n reader = new FileReader();\n upload_file(0);\n return this;\n };\n\n // upload file\n const upload_file = async (start) => {\n const next_slice = start + slice_size + 1;\n const blob = file.slice(start, next_slice);\n const chunks = Math.ceil(file.size / (slice_size + 1));\n chunk++;\n onProgress((chunk / chunks) * 100);\n\n const body = new FormData();\n body.append(\"file\", blob);\n body.append(\"name\", file.name);\n body.append(\"chunk\", chunk);\n body.append(\"chunks\", chunks);\n\n try {\n const file_url = await wp.apiFetch({\n path,\n method: \"POST\",\n body,\n });\n\n if (cancelled) {\n console.log(\"cancelled\");\n return;\n }\n\n if (next_slice < file.size) {\n onProgress(percent_done);\n upload_file(next_slice);\n } else {\n onComplete(file_url);\n }\n } catch (e) {\n onError(e);\n console.error(e);\n }\n };\n\n chunkUpload();\n\n return {\n cancel: () => {\n cancelled = true;\n },\n };\n}\n","export default ({ item, onClick, className }) => {\n function bytesToSize(bytes) {\n var sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n if (bytes == 0) return \"0 Byte\";\n var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));\n return Math.round(bytes / Math.pow(1024, i), 2) + \" \" + sizes[i];\n }\n\n function formatDate(date) {\n return new Date(date).toLocaleString();\n }\n\n const isEncoding = () => {\n return !!item?.encodeProgress && item.encodeProgress !== 100;\n };\n\n return (\n <div\n className={`presto-player__media-list-item ${className}`}\n onClick={onClick}\n >\n <div className=\"presto-player__media-list-item-icon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinecap=\"round\"\n >\n <polygon points=\"23 7 16 12 23 17 23 7\"></polygon>\n <rect x=\"1\" y=\"5\" width=\"15\" height=\"14\" rx=\"2\" ry=\"2\"></rect>\n </svg>\n </div>\n <div className=\"presto-player__media-list-item-title\">{item?.title}</div>\n {isEncoding() && (\n <div className=\"presto-player__media-list-item-size\">Encoding...</div>\n )}\n {!isEncoding() && (\n <div className=\"presto-player__media-list-item-size\">\n {bytesToSize(item?.size)}\n </div>\n )}\n {!isEncoding() && (\n <div className=\"presto-player__media-list-item-modified\">\n {formatDate(item.updated_at)}\n </div>\n )}\n </div>\n );\n};\n","export default ({ item, onClick, className }) => {\n function bytesToSize(bytes) {\n var sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n if (bytes == 0) return \"0 Byte\";\n var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));\n return Math.round(bytes / Math.pow(1024, i), 2) + \" \" + sizes[i];\n }\n\n function formatDate(date) {\n return new Date(date).toLocaleString();\n }\n\n return (\n <div\n className={`presto-player__media-list-item ${className}`}\n onClick={onClick}\n >\n <div className=\"presto-player__media-list-item-icon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinecap=\"round\"\n >\n <polygon points=\"23 7 16 12 23 17 23 7\"></polygon>\n <rect x=\"1\" y=\"5\" width=\"15\" height=\"14\" rx=\"2\" ry=\"2\"></rect>\n </svg>\n </div>\n <div className=\"presto-player__media-list-item-title\">{item?.title}</div>\n <div className=\"presto-player__media-list-item-size\">\n {bytesToSize(item?.size)}\n </div>\n <div className=\"presto-player__media-list-item-modified\">\n {formatDate(item.updated_at)}\n </div>\n </div>\n );\n};\n","/** @jsx jsx */\n/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst {\n Modal,\n Spinner,\n Button,\n BaseControl,\n Flex,\n FlexBlock,\n Notice,\n Card,\n CardBody,\n Disabled,\n DropZone,\n FormFileUpload,\n DropZoneProvider,\n} = wp.components;\nconst { useEffect, useState, useRef } = wp.element;\nimport MediaItem from \"./MediaItem\";\nimport MediaFolder from \"./MediaFolder\";\n\nimport { css, jsx } from \"@emotion/core\";\n\nexport default ({\n onClose,\n title,\n header,\n onLoad,\n items,\n folders,\n fetching,\n progressMessage,\n onSelect,\n error,\n onDelete,\n onUpload,\n progress,\n}) => {\n const [selected, setSelected] = useState({});\n const [deleteConfirm, setDeleteConfirm] = useState(false);\n const buttonRef = useRef();\n\n useEffect(() => {\n onLoad && onLoad();\n }, []);\n\n const bytesToSize = (bytes) => {\n var sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n if (bytes == 0) return \"0 Byte\";\n var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));\n return Math.round(bytes / Math.pow(1024, i), 2) + \" \" + sizes[i];\n };\n\n const toDate = (d) => {\n d = new Date(d);\n var hours = d.getHours();\n var minutes = d.getMinutes();\n var ampm = hours >= 12 ? \"pm\" : \"am\";\n hours = hours % 12;\n hours = hours ? hours : 12;\n minutes = minutes < 10 ? \"0\" + minutes : minutes;\n\n return (\n d.getDate() +\n \"-\" +\n (d.getMonth() + 1) +\n \"-\" +\n d.getFullYear() +\n \" at \" +\n hours +\n \":\" +\n minutes +\n ampm\n );\n };\n\n const deleteSelected = () => {\n onDelete(selected);\n setDeleteConfirm(false);\n };\n\n const isSelected = () => {\n return Object.keys(selected || {}).length;\n };\n\n const sidebarContent = () => {\n if (!isSelected()) {\n return <></>;\n }\n return (\n <div className=\"presto-player__media-modal-sidebar-content\">\n <BaseControl>\n <Disabled key={selected.id}>\n {selected?.thumbnail ? (\n <img src={selected?.thumbnail} style={{ maxWidth: \"100%\" }} />\n ) : (\n <video preload=\"metadata\">\n <source src={selected.previewUrl} />\n </video>\n )}\n </Disabled>\n </BaseControl>\n <BaseControl>\n <BaseControl.VisualLabel>\n {__(\"Name\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <h3 style={{ marginTop: \"5px\" }}>{selected.title}</h3>\n </BaseControl>\n\n {!!selected?.visibility && (\n <BaseControl>\n <BaseControl.VisualLabel>\n {__(\"Visibility\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <h3 style={{ marginTop: \"5px\" }}>{selected.visibility}</h3>\n </BaseControl>\n )}\n\n <BaseControl>\n <BaseControl.VisualLabel>\n {__(\"Size\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <h3 style={{ marginTop: \"5px\" }}>\n {bytesToSize(selected?.size || 0)}\n </h3>\n </BaseControl>\n\n <BaseControl>\n <BaseControl.VisualLabel>\n {__(\"Created\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <h3 style={{ marginTop: \"5px\" }}>{toDate(selected?.created_at)}</h3>\n </BaseControl>\n\n <BaseControl>\n {deleteConfirm ? (\n <Card>\n <CardBody>\n <p>\n <strong>Are you sure?</strong>\n </p>\n <p>Are you sure you want to delete this video?</p>\n <Button isDestructive onClick={deleteSelected}>\n Yes\n </Button>\n <Button onClick={() => setDeleteConfirm(false)}>Cancel</Button>\n </CardBody>\n </Card>\n ) : (\n <Button\n isDestructive\n onClick={() => {\n setDeleteConfirm(!deleteConfirm);\n }}\n >\n {__(\"Delete video\", \"presto-player\")}\n </Button>\n )}\n </BaseControl>\n </div>\n );\n };\n\n const selectVideo = () => {\n if (selected) {\n onSelect(selected);\n onClose();\n }\n };\n\n const itemsContent = () => {\n if (fetching) {\n return (\n <Flex className=\"presto-player__media-loading\">\n <FlexBlock style={{ textAlign: \"center\" }}>\n {progress ? (\n <>\n <div>\n <strong>\n {progressMessage || __(\"Uploading\", \"presto-player\")}\n </strong>\n </div>\n <div>\n {__(\n \"Please don't navigate away from this page.\",\n \"presto-player\"\n )}\n </div>\n <progress\n className=\"presto-progress\"\n max=\"100\"\n value={progress}\n style={{ width: \"100px\" }}\n ></progress>\n </>\n ) : (\n <Spinner />\n )}\n </FlexBlock>\n </Flex>\n );\n }\n\n if (!items?.length) {\n return (\n <Flex align-items=\"center\" className=\"presto-player__media-not-found\">\n <div>\n <h2>Drop video files here to upload</h2>\n <p>or browse for a video</p>\n <FormFileUpload\n isSecondary\n accept=\"video/mp4,video/x-m4v,video/*\"\n onChange={(e) => {\n if (!e.target.files) {\n return;\n }\n onUpload(e.target.files);\n jQuery(e.target).val(null);\n }}\n >\n {__(\"Upload New Video\", \"presto-player\")}\n </FormFileUpload>\n </div>\n </Flex>\n );\n }\n\n return (\n <div className=\"presto-player__media-list\">\n <h2>{title}</h2>\n\n {folders && (\n <div className=\"presto-player__media-list-folders\">\n {folders.map((folder) => {\n return <MediaFolder key={folder.id} item={folder} />;\n })}\n </div>\n )}\n\n <div className=\"presto-player__media-list-items\">\n {items.map((item) => {\n return (\n <MediaItem\n item={item}\n key={item.id}\n onClick={() => {\n if (selected === item) {\n setSelected({});\n } else {\n setSelected(item);\n }\n }}\n className={selected === item ? \"is-selected\" : \"\"}\n />\n );\n })}\n </div>\n </div>\n );\n };\n\n return (\n <Modal\n title={header ? header : __(\"Add Media\", \"presto-player\")}\n onRequestClose={onClose}\n className=\"presto-player__media-modal presto-player__full-modal\"\n overlayClassName=\"presto-player__modal-overlay\"\n >\n <div className=\"presto-player__media-modal-layout\" data-cy=\"media-modal\">\n <div className=\"presto-player__media-modal-header\">\n <div\n className=\"presto-player__media-modal-upload\"\n css={css`\n display: flex;\n align-items: center;\n `}\n >\n <FormFileUpload\n isPrimary\n accept=\"video/mp4,video/x-m4v,video/*\"\n onChange={(e) => {\n if (!e.target.files) {\n return;\n }\n onUpload(e.target.files);\n jQuery(e.target).val(null);\n }}\n >\n {__(\"Upload New Video\", \"presto-player\")}\n </FormFileUpload>\n <div\n css={css`\n margin-left: 10px;\n `}\n >\n {__(\"Or drag a file here to upload.\", \"presto-player\")}\n </div>\n </div>\n {error && (\n <Notice status=\"error\" isDismissible={false}>\n {error}\n </Notice>\n )}\n </div>\n <div className=\"presto-player__media-modal-content\">\n <DropZoneProvider>\n {itemsContent()}\n <DropZone label={\"Drop files\"} onFilesDrop={onUpload} />\n </DropZoneProvider>\n </div>\n <div className=\"presto-player__media-modal-sidebar\">\n {sidebarContent()}\n </div>\n <div className=\"presto-player__media-modal-footer\">\n <Button\n isPrimary\n disabled={!isSelected()}\n onClick={selectVideo}\n ref={buttonRef}\n >\n {__(\"Choose\", \"presto-player\")}\n </Button>\n </div>\n </div>\n </Modal>\n );\n};\n","const { __ } = wp.i18n;\nimport chunkUpload from \"@/admin/blocks/shared/media/chunk-upload\";\nimport MediaPopup from \"@/admin/blocks/shared/media/MediaPopup\";\nconst { useState, useEffect } = wp.element;\n\nexport default ({ closePopup, noticeOperations, onSelect, isPrivate }) => {\n const [videos, setVideos] = useState([]);\n const [fetching, setFetching] = useState(false);\n const [progress, setProgress] = useState(0);\n const [progressMessage, setProgressMessage] = useState(\"\");\n const [error, setError] = useState(\"\");\n\n const endpoint = isPrivate ? \"private-videos\" : \"public-videos\";\n\n // reset progress and error on open\n useEffect(() => {\n setProgress(0);\n setError(\"\");\n }, []);\n\n // handle error\n const onError = (message) => {\n noticeOperations.removeAllNotices();\n noticeOperations.createErrorNotice(message);\n };\n\n const uploadFile = async (files) => {\n setError(\"\");\n setFetching(true);\n setProgressMessage(__(\"Uploading\", \"presto-player\"));\n chunkUpload({\n file: files[0],\n path: `presto-player/v1/bunny/upload`,\n onProgress: (percent) => {\n setProgress(percent - 10); // leave 10% for storing\n },\n onComplete: storeFile,\n onError: (e) => {\n setError(e.message);\n setProgress(0);\n setFetching(false);\n },\n });\n };\n\n const storeFile = async ({ path, name }) => {\n setProgressMessage(__(\"Storing\", \"presto-player\"));\n try {\n const videos = await wp.apiFetch({\n path: `presto-player/v1/bunny/${endpoint}`,\n method: \"POST\",\n data: {\n path,\n name,\n },\n });\n setVideos(videos);\n } catch (e) {\n setError(e.message);\n console.error(e);\n } finally {\n setProgress(0);\n setFetching(false);\n }\n };\n\n const deleteVideo = async (video) => {\n try {\n setVideos((videos || []).filter((item) => item !== video));\n await wp.apiFetch({\n path: `presto-player/v1/bunny/${endpoint}`,\n method: \"DELETE\",\n data: {\n name: video?.title,\n },\n });\n } catch (e) {\n setError(e.message);\n }\n };\n\n // loads videos for media popup\n const loadVideos = async () => {\n try {\n setFetching(true);\n const videos = await wp.apiFetch({\n path: `presto-player/v1/bunny/${endpoint}`,\n });\n setVideos(videos);\n } catch (e) {\n setError(e.message);\n } finally {\n setFetching(false);\n }\n };\n\n return (\n <MediaPopup\n onClose={closePopup}\n progressMessage={progressMessage}\n fetching={fetching}\n error={error}\n onUpload={uploadFile}\n onLoad={loadVideos}\n items={videos}\n progress={progress}\n onDelete={deleteVideo}\n onSelect={onSelect}\n onError={onError}\n header={\n isPrivate\n ? __(\"Bunny.net Private Video Storage\", \"presto-player\")\n : __(\"Bunny.net Public Video Storage\", \"presto-player\")\n }\n title={\n isPrivate\n ? __(\"Private Video Library\", \"presto-player\")\n : __(\"Public Video Library\", \"presto-player\")\n }\n />\n );\n};\n","const { combineReducers } = wp.data;\n\n/**\n * Videos\n *\n * @param {array} state\n * @param {object} action\n */\nconst videosReducer = (state = [], action) => {\n switch (action.type) {\n case \"SET_VIDEOS\":\n return action.value;\n case \"ADD_VIDEOS\":\n return [...state, ...action.value];\n case \"ADD_VIDEO\":\n return [...state, ...[action.value]];\n case \"UPDATE_VIDEO\":\n return state.map((item, index) => {\n if (item.id !== action.value?.id) {\n return item;\n }\n return {\n ...item,\n ...action.value,\n };\n });\n case \"REMOVE_VIDEO\":\n return state.filter((item) => item.guid !== action.value.guid);\n }\n return state;\n};\n\n/**\n * Videos\n *\n * @param {array} state\n * @param {object} action\n */\nconst uploadsReducer = (state = [], action) => {\n switch (action.type) {\n case \"SET_UPLOADS\":\n return action.value;\n case \"ADD_UPLOADS\":\n return [...state, ...action.value];\n case \"ADD_UPLOAD\":\n return [...state, ...[action.value]];\n case \"UPDATE_UPLOAD\":\n return state.map((item, index) => {\n if (item.id !== action.value?.id) {\n return item;\n }\n return {\n ...item,\n ...action.value,\n };\n });\n case \"REMOVE_UPLOAD\":\n return state.filter((item) => item !== action.value);\n }\n return state;\n};\n\n/**\n * Videos\n *\n * @param {array} state\n * @param {object} action\n */\nconst collectionsReducer = (state = [], action) => {\n switch (action.type) {\n case \"SET_COLLECTIONS\":\n return action.value;\n case \"ADD_COLLECTION\":\n return [...state, ...[action.value]];\n case \"UPDATE_COLLECTION\":\n return state.map((item, index) => {\n if (item.id !== action.value?.id) {\n return item;\n }\n return {\n ...item,\n ...action.value,\n };\n });\n case \"REMOVE_COLLECTION\":\n return state.filter((item) => item !== action.value);\n }\n return state;\n};\n\n/**\n * Request\n * @param {} state\n * @param {*} action\n * @returns\n */\nconst requestReducer = (\n state = {\n private: false,\n collection: \"\",\n search: \"\",\n },\n action\n) => {\n switch (action.type) {\n case \"SET_PRIVATE_REQUEST\":\n return {\n ...state,\n private: action.value,\n };\n case \"SET_SEARCH_REQUEST\":\n return {\n ...state,\n search: action.value,\n };\n case \"SET_COLLECTION_REQUEST\":\n return {\n ...state,\n collection: action.value,\n };\n }\n\n return state;\n};\n\n/**\n * Request\n * @param {} state\n * @param {*} action\n * @returns\n */\nconst UIReducer = (\n state = {\n loading: false,\n videosFetched: false,\n createCollection: false,\n selectedId: null,\n },\n action\n) => {\n switch (action.type) {\n case \"SET_LOADING\":\n return {\n ...state,\n loading: action.value,\n };\n case \"SET_VIDEOS_FETCHED\":\n return {\n ...state,\n videosFetched: action.value,\n };\n case \"SET_UI_ITEM\":\n return {\n ...state,\n [action.item]: action.value,\n };\n }\n\n return state;\n};\n\nconst errorReducer = (state = [], action) => {\n switch (action.type) {\n case \"ADD_ERROR\":\n return [...state, ...[action.value]];\n case \"REMOVE_ERROR\":\n return state.filter((element) => element !== action.value);\n }\n return state;\n};\n\nexport default combineReducers({\n videosReducer,\n collectionsReducer,\n uploadsReducer,\n requestReducer,\n UIReducer,\n errorReducer,\n});\n","export function videos(state) {\n return state?.videosReducer || [];\n}\nexport function collections(state) {\n return state?.collectionsReducer || [];\n}\nexport function uploads(state) {\n return state?.uploadsReducer || [];\n}\nexport function isPrivate(state) {\n return !!state?.requestReducer?.private;\n}\nexport function isLoading(state) {\n return state?.UIReducer?.loading || false;\n}\nexport function errors(state) {\n return state?.errorReducer || [];\n}\nexport function videosFetched(state) {\n return state?.UIReducer?.videosFetched || false;\n}\nexport function currentCollection(state) {\n return state?.requestReducer?.collection;\n}\nexport function ui(state, arg) {\n return state?.UIReducer?.[arg];\n}\nexport function requestType(state) {\n return state?.requestReducer?.private ? \"private\" : \"public\";\n}\n","export function setVideos(value) {\n return {\n type: \"SET_VIDEOS\",\n value,\n };\n}\nexport function addVideos(value) {\n return {\n type: \"ADD_VIDEOS\",\n value,\n };\n}\n\nexport function removeVideo(value) {\n return {\n type: \"REMOVE_VIDEO\",\n value,\n };\n}\n\nexport function setCollections(value) {\n return {\n type: \"SET_COLLECTIONS\",\n value,\n };\n}\n\nexport function addCollection(value) {\n return {\n type: \"ADD_COLLECTION\",\n value,\n };\n}\n\nexport function setIsPrivate(value) {\n return {\n type: \"SET_PRIVATE_REQUEST\",\n value,\n };\n}\n\nexport function setSearch(value) {\n return {\n type: \"SET_SEARCH\",\n value,\n };\n}\n\nexport function setCollectionRequest(value) {\n return {\n type: \"SET_COLLECTION_REQUEST\",\n value,\n };\n}\n\nexport function setUploads(value) {\n return {\n type: \"SET_UPLOADS\",\n value,\n };\n}\n\nexport function addUploads(value) {\n return {\n type: \"ADD_UPLOADS\",\n value,\n };\n}\n\nexport function removeUpload(value) {\n return {\n type: \"REMOVE_UPLOAD\",\n value,\n };\n}\n\nexport function setVideosFetched(value) {\n return {\n type: \"SET_VIDEOS_FETCHED\",\n value,\n };\n}\n\nexport function setLoading(value) {\n return {\n type: \"SET_LOADING\",\n value,\n };\n}\n\nexport function setUI(item, value) {\n return {\n type: \"SET_UI_ITEM\",\n item,\n value,\n };\n}\n\nexport function addError(value) {\n return {\n type: \"ADD_ERROR\",\n value,\n };\n}\nexport function removeError(value) {\n return {\n type: \"REMOVE_ERROR\",\n value,\n };\n}\n","/**\n * WordPress dependencies\n */\nconst { registerStore } = wp.data;\n\n/**\n * Internal dependencies\n */\nimport reducer from \"./reducer\";\nimport * as selectors from \"./selectors\";\nimport * as actions from \"./actions\";\n\nexport default registerStore(\"presto-player/bunny-popup\", {\n reducer,\n selectors,\n actions,\n});\n","/**\n * Is the video playable\n */\nexport const isPlayable = (video) =>\n video?.status == 3 && video?.availableResolutions.length;\n\n/**\n * It's selectable if it's playable or live;\n */\nexport const isSelectable = (video) => isPlayable(video) || video?.status === 4;\n\n/**\n * Get the status text\n * @returns string\n */\nexport const getStatusText = (video) => {\n if (video?.status == 0) return \"Processing\";\n if (video?.status == 1) return \"Uploaded\";\n if (video?.status == 2) return \"Processing\";\n if (isPlayable(video)) return \"Playable\";\n if (video?.status == 3) return \"Encoding\";\n if (video?.status == 4) return \"Live\";\n if (video?.status == 5) return \"Error\";\n if (video?.status == 6) return \"Upload Failed\";\n};\n\nexport const getLengthToTime = (length) => {\n if (length == undefined || length == null) return \"\";\n return new Date(length * 1000).toISOString().substr(11, 8);\n};\n\nexport const bytesToSize = (bytes) => {\n if (bytes == undefined || bytes == 0) return \"Unknown\";\n var sizes = [\"b\", \"KB\", \"MB\", \"GB\", \"TB\"];\n if (bytes == 0) return \"0 b\";\n var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)).toString());\n return (bytes / Math.pow(1024, i)).toFixed(2) + \" \" + sizes[i];\n};\n\nexport const stampToDate = (d) => {\n d = new Date(d);\n var hours = d.getHours();\n var minutes = d.getMinutes();\n var ampm = hours >= 12 ? \"pm\" : \"am\";\n hours = hours % 12;\n hours = hours ? hours : 12;\n minutes = minutes < 10 ? \"0\" + minutes : minutes;\n\n return (\n d.getDate() +\n \"-\" +\n (d.getMonth() + 1) +\n \"-\" +\n d.getFullYear() +\n \" at \" +\n hours +\n \":\" +\n minutes +\n ampm\n );\n};\n","/** @jsx jsx */\n\nconst { __ } = wp.i18n;\nconst { Button, BaseControl, Disabled, Card, CardBody } = wp.components;\nconst { useState, useContext, useEffect } = wp.element;\nconst { dispatch, useSelect } = wp.data;\n\nimport {\n isSelectable,\n getStatusText,\n getLengthToTime,\n stampToDate,\n bytesToSize,\n} from \"./utils\";\n\nimport { jsx, css } from \"@emotion/core\";\n\nexport default () => {\n const [deleteConfirm, setDeleteConfirm] = useState(false);\n const [deleting, setDeleting] = useState(false);\n const [video, setVideo] = useState(null);\n\n const isPrivate = useSelect((select) =>\n select(\"presto-player/bunny-popup\").isPrivate()\n );\n const selectedId = useSelect((select) =>\n select(\"presto-player/bunny-popup\").ui(\"selectedId\")\n );\n const videos = useSelect((select) =>\n select(\"presto-player/bunny-popup\").videos()\n );\n\n useEffect(() => {\n setVideo(\n selectedId ? videos.find((video) => video.guid === selectedId) : null\n );\n }, [videos, selectedId]);\n\n const onDelete = async () => {\n await wp.apiFetch({\n path: `presto-player/v1/bunny/stream/videos/${video.id}`,\n method: \"DELETE\",\n data: {\n type: isPrivate ? \"private\" : \"public\",\n },\n });\n dispatch(\"presto-player/bunny-popup\").removeVideo(video);\n dispatch(\"presto-player/bunny-popup\").setUI(\"selectedId\", null);\n setDeleting(false);\n setDeleteConfirm(false);\n };\n\n const controlCSS = css`\n margin-top: 5px;\n `;\n\n if (!video) {\n return \"\";\n }\n\n const getThumbnail = (video) => {\n return isPrivate ? video?.webPURLSigned : video?.webPURL;\n };\n\n return (\n video && (\n <div className=\"presto-player__media-modal-sidebar-content\">\n <BaseControl\n css={css`\n position: relative;\n `}\n >\n <Disabled key={video.id}>\n {isSelectable(video) && getThumbnail(video) && (\n <img src={getThumbnail(video)} css={{ maxWidth: \"100%\" }} />\n )}\n </Disabled>\n <Button\n isSmall\n isPrimary\n isBusy={!isSelectable(video)}\n css={css`\n ${isSelectable(video) ? \"position: absolute;\" : \"\"}\n top: 8px;\n right: 8px;\n font-size: 11px;\n color: #ffffff;\n padding: 2px 10px;\n border-radius: 9999px;\n `}\n >\n {getStatusText(video)}\n </Button>\n </BaseControl>\n <BaseControl>\n <BaseControl.VisualLabel>\n {__(\"Name\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <h3 css={controlCSS}>{video.title}</h3>\n </BaseControl>\n\n {!!video?.visibility && (\n <BaseControl>\n <BaseControl.VisualLabel>\n {__(\"Visibility\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <h3 css={controlCSS}>{video.visibility}</h3>\n </BaseControl>\n )}\n\n <BaseControl>\n <BaseControl.VisualLabel>\n {__(\"Size\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <h3 css={controlCSS}>{bytesToSize(video?.size || 0)}</h3>\n </BaseControl>\n\n <BaseControl>\n <BaseControl.VisualLabel>\n {__(\"Length\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <h3 css={controlCSS}>{getLengthToTime(video?.length)}</h3>\n </BaseControl>\n\n <BaseControl>\n <BaseControl.VisualLabel>\n {__(\"Created\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <h3 css={controlCSS}>{stampToDate(video?.created_at)}</h3>\n </BaseControl>\n\n <BaseControl>\n {deleteConfirm ? (\n <Card>\n <CardBody>\n <p>\n <strong>{__(\"Are you sure?\", \"presto-player\")}</strong>\n </p>\n <p>\n {__(\n \"Are you sure you want to delete this video?\",\n \"presto-player\"\n )}\n </p>\n <Button\n isDestructive\n disabled={deleting}\n isBusy={deleting}\n onClick={(e) => {\n e.preventDefault();\n onDelete();\n setDeleting(true);\n }}\n >\n {__(\"Yes\", \"presto-player\")}\n </Button>\n <Button onClick={() => setDeleteConfirm(false)}>\n {__(\"Cancel\", \"presto-player\")}\n </Button>\n </CardBody>\n </Card>\n ) : (\n <Button\n isDestructive\n onClick={() => {\n setDeleteConfirm(!deleteConfirm);\n }}\n >\n {__(\"Delete video\", \"presto-player\")}\n </Button>\n )}\n </BaseControl>\n </div>\n )\n );\n};\n","/** @jsx jsx */\nimport { css, jsx } from \"@emotion/core\";\n\nexport default ({ className, progress }) => {\n return (\n <div className={className}>\n <div\n css={css`\n height: 100%;\n background-color: var(--wp-admin-theme-color, #007cba);\n `}\n style={{ width: `${progress}%` }}\n ></div>\n </div>\n );\n};\n","/** @jsx jsx */\nimport { css, jsx } from \"@emotion/core\";\nimport ProgressBar from \"./ProgressBar\";\n\nexport default ({ progress }) => {\n return (\n <div\n css={css`\n max-width: 100%;\n object-fit: cover;\n width: 100%;\n height: 140px;\n background-color: #222;\n color: white;\n text-decoration: none;\n text-align: center;\n box-sizing: border-box;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n `}\n >\n <ProgressBar\n progress={progress}\n css={css`\n width: 100%;\n border-radius: 0px;\n margin: 0 15px;\n background-color: #e3e3e3;\n height: 3px;\n `}\n />\n </div>\n );\n};\n","/** @jsx jsx */\nimport { css, jsx } from \"@emotion/core\";\n\nexport default (props) => {\n const { thumbnail, title, footer, badge, before, after } = props;\n return (\n <div\n className=\"presto-player__video-thumb\"\n css={css`\n cursor: pointer;\n user-select: none;\n display: inline-block;\n position: relative;\n margin-right: 20px;\n font-weight: bold;\n margin-bottom: 20px;\n width: 220px;\n flex: 0 0 220px;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n overflow: hidden;\n `}\n {...props}\n >\n {!!before && before}\n\n {!!thumbnail && thumbnail}\n\n <div\n css={css`\n margin: 14px;\n `}\n >\n {!!badge && (\n <div\n css={css`\n position: absolute;\n top: 8px;\n right: 8px;\n `}\n >\n {badge}\n </div>\n )}\n\n {!!title && (\n <span\n css={css`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n width: 100%;\n max-width: 100%;\n display: inline-block;\n margin-bottom: 7px;\n font-size: 13px;\n `}\n >\n {title}\n </span>\n )}\n\n {!!footer && (\n <div\n css={css`\n font-size: 12px;\n opacity: 0.75;\n margin-bottom: 7px;\n `}\n >\n {footer}\n </div>\n )}\n </div>\n\n {!!after && after}\n </div>\n );\n};\n","/** @jsx jsx */\nimport { css, jsx } from \"@emotion/core\";\nconst { Icon, Button } = wp.components;\nconst { useEffect, useState } = wp.element;\nconst { useSelect, dispatch } = wp.data;\nimport ProgressOverlay from \"../ProgressOverlay\";\nimport ProgressBar from \"../ProgressBar\";\nimport Thumbnail from \"../ThumbTemplate\";\n\nimport {\n isSelectable,\n getStatusText,\n getLengthToTime,\n bytesToSize,\n} from \"../utils\";\n\nexport default ({ video }) => {\n const [selected, setSelected] = useState();\n const isPrivate = useSelect((select) =>\n select(\"presto-player/bunny-popup\").isPrivate()\n );\n const selectedId = useSelect((select) =>\n select(\"presto-player/bunny-popup\").ui(\"selectedId\")\n );\n\n useEffect(() => {\n setSelected(selectedId ? selectedId === video.guid : null);\n }, [selectedId]);\n\n /**\n * Status badge\n * @returns JSX\n */\n const renderStatusBadge = () => (\n <Button\n isSmall\n isPrimary\n isBusy={!isSelectable(video)}\n css={css`\n font-size: 11px;\n color: #ffffff;\n padding: 2px 10px;\n border-radius: 9999px;\n `}\n >\n {getStatusText(video)}\n </Button>\n );\n\n /**\n * Render thumbnail\n * @returns\n */\n const renderThumbnail = () => {\n if (video.status < 3) {\n return <ProgressOverlay progress={video.encodeProgress} />;\n }\n\n const url = isPrivate ? video?.thumbnailURLSigned : video?.thumbnailURL;\n\n if (url) {\n return (\n <img\n css={css`\n max-width: 100%;\n object-fit: cover;\n width: 100%;\n height: 140px;\n display: block;\n `}\n src={url}\n />\n );\n }\n };\n\n const renderLength = () => (\n <div\n css={css`\n display: flex;\n align-items: center;\n `}\n >\n <span\n css={css`\n margin-right: 10px;\n display: flex;\n align-items: center;\n `}\n >\n <Icon\n css={css`\n width: 14px;\n height: 14px;\n font-size: 14px;\n margin-right: 5px;\n opacity: 0.5;\n `}\n icon=\"clock\"\n size={14}\n />\n <span>{getLengthToTime(video.length)}</span>\n </span>\n <span\n css={css`\n display: flex;\n align-items: center;\n `}\n >\n <Icon\n css={css`\n opacity: 0.5;\n width: 14px;\n height: 14px;\n font-size: 14px;\n margin-right: 5px;\n `}\n icon=\"database\"\n size={14}\n />\n <span>{bytesToSize(video.storageSize)}</span>\n </span>\n </div>\n );\n\n return (\n <Thumbnail\n onClick={() => {\n dispatch(\"presto-player/bunny-popup\").setUI(\"selectedId\", video?.guid);\n }}\n css={css`\n ${selected &&\n \"box-shadow: 0 0 0 0px #fff, 0 0 0 3px var(--wp-admin-theme-color, #007cba);\"}\n border: 1px solid\n ${selected ? \"var(--wp-admin-theme-color, #007cba)\" : \"#e0e0e0\"};\n `}\n thumbnail={renderThumbnail()}\n badge={renderStatusBadge()}\n title={video.title}\n footer={renderLength()}\n after={\n video.status === 3 ? (\n <ProgressBar\n css={css`\n width: 100%;\n border-radius: 0px;\n margin: 0;\n background-color: #e3e3e3;\n height: 3px;\n `}\n progress={video.encodeProgress}\n />\n ) : (\n \"\"\n )\n }\n />\n );\n};\n","/** @jsx jsx */\nconst { Flex, FlexBlock, Spinner } = wp.components;\n\nimport { jsx } from \"@emotion/core\";\n\nexport default ({ className }) => {\n return (\n <Flex className={className}>\n <FlexBlock css={{ textAlign: \"center\" }}>\n <Spinner />\n </FlexBlock>\n </Flex>\n );\n};\n","/** @jsx jsx */\nconst { __ } = wp.i18n;\nconst { useState, useEffect, Fragment } = wp.element;\nconst { Flex, FormFileUpload, Notice } = wp.components;\nconst { dispatch, useSelect } = wp.data;\nimport { css, jsx } from \"@emotion/core\";\nimport Video from \"./Video\";\n\nimport Loading from \"../Loading\";\n\nexport default () => {\n const [selected, setSelected] = useState(false);\n const [notice, setNotice] = useState(\"\");\n const fetched = useSelect((select) =>\n select(\"presto-player/bunny-popup\").videosFetched()\n );\n const videos = useSelect((select) =>\n select(\"presto-player/bunny-popup\").videos()\n );\n const type = useSelect((select) =>\n select(\"presto-player/bunny-popup\").requestType()\n );\n const collection = useSelect((select) =>\n select(\"presto-player/bunny-popup\").currentCollection()\n );\n\n // fetch videos\n useEffect(() => {\n if (!fetched) {\n fetch();\n }\n }, [fetched]);\n\n // sync every 5 seconds\n useEffect(() => {\n const interval = setInterval(() => {\n fetch({ sync: true });\n }, 3000);\n return () => clearInterval(interval);\n }, [fetched]);\n\n // fetch videos\n const fetch = async ({ sync } = { sync: false }) => {\n try {\n const videos = await wp.apiFetch({\n path: wp.url.addQueryArgs(`presto-player/v1/bunny/stream/videos`, {\n type,\n ...(collection?.guid ? { collection: collection?.guid } : {}),\n items_per_page: 500,\n }),\n });\n dispatch(\"presto-player/bunny-popup\").setVideos(videos?.items);\n setNotice(\"\");\n } catch (e) {\n if (e?.data?.status === 401) {\n setNotice(\n __(\n \"Please wait. Pullzone cache is clearing. This may take a minute or two...\"\n )\n );\n return;\n }\n\n if (!sync) {\n dispatch(\"presto-player/bunny-popup\").addError(e.message);\n }\n } finally {\n dispatch(\"presto-player/bunny-popup\").setVideosFetched(true);\n }\n };\n\n // default no video content\n const renderDefaultContent = () => {\n return (\n <Flex\n align=\"center\"\n justify=\"center\"\n css={css`\n height: 100%;\n text-align: center;\n `}\n >\n <div>\n <h2>{__(\"Drop video files here to upload\", \"presto-player\")}</h2>\n <p>{__(\"or browse for a video\", \"presto-player\")}</p>\n <FormFileUpload\n isSecondary\n accept=\"video/mp4,video/x-m4v,video/*\"\n onChange={(e) => {\n if (!e.target.files) {\n return;\n }\n dispatch(\"presto-player/bunny-popup\").addUploads(e.target.files);\n jQuery(e.target).val(null);\n }}\n >\n {__(\"Upload New Video\", \"presto-player\")}\n </FormFileUpload>\n </div>\n </Flex>\n );\n };\n\n if (notice) {\n return (\n <Notice status=\"warning\" isDismissible={false}>\n <div css={{ display: \"flex\", alignItems: \"center\" }}>\n <Loading css={{ flex: 1 }} />\n {notice}\n </div>\n </Notice>\n );\n }\n\n // still loading\n if (!fetched) {\n return <Loading css={{ flex: 1 }} />;\n }\n\n // render\n return (\n <Fragment>\n {videos && !!videos.length ? (\n <div>\n {!collection?.guid && <h2>{__(\"Videos\", \"presto-player\")}</h2>}\n {videos.map((video) => {\n if (video?.collectionId !== (collection?.guid || \"\")) {\n return;\n }\n return (\n <Video\n key={video.id}\n video={video}\n onClick={() => {\n setSelected(selected.guid === video.guid ? {} : video);\n }}\n selected={selected.guid === video.guid}\n />\n );\n })}\n </div>\n ) : (\n renderDefaultContent()\n )}\n </Fragment>\n );\n};\n","/** @jsx jsx */\n\nconst { Icon } = wp.components;\nconst { dispatch } = wp.data;\n\nimport Thumb from \"../ThumbTemplate\";\n\nimport { jsx, css } from \"@emotion/core\";\n\nexport default ({ collection }) => {\n // handle click\n const handleClick = (e) => {\n e.preventDefault();\n dispatch(\"presto-player/bunny-popup\").setCollectionRequest(collection);\n dispatch(\"presto-player/bunny-popup\").setVideosFetched(false);\n };\n\n return (\n <Thumb\n onClick={handleClick}\n title={\n <div>\n <Icon\n icon=\"open-folder\"\n css={css`\n color: var(--wp-admin-theme-color);\n margin-right: 10px;\n `}\n />\n {collection.name}\n </div>\n }\n footer={<div>{collection.videoCount} Videos</div>}\n />\n );\n};\n","/** @jsx jsx */\nimport { css, jsx } from \"@emotion/core\";\n\nconst { __ } = wp.i18n;\nconst { useEffect } = wp.element;\nconst { useSelect, dispatch } = wp.data;\n\nimport Collection from \"./Collection\";\n\nexport default () => {\n const collections = useSelect((select) =>\n select(\"presto-player/bunny-popup\").collections()\n );\n const type = useSelect((select) =>\n select(\"presto-player/bunny-popup\").requestType()\n );\n\n const fetchCollections = async () => {\n try {\n const response = await wp.apiFetch({\n path: wp.url.addQueryArgs(`presto-player/v1/bunny/stream/collections`, {\n type,\n }),\n });\n dispatch(\"presto-player/bunny-popup\").setCollections(response?.items);\n } catch (e) {\n if (e?.data?.status === 401) {\n return;\n }\n dispatch(\"presto-player/bunny-popup\").addError(e.message);\n }\n };\n\n useEffect(() => {\n fetchCollections();\n }, []);\n\n return (\n !!collections.length && (\n <div>\n <h2>{__(\"Collections\", \"presto-player\")}</h2>\n <div\n css={css`\n display: flex;\n align-items: stretch;\n overflow: auto;\n `}\n >\n {collections.map((collection) => (\n <Collection collection={collection} key={collection.guid} />\n ))}\n </div>\n </div>\n )\n );\n};\n","/** @jsx jsx */\nconst { __ } = wp.i18n;\nconst { Button, TextControl, Modal, BaseControl } = wp.components;\nconst { useState, Fragment } = wp.element;\nconst { dispatch, useSelect } = wp.data;\n\nimport { jsx, css } from \"@emotion/core\";\n\nexport default () => {\n const [name, setName] = useState(\"\");\n const [busy, setBusy] = useState(false);\n const type = useSelect((select) =>\n select(\"presto-player/bunny-popup\").requestType()\n );\n const modal = useSelect((select) =>\n select(\"presto-player/bunny-popup\").ui(\"createCollection\")\n );\n const setModal = (value) => {\n dispatch(\"presto-player/bunny-popup\").setUI(\"createCollection\", value);\n };\n\n const onCreate = async () => {\n setBusy(true);\n try {\n let collection = await wp.apiFetch({\n path: \"presto-player/v1/bunny/stream/collections\",\n method: \"POST\",\n data: {\n type,\n name,\n },\n });\n dispatch(\"presto-player/bunny-popup\").addCollection(collection);\n dispatch(\"presto-player/bunny-popup\").setCollectionRequest(collection);\n dispatch(\"presto-player/bunny-popup\").setVideosFetched(false);\n setName(\"\");\n setModal(false);\n } catch (e) {\n console.error(e);\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <Fragment>\n <Button isSecondary onClick={() => setModal(true)}>\n {__(\"Create Collection\", \"presto-player\")}\n </Button>\n {modal && (\n <Modal\n overlayClassName=\"presto-modal\"\n title={\"Create New Collection\"}\n shouldCloseOnClickOutside={false}\n isDismissible={false}\n >\n <TextControl\n css={css`\n margin-bottom: 15px;\n `}\n tabIndex=\"0\"\n placeholder={__(\"Enter a collection name\", \"presto-player\")}\n value={name}\n onChange={(name) => setName(name)}\n />\n\n <BaseControl>\n <Button\n isBusy={busy}\n disabled={busy}\n isPrimary\n onClick={() => {\n onCreate();\n }}\n >\n {__(\"Create\", \"presto-player\")}\n </Button>{\" \"}\n <Button onClick={() => setModal(false)}>\n {__(\"Cancel\", \"presto-player\")}\n </Button>\n </BaseControl>\n </Modal>\n )}\n </Fragment>\n );\n};\n","/** @jsx jsx */\nconst { __ } = wp.i18n;\nconst { Flex, FlexBlock, FlexItem, Button, FormFileUpload } = wp.components;\nconst { dispatch } = wp.data;\nimport CreateCollection from \"./collections/CreateCollection\";\n\nimport { jsx } from \"@emotion/core\";\n\nexport default ({ afterUpload }) => {\n return (\n <Flex>\n <FlexBlock>\n <Flex justify=\"flex-start\">\n <FormFileUpload\n multiple\n isPrimary\n accept=\"video/mp4,video/x-m4v,video/*\"\n onChange={(e) => {\n if (!e.target.files) {\n return;\n }\n dispatch(\"presto-player/bunny-popup\").addUploads(e.target.files);\n jQuery(e.target).val(null);\n }}\n >\n {__(\"Upload Videos\", \"presto-player\")}\n </FormFileUpload>{\" \"}\n <CreateCollection />\n {!!afterUpload && afterUpload}\n </Flex>\n </FlexBlock>\n <FlexItem>\n {/* <Flex align={\"stretch\"}>\n <input\n class=\"components-text-control__input\"\n type=\"text\"\n placeholder={__(\"Search for a video...\", \"presto-player\")}\n value={search}\n onChange={(event) => {\n setSearch(event.target.value);\n }}\n />\n <Button\n isPrimary\n size=\"small\"\n onClick={(e) => {\n e.preventDefault();\n onSearch && onSearch(search);\n }}\n >\n {__(\"Search\", \"presto-player\")}\n </Button>\n </Flex> */}\n </FlexItem>\n </Flex>\n );\n};\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst { Button } = wp.components;\nconst { useState, useEffect } = wp.element;\nconst { useSelect } = wp.data;\n\nexport default ({ onChoose }) => {\n const [video, setVideo] = useState(null);\n const [canSelect, setCanSelect] = useState(false);\n\n const selectedId = useSelect((select) =>\n select(\"presto-player/bunny-popup\").ui(\"selectedId\")\n );\n const videos = useSelect((select) =>\n select(\"presto-player/bunny-popup\").videos()\n );\n\n // update selected video when videos or selected id changes\n useEffect(() => {\n setVideo(\n selectedId ? videos.find((video) => video.guid === selectedId) : null\n );\n }, [videos, selectedId]);\n\n // set if we can select if video has available resolutions\n useEffect(() => {\n if (video?.status == 3 && video?.availableResolutions.length) {\n setCanSelect(true);\n return;\n }\n setCanSelect(video?.status > 3 && video?.status < 5);\n }, [video?.availableResolutions]);\n\n return (\n <Button isPrimary disabled={!canSelect} onClick={() => onChoose(video)}>\n {video?.id && !canSelect\n ? __(\"Please wait, video is encoding...\", \"presto-player\")\n : __(\"Choose\", \"presto-player\")}\n </Button>\n );\n};\n","/** @jsx jsx */\nconst { Icon } = wp.components;\nimport { css, jsx } from \"@emotion/core\";\n\nexport default ({ children, onClick }) => {\n return (\n <span\n onClick={onClick}\n css={css`\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n color: var(--wp-admin-theme-color, #007cba);\n padding: 6px 0;\n `}\n >\n <Icon\n css={css`\n width: 14px;\n height: 14px;\n font-size: 14px;\n margin-right: 5px;\n `}\n icon=\"arrow-left-alt\"\n size={14}\n />\n <span>{children}</span>\n </span>\n );\n};\n","/** @jsx jsx */\n\n/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst { useState } = wp.element;\nconst { dispatch, useSelect } = wp.data;\nconst { Button, Modal, BaseControl } = wp.components;\n\nimport { css, jsx } from \"@emotion/core\";\nimport BackButton from \"./BackButton\";\n\nexport default () => {\n const [modal, setModal] = useState(false);\n const [deleting, setDeleting] = useState(false);\n const [error, setError] = useState(\"\");\n const collection = useSelect((select) =>\n select(\"presto-player/bunny-popup\").currentCollection()\n );\n const type = useSelect((select) =>\n select(\"presto-player/bunny-popup\").requestType()\n );\n\n const deleteCollection = async () => {\n setDeleting(true);\n try {\n await wp.apiFetch({\n path: `presto-player/v1/bunny/stream/collections/${collection?.guid}`,\n method: \"DELETE\",\n data: {\n type,\n },\n });\n setModal(false);\n dispatch(\"presto-player/bunny-popup\").setCollectionRequest(\"\");\n dispatch(\"presto-player/bunny-popup\").setVideosFetched(false);\n } catch (e) {\n setModal(false);\n dispatch(\"presto-player/bunny-popup\").addError(e.message);\n } finally {\n setDeleting(false);\n }\n };\n\n return (\n <div\n css={css`\n margin-bottom: 2em;\n display: flex;\n align-items: center;\n justify-content: space-between;\n `}\n >\n <div>\n <BackButton\n onClick={() => {\n dispatch(\"presto-player/bunny-popup\").setCollectionRequest(\"\");\n dispatch(\"presto-player/bunny-popup\").setVideosFetched(false);\n }}\n >\n {__(\"Back To Main Folder\", \"presto-player\")}\n </BackButton>\n <h2>{collection.name}</h2>\n </div>\n <Button isDestructive onClick={() => setModal(true)}>\n {__(\"Delete Collection\", \"presto-player\")}\n </Button>\n {modal && (\n <Modal\n shouldCloseOnClickOutside={false}\n overlayClassName=\"presto-modal\"\n title={\"Delete Collection\"}\n onRequestClose={() => setModal(false)}\n >\n <h2>\n {__(\n \"Are you sure you want to delete the collection? \",\n \"presto-player\"\n )}\n </h2>\n <p>\n {__(\n \"This will also delete all videos inside of the collection.\",\n \"presto-player\"\n )}\n </p>\n <BaseControl>\n <Button\n isDestructive\n disabled={deleting}\n isBusy={deleting}\n onClick={deleteCollection}\n >\n {__(\"Delete\", \"presto-player\")}\n </Button>{\" \"}\n <Button onClick={() => setModal(false)}>\n {__(\"Cancel\", \"presto-player\")}\n </Button>\n </BaseControl>\n </Modal>\n )}\n </div>\n );\n};\n","/** @jsx jsx */\nimport { css, jsx } from \"@emotion/core\";\n\nconst { Icon } = wp.components;\nconst { useState, useEffect, useContext } = wp.element;\nconst { useSelect, dispatch } = wp.data;\nconst { __ } = wp.i18n;\n\nimport chunkUpload from \"@/admin/blocks/shared/media/chunk-upload\";\n\nimport ProgressBar from \"../ProgressBar\";\n\nexport default ({ file, name, onComplete }) => {\n const [progress, setProgress] = useState(0);\n const [message, setMessage] = useState(__(\"Uploading\", \"presto-player\"));\n const [error, setError] = useState(\"\");\n const [created, setCreated] = useState(false);\n const type = useSelect((select) =>\n select(\"presto-player/bunny-popup\").requestType()\n );\n const collection = useSelect((select) =>\n select(\"presto-player/bunny-popup\").currentCollection()\n );\n\n let uploader;\n\n const upload = async () => {\n setMessage(__(\"Uploading\", \"presto-player\"));\n uploader = chunkUpload({\n file: file?.[0] ? file?.[0] : file,\n path: `presto-player/v1/bunny/stream/upload`,\n onProgress: (percent) => {\n setProgress(percent); // leave 10% for storing\n },\n onComplete: createVideo,\n onError: (e) => {\n setError(e.message);\n setMessage(__(\"Error\", \"presto-player\"));\n setProgress(0);\n },\n });\n };\n\n const createVideo = async ({ path, name }) => {\n setMessage(__(\"Creating\", \"presto-player\"));\n try {\n const video = await wp.apiFetch({\n path: \"presto-player/v1/bunny/stream/videos\",\n method: \"POST\",\n data: {\n type,\n name,\n ...(collection?.guid ? { collection: collection.guid } : {}),\n },\n });\n setCreated(true);\n storeVideo({ path, video });\n } catch (e) {\n setError(e.message);\n } finally {\n setProgress(0);\n }\n };\n\n /**\n * Store the video on Bunny.net\n */\n const storeVideo = async ({ path, video }) => {\n await wp.apiFetch({\n path: \"presto-player/v1/bunny/stream/store\",\n method: \"POST\",\n data: {\n type,\n path,\n guid: video.guid,\n },\n });\n\n onComplete();\n };\n\n const onCancel = () => {\n uploader && uploader.cancel();\n dispatch(\"presto-player/bunny-popup\").removeUpload(upload);\n };\n\n useEffect(() => {\n upload();\n return () => {\n uploader && uploader.cancel();\n };\n }, []);\n\n if (created) {\n return \"\";\n }\n\n return (\n <div\n css={css`\n display: flex;\n align-items: center;\n justify-content: space-between;\n animation: components-button__busy-animation 2500ms infinite linear;\n opacity: 1;\n padding: 6px 12px;\n border-radius: 99999px;\n border: 1px solid #dddddd;\n background-size: 100px 100%;\n background-image: linear-gradient(\n -45deg,\n #ffffff 33%,\n #f3f3f3 33%,\n #f3f3f3 70%,\n #ffffff 70%\n );\n `}\n >\n <div\n css={css`\n flex: 1;\n white-space: nowrap;\n overflow: hidden;\n max-width: 150px;\n text-overflow: ellipsis;\n font-weight: bold;\n `}\n >\n {!!error && error}\n {!!name && name} {file.name}...\n </div>\n <div\n css={css`\n display: flex;\n align-items: center;\n `}\n >\n <ProgressBar\n css={css`\n width: 50px;\n height: 3px;\n margin: 0 5px;\n background: #e3e3e3;\n border-radius: 9999px;\n overflow: hidden;\n `}\n progress={progress}\n />\n {/* <Icon onClick={onCancel} icon=\"no-alt\" /> */}\n </div>\n </div>\n );\n};\n","/** @jsx jsx */\nimport { css, jsx } from \"@emotion/core\";\n\nimport Upload from \"./Upload\";\nconst { useSelect } = wp.data;\n\nexport default ({ removeUpload, isPrivate }) => {\n const uploads = useSelect((select) =>\n select(\"presto-player/bunny-popup\").uploads()\n );\n\n if (!uploads.length) {\n return \"\";\n }\n\n return (\n <div\n css={css`\n overflow: auto;\n display: flex;\n align-items: center;\n position: relative;\n `}\n >\n {uploads.length &&\n uploads.map((upload) => {\n return (\n <Upload\n css={css`\n margin-right: 0px;\n `}\n file={upload}\n onComplete={() => removeUpload(upload)}\n />\n );\n })}\n </div>\n );\n};\n","/**\n * WordPress dependencies\n */\n/** @jsx jsx */\nconst { __ } = wp.i18n;\nconst { Modal } = wp.components;\n\nimport { css, jsx } from \"@emotion/core\";\n\nexport default ({\n onClose,\n title,\n header,\n error,\n mainContent,\n sidebar,\n footer,\n}) => {\n return (\n <Modal\n title={title ? title : __(\"Add Media\", \"presto-player\")}\n onRequestClose={onClose}\n css={css`\n width: 100%;\n height: 100%;\n max-width: calc(100% - 32px);\n max-height: calc(100% - 32px);\n\n .components-modal__content {\n position: relative;\n display: flex;\n flex-direction: column;\n }\n `}\n overlayClassName=\"presto-player__modal-overlay\"\n >\n <div\n css={css`\n @media screen and (min-width: 780px) {\n margin: -24px;\n display: grid;\n flex: 1;\n max-height: calc(100vh - 68px);\n grid-template-columns: 1fr 1fr minmax(0px, 267px);\n grid-template-rows: minmax(50px, auto) 1fr 60px;\n grid-template-areas:\n \"header header sidebar\"\n \"main main sidebar\"\n \"footer footer footer\";\n overflow: hidden;\n }\n `}\n data-cy=\"media-modal\"\n >\n <div\n css={css`\n grid-area: header;\n padding: 24px 24px 12px 24px;\n `}\n >\n <div\n css={css`\n display: flex;\n align-items: center;\n\n > * {\n margin-right: 10px;\n }\n `}\n >\n {header}\n </div>\n {error}\n </div>\n <div\n css={css`\n grid-area: main;\n display: grid;\n overflow: hidden;\n\n .components-drop-zone__provider {\n overflow: hidden;\n display: grid;\n }\n\n .components-drop-zone {\n z-index: 99;\n }\n `}\n >\n {mainContent}\n </div>\n <div\n css={css`\n display: none;\n grid-area: sidebar;\n padding: 0 16px;\n z-index: 75;\n background: #f3f3f3;\n border-left: 1px solid #ddd;\n overflow: auto;\n\n @media screen and (min-width: 780px) {\n display: block;\n }\n\n .sidebar-content {\n padding: 16px 0;\n }\n `}\n >\n {sidebar}\n </div>\n <div\n css={css`\n grid-area: footer;\n border-top: 1px solid #ddd;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n padding: 8px;\n `}\n >\n {footer}\n </div>\n </div>\n </Modal>\n );\n};\n","/** @jsx jsx */\n\n/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst { Button, DropZone, DropZoneProvider, Notice } = wp.components;\nconst { useState, useEffect, Fragment } = wp.element;\nconst { dispatch, useSelect } = wp.data;\n\nimport { css, jsx } from \"@emotion/core\";\n\nimport Sidebar from \"./Sidebar\";\nimport Videos from \"./video/Videos\";\nimport Collections from \"./collections/Collections\";\nimport Header from \"./Header\";\nimport Footer from \"./Footer\";\nimport CollectionHeader from \"./CollectionHeader\";\nimport Uploads from \"./upload/Uploads\";\n\nimport MediaPopupTemplate from \"@/admin/blocks/shared/media/MediaPopupTemplate\";\n\nexport default ({ onClose, onChoose }) => {\n const isPrivate = useSelect((select) =>\n select(\"presto-player/bunny-popup\").isPrivate()\n );\n const uploads = useSelect((select) =>\n select(\"presto-player/bunny-popup\").uploads()\n );\n const currentCollection = useSelect((select) =>\n select(\"presto-player/bunny-popup\").currentCollection()\n );\n const errors = useSelect((select) =>\n select(\"presto-player/bunny-popup\").errors()\n );\n\n useEffect(() => {\n dispatch(\"presto-player/bunny-popup\").setVideosFetched(false);\n dispatch(\"presto-player/bunny-popup\").setCollections([]);\n dispatch(\"presto-player/bunny-popup\").setVideos([]);\n }, []);\n\n const onCloseConfirm = () => {\n if (uploads.length) {\n const r = confirm(\"Discard your uploads?\");\n if (r) {\n onClose();\n dispatch(\"presto-player/bunny-popup\").setUploads([]);\n }\n return;\n }\n onClose();\n };\n\n const addUpload = (files) => {\n dispatch(\"presto-player/bunny-popup\").addUploads(files);\n };\n const removeUpload = (file) => {\n dispatch(\"presto-player/bunny-popup\").removeUpload(file);\n };\n\n /**\n * Modal Title\n *\n * @returns string\n */\n const title = isPrivate\n ? __(\"Private Stream Library\", \"presto-player\")\n : __(\"Public Stream Library\", \"presto-player\");\n\n /**\n * Main Content\n *\n * @returns JSX\n */\n const mainContent = () => {\n return (\n <DropZoneProvider\n css={css`\n overflow: auto;\n display: flex;\n flex-direction: column;\n `}\n >\n <div\n css={css`\n padding: 12px 24px;\n overflow: auto;\n display: flex;\n flex-direction: column;\n `}\n >\n {!!errors.length &&\n errors.map((error) => {\n return (\n <Notice\n css={css`\n margin: 0 0 20px 0;\n `}\n status=\"error\"\n onRemove={() =>\n dispatch(\"presto-player/bunny-popup\").removeError(error)\n }\n >\n {error}\n </Notice>\n );\n })}\n\n {/* Show back button or collections */}\n {!!currentCollection ? <CollectionHeader /> : <Collections />}\n\n <div\n css={css`\n display: flex;\n align-items: stretch;\n `}\n >\n <Videos />\n </div>\n\n <DropZone label={\"Drop files\"} onFilesDrop={addUpload} />\n </div>\n </DropZoneProvider>\n );\n };\n\n /**\n * Modal Header\n */\n const header = (\n <Header\n afterUpload={\n <Uploads\n uploads={uploads}\n removeUpload={removeUpload}\n isPrivate={isPrivate}\n />\n }\n />\n );\n\n const sidebar = <Sidebar />;\n\n /**\n * Modal Footer\n */\n const footer = <Footer onChoose={onChoose} />;\n\n return (\n <MediaPopupTemplate\n title={title}\n header={header}\n mainContent={mainContent()}\n onClose={onCloseConfirm}\n footer={footer}\n sidebar={sidebar}\n />\n );\n};\n","const { __ } = wp.i18n;\nconst { useEffect } = wp.element;\nconst { dispatch } = wp.data;\n\nimport \"./popup/stream/store/store\";\nimport StreamPopup from \"./popup/stream/Popup\";\n\nexport default ({ closePopup, onSelect, isPrivate }) => {\n const onChoose = (video) => {\n video.url = video.playlistURL;\n video.thumbnail = video.thumbnailURL;\n video.preview = video.webPURL;\n onSelect(video);\n };\n\n // set privacy option in store\n useEffect(() => {\n dispatch(\"presto-player/bunny-popup\").setIsPrivate(isPrivate);\n }, [isPrivate]);\n\n // render template\n return (\n <StreamPopup\n onClose={closePopup}\n onChoose={onChoose}\n header={\n isPrivate\n ? __(\"Private Stream Library\", \"presto-player\")\n : __(\"Public Stream Library\", \"presto-player\")\n }\n title={\n isPrivate\n ? __(\"Private Video Stream\", \"presto-player\")\n : __(\"Public Video Stream\", \"presto-player\")\n }\n />\n );\n};\n","const { __ } = wp.i18n;\nconst { useState } = wp.element;\nconst baseUrl = `${prestoPlayer.root}${prestoPlayer.prestoVersionString}bunny/`;\n\nexport default (onRefetch) => {\n const [apikey, setApikey] = useState(\"\");\n const [saveMessage, setSaveMessage] = useState(\"\");\n const [saving, setSaving] = useState(false);\n const [step, setStep] = useState(0);\n const [error, setError] = useState(\"\");\n\n const getError = (errorString) => {\n if (errorString.includes(\"Authorization has been denied\")) {\n return \"Your API key is incorrect. Please double-check to make sure you've copied it correctly.\";\n }\n if (errorString.includes(\"localhost\")) {\n return \"You cannot use a CDN on a local site. Please use Bunny.net on a live, publicly accessible site.\";\n }\n return errorString;\n };\n\n const saveKey = async () => {\n setError(\"\");\n\n try {\n setSaving(true);\n setStep(0);\n setSaveMessage(__(\"Validating API Key...\", \"presto-player\"));\n const { success } = await wp.apiFetch({\n url: `${baseUrl}api-key`,\n method: \"POST\",\n data: {\n api_key: apikey,\n },\n });\n\n if (!success) {\n throw {\n message:\n \"Could not save the API key. Please double check it to make sure it's correct.\",\n };\n }\n } catch (e) {\n setStep(0);\n setError(\n e?.message\n ? getError(e.message)\n : \"Something went wrong. Please try again\"\n );\n return;\n } finally {\n setStep(1);\n setSaving(false);\n setSaveMessage(\"\");\n }\n\n // create storage zone\n try {\n setSaving(true);\n setSaveMessage(\n __(\n \"Setting up storage zones. This make take a few minutes...\",\n \"presto-player\"\n )\n );\n const { id } = await wp.apiFetch({\n url: `${baseUrl}storage-zones`,\n method: \"POST\",\n });\n } catch (e) {\n setStep(0);\n setError(\n e?.message\n ? getError(e.message)\n : \"Something went wrong. Please try again\"\n );\n return;\n } finally {\n setStep(2);\n setSaving(false);\n setSaveMessage(\"\");\n }\n\n // create storage zone\n try {\n setSaving(true);\n setSaveMessage(\n __(\n \"Setting up pull zones. This make take a few minutes...\",\n \"presto-player\"\n )\n );\n const { id } = await wp.apiFetch({\n url: `${baseUrl}pull-zones`,\n method: \"POST\",\n });\n } catch (e) {\n setStep(0);\n setError(\n e?.message\n ? getError(e.message)\n : \"Something went wrong. Please try again\"\n );\n return;\n } finally {\n setStep(3);\n setSaving(false);\n setSaveMessage(\"\");\n }\n\n onRefetch();\n };\n\n const totalSteps = 3;\n\n return { saveKey, setApikey, step, saveMessage, saving, error, totalSteps };\n};\n","const { __ } = wp.i18n;\nconst { useState } = wp.element;\nconst baseUrl = `${prestoPlayer.root}${prestoPlayer.prestoVersionString}bunny/stream/`;\n\nexport default (onRefetch) => {\n const [apikey, setApikey] = useState(\"\");\n const [saveMessage, setSaveMessage] = useState(\"\");\n const [saving, setSaving] = useState(false);\n const [step, setStep] = useState(0);\n const [error, setError] = useState(\"\");\n\n const getError = (errorString) => {\n if (errorString.includes(\"Authorization has been denied\")) {\n return \"Your API key is incorrect. Please double-check to make sure you've copied it correctly.\";\n }\n if (errorString.includes(\"localhost\")) {\n return \"You cannot use a CDN on a local site. Please use Bunny.net on a live, publicly accessible site.\";\n }\n return errorString;\n };\n\n const saveKey = async () => {\n setError(\"\");\n\n try {\n setSaving(true);\n setStep(0);\n setSaveMessage(__(\"Validating API Key...\", \"presto-player\"));\n const { success } = await wp.apiFetch({\n url: `${baseUrl}api-key`,\n method: \"POST\",\n data: {\n api_key: apikey,\n },\n });\n\n if (!success) {\n throw {\n message:\n \"Could not save the API key. Please double check it to make sure it's correct.\",\n };\n }\n } catch (e) {\n setStep(0);\n setError(\n e?.message\n ? getError(e.message)\n : \"Something went wrong. Please try again\"\n );\n return;\n } finally {\n setStep(1);\n setSaving(false);\n setSaveMessage(\"\");\n }\n\n // public library\n try {\n setSaving(true);\n setSaveMessage(\n __(\n \"Setting up public video library. This make take a few moments...\",\n \"presto-player\"\n )\n );\n const { id } = await wp.apiFetch({\n url: `${baseUrl}library`,\n method: \"POST\",\n data: {\n type: \"public\",\n },\n });\n } catch (e) {\n setStep(0);\n setError(\n e?.message\n ? getError(e.message)\n : \"Something went wrong. Please try again\"\n );\n return;\n } finally {\n setStep(2);\n setSaving(false);\n setSaveMessage(\"\");\n }\n\n // private library\n try {\n setSaving(true);\n setSaveMessage(\n __(\n \"Setting up private video library. This make take a few moments...\",\n \"presto-player\"\n )\n );\n await wp.apiFetch({\n url: `${baseUrl}library`,\n method: \"POST\",\n data: {\n type: \"private\",\n },\n });\n } catch (e) {\n setStep(0);\n setError(\n e?.message\n ? getError(e.message)\n : \"Something went wrong. Please try again\"\n );\n return;\n } finally {\n setStep(2);\n setSaving(false);\n setSaveMessage(\"\");\n }\n\n onRefetch();\n };\n\n const totalSteps = 3;\n\n return { saveKey, setApikey, step, saveMessage, saving, error, totalSteps };\n};\n","const { __ } = wp.i18n;\n\nconst {\n Button,\n TextControl,\n Placeholder,\n Flex,\n FlexBlock,\n ExternalLink,\n Spinner,\n FlexItem,\n Notice,\n} = wp.components;\nconst { useEffect } = wp.element;\n\nimport useStorageConnection from \"./useStorageConnection\";\nimport useStreamConnection from \"./useStreamConnection\";\n\nexport default ({ onRefetch, type, autoSubmit }) => {\n const {\n saveKey,\n apikey,\n setApikey,\n saveMessage,\n saving,\n totalSteps,\n step,\n error,\n } =\n type === \"stream\"\n ? useStreamConnection(onRefetch)\n : useStorageConnection(onRefetch);\n\n useEffect(() => {\n if (autoSubmit) {\n saveKey();\n }\n }, [autoSubmit]);\n\n return (\n <Placeholder\n label={__(\"Bunny.net Video\", \"presto-player\")}\n instructions={\n <>\n {__(\n \"Enter your Bunny.net API key, which can be found on your Bunny CDN Account page.\",\n \"presto-player\"\n )}\n \n <ExternalLink href=\"https://bunnycdn.com/dashboard/account\">\n {__(\"Get My API Key\", \"presto-player\")}\n </ExternalLink>\n </>\n }\n >\n {saving ? (\n <Flex>\n <FlexItem>\n <Spinner />\n </FlexItem>\n <FlexBlock>\n {saveMessage}\n <progress\n className=\"presto-progress\"\n max={totalSteps}\n value={step}\n style={{ width: \"100%\" }}\n ></progress>\n </FlexBlock>\n </Flex>\n ) : (\n <form\n onSubmit={(e) => {\n e.preventDefault();\n saveKey();\n }}\n >\n {error && (\n <Flex style={{ width: \"100%\" }}>\n <FlexBlock>\n <Notice status=\"error\" isDismissible={false}>\n {error}\n </Notice>\n </FlexBlock>\n </Flex>\n )}\n <Flex style={{ width: \"100%\", maxWidth: \"400px\" }}>\n <FlexBlock>\n <TextControl\n value={apikey}\n onChange={(apikey) => setApikey(apikey)}\n className={\"presto-link-placeholder-input\"}\n type=\"password\"\n autoComplete=\"off\"\n placeholder={__(\"Your Bunny.net API Key\", \"presto-player\")}\n required\n />\n </FlexBlock>\n <FlexItem>\n <Button isPrimary style={{ marginBottom: \"8px\" }} type=\"submit\">\n {__(\"Next\", \"presto-player\")} →\n </Button>\n </FlexItem>\n </Flex>\n </form>\n )}\n </Placeholder>\n );\n};\n","/**\n * WordPress dependencies\n */\nconst {\n Button,\n Disabled,\n DropdownMenu,\n Spinner,\n Toolbar,\n withNotices,\n BaseControl,\n Placeholder,\n ToggleControl,\n} = wp.components;\nconst { BlockControls, InspectorControls } = wp.editor;\nconst { __ } = wp.i18n;\nconst { compose } = wp.compose;\nconst { useEffect, useState, Fragment } = wp.element;\nconst { dispatch } = wp.data;\n\nimport { signURL } from \"../../shared/services/bunny\";\n\n// hocs\nimport withPlayerEdit from \"../with-player-edit\";\nimport withPlayerData from \"../with-player-data\";\n\n/**\n * Internal dependencies\n */\nimport TracksEditor from \"@/admin/blocks/shared/tracks/TracksEditor\";\nimport StorageMedia from \"./StorageMedia\";\nimport StreamMedia from \"./StreamMedia\";\nimport APIPlaceholder from \"./APIPlaceholder\";\nimport BlockInspectorControls from \"@/admin/blocks/shared/BlockInspectorControls\";\nimport Player from \"@/admin/blocks/shared/Player\";\n\nexport default compose([withPlayerData(), withPlayerEdit()])(\n withNotices(\n ({\n attributes,\n setAttributes,\n noticeOperations,\n branding,\n isSelected,\n presetData,\n createVideo,\n lockSave,\n unlockSave,\n onRemoveSrc,\n renderKey,\n defaultPreset,\n }) => {\n const {\n poster,\n src,\n id,\n tracks,\n visibility,\n previewSrc,\n thumbnail,\n } = attributes;\n\n const [mediaPopup, setMediaPopup] = useState(\"\");\n const [loading, setLoading] = useState(false);\n\n // What setup screen should we show\n const [setup, setSetup] = useState(\"\");\n const [isSetup, setIsSetup] = useState({\n stream: false,\n storage: false,\n });\n const [disableStream, setDisableStream] = useState(false);\n\n // setup and api\n const [isAPILoaded, setIsAPILoaded] = useState(false);\n const [fetchingSettings, setFetchingSettings] = useState(false);\n const [autoSubmitStream, setAutoSubmitStream] = useState(false);\n\n const userCanReadSettings = wp.data.useSelect((select) =>\n select(\"core\").canUser(\"read\", \"settings\")\n );\n\n // is this private\n const isPrivate = visibility === \"private\";\n\n // is legacy storage disabled\n const disableLegacyStorage =\n prestoPlayerAdmin?.bunny?.disable_legacy_storage;\n\n // set privacy option in store\n useEffect(() => {\n dispatch(\"presto-player/bunny-popup\").setIsPrivate(\n visibility === \"private\"\n );\n }, [visibility]);\n\n useEffect(() => {\n setIsSetup({\n storage: prestoPlayerAdmin?.isSetup?.bunny?.storage,\n stream: prestoPlayerAdmin?.isSetup?.bunny?.stream,\n });\n }, []);\n\n function selectVideo(media, ...args) {\n if (!media.url) {\n // in this case there was an error\n // previous attributes should be removed\n // because they may be temporary blob urls\n setAttributes({ src: undefined, id: undefined });\n return;\n }\n\n // set preset attributes\n setAttributes({\n src: media.url,\n preset: defaultPreset?.id,\n ...(media?.thumbnail ? { thumbnail: media.thumbnail } : {}),\n ...(media?.preview ? { preview: media.preview } : {}),\n });\n\n // create video\n setLoading(true);\n lockSave();\n createVideo({\n src: media.url,\n type: \"bunny\",\n title: media.title,\n ...(media?.guid ? { external_id: media.guid } : {}),\n })\n .catch((e) => {\n setAttributes({ src: \"\" });\n console.error(e);\n })\n .finally(() => {\n unlockSave();\n setLoading(false);\n });\n }\n\n // fetch settings\n const fetchSettings = async () => {\n try {\n const {\n presto_player_bunny_pull_zones,\n presto_player_bunny_storage_zones,\n presto_player_bunny_stream_private,\n presto_player_bunny_stream_public,\n } = await wp.apiFetch({\n path: `wp/v2/settings`,\n });\n setIsAPILoaded(true);\n\n if (!presto_player_bunny_stream_private) {\n setDisableStream(true);\n }\n\n // is this set up?\n const isSetup = (option) => {\n return !!(option?.private_id && option?.public_id);\n };\n\n const storageSetup =\n isSetup(presto_player_bunny_pull_zones) ||\n isSetup(presto_player_bunny_storage_zones);\n const streamSetup =\n presto_player_bunny_stream_private?.pull_zone_url &&\n presto_player_bunny_stream_public?.pull_zone_url;\n\n setIsSetup({\n storage: storageSetup,\n stream: streamSetup,\n });\n\n if (!storageSetup && !streamSetup) {\n setSetup(\"stream\");\n } else {\n setSetup(\"\");\n }\n } finally {\n setFetchingSettings(false);\n }\n };\n\n // mounted\n useEffect(() => {\n if (userCanReadSettings) {\n fetchSettings();\n } else {\n setIsAPILoaded(true);\n }\n }, [userCanReadSettings]);\n\n const setPreview = async () => {\n if (isPrivate) {\n let previewSrc = await signURL(src);\n setAttributes({ previewSrc });\n } else {\n setAttributes({ previewSrc: src });\n }\n };\n useEffect(() => {\n setPreview();\n }, [src]);\n\n const setThumbnail = async () => {\n if (isPrivate) {\n let previewThumbnail = await signURL(thumbnail);\n if (previewThumbnail) {\n setAttributes({ previewThumbnail });\n }\n } else {\n setAttributes({ previewThumbnail: thumbnail });\n }\n };\n useEffect(() => {\n setThumbnail();\n }, [thumbnail]);\n\n const placeholderButtons = () => {\n return (\n <Fragment>\n {isSetup.stream && (\n <Button isPrimary onClick={() => setMediaPopup(\"stream\")}>\n {isPrivate\n ? __(\"Add/Select Private Video Stream\", \"presto-player\")\n : __(\"Add/Select Video Stream\", \"presto-player\")}\n </Button>\n )}\n\n {!disableLegacyStorage && isSetup.storage && (\n <Button\n isSecondary={isSetup.stream}\n isPrimary={!isSetup.stream}\n onClick={() => setMediaPopup(\"storage\")}\n >\n {isPrivate\n ? __(\"Add/Select Private Video (Classic)\", \"presto-player\")\n : __(\"Add/Select Video (Classic)\", \"presto-player\")}\n </Button>\n )}\n\n {!isSetup.stream && !disableStream && isSetup.storage && (\n <Button\n isSecondary\n onClick={() => {\n setAutoSubmitStream(true);\n setSetup(\"stream\");\n }}\n >\n {__(\"Enable Bunny.net Stream!\", \"presto-player\")}\n </Button>\n )}\n\n {!!userCanReadSettings && moreButtons()}\n </Fragment>\n );\n };\n\n const moreButtons = () => {\n const controls = [];\n !disableStream &&\n controls.push({\n title: isSetup.stream\n ? __(\"Reconnect Stream\", \"presto-player\")\n : __(\"Connect Stream\", \"presto-player\"),\n onClick: () => {\n setSetup(\"stream\");\n setAutoSubmitStream(false);\n },\n });\n\n !disableLegacyStorage &&\n controls.push({\n title: isSetup.storage\n ? __(\"Reconnect Storage (Classic)\", \"presto-player\")\n : __(\"Connect Storage (Classic)\", \"presto-player\"),\n onClick: () => setSetup(\"storage\"),\n });\n\n return (\n <DropdownMenu\n icon=\"ellipsis\"\n label={__(\"Connection Options\", \"presto-player\")}\n controls={controls}\n />\n );\n };\n\n if (loading || !isAPILoaded) {\n return (\n <Placeholder className=\"presto-player__placeholder is-loading\">\n <Spinner />\n </Placeholder>\n );\n }\n\n if (setup === \"stream\") {\n return (\n <APIPlaceholder\n type=\"stream\"\n autoSubmit={autoSubmitStream}\n onRefetch={() => {\n setIsAPILoaded(false);\n fetchSettings();\n }}\n />\n );\n }\n\n if (setup === \"storage\") {\n return (\n <APIPlaceholder\n type=\"storage\"\n onRefetch={() => {\n setIsAPILoaded(false);\n fetchSettings();\n }}\n />\n );\n }\n\n if (!id) {\n return (\n <div>\n <Placeholder\n label={\n isPrivate\n ? __(\"Bunny.net Private Video\", \"presto-player\")\n : __(\"Bunny.net Video\", \"presto-player\")\n }\n icon={\n isPrivate ? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"presto-block-icon\"\n >\n <path d=\"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z\"></path>\n </svg>\n ) : (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"presto-block-icon\"\n >\n <polyline points=\"8 17 12 21 16 17\"></polyline>\n <line x1=\"12\" y1=\"12\" x2=\"12\" y2=\"21\"></line>\n <path d=\"M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29\"></path>\n </svg>\n )\n }\n instructions={\n <>{__(\"Add or select a Bunny.net video\", \"presto-player\")}</>\n }\n >\n <BaseControl className=\"presto-player__placeholder-control\">\n <ToggleControl\n label=\"Private Video\"\n help={\n isPrivate\n ? \"Video is only accessible to those who are logged in.\"\n : \"Video is accessible to everyone.\"\n }\n checked={isPrivate}\n onChange={(isPrivate) => {\n setAttributes({\n visibility: isPrivate ? \"private\" : \"public\",\n });\n }}\n />\n </BaseControl>\n {placeholderButtons()}\n </Placeholder>\n\n {mediaPopup === \"storage\" && (\n <StorageMedia\n isPrivate={isPrivate}\n closePopup={() => setMediaPopup(\"\")}\n noticeOperations={noticeOperations}\n onSelect={selectVideo}\n />\n )}\n\n {mediaPopup === \"stream\" && (\n <StreamMedia\n isPrivate={isPrivate}\n closePopup={() => setMediaPopup(\"\")}\n noticeOperations={noticeOperations}\n onSelect={selectVideo}\n />\n )}\n </div>\n );\n }\n\n return (\n <>\n <BlockControls>\n <TracksEditor\n tracks={tracks}\n onChange={(newTracks) => {\n setAttributes({ tracks: newTracks });\n }}\n />\n <Toolbar>\n <Button onClick={() => onRemoveSrc()}>\n {__(\"Replace\", \"presto-player\")}\n </Button>\n </Toolbar>\n </BlockControls>\n\n <InspectorControls>\n <BlockInspectorControls\n setAttributes={setAttributes}\n attributes={attributes}\n />\n </InspectorControls>\n\n <figure className=\"wp-block-video\">\n {/*\n Disable the video tag so the user clicking on it won't play the\n video when the controls are enabled.\n */}\n <Disabled>\n <Player\n poster={poster}\n src={previewSrc}\n id={id}\n type={\"bunny\"}\n attributes={attributes}\n setAttributes={setAttributes}\n preset={presetData}\n branding={branding}\n key={renderKey}\n />\n </Disabled>\n </figure>\n </>\n );\n }\n )\n);\n","const { __ } = wp.i18n;\nimport edit from \"./edit\";\nimport blockOptions from \"../block-options\";\n\n/**\n * Block Name\n */\nexport const name = \"presto-player/bunny\";\n\n/**\n * Block Options\n */\nexport const options = {\n ...blockOptions,\n\n attributes: {\n ...blockOptions.attributes,\n ...{\n thumbnail: {\n type: String,\n default: \"\",\n },\n preview: {\n type: String,\n default: \"\",\n },\n },\n },\n\n premium: true,\n\n title: __(\"Presto Bunny.net Video\", \"presto-player\"),\n\n description: __(\"Serve video through Bunny.net CDN.\", \"presto-player\"),\n\n variations: [\n {\n name: \"public\",\n isDefault: true,\n title: __(\"Presto Bunny.net Video\", \"presto-player\"),\n description: __(\n \"Serve public video through Bunny.net CDN.\",\n \"presto-player\"\n ),\n attributes: { visibility: \"public\" },\n },\n {\n name: \"private\",\n title: __(\"Presto Bunny.net Private Video\", \"presto-player\"),\n icon: (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"presto-block-icon\"\n >\n <path d=\"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z\"></path>\n </svg>\n ),\n description: __(\n \"Serve private, secure video through Bunny.net CDN.\",\n \"presto-player\"\n ),\n attributes: { visibility: \"private\" },\n },\n ],\n\n icon: (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"presto-block-icon\"\n >\n <polyline points=\"8 17 12 21 16 17\"></polyline>\n <line x1=\"12\" y1=\"12\" x2=\"12\" y2=\"21\"></line>\n <path d=\"M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29\"></path>\n </svg>\n ),\n\n edit,\n};\n","/**\n * External dependencies\n */\n\nimport classnames from \"classnames\";\nconst baseCurrentUrl = window.location.href;\nimport helpers from \"./helpers\";\n\n/**\n * WordPress dependencies\n */\nimport { Button, Placeholder, withFilters } from \"@wordpress/components\";\nimport { __ } from \"@wordpress/i18n\";\nimport { useState, useEffect } from \"@wordpress/element\";\nimport { useSelect } from \"@wordpress/data\";\nimport {\n MediaUpload,\n MediaUploadCheck,\n URLPopover,\n} from \"@wordpress/block-editor\";\n\nconst InsertFromURLPopover = ({ src, onChange, onSubmit, onClose }) => (\n <URLPopover onClose={onClose}>\n <form\n className=\"block-editor-media-placeholder__url-input-form\"\n onSubmit={onSubmit}\n >\n <input\n data-cy=\"url-input\"\n className=\"block-editor-media-placeholder__url-input-field\"\n type=\"url\"\n aria-label={__(\"URL\", \"presto-player\")}\n placeholder={__(\"Paste an mp3 URL\", \"presto-player\")}\n onChange={onChange}\n value={src}\n />\n <Button\n data-cy=\"url-submit\"\n className=\"block-editor-media-placeholder__url-input-submit-button\"\n icon={\"editor-break\"}\n label={__(\"Apply\", \"presto-player\")}\n type=\"submit\"\n />\n </form>\n </URLPopover>\n);\n\nexport function MediaPlaceholder({\n value = {},\n allowedTypes = [],\n className,\n icon,\n url = true,\n labels = {},\n mediaPreview,\n notices,\n isAppender,\n isPrivate,\n addToGallery,\n onSelect,\n onCancel,\n onSelectURL,\n onDoubleClick,\n children,\n allowURLs,\n}) {\n const mediaUpload = useSelect((select) => {\n const { getSettings } = select(\"core/block-editor\");\n return getSettings().mediaUpload;\n }, []);\n\n const [src, setSrc] = useState(\"\");\n const [isURLInputVisible, setIsURLInputVisible] = useState(false);\n\n useEffect(() => {\n setSrc(value?.src ?? \"\");\n }, [value]);\n\n const onChangeSrc = (event) => {\n setSrc(event.target.value);\n };\n\n const openURLInput = () => {\n setIsURLInputVisible(true);\n };\n\n const closeURLInput = () => {\n setIsURLInputVisible(false);\n };\n\n const onSubmitSrc = (event) => {\n event.preventDefault();\n if (src && onSelectURL) {\n onSelectURL(src);\n closeURLInput();\n }\n };\n\n const renderPlaceholder = (content, onClick) => {\n let { instructions, title } = labels;\n\n if (!mediaUpload && !onSelectURL) {\n instructions = __(\n \"To edit this block, you need permission to upload media.\",\n \"presto-player\"\n );\n }\n\n // set class names\n const placeholderClassName = classnames(\n \"block-editor-media-placeholder\",\n className,\n {\n \"is-appender\": isAppender,\n }\n );\n\n return (\n <Placeholder\n icon={icon}\n label={title}\n instructions={instructions}\n className={placeholderClassName}\n notices={notices}\n onClick={onClick}\n onDoubleClick={onDoubleClick}\n preview={mediaPreview}\n >\n {children}\n {content}\n </Placeholder>\n );\n };\n\n const renderCancelLink = () => {\n return (\n onCancel && (\n <Button\n className=\"block-editor-media-placeholder__cancel-button\"\n title={__(\"Cancel\", \"presto-player\")}\n isLink\n onClick={onCancel}\n >\n {__(\"Cancel\", \"presto-player\")}\n </Button>\n )\n );\n };\n\n const renderUrlSelectionUI = () => {\n return (\n onSelectURL && (\n <div className=\"block-editor-media-placeholder__url-input-container\">\n {url && isPrivate === false && (\n <Button\n className=\"block-editor-media-placeholder__button\"\n onClick={openURLInput}\n isPressed={isURLInputVisible}\n isTertiary\n >\n {__(\"Audio URL\", \"presto-player\")}\n </Button>\n )}\n {isURLInputVisible && (\n <InsertFromURLPopover\n src={src}\n onChange={onChangeSrc}\n onSubmit={onSubmitSrc}\n onClose={closeURLInput}\n />\n )}\n </div>\n )\n );\n };\n\n const renderMediaUploadChecked = () => {\n const mediaLibraryButton = (\n <MediaUpload\n title={\n isPrivate\n ? __(\"Select or Upload Private Audio\", \"presto-player\")\n : __(\"Select or Upload Audio\", \"presto-player\")\n }\n addToGallery={addToGallery}\n gallery={false}\n multiple={false}\n onSelect={(event) => {\n // set private/public url params\n helpers.unsetUrlParams();\n onSelect(event);\n }}\n onClose={() => {\n // unset private/public url params\n helpers.unsetUrlParams();\n }}\n allowedTypes={allowedTypes}\n value={Array.isArray(value) ? value.map(({ id }) => id) : value.id}\n render={({ open }) => {\n return (\n <Button\n isPrimary\n onClick={(event) => {\n event.stopPropagation();\n helpers.unsetUrlParams();\n if (isPrivate) {\n helpers.setUrlPrivate(baseCurrentUrl);\n } else {\n helpers.setUrlPublic(baseCurrentUrl);\n }\n open();\n }}\n >\n {isPrivate\n ? __(\"Add/Select Private Audio\", \"presto-player\")\n : __(\"Add/Select Audio\", \"presto-player\")}\n </Button>\n );\n }}\n />\n );\n\n if (mediaUpload) {\n const content = (\n <>\n {mediaLibraryButton}\n {!!allowURLs && renderUrlSelectionUI()}\n {renderCancelLink()}\n </>\n );\n return renderPlaceholder(content);\n }\n\n return renderPlaceholder(mediaLibraryButton);\n };\n\n return (\n <MediaUploadCheck fallback={renderPlaceholder(renderUrlSelectionUI())}>\n {renderMediaUploadChecked()}\n </MediaUploadCheck>\n );\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/media-placeholder/README.md\n */\nexport default withFilters(\"editor.MediaPlaceholder\")(MediaPlaceholder);\n","import MediaPlaceholder from \"@/admin/blocks/shared/audio-placeholder\";\nconst { __ } = wp.i18n;\nconst { withNotices, BaseControl, ToggleControl, Notice } = wp.components;\nimport ProBadge from \"@/admin/blocks/shared/components/ProBadge\";\n\nconst ALLOWED_MEDIA_TYPES = [\"audio\"];\n\nexport default ({\n attributes,\n setAttributes,\n onSelectURL,\n onSelect,\n children,\n}) => {\n const { visibility } = attributes;\n const isPrivate = visibility === \"private\";\n\n return (\n <MediaPlaceholder\n icon={\n isPrivate ? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"presto-block-icon\"\n >\n <rect x=\"3\" y=\"11\" width=\"18\" height=\"11\" rx=\"2\" ry=\"2\"></rect>\n <path d=\"M7 11V7a5 5 0 0 1 10 0v4\"></path>\n </svg>\n ) : (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n className=\"presto-block-icon\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3\"\n />\n </svg>\n )\n }\n labels={{\n title: __(\"Presto Audio\", \"presto-player\"),\n instructions: __(\n \"Upload a audio file, or pick one from your media library.\",\n \"presto-player\"\n ),\n }}\n accept=\"audio/*\"\n setAttributes={setAttributes}\n allowedTypes={ALLOWED_MEDIA_TYPES}\n switcher={true}\n isPrivate={isPrivate}\n allowURLs={!isPrivate}\n onSelectURL={onSelectURL}\n onSelect={onSelect}\n value={attributes}\n allowURLs={true}\n onError={() => console.log(\"error\")}\n >\n <div style={{ width: \"100%\" }}>\n <BaseControl className=\"presto-player__placeholder-control\">\n <ToggleControl\n label={\n <div>\n {__(\"Make Private\", \"presto-player\")}{\" \"}\n {!prestoPlayer?.isPremium && <ProBadge />}\n </div>\n }\n help={\n isPrivate\n ? __(\n \"This audio is only accessible to those who are logged in.\",\n \"presto-player\"\n )\n : __(\n \"This audio is currently accessible to everyone.\",\n \"presto-player\"\n )\n }\n checked={isPrivate}\n onChange={(isPrivate) => {\n if (!prestoPlayer?.isPremium) {\n dispatch(\"presto-player/player\").setProModal(true);\n return;\n }\n setAttributes({\n visibility: isPrivate ? \"private\" : \"public\",\n });\n }}\n />\n </BaseControl>\n\n {!!children && <div style={{ width: \"100%\" }}>{children}</div>}\n\n {!!isPrivate && (\n <Notice status=\"warning\" isDismissible={false}>\n <div>\n <div>\n <strong>{__(\"Note\", \"presto-player\")}</strong>\n </div>\n {__(\n \"Private audio uses php to stream your audio. Keep in mind this will use up disk space and bandwidth so it may not be an appropriate choice for some hosts.\",\n \"presto-player\"\n )}\n </div>\n </Notice>\n )}\n </div>\n </MediaPlaceholder>\n );\n};\n","import { __ } from \"@wordpress/i18n\";\nimport { Disabled } from \"@wordpress/components\";\nimport { PrestoCtaOverlayUi, PrestoEmailOverlayUi } from \"@presto-player/react\";\nimport { timeToSeconds } from \"../../util\";\nimport Player from \"../Player\";\nimport { useEffect, useState } from \"@wordpress/element\";\n\nexport default ({\n state,\n branding,\n menu,\n src,\n poster,\n currentTime,\n preload,\n mediaTitle,\n overlays,\n isDisabled = true,\n}) => {\n const [renderKey, setRenderKey] = useState(1);\n const { email_collection, cta } = state;\n\n useEffect(() => {\n setRenderKey(renderKey + 1);\n }, [\n state.skin,\n state[\"play-large\"],\n state.rewind,\n state.play,\n state[\"fast-forward\"],\n state.progress,\n state[\"current-time\"],\n state.mute,\n state.volume,\n state.speed,\n state.pip,\n state.fullscreen,\n state.captions,\n state.hide_logo,\n ]);\n\n const previews = {\n email: !!email_collection?.enabled && (\n <PrestoEmailOverlayUi\n className=\"email-overlay\"\n slot=\"player-end\"\n headline={email_collection?.headline}\n style={{\n \"--presto-player-email-border-radiuss\": `${email_collection?.button_radius}px`,\n \"--plyr-color-main\": state?.background_color || branding?.color,\n ...(email_collection.button_color\n ? {\n \"--presto-player-button-color\": `${email_collection.button_color}`,\n }\n : {}),\n ...(email_collection.button_text_color\n ? {\n \"--presto-player-button-text\": `${email_collection.button_text_color}`,\n }\n : {}),\n }}\n defaultHeadline={__(\"Enter your email to play.\", \"presto-player\")}\n bottomText={email_collection?.bottom_text}\n allowSkip={email_collection?.allow_skip}\n skipText={__(\"Skip\", \"presto-player\")}\n buttonText={email_collection?.button_text}\n placeholder={__(\"Email address\", \"presto-player\")}\n i18n={window.prestoPlayer.i18n}\n type={\"audio\"}\n />\n ),\n cta: !!cta?.enabled && (\n <PrestoCtaOverlayUi\n className=\"cta-overlay\"\n style={{\n \"--presto-player-button-border-radius\": `${cta.button_radius}px`,\n ...(cta?.background_opacity\n ? {\n \"--presto-player-cta-background-opacity\": `${\n cta?.background_opacity / 100\n }`,\n }\n : {}),\n ...(cta.button_color\n ? {\n \"--presto-player-button-color\": `${cta.button_color}`,\n }\n : {}),\n ...(cta.button_text_color\n ? {\n \"--presto-player-button-text\": `${cta.button_text_color}`,\n }\n : {}),\n }}\n slot=\"player-end\"\n headline={cta?.headline}\n bottom-text={cta?.bottom_text}\n button-link={cta?.button_link}\n allow-skip={cta?.percentage !== 100 && cta?.show_skip}\n borderRadius={cta?.border_radius}\n allow-rewatch={cta?.percentage === 100 && cta?.show_rewatch}\n skip-text={__(\"Skip\", \"presto-player\")}\n show-button={cta?.show_button}\n button-text={cta?.button_text}\n i18n={window.prestoPlayer.i18n}\n type={\"audio\"}\n />\n ),\n };\n\n return (\n <Disabled isDisabled={isDisabled} className=\"disable-player\">\n <div className=\"presto-player__wrapper\">\n <Player\n src={src || \"http://something.mp3\"}\n classes={`\n ${menu === \"cta\" && !!cta?.enabled && \"cta-active\"} \n ${\n menu === \"email\" && !!email_collection?.enabled && \"email-active\"\n }`}\n preset={state}\n branding={branding}\n i18n={prestoPlayerAdmin?.i18n}\n preload={preload}\n attributes={{\n chapters: [],\n poster: poster,\n title: mediaTitle,\n }}\n type={\"audio\"}\n currentTime={currentTime ? timeToSeconds(currentTime) : \"\"}\n overlays={overlays}\n key={renderKey}\n adminPreview={previews?.[menu] || \"\"}\n />\n </div>\n </Disabled>\n );\n};\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst {\n ToggleControl,\n BaseControl,\n HorizontalRule,\n __experimentalAlignmentMatrixControl: AlignmentMatrixControl,\n SelectControl,\n} = wp.components;\n\nexport default function ({ state, updateState, className }) {\n return (\n <div className={className}>\n <BaseControl>\n <h3>{__(\"Behavior\", \"presto-player\")}</h3>\n </BaseControl>\n <BaseControl>\n <ToggleControl\n label={__(\"Save Play Position\", \"presto-player\")}\n help={__(\n \"Saves the user's play position so when they come back to the page they can continue the audio from where they left off.\",\n \"presto-player\"\n )}\n onChange={(save_player_position) => {\n updateState({ save_player_position });\n }}\n checked={state.save_player_position}\n />\n </BaseControl>\n <BaseControl>\n <ToggleControl\n label={__(\"Focus Mode\", \"presto-player\")}\n help={__(\n \"Play only when tab is visible and audio is in viewport.\",\n \"presto-player\"\n )}\n onChange={(play_video_viewport) => {\n updateState({ play_video_viewport });\n }}\n checked={state.play_video_viewport}\n />\n </BaseControl>\n\n <BaseControl>\n <ToggleControl\n label={__(\"Sticky On Scroll\", \"presto-player\")}\n help={__(\n \"Stick audios to the side of the screen when the page is scrolled and the audio is playing.\",\n \"presto-player\"\n )}\n onChange={(sticky_scroll) => {\n updateState({ sticky_scroll });\n }}\n checked={state.sticky_scroll}\n />\n </BaseControl>\n\n <BaseControl>\n <SelectControl\n label={__(\"On Audio End\", \"presto-player\")}\n value={state.on_video_end}\n options={[\n {\n value: \"select\",\n label: __(\"Select\", \"presto-player\"),\n },\n {\n value: \"loop\",\n label: __(\"Loop\", \"presto-player\"),\n },\n {\n value: \"go-to-start\",\n label: __(\"Go to start\", \"presto-player\"),\n },\n ]}\n onChange={(on_video_end) => {\n updateState({ on_video_end });\n }}\n />\n </BaseControl>\n </div>\n );\n}\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst { ToggleControl, BaseControl } = wp.components;\n\nexport default function ({ state, updateState, className }) {\n return (\n <div className={className}>\n <BaseControl>\n <h3>{__(\"Controls\", \"presto-player\")}</h3>\n </BaseControl>\n <BaseControl className=\"presto-player__control--large-play\">\n <ToggleControl\n label={__(\"Large Play Button\", \"presto-player\")}\n help={__(\n \"Adds a large play button over the top of the player.\",\n \"presto-player\"\n )}\n onChange={(play) => {\n updateState({ \"play-large\": play });\n }}\n checked={state[\"play-large\"]}\n />\n </BaseControl>\n <BaseControl className=\"presto-player__control--rewind\">\n <ToggleControl\n label={__(\"Rewind\", \"presto-player\")}\n help={__(\n \"Adds a 10 second rewind button to the player.\",\n \"presto-player\"\n )}\n onChange={(rewind) => {\n updateState({ rewind });\n }}\n checked={state.rewind}\n />\n </BaseControl>\n <BaseControl className=\"presto-player__control--play\">\n <ToggleControl\n label={__(\"Small Play Button\", \"presto-player\")}\n help={__(\n \"Adds a small play button to the bottom of the player.\",\n \"presto-player\"\n )}\n onChange={(play) => {\n updateState({ play });\n }}\n checked={state.play}\n />\n </BaseControl>\n <BaseControl className=\"presto-player__control--fast-forward\">\n <ToggleControl\n label={__(\"Fast Forward\", \"presto-player\")}\n help={__(\n \"Adds a 10 second rewind button to the player.\",\n \"presto-player\"\n )}\n onChange={(value) => {\n updateState({ \"fast-forward\": value });\n }}\n checked={state[\"fast-forward\"]}\n />\n </BaseControl>\n <BaseControl className=\"presto-player__control--progress\">\n <ToggleControl\n label={__(\"Progress Bar\", \"presto-player\")}\n help={__(\"Shows a seekable progress bar.\", \"presto-player\")}\n onChange={(progress) => {\n updateState({ progress });\n }}\n checked={state.progress}\n />\n </BaseControl>\n <BaseControl className=\"presto-player__control--current-time\">\n <ToggleControl\n label={__(\"Current Time\", \"presto-player\")}\n help={__(\"Shows the audio timestamp.\", \"presto-player\")}\n onChange={(value) => {\n updateState({ \"current-time\": value });\n }}\n checked={state[\"current-time\"]}\n />\n </BaseControl>\n <BaseControl className=\"presto-player__control--volume\">\n <ToggleControl\n label={__(\"Volume\", \"presto-player\")}\n help={__(\"Shows a volume bar.\", \"presto-player\")}\n onChange={(value) => {\n updateState({ volume: value, mute: value });\n }}\n checked={state.volume}\n />\n </BaseControl>\n <BaseControl className=\"presto-player__control--speed\">\n <ToggleControl\n label={__(\"Speed\", \"presto-player\")}\n help={__(\"Shows playback speed controls.\", \"presto-player\")}\n onChange={(speed) => {\n updateState({ speed });\n }}\n checked={state.speed}\n />\n </BaseControl>\n </div>\n );\n}\n","/**\n * WordPress dependencies\n */\nimport { __ } from \"@wordpress/i18n\";\nimport {\n ToggleControl,\n BaseControl,\n RangeControl,\n Flex,\n} from \"@wordpress/components\";\nimport ColorPopup from \"../components/ColorPopup\";\n\nexport default function ({ state, updateState, className }) {\n return (\n <div className={className}>\n <BaseControl>\n <h3>{__(\"Style\", \"presto-player\")}</h3>\n </BaseControl>\n <BaseControl>\n <RangeControl\n label={__(\"Round Corners\", \"presto-player\")}\n help={__(\"Player border radius size.\", \"presto-player\")}\n value={state?.border_radius || 0}\n onChange={(border_radius) => updateState({ border_radius })}\n min={0}\n max={25}\n />\n </BaseControl>\n\n <BaseControl>\n <Flex>\n <BaseControl.VisualLabel>\n <p>{__(\"Background Color\", \"presto-player\")}</p>\n </BaseControl.VisualLabel>\n\n <ColorPopup\n color={state?.background_color || \"#000000\"}\n setColor={(value) => {\n updateState({ background_color: value.hex });\n }}\n />\n </Flex>\n </BaseControl>\n <BaseControl>\n <Flex>\n <BaseControl.VisualLabel>\n <p>{__(\"Control Color\", \"presto-player\")}</p>\n </BaseControl.VisualLabel>\n\n <ColorPopup\n color={state?.control_color || \"#000000\"}\n setColor={(value) => {\n updateState({ control_color: value.hex });\n }}\n />\n </Flex>\n </BaseControl>\n </div>\n );\n}\n","/** @jsx jsx */\n/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst {\n TextControl,\n BaseControl,\n Icon,\n Notice,\n Button,\n Flex,\n FlexItem,\n SelectControl,\n FlexBlock,\n Modal,\n} = wp.components;\nconst { useState, useEffect } = wp.element;\nconst { useSelect, dispatch } = wp.data;\n\nimport { snackbarNotice } from \"@/admin/blocks/util\";\nimport Menu from \"@/admin/ui/Menu\";\nimport { css, jsx } from \"@emotion/core\";\nimport Preview from \"./Preview\";\nimport Behavior from \"./Behavior\";\nimport Controls from \"./Controls\";\nimport Style from \"./Style\";\nimport ActionBar from \"../presets/ActionBar\";\nimport CTA from \"../presets/CTA\";\nimport Email from \"../presets/Email\";\n\nfunction EditPlayerPreset({\n type = \"new\",\n closeModal,\n addPreset,\n onSave,\n updatePreset,\n name = \"\",\n attributes,\n preset = {\n \"play-large\": true,\n rewind: true,\n play: true,\n \"fast-forward\": true,\n progress: true,\n \"current-time\": true,\n mute: true,\n volume: true,\n speed: false,\n pip: false,\n // behavior\n save_player_position: false,\n reset_on_end: false,\n sticky_scroll: false,\n // style\n hide_logo: false,\n border_radius: 0,\n skin: \"default\",\n background_color: \"\",\n control_color: \"\",\n\n // features\n cta: {},\n email_collection: {},\n action_bar: {},\n },\n}) {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState(\"\");\n const [menu, setMenu] = useState(\"\");\n const [thisName, setThisName] = useState(name);\n const [state, setState] = useState(preset);\n const branding = useSelect((select) => {\n return select(\"presto-player/player\").branding();\n });\n\n const [value, setValue] = useState(\"\");\n\n const genericError = {\n message: __(\n \"The preset could not be saved. Please reload the page and try again.\",\n \"presto-player\"\n ),\n };\n\n //you tube feature\n const youtube = useSelect((select) => {\n return select(\"presto-player/player\").youtube();\n });\n\n useEffect(() => {\n setValue(youtube.channel_id);\n }, [youtube?.channel_id]);\n\n // update state\n const updateState = (updated = {}) => {\n setState({ ...state, ...updated });\n };\n\n const putPreset = async () => {\n setLoading(true);\n try {\n const data = {\n ...state,\n ...{ name: thisName },\n };\n let saved = await wp.apiFetch({\n method: \"POST\",\n url: wp.url.addQueryArgs(\n `${prestoPlayer.root}${prestoPlayer.prestoVersionString}audio-preset/${preset.id}`,\n { _method: \"PUT\" }\n ),\n data,\n });\n\n if (!saved) {\n throw genericError;\n }\n\n // update or create here\n updatePreset(saved);\n closeModal();\n !!onSave && onSave(saved);\n snackbarNotice({ message: __(\"Preset updated!\", \"presto-player\") });\n } catch (e) {\n setError(e?.message ? e.message : genericError);\n } finally {\n setLoading(false);\n }\n\n // youtube id save\n dispatch(\"presto-player/player\").updateYoutube({ channel_id: value });\n\n const data = {\n ...youtube,\n ...{ channel_id: value },\n };\n\n try {\n let response = await wp.apiFetch({\n path: \"wp/v2/settings\",\n method: \"POST\",\n data: {\n presto_player_youtube: data,\n },\n });\n if (response?.presto_player_youtube) {\n dispatch(\"presto-player/player\").setYoutube(\n response?.presto_player_youtube\n );\n onClose();\n }\n } catch (e) {\n console.log(e);\n }\n };\n\n const createPreset = async () => {\n setLoading(true);\n try {\n let saved = await wp.apiFetch({\n method: \"POST\",\n url:\n prestoPlayer.root + prestoPlayer.prestoVersionString + \"audio-preset\",\n data: {\n ...{ name: thisName },\n ...state,\n },\n });\n if (!saved) {\n throw genericError;\n }\n\n // update or create here\n addPreset(saved);\n closeModal();\n !!onSave && onSave(saved);\n snackbarNotice({ message: __(\"Preset created!\", \"presto-player\") });\n } catch (e) {\n setError(e?.message ? e.message : genericError);\n } finally {\n setLoading(false);\n }\n };\n\n // validate and save\n const save = () => {\n if (!thisName) {\n setError(__(\"You must enter a name for the preset.\", \"presto-player\"));\n return;\n }\n return type === \"edit\" ? putPreset() : createPreset();\n };\n\n const tabs = [\n {\n name: \"controls\",\n title: __(\"Controls\", \"presto-player\"),\n icon: <Icon icon=\"admin-settings\" />,\n component: <Controls updateState={updateState} state={state} />,\n },\n {\n name: \"behavior\",\n title: __(\"Behavior\", \"presto-player\"),\n icon: <Icon icon=\"admin-generic\" />,\n component: <Behavior updateState={updateState} state={state} />,\n },\n {\n name: \"style\",\n title: __(\"Style\", \"presto-player\"),\n icon: <Icon icon=\"admin-customizer\" />,\n component: <Style updateState={updateState} state={state} />,\n },\n {\n name: \"email\",\n title: __(\"Email Capture\", \"presto-player\"),\n icon: <Icon icon=\"email\" />,\n component: <Email updateState={updateState} state={state} />,\n },\n {\n name: \"cta\",\n title: __(\"Call To Action\", \"presto-player\"),\n icon: <Icon icon=\"megaphone\" />,\n component: <CTA updateState={updateState} state={state} />,\n },\n {\n name: \"action_bar\",\n title: __(\"Action Bar\", \"presto-player\"),\n icon: <Icon icon=\"cover-image\" />,\n component: (\n <ActionBar\n updateState={updateState}\n state={state}\n value={value}\n setValue={setValue}\n />\n ),\n },\n ];\n\n return (\n <Modal\n title={\n type == \"edit\"\n ? __(\"Edit A Audio Preset\", \"presto-player\")\n : __(\"Create A New Audio Preset\", \"presto-player\")\n }\n onRequestClose={closeModal}\n className=\"presto-player__modal-presets\"\n overlayClassName=\"presto-player__modal-presets-overlay\"\n >\n <div className=\"presto-player__preset-options\" data-cy=\"preset-modal\">\n <TextControl\n value={thisName}\n hideLabelFromVision={true}\n label={__(\"Preset Name\", \"presto-player\")}\n onChange={(name) => setThisName(name)}\n placeholder={__(\"Enter a preset name...\", \"presto-player\")}\n className=\"presto-player__modal--style-name\"\n autoFocus\n />\n\n <Flex align=\"stretch\" className=\"presto-player__style-preview-area\">\n <FlexItem className=\"presto-player__style-sidebar\">\n <div>\n <Menu\n items={tabs}\n title={__(\"Customize\", \"presto-player\")}\n onSelect={setMenu}\n >\n {(item) => item.component}\n </Menu>\n </div>\n </FlexItem>\n <FlexBlock className=\"presto-player__style-preview-panel\">\n <div\n style={{ position: \"absolute\", top: 0, left: 0, padding: \"20px\" }}\n >\n <SelectControl\n label={__(\"Skin\", \"presto-player\")}\n labelPosition=\"side\"\n value={state?.skin}\n hideLabelFromVision={true}\n options={[\n { label: __(\"Basic\", \"presto-player\"), value: \"default\" },\n { label: __(\"Stacked\", \"presto-player\"), value: \"stacked\" },\n ]}\n onChange={(skin) => {\n updateState({ skin });\n }}\n />\n </div>\n {/*\n Disable the audio tag so the user clicking on it won't play the\n audio when the controls are enabled.\n\t\t\t\t*/}\n\n <Preview\n poster={attributes.poster}\n src={attributes.src}\n state={state}\n branding={branding}\n menu={menu}\n mediaTitle={attributes.title}\n />\n </FlexBlock>\n </Flex>\n\n <br />\n\n {error && (\n <BaseControl>\n <Notice\n className=\"presto-player__modal--error-notice\"\n status=\"error\"\n isDismissible={false}\n style={{ margin: 0 }}\n >\n {error.replace(/(<([^>]+)>)/gi, \"\")}\n </Notice>\n </BaseControl>\n )}\n <div\n css={css`\n display: flex;\n align-items: center;\n justify-content: space-between;\n `}\n >\n <div\n css={css`\n opacity: 0.5;\n font-size: 12px;\n `}\n >\n Preset ID: {preset.id}\n </div>\n <div>\n <Button isTertiary onClick={closeModal} style={{ margin: \"0 6px\" }}>\n {__(\"Cancel\", \"presto-player\")}\n </Button>\n <Button\n isPrimary\n isBusy={loading}\n disabled={loading}\n onClick={save}\n data-cy=\"submit-preset\"\n >\n {type == \"edit\"\n ? __(\"Update Preset\", \"presto-player\")\n : __(\"Create Preset\", \"presto-player\")}\n </Button>\n </div>\n </div>\n </div>\n </Modal>\n );\n}\nexport default EditPlayerPreset;\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst { Icon, Spinner, Modal, Button, ButtonGroup } = wp.components;\nconst { useState } = wp.element;\n\nexport default function ({\n preset,\n index,\n isActive,\n remove,\n setPreset,\n onEdit,\n}) {\n const [loading, setLoading] = useState(false);\n const [confirmOpen, setConfirmOpen] = useState(false);\n\n const openConfirm = () => setConfirmOpen(true);\n const closeConfirm = () => setConfirmOpen(false);\n\n const untrashPreset = async () => {};\n\n const trashPreset = async () => {\n // remove unsaved\n if (!preset.id) {\n remove(preset);\n return;\n }\n\n try {\n setLoading(true);\n let deleted = await wp.apiFetch({\n method: \"POST\",\n url: wp.url.addQueryArgs(\n `${prestoPlayer.root}${prestoPlayer.prestoVersionString}audio-preset/${preset.id}`,\n { _method: \"DELETE\" }\n ),\n });\n if (deleted) {\n remove(preset);\n wp.data.dispatch(\"core/notices\").createNotice(\n \"success\", // Can be one of: success, info, warning, error.\n __(\"Preset trashed.\", \"presto-player\"),\n {\n type: \"snackbar\",\n isDismissible: true,\n // actions: [\n // {\n // label: __(\"Undo\", \"presto-player\"),\n // onClick: () => {\n // console.log(\"untrash\");\n // },\n // },\n // ],\n }\n );\n }\n } catch (e) {\n console.error(e);\n if (e?.message) {\n wp.data.dispatch(\"core/notices\").createNotice(\n \"error\", // Can be one of: success, info, warning, error.\n e.message,\n {\n type: \"snackbar\",\n isDismissible: true, // Whether the user can dismiss the notice.\n }\n );\n }\n } finally {\n setConfirmOpen(false);\n setLoading(false);\n }\n };\n\n if (loading) {\n return (\n <div\n className=\"block-editor-block-styles__item\"\n role=\"button\"\n tabIndex={index}\n aria-label=\"Fill\"\n style={{ color: isActive ? \"var(--wp-admin-theme-color)\" : \"inherit\" }}\n >\n <div\n className=\"block-editor-block-styles__item-preview\"\n style={{\n border: isActive\n ? \"2px solid var(--wp-admin-theme-color)\"\n : \"2px solid #e3e3e3\",\n margin: 0,\n display: \"flex\",\n \"align-items\": \"center\",\n \"justify-content\": \"center\",\n }}\n >\n <Spinner />\n </div>\n </div>\n );\n }\n\n return (\n <div\n className={`block-editor-block-styles__item presto-preset-${preset.slug}`}\n onClick={() => {\n setPreset(preset);\n }}\n role=\"button\"\n tabIndex={index}\n aria-label=\"Fill\"\n style={{ color: isActive ? \"var(--wp-admin-theme-color)\" : \"inherit\" }}\n >\n <div\n className=\"block-editor-block-styles__item-preview\"\n style={{\n border: isActive\n ? \"2px solid var(--wp-admin-theme-color)\"\n : \"2px solid #e3e3e3\",\n margin: 0,\n }}\n >\n <div\n style={{\n textAlign: \"center\",\n width: \"100%\",\n color: isActive ? \"var(--wp-admin-theme-color)\" : \"inherit\",\n opacity: isActive ? 1 : 0.75,\n }}\n >\n {preset?.icon ? (\n <Icon\n icon={preset?.icon}\n style={{\n fontSize: \"30px\",\n width: \"30px\",\n height: \"30px\",\n }}\n />\n ) : (\n <h1 style={{ opacity: 0.75 }}>\n {preset?.name?.charAt(0)?.toUpperCase() || \"Untitled\"}\n </h1>\n )}\n </div>\n </div>\n <div\n className=\"block-editor-block-styles__item-label\"\n style={{ fontWeight: \"bold\", textTransform: \"capitalize\" }}\n >\n {preset?.name || \"Untitled\"}\n </div>\n\n {!preset?.is_locked && (\n <div className=\"block-editor-block-styles__item-edit\">\n <div\n className=\"block-editor-block-styles__item-edit-icon\"\n onClick={onEdit}\n >\n <Icon icon=\"edit\" />\n </div>\n <div\n className=\"block-editor-block-styles__item-edit-icon\"\n onClick={openConfirm}\n >\n <Icon icon=\"trash\" />\n </div>\n </div>\n )}\n\n {confirmOpen && (\n <Modal\n title={__(\"Trash Preset?\", \"presto-player\")}\n onRequestClose={closeConfirm}\n style={{ maxWidth: \"250px\" }}\n >\n <p>\n <strong>{__(\"Warning!\", \"presto-player\")} </strong>\n {__(\n \"Any audios assigned to this preset will automatically use the default preset.\",\n \"presto-player\"\n )}\n </p>\n\n <ButtonGroup>\n <Button\n isDestructive\n onClick={trashPreset}\n style={{ margin: \"0 4px\" }}\n >\n {__(\"Trash\", \"presto-player\")}\n </Button>\n <Button\n isTertiary\n onClick={closeConfirm}\n style={{ margin: \"0 4px\", boxShadow: \"none\" }}\n >\n {__(\"Cancel\", \"presto-player\")}\n </Button>\n </ButtonGroup>\n </Modal>\n )}\n </div>\n );\n}\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst { withNotices, BaseControl, Spinner, Button } = wp.components;\nconst { useState, useEffect } = wp.element;\nconst { useSelect, dispatch } = wp.data;\n\nimport ProBadge from \"@/admin/blocks/shared/components/ProBadge\";\nimport EditPreset from \"./Edit\";\nimport Preset from \"./Preset\";\n\nfunction PlayerPresets({ attributes, setAttributes }) {\n // modal\n const [modal, setModal] = useState(false);\n const openModal = (type) => setModal(type);\n const closeModal = () => setModal(false);\n const [presetData, setPresetData] = useState(null);\n const [name, setName] = useState(null);\n\n // preset data\n // preset data\n const { presets, loading } = useSelect((select) => {\n return {\n presets: select(\"presto-player/player\").getAudioPresets(),\n loading: select(\"presto-player/player\").isResolving(\"getAudioPresets\"),\n };\n });\n\n // preset actions\n const addPreset = (preset) => {\n dispatch(\"presto-player/player\").addAudioPreset(preset);\n };\n const updatePreset = (preset) => {\n dispatch(\"presto-player/player\").updateAudioPreset(preset);\n };\n const removePreset = (preset) => {\n dispatch(\"presto-player/player\").removeAudioPreset(preset);\n };\n\n // set this preset id\n const setPreset = (preset) => {\n setAttributes({ preset: preset.id });\n };\n\n if (loading) {\n return (\n <div className=\"presto-settings__loading\">\n <Spinner />\n </div>\n );\n }\n\n return (\n <>\n {presets.length ? (\n <p>\n {__(\n \"Select a audio configuration preset, or add your own.\",\n \"presto-player\"\n )}\n </p>\n ) : (\n \"\"\n )}\n\n <BaseControl>\n <div className=\"block-editor-block-styles\">\n {(presets || []).length\n ? presets.map((preset, i) => {\n return (\n <Preset\n setPreset={setPreset}\n index={i}\n isActive={attributes?.preset === preset.id}\n preset={preset}\n key={preset.id}\n onEdit={() => {\n setName(preset.name);\n setPresetData(preset);\n setModal(\"edit\");\n }}\n remove={removePreset}\n />\n );\n })\n : __(\n \"No style presets. You can create a new style by clicking 'Add New Style'.\",\n \"presto-plugin\"\n )}\n </div>\n </BaseControl>\n <BaseControl>\n <Button\n isPrimary\n data-cy=\"add-new-preset\"\n onClick={() => {\n if (!prestoPlayer?.isPremium) {\n dispatch(\"presto-player/player\").setProModal(true);\n return;\n }\n openModal(\"new\");\n }}\n >\n {__(\"Add New Preset\", \"presto-player\")}\n </Button>\n {!prestoPlayer?.isPremium && <ProBadge />}\n </BaseControl>\n {modal == \"new\" && (\n <EditPreset\n closeModal={closeModal}\n addPreset={addPreset}\n type=\"new\"\n onSave={setPreset}\n attributes={attributes}\n />\n )}\n {modal == \"edit\" && (\n <EditPreset\n closeModal={closeModal}\n addPreset={addPreset}\n updatePreset={updatePreset}\n type=\"edit\"\n preset={presetData}\n name={name}\n attributes={attributes}\n />\n )}\n </>\n );\n}\n\nexport default withNotices(PlayerPresets);\n","import { __ } from \"@wordpress/i18n\";\nimport VideoBranding from \"@/admin/blocks/shared/branding\";\nimport {\n Button,\n PanelBody,\n BaseControl,\n ToggleControl,\n PanelRow,\n SelectControl,\n Flex,\n Icon,\n TextControl,\n FlexBlock,\n} from \"@wordpress/components\";\nimport { useInstanceId } from \"@wordpress/compose\";\nimport { MediaUpload, MediaUploadCheck } from \"@wordpress/block-editor\";\nimport VideoChapters from \"@/admin/blocks/shared/chapters\";\nimport ProBadge from \"@/admin/blocks/shared/components/ProBadge\";\nimport AudioPresets from \"@/admin/blocks/shared/audioPresets\";\n\nconst AUDIO_POSTER_ALLOWED_MEDIA_TYPES = [\"image\"];\n\nfunction AudioBlockInspectorControl({ attributes, setAttributes }) {\n const instanceId = useInstanceId(AudioBlockInspectorControl);\n const audioPosterDescription = `audio-block__poster-image-description-${instanceId}`;\n\n const { autoplay, poster, preload, title } = attributes;\n\n function onSelectPoster(image) {\n setAttributes({ poster: image.url });\n }\n function onRemovePoster() {\n setAttributes({ poster: \"\" });\n }\n return (\n <>\n <PanelBody\n title={<>{__(\"Title\", \"presto-player\")} </>}\n initialOpen={true}\n >\n <FlexBlock>\n <TextControl\n className={\"presto-player__caption--title\"}\n placeholder={__(\"Title\", \"presto-player\")}\n value={title || \"\"}\n onChange={(title) => setAttributes({ title: title })}\n autoComplete=\"off\"\n />\n </FlexBlock>\n </PanelBody>\n\n {/* Chapters */}\n <PanelBody\n title={\n <>\n {__(\"Chapters\", \"presto-player\")}{\" \"}\n {!prestoPlayer?.isPremium && <ProBadge />}\n </>\n }\n initialOpen={prestoPlayer?.isPremium}\n >\n <VideoChapters setAttributes={setAttributes} attributes={attributes} />\n </PanelBody>\n\n <PanelBody title={<>{__(\"Audio Settings\", \"presto-player\")} </>}>\n {/* Autoplay Settings */}\n <ToggleControl\n label={<>{__(\"Autoplay\", \"presto-player\")} </>}\n checked={autoplay}\n onChange={(autoplay) => {\n setAttributes({ autoplay });\n }}\n />\n\n {/* Performance Preference */}\n <PanelRow>\n <SelectControl\n label={\n <Flex>\n <div>{__(\"Performance Preference\", \"presto-player\")}</div>\n <a\n href=\"https://prestoplayer.com/docs/performance-preferences-explained\"\n target=\"_blank\"\n style={{ textDecoration: \"none\" }}\n >\n <Icon icon=\"editor-help\" />\n </a>\n </Flex>\n }\n className=\"presto-setting__preload\"\n value={preload}\n onChange={(value) => setAttributes({ preload: value })}\n options={[\n {\n value: \"auto\",\n label: __(\"Audio Playback Speed\", \"presto-player\"),\n },\n {\n value: \"metadata\",\n label: __(\"Page Load Speed\", \"presto-player\"),\n },\n {\n value: \"none\",\n label: __(\"Page Load Speed (Extreme)\", \"presto-player\"),\n },\n ]}\n />\n </PanelRow>\n\n {/* Poster Image */}\n <MediaUploadCheck>\n <BaseControl className=\"editor-video-poster-control\">\n <BaseControl.VisualLabel>\n <p>{__(\"Poster image\", \"presto-player\")}</p>\n </BaseControl.VisualLabel>\n <MediaUpload\n title={__(\"Select poster image\", \"presto-player\")}\n onSelect={onSelectPoster}\n allowedTypes={AUDIO_POSTER_ALLOWED_MEDIA_TYPES}\n render={({ open }) => (\n <Button\n className=\"presto-setting__poster\"\n isPrimary\n onClick={open}\n aria-describedby={audioPosterDescription}\n >\n {!poster\n ? __(\"Select\", \"presto-player\")\n : __(\"Replace\", \"presto-player\")}\n </Button>\n )}\n />\n <p id={audioPosterDescription} hidden>\n {poster\n ? sprintf(\n __(\"The current poster image url is %s\", \"presto-player\"),\n poster\n )\n : __(\n \"There is no poster image currently selected\",\n \"presto-player\"\n )}\n </p>\n {!!poster && (\n <Button\n onClick={onRemovePoster}\n className=\"presto-setting__remove-poster\"\n isTertiary\n >\n {__(\"Remove\", \"presto-player\")}\n </Button>\n )}\n </BaseControl>\n </MediaUploadCheck>\n </PanelBody>\n\n {/* Audio Presets */}\n <PanelBody title={__(\"Audio Preset\", \"presto-player\")}>\n <AudioPresets setAttributes={setAttributes} attributes={attributes} />\n </PanelBody>\n\n {/* Global Branding */}\n <PanelBody\n title={<>{__(\"Global Player Branding\", \"presto-player\")}</>}\n initialOpen={false}\n >\n <VideoBranding\n setAttributes={setAttributes}\n attributes={attributes}\n type=\"audio\"\n />\n </PanelBody>\n </>\n );\n}\n\nexport default AudioBlockInspectorControl;\n","/**\n * WordPress dependencies\n */\n\nimport { createHigherOrderComponent } from \"@wordpress/compose\";\nimport { useEffect, useState } from \"@wordpress/element\";\nimport { dispatch } from \"@wordpress/data\";\nimport { usePrevious } from \"@/admin/blocks/util\";\nimport { __ } from \"@wordpress/i18n\";\nimport apiFetch from \"@/shared/services/fetch\";\n\n/**\n * Higher order component factory for injecting the editor colors as the\n * `colors` prop in the `withColors` HOC.\n *\n * @return {Function} The higher order component.\n */\nexport default () =>\n createHigherOrderComponent(\n (WrappedComponent) => (props) => {\n const {\n presets,\n attributes,\n setAttributes,\n defaultPreset,\n isSelected,\n branding,\n } = props;\n const [presetData, setPresetData] = useState({});\n const [count, setCount] = useState(1);\n let { poster, chapters } = attributes;\n\n useEffect(() => {\n if (isSelected && attributes?.id) {\n dispatch(\"core/edit-post\").openGeneralSidebar(\"edit-post/block\");\n }\n }, [isSelected]);\n\n // don't allow selection if there is an override\n useEffect(() => {\n if (isSelected && attributes?.selectionOverrideClientId) {\n dispatch(\"core/block-editor\").selectBlock(\n attributes?.selectionOverrideClientId\n );\n }\n }, [isSelected]);\n\n // set preset data when presets are loaded\n useEffect(() => {\n if (presets && presets.length) {\n const thisPreset = presets.find((preset) => {\n return preset.id === attributes?.preset;\n });\n if (thisPreset) {\n setPresetData(thisPreset);\n } else {\n setPresetData(defaultPreset);\n setAttributes({ preset: defaultPreset?.id });\n }\n }\n }, [presets, attributes?.preset]);\n\n // re-render the player if presetdata, poster or chapters change\n useEffect(() => {\n onUpdate();\n }, [poster, presetData, chapters, branding.logo]);\n\n // increment update key\n const onUpdate = () => {\n setCount(count + 1);\n };\n\n // re-render only if times change\n const prevChapters = usePrevious(chapters);\n useEffect(() => {\n let times = chapters?.map((item) => item.time);\n let prevTimes = prevChapters?.map((item) => item.time);\n if (_.difference(times, prevTimes).length) {\n onUpdate();\n }\n }, [chapters]);\n\n const createVideo = async ({\n src,\n external_id,\n attachment_id,\n type,\n title,\n }) => {\n if (!src && !external_id && !attachment_id) {\n return;\n }\n const { id } = await apiFetch({\n method: \"POST\",\n path: \"/presto-player/v1/videos\",\n data: {\n attachment_id,\n post_id: wp.data.select(\"core/editor\").getCurrentPostId(),\n external_id,\n ...(title ? { title } : {}),\n src,\n type,\n },\n });\n setAttributes({ id });\n };\n\n const lock = () => {\n return dispatch(\"core/editor\").lockPostSaving(\"presto-player\");\n };\n\n const unlock = () => {\n return dispatch(\"core/editor\").unlockPostSaving(\"presto-player\");\n };\n\n function onRemoveSrc() {\n let r = confirm(__(\"Remove this\", \"presto-player\"));\n if (r) {\n setAttributes({\n src: \"\",\n id: undefined,\n });\n }\n }\n\n // make sure it's the default\n if (!attributes?.preset) {\n setAttributes({ preset: defaultPreset?.id });\n }\n\n return (\n <WrappedComponent\n {...props}\n lockSave={lock}\n unlockSave={unlock}\n createVideo={createVideo}\n onUpdate={onUpdate}\n onRemoveSrc={onRemoveSrc}\n presetData={presetData}\n setPresetData={setPresetData}\n renderKey={count}\n />\n );\n },\n \"withPlayerEdit\"\n );\n","const { withSelect } = wp.data;\n\nexport default function (props) {\n return withSelect((select) => {\n return {\n branding: select(\"presto-player/player\").branding(),\n loading: select(\"presto-player/player\").isResolving(\"getAudioPresets\"),\n presets: select(\"presto-player/player\").getAudioPresets(),\n defaultPreset: select(\"presto-player/player\").getDefaultAudioPreset(),\n };\n });\n}\n","import HostedAudioPlaceholder from \"./HostedAudioPlaceholder\";\nimport { InspectorControls, BlockControls } from \"@wordpress/editor\";\nimport AudioBlockInspectorControl from \"./AudioBlockInspectorControl\";\nimport Player from \"@/admin/blocks/shared/Player\";\nconst { compose } = wp.compose;\nimport withPlayerEdit from \"./with-player-edit\";\nimport withPlayerData from \"./with-player-data\";\nimport {\n Placeholder,\n Spinner,\n Disabled,\n withNotices,\n Toolbar,\n Button,\n} from \"@wordpress/components\";\nimport { __ } from \"@wordpress/i18n\";\n\nexport default compose([withPlayerData(), withPlayerEdit()])(\n withNotices(\n ({\n attributes,\n setAttributes,\n branding,\n presetData,\n renderKey,\n defaultPreset,\n lockSave,\n unlockSave,\n loading,\n createVideo,\n onRemoveSrc,\n }) => {\n const { poster, src, id } = attributes;\n\n const onSelectURL = (newUrl) => {\n setAttributes({\n ...attributes,\n src: newUrl,\n title: newUrl,\n preset: defaultPreset?.id,\n });\n lockSave();\n createVideo({\n src: newUrl,\n type: \"link\",\n })\n .catch((e) => {\n setAttributes({ src: \"\" });\n showNotice(e);\n })\n .finally(unlockSave);\n };\n // const tracks = ''\n function onSelectAudio(audio) {\n if (!audio || !audio.url) {\n // in this case there was an error\n // previous attributes should be removed\n // because they may be temporary blob urls\n setAttributes({ src: undefined, id: undefined });\n return;\n }\n // sets the block's attribute and updates the edit component from the\n // selected media\n if (audio.title) {\n setAttributes({\n src: audio.url,\n preset: defaultPreset?.id,\n title: audio.title,\n attachment_id: audio.id,\n });\n\n lockSave();\n createVideo({\n src: audio.url,\n type: \"attachment\",\n attachment_id: audio.id,\n })\n .catch((e) => {\n setAttributes({ src: \"\" });\n showNotice(e);\n })\n .finally(unlockSave);\n } else {\n setAttributes({\n src: audio.url,\n title: audio.url,\n preset: defaultPreset?.id,\n // attachment_id: audio.id,\n });\n }\n }\n\n if (!src) {\n return (\n <>\n <HostedAudioPlaceholder\n attributes={attributes}\n setAttributes={setAttributes}\n onSelectURL={onSelectURL}\n onSelect={onSelectAudio}\n ></HostedAudioPlaceholder>\n </>\n );\n }\n\n // loading presets still\n if (loading || !id) {\n return (\n <Placeholder className=\"presto-player__placeholder is-loading\">\n <Spinner />\n </Placeholder>\n );\n }\n\n return (\n <>\n <BlockControls>\n {/* <AudioTranscription\n attributes={attributes}\n tracks={tracks}\n onChange={(newTracks) => {\n setAttributes({ tracks: newTracks });\n }}\n /> */}\n <Toolbar>\n <Button onClick={() => onRemoveSrc()}>\n {__(\"Replace\", \"presto-player\")}\n </Button>\n </Toolbar>\n </BlockControls>\n\n {/* Enable InspectorControls */}\n <InspectorControls>\n <AudioBlockInspectorControl\n attributes={attributes}\n setAttributes={setAttributes}\n />\n </InspectorControls>\n\n <figure>\n {/*\n Disable the audio tag so the user clicking on it won't play the\n audio when the controls are enabled.\n */}\n <Disabled>\n <Player\n poster={poster}\n src={src}\n id={id}\n type={\"audio\"}\n attributes={attributes}\n setAttributes={setAttributes}\n preset={presetData}\n branding={branding}\n key={renderKey}\n />\n </Disabled>\n </figure>\n </>\n );\n }\n )\n);\n","import { __ } from \"@wordpress/i18n\";\nimport edit from \"./edit\";\nexport const name = \"presto-player/audio\";\n\nexport const options = {\n category: \"presto\",\n\n attributes: {\n src: {\n type: \"string\",\n },\n autoplay: {\n type: Boolean,\n default: false,\n },\n poster: {\n type: \"string\",\n },\n chapters: {\n type: \"array\",\n default: [],\n },\n preload: {\n type: \"string\",\n },\n title: {\n type: \"string\",\n },\n tracks: {\n type: \"array\",\n items: {\n type: \"object\",\n },\n default: [],\n },\n preset: {\n type: Number,\n },\n id: {\n type: Number,\n },\n attachment_id: {\n type: Number,\n },\n src: {\n type: String,\n },\n visibility: {\n type: String,\n default: \"public\",\n },\n },\n\n title: __(\"Presto Audio\", \"presto-player\"),\n\n description: __(\"A audio player wrapper.\", \"presto-player\"),\n\n variations: [\n {\n name: \"public\",\n isDefault: true,\n title: __(\"Presto Audio\", \"presto-player\"),\n description: __(\"Presto self-hosted audio block.\", \"presto-player\"),\n attributes: { visibility: \"public\" },\n },\n ...(prestoPlayer?.isPremium\n ? [\n {\n name: \"private\",\n title: __(\"Presto Private Audio\", \"presto-player\"),\n icon: (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"presto-block-icon\"\n >\n <rect x=\"3\" y=\"11\" width=\"18\" height=\"11\" rx=\"2\" ry=\"2\"></rect>\n <path d=\"M7 11V7a5 5 0 0 1 10 0v4\"></path>\n </svg>\n ),\n description: __(\n \"Private self-hosted audio block.\",\n \"presto-player\"\n ),\n attributes: { visibility: \"private\" },\n },\n ]\n : []),\n ],\n\n icon: (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n className=\"presto-block-icon\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3\"\n />\n </svg>\n ),\n edit,\n};\n","const { combineReducers, dispatch } = wp.data;\nconst { apiFetch } = wp;\nconst { pick } = lodash;\n\n/**\n * Presets reducer\n *\n * @param {array} state\n * @param {object} action\n */\nconst presetReducer = (state = [], action) => {\n switch (action.type) {\n case \"SET_PRESET\":\n return action.value;\n case \"ADD_PRESET\":\n return [...state, ...[action.value]];\n case \"UPDATE_PRESET\":\n return state.map((item, index) => {\n if (item.id !== action.value?.id) {\n return item;\n }\n return {\n ...item,\n ...action.value,\n };\n });\n case \"REMOVE_PRESET\":\n return state.filter((item) => {\n return item !== action.value;\n });\n }\n return state;\n};\n\n/**\n * Presets reducer\n *\n * @param {array} state\n * @param {object} action\n */\n const audioPresetReducer = (state = [], action) => {\n switch (action.type) {\n case \"SET_AUDIO_PRESET\":\n return action.value;\n case \"SET_AUDIO_PRESET\":\n return action.value;\n case \"ADD_AUDIO_PRESET\":\n return [...state, ...[action.value]];\n case \"UPDATE_AUDIO_PRESET\":\n return state.map((item, index) => {\n if (item.id !== action.value?.id) {\n return item;\n }\n return {\n ...item,\n ...action.value,\n };\n });\n case \"REMOVE_AUDIO_PRESET\":\n return state.filter((item) => {\n return item !== action.value;\n });\n }\n return state;\n};\n\n/**\n * For preset loading\n *\n * @param {boolean} state\n * @param {object} action\n */\nconst presetLoadingReducer = (state = true, action) => {\n switch (action.type) {\n case \"SET_PRESET_LOADING\":\n return action.value;\n }\n};\n\n/**\n * For preset loading\n *\n * @param {boolean} state\n * @param {object} action\n */\nconst videosLoadingReducer = (state = true, action) => {\n switch (action.type) {\n case \"SET_VIDEOS_LOADING\":\n return action.value;\n }\n};\n\nconst proModalReducer = (state = false, action) => {\n switch (action.type) {\n case \"SET_PRO_MODAL\":\n return action.value;\n }\n};\n\nconst addVideo = (videos, video) => {\n // check for existing item\n const index = videos.find((e) => e.id === video.id);\n if (index) {\n return videos;\n }\n return [...videos, ...[video]];\n};\n\nconst videosReducer = (\n state = {\n total: 0,\n total_pages: 0,\n videos: [],\n hasResolved: false,\n isError: false,\n },\n action\n) => {\n switch (action.type) {\n case \"SET_VIDEOS\":\n return action.value;\n case \"UPDATE_VIDEOS\":\n return { ...state, ...action.value };\n case \"APPEND_VIDEOS\":\n let draft = state;\n (action.value || []).forEach((video) => {\n draft.videos = addVideo(draft.videos, video);\n });\n return draft;\n case \"ADD_VIDEO\":\n return { ...state, videos: addVideo(state.videos, action.value) };\n case \"UPDATE_VIDEO\":\n return {\n ...state,\n videos: state.videos.map((item, index) => {\n if (item.id !== action.value?.id) {\n return item;\n }\n return {\n ...item,\n ...action.value,\n };\n }),\n };\n case \"REMOVE_VIDEO\":\n return {\n ...state,\n videos: state.videos.filter((item) => {\n return item !== action.value;\n }),\n };\n }\n return state;\n};\n\n/**\n * Branding options are global and stored in settings\n * @param {object} state\n * @param {object} action\n */\nconst brandingReducer = (state = {}, action) => {\n switch (action.type) {\n case \"SET_BRANDING\":\n return action.value;\n case \"UPDATE_BRANDING\":\n return {\n ...state,\n [action.name]: action.value,\n };\n }\n return state;\n};\n\n/**\n * Youtube are global and stored in settings\n * @param {object} state\n * @param {object} action\n */\nconst youtubeReducer = (state = {}, action) => {\n switch (action.type) {\n case \"SET_YOUTUBE\":\n return action.value;\n case \"UPDATE_YOUTUBE\":\n return {\n ...state,\n [action.name]: action.value,\n };\n }\n return state;\n};\n\n/**\n * General are global and stored in settings\n * @param {object} state\n * @param {object} action\n */\nconst presetSettingsReducer = (state = {}, action) => {\n switch (action.type) {\n case \"SET_PRESET_SETTINGS\":\n return action.value;\n }\n return state;\n};\nconst audioPresetSettingsReducer = (state = {}, action) => {\n switch (action.type) {\n case \"SET_PRESET_AUDIO_SETTINGS\":\n return action.value;\n }\n return state;\n};\n/**\n * For fetching the options\n *\n * @param {object} state\n * @param {object} action\n */\nconst optionsApi = (state, action) => {\n switch (action.type) {\n /**\n * Fetch our options\n */\n case \"FETCH_OPTIONS\":\n return apiFetch({\n path: \"/presto-player/v1/settings/\",\n }).then((settings) => {\n dispatch(\"presto-player/player\").setBranding(\n settings.presto_player_branding\n );\n dispatch(\"presto-player/player\").setYoutube(\n settings.presto_player_youtube\n );\n dispatch(\"presto-player/player\").setPresetSettings(\n settings.presto_player_presets\n );\n dispatch(\"presto-player/player\").setPresetAudioSettings(\n settings.presto_player_audio_presets\n );\n });\n\n /**\n * Persist options to db\n */\n case \"SAVE_OPTIONS\":\n const data = {\n presto_player_branding: pick(action?.branding, [\n \"logo\",\n \"color\",\n \"logo_width\",\n \"player_css\",\n ]),\n };\n\n // remove blanks\n Object.keys(data).forEach(\n (key) =>\n (data[key] == null || !Object.keys(data?.[key] || {}).length) &&\n delete data[key]\n );\n\n apiFetch({\n path: \"/presto-player/v1/settings\",\n method: \"POST\",\n data,\n });\n\n return data;\n }\n};\n\nexport default combineReducers({\n presetReducer,\n audioPresetReducer,\n presetLoadingReducer,\n videosLoadingReducer,\n videosReducer,\n proModalReducer,\n brandingReducer,\n youtubeReducer,\n presetSettingsReducer,\n optionsApi,\n audioPresetSettingsReducer\n});\n","export function getPresets(state) {\n return state?.presetReducer || [];\n}\nexport function getAudioPresets(state) {\n return state?.audioPresetReducer || [];\n}\nexport function getPreset(state, id) {\n if (state?.presetReducer?.length) {\n return state?.presetReducer.find((item) => item.id === id);\n }\n return [];\n}\nexport function getReusableVideos(state) {\n return state?.videosReducer || [];\n}\nexport function getReusableVideo(state, id) {\n return state?.videosReducer?.videos?.find((video) => video?.id === id) || [];\n}\nexport function getDefaultPreset(state) {\n const default_preset = state?.presetSettingsReducer?.default_player_preset;\n\n let preset =\n default_preset &&\n (state?.presetReducer || []).find((preset) => {\n return preset.id && preset.id === default_preset;\n });\n\n if (!preset) {\n preset = (state?.presetReducer || []).find((preset) => {\n return preset.slug == \"default\";\n });\n }\n if (!preset) {\n preset = (state?.presetReducer || [])[0];\n }\n return preset;\n}\nexport function getDefaultAudioPreset(state) {\n const default_preset = state?.audioPresetSettingsReducer?.default_player_preset;\n\n let preset =\n default_preset &&\n (state?.audioPresetReducer || []).find((preset) => {\n return preset.id && preset.id === default_preset;\n });\n\n if (!preset) {\n preset = (state?.audioPresetReducer || []).find((preset) => {\n return preset.slug == \"default\";\n });\n }\n if (!preset) {\n preset = (state?.audioPresetReducer || [])[0];\n }\n return preset;\n}\nexport function presetsLoading(state) {\n return !!state?.presetLoadingReducer;\n}\nexport function branding(state) {\n return state?.brandingReducer;\n}\nexport function playerCSS(state) {\n return state?.brandingReducer?.player_css;\n}\nexport function youtube(state) {\n return state?.youtubeReducer;\n}\nexport function proModal(state) {\n return state?.proModalReducer;\n}\n","export function setPresetLoading(value) {\n return {\n type: \"SET_PRESET_LOADING\",\n value,\n };\n}\n\nexport function setVideosLoading(value) {\n return {\n type: \"SET_VIDEOS_LOADING\",\n value,\n };\n}\n\nexport function setProModal(value) {\n return {\n type: \"SET_PRO_MODAL\",\n value,\n };\n}\n\n/**\n * Videos\n */\nexport function setVideos(value) {\n return {\n type: \"SET_VIDEOS\",\n value,\n };\n}\nexport function updateVideos(value) {\n return {\n type: \"UPDATE_VIDEOS\",\n value,\n };\n}\nexport function appendVideos(value) {\n return {\n type: \"APPEND_VIDEOS\",\n value,\n };\n}\nexport function addVideo(value) {\n return {\n type: \"ADD_VIDEO\",\n value,\n };\n}\n\n/**\n * Presets\n */\nexport function setPresets(value) {\n return {\n type: \"SET_PRESET\",\n value,\n };\n}\nexport function addPreset(value) {\n return {\n type: \"ADD_PRESET\",\n value,\n };\n}\nexport function updatePreset(value) {\n return {\n type: \"UPDATE_PRESET\",\n value,\n };\n}\nexport function removePreset(value) {\n return {\n type: \"REMOVE_PRESET\",\n value,\n };\n}\n\n/**\n * Audio Presets\n */\n\nexport function setAudioPresets(value) {\n return {\n type: \"SET_AUDIO_PRESET\",\n value,\n };\n}\n\nexport function addAudioPreset(value) {\n return {\n type: \"ADD_AUDIO_PRESET\",\n value,\n };\n}\nexport function updateAudioPreset(value) {\n return {\n type: \"UPDATE_AUDIO_PRESET\",\n value,\n };\n}\nexport function removeAudioPreset(value) {\n return {\n type: \"REMOVE_AUDIO_PRESET\",\n value,\n };\n}\n\n/**\n * Branding\n */\nexport function setBranding(value) {\n return {\n type: \"SET_BRANDING\",\n value,\n };\n}\nexport function updateBranding(name, value) {\n return {\n type: \"UPDATE_BRANDING\",\n name,\n value,\n };\n}\n\n/**\n * Save provided settings\n */\nexport function saveOptions(args) {\n return {\n type: \"SAVE_OPTIONS\",\n ...args,\n };\n}\n\n/**\n * FetchOptions\n */\nexport function fetchOptions() {\n return {\n type: \"FETCH_OPTIONS\",\n };\n}\n\nexport function fetchFromAPI(path) {\n return {\n type: \"FETCH_FROM_API\",\n path,\n };\n}\n\nexport function fetchFromWPAPI(path, args) {\n return {\n type: \"FETCH_FROM_WP_API\",\n path,\n args,\n };\n}\n\nexport function setYoutube(value) {\n return {\n type: \"SET_YOUTUBE\",\n value,\n };\n}\n\nexport function updateYoutube(name, value) {\n return {\n type: \"UPDATE_YOUTUBE\",\n name,\n value,\n };\n}\n\nexport function setPresetSettings(value) {\n return {\n type: \"SET_PRESET_SETTINGS\",\n value,\n };\n}\n\nexport function setPresetAudioSettings(value) {\n return {\n type: \"SET_PRESET_AUDIO_SETTINGS\",\n value,\n };\n}","const { apiFetch } = wp;\n\nexport default {\n FETCH_FROM_API(action) {\n return apiFetch({\n url: prestoPlayer.root + prestoPlayer.prestoVersionString + action.path,\n });\n },\n async FETCH_FROM_WP_API({ args, path = \"\" }) {\n let res = await apiFetch({\n path: wp.url.addQueryArgs(`wp/v2/${path}`, args?.query),\n ...(args?.data ? { data: args.data } : {}),\n ...args?.options,\n parse: false,\n });\n\n const data = await res.json();\n const total = res.headers && res.headers.get(\"X-WP-Total\");\n const total_pages = res.headers && res.headers.get(\"X-WP-TotalPages\");\n\n return new Promise((resolve, reject) => {\n resolve({\n data,\n total,\n total_pages,\n });\n return;\n });\n },\n};\n","import * as actions from \"./actions\";\n\nexport default {\n *getPresets() {\n const presets = yield actions.fetchFromAPI(\"preset\");\n return actions.setPresets(presets);\n },\n *getAudioPresets(){\n const presets = yield actions.fetchFromAPI(\"audio-preset\");\n return actions.setAudioPresets(presets);\n },\n *getReusableVideo(id) {\n const path = `presto-videos/${id}`;\n const preset = yield actions.fetchFromWPAPI(path, {});\n return actions.addVideo(preset?.data || {});\n },\n};\n","/**\n * WordPress dependencies\n */\nconst { registerStore } = wp.data;\n\n/**\n * Internal dependencies\n */\nimport reducer from \"./reducer\";\nimport * as selectors from \"./selectors\";\nimport * as actions from \"./actions\";\nimport controls from \"./controls\";\nimport resolvers from \"./resolvers\";\n\nexport default registerStore(\"presto-player/player\", {\n reducer,\n selectors,\n actions,\n controls,\n resolvers,\n});\n","const { Modal, Button } = wp.components;\nconst { dispatch, useSelect } = wp.data;\nimport ProBadge from \"@/admin/blocks/shared/components/ProBadge\";\n\nexport default function () {\n const closeModal = () => {\n dispatch(\"presto-player/player\").setProModal(false);\n };\n\n const open = useSelect((select) => {\n return select(\"presto-player/player\").proModal();\n });\n\n return open ? (\n <Modal title={\"Pro Feature\"} onRequestClose={closeModal}>\n <h2>\n Unlock Presto Player <ProBadge />\n </h2>\n <p>Get this feature and more with the Pro version of Presto Player!</p>\n <Button href=\"https://prestoplayer.com\" target=\"_blank\" isPrimary>\n Learn More\n </Button>\n </Modal>\n ) : (\n \"\"\n );\n}\n","/**\n * Dynamically locate, load & register all Editor Blocks & Plugins.\n */\nconst { registerBlockType, unregisterBlockType } = wp.blocks;\nconst { registerPlugin, unregisterPlugin } = wp.plugins;\nconst { select, dispatch } = wp.data;\nconst { render } = wp.element;\n\nimport store from \"./store/player\";\n\nimport \"@/admin/blocks/shared/styles/gutenberg/index.scss\";\nimport ProUpgradeModal from \"./shared/ProUpgradeModal\";\n\n/**\n * No-op function for use as a default argument value.\n *\n * @returns null\n */\nconst noop = () => null;\n\n/**\n * Require a set of modules and configure them for hot module replacement.\n *\n * The first argument should be a function returning a `require.context()`\n * call. All modules loaded from this context are cached, and on each rebuild\n * the incoming updated modules are checked against the cache. Updated modules\n * which already exist in the cache are unregistered with the provided function,\n * then any incoming (new or updated) modules will be registered.\n *\n * @param {Function} getContext Execute and return a `require.context()` call.\n * @param {Function} register Function to register accepted modules.\n * @param {Function} unregister Function to unregister replaced modules.\n * @param {Function} [before] Function to run before updating moules.\n * @param {Function} [after] Function to run after updating moules.\n */\nconst autoload = ({\n getContext,\n register,\n unregister,\n before = noop,\n after = noop,\n}) => {\n const cache = {};\n const loadModules = () => {\n before();\n\n const context = getContext();\n const changedNames = [];\n context.keys().forEach((key) => {\n const module = context(key);\n if (module === cache[key]) {\n // Module unchanged: no further action needed.\n return;\n }\n if (cache[key]) {\n // Module changed, and prior copy detected: unregister old module.\n unregister(cache[key]);\n }\n // Register new module and update cache.\n register(module);\n changedNames.push(module.name);\n cache[key] = module;\n });\n\n after(changedNames);\n\n // Return the context for HMR initialization.\n return context;\n };\n\n const context = loadModules();\n\n if (module.hot) {\n module.hot.accept(context.id, loadModules);\n }\n};\n\n// Maintain the selected block ID across HMR updates.\nlet selectedBlockId = null;\nconst storeSelectedBlock = () => {\n selectedBlockId = select(\"core/editor\").getSelectedBlockClientId();\n dispatch(\"core/editor\").clearSelectedBlock();\n};\nconst refreshAllBlocks = (changedNames = []) => {\n // Refresh all blocks by iteratively selecting each one.\n select(\"core/editor\")\n .getBlocks()\n .forEach(({ name, clientId }) => {\n if (changedNames.includes(name)) {\n dispatch(\"core/editor\").selectBlock(clientId);\n }\n });\n // Reselect whatever was selected in the beginning.\n if (selectedBlockId) {\n dispatch(\"core/editor\").selectBlock(selectedBlockId);\n } else {\n dispatch(\"core/editor\").clearSelectedBlock();\n }\n selectedBlockId = null;\n};\n\n// Load all block index files.\nautoload({\n getContext: () => require.context(\"./blocks\", true, /index\\.js$/),\n register: ({ name, options }) => {\n if (prestoPlayer?.isPremium) {\n registerBlockType(name, options);\n } else if (!options.premium) {\n registerBlockType(name, options);\n }\n },\n unregister: ({ name }) => unregisterBlockType(name),\n before: storeSelectedBlock,\n after: refreshAllBlocks,\n});\n\n// Load all plugin files.\nautoload({\n getContext: () => require.context(\"./plugins\", true, /index\\.js$/),\n register: ({ name, options }) => registerPlugin(name, options),\n unregister: ({ name }) => unregisterPlugin(name),\n});\n\njQuery(\"body\").append('<div id=\"presto-plugin-app\"></div>');\nrender(<ProUpgradeModal />, document.getElementById(\"presto-plugin-app\"));\n\n// fetch settings\ndispatch(\"presto-player/player\").fetchOptions();\n\nlet saving = false;\n// save the settings on post save, just in case they miss the button\nwp.data.subscribe(function () {\n var isSavingPost = wp.data.select(\"core/editor\").isSavingPost();\n var isAutosavingPost = wp.data.select(\"core/editor\").isAutosavingPost();\n\n if (isSavingPost && !isAutosavingPost) {\n if (saving) {\n return;\n }\n saving = true;\n let { brandingReducer } = store.getState();\n dispatch(\"presto-player/player\")\n .saveOptions({\n branding: brandingReducer,\n })\n .then(() => {\n saving = false;\n });\n }\n});\n","/**\n * External dependencies\n */\nimport classnames from \"classnames\";\n\n/**\n * WordPress dependencies\n */\nconst { useInstanceId } = wp.compose;\nconst { __ } = wp.i18n;\nconst { VisuallyHidden, Button, Icon } = wp.components;\nconst { useRef } = wp.element;\n\nfunction InserterSearchForm({ className, onChange, value, placeholder }) {\n const instanceId = useInstanceId(InserterSearchForm);\n const searchInput = useRef();\n\n return (\n <div className={\"block-editor-inserter__search\"} style={{ padding: 0 }}>\n <VisuallyHidden\n as=\"label\"\n htmlFor={`block-editor-inserter__search-${instanceId}`}\n >\n {placeholder}\n </VisuallyHidden>\n <input\n ref={searchInput}\n className=\"block-editor-inserter__search-input\"\n id={`block-editor-inserter__search-${instanceId}`}\n type=\"search\"\n placeholder={placeholder}\n onChange={(event) => onChange(event.target.value)}\n autoComplete=\"off\"\n value={value || \"\"}\n />\n <div className=\"block-editor-inserter__search-icon\">\n {!!value && (\n <Button\n icon={\"close-small\"}\n label={__(\"Reset search\", \"presto-player\")}\n onClick={() => {\n onChange(\"\");\n searchInput.current.focus();\n }}\n />\n )}\n {!value && <Icon icon={\"search\"} />}\n </div>\n </div>\n );\n}\n\nexport default InserterSearchForm;\n","import { __ } from \"@wordpress/i18n\";\nimport { PanelBody } from \"@wordpress/components\";\n\nasync function copyTextToClipboard(e) {\n let textToCopy = document.getElementById(\"presto-shortcode-input\").value;\n let btn = e.currentTarget;\n let buttonText = btn.textContent;\n e.currentTarget.textContent = __(\"Copied!\", \"presto-player\");\n\n setTimeout(() => {\n btn.textContent = buttonText;\n }, 1500);\n\n if (navigator.clipboard && window.isSecureContext) {\n // navigator clipboard api method'\n return navigator.clipboard.writeText(textToCopy);\n } else {\n // text area method for older OR non secure URL pages.\n let textArea = document.createElement(\"textarea\");\n textArea.value = textToCopy;\n // make the textarea out of viewport\n textArea.style.position = \"fixed\";\n textArea.style.left = \"-999999px\";\n textArea.style.top = \"-999999px\";\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n return new Promise((res, rej) => {\n document.execCommand(\"copy\") ? res() : rej();\n textArea.remove();\n });\n }\n}\n\nfunction InserterShortcodeInput() {\n return (\n <PanelBody title={__(\"Timestamp Shortcode\", \"presto-player\")}>\n <div className={\"block-editor-inserter__shortcode-input\"}>\n <p>\n {__(\n \"Add convenient links to skip the player to a specific timestamp.\",\n \"presto-player\"\n )}\n </p>\n <input\n id=\"presto-shortcode-input\"\n style={{ width: \"100%\", fontSize: \"11px\", marginBottom: \"10px\" }}\n type=\"text\"\n readOnly\n value='[pptime time=\"1:00\"]Optional Text[/pptime]'\n />\n <button\n type=\"button\"\n className=\"components-button is-primary\"\n onClick={copyTextToClipboard}\n >\n {__(\"Copy to clipboard\", \"presto-player\")}\n </button>\n </div>\n </PanelBody>\n );\n}\n\nexport default InserterShortcodeInput;\n","export default ({ icon, title, id, selectBlock, i }) => {\n return (\n <button\n type=\"button\"\n id={`video-${id}`}\n tabIndex={i}\n onClick={selectBlock}\n role=\"option\"\n className=\"components-button block-editor-block-types-list__item editor-block-list-item-kadence-spacer\"\n >\n <span className=\"block-editor-block-types-list__item-icon\">\n <span className=\"block-editor-block-icon has-colors\">{icon}</span>\n </span>\n <span className=\"block-editor-block-types-list__item-title\">{title}</span>\n </button>\n );\n};\n","const { __ } = wp.i18n;\n\nconst { Panel, PanelBody, Button, Spinner } = wp.components;\nconst { PluginSidebar, PluginSidebarMoreMenuItem } = wp.editPost;\nconst { Fragment, useEffect, useState, useCallback } = wp.element;\nconst { dispatch, useSelect } = wp.data;\nconst { createBlock, getBlockType } = wp.blocks;\nconst { apiFetch } = wp;\n\nimport SearchForm from \"./SearchForm\";\nimport InserterShortcodeInput from \"./ShortcodeInput\";\nimport Video from \"./Video\";\nconst { parse } = wp.blockSerializationDefaultParser;\n\n//create your forceUpdate hook\nfunction useForceUpdate() {\n const [value, setValue] = useState(0); // integer state\n return () => setValue((value) => value + 1); // update the state to force render\n}\n\nexport default () => {\n const forceUpdate = useForceUpdate();\n const icon = (\n <svg viewBox=\"0 0 35 34\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <path\n d=\"M23.3722 16.9766L33.2059 11.2991L33.2059 22.6541L23.3722 16.9766Z\"\n fillOpacity=\"0.7\"\n />\n <path\n d=\"M23.3745 5.6227L33.2082 11.3002L23.3745 16.9776L23.3745 5.6227Z\"\n fillOpacity=\"0.75\"\n />\n <path\n d=\"M23.3745 5.62242L23.3745 16.9773L13.5409 11.2999L23.3745 5.62242Z\"\n fillOpacity=\"0.8\"\n />\n <path\n d=\"M23.399 5.613L13.5654 11.2905L13.5654 -0.0644536L23.399 5.613Z\"\n fillOpacity=\"0.85\"\n />\n <path\n d=\"M13.5699 11.3038L13.5699 22.6587L3.73623 16.9813L13.5699 11.3038Z\"\n fillOpacity=\"0.8\"\n />\n <path\n d=\"M13.5699 -0.0245525L13.5699 11.3304L3.73623 5.6529L13.5699 -0.0245525Z\"\n fillOpacity=\"0.9\"\n />\n <path\n d=\"M13.5699 22.6451L13.5699 34L3.73623 28.3226L13.5699 22.6451Z\"\n fillOpacity=\"0.7\"\n />\n <path\n d=\"M23.3745 16.9774L33.2082 22.6549L23.3745 28.3323L23.3745 16.9774Z\"\n fillOpacity=\"0.65\"\n />\n <path\n d=\"M3.73774 16.9774L13.5714 22.6549L3.73774 28.3323L3.73774 16.9774Z\"\n fillOpacity=\"0.75\"\n />\n <path\n d=\"M3.73774 5.63149L13.5714 11.3089L3.73774 16.9864L3.73774 5.63149Z\"\n fillOpacity=\"0.85\"\n />\n <path\n d=\"M23.3745 16.9772L23.3745 28.3321L13.5409 22.6546L23.3745 16.9772Z\"\n fillOpacity=\"0.6\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0\">\n <rect width=\"35\" height=\"34\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n );\n\n const [hasMore, setHasMore] = useState(false);\n const [page, setPage] = useState(1);\n const [isLoading, setIsLoading] = useState(false);\n\n // search\n const [search, setSearch] = useState(\"\");\n const searchFor = (term) => {\n setPage(1);\n setSearch(term);\n };\n const debounceOnSearch = useCallback(\n _.debounce((term) => {\n doFetch({ replace: true, term });\n }, 250),\n []\n );\n useEffect(() => {\n debounceOnSearch(search);\n }, [search]);\n\n // fetch\n useEffect(() => {\n setIsLoading(true);\n doFetch({ replace: false });\n }, [page]);\n\n // get from store\n const { videos, total_pages, hasResolved } = useSelect(\n (select) => {\n return select(\"presto-player/player\").getReusableVideos();\n },\n [search, page]\n );\n\n const doFetch = async ({ replace, term }) => {\n let res = await apiFetch({\n path: wp.url.addQueryArgs(`wp/v2/presto-videos`, {\n search: term,\n page,\n per_page: 10,\n }),\n parse: false,\n });\n let videos = await res.json();\n const total = res.headers && parseInt(res.headers.get(\"X-WP-Total\"));\n const total_pages =\n res.headers && parseInt(res.headers.get(\"X-WP-TotalPages\"));\n\n if (!replace) {\n dispatch(\"presto-player/player\").appendVideos(videos);\n dispatch(\"presto-player/player\").updateVideos({\n hasResolved: true,\n total,\n total_pages,\n });\n } else {\n dispatch(\"presto-player/player\").updateVideos({\n videos,\n hasResolved: true,\n total,\n total_pages,\n });\n }\n forceUpdate();\n setIsLoading(false);\n };\n\n useEffect(() => {\n setHasMore(page < total_pages);\n }, [page, total_pages]);\n\n const nextPage = () => {\n let newPage = page + 1;\n newPage = newPage > total_pages ? total_pages : newPage;\n setPage(newPage);\n };\n\n const getIcon = (video) => {\n const blocks = parse(video?.content?.raw);\n if (blocks?.[0]?.innerBlocks?.[0]?.blockName) {\n const type = getBlockType(blocks?.[0]?.innerBlocks?.[0]?.blockName);\n return type?.icon?.src ? type.icon.src : \"\";\n }\n return \"\";\n };\n\n const emptyPlaceholder = () => {\n if (videos.length) {\n return;\n }\n\n if (search) {\n return <p>{__(\"No videos found.\", \"presto-player\")}</p>;\n }\n\n return (\n <Button href=\"post-new.php?post_type=pp_video_block\" isSecondary>\n {__(\"Create A Reusable Video\", \"presto-player\")}\n </Button>\n );\n };\n\n const videosPanel = () => {\n if (!hasResolved) {\n return <Spinner />;\n }\n\n return (\n <div\n role=\"listbox\"\n className=\"block-editor-block-types-list presto-player__panel-grid-list\"\n style={{\n display: \"flex\",\n flexWrap: \"wrap\",\n }}\n aria-label={__(\"Media Hub\", \"presto-player\")}\n >\n {videos.length\n ? videos.map((video, i) => {\n return (\n <Video\n selectBlock={(e) => {\n dispatch(\"core/editor\").insertBlock(\n createBlock(\"presto-player/reusable-display\", {\n id: video?.id,\n })\n );\n }}\n icon={getIcon(video)}\n title={video?.title?.raw || \"Untitled\"}\n id={video?.id}\n i={i}\n key={video?.id}\n />\n );\n })\n : emptyPlaceholder()}\n {!search && hasMore && videos.length ? (\n <div\n style={{\n \"margin-top\": \"20px\",\n \"text-align\": \"center\",\n display: \"flex\",\n \"justify-content\": \"center\",\n width: \"100%\",\n }}\n >\n <Button isSecondary isSmall onClick={nextPage} isBusy={isLoading}>\n Load More\n </Button>\n </div>\n ) : (\n \"\"\n )}\n </div>\n );\n };\n\n return (\n <Fragment>\n <PluginSidebarMoreMenuItem target=\"presto-player-sidebar\" icon={icon}>\n {__(\"Presto Player\", \"presto-player\")}\n </PluginSidebarMoreMenuItem>\n <PluginSidebar\n name=\"presto-player-sidebar\"\n title={__(\"Presto Player\", \"presto-player\")}\n icon={icon}\n >\n <InserterShortcodeInput />\n\n <PanelBody title={__(\"Media Hub\", \"presto-player\")}>\n <SearchForm\n placeholder=\"Search media...\"\n value={search}\n onChange={(search) => searchFor(search)}\n />\n <div className=\"block-editor-inserter__panel-content\">\n {videosPanel()}\n </div>\n </PanelBody>\n </PluginSidebar>\n </Fragment>\n );\n};\n","import render from \"./render\";\n\n/**\n * Block Name\n */\nexport const name = \"presto-player\";\n\nexport const options = {\n render,\n};\n","/**\n * External dependencies\n */\n\nconst { noop } = lodash;\nimport classnames from \"classnames\";\nconst baseCurrentUrl = window.location.href;\nimport helpers from \"./helpers\";\n\n/**\n * WordPress dependencies\n */\nconst {\n Button,\n Notice,\n Placeholder,\n DropZone,\n withFilters,\n BaseControl,\n ToggleControl,\n FormFileUpload,\n} = wp.components;\n\nconst { __ } = wp.i18n;\nconst { useState, useEffect } = wp.element;\nconst { useSelect } = wp.data;\nconst deprecated = wp.deprecated;\nconst { MediaUpload, MediaUploadCheck, URLPopover } = wp.editor;\n// const { URLPopover } = wp.blockEditor;\n\nconst InsertFromURLPopover = ({ src, onChange, onSubmit, onClose }) => (\n <URLPopover onClose={onClose}>\n <form\n className=\"block-editor-media-placeholder__url-input-form\"\n onSubmit={onSubmit}\n >\n <input\n data-cy=\"url-input\"\n className=\"block-editor-media-placeholder__url-input-field\"\n type=\"url\"\n aria-label={__(\"URL\", \"presto-player\")}\n placeholder={__(\n \"Paste or type a Youtube, Vimeo or .mp4 video URL\",\n \"presto-player\"\n )}\n onChange={onChange}\n value={src}\n />\n <Button\n data-cy=\"url-submit\"\n className=\"block-editor-media-placeholder__url-input-submit-button\"\n icon={\"editor-break\"}\n label={__(\"Apply\", \"presto-player\")}\n type=\"submit\"\n />\n </form>\n </URLPopover>\n);\n\nexport function MediaPlaceholder({\n value = {},\n allowedTypes = [],\n className,\n icon,\n url = true,\n labels = {},\n mediaPreview,\n notices,\n isAppender,\n isPrivate,\n addToGallery,\n onSelect,\n onCancel,\n onSelectURL,\n onDoubleClick,\n children,\n allowURLs,\n}) {\n const mediaUpload = useSelect((select) => {\n const { getSettings } = select(\"core/block-editor\");\n return getSettings().mediaUpload;\n }, []);\n\n const [src, setSrc] = useState(\"\");\n const [isURLInputVisible, setIsURLInputVisible] = useState(false);\n\n useEffect(() => {\n setSrc(value?.src ?? \"\");\n }, [value]);\n\n const onChangeSrc = (event) => {\n setSrc(event.target.value);\n };\n\n const openURLInput = () => {\n setIsURLInputVisible(true);\n };\n\n const closeURLInput = () => {\n setIsURLInputVisible(false);\n };\n\n const onSubmitSrc = (event) => {\n event.preventDefault();\n if (src && onSelectURL) {\n onSelectURL(src);\n closeURLInput();\n }\n };\n\n const renderPlaceholder = (content, onClick) => {\n let { instructions, title } = labels;\n\n if (!mediaUpload && !onSelectURL) {\n instructions = __(\n \"To edit this block, you need permission to upload media.\",\n \"presto-player\"\n );\n }\n\n // set class names\n const placeholderClassName = classnames(\n \"block-editor-media-placeholder\",\n className,\n {\n \"is-appender\": isAppender,\n }\n );\n\n return (\n <Placeholder\n icon={icon}\n label={title}\n instructions={instructions}\n className={placeholderClassName}\n notices={notices}\n onClick={onClick}\n onDoubleClick={onDoubleClick}\n preview={mediaPreview}\n >\n {children}\n {content}\n </Placeholder>\n );\n };\n\n const renderCancelLink = () => {\n return (\n onCancel && (\n <Button\n className=\"block-editor-media-placeholder__cancel-button\"\n title={__(\"Cancel\", \"presto-player\")}\n isLink\n onClick={onCancel}\n >\n {__(\"Cancel\", \"presto-player\")}\n </Button>\n )\n );\n };\n\n const renderUrlSelectionUI = () => {\n return (\n onSelectURL && (\n <div className=\"block-editor-media-placeholder__url-input-container\">\n {url && (\n <Button\n data-cy=\"video-url\"\n className=\"block-editor-media-placeholder__button\"\n onClick={openURLInput}\n isPressed={isURLInputVisible}\n isTertiary\n >\n {__(\"Video URL\", \"presto-player\")}\n </Button>\n )}\n {isURLInputVisible && (\n <InsertFromURLPopover\n src={src}\n onChange={onChangeSrc}\n onSubmit={onSubmitSrc}\n onClose={closeURLInput}\n />\n )}\n </div>\n )\n );\n };\n\n const renderMediaUploadChecked = () => {\n const mediaLibraryButton = (\n <MediaUpload\n title={\n isPrivate\n ? __(\"Select or Upload Private Video\", \"presto-player\")\n : __(\"Select or Upload Video\", \"presto-player\")\n }\n addToGallery={addToGallery}\n gallery={false}\n multiple={false}\n onSelect={(event) => {\n // set private/public url params\n helpers.unsetUrlParams();\n onSelect(event);\n }}\n onClose={() => {\n // unset private/public url params\n helpers.unsetUrlParams();\n }}\n allowedTypes={allowedTypes}\n value={Array.isArray(value) ? value.map(({ id }) => id) : value.id}\n render={({ open }) => {\n return (\n <Button\n data-cy=\"add-video\"\n isPrimary\n onClick={(event) => {\n event.stopPropagation();\n helpers.unsetUrlParams();\n if (isPrivate) {\n helpers.setUrlPrivate(baseCurrentUrl);\n } else {\n helpers.setUrlPublic(baseCurrentUrl);\n }\n open();\n }}\n >\n {isPrivate\n ? __(\"Add/Select Private Video\", \"presto-player\")\n : __(\"Add/Select Video\", \"presto-player\")}\n </Button>\n );\n }}\n />\n );\n\n if (mediaUpload) {\n const content = (\n <>\n {mediaLibraryButton}\n {!!allowURLs && renderUrlSelectionUI()}\n {renderCancelLink()}\n </>\n );\n return renderPlaceholder(content);\n }\n\n return renderPlaceholder(mediaLibraryButton);\n };\n\n return (\n <MediaUploadCheck fallback={renderPlaceholder(renderUrlSelectionUI())}>\n {renderMediaUploadChecked()}\n </MediaUploadCheck>\n );\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/media-placeholder/README.md\n */\nexport default withFilters(\"editor.MediaPlaceholder\")(MediaPlaceholder);\n","const { __ } = wp.i18n;\nconst { withNotices, BaseControl, ToggleControl, Notice } = wp.components;\nconst { dispatch } = wp.data;\n\nimport MediaPlaceholder from \"@/admin/blocks/shared/placeholder\";\nimport ProBadge from \"@/admin/blocks/shared/components/ProBadge\";\n\n//constants\nconst ALLOWED_MEDIA_TYPES = [\"video\"];\n\nexport default withNotices(\n ({\n noticeUI,\n onSelect,\n children,\n onSelectURL,\n onUploadError,\n setAttributes,\n attributes,\n }) => {\n const { visibility } = attributes;\n const isPrivate = visibility === \"private\";\n\n return (\n <div>\n <MediaPlaceholder\n icon={\n isPrivate ? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"presto-block-icon\"\n >\n <rect x=\"3\" y=\"11\" width=\"18\" height=\"11\" rx=\"2\" ry=\"2\"></rect>\n <path d=\"M7 11V7a5 5 0 0 1 10 0v4\"></path>\n </svg>\n ) : (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"presto-block-icon\"\n >\n <polygon points=\"23 7 16 12 23 17 23 7\"></polygon>\n <rect x=\"1\" y=\"5\" width=\"15\" height=\"14\" rx=\"2\" ry=\"2\"></rect>\n </svg>\n )\n }\n labels={{\n title: isPrivate\n ? __(\"Presto Private Video\", \"presto-player\")\n : __(\"Presto Video\", \"presto-player\"),\n instructions: isPrivate\n ? __(\n \"Upload a video file, or pick one from your media library.\",\n \"presto-player\"\n )\n : __(\n \"Upload a video file, pick one from your media library, or add one with a URL.\",\n \"presto-player\"\n ),\n }}\n onSelect={onSelect}\n onSelectURL={onSelectURL}\n switcher={true}\n isPrivate={isPrivate}\n allowURLs={!isPrivate}\n accept=\"video/*\"\n setAttributes={setAttributes}\n allowedTypes={ALLOWED_MEDIA_TYPES}\n value={attributes}\n notices={noticeUI}\n onError={onUploadError}\n >\n <div style={{ width: \"100%\" }}>\n <BaseControl className=\"presto-player__placeholder-control\">\n <ToggleControl\n label={\n <div>\n {__(\"Make Private\", \"presto-player\")}{\" \"}\n {!prestoPlayer?.isPremium && <ProBadge />}\n </div>\n }\n help={\n isPrivate\n ? __(\n \"This video is only accessible to those who are logged in.\",\n \"presto-player\"\n )\n : __(\n \"This video is currently accessible to everyone.\",\n \"presto-player\"\n )\n }\n checked={isPrivate}\n onChange={(isPrivate) => {\n if (!prestoPlayer?.isPremium) {\n dispatch(\"presto-player/player\").setProModal(true);\n return;\n }\n setAttributes({\n visibility: isPrivate ? \"private\" : \"public\",\n });\n }}\n />\n </BaseControl>\n\n {!!children && <div style={{ width: \"100%\" }}>{children}</div>}\n\n {!!isPrivate && (\n <Notice status=\"warning\" isDismissible={false}>\n <div>\n <div>\n <strong>{__(\"Note\", \"presto-player\")}</strong>\n </div>\n {__(\n \"Private videos use php to stream your video. Keep in mind this will use up disk space and bandwidth so it may not be an appropriate choice for some hosts.\",\n \"presto-player\"\n )}\n </div>\n </Notice>\n )}\n </div>\n </MediaPlaceholder>\n </div>\n );\n }\n);\n","/**\n * WordPress dependencies\n */\nconst { __ } = wp.i18n;\nconst { getBlobByURL, isBlobURL } = wp.blob;\nconst {\n Button,\n Disabled,\n Toolbar,\n Notice,\n withNotices,\n Placeholder,\n Spinner,\n} = wp.components;\n\nconst { BlockControls, InspectorControls } = wp.editor;\nconst { compose } = wp.compose;\nconst { useEffect, useState } = wp.element;\nconst { dispatch } = wp.data;\nconst { createBlock } = wp.blocks;\n\nimport { isHLS } from \"@/shared/util\";\n\n// hocs\nimport withPlayerEdit from \"../with-player-edit\";\nimport withPlayerData from \"../with-player-data\";\n\n/**\n * Internal dependencies\n */\nimport HostedPlaceholder from \"./HostedPlaceholder\";\nimport TracksEditor from \"@/admin/blocks/shared/tracks/TracksEditor\";\nimport BlockInspectorControls from \"@/admin/blocks/shared/BlockInspectorControls\";\nimport Player from \"@/admin/blocks/shared/Player\";\n\nimport { determineVideoUrlType } from \"@/shared/util.js\";\n\n//constants\nconst ALLOWED_MEDIA_TYPES = [\"video\"];\n\nexport default compose([withPlayerData(), withPlayerEdit()])(\n withNotices(\n ({\n noticeUI,\n attributes,\n setAttributes,\n isSelected,\n noticeOperations,\n branding,\n loading,\n presetData,\n createVideo,\n onRemoveSrc,\n renderKey,\n lockSave,\n unlockSave,\n clientId,\n defaultPreset,\n }) => {\n const { poster, src, id, tracks } = attributes;\n const [upgradeNotice, setUpgradeNotice] = useState(\"\");\n\n const showNotice = (e) => {\n noticeOperations.removeAllNotices();\n noticeOperations.createErrorNotice(e?.message);\n };\n\n useEffect(() => {\n if (!id && isBlobURL(src)) {\n const file = getBlobByURL(src);\n if (file) {\n mediaUpload({\n filesList: [file],\n onFileChange: ([{ url }]) => {\n setAttributes({ src: url });\n },\n onError: (message) => {\n noticeOperations.createErrorNotice(message);\n },\n allowedTypes: ALLOWED_MEDIA_TYPES,\n });\n }\n }\n }, []);\n\n function onSelectVideo(media) {\n if (!media || !media.url) {\n // in this case there was an error\n // previous attributes should be removed\n // because they may be temporary blob urls\n setAttributes({ src: undefined, id: undefined });\n return;\n }\n // sets the block's attribute and updates the edit component from the\n // selected media\n setAttributes({\n src: media.url,\n preset: defaultPreset?.id,\n attachment_id: media.id,\n });\n\n lockSave();\n createVideo({\n src: media.url,\n type: \"attachment\",\n attachment_id: media.id,\n })\n .catch((e) => {\n setAttributes({ src: \"\" });\n showNotice(e);\n })\n .finally(unlockSave);\n }\n\n function onSelectURL(newSrc) {\n setAttributes({ attachment_id: null });\n if (newSrc && isHLS(newSrc)) {\n if (!prestoPlayer?.isPremium) {\n setUpgradeNotice(\n <Notice status=\"info\" onRemove={() => setUpgradeNotice(\"\")}>\n <div>\n <div>\n <strong>\n {__(\n \"Get HLS Streaming and more with Presto Player Pro!\",\n \"presto-player\"\n )}\n </strong>\n </div>\n\n {__(\n \"Stream HLS links and more with Presto Player Pro.\",\n \"presto-player\"\n )}\n <div\n style={{\n marginTop: \"1em\",\n }}\n >\n <Button isPrimary>{__(\"Upgrade\", \"presto-player\")}</Button>\n </div>\n </div>\n </Notice>\n );\n return;\n }\n }\n\n if (newSrc !== src) {\n const { type } = determineVideoUrlType(newSrc);\n if (type === \"youtube\") {\n const youtubeBlock = createBlock(\"presto-player/youtube\", {\n src: newSrc,\n });\n dispatch(\"core/editor\").replaceBlock(clientId, youtubeBlock);\n return;\n }\n\n if (type === \"vimeo\") {\n const vimeoBlock = createBlock(\"presto-player/vimeo\", {\n src: newSrc,\n });\n dispatch(\"core/editor\").replaceBlock(clientId, vimeoBlock);\n return;\n }\n\n setAttributes({ src: newSrc, attachmend_id: null });\n setAttributes({ preset: defaultPreset?.id });\n\n lockSave();\n createVideo({ src: newSrc, type: \"link\" })\n .catch((e) => {\n setAttributes({ src: \"\" });\n showNotice(e);\n })\n .finally(unlockSave);\n }\n }\n\n function onUploadError(message) {\n noticeOperations.removeAllNotices();\n noticeOperations.createErrorNotice(message);\n }\n\n if (!src) {\n return (\n <div>\n <HostedPlaceholder\n onSelect={onSelectVideo}\n onSelectURL={onSelectURL}\n setAttributes={setAttributes}\n attributes={attributes}\n onError={onUploadError}\n >\n {upgradeNotice}\n </HostedPlaceholder>\n </div>\n );\n }\n\n // loading presets still\n if (loading || !id) {\n return (\n <Placeholder className=\"presto-player__placeholder is-loading\">\n <Spinner />\n </Placeholder>\n );\n }\n\n return (\n <div>\n <BlockControls>\n <TracksEditor\n tracks={tracks}\n onChange={(newTracks) => {\n setAttributes({ tracks: newTracks });\n }}\n />\n <Toolbar>\n <Button onClick={() => onRemoveSrc()}>\n {__(\"Replace\", \"presto-player\")}\n </Button>\n </Toolbar>\n </BlockControls>\n\n <InspectorControls>\n <BlockInspectorControls\n setAttributes={setAttributes}\n attributes={attributes}\n />\n </InspectorControls>\n\n <figure>\n {/*\n Disable the video tag so the user clicking on it won't play the\n video when the controls are enabled.\n */}\n <Disabled>\n <Player\n poster={poster}\n src={src}\n id={id}\n type={\"hosted\"}\n attributes={attributes}\n setAttributes={setAttributes}\n preset={presetData}\n branding={branding}\n key={renderKey}\n />\n </Disabled>\n </figure>\n </div>\n );\n }\n )\n);\n","const { __ } = wp.i18n;\nimport edit from \"./edit\";\nimport blockOptions from \"../block-options\";\n\n/**\n * Block Name\n */\nexport const name = \"presto-player/self-hosted\";\n\n/**\n * Block Options\n */\nexport const options = {\n ...blockOptions,\n\n title: __(\"Presto Video\", \"presto-player\"),\n\n description: __(\"Presto Self-hosted video block.\", \"presto-player\"),\n\n variations: [\n {\n name: \"public\",\n isDefault: true,\n title: __(\"Presto Video\", \"presto-player\"),\n description: __(\"Presto Self-hosted video block.\", \"presto-player\"),\n attributes: { visibility: \"public\" },\n },\n ...(prestoPlayer?.isPremium\n ? [\n {\n name: \"private\",\n title: __(\"Presto Private Video\", \"presto-player\"),\n icon: (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"presto-block-icon\"\n >\n <rect x=\"3\" y=\"11\" width=\"18\" height=\"11\" rx=\"2\" ry=\"2\"></rect>\n <path d=\"M7 11V7a5 5 0 0 1 10 0v4\"></path>\n </svg>\n ),\n description: __(\n \"Private video self-hosted block.\",\n \"presto-player\"\n ),\n attributes: { visibility: \"private\" },\n },\n ]\n : []),\n ],\n\n icon: (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"presto-block-icon\"\n >\n <polygon points=\"23 7 16 12 23 17 23 7\"></polygon>\n <rect x=\"1\" y=\"5\" width=\"15\" height=\"14\" rx=\"2\" ry=\"2\"></rect>\n </svg>\n ),\n\n edit,\n};\n","// In your application's entrypoint\nconst { __ } = wp.i18n;\nconst { InnerBlocks, useBlockProps } = wp.blockEditor;\nconst { BlockControls, InspectorControls } = wp.editor;\nconst {\n Disabled,\n Toolbar,\n Button,\n PanelBody,\n Panel,\n Placeholder,\n Spinner,\n} = wp.components;\nconst { useSelect, dispatch } = wp.data;\nconst { useState, useEffect } = wp.element;\nconst { parse } = wp.blockSerializationDefaultParser;\n\nexport default ({ attributes, isSelected, clientId }) => {\n const { id } = attributes;\n const blockProps = useBlockProps();\n const [hasResolved, setHasResolved] = useState(false);\n const [block, setBlock] = useState([]);\n const [link, setLink] = useState(\"\");\n\n const video = useSelect((select) => {\n if (!id) {\n return;\n }\n return select(\"presto-player/player\").getReusableVideo(id);\n });\n\n useEffect(() => {\n wp.data.dispatch(\"core/block-editor\").selectBlock(clientId);\n }, [hasResolved]);\n\n // lock inner blocks\n const innerBlocks = useSelect((select) => {\n return select(\"core/editor\").getBlocksByClientId(clientId)[0].innerBlocks;\n });\n if (innerBlocks && video?.id) {\n innerBlocks.forEach(function (block) {\n dispatch(\"core/editor\").updateBlockAttributes(block.clientId, {\n selectionOverrideClientId: clientId,\n });\n });\n }\n\n useEffect(() => {\n if (video.id) {\n setHasResolved(true);\n // set inner block\n const blocks = parse(video?.content?.raw);\n setBlock([\n blocks?.[0]?.innerBlocks[0].blockName,\n blocks?.[0]?.innerBlocks[0].attrs,\n ]);\n\n setLink(`post.php?post=${video.id}&action=edit`);\n }\n }, [video]);\n\n if (!hasResolved) {\n return (\n <div {...blockProps}>\n <Placeholder>\n <Spinner />\n </Placeholder>\n </div>\n );\n }\n\n if (!block) {\n return;\n }\n\n return (\n <>\n <InspectorControls>\n <PanelBody>\n <p>\n This is a reusable video that you can edit once and place anywhere.\n </p>\n <Button isSecondary href={\"edit.php?post_type=pp_video_block\"}>\n {__(\"Manage Media Hub\", \"presto-player\")}\n </Button>\n </PanelBody>\n </InspectorControls>\n <div className={\"block-library-block__reusable-block-container\"}>\n <div {...blockProps}>\n {isSelected && (\n <div className=\"reusable-block-edit-panel\">\n <b className=\"reusable-block-edit-panel__info\">\n {video?.title?.raw}\n </b>\n <Button\n isSecondary\n href={link}\n className=\"reusable-block-edit-panel__button\"\n >\n {__(\"Edit Reusable Video\", \"presto-player\")}\n </Button>\n </div>\n )}\n <Disabled>\n <InnerBlocks\n template={[block]}\n templateLock={\"all\"}\n renderAppender={false}\n />\n </Disabled>\n </div>\n </div>\n </>\n );\n};\n","// In your application's entrypoint\nconst { InnerBlocks, useBlockProps } = wp.blockEditor;\nimport edit from \"./edit\";\n\n/**\n * Block Name\n */\nexport const name = \"presto-player/reusable-display\";\n\n/**\n * Block Options\n */\nexport const options = {\n title: \"Reusable Block Display\",\n\n category: \"presto\",\n\n attributes: {\n id: Number,\n },\n\n supports: {\n align: true,\n inserter: false,\n reusable: false,\n html: false,\n },\n\n icon: (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"presto-block-icon\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n <line x1=\"2\" y1=\"12\" x2=\"22\" y2=\"12\"></line>\n <path d=\"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z\"></path>\n </svg>\n ),\n\n edit,\n\n // dynamic save function\n save: function () {\n return null;\n },\n};\n","/**\n * WordPress dependencies\n */\nconst {\n Button,\n Disabled,\n Toolbar,\n Placeholder,\n Spinner,\n withNotices,\n} = wp.components;\nconst { BlockControls, InspectorControls } = wp.editor;\nconst { useEffect } = wp.element;\nconst { __ } = wp.i18n;\nconst { compose } = wp.compose;\n\n// hocs\nimport withPlayerEdit from \"../with-player-edit\";\nimport withPlayerData from \"../with-player-data\";\n\n/**\n * Internal dependencies\n */\n// import TracksEditor from \"@/admin/blocks/shared/tracks/TracksEditor\";\nimport BlockInspectorControls from \"@/admin/blocks/shared/BlockInspectorControls\";\nimport Player from \"@/admin/blocks/shared/Player\";\nimport LinkPlaceholder from \"@/admin/blocks/shared/LinkPlaceholder\";\nimport { getVimeoId } from \"@/shared/util.js\";\nimport { usePrevious } from \"@/admin/blocks/util\";\n\nexport default compose([withPlayerData(), withPlayerEdit()])(\n withNotices(\n ({\n attributes,\n setAttributes,\n branding,\n noticeOperations,\n loading,\n createVideo,\n lockSave,\n unlockSave,\n presetData,\n onRemoveSrc,\n renderKey,\n }) => {\n const { poster, src, id } = attributes;\n\n const showNotice = (e) => {\n noticeOperations.removeAllNotices();\n noticeOperations.createErrorNotice(e?.message);\n };\n\n // make sure to save/get attachment id if src is set\n const prevSrc = usePrevious(src);\n useEffect(() => {\n // reset id only if we're changing the src\n if (prevSrc) {\n setAttributes({ id: 0 });\n }\n let video_id = getVimeoId(src);\n setAttributes({ video_id });\n\n lockSave();\n createVideo({ src, external_id: video_id, type: \"vimeo\" })\n .catch((e) => {\n setAttributes({ src: \"\" });\n showNotice(e);\n })\n .finally(unlockSave);\n }, [src]);\n\n // handle url update\n function onSelectURL(newSrc) {\n if (newSrc !== src) {\n setAttributes({ src: newSrc });\n }\n }\n\n if (!src) {\n return (\n <div>\n <LinkPlaceholder\n icon={\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"presto-block-icon\"\n >\n <path d=\"M22.875 10.063c-2.442 5.217-8.337 12.319-12.063 12.319-3.672 0-4.203-7.831-6.208-13.043-.987-2.565-1.624-1.976-3.474-.681l-1.128-1.455c2.698-2.372 5.398-5.127 7.057-5.28 1.868-.179 3.018 1.098 3.448 3.832.568 3.593 1.362 9.17 2.748 9.17 1.08 0 3.741-4.424 3.878-6.006.243-2.316-1.703-2.386-3.392-1.663 2.673-8.754 13.793-7.142 9.134 2.807z\" />\n </svg>\n }\n label={__(\"Presto Vimeo Video\", \"presto-player\")}\n instructions={__(\"Enter Vimeo Video URL\", \"presto-player\")}\n placeholder={__(\"Vimeo URL\", \"presto-player\")}\n attributes={attributes}\n setAttributes={setAttributes}\n onSelectURL={onSelectURL}\n />\n </div>\n );\n }\n\n // loading presets or id still\n if (loading || !id) {\n return (\n <Placeholder className=\"presto-player__placeholder is-loading\">\n <Spinner />\n </Placeholder>\n );\n }\n\n return (\n <>\n <BlockControls>\n <Toolbar>\n {/* <TracksEditor\n tracks={tracks}\n onChange={(newTracks) => {\n setAttributes({ tracks: newTracks });\n }}\n /> */}\n <Button onClick={() => onRemoveSrc()}>\n {__(\"Replace\", \"presto-player\")}\n </Button>\n </Toolbar>\n </BlockControls>\n\n <InspectorControls>\n <BlockInspectorControls\n setAttributes={setAttributes}\n attributes={attributes}\n />\n </InspectorControls>\n\n <figure>\n {/*\n Disable the video tag so the user clicking on it won't play the\n video when the controls are enabled.\n */}\n <Disabled>\n <Player\n poster={poster}\n src={src}\n type=\"vimeo\"\n id={id}\n attributes={attributes}\n setAttributes={setAttributes}\n preset={presetData}\n branding={branding}\n key={renderKey}\n />\n </Disabled>\n </figure>\n </>\n );\n }\n )\n);\n","const { __ } = wp.i18n;\nimport edit from \"./edit\";\nimport blockOptions from \"../block-options\";\n\n/**\n * Block Name\n */\nexport const name = \"presto-player/vimeo\";\n\n/**\n * Block Options\n */\nexport const options = {\n ...blockOptions,\n\n attributes: {\n ...blockOptions.attributes,\n video_id: {\n type: String,\n },\n },\n\n title: __(\"Presto Vimeo Video\", \"presto-player\"),\n\n description: __(\n \"A vimeo video wrapped in an awesome player.\",\n \"presto-player\"\n ),\n\n icon: (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"presto-block-icon\"\n >\n <path d=\"M22.875 10.063c-2.442 5.217-8.337 12.319-12.063 12.319-3.672 0-4.203-7.831-6.208-13.043-.987-2.565-1.624-1.976-3.474-.681l-1.128-1.455c2.698-2.372 5.398-5.127 7.057-5.28 1.868-.179 3.018 1.098 3.448 3.832.568 3.593 1.362 9.17 2.748 9.17 1.08 0 3.741-4.424 3.878-6.006.243-2.316-1.703-2.386-3.392-1.663 2.673-8.754 13.793-7.142 9.134 2.807z\" />\n </svg>\n ),\n\n edit,\n};\n","/**\n * WordPress dependencies\n */\nconst {\n Button,\n Disabled,\n Toolbar,\n Placeholder,\n Spinner,\n withNotices,\n} = wp.components;\nconst { BlockControls, InspectorControls } = wp.editor;\nconst { useEffect } = wp.element;\nconst { __ } = wp.i18n;\nconst { compose } = wp.compose;\n\n// hocs\nimport withPlayerEdit from \"../with-player-edit\";\nimport withPlayerData from \"../with-player-data\";\n\n/**\n * Internal dependencies\n */\nimport BlockInspectorControls from \"@/admin/blocks/shared/BlockInspectorControls\";\nimport Player from \"@/admin/blocks/shared/Player\";\nimport LinkPlaceholder from \"@/admin/blocks/shared/LinkPlaceholder\";\nimport { getYoutubeId } from \"@/shared/util.js\";\nimport { usePrevious } from \"@/admin/blocks/util\";\n\nexport default compose([withPlayerData(), withPlayerEdit()])(\n withNotices(\n ({\n attributes,\n setAttributes,\n noticeOperations,\n branding,\n createVideo,\n loading,\n presetData,\n onRemoveSrc,\n lockSave,\n unlockSave,\n renderKey,\n }) => {\n const { poster, src, id } = attributes;\n\n const showNotice = (e) => {\n noticeOperations.removeAllNotices();\n noticeOperations.createErrorNotice(e?.message);\n };\n\n // make sure to save/get attachment id if src is set\n const prevSrc = usePrevious(src);\n useEffect(() => {\n // reset id only if we're changing the src\n if (prevSrc) {\n setAttributes({ id: 0 });\n }\n let video_id = getYoutubeId(src);\n setAttributes({ video_id });\n\n lockSave();\n createVideo({ src, external_id: video_id, type: \"youtube\" })\n .catch((e) => {\n setAttributes({ src: \"\" });\n showNotice(e);\n })\n .finally(unlockSave);\n }, [src]);\n\n // handle url update\n function onSelectURL(newSrc) {\n if (newSrc !== src) {\n setAttributes({ src: newSrc });\n }\n }\n\n if (!src) {\n return (\n <div>\n <LinkPlaceholder\n icon={\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"presto-block-icon\"\n >\n <path d=\"M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2 29 29 0 0 0 .46-5.25 29 29 0 0 0-.46-5.33z\"></path>\n <polygon points=\"9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02\"></polygon>\n </svg>\n }\n label={__(\"Presto Youtube Video\", \"presto-player\")}\n instructions={__(\"Enter Youtube Video URL\", \"presto-player\")}\n placeholder={__(\"Youtube URL\", \"presto-player\")}\n attributes={attributes}\n setAttributes={setAttributes}\n onSelectURL={onSelectURL}\n />\n </div>\n );\n }\n\n // loading presets or id still\n if (loading || !id) {\n return (\n <Placeholder className=\"presto-player__placeholder is-loading\">\n <Spinner />\n </Placeholder>\n );\n }\n\n return (\n <>\n <BlockControls>\n <Toolbar>\n <Button onClick={() => onRemoveSrc()}>\n {__(\"Replace\", \"presto-player\")}\n </Button>\n </Toolbar>\n </BlockControls>\n\n <InspectorControls>\n <BlockInspectorControls\n setAttributes={setAttributes}\n attributes={attributes}\n />\n </InspectorControls>\n\n <figure>\n {/*\n Disable the video tag so the user clicking on it won't play the\n video when the controls are enabled.\n\t\t\t\t*/}\n <Disabled>\n <Player\n poster={poster}\n src={src}\n type=\"youtube\"\n id={id}\n attributes={attributes}\n setAttributes={setAttributes}\n preset={presetData}\n branding={branding}\n key={renderKey}\n />\n </Disabled>\n </figure>\n </>\n );\n }\n )\n);\n","// In your application's entrypoint\nconst { __ } = wp.i18n;\nimport edit from \"./edit\";\nimport blockOptions from \"../block-options\";\n\n/**\n * Block Name\n */\nexport const name = \"presto-player/youtube\";\n\n/**\n * Block Options\n */\nexport const options = {\n ...blockOptions,\n\n attributes: {\n ...blockOptions.attributes,\n video_id: {\n type: String,\n },\n },\n\n title: __(\"Presto Youtube Video\", \"presto-player\"),\n\n description: __(\n \"A youtube video wrapped in an awesome player.\",\n \"presto-player\"\n ),\n\n icon: (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"presto-block-icon\"\n >\n <path d=\"M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2 29 29 0 0 0 .46-5.25 29 29 0 0 0-.46-5.33z\"></path>\n <polygon points=\"9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02\"></polygon>\n </svg>\n ),\n\n edit,\n};\n"],"sourceRoot":""}
|
|
dist/blocks/admin-3536c985.js
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
*
|
3 |
+
* Presto Player
|
4 |
+
*
|
5 |
+
* @author Presto Made, Inc
|
6 |
+
* @version 0.1.0
|
7 |
+
* @link undefined
|
8 |
+
* @license GPL
|
9 |
+
*
|
10 |
+
* Copyright (c) 2022 Presto Made, Inc
|
11 |
+
*
|
12 |
+
* This software is released under the GPL License
|
13 |
+
* https://opensource.org/licenses/GPL
|
14 |
+
*
|
15 |
+
* Compiled with the help of https://wpack.io
|
16 |
+
* A zero setup Webpack Bundler Script for WordPress
|
17 |
+
*/
|
18 |
+
(window.wpackioprestoPlayerblocksJsonp=window.wpackioprestoPlayerblocksJsonp||[]).push([[0],[,,,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},,,,,function(e,t,r){"use strict";r.d(t,"f",(function(){return l})),r.d(t,"d",(function(){return c})),r.d(t,"e",(function(){return i})),r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return p})),r.d(t,"a",(function(){return u}));var n=wp.element,a=n.useRef,o=n.useEffect;function l(e){var t=a();return o((function(){t.current=e})),t.current}function c(e){var t=e.status,r=void 0===t?"success":t,n=e.message;wp.data.dispatch("core/notices").createNotice(r,n,{type:"snackbar"})}function i(e){var t,r=e.split(":");return r.length>1&&(t=60*parseInt(r[0])),parseInt(r[1])+parseInt(t)}function s(e){var t=parseInt(e,10),r=Math.floor(t/60);return t<10&&(t="0"+t),r+":"+t}function p(e){var t=e;if(!(t=t.replace(/[^\d\d:\d\d.-]/g,"")).includes(":"))return"".concat(t,":00");0===t.substr(0,t.indexOf(":")).length&&(t="0".concat(t));var r=t.indexOf(":");return t=t.substring(0,r+3)}function u(e){if(e){if(e.match(/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/))return"youtube";if(e.match(/(https?:\/\/)?(www\.)?(player\.)?vimeo\.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/))return"vimeo";if(e.indexOf("https://vz-")>-1&&e.indexOf("b-cdn.net")>-1)return"bunny";if(e.indexOf(".mp3")>-1)return"audio"}return"self-hosted"}},function(e,t,r){"use strict";var n=wp.i18n.__;t.a=function(){return React.createElement("div",{className:"presto-player__pro-badge"},n("Pro","presto-player"))}},,function(e,t,r){"use strict";var n=r(1),a=r(0),o=wp.components,l=o.ColorPicker,c=o.ColorIndicator,i=o.Popover,s=o.Button,p=(o.Flex,wp.element),u=p.useState,d=p.useEffect,b=wp.i18n.__;t.a=function(e){var t=e.color,r=e.setColor,o=e.onFocus,p=u(!1),m=Object(n.a)(p,2),y=m[0],v=m[1],f=u(t),h=Object(n.a)(f,2),O=h[0],g=h[1];return d((function(){y&&t&&g(t)}),[y]),Object(a.b)("span",null,Object(a.b)(c,{css:{width:"25px",height:"25px",borderRadius:"9999px"},colorValue:t,onClick:function(){v(!y),o&&o()}}),!!y&&Object(a.b)(i,{position:"bottom left",focusOnMount:!0,onFocusOutside:function(e){v(!1)}},Object(a.b)(l,{color:t||"",onChangeComplete:function(e){return(null==e?void 0:e.hex)&&r(e)},disableAlpha:!0}),Object(a.b)("div",{css:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px"}},Object(a.b)(s,{css:{margin:"0 5px"},isTertiary:!0,onClick:function(){r({hex:null}),v(!1)}},b("Reset","presto-player")),Object(a.b)("div",{css:{display:"flex",justifyContent:"flex-end",padding:"10px"}},Object(a.b)(s,{css:{margin:"0 5px"},isTertiary:!0,onClick:function(){r({hex:O}),v(!1)}},b("Cancel","presto-player")),Object(a.b)(s,{isPrimary:!0,onClick:function(){return v(!1)}},b("Apply","presto-player"))))))}},function(e,t){e.exports=window.wp.element},function(e,t,r){"use strict";var n=r(5),a=r(23),o=r(9);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var i=wp.data.useSelect;t.a=function(e){var t,r,n,l=e.src,s=e.classes,p=e.preset,u=e.branding,d=e.attributes,b=e.adminPreview,m=e.currentTime,y=e.preload,v=void 0===y?"metadata":y,f=e.overlays,h=e.type,O=d.chapters,g=d.mutedOverlay,j=d.mutedPreview,w=i((function(e){var t;return null===(t=e("presto-player/player"))||void 0===t?void 0:t.youtube()})),_=i((function(e){var t;return null===(t=e("presto-player/player"))||void 0===t?void 0:t.playerCSS()}));return React.createElement("div",{className:"wp-block-video presto-block-video",style:"audio"===h?c(c(c({"--presto-player-border-radius":"".concat(null==p?void 0:p.border_radius,"px")},null!=p&&p.background_color?{"--plyr-audio-controls-background":p.background_color}:{"--plyr-audio-controls-background":null==u?void 0:u.color}),null!=p&&p.control_color?{"--plyr-audio-control-color":p.control_color,"--plyr-range-thumb-background":p.control_color,"--plyr-range-fill-background":p.control_color,"--plyr-audio-progress-buffered-background":function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=e.replace("#","");3===r.length&&(r=r[0]+r[0]+r[1]+r[1]+r[2]+r[2]);var n=parseInt(r.substring(0,2),16),a=parseInt(r.substring(2,4),16),o=parseInt(r.substring(4,6),16);return t>1&&t<=100&&(t/=100),"rgba("+n+","+a+","+o+","+t+")"}(p.control_color||(null==u?void 0:u.color)||"#00b3ff",.5)}:{"--plyr-audio-control-color":"#ffffff","--plyr-range-thumb-background":"#ffffff","--plyr-range-fill-background":"#ffffff"}),{},{"--plyr-range-thumb-shadow":"0px"}):c(c(c({"--presto-player-border-radius":"".concat(null==p?void 0:p.border_radius,"px")},null!=p&&p.caption_background?{"--plyr-captions-background":p.caption_background}:{}),null!=u&&u.color?{"--plyr-color-main":u.color}:{}),{},{"--presto-player-email-border-radius":"".concat((null==p||null===(t=p.email_collection)||void 0===t?void 0:t.border_radius)||0,"px"),"--presto-player-logo-width":"".concat((null==u?void 0:u.logo_width)||75,"px")})},React.createElement(a.c,{src:l,css:_,classes:s,currentTime:m,overlays:f,isAdmin:!0,preload:v,preset:p,bunny:{thumbnail:null==d?void 0:d.previewThumbnail,preview:null==d?void 0:d.preview},youtube:{channelId:null==w?void 0:w.channel_id},tracks:!(null==p||!p.captions)&&[{kind:"captions",label:"English",srclang:"en",src:"/path/to/captions.en.vtt",default:!0}],branding:u,chapters:O,blockAttributes:d,poster:d.poster,provider:"audio"===h?"audio":Object(o.a)(l),mediaTitle:d.title},React.createElement("div",{slot:"player-end"},(null==j?void 0:j.enabled)&&(null==g?void 0:g.enabled)&&React.createElement("div",{className:"presto-player__overlay is-image",style:{position:"absolute",width:"".concat((null==g?void 0:g.width)||100,"%"),left:"".concat(100*((null==g||null===(r=g.focalPoint)||void 0===r?void 0:r.x)||.5),"%"),top:"".concat(100*((null==g||null===(n=g.focalPoint)||void 0===n?void 0:n.y)||.5),"%")}},React.createElement("img",{src:null==g?void 0:g.src,style:{transform:"translateX(-50%) translateY(-50%)"}})),b)))}},function(e,t,r){"use strict";var n={setUrlPrivate:function(){var e=-1===window.location.href.indexOf("?")?"?":"&",t=window.location.href+e+"presto_video_type=private";window.history.pushState({path:t},"",t)},setUrlPublic:function(){var e=-1===window.location.href.indexOf("?")?"?":"&",t=window.location.href+e+"presto_video_type=public";window.history.pushState({path:t},"",t)},unsetUrlParams:function(){var e=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=new URL(e);return t.forEach((function(e){r.searchParams.delete(e)})),r.href}(window.location.href,["presto_video_type"]);window.history.pushState({path:e},"",e)}};t.a=n},function(e,t){e.exports=window.wp.data},function(e,t,r){"use strict";var n,a=r(5),o=(n={visibility:{type:String,default:"public"},color:{type:String,default:"#00b3ff"},blockAlignment:{type:String},mutedPreview:{type:Object,default:{enabled:!1,captions:!1}},mutedOverlay:{type:Object,default:{enabled:!1,src:"",width:200,focalPoint:{x:.5,y:.5}}},mutedPreviewCaptions:{type:Boolean},mutedOverlayType:{type:String,default:"text"},mutedOverlayText:{type:String,default:"Click to play"},mutedOverlaySrc:{type:String},mutedOverlayImageWidth:{type:Number,default:200},mutedOverlayFocalPoint:{type:Object}},Object(a.a)(n,"mutedOverlay",{type:Object,default:{enabled:!1,type:"text",text:"",src:"",width:200,focalPoint:{x:.5,y:.5}}}),Object(a.a)(n,"autoplay",{type:Boolean}),Object(a.a)(n,"preload",{type:String}),Object(a.a)(n,"playsInline",{type:Boolean}),Object(a.a)(n,"id",{type:Number}),Object(a.a)(n,"attachment_id",{type:Number}),Object(a.a)(n,"src",{type:String}),Object(a.a)(n,"imageID",{type:Number}),Object(a.a)(n,"poster",{type:String}),Object(a.a)(n,"content",{type:Boolean}),Object(a.a)(n,"preset",{type:Number}),Object(a.a)(n,"chapters",{type:Array,default:[]}),Object(a.a)(n,"overlays",{type:Array,default:[]}),Object(a.a)(n,"tracks",{type:"array",items:{type:"object"},default:[]}),n);t.a={attributes:o,category:"presto",supports:{align:!0},save:function(){return null}}},function(e,t,r){"use strict";function n(e){var t,r=(e||"").match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);return r&&11===(null==r||null===(t=r[2])||void 0===t?void 0:t.length)?r[2]:null}function a(e){var t=/^.*(vimeo\.com\/)((channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/))?([0-9]+)/.exec(e||"");return(null==t?void 0:t[5])||""}function o(e){var t=a(e);if(t)return{video_id:t,type:"vimeo"};var r=n(e);return r?{video_id:r,type:"youtube"}:{$video_id:0,$type:"none"}}function l(e){return"string"==typeof e&&e.includes(".m3u8")}r.d(t,"c",(function(){return n})),r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return o})),r.d(t,"d",(function(){return l}))},,function(e,t,r){"use strict";var n=r(5),a=r(7),o=r(1),l=r(2),c=r.n(l),i=r(9),s=r(33);function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d=wp.compose.createHigherOrderComponent,b=wp.element,m=b.useEffect,y=b.useState;t.a=function(){return d((function(e){return function(t){var r=t.presets,n=t.attributes,l=t.setAttributes,p=t.defaultPreset,d=t.isSelected,b=t.branding,v=y({}),f=Object(o.a)(v,2),h=f[0],O=f[1],g=y(1),j=Object(o.a)(g,2),w=j[0],E=j[1],R=n.poster,k=n.chapters;m((function(){d&&null!=n&&n.id&&wp.data.dispatch("core/edit-post").openGeneralSidebar("edit-post/block")}),[d]),m((function(){d&&null!=n&&n.selectionOverrideClientId&&wp.data.dispatch("core/block-editor").selectBlock(null==n?void 0:n.selectionOverrideClientId)}),[d]),m((function(){if(r&&r.length){var e=r.find((function(e){return e.id===(null==n?void 0:n.preset)}));e?O(e):(O(p),l({preset:null==p?void 0:p.id}))}}),[r,null==n?void 0:n.preset]),m((function(){P()}),[R,h,k,b.logo]);var P=function(){E(w+1)},C=Object(i.f)(k);m((function(){var e=null==k?void 0:k.map((function(e){return e.time})),t=null==C?void 0:C.map((function(e){return e.time}));_.difference(e,t).length&&P()}),[k]);var x=function(){var e=Object(a.a)(c.a.mark((function e(t){var r,n,a,o,i,p,d;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.src,n=t.external_id,a=t.attachment_id,o=t.type,i=t.title,r||n||a){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,Object(s.a)({method:"POST",path:"/presto-player/v1/videos",data:u(u({attachment_id:a,post_id:wp.data.select("core/editor").getCurrentPostId(),external_id:n},i?{title:i}:{}),{},{src:r,type:o})});case 5:p=e.sent,d=p.id,l({id:d});case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return null!=n&&n.preset||l({preset:null==p?void 0:p.id}),React.createElement(e,Object.assign({},t,{lockSave:function(){return wp.data.dispatch("core/editor").lockPostSaving("presto-player")},unlockSave:function(){return wp.data.dispatch("core/editor").unlockPostSaving("presto-player")},createVideo:x,onUpdate:P,onRemoveSrc:function(){confirm("Remove this video?")&&l(u(u(u(u({src:"",id:void 0},null!=n&&n.thumbnail?{thumbnail:null}:{}),null!=n&&n.preview?{preview:null}:{}),null!=n&&n.previewSrc?{previewSrc:null}:{}),null!=n&&n.previewThumbnail?{previewThumbnail:null}:{}))},presetData:h,setPresetData:O,renderKey:w}))}}),"withPlayerEdit")}},function(e,t,r){"use strict";var n=wp.data.withSelect;t.a=function(e){return n((function(e){return{branding:e("presto-player/player").branding(),loading:e("presto-player/player").isResolving("getPresets"),presets:e("presto-player/player").getPresets(),defaultPreset:e("presto-player/player").getDefaultPreset()}}))}},function(e,t,r){"use strict";var n,a=r(29),o=r(39),l=r(10),c=r(6),i=r(1),s=r(50),p=r(0),u=wp.i18n.__,d=wp.element.useState,b=wp.data,m=(b.useSelect,b.dispatch),y=wp.components,v=(y.withNotices,y.BaseControl),f=(y.Spinner,y.Button),h=function(e){var t,r=e.setAttributes,a=e.attributes,o=a.overlays,b=d(!1),y=Object(i.a)(b,2),h=y[0],O=y[1];return Object(p.b)(React.Fragment,null,Object(p.b)(v,null,Object(p.b)(f,{isPrimary:!0,onClick:function(){var e;null!==(e=prestoPlayer)&&void 0!==e&&e.isPremium?O(!0):m("presto-player/player").setProModal(!0)}},o.length?u("Update Overlays","presto-player"):u("Add Overlay","presto-player"),!!o.length&&Object(p.b)("div",{css:Object(p.a)(n||(n=Object(c.a)(["\n font-size: 10px;\n background: #fff;\n color: var(--wp-admin-theme-color);\n font-weight: bold;\n display: inline-block;\n line-height: 6px;\n padding: 5px;\n border-radius: 9999px;\n margin-left: 10px;\n "])))},o.length)),!(null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium)&&Object(p.b)(l.a,null)),h&&Object(p.b)(s.a,{closeModal:function(){return O(!1)},attributes:a,setAttributes:r,updateOverlayAttribute:function(e){r({overlays:e})}}))},O=r(7),g=r(5),j=r(2),w=r.n(j),_=r(9),E=r(31),R=r(35),k=r(40),P=wp.i18n.__,C=wp.components,x=C.ToggleControl,S=C.BaseControl,N=C.HorizontalRule,T=C.__experimentalAlignmentMatrixControl,D=C.SelectControl,B=function(e){var t=e.state,r=e.updateState,n=e.className;return React.createElement("div",{className:n},React.createElement(S,null,React.createElement("h3",null,P("Behavior","presto-player"))),React.createElement(S,null,React.createElement(x,{label:P("Auto-Hide Controls","presto-player"),help:P("Hide video controls automatically after 2 seconds of no mouse movement.","presto-player"),onChange:function(e){r({auto_hide:e})},checked:t.auto_hide})),React.createElement(S,null,React.createElement(x,{label:P("Save Play Position","presto-player"),help:P("Saves the user's play position so when they come back to the page they can continue the video from where they left off.","presto-player"),onChange:function(e){r({save_player_position:e})},checked:t.save_player_position})),React.createElement(S,null,React.createElement(x,{label:P("Captions On By Default","presto-player"),help:P("Toggles if captions should be active by default.","presto-player"),onChange:function(e){r({captions_enabled:e})},checked:t.captions_enabled})),React.createElement(S,null,React.createElement(x,{label:P("Focus Mode","presto-player"),help:P("Play only when tab is visible and video is in viewport.","presto-player"),onChange:function(e){r({play_video_viewport:e})},checked:t.play_video_viewport})),React.createElement(S,null,React.createElement(x,{label:P("Sticky On Scroll","presto-player"),help:P("Stick videos to the side of the screen when the page is scrolled and the video is playing.","presto-player"),onChange:function(e){r({sticky_scroll:e})},checked:t.sticky_scroll})),!!t.sticky_scroll&&React.createElement(React.Fragment,null,React.createElement(S,{label:P("Choose a position for your sticky player.","presto-player")},React.createElement(T,{value:t.sticky_scroll_position,onChange:function(e){r({sticky_scroll_position:e})}}))),React.createElement(S,null,React.createElement(D,{label:P("On Video End","presto-player"),value:t.on_video_end,options:[{value:"select",label:P("Select","presto-player")},{value:"loop",label:P("Loop","presto-player")},{value:"go-to-start",label:P("Go to start","presto-player")}],onChange:function(e){r({on_video_end:e})}})),React.createElement(N,null),React.createElement(S,null),React.createElement(S,null,React.createElement("h3",null,P("Youtube","presto-player"))),React.createElement(S,null,React.createElement(x,{label:P("Hide Youtube UI (Experimental)","presto-player"),help:P("Hides the Youtube logo and related videos.","presto-player"),onChange:function(e){r({hide_youtube:e})},checked:t.hide_youtube})),React.createElement(S,null,React.createElement(x,{label:P("Lazy Load Videos","presto-player"),help:P("Improves page loading performance by only loading the video when clicked.","presto-player"),onChange:function(e){r({lazy_load_youtube:e})},checked:t.lazy_load_youtube})))},A=wp.i18n.__,L=wp.components,I=L.ToggleControl,F=L.BaseControl,V=function(e){var t=e.state,r=e.updateState,n=e.className;return React.createElement("div",{className:n},React.createElement(F,null,React.createElement("h3",null,A("Controls","presto-player"))),React.createElement(F,{className:"presto-player__control--large-play"},React.createElement(I,{label:A("Large Play Button","presto-player"),help:A("Adds a large play button over the top of the player.","presto-player"),onChange:function(e){r({"play-large":e})},checked:t["play-large"]})),React.createElement(F,{className:"presto-player__control--rewind"},React.createElement(I,{label:A("Rewind","presto-player"),help:A("Adds a 10 second rewind button to the player.","presto-player"),onChange:function(e){r({rewind:e})},checked:t.rewind})),React.createElement(F,{className:"presto-player__control--play"},React.createElement(I,{label:A("Small Play Button","presto-player"),help:A("Adds a small play button to the bottom of the player.","presto-player"),onChange:function(e){r({play:e})},checked:t.play})),React.createElement(F,{className:"presto-player__control--fast-forward"},React.createElement(I,{label:A("Fast Forward","presto-player"),help:A("Adds a 10 second rewind button to the player.","presto-player"),onChange:function(e){r({"fast-forward":e})},checked:t["fast-forward"]})),React.createElement(F,{className:"presto-player__control--progress"},React.createElement(I,{label:A("Progress Bar","presto-player"),help:A("Shows a seekable progress bar.","presto-player"),onChange:function(e){r({progress:e})},checked:t.progress})),React.createElement(F,{className:"presto-player__control--current-time"},React.createElement(I,{label:A("Current Time","presto-player"),help:A("Shows the video timestamp.","presto-player"),onChange:function(e){r({"current-time":e})},checked:t["current-time"]})),React.createElement(F,{className:"presto-player__control--volume"},React.createElement(I,{label:A("Volume","presto-player"),help:A("Shows a volume bar.","presto-player"),onChange:function(e){r({volume:e,mute:e})},checked:t.volume})),React.createElement(F,{className:"presto-player__control--speed"},React.createElement(I,{label:A("Speed","presto-player"),help:A("Shows playback speed controls.","presto-player"),onChange:function(e){r({speed:e})},checked:t.speed})),React.createElement(F,{className:"presto-player__control--pip"},React.createElement(I,{label:A("Picture In Picture (HTML5 only)","presto-player"),help:A("Allows users to dock the player on their screen and watch when using other app on their computer.","presto-player"),onChange:function(e){r({pip:e})},checked:t.pip})),React.createElement(F,{className:"presto-player__control--fullscreen"},React.createElement(I,{label:A("Fullscreen","presto-player"),help:A("Adds a button to allow the player to be fullscreen.","presto-player"),onChange:function(e){r({fullscreen:e})},checked:t.fullscreen})),React.createElement(F,{className:"presto-player__control--captions"},React.createElement(I,{label:A("Captions","presto-player"),help:A("Shows a dedicated caption toggle button.","presto-player"),onChange:function(e){r({captions:e})},checked:t.captions})))},U=r(36),M=r(12);function z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function W(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach((function(t){Object(g.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var H,Y,G=wp.i18n.__,q=wp.components,Z=q.ToggleControl,K=q.BaseControl,Q=q.RadioControl,X=q.Flex,$=q.RangeControl,J=wp.element.useEffect,ee=function(e){var t=e.state,r=e.updateState,n=e.className,a=t.watermark,o={text:G("Enter your watermark text.","presto-player"),position:"top-right",color:"#fff",backgroundColor:"#333",opacity:80};J((function(){Object.keys(o).forEach((function(e){var r;void 0===(null==t||null===(r=t.watermark)||void 0===r?void 0:r[e])&&l(Object(g.a)({},e,o[e]))}))}),[t]);var l=function(e){r(W(W({},t),{},{watermark:W(W({},a),e)}))};return React.createElement("div",{className:n},React.createElement(K,null,React.createElement("h3",null,G("Dynamic Watermark Text","presto-player"))),React.createElement(K,{className:"presto-player__control--watermark"},React.createElement(Z,{label:G("Enable","presto-player"),help:G("Add a simulated dynamic watermark over your video.","presto-player"),onChange:function(e){l({enabled:e})},checked:null==a?void 0:a.enabled})),(null==a?void 0:a.enabled)&&React.createElement("div",null,React.createElement(U.a,{text:null==a?void 0:a.text,update:function(e){var t=e.text;l({text:t})}}),React.createElement(K,{className:n},React.createElement(Q,{label:G("Position","presto-player"),options:[{label:"Top Right",value:"top-right"},{label:"Top Left",value:"top-left"},{label:"Change Every 10 Seconds",value:"randomize"}],selected:(null==a?void 0:a.position)||"top-right",onChange:function(e){return l({position:e})}})),React.createElement(K,{className:"presto-player__control-text-color"},React.createElement(X,null,React.createElement(K.VisualLabel,null,G("Text Color","presto-player")),React.createElement(M.a,{color:(null==a?void 0:a.color)||"#fff",setColor:function(e){return l({color:e&&e.hex})}}))),React.createElement(K,{className:"presto-player__control-text-color"},React.createElement(X,null,React.createElement(K.VisualLabel,null,G("Background Color","presto-player")),React.createElement(M.a,{color:(null==a?void 0:a.backgroundColor)||"#333",setColor:function(e){return l({backgroundColor:e&&e.hex})}}))),React.createElement(K,null,React.createElement($,{label:G("Opacity","presto-player"),help:G("Opacity percentage of the watermark.","presto-player"),value:(null==a?void 0:a.opacity)||100,onChange:function(e){return l({opacity:e})},min:0,max:100}))))},te=r(32),re=r(38),ne=wp.i18n.__,ae=wp.components,oe=ae.ToggleControl,le=ae.BaseControl,ce=ae.RangeControl,ie=ae.SelectControl,se=ae.ColorPicker,pe=function(e){var t=e.state,r=e.updateState,n=e.className;return React.createElement("div",{className:n},React.createElement(le,null,React.createElement("h3",null,ne("Style","presto-player"))),React.createElement(le,null,React.createElement(oe,{label:ne("Hide Logo","presto-player"),help:ne("Hides the logo on this video.","presto-player"),onChange:function(e){r({hide_logo:e})},checked:t.hide_logo})),React.createElement(le,null,React.createElement(ce,{label:ne("Round Corners","presto-player"),help:ne("Player border radius size.","presto-player"),value:(null==t?void 0:t.border_radius)||0,onChange:function(e){return r({border_radius:e})},min:0,max:25})),React.createElement(le,null,React.createElement(ie,{label:ne("Caption Style","presto-player"),labelPosition:"top",value:null==t?void 0:t.caption_style,options:[{label:ne("Default","presto-player"),value:"default"},{label:ne("Full","presto-player"),value:"full"}],onChange:function(e){r({caption_style:e})}})),React.createElement(le,null,React.createElement(le.VisualLabel,null,React.createElement("p",null,ne("Caption Background","presto-player"))),React.createElement(se,{color:(null==t?void 0:t.caption_background)||"#000000",onChangeComplete:function(e){r({caption_background:e.hex})},disableAlpha:!0})))};function ue(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function de(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ue(Object(r),!0).forEach((function(t){Object(g.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ue(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var be=wp.i18n.__,me=wp.components,ye=me.TextControl,ve=me.BaseControl,fe=me.Icon,he=me.Notice,Oe=me.Button,ge=me.Flex,je=me.FlexItem,we=me.SelectControl,_e=me.FlexBlock,Ee=me.Modal,Re=wp.element,ke=Re.useState,Pe=Re.useEffect,Ce=wp.data,xe=Ce.useSelect,Se=Ce.dispatch;var Ne=function(e){var t=e.type,r=void 0===t?"new":t,n=e.closeModal,a=e.addPreset,o=e.onSave,l=e.updatePreset,s=e.name,u=void 0===s?"":s,d=e.preset,b=void 0===d?{"play-large":!0,rewind:!0,play:!0,"fast-forward":!0,progress:!0,"current-time":!0,mute:!0,volume:!0,speed:!1,pip:!1,fullscreen:!0,captions:!1,save_player_position:!1,reset_on_end:!1,auto_hide:!0,sticky_scroll:!1,hide_logo:!1,border_radius:0,skin:"default",caption_style:"default",caption_background:"#000000",hide_youtube:!1,lazy_load_youtube:!1,cta:{},email_collection:{},action_bar:{}}:d,m=ke(!1),y=Object(i.a)(m,2),v=y[0],f=y[1],h=ke(""),g=Object(i.a)(h,2),j=g[0],P=g[1],C=ke(""),x=Object(i.a)(C,2),S=x[0],N=x[1],T=ke(u),D=Object(i.a)(T,2),A=D[0],L=D[1],I=ke(b),F=Object(i.a)(I,2),U=F[0],M=F[1],z=xe((function(e){return e("presto-player/player").branding()})),W=ke(""),G=Object(i.a)(W,2),q=G[0],Z=G[1],K={message:be("The preset could not be saved. Please reload the page and try again.","presto-player")},Q=xe((function(e){return e("presto-player/player").youtube()}));Pe((function(){Z(Q.channel_id)}),[null==Q?void 0:Q.channel_id]);var X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};M(de(de({},U),e))},$=function(){var e=Object(O.a)(w.a.mark((function e(){var t,r,a,c;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f(!0),e.prev=1,t=de(de({},U),{name:A}),e.next=5,wp.apiFetch({method:"POST",url:wp.url.addQueryArgs("".concat(prestoPlayer.root).concat(prestoPlayer.prestoVersionString,"preset/").concat(b.id),{_method:"PUT"}),data:t});case 5:if(r=e.sent){e.next=8;break}throw K;case 8:l(r),n(),o&&o(r),Object(_.d)({message:be("Preset updated!","presto-player")}),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),P(null!==e.t0&&void 0!==e.t0&&e.t0.message?e.t0.message:K);case 17:return e.prev=17,f(!1),e.finish(17);case 20:return Se("presto-player/player").updateYoutube({channel_id:q}),a=de(de({},Q),{channel_id:q}),e.prev=22,e.next=25,wp.apiFetch({path:"wp/v2/settings",method:"POST",data:{presto_player_youtube:a}});case 25:null!=(c=e.sent)&&c.presto_player_youtube&&(Se("presto-player/player").setYoutube(null==c?void 0:c.presto_player_youtube),onClose()),e.next=32;break;case 29:e.prev=29,e.t1=e.catch(22),console.log(e.t1);case 32:case"end":return e.stop()}}),e,null,[[1,14,17,20],[22,29]])})));return function(){return e.apply(this,arguments)}}(),J=function(){var e=Object(O.a)(w.a.mark((function e(){var t;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f(!0),e.prev=1,e.next=4,wp.apiFetch({method:"POST",url:prestoPlayer.root+prestoPlayer.prestoVersionString+"preset",data:de(de({},{name:A}),U)});case 4:if(t=e.sent){e.next=7;break}throw K;case 7:a(t),n(),o&&o(t),Object(_.d)({message:be("Preset created!","presto-player")}),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),P(null!==e.t0&&void 0!==e.t0&&e.t0.message?e.t0.message:K);case 16:return e.prev=16,f(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[1,13,16,19]])})));return function(){return e.apply(this,arguments)}}(),ne=[{name:"controls",title:be("Controls","presto-player"),icon:Object(p.b)(fe,{icon:"admin-settings"}),component:Object(p.b)(V,{updateState:X,state:U})},{name:"behavior",title:be("Behavior","presto-player"),icon:Object(p.b)(fe,{icon:"admin-generic"}),component:Object(p.b)(B,{updateState:X,state:U})},{name:"style",title:be("Style","presto-player"),icon:Object(p.b)(fe,{icon:"admin-customizer"}),component:Object(p.b)(pe,{updateState:X,state:U})},{name:"email",title:be("Email Capture","presto-player"),icon:Object(p.b)(fe,{icon:"email"}),component:Object(p.b)(re.a,{updateState:X,state:U})},{name:"cta",title:be("Call To Action","presto-player"),icon:Object(p.b)(fe,{icon:"megaphone"}),component:Object(p.b)(te.a,{updateState:X,state:U})},{name:"action_bar",title:be("Action Bar","presto-player"),icon:Object(p.b)(fe,{icon:"cover-image"}),component:Object(p.b)(k.a,{updateState:X,state:U,value:q,setValue:Z})},{name:"watermark",title:be("Dynamic Watermark","presto-player"),icon:Object(p.b)(fe,{icon:"lock"}),component:Object(p.b)(ee,{updateState:X,state:U})}];return Object(p.b)(Ee,{title:be("edit"==r?"Edit A Video Preset":"Create A New Video Preset","presto-player"),onRequestClose:n,className:"presto-player__modal-presets",overlayClassName:"presto-player__modal-presets-overlay"},Object(p.b)("div",{className:"presto-player__preset-options","data-cy":"preset-modal"},Object(p.b)(ye,{value:A,hideLabelFromVision:!0,label:be("Preset Name","presto-player"),onChange:function(e){return L(e)},placeholder:be("Enter a preset name...","presto-player"),className:"presto-player__modal--style-name",autoFocus:!0}),Object(p.b)(ge,{align:"stretch",className:"presto-player__style-preview-area"},Object(p.b)(je,{className:"presto-player__style-sidebar"},Object(p.b)("div",null,Object(p.b)(E.a,{items:ne,title:be("Customize","presto-player"),onSelect:N},(function(e){return e.component})))),Object(p.b)(_e,{className:"presto-player__style-preview-panel"},Object(p.b)("div",{style:{position:"absolute",top:0,left:0,padding:"20px"}},Object(p.b)(we,{label:be("Skin","presto-player"),labelPosition:"side",value:null==U?void 0:U.skin,hideLabelFromVision:!0,options:[{label:be("Basic","presto-player"),value:"default"},{label:be("Stacked","presto-player"),value:"stacked"}],onChange:function(e){X({skin:e})}})),Object(p.b)(R.a,{poster:"https://source.unsplash.com/daily",state:U,branding:z,menu:S}))),Object(p.b)("br",null),j&&Object(p.b)(ve,null,Object(p.b)(he,{className:"presto-player__modal--error-notice",status:"error",isDismissible:!1,style:{margin:0}},j.replace(/(<([^>]+)>)/gi,""))),Object(p.b)("div",{css:Object(p.a)(H||(H=Object(c.a)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n "])))},Object(p.b)("div",{css:Object(p.a)(Y||(Y=Object(c.a)(["\n opacity: 0.5;\n font-size: 12px;\n "])))},"Preset ID: ",b.id),Object(p.b)("div",null,Object(p.b)(Oe,{isTertiary:!0,onClick:n,style:{margin:"0 6px"}},be("Cancel","presto-player")),Object(p.b)(Oe,{isPrimary:!0,isBusy:v,disabled:v,onClick:function(){if(A)return"edit"===r?$():J();P(be("You must enter a name for the preset.","presto-player"))},"data-cy":"submit-preset"},be("edit"==r?"Update Preset":"Create Preset","presto-player"))))))},Te=wp.i18n.__,De=wp.components,Be=De.Icon,Ae=De.Spinner,Le=De.Modal,Ie=De.Button,Fe=De.ButtonGroup,Ve=wp.element.useState,Ue=function(e){var t,r,n=e.preset,a=e.index,o=e.isActive,l=e.remove,c=e.setPreset,s=e.onEdit,p=Ve(!1),u=Object(i.a)(p,2),d=u[0],b=u[1],m=Ve(!1),y=Object(i.a)(m,2),v=y[0],f=y[1],h=function(){return f(!1)},g=function(){var e=Object(O.a)(w.a.mark((function e(){return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.id){e.next=3;break}return l(n),e.abrupt("return");case 3:return e.prev=3,b(!0),e.next=7,wp.apiFetch({method:"POST",url:wp.url.addQueryArgs("".concat(prestoPlayer.root).concat(prestoPlayer.prestoVersionString,"preset/").concat(n.id),{_method:"DELETE"})});case 7:e.sent&&(l(n),wp.data.dispatch("core/notices").createNotice("success",Te("Preset trashed.","presto-player"),{type:"snackbar",isDismissible:!0})),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(3),console.error(e.t0),null!==e.t0&&void 0!==e.t0&&e.t0.message&&wp.data.dispatch("core/notices").createNotice("error",e.t0.message,{type:"snackbar",isDismissible:!0});case 15:return e.prev=15,f(!1),b(!1),e.finish(15);case 19:case"end":return e.stop()}}),e,null,[[3,11,15,19]])})));return function(){return e.apply(this,arguments)}}();return d?React.createElement("div",{className:"block-editor-block-styles__item",role:"button",tabIndex:a,"aria-label":"Fill",style:{color:o?"var(--wp-admin-theme-color)":"inherit"}},React.createElement("div",{className:"block-editor-block-styles__item-preview",style:{border:o?"2px solid var(--wp-admin-theme-color)":"2px solid #e3e3e3",margin:0,display:"flex","align-items":"center","justify-content":"center"}},React.createElement(Ae,null))):React.createElement("div",{className:"block-editor-block-styles__item presto-preset-".concat(n.slug),onClick:function(){c(n)},role:"button",tabIndex:a,"aria-label":"Fill",style:{color:o?"var(--wp-admin-theme-color)":"inherit"}},React.createElement("div",{className:"block-editor-block-styles__item-preview",style:{border:o?"2px solid var(--wp-admin-theme-color)":"2px solid #e3e3e3",margin:0}},React.createElement("div",{style:{textAlign:"center",width:"100%",color:o?"var(--wp-admin-theme-color)":"inherit",opacity:o?1:.75}},null!=n&&n.icon?React.createElement(Be,{icon:null==n?void 0:n.icon,style:{fontSize:"30px",width:"30px",height:"30px"}}):React.createElement("h1",{style:{opacity:.75}},(null==n||null===(t=n.name)||void 0===t||null===(r=t.charAt(0))||void 0===r?void 0:r.toUpperCase())||"Untitled"))),React.createElement("div",{className:"block-editor-block-styles__item-label",style:{fontWeight:"bold",textTransform:"capitalize"}},(null==n?void 0:n.name)||"Untitled"),!(null!=n&&n.is_locked)&&React.createElement("div",{className:"block-editor-block-styles__item-edit"},React.createElement("div",{className:"block-editor-block-styles__item-edit-icon",onClick:s},React.createElement(Be,{icon:"edit"})),React.createElement("div",{className:"block-editor-block-styles__item-edit-icon",onClick:function(){return f(!0)}},React.createElement(Be,{icon:"trash"}))),v&&React.createElement(Le,{title:Te("Trash Preset?","presto-player"),onRequestClose:h,style:{maxWidth:"250px"}},React.createElement("p",null,React.createElement("strong",null,Te("Warning!","presto-player")," "),Te("Any videos assigned to this preset will automatically use the default preset.","presto-player")),React.createElement(Fe,null,React.createElement(Ie,{isDestructive:!0,onClick:g,style:{margin:"0 4px"}},Te("Trash","presto-player")),React.createElement(Ie,{isTertiary:!0,onClick:h,style:{margin:"0 4px",boxShadow:"none"}},Te("Cancel","presto-player")))))},Me=wp.i18n.__,ze=wp.components,We=ze.withNotices,He=ze.BaseControl,Ye=ze.Spinner,Ge=ze.Button,qe=wp.element,Ze=qe.useState,Ke=(qe.useEffect,wp.data),Qe=Ke.useSelect,Xe=Ke.dispatch;var $e=We((function(e){var t,r=e.attributes,n=e.setAttributes,a=Ze(!1),o=Object(i.a)(a,2),c=o[0],s=o[1],p=function(){return s(!1)},u=Ze(null),d=Object(i.a)(u,2),b=d[0],m=d[1],y=Ze(null),v=Object(i.a)(y,2),f=v[0],h=v[1],O=Qe((function(e){return{presets:e("presto-player/player").getPresets(),loading:e("presto-player/player").isResolving("getPresets")}})),g=O.presets,j=O.loading,w=function(e){Xe("presto-player/player").addPreset(e)},_=function(e){Xe("presto-player/player").removePreset(e)},E=function(e){n({preset:e.id})};return j?React.createElement("div",{className:"presto-settings__loading"},React.createElement(Ye,null)):React.createElement(React.Fragment,null,g.length?React.createElement("p",null,Me("Select a video configuration preset, or add your own.","presto-player")):"",React.createElement(He,null,React.createElement("div",{className:"block-editor-block-styles"},(g||[]).length?g.map((function(e,t){return React.createElement(Ue,{setPreset:E,index:t,isActive:(null==r?void 0:r.preset)===e.id,preset:e,key:e.id,onEdit:function(){h(e.name),m(e),s("edit")},remove:_})})):Me("No style presets. You can create a new style by clicking 'Add New Style'.","presto-plugin"))),React.createElement(He,null,React.createElement(Ge,{isPrimary:!0,"data-cy":"add-new-preset",onClick:function(){var e;null!==(e=prestoPlayer)&&void 0!==e&&e.isPremium?s("new"):Xe("presto-player/player").setProModal(!0)}},Me("Add New Preset","presto-player")),!(null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium)&&React.createElement(l.a,null)),"new"==c&&React.createElement(Ne,{closeModal:p,addPreset:w,type:"new",onSave:E}),"edit"==c&&React.createElement(Ne,{closeModal:p,addPreset:w,updatePreset:function(e){Xe("presto-player/player").updatePreset(e)},type:"edit",preset:b,name:f}))})),Je=r(18);function et(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?et(Object(r),!0).forEach((function(t){Object(g.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):et(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var rt=wp.i18n.__,nt=wp.components,at=(nt.PanelRow,nt.TextControl,nt.SelectControl,nt.BaseControl),ot=nt.Button,lt=nt.FocalPointPicker,ct=nt.RangeControl,it=wp.blockEditor,st=it.MediaUpload,pt=it.MediaUploadCheck,ut=(wp.element.useState,["image"]),dt=function(e){var t=e.attributes,r=e.setAttributes,n=e.instanceId,a=t.mutedOverlay,o="video-block__overlay-image-description-".concat(n);return React.createElement(React.Fragment,null,React.createElement(pt,null,React.createElement(at,{className:"editor-video-overlay-control"},React.createElement(at.VisualLabel,null,React.createElement("p",null,rt("Overlay Image","presto-player"))),React.createElement(st,{title:rt("Select overlay image","presto-player"),onSelect:function(e){r({mutedOverlay:tt(tt({},a),{src:e.url})})},allowedTypes:ut,render:function(e){var t=e.open;return React.createElement(ot,{className:"presto-setting__poster",isPrimary:!0,onClick:t},null!=a&&a.src?rt("Replace","presto-player"):rt("Select","presto-player"))}}),React.createElement("p",{id:o,hidden:!0},null!=a&&a.src?sprintf(rt("The current overlay image url is %s","presto-player"),null==a?void 0:a.src):rt("There is no overlay image currently selected","presto-player")),!(null==a||!a.src)&&React.createElement(ot,{onClick:function(){r({mutedOverlay:tt(tt({},a),{src:""})})},className:"presto-setting__remove-poster",isTertiary:!0},rt("Remove","presto-player")))),!(null==a||!a.src)&&React.createElement(lt,{url:"",dimensions:{width:160,height:90},value:null==a?void 0:a.focalPoint,onChange:function(e){return r({mutedOverlay:tt(tt({},a),{focalPoint:e})})}}),!(null==a||!a.src)&&React.createElement(ct,{label:rt("Max Width (%)","presto-player"),value:null==a?void 0:a.width,onChange:function(e){return r({mutedOverlay:tt(tt({},a),{width:e})})},min:1,max:100}))};function bt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bt(Object(r),!0).forEach((function(t){Object(g.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var yt=wp.i18n.__,vt=wp.components,ft=vt.ToggleControl,ht=vt.SelectControl,Ot=vt.BaseControl,gt=vt.Button,jt=vt.PanelRow,wt=vt.Icon,_t=vt.Flex,Et=wp.data.dispatch,Rt=wp.blockEditor,kt=Rt.MediaUpload,Pt=Rt.MediaUploadCheck,Ct=["image"],xt=wp.compose.useInstanceId,St=function e(t){var r=t.setAttributes,n=t.attributes,a=n.mutedPreview,o=n.autoplay,c=n.playsInline,i=n.preload,s=n.poster,p=n.mutedOverlay,u=xt(e),d="video-block__poster-image-description-".concat(u),b=function(e){return function(t){r(Object(g.a)({},e,t))}};var m,y;return React.createElement(React.Fragment,null,!o&&React.createElement(React.Fragment,null,React.createElement(ft,{label:React.createElement(React.Fragment,null,yt("Muted Autoplay Preview","presto-player")," ",!(null!==(m=prestoPlayer)&&void 0!==m&&m.isPremium)&&React.createElement(l.a,null)),onChange:function(e){var t;null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium?r({mutedPreview:mt(mt({},a),{enabled:e})}):Et("presto-player/player").setProModal(!0)},checked:null==a?void 0:a.enabled,className:"presto-setting__mutedPreview",help:yt("Shows a muted preview of the video.","presto-player")}),!(null==a||!a.enabled)&&!(null!=n&&n.video_id)&&React.createElement(jt,null,React.createElement(ft,{label:yt("Muted Preview Captions","presto-player"),onChange:function(e){r({mutedPreview:mt(mt({},a),{captions:e})})},checked:null==a?void 0:a.captions,className:"presto-setting__mutedPreviewCaptions",help:yt("Play captions during muted autoplay","presto-player")})),!!a.enabled&&React.createElement(jt,null,React.createElement(ft,{label:React.createElement(React.Fragment,null,yt("Muted Preview Overlay","presto-player")," ",!(null!==(y=prestoPlayer)&&void 0!==y&&y.isPremium)&&React.createElement(l.a,null)),onChange:function(e){var t;null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium?r({mutedOverlay:mt(mt({},p),{enabled:e})}):Et("presto-player/player").setProModal(!0)},checked:null==p?void 0:p.enabled,className:"presto-setting__mutedOverlay",help:yt("Show an image over the top of the video either before or after the video.","presto-player")})),(null==p?void 0:p.enabled)&&(null==a?void 0:a.enabled)&&React.createElement(dt,{attributes:n,setAttributes:r})),!(null!=a&&a.enabled)&&React.createElement(ft,{label:yt("Autoplay","presto-player"),className:"presto-setting__autoplay",onChange:b("autoplay"),checked:o,help:function(e){return e?yt("Note: Autoplaying videos may cause usability issues for some visitors.","presto-player"):null}}),React.createElement(jt,null,React.createElement(ft,{label:yt("Play inline","presto-player"),className:"presto-setting__playsInline","data-cy":"playsInline",onChange:b("playsInline"),checked:c,help:yt("On mobile browsers, play the video on the page instead of opening it up fullscreen.","presto-player")})),!(null!=n&&n.video_id)&&React.createElement(jt,null,React.createElement(ht,{label:React.createElement(_t,null,React.createElement("div",null,yt("Performance Preference","presto-player")),React.createElement("a",{href:"https://prestoplayer.com/docs/performance-preferences-explained",target:"_blank",style:{textDecoration:"none"}},React.createElement(wt,{icon:"editor-help"}))),className:"presto-setting__preload",value:i,onChange:function(e){return r({preload:e})},help:(!!(null!=n&&n.src&&Object(Je.d)(null==n?void 0:n.src)&&["metadata","none"].includes(i))||"none"===i&&!s)&&yt("A poster image is recommended for this setting.","presto-player"),options:[{value:"auto",label:yt("Video Playback Speed","presto-player")},{value:"metadata",label:yt("Page Load Speed","presto-player")},{value:"none",label:yt("Page Load Speed (Extreme)","presto-player")}]})),React.createElement(Pt,null,React.createElement(Ot,{className:"editor-video-poster-control"},React.createElement(Ot.VisualLabel,null,React.createElement("p",null,yt("Poster image","presto-player"))),React.createElement(kt,{title:yt("Select poster image","presto-player"),onSelect:function(e){r({poster:e.url})},allowedTypes:Ct,render:function(e){var t=e.open;return React.createElement(gt,{className:"presto-setting__poster",isPrimary:!0,onClick:t,"aria-describedby":d},yt(s?"Replace":"Select","presto-player"))}}),React.createElement("p",{id:d,hidden:!0},s?sprintf(yt("The current poster image url is %s","presto-player"),s):yt("There is no poster image currently selected","presto-player")),!!s&&React.createElement(gt,{onClick:function(){r({poster:""})},className:"presto-setting__remove-poster",isTertiary:!0},yt("Remove","presto-player")))))},Nt=wp.components.PanelBody,Tt=wp.i18n.__;t.a=function(e){var t,r,n,c,i=e.attributes,s=e.setAttributes;return React.createElement(React.Fragment,null,React.createElement(Nt,{title:React.createElement(React.Fragment,null,Tt("Chapters","presto-player")," ",!(null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium)&&React.createElement(l.a,null)),initialOpen:null===(r=prestoPlayer)||void 0===r?void 0:r.isPremium},React.createElement(o.a,{setAttributes:s,attributes:i})),React.createElement(Nt,{title:React.createElement(React.Fragment,null,Tt("Overlays","presto-player")," ",!(null!==(n=prestoPlayer)&&void 0!==n&&n.isPremium)&&React.createElement(l.a,null)),initialOpen:null===(c=prestoPlayer)||void 0===c?void 0:c.isPremium},React.createElement(h,{setAttributes:s,attributes:i})),React.createElement(Nt,{title:Tt("Video settings","presto-player")},React.createElement(St,{setAttributes:s,attributes:i})),React.createElement(Nt,{title:Tt("Video Preset","presto-player")},React.createElement($e,{setAttributes:s,attributes:i})),React.createElement(Nt,{title:Tt("Global Player Branding","presto-player"),initialOpen:!1},React.createElement(a.a,{setAttributes:s,attributes:i})))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return j})),r.d(t,"b",(function(){return w})),r.d(t,"c",(function(){return _}));var n=r(46),a=r(47),o=r(53),l=r(54),c=r(44),i=r(26),s=r.n(i),p=function(e){return e.replace(/([A-Z])/g,(function(e){return"-".concat(e[0].toLowerCase())}))},u=r(48),d=function(e,t,r){var n=t.className||t.class,a=r.className||r.class,o=y(e),l=y(n?n.split(" "):[]),c=y(a?a.split(" "):[]),i=[];return o.forEach((function(e){l.has(e)?(i.push(e),l.delete(e)):c.has(e)||i.push(e)})),l.forEach((function(e){return i.push(e)})),i.join(" ")},b=function(e){if("undefined"==typeof document)return!0;var t="on"+e,r=t in document;if(!r){var n=document.createElement("div");n.setAttribute(t,"return;"),r="function"==typeof n[t]}return r},m=function(e,t,r){var n=e.__events||(e.__events={}),a=n[t];a&&e.removeEventListener(t,a),e.addEventListener(t,n[t]=function(e){r&&r.call(this,e)})},y=function(e){var t=new Map;return e.forEach((function(e){return t.set(e,e)})),t},v=function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)},f=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){t.forEach((function(t){v(t,e)}))}};function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Object(c.a)(e);if(t){var a=Object(c.a)(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return Object(l.a)(this,r)}}var O=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},g=function(e,t,r,l){void 0!==l&&l();var c=e.toLowerCase().split("-").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join(""),i=function(t){Object(o.a)(i,t);var l=h(i);function i(e){var t;return Object(n.a)(this,i),(t=l.call(this,e)).setComponentElRef=function(e){t.componentEl=e},t}return Object(a.a)(i,[{key:"componentDidMount",value:function(){this.componentDidUpdate(this.props)}},{key:"componentDidUpdate",value:function(e){!function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e instanceof Element){var n=d(e.classList,t,r);""!==n&&(e.className=n),Object.keys(t).forEach((function(r){if("children"!==r&&"style"!==r&&"ref"!==r&&"class"!==r&&"className"!==r&&"forwardedRef"!==r)if(0===r.indexOf("on")&&r[2]===r[2].toUpperCase()){var n=r.substring(2),a=n[0].toLowerCase()+n.substring(1);b(a)||m(e,a,t[r])}else{e[r]=t[r],"string"===Object(u.a)(t[r])&&e.setAttribute(p(r),t[r])}}))}}(this.componentEl,this.props,e)}},{key:"render",value:function(){var t=this.props,n=t.children,a=t.forwardedRef,o=t.style,l=(t.className,t.ref,O(t,["children","forwardedRef","style","className","ref"])),c=Object.keys(l).reduce((function(e,t){if(0===t.indexOf("on")&&t[2]===t[2].toUpperCase()){var r=t.substring(2).toLowerCase();"undefined"!=typeof document&&b(r)&&(e[t]=l[t])}else e[t]=l[t];return e}),{});r&&(c=r(this.props,c));var i=Object.assign(Object.assign({},c),{ref:f(a,this.setComponentElRef),style:o});return s.a.createElement(e,i,n)}}],[{key:"displayName",get:function(){return c}}]),i}(s.a.Component);return t&&(i.contextType=t),function(e,t){var r=function(t,r){return s.a.createElement(e,Object.assign({},t,{forwardedRef:r}))};return r.displayName=t,s.a.forwardRef(r)}(i,c)},j=g("presto-cta-overlay-ui"),w=g("presto-email-overlay-ui"),_=g("presto-player")},function(e,t){e.exports=window.wp.blockEditor},function(e,t,r){"use strict";var n,a,o,l,c,i,s=r(6),p=r(5),u=r(1),d=r(0);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){Object(p.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var y=wp.i18n.__,v=wp.components,f=v.Button,h=v.Popover,O=v.Icon,g=wp.blockEditor.__experimentalLinkControl,j=wp.element.useState,w=wp.url.prependHTTP;t.a=function(e){var t=e.setSettings,r=e.settings,p=j(!1),b=Object(u.a)(p,2),v=b[0],_=b[1],E=r.url,R=j(),k=Object(u.a)(R,2),P=k[0],C=k[1],x=m({url:null==r?void 0:r.url,type:null==r?void 0:r.type,id:null==r?void 0:r.id,opensInNewTab:null==r?void 0:r.opensInNewTab},P),S=function(e){e=m(m({},P),e);var r=x.opensInNewTab!==e.opensInNewTab&&x.url===e.url&&void 0===e.url;if(C(r?e:void 0),!r){var n=w(e.url);t({url:n,type:e.type,id:void 0!==e.id&&null!==e.id?String(e.id):void 0,opensInNewTab:e.opensInNewTab})}};return Object(d.b)("span",null,E?Object(d.b)("div",{css:Object(d.a)(n||(n=Object(s.a)(["\n display: flex;\n justify-content: space-between;\n "])))},Object(d.b)("div",{css:Object(d.a)(a||(a=Object(s.a)(["\n max-width: 85%;\n overflow: hidden;\n display: flex;\n align-items: center;\n "])))},Object(d.b)("a",{href:"#",css:Object(d.a)(o||(o=Object(s.a)(["\n padding: 10px;\n background: #f3f3f3;\n border-radius: 4px;\n width: 100%;\n display: inline-flex;\n align-items: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n text-decoration: none;\n "]))),onClick:function(){return _(!v)}},Object(d.b)(O,{icon:"edit",css:Object(d.a)(l||(l=Object(s.a)(["\n cursor: pointer;\n opacity: 0.75;\n margin: 0 2px;\n font-size: 16px;\n width: 16px;\n height: 16px;\n text-decoration: none;\n "])))}),E),v&&Object(d.b)(h,{position:"bottom center",onClose:function(){return _(!1)}},Object(d.b)(g,{value:r,onChange:S}))),Object(d.b)("div",{css:Object(d.a)(c||(c=Object(s.a)(["\n display: flex;\n align-items: center;\n "])))},Object(d.b)(O,{onClick:function(){confirm(y("Are you sure you wish to remove this link?","presto-player"))&&t({})},icon:"trash",className:"presto-icon",css:Object(d.a)(i||(i=Object(s.a)(["\n cursor: pointer;\n opacity: 0.75;\n margin: 0 2px;\n fontsize: 18px;\n width: 18px;\n height: 18px;\n\n &:hover {\n color: #cc1818;\n }\n "])))}))):Object(d.b)("span",null,Object(d.b)(f,{isPrimary:!0,isSmall:!0,onClick:function(){return _(!v)}},y("Add Link","presto-player")),v&&Object(d.b)(h,{position:"bottom center",onClose:function(){return _(!1)}},Object(d.b)(g,{value:r,onChange:S}))))}},,,,function(e,t,r){"use strict";var n=r(7),a=r(1),o=r(2),l=r.n(o),c=r(10),i=wp.i18n.__,s=wp.components,p=s.ColorPicker,u=s.Button,d=s.withNotices,b=s.BaseControl,m=s.RangeControl,y=wp.blockEditor,v=y.MediaUpload,f=y.MediaUploadCheck,h=wp.compose.useInstanceId,O=wp.element.useState,g=wp.data,j=g.dispatch,w=g.useSelect,_=["image"];t.a=d((function e(t){t.setAttributes,t.attributes;var r,o=t.type,s=h(e),d=O(1),y=Object(a.a)(d,2),g=y[0],E=y[1],R=w((function(e){return e("presto-player/player").branding()})),k=function(){var e=Object(n.a)(l.a.mark((function e(){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j("presto-player/player").saveOptions({branding:R});case 2:wp.data.dispatch("core/notices").createNotice("success","Player branding saved.",{type:"snackbar",isDismissible:!0});case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return React.createElement("div",{className:"presto-player__panel--branding"},"audio"!==o&&React.createElement("p",null,i("Here you can select the global player branding This will apply to all players on the site.","presto-player")),React.createElement(f,null,React.createElement(b,{className:"editor-video-poster-control"},"audio"!==o&&React.createElement(React.Fragment,null,React.createElement(b.VisualLabel,null,React.createElement("p",null,i("Logo Overlay","presto-player")," ",!(null!==(r=prestoPlayer)&&void 0!==r&&r.isPremium)&&React.createElement(c.a,null))),React.createElement(v,{title:i("Select logo overlay image","presto-player"),onSelect:function(e){j("presto-player/player").updateBranding("logo",e.url)},allowedTypes:_,render:function(e){var t=e.open;return React.createElement(u,{className:"presto-setting__logo",isSecondary:!0,onClick:function(){var e;null!==(e=prestoPlayer)&&void 0!==e&&e.isPremium?t():j("presto-player/player").setProModal(!0)},"aria-describedby":"video-block__logo-image-description-".concat(s)},null!=R&&R.logo?i("Replace","presto-player"):i("Select","presto-player"))}})),React.createElement("p",{id:"video-block__logo-image-description-".concat(s),hidden:!0},null!=R&&R.logo?sprintf(i("The current logo image url is %s","presto-player"),null==R?void 0:R.logo):i("There is no logo image currently selected","presto-player")),!(null==R||!R.logo)&&React.createElement(u,{onClick:function(){j("presto-player/player").updateBranding("logo","")},isTertiary:!0},i("Remove","presto-player")))),!(null==R||!R.logo)&&React.createElement(m,{label:i("Logo Max Width","presto-player"),value:(null==R?void 0:R.logo_width)||150,onChange:function(e){return j("presto-player/player").updateBranding("logo_width",e)},min:1,max:400}),React.createElement(p,{color:null==R?void 0:R.color,onChangeComplete:function(e){j("presto-player/player").updateBranding("color",e.hex)},key:g,disableAlpha:!0}),(null==R?void 0:R.color)&&React.createElement(b,null,React.createElement(u,{isSecondary:!0,onClick:function(){var e,t;j("presto-player/player").updateBranding("color",(null===(e=prestoPlayer)||void 0===e||null===(t=e.defaults)||void 0===t?void 0:t.color)||"#00b3ff"),E(g+1)}},i("Reset Color","presto-player"))),React.createElement(u,{isPrimary:!0,onClick:k},i("Save Branding","presto-player")))}))},function(e,t){e.exports=window.wp.compose},function(e,t,r){"use strict";var n=r(5),a=r(1),o=r(19),l=r.n(o),c=wp.i18n.__,i=wp.element,s=i.useState,p=i.useEffect,u=lodash,d=u.partial,b=u.noop,m=u.find,y=wp.components,v=y.NavigableMenu,f=y.Animate;t.a=function(e){var t,r=e.className,o=e.children,i=e.items,u=e.title,y=e.orientation,h=void 0===y?"horizontal":y,O=e.activeClass,g=void 0===O?"is-active":O,j=e.onSelect,w=void 0===j?b:j,_=s(null),E=Object(a.a)(_,2),R=E[0],k=E[1],P=s("left"),C=Object(a.a)(P,2),x=(C[0],C[1]),S=function(e){k(e),w&&w(e)},N=function(e,t){t.click()},T=m(i,{name:R}),D="".concat(null!==(t=null==T?void 0:T.name)&&void 0!==t?t:"none");return p((function(){x(R?"right":"left")}),[R]),React.createElement("div",{className:r},React.createElement(f,{type:"slide-in",origin:T?"right":"left"},(function(e){var t=e.className;return T?React.createElement("div",{key:D,"aria-labelledby":D,role:"itempanel",id:"".concat(D,"-view"),className:l()(t,"presto-player__menu-content")},React.createElement("div",{className:"presto-player__menu-items"},React.createElement("div",{className:"presto-player__menu-item is-back-button",onClick:function(){return S("")}},React.createElement("svg",{class:"back-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",role:"img","aria-hidden":"true",focusable:"false"},React.createElement("path",{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),c("Back","presto-player"))),o(T)):React.createElement("div",{className:l()(t,"is-from-right")},!!u&&React.createElement("h2",null,u),React.createElement(v,{role:"itemlist",orientation:h,onNavigate:N,className:l()("presto-player__menu-items")},i.map((function(e){return React.createElement("div",{className:l()("presto-player__menu-item",e.className,Object(n.a)({},g,e.name===R)),itemId:"".concat(e.name),"aria-controls":"".concat(e.name,"-view"),selected:e.name===R,key:e.name,onClick:d(S,e.name)},!!e.icon&&React.createElement("div",{class:"presto-player__menu-icon"},e.icon),e.title,React.createElement("svg",{className:"submenu-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",role:"img",ariaHidden:"true",focusable:"false"},React.createElement("path",{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})))}))))})))}},function(e,t,r){"use strict";var n,a,o=r(6),l=r(5),c=r(3),i=r(4),s=r(13),p=r(16),u=r(25),d=r(12),b=r(0);function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){Object(l.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function v(e){var t=e.state,r=e.updateState,m=e.className,v=t.cta,f=t.email_collection,h=Object(p.useSelect)((function(e){return e("presto-player/player").branding()})),O={percentage:100,show_rewatch:!0,show_skip:!0,headline:Object(c.__)("Want to learn more?","presto-player"),show_button:!0,button_text:Object(c.__)("Click Here","presto-player"),button_link:{opensInNewTab:!0}};Object(s.useEffect)((function(){Object.keys(O).forEach((function(e){var r;void 0===(null==t||null===(r=t.cta)||void 0===r?void 0:r[e])&&g(Object(l.a)({},e,O[e]))}))}),[t]);var g=function(e){r(y(y({},t),{},{cta:y(y({},v),e)}))};return Object(b.b)("div",{className:m},Object(b.b)(i.BaseControl,null,Object(b.b)("h3",null,Object(c.__)("Call To Action","presto-player"))),Object(b.b)(i.BaseControl,{className:"presto-player__control--large-play"},Object(b.b)(i.ToggleControl,{label:Object(c.__)("Enable","presto-player"),help:Object(c.__)("Show an email collection form and message over your player.","presto-player"),onChange:function(e){g({enabled:e})},checked:null==v?void 0:v.enabled})),!(null==v||!v.enabled)&&Object(b.b)(React.Fragment,null,Object(b.b)(i.BaseControl,{className:"presto-player__control--percentage-watched"},Object(b.b)(i.RangeControl,{label:Object(c.__)("Display At (Percentage)","presto-player"),labelPosition:"top",onChange:function(e){g({percentage:e})},marks:[{value:0,label:Object(c.__)("Start","presto-player")},{value:50,label:Object(c.__)("50% Watched","presto-player")},{value:100,label:Object(c.__)("End","presto-player")}],shiftStep:5,value:null==v?void 0:v.percentage})),(null==f?void 0:f.enabled)&&(null==f?void 0:f.percentage)===(null==v?void 0:v.percentage)&&Object(b.b)(i.Notice,{css:Object(b.a)(n||(n=Object(o.a)(["\n margin: 0 0 30px 0 !important;\n "]))),status:"warning",isDismissible:!1},Object(c.__)("You already have an email capture set display at the same time.","presto-player"),Object(b.b)(i.Button,{onClick:function(){r(y(y({},t),{},{email_collection:y(y({},f),{enabled:!1})}))},isLink:!0,css:Object(b.a)(a||(a=Object(o.a)(["\n margin-top: 10px !important;\n "])))},Object(c.__)("Disable Email Capture","presto-player"))),100===(null==v?void 0:v.percentage)?Object(b.b)(i.BaseControl,{className:"presto-player__control--show-rewatch"},Object(b.b)(i.ToggleControl,{label:Object(c.__)("Show Rewatch Button","presto-player"),help:Object(c.__)("Show a rewatch button at the end of the player.","presto-player"),onChange:function(e){g({show_rewatch:e})},checked:null==v?void 0:v.show_rewatch})):Object(b.b)(i.BaseControl,{className:"presto-player__control--show-skip"},Object(b.b)(i.ToggleControl,{label:Object(c.__)("Allow Skipping","presto-player"),help:Object(c.__)("Let the user continue watching the player.","presto-player"),onChange:function(e){g({show_skip:e})},checked:null==v?void 0:v.show_skip})),Object(b.b)(i.BaseControl,{className:"presto-player__control--button-link"},Object(b.b)(i.BaseControl.VisualLabel,null,Object(b.b)("p",null," ",Object(c.__)("Link","presto-player"))),Object(b.b)(u.a,{setSettings:function(e){g({button_link:e})},settings:(null==v?void 0:v.button_link)||{}})),Object(b.b)(i.BaseControl,{className:"presto-player__control--headline"},Object(b.b)(i.TextareaControl,{label:Object(c.__)("Headline","presto-player"),help:Object(c.__)("The headline for your form.","presto-player"),value:null==v?void 0:v.headline,onChange:function(e){g({headline:e})}})),Object(b.b)(i.BaseControl,{className:"presto-player__control--bottom-text"},Object(b.b)(i.TextareaControl,{label:Object(c.__)("Bottom Text","presto-player"),help:Object(c.__)("Text displayed below the form. HTML allowed.","presto-player"),value:null==v?void 0:v.bottom_text,onChange:function(e){g({bottom_text:e})}})),Object(b.b)(i.BaseControl,{className:"presto-player__control--show-button"},Object(b.b)(i.ToggleControl,{label:Object(c.__)("Show Button","presto-player"),help:Object(c.__)("Show a call to action button.","presto-player"),onChange:function(e){g({show_button:e})},checked:null==v?void 0:v.show_button})),!(null==v||!v.show_button)&&Object(b.b)("div",null,Object(b.b)(i.BaseControl,{className:"presto-player__control--button-text"},Object(b.b)(i.TextControl,{label:Object(c.__)("Button Text","presto-player"),help:Object(b.b)("p",null,Object(c.__)("Button text for the Call To Action","presto-player")),value:null==v?void 0:v.button_text,onChange:function(e){return g({button_text:e})}})),Object(b.b)("h3",null,Object(c.__)("Style","presto-player")),Object(b.b)(i.BaseControl,null,Object(b.b)(i.RangeControl,{label:Object(c.__)("Round Corners","presto-player"),help:Object(c.__)("Border radius of form elements.","presto-player"),value:(null==v?void 0:v.button_radius)||0,onChange:function(e){return g({button_radius:e})},min:0,max:25})),Object(b.b)(i.BaseControl,{className:"presto-player__control--button-color"},Object(b.b)(i.Flex,null,Object(b.b)(i.BaseControl.VisualLabel,null,Object(c.__)("Button Color","presto-player")),Object(b.b)(d.a,{color:(null==v?void 0:v.button_color)||(null==h?void 0:h.color),setColor:function(e){return g({button_color:e&&e.hex})}}))),Object(b.b)(i.BaseControl,{className:"presto-player__control--button-text-color"},Object(b.b)(i.Flex,null,Object(b.b)(i.BaseControl.VisualLabel,null,Object(c.__)("Button Text Color","presto-player")),Object(b.b)(d.a,{color:(null==v?void 0:v.button_text_color)||"#ffffff",setColor:function(e){return g({button_text_color:e&&e.hex})}})))),Object(b.b)(i.BaseControl,null,Object(b.b)(i.RangeControl,{label:Object(c.__)("Background Opacity","presto-player"),help:Object(c.__)("Opacity percentage of the cover background.","presto-player"),value:(null==v?void 0:v.background_opacity)||75,onChange:function(e){return g({background_opacity:e})},min:0,max:100}))))}v.defaultProps={catName:"Sandy",eyeColor:"deepblue",age:"120"},t.a=v},function(e,t,r){"use strict";var n=wp.apiFetch;n.use(n.createNonceMiddleware(prestoPlayer.nonce)),n.use(n.createRootURLMiddleware(prestoPlayer.root+prestoPlayer.prestoVersionString)),t.a=n},function(e,t,r){"use strict";r.d(t,"a",(function(){return N}));var n=r(8),a=r(49),o=r(1),l=r(5);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){Object(l.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var s=wp.i18n,p=s.__,u=s.sprintf,d=wp.components,b=d.NavigableMenu,m=d.MenuItem,y=d.FormFileUpload,v=d.MenuGroup,f=d.ToolbarGroup,h=d.ToolbarButton,O=d.Dropdown,g=(d.SVG,d.Rect,d.Path,d.Button),j=d.TextControl,w=(d.SelectControl,wp.blockEditor),_=w.MediaUpload,E=w.MediaUploadCheck,R=wp.data.useSelect,k=wp.element.useState,P=["text/vtt"],C=React.createElement("svg",{viewBox:"0 0 29 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.5014 20.2854H28.6316V0.764648H0.110825V20.2854H11.241L14.3712 24.2854L17.5014 20.2854ZM14.3712 21.0401L16.5269 18.2854H26.6316V2.76465H2.11082V18.2854H12.2155L14.3712 21.0401Z"}),React.createElement("path",{d:"M10.4503 14.9446C9.56226 14.9446 8.76226 14.7606 8.05026 14.3926C7.33826 14.0166 6.77826 13.4966 6.37026 12.8326C5.97026 12.1606 5.77026 11.4006 5.77026 10.5526C5.77026 9.70464 5.97026 8.94864 6.37026 8.28464C6.77826 7.61264 7.33826 7.09264 8.05026 6.72464C8.76226 6.34864 9.56226 6.16064 10.4503 6.16064C11.2663 6.16064 11.9943 6.30464 12.6343 6.59264C13.2743 6.88064 13.8023 7.29664 14.2183 7.84064L12.4303 9.43664C11.9103 8.78064 11.2983 8.45264 10.5943 8.45264C10.0023 8.45264 9.52626 8.64464 9.16626 9.02864C8.80626 9.40464 8.62626 9.91264 8.62626 10.5526C8.62626 11.1926 8.80626 11.7046 9.16626 12.0886C9.52626 12.4646 10.0023 12.6526 10.5943 12.6526C11.2983 12.6526 11.9103 12.3246 12.4303 11.6686L14.2183 13.2646C13.8023 13.8086 13.2743 14.2246 12.6343 14.5126C11.9943 14.8006 11.2663 14.9446 10.4503 14.9446Z"}),React.createElement("path",{d:"M19.2042 14.9446C18.3162 14.9446 17.5162 14.7606 16.8042 14.3926C16.0922 14.0166 15.5322 13.4966 15.1242 12.8326C14.7242 12.1606 14.5242 11.4006 14.5242 10.5526C14.5242 9.70464 14.7242 8.94864 15.1242 8.28464C15.5322 7.61264 16.0922 7.09264 16.8042 6.72464C17.5162 6.34864 18.3162 6.16064 19.2042 6.16064C20.0202 6.16064 20.7482 6.30464 21.3882 6.59264C22.0282 6.88064 22.5562 7.29664 22.9722 7.84064L21.1842 9.43664C20.6642 8.78064 20.0522 8.45264 19.3482 8.45264C18.7562 8.45264 18.2802 8.64464 17.9202 9.02864C17.5602 9.40464 17.3802 9.91264 17.3802 10.5526C17.3802 11.1926 17.5602 11.7046 17.9202 12.0886C18.2802 12.4646 18.7562 12.6526 19.3482 12.6526C20.0522 12.6526 20.6642 12.3246 21.1842 11.6686L22.9722 13.2646C22.5562 13.8086 22.0282 14.2246 21.3882 14.5126C20.7482 14.8006 20.0202 14.9446 19.2042 14.9446Z"}));function x(e){var t,r=e.tracks,n=e.onEditPress;return t=0===r.length?React.createElement("p",{className:"block-library-video-tracks-editor__tracks-informative-message"},p("Captions are .vtt files that help make your content more accesible to a wider range of users.","presto-player")):r.map((function(e,t){return React.createElement("div",{key:t,className:"block-library-video-tracks-editor__track-list-track"},React.createElement("span",null,e.label," "),React.createElement(g,{isTertiary:!0,onClick:function(){return n(t)},"aria-label":u(p("Edit %s","presto-player"),e.label)},p("Edit","presto-player")))})),React.createElement(v,{label:p("Captions","presto-player"),className:"block-library-video-tracks-editor__track-list"},t)}function S(e){var t=e.track,r=e.onChange,n=e.onClose,a=e.onRemove,o=t.src,l=void 0===o?"":o,c=t.label,s=void 0===c?"":c,u=t.srcLang,d=void 0===u?"":u,m=(t.kind,l.startsWith("blob:")?"":l.substring(l.lastIndexOf("/")+1));return React.createElement(b,null,React.createElement("div",{className:"block-library-video-tracks-editor__single-track-editor"},React.createElement("span",{className:"block-library-video-tracks-editor__single-track-editor-edit-track-label"},p("Edit caption track","presto-player")),React.createElement("span",null,p("File","presto-player"),": ",React.createElement("b",null,m)),React.createElement("div",{className:"block-library-video-tracks-editor__single-track-editor-label-language"},React.createElement(j,{autoFocus:!0,onChange:function(e){return r(i(i({},t),{},{label:e}))},label:p("Label","presto-player"),value:s,help:p("Title of track","presto-player")}),React.createElement(j,{onChange:function(e){return r(i(i({},t),{},{srcLang:e}))},label:p("Source language","presto-player"),value:d,help:p("Language tag (en, fr, etc.)","presto-player")})),React.createElement("div",{className:"block-library-video-tracks-editor__single-track-editor-buttons-container"},React.createElement(g,{isSecondary:!0,onClick:function(){var e={},a=!1;""===s&&(e.label=p("English","presto-player"),a=!0),""===d&&(e.srcLang="en",a=!0),a&&r(i(i({},t),e)),n()}},p("Close","presto-player")),React.createElement(g,{isDestructive:!0,isLink:!0,onClick:a},p("Remove track","presto-player")))))}function N(e){var t=e.tracks,r=void 0===t?[]:t,l=e.onChange,c=R((function(e){return e("core/block-editor").getSettings().mediaUpload}),[]),s=k(null),u=Object(o.a)(s,2),d=u[0],g=u[1];return c?React.createElement(O,{contentClassName:"block-library-video-tracks-editor",renderToggle:function(e){var t=e.isOpen,r=e.onToggle;return React.createElement(f,null,React.createElement(h,{label:p("Captions","presto-player"),showTooltip:!0,"aria-expanded":t,"aria-haspopup":"true",onClick:r,icon:C}))},renderContent:function(e){return Object(a.a)(e),null!==d?React.createElement(S,{track:r[d],onChange:function(e){var t=Object(n.a)(r);t[d]=e,l(t)},onClose:function(){return g(null)},onRemove:function(){l(r.filter((function(e,t){return t!==d}))),g(null)}}):React.createElement(React.Fragment,null,React.createElement(b,null,React.createElement(x,{tracks:r,onEditPress:g}),React.createElement(v,{className:"block-library-video-tracks-editor__add-tracks-container",label:p("Add caption languages","presto-player")},React.createElement(_,{onSelect:function(e){var t=e.url,a=r.length;l([].concat(Object(n.a)(r),[{src:t}])),g(a)},allowedTypes:P,render:function(e){var t=e.open;return React.createElement(m,{icon:"media",onClick:t},p("Open Media Library","presto-player"))}}),React.createElement(E,null,React.createElement(y,{onChange:function(e){var t=e.target.files,a=r.length;c({allowedTypes:P,filesList:t,onFileChange:function(e){var t=Object(o.a)(e,1)[0].url,c=Object(n.a)(r);c[a]||(c[a]={}),c[a]=i(i({},r[a]),{},{src:t}),l(c),g(a)}})},accept:".vtt,text/vtt",render:function(e){var t=e.openFileDialog;return React.createElement(m,{icon:"upload",onClick:function(){t()}},p("Upload","presto-player"))}})))))}}):null}},function(e,t,r){"use strict";var n=r(5),a=r(1),o=r(23),l=r(9),c=r(14);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=wp.i18n.__,u=wp.components.Disabled,d=wp.element,b=d.useState,m=d.useEffect;t.a=function(e){var t,r,n,i=e.state,d=e.branding,y=e.menu,v=e.src,f=e.poster,h=e.currentTime,O=e.preload,g=e.overlays,j=e.isDisabled,w=void 0===j||j,_=b(1),E=Object(a.a)(_,2),R=E[0],k=E[1],P=i.email_collection,C=i.cta;m((function(){k(R+1)}),[i.skin,i["play-large"],i.rewind,i.play,i["fast-forward"],i.progress,i["current-time"],i.mute,i.volume,i.speed,i.pip,i.fullscreen,i.captions,i.hide_logo]);var x={email:!(null==P||!P.enabled)&&React.createElement(o.b,{className:"email-overlay",slot:"player-end",headline:null==P?void 0:P.headline,style:s(s({"--presto-player-email-border-radiuss":"".concat(null==P?void 0:P.button_radius,"px"),"--plyr-color-main":(null==i?void 0:i.background_color)||(null==d?void 0:d.color)},P.button_color?{"--presto-player-button-color":"".concat(P.button_color)}:{}),P.button_text_color?{"--presto-player-button-text":"".concat(P.button_text_color)}:{}),defaultHeadline:p("Enter your email to play.","presto-player"),bottomText:null==P?void 0:P.bottom_text,allowSkip:null==P?void 0:P.allow_skip,skipText:p("Skip","presto-player"),buttonText:null==P?void 0:P.button_text,placeholder:p("Email address","presto-player"),i18n:window.prestoPlayer.i18n}),cta:!(null==C||!C.enabled)&&React.createElement(o.a,{className:"cta-overlay",style:s(s(s({"--presto-player-button-border-radius":"".concat(C.button_radius,"px")},null!=C&&C.background_opacity?{"--presto-player-cta-background-opacity":"".concat((null==C?void 0:C.background_opacity)/100)}:{}),C.button_color?{"--presto-player-button-color":"".concat(C.button_color)}:{}),C.button_text_color?{"--presto-player-button-text":"".concat(C.button_text_color)}:{}),slot:"player-end",headline:null==C?void 0:C.headline,"bottom-text":null==C?void 0:C.bottom_text,"button-link":null==C?void 0:C.button_link,"allow-skip":100!==(null==C?void 0:C.percentage)&&(null==C?void 0:C.show_skip),borderRadius:null==C?void 0:C.border_radius,"allow-rewatch":100===(null==C?void 0:C.percentage)&&(null==C?void 0:C.show_rewatch),"skip-text":p("Skip","presto-player"),"show-button":null==C?void 0:C.show_button,"button-text":null==C?void 0:C.button_text,i18n:null===(t=window)||void 0===t||null===(r=t.prestoPlayer)||void 0===r?void 0:r.i18n})};return React.createElement(u,{isDisabled:w,className:"disable-player"},React.createElement("div",{className:"presto-player__wrapper"},React.createElement(c.a,{src:v||"",className:"\n ".concat("cta"===y&&!(null==C||!C.enabled)&&"cta-active"," \n ").concat("email"===y&&!(null==P||!P.enabled)&&"email-active"),preset:i,branding:s(s({},d),{},{logo:null!=i&&i.hide_logo?"":d.logo}),i18n:null===(n=prestoPlayerAdmin)||void 0===n?void 0:n.i18n,preload:O,attributes:{chapters:[],poster:f},currentTime:h?Object(l.e)(h):"",overlays:g,key:R,adminPreview:(null==x?void 0:x[y])||""})))}},function(e,t,r){"use strict";var n=r(1),a=wp.i18n.__,o=wp.components.TextareaControl,l=wp.element.useState;t.a=function(e){var t=e.text,r=e.update,c=e.onFocus,i=l(!1),s=Object(n.a)(i,2),p=s[0],u=s[1];return React.createElement("div",{style:{display:"block",width:"100%"}},React.createElement(o,{label:"Text",help:React.createElement("span",null,a("This field accepts","presto-player")," ",React.createElement("a",{href:"#",onClick:function(e){u(!p),e.preventDefault()}},a("Dynamic Data","presto-player")),!!p&&React.createElement("div",{style:{marginTop:"20px"}},a("This field will also accept dynamic values that we will replace with dynamic content: {user.user_login}, {user.user_nicename}, {user.user_email}, {user.user_url},{user.user_registered}, {user.display_name}, {site.url}, {site.name}, {ip_address}","presto-player"))),className:"presto-player__overlay--text",placeholder:a("Enter some text.","presto-player"),value:t||"",onChange:function(e){return r({text:e})},autoComplete:"off",onFocus:c}))}},function(e,t,r){"use strict";var n=r(1),a=wp.components,o=a.Button,l=a.Placeholder,c=a.TextControl,i=a.Flex,s=a.FlexItem,p=a.FlexBlock,u=wp.element.useState,d=wp.i18n.__;t.a=function(e){var t=e.attributes,r=(e.setAttributes,e.icon),a=e.onSelectURL,b=e.label,m=e.instructions,y=e.placeholder,v=t.src,f=u({src:v}),h=Object(n.a)(f,2),O=h[0],g=h[1];return React.createElement(l,{icon:r,label:b||d("Presto Embedded Video","presto-player"),instructions:m||d("Enter video URL","presto-player")},React.createElement("form",{onSubmit:function(e){e.preventDefault(),a(O.url)}},React.createElement(i,{style:{width:"100%",maxWidth:"400px"}},React.createElement(p,null,React.createElement(c,{type:"url",className:"presto-link-placeholder-input",placeholder:y||d("Youtube URL","presto-player"),value:O.url,onChange:function(e){return g({url:e})}})),React.createElement(s,null,React.createElement(o,{isPrimary:!0,style:{marginBottom:"8px"},type:"submit"},d("Add Video","presto-player"))))))}},function(e,t,r){"use strict";var n,a,o=r(6),l=r(5),c=r(3),i=r(4),s=r(16),p=r(8),u=r(7),d=r(1),b=r(2),m=r.n(b),y=function(){return React.createElement("div",null,React.createElement("presto-player-skeleton",{style:{width:"30%",marginBottom:"10px"}}),React.createElement("presto-player-skeleton",{style:{height:"2rem",marginBottom:"20px"}}))},v=wp.i18n.__,f=wp.components,h=f.SelectControl,O=f.TextControl,g=f.Notice,j=wp.element,w=j.useEffect,_=j.useState,E=function(e){var t=e.options,r=e.updateEmailState,n=_(!1),a=Object(d.a)(n,2),o=a[0],l=a[1],c=_([{value:null,label:v("Choose an audience","presto-player")}]),i=Object(d.a)(c,2),s=i[0],b=i[1],f=_(""),j=Object(d.a)(f,2),E=j[0],R=j[1],k=function(){var e=Object(u.a)(m.a.mark((function e(){var t,r;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/mailchimp/lists"});case 4:t=e.sent,r=s,(t||[]).forEach((function(e){r=[].concat(Object(p.a)(r),[{value:e.id,label:e.name}])})),b(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&e.t0.message&&R(e.t0.message);case 13:return e.prev=13,l(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(){return e.apply(this,arguments)}}();return w((function(){k()}),[]),o?React.createElement("div",null,React.createElement(y,null),React.createElement(y,null)):E?React.createElement(g,{className:"presto-notice",status:"error",isDismissible:!1},E):React.createElement("div",null,React.createElement(h,{label:v("Choose an audience","presto-player"),value:null==t?void 0:t.provider_list,options:s,onChange:function(e){return r({provider_list:e})}}),React.createElement(O,{label:v("Tag","presto-player"),help:React.createElement("p",null,v("Give this contact an optional tag when they are added to the list.","presto-player")),value:null==t?void 0:t.provider_tag,onChange:function(e){return r({provider_tag:e})}}))},R=wp.i18n.__,k=wp.components,P=k.SelectControl,C=k.Notice,x=wp.element,S=x.useEffect,N=x.useState,T=function(e){var t=e.options,r=e.updateEmailState,n=N(!1),a=Object(d.a)(n,2),o=a[0],l=a[1],c=N([{value:null,label:R("Choose a group","presto-player")}]),i=Object(d.a)(c,2),s=i[0],b=i[1],v=N(""),f=Object(d.a)(v,2),h=f[0],O=f[1],g=function(){var e=Object(u.a)(m.a.mark((function e(){var t,r;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/mailerlite/groups"});case 4:t=e.sent,r=s,(t||[]).forEach((function(e){r=[].concat(Object(p.a)(r),[{value:e.id,label:e.name}])})),b(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&e.t0.message&&O(e.t0.message);case 13:return e.prev=13,l(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(){return e.apply(this,arguments)}}();return S((function(){g()}),[]),o?React.createElement(y,null):h?React.createElement(C,{className:"presto-notice",status:"error",isDismissible:!1},h):React.createElement("div",null,React.createElement(P,{label:R("Choose a group","presto-player"),value:null==t?void 0:t.provider_list,options:s,onChange:function(e){return r({provider_list:e})}}))},D=wp.i18n.__,B=wp.components,A=B.SelectControl,L=B.Notice,I=wp.element,F=I.useEffect,V=I.useState,U=function(e){var t=e.options,r=e.updateEmailState,n=V(!1),a=Object(d.a)(n,2),o=a[0],l=a[1],c=V(!1),i=Object(d.a)(c,2),s=i[0],b=i[1],v=V([{value:null,label:D("Choose a list","presto-player")}]),f=Object(d.a)(v,2),h=f[0],O=f[1],g=V([{value:null,label:D("Choose a tag","presto-player")}]),j=Object(d.a)(g,2),w=j[0],_=j[1],E=V(""),R=Object(d.a)(E,2),k=R[0],P=R[1],C=function(){var e=Object(u.a)(m.a.mark((function e(){var t,r;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/activecampaign/lists"});case 4:t=e.sent,r=h,(t||[]).forEach((function(e){r=[].concat(Object(p.a)(r),[{value:e.id,label:e.name||D("Default list","presto-player")}])})),O(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&e.t0.message&&P(e.t0.message);case 13:return e.prev=13,l(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(){return e.apply(this,arguments)}}(),x=function(){var e=Object(u.a)(m.a.mark((function e(){var t,r;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/activecampaign/tags"});case 4:t=e.sent,r=w,(t||[]).forEach((function(e){r=[].concat(Object(p.a)(r),[{value:e.id,label:e.tag}])})),_(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&e.t0.message&&P(e.t0.message);case 13:return e.prev=13,b(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(){return e.apply(this,arguments)}}();return F((function(){C(),x()}),[]),k?React.createElement(L,{className:"presto-notice",status:"error",isDismissible:!1},k):React.createElement("div",null,o?React.createElement(y,null):h.length>1&&React.createElement(A,{label:D("Choose a list","presto-player"),value:null==t?void 0:t.provider_list,options:h,onChange:function(e){return r({provider_list:e})}}),s?React.createElement(y,null):w.length>1&&React.createElement(A,{label:D("Choose a tag","presto-player"),value:null==t?void 0:t.provider_tag,options:w,onChange:function(e){return r({provider_tag:e})}}))},M=wp.i18n.__,z=wp.components,W=z.SelectControl,H=z.Notice,Y=wp.element,G=Y.useEffect,q=Y.useState,Z=function(e){var t=e.options,r=e.updateEmailState,n=q(!1),a=Object(d.a)(n,2),o=a[0],l=a[1],c=q(!1),i=Object(d.a)(c,2),s=i[0],b=i[1],v=q([{value:null,label:M("Choose a list","presto-player")}]),f=Object(d.a)(v,2),h=f[0],O=f[1],g=q([{value:null,label:M("Choose a tag","presto-player")}]),j=Object(d.a)(g,2),w=j[0],_=j[1],E=q(""),R=Object(d.a)(E,2),k=R[0],P=R[1],C=function(){var e=Object(u.a)(m.a.mark((function e(){var t,r;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/fluentcrm/lists"});case 4:t=e.sent,r=h,(t||[]).forEach((function(e){r=[].concat(Object(p.a)(r),[{value:e.id,label:e.title||e.slug}])})),O(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&e.t0.message&&P(e.t0.message);case 13:return e.prev=13,l(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(){return e.apply(this,arguments)}}(),x=function(){var e=Object(u.a)(m.a.mark((function e(){var t,r;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/fluentcrm/tags"});case 4:t=e.sent,r=w,(t||[]).forEach((function(e){r=[].concat(Object(p.a)(r),[{value:e.id,label:e.title||e.slug}])})),_(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),null!==e.t0&&void 0!==e.t0&&e.t0.message&&P(e.t0.message);case 13:return e.prev=13,b(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,10,13,16]])})));return function(){return e.apply(this,arguments)}}();return G((function(){C(),x()}),[]),k?React.createElement(H,{className:"presto-notice",status:"error",isDismissible:!1},k):React.createElement("div",null,o?React.createElement(y,null):h.length>1&&React.createElement(W,{label:M("Choose a list","presto-player"),value:null==t?void 0:t.provider_list,options:h,onChange:function(e){return r({provider_list:e})}}),s?React.createElement(y,null):w.length>1&&React.createElement(W,{label:M("Choose a tag","presto-player"),value:null==t?void 0:t.provider_tag,options:w,onChange:function(e){return r({provider_tag:e})}}))},K=wp.i18n.__,Q=wp.components,X=Q.SelectControl,$=Q.Button,J=Q.Flex,ee=Q.Icon,te=wp.element,re=te.useEffect,ne=te.useState,ae=function(e){var t=e.options,r=e.updateEmailState,n=ne(!1),a=Object(d.a)(n,2),o=a[0],l=a[1],c=ne([{value:"none",label:K("None","presto-player")}]),i=Object(d.a)(c,2),s=i[0],b=i[1],v=ne(""),f=Object(d.a)(v,2),h=f[0],O=f[1],g={presto_player_activecampaign:{label:"ActiveCampaign",value:"activecampaign"},presto_player_mailchimp:{label:"MailChimp",value:"mailchimp"},presto_player_mailerlite:{label:"MailerLite",value:"mailerlite"},presto_player_fluentcrm:{label:"FluentCRM",value:"fluentcrm"}},j=function(){var e=Object(u.a)(m.a.mark((function e(){var t,r;return m.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l(!0),O(""),e.prev=2,e.next=5,wp.apiFetch({path:"wp/v2/settings"});case 5:t=e.sent,r=s,Object.keys(t).forEach((function(e){var n;null!=g&&g[e]&&null!==(n=t[e])&&void 0!==n&&n.connected&&(r=[].concat(Object(p.a)(r),[g[e]]))})),b(r),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),null!==e.t0&&void 0!==e.t0&&e.t0.message&&O(e.t0.message);case 14:return e.prev=14,l(!1),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[2,11,14,17]])})));return function(){return e.apply(this,arguments)}}();re((function(){j()}),[]);return o?React.createElement(y,null):React.createElement("div",null,h,s.length>1?React.createElement("div",null,React.createElement(X,{label:K("Choose an email provider","presto-player"),value:null==t?void 0:t.provider,options:s,onChange:function(e){return r({provider:e})}}),function(){var e=s.find((function(e){return e.value===(null==t?void 0:t.provider)}));if(Object.keys(e||{}).length)switch(null==t?void 0:t.provider){case"mailchimp":return React.createElement(E,{options:t,updateEmailState:r});case"mailerlite":return React.createElement(T,{options:t,updateEmailState:r});case"activecampaign":return React.createElement(U,{options:t,updateEmailState:r});case"fluentcrm":return React.createElement(Z,{options:t,updateEmailState:r})}}()):React.createElement(J,null,React.createElement($,{target:"_blank",href:"/wp-admin/edit.php?post_type=pp_video_block&page=presto-player-settings#/integrations",isSecondary:!0,isSmall:!0},K("Connect a provider","presto-player")),React.createElement($,{isSmall:!0,onClick:function(e){e.preventDefault(),j()}},React.createElement(ee,{icon:"update"}))))},oe=r(12),le=r(0);function ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ie(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(r),!0).forEach((function(t){Object(l.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.a=function(e){var t=e.state,r=e.updateState,l=e.className,p=t.email_collection,u=t.cta,d=Object(s.useSelect)((function(e){return e("presto-player/player").branding()})),b=function(e){r(ie(ie({},t),{},{email_collection:ie(ie({},p),e)}))};return Object(le.b)("div",{className:l},Object(le.b)(i.BaseControl,null,Object(le.b)("h3",null,Object(c.__)("Email Capture","presto-player"))),Object(le.b)(i.BaseControl,{className:"presto-player__control--large-play"},Object(le.b)(i.ToggleControl,{label:Object(c.__)("Enable","presto-player"),help:Object(c.__)("Show an email collection form and message over your player.","presto-player"),onChange:function(e){b({enabled:e})},checked:null==p?void 0:p.enabled})),!(null==p||!p.enabled)&&Object(le.b)(React.Fragment,null,Object(le.b)(i.BaseControl,{className:"presto-player__control--percentage-watched"},Object(le.b)(i.RangeControl,{label:Object(c.__)("Display At (Percentage)","presto-player"),labelPosition:"top",onChange:function(e){b({percentage:e})},marks:[{value:0,label:Object(c.__)("Start","presto-player")},{value:50,label:Object(c.__)("50% Watched","presto-player")},{value:100,label:Object(c.__)("End","presto-player")}],shiftStep:5,value:(null==p?void 0:p.percentage)||0})),(null==u?void 0:u.enabled)&&(null==p?void 0:p.percentage)===(null==u?void 0:u.percentage)&&Object(le.b)(i.Notice,{css:Object(le.a)(n||(n=Object(o.a)(["\n margin: 0 0 30px 0 !important;\n "]))),status:"warning",isDismissible:!1},Object(c.__)("You already have a Call To Action set display at the same time.","presto-player"),Object(le.b)(i.Button,{onClick:function(){r(ie(ie({},t),{},{cta:ie(ie({},u),{enabled:!1})}))},isLink:!0,css:Object(le.a)(a||(a=Object(o.a)(["\n margin-top: 10px !important;\n "])))},Object(c.__)("Disable Call To Action","presto-player"))),Object(le.b)(i.BaseControl,{className:"presto-player__control--large-play"},Object(le.b)(i.ToggleControl,{label:Object(c.__)("Allow Skipping","presto-player"),help:Object(c.__)("Let the viewer skip","presto-player"),onChange:function(e){b({allow_skip:e})},checked:null==p?void 0:p.allow_skip})),Object(le.b)(i.BaseControl,{className:"presto-player__control--large-play"},Object(le.b)(i.TextareaControl,{label:Object(c.__)("Headline","presto-player"),help:Object(c.__)("The headline for your form.","presto-player"),value:null==p?void 0:p.headline,onChange:function(e){b({headline:e})}})),Object(le.b)(i.BaseControl,{className:"presto-player__control--large-play"},Object(le.b)(i.TextareaControl,{label:Object(c.__)("Bottom Text","presto-player"),help:Object(c.__)("Text displayed below the form. HTML allowed.","presto-player"),value:null==p?void 0:p.bottom_text,onChange:function(e){b({bottom_text:e})}})),Object(le.b)(i.BaseControl,{className:"presto-player__control--large-play"},Object(le.b)(i.TextControl,{label:Object(c.__)("Play Button Text","presto-player"),help:Object(le.b)("p",null,Object(c.__)("Submit button text","presto-player")),value:null==p?void 0:p.button_text,onChange:function(e){return b({button_text:e})}})),Object(le.b)(i.BaseControl,{className:"presto-player__control--button-color"},Object(le.b)(i.Flex,null,Object(le.b)(i.BaseControl.VisualLabel,null,Object(c.__)("Button Color","presto-player")),Object(le.b)(oe.a,{color:(null==u?void 0:u.button_color)||(null==d?void 0:d.color),setColor:function(e){return b({button_color:e&&e.hex})}}))),Object(le.b)(i.BaseControl,{className:"presto-player__control--button-text-color"},Object(le.b)(i.Flex,null,Object(le.b)(i.BaseControl.VisualLabel,null,Object(c.__)("Button Text Color","presto-player")),Object(le.b)(oe.a,{color:(null==u?void 0:u.button_text_color)||"#ffffff",setColor:function(e){return b({button_text_color:e&&e.hex})}}))),Object(le.b)("h3",null,Object(c.__)("Integrate","presto-player")),Object(le.b)(i.BaseControl,null,Object(le.b)(ae,{updateEmailState:b,options:p})),Object(le.b)("h3",null,Object(c.__)("Style","presto-player")),Object(le.b)(i.BaseControl,null,Object(le.b)(i.RangeControl,{label:Object(c.__)("Round Corners","presto-player"),help:Object(c.__)("Border radius of form elements.","presto-player"),value:(null==p?void 0:p.border_radius)||0,onChange:function(e){return b({border_radius:e})},min:0,max:25}))))}},function(e,t,r){"use strict";var n=r(8),a=r(5),o=r(1),l=r(9),c=wp.i18n.__,i=wp.components,s=i.Flex,p=i.FlexItem,u=i.FlexBlock,d=i.TextControl,b=i.Button,m=wp.element.useState,y=function(e){var t=e.update,r=e.add,n=e.remove,i=e.className,y=e.time,v=e.title,f=(e.disabled,e.showNotice,m(y)),h=Object(o.a)(f,2),O=h[0],g=h[1];return React.createElement(s,{align:"center",className:i},React.createElement(p,null,React.createElement(d,Object(a.a)({className:"presto-player__caption--time",style:{width:"60px"},placeholder:"0:00",value:O,onChange:function(e){return g(e)},onBlur:function(){var e=Object(l.b)(O);t({time:e}),g(e)},autoComplete:"off"},"placeholder","0:00"))),React.createElement(u,null,React.createElement(d,{className:"presto-player__caption--title",placeholder:c("Title","presto-player"),value:v||"",onChange:function(e){return t({title:e})},autoComplete:"off"})),React.createElement(p,null,n&&React.createElement(b,{icon:"minus",className:"ph-chapter__remove",style:{marginBottom:"8px"},label:c("Remove Chapter","presto-player"),onClick:n}),r&&React.createElement(b,{icon:"plus-alt",className:"ph-chapter__add",label:c("Add Chapter","presto-player"),style:{marginBottom:"8px"},onClick:function(){r(),g("")}})))};function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){Object(a.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}wp.i18n.__;var h=wp.element.useState,O=wp.data.dispatch;t.a=function(e){var t,r=e.setAttributes,a=e.attributes,l=function(){O("presto-player/player").setProModal(!0)};if(null===(t=prestoPlayer)||void 0===t||!t.isPremium)return React.createElement(y,{disabled:!0,className:"ph-chapter is-new",time:"",title:"",update:function(){},showNotice:l,add:l});var c=a.chapters,i=h({title:"",time:""}),s=Object(o.a)(i,2),p=s[0],u=s[1];return React.createElement(React.Fragment,null,(c||[]).sort((function(e,t){return parseInt(e.time.split(":")[0])-parseInt(t.time.split(":")[0])==0?parseInt(e.time.split(":")[1])-parseInt(t.time.split(":")[1]):parseInt(e.time.split(":")[0])-parseInt(t.time.split(":")[0])})).map((function(e,t){return React.createElement(y,{key:"".concat(t,"-").concat(e.time),className:"ph-chapter",time:e.time,title:e.title,chapter:e,update:function(t){!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=c.indexOf(e),a=c.map((function(e,r){return r!==n?e:f(f({},e),t)}));r({chapters:a})}(e,t)},remove:function(){!function(e){var t=c.indexOf(e);r({chapters:c.filter((function(e,r){return r!==t}))})}(e)}})})),React.createElement(y,{className:"ph-chapter is-new",time:p.time,title:p.title,update:function(e){u(f(f({},p),e))},add:function(){p.time&&p.title&&(r({chapters:[].concat(Object(n.a)(c||[]),[{time:p.time,title:p.title}])}),u({title:"",time:""}))}}))}},function(e,t,r){"use strict";var n,a,o,l=r(5),c=r(1),i=r(12),s=r(25),p=r(6),u=r(7),d=r(2),b=r.n(d),m=r(0);function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){Object(l.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f=wp.i18n.__,h=wp.components,O=h.TextControl,g=h.ExternalLink,j=h.Button,w=(h.Flex,wp.element),_=w.useState,E=w.useEffect,R=wp.data,k=R.useSelect,P=R.dispatch,C=function(e){var t=e.onClose,r=e.value,l=e.setValue,i=_(!1),s=Object(c.a)(i,2),d=s[0],y=s[1],h=wp.data.useSelect((function(e){return e("core").canUser("read","settings")})),w=k((function(e){return e("presto-player/player").youtube()}));E((function(){l(w.channel_id)}),[null==w?void 0:w.channel_id]);var R=function(){var e=Object(u.a)(b.a.mark((function e(n){var a,o;return b.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.preventDefault(),y(!0),P("presto-player/player").updateYoutube({channel_id:r}),a=v(v({},w),{channel_id:r}),e.prev=4,e.next=7,wp.apiFetch({path:"wp/v2/settings",method:"POST",data:{presto_player_youtube:a}});case 7:null!=(o=e.sent)&&o.presto_player_youtube&&(P("presto-player/player").setYoutube(null==o?void 0:o.presto_player_youtube),t()),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(4);case 13:return e.prev=13,y(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[4,11,13,16]])})));return function(t){return e.apply(this,arguments)}}();return h?Object(m.b)("form",{onSubmit:R},Object(m.b)(O,{css:Object(m.a)(n||(n=Object(p.a)(["\n margin-bottom: 0 !important;\n "]))),label:f("Youtube Channel ID","presto-player"),help:Object(m.b)("p",null,Object(m.b)(g,{href:"https://support.google.com/youtube/answer/3250431?hl=en"},f("Find my channel id","presto-player"))),value:r,onChange:function(e){return l(e)}}),Object(m.b)(j,{disabled:d,isBusy:d,css:Object(m.a)(a||(a=Object(p.a)(["\n margin-bottom: 1em;\n "]))),isPrimary:!0,type:"submot"},f("Save","presto-player")),Object(m.b)(j,{onClick:t,css:Object(m.a)(o||(o=Object(p.a)(["\n margin-bottom: 1em;\n "]))),isTertiary:!0},f("Cancel","presto-player"))):""};function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){Object(l.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var N=wp.i18n.__,T=wp.components,D=T.ToggleControl,B=T.Flex,A=T.Button,L=T.BaseControl,I=T.RangeControl,F=T.TextControl,V=T.SelectControl,U=T.TextareaControl,M=wp.element,z=M.useEffect,W=M.useState,H=wp.data.useSelect;t.a=function(e){var t=e.state,r=e.updateState,n=e.className,a=e.value,o=e.setValue,l=t.action_bar,p=W(!1),u=Object(c.a)(p,2),d=u[0],b=u[1],m=H((function(e){return e("presto-player/player").branding()})),y=H((function(e){return e("presto-player/player").youtube()})),v=function(e){r(S(S({},t),{},{action_bar:S(S({},l),e)}))};z((function(){null!=l&&l.text||v({text:"Like this?"}),null!=l&&l.button_type||v({button_type:"custom"}),null!=l&&l.button_text||v({button_text:"Click Here"})}),[t]);return React.createElement("div",{className:n},React.createElement(L,null,React.createElement("h3",null,N("Action Bar","presto-player"))),React.createElement(L,{className:"presto-player__control--large-play"},React.createElement(D,{label:N("Enable","presto-player"),help:N("Show an action bar below your player while it's playing.","presto-player"),onChange:function(e){v({enabled:e})},checked:null==l?void 0:l.enabled})),!(null==l||!l.enabled)&&React.createElement(React.Fragment,null,React.createElement(L,{className:"presto-player__control--percentage-watched"},React.createElement(I,{label:N("Display At (Percentage)","presto-player"),labelPosition:"top",onChange:function(e){v({percentage_start:e})},marks:[{value:0,label:N("Start","presto-player")},{value:50,label:N("50% Watched","presto-player")},{value:100,label:N("End","presto-player")}],shiftStep:5,value:(null==l?void 0:l.percentage_start)||0})),React.createElement(L,{className:"presto-player__control--large-play"},React.createElement(U,{label:N("Text","presto-player"),help:N("Action bar text.","presto-player"),value:null==l?void 0:l.text,onChange:function(e){return v({text:e})}})),React.createElement(L,{className:"presto-player__control--large-play"},React.createElement(B,null,React.createElement(L.VisualLabel,null,N("Action Bar Background","presto-player")),React.createElement(i.a,{color:(null==l?void 0:l.background_color)||"#1d1d1d",setColor:function(e){return v({background_color:e&&e.hex})}}))),React.createElement(L,null,React.createElement("h3",null,N("Button","presto-player"))),React.createElement(L,{className:"presto-player__control--button-type"},React.createElement(V,{label:N("Button Type","presto-player"),value:null==l?void 0:l.button_type,options:[{value:"custom",label:N("Custom","presto-player")},{value:"youtube",label:N("YouTube Subscribe","presto-player")},{value:"none",label:N("None","presto-player")}],onChange:function(e){return v({button_type:e})}})),"youtube"===(null==l?void 0:l.button_type)&&(null==y?void 0:y.channel_id)&&React.createElement(D,{label:N("Show Count","presto-player"),help:N("Show your follower count.","presto-player"),onChange:function(e){v({button_count:e})},checked:null==l?void 0:l.button_count}),function(){if("youtube"===(null==l?void 0:l.button_type))return d?React.createElement(C,{onClose:function(){return b(!1)},value:a,setValue:o}):React.createElement("div",null,React.createElement(A,{isSecondary:!0,onClick:function(e){e.preventDefault(),b(!0)}},null!=y&&y.channel_id?N("Update Youtube Channel Id","presto-player"):N("Add Youtube Channel Id","presto-player")),React.createElement("br",null),React.createElement("br",null),React.createElement("br",null))}(),"custom"===(null==l?void 0:l.button_type)&&React.createElement("div",null,React.createElement(L,{className:"presto-player__control--button-text"},React.createElement(F,{label:N("Button Text","presto-player"),help:React.createElement("p",null,N("Submit button text","presto-player")),value:null==l?void 0:l.button_text,onChange:function(e){return v({button_text:e})}})),React.createElement(L,{className:"presto-player__control--button-text"},React.createElement(L.VisualLabel,null,React.createElement("p",null," ",N("Button Link","presto-player"))),React.createElement(s.a,{setSettings:function(e){v({button_link:e})},settings:(null==l?void 0:l.button_link)||{}})),React.createElement(L,{className:"presto-player__control--button-radius"},React.createElement(I,{label:N("Round Corners","presto-player"),help:N("Border radius of the button","presto-player"),value:(null==l?void 0:l.button_radius)||0,onChange:function(e){return v({button_radius:e})},min:0,max:25})),React.createElement(L,{className:"presto-player__control--button-color"},React.createElement(B,null,React.createElement(L.VisualLabel,null,N("Button Color","presto-player")),React.createElement(i.a,{color:(null==l?void 0:l.button_color)||(null==m?void 0:m.color),setColor:function(e){return v({button_color:e&&e.hex})}}))),React.createElement(L,{className:"presto-player__control--button-text-color"},React.createElement(B,null,React.createElement(L.VisualLabel,null,N("Button Text Color","presto-player")),React.createElement(i.a,{color:(null==l?void 0:l.button_text_color)||"#ffffff",setColor:function(e){return v({button_text_color:e&&e.hex})}}))))))}},,,function(e,t){e.exports=window.wp.editor},,,,,,,function(e,t,r){"use strict";(function(e){var n,a,o=r(6),l=r(8),c=r(5),i=r(1),s=r(52),p=r(0),u=r(35),d=r(51);function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){Object(c.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var y=wp.i18n.__,v=wp.components,f=v.Button,h=v.Flex,O=v.FlexItem,g=v.FlexBlock,j=v.Modal,w=wp.element,_=w.useState,E=w.useEffect,R=wp.data.useSelect;t.a=function(t){var r=t.closeModal,c=t.attributes,b=t.setAttributes,v=t.updateOverlayAttribute,w=_(!1),k=Object(i.a)(w,2),P=k[0],C=k[1],x=_(""),S=Object(i.a)(x,2),N=S[0],T=S[1],D=c.overlays,B=c.preset,A=c.src,L=c.poster,I=c.previewSrc,F=R((function(e){return e("presto-player/player").branding()})),V=R((function(e){return e("presto-player/player").getPreset(B)}));E((function(){D.length||U()}),[]);var U=function(){var e={startTime:"0:00",endTime:"0:05",text:y("Here's a link to click!","presto-player"),link:{},position:"top-right",color:"#fff",backgroundColor:"#000",opacity:75};D[D.length-1]&&(e=m({},D[D.length-1]));e.id=Object(s.a)(10),b({overlays:[].concat(Object(l.a)(D||[]),[e])})};return Object(p.b)(j,{title:y("Manage Video Overlays","presto-player"),onRequestClose:r,className:"presto-player__modal-presets",overlayClassName:"presto-player__modal-presets-overlay",shouldCloseOnClickOutside:!1},Object(p.b)("div",{className:"presto-player__preset-options","data-cy":"preset-modal"},Object(p.b)(h,{align:"stretch",className:"presto-player__style-preview-area"},Object(p.b)(O,{className:"presto-player__style-sidebar"},Object(p.b)("div",{css:{padding:"3px"}},(D||[]).sort((function(e,t){return parseInt(e.startTime.split(":")[0])-parseInt(t.startTime.split(":")[0])==0?parseInt(e.startTime.split(":")[1])-parseInt(t.startTime.split(":")[1]):parseInt(e.startTime.split(":")[0])-parseInt(t.startTime.split(":")[0])})).map((function(t,r){return Object(p.b)(d.a,{key:"".concat(r,"-").concat(t.startTime),overlayIndex:r,className:"presto-player__overlay",startTime:t.startTime,endTime:t.endTime,text:t.text,link:t.link,position:t.position,color:t.color,backgroundColor:t.backgroundColor,opacity:t.opacity,overlay:t,update:function(e){!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=D.indexOf(e),n=D.map((function(e,n){return n!==r?e:m(m({},e),t)}));b({overlays:n})}(t,e)},remove:function(){!function(e){var t=D.indexOf(e);b({overlays:D.filter((function(e,r){return r!==t}))})}(t)},updateCurrentTime:function(t){!function(t){T(""),e.nextTick((function(){T(t)}))}(t)}})})),Object(p.b)(f,{isPrimary:!0,onClick:U},y("Add An Overlay","presto-player")))),Object(p.b)(g,{className:"presto-player__style-preview-panel"},Object(p.b)(u.a,{preload:"auto",currentTime:N,src:I||A,isDisabled:!1,state:m(m({},V),{},{lazy_load_youtube:!1,invert_time:!1}),branding:F,poster:L,overlays:D}))),Object(p.b)("br",null),Object(p.b)("div",{css:Object(p.a)(n||(n=Object(o.a)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n "])))},Object(p.b)("div",{css:Object(p.a)(a||(a=Object(o.a)(["\n opacity: 0.5;\n font-size: 12px;\n "])))}),Object(p.b)("div",null,Object(p.b)(f,{isTertiary:!0,onClick:r,style:{margin:"0 6px"}},y("Cancel","presto-player")),Object(p.b)(f,{isPrimary:!0,isBusy:P,disabled:P,onClick:function(){C(!0),v(D),C(!1),r()},"data-cy":"submit-preset"},y("Save Overlays","presto-player"))))))}}).call(this,r(66))},function(e,t,r){"use strict";var n=r(1),a=r(0),o=r(9),l=r(25),c=r(36),i=r(12),s=wp.i18n.__,p=wp.components,u=p.Flex,d=p.FlexItem,b=p.TextControl,m=p.Button,y=p.BaseControl,v=p.RadioControl,f=p.RangeControl,h=(p.withFocusReturn,wp.element),O=h.useRef,g=h.useEffect,j=wp.element.useState;t.a=function(e){var t=e.overlayIndex,r=e.update,p=e.remove,h=e.className,w=e.startTime,_=e.endTime,E=e.text,R=e.link,k=e.position,P=e.color,C=e.backgroundColor,x=e.opacity,S=e.updateCurrentTime,N=j(w),T=Object(n.a)(N,2),D=T[0],B=T[1],A=j(_),L=Object(n.a)(A,2),I=L[0],F=L[1],V=j(k),U=Object(n.a)(V,2),M=U[0],z=U[1],W=O();g((function(){if(Object(o.e)(w)>=Object(o.e)(_)){var e=Object(o.b)(w),t=Object(o.e)(e)+1;e=Object(o.b)(Object(o.c)(t)),r({endTime:e}),F(e)}}),[w,_]);var H=function(){var e=Object(o.b)(D);r({startTime:e}),B(e),S(e)};return Object(a.b)("div",null,Object(a.b)(u,{align:"center",className:h},Object(a.b)(d,null,Object(a.b)(b,{ref:W,id:"start-time-".concat(t),label:s("Start Time","presto-player"),className:"presto-player__overlay--start-time",value:D,onChange:function(e){return B(e)},onBlur:H,onFocus:H,autoComplete:"off",placeholder:"0:00"})),Object(a.b)(d,null,Object(a.b)(b,{label:s("End Time","presto-player"),className:"presto-player__overlay--end-time",value:I,onChange:F,onBlur:function(){var e=Object(o.b)(I);r({endTime:e}),F(e)},autoComplete:"off",placeholder:"0:00"}))),Object(a.b)(c.a,{text:E,update:r,onFocus:function(){S(Object(o.b)(D))}}),Object(a.b)(y,{style:{width:"100%"}},Object(a.b)(y.VisualLabel,null,Object(a.b)("p",null," ",s("Link","presto-player"))),Object(a.b)(l.a,{onFocus:function(){S(Object(o.b)(D))},setSettings:function(e){return r({link:e})},settings:R||{}})),Object(a.b)(y,{className:h},Object(a.b)(v,{label:s("Position","presto-player"),options:[{label:"Top Right",value:"top-right"},{label:"Top Left",value:"top-left"}],selected:M||"right",onFocus:function(){S(Object(o.b)(D))},onChange:function(e){r({position:e}),z(e),S(Object(o.b)(D))}})),Object(a.b)(y,{className:"presto-player__control--overlay-text-color"},Object(a.b)(u,null,Object(a.b)(y.VisualLabel,null,s("Text Color","presto-player")),Object(a.b)(i.a,{onFocus:function(){S(Object(o.b)(D))},color:P,setColor:function(e){r({color:e&&e.hex})}}))),Object(a.b)(y,{className:"presto-player__control--overlay-background-color"},Object(a.b)(u,null,Object(a.b)(y.VisualLabel,null,s("Background Color","presto-player")),Object(a.b)(i.a,{onFocus:function(){S(Object(o.b)(D))},color:C,setColor:function(e){r({backgroundColor:e&&e.hex})}}))),Object(a.b)(y,null,Object(a.b)(f,{label:s("Opacity","presto-player"),help:s("Opacity percentage of the overlay.","presto-player"),value:x,onChange:function(e){return r({opacity:e})},min:0,max:100})),p&&Object(a.b)(y,{className:h},Object(a.b)(u,{justify:"flex-end"},Object(a.b)(m,{isDestructive:!0,isSmall:!0,onClick:p},s("Remove Overlay","presto-player")))),Object(a.b)("hr",{css:{marginBottom:"20px"}}))}},,,,function(e,t,r){r(56),e.exports=r(71)},,,,function(e,t,r){var n={"./audio/index.js":70,"./bunny/index.js":69,"./hosted/index.js":73,"./reusable-display/index.js":74,"./reusable-edit/index.js":67,"./vimeo/index.js":75,"./youtube/index.js":76};function a(e){var t=o(e);return r(t)}function o(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}a.keys=function(){return Object.keys(n)},a.resolve=o,e.exports=a,a.id=59},,,,,,,,function(e,t,r){"use strict";r.r(t),r.d(t,"name",(function(){return v})),r.d(t,"options",(function(){return f}));var n=wp.i18n.__,a=wp.blockEditor,o=a.InnerBlocks,l=a.useBlockProps,c=wp.data,i=c.useSelect,s=c.dispatch,p=wp.components,u=p.Button,d=p.Placeholder,b=wp.plugins,m=(b.getPlugins,b.unregisterPlugin),y=wp.element.useEffect,v="presto-player/reusable-edit",f={title:"Reusable Block Container",category:"presto",supports:{inserter:!1,reusable:!1,html:!1},icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("circle",{cx:"12",cy:"12",r:"10"}),React.createElement("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),React.createElement("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})),edit:function(e){var t=l(),r=e.clientId,a=e.isSelected,c=i((function(e){return e("core/block-editor").getBlock(r).innerBlocks}));y((function(){a&&wp.data.dispatch("core/edit-post").openGeneralSidebar("edit-post/block")}),[a]),s("core/block-editor").setTemplateValidity(!0),y((function(){m("presto-player")}),[]);var p,b=function(e){var t=wp.blocks.createBlock("presto-player/".concat(e));return s("core/block-editor").insertBlock(t,0,r)};return null!=c&&c.length?React.createElement("div",null,React.createElement("div",t,React.createElement(o,{templateLock:!1,renderAppender:function(){return 0===c.length&&React.createElement(o.ButtonBlockAppender,null)}}))):React.createElement("div",null,React.createElement("div",t,React.createElement(d,{icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("polygon",{points:"23 7 16 12 23 17 23 7"}),React.createElement("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2",ry:"2"})),instructions:n("Choose a video type to get started.","presto-player"),label:n("Choose a Video Type","presto-player")},React.createElement(u,{isPrimary:!0,onClick:function(){b("self-hosted")}},n("Video","presto-player")),React.createElement(u,{isPrimary:!0,onClick:function(){b("youtube")}},n("Youtube","presto-player")),React.createElement(u,{isPrimary:!0,onClick:function(){b("vimeo")}},n("Vimeo","presto-player")),null!==(p=prestoPlayer)&&void 0!==p&&p.isPremium?React.createElement(u,{isPrimary:!0,onClick:function(){b("bunny")}},n("Bunny.net","presto-player")):"",React.createElement(u,{isPrimary:!0,onClick:function(){b("audio")}},n("Audio","presto-player"))),React.createElement(o,{templateLock:!1,renderAppender:function(){return!1}})))},save:function(){var e=l.save();return React.createElement("div",e,React.createElement(o.Content,null))}}},function(e,t,r){var n={"./reusable-videos/index.js":72};function a(e){var t=o(e);return r(t)}function o(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}a.keys=function(){return Object.keys(n)},a.resolve=o,e.exports=a,a.id=68},function(e,t,r){"use strict";r.r(t),r.d(t,"name",(function(){return xa})),r.d(t,"options",(function(){return Sa}));var n={};r.r(n),r.d(n,"videos",(function(){return Q})),r.d(n,"collections",(function(){return X})),r.d(n,"uploads",(function(){return $})),r.d(n,"isPrivate",(function(){return J})),r.d(n,"isLoading",(function(){return ee})),r.d(n,"errors",(function(){return te})),r.d(n,"videosFetched",(function(){return re})),r.d(n,"currentCollection",(function(){return ne})),r.d(n,"ui",(function(){return ae})),r.d(n,"requestType",(function(){return oe}));var a={};r.r(a),r.d(a,"setVideos",(function(){return le})),r.d(a,"addVideos",(function(){return ce})),r.d(a,"removeVideo",(function(){return ie})),r.d(a,"setCollections",(function(){return se})),r.d(a,"addCollection",(function(){return pe})),r.d(a,"setIsPrivate",(function(){return ue})),r.d(a,"setSearch",(function(){return de})),r.d(a,"setCollectionRequest",(function(){return be})),r.d(a,"setUploads",(function(){return me})),r.d(a,"addUploads",(function(){return ye})),r.d(a,"removeUpload",(function(){return ve})),r.d(a,"setVideosFetched",(function(){return fe})),r.d(a,"setLoading",(function(){return he})),r.d(a,"setUI",(function(){return Oe})),r.d(a,"addError",(function(){return ge})),r.d(a,"removeError",(function(){return je}));var o,l,c=r(5),i=r(7),s=r(1),p=r(2),u=r.n(p),d=function(){var e=Object(i.a)(u.a.mark((function e(t){var r;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,wp.apiFetch({path:"presto-player/v1/bunny/sign",method:"POST",data:{url:t,id:0}});case 4:return r=e.sent,e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),b=r(20),m=r(21),y=r(34),v=function(e){var t=e.file,r=e.path,n=e.onProgress,a=e.onComplete,o=e.onError,l=0,c=!1,s=Math.min(prestoPlayerAdmin.wp_max_upload_size-1e6,159e5),p=Math.max(s,19e5);p=Math.min(p,104857600);var d=function(){var e=Object(i.a)(u.a.mark((function e(i){var s,b,m,y,v;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=i+p+1,b=t.slice(i,s),m=Math.ceil(t.size/(p+1)),l++,n(l/m*100),(y=new FormData).append("file",b),y.append("name",t.name),y.append("chunk",l),y.append("chunks",m),e.prev=10,e.next=13,wp.apiFetch({path:r,method:"POST",body:y});case 13:if(v=e.sent,!c){e.next=17;break}return console.log("cancelled"),e.abrupt("return");case 17:s<t.size?(n(void 0),d(s)):a(v),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(10),o(e.t0),console.error(e.t0);case 24:case"end":return e.stop()}}),e,null,[[10,20]])})));return function(t){return e.apply(this,arguments)}}();return l=0,new FileReader,d(0),{cancel:function(){c=!0}}},f=r(6),h=function(e){var t=e.item,r=e.onClick,n=e.className;var a,o=function(){return!(null==t||!t.encodeProgress)&&100!==t.encodeProgress};return React.createElement("div",{className:"presto-player__media-list-item ".concat(n),onClick:r},React.createElement("div",{className:"presto-player__media-list-item-icon"},React.createElement("svg",Object(c.a)({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"},"strokeLinecap","round"),React.createElement("polygon",{points:"23 7 16 12 23 17 23 7"}),React.createElement("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2",ry:"2"}))),React.createElement("div",{className:"presto-player__media-list-item-title"},null==t?void 0:t.title),o()&&React.createElement("div",{className:"presto-player__media-list-item-size"},"Encoding..."),!o()&&React.createElement("div",{className:"presto-player__media-list-item-size"},function(e){if(0==e)return"0 Byte";var t=parseInt(Math.floor(Math.log(e)/Math.log(1024)));return Math.round(e/Math.pow(1024,t),2)+" "+["Bytes","KB","MB","GB","TB"][t]}(null==t?void 0:t.size)),!o()&&React.createElement("div",{className:"presto-player__media-list-item-modified"},(a=t.updated_at,new Date(a).toLocaleString())))},O=function(e){var t,r=e.item,n=e.onClick,a=e.className;return React.createElement("div",{className:"presto-player__media-list-item ".concat(a),onClick:n},React.createElement("div",{className:"presto-player__media-list-item-icon"},React.createElement("svg",Object(c.a)({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"},"strokeLinecap","round"),React.createElement("polygon",{points:"23 7 16 12 23 17 23 7"}),React.createElement("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2",ry:"2"}))),React.createElement("div",{className:"presto-player__media-list-item-title"},null==r?void 0:r.title),React.createElement("div",{className:"presto-player__media-list-item-size"},function(e){if(0==e)return"0 Byte";var t=parseInt(Math.floor(Math.log(e)/Math.log(1024)));return Math.round(e/Math.pow(1024,t),2)+" "+["Bytes","KB","MB","GB","TB"][t]}(null==r?void 0:r.size)),React.createElement("div",{className:"presto-player__media-list-item-modified"},(t=r.updated_at,new Date(t).toLocaleString())))},g=r(0),j=wp.i18n.__,w=wp.components,_=w.Modal,E=w.Spinner,R=w.Button,k=w.BaseControl,P=w.Flex,C=w.FlexBlock,x=w.Notice,S=w.Card,N=w.CardBody,T=w.Disabled,D=w.DropZone,B=w.FormFileUpload,A=w.DropZoneProvider,L=wp.element,I=L.useEffect,F=L.useState,V=L.useRef,U=function(e){var t=e.onClose,r=e.title,n=e.header,a=e.onLoad,c=e.items,i=e.folders,p=e.fetching,u=e.progressMessage,d=e.onSelect,b=e.error,m=e.onDelete,y=e.onUpload,v=e.progress,w=F({}),L=Object(s.a)(w,2),U=L[0],M=L[1],z=F(!1),W=Object(s.a)(z,2),H=W[0],Y=W[1],G=V();I((function(){a&&a()}),[]);var q,Z,K,Q,X=function(){m(U),Y(!1)},$=function(){return Object.keys(U||{}).length};return Object(g.b)(_,{title:n||j("Add Media","presto-player"),onRequestClose:t,className:"presto-player__media-modal presto-player__full-modal",overlayClassName:"presto-player__modal-overlay"},Object(g.b)("div",{className:"presto-player__media-modal-layout","data-cy":"media-modal"},Object(g.b)("div",{className:"presto-player__media-modal-header"},Object(g.b)("div",{className:"presto-player__media-modal-upload",css:Object(g.a)(o||(o=Object(f.a)(["\n display: flex;\n align-items: center;\n "])))},Object(g.b)(B,{isPrimary:!0,accept:"video/mp4,video/x-m4v,video/*",onChange:function(e){e.target.files&&(y(e.target.files),jQuery(e.target).val(null))}},j("Upload New Video","presto-player")),Object(g.b)("div",{css:Object(g.a)(l||(l=Object(f.a)(["\n margin-left: 10px;\n "])))},j("Or drag a file here to upload.","presto-player"))),b&&Object(g.b)(x,{status:"error",isDismissible:!1},b)),Object(g.b)("div",{className:"presto-player__media-modal-content"},Object(g.b)(A,null,p?Object(g.b)(P,{className:"presto-player__media-loading"},Object(g.b)(C,{style:{textAlign:"center"}},v?Object(g.b)(React.Fragment,null,Object(g.b)("div",null,Object(g.b)("strong",null,u||j("Uploading","presto-player"))),Object(g.b)("div",null,j("Please don't navigate away from this page.","presto-player")),Object(g.b)("progress",{className:"presto-progress",max:"100",value:v,style:{width:"100px"}})):Object(g.b)(E,null))):null!=c&&c.length?Object(g.b)("div",{className:"presto-player__media-list"},Object(g.b)("h2",null,r),i&&Object(g.b)("div",{className:"presto-player__media-list-folders"},i.map((function(e){return Object(g.b)(O,{key:e.id,item:e})}))),Object(g.b)("div",{className:"presto-player__media-list-items"},c.map((function(e){return Object(g.b)(h,{item:e,key:e.id,onClick:function(){M(U===e?{}:e)},className:U===e?"is-selected":""})})))):Object(g.b)(P,{"align-items":"center",className:"presto-player__media-not-found"},Object(g.b)("div",null,Object(g.b)("h2",null,"Drop video files here to upload"),Object(g.b)("p",null,"or browse for a video"),Object(g.b)(B,{isSecondary:!0,accept:"video/mp4,video/x-m4v,video/*",onChange:function(e){e.target.files&&(y(e.target.files),jQuery(e.target).val(null))}},j("Upload New Video","presto-player")))),Object(g.b)(D,{label:"Drop files",onFilesDrop:y}))),Object(g.b)("div",{className:"presto-player__media-modal-sidebar"},$()?Object(g.b)("div",{className:"presto-player__media-modal-sidebar-content"},Object(g.b)(k,null,Object(g.b)(T,{key:U.id},null!=U&&U.thumbnail?Object(g.b)("img",{src:null==U?void 0:U.thumbnail,style:{maxWidth:"100%"}}):Object(g.b)("video",{preload:"metadata"},Object(g.b)("source",{src:U.previewUrl})))),Object(g.b)(k,null,Object(g.b)(k.VisualLabel,null,j("Name","presto-player")),Object(g.b)("h3",{style:{marginTop:"5px"}},U.title)),!(null==U||!U.visibility)&&Object(g.b)(k,null,Object(g.b)(k.VisualLabel,null,j("Visibility","presto-player")),Object(g.b)("h3",{style:{marginTop:"5px"}},U.visibility)),Object(g.b)(k,null,Object(g.b)(k.VisualLabel,null,j("Size","presto-player")),Object(g.b)("h3",{style:{marginTop:"5px"}},function(e){if(0==e)return"0 Byte";var t=parseInt(Math.floor(Math.log(e)/Math.log(1024)));return Math.round(e/Math.pow(1024,t),2)+" "+["Bytes","KB","MB","GB","TB"][t]}((null==U?void 0:U.size)||0))),Object(g.b)(k,null,Object(g.b)(k.VisualLabel,null,j("Created","presto-player")),Object(g.b)("h3",{style:{marginTop:"5px"}},(q=null==U?void 0:U.created_at,Z=(q=new Date(q)).getHours(),K=q.getMinutes(),Q=Z>=12?"pm":"am",Z=(Z%=12)||12,K=K<10?"0"+K:K,q.getDate()+"-"+(q.getMonth()+1)+"-"+q.getFullYear()+" at "+Z+":"+K+Q))),Object(g.b)(k,null,H?Object(g.b)(S,null,Object(g.b)(N,null,Object(g.b)("p",null,Object(g.b)("strong",null,"Are you sure?")),Object(g.b)("p",null,"Are you sure you want to delete this video?"),Object(g.b)(R,{isDestructive:!0,onClick:X},"Yes"),Object(g.b)(R,{onClick:function(){return Y(!1)}},"Cancel"))):Object(g.b)(R,{isDestructive:!0,onClick:function(){Y(!H)}},j("Delete video","presto-player")))):Object(g.b)(React.Fragment,null)),Object(g.b)("div",{className:"presto-player__media-modal-footer"},Object(g.b)(R,{isPrimary:!0,disabled:!$(),onClick:function(){U&&(d(U),t())},ref:G},j("Choose","presto-player")))))},M=wp.i18n.__,z=wp.element,W=z.useState,H=z.useEffect,Y=function(e){var t=e.closePopup,r=e.noticeOperations,n=e.onSelect,a=e.isPrivate,o=W([]),l=Object(s.a)(o,2),c=l[0],p=l[1],d=W(!1),b=Object(s.a)(d,2),m=b[0],y=b[1],f=W(0),h=Object(s.a)(f,2),O=h[0],g=h[1],j=W(""),w=Object(s.a)(j,2),_=w[0],E=w[1],R=W(""),k=Object(s.a)(R,2),P=k[0],C=k[1],x=a?"private-videos":"public-videos";H((function(){g(0),C("")}),[]);var S=function(){var e=Object(i.a)(u.a.mark((function e(t){return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:C(""),y(!0),E(M("Uploading","presto-player")),v({file:t[0],path:"presto-player/v1/bunny/upload",onProgress:function(e){g(e-10)},onComplete:N,onError:function(e){C(e.message),g(0),y(!1)}});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),N=function(){var e=Object(i.a)(u.a.mark((function e(t){var r,n,a;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.path,n=t.name,E(M("Storing","presto-player")),e.prev=2,e.next=5,wp.apiFetch({path:"presto-player/v1/bunny/".concat(x),method:"POST",data:{path:r,name:n}});case 5:a=e.sent,p(a),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(2),C(e.t0.message),console.error(e.t0);case 13:return e.prev=13,g(0),y(!1),e.finish(13);case 17:case"end":return e.stop()}}),e,null,[[2,9,13,17]])})));return function(t){return e.apply(this,arguments)}}(),T=function(){var e=Object(i.a)(u.a.mark((function e(t){return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,p((c||[]).filter((function(e){return e!==t}))),e.next=4,wp.apiFetch({path:"presto-player/v1/bunny/".concat(x),method:"DELETE",data:{name:null==t?void 0:t.title}});case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),C(e.t0.message);case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),D=function(){var e=Object(i.a)(u.a.mark((function e(){var t;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,y(!0),e.next=4,wp.apiFetch({path:"presto-player/v1/bunny/".concat(x)});case 4:t=e.sent,p(t),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),C(e.t0.message);case 11:return e.prev=11,y(!1),e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[0,8,11,14]])})));return function(){return e.apply(this,arguments)}}();return React.createElement(U,{onClose:t,progressMessage:_,fetching:m,error:P,onUpload:S,onLoad:D,items:c,progress:O,onDelete:T,onSelect:n,onError:function(e){r.removeAllNotices(),r.createErrorNotice(e)},header:M(a?"Bunny.net Private Video Storage":"Bunny.net Public Video Storage","presto-player"),title:M(a?"Private Video Library":"Public Video Library","presto-player")})},G=r(8);function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q(Object(r),!0).forEach((function(t){Object(c.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var K=(0,wp.data.combineReducers)({videosReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_VIDEOS":return t.value;case"ADD_VIDEOS":return[].concat(Object(G.a)(e),Object(G.a)(t.value));case"ADD_VIDEO":return[].concat(Object(G.a)(e),[t.value]);case"UPDATE_VIDEO":return e.map((function(e,r){var n;return e.id!==(null===(n=t.value)||void 0===n?void 0:n.id)?e:Z(Z({},e),t.value)}));case"REMOVE_VIDEO":return e.filter((function(e){return e.guid!==t.value.guid}))}return e},collectionsReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_COLLECTIONS":return t.value;case"ADD_COLLECTION":return[].concat(Object(G.a)(e),[t.value]);case"UPDATE_COLLECTION":return e.map((function(e,r){var n;return e.id!==(null===(n=t.value)||void 0===n?void 0:n.id)?e:Z(Z({},e),t.value)}));case"REMOVE_COLLECTION":return e.filter((function(e){return e!==t.value}))}return e},uploadsReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_UPLOADS":return t.value;case"ADD_UPLOADS":return[].concat(Object(G.a)(e),Object(G.a)(t.value));case"ADD_UPLOAD":return[].concat(Object(G.a)(e),[t.value]);case"UPDATE_UPLOAD":return e.map((function(e,r){var n;return e.id!==(null===(n=t.value)||void 0===n?void 0:n.id)?e:Z(Z({},e),t.value)}));case"REMOVE_UPLOAD":return e.filter((function(e){return e!==t.value}))}return e},requestReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{private:!1,collection:"",search:""},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_PRIVATE_REQUEST":return Z(Z({},e),{},{private:t.value});case"SET_SEARCH_REQUEST":return Z(Z({},e),{},{search:t.value});case"SET_COLLECTION_REQUEST":return Z(Z({},e),{},{collection:t.value})}return e},UIReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{loading:!1,videosFetched:!1,createCollection:!1,selectedId:null},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_LOADING":return Z(Z({},e),{},{loading:t.value});case"SET_VIDEOS_FETCHED":return Z(Z({},e),{},{videosFetched:t.value});case"SET_UI_ITEM":return Z(Z({},e),{},Object(c.a)({},t.item,t.value))}return e},errorReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_ERROR":return[].concat(Object(G.a)(e),[t.value]);case"REMOVE_ERROR":return e.filter((function(e){return e!==t.value}))}return e}});function Q(e){return(null==e?void 0:e.videosReducer)||[]}function X(e){return(null==e?void 0:e.collectionsReducer)||[]}function $(e){return(null==e?void 0:e.uploadsReducer)||[]}function J(e){var t;return!(null==e||null===(t=e.requestReducer)||void 0===t||!t.private)}function ee(e){var t;return(null==e||null===(t=e.UIReducer)||void 0===t?void 0:t.loading)||!1}function te(e){return(null==e?void 0:e.errorReducer)||[]}function re(e){var t;return(null==e||null===(t=e.UIReducer)||void 0===t?void 0:t.videosFetched)||!1}function ne(e){var t;return null==e||null===(t=e.requestReducer)||void 0===t?void 0:t.collection}function ae(e,t){var r;return null==e||null===(r=e.UIReducer)||void 0===r?void 0:r[t]}function oe(e){var t;return null!=e&&null!==(t=e.requestReducer)&&void 0!==t&&t.private?"private":"public"}function le(e){return{type:"SET_VIDEOS",value:e}}function ce(e){return{type:"ADD_VIDEOS",value:e}}function ie(e){return{type:"REMOVE_VIDEO",value:e}}function se(e){return{type:"SET_COLLECTIONS",value:e}}function pe(e){return{type:"ADD_COLLECTION",value:e}}function ue(e){return{type:"SET_PRIVATE_REQUEST",value:e}}function de(e){return{type:"SET_SEARCH",value:e}}function be(e){return{type:"SET_COLLECTION_REQUEST",value:e}}function me(e){return{type:"SET_UPLOADS",value:e}}function ye(e){return{type:"ADD_UPLOADS",value:e}}function ve(e){return{type:"REMOVE_UPLOAD",value:e}}function fe(e){return{type:"SET_VIDEOS_FETCHED",value:e}}function he(e){return{type:"SET_LOADING",value:e}}function Oe(e,t){return{type:"SET_UI_ITEM",item:e,value:t}}function ge(e){return{type:"ADD_ERROR",value:e}}function je(e){return{type:"REMOVE_ERROR",value:e}}(0,wp.data.registerStore)("presto-player/bunny-popup",{reducer:K,selectors:n,actions:a});var we,_e,Ee,Re,ke,Pe,Ce,xe,Se,Ne,Te,De,Be,Ae,Le,Ie,Fe,Ve,Ue,Me,ze,We=function(e){return 3==(null==e?void 0:e.status)&&(null==e?void 0:e.availableResolutions.length)},He=function(e){return We(e)||4===(null==e?void 0:e.status)},Ye=function(e){return 0==(null==e?void 0:e.status)?"Processing":1==(null==e?void 0:e.status)?"Uploaded":2==(null==e?void 0:e.status)?"Processing":We(e)?"Playable":3==(null==e?void 0:e.status)?"Encoding":4==(null==e?void 0:e.status)?"Live":5==(null==e?void 0:e.status)?"Error":6==(null==e?void 0:e.status)?"Upload Failed":void 0},Ge=function(e){return null==e||null==e?"":new Date(1e3*e).toISOString().substr(11,8)},qe=function(e){if(null==e||0==e)return"Unknown";if(0==e)return"0 b";var t=parseInt(Math.floor(Math.log(e)/Math.log(1024)).toString());return(e/Math.pow(1024,t)).toFixed(2)+" "+["b","KB","MB","GB","TB"][t]},Ze=wp.i18n.__,Ke=wp.components,Qe=Ke.Button,Xe=Ke.BaseControl,$e=Ke.Disabled,Je=Ke.Card,et=Ke.CardBody,tt=wp.element,rt=tt.useState,nt=(tt.useContext,tt.useEffect),at=wp.data,ot=at.dispatch,lt=at.useSelect,ct=function(){var e=rt(!1),t=Object(s.a)(e,2),r=t[0],n=t[1],a=rt(!1),o=Object(s.a)(a,2),l=o[0],c=o[1],p=rt(null),d=Object(s.a)(p,2),b=d[0],m=d[1],y=lt((function(e){return e("presto-player/bunny-popup").isPrivate()})),v=lt((function(e){return e("presto-player/bunny-popup").ui("selectedId")})),h=lt((function(e){return e("presto-player/bunny-popup").videos()}));nt((function(){m(v?h.find((function(e){return e.guid===v})):null)}),[h,v]);var O=function(){var e=Object(i.a)(u.a.mark((function e(){return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,wp.apiFetch({path:"presto-player/v1/bunny/stream/videos/".concat(b.id),method:"DELETE",data:{type:y?"private":"public"}});case 2:ot("presto-player/bunny-popup").removeVideo(b),ot("presto-player/bunny-popup").setUI("selectedId",null),c(!1),n(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),j=Object(g.a)(we||(we=Object(f.a)(["\n margin-top: 5px;\n "])));if(!b)return"";var w,_,E,R,k=function(e){return y?null==e?void 0:e.webPURLSigned:null==e?void 0:e.webPURL};return b&&Object(g.b)("div",{className:"presto-player__media-modal-sidebar-content"},Object(g.b)(Xe,{css:Object(g.a)(_e||(_e=Object(f.a)(["\n position: relative;\n "])))},Object(g.b)($e,{key:b.id},He(b)&&k(b)&&Object(g.b)("img",{src:k(b),css:{maxWidth:"100%"}})),Object(g.b)(Qe,{isSmall:!0,isPrimary:!0,isBusy:!He(b),css:Object(g.a)(Ee||(Ee=Object(f.a)(["\n ","\n top: 8px;\n right: 8px;\n font-size: 11px;\n color: #ffffff;\n padding: 2px 10px;\n border-radius: 9999px;\n "])),He(b)?"position: absolute;":"")},Ye(b))),Object(g.b)(Xe,null,Object(g.b)(Xe.VisualLabel,null,Ze("Name","presto-player")),Object(g.b)("h3",{css:j},b.title)),!(null==b||!b.visibility)&&Object(g.b)(Xe,null,Object(g.b)(Xe.VisualLabel,null,Ze("Visibility","presto-player")),Object(g.b)("h3",{css:j},b.visibility)),Object(g.b)(Xe,null,Object(g.b)(Xe.VisualLabel,null,Ze("Size","presto-player")),Object(g.b)("h3",{css:j},qe((null==b?void 0:b.size)||0))),Object(g.b)(Xe,null,Object(g.b)(Xe.VisualLabel,null,Ze("Length","presto-player")),Object(g.b)("h3",{css:j},Ge(null==b?void 0:b.length))),Object(g.b)(Xe,null,Object(g.b)(Xe.VisualLabel,null,Ze("Created","presto-player")),Object(g.b)("h3",{css:j},(w=null==b?void 0:b.created_at,_=(w=new Date(w)).getHours(),E=w.getMinutes(),R=_>=12?"pm":"am",_=(_%=12)||12,E=E<10?"0"+E:E,w.getDate()+"-"+(w.getMonth()+1)+"-"+w.getFullYear()+" at "+_+":"+E+R))),Object(g.b)(Xe,null,r?Object(g.b)(Je,null,Object(g.b)(et,null,Object(g.b)("p",null,Object(g.b)("strong",null,Ze("Are you sure?","presto-player"))),Object(g.b)("p",null,Ze("Are you sure you want to delete this video?","presto-player")),Object(g.b)(Qe,{isDestructive:!0,disabled:l,isBusy:l,onClick:function(e){e.preventDefault(),O(),c(!0)}},Ze("Yes","presto-player")),Object(g.b)(Qe,{onClick:function(){return n(!1)}},Ze("Cancel","presto-player")))):Object(g.b)(Qe,{isDestructive:!0,onClick:function(){n(!r)}},Ze("Delete video","presto-player"))))},it=function(e){var t=e.className,r=e.progress;return Object(g.b)("div",{className:t},Object(g.b)("div",{css:Object(g.a)(Re||(Re=Object(f.a)(["\n height: 100%;\n background-color: var(--wp-admin-theme-color, #007cba);\n "]))),style:{width:"".concat(r,"%")}}))},st=function(e){var t=e.progress;return Object(g.b)("div",{css:Object(g.a)(ke||(ke=Object(f.a)(["\n max-width: 100%;\n object-fit: cover;\n width: 100%;\n height: 140px;\n background-color: #222;\n color: white;\n text-decoration: none;\n text-align: center;\n box-sizing: border-box;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n "])))},Object(g.b)(it,{progress:t,css:Object(g.a)(Pe||(Pe=Object(f.a)(["\n width: 100%;\n border-radius: 0px;\n margin: 0 15px;\n background-color: #e3e3e3;\n height: 3px;\n "])))}))},pt=function(e){var t=e.thumbnail,r=e.title,n=e.footer,a=e.badge,o=e.before,l=e.after;return Object(g.b)("div",Object.assign({className:"presto-player__video-thumb",css:Object(g.a)(Ce||(Ce=Object(f.a)(["\n cursor: pointer;\n user-select: none;\n display: inline-block;\n position: relative;\n margin-right: 20px;\n font-weight: bold;\n margin-bottom: 20px;\n width: 220px;\n flex: 0 0 220px;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n overflow: hidden;\n "])))},e),!!o&&o,!!t&&t,Object(g.b)("div",{css:Object(g.a)(xe||(xe=Object(f.a)(["\n margin: 14px;\n "])))},!!a&&Object(g.b)("div",{css:Object(g.a)(Se||(Se=Object(f.a)(["\n position: absolute;\n top: 8px;\n right: 8px;\n "])))},a),!!r&&Object(g.b)("span",{css:Object(g.a)(Ne||(Ne=Object(f.a)(["\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n width: 100%;\n max-width: 100%;\n display: inline-block;\n margin-bottom: 7px;\n font-size: 13px;\n "])))},r),!!n&&Object(g.b)("div",{css:Object(g.a)(Te||(Te=Object(f.a)(["\n font-size: 12px;\n opacity: 0.75;\n margin-bottom: 7px;\n "])))},n)),!!l&&l)},ut=wp.components,dt=ut.Icon,bt=ut.Button,mt=wp.element,yt=mt.useEffect,vt=mt.useState,ft=wp.data,ht=ft.useSelect,Ot=ft.dispatch,gt=function(e){var t=e.video,r=vt(),n=Object(s.a)(r,2),a=n[0],o=n[1],l=ht((function(e){return e("presto-player/bunny-popup").isPrivate()})),c=ht((function(e){return e("presto-player/bunny-popup").ui("selectedId")}));yt((function(){o(c?c===t.guid:null)}),[c]);return Object(g.b)(pt,{onClick:function(){Ot("presto-player/bunny-popup").setUI("selectedId",null==t?void 0:t.guid)},css:Object(g.a)(Ue||(Ue=Object(f.a)(["\n ","\n border: 1px solid\n ",";\n "])),a&&"box-shadow: 0 0 0 0px #fff, 0 0 0 3px var(--wp-admin-theme-color, #007cba);",a?"var(--wp-admin-theme-color, #007cba)":"#e0e0e0"),thumbnail:function(){if(t.status<3)return Object(g.b)(st,{progress:t.encodeProgress});var e=l?null==t?void 0:t.thumbnailURLSigned:null==t?void 0:t.thumbnailURL;return e?Object(g.b)("img",{css:Object(g.a)(Be||(Be=Object(f.a)(["\n max-width: 100%;\n object-fit: cover;\n width: 100%;\n height: 140px;\n display: block;\n "]))),src:e}):void 0}(),badge:Object(g.b)(bt,{isSmall:!0,isPrimary:!0,isBusy:!He(t),css:Object(g.a)(De||(De=Object(f.a)(["\n font-size: 11px;\n color: #ffffff;\n padding: 2px 10px;\n border-radius: 9999px;\n "])))},Ye(t)),title:t.title,footer:Object(g.b)("div",{css:Object(g.a)(Ae||(Ae=Object(f.a)(["\n display: flex;\n align-items: center;\n "])))},Object(g.b)("span",{css:Object(g.a)(Le||(Le=Object(f.a)(["\n margin-right: 10px;\n display: flex;\n align-items: center;\n "])))},Object(g.b)(dt,{css:Object(g.a)(Ie||(Ie=Object(f.a)(["\n width: 14px;\n height: 14px;\n font-size: 14px;\n margin-right: 5px;\n opacity: 0.5;\n "]))),icon:"clock",size:14}),Object(g.b)("span",null,Ge(t.length))),Object(g.b)("span",{css:Object(g.a)(Fe||(Fe=Object(f.a)(["\n display: flex;\n align-items: center;\n "])))},Object(g.b)(dt,{css:Object(g.a)(Ve||(Ve=Object(f.a)(["\n opacity: 0.5;\n width: 14px;\n height: 14px;\n font-size: 14px;\n margin-right: 5px;\n "]))),icon:"database",size:14}),Object(g.b)("span",null,qe(t.storageSize)))),after:3===t.status?Object(g.b)(it,{css:Object(g.a)(Me||(Me=Object(f.a)(["\n width: 100%;\n border-radius: 0px;\n margin: 0;\n background-color: #e3e3e3;\n height: 3px;\n "]))),progress:t.encodeProgress}):""})},jt=wp.components,wt=jt.Flex,_t=jt.FlexBlock,Et=jt.Spinner,Rt=function(e){var t=e.className;return Object(g.b)(wt,{className:t},Object(g.b)(_t,{css:{textAlign:"center"}},Object(g.b)(Et,null)))};function kt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kt(Object(r),!0).forEach((function(t){Object(c.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ct,xt,St,Nt,Tt,Dt,Bt,At,Lt,It,Ft=wp.i18n.__,Vt=wp.element,Ut=Vt.useState,Mt=Vt.useEffect,zt=Vt.Fragment,Wt=wp.components,Ht=Wt.Flex,Yt=Wt.FormFileUpload,Gt=Wt.Notice,qt=wp.data,Zt=qt.dispatch,Kt=qt.useSelect,Qt=function(){var e=Ut(!1),t=Object(s.a)(e,2),r=t[0],n=t[1],a=Ut(""),o=Object(s.a)(a,2),l=o[0],c=o[1],p=Kt((function(e){return e("presto-player/bunny-popup").videosFetched()})),d=Kt((function(e){return e("presto-player/bunny-popup").videos()})),b=Kt((function(e){return e("presto-player/bunny-popup").requestType()})),m=Kt((function(e){return e("presto-player/bunny-popup").currentCollection()}));Mt((function(){p||y()}),[p]),Mt((function(){var e=setInterval((function(){y({sync:!0})}),3e3);return function(){return clearInterval(e)}}),[p]);var y=function(){var e=Object(i.a)(u.a.mark((function e(){var t,r,n,a,o=arguments;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{sync:!1},r=t.sync,e.prev=1,e.next=4,wp.apiFetch({path:wp.url.addQueryArgs("presto-player/v1/bunny/stream/videos",Pt(Pt({type:b},null!=m&&m.guid?{collection:null==m?void 0:m.guid}:{}),{},{items_per_page:500}))});case 4:n=e.sent,Zt("presto-player/bunny-popup").setVideos(null==n?void 0:n.items),c(""),e.next=15;break;case 9:if(e.prev=9,e.t0=e.catch(1),401!==(null===e.t0||void 0===e.t0||null===(a=e.t0.data)||void 0===a?void 0:a.status)){e.next=14;break}return c(Ft("Please wait. Pullzone cache is clearing. This may take a minute or two...")),e.abrupt("return");case 14:r||Zt("presto-player/bunny-popup").addError(e.t0.message);case 15:return e.prev=15,Zt("presto-player/bunny-popup").setVideosFetched(!0),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[1,9,15,18]])})));return function(){return e.apply(this,arguments)}}();return l?Object(g.b)(Gt,{status:"warning",isDismissible:!1},Object(g.b)("div",{css:{display:"flex",alignItems:"center"}},Object(g.b)(Rt,{css:{flex:1}}),l)):p?Object(g.b)(zt,null,d&&d.length?Object(g.b)("div",null,!(null!=m&&m.guid)&&Object(g.b)("h2",null,Ft("Videos","presto-player")),d.map((function(e){if((null==e?void 0:e.collectionId)===((null==m?void 0:m.guid)||""))return Object(g.b)(gt,{key:e.id,video:e,onClick:function(){n(r.guid===e.guid?{}:e)},selected:r.guid===e.guid})}))):Object(g.b)(Ht,{align:"center",justify:"center",css:Object(g.a)(ze||(ze=Object(f.a)(["\n height: 100%;\n text-align: center;\n "])))},Object(g.b)("div",null,Object(g.b)("h2",null,Ft("Drop video files here to upload","presto-player")),Object(g.b)("p",null,Ft("or browse for a video","presto-player")),Object(g.b)(Yt,{isSecondary:!0,accept:"video/mp4,video/x-m4v,video/*",onChange:function(e){e.target.files&&(Zt("presto-player/bunny-popup").addUploads(e.target.files),jQuery(e.target).val(null))}},Ft("Upload New Video","presto-player"))))):Object(g.b)(Rt,{css:{flex:1}})},Xt=wp.components.Icon,$t=wp.data.dispatch,Jt=function(e){var t=e.collection;return Object(g.b)(pt,{onClick:function(e){e.preventDefault(),$t("presto-player/bunny-popup").setCollectionRequest(t),$t("presto-player/bunny-popup").setVideosFetched(!1)},title:Object(g.b)("div",null,Object(g.b)(Xt,{icon:"open-folder",css:Object(g.a)(Ct||(Ct=Object(f.a)(["\n color: var(--wp-admin-theme-color);\n margin-right: 10px;\n "])))}),t.name),footer:Object(g.b)("div",null,t.videoCount," Videos")})},er=wp.i18n.__,tr=wp.element.useEffect,rr=wp.data,nr=rr.useSelect,ar=rr.dispatch,or=function(){var e=nr((function(e){return e("presto-player/bunny-popup").collections()})),t=nr((function(e){return e("presto-player/bunny-popup").requestType()})),r=function(){var e=Object(i.a)(u.a.mark((function e(){var r,n;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,wp.apiFetch({path:wp.url.addQueryArgs("presto-player/v1/bunny/stream/collections",{type:t})});case 3:r=e.sent,ar("presto-player/bunny-popup").setCollections(null==r?void 0:r.items),e.next=12;break;case 7:if(e.prev=7,e.t0=e.catch(0),401!==(null===e.t0||void 0===e.t0||null===(n=e.t0.data)||void 0===n?void 0:n.status)){e.next=11;break}return e.abrupt("return");case 11:ar("presto-player/bunny-popup").addError(e.t0.message);case 12:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}();return tr((function(){r()}),[]),!!e.length&&Object(g.b)("div",null,Object(g.b)("h2",null,er("Collections","presto-player")),Object(g.b)("div",{css:Object(g.a)(xt||(xt=Object(f.a)(["\n display: flex;\n align-items: stretch;\n overflow: auto;\n "])))},e.map((function(e){return Object(g.b)(Jt,{collection:e,key:e.guid})}))))},lr=wp.i18n.__,cr=wp.components,ir=cr.Button,sr=cr.TextControl,pr=cr.Modal,ur=cr.BaseControl,dr=wp.element,br=dr.useState,mr=dr.Fragment,yr=wp.data,vr=yr.dispatch,fr=yr.useSelect,hr=function(){var e=br(""),t=Object(s.a)(e,2),r=t[0],n=t[1],a=br(!1),o=Object(s.a)(a,2),l=o[0],c=o[1],p=fr((function(e){return e("presto-player/bunny-popup").requestType()})),d=fr((function(e){return e("presto-player/bunny-popup").ui("createCollection")})),b=function(e){vr("presto-player/bunny-popup").setUI("createCollection",e)},m=function(){var e=Object(i.a)(u.a.mark((function e(){var t;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/bunny/stream/collections",method:"POST",data:{type:p,name:r}});case 4:t=e.sent,vr("presto-player/bunny-popup").addCollection(t),vr("presto-player/bunny-popup").setCollectionRequest(t),vr("presto-player/bunny-popup").setVideosFetched(!1),n(""),b(!1),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),console.error(e.t0);case 15:return e.prev=15,c(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[1,12,15,18]])})));return function(){return e.apply(this,arguments)}}();return Object(g.b)(mr,null,Object(g.b)(ir,{isSecondary:!0,onClick:function(){return b(!0)}},lr("Create Collection","presto-player")),d&&Object(g.b)(pr,{overlayClassName:"presto-modal",title:"Create New Collection",shouldCloseOnClickOutside:!1,isDismissible:!1},Object(g.b)(sr,{css:Object(g.a)(St||(St=Object(f.a)(["\n margin-bottom: 15px;\n "]))),tabIndex:"0",placeholder:lr("Enter a collection name","presto-player"),value:r,onChange:function(e){return n(e)}}),Object(g.b)(ur,null,Object(g.b)(ir,{isBusy:l,disabled:l,isPrimary:!0,onClick:function(){m()}},lr("Create","presto-player"))," ",Object(g.b)(ir,{onClick:function(){return b(!1)}},lr("Cancel","presto-player")))))},Or=wp.i18n.__,gr=wp.components,jr=gr.Flex,wr=gr.FlexBlock,_r=gr.FlexItem,Er=(gr.Button,gr.FormFileUpload),Rr=wp.data.dispatch,kr=function(e){var t=e.afterUpload;return Object(g.b)(jr,null,Object(g.b)(wr,null,Object(g.b)(jr,{justify:"flex-start"},Object(g.b)(Er,{multiple:!0,isPrimary:!0,accept:"video/mp4,video/x-m4v,video/*",onChange:function(e){e.target.files&&(Rr("presto-player/bunny-popup").addUploads(e.target.files),jQuery(e.target).val(null))}},Or("Upload Videos","presto-player"))," ",Object(g.b)(hr,null),!!t&&t)),Object(g.b)(_r,null))},Pr=wp.i18n.__,Cr=wp.components.Button,xr=wp.element,Sr=xr.useState,Nr=xr.useEffect,Tr=wp.data.useSelect,Dr=function(e){var t=e.onChoose,r=Sr(null),n=Object(s.a)(r,2),a=n[0],o=n[1],l=Sr(!1),c=Object(s.a)(l,2),i=c[0],p=c[1],u=Tr((function(e){return e("presto-player/bunny-popup").ui("selectedId")})),d=Tr((function(e){return e("presto-player/bunny-popup").videos()}));return Nr((function(){o(u?d.find((function(e){return e.guid===u})):null)}),[d,u]),Nr((function(){3==(null==a?void 0:a.status)&&null!=a&&a.availableResolutions.length?p(!0):p((null==a?void 0:a.status)>3&&(null==a?void 0:a.status)<5)}),[null==a?void 0:a.availableResolutions]),React.createElement(Cr,{isPrimary:!0,disabled:!i,onClick:function(){return t(a)}},null!=a&&a.id&&!i?Pr("Please wait, video is encoding...","presto-player"):Pr("Choose","presto-player"))},Br=wp.components.Icon,Ar=function(e){var t=e.children,r=e.onClick;return Object(g.b)("span",{onClick:r,css:Object(g.a)(Nt||(Nt=Object(f.a)(["\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n color: var(--wp-admin-theme-color, #007cba);\n padding: 6px 0;\n "])))},Object(g.b)(Br,{css:Object(g.a)(Tt||(Tt=Object(f.a)(["\n width: 14px;\n height: 14px;\n font-size: 14px;\n margin-right: 5px;\n "]))),icon:"arrow-left-alt",size:14}),Object(g.b)("span",null,t))},Lr=wp.i18n.__,Ir=wp.element.useState,Fr=wp.data,Vr=Fr.dispatch,Ur=Fr.useSelect,Mr=wp.components,zr=Mr.Button,Wr=Mr.Modal,Hr=Mr.BaseControl,Yr=function(){var e=Ir(!1),t=Object(s.a)(e,2),r=t[0],n=t[1],a=Ir(!1),o=Object(s.a)(a,2),l=o[0],c=o[1],p=Ir(""),d=Object(s.a)(p,2),b=(d[0],d[1],Ur((function(e){return e("presto-player/bunny-popup").currentCollection()}))),m=Ur((function(e){return e("presto-player/bunny-popup").requestType()})),y=function(){var e=Object(i.a)(u.a.mark((function e(){return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c(!0),e.prev=1,e.next=4,wp.apiFetch({path:"presto-player/v1/bunny/stream/collections/".concat(null==b?void 0:b.guid),method:"DELETE",data:{type:m}});case 4:n(!1),Vr("presto-player/bunny-popup").setCollectionRequest(""),Vr("presto-player/bunny-popup").setVideosFetched(!1),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(1),n(!1),Vr("presto-player/bunny-popup").addError(e.t0.message);case 13:return e.prev=13,c(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,9,13,16]])})));return function(){return e.apply(this,arguments)}}();return Object(g.b)("div",{css:Object(g.a)(Dt||(Dt=Object(f.a)(["\n margin-bottom: 2em;\n display: flex;\n align-items: center;\n justify-content: space-between;\n "])))},Object(g.b)("div",null,Object(g.b)(Ar,{onClick:function(){Vr("presto-player/bunny-popup").setCollectionRequest(""),Vr("presto-player/bunny-popup").setVideosFetched(!1)}},Lr("Back To Main Folder","presto-player")),Object(g.b)("h2",null,b.name)),Object(g.b)(zr,{isDestructive:!0,onClick:function(){return n(!0)}},Lr("Delete Collection","presto-player")),r&&Object(g.b)(Wr,{shouldCloseOnClickOutside:!1,overlayClassName:"presto-modal",title:"Delete Collection",onRequestClose:function(){return n(!1)}},Object(g.b)("h2",null,Lr("Are you sure you want to delete the collection? ","presto-player")),Object(g.b)("p",null,Lr("This will also delete all videos inside of the collection.","presto-player")),Object(g.b)(Hr,null,Object(g.b)(zr,{isDestructive:!0,disabled:l,isBusy:l,onClick:y},Lr("Delete","presto-player"))," ",Object(g.b)(zr,{onClick:function(){return n(!1)}},Lr("Cancel","presto-player")))))};function Gr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function qr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gr(Object(r),!0).forEach((function(t){Object(c.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}wp.components.Icon;var Zr,Kr,Qr,Xr,$r,Jr,en,tn,rn,nn,an,on,ln,cn=wp.element,sn=cn.useState,pn=cn.useEffect,un=(cn.useContext,wp.data),dn=un.useSelect,bn=(un.dispatch,wp.i18n.__),mn=function(e){var t,r=e.file,n=e.name,a=e.onComplete,o=sn(0),l=Object(s.a)(o,2),c=l[0],p=l[1],d=sn(bn("Uploading","presto-player")),b=Object(s.a)(d,2),m=(b[0],b[1]),y=sn(""),h=Object(s.a)(y,2),O=h[0],j=h[1],w=sn(!1),_=Object(s.a)(w,2),E=_[0],R=_[1],k=dn((function(e){return e("presto-player/bunny-popup").requestType()})),P=dn((function(e){return e("presto-player/bunny-popup").currentCollection()})),C=function(){var e=Object(i.a)(u.a.mark((function e(){return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:m(bn("Uploading","presto-player")),t=v({file:null!=r&&r[0]?null==r?void 0:r[0]:r,path:"presto-player/v1/bunny/stream/upload",onProgress:function(e){p(e)},onComplete:x,onError:function(e){j(e.message),m(bn("Error","presto-player")),p(0)}});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),x=function(){var e=Object(i.a)(u.a.mark((function e(t){var r,n,a;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.path,n=t.name,m(bn("Creating","presto-player")),e.prev=2,e.next=5,wp.apiFetch({path:"presto-player/v1/bunny/stream/videos",method:"POST",data:qr({type:k,name:n},null!=P&&P.guid?{collection:P.guid}:{})});case 5:a=e.sent,R(!0),S({path:r,video:a}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),j(e.t0.message);case 13:return e.prev=13,p(0),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[2,10,13,16]])})));return function(t){return e.apply(this,arguments)}}(),S=function(){var e=Object(i.a)(u.a.mark((function e(t){var r,n;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.path,n=t.video,e.next=3,wp.apiFetch({path:"presto-player/v1/bunny/stream/store",method:"POST",data:{type:k,path:r,guid:n.guid}});case 3:a();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return pn((function(){return C(),function(){t&&t.cancel()}}),[]),E?"":Object(g.b)("div",{css:Object(g.a)(Bt||(Bt=Object(f.a)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n animation: components-button__busy-animation 2500ms infinite linear;\n opacity: 1;\n padding: 6px 12px;\n border-radius: 99999px;\n border: 1px solid #dddddd;\n background-size: 100px 100%;\n background-image: linear-gradient(\n -45deg,\n #ffffff 33%,\n #f3f3f3 33%,\n #f3f3f3 70%,\n #ffffff 70%\n );\n "])))},Object(g.b)("div",{css:Object(g.a)(At||(At=Object(f.a)(["\n flex: 1;\n white-space: nowrap;\n overflow: hidden;\n max-width: 150px;\n text-overflow: ellipsis;\n font-weight: bold;\n "])))},!!O&&O,!!n&&n," ",r.name,"..."),Object(g.b)("div",{css:Object(g.a)(Lt||(Lt=Object(f.a)(["\n display: flex;\n align-items: center;\n "])))},Object(g.b)(it,{css:Object(g.a)(It||(It=Object(f.a)(["\n width: 50px;\n height: 3px;\n margin: 0 5px;\n background: #e3e3e3;\n border-radius: 9999px;\n overflow: hidden;\n "]))),progress:c})))},yn=wp.data.useSelect,vn=function(e){var t=e.removeUpload,r=(e.isPrivate,yn((function(e){return e("presto-player/bunny-popup").uploads()})));return r.length?Object(g.b)("div",{css:Object(g.a)(Zr||(Zr=Object(f.a)(["\n overflow: auto;\n display: flex;\n align-items: center;\n position: relative;\n "])))},r.length&&r.map((function(e){return Object(g.b)(mn,{css:Object(g.a)(Kr||(Kr=Object(f.a)(["\n margin-right: 0px;\n "]))),file:e,onComplete:function(){return t(e)}})}))):""},fn=wp.i18n.__,hn=wp.components.Modal,On=function(e){var t=e.onClose,r=e.title,n=e.header,a=e.error,o=e.mainContent,l=e.sidebar,c=e.footer;return Object(g.b)(hn,{title:r||fn("Add Media","presto-player"),onRequestClose:t,css:Object(g.a)(Qr||(Qr=Object(f.a)(["\n width: 100%;\n height: 100%;\n max-width: calc(100% - 32px);\n max-height: calc(100% - 32px);\n\n .components-modal__content {\n position: relative;\n display: flex;\n flex-direction: column;\n }\n "]))),overlayClassName:"presto-player__modal-overlay"},Object(g.b)("div",{css:Object(g.a)(Xr||(Xr=Object(f.a)(['\n @media screen and (min-width: 780px) {\n margin: -24px;\n display: grid;\n flex: 1;\n max-height: calc(100vh - 68px);\n grid-template-columns: 1fr 1fr minmax(0px, 267px);\n grid-template-rows: minmax(50px, auto) 1fr 60px;\n grid-template-areas:\n "header header sidebar"\n "main main sidebar"\n "footer footer footer";\n overflow: hidden;\n }\n ']))),"data-cy":"media-modal"},Object(g.b)("div",{css:Object(g.a)($r||($r=Object(f.a)(["\n grid-area: header;\n padding: 24px 24px 12px 24px;\n "])))},Object(g.b)("div",{css:Object(g.a)(Jr||(Jr=Object(f.a)(["\n display: flex;\n align-items: center;\n\n > * {\n margin-right: 10px;\n }\n "])))},n),a),Object(g.b)("div",{css:Object(g.a)(en||(en=Object(f.a)(["\n grid-area: main;\n display: grid;\n overflow: hidden;\n\n .components-drop-zone__provider {\n overflow: hidden;\n display: grid;\n }\n\n .components-drop-zone {\n z-index: 99;\n }\n "])))},o),Object(g.b)("div",{css:Object(g.a)(tn||(tn=Object(f.a)(["\n display: none;\n grid-area: sidebar;\n padding: 0 16px;\n z-index: 75;\n background: #f3f3f3;\n border-left: 1px solid #ddd;\n overflow: auto;\n\n @media screen and (min-width: 780px) {\n display: block;\n }\n\n .sidebar-content {\n padding: 16px 0;\n }\n "])))},l),Object(g.b)("div",{css:Object(g.a)(rn||(rn=Object(f.a)(["\n grid-area: footer;\n border-top: 1px solid #ddd;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n padding: 8px;\n "])))},c)))},gn=wp.i18n.__,jn=wp.components,wn=(jn.Button,jn.DropZone),_n=jn.DropZoneProvider,En=jn.Notice,Rn=wp.element,kn=(Rn.useState,Rn.useEffect),Pn=(Rn.Fragment,wp.data),Cn=Pn.dispatch,xn=Pn.useSelect,Sn=function(e){var t=e.onClose,r=e.onChoose,n=xn((function(e){return e("presto-player/bunny-popup").isPrivate()})),a=xn((function(e){return e("presto-player/bunny-popup").uploads()})),o=xn((function(e){return e("presto-player/bunny-popup").currentCollection()})),l=xn((function(e){return e("presto-player/bunny-popup").errors()}));kn((function(){Cn("presto-player/bunny-popup").setVideosFetched(!1),Cn("presto-player/bunny-popup").setCollections([]),Cn("presto-player/bunny-popup").setVideos([])}),[]);var c=function(e){Cn("presto-player/bunny-popup").addUploads(e)},i=gn(n?"Private Stream Library":"Public Stream Library","presto-player"),s=Object(g.b)(kr,{afterUpload:Object(g.b)(vn,{uploads:a,removeUpload:function(e){Cn("presto-player/bunny-popup").removeUpload(e)},isPrivate:n})}),p=Object(g.b)(ct,null),u=Object(g.b)(Dr,{onChoose:r});return Object(g.b)(On,{title:i,header:s,mainContent:Object(g.b)(_n,{css:Object(g.a)(nn||(nn=Object(f.a)(["\n overflow: auto;\n display: flex;\n flex-direction: column;\n "])))},Object(g.b)("div",{css:Object(g.a)(an||(an=Object(f.a)(["\n padding: 12px 24px;\n overflow: auto;\n display: flex;\n flex-direction: column;\n "])))},!!l.length&&l.map((function(e){return Object(g.b)(En,{css:Object(g.a)(on||(on=Object(f.a)(["\n margin: 0 0 20px 0;\n "]))),status:"error",onRemove:function(){return Cn("presto-player/bunny-popup").removeError(e)}},e)})),o?Object(g.b)(Yr,null):Object(g.b)(or,null),Object(g.b)("div",{css:Object(g.a)(ln||(ln=Object(f.a)(["\n display: flex;\n align-items: stretch;\n "])))},Object(g.b)(Qt,null)),Object(g.b)(wn,{label:"Drop files",onFilesDrop:c}))),onClose:function(){a.length?confirm("Discard your uploads?")&&(t(),Cn("presto-player/bunny-popup").setUploads([])):t()},footer:u,sidebar:p})},Nn=wp.i18n.__,Tn=wp.element.useEffect,Dn=wp.data.dispatch,Bn=function(e){var t=e.closePopup,r=e.onSelect,n=e.isPrivate;return Tn((function(){Dn("presto-player/bunny-popup").setIsPrivate(n)}),[n]),React.createElement(Sn,{onClose:t,onChoose:function(e){e.url=e.playlistURL,e.thumbnail=e.thumbnailURL,e.preview=e.webPURL,r(e)},header:Nn(n?"Private Stream Library":"Public Stream Library","presto-player"),title:Nn(n?"Private Video Stream":"Public Video Stream","presto-player")})},An=wp.i18n.__,Ln=wp.element.useState,In="".concat(prestoPlayer.root).concat(prestoPlayer.prestoVersionString,"bunny/"),Fn=wp.i18n.__,Vn=wp.element.useState,Un="".concat(prestoPlayer.root).concat(prestoPlayer.prestoVersionString,"bunny/stream/"),Mn=wp.i18n.__,zn=wp.components,Wn=zn.Button,Hn=zn.TextControl,Yn=zn.Placeholder,Gn=zn.Flex,qn=zn.FlexBlock,Zn=zn.ExternalLink,Kn=zn.Spinner,Qn=zn.FlexItem,Xn=zn.Notice,$n=wp.element.useEffect,Jn=function(e){var t=e.onRefetch,r=e.type,n=e.autoSubmit,a="stream"===r?function(e){var t=Vn(""),r=Object(s.a)(t,2),n=r[0],a=r[1],o=Vn(""),l=Object(s.a)(o,2),c=l[0],p=l[1],d=Vn(!1),b=Object(s.a)(d,2),m=b[0],y=b[1],v=Vn(0),f=Object(s.a)(v,2),h=f[0],O=f[1],g=Vn(""),j=Object(s.a)(g,2),w=j[0],_=j[1],E=function(e){return e.includes("Authorization has been denied")?"Your API key is incorrect. Please double-check to make sure you've copied it correctly.":e.includes("localhost")?"You cannot use a CDN on a local site. Please use Bunny.net on a live, publicly accessible site.":e};return{saveKey:function(){var t=Object(i.a)(u.a.mark((function t(){var r,a;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return _(""),t.prev=1,y(!0),O(0),p(Fn("Validating API Key...","presto-player")),t.next=7,wp.apiFetch({url:"".concat(Un,"api-key"),method:"POST",data:{api_key:n}});case 7:if(r=t.sent,r.success){t.next=11;break}throw{message:"Could not save the API key. Please double check it to make sure it's correct."};case 11:t.next=18;break;case 13:return t.prev=13,t.t0=t.catch(1),O(0),_(null!==t.t0&&void 0!==t.t0&&t.t0.message?E(t.t0.message):"Something went wrong. Please try again"),t.abrupt("return");case 18:return t.prev=18,O(1),y(!1),p(""),t.finish(18);case 23:return t.prev=23,y(!0),p(Fn("Setting up public video library. This make take a few moments...","presto-player")),t.next=28,wp.apiFetch({url:"".concat(Un,"library"),method:"POST",data:{type:"public"}});case 28:a=t.sent,a.id,t.next=37;break;case 32:return t.prev=32,t.t1=t.catch(23),O(0),_(null!==t.t1&&void 0!==t.t1&&t.t1.message?E(t.t1.message):"Something went wrong. Please try again"),t.abrupt("return");case 37:return t.prev=37,O(2),y(!1),p(""),t.finish(37);case 42:return t.prev=42,y(!0),p(Fn("Setting up private video library. This make take a few moments...","presto-player")),t.next=47,wp.apiFetch({url:"".concat(Un,"library"),method:"POST",data:{type:"private"}});case 47:t.next=54;break;case 49:return t.prev=49,t.t2=t.catch(42),O(0),_(null!==t.t2&&void 0!==t.t2&&t.t2.message?E(t.t2.message):"Something went wrong. Please try again"),t.abrupt("return");case 54:return t.prev=54,O(2),y(!1),p(""),t.finish(54);case 59:e();case 60:case"end":return t.stop()}}),t,null,[[1,13,18,23],[23,32,37,42],[42,49,54,59]])})));return function(){return t.apply(this,arguments)}}(),setApikey:a,step:h,saveMessage:c,saving:m,error:w,totalSteps:3}}(t):function(e){var t=Ln(""),r=Object(s.a)(t,2),n=r[0],a=r[1],o=Ln(""),l=Object(s.a)(o,2),c=l[0],p=l[1],d=Ln(!1),b=Object(s.a)(d,2),m=b[0],y=b[1],v=Ln(0),f=Object(s.a)(v,2),h=f[0],O=f[1],g=Ln(""),j=Object(s.a)(g,2),w=j[0],_=j[1],E=function(e){return e.includes("Authorization has been denied")?"Your API key is incorrect. Please double-check to make sure you've copied it correctly.":e.includes("localhost")?"You cannot use a CDN on a local site. Please use Bunny.net on a live, publicly accessible site.":e};return{saveKey:function(){var t=Object(i.a)(u.a.mark((function t(){var r,a,o;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return _(""),t.prev=1,y(!0),O(0),p(An("Validating API Key...","presto-player")),t.next=7,wp.apiFetch({url:"".concat(In,"api-key"),method:"POST",data:{api_key:n}});case 7:if(r=t.sent,r.success){t.next=11;break}throw{message:"Could not save the API key. Please double check it to make sure it's correct."};case 11:t.next=18;break;case 13:return t.prev=13,t.t0=t.catch(1),O(0),_(null!==t.t0&&void 0!==t.t0&&t.t0.message?E(t.t0.message):"Something went wrong. Please try again"),t.abrupt("return");case 18:return t.prev=18,O(1),y(!1),p(""),t.finish(18);case 23:return t.prev=23,y(!0),p(An("Setting up storage zones. This make take a few minutes...","presto-player")),t.next=28,wp.apiFetch({url:"".concat(In,"storage-zones"),method:"POST"});case 28:a=t.sent,a.id,t.next=37;break;case 32:return t.prev=32,t.t1=t.catch(23),O(0),_(null!==t.t1&&void 0!==t.t1&&t.t1.message?E(t.t1.message):"Something went wrong. Please try again"),t.abrupt("return");case 37:return t.prev=37,O(2),y(!1),p(""),t.finish(37);case 42:return t.prev=42,y(!0),p(An("Setting up pull zones. This make take a few minutes...","presto-player")),t.next=47,wp.apiFetch({url:"".concat(In,"pull-zones"),method:"POST"});case 47:o=t.sent,o.id,t.next=56;break;case 51:return t.prev=51,t.t2=t.catch(42),O(0),_(null!==t.t2&&void 0!==t.t2&&t.t2.message?E(t.t2.message):"Something went wrong. Please try again"),t.abrupt("return");case 56:return t.prev=56,O(3),y(!1),p(""),t.finish(56);case 61:e();case 62:case"end":return t.stop()}}),t,null,[[1,13,18,23],[23,32,37,42],[42,51,56,61]])})));return function(){return t.apply(this,arguments)}}(),setApikey:a,step:h,saveMessage:c,saving:m,error:w,totalSteps:3}}(t),o=a.saveKey,l=a.apikey,c=a.setApikey,p=a.saveMessage,d=a.saving,b=a.totalSteps,m=a.step,y=a.error;return $n((function(){n&&o()}),[n]),React.createElement(Yn,{label:Mn("Bunny.net Video","presto-player"),instructions:React.createElement(React.Fragment,null,Mn("Enter your Bunny.net API key, which can be found on your Bunny CDN Account page.","presto-player")," ",React.createElement(Zn,{href:"https://bunnycdn.com/dashboard/account"},Mn("Get My API Key","presto-player")))},d?React.createElement(Gn,null,React.createElement(Qn,null,React.createElement(Kn,null)),React.createElement(qn,null,p,React.createElement("progress",{className:"presto-progress",max:b,value:m,style:{width:"100%"}}))):React.createElement("form",{onSubmit:function(e){e.preventDefault(),o()}},y&&React.createElement(Gn,{style:{width:"100%"}},React.createElement(qn,null,React.createElement(Xn,{status:"error",isDismissible:!1},y))),React.createElement(Gn,{style:{width:"100%",maxWidth:"400px"}},React.createElement(qn,null,React.createElement(Hn,{value:l,onChange:function(e){return c(e)},className:"presto-link-placeholder-input",type:"password",autoComplete:"off",placeholder:Mn("Your Bunny.net API Key","presto-player"),required:!0})),React.createElement(Qn,null,React.createElement(Wn,{isPrimary:!0,style:{marginBottom:"8px"},type:"submit"},Mn("Next","presto-player")," →")))))},ea=r(22),ta=r(14);function ra(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function na(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ra(Object(r),!0).forEach((function(t){Object(c.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ra(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var aa=wp.components,oa=aa.Button,la=aa.Disabled,ca=aa.DropdownMenu,ia=aa.Spinner,sa=aa.Toolbar,pa=aa.withNotices,ua=aa.BaseControl,da=aa.Placeholder,ba=aa.ToggleControl,ma=wp.editor,ya=ma.BlockControls,va=ma.InspectorControls,fa=wp.i18n.__,ha=wp.compose.compose,Oa=wp.element,ga=Oa.useEffect,ja=Oa.useState,wa=Oa.Fragment,_a=wp.data.dispatch,Ea=ha([Object(m.a)(),Object(b.a)()])(pa((function(e){var t,r,n=e.attributes,a=e.setAttributes,o=e.noticeOperations,l=e.branding,c=(e.isSelected,e.presetData),p=e.createVideo,b=e.lockSave,m=e.unlockSave,v=e.onRemoveSrc,f=e.renderKey,h=e.defaultPreset,O=n.poster,g=n.src,j=n.id,w=n.tracks,_=n.visibility,E=n.previewSrc,R=n.thumbnail,k=ja(""),P=Object(s.a)(k,2),C=P[0],x=P[1],S=ja(!1),N=Object(s.a)(S,2),T=N[0],D=N[1],B=ja(""),A=Object(s.a)(B,2),L=A[0],I=A[1],F=ja({stream:!1,storage:!1}),V=Object(s.a)(F,2),U=V[0],M=V[1],z=ja(!1),W=Object(s.a)(z,2),H=W[0],G=W[1],q=ja(!1),Z=Object(s.a)(q,2),K=Z[0],Q=Z[1],X=ja(!1),$=Object(s.a)(X,2),J=($[0],$[1]),ee=ja(!1),te=Object(s.a)(ee,2),re=te[0],ne=te[1],ae=wp.data.useSelect((function(e){return e("core").canUser("read","settings")})),oe="private"===_,le=null===(t=prestoPlayerAdmin)||void 0===t||null===(r=t.bunny)||void 0===r?void 0:r.disable_legacy_storage;function ce(e){e.url?(a(na(na({src:e.url,preset:null==h?void 0:h.id},null!=e&&e.thumbnail?{thumbnail:e.thumbnail}:{}),null!=e&&e.preview?{preview:e.preview}:{})),D(!0),b(),p(na({src:e.url,type:"bunny",title:e.title},null!=e&&e.guid?{external_id:e.guid}:{})).catch((function(e){a({src:""}),console.error(e)})).finally((function(){m(),D(!1)}))):a({src:void 0,id:void 0})}ga((function(){_a("presto-player/bunny-popup").setIsPrivate("private"===_)}),[_]),ga((function(){var e,t,r,n,a,o;M({storage:null===(e=prestoPlayerAdmin)||void 0===e||null===(t=e.isSetup)||void 0===t||null===(r=t.bunny)||void 0===r?void 0:r.storage,stream:null===(n=prestoPlayerAdmin)||void 0===n||null===(a=n.isSetup)||void 0===a||null===(o=a.bunny)||void 0===o?void 0:o.stream})}),[]);var ie=function(){var e=Object(i.a)(u.a.mark((function e(){var t,r,n,a,o,l,c,i;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,wp.apiFetch({path:"wp/v2/settings"});case 3:t=e.sent,r=t.presto_player_bunny_pull_zones,n=t.presto_player_bunny_storage_zones,a=t.presto_player_bunny_stream_private,o=t.presto_player_bunny_stream_public,Q(!0),a||G(!0),c=(l=function(e){return!(null==e||!e.private_id||null==e||!e.public_id)})(r)||l(n),i=(null==a?void 0:a.pull_zone_url)&&(null==o?void 0:o.pull_zone_url),M({storage:c,stream:i}),I(c||i?"":"stream");case 15:return e.prev=15,J(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[0,,15,18]])})));return function(){return e.apply(this,arguments)}}();ga((function(){ae?ie():Q(!0)}),[ae]);var se=function(){var e=Object(i.a)(u.a.mark((function e(){var t;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!oe){e.next=7;break}return e.next=3,d(g);case 3:t=e.sent,a({previewSrc:t}),e.next=8;break;case 7:a({previewSrc:g});case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();ga((function(){se()}),[g]);var pe=function(){var e=Object(i.a)(u.a.mark((function e(){var t;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!oe){e.next=7;break}return e.next=3,d(R);case 3:(t=e.sent)&&a({previewThumbnail:t}),e.next=8;break;case 7:a({previewThumbnail:R});case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();ga((function(){pe()}),[R]);var ue=function(){var e=[];return!H&&e.push({title:U.stream?fa("Reconnect Stream","presto-player"):fa("Connect Stream","presto-player"),onClick:function(){I("stream"),ne(!1)}}),!le&&e.push({title:U.storage?fa("Reconnect Storage (Classic)","presto-player"):fa("Connect Storage (Classic)","presto-player"),onClick:function(){return I("storage")}}),React.createElement(ca,{icon:"ellipsis",label:fa("Connection Options","presto-player"),controls:e})};return T||!K?React.createElement(da,{className:"presto-player__placeholder is-loading"},React.createElement(ia,null)):"stream"===L?React.createElement(Jn,{type:"stream",autoSubmit:re,onRefetch:function(){Q(!1),ie()}}):"storage"===L?React.createElement(Jn,{type:"storage",onRefetch:function(){Q(!1),ie()}}):j?React.createElement(React.Fragment,null,React.createElement(ya,null,React.createElement(y.a,{tracks:w,onChange:function(e){a({tracks:e})}}),React.createElement(sa,null,React.createElement(oa,{onClick:function(){return v()}},fa("Replace","presto-player")))),React.createElement(va,null,React.createElement(ea.a,{setAttributes:a,attributes:n})),React.createElement("figure",{className:"wp-block-video"},React.createElement(la,null,React.createElement(ta.a,{poster:O,src:E,id:j,type:"bunny",attributes:n,setAttributes:a,preset:c,branding:l,key:f})))):React.createElement("div",null,React.createElement(da,{label:fa(oe?"Bunny.net Private Video":"Bunny.net Video","presto-player"),icon:oe?React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})):React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("polyline",{points:"8 17 12 21 16 17"}),React.createElement("line",{x1:"12",y1:"12",x2:"12",y2:"21"}),React.createElement("path",{d:"M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29"})),instructions:React.createElement(React.Fragment,null,fa("Add or select a Bunny.net video","presto-player"))},React.createElement(ua,{className:"presto-player__placeholder-control"},React.createElement(ba,{label:"Private Video",help:oe?"Video is only accessible to those who are logged in.":"Video is accessible to everyone.",checked:oe,onChange:function(e){a({visibility:e?"private":"public"})}})),React.createElement(wa,null,U.stream&&React.createElement(oa,{isPrimary:!0,onClick:function(){return x("stream")}},fa(oe?"Add/Select Private Video Stream":"Add/Select Video Stream","presto-player")),!le&&U.storage&&React.createElement(oa,{isSecondary:U.stream,isPrimary:!U.stream,onClick:function(){return x("storage")}},fa(oe?"Add/Select Private Video (Classic)":"Add/Select Video (Classic)","presto-player")),!U.stream&&!H&&U.storage&&React.createElement(oa,{isSecondary:!0,onClick:function(){ne(!0),I("stream")}},fa("Enable Bunny.net Stream!","presto-player")),!!ae&&ue())),"storage"===C&&React.createElement(Y,{isPrivate:oe,closePopup:function(){return x("")},noticeOperations:o,onSelect:ce}),"stream"===C&&React.createElement(Bn,{isPrivate:oe,closePopup:function(){return x("")},noticeOperations:o,onSelect:ce}))}))),Ra=r(17);function ka(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ka(Object(r),!0).forEach((function(t){Object(c.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ka(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ca=wp.i18n.__,xa="presto-player/bunny",Sa=Pa(Pa({},Ra.a),{},{attributes:Pa(Pa({},Ra.a.attributes),{thumbnail:{type:String,default:""},preview:{type:String,default:""}}),premium:!0,title:Ca("Presto Bunny.net Video","presto-player"),description:Ca("Serve video through Bunny.net CDN.","presto-player"),variations:[{name:"public",isDefault:!0,title:Ca("Presto Bunny.net Video","presto-player"),description:Ca("Serve public video through Bunny.net CDN.","presto-player"),attributes:{visibility:"public"}},{name:"private",title:Ca("Presto Bunny.net Private Video","presto-player"),icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})),description:Ca("Serve private, secure video through Bunny.net CDN.","presto-player"),attributes:{visibility:"private"}}],icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("polyline",{points:"8 17 12 21 16 17"}),React.createElement("line",{x1:"12",y1:"12",x2:"12",y2:"21"}),React.createElement("path",{d:"M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29"})),edit:Ea})},function(e,t,r){"use strict";r.r(t),r.d(t,"name",(function(){return ot})),r.d(t,"options",(function(){return lt}));var n=r(8),a=r(5),o=r(3),l=r(1),c=r(19),i=r.n(c),s=r(15),p=r(4),u=r(13),d=r(16),b=r(24),m=window.location.href,y=function(e){var t=e.src,r=e.onChange,n=e.onSubmit,a=e.onClose;return React.createElement(b.URLPopover,{onClose:a},React.createElement("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n},React.createElement("input",{"data-cy":"url-input",className:"block-editor-media-placeholder__url-input-field",type:"url","aria-label":Object(o.__)("URL","presto-player"),placeholder:Object(o.__)("Paste an mp3 URL","presto-player"),onChange:r,value:t}),React.createElement(p.Button,{"data-cy":"url-submit",className:"block-editor-media-placeholder__url-input-submit-button",icon:"editor-break",label:Object(o.__)("Apply","presto-player"),type:"submit"})))};var v=Object(p.withFilters)("editor.MediaPlaceholder")((function(e){var t=e.value,r=void 0===t?{}:t,n=e.allowedTypes,a=void 0===n?[]:n,c=e.className,v=e.icon,f=e.url,h=void 0===f||f,O=e.labels,g=void 0===O?{}:O,j=e.mediaPreview,w=e.notices,_=e.isAppender,E=e.isPrivate,R=e.addToGallery,k=e.onSelect,P=e.onCancel,C=e.onSelectURL,x=e.onDoubleClick,S=e.children,N=e.allowURLs,T=Object(d.useSelect)((function(e){return(0,e("core/block-editor").getSettings)().mediaUpload}),[]),D=Object(u.useState)(""),B=Object(l.a)(D,2),A=B[0],L=B[1],I=Object(u.useState)(!1),F=Object(l.a)(I,2),V=F[0],U=F[1];Object(u.useEffect)((function(){var e;L(null!==(e=null==r?void 0:r.src)&&void 0!==e?e:"")}),[r]);var M=function(e){L(e.target.value)},z=function(){U(!0)},W=function(){U(!1)},H=function(e){e.preventDefault(),A&&C&&(C(A),W())},Y=function(e,t){var r=g.instructions,n=g.title;T||C||(r=Object(o.__)("To edit this block, you need permission to upload media.","presto-player"));var a=i()("block-editor-media-placeholder",c,{"is-appender":_});return React.createElement(p.Placeholder,{icon:v,label:n,instructions:r,className:a,notices:w,onClick:t,onDoubleClick:x,preview:j},S,e)},G=function(){return C&&React.createElement("div",{className:"block-editor-media-placeholder__url-input-container"},h&&!1===E&&React.createElement(p.Button,{className:"block-editor-media-placeholder__button",onClick:z,isPressed:V,isTertiary:!0},Object(o.__)("Audio URL","presto-player")),V&&React.createElement(y,{src:A,onChange:M,onSubmit:H,onClose:W}))};return React.createElement(b.MediaUploadCheck,{fallback:Y(G())},function(){var e=React.createElement(b.MediaUpload,{title:E?Object(o.__)("Select or Upload Private Audio","presto-player"):Object(o.__)("Select or Upload Audio","presto-player"),addToGallery:R,gallery:!1,multiple:!1,onSelect:function(e){s.a.unsetUrlParams(),k(e)},onClose:function(){s.a.unsetUrlParams()},allowedTypes:a,value:Array.isArray(r)?r.map((function(e){return e.id})):r.id,render:function(e){var t=e.open;return React.createElement(p.Button,{isPrimary:!0,onClick:function(e){e.stopPropagation(),s.a.unsetUrlParams(),E?s.a.setUrlPrivate(m):s.a.setUrlPublic(m),t()}},E?Object(o.__)("Add/Select Private Audio","presto-player"):Object(o.__)("Add/Select Audio","presto-player"))}});if(T){var t=React.createElement(React.Fragment,null,e,!!N&&G(),P&&React.createElement(p.Button,{className:"block-editor-media-placeholder__cancel-button",title:Object(o.__)("Cancel","presto-player"),isLink:!0,onClick:P},Object(o.__)("Cancel","presto-player")));return Y(t)}return Y(e)}())})),f=r(10),h=wp.i18n.__,O=wp.components,g=(O.withNotices,O.BaseControl),j=O.ToggleControl,w=O.Notice,E=["audio"],R=function(e){var t,r,n=e.attributes,o=e.setAttributes,l=e.onSelectURL,c=e.onSelect,i=e.children,s="private"===n.visibility;return React.createElement(v,(r={icon:s?React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),React.createElement("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})):React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"presto-block-icon"},React.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"})),labels:{title:h("Presto Audio","presto-player"),instructions:h("Upload a audio file, or pick one from your media library.","presto-player")},accept:"audio/*",setAttributes:o,allowedTypes:E,switcher:!0,isPrivate:s,allowURLs:!s,onSelectURL:l,onSelect:c,value:n},Object(a.a)(r,"allowURLs",!0),Object(a.a)(r,"onError",(function(){return console.log("error")})),r),React.createElement("div",{style:{width:"100%"}},React.createElement(g,{className:"presto-player__placeholder-control"},React.createElement(j,{label:React.createElement("div",null,h("Make Private","presto-player")," ",!(null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium)&&React.createElement(f.a,null)),help:h(s?"This audio is only accessible to those who are logged in.":"This audio is currently accessible to everyone.","presto-player"),checked:s,onChange:function(e){var t;null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium?o({visibility:e?"private":"public"}):dispatch("presto-player/player").setProModal(!0)}})),!!i&&React.createElement("div",{style:{width:"100%"}},i),!!s&&React.createElement(w,{status:"warning",isDismissible:!1},React.createElement("div",null,React.createElement("div",null,React.createElement("strong",null,h("Note","presto-player"))),h("Private audio uses php to stream your audio. Keep in mind this will use up disk space and bandwidth so it may not be an appropriate choice for some hosts.","presto-player")))))},k=r(43),P=r(29),C=r(30),x=r(39),S=r(6),N=r(7),T=r(2),D=r.n(T),B=r(9),A=r(31),L=r(0),I=r(23),F=r(14);function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach((function(t){Object(a.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var M,z,W=function(e){var t,r=e.state,n=e.branding,a=e.menu,c=e.src,i=e.poster,s=e.currentTime,d=e.preload,b=e.mediaTitle,m=e.overlays,y=e.isDisabled,v=void 0===y||y,f=Object(u.useState)(1),h=Object(l.a)(f,2),O=h[0],g=h[1],j=r.email_collection,w=r.cta;Object(u.useEffect)((function(){g(O+1)}),[r.skin,r["play-large"],r.rewind,r.play,r["fast-forward"],r.progress,r["current-time"],r.mute,r.volume,r.speed,r.pip,r.fullscreen,r.captions,r.hide_logo]);var _={email:!(null==j||!j.enabled)&&React.createElement(I.b,{className:"email-overlay",slot:"player-end",headline:null==j?void 0:j.headline,style:U(U({"--presto-player-email-border-radiuss":"".concat(null==j?void 0:j.button_radius,"px"),"--plyr-color-main":(null==r?void 0:r.background_color)||(null==n?void 0:n.color)},j.button_color?{"--presto-player-button-color":"".concat(j.button_color)}:{}),j.button_text_color?{"--presto-player-button-text":"".concat(j.button_text_color)}:{}),defaultHeadline:Object(o.__)("Enter your email to play.","presto-player"),bottomText:null==j?void 0:j.bottom_text,allowSkip:null==j?void 0:j.allow_skip,skipText:Object(o.__)("Skip","presto-player"),buttonText:null==j?void 0:j.button_text,placeholder:Object(o.__)("Email address","presto-player"),i18n:window.prestoPlayer.i18n,type:"audio"}),cta:!(null==w||!w.enabled)&&React.createElement(I.a,{className:"cta-overlay",style:U(U(U({"--presto-player-button-border-radius":"".concat(w.button_radius,"px")},null!=w&&w.background_opacity?{"--presto-player-cta-background-opacity":"".concat((null==w?void 0:w.background_opacity)/100)}:{}),w.button_color?{"--presto-player-button-color":"".concat(w.button_color)}:{}),w.button_text_color?{"--presto-player-button-text":"".concat(w.button_text_color)}:{}),slot:"player-end",headline:null==w?void 0:w.headline,"bottom-text":null==w?void 0:w.bottom_text,"button-link":null==w?void 0:w.button_link,"allow-skip":100!==(null==w?void 0:w.percentage)&&(null==w?void 0:w.show_skip),borderRadius:null==w?void 0:w.border_radius,"allow-rewatch":100===(null==w?void 0:w.percentage)&&(null==w?void 0:w.show_rewatch),"skip-text":Object(o.__)("Skip","presto-player"),"show-button":null==w?void 0:w.show_button,"button-text":null==w?void 0:w.button_text,i18n:window.prestoPlayer.i18n,type:"audio"})};return React.createElement(p.Disabled,{isDisabled:v,className:"disable-player"},React.createElement("div",{className:"presto-player__wrapper"},React.createElement(F.a,{src:c||"http://something.mp3",classes:"\n ".concat("cta"===a&&!(null==w||!w.enabled)&&"cta-active"," \n ").concat("email"===a&&!(null==j||!j.enabled)&&"email-active"),preset:r,branding:n,i18n:null===(t=prestoPlayerAdmin)||void 0===t?void 0:t.i18n,preload:d,attributes:{chapters:[],poster:i,title:b},type:"audio",currentTime:s?Object(B.e)(s):"",overlays:m,key:O,adminPreview:(null==_?void 0:_[a])||""})))},H=wp.i18n.__,Y=wp.components,G=Y.ToggleControl,q=Y.BaseControl,Z=(Y.HorizontalRule,Y.__experimentalAlignmentMatrixControl,Y.SelectControl),K=function(e){var t=e.state,r=e.updateState,n=e.className;return React.createElement("div",{className:n},React.createElement(q,null,React.createElement("h3",null,H("Behavior","presto-player"))),React.createElement(q,null,React.createElement(G,{label:H("Save Play Position","presto-player"),help:H("Saves the user's play position so when they come back to the page they can continue the audio from where they left off.","presto-player"),onChange:function(e){r({save_player_position:e})},checked:t.save_player_position})),React.createElement(q,null,React.createElement(G,{label:H("Focus Mode","presto-player"),help:H("Play only when tab is visible and audio is in viewport.","presto-player"),onChange:function(e){r({play_video_viewport:e})},checked:t.play_video_viewport})),React.createElement(q,null,React.createElement(G,{label:H("Sticky On Scroll","presto-player"),help:H("Stick audios to the side of the screen when the page is scrolled and the audio is playing.","presto-player"),onChange:function(e){r({sticky_scroll:e})},checked:t.sticky_scroll})),React.createElement(q,null,React.createElement(Z,{label:H("On Audio End","presto-player"),value:t.on_video_end,options:[{value:"select",label:H("Select","presto-player")},{value:"loop",label:H("Loop","presto-player")},{value:"go-to-start",label:H("Go to start","presto-player")}],onChange:function(e){r({on_video_end:e})}})))},Q=wp.i18n.__,X=wp.components,$=X.ToggleControl,J=X.BaseControl,ee=function(e){var t=e.state,r=e.updateState,n=e.className;return React.createElement("div",{className:n},React.createElement(J,null,React.createElement("h3",null,Q("Controls","presto-player"))),React.createElement(J,{className:"presto-player__control--large-play"},React.createElement($,{label:Q("Large Play Button","presto-player"),help:Q("Adds a large play button over the top of the player.","presto-player"),onChange:function(e){r({"play-large":e})},checked:t["play-large"]})),React.createElement(J,{className:"presto-player__control--rewind"},React.createElement($,{label:Q("Rewind","presto-player"),help:Q("Adds a 10 second rewind button to the player.","presto-player"),onChange:function(e){r({rewind:e})},checked:t.rewind})),React.createElement(J,{className:"presto-player__control--play"},React.createElement($,{label:Q("Small Play Button","presto-player"),help:Q("Adds a small play button to the bottom of the player.","presto-player"),onChange:function(e){r({play:e})},checked:t.play})),React.createElement(J,{className:"presto-player__control--fast-forward"},React.createElement($,{label:Q("Fast Forward","presto-player"),help:Q("Adds a 10 second rewind button to the player.","presto-player"),onChange:function(e){r({"fast-forward":e})},checked:t["fast-forward"]})),React.createElement(J,{className:"presto-player__control--progress"},React.createElement($,{label:Q("Progress Bar","presto-player"),help:Q("Shows a seekable progress bar.","presto-player"),onChange:function(e){r({progress:e})},checked:t.progress})),React.createElement(J,{className:"presto-player__control--current-time"},React.createElement($,{label:Q("Current Time","presto-player"),help:Q("Shows the audio timestamp.","presto-player"),onChange:function(e){r({"current-time":e})},checked:t["current-time"]})),React.createElement(J,{className:"presto-player__control--volume"},React.createElement($,{label:Q("Volume","presto-player"),help:Q("Shows a volume bar.","presto-player"),onChange:function(e){r({volume:e,mute:e})},checked:t.volume})),React.createElement(J,{className:"presto-player__control--speed"},React.createElement($,{label:Q("Speed","presto-player"),help:Q("Shows playback speed controls.","presto-player"),onChange:function(e){r({speed:e})},checked:t.speed})))},te=r(12),re=function(e){var t=e.state,r=e.updateState,n=e.className;return React.createElement("div",{className:n},React.createElement(p.BaseControl,null,React.createElement("h3",null,Object(o.__)("Style","presto-player"))),React.createElement(p.BaseControl,null,React.createElement(p.RangeControl,{label:Object(o.__)("Round Corners","presto-player"),help:Object(o.__)("Player border radius size.","presto-player"),value:(null==t?void 0:t.border_radius)||0,onChange:function(e){return r({border_radius:e})},min:0,max:25})),React.createElement(p.BaseControl,null,React.createElement(p.Flex,null,React.createElement(p.BaseControl.VisualLabel,null,React.createElement("p",null,Object(o.__)("Background Color","presto-player"))),React.createElement(te.a,{color:(null==t?void 0:t.background_color)||"#000000",setColor:function(e){r({background_color:e.hex})}}))),React.createElement(p.BaseControl,null,React.createElement(p.Flex,null,React.createElement(p.BaseControl.VisualLabel,null,React.createElement("p",null,Object(o.__)("Control Color","presto-player"))),React.createElement(te.a,{color:(null==t?void 0:t.control_color)||"#000000",setColor:function(e){r({control_color:e.hex})}}))))},ne=r(40),ae=r(32),oe=r(38);function le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ce(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?le(Object(r),!0).forEach((function(t){Object(a.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):le(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ie=wp.i18n.__,se=wp.components,pe=se.TextControl,ue=se.BaseControl,de=se.Icon,be=se.Notice,me=se.Button,ye=se.Flex,ve=se.FlexItem,fe=se.SelectControl,he=se.FlexBlock,Oe=se.Modal,ge=wp.element,je=ge.useState,we=ge.useEffect,_e=wp.data,Ee=_e.useSelect,Re=_e.dispatch;var ke=function(e){var t=e.type,r=void 0===t?"new":t,n=e.closeModal,a=e.addPreset,o=e.onSave,c=e.updatePreset,i=e.name,s=void 0===i?"":i,p=e.attributes,u=e.preset,d=void 0===u?{"play-large":!0,rewind:!0,play:!0,"fast-forward":!0,progress:!0,"current-time":!0,mute:!0,volume:!0,speed:!1,pip:!1,save_player_position:!1,reset_on_end:!1,sticky_scroll:!1,hide_logo:!1,border_radius:0,skin:"default",background_color:"",control_color:"",cta:{},email_collection:{},action_bar:{}}:u,b=je(!1),m=Object(l.a)(b,2),y=m[0],v=m[1],f=je(""),h=Object(l.a)(f,2),O=h[0],g=h[1],j=je(""),w=Object(l.a)(j,2),_=w[0],E=w[1],R=je(s),k=Object(l.a)(R,2),P=k[0],C=k[1],x=je(d),T=Object(l.a)(x,2),I=T[0],F=T[1],V=Ee((function(e){return e("presto-player/player").branding()})),U=je(""),H=Object(l.a)(U,2),Y=H[0],G=H[1],q={message:ie("The preset could not be saved. Please reload the page and try again.","presto-player")},Z=Ee((function(e){return e("presto-player/player").youtube()}));we((function(){G(Z.channel_id)}),[null==Z?void 0:Z.channel_id]);var Q=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};F(ce(ce({},I),e))},X=function(){var e=Object(N.a)(D.a.mark((function e(){var t,r,a,l;return D.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),e.prev=1,t=ce(ce({},I),{name:P}),e.next=5,wp.apiFetch({method:"POST",url:wp.url.addQueryArgs("".concat(prestoPlayer.root).concat(prestoPlayer.prestoVersionString,"audio-preset/").concat(d.id),{_method:"PUT"}),data:t});case 5:if(r=e.sent){e.next=8;break}throw q;case 8:c(r),n(),o&&o(r),Object(B.d)({message:ie("Preset updated!","presto-player")}),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),g(null!==e.t0&&void 0!==e.t0&&e.t0.message?e.t0.message:q);case 17:return e.prev=17,v(!1),e.finish(17);case 20:return Re("presto-player/player").updateYoutube({channel_id:Y}),a=ce(ce({},Z),{channel_id:Y}),e.prev=22,e.next=25,wp.apiFetch({path:"wp/v2/settings",method:"POST",data:{presto_player_youtube:a}});case 25:null!=(l=e.sent)&&l.presto_player_youtube&&(Re("presto-player/player").setYoutube(null==l?void 0:l.presto_player_youtube),onClose()),e.next=32;break;case 29:e.prev=29,e.t1=e.catch(22),console.log(e.t1);case 32:case"end":return e.stop()}}),e,null,[[1,14,17,20],[22,29]])})));return function(){return e.apply(this,arguments)}}(),$=function(){var e=Object(N.a)(D.a.mark((function e(){var t;return D.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),e.prev=1,e.next=4,wp.apiFetch({method:"POST",url:prestoPlayer.root+prestoPlayer.prestoVersionString+"audio-preset",data:ce(ce({},{name:P}),I)});case 4:if(t=e.sent){e.next=7;break}throw q;case 7:a(t),n(),o&&o(t),Object(B.d)({message:ie("Preset created!","presto-player")}),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),g(null!==e.t0&&void 0!==e.t0&&e.t0.message?e.t0.message:q);case 16:return e.prev=16,v(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[1,13,16,19]])})));return function(){return e.apply(this,arguments)}}(),J=[{name:"controls",title:ie("Controls","presto-player"),icon:Object(L.b)(de,{icon:"admin-settings"}),component:Object(L.b)(ee,{updateState:Q,state:I})},{name:"behavior",title:ie("Behavior","presto-player"),icon:Object(L.b)(de,{icon:"admin-generic"}),component:Object(L.b)(K,{updateState:Q,state:I})},{name:"style",title:ie("Style","presto-player"),icon:Object(L.b)(de,{icon:"admin-customizer"}),component:Object(L.b)(re,{updateState:Q,state:I})},{name:"email",title:ie("Email Capture","presto-player"),icon:Object(L.b)(de,{icon:"email"}),component:Object(L.b)(oe.a,{updateState:Q,state:I})},{name:"cta",title:ie("Call To Action","presto-player"),icon:Object(L.b)(de,{icon:"megaphone"}),component:Object(L.b)(ae.a,{updateState:Q,state:I})},{name:"action_bar",title:ie("Action Bar","presto-player"),icon:Object(L.b)(de,{icon:"cover-image"}),component:Object(L.b)(ne.a,{updateState:Q,state:I,value:Y,setValue:G})}];return Object(L.b)(Oe,{title:ie("edit"==r?"Edit A Audio Preset":"Create A New Audio Preset","presto-player"),onRequestClose:n,className:"presto-player__modal-presets",overlayClassName:"presto-player__modal-presets-overlay"},Object(L.b)("div",{className:"presto-player__preset-options","data-cy":"preset-modal"},Object(L.b)(pe,{value:P,hideLabelFromVision:!0,label:ie("Preset Name","presto-player"),onChange:function(e){return C(e)},placeholder:ie("Enter a preset name...","presto-player"),className:"presto-player__modal--style-name",autoFocus:!0}),Object(L.b)(ye,{align:"stretch",className:"presto-player__style-preview-area"},Object(L.b)(ve,{className:"presto-player__style-sidebar"},Object(L.b)("div",null,Object(L.b)(A.a,{items:J,title:ie("Customize","presto-player"),onSelect:E},(function(e){return e.component})))),Object(L.b)(he,{className:"presto-player__style-preview-panel"},Object(L.b)("div",{style:{position:"absolute",top:0,left:0,padding:"20px"}},Object(L.b)(fe,{label:ie("Skin","presto-player"),labelPosition:"side",value:null==I?void 0:I.skin,hideLabelFromVision:!0,options:[{label:ie("Basic","presto-player"),value:"default"},{label:ie("Stacked","presto-player"),value:"stacked"}],onChange:function(e){Q({skin:e})}})),Object(L.b)(W,{poster:p.poster,src:p.src,state:I,branding:V,menu:_,mediaTitle:p.title}))),Object(L.b)("br",null),O&&Object(L.b)(ue,null,Object(L.b)(be,{className:"presto-player__modal--error-notice",status:"error",isDismissible:!1,style:{margin:0}},O.replace(/(<([^>]+)>)/gi,""))),Object(L.b)("div",{css:Object(L.a)(M||(M=Object(S.a)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n "])))},Object(L.b)("div",{css:Object(L.a)(z||(z=Object(S.a)(["\n opacity: 0.5;\n font-size: 12px;\n "])))},"Preset ID: ",d.id),Object(L.b)("div",null,Object(L.b)(me,{isTertiary:!0,onClick:n,style:{margin:"0 6px"}},ie("Cancel","presto-player")),Object(L.b)(me,{isPrimary:!0,isBusy:y,disabled:y,onClick:function(){if(P)return"edit"===r?X():$();g(ie("You must enter a name for the preset.","presto-player"))},"data-cy":"submit-preset"},ie("edit"==r?"Update Preset":"Create Preset","presto-player"))))))},Pe=wp.i18n.__,Ce=wp.components,xe=Ce.Icon,Se=Ce.Spinner,Ne=Ce.Modal,Te=Ce.Button,De=Ce.ButtonGroup,Be=wp.element.useState,Ae=function(e){var t,r,n=e.preset,a=e.index,o=e.isActive,c=e.remove,i=e.setPreset,s=e.onEdit,p=Be(!1),u=Object(l.a)(p,2),d=u[0],b=u[1],m=Be(!1),y=Object(l.a)(m,2),v=y[0],f=y[1],h=function(){return f(!1)},O=function(){var e=Object(N.a)(D.a.mark((function e(){return D.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.id){e.next=3;break}return c(n),e.abrupt("return");case 3:return e.prev=3,b(!0),e.next=7,wp.apiFetch({method:"POST",url:wp.url.addQueryArgs("".concat(prestoPlayer.root).concat(prestoPlayer.prestoVersionString,"audio-preset/").concat(n.id),{_method:"DELETE"})});case 7:e.sent&&(c(n),wp.data.dispatch("core/notices").createNotice("success",Pe("Preset trashed.","presto-player"),{type:"snackbar",isDismissible:!0})),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(3),console.error(e.t0),null!==e.t0&&void 0!==e.t0&&e.t0.message&&wp.data.dispatch("core/notices").createNotice("error",e.t0.message,{type:"snackbar",isDismissible:!0});case 15:return e.prev=15,f(!1),b(!1),e.finish(15);case 19:case"end":return e.stop()}}),e,null,[[3,11,15,19]])})));return function(){return e.apply(this,arguments)}}();return d?React.createElement("div",{className:"block-editor-block-styles__item",role:"button",tabIndex:a,"aria-label":"Fill",style:{color:o?"var(--wp-admin-theme-color)":"inherit"}},React.createElement("div",{className:"block-editor-block-styles__item-preview",style:{border:o?"2px solid var(--wp-admin-theme-color)":"2px solid #e3e3e3",margin:0,display:"flex","align-items":"center","justify-content":"center"}},React.createElement(Se,null))):React.createElement("div",{className:"block-editor-block-styles__item presto-preset-".concat(n.slug),onClick:function(){i(n)},role:"button",tabIndex:a,"aria-label":"Fill",style:{color:o?"var(--wp-admin-theme-color)":"inherit"}},React.createElement("div",{className:"block-editor-block-styles__item-preview",style:{border:o?"2px solid var(--wp-admin-theme-color)":"2px solid #e3e3e3",margin:0}},React.createElement("div",{style:{textAlign:"center",width:"100%",color:o?"var(--wp-admin-theme-color)":"inherit",opacity:o?1:.75}},null!=n&&n.icon?React.createElement(xe,{icon:null==n?void 0:n.icon,style:{fontSize:"30px",width:"30px",height:"30px"}}):React.createElement("h1",{style:{opacity:.75}},(null==n||null===(t=n.name)||void 0===t||null===(r=t.charAt(0))||void 0===r?void 0:r.toUpperCase())||"Untitled"))),React.createElement("div",{className:"block-editor-block-styles__item-label",style:{fontWeight:"bold",textTransform:"capitalize"}},(null==n?void 0:n.name)||"Untitled"),!(null!=n&&n.is_locked)&&React.createElement("div",{className:"block-editor-block-styles__item-edit"},React.createElement("div",{className:"block-editor-block-styles__item-edit-icon",onClick:s},React.createElement(xe,{icon:"edit"})),React.createElement("div",{className:"block-editor-block-styles__item-edit-icon",onClick:function(){return f(!0)}},React.createElement(xe,{icon:"trash"}))),v&&React.createElement(Ne,{title:Pe("Trash Preset?","presto-player"),onRequestClose:h,style:{maxWidth:"250px"}},React.createElement("p",null,React.createElement("strong",null,Pe("Warning!","presto-player")," "),Pe("Any audios assigned to this preset will automatically use the default preset.","presto-player")),React.createElement(De,null,React.createElement(Te,{isDestructive:!0,onClick:O,style:{margin:"0 4px"}},Pe("Trash","presto-player")),React.createElement(Te,{isTertiary:!0,onClick:h,style:{margin:"0 4px",boxShadow:"none"}},Pe("Cancel","presto-player")))))},Le=wp.i18n.__,Ie=wp.components,Fe=Ie.withNotices,Ve=Ie.BaseControl,Ue=Ie.Spinner,Me=Ie.Button,ze=wp.element,We=ze.useState,He=(ze.useEffect,wp.data),Ye=He.useSelect,Ge=He.dispatch;var qe=Fe((function(e){var t,r=e.attributes,n=e.setAttributes,a=We(!1),o=Object(l.a)(a,2),c=o[0],i=o[1],s=function(){return i(!1)},p=We(null),u=Object(l.a)(p,2),d=u[0],b=u[1],m=We(null),y=Object(l.a)(m,2),v=y[0],h=y[1],O=Ye((function(e){return{presets:e("presto-player/player").getAudioPresets(),loading:e("presto-player/player").isResolving("getAudioPresets")}})),g=O.presets,j=O.loading,w=function(e){Ge("presto-player/player").addAudioPreset(e)},_=function(e){Ge("presto-player/player").removeAudioPreset(e)},E=function(e){n({preset:e.id})};return j?React.createElement("div",{className:"presto-settings__loading"},React.createElement(Ue,null)):React.createElement(React.Fragment,null,g.length?React.createElement("p",null,Le("Select a audio configuration preset, or add your own.","presto-player")):"",React.createElement(Ve,null,React.createElement("div",{className:"block-editor-block-styles"},(g||[]).length?g.map((function(e,t){return React.createElement(Ae,{setPreset:E,index:t,isActive:(null==r?void 0:r.preset)===e.id,preset:e,key:e.id,onEdit:function(){h(e.name),b(e),i("edit")},remove:_})})):Le("No style presets. You can create a new style by clicking 'Add New Style'.","presto-plugin"))),React.createElement(Ve,null,React.createElement(Me,{isPrimary:!0,"data-cy":"add-new-preset",onClick:function(){var e;null!==(e=prestoPlayer)&&void 0!==e&&e.isPremium?i("new"):Ge("presto-player/player").setProModal(!0)}},Le("Add New Preset","presto-player")),!(null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium)&&React.createElement(f.a,null)),"new"==c&&React.createElement(ke,{closeModal:s,addPreset:w,type:"new",onSave:E,attributes:r}),"edit"==c&&React.createElement(ke,{closeModal:s,addPreset:w,updatePreset:function(e){Ge("presto-player/player").updateAudioPreset(e)},type:"edit",preset:d,name:v,attributes:r}))})),Ze=["image"];var Ke=function e(t){var r,n,a=t.attributes,l=t.setAttributes,c=Object(C.useInstanceId)(e),i="audio-block__poster-image-description-".concat(c),s=a.autoplay,u=a.poster,d=a.preload,m=a.title;return React.createElement(React.Fragment,null,React.createElement(p.PanelBody,{title:React.createElement(React.Fragment,null,Object(o.__)("Title","presto-player")," "),initialOpen:!0},React.createElement(p.FlexBlock,null,React.createElement(p.TextControl,{className:"presto-player__caption--title",placeholder:Object(o.__)("Title","presto-player"),value:m||"",onChange:function(e){return l({title:e})},autoComplete:"off"}))),React.createElement(p.PanelBody,{title:React.createElement(React.Fragment,null,Object(o.__)("Chapters","presto-player")," ",!(null!==(r=prestoPlayer)&&void 0!==r&&r.isPremium)&&React.createElement(f.a,null)),initialOpen:null===(n=prestoPlayer)||void 0===n?void 0:n.isPremium},React.createElement(x.a,{setAttributes:l,attributes:a})),React.createElement(p.PanelBody,{title:React.createElement(React.Fragment,null,Object(o.__)("Audio Settings","presto-player")," ")},React.createElement(p.ToggleControl,{label:React.createElement(React.Fragment,null,Object(o.__)("Autoplay","presto-player")," "),checked:s,onChange:function(e){l({autoplay:e})}}),React.createElement(p.PanelRow,null,React.createElement(p.SelectControl,{label:React.createElement(p.Flex,null,React.createElement("div",null,Object(o.__)("Performance Preference","presto-player")),React.createElement("a",{href:"https://prestoplayer.com/docs/performance-preferences-explained",target:"_blank",style:{textDecoration:"none"}},React.createElement(p.Icon,{icon:"editor-help"}))),className:"presto-setting__preload",value:d,onChange:function(e){return l({preload:e})},options:[{value:"auto",label:Object(o.__)("Audio Playback Speed","presto-player")},{value:"metadata",label:Object(o.__)("Page Load Speed","presto-player")},{value:"none",label:Object(o.__)("Page Load Speed (Extreme)","presto-player")}]})),React.createElement(b.MediaUploadCheck,null,React.createElement(p.BaseControl,{className:"editor-video-poster-control"},React.createElement(p.BaseControl.VisualLabel,null,React.createElement("p",null,Object(o.__)("Poster image","presto-player"))),React.createElement(b.MediaUpload,{title:Object(o.__)("Select poster image","presto-player"),onSelect:function(e){l({poster:e.url})},allowedTypes:Ze,render:function(e){var t=e.open;return React.createElement(p.Button,{className:"presto-setting__poster",isPrimary:!0,onClick:t,"aria-describedby":i},u?Object(o.__)("Replace","presto-player"):Object(o.__)("Select","presto-player"))}}),React.createElement("p",{id:i,hidden:!0},u?sprintf(Object(o.__)("The current poster image url is %s","presto-player"),u):Object(o.__)("There is no poster image currently selected","presto-player")),!!u&&React.createElement(p.Button,{onClick:function(){l({poster:""})},className:"presto-setting__remove-poster",isTertiary:!0},Object(o.__)("Remove","presto-player"))))),React.createElement(p.PanelBody,{title:Object(o.__)("Audio Preset","presto-player")},React.createElement(qe,{setAttributes:l,attributes:a})),React.createElement(p.PanelBody,{title:React.createElement(React.Fragment,null,Object(o.__)("Global Player Branding","presto-player")),initialOpen:!1},React.createElement(P.a,{setAttributes:l,attributes:a,type:"audio"})))},Qe=r(33);function Xe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $e(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xe(Object(r),!0).forEach((function(t){Object(a.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Je=wp.data.withSelect;function et(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?et(Object(r),!0).forEach((function(t){Object(a.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):et(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var rt,nt,at=(0,wp.compose.compose)([Je((function(e){return{branding:e("presto-player/player").branding(),loading:e("presto-player/player").isResolving("getAudioPresets"),presets:e("presto-player/player").getAudioPresets(),defaultPreset:e("presto-player/player").getDefaultAudioPreset()}})),Object(C.createHigherOrderComponent)((function(e){return function(t){var r=t.presets,n=t.attributes,a=t.setAttributes,c=t.defaultPreset,i=t.isSelected,s=t.branding,p=Object(u.useState)({}),b=Object(l.a)(p,2),m=b[0],y=b[1],v=Object(u.useState)(1),f=Object(l.a)(v,2),h=f[0],O=f[1],g=n.poster,j=n.chapters;Object(u.useEffect)((function(){i&&null!=n&&n.id&&Object(d.dispatch)("core/edit-post").openGeneralSidebar("edit-post/block")}),[i]),Object(u.useEffect)((function(){i&&null!=n&&n.selectionOverrideClientId&&Object(d.dispatch)("core/block-editor").selectBlock(null==n?void 0:n.selectionOverrideClientId)}),[i]),Object(u.useEffect)((function(){if(r&&r.length){var e=r.find((function(e){return e.id===(null==n?void 0:n.preset)}));e?y(e):(y(c),a({preset:null==c?void 0:c.id}))}}),[r,null==n?void 0:n.preset]),Object(u.useEffect)((function(){w()}),[g,m,j,s.logo]);var w=function(){O(h+1)},E=Object(B.f)(j);Object(u.useEffect)((function(){var e=null==j?void 0:j.map((function(e){return e.time})),t=null==E?void 0:E.map((function(e){return e.time}));_.difference(e,t).length&&w()}),[j]);var R=function(){var e=Object(N.a)(D.a.mark((function e(t){var r,n,o,l,c,i,s;return D.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.src,n=t.external_id,o=t.attachment_id,l=t.type,c=t.title,r||n||o){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,Object(Qe.a)({method:"POST",path:"/presto-player/v1/videos",data:$e($e({attachment_id:o,post_id:wp.data.select("core/editor").getCurrentPostId(),external_id:n},c?{title:c}:{}),{},{src:r,type:l})});case 5:i=e.sent,s=i.id,a({id:s});case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return null!=n&&n.preset||a({preset:null==c?void 0:c.id}),React.createElement(e,Object.assign({},t,{lockSave:function(){return Object(d.dispatch)("core/editor").lockPostSaving("presto-player")},unlockSave:function(){return Object(d.dispatch)("core/editor").unlockPostSaving("presto-player")},createVideo:R,onUpdate:w,onRemoveSrc:function(){confirm(Object(o.__)("Remove this","presto-player"))&&a({src:"",id:void 0})},presetData:m,setPresetData:y,renderKey:h}))}}),"withPlayerEdit")])(Object(p.withNotices)((function(e){var t=e.attributes,r=e.setAttributes,n=e.branding,a=e.presetData,l=e.renderKey,c=e.defaultPreset,i=e.lockSave,s=e.unlockSave,u=e.loading,d=e.createVideo,b=e.onRemoveSrc,m=t.poster,y=t.src,v=t.id;return y?u||!v?React.createElement(p.Placeholder,{className:"presto-player__placeholder is-loading"},React.createElement(p.Spinner,null)):React.createElement(React.Fragment,null,React.createElement(k.BlockControls,null,React.createElement(p.Toolbar,null,React.createElement(p.Button,{onClick:function(){return b()}},Object(o.__)("Replace","presto-player")))),React.createElement(k.InspectorControls,null,React.createElement(Ke,{attributes:t,setAttributes:r})),React.createElement("figure",null,React.createElement(p.Disabled,null,React.createElement(F.a,{poster:m,src:y,id:v,type:"audio",attributes:t,setAttributes:r,preset:a,branding:n,key:l})))):React.createElement(React.Fragment,null,React.createElement(R,{attributes:t,setAttributes:r,onSelectURL:function(e){r(tt(tt({},t),{},{src:e,title:e,preset:null==c?void 0:c.id})),i(),d({src:e,type:"link"}).catch((function(e){r({src:""}),showNotice(e)})).finally(s)},onSelect:function(e){e&&e.url?e.title?(r({src:e.url,preset:null==c?void 0:c.id,title:e.title,attachment_id:e.id}),i(),d({src:e.url,type:"attachment",attachment_id:e.id}).catch((function(e){r({src:""}),showNotice(e)})).finally(s)):r({src:e.url,title:e.url,preset:null==c?void 0:c.id}):r({src:void 0,id:void 0})}}))}))),ot="presto-player/audio",lt={category:"presto",attributes:(rt={src:{type:"string"},autoplay:{type:Boolean,default:!1},poster:{type:"string"},chapters:{type:"array",default:[]},preload:{type:"string"},title:{type:"string"},tracks:{type:"array",items:{type:"object"},default:[]},preset:{type:Number},id:{type:Number},attachment_id:{type:Number}},Object(a.a)(rt,"src",{type:String}),Object(a.a)(rt,"visibility",{type:String,default:"public"}),rt),title:Object(o.__)("Presto Audio","presto-player"),description:Object(o.__)("A audio player wrapper.","presto-player"),variations:[{name:"public",isDefault:!0,title:Object(o.__)("Presto Audio","presto-player"),description:Object(o.__)("Presto self-hosted audio block.","presto-player"),attributes:{visibility:"public"}}].concat(Object(n.a)(null!==(nt=prestoPlayer)&&void 0!==nt&&nt.isPremium?[{name:"private",title:Object(o.__)("Presto Private Audio","presto-player"),icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),React.createElement("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})),description:Object(o.__)("Private self-hosted audio block.","presto-player"),attributes:{visibility:"private"}}]:[])),icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"presto-block-icon"},React.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"})),edit:at}},function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"getPresets",(function(){return v})),r.d(n,"getAudioPresets",(function(){return f})),r.d(n,"getPreset",(function(){return h})),r.d(n,"getReusableVideos",(function(){return O})),r.d(n,"getReusableVideo",(function(){return g})),r.d(n,"getDefaultPreset",(function(){return j})),r.d(n,"getDefaultAudioPreset",(function(){return w})),r.d(n,"presetsLoading",(function(){return _})),r.d(n,"branding",(function(){return E})),r.d(n,"playerCSS",(function(){return R})),r.d(n,"youtube",(function(){return k})),r.d(n,"proModal",(function(){return P}));var a={};r.r(a),r.d(a,"setPresetLoading",(function(){return x})),r.d(a,"setVideosLoading",(function(){return S})),r.d(a,"setProModal",(function(){return N})),r.d(a,"setVideos",(function(){return T})),r.d(a,"updateVideos",(function(){return D})),r.d(a,"appendVideos",(function(){return B})),r.d(a,"addVideo",(function(){return A})),r.d(a,"setPresets",(function(){return L})),r.d(a,"addPreset",(function(){return I})),r.d(a,"updatePreset",(function(){return F})),r.d(a,"removePreset",(function(){return V})),r.d(a,"setAudioPresets",(function(){return U})),r.d(a,"addAudioPreset",(function(){return M})),r.d(a,"updateAudioPreset",(function(){return z})),r.d(a,"removeAudioPreset",(function(){return W})),r.d(a,"setBranding",(function(){return H})),r.d(a,"updateBranding",(function(){return Y})),r.d(a,"saveOptions",(function(){return G})),r.d(a,"fetchOptions",(function(){return q})),r.d(a,"fetchFromAPI",(function(){return Z})),r.d(a,"fetchFromWPAPI",(function(){return K})),r.d(a,"setYoutube",(function(){return Q})),r.d(a,"updateYoutube",(function(){return X})),r.d(a,"setPresetSettings",(function(){return $})),r.d(a,"setPresetAudioSettings",(function(){return J}));var o=r(5),l=r(8);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){Object(o.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var s=wp.data,p=s.combineReducers,u=s.dispatch,d=wp.apiFetch,b=lodash.pick,m=function(e,t){return e.find((function(e){return e.id===t.id}))?e:[].concat(Object(l.a)(e),[t])},y=p({presetReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_PRESET":return t.value;case"ADD_PRESET":return[].concat(Object(l.a)(e),[t.value]);case"UPDATE_PRESET":return e.map((function(e,r){var n;return e.id!==(null===(n=t.value)||void 0===n?void 0:n.id)?e:i(i({},e),t.value)}));case"REMOVE_PRESET":return e.filter((function(e){return e!==t.value}))}return e},audioPresetReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_AUDIO_PRESET":case"SET_AUDIO_PRESET":return t.value;case"ADD_AUDIO_PRESET":return[].concat(Object(l.a)(e),[t.value]);case"UPDATE_AUDIO_PRESET":return e.map((function(e,r){var n;return e.id!==(null===(n=t.value)||void 0===n?void 0:n.id)?e:i(i({},e),t.value)}));case"REMOVE_AUDIO_PRESET":return e.filter((function(e){return e!==t.value}))}return e},presetLoadingReducer:function(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"SET_PRESET_LOADING":return e.value}},videosLoadingReducer:function(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"SET_VIDEOS_LOADING":return e.value}},videosReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{total:0,total_pages:0,videos:[],hasResolved:!1,isError:!1},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_VIDEOS":return t.value;case"UPDATE_VIDEOS":return i(i({},e),t.value);case"APPEND_VIDEOS":var r=e;return(t.value||[]).forEach((function(e){r.videos=m(r.videos,e)})),r;case"ADD_VIDEO":return i(i({},e),{},{videos:m(e.videos,t.value)});case"UPDATE_VIDEO":return i(i({},e),{},{videos:e.videos.map((function(e,r){var n;return e.id!==(null===(n=t.value)||void 0===n?void 0:n.id)?e:i(i({},e),t.value)}))});case"REMOVE_VIDEO":return i(i({},e),{},{videos:e.videos.filter((function(e){return e!==t.value}))})}return e},proModalReducer:function(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"SET_PRO_MODAL":return e.value}},brandingReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_BRANDING":return t.value;case"UPDATE_BRANDING":return i(i({},e),{},Object(o.a)({},t.name,t.value))}return e},youtubeReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_YOUTUBE":return t.value;case"UPDATE_YOUTUBE":return i(i({},e),{},Object(o.a)({},t.name,t.value))}return e},presetSettingsReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_PRESET_SETTINGS":return t.value}return e},optionsApi:function(e,t){switch(t.type){case"FETCH_OPTIONS":return d({path:"/presto-player/v1/settings/"}).then((function(e){u("presto-player/player").setBranding(e.presto_player_branding),u("presto-player/player").setYoutube(e.presto_player_youtube),u("presto-player/player").setPresetSettings(e.presto_player_presets),u("presto-player/player").setPresetAudioSettings(e.presto_player_audio_presets)}));case"SAVE_OPTIONS":var r={presto_player_branding:b(null==t?void 0:t.branding,["logo","color","logo_width","player_css"])};return Object.keys(r).forEach((function(e){return(null==r[e]||!Object.keys((null==r?void 0:r[e])||{}).length)&&delete r[e]})),d({path:"/presto-player/v1/settings",method:"POST",data:r}),r}},audioPresetSettingsReducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_PRESET_AUDIO_SETTINGS":return t.value}return e}});function v(e){return(null==e?void 0:e.presetReducer)||[]}function f(e){return(null==e?void 0:e.audioPresetReducer)||[]}function h(e,t){var r;return null!=e&&null!==(r=e.presetReducer)&&void 0!==r&&r.length?null==e?void 0:e.presetReducer.find((function(e){return e.id===t})):[]}function O(e){return(null==e?void 0:e.videosReducer)||[]}function g(e,t){var r,n;return(null==e||null===(r=e.videosReducer)||void 0===r||null===(n=r.videos)||void 0===n?void 0:n.find((function(e){return(null==e?void 0:e.id)===t})))||[]}function j(e){var t,r=null==e||null===(t=e.presetSettingsReducer)||void 0===t?void 0:t.default_player_preset,n=r&&((null==e?void 0:e.presetReducer)||[]).find((function(e){return e.id&&e.id===r}));return n||(n=((null==e?void 0:e.presetReducer)||[]).find((function(e){return"default"==e.slug}))),n||(n=((null==e?void 0:e.presetReducer)||[])[0]),n}function w(e){var t,r=null==e||null===(t=e.audioPresetSettingsReducer)||void 0===t?void 0:t.default_player_preset,n=r&&((null==e?void 0:e.audioPresetReducer)||[]).find((function(e){return e.id&&e.id===r}));return n||(n=((null==e?void 0:e.audioPresetReducer)||[]).find((function(e){return"default"==e.slug}))),n||(n=((null==e?void 0:e.audioPresetReducer)||[])[0]),n}function _(e){return!(null==e||!e.presetLoadingReducer)}function E(e){return null==e?void 0:e.brandingReducer}function R(e){var t;return null==e||null===(t=e.brandingReducer)||void 0===t?void 0:t.player_css}function k(e){return null==e?void 0:e.youtubeReducer}function P(e){return null==e?void 0:e.proModalReducer}function C(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){return{type:"SET_PRESET_LOADING",value:e}}function S(e){return{type:"SET_VIDEOS_LOADING",value:e}}function N(e){return{type:"SET_PRO_MODAL",value:e}}function T(e){return{type:"SET_VIDEOS",value:e}}function D(e){return{type:"UPDATE_VIDEOS",value:e}}function B(e){return{type:"APPEND_VIDEOS",value:e}}function A(e){return{type:"ADD_VIDEO",value:e}}function L(e){return{type:"SET_PRESET",value:e}}function I(e){return{type:"ADD_PRESET",value:e}}function F(e){return{type:"UPDATE_PRESET",value:e}}function V(e){return{type:"REMOVE_PRESET",value:e}}function U(e){return{type:"SET_AUDIO_PRESET",value:e}}function M(e){return{type:"ADD_AUDIO_PRESET",value:e}}function z(e){return{type:"UPDATE_AUDIO_PRESET",value:e}}function W(e){return{type:"REMOVE_AUDIO_PRESET",value:e}}function H(e){return{type:"SET_BRANDING",value:e}}function Y(e,t){return{type:"UPDATE_BRANDING",name:e,value:t}}function G(e){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?C(Object(r),!0).forEach((function(t){Object(o.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({type:"SAVE_OPTIONS"},e)}function q(){return{type:"FETCH_OPTIONS"}}function Z(e){return{type:"FETCH_FROM_API",path:e}}function K(e,t){return{type:"FETCH_FROM_WP_API",path:e,args:t}}function Q(e){return{type:"SET_YOUTUBE",value:e}}function X(e,t){return{type:"UPDATE_YOUTUBE",name:e,value:t}}function $(e){return{type:"SET_PRESET_SETTINGS",value:e}}function J(e){return{type:"SET_PRESET_AUDIO_SETTINGS",value:e}}var ee=r(7),te=r(2),re=r.n(te);function ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ae(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(r),!0).forEach((function(t){Object(o.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ne(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var oe=wp.apiFetch,le={FETCH_FROM_API:function(e){return oe({url:prestoPlayer.root+prestoPlayer.prestoVersionString+e.path})},FETCH_FROM_WP_API:function(e){return Object(ee.a)(re.a.mark((function t(){var r,n,a,o,l,c,i;return re.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.args,n=e.path,a=void 0===n?"":n,t.next=3,oe(ae(ae(ae({path:wp.url.addQueryArgs("wp/v2/".concat(a),null==r?void 0:r.query)},null!=r&&r.data?{data:r.data}:{}),null==r?void 0:r.options),{},{parse:!1}));case 3:return o=t.sent,t.next=6,o.json();case 6:return l=t.sent,c=o.headers&&o.headers.get("X-WP-Total"),i=o.headers&&o.headers.get("X-WP-TotalPages"),t.abrupt("return",new Promise((function(e,t){e({data:l,total:c,total_pages:i})})));case 10:case"end":return t.stop()}}),t)})))()}},ce={getPresets:re.a.mark((function e(){var t;return re.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Z("preset");case 2:return t=e.sent,e.abrupt("return",L(t));case 4:case"end":return e.stop()}}),e)})),getAudioPresets:re.a.mark((function e(){var t;return re.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Z("audio-preset");case 2:return t=e.sent,e.abrupt("return",U(t));case 4:case"end":return e.stop()}}),e)})),getReusableVideo:re.a.mark((function e(t){var r,n;return re.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="presto-videos/".concat(t),e.next=3,K(r,{});case 3:return n=e.sent,e.abrupt("return",A((null==n?void 0:n.data)||{}));case 5:case"end":return e.stop()}}),e)}))},ie=(0,wp.data.registerStore)("presto-player/player",{reducer:y,selectors:n,actions:a,controls:le,resolvers:ce}),se=r(10),pe=wp.components,ue=pe.Modal,de=pe.Button,be=wp.data,me=be.dispatch,ye=be.useSelect,ve=function(){return ye((function(e){return e("presto-player/player").proModal()}))?React.createElement(ue,{title:"Pro Feature",onRequestClose:function(){me("presto-player/player").setProModal(!1)}},React.createElement("h2",null,"Unlock Presto Player ",React.createElement(se.a,null)),React.createElement("p",null,"Get this feature and more with the Pro version of Presto Player!"),React.createElement(de,{href:"https://prestoplayer.com",target:"_blank",isPrimary:!0},"Learn More")):""},fe=wp.blocks,he=fe.registerBlockType,Oe=fe.unregisterBlockType,ge=wp.plugins,je=ge.registerPlugin,we=ge.unregisterPlugin,_e=wp.data,Ee=_e.select,Re=_e.dispatch,ke=wp.element.render,Pe=function(){return null},Ce=function(e){var t=e.getContext,r=e.register,n=e.unregister,a=e.before,o=void 0===a?Pe:a,l=e.after,c=void 0===l?Pe:l,i={};!function(){o();var e=t(),a=[];e.keys().forEach((function(t){var o=e(t);o!==i[t]&&(i[t]&&n(i[t]),r(o),a.push(o.name),i[t]=o)})),c(a)}()},xe=null;Ce({getContext:function(){return r(59)},register:function(e){var t,r=e.name,n=e.options;null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium?he(r,n):n.premium||he(r,n)},unregister:function(e){var t=e.name;return Oe(t)},before:function(){xe=Ee("core/editor").getSelectedBlockClientId(),Re("core/editor").clearSelectedBlock()},after:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Ee("core/editor").getBlocks().forEach((function(t){var r=t.name,n=t.clientId;e.includes(r)&&Re("core/editor").selectBlock(n)})),xe?Re("core/editor").selectBlock(xe):Re("core/editor").clearSelectedBlock(),xe=null}}),Ce({getContext:function(){return r(68)},register:function(e){var t=e.name,r=e.options;return je(t,r)},unregister:function(e){var t=e.name;return we(t)}}),jQuery("body").append('<div id="presto-plugin-app"></div>'),ke(React.createElement(ve,null),document.getElementById("presto-plugin-app")),Re("presto-player/player").fetchOptions();var Se=!1;wp.data.subscribe((function(){var e=wp.data.select("core/editor").isSavingPost(),t=wp.data.select("core/editor").isAutosavingPost();if(e&&!t){if(Se)return;Se=!0;var r=ie.getState().brandingReducer;Re("presto-player/player").saveOptions({branding:r}).then((function(){Se=!1}))}}))},function(e,t,r){"use strict";r.r(t),r.d(t,"name",(function(){return W})),r.d(t,"options",(function(){return H}));var n=r(7),a=r(1),o=r(2),l=r.n(o),c=(r(19),wp.compose.useInstanceId),i=wp.i18n.__,s=wp.components,p=s.VisuallyHidden,u=s.Button,d=s.Icon,b=wp.element.useRef;var m=function e(t){t.className;var r=t.onChange,n=t.value,a=t.placeholder,o=c(e),l=b();return React.createElement("div",{className:"block-editor-inserter__search",style:{padding:0}},React.createElement(p,{as:"label",htmlFor:"block-editor-inserter__search-".concat(o)},a),React.createElement("input",{ref:l,className:"block-editor-inserter__search-input",id:"block-editor-inserter__search-".concat(o),type:"search",placeholder:a,onChange:function(e){return r(e.target.value)},autoComplete:"off",value:n||""}),React.createElement("div",{className:"block-editor-inserter__search-icon"},!!n&&React.createElement(u,{icon:"close-small",label:i("Reset search","presto-player"),onClick:function(){r(""),l.current.focus()}}),!n&&React.createElement(d,{icon:"search"})))},y=r(3),v=r(4);function f(e){return h.apply(this,arguments)}function h(){return(h=Object(n.a)(l.a.mark((function e(t){var r,n,a,o;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=document.getElementById("presto-shortcode-input").value,n=t.currentTarget,a=n.textContent,t.currentTarget.textContent=Object(y.__)("Copied!","presto-player"),setTimeout((function(){n.textContent=a}),1500),!navigator.clipboard||!window.isSecureContext){e.next=9;break}return e.abrupt("return",navigator.clipboard.writeText(r));case 9:return(o=document.createElement("textarea")).value=r,o.style.position="fixed",o.style.left="-999999px",o.style.top="-999999px",document.body.appendChild(o),o.focus(),o.select(),e.abrupt("return",new Promise((function(e,t){document.execCommand("copy")?e():t(),o.remove()})));case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var O=function(){return React.createElement(v.PanelBody,{title:Object(y.__)("Timestamp Shortcode","presto-player")},React.createElement("div",{className:"block-editor-inserter__shortcode-input"},React.createElement("p",null,Object(y.__)("Add convenient links to skip the player to a specific timestamp.","presto-player")),React.createElement("input",{id:"presto-shortcode-input",style:{width:"100%",fontSize:"11px",marginBottom:"10px"},type:"text",readOnly:!0,value:'[pptime time="1:00"]Optional Text[/pptime]'}),React.createElement("button",{type:"button",className:"components-button is-primary",onClick:f},Object(y.__)("Copy to clipboard","presto-player"))))},g=function(e){var t=e.icon,r=e.title,n=e.id,a=e.selectBlock,o=e.i;return React.createElement("button",{type:"button",id:"video-".concat(n),tabIndex:o,onClick:a,role:"option",className:"components-button block-editor-block-types-list__item editor-block-list-item-kadence-spacer"},React.createElement("span",{className:"block-editor-block-types-list__item-icon"},React.createElement("span",{className:"block-editor-block-icon has-colors"},t)),React.createElement("span",{className:"block-editor-block-types-list__item-title"},r))},j=wp.i18n.__,w=wp.components,E=(w.Panel,w.PanelBody),R=w.Button,k=w.Spinner,P=wp.editPost,C=P.PluginSidebar,x=P.PluginSidebarMoreMenuItem,S=wp.element,N=S.Fragment,T=S.useEffect,D=S.useState,B=S.useCallback,A=wp.data,L=A.dispatch,I=A.useSelect,F=wp.blocks,V=F.createBlock,U=F.getBlockType,M=wp.apiFetch,z=wp.blockSerializationDefaultParser.parse;var W="presto-player",H={render:function(){var e,t,r,o=(e=D(0),(t=Object(a.a)(e,2))[0],r=t[1],function(){return r((function(e){return e+1}))}),c=React.createElement("svg",{viewBox:"0 0 35 34",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",null,React.createElement("path",{d:"M23.3722 16.9766L33.2059 11.2991L33.2059 22.6541L23.3722 16.9766Z",fillOpacity:"0.7"}),React.createElement("path",{d:"M23.3745 5.6227L33.2082 11.3002L23.3745 16.9776L23.3745 5.6227Z",fillOpacity:"0.75"}),React.createElement("path",{d:"M23.3745 5.62242L23.3745 16.9773L13.5409 11.2999L23.3745 5.62242Z",fillOpacity:"0.8"}),React.createElement("path",{d:"M23.399 5.613L13.5654 11.2905L13.5654 -0.0644536L23.399 5.613Z",fillOpacity:"0.85"}),React.createElement("path",{d:"M13.5699 11.3038L13.5699 22.6587L3.73623 16.9813L13.5699 11.3038Z",fillOpacity:"0.8"}),React.createElement("path",{d:"M13.5699 -0.0245525L13.5699 11.3304L3.73623 5.6529L13.5699 -0.0245525Z",fillOpacity:"0.9"}),React.createElement("path",{d:"M13.5699 22.6451L13.5699 34L3.73623 28.3226L13.5699 22.6451Z",fillOpacity:"0.7"}),React.createElement("path",{d:"M23.3745 16.9774L33.2082 22.6549L23.3745 28.3323L23.3745 16.9774Z",fillOpacity:"0.65"}),React.createElement("path",{d:"M3.73774 16.9774L13.5714 22.6549L3.73774 28.3323L3.73774 16.9774Z",fillOpacity:"0.75"}),React.createElement("path",{d:"M3.73774 5.63149L13.5714 11.3089L3.73774 16.9864L3.73774 5.63149Z",fillOpacity:"0.85"}),React.createElement("path",{d:"M23.3745 16.9772L23.3745 28.3321L13.5409 22.6546L23.3745 16.9772Z",fillOpacity:"0.6"})),React.createElement("defs",null,React.createElement("clipPath",{id:"clip0"},React.createElement("rect",{width:"35",height:"34",fill:"white"})))),i=D(!1),s=Object(a.a)(i,2),p=s[0],u=s[1],d=D(1),b=Object(a.a)(d,2),y=b[0],v=b[1],f=D(!1),h=Object(a.a)(f,2),w=h[0],P=h[1],S=D(""),A=Object(a.a)(S,2),F=A[0],W=A[1],H=B(_.debounce((function(e){K({replace:!0,term:e})}),250),[]);T((function(){H(F)}),[F]),T((function(){P(!0),K({replace:!1})}),[y]);var Y=I((function(e){return e("presto-player/player").getReusableVideos()}),[F,y]),G=Y.videos,q=Y.total_pages,Z=Y.hasResolved,K=function(){var e=Object(n.a)(l.a.mark((function e(t){var r,n,a,c,i,s;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.replace,n=t.term,e.next=3,M({path:wp.url.addQueryArgs("wp/v2/presto-videos",{search:n,page:y,per_page:10}),parse:!1});case 3:return a=e.sent,e.next=6,a.json();case 6:c=e.sent,i=a.headers&&parseInt(a.headers.get("X-WP-Total")),s=a.headers&&parseInt(a.headers.get("X-WP-TotalPages")),r?L("presto-player/player").updateVideos({videos:c,hasResolved:!0,total:i,total_pages:s}):(L("presto-player/player").appendVideos(c),L("presto-player/player").updateVideos({hasResolved:!0,total:i,total_pages:s})),o(),P(!1);case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();T((function(){u(y<q)}),[y,q]);var Q=function(){var e=y+1;v(e=e>q?q:e)},X=function(e){var t,r,n,a,o=z(null==e||null===(t=e.content)||void 0===t?void 0:t.raw);if(null!=o&&null!==(r=o[0])&&void 0!==r&&null!==(n=r.innerBlocks)&&void 0!==n&&null!==(a=n[0])&&void 0!==a&&a.blockName){var l,c,i,s,p=U(null==o||null===(l=o[0])||void 0===l||null===(c=l.innerBlocks)||void 0===c||null===(i=c[0])||void 0===i?void 0:i.blockName);return null!=p&&null!==(s=p.icon)&&void 0!==s&&s.src?p.icon.src:""}return""};return React.createElement(N,null,React.createElement(x,{target:"presto-player-sidebar",icon:c},j("Presto Player","presto-player")),React.createElement(C,{name:"presto-player-sidebar",title:j("Presto Player","presto-player"),icon:c},React.createElement(O,null),React.createElement(E,{title:j("Media Hub","presto-player")},React.createElement(m,{placeholder:"Search media...",value:F,onChange:function(e){return t=e,v(1),void W(t);var t}}),React.createElement("div",{className:"block-editor-inserter__panel-content"},Z?React.createElement("div",{role:"listbox",className:"block-editor-block-types-list presto-player__panel-grid-list",style:{display:"flex",flexWrap:"wrap"},"aria-label":j("Media Hub","presto-player")},G.length?G.map((function(e,t){var r;return React.createElement(g,{selectBlock:function(t){L("core/editor").insertBlock(V("presto-player/reusable-display",{id:null==e?void 0:e.id}))},icon:X(e),title:(null==e||null===(r=e.title)||void 0===r?void 0:r.raw)||"Untitled",id:null==e?void 0:e.id,i:t,key:null==e?void 0:e.id})})):function(){if(!G.length)return F?React.createElement("p",null,j("No videos found.","presto-player")):React.createElement(R,{href:"post-new.php?post_type=pp_video_block",isSecondary:!0},j("Create A Reusable Video","presto-player"))}(),!F&&p&&G.length?React.createElement("div",{style:{"margin-top":"20px","text-align":"center",display:"flex","justify-content":"center",width:"100%"}},React.createElement(R,{isSecondary:!0,isSmall:!0,onClick:Q,isBusy:w},"Load More")):""):React.createElement(k,null)))))}}},function(e,t,r){"use strict";r.r(t),r.d(t,"name",(function(){return ye})),r.d(t,"options",(function(){return ve}));var n=r(8),a=r(5),o=r(1),l=r(18),c=r(20),i=r(21),s=r(19),p=r.n(s),u=r(15),d=(lodash.noop,window.location.href),b=wp.components,m=b.Button,y=(b.Notice,b.Placeholder),v=(b.DropZone,b.withFilters),f=(b.BaseControl,b.ToggleControl,b.FormFileUpload,wp.i18n.__),h=wp.element,O=h.useState,g=h.useEffect,j=wp.data.useSelect,w=(wp.deprecated,wp.editor),_=w.MediaUpload,E=w.MediaUploadCheck,R=w.URLPopover,k=function(e){var t=e.src,r=e.onChange,n=e.onSubmit,a=e.onClose;return React.createElement(R,{onClose:a},React.createElement("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n},React.createElement("input",{"data-cy":"url-input",className:"block-editor-media-placeholder__url-input-field",type:"url","aria-label":f("URL","presto-player"),placeholder:f("Paste or type a Youtube, Vimeo or .mp4 video URL","presto-player"),onChange:r,value:t}),React.createElement(m,{"data-cy":"url-submit",className:"block-editor-media-placeholder__url-input-submit-button",icon:"editor-break",label:f("Apply","presto-player"),type:"submit"})))};var P,C=v("editor.MediaPlaceholder")((function(e){var t=e.value,r=void 0===t?{}:t,n=e.allowedTypes,a=void 0===n?[]:n,l=e.className,c=e.icon,i=e.url,s=void 0===i||i,b=e.labels,v=void 0===b?{}:b,h=e.mediaPreview,w=e.notices,R=e.isAppender,P=e.isPrivate,C=e.addToGallery,x=e.onSelect,S=e.onCancel,N=e.onSelectURL,T=e.onDoubleClick,D=e.children,B=e.allowURLs,A=j((function(e){return(0,e("core/block-editor").getSettings)().mediaUpload}),[]),L=O(""),I=Object(o.a)(L,2),F=I[0],V=I[1],U=O(!1),M=Object(o.a)(U,2),z=M[0],W=M[1];g((function(){var e;V(null!==(e=null==r?void 0:r.src)&&void 0!==e?e:"")}),[r]);var H=function(e){V(e.target.value)},Y=function(){W(!0)},G=function(){W(!1)},q=function(e){e.preventDefault(),F&&N&&(N(F),G())},Z=function(e,t){var r=v.instructions,n=v.title;A||N||(r=f("To edit this block, you need permission to upload media.","presto-player"));var a=p()("block-editor-media-placeholder",l,{"is-appender":R});return React.createElement(y,{icon:c,label:n,instructions:r,className:a,notices:w,onClick:t,onDoubleClick:T,preview:h},D,e)},K=function(){return N&&React.createElement("div",{className:"block-editor-media-placeholder__url-input-container"},s&&React.createElement(m,{"data-cy":"video-url",className:"block-editor-media-placeholder__button",onClick:Y,isPressed:z,isTertiary:!0},f("Video URL","presto-player")),z&&React.createElement(k,{src:F,onChange:H,onSubmit:q,onClose:G}))};return React.createElement(E,{fallback:Z(K())},function(){var e=React.createElement(_,{title:f(P?"Select or Upload Private Video":"Select or Upload Video","presto-player"),addToGallery:C,gallery:!1,multiple:!1,onSelect:function(e){u.a.unsetUrlParams(),x(e)},onClose:function(){u.a.unsetUrlParams()},allowedTypes:a,value:Array.isArray(r)?r.map((function(e){return e.id})):r.id,render:function(e){var t=e.open;return React.createElement(m,{"data-cy":"add-video",isPrimary:!0,onClick:function(e){e.stopPropagation(),u.a.unsetUrlParams(),P?u.a.setUrlPrivate(d):u.a.setUrlPublic(d),t()}},f(P?"Add/Select Private Video":"Add/Select Video","presto-player"))}});if(A){var t=React.createElement(React.Fragment,null,e,!!B&&K(),S&&React.createElement(m,{className:"block-editor-media-placeholder__cancel-button",title:f("Cancel","presto-player"),isLink:!0,onClick:S},f("Cancel","presto-player")));return Z(t)}return Z(e)}())})),x=r(10),S=wp.i18n.__,N=wp.components,T=N.withNotices,D=N.BaseControl,B=N.ToggleControl,A=N.Notice,L=wp.data.dispatch,I=["video"],F=T((function(e){var t,r=e.noticeUI,n=e.onSelect,a=e.children,o=e.onSelectURL,l=e.onUploadError,c=e.setAttributes,i=e.attributes,s="private"===i.visibility;return React.createElement("div",null,React.createElement(C,{icon:s?React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),React.createElement("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})):React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("polygon",{points:"23 7 16 12 23 17 23 7"}),React.createElement("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2",ry:"2"})),labels:{title:S(s?"Presto Private Video":"Presto Video","presto-player"),instructions:S(s?"Upload a video file, or pick one from your media library.":"Upload a video file, pick one from your media library, or add one with a URL.","presto-player")},onSelect:n,onSelectURL:o,switcher:!0,isPrivate:s,allowURLs:!s,accept:"video/*",setAttributes:c,allowedTypes:I,value:i,notices:r,onError:l},React.createElement("div",{style:{width:"100%"}},React.createElement(D,{className:"presto-player__placeholder-control"},React.createElement(B,{label:React.createElement("div",null,S("Make Private","presto-player")," ",!(null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium)&&React.createElement(x.a,null)),help:S(s?"This video is only accessible to those who are logged in.":"This video is currently accessible to everyone.","presto-player"),checked:s,onChange:function(e){var t;null!==(t=prestoPlayer)&&void 0!==t&&t.isPremium?c({visibility:e?"private":"public"}):L("presto-player/player").setProModal(!0)}})),!!a&&React.createElement("div",{style:{width:"100%"}},a),!!s&&React.createElement(A,{status:"warning",isDismissible:!1},React.createElement("div",null,React.createElement("div",null,React.createElement("strong",null,S("Note","presto-player"))),S("Private videos use php to stream your video. Keep in mind this will use up disk space and bandwidth so it may not be an appropriate choice for some hosts.","presto-player"))))))})),V=r(34),U=r(22),M=r(14),z=wp.i18n.__,W=wp.blob,H=W.getBlobByURL,Y=W.isBlobURL,G=wp.components,q=G.Button,Z=G.Disabled,K=G.Toolbar,Q=G.Notice,X=G.withNotices,$=G.Placeholder,J=G.Spinner,ee=wp.editor,te=ee.BlockControls,re=ee.InspectorControls,ne=wp.compose.compose,ae=wp.element,oe=ae.useEffect,le=ae.useState,ce=wp.data.dispatch,ie=wp.blocks.createBlock,se=["video"],pe=ne([Object(i.a)(),Object(c.a)()])(X((function(e){e.noticeUI;var t=e.attributes,r=e.setAttributes,n=(e.isSelected,e.noticeOperations),a=e.branding,c=e.loading,i=e.presetData,s=e.createVideo,p=e.onRemoveSrc,u=e.renderKey,d=e.lockSave,b=e.unlockSave,m=e.clientId,y=e.defaultPreset,v=t.poster,f=t.src,h=t.id,O=t.tracks,g=le(""),j=Object(o.a)(g,2),w=j[0],_=j[1],E=function(e){n.removeAllNotices(),n.createErrorNotice(null==e?void 0:e.message)};return oe((function(){if(!h&&Y(f)){var e=H(f);e&&mediaUpload({filesList:[e],onFileChange:function(e){var t=Object(o.a)(e,1)[0].url;r({src:t})},onError:function(e){n.createErrorNotice(e)},allowedTypes:se})}}),[]),f?c||!h?React.createElement($,{className:"presto-player__placeholder is-loading"},React.createElement(J,null)):React.createElement("div",null,React.createElement(te,null,React.createElement(V.a,{tracks:O,onChange:function(e){r({tracks:e})}}),React.createElement(K,null,React.createElement(q,{onClick:function(){return p()}},z("Replace","presto-player")))),React.createElement(re,null,React.createElement(U.a,{setAttributes:r,attributes:t})),React.createElement("figure",null,React.createElement(Z,null,React.createElement(M.a,{poster:v,src:f,id:h,type:"hosted",attributes:t,setAttributes:r,preset:i,branding:a,key:u})))):React.createElement("div",null,React.createElement(F,{onSelect:function(e){e&&e.url?(r({src:e.url,preset:null==y?void 0:y.id,attachment_id:e.id}),d(),s({src:e.url,type:"attachment",attachment_id:e.id}).catch((function(e){r({src:""}),E(e)})).finally(b)):r({src:void 0,id:void 0})},onSelectURL:function(e){var t;if(r({attachment_id:null}),e&&Object(l.d)(e)&&(null===(t=prestoPlayer)||void 0===t||!t.isPremium))return void _(React.createElement(Q,{status:"info",onRemove:function(){return _("")}},React.createElement("div",null,React.createElement("div",null,React.createElement("strong",null,z("Get HLS Streaming and more with Presto Player Pro!","presto-player"))),z("Stream HLS links and more with Presto Player Pro.","presto-player"),React.createElement("div",{style:{marginTop:"1em"}},React.createElement(q,{isPrimary:!0},z("Upgrade","presto-player"))))));if(e!==f){var n=Object(l.a)(e).type;if("youtube"===n){var a=ie("presto-player/youtube",{src:e});return void ce("core/editor").replaceBlock(m,a)}if("vimeo"===n){var o=ie("presto-player/vimeo",{src:e});return void ce("core/editor").replaceBlock(m,o)}r({src:e,attachmend_id:null}),r({preset:null==y?void 0:y.id}),d(),s({src:e,type:"link"}).catch((function(e){r({src:""}),E(e)})).finally(b)}},setAttributes:r,attributes:t,onError:function(e){n.removeAllNotices(),n.createErrorNotice(e)}},w))}))),ue=r(17);function de(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?de(Object(r),!0).forEach((function(t){Object(a.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):de(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var me=wp.i18n.__,ye="presto-player/self-hosted",ve=be(be({},ue.a),{},{title:me("Presto Video","presto-player"),description:me("Presto Self-hosted video block.","presto-player"),variations:[{name:"public",isDefault:!0,title:me("Presto Video","presto-player"),description:me("Presto Self-hosted video block.","presto-player"),attributes:{visibility:"public"}}].concat(Object(n.a)(null!==(P=prestoPlayer)&&void 0!==P&&P.isPremium?[{name:"private",title:me("Presto Private Video","presto-player"),icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),React.createElement("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})),description:me("Private video self-hosted block.","presto-player"),attributes:{visibility:"private"}}]:[])),icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("polygon",{points:"23 7 16 12 23 17 23 7"}),React.createElement("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2",ry:"2"})),edit:pe})},function(e,t,r){"use strict";r.r(t),r.d(t,"name",(function(){return E})),r.d(t,"options",(function(){return R}));var n=r(1),a=wp.i18n.__,o=wp.blockEditor,l=o.InnerBlocks,c=o.useBlockProps,i=wp.editor,s=(i.BlockControls,i.InspectorControls),p=wp.components,u=p.Disabled,d=(p.Toolbar,p.Button),b=p.PanelBody,m=(p.Panel,p.Placeholder),y=p.Spinner,v=wp.data,f=v.useSelect,h=v.dispatch,O=wp.element,g=O.useState,j=O.useEffect,w=wp.blockSerializationDefaultParser.parse,_=wp.blockEditor,E=(_.InnerBlocks,_.useBlockProps,"presto-player/reusable-display"),R={title:"Reusable Block Display",category:"presto",attributes:{id:Number},supports:{align:!0,inserter:!1,reusable:!1,html:!1},icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("circle",{cx:"12",cy:"12",r:"10"}),React.createElement("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),React.createElement("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})),edit:function(e){var t,r=e.attributes,o=e.isSelected,i=e.clientId,p=r.id,v=c(),O=g(!1),_=Object(n.a)(O,2),E=_[0],R=_[1],k=g([]),P=Object(n.a)(k,2),C=P[0],x=P[1],S=g(""),N=Object(n.a)(S,2),T=N[0],D=N[1],B=f((function(e){if(p)return e("presto-player/player").getReusableVideo(p)}));j((function(){wp.data.dispatch("core/block-editor").selectBlock(i)}),[E]);var A=f((function(e){return e("core/editor").getBlocksByClientId(i)[0].innerBlocks}));return A&&null!=B&&B.id&&A.forEach((function(e){h("core/editor").updateBlockAttributes(e.clientId,{selectionOverrideClientId:i})})),j((function(){if(B.id){var e,t,r;R(!0);var n=w(null==B||null===(e=B.content)||void 0===e?void 0:e.raw);x([null==n||null===(t=n[0])||void 0===t?void 0:t.innerBlocks[0].blockName,null==n||null===(r=n[0])||void 0===r?void 0:r.innerBlocks[0].attrs]),D("post.php?post=".concat(B.id,"&action=edit"))}}),[B]),E?C?React.createElement(React.Fragment,null,React.createElement(s,null,React.createElement(b,null,React.createElement("p",null,"This is a reusable video that you can edit once and place anywhere."),React.createElement(d,{isSecondary:!0,href:"edit.php?post_type=pp_video_block"},a("Manage Media Hub","presto-player")))),React.createElement("div",{className:"block-library-block__reusable-block-container"},React.createElement("div",v,o&&React.createElement("div",{className:"reusable-block-edit-panel"},React.createElement("b",{className:"reusable-block-edit-panel__info"},null==B||null===(t=B.title)||void 0===t?void 0:t.raw),React.createElement(d,{isSecondary:!0,href:T,className:"reusable-block-edit-panel__button"},a("Edit Reusable Video","presto-player"))),React.createElement(u,null,React.createElement(l,{template:[C],templateLock:"all",renderAppender:!1}))))):void 0:React.createElement("div",v,React.createElement(m,null,React.createElement(y,null)))},save:function(){return null}}},function(e,t,r){"use strict";r.r(t),r.d(t,"name",(function(){return C})),r.d(t,"options",(function(){return x}));var n=r(5),a=r(20),o=r(21),l=r(22),c=r(14),i=r(37),s=r(18),p=r(9),u=wp.components,d=u.Button,b=u.Disabled,m=u.Toolbar,y=u.Placeholder,v=u.Spinner,f=u.withNotices,h=wp.editor,O=h.BlockControls,g=h.InspectorControls,j=wp.element.useEffect,w=wp.i18n.__,_=(0,wp.compose.compose)([Object(o.a)(),Object(a.a)()])(f((function(e){var t=e.attributes,r=e.setAttributes,n=e.branding,a=e.noticeOperations,o=e.loading,u=e.createVideo,f=e.lockSave,h=e.unlockSave,_=e.presetData,E=e.onRemoveSrc,R=e.renderKey,k=t.poster,P=t.src,C=t.id,x=Object(p.f)(P);return j((function(){x&&r({id:0});var e=Object(s.b)(P);r({video_id:e}),f(),u({src:P,external_id:e,type:"vimeo"}).catch((function(e){r({src:""}),function(e){a.removeAllNotices(),a.createErrorNotice(null==e?void 0:e.message)}(e)})).finally(h)}),[P]),P?o||!C?React.createElement(y,{className:"presto-player__placeholder is-loading"},React.createElement(v,null)):React.createElement(React.Fragment,null,React.createElement(O,null,React.createElement(m,null,React.createElement(d,{onClick:function(){return E()}},w("Replace","presto-player")))),React.createElement(g,null,React.createElement(l.a,{setAttributes:r,attributes:t})),React.createElement("figure",null,React.createElement(b,null,React.createElement(c.a,{poster:k,src:P,type:"vimeo",id:C,attributes:t,setAttributes:r,preset:_,branding:n,key:R})))):React.createElement("div",null,React.createElement(i.a,{icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"presto-block-icon"},React.createElement("path",{d:"M22.875 10.063c-2.442 5.217-8.337 12.319-12.063 12.319-3.672 0-4.203-7.831-6.208-13.043-.987-2.565-1.624-1.976-3.474-.681l-1.128-1.455c2.698-2.372 5.398-5.127 7.057-5.28 1.868-.179 3.018 1.098 3.448 3.832.568 3.593 1.362 9.17 2.748 9.17 1.08 0 3.741-4.424 3.878-6.006.243-2.316-1.703-2.3
|