@clickview/lite 0.44.0-rc.7 → 0.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundles.json +1 -1
- package/dist/css/{3867-lite-275434352f.chunk.css → 3867-lite-b49fe21114.chunk.css} +1 -1
- package/dist/scripts/{2261-9d136a349e-lite.chunk.js → 2261-60a35c5b26-lite.chunk.js} +1 -1
- package/dist/scripts/2383-a4dc697816-lite.chunk.js +1 -0
- package/dist/scripts/3867-651a4b17b7-lite.chunk.js +2 -0
- package/dist/scripts/4436-02ef766975-lite.chunk.js +1 -0
- package/dist/scripts/{bundle-989b276194.min.js → bundle-9d9ab85581.min.js} +2 -2
- package/package.json +1 -1
- package/dist/scripts/2383-2fe9440a7f-lite.chunk.js +0 -1
- package/dist/scripts/3867-c01b777a28-lite.chunk.js +0 -2
- package/dist/scripts/4436-bee8cd9186-lite.chunk.js +0 -1
- /package/dist/scripts/{3867-c01b777a28-lite.chunk.js.LICENSE.txt → 3867-651a4b17b7-lite.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{bundle-989b276194.min.js.LICENSE.txt → bundle-9d9ab85581.min.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[4436],{85048:(e,t,n)=>{n.r(t),n.d(t,{EditClipTimepointsView:()=>Ue});var r=n(32735),i=n(23481),o=n(81886),a=n(20354),u=n(28400),l=n(83345),c=n(95047),s=n(93264);const f={arrowContainer:"lFyGP",downArrow:"kuLky",upArrow:"_zBG5",inputContainer:"h0Hdv",focus:"IJSFr"};function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,u=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var y=38,h=40,m=3600;function v(e){var t=p(r.useState("00"),2),n=t[0],i=t[1],o=p(r.useState("00"),2),a=o[0],u=o[1],l=p(r.useState("00"),2),d=l[0],v=l[1],b=p(r.useState(!1),2),g=b[0],T=b[1],w=r.useRef(null),S=r.useRef(null),O=e.duration&&e.duration>=m;function E(e){e.target.select(),T(!0)}function P(e,t,n){var r=e.target.value.replace(/\D/g,"").slice(0,2);t(r),2===r.length&&(null==n?void 0:n.current)&&requestAnimationFrame((function(){return n.current.focus()}))}function C(){e.setTime(e.value+1)}function j(){e.setTime(e.value-1)}function _(t,r){var i;e.allowKeyboardInput&&((i=c.k.convertDurationToSeconds(n,a,d))<0||e.maxValue&&i>e.maxValue||e.setTime(i),r(t.target.value.padStart(2,"0")),T(!1))}function k(e){e.keyCode===y&&C(),e.keyCode===h&&j()}return r.useEffect((function(){var t;t=s.T.ToDisplayDuration(1e3*e.value,!0).split(":"),i(String(t[0]).padStart(2,"0")),u(t[1]),v(t[2])}),[e.value]),r.createElement("div",{className:"".concat(f.inputContainer," ").concat(g?f.focus:""," position-relative bg-white d-flex align-items-center p-2 rounded-pill font-size-md")},r.createElement("div",{className:"".concat(O?"":"d-none")},r.createElement("input",{type:"text",className:"border-0 outline-none",value:n,maxLength:2,placeholder:"HH",onChange:function(e){return P(e,i,w)},onFocus:E,onBlur:function(e){return _(e,i)},onKeyDown:k,disabled:e.disabled}),r.createElement("span",null,":")),r.createElement("div",null,r.createElement("input",{ref:w,type:"text",className:"border-0 outline-none",value:a,maxLength:2,placeholder:"MM",onChange:function(e){return P(e,u,S)},onFocus:E,onBlur:function(e){return _(e,u)},onKeyDown:k,disabled:e.disabled}),r.createElement("span",null,":")),r.createElement("input",{ref:S,type:"text",className:"border-0 outline-none",value:d,maxLength:2,placeholder:"SS",onChange:function(e){return v(e.target.value)},onFocus:E,onBlur:function(e){return _(e,v)},onKeyDown:k,disabled:e.disabled}),!e.hideButtons&&r.createElement("div",null,r.createElement("div",{className:f.arrowContainer,onClick:C},r.createElement("div",{className:f.upArrow})),r.createElement("div",{className:f.arrowContainer,onClick:j},r.createElement("div",{className:f.downArrow}))))}v.defaultProps={allowKeyboardInput:!0,size:"lg"};var b="shared.clipTimeForm",g=i.T.encloseNamespace(b);function T(e){if(isNaN(e.startTime)||isNaN(e.endTime))return r.createElement(r.Fragment,null);var t=Math.floor(e.endTime)-Math.floor(e.startTime);return r.createElement("div",{className:"px-3"},r.createElement("form",{className:"d-flex align-items-center justify-content-center pb-4"},r.createElement("div",null,r.createElement(v,{value:e.startTime,setTime:e.setStartTime,duration:e.duration})),r.createElement("span",{className:"px-2"},"-"),r.createElement("div",{className:"me-2"},r.createElement(v,{value:e.endTime,setTime:e.setEndTime,duration:e.duration})),r.createElement("span",null,r.createElement("strong",null,r.createElement(l.x,{namespace:b,phrase:"duration"}))," ",s.T.ToDisplayDuration(1e3*t))),r.createElement("div",{className:"d-flex justify-content-end"},r.createElement("button",{className:"btn btn-link",onClick:e.onCancel},g("cancel")),r.createElement("button",{className:"btn btn-dark",onClick:e.onSubmit},g("next"))))}var w=n(60051),S=n(43012),O=n(39151),E=n(47812),P=n(1575),C=n(89476),j=n(79612),_=n(89961),k=n(36527),D=n(93861);function B(e){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B(e)}function R(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,A(r.key),r)}}function A(e){var t=function(e,t){if("object"!=B(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=B(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==B(t)?t:String(t)}function M(e,t,n){return t=I(t),function(e,t){if(t&&("object"===B(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,N()?Reflect.construct(t,n||[],I(e).constructor):t.apply(e,n))}function N(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(N=function(){return!!e})()}function x(){return x="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=I(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},x.apply(this,arguments)}function I(e){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},I(e)}function L(e,t){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},L(e,t)}var F=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),M(this,t,arguments)}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&L(e,t)}(t,e),n=t,(r=[{key:"buildCSSClass",value:function(){return"cv-clip-timepoint-handle ".concat(x(I(t.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(e,n,r){return x(I(t.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},n),{className:this.buildCSSClass(),innerHTML:'<svg viewBox="0 0 5 14" pointer-events="none"><g id="Clips" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Clip-2" transform="translate(-835.000000, -632.000000)" fill="#FFFFFF"><g id="Video-Copy" transform="translate(275.000000, 96.000000)"><g id="Handles" transform="translate(560.000000, 536.000000)"><circle id="Oval" cx="1" cy="1" r="1"></circle><circle id="Oval-Copy-2" cx="1" cy="5" r="1"></circle><circle id="Oval-Copy-4" cx="1" cy="9" r="1"></circle><circle id="Oval-Copy-8" cx="1" cy="13" r="1"></circle><circle id="Oval-Copy" cx="4" cy="1" r="1"></circle><circle id="Oval-Copy-3" cx="4" cy="5" r="1"></circle><circle id="Oval-Copy-5" cx="4" cy="9" r="1"></circle><circle id="Oval-Copy-9" cx="4" cy="13" r="1"></circle></g></g></g></g></svg>'}),r)}},{key:"isEventTarget",value:function(e){return this.el().contains(e.target)}}])&&R(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(D.Z.getComponent("Component"));function H(e){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(e)}function Z(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,U(r.key),r)}}function U(e){var t=function(e,t){if("object"!=H(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=H(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==H(t)?t:String(t)}function K(e,t,n){return t=G(t),function(e,t){if(t&&("object"===H(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,V()?Reflect.construct(t,n||[],G(e).constructor):t.apply(e,n))}function V(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(V=function(){return!!e})()}function z(){return z="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=G(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},z.apply(this,arguments)}function G(e){return G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},G(e)}function W(e,t){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},W(e,t)}var $=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=K(this,t,[e,n])).dragStartActive=!1,r.dragEndActive=!1,r.dragSliderActive=!1,r.dragSliderCurrentPosition=null,r.minDuration=Math.min(e.duration(),r.options_.minDuration),r.setStartTime(n.startTime,!1),r.setEndTime(n.endTime,!1),r.startHandle=new F(r.player(),n),r.startHandle.addClass("cv-clip-start-handle"),r.addChild(r.startHandle),r.endHandle=new F(r.player(),n),r.endHandle.addClass("cv-clip-end-handle"),r.addChild(r.endHandle),r.on(r.player(),"update:clip:start:time",(function(e){var t=e.time;return r.setStartTime(t)})),r.on(r.player(),"update:clip:end:time",(function(e){var t=e.time;return r.setEndTime(t)})),r.bindListeners(),r.update(),r}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&W(e,t)}(t,e),n=t,r=[{key:"createEl",value:function(){return z(G(t.prototype),"createEl",this).call(this,"div",{className:"cv-clip-timepoint-selector"},{})}},{key:"update",value:function(){var e=this;this.options_.onChangeStartTime(this.startTime),this.options_.onChangeEndTime(this.endTime),this.requestAnimationFrame((function(){e.setStartOffset(),e.setWidth()}))}},{key:"setStartTime",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!isNaN(e)){var n=this.hasStartTime()&&this.hasEndTime()&&this.endTime-this.startTime,r=this.player().duration()-this.minDuration;if(e>r&&(e=r),e<0&&(e=0),this.startTime=e,this.endTime&&this.endTime-this.startTime<this.minDuration){var i="number"==typeof n?this.startTime+n:this.startTime+this.minDuration;this.setEndTime(i)}this.player().currentTime(this.startTime),t&&this.update()}}},{key:"setEndTime",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!isNaN(e)){var n=this.hasStartTime()&&this.hasEndTime()&&this.endTime-this.startTime,r=this.minDuration;if(e<r&&(e=r),e>this.player().duration()&&(e=this.player().duration()),this.endTime=e,this.startTime&&this.endTime-this.startTime<this.minDuration){var i="number"==typeof n?this.endTime-n:this.endTime-this.minDuration;this.setStartTime(i)}t&&this.update()}}},{key:"bindListeners",value:function(){var e=this;this.onTimeupdate=this.onTimeupdate.bind(this),this.player().on("timeupdate",this.onTimeupdate),this.on("mousedown",this.dragStart),this.on("touchstart",this.dragStart),this.player().on("dispose",(function(){e.player().off("timeupdate",e.onTimeupdate),e.off("mousedown",e.dragStart),e.off("touchstart",e.dragStart)}))}},{key:"hasStartTime",value:function(){return"number"==typeof this.startTime}},{key:"hasEndTime",value:function(){return"number"==typeof this.endTime}},{key:"onTimeupdate",value:function(){var e=this.player().currentTime();e>this.endTime&&e<this.endTime+.5&&this.player().pause()}},{key:"dragStart",value:function(e){this.startHandle.isEventTarget(e)&&(e.stopImmediatePropagation(),this.dragStartActive=!0),this.endHandle.isEventTarget(e)&&(e.stopImmediatePropagation(),this.dragEndActive=!0),e.target===this.el()&&(e.stopImmediatePropagation(),this.dragSliderActive=!0,this.dragSliderCurrentPosition=this.getPosition(e));var t=this.el().ownerDocument;this.on(t,"mousemove",this.drag),this.on(t,"mouseup",this.dragEnd),this.on(t,"touchmove",this.drag),this.on(t,"touchend",this.dragEnd),this.drag(e)}},{key:"dragEnd",value:function(){this.dragStartActive=!1,this.dragEndActive=!1,this.dragSliderActive=!1,this.dragSliderCurrentPosition=null;var e=this.el().ownerDocument;this.off(e,"mousemove",this.drag),this.off(e,"mouseup",this.dragEnd),this.off(e,"touchmove",this.drag),this.off(e,"touchend",this.dragEnd)}},{key:"drag",value:function(e){if((this.dragStartActive||this.dragEndActive||this.dragSliderActive)&&D.Z.dom.isSingleLeftClick(e)){var t=this.getPosition(e),n=t*this.player().duration();this.dragStartActive&&this.handleStartHandleDrag(n),this.dragEndActive&&this.handleEndHandleDrag(n),this.dragSliderActive&&this.handleSliderDrag(t)}}},{key:"handleStartHandleDrag",value:function(e){this.setStartTime(e)}},{key:"handleEndHandleDrag",value:function(e){this.setEndTime(e)}},{key:"handleSliderDrag",value:function(e){var t=(e-this.dragSliderCurrentPosition)*this.player().duration(),n=this.startTime+t,r=this.endTime+t;n<=0||r>=this.player().duration()||(this.dragSliderCurrentPosition=e,this.setStartTime(n),this.setEndTime(r))}},{key:"getPosition",value:function(e){return D.Z.dom.getPointerPosition(this.el_.parentNode,e).x}},{key:"setStartOffset",value:function(){this.el_.style.marginLeft="".concat(this.getPercentage(this.startTime),"%")}},{key:"setWidth",value:function(){this.el_.style.width="".concat(this.getPercentage(this.endTime-this.startTime),"%")}},{key:"getPercentage",value:function(e){return+(e/this.player().duration()*100).toFixed(4)}}],r&&Z(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(D.Z.getComponent("Component"));function q(e){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},q(e)}function Q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,J(r.key),r)}}function J(e){var t=function(e,t){if("object"!=q(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=q(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==q(t)?t:String(t)}function Y(e,t,n){return t=te(t),function(e,t){if(t&&("object"===q(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,X()?Reflect.construct(t,n||[],te(e).constructor):t.apply(e,n))}function X(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(X=function(){return!!e})()}function ee(){return ee="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=te(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},ee.apply(this,arguments)}function te(e){return te=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},te(e)}function ne(e,t){return ne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ne(e,t)}var re=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Y(this,t,[e,n])).seekBar_=n.seekBar,r.playProgressBar_=n.playProgressBar,r.bindListeners(),r.player_.one("dispose",(function(){r.unbindListeners()})),r}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ne(e,t)}(t,e),n=t,(r=[{key:"createEl",value:function(e,n,r){return ee(te(t.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},n),{className:"cv-create-clip-progress-indicator"}),r)}},{key:"bindListeners",value:function(){this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown)}},{key:"unbindListeners",value:function(){var e=this.el_.ownerDocument;this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off(e,"mousemove",this.handleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchmove",this.handleMouseMove),this.off(e,"touchend",this.handleMouseUp)}},{key:"handleMouseDown",value:function(e){if(D.Z.dom.isSingleLeftClick(e)){e.stopPropagation(),"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||D.Z.browser.IS_CHROME||e.preventDefault(),this.player_.scrubbing(!0),this.videoWasPlaying_=!this.player_.paused(),this.player_.pause(),D.Z.dom.blockTextSelection();var t=this.el_.ownerDocument;this.on(t,"mousemove",this.handleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchmove",this.handleMouseMove),this.on(t,"touchend",this.handleMouseUp),this.handleMouseMove(e),this.player_.addClass("cv-hide-mouse-time")}}},{key:"handleMouseMove",value:function(e){if(D.Z.dom.isSingleLeftClick(e)){var t=D.Z.dom.getPointerPosition(this.seekBar_.el_,e).x*this.player_.duration();t===this.player_.duration()&&(t-=.1),this.player_.currentTime(t),this.playProgressBar_.update()}}},{key:"handleMouseUp",value:function(e){D.Z.dom.unblockTextSelection();var t=this.el_.ownerDocument;this.off(t,"mousemove",this.handleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchmove",this.handleMouseMove),this.off(t,"touchend",this.handleMouseUp),null==e||e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying_&&this.player_.play(),this.seekBar_.update(),this.player_.removeClass("cv-hide-mouse-time")}}])&&Q(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(D.Z.getComponent("Component"));function ie(e){return ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ie(e)}function oe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ae(r.key),r)}}function ae(e){var t=function(e,t){if("object"!=ie(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ie(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ie(t)?t:String(t)}function ue(e,t,n){return t=ce(t),function(e,t){if(t&&("object"===ie(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,le()?Reflect.construct(t,n||[],ce(e).constructor):t.apply(e,n))}function le(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(le=function(){return!!e})()}function ce(e){return ce=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ce(e)}function se(e,t){return se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},se(e,t)}D.Z.registerComponent("CreateClipProgressIndicator",re);var fe=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=ue(this,t,[e,n])).addClass("cv-create-clip-seek-bar"),r}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&se(e,t)}(t,e),n=t,(r=[{key:"initialize",value:function(e){var t=new $(this.player(),e);this.addChild(t);var n=this.getChild("playProgressBar"),r=new re(this.player_,{seekBar:this,playProgressBar:n});n.addChild(r)}}])&&oe(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(D.Z.getComponent("SeekBar"));function pe(e){return pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pe(e)}function de(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ye(r.key),r)}}function ye(e){var t=function(e,t){if("object"!=pe(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=pe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pe(t)?t:String(t)}function he(e,t,n){return t=ge(t),function(e,t){if(t&&("object"===pe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ve(e)}(e,me()?Reflect.construct(t,n||[],ge(e).constructor):t.apply(e,n))}function me(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(me=function(){return!!e})()}function ve(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function be(){return be="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=ge(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},be.apply(this,arguments)}function ge(e){return ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ge(e)}function Te(e,t){return Te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Te(e,t)}fe.prototype.options_={children:["playProgressBar"],barName:"playProgressBar"},D.Z.browser.IS_IOS||D.Z.browser.IS_ANDROID||fe.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),D.Z.registerComponent("CreateClipSeekBar",fe);var we=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=he(this,t,[e,n])).options=n,r.initCreateClipSeekBar=r.initCreateClipSeekBar.bind(ve(r)),r.player.one("loadedmetadata",(function(){return r.player.ready(r.initCreateClipSeekBar)})),r}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Te(e,t)}(t,e),n=t,(r=[{key:"initCreateClipSeekBar",value:function(){var e,t=null===(e=this.player.controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar");if(t){var n=!isNaN(this.options.startTime)&&this.options.startTime>=0?this.options.startTime:0,r=!isNaN(this.options.endTime)&&this.options.endTime<=this.player.duration()?this.options.endTime:this.player.duration(),i=Math.min(this.options.minDuration||5,this.player.duration());t.initialize({startTime:n,endTime:r,minDuration:i,onChangeStartTime:this.options.onChangeStartTime,onChangeEndTime:this.options.onChangeEndTime})}}},{key:"dispose",value:function(){this.player.off("loadedmetadata",this.initCreateClipSeekBar),be(ge(t.prototype),"dispose",this).call(this)}}])&&de(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(D.Z.getPlugin("plugin"));function Se(e){return Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Se(e)}function Oe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ee(r.key),r)}}function Ee(e){var t=function(e,t){if("object"!=Se(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Se(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Se(t)?t:String(t)}function Pe(e,t,n){return t=_e(t),function(e,t){if(t&&("object"===Se(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ce()?Reflect.construct(t,n||[],_e(e).constructor):t.apply(e,n))}function Ce(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ce=function(){return!!e})()}function je(){return je="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_e(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},je.apply(this,arguments)}function _e(e){return _e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_e(e)}function ke(e,t){return ke=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ke(e,t)}D.Z.registerPlugin("createClipPlugin",we);var De=function(e){function t(e,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Pe(this,t,[e,Object.assign(Object.assign({},n),{playbackRates:null,enableLocalCache:!1})])}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ke(e,t)}(t,e),n=t,(r=[{key:"getPlayerClassName",value:function(){return"cv-create-clip-player"}},{key:"configurePlugins",value:function(){var e=this.options,t=e.startTime,n=e.endTime,r=e.minDuration,i=e.onChangeStartTime,o=e.onChangeEndTime;this.player.createClipPlugin({startTime:t,endTime:n,minDuration:r,onChangeStartTime:i,onChangeEndTime:o})}},{key:"getPlayerOptions",value:function(){var e=je(_e(t.prototype),"getPlayerOptions",this).call(this);return e.inactivityTimeout=0,e}},{key:"getSeekBarName",value:function(){return"CreateClipSeekBar"}},{key:"getAnalyticsPlayerType",value:function(){return"create-clip-player"}}])&&Oe(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(k.r),Be=n(63816);function Re(e){var t=e.onReady,n=e.onDispose,i=r.useRef(),o=r.useRef();return r.useEffect((function(){var r;if(null===(r=o.current)||void 0===r||r.dispose(),i)return o.current=new De(i.current,e),t&&o.current.ready((function(){t((0,Be.G)(o.current))})),n&&o.current.one("dispose",n),function(){var e;null===(e=o.current)||void 0===e||e.dispose()}}),[e.viewKey]),r.useEffect((function(){var t;null===(t=o.current)||void 0===t||t.trigger({type:"update:clip:start:time",time:e.startTime})}),[e.startTime]),r.useEffect((function(){var t;null===(t=o.current)||void 0===t||t.trigger({type:"update:clip:end:time",time:e.endTime})}),[e.endTime]),r.createElement("div",{ref:i})}var Ae=n(14070),Me=n(97291);function Ne(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,u=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return xe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xe(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ie="edit-clip-timepoints",Le="shared.editClipTimepoints",Fe=i.T.encloseNamespace(Le),He=30,Ze=5;function Ue(e){var t,n,l,c=r.useRef(),s=e.startTime||0,f=Ne(r.useState(s),2),p=f[0],d=f[1],y=Ne(r.useState(s+He),2),h=y[0],m=y[1],v=a.a.useBasicFetch(O.L.config()),b=a.a.useBasicFetch(!!e.id&&S.e.clip(e.id)),g=(null===(n=null===(t=b.data)||void 0===t?void 0:t._parentVideo)||void 0===n?void 0:n.id)||e.videoId,k=a.a.useBasicFetch(!!g&&E.k.createViewKey(g,w.f.MasterObject)),D=a.a.useBasicFetch(!!g&&P.R.video(g)),B=Ne(r.useState(0),2),R=B[0],A=B[1],M=(0,C.f)();return(0,j.M)({title:e.id?null===(l=b.data)||void 0===l?void 0:l.name:Fe("pageTitle")}),r.useEffect((function(){M.lock({id:Ie,title:i.T.getPhrase(Le,"navLockTitle"),text:i.T.getPhrase(Le,"navLockBody")})}),[]),r.useEffect((function(){b.data&&(d(b.data.startTime),m(b.data.endTime))}),[b.data]),e.id||e.videoId?r.createElement("div",{className:"px-3"},!!v.data&&!!k.data&&!!D.data&&(!e.id||!!b.data)&&r.createElement("div",{className:"pb-3"},r.createElement("div",{className:"mb-3"},r.createElement(Re,{onReady:function(e){c.current=e,e.on("durationchange",(function(){return A(e.duration())}))},playerApi:new URL(v.data.playerApiUrl),viewKey:k.data.viewKey,startTime:p,endTime:h,onChangeStartTime:d,onChangeEndTime:m,minDuration:Ze,autoplay:!0})),r.createElement(T,{startTime:p,endTime:h,setStartTime:d,setEndTime:m,onSubmit:function(){var t="";p>h&&(t=Fe("startTimeGreaterThanEndTime")),h-p<Ze&&(t=Fe("tooShort",{minDuration:Ze})),t?function(e){_.M.render(r.createElement("p",null,e),{title:Fe("errorHeading"),cancelButtonProps:{variant:"link",text:Fe("close")}})}(t):(M.unlock(Ie),o.Q.C$.trigger({application:Me.O.CLIPS,action:e.id?Ae.e.Clips.EDIT_CLIP_DETAILS:Ae.e.Clips.CREATE_CLIP_DETAILS,args:e.id?[e.id]:[e.videoId],params:{startTime:p,endTime:h,isCopying:e.isCopying}}))},onCancel:function(){var e,t,n,r,i=null!==(t=null===(e=c.current)||void 0===e?void 0:e.currentTime())&&void 0!==t?t:0;o.Q.C$.trigger({application:Me.O.VIDEOS,action:Ae.e.Videos.PLAY_VIDEO,args:[null===(n=D.data)||void 0===n?void 0:n.id,u.m.slugify(null===(r=D.data)||void 0===r?void 0:r.name)],params:{t:i}})},duration:R}))):r.createElement(r.Fragment,null)}}}]);
|