@devix-technologies/react-gjirafa-vp-player 1.0.18 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +271 -0
- package/dist/react-gjirafa-vp-player.es.js +746 -626
- package/dist/react-gjirafa-vp-player.umd.js +8 -8
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(j,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],P):(j=typeof globalThis<"u"?globalThis:j||self,P(j.ReactGjirafaVPPlayer={},j.React))})(this,function(j,P){"use strict";function kt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const se=kt(P);var ke={exports:{}},me={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Ye;function Et(){if(Ye)return me;Ye=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,a,i){var o=null;if(i!==void 0&&(o=""+i),a.key!==void 0&&(o=""+a.key),"key"in a){i={};for(var l in a)l!=="key"&&(i[l]=a[l])}else i=a;return a=i.ref,{$$typeof:e,type:n,key:o,ref:a!==void 0?a:null,props:i}}return me.Fragment=t,me.jsx=r,me.jsxs=r,me}var ye={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var Ge;function _t(){return Ge||(Ge=1,process.env.NODE_ENV!=="production"&&function(){function e(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===U?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case d:return"Fragment";case y:return"Profiler";case m:return"StrictMode";case B:return"Suspense";case S:return"SuspenseList";case L:return"Activity"}if(typeof s=="object")switch(typeof s.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),s.$$typeof){case v:return"Portal";case R:return(s.displayName||"Context")+".Provider";case _:return(s._context.displayName||"Context")+".Consumer";case T:var b=s.render;return s=s.displayName,s||(s=b.displayName||b.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case p:return b=s.displayName||null,b!==null?b:e(s.type)||"Memo";case D:b=s._payload,s=s._init;try{return e(s(b))}catch{}}return null}function t(s){return""+s}function r(s){try{t(s);var b=!1}catch{b=!0}if(b){b=console;var I=b.error,w=typeof Symbol=="function"&&Symbol.toStringTag&&s[Symbol.toStringTag]||s.constructor.name||"Object";return I.call(b,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",w),t(s)}}function n(s){if(s===d)return"<>";if(typeof s=="object"&&s!==null&&s.$$typeof===D)return"<...>";try{var b=e(s);return b?"<"+b+">":"<...>"}catch{return"<...>"}}function a(){var s=$.A;return s===null?null:s.getOwner()}function i(){return Error("react-stack-top-frame")}function o(s){if(Z.call(s,"key")){var b=Object.getOwnPropertyDescriptor(s,"key").get;if(b&&b.isReactWarning)return!1}return s.key!==void 0}function l(s,b){function I(){X||(X=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",b))}I.isReactWarning=!0,Object.defineProperty(s,"key",{get:I,configurable:!0})}function u(){var s=e(this.type);return M[s]||(M[s]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),s=this.props.ref,s!==void 0?s:null}function h(s,b,I,w,F,W,E,V){return I=W.ref,s={$$typeof:k,type:s,key:b,props:W,_owner:F},(I!==void 0?I:null)!==null?Object.defineProperty(s,"ref",{enumerable:!1,get:u}):Object.defineProperty(s,"ref",{enumerable:!1,value:null}),s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(s,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(s,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:E}),Object.defineProperty(s,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:V}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s}function c(s,b,I,w,F,W,E,V){var g=b.children;if(g!==void 0)if(w)if(N(g)){for(w=0;w<g.length;w++)f(g[w]);Object.freeze&&Object.freeze(g)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else f(g);if(Z.call(b,"key")){g=e(s);var O=Object.keys(b).filter(function(pe){return pe!=="key"});w=0<O.length?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}",fe[g+w]||(O=0<O.length?"{"+O.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,M,U,se,U),te[U+M]=!0)}if(U=null,O!==void 0&&(r(O),U=""+O),o(m)&&(r(m.key),U=""+m.key),"key"in m){O={};for(var Me in m)Me!=="key"&&(O[Me]=m[Me])}else O=m;return U&&c(O,typeof s=="function"?s.displayName||s.name||"Unknown":s),y(s,U,Z,re,a(),O,Fe,Be)}function f(s){typeof s=="object"&&s!==null&&s.$$typeof===k&&s._store&&(s._store.validated=1)}var b=P,k=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),S=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),$=Symbol.for("react.client.reference"),R=b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=Object.prototype.hasOwnProperty,Y=Array.isArray,V=console.createTask?console.createTask:function(){return null};b={"react-stack-bottom-frame":function(s){return s()}};var G,q={},ee=b["react-stack-bottom-frame"].bind(b,i)(),J=V(n(i)),te={};le.Fragment=d,le.jsx=function(s,m,O,M,re){var Z=1e4>R.recentlyCreatedOwnerStacks++;return l(s,m,O,!1,M,re,Z?Error("react-stack-top-frame"):ee,Z?V(n(s)):J)},le.jsxs=function(s,m,O,M,re){var Z=1e4>R.recentlyCreatedOwnerStacks++;return l(s,m,O,!0,M,re,Z?Error("react-stack-top-frame"):ee,Z?V(n(s)):J)}}()),le}var ze;function Pt(){return ze||(ze=1,process.env.NODE_ENV==="production"?ye.exports=wt():ye.exports=xt()),ye.exports}var N=Pt();function Se(){return Se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Se.apply(null,arguments)}function kt(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function Et(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var _t=function(){function e(r){var n=this;this._insertTag=function(a){var i;n.tags.length===0?n.insertionPoint?i=n.insertionPoint.nextSibling:n.prepend?i=n.container.firstChild:i=n.before:i=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(a,i),n.tags.push(a)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Et(this));var a=this.tags[this.tags.length-1];if(this.isSpeedy){var i=kt(a);try{i.insertRule(n,i.cssRules.length)}catch{}}else a.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){var a;return(a=n.parentNode)==null?void 0:a.removeChild(n)}),this.tags=[],this.ctr=0},e}(),B="-ms-",ge="-moz-",E="-webkit-",We="comm",Ae="rule",Ce="decl",St="@import",Ye="@keyframes",At="@layer",Ct=Math.abs,be=String.fromCharCode,Tt=Object.assign;function Rt(e,t){return F(e,0)^45?(((t<<2^F(e,0))<<2^F(e,1))<<2^F(e,2))<<2^F(e,3):0}function Ge(e){return e.trim()}function It(e,t){return(e=t.exec(e))?e[0]:e}function _(e,t,r){return e.replace(t,r)}function Te(e,t){return e.indexOf(t)}function F(e,t){return e.charCodeAt(t)|0}function ue(e,t,r){return e.slice(t,r)}function H(e){return e.length}function Re(e){return e.length}function ve(e,t){return t.push(e),e}function Ot(e,t){return e.map(t).join("")}var we=1,ne=1,qe=0,D=0,L=0,ae="";function xe(e,t,r,n,a,i,o){return{value:e,root:t,parent:r,type:n,props:a,children:i,line:we,column:ne,length:o,return:""}}function de(e,t){return Tt(xe("",null,null,"",null,null,0),e,{length:-e.length},t)}function jt(){return L}function $t(){return L=D>0?F(ae,--D):0,ne--,L===10&&(ne=1,we--),L}function W(){return L=D<qe?F(ae,D++):0,ne++,L===10&&(ne=1,we++),L}function X(){return F(ae,D)}function Pe(){return D}function fe(e,t){return ue(ae,e,t)}function pe(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function He(e){return we=ne=1,qe=H(ae=e),D=0,[]}function Xe(e){return ae="",e}function ke(e){return Ge(fe(D-1,Ie(e===91?e+2:e===40?e+1:e)))}function Lt(e){for(;(L=X())&&L<33;)W();return pe(e)>2||pe(L)>3?"":" "}function Nt(e,t){for(;--t&&W()&&!(L<48||L>102||L>57&&L<65||L>70&&L<97););return fe(e,Pe()+(t<6&&X()==32&&W()==32))}function Ie(e){for(;W();)switch(L){case e:return D;case 34:case 39:e!==34&&e!==39&&Ie(L);break;case 40:e===41&&Ie(e);break;case 92:W();break}return D}function Vt(e,t){for(;W()&&e+L!==57;)if(e+L===84&&X()===47)break;return"/*"+fe(t,D-1)+"*"+be(e===47?e:W())}function Ft(e){for(;!pe(X());)W();return fe(e,D)}function Bt(e){return Xe(Ee("",null,null,null,[""],e=He(e),0,[0],e))}function Ee(e,t,r,n,a,i,o,c,u){for(var y=0,l=0,f=o,b=0,k=0,g=0,d=1,v=1,p=1,w=0,S="",A=a,j=i,x=n,h=S;v;)switch(g=w,w=W()){case 40:if(g!=108&&F(h,f-1)==58){Te(h+=_(ke(w),"&","&\f"),"&\f")!=-1&&(p=-1);break}case 34:case 39:case 91:h+=ke(w);break;case 9:case 10:case 13:case 32:h+=Lt(g);break;case 92:h+=Nt(Pe()-1,7);continue;case 47:switch(X()){case 42:case 47:ve(Mt(Vt(W(),Pe()),t,r),u);break;default:h+="/"}break;case 123*d:c[y++]=H(h)*p;case 125*d:case 59:case 0:switch(w){case 0:case 125:v=0;case 59+l:p==-1&&(h=_(h,/\f/g,"")),k>0&&H(h)-f&&ve(k>32?Je(h+";",n,r,f-1):Je(_(h," ","")+";",n,r,f-2),u);break;case 59:h+=";";default:if(ve(x=Ke(h,t,r,y,l,a,c,S,A=[],j=[],f),i),w===123)if(l===0)Ee(h,t,x,x,A,i,f,c,j);else switch(b===99&&F(h,3)===110?100:b){case 100:case 108:case 109:case 115:Ee(e,x,x,n&&ve(Ke(e,x,x,0,0,a,c,S,a,A=[],f),j),a,j,f,c,n?A:j);break;default:Ee(h,x,x,x,[""],j,0,c,j)}}y=l=k=0,d=p=1,S=h="",f=o;break;case 58:f=1+H(h),k=g;default:if(d<1){if(w==123)--d;else if(w==125&&d++==0&&$t()==125)continue}switch(h+=be(w),w*d){case 38:p=l>0?1:(h+="\f",-1);break;case 44:c[y++]=(H(h)-1)*p,p=1;break;case 64:X()===45&&(h+=ke(W())),b=X(),l=f=H(S=h+=Ft(Pe())),w++;break;case 45:g===45&&H(h)==2&&(d=0)}}return i}function Ke(e,t,r,n,a,i,o,c,u,y,l){for(var f=a-1,b=a===0?i:[""],k=Re(b),g=0,d=0,v=0;g<n;++g)for(var p=0,w=ue(e,f+1,f=Ct(d=o[g])),S=e;p<k;++p)(S=Ge(d>0?b[p]+" "+w:_(w,/&\f/g,b[p])))&&(u[v++]=S);return xe(e,t,r,a===0?Ae:c,u,y,l)}function Mt(e,t,r){return xe(e,t,r,We,be(jt()),ue(e,2,-2),0)}function Je(e,t,r,n){return xe(e,t,r,Ce,ue(e,0,n),ue(e,n+1,-1),n)}function ie(e,t){for(var r="",n=Re(e),a=0;a<n;a++)r+=t(e[a],a,e,t)||"";return r}function Ut(e,t,r,n){switch(e.type){case At:if(e.children.length)break;case St:case Ce:return e.return=e.return||e.value;case We:return"";case Ye:return e.return=e.value+"{"+ie(e.children,n)+"}";case Ae:e.value=e.props.join(",")}return H(r=ie(e.children,n))?e.return=e.value+"{"+r+"}":""}function Dt(e){var t=Re(e);return function(r,n,a,i){for(var o="",c=0;c<t;c++)o+=e[c](r,n,a,i)||"";return o}}function zt(e){return function(t){t.root||(t=t.return)&&e(t)}}function Ze(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Wt=function(t,r,n){for(var a=0,i=0;a=i,i=X(),a===38&&i===12&&(r[n]=1),!pe(i);)W();return fe(t,D)},Yt=function(t,r){var n=-1,a=44;do switch(pe(a)){case 0:a===38&&X()===12&&(r[n]=1),t[n]+=Wt(D-1,r,n);break;case 2:t[n]+=ke(a);break;case 4:if(a===44){t[++n]=X()===58?"&\f":"",r[n]=t[n].length;break}default:t[n]+=be(a)}while(a=W());return t},Gt=function(t,r){return Xe(Yt(He(t),r))},Qe=new WeakMap,qt=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var r=t.value,n=t.parent,a=t.column===n.column&&t.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(t.props.length===1&&r.charCodeAt(0)!==58&&!Qe.get(n))&&!a){Qe.set(t,!0);for(var i=[],o=Gt(r,i),c=n.props,u=0,y=0;u<o.length;u++)for(var l=0;l<c.length;l++,y++)t.props[y]=i[u]?o[u].replace(/&\f/g,c[l]):c[l]+" "+o[u]}}},Ht=function(t){if(t.type==="decl"){var r=t.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(t.return="",t.value="")}};function et(e,t){switch(Rt(e,t)){case 5103:return E+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return E+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return E+e+ge+e+B+e+e;case 6828:case 4268:return E+e+B+e+e;case 6165:return E+e+B+"flex-"+e+e;case 5187:return E+e+_(e,/(\w+).+(:[^]+)/,E+"box-$1$2"+B+"flex-$1$2")+e;case 5443:return E+e+B+"flex-item-"+_(e,/flex-|-self/,"")+e;case 4675:return E+e+B+"flex-line-pack"+_(e,/align-content|flex-|-self/,"")+e;case 5548:return E+e+B+_(e,"shrink","negative")+e;case 5292:return E+e+B+_(e,"basis","preferred-size")+e;case 6060:return E+"box-"+_(e,"-grow","")+E+e+B+_(e,"grow","positive")+e;case 4554:return E+_(e,/([^-])(transform)/g,"$1"+E+"$2")+e;case 6187:return _(_(_(e,/(zoom-|grab)/,E+"$1"),/(image-set)/,E+"$1"),e,"")+e;case 5495:case 3959:return _(e,/(image-set\([^]*)/,E+"$1$`$1");case 4968:return _(_(e,/(.+:)(flex-)?(.*)/,E+"box-pack:$3"+B+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+E+e+e;case 4095:case 3583:case 4068:case 2532:return _(e,/(.+)-inline(.+)/,E+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(H(e)-1-t>6)switch(F(e,t+1)){case 109:if(F(e,t+4)!==45)break;case 102:return _(e,/(.+:)(.+)-([^]+)/,"$1"+E+"$2-$3$1"+ge+(F(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Te(e,"stretch")?et(_(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(F(e,t+1)!==115)break;case 6444:switch(F(e,H(e)-3-(~Te(e,"!important")&&10))){case 107:return _(e,":",":"+E)+e;case 101:return _(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+E+(F(e,14)===45?"inline-":"")+"box$3$1"+E+"$2$3$1"+B+"$2box$3")+e}break;case 5936:switch(F(e,t+11)){case 114:return E+e+B+_(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return E+e+B+_(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return E+e+B+_(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return E+e+B+e+e}return e}var Xt=function(t,r,n,a){if(t.length>-1&&!t.return)switch(t.type){case Ce:t.return=et(t.value,t.length);break;case Ye:return ie([de(t,{value:_(t.value,"@","@"+E)})],a);case Ae:if(t.length)return Ot(t.props,function(i){switch(It(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ie([de(t,{props:[_(i,/:(read-\w+)/,":"+ge+"$1")]})],a);case"::placeholder":return ie([de(t,{props:[_(i,/:(plac\w+)/,":"+E+"input-$1")]}),de(t,{props:[_(i,/:(plac\w+)/,":"+ge+"$1")]}),de(t,{props:[_(i,/:(plac\w+)/,B+"input-$1")]})],a)}return""})}},Kt=[Xt],Jt=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(d){var v=d.getAttribute("data-emotion");v.indexOf(" ")!==-1&&(document.head.appendChild(d),d.setAttribute("data-s",""))})}var a=t.stylisPlugins||Kt,i={},o,c=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(d){for(var v=d.getAttribute("data-emotion").split(" "),p=1;p<v.length;p++)i[v[p]]=!0;c.push(d)});var u,y=[qt,Ht];{var l,f=[Ut,zt(function(d){l.insert(d)})],b=Dt(y.concat(a,f)),k=function(v){return ie(Bt(v),b)};u=function(v,p,w,S){l=w,k(v?v+"{"+p.styles+"}":p.styles),S&&(g.inserted[p.name]=!0)}}var g={key:r,sheet:new _t({key:r,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:u};return g.sheet.hydrate(c),g},Zt=!0;function Qt(e,t,r){var n="";return r.split(" ").forEach(function(a){e[a]!==void 0?t.push(e[a]+";"):a&&(n+=a+" ")}),n}var tt=function(t,r,n){var a=t.key+"-"+r.name;(n===!1||Zt===!1)&&t.registered[a]===void 0&&(t.registered[a]=r.styles)},er=function(t,r,n){tt(t,r,n);var a=t.key+"-"+r.name;if(t.inserted[r.name]===void 0){var i=r;do t.insert(r===i?"."+a:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function tr(e){for(var t=0,r,n=0,a=e.length;a>=4;++n,a-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var rr={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},nr=/[A-Z]|^ms/g,ar=/_EMO_([^_]+?)_([^]*?)_EMO_/g,rt=function(t){return t.charCodeAt(1)===45},nt=function(t){return t!=null&&typeof t!="boolean"},Oe=Ze(function(e){return rt(e)?e:e.replace(nr,"-$&").toLowerCase()}),at=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(ar,function(n,a,i){return K={name:a,styles:i,next:K},a})}return rr[t]!==1&&!rt(t)&&typeof r=="number"&&r!==0?r+"px":r};function he(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var a=r;if(a.anim===1)return K={name:a.name,styles:a.styles,next:K},a.name;var i=r;if(i.styles!==void 0){var o=i.next;if(o!==void 0)for(;o!==void 0;)K={name:o.name,styles:o.styles,next:K},o=o.next;var c=i.styles+";";return c}return ir(e,t,r)}case"function":{if(e!==void 0){var u=K,y=r(e);return K=u,he(e,t,y)}break}}var l=r;if(t==null)return l;var f=t[l];return f!==void 0?f:l}function ir(e,t,r){var n="";if(Array.isArray(r))for(var a=0;a<r.length;a++)n+=he(e,t,r[a])+";";else for(var i in r){var o=r[i];if(typeof o!="object"){var c=o;t!=null&&t[c]!==void 0?n+=i+"{"+t[c]+"}":nt(c)&&(n+=Oe(i)+":"+at(i,c)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var u=0;u<o.length;u++)nt(o[u])&&(n+=Oe(i)+":"+at(i,o[u])+";");else{var y=he(e,t,o);switch(i){case"animation":case"animationName":{n+=Oe(i)+":"+y+";";break}default:n+=i+"{"+y+"}"}}}return n}var it=/label:\s*([^\s;{]+)\s*(;|$)/g,K;function or(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,a="";K=void 0;var i=e[0];if(i==null||i.raw===void 0)n=!1,a+=he(r,t,i);else{var o=i;a+=o[0]}for(var c=1;c<e.length;c++)if(a+=he(r,t,e[c]),n){var u=i;a+=u[c]}it.lastIndex=0;for(var y="",l;(l=it.exec(a))!==null;)y+="-"+l[1];var f=tr(a)+y;return{name:f,styles:a,next:K}}var sr=function(t){return t()},cr=Q.useInsertionEffect?Q.useInsertionEffect:!1,lr=cr||sr,ot=Q.createContext(typeof HTMLElement<"u"?Jt({key:"css"}):null);ot.Provider;var ur=function(t){return P.forwardRef(function(r,n){var a=P.useContext(ot);return t(r,a,n)})},dr=Q.createContext({}),fr=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,pr=Ze(function(e){return fr.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),hr=pr,mr=function(t){return t!=="theme"},st=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?hr:mr},ct=function(t,r,n){var a;if(r){var i=r.shouldForwardProp;a=t.__emotion_forwardProp&&i?function(o){return t.__emotion_forwardProp(o)&&i(o)}:i}return typeof a!="function"&&n&&(a=t.__emotion_forwardProp),a},yr=function(t){var r=t.cache,n=t.serialized,a=t.isStringTag;return tt(r,n,a),lr(function(){return er(r,n,a)}),null},gr=function e(t,r){var n=t.__emotion_real===t,a=n&&t.__emotion_base||t,i,o;r!==void 0&&(i=r.label,o=r.target);var c=ct(t,r,n),u=c||st(a),y=!u("as");return function(){var l=arguments,f=n&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&f.push("label:"+i+";"),l[0]==null||l[0].raw===void 0)f.push.apply(f,l);else{var b=l[0];f.push(b[0]);for(var k=l.length,g=1;g<k;g++)f.push(l[g],b[g])}var d=ur(function(v,p,w){var S=y&&v.as||a,A="",j=[],x=v;if(v.theme==null){x={};for(var h in v)x[h]=v[h];x.theme=Q.useContext(dr)}typeof v.className=="string"?A=Qt(p.registered,j,v.className):v.className!=null&&(A=v.className+" ");var I=or(f.concat(j),p.registered,x);A+=p.key+"-"+I.name,o!==void 0&&(A+=" "+o);var C=y&&c===void 0?st(S):u,$={};for(var R in v)y&&R==="as"||C(R)&&($[R]=v[R]);return $.className=A,w&&($.ref=w),Q.createElement(Q.Fragment,null,Q.createElement(yr,{cache:p,serialized:I,isStringTag:typeof S=="string"}),Q.createElement(S,$))});return d.displayName=i!==void 0?i:"Styled("+(typeof a=="string"?a:a.displayName||a.name||"Component")+")",d.defaultProps=t.defaultProps,d.__emotion_real=d,d.__emotion_base=a,d.__emotion_styles=f,d.__emotion_forwardProp=c,Object.defineProperty(d,"toString",{value:function(){return"."+o}}),d.withComponent=function(v,p){var w=e(v,Se({},r,p,{shouldForwardProp:ct(d,p,!0)}));return w.apply(void 0,f)},d}},br=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],oe=gr.bind(null);br.forEach(function(e){oe[e]=oe(e)});const vr=oe.div`
|
|
22
|
+
<%s key={someKey} {...props} />`,w,g,O,g),fe[g+w]=!0)}if(g=null,I!==void 0&&(r(I),g=""+I),o(b)&&(r(b.key),g=""+b.key),"key"in b){I={};for(var te in b)te!=="key"&&(I[te]=b[te])}else I=b;return g&&l(I,typeof s=="function"?s.displayName||s.name||"Unknown":s),h(s,g,W,F,a(),I,E,V)}function f(s){typeof s=="object"&&s!==null&&s.$$typeof===k&&s._store&&(s._store.validated=1)}var x=P,k=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),R=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),U=Symbol.for("react.client.reference"),$=x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=Object.prototype.hasOwnProperty,N=Array.isArray,H=console.createTask?console.createTask:function(){return null};x={"react-stack-bottom-frame":function(s){return s()}};var X,M={},oe=x["react-stack-bottom-frame"].bind(x,i)(),ee=H(n(i)),fe={};ye.Fragment=d,ye.jsx=function(s,b,I,w,F){var W=1e4>$.recentlyCreatedOwnerStacks++;return c(s,b,I,!1,w,F,W?Error("react-stack-top-frame"):oe,W?H(n(s)):ee)},ye.jsxs=function(s,b,I,w,F){var W=1e4>$.recentlyCreatedOwnerStacks++;return c(s,b,I,!0,w,F,W?Error("react-stack-top-frame"):oe,W?H(n(s)):ee)}}()),ye}var qe;function St(){return qe||(qe=1,process.env.NODE_ENV==="production"?ke.exports=Et():ke.exports=_t()),ke.exports}var Y=St();function je(){return je=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},je.apply(null,arguments)}function At(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function Ct(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var Tt=function(){function e(r){var n=this;this._insertTag=function(a){var i;n.tags.length===0?n.insertionPoint?i=n.insertionPoint.nextSibling:n.prepend?i=n.container.firstChild:i=n.before:i=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(a,i),n.tags.push(a)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Ct(this));var a=this.tags[this.tags.length-1];if(this.isSpeedy){var i=At(a);try{i.insertRule(n,i.cssRules.length)}catch{}}else a.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){var a;return(a=n.parentNode)==null?void 0:a.removeChild(n)}),this.tags=[],this.ctr=0},e}(),q="-ms-",Ee="-moz-",A="-webkit-",He="comm",Ve="rule",Le="decl",It="@import",Xe="@keyframes",Rt="@layer",Ot=Math.abs,_e=String.fromCharCode,jt=Object.assign;function Vt(e,t){return G(e,0)^45?(((t<<2^G(e,0))<<2^G(e,1))<<2^G(e,2))<<2^G(e,3):0}function Ke(e){return e.trim()}function Lt(e,t){return(e=t.exec(e))?e[0]:e}function C(e,t,r){return e.replace(t,r)}function $e(e,t){return e.indexOf(t)}function G(e,t){return e.charCodeAt(t)|0}function ge(e,t,r){return e.slice(t,r)}function ne(e){return e.length}function Ne(e){return e.length}function Se(e,t){return t.push(e),e}function $t(e,t){return e.map(t).join("")}var Ae=1,le=1,Je=0,K=0,z=0,ce="";function Ce(e,t,r,n,a,i,o){return{value:e,root:t,parent:r,type:n,props:a,children:i,line:Ae,column:le,length:o,return:""}}function ve(e,t){return jt(Ce("",null,null,"",null,null,0),e,{length:-e.length},t)}function Nt(){return z}function Ft(){return z=K>0?G(ce,--K):0,le--,z===10&&(le=1,Ae--),z}function J(){return z=K<Je?G(ce,K++):0,le++,z===10&&(le=1,Ae++),z}function ae(){return G(ce,K)}function Te(){return K}function be(e,t){return ge(ce,e,t)}function xe(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Ze(e){return Ae=le=1,Je=ne(ce=e),K=0,[]}function Qe(e){return ce="",e}function Ie(e){return Ke(be(K-1,Fe(e===91?e+2:e===40?e+1:e)))}function Bt(e){for(;(z=ae())&&z<33;)J();return xe(e)>2||xe(z)>3?"":" "}function Dt(e,t){for(;--t&&J()&&!(z<48||z>102||z>57&&z<65||z>70&&z<97););return be(e,Te()+(t<6&&ae()==32&&J()==32))}function Fe(e){for(;J();)switch(z){case e:return K;case 34:case 39:e!==34&&e!==39&&Fe(z);break;case 40:e===41&&Fe(e);break;case 92:J();break}return K}function Ut(e,t){for(;J()&&e+z!==57;)if(e+z===84&&ae()===47)break;return"/*"+be(t,K-1)+"*"+_e(e===47?e:J())}function Mt(e){for(;!xe(ae());)J();return be(e,K)}function zt(e){return Qe(Re("",null,null,null,[""],e=Ze(e),0,[0],e))}function Re(e,t,r,n,a,i,o,l,u){for(var h=0,c=0,f=o,x=0,k=0,v=0,d=1,m=1,y=1,_=0,R="",T=a,B=i,S=n,p=R;m;)switch(v=_,_=J()){case 40:if(v!=108&&G(p,f-1)==58){$e(p+=C(Ie(_),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:p+=Ie(_);break;case 9:case 10:case 13:case 32:p+=Bt(v);break;case 92:p+=Dt(Te()-1,7);continue;case 47:switch(ae()){case 42:case 47:Se(Wt(Ut(J(),Te()),t,r),u);break;default:p+="/"}break;case 123*d:l[h++]=ne(p)*y;case 125*d:case 59:case 0:switch(_){case 0:case 125:m=0;case 59+c:y==-1&&(p=C(p,/\f/g,"")),k>0&&ne(p)-f&&Se(k>32?tt(p+";",n,r,f-1):tt(C(p," ","")+";",n,r,f-2),u);break;case 59:p+=";";default:if(Se(S=et(p,t,r,h,c,a,l,R,T=[],B=[],f),i),_===123)if(c===0)Re(p,t,S,S,T,i,f,l,B);else switch(x===99&&G(p,3)===110?100:x){case 100:case 108:case 109:case 115:Re(e,S,S,n&&Se(et(e,S,S,0,0,a,l,R,a,T=[],f),B),a,B,f,l,n?T:B);break;default:Re(p,S,S,S,[""],B,0,l,B)}}h=c=k=0,d=y=1,R=p="",f=o;break;case 58:f=1+ne(p),k=v;default:if(d<1){if(_==123)--d;else if(_==125&&d++==0&&Ft()==125)continue}switch(p+=_e(_),_*d){case 38:y=c>0?1:(p+="\f",-1);break;case 44:l[h++]=(ne(p)-1)*y,y=1;break;case 64:ae()===45&&(p+=Ie(J())),x=ae(),c=f=ne(R=p+=Mt(Te())),_++;break;case 45:v===45&&ne(p)==2&&(d=0)}}return i}function et(e,t,r,n,a,i,o,l,u,h,c){for(var f=a-1,x=a===0?i:[""],k=Ne(x),v=0,d=0,m=0;v<n;++v)for(var y=0,_=ge(e,f+1,f=Ot(d=o[v])),R=e;y<k;++y)(R=Ke(d>0?x[y]+" "+_:C(_,/&\f/g,x[y])))&&(u[m++]=R);return Ce(e,t,r,a===0?Ve:l,u,h,c)}function Wt(e,t,r){return Ce(e,t,r,He,_e(Nt()),ge(e,2,-2),0)}function tt(e,t,r,n){return Ce(e,t,r,Le,ge(e,0,n),ge(e,n+1,-1),n)}function ue(e,t){for(var r="",n=Ne(e),a=0;a<n;a++)r+=t(e[a],a,e,t)||"";return r}function Yt(e,t,r,n){switch(e.type){case Rt:if(e.children.length)break;case It:case Le:return e.return=e.return||e.value;case He:return"";case Xe:return e.return=e.value+"{"+ue(e.children,n)+"}";case Ve:e.value=e.props.join(",")}return ne(r=ue(e.children,n))?e.return=e.value+"{"+r+"}":""}function Gt(e){var t=Ne(e);return function(r,n,a,i){for(var o="",l=0;l<t;l++)o+=e[l](r,n,a,i)||"";return o}}function qt(e){return function(t){t.root||(t=t.return)&&e(t)}}function rt(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Ht=function(t,r,n){for(var a=0,i=0;a=i,i=ae(),a===38&&i===12&&(r[n]=1),!xe(i);)J();return be(t,K)},Xt=function(t,r){var n=-1,a=44;do switch(xe(a)){case 0:a===38&&ae()===12&&(r[n]=1),t[n]+=Ht(K-1,r,n);break;case 2:t[n]+=Ie(a);break;case 4:if(a===44){t[++n]=ae()===58?"&\f":"",r[n]=t[n].length;break}default:t[n]+=_e(a)}while(a=J());return t},Kt=function(t,r){return Qe(Xt(Ze(t),r))},nt=new WeakMap,Jt=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var r=t.value,n=t.parent,a=t.column===n.column&&t.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(t.props.length===1&&r.charCodeAt(0)!==58&&!nt.get(n))&&!a){nt.set(t,!0);for(var i=[],o=Kt(r,i),l=n.props,u=0,h=0;u<o.length;u++)for(var c=0;c<l.length;c++,h++)t.props[h]=i[u]?o[u].replace(/&\f/g,l[c]):l[c]+" "+o[u]}}},Zt=function(t){if(t.type==="decl"){var r=t.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(t.return="",t.value="")}};function at(e,t){switch(Vt(e,t)){case 5103:return A+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return A+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return A+e+Ee+e+q+e+e;case 6828:case 4268:return A+e+q+e+e;case 6165:return A+e+q+"flex-"+e+e;case 5187:return A+e+C(e,/(\w+).+(:[^]+)/,A+"box-$1$2"+q+"flex-$1$2")+e;case 5443:return A+e+q+"flex-item-"+C(e,/flex-|-self/,"")+e;case 4675:return A+e+q+"flex-line-pack"+C(e,/align-content|flex-|-self/,"")+e;case 5548:return A+e+q+C(e,"shrink","negative")+e;case 5292:return A+e+q+C(e,"basis","preferred-size")+e;case 6060:return A+"box-"+C(e,"-grow","")+A+e+q+C(e,"grow","positive")+e;case 4554:return A+C(e,/([^-])(transform)/g,"$1"+A+"$2")+e;case 6187:return C(C(C(e,/(zoom-|grab)/,A+"$1"),/(image-set)/,A+"$1"),e,"")+e;case 5495:case 3959:return C(e,/(image-set\([^]*)/,A+"$1$`$1");case 4968:return C(C(e,/(.+:)(flex-)?(.*)/,A+"box-pack:$3"+q+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+A+e+e;case 4095:case 3583:case 4068:case 2532:return C(e,/(.+)-inline(.+)/,A+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ne(e)-1-t>6)switch(G(e,t+1)){case 109:if(G(e,t+4)!==45)break;case 102:return C(e,/(.+:)(.+)-([^]+)/,"$1"+A+"$2-$3$1"+Ee+(G(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~$e(e,"stretch")?at(C(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(G(e,t+1)!==115)break;case 6444:switch(G(e,ne(e)-3-(~$e(e,"!important")&&10))){case 107:return C(e,":",":"+A)+e;case 101:return C(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+A+(G(e,14)===45?"inline-":"")+"box$3$1"+A+"$2$3$1"+q+"$2box$3")+e}break;case 5936:switch(G(e,t+11)){case 114:return A+e+q+C(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return A+e+q+C(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return A+e+q+C(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return A+e+q+e+e}return e}var Qt=function(t,r,n,a){if(t.length>-1&&!t.return)switch(t.type){case Le:t.return=at(t.value,t.length);break;case Xe:return ue([ve(t,{value:C(t.value,"@","@"+A)})],a);case Ve:if(t.length)return $t(t.props,function(i){switch(Lt(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ue([ve(t,{props:[C(i,/:(read-\w+)/,":"+Ee+"$1")]})],a);case"::placeholder":return ue([ve(t,{props:[C(i,/:(plac\w+)/,":"+A+"input-$1")]}),ve(t,{props:[C(i,/:(plac\w+)/,":"+Ee+"$1")]}),ve(t,{props:[C(i,/:(plac\w+)/,q+"input-$1")]})],a)}return""})}},er=[Qt],tr=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(d){var m=d.getAttribute("data-emotion");m.indexOf(" ")!==-1&&(document.head.appendChild(d),d.setAttribute("data-s",""))})}var a=t.stylisPlugins||er,i={},o,l=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(d){for(var m=d.getAttribute("data-emotion").split(" "),y=1;y<m.length;y++)i[m[y]]=!0;l.push(d)});var u,h=[Jt,Zt];{var c,f=[Yt,qt(function(d){c.insert(d)})],x=Gt(h.concat(a,f)),k=function(m){return ue(zt(m),x)};u=function(m,y,_,R){c=_,k(m?m+"{"+y.styles+"}":y.styles),R&&(v.inserted[y.name]=!0)}}var v={key:r,sheet:new Tt({key:r,container:o,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:i,registered:{},insert:u};return v.sheet.hydrate(l),v},rr=!0;function nr(e,t,r){var n="";return r.split(" ").forEach(function(a){e[a]!==void 0?t.push(e[a]+";"):a&&(n+=a+" ")}),n}var it=function(t,r,n){var a=t.key+"-"+r.name;(n===!1||rr===!1)&&t.registered[a]===void 0&&(t.registered[a]=r.styles)},ar=function(t,r,n){it(t,r,n);var a=t.key+"-"+r.name;if(t.inserted[r.name]===void 0){var i=r;do t.insert(r===i?"."+a:"",i,t.sheet,!0),i=i.next;while(i!==void 0)}};function ir(e){for(var t=0,r,n=0,a=e.length;a>=4;++n,a-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var or={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},sr=/[A-Z]|^ms/g,lr=/_EMO_([^_]+?)_([^]*?)_EMO_/g,ot=function(t){return t.charCodeAt(1)===45},st=function(t){return t!=null&&typeof t!="boolean"},Be=rt(function(e){return ot(e)?e:e.replace(sr,"-$&").toLowerCase()}),lt=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(lr,function(n,a,i){return ie={name:a,styles:i,next:ie},a})}return or[t]!==1&&!ot(t)&&typeof r=="number"&&r!==0?r+"px":r};function we(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var a=r;if(a.anim===1)return ie={name:a.name,styles:a.styles,next:ie},a.name;var i=r;if(i.styles!==void 0){var o=i.next;if(o!==void 0)for(;o!==void 0;)ie={name:o.name,styles:o.styles,next:ie},o=o.next;var l=i.styles+";";return l}return cr(e,t,r)}case"function":{if(e!==void 0){var u=ie,h=r(e);return ie=u,we(e,t,h)}break}}var c=r;if(t==null)return c;var f=t[c];return f!==void 0?f:c}function cr(e,t,r){var n="";if(Array.isArray(r))for(var a=0;a<r.length;a++)n+=we(e,t,r[a])+";";else for(var i in r){var o=r[i];if(typeof o!="object"){var l=o;t!=null&&t[l]!==void 0?n+=i+"{"+t[l]+"}":st(l)&&(n+=Be(i)+":"+lt(i,l)+";")}else if(Array.isArray(o)&&typeof o[0]=="string"&&(t==null||t[o[0]]===void 0))for(var u=0;u<o.length;u++)st(o[u])&&(n+=Be(i)+":"+lt(i,o[u])+";");else{var h=we(e,t,o);switch(i){case"animation":case"animationName":{n+=Be(i)+":"+h+";";break}default:n+=i+"{"+h+"}"}}}return n}var ct=/label:\s*([^\s;{]+)\s*(;|$)/g,ie;function ur(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,a="";ie=void 0;var i=e[0];if(i==null||i.raw===void 0)n=!1,a+=we(r,t,i);else{var o=i;a+=o[0]}for(var l=1;l<e.length;l++)if(a+=we(r,t,e[l]),n){var u=i;a+=u[l]}ct.lastIndex=0;for(var h="",c;(c=ct.exec(a))!==null;)h+="-"+c[1];var f=ir(a)+h;return{name:f,styles:a,next:ie}}var dr=function(t){return t()},fr=se.useInsertionEffect?se.useInsertionEffect:!1,pr=fr||dr,ut=se.createContext(typeof HTMLElement<"u"?tr({key:"css"}):null);ut.Provider;var hr=function(t){return P.forwardRef(function(r,n){var a=P.useContext(ut);return t(r,a,n)})},mr=se.createContext({}),yr=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,gr=rt(function(e){return yr.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),vr=gr,br=function(t){return t!=="theme"},dt=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?vr:br},ft=function(t,r,n){var a;if(r){var i=r.shouldForwardProp;a=t.__emotion_forwardProp&&i?function(o){return t.__emotion_forwardProp(o)&&i(o)}:i}return typeof a!="function"&&n&&(a=t.__emotion_forwardProp),a},xr=function(t){var r=t.cache,n=t.serialized,a=t.isStringTag;return it(r,n,a),pr(function(){return ar(r,n,a)}),null},wr=function e(t,r){var n=t.__emotion_real===t,a=n&&t.__emotion_base||t,i,o;r!==void 0&&(i=r.label,o=r.target);var l=ft(t,r,n),u=l||dt(a),h=!u("as");return function(){var c=arguments,f=n&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&f.push("label:"+i+";"),c[0]==null||c[0].raw===void 0)f.push.apply(f,c);else{var x=c[0];f.push(x[0]);for(var k=c.length,v=1;v<k;v++)f.push(c[v],x[v])}var d=hr(function(m,y,_){var R=h&&m.as||a,T="",B=[],S=m;if(m.theme==null){S={};for(var p in m)S[p]=m[p];S.theme=se.useContext(mr)}typeof m.className=="string"?T=nr(y.registered,B,m.className):m.className!=null&&(T=m.className+" ");var D=ur(f.concat(B),y.registered,S);T+=y.key+"-"+D.name,o!==void 0&&(T+=" "+o);var L=h&&l===void 0?dt(R):u,U={};for(var $ in m)h&&$==="as"||L($)&&(U[$]=m[$]);return U.className=T,_&&(U.ref=_),se.createElement(se.Fragment,null,se.createElement(xr,{cache:y,serialized:D,isStringTag:typeof R=="string"}),se.createElement(R,U))});return d.displayName=i!==void 0?i:"Styled("+(typeof a=="string"?a:a.displayName||a.name||"Component")+")",d.defaultProps=t.defaultProps,d.__emotion_real=d,d.__emotion_base=a,d.__emotion_styles=f,d.__emotion_forwardProp=l,Object.defineProperty(d,"toString",{value:function(){return"."+o}}),d.withComponent=function(m,y){var _=e(m,je({},r,y,{shouldForwardProp:ft(d,y,!0)}));return _.apply(void 0,f)},d}},Pr=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],de=wr.bind(null);Pr.forEach(function(e){de[e]=de(e)});const kr=de.div`
|
|
23
23
|
display: flex;
|
|
24
24
|
align-items: center;
|
|
25
25
|
justify-content: center;
|
|
@@ -47,7 +47,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
47
47
|
background-color: rgba(255, 165, 0, 0.1);
|
|
48
48
|
border: 1px solid orange;
|
|
49
49
|
`;default:return""}}}
|
|
50
|
-
`,
|
|
50
|
+
`,De=({type:e,children:t,className:r,icon:n,action:a})=>Y.jsxs(kr,{type:e,className:r,children:[n&&Y.jsx("span",{children:n}),Y.jsx("span",{children:t}),a&&Y.jsx("span",{children:a})]}),Ue=de.div`
|
|
51
51
|
width: ${({width:e})=>e||"100%"};
|
|
52
52
|
height: ${({height:e})=>e||"100%"};
|
|
53
53
|
border-radius: 0px !important; /* Force remove rounded corners on container */
|
|
@@ -59,7 +59,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
59
59
|
|
|
60
60
|
/* Hide specific elements inside the player */
|
|
61
61
|
${({$hiddenClasses:e})=>(e==null?void 0:e.length)&&e.map(t=>`.${t} { display: none !important; }`).join("")}
|
|
62
|
-
`,
|
|
62
|
+
`,pt=de.div`
|
|
63
63
|
position: fixed;
|
|
64
64
|
top: 0;
|
|
65
65
|
left: 0;
|
|
@@ -71,7 +71,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
71
71
|
align-items: center;
|
|
72
72
|
z-index: 1000;
|
|
73
73
|
pointer-events: auto;
|
|
74
|
-
`,
|
|
74
|
+
`,ht=de.div`
|
|
75
75
|
position: relative;
|
|
76
76
|
width: min(360px, 100%);
|
|
77
77
|
max-width: 360px;
|
|
@@ -83,4 +83,4 @@ React keys must be passed directly to JSX without using spread:
|
|
|
83
83
|
width: 100%;
|
|
84
84
|
max-width: 100%;
|
|
85
85
|
}
|
|
86
|
-
`,wr=(e,t)=>`https://vp-api.gjirafa.tech/api/v2/projects/${e}/videos?search=${t}`,dt=(e,t)=>`https://vp-api.gjirafa.tech/api/projects/${e}/playlists/${t}/videos`,xr=(e,t)=>`https://vp-api.gjirafa.tech/api/projects/${e}/playlists/${t}`,Pr=e=>`https://host.vpplayer.tech/player/${e}/vpplayer.js`,Le=(e,t)=>`vp-player-${e||"default"}-${t||""}`,Ne=new Map,ft=(e,t)=>{const[r,n]=P.useState(!1),[a,i]=P.useState(null);return P.useEffect(()=>{let o=null,c,u=0;const y=3;let l;try{l=t||Pr(e||"latest")}catch(k){const g=k instanceof Error?k.message:String(k);i(`Failed to resolve script URL: ${g}`),n(!1);return}if(Ne.get(l)){n(!0),i(null);return}if(document.querySelector(`script[src="${l}"]`)){Ne.set(l,!0),n(!0),i(null);return}const b=()=>{o=document.createElement("script"),o.src=l,o.async=!0,c=window.setTimeout(()=>{n(!1),i(`Loading script timed out: ${l}`)},1e4),o.onload=()=>{clearTimeout(c),Ne.set(l,!0),n(!0),i(null)},o.onerror=()=>{clearTimeout(c),u++,u<y?setTimeout(b,1e3*u):(n(!1),i(`Failed to load VP Player script after ${y} attempts: ${l}`))},document.body.appendChild(o)};return b(),()=>{clearTimeout(c),o&&document.body.contains(o)&&document.body.removeChild(o)}},[e,t]),{isLoaded:r,error:a}},kr={},me=new Map,Er=3e4,Ve=5,pt=({projectId:e,videoId:t,playlistId:r,videoUrl:n,apiKey:a})=>{const[i,o]=P.useState(null),[c,u]=P.useState(null),[y,l]=P.useState(!1),[f,b]=P.useState(null),k=a||(typeof kr<"u"?"1CFC4B619E9342B6BAC4879BA8C30CF216C4BA9D3F084B11825F4AB2D5CF845E":void 0);return P.useEffect(()=>{const g=t?`video:${t}`:r?`playlist:${r}`:null;if(!e||n||!t&&!r){o(n||null),u(null),l(!1),b(null);return}if(!k){l(!1),b("No API key provided");return}if(g&&me.has(g)){const A=me.get(g);o(A.url),u(A.playlist),l(!1),b(null);return}let d=!0;const v=new AbortController,p=v.signal,S=setTimeout(async()=>{var j,x,h,I;if(!d)return;l(!0),b(null);let A=0;for(;A<Ve&&d;)try{const C=t&&!r?wr(e,t):dt(e,r),$=setTimeout(()=>v.abort(),Er),R=await fetch(C,{method:"GET",headers:{"api-key":k,Accept:"application/json","Cache-Control":"no-cache"},signal:p});if(clearTimeout($),!R.ok)throw new Error(`Fetch failed with status ${R.status}`);const z=await R.json();if(!d)return;if(t&&!r){const Y=(x=(j=z.result)==null?void 0:j.items)==null?void 0:x.find(V=>V.mediaId===t);if(!(Y!=null&&Y.playbackUrl))throw new Error("Invalid video data");o(Y.playbackUrl),u(null),g&&me.set(g,{url:Y.playbackUrl,playlist:null})}else{if(!Array.isArray(z.result))throw new Error("Invalid playlist format");const Y=xr(e,r),V=await fetch(Y,{method:"GET",headers:{"api-key":k,Accept:"application/json","Cache-Control":"no-cache"},signal:p});if(V.ok){const G=await V.json();let q=[...z.result];if((h=G.result)!=null&&h.playlistBackupState&&((I=G.result)!=null&&I.playlistBackupId)){const ee=dt(e,G.result.playlistBackupId),J=await fetch(ee,{method:"GET",headers:{"api-key":k,Accept:"application/json","Cache-Control":"no-cache"},signal:p});if(J.ok){const te=await J.json();if(Array.isArray(te.result)){const s=te.result.map(m=>({...m,isBackupPlaylist:!0}));q=[...q,...s]}}}u(q),o(null),g&&me.set(g,{url:null,playlist:q})}else u(z.result),o(null),g&&me.set(g,{url:null,playlist:z.result})}break}catch(C){if(p.aborted){d&&b("Request timed out");break}if(A++,A>=Ve){const $=C instanceof Error?C.message:String(C);d&&b(`Failed after ${Ve} attempts: ${$}`)}else await new Promise($=>setTimeout($,2e3))}d&&l(!1)},100);return()=>{d=!1,clearTimeout(S),v.abort()}},[k,e,t,r,n]),{fetchedPlaybackUrl:i,fetchedPlaylist:c,isLoading:y,error:f}},_r={projectId:"vp-player-projectId",video:{file:"",playlist:{state:!0,playlistVideoIndex:0,videos:[]}},config:{autoplay:!0,muted:!0,loop:!1,size:{width:"100%",height:"30vh"},controls:{settingsButton:!0,chromecastButton:!1,nextButton:!0,fullscreenButton:!0,airplayButton:!1,bigPlayButton:!1,autopausePlayButton:!0,pictureInPictureButton:!1,relatedButton:!1,volumeButton:!0,shareButton:!0}}},ht=({videoUrl:e,fetchedPlaybackUrl:t,fetchedPlaylist:r,projectId:n,config:a={},isVerticalPlayer:i})=>{var l,f,b,k,g,d,v,p,w,S,A,j,x;const o={..._r,...a},c={...o.config,...a.config};if(e)return{...o,video:{...o.video,file:e,playlist:void 0},config:c};if(t)return{...o,video:{...o.video,file:t,playlist:void 0},config:c};if(r&&r.length>0){const h=((f=(l=a==null?void 0:a.video)==null?void 0:l.playlist)==null?void 0:f.playlistVideoIndex)??((b=a==null?void 0:a.config)==null?void 0:b.playlistVideoIndex)??0;return i?{...o,projectId:n||"vp-player-projectId",video:{...o.video,file:(k=r[0])==null?void 0:k.hlsUrl,title:(g=r[0])==null?void 0:g.title,playlist:{state:!0,playlistId:"",playlistVideoIndex:Number(h),videos:r.slice(1).map((C,$)=>({videoId:String($+1),title:C.title,file:C.hlsUrl,thumbnailUrl:C.thumbnailUrl,duration:C.duration}))}},config:c}:{...o,projectId:n||"vp-player-projectId",video:{...o.video,file:((d=r[Number(h)])==null?void 0:d.hlsUrl)||((v=r[0])==null?void 0:v.hlsUrl)||"",title:((p=r[Number(h)])==null?void 0:p.title)||((w=r[0])==null?void 0:w.title),thumbnail:((S=r[Number(h)])==null?void 0:S.thumbnailUrl)||((A=r[0])==null?void 0:A.thumbnailUrl),playlist:{state:!0,playlistVideoIndex:Number(h),videos:r.map((C,$)=>({videoId:String($),title:C.title,file:C.hlsUrl,thumbnailUrl:C.thumbnailUrl,duration:C.duration}))}},config:c}}const u=((j=a==null?void 0:a.video)==null?void 0:j.playlist)||o.video.playlist,y=(x=a==null?void 0:a.video)==null?void 0:x.file;if(y)return{...o,video:{...o.video,file:y,playlist:void 0},config:c};if(u!=null&&u.videos&&u.videos.length>0){const h=u.videos[Number(u.playlistVideoIndex)||0];return{...o,video:{...o.video,file:(h==null?void 0:h.file)||"",playlist:{...u,state:u.state??!0,playlistVideoIndex:Number(u.playlistVideoIndex||0),videos:u.videos}},config:{...o.config,...a==null?void 0:a.config}}}throw new Error("No valid video source found. Provide videoUrl, videoId, playlistId, or config with video.file or playlist.")},mt=e=>{if(!e)return;const t=/https:\/\/host\.vpplayer\.tech\/player\/([^/]+)\/([^/]+)(?:\/[^/]+)?\.js/,r=e.match(t);return r?r[2]:void 0},yt=({playerId:e,videoId:t,version:r,videoUrl:n,projectId:a,playlistId:i,scriptUrl:o,config:c={},apiKey:u,isReels:y=!1,onPlaylistData:l})=>{const f=P.useRef(null),b=P.useRef(null),{isLoaded:k,error:g}=ft(r,o),d=t||mt(o),[v,p]=P.useState(null),{fetchedPlaybackUrl:w,fetchedPlaylist:S,isLoading:A,error:j}=pt({projectId:a,videoId:d,playlistId:i,videoUrl:n,apiKey:u}),x=Le(e,d);P.useEffect(()=>{S&&l&&l(S)},[S,l]);const h=P.useMemo(()=>{const I=c.config||{},C=y&&!I.size?{sizeType:"RESPONSIVE",aspectRatio:"9:16"}:I.size||{sizeType:"FIXED",width:"100%"};return{...c,config:{...I,size:C}}},[c,y]);return P.useEffect(()=>{if(g){p(g);return}if(!k||A&&!n)return;let I=!0;const $=setTimeout(async()=>{try{const R=o==null?void 0:o.includes("vertical-player");if(document.querySelectorAll('[id*="player"]').forEach(ee=>{var te,s;const J=ee.id;if(J!==x)try{const m=R?(te=window.vpVerticalPlayer)==null?void 0:te.call(window,J):(s=window.vpPlayer)==null?void 0:s.call(window,J);m!=null&&m.destroy&&m.destroy()}catch(m){console.warn(`Failed to destroy existing player ${J}:`,m)}}),await new Promise(ee=>setTimeout(ee,100)),!I||!f.current)return;if(!document.getElementById(x)){p("DOM element not found after cleanup.");return}if(!window.vpPlayer&&!window.vpVerticalPlayer){p("VP Player script not loaded.");return}const V=R?window.vpVerticalPlayer:window.vpPlayer;if(!V){p(`VP ${R?"Vertical ":""}Player script not loaded.`);return}const G=ht({videoUrl:n,fetchedPlaybackUrl:w??void 0,fetchedPlaylist:S??void 0,projectId:a,config:h,isVerticalPlayer:R}),q=V(x);if(!q){p(`Failed to create VP ${R?"Vertical ":""}Player instance.`);return}I&&f.current&&(q.setup(G),b.current=q,p(null))}catch(R){if(I){const z=R instanceof Error?R.message:String(R);p(z),console.error("VP Player initialization error:",R)}}},150);return()=>{I=!1,clearTimeout($)}},[k,A,n,w,S,a,h,x,g,o]),P.useEffect(()=>()=>{if(b.current){try{b.current.destroy&&b.current.destroy()}catch(C){console.warn(`Failed to destroy player ${x}:`,C)}b.current=null}const I=document.getElementById(x);I&&(I.innerHTML="")},[x]),{playerRef:f,playerInstanceRef:b,isScriptLoaded:k,isLoading:A,error:j||v||g}},gt=({playerId:e,videoId:t,version:r,videoUrl:n,projectId:a,playlistId:i,scriptUrl:o,config:c={},apiKey:u,isReels:y=!1,hiddenClasses:l=[],onClose:f,className:b,onPlaylistData:k})=>{var $,R,z,Y;const{playerRef:g,playerInstanceRef:d,isScriptLoaded:v,isLoading:p,error:w}=yt({playerId:e,videoId:t,version:r,videoUrl:n,projectId:a,playlistId:i,scriptUrl:o,config:c,apiKey:u,isReels:y,onPlaylistData:k}),[S,A]=P.useState(!0),j=()=>y&&A(!0),x=()=>{var V,G;A(!1),(G=(V=d.current)==null?void 0:V.play)==null||G.call(V),f==null||f()},h=(R=($=c==null?void 0:c.config)==null?void 0:$.size)!=null&&R.width?typeof c.config.size.width=="number"?`${c.config.size.width}px`:c.config.size.width:void 0,I=(Y=(z=c==null?void 0:c.config)==null?void 0:z.size)!=null&&Y.height?typeof c.config.size.height=="number"?`${c.config.size.height}px`:c.config.size.height:void 0,C=Le(e,t);return w?N.jsxs(je,{type:"error",children:["An error occurred: ",w]}):p||!v?N.jsx(je,{type:"loading",children:"Loading..."}):N.jsxs(N.Fragment,{children:[y&&!S?N.jsx("div",{onClick:j}):null,!y&&N.jsx("div",{children:N.jsx($e,{id:C,ref:g,width:h||"100%",height:I||"auto",$hiddenClasses:l,className:b})},C),y&&S&&N.jsx(lt,{onClick:x,className:b,children:N.jsx(ut,{className:b,onClick:V=>V.stopPropagation(),children:N.jsx("div",{children:N.jsx($e,{id:C,ref:g,width:"100%",height:"auto",$hiddenClasses:l,className:b})},C)})})]})},bt=P.createContext(void 0),Sr=({children:e})=>{const[t,r]=P.useState(!1),[n,a]=P.useState(null),[i,o]=P.useState(null),c=P.useCallback(l=>{try{const f=Le(l.playerId,l.videoId);a({...l,playerId:f}),r(!0),o(null)}catch{o("Failed to show player.")}},[]),u=P.useCallback(()=>{r(!1),a(null),o(null)},[]),y=P.useMemo(()=>({showPlayer:c,hidePlayer:u,isPlayerVisible:t,playerParams:n}),[c,u,t,n]);return N.jsxs(bt.Provider,{value:y,children:[e,i&&N.jsx(je,{type:"error",children:i}),t&&(n==null?void 0:n.playerId)&&N.jsx(gt,{playerId:n.playerId,videoId:n.videoId,projectId:n.projectId,videoUrl:n.videoUrl,version:n.version,playlistId:n.playlistId,scriptUrl:n.scriptUrl,config:n.config,isReels:n.isReels,thumbnailUrl:n.thumbnailUrl,onClose:u,hiddenClasses:n.hiddenClasses||[],apiKey:n.apiKey,className:n.className})]})},Ar=()=>{const e=P.useContext(bt);if(!e)throw new Error("useVPPlayer must be used within a VPPlayerProvider");return e},Cr={projectId:"vp-player-projectId",video:{file:"",playlist:{state:!0,playlistVideoIndex:0,videos:[]}},config:{autoplay:!0,pauseOtherVideos:!0,focusOnAutostart:!1,muted:!0,loop:!1,size:{width:"100%"},controls:{settingsButton:!0,chromecastButton:!1,nextButton:!1,fullscreenButton:!0,airplayButton:!1,bigPlayButton:!1,autopausePlayButton:!0,pictureInPictureButton:!1,relatedButton:!1,volumeButton:!0,shareButton:!0}}},Tr={config:{autostartOnLoad:{state:!0,onMobile:!0,onData:!0},muted:!0}},Rr={config:{autoplay:!0,muted:!0}},_e={video:{advertising:!0,ads:{skipAd:{state:!0,skipFrom:5}}},config:{adAnnouncement:{state:!0,timeBeforeAd:5},adsRequireInteraction:!1}},Ir=(e,t,r="time",n=0)=>{var a;return{..._e,video:{..._e.video,ads:{...(a=_e.video)==null?void 0:a.ads,adBreaks:[{adTagUrl:t,breakType:e,breakTimingType:r,breakTimingValue:n}]}}}},Or="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",jr="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4",$r="https://videos.pexels.com/video-files/4678261/4678261-hd_1080_1920_25fps.mp4",Lr="https://images.pexels.com/videos/4678261/pexels-photo-4678261.jpeg?auto=compress&cs=tinysrgb&w=600",Nr="https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=",Vr="https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=";T.AD_TAG_LINEAR_URL=Nr,T.AD_TAG_SKIPPABLE_LINEAR_URL=Vr,T.BIG_BUCK_BUNNY_URL=Or,T.ELEPHANTS_DREAM_URL=jr,T.Overlay=lt,T.PEXELS_THUMBNAIL_URL=Lr,T.PEXELS_VERTICAL_VIDEO_URL=$r,T.PlayerContainer=$e,T.PlayerWrapper=ut,T.VPPlayer=gt,T.VPPlayerProvider=Sr,T.baseConfig=Tr,T.baseConfigWithAds=_e,T.baseConfigWithAutoplay=Rr,T.buildVPPlayerConfig=ht,T.defaultVPPlayerConfig=Cr,T.extractVideoId=mt,T.getAdConfig=Ir,T.useVPPlayer=Ar,T.useVPPlayerLogic=yt,T.useVPPlayerScript=ft,T.useVideoData=pt,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
|
|
86
|
+
`,Er=(e,t)=>`https://vp-api.gjirafa.tech/api/v2/projects/${e}/videos?search=${t}`,mt=(e,t)=>`https://vp-api.gjirafa.tech/api/projects/${e}/playlists/${t}/videos`,_r=(e,t)=>`https://vp-api.gjirafa.tech/api/projects/${e}/playlists/${t}`,Sr=e=>`https://host.vpplayer.tech/player/${e}/vpplayer.js`,Me=(e,t)=>`vp-player-${e||"default"}-${t||""}`,ze=new Map,yt=(e,t)=>{const[r,n]=P.useState(!1),[a,i]=P.useState(null);return P.useEffect(()=>{let o=null,l,u=0;const h=3;let c;try{c=t||Sr(e||"latest")}catch(k){const v=k instanceof Error?k.message:String(k);i(`Failed to resolve script URL: ${v}`),n(!1);return}if(ze.get(c)){n(!0),i(null);return}if(document.querySelector(`script[src="${c}"]`)){ze.set(c,!0),n(!0),i(null);return}const x=()=>{o=document.createElement("script"),o.src=c,o.async=!0,l=window.setTimeout(()=>{n(!1),i(`Loading script timed out: ${c}`)},1e4),o.onload=()=>{clearTimeout(l),ze.set(c,!0),n(!0),i(null)},o.onerror=()=>{clearTimeout(l),u++,u<h?setTimeout(x,1e3*u):(n(!1),i(`Failed to load VP Player script after ${h} attempts: ${c}`))},document.body.appendChild(o)};return x(),()=>{clearTimeout(l),o&&document.body.contains(o)&&document.body.removeChild(o)}},[e,t]),{isLoaded:r,error:a}},Ar={},Pe=new Map,Cr=3e4,We=5,gt=({projectId:e,videoId:t,playlistId:r,videoUrl:n,apiKey:a})=>{const[i,o]=P.useState(null),[l,u]=P.useState(null),[h,c]=P.useState(!1),[f,x]=P.useState(null),k=a||(typeof Ar<"u"?"1CFC4B619E9342B6BAC4879BA8C30CF216C4BA9D3F084B11825F4AB2D5CF845E":void 0);return P.useEffect(()=>{const v=t?`video:${t}`:r?`playlist:${r}`:null;if(!e||n||!t&&!r){o(n||null),u(null),c(!1),x(null);return}if(!k){c(!1),x("No API key provided");return}if(v&&Pe.has(v)){const T=Pe.get(v);o(T.url),u(T.playlist),c(!1),x(null);return}let d=!0;const m=new AbortController,y=m.signal,R=setTimeout(async()=>{var B,S,p,D;if(!d)return;c(!0),x(null);let T=0;for(;T<We&&d;)try{const L=t&&!r?Er(e,t):mt(e,r),U=setTimeout(()=>m.abort(),Cr),$=await fetch(L,{method:"GET",headers:{"api-key":k,Accept:"application/json","Cache-Control":"no-cache"},signal:y});if(clearTimeout(U),!$.ok)throw new Error(`Fetch failed with status ${$.status}`);const Z=await $.json();if(!d)return;if(t&&!r){const N=(S=(B=Z.result)==null?void 0:B.items)==null?void 0:S.find(H=>H.mediaId===t);if(!(N!=null&&N.playbackUrl))throw new Error("Invalid video data");o(N.playbackUrl),u(null),v&&Pe.set(v,{url:N.playbackUrl,playlist:null})}else{if(!Array.isArray(Z.result))throw new Error("Invalid playlist format");const N=_r(e,r),H=await fetch(N,{method:"GET",headers:{"api-key":k,Accept:"application/json","Cache-Control":"no-cache"},signal:y});if(H.ok){const X=await H.json();let M=[...Z.result];if((p=X.result)!=null&&p.playlistBackupState&&((D=X.result)!=null&&D.playlistBackupId)){const oe=mt(e,X.result.playlistBackupId),ee=await fetch(oe,{method:"GET",headers:{"api-key":k,Accept:"application/json","Cache-Control":"no-cache"},signal:y});if(ee.ok){const fe=await ee.json();if(Array.isArray(fe.result)){const s=fe.result.map(b=>({...b,isBackupPlaylist:!0}));M=[...M,...s]}}}u(M),o(null),v&&Pe.set(v,{url:null,playlist:M})}else u(Z.result),o(null),v&&Pe.set(v,{url:null,playlist:Z.result})}break}catch(L){if(y.aborted){d&&x("Request timed out");break}if(T++,T>=We){const U=L instanceof Error?L.message:String(L);d&&x(`Failed after ${We} attempts: ${U}`)}else await new Promise(U=>setTimeout(U,2e3))}d&&c(!1)},100);return()=>{d=!1,clearTimeout(R),m.abort()}},[k,e,t,r,n]),{fetchedPlaybackUrl:i,fetchedPlaylist:l,isLoading:h,error:f}},Tr={projectId:"vp-player-projectId",video:{file:"",playlist:{state:!0,playlistVideoIndex:0,videos:[]}},config:{autoplay:!0,muted:!0,loop:!1,size:{width:"100%",height:"30vh"},controls:{settingsButton:!0,chromecastButton:!1,nextButton:!0,fullscreenButton:!0,airplayButton:!1,bigPlayButton:!1,autopausePlayButton:!0,pictureInPictureButton:!1,relatedButton:!1,volumeButton:!0,shareButton:!0}}},vt=({videoUrl:e,fetchedPlaybackUrl:t,fetchedPlaylist:r,projectId:n,config:a={},isVerticalPlayer:i})=>{var c,f,x,k,v,d,m,y,_,R,T,B,S;const o={...Tr,...a},l={...o.config,...a.config};if(e)return{...o,video:{...o.video,file:e,playlist:void 0},config:l};if(t)return{...o,video:{...o.video,file:t,playlist:void 0},config:l};if(r&&r.length>0){const p=((f=(c=a==null?void 0:a.video)==null?void 0:c.playlist)==null?void 0:f.playlistVideoIndex)??((x=a==null?void 0:a.config)==null?void 0:x.playlistVideoIndex)??0;return i?{...o,projectId:n||"vp-player-projectId",video:{...o.video,file:(k=r[0])==null?void 0:k.hlsUrl,title:(v=r[0])==null?void 0:v.title,playlist:{state:!0,playlistId:"",playlistVideoIndex:Number(p),videos:r.slice(1).map((L,U)=>({videoId:String(U+1),title:L.title,file:L.hlsUrl,thumbnailUrl:L.thumbnailUrl,duration:L.duration}))}},config:l}:{...o,projectId:n||"vp-player-projectId",video:{...o.video,file:((d=r[Number(p)])==null?void 0:d.hlsUrl)||((m=r[0])==null?void 0:m.hlsUrl)||"",title:((y=r[Number(p)])==null?void 0:y.title)||((_=r[0])==null?void 0:_.title),thumbnail:((R=r[Number(p)])==null?void 0:R.thumbnailUrl)||((T=r[0])==null?void 0:T.thumbnailUrl),playlist:{state:!0,playlistVideoIndex:Number(p),videos:r.map((L,U)=>({videoId:String(U),title:L.title,file:L.hlsUrl,thumbnailUrl:L.thumbnailUrl,duration:L.duration}))}},config:l}}const u=((B=a==null?void 0:a.video)==null?void 0:B.playlist)||o.video.playlist,h=(S=a==null?void 0:a.video)==null?void 0:S.file;if(h)return{...o,video:{...o.video,file:h,playlist:void 0},config:l};if(u!=null&&u.videos&&u.videos.length>0){const p=u.videos[Number(u.playlistVideoIndex)||0];return{...o,video:{...o.video,file:(p==null?void 0:p.file)||"",playlist:{...u,state:u.state??!0,playlistVideoIndex:Number(u.playlistVideoIndex||0),videos:u.videos}},config:{...o.config,...a==null?void 0:a.config}}}throw new Error("No valid video source found. Provide videoUrl, videoId, playlistId, or config with video.file or playlist.")},bt=e=>{if(!e)return;const t=/https:\/\/host\.vpplayer\.tech\/player\/([^/]+)\/([^/]+)(?:\/[^/]+)?\.js/,r=e.match(t);return r?r[2]:void 0},xt=({playerId:e,videoId:t,version:r,videoUrl:n,projectId:a,playlistId:i,scriptUrl:o,config:l={},apiKey:u,isReels:h=!1,onPlaylistData:c,onVideoStarted:f})=>{const x=P.useRef(null),k=P.useRef(null),v=P.useRef(!1),d=P.useRef(""),m=P.useRef([]),y=P.useRef([]),{isLoaded:_,error:R}=yt(r,o),T=t||bt(o),[B,S]=P.useState(null),{fetchedPlaybackUrl:p,fetchedPlaylist:D,isLoading:L,error:U}=gt({projectId:a,videoId:T,playlistId:i,videoUrl:n,apiKey:u}),$=Me(e,T);P.useEffect(()=>{D&&c&&c(D)},[D,c]);const Z=P.useMemo(()=>{const N=l.config||{},H=h&&!N.size?{sizeType:"RESPONSIVE",aspectRatio:"9:16"}:N.size||{sizeType:"FIXED",width:"100%"};return{...l,config:{...N,size:H}}},[l,h]);return P.useEffect(()=>{if(R){S(R);return}if(!_||L&&!n)return;let N=!0;const X=setTimeout(async()=>{try{m.current.forEach(F=>clearInterval(F)),m.current=[],y.current.forEach(F=>clearTimeout(F)),y.current=[];const M=(D==null?void 0:D.length)??0,oe=JSON.stringify({playerId:$,videoId:t||T,playlistId:i,videoUrl:n,fetchedPlaybackUrl:p,scriptUrl:o,isReels:h,projectId:a,playlistLength:M});if(v.current&&k.current&&d.current===oe)return;d.current!==oe&&(v.current=!1,d.current=oe);const ee=o==null?void 0:o.includes("vertical-player");if(document.querySelectorAll('[id*="player"]').forEach(F=>{var E,V;const W=F.id;if(W!==$)try{const g=ee?(E=window.vpVerticalPlayer)==null?void 0:E.call(window,W):(V=window.vpPlayer)==null?void 0:V.call(window,W);g!=null&&g.destroy&&g.destroy()}catch(g){console.warn(`Failed to destroy existing player ${W}:`,g)}}),await new Promise(F=>setTimeout(F,100)),!N||!x.current)return;if(!document.getElementById($)){S("DOM element not found after cleanup.");return}if(!window.vpPlayer&&!window.vpVerticalPlayer){S("VP Player script not loaded.");return}const b=ee?window.vpVerticalPlayer:window.vpPlayer;if(!b){S(`VP ${ee?"Vertical ":""}Player script not loaded.`);return}const I=vt({videoUrl:n,fetchedPlaybackUrl:p??void 0,fetchedPlaylist:D??void 0,projectId:a,config:Z,isVerticalPlayer:ee}),w=b($);if(!w){S(`Failed to create VP ${ee?"Vertical ":""}Player instance.`);return}if(N&&x.current&&(w.setup(I),k.current=w,v.current=!0,S(null),f&&w.on)){const F=()=>{var V;const E={};if(D&&D.length>0){const g=w.videoIndex??((V=w.playlist)==null?void 0:V.playlistVideoIndex)??0,O=D[g];O&&(E.title=O.title,E.hlsUrl=O.hlsUrl,E.file=O.hlsUrl,E.thumbnailUrl=O.thumbnailUrl,E.duration=O.duration,E.videoIndex=g,E.playlistVideoIndex=g,E.isBackupPlaylist=O.isBackupPlaylist,E.mediaId=O.mediaId)}else I.video&&(E.title=I.video.title,E.file=I.video.file,E.hlsUrl=I.video.file,E.thumbnailUrl=I.video.thumbnail,E.videoId=t||T,E.videoIndex=0,E.playlistVideoIndex=0,w.getDuration&&(E.duration=w.getDuration()));return E},W=()=>{try{setTimeout(()=>{const E=F();f(E)},100)}catch(E){console.warn("Error in video-started handler:",E)}};if(h){let E=!1,V=-1;const g=()=>{if(!E){E=!0;try{w.on&&(w.on("vp-video-started",W),w.on("video-started",W),w.on("play",W)),setTimeout(()=>{const re=F();(re.title||re.file)&&(f(re),V=w.videoIndex??0)},500)}catch(re){console.error("Error setting up event listeners:",re)}}};let O=0;const te=15,pe=setInterval(()=>{try{const re=w.videoIndex!==void 0||w.playlist;if(!E)O++,(re||O>=te)&&g();else{const he=w.videoIndex??0;he!==V&&V!==-1&&(V=he,W())}}catch{}},200);m.current.push(pe);try{w.on&&w.on("vp-listen-ready",g)}catch{}}else{const E=async V=>{var g,O;try{const te=o==null?void 0:o.match(/player\/([^/.]+)/),pe=te==null?void 0:te[1];if(!pe||!V)return F();const re=`https://host.vpplayer.tech/player/${pe}/${V}.json`,he=await fetch(re);if(!he.ok)return console.warn("Failed to fetch full video config:",he.status),F();const Q=await he.json();return!Q||!Q.video?F():{videoId:V,title:Q.video.title,description:Q.video.description,file:Q.video.file,hlsUrl:Q.video.file,thumbnailUrl:Q.video.thumbnail,duration:Q.video.duration,publishDate:Q.video.publishDate,projectId:Q.projectId,premium:((g=Q.video.videoLocking)==null?void 0:g.isEnabled)||!1,author:Q.video.author,tags:Q.video.tags||[],videoIndex:w.videoIndex??0,playlistVideoIndex:((O=w.playlist)==null?void 0:O.playlistVideoIndex)??0}}catch(te){return console.warn("Error fetching full video data:",te),F()}};w.on("ready",async V=>{try{const g=(V==null?void 0:V.id)||t||T;if(g){const O=await E(g);f(O)}else{const O=F();(O.title||O.file)&&f(O)}}catch(g){console.warn("Error in ready handler:",g)}}),w.on("playlistItem",async V=>{try{const g=V==null?void 0:V.id;if(g){const O=await E(g);f(O)}}catch(g){console.warn("Error in playlistItem handler:",g)}})}}}catch(M){if(N){const oe=M instanceof Error?M.message:String(M);S(oe),console.error("VP Player initialization error:",M)}}},150);return()=>{N=!1,clearTimeout(X),m.current.forEach(M=>clearInterval(M)),m.current=[],y.current.forEach(M=>clearTimeout(M)),y.current=[],v.current=!1}},[_,L,$,R,o]),P.useEffect(()=>()=>{if(k.current){try{k.current.destroy&&k.current.destroy()}catch(H){console.warn(`Failed to destroy player ${$}:`,H)}k.current=null}v.current=!1;const N=document.getElementById($);N&&(N.innerHTML="")},[$]),{playerRef:x,playerInstanceRef:k,isScriptLoaded:_,isLoading:L,error:U||B||R}},wt=({playerId:e,videoId:t,version:r,videoUrl:n,projectId:a,playlistId:i,scriptUrl:o,config:l={},apiKey:u,isReels:h=!1,hiddenClasses:c=[],onClose:f,className:x,onPlaylistData:k,onVideoStarted:v})=>{var $,Z,N,H;const{playerRef:d,playerInstanceRef:m,isScriptLoaded:y,isLoading:_,error:R}=xt({playerId:e,videoId:t,version:r,videoUrl:n,projectId:a,playlistId:i,scriptUrl:o,config:l,apiKey:u,isReels:h,onPlaylistData:k,onVideoStarted:v}),[T,B]=P.useState(!0),S=()=>h&&B(!0),p=()=>{var X,M;B(!1),(M=(X=m.current)==null?void 0:X.play)==null||M.call(X),f==null||f()},D=(Z=($=l==null?void 0:l.config)==null?void 0:$.size)!=null&&Z.width?typeof l.config.size.width=="number"?`${l.config.size.width}px`:l.config.size.width:void 0,L=(H=(N=l==null?void 0:l.config)==null?void 0:N.size)!=null&&H.height?typeof l.config.size.height=="number"?`${l.config.size.height}px`:l.config.size.height:void 0,U=Me(e,t);return R?Y.jsxs(De,{type:"error",children:["An error occurred: ",R]}):_||!y?Y.jsx(De,{type:"loading",children:"Loading..."}):Y.jsxs(Y.Fragment,{children:[h&&!T?Y.jsx("div",{onClick:S}):null,!h&&Y.jsx("div",{children:Y.jsx(Ue,{id:U,ref:d,width:D||"100%",height:L||"auto",$hiddenClasses:c,className:x})},U),h&&T&&Y.jsx(pt,{onClick:p,className:x,children:Y.jsx(ht,{className:x,onClick:X=>X.stopPropagation(),children:Y.jsx("div",{children:Y.jsx(Ue,{id:U,ref:d,width:"100%",height:"auto",$hiddenClasses:c,className:x})},U)})})]})},Pt=P.createContext(void 0),Ir=({children:e})=>{const[t,r]=P.useState(!1),[n,a]=P.useState(null),[i,o]=P.useState(null),l=P.useCallback(c=>{try{const f=Me(c.playerId,c.videoId);a({...c,playerId:f}),r(!0),o(null)}catch{o("Failed to show player.")}},[]),u=P.useCallback(()=>{r(!1),a(null),o(null)},[]),h=P.useMemo(()=>({showPlayer:l,hidePlayer:u,isPlayerVisible:t,playerParams:n}),[l,u,t,n]);return Y.jsxs(Pt.Provider,{value:h,children:[e,i&&Y.jsx(De,{type:"error",children:i}),t&&(n==null?void 0:n.playerId)&&Y.jsx(wt,{playerId:n.playerId,videoId:n.videoId,projectId:n.projectId,videoUrl:n.videoUrl,version:n.version,playlistId:n.playlistId,scriptUrl:n.scriptUrl,config:n.config,isReels:n.isReels,thumbnailUrl:n.thumbnailUrl,onClose:u,hiddenClasses:n.hiddenClasses||[],apiKey:n.apiKey,className:n.className})]})},Rr=()=>{const e=P.useContext(Pt);if(!e)throw new Error("useVPPlayer must be used within a VPPlayerProvider");return e},Or={projectId:"vp-player-projectId",video:{file:"",playlist:{state:!0,playlistVideoIndex:0,videos:[]}},config:{autoplay:!0,pauseOtherVideos:!0,focusOnAutostart:!1,muted:!0,loop:!1,size:{width:"100%"},controls:{settingsButton:!0,chromecastButton:!1,nextButton:!1,fullscreenButton:!0,airplayButton:!1,bigPlayButton:!1,autopausePlayButton:!0,pictureInPictureButton:!1,relatedButton:!1,volumeButton:!0,shareButton:!0}}},jr={config:{autostartOnLoad:{state:!0,onMobile:!0,onData:!0},muted:!0}},Vr={config:{autoplay:!0,muted:!0}},Oe={video:{advertising:!0,ads:{skipAd:{state:!0,skipFrom:5}}},config:{adAnnouncement:{state:!0,timeBeforeAd:5},adsRequireInteraction:!1}},Lr=(e,t,r="time",n=0)=>{var a;return{...Oe,video:{...Oe.video,ads:{...(a=Oe.video)==null?void 0:a.ads,adBreaks:[{adTagUrl:t,breakType:e,breakTimingType:r,breakTimingValue:n}]}}}},$r="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",Nr="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4",Fr="https://videos.pexels.com/video-files/4678261/4678261-hd_1080_1920_25fps.mp4",Br="https://images.pexels.com/videos/4678261/pexels-photo-4678261.jpeg?auto=compress&cs=tinysrgb&w=600",Dr="https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=",Ur="https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=";j.AD_TAG_LINEAR_URL=Dr,j.AD_TAG_SKIPPABLE_LINEAR_URL=Ur,j.BIG_BUCK_BUNNY_URL=$r,j.ELEPHANTS_DREAM_URL=Nr,j.Overlay=pt,j.PEXELS_THUMBNAIL_URL=Br,j.PEXELS_VERTICAL_VIDEO_URL=Fr,j.PlayerContainer=Ue,j.PlayerWrapper=ht,j.VPPlayer=wt,j.VPPlayerProvider=Ir,j.baseConfig=jr,j.baseConfigWithAds=Oe,j.baseConfigWithAutoplay=Vr,j.buildVPPlayerConfig=vt,j.defaultVPPlayerConfig=Or,j.extractVideoId=bt,j.getAdConfig=Lr,j.useVPPlayer=Rr,j.useVPPlayerLogic=xt,j.useVPPlayerScript=yt,j.useVideoData=gt,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
|