1"use strict";(self.webpackChunkdantri_2022=self.webpackChunkdantri_2022||[]).push([[3394],{37043:function(e,t,n){var r=n(8081),o=n.n(r),a=n(23645),c=n.n(a)()(o());c.push([e.id,".yFqJMDJm9OqeFgZPpawa{padding-top:56.25%}",""]),c.locals={placeholder:"yFqJMDJm9OqeFgZPpawa"},t.Z=c},73394:function(e,t,n){n.d(t,{Y:function(){return Z}});var r=n(67294),o=n(33821),a=n(75429),c=n(22189),u=n(45697),i=n.n(u),l=n(23560),s=n.n(l),f=n(14293),d=n.n(f),p=n(73955),y=n.n(p),b=n(58147),h=n(90049),m=n(93379),v=n.n(m),g=n(7795),w=n.n(g),E=n(90569),P=n.n(E),S=n(3565),O=n.n(S),k=n(19216),j=n.n(k),F=n(44589),R=n.n(F),A=n(37043),D={};function T(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}function I(e,t,n,r,o,a,c){try{var u=e[a](c),i=u.value}catch(e){return void n(e)}u.done?t(i):Promise.resolve(i).then(r,o)}function L(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function c(e){I(a,r,o,c,u,"next",e)}function u(e){I(a,r,o,c,u,"throw",e)}c(void 0)}))}}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M(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,o,a=[],c=!0,u=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{c||null==n.return||n.return()}finally{if(u)throw o}}return a}}(e,t)||q(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 _(e){return function(e){if(Array.isArray(e))return T(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||q(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(e,t){if(e){if("string"==typeof e)return T(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(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T(e,t):void 0}}function C(e,t){var n,r,o,a,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,r=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=t.call(e,c)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}D.styleTagTransform=R(),D.setAttributes=O(),D.insert=P().bind(null,"head"),D.domAPI=w(),D.insertStyleElement=j(),v()(A.Z,D),A.Z&&A.Z.locals&&A.Z.locals;var Z=function(e){var t=e.classes,n=e.options,u=e.onLibReady,i=e.onInit,l=e.onTimeUpdate,f=e.onLoadedData,p=e.onFirstLoadedMetadata,m=e.onFirstPlay,v=e.onPlay,g=e.onPause,w=e.onVolumeChange,E=e.onEnded,P=e.onError,S=e.id,O="https://cdnasset.dantri.com.vn",k=(0,o.Gq)("".concat(O,"/player/dantri-player.js")),j=(0,o.Rd)("".concat(O,"/player/dantri-player.css")),F=S||(0,r.useRef)(y()("video-player-")).current,R=(0,r.useRef)(null),A=(0,o.bp)("audio-played"),D=(A.data,A.setData),T=M((0,r.useState)(!1),2),I=T[0],q=T[1],Z=M((0,r.useState)(!1),2),B=Z[0],N=Z[1],V=M((0,r.useState)(!1),2),W=V[0],G=V[1],J=M((0,r.useState)(!1),2),Y=J[0],U=J[1],H=M((0,r.useState)(!0),2),z=H[0],$=H[1],K=M((0,r.useState)(""),2),Q=K[0],X=K[1],ee=M((0,r.useState)(0),2),te=ee[0],ne=ee[1],re=M((0,r.useState)(void 0),2),oe=re[0],ae=re[1],ce=M((0,r.useState)(void 0),2),ue=ce[0],ie=ce[1],le=M((0,r.useState)(void 0),2),se=le[0],fe=le[1],de=null!=n?n:{},pe=de.enableAutoMuteOthers,ye=void 0===pe||pe,be=de.isFullscreen,he=(0,r.useRef)(u),me=(0,r.useRef)(l),ve=(0,r.useRef)(f),ge=(0,r.useRef)(p),we=(0,r.useRef)(m),Ee=(0,r.useRef)(v),Pe=(0,r.useRef)(g),Se=(0,r.useRef)(E),Oe=(0,r.useRef)(w),ke=(0,r.useRef)(P);(0,r.useEffect)((function(){he.current=u,me.current=l,ve.current=f,we.current=m,Ee.current=v,Pe.current=g,Se.current=E,Oe.current=w,ke.current=P,ge.current=p}),[l,f,p,m,v,g,E,w,P]);var je=(0,r.useCallback)(function(){var e=L((function(e){var t,n,r,o=arguments;return C(this,(function(a){switch(a.label){case 0:if(t=o.length>1&&void 0!==o[1]?o[1]:3,!e||!e.paused())return[2];n=1,a.label=1;case 1:if(!(n<=t))return[3,6];a.label=2;case 2:return a.trys.push([2,4,,5]),[4,e.play()];case 3:return a.sent(),[3,6];
1case 4:r=a.sent(),console.error("Video autoplay bá» từ chá»i: ",r);try{e.muted()||e.muted(!0)}catch(e){console.error("Video không thá» muted: ",e)}return++n>t&&console.error("Äã thá» autoplay video "+t+" lần nhưng không thà nh công"),[3,5];case 5:return[3,1];case 6:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),[]);return(0,r.useEffect)((function(){var e=document.getElementsByClassName("video-container")[0];e&&(Y?e.classList.add("sticky"):e.classList.remove("sticky"))}),[Y]),(0,r.useEffect)((function(){I&&Q&&(X(""),clearInterval(te),ne(0))}),[I,Q]),(0,r.useEffect)((function(){if(I&&W){z&&(R.current.muted(!1),$(!1));var e=(0,b.Z8)().filter((function(e){return e.enablePip})).map((function(e){return e.id}));(0,c.isArrayAny)(e)&&e.indexOf(F)<0&&((0,b.z2)(_(e).concat([F]),!1),ue<.5&&(0,h.Yk)(document.getElementById(F),-50))}}),[I,W]),(0,r.useEffect)((function(){if(!d()(ue)){var e,t=R.current,r=(0,b.Z8)();if(n.disableScrollToPlay||(ue<.5&&!t.paused()&&(r.filter((function(e){return e.enablePip})).length>0||t.muted()||be)&&!Y&&!(null===(e=n.pip)||void 0===e?void 0:e.allowWhenMuted)&&t.pause(),ue>=.5&&t.paused()&&!B&&d()(n.countDown)&&t.play()),n.pip&&(0!==ue||!t||t.paused()||t.muted()&&!n.pip.allowWhenMuted||Y||r.filter((function(e){return e.enablePip})).length>0?U(!1):U(!0)),n.countDown>=0&&!n.autoplay)if(1!==ue||!t.paused()||I||B)X(""),clearInterval(te);else{var o=n.countDown;if(o>0){var a=setInterval(L((function(){return C(this,(function(e){switch(e.label){case 0:return 0!==o?[3,2]:(X(""),[4,je(t)]);case 1:return e.sent(),clearInterval(a),[3,3];case 2:X("Video sẽ tá»± Äá»ng phát sau ".concat(o)),o--,e.label=3;case 3:return[2]}}
1))})),1e3);ne(a)}else setTimeout((function(){je(t)}),200)}}}),[ue]),(0,r.useEffect)((function(){if(oe){var e=oe.el();if(!be){var t=document.getElementById("video-wrap-".concat(oe.id_)),n=t.clientHeight;t.parentElement.style.minHeight="".concat(n,"px"),e=t.parentElement}var r={threshold:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1]};document.getElementsByClassName("video-container")[0]&&(a=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){x(e,t,n[t])}))}return e}({},r),c=null!=(c={rootMargin:"75px 0px 0px 0px"})?c:{},Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(c)).forEach((function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(c,e))})),r=a);var o=new IntersectionObserver((function(e){e.forEach((function(e){var t=e.intersectionRatio;ie(t)}))}),r);return o.observe(e),function(){o.disconnect()}}var a,c}),[oe]),(0,r.useEffect)((function(){!se||!oe||I&&B||(oe.paused()?N(!0):q(!0))}),[se]),(0,r.useEffect)((function(){return n&&(n.sources||n.src)?"ready"===k&&"ready"===j&&s()(window.DantriPlayer)&&(s()(he.current)&&he.current(),window.DantriPlayer(F,n,(function(e){R.current=e,e.on("loadstart",(function(e){[document.getElementById("".concat(F,"_html5_api")),document.querySelector("#".concat(F," .vjs-big-play-button")),document.querySelector("#".concat(F," .vjs-touch-overlay"))].concat(_(document.querySelectorAll("#".concat(F," .vjs-play-control")))).forEach((function(e,t){e&&e.addEventListener("click",(function(e){setTimeout((function(){fe(e)}),100)}))}))})),e.on("timeupdate",(function(e){s()(me.current)&&me.current(e)})),e.on("loadeddata",(function(e){s()(ve.current)&&ve.current(e)})),e.on("error",(function(e){s()(ke.current)&&ke.current(e)})),e.one("play",(function(e){a.PubSub.publish(a.EVENT_TYPES.STOP_RELOAD_PAGE,null),G(!0),s()(we.current)&&we.current(e)})),e.one("loadedmetadata",(function(e){s()(ge.current)&&ge.current(e)})),e.on("play",(function(e){a.PubSub.publish(a.EVENT_TYPES.STOP_RELOAD_PAGE,null),G(!0),s()(Ee.current)&&Ee.current(e)})),e.on("pause",(function(e){G(!1),s()(Pe.current)&&Pe.current(e)})),e.on("ended",(function(e){q(!0),s()(Se.current)&&Se.current(e)})),e.on("volumechange",(function(e){ye&&(e.target.player.muted()||((0,b.EB)([e.target.id]),D(!1))),s()(Oe.current)&&Oe.current(e,muted)})),e.one("canplay",(function(t){n.forcePlay&&n.forcePlay.enable&&je(e).then((function(){s()(n.forcePlay.callbackFnc)&&n.forcePlay.callbackFnc()}))})),ae(e),s()(i)&&i(e)}))):console.error("------ where's the source ------"),function(){var e;s()(null==R||null===(e=R.current)||void 0===e?void 0:e.dispose)&&R.current.dispose()}}),[k,j]),r.createElement("div",{id:"video-wrap-".concat(F),className:"vplayer-container ".concat(Y?"sticky-player ratio-".concat(n.aspectRatio?n.aspectRatio.replace(":","x"):"1"):""," ").concat(Q?"have-countDown":""," ").concat(t||"").trim()},r.createElement("video",{id:F,muted:!0,playsInline:!0}),n.pip?r.createElement("button",{type:"button",className:"sticky-player-close",onClick:function(){U(!1),R.current.pause()}},r.createElement("svg",{"aria-hidden":"true",width:"22",height:"22",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M26 6L6 26",stroke:"#FFFFFF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{d:"M6 6L26 26",stroke:"#FFFFFF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))):null,n.countDown>0?r.createElement("span",{className:"count-down ".concat(Q?"":"hidden")},Q):null)};Z.propsTypes={onInit:i().func,onLoadedData:i().func,onTimeUpdate:i().func,onFirstPlay:i().func,onPlay:i().func,onPause:i().func,onVolumeChange:i().func,onEnded:i().func,onError:i().func,options:i().shape({sources:i().arrayOf(i().shape({src:i().string.isRequired,type:i().string})).isRequired,src:i().string,poster:i().string,autoplay:i().bool,preload:i().string,muted:i().bool,ads:i().string,watermark:i().bool,pip:i().shape({allowWhenMuted:i().bool}),countDown:i().number,disableScrollToPlay:i().bool,aspectRatio:i().string,forcePlay:i().shape({enable:i().bool,callbackFnc:i().func}),enableAutoMuteOthers:i().bool,isFullscreen:i().bool})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.