textalive-react-api 0.4.13 → 0.4.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +1 -1
- package/dist/index.js +1 -1
- package/dist/textalive-react-api.d.ts +4 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import n,{createContext as o,useRef as i,useState as a,useEffect as c,useContext as u,useCallback as l,useMemo as s,forwardRef as d,useImperativeHandle as f}from"react";import{Slider as p,Text as v,Switch as h,ColorInput as m,useCombobox as g,InputDescription as b,Combobox as y,InputBase as O,Input as w,ScrollArea as j,Pill as P,TextInput as S}from"@mantine/core";import{useElementSize as _}from"@mantine/hooks";var E="PlayerControl-module__control___2umaO",N=function(t){var r=t.svgLogoImage;return e("div",{className:E,dangerouslySetInnerHTML:r?{__html:r}:void 0})},C=function(e){return e[e.Idle=0]="Idle",e[e.Request=1]="Request",e[e.Success=2]="Success",e[e.Fail=3]="Fail",e}({});function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function V(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return D(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?D(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var L=o(null);function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}function k(e){var t=function(e,t){if("object"!=I(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=I(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==I(t)?t:t+""}function x(e,t,r){return(t=k(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var F="Overlay-module__overlay___ernIt";function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var T=function(t){var r=M({},t),n=r.active;return delete r.active,e("div",M({className:"".concat(F," ").concat(n?"active":"inactive"," overlay")},r))},z=o(null),R=o(null);function q(){var e=i(null),t=V(a({width:0,height:0}),2),r=t[0],n=t[1];return c((function(){if(window){var t=function(){if(e.current){var t=e.current,o=t.clientWidth,i=t.clientHeight;n({width:o,height:i})}r=null},r=null,o=function(){r||(r=setTimeout(t,200))};return window.addEventListener("resize",o),t(),function(){window.removeEventListener("resize",o)}}}),[]),[r,e]}function U(e){if(!e){if("undefined"==typeof window)return!0;var t=window.navigator.languages&&window.navigator.languages[0]||window.navigator.language||window.navigator.userLanguage||window.navigator.browserLanguage,r=t.indexOf("ja"),n=t.indexOf("en");return r>=0&&(n<0||r<n)}return"en"!==e.language}function B(e){return"string"==typeof e?e:e?(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&e.ja||e.default:void 0}function H(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=Math.floor(e/1e3),n=Math.floor(r/60),o=Math.floor(n/60),i=Math.floor(e%1e3),a=r%60,c=n%60,u=String(o).padStart(2,"0"),l=String(c).padStart(2,"0"),s=String(a).padStart(2,"0"),d=String(i).padStart(3,"0");return t?"".concat(o>0?"".concat(u,"時間"):"").concat(l,"分").concat(s,".").concat(d,"秒"):"".concat(o>0?"".concat(u,":"):"").concat(l,":").concat(s,".").concat(d)}var W={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},G=n.createContext&&n.createContext(W),X=["attr","size","title"];function Y(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},J.apply(this,arguments)}function $(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function K(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$(Object(r),!0).forEach((function(t){Q(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Q(e,t,r){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?n:n+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Z(e){return e&&e.map(((e,t)=>n.createElement(e.tag,K({key:t},e.attr),Z(e.child))))}function ee(e){return t=>n.createElement(te,J({attr:K({},e.attr)},t),Z(e.child))}function te(e){var t=t=>{var r,{attr:o,size:i,title:a}=e,c=Y(e,X),u=i||t.size||"1em";return t.className&&(r=t.className),e.className&&(r=(r?r+" ":"")+e.className),n.createElement("svg",J({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,o,c,{className:r,style:K(K({color:e.color||t.color},t.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),a&&n.createElement("title",null,a),e.children)};return void 0!==G?n.createElement(G.Consumer,null,(e=>t(e))):t(W)}function re(e){return ee({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"},child:[]},{tag:"path",attr:{d:"M10.97 4.97a.75.75 0 0 1 1.071 1.05l-3.992 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z"},child:[]}]})(e)}function ne(e){return ee({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"},child:[]},{tag:"path",attr:{d:"M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0M7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0z"},child:[]}]})(e)}function oe(e){return ee({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"},child:[]},{tag:"path",attr:{d:"M11.354 4.646a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708l6-6a.5.5 0 0 1 .708 0"},child:[]}]})(e)}function ie(e){return ee({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"},child:[]}]})(e)}var ae="PlayerStatusItem-module__tr___UXBxy",ce="PlayerStatusItem-module__left___3VOvc",ue="PlayerStatusItem-module__label___oXapr",le="PlayerStatusItem-module__logo___DsgYt",se=function(r){var n=r.label,o=r.status,i=u(R),a=U(null==i?void 0:i.user);return t("tr",{className:"".concat(o===C.Idle?"idle":o===C.Request?"request":o===C.Success?"success":"failed"," ").concat(ae),children:[e("td",{className:ce,children:e("span",{className:ue,children:n})}),t("td",{className:le,children:[o===C.Idle&&e(oe,{}),o===C.Request&&e(ie,{}),o===C.Fail&&e(ne,{}),o===C.Success&&e(re,{})]}),t("td",{children:[o===C.Request&&(a?"読み込み中":"Loading"),o===C.Fail&&(a?"読み込み失敗":"Failed"),o===C.Success&&(a?"読み込み完了":"Loaded")]})]})},de="PlayerStatus-module__status___2lF7b",fe=function(r){var n=r.onError,o=u(z),i=u(L),l=u(R),s=U(null==l?void 0:l.user),d=V(a(C.Idle),2),f=d[0],p=d[1],v=V(a(C.Idle),2),h=v[0],m=v[1],g=V(a(C.Idle),2),b=g[0],y=g[1],O=V(a(C.Idle),2),w=O[0],j=O[1],P=V(a(C.Idle),2),S=P[0],_=P[1],E=V(a(C.Idle),2),N=E[0],D=E[1],I=null!=i&&i.graphics||o?C.Success:C.Request;return c((function(){if(i){var e,t=function(e,t){void 0!==t&&(null==n||n(e,t))},r={onVideoLoad:function(r,n){e=r,t("onVideoLoad",n),p(C.Request),m(C.Idle),y(C.Idle),j(C.Idle),_(C.Idle),D(C.Request)},onSongLoad:function(r,n){t("onSongLoad",n),r?(p(C.Success),m(C.Request)):e&&(e.songleCode||e.songleId>=0)?p(C.Fail):p(C.Idle)},onSongMapLoad:function(r,n){t("onSongMapLoad",n),m(r?C.Success:C.Fail),e&&e.lyricId>=0&&y(C.Request)},onLyricsLoad:function(e,r){t("onLyricsLoad",r),y(e?C.Success:C.Fail),e&&j(C.Request)},onTextLoad:function(e,r){t("onTextLoad",r),j(e?C.Success:C.Fail),_(C.Request)},onFontsLoad:function(e,r){t("onFontsLoad",r),_(e?C.Success:C.Fail)},onBackgroundGraphicsUpdate:function(e){D(C.Success)}};return i.addListener(r),function(){i.removeListener(r)}}}),[n,i]),e("table",{className:"player status ".concat(de),children:t("tbody",{children:[e(se,{label:s?"グラフィックドライバ":"Graphics driver",status:I}),e(se,{label:s?"楽曲情報":"Song info",status:f}),e(se,{label:s?"音楽地図":"Song map",status:h}),e(se,{label:s?"歌詞":"Lyrics",status:b}),e(se,{label:s?"テキスト":"Text",status:w}),e(se,{label:s?"フォント":"Fonts",status:S}),e(se,{label:s?"背景グラフィック":"Background graphics",status:N})]})})},pe=function(t){var r=t.showStatus,n=t.svgLogoImage,o=t.onError,i=u(L),s=V(a(!1),2),d=s[0],f=s[1],p=V(a(!1),2),v=p[0],h=p[1],m=V(a(!1),2),g=m[0],b=m[1];c((function(){if(i){i.video&&f(!0),i.isPlaying&&h(!0),i.isVideoSeeking&&b(!0);var e={onVideoLoad:function(e){f(!1)},onVideoReady:function(e){f(!0)},onPlay:function(){h(!0)},onPause:function(){h(!1)},onStop:function(){h(!1)},onVideoSeekStart:function(){b(!0)},onVideoSeekEnd:function(){b(!1)}};return i.addListener(e),function(){i.removeListener(e)}}}),[i]);var y=l((function(e){i&&i.video&&(e.preventDefault(),i.isPlaying?i.requestPause():i.requestPlay())}),[i]);return e(T,{active:r&&!d||!v&&!g,onClick:r&&!d?void 0:y,children:d?e(N,{svgLogoImage:n}):r&&e(fe,{onError:o})})};function ve(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var he=o(null),me=o(null);function ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var be=function(t){var r=t.manager,n=t.children,o=V(a(null),2),i=o[0],u=o[1];return c((function(){if("undefined"!=typeof window){var e=!0,t={onUserProfileUpdated:function(e){u(e?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ge(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e):null)}};return r.addListener(t),r.getProfile().then((function(t){return e&&u(t)})),function(){r.removeListener(t),e=!1}}}),[r]),e(R.Provider,{value:i,children:n})},ye="Seekbar-module__seekbar___pCDsH",Oe=["position","duration","onSeekStart","onSeek","onSeekEnd"];function we(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function je(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?we(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):we(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Pe=function(t){var r=t.position,n=t.duration,o=t.onSeekStart,a=t.onSeek,s=t.onSeekEnd,d=ve(t,Oe),f=u(R),v=U(null==f?void 0:f.user),h=i(!1),m=i(o),g=i(a),b=i(s),y=i(null),O=i(0);c((function(){m.current=o,g.current=a,b.current=s}),[a,s,o]);var w=l((function(){var e;(h.current||y.current)&&(h.current||(h.current=!0,null===(e=m.current)||void 0===e||e.call(m)))}),[]),j=l((function(){var e;h.current&&(h.current=!1,y.current=null,null===(e=b.current)||void 0===e||e.call(b))}),[]),P=l((function(e){var t;w(),null===(t=g.current)||void 0===t||t.call(g,e)}),[w]),S=l((function(e){j()}),[j]),_=l((function(e){return H(e,v)}),[v]),E=l((function(e){y.current=e}),[]),N=l((function(){return Date.now()-O.current<1e3}),[]),C=l((function(e){O.current=Date.now(),E("capture:touchstart")}),[E]),D=l((function(e){"mouse"===e.pointerType&&N()||("touch"===e.pointerType&&(O.current=Date.now()),E("capture:pointerdown:".concat(e.pointerType)))}),[E,N]),V=l((function(e){N()||E("capture:mousedown")}),[E,N]);return c((function(){var e=function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(O.current=Date.now()),j()},t=function(){"hidden"===document.visibilityState&&e()},r=function(){return e()},n=function(){return e(!0)},o=function(){return e(!0)},i=function(){return e()},a=function(){return e(!0)},c=function(){return e()};return document.addEventListener("mouseup",r),document.addEventListener("touchend",n),document.addEventListener("touchcancel",o),document.addEventListener("pointerup",i),document.addEventListener("pointercancel",a),window.addEventListener("blur",c),document.addEventListener("visibilitychange",t),function(){document.removeEventListener("mouseup",r),document.removeEventListener("touchend",n),document.removeEventListener("touchcancel",o),document.removeEventListener("pointerup",i),document.removeEventListener("pointercancel",a),window.removeEventListener("blur",c),document.removeEventListener("visibilitychange",t),j()}}),[j]),e("div",{className:"".concat(ye," seekbar"),onTouchStartCapture:C,onPointerDownCapture:D,onMouseDownCapture:V,children:e(p,je(je({},d),{},{value:r,min:0,max:n,onChange:P,onChangeEnd:S,label:_}))})},Se=function(t){var r=t.disabled,n=t.player,o=u(L),i=n||o,s=V(a(0),2),d=s[0],f=s[1],p=V(a(0),2),v=p[0],h=p[1];c((function(){var e;if(i){var t={onVideoReady:function(e){return h(e.duration)},onThrottledTimeUpdate:function(){return f(i.videoPosition)}};return i.addListener(t),"number"==typeof(null===(e=i.video)||void 0===e?void 0:e.duration)&&h(i.video.duration),f(i.videoPosition),function(){i.removeListener(t)}}}),[i]);var m=l((function(e){null==i||i.setVideoPosition(e),f(e)}),[i]),g=l((function(){null==i||i.startVideoSeek()}),[i]),b=l((function(){i&&(i.endVideoSeek(),i.requestMediaSeek(i.videoPosition))}),[i]),y=!(!i||!i.video);return e(Pe,{disabled:"boolean"==typeof r?r:!y,position:d,duration:v,onSeekStart:y?g:void 0,onSeek:y?m:void 0,onSeekEnd:y?b:void 0})},_e={wrapper:"PlayerWrapper-module__wrapper___fjlgO"},Ee=function(t){var r=t.children,n=t.overlayed,o=t.rounded,i=t.bordered;return e("div",{className:[_e.wrapper,n&&"overlayed",i&&"bordered",o&&"rounded"].filter((function(e){return!!e})).join(" "),children:r})},Ne="ReactPlayer-module__player___rvJIC",Ce=["transparent","playerFactory","onInit","children"];function De(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?De(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):De(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Le=function(r){var n=r.transparent,o=r.playerFactory,u=r.onInit,l=r.children,s=ve(r,Ce),d=i(null),f=V(a(null),2),p=f[0],v=f[1],h=_(),m=h.ref,g=h.width,b=h.height;return c((function(){var e=s.graphics,t=s.mediaElement,r=s.unsafeAcceleration;if(d.current&&e){if(p){var n=p.stageElement!==d.current,i=p.mediaElement!==t,a=p.graphics!==e,c=p.options.unsafeAcceleration!==r;if(!(n||i||a||c))return;if(!i&&!a&&!c)return void(p.stageElement=d.current);if(!n&&!a&&!c)return void(p.mediaElement=t);p.dispose()}v(o(Ve(Ve({},s),{},{stageElement:d.current,mediaElement:t})))}}),[o,d.current,s]),c((function(){p&&u&&u(p)}),[p]),c((function(){p&&p.resize({width:g||480,height:b||270})}),[g,b]),t("div",{ref:m,className:"".concat(Ne," textalive-player ").concat(n?"transparent":"white"),children:[e("canvas",{ref:d}),l]})},Ie=function(t){return c((function(){console.warn('[TextAlive React API] import { Player } from "textalive-react-api" is deprecated; use ReactPlayer instead')}),[]),e(Le,Ve({},t))},ke="WidgetLabel-module__label___UzNG4";function xe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xe(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ae=function(t){return e(v,Fe(Fe({component:"div"},t),{},{className:ke}))},Me=function(n){var o=n.widget,i=n.value,a=n.onValueChange,c=n.withoutName,s=n.description,d=u(R),f=U(null==d?void 0:d.user),p="boolean"==typeof i?i:!!o.initialValue,v=l((function(e){a&&a(e.currentTarget.checked)}),[a]);return t("div",{className:"check widget",children:[t(Ae,{children:[B(o.title,f),!c&&t(r,{children:[" ","(",e("code",{children:o.name}),")"]})]}),e(h,{size:"md",description:B(s,f),checked:p,onChange:v})]})},Te="ColorWidget-module__color___XheVj";function ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Re(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ze(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ze(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var qe=function(t){var r=t.position,n=void 0===r?"leftAligned":r,o=t.label,i=t.labelTitle,a=t.description,c=t.value,l=t.colorFactory,d=t.onValueChange,f=u(he),p=s((function(){return function(e){null==d||d(l(e))}}),[d,l]);return e("div",{className:Te,children:e(m,Re(Re(Re({},n?{popoverProps:{position:"leftAligned"===n?"bottom-start":"rightAligned"===n?"bottom-end":"bottom"}}:{}),f?{swatches:f}:{}),{},{format:"hex",label:e(Ae,{children:o}),description:a||i,value:c.rgb,onChange:p,withEyeDropper:!1}))})},Ue=function(n){var o=n.position,i=n.widget,a=n.value,c=n.colorFactory,l=n.onValueChange,s=n.withoutName,d=n.description,f=u(R),p=U(null==f?void 0:f.user),v=function(e,t){return"object"===I(e)?e:t(String(e))}(a||(null==i?void 0:i.initialValue),c);return e("div",{className:"color widget",children:e(qe,{position:o,label:t(Ae,{children:[B(i.title,p),!s&&t(r,{children:[" ","(",e("code",{children:i.name}),")"]})]}),description:B(d,p),value:v,colorFactory:c,onValueChange:l})})};var Be="SelectDropdown-module__description___f1qjY",He=function(n){var o=n.label,i=n.description,a=n.options,c=n.value,l=n.disabled,d=n.onValueChange,f=u(R),p=U(null==f?void 0:f.user),v=g({onDropdownClose:function(){return v.resetSelectedOption()}}),h=s((function(){return(a||[]).find((function(e){return String(e.value)===String(c)}))}),[a,c]);return t(r,{children:[o&&e(Ae,{children:o}),i&&e(b,{className:Be,children:i}),t(y,{store:v,disabled:l,withinPortal:!0,width:"target",onOptionSubmit:function(e){null==d||d(e),v.closeDropdown()},children:[e(y.Target,{children:e(O,{disabled:l,component:"button",type:"button",pointer:!0,rightSection:e(y.Chevron,{}),rightSectionPointerEvents:"none",onClick:function(){return v.toggleDropdown()},children:(null==h?void 0:h.label)||e(w.Placeholder,{children:p?"選択してください":"Pick value"})})}),e(y.Dropdown,{children:e(j.Autosize,{mah:"min(50vh, 320px)",type:"scroll",children:e(y.Options,{children:null==a?void 0:a.map((function(t,r){return e(y.Option,{value:String(t.value),children:t.label},r)}))})})})]})]})},We=["value","onValueChange","withPrivate"];function Ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Xe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ge(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ge(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ye=function(n){var o=n.value,i=n.onValueChange,a=n.withPrivate,c=ve(n,We),l=u(R),d=U(null==l?void 0:l.user),f=u(me),p=s((function(){return!Array.isArray(f)||f.length<=0?null:(a?f:f.filter((function(e){return!e.isPrivate}))).map((function(n){return{label:t("span",{children:[n.isPrivate&&t(r,{children:[e(P,{size:"sm",children:d?"プライベート":"Private"})," "]}),e("span",{style:{fontFamily:n.isPrivate?n.key:n.en},children:d?n.ja:n.en})]}),value:n.isPrivate?n.key:n.en}}))}),[a,d,f]);return e(He,Xe(Xe({},c),{},{options:p,value:o,disabled:!p,onValueChange:i}))},Je=function(n){var o=n.widget,i=n.value,a=n.onValueChange,c=n.withPrivate,l=n.withoutName,s=n.description,d=u(R),f=U(null==d?void 0:d.user),p=void 0===i?o.initialValue:i;return e("div",{className:"font family widget",children:e(Ye,{withPrivate:c,label:t(r,{children:[B(o.title,f),!l&&t(r,{children:[" ","(",e("code",{children:o.name}),")"]})]}),description:B(s,f),value:p,onValueChange:a})})},$e="NumericSlider-module__widget___6EwOt",Ke="NumericSlider-module__input___tGIR-",Qe="NumericSlider-module__text___wjhb9",Ze=function(r){var n=r.disabled,o=r.min,i=r.max,a=r.value,c=r.onValueChange,u=r.withTextInput;return t("div",{className:$e,children:[e(p,{className:Ke,disabled:n,min:o,max:i,step:1,label:u?null:void 0,value:a,onChange:function(e){return null==c?void 0:c(e)}}),u&&e(S,{className:Qe,disabled:n,value:String(a),type:"number",onChange:function(e){return null==c?void 0:c(parseInt(e.target.value))}})]})},et=function(n){var o=n.widget,i=n.value,a=n.onValueChange,c=n.withoutName,l=n.description,d=u(R),f=U(null==d?void 0:d.user),p=g({onDropdownClose:function(){return p.resetSelectedOption()}}),v=void 0===i?o.initialValue:i,h=s((function(){if(!Array.isArray(o.params))return[];if(1===o.params.length&&"object"===I(o.params[0])&&!Array.isArray(o.params[0])){var e=o.params[0];return Object.entries(e).map((function(e){var t=V(e,2),r=t[0],n=t[1];return{label:String(n),value:r}}))}return o.params.map((function(e){return Array.isArray(e)?e.length>1?{label:String(e[1]),value:e[0]}:{label:String(e[0]),value:e[0]}:{label:String(e),value:e}}))}),[o.params]);return e("div",{className:"select widget",children:e(He,{label:t(r,{children:[B(o.title,f),!c&&t(r,{children:[" ","(",e("code",{children:o.name}),")"]})]}),description:B(l,f),options:h,value:v,onValueChange:a})})},tt=function(n){var o,i=n.widget,a=n.value,c=n.onValueChange,l=n.withTextInput,d=n.withoutName,f=n.description,p=u(R),v=U(null==p?void 0:p.user),h=s((function(){var e=0,t=100;if(Array.isArray(i.params))switch(i.params.length){case 1:var r=parseInt(i.params[0]);isNaN(r)||(t=r);break;case 2:var n=parseInt(i.params[0]),o=parseInt(i.params[1]);isNaN(n)||isNaN(o)||(e=n,t=o)}return[e,t]}),[i.params]),m=V(h,2),g=m[0],y=m[1];return"number"!=typeof a||isNaN(a)?(o=parseInt(i.initialValue),isNaN(o)&&(o=(g+y)/2)):o=a,t("div",{className:"slider widget",children:[t(Ae,{children:[B(i.title,v),!d&&t(r,{children:[" ","(",e("code",{children:i.name}),")"]})]}),f&&e(b,{children:B(f,v)}),e(Ze,{min:g,max:y,value:o,onValueChange:c,withTextInput:l})]})},rt=function(r){var n=r.position,o=r.widget,i=r.value,a=r.colorFactory,c=r.onValueChange,s=r.withPrivate,d=r.withoutName,f=r.description,p=u(R),v=U(null==p?void 0:p.user),h=l((function(e){c(o.name,e)}),[o,c]);if(!o)return null;switch(o.className){case"Slider":return e(tt,{widget:o,value:i,withTextInput:!0,withoutName:d,description:f,onValueChange:h});case"Color":return e(Ue,{position:n,widget:o,value:i,withoutName:d,description:f,colorFactory:a,onValueChange:h});case"Check":return e(Me,{widget:o,value:i,withoutName:d,description:f,onValueChange:h});case"Select":return e(et,{widget:o,value:i,withoutName:d,description:f,onValueChange:h});case"FontFamily":return e(Je,{widget:o,value:i,withPrivate:s,withoutName:d,description:f,onValueChange:h});default:return t("div",{className:"unsupported widget",children:[e("label",{children:v?"サポートされていないウィジェット":"Unsupported widget"}),e("p",{children:o.className})]})}};function nt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var ot=d((function(t,r){var n=t.widgets,o=t.initialValues,i=t.colorFactory,c=t.onValueChange,u=t.withPrivate,s=t.withoutName,d=V(a(o||{}),2),p=d[0],v=d[1],h=l((function(e,t){var r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nt(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},p);r[e]=t,v(r),c&&c(e,t)}),[p,c]);return f(r,(function(){return{values:p,setValues:v}}),[p]),e("div",{className:"widgets",children:n.map((function(t){return e(rt,{widget:t,value:p[t.name],colorFactory:i,onValueChange:h,withPrivate:u,withoutName:s},"widgets-".concat(t.name))}))})}));export{Me as CheckWidget,qe as ColorPicker,Ue as ColorWidget,he as ColorsContext,Ye as FontFamilyDropdown,Je as FontFamilyWidget,me as FontsContext,z as GraphicsDriverContext,Ze as NumericSlider,T as Overlay,Ie as Player,L as PlayerContext,N as PlayerControl,C as PlayerLoaderStatus,pe as PlayerOverlay,Se as PlayerSeekbar,fe as PlayerStatus,se as PlayerStatusItem,Ee as PlayerWrapper,R as ProfileContext,be as ProfileProvider,Le as ReactPlayer,Pe as Seekbar,He as SelectDropdown,et as SelectWidget,tt as SliderWidget,rt as Widget,Ae as WidgetLabel,ot as Widgets,U as isJa,H as msToString,B as regionalText,q as useResize};
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import n,{createContext as o,useRef as i,useState as a,useEffect as c,useContext as u,useCallback as l,useMemo as s,forwardRef as d,useImperativeHandle as f}from"react";import{Slider as p,Text as v,Switch as h,ColorInput as m,useCombobox as b,InputDescription as g,Combobox as y,InputBase as O,Input as w,ScrollArea as j,Pill as P,TextInput as S}from"@mantine/core";import{useElementSize as _}from"@mantine/hooks";var N="PlayerControl-module__control___2umaO",E=function(t){var r=t.svgLogoImage;return e("div",{className:N,dangerouslySetInnerHTML:r?{__html:r}:void 0})},C=function(e){return e[e.Idle=0]="Idle",e[e.Request=1]="Request",e[e.Success=2]="Success",e[e.Fail=3]="Fail",e}({});function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function L(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return D(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?D(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var V=o(null);function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}function I(e){var t=function(e,t){if("object"!=k(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=k(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==k(t)?t:t+""}function x(e,t,r){return(t=I(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var F="Overlay-module__overlay___ernIt";function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var T=function(t){var r=M({},t),n=r.active;return delete r.active,e("div",M({className:"".concat(F," ").concat(n?"active":"inactive"," overlay")},r))},z=o(null),R=o(null);function q(){var e=i(null),t=L(a({width:0,height:0}),2),r=t[0],n=t[1];return c((function(){if(window){var t=function(){if(e.current){var t=e.current,o=t.clientWidth,i=t.clientHeight;n({width:o,height:i})}r=null},r=null,o=function(){r||(r=setTimeout(t,200))};return window.addEventListener("resize",o),t(),function(){window.removeEventListener("resize",o)}}}),[]),[r,e]}function B(e){if(!e){if("undefined"==typeof window)return!0;var t=window.navigator.languages&&window.navigator.languages[0]||window.navigator.language||window.navigator.userLanguage||window.navigator.browserLanguage,r=t.indexOf("ja"),n=t.indexOf("en");return r>=0&&(n<0||r<n)}return"en"!==e.language}function U(e){return"string"==typeof e?e:e?(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&e.ja||e.default:void 0}function H(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=Math.floor(e/1e3),n=Math.floor(r/60),o=Math.floor(n/60),i=Math.floor(e%1e3),a=r%60,c=n%60,u=String(o).padStart(2,"0"),l=String(c).padStart(2,"0"),s=String(a).padStart(2,"0"),d=String(i).padStart(3,"0");return t?"".concat(o>0?"".concat(u,"時間"):"").concat(l,"分").concat(s,".").concat(d,"秒"):"".concat(o>0?"".concat(u,":"):"").concat(l,":").concat(s,".").concat(d)}var W={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},G=n.createContext&&n.createContext(W),X=["attr","size","title"];function Y(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},J.apply(this,arguments)}function K(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?K(Object(r),!0).forEach((function(t){Q(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Q(e,t,r){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?n:n+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Z(e){return e&&e.map(((e,t)=>n.createElement(e.tag,$({key:t},e.attr),Z(e.child))))}function ee(e){return t=>n.createElement(te,J({attr:$({},e.attr)},t),Z(e.child))}function te(e){var t=t=>{var r,{attr:o,size:i,title:a}=e,c=Y(e,X),u=i||t.size||"1em";return t.className&&(r=t.className),e.className&&(r=(r?r+" ":"")+e.className),n.createElement("svg",J({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,o,c,{className:r,style:$($({color:e.color||t.color},t.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),a&&n.createElement("title",null,a),e.children)};return void 0!==G?n.createElement(G.Consumer,null,(e=>t(e))):t(W)}function re(e){return ee({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"},child:[]},{tag:"path",attr:{d:"M10.97 4.97a.75.75 0 0 1 1.071 1.05l-3.992 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z"},child:[]}]})(e)}function ne(e){return ee({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"},child:[]},{tag:"path",attr:{d:"M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0M7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0z"},child:[]}]})(e)}function oe(e){return ee({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"},child:[]},{tag:"path",attr:{d:"M11.354 4.646a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708l6-6a.5.5 0 0 1 .708 0"},child:[]}]})(e)}function ie(e){return ee({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"},child:[]}]})(e)}var ae="PlayerStatusItem-module__tr___UXBxy",ce="PlayerStatusItem-module__left___3VOvc",ue="PlayerStatusItem-module__label___oXapr",le="PlayerStatusItem-module__logo___DsgYt",se=function(r){var n=r.label,o=r.status,i=u(R),a=B(null==i?void 0:i.user);return t("tr",{className:"".concat(o===C.Idle?"idle":o===C.Request?"request":o===C.Success?"success":"failed"," ").concat(ae),children:[e("td",{className:ce,children:e("span",{className:ue,children:n})}),t("td",{className:le,children:[o===C.Idle&&e(oe,{}),o===C.Request&&e(ie,{}),o===C.Fail&&e(ne,{}),o===C.Success&&e(re,{})]}),t("td",{children:[o===C.Request&&(a?"読み込み中":"Loading"),o===C.Fail&&(a?"読み込み失敗":"Failed"),o===C.Success&&(a?"読み込み完了":"Loaded")]})]})},de="PlayerStatus-module__status___2lF7b",fe=function(r){var n=r.onError,o=u(z),i=u(V),l=u(R),s=B(null==l?void 0:l.user),d=L(a(C.Idle),2),f=d[0],p=d[1],v=L(a(C.Idle),2),h=v[0],m=v[1],b=L(a(C.Idle),2),g=b[0],y=b[1],O=L(a(C.Idle),2),w=O[0],j=O[1],P=L(a(C.Idle),2),S=P[0],_=P[1],N=L(a(C.Idle),2),E=N[0],D=N[1],k=null!=i&&i.graphics||o?C.Success:C.Request;return c((function(){if(i){var e,t=function(e,t){void 0!==t&&(null==n||n(e,t))},r={onVideoLoad:function(r,n){e=r,t("onVideoLoad",n),p(C.Request),m(C.Idle),y(C.Idle),j(C.Idle),_(C.Idle),D(C.Request)},onSongLoad:function(r,n){t("onSongLoad",n),r?(p(C.Success),m(C.Request)):e&&(e.songleCode||e.songleId>=0)?p(C.Fail):p(C.Idle)},onSongMapLoad:function(r,n){t("onSongMapLoad",n),m(r?C.Success:C.Fail),e&&e.lyricId>=0&&y(C.Request)},onLyricsLoad:function(e,r){t("onLyricsLoad",r),y(e?C.Success:C.Fail),e&&j(C.Request)},onTextLoad:function(e,r){t("onTextLoad",r),j(e?C.Success:C.Fail),_(C.Request)},onFontsLoad:function(e,r){t("onFontsLoad",r),_(e?C.Success:C.Fail)},onBackgroundGraphicsUpdate:function(e){D(C.Success)}};return i.addListener(r),function(){i.removeListener(r)}}}),[n,i]),e("table",{className:"player status ".concat(de),children:t("tbody",{children:[e(se,{label:s?"グラフィックドライバ":"Graphics driver",status:k}),e(se,{label:s?"楽曲情報":"Song info",status:f}),e(se,{label:s?"音楽地図":"Song map",status:h}),e(se,{label:s?"歌詞":"Lyrics",status:g}),e(se,{label:s?"テキスト":"Text",status:w}),e(se,{label:s?"フォント":"Fonts",status:S}),e(se,{label:s?"背景グラフィック":"Background graphics",status:E})]})})},pe=function(t){var r=t.showStatus,n=t.svgLogoImage,o=t.onError,i=u(V),s=L(a(!1),2),d=s[0],f=s[1],p=L(a(!1),2),v=p[0],h=p[1],m=L(a(!1),2),b=m[0],g=m[1];c((function(){if(i){i.video&&f(!0),i.isPlaying&&h(!0),i.isVideoSeeking&&g(!0);var e={onVideoLoad:function(e){f(!1)},onVideoReady:function(e){f(!0)},onPlay:function(){h(!0)},onPause:function(){h(!1)},onStop:function(){h(!1)},onVideoSeekStart:function(){g(!0)},onVideoSeekEnd:function(){g(!1)}};return i.addListener(e),function(){i.removeListener(e)}}}),[i]);var y=l((function(e){i&&i.video&&(e.preventDefault(),i.isPlaying?i.requestPause():i.requestPlay())}),[i]);return e(T,{active:r&&!d||!v&&!b,onClick:r&&!d?void 0:y,children:d?e(E,{svgLogoImage:n}):r&&e(fe,{onError:o})})};function ve(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var he=o(null),me=o(null);function be(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var ge=function(t){var r=t.manager,n=t.children,o=L(a(null),2),i=o[0],u=o[1];return c((function(){if("undefined"!=typeof window){var e=!0,t={onUserProfileUpdated:function(e){u(e?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?be(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):be(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e):null)}};return r.addListener(t),r.getProfile().then((function(t){return e&&u(t)})),function(){r.removeListener(t),e=!1}}}),[r]),e(R.Provider,{value:i,children:n})},ye="Seekbar-module__seekbar___pCDsH",Oe=["position","duration","onSeekStart","onSeek","onSeekEnd"];function we(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function je(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?we(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):we(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Pe=function(t){var r=t.position,n=t.duration,o=t.onSeekStart,a=t.onSeek,s=t.onSeekEnd,d=ve(t,Oe),f=u(R),v=B(null==f?void 0:f.user),h=i(!1),m=i(o),b=i(a),g=i(s),y=i(null),O=i(0);c((function(){m.current=o,b.current=a,g.current=s}),[a,s,o]);var w=l((function(){var e;(h.current||y.current)&&(h.current||(h.current=!0,null===(e=m.current)||void 0===e||e.call(m)))}),[]),j=l((function(){var e;h.current&&(h.current=!1,y.current=null,null===(e=g.current)||void 0===e||e.call(g))}),[]),P=l((function(e){var t;w(),null===(t=b.current)||void 0===t||t.call(b,e)}),[w]),S=l((function(e){j()}),[j]),_=l((function(e){return H(e,v)}),[v]),N=l((function(e){y.current=e}),[]),E=l((function(){return Date.now()-O.current<1e3}),[]),C=l((function(e){O.current=Date.now(),N("capture:touchstart")}),[N]),D=l((function(e){"mouse"===e.pointerType&&E()||("touch"===e.pointerType&&(O.current=Date.now()),N("capture:pointerdown:".concat(e.pointerType)))}),[N,E]),L=l((function(e){E()||N("capture:mousedown")}),[N,E]);return c((function(){var e=function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(O.current=Date.now()),j()},t=function(){"hidden"===document.visibilityState&&e()},r=function(){return e()},n=function(){return e(!0)},o=function(){return e(!0)},i=function(){return e()},a=function(){return e(!0)},c=function(){return e()};return document.addEventListener("mouseup",r),document.addEventListener("touchend",n),document.addEventListener("touchcancel",o),document.addEventListener("pointerup",i),document.addEventListener("pointercancel",a),window.addEventListener("blur",c),document.addEventListener("visibilitychange",t),function(){document.removeEventListener("mouseup",r),document.removeEventListener("touchend",n),document.removeEventListener("touchcancel",o),document.removeEventListener("pointerup",i),document.removeEventListener("pointercancel",a),window.removeEventListener("blur",c),document.removeEventListener("visibilitychange",t),j()}}),[j]),e("div",{className:"".concat(ye," seekbar"),onTouchStartCapture:C,onPointerDownCapture:D,onMouseDownCapture:L,children:e(p,je(je({},d),{},{value:r,min:0,max:n,onChange:P,onChangeEnd:S,label:_}))})},Se=function(t){var r=t.disabled,n=t.player,o=u(V),i=n||o,s=L(a(0),2),d=s[0],f=s[1],p=L(a(0),2),v=p[0],h=p[1];c((function(){var e;if(i){var t={onVideoReady:function(e){return h(e.duration)},onThrottledTimeUpdate:function(){return f(i.videoPosition)}};return i.addListener(t),"number"==typeof(null===(e=i.video)||void 0===e?void 0:e.duration)&&h(i.video.duration),f(i.videoPosition),function(){i.removeListener(t)}}}),[i]);var m=l((function(e){null==i||i.setVideoPosition(e),f(e)}),[i]),b=l((function(){null==i||i.startVideoSeek()}),[i]),g=l((function(){i&&(i.endVideoSeek(),i.requestMediaSeek(i.videoPosition))}),[i]),y=!(!i||!i.video);return e(Pe,{disabled:"boolean"==typeof r?r:!y,position:d,duration:v,onSeekStart:y?b:void 0,onSeek:y?m:void 0,onSeekEnd:y?g:void 0})},_e={wrapper:"PlayerWrapper-module__wrapper___fjlgO"},Ne=function(t){var r=t.children,n=t.overlayed,o=t.rounded,i=t.bordered;return e("div",{className:[_e.wrapper,n&&"overlayed",i&&"bordered",o&&"rounded"].filter((function(e){return!!e})).join(" "),children:r})},Ee="ReactPlayer-module__player___rvJIC",Ce=["transparent","playerFactory","onInit","children"];function De(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Le(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?De(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):De(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ve=function(r){var n=r.transparent,o=r.playerFactory,u=r.onInit,l=r.children,s=ve(r,Ce),d=i(null),f=L(a(null),2),p=f[0],v=f[1],h=i(null),m=i(s);m.current=s;var b=i(o);b.current=o;var g=_(),y=g.ref,O=g.width,w=g.height,j=s.graphics,P=s.unsafeAcceleration,S=s.mediaElement;return c((function(){if(d.current&&j){var e=b.current(Le(Le({},m.current),{},{stageElement:d.current}));return h.current=e,v(e),function(){h.current===e&&(h.current=null),e.dispose()}}}),[j,P]),c((function(){h.current&&h.current.mediaElement!==S&&(h.current.mediaElement=S)}),[S]),c((function(){p&&h.current===p&&u&&u(p)}),[p]),c((function(){p&&h.current===p&&p.resize({width:O||480,height:w||270})}),[p,O,w]),t("div",{ref:y,className:"".concat(Ee," textalive-player ").concat(n?"transparent":"white"),children:[e("canvas",{ref:d}),l]})},ke=function(t){return c((function(){console.warn('[TextAlive React API] import { Player } from "textalive-react-api" is deprecated; use ReactPlayer instead')}),[]),e(Ve,Le({},t))},Ie="WidgetLabel-module__label___UzNG4";function xe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xe(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ae=function(t){return e(v,Fe(Fe({component:"div"},t),{},{className:Ie}))},Me=function(n){var o=n.widget,i=n.value,a=n.onValueChange,c=n.withoutName,s=n.description,d=u(R),f=B(null==d?void 0:d.user),p="boolean"==typeof i?i:!!o.initialValue,v=l((function(e){a&&a(e.currentTarget.checked)}),[a]);return t("div",{className:"check widget",children:[t(Ae,{children:[U(o.title,f),!c&&t(r,{children:[" ","(",e("code",{children:o.name}),")"]})]}),e(h,{size:"md",description:U(s,f),checked:p,onChange:v})]})},Te="ColorWidget-module__color___XheVj";function ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Re(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ze(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ze(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var qe=function(t){var r=t.position,n=void 0===r?"leftAligned":r,o=t.label,i=t.labelTitle,a=t.description,c=t.value,l=t.withAlpha,d=void 0!==l&&l,f=t.colorFactory,p=t.onValueChange,v=u(he),h=s((function(){return function(e){null==p||p(f(e))}}),[p,f]);return e("div",{className:Te,children:e(m,Re(Re(Re({},n?{popoverProps:{position:"leftAligned"===n?"bottom-start":"rightAligned"===n?"bottom-end":"bottom"}}:{}),v?{swatches:v}:{}),{},{format:d?"hexa":"hex",label:e(Ae,{children:o}),description:a||i,value:d?c.toString():c.rgb,onChange:h,withEyeDropper:!1}))})},Be=function(n){var o=n.position,i=n.withAlpha,a=n.widget,c=n.value,l=n.colorFactory,s=n.onValueChange,d=n.withoutName,f=n.description,p=u(R),v=B(null==p?void 0:p.user),h=function(e,t){return"object"===k(e)?e:t(String(e))}(c||(null==a?void 0:a.initialValue),l);return e("div",{className:"color widget",children:e(qe,{position:o,withAlpha:i,label:t(Ae,{children:[U(a.title,v),!d&&t(r,{children:[" ","(",e("code",{children:a.name}),")"]})]}),description:U(f,v),value:h,colorFactory:l,onValueChange:s})})};var Ue="SelectDropdown-module__description___f1qjY",He=function(n){var o=n.label,i=n.description,a=n.options,c=n.value,l=n.disabled,d=n.onValueChange,f=u(R),p=B(null==f?void 0:f.user),v=b({onDropdownClose:function(){return v.resetSelectedOption()}}),h=s((function(){return(a||[]).find((function(e){return String(e.value)===String(c)}))}),[a,c]);return t(r,{children:[o&&e(Ae,{children:o}),i&&e(g,{className:Ue,children:i}),t(y,{store:v,disabled:l,withinPortal:!0,width:"target",onOptionSubmit:function(e){null==d||d(e),v.closeDropdown()},children:[e(y.Target,{children:e(O,{disabled:l,component:"button",type:"button",pointer:!0,rightSection:e(y.Chevron,{}),rightSectionPointerEvents:"none",onClick:function(){return v.toggleDropdown()},children:(null==h?void 0:h.label)||e(w.Placeholder,{children:p?"選択してください":"Pick value"})})}),e(y.Dropdown,{children:e(j.Autosize,{mah:"min(50vh, 320px)",type:"scroll",children:e(y.Options,{children:null==a?void 0:a.map((function(t,r){return e(y.Option,{value:String(t.value),children:t.label},r)}))})})})]})]})},We=["value","onValueChange","withPrivate"];function Ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Xe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ge(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ge(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ye=function(n){var o=n.value,i=n.onValueChange,a=n.withPrivate,c=ve(n,We),l=u(R),d=B(null==l?void 0:l.user),f=u(me),p=s((function(){return!Array.isArray(f)||f.length<=0?null:(a?f:f.filter((function(e){return!e.isPrivate}))).map((function(n){return{label:t("span",{children:[n.isPrivate&&t(r,{children:[e(P,{size:"sm",children:d?"プライベート":"Private"})," "]}),e("span",{style:{fontFamily:n.isPrivate?n.key:n.en},children:d?n.ja:n.en})]}),value:n.isPrivate?n.key:n.en}}))}),[a,d,f]);return e(He,Xe(Xe({},c),{},{options:p,value:o,disabled:!p,onValueChange:i}))},Je=function(n){var o=n.widget,i=n.value,a=n.onValueChange,c=n.withPrivate,l=n.withoutName,s=n.description,d=u(R),f=B(null==d?void 0:d.user),p=void 0===i?o.initialValue:i;return e("div",{className:"font family widget",children:e(Ye,{withPrivate:c,label:t(r,{children:[U(o.title,f),!l&&t(r,{children:[" ","(",e("code",{children:o.name}),")"]})]}),description:U(s,f),value:p,onValueChange:a})})},Ke="NumericSlider-module__widget___6EwOt",$e="NumericSlider-module__input___tGIR-",Qe="NumericSlider-module__text___wjhb9",Ze=function(r){var n=r.disabled,o=r.min,i=r.max,u=r.step,l=void 0===u?1:u,s=r.ariaLabel,d=r.value,f=r.onValueChange,v=r.withTextInput,h=L(a(String(d)),2),m=h[0],b=h[1];c((function(){return b(String(d))}),[d]);return t("div",{className:Ke,children:[e(p,{thumbLabel:s,className:$e,disabled:n,min:o,max:i,step:l,label:v?null:void 0,value:d,onChange:function(e){return null==f?void 0:f(e)}}),v&&e(S,{className:Qe,disabled:n,"aria-label":s,value:m,type:"number",min:o,max:i,step:l,onChange:function(e){return b(e.target.value)},onBlur:function(){var e=Number(m);m.trim()&&Number.isFinite(e)&&e>=o&&e<=i&&Math.abs((e-o)/l-Math.round((e-o)/l))<1e-7?e!==Number(d)&&(null==f||f(e)):b(String(d))},onKeyDown:function(e){"Enter"===e.key&&e.currentTarget.blur(),"Escape"===e.key&&b(String(d))}})]})},et=function(n){var o=n.widget,i=n.value,a=n.onValueChange,c=n.withoutName,l=n.description,d=u(R),f=B(null==d?void 0:d.user),p=b({onDropdownClose:function(){return p.resetSelectedOption()}}),v=void 0===i?o.initialValue:i,h=s((function(){if(!Array.isArray(o.params))return[];if(1===o.params.length&&"object"===k(o.params[0])&&!Array.isArray(o.params[0])){var e=o.params[0];return Object.entries(e).map((function(e){var t=L(e,2),r=t[0],n=t[1];return{label:String(n),value:r}}))}return o.params.map((function(e){return Array.isArray(e)?e.length>1?{label:String(e[1]),value:e[0]}:{label:String(e[0]),value:e[0]}:{label:String(e),value:e}}))}),[o.params]);return e("div",{className:"select widget",children:e(He,{label:t(r,{children:[U(o.title,f),!c&&t(r,{children:[" ","(",e("code",{children:o.name}),")"]})]}),description:U(l,f),options:h,value:v,onValueChange:a})})},tt=function(n){var o,i=n.widget,a=n.value,c=n.onValueChange,l=n.withTextInput,d=n.withoutName,f=n.description,p=u(R),v=B(null==p?void 0:p.user),h=L(s((function(){var e=i.params;if(!Array.isArray(e)||!e.length)return[0,100,1];var t=1===e.length?0:Number(e[0]),r=Number(1===e.length?e[0]:e[1]),n=void 0===e[2]?1:Number(e[2]);return[Number.isFinite(t)?t:0,Number.isFinite(r)?r:100,Number.isFinite(n)&&n>0?n:1]}),[i.params]),3),m=h[0],b=h[1],y=h[2];return"number"!=typeof a||isNaN(a)?(o=Number(i.initialValue),isNaN(o)&&(o=(m+b)/2)):o=a,t("div",{className:"slider widget",children:[t(Ae,{children:[U(i.title,v),!d&&t(r,{children:[" ","(",e("code",{children:i.name}),")"]})]}),f&&e(g,{children:U(f,v)}),e(Ze,{min:m,max:b,step:y,ariaLabel:String(U(i.title,v)||i.name),value:o,onValueChange:c,withTextInput:l})]})},rt=function(r){var n=r.position,o=r.widget,i=r.value,a=r.colorFactory,c=r.onValueChange,s=r.withPrivate,d=r.withoutName,f=r.description,p=u(R),v=B(null==p?void 0:p.user),h=l((function(e){c(o.name,e)}),[o,c]);if(!o)return null;switch(o.className){case"Slider":return e(tt,{widget:o,value:i,withTextInput:!0,withoutName:d,description:f,onValueChange:h});case"Color":return e(Be,{position:n,widget:o,value:i,withoutName:d,description:f,colorFactory:a,onValueChange:h});case"Check":return e(Me,{widget:o,value:i,withoutName:d,description:f,onValueChange:h});case"Select":return e(et,{widget:o,value:i,withoutName:d,description:f,onValueChange:h});case"FontFamily":return e(Je,{widget:o,value:i,withPrivate:s,withoutName:d,description:f,onValueChange:h});default:return t("div",{className:"unsupported widget",children:[e("label",{children:v?"サポートされていないウィジェット":"Unsupported widget"}),e("p",{children:o.className})]})}};function nt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var ot=d((function(t,r){var n=t.widgets,o=t.initialValues,i=t.colorFactory,c=t.onValueChange,u=t.withPrivate,s=t.withoutName,d=L(a(o||{}),2),p=d[0],v=d[1],h=l((function(e,t){var r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nt(Object(r),!0).forEach((function(t){x(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},p);r[e]=t,v(r),c&&c(e,t)}),[p,c]);return f(r,(function(){return{values:p,setValues:v}}),[p]),e("div",{className:"widgets",children:n.map((function(t){return e(rt,{widget:t,value:p[t.name],colorFactory:i,onValueChange:h,withPrivate:u,withoutName:s},"widgets-".concat(t.name))}))})}));export{Me as CheckWidget,qe as ColorPicker,Be as ColorWidget,he as ColorsContext,Ye as FontFamilyDropdown,Je as FontFamilyWidget,me as FontsContext,z as GraphicsDriverContext,Ze as NumericSlider,T as Overlay,ke as Player,V as PlayerContext,E as PlayerControl,C as PlayerLoaderStatus,pe as PlayerOverlay,Se as PlayerSeekbar,fe as PlayerStatus,se as PlayerStatusItem,Ne as PlayerWrapper,R as ProfileContext,ge as ProfileProvider,Ve as ReactPlayer,Pe as Seekbar,He as SelectDropdown,et as SelectWidget,tt as SliderWidget,rt as Widget,Ae as WidgetLabel,ot as Widgets,B as isJa,H as msToString,U as regionalText,q as useResize};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("@mantine/core"),n=require("@mantine/hooks"),o="PlayerControl-module__control___2umaO",i=function(t){var r=t.svgLogoImage;return e.jsx("div",{className:o,dangerouslySetInnerHTML:r?{__html:r}:void 0})},a=function(e){return e[e.Idle=0]="Idle",e[e.Request=1]="Request",e[e.Success=2]="Success",e[e.Fail=3]="Fail",e}({});function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var l=t.createContext(null);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function d(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}function f(e,t,r){return(t=d(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p="Overlay-module__overlay___ernIt";function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var m=function(t){var r=b({},t),n=r.active;return delete r.active,e.jsx("div",b({className:"".concat(p," ").concat(n?"active":"inactive"," overlay")},r))},h=t.createContext(null),g=t.createContext(null);function y(e){if(!e){if("undefined"==typeof window)return!0;var t=window.navigator.languages&&window.navigator.languages[0]||window.navigator.language||window.navigator.userLanguage||window.navigator.browserLanguage,r=t.indexOf("ja"),n=t.indexOf("en");return r>=0&&(n<0||r<n)}return"en"!==e.language}function j(e){return"string"==typeof e?e:e?(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&e.ja||e.default:void 0}function x(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=Math.floor(e/1e3),n=Math.floor(r/60),o=Math.floor(n/60),i=Math.floor(e%1e3),a=r%60,u=n%60,c=String(o).padStart(2,"0"),l=String(u).padStart(2,"0"),s=String(a).padStart(2,"0"),d=String(i).padStart(3,"0");return t?"".concat(o>0?"".concat(c,"時間"):"").concat(l,"分").concat(s,".").concat(d,"秒"):"".concat(o>0?"".concat(c,":"):"").concat(l,":").concat(s,".").concat(d)}var O={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},w=t.createContext&&t.createContext(O),P=["attr","size","title"];function S(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},C.apply(this,arguments)}function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){k(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function k(e,t,r){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?n:n+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function N(e){return e&&e.map(((e,r)=>t.createElement(e.tag,E({key:r},e.attr),N(e.child))))}function D(e){return r=>t.createElement(I,C({attr:E({},e.attr)},r),N(e.child))}function I(e){var r=r=>{var n,{attr:o,size:i,title:a}=e,u=S(e,P),c=i||r.size||"1em";return r.className&&(n=r.className),e.className&&(n=(n?n+" ":"")+e.className),t.createElement("svg",C({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,o,u,{className:n,style:E(E({color:e.color||r.color},r.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),a&&t.createElement("title",null,a),e.children)};return void 0!==w?t.createElement(w.Consumer,null,(e=>r(e))):r(O)}function L(e){return D({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"},child:[]},{tag:"path",attr:{d:"M10.97 4.97a.75.75 0 0 1 1.071 1.05l-3.992 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z"},child:[]}]})(e)}function V(e){return D({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"},child:[]},{tag:"path",attr:{d:"M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0M7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0z"},child:[]}]})(e)}function F(e){return D({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"},child:[]},{tag:"path",attr:{d:"M11.354 4.646a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708l6-6a.5.5 0 0 1 .708 0"},child:[]}]})(e)}function R(e){return D({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"},child:[]}]})(e)}var M="PlayerStatusItem-module__tr___UXBxy",T="PlayerStatusItem-module__left___3VOvc",A="PlayerStatusItem-module__label___oXapr",z="PlayerStatusItem-module__logo___DsgYt",q=function(r){var n=r.label,o=r.status,i=t.useContext(g),u=y(null==i?void 0:i.user);return e.jsxs("tr",{className:"".concat(o===a.Idle?"idle":o===a.Request?"request":o===a.Success?"success":"failed"," ").concat(M),children:[e.jsx("td",{className:T,children:e.jsx("span",{className:A,children:n})}),e.jsxs("td",{className:z,children:[o===a.Idle&&e.jsx(F,{}),o===a.Request&&e.jsx(R,{}),o===a.Fail&&e.jsx(V,{}),o===a.Success&&e.jsx(L,{})]}),e.jsxs("td",{children:[o===a.Request&&(u?"読み込み中":"Loading"),o===a.Fail&&(u?"読み込み失敗":"Failed"),o===a.Success&&(u?"読み込み完了":"Loaded")]})]})},W="PlayerStatus-module__status___2lF7b",B=function(r){var n=r.onError,o=t.useContext(h),i=t.useContext(l),u=t.useContext(g),s=y(null==u?void 0:u.user),d=c(t.useState(a.Idle),2),f=d[0],p=d[1],v=c(t.useState(a.Idle),2),b=v[0],m=v[1],j=c(t.useState(a.Idle),2),x=j[0],O=j[1],w=c(t.useState(a.Idle),2),P=w[0],S=w[1],C=c(t.useState(a.Idle),2),_=C[0],E=C[1],k=c(t.useState(a.Idle),2),N=k[0],D=k[1],I=null!=i&&i.graphics||o?a.Success:a.Request;return t.useEffect((function(){if(i){var e,t=function(e,t){void 0!==t&&(null==n||n(e,t))},r={onVideoLoad:function(r,n){e=r,t("onVideoLoad",n),p(a.Request),m(a.Idle),O(a.Idle),S(a.Idle),E(a.Idle),D(a.Request)},onSongLoad:function(r,n){t("onSongLoad",n),r?(p(a.Success),m(a.Request)):e&&(e.songleCode||e.songleId>=0)?p(a.Fail):p(a.Idle)},onSongMapLoad:function(r,n){t("onSongMapLoad",n),m(r?a.Success:a.Fail),e&&e.lyricId>=0&&O(a.Request)},onLyricsLoad:function(e,r){t("onLyricsLoad",r),O(e?a.Success:a.Fail),e&&S(a.Request)},onTextLoad:function(e,r){t("onTextLoad",r),S(e?a.Success:a.Fail),E(a.Request)},onFontsLoad:function(e,r){t("onFontsLoad",r),E(e?a.Success:a.Fail)},onBackgroundGraphicsUpdate:function(e){D(a.Success)}};return i.addListener(r),function(){i.removeListener(r)}}}),[n,i]),e.jsx("table",{className:"player status ".concat(W),children:e.jsxs("tbody",{children:[e.jsx(q,{label:s?"グラフィックドライバ":"Graphics driver",status:I}),e.jsx(q,{label:s?"楽曲情報":"Song info",status:f}),e.jsx(q,{label:s?"音楽地図":"Song map",status:b}),e.jsx(q,{label:s?"歌詞":"Lyrics",status:x}),e.jsx(q,{label:s?"テキスト":"Text",status:P}),e.jsx(q,{label:s?"フォント":"Fonts",status:_}),e.jsx(q,{label:s?"背景グラフィック":"Background graphics",status:N})]})})};function H(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var U=t.createContext(null),G=t.createContext(null);function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var J="Seekbar-module__seekbar___pCDsH",Y=["position","duration","onSeekStart","onSeek","onSeekEnd"];function $(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function K(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Q=function(n){var o=n.position,i=n.duration,a=n.onSeekStart,u=n.onSeek,c=n.onSeekEnd,l=H(n,Y),s=t.useContext(g),d=y(null==s?void 0:s.user),f=t.useRef(!1),p=t.useRef(a),v=t.useRef(u),b=t.useRef(c),m=t.useRef(null),h=t.useRef(0);t.useEffect((function(){p.current=a,v.current=u,b.current=c}),[u,c,a]);var j=t.useCallback((function(){var e;(f.current||m.current)&&(f.current||(f.current=!0,null===(e=p.current)||void 0===e||e.call(p)))}),[]),O=t.useCallback((function(){var e;f.current&&(f.current=!1,m.current=null,null===(e=b.current)||void 0===e||e.call(b))}),[]),w=t.useCallback((function(e){var t;j(),null===(t=v.current)||void 0===t||t.call(v,e)}),[j]),P=t.useCallback((function(e){O()}),[O]),S=t.useCallback((function(e){return x(e,d)}),[d]),C=t.useCallback((function(e){m.current=e}),[]),_=t.useCallback((function(){return Date.now()-h.current<1e3}),[]),E=t.useCallback((function(e){h.current=Date.now(),C("capture:touchstart")}),[C]),k=t.useCallback((function(e){"mouse"===e.pointerType&&_()||("touch"===e.pointerType&&(h.current=Date.now()),C("capture:pointerdown:".concat(e.pointerType)))}),[C,_]),N=t.useCallback((function(e){_()||C("capture:mousedown")}),[C,_]);return t.useEffect((function(){var e=function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(h.current=Date.now()),O()},t=function(){"hidden"===document.visibilityState&&e()},r=function(){return e()},n=function(){return e(!0)},o=function(){return e(!0)},i=function(){return e()},a=function(){return e(!0)},u=function(){return e()};return document.addEventListener("mouseup",r),document.addEventListener("touchend",n),document.addEventListener("touchcancel",o),document.addEventListener("pointerup",i),document.addEventListener("pointercancel",a),window.addEventListener("blur",u),document.addEventListener("visibilitychange",t),function(){document.removeEventListener("mouseup",r),document.removeEventListener("touchend",n),document.removeEventListener("touchcancel",o),document.removeEventListener("pointerup",i),document.removeEventListener("pointercancel",a),window.removeEventListener("blur",u),document.removeEventListener("visibilitychange",t),O()}}),[O]),e.jsx("div",{className:"".concat(J," seekbar"),onTouchStartCapture:E,onPointerDownCapture:k,onMouseDownCapture:N,children:e.jsx(r.Slider,K(K({},l),{},{value:o,min:0,max:i,onChange:w,onChangeEnd:P,label:S}))})},Z={wrapper:"PlayerWrapper-module__wrapper___fjlgO"},ee="ReactPlayer-module__player___rvJIC",te=["transparent","playerFactory","onInit","children"];function re(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?re(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var oe=function(r){var o=r.transparent,i=r.playerFactory,a=r.onInit,u=r.children,l=H(r,te),s=t.useRef(null),d=c(t.useState(null),2),f=d[0],p=d[1],v=n.useElementSize(),b=v.ref,m=v.width,h=v.height;return t.useEffect((function(){var e=l.graphics,t=l.mediaElement,r=l.unsafeAcceleration;if(s.current&&e){if(f){var n=f.stageElement!==s.current,o=f.mediaElement!==t,a=f.graphics!==e,u=f.options.unsafeAcceleration!==r;if(!(n||o||a||u))return;if(!o&&!a&&!u)return void(f.stageElement=s.current);if(!n&&!a&&!u)return void(f.mediaElement=t);f.dispose()}p(i(ne(ne({},l),{},{stageElement:s.current,mediaElement:t})))}}),[i,s.current,l]),t.useEffect((function(){f&&a&&a(f)}),[f]),t.useEffect((function(){f&&f.resize({width:m||480,height:h||270})}),[m,h]),e.jsxs("div",{ref:b,className:"".concat(ee," textalive-player ").concat(o?"transparent":"white"),children:[e.jsx("canvas",{ref:s}),u]})},ie="WidgetLabel-module__label___UzNG4";function ae(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ae(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ae(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ce=function(t){return e.jsx(r.Text,ue(ue({component:"div"},t),{},{className:ie}))},le=function(n){var o=n.widget,i=n.value,a=n.onValueChange,u=n.withoutName,c=n.description,l=t.useContext(g),s=y(null==l?void 0:l.user),d="boolean"==typeof i?i:!!o.initialValue,f=t.useCallback((function(e){a&&a(e.currentTarget.checked)}),[a]);return e.jsxs("div",{className:"check widget",children:[e.jsxs(ce,{children:[j(o.title,s),!u&&e.jsxs(e.Fragment,{children:[" ","(",e.jsx("code",{children:o.name}),")"]})]}),e.jsx(r.Switch,{size:"md",description:j(c,s),checked:d,onChange:f})]})},se="ColorWidget-module__color___XheVj";function de(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?de(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):de(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var pe=function(n){var o=n.position,i=void 0===o?"leftAligned":o,a=n.label,u=n.labelTitle,c=n.description,l=n.value,s=n.colorFactory,d=n.onValueChange,f=t.useContext(U),p=t.useMemo((function(){return function(e){null==d||d(s(e))}}),[d,s]);return e.jsx("div",{className:se,children:e.jsx(r.ColorInput,fe(fe(fe({},i?{popoverProps:{position:"leftAligned"===i?"bottom-start":"rightAligned"===i?"bottom-end":"bottom"}}:{}),f?{swatches:f}:{}),{},{format:"hex",label:e.jsx(ce,{children:a}),description:c||u,value:l.rgb,onChange:p,withEyeDropper:!1}))})},ve=function(r){var n=r.position,o=r.widget,i=r.value,a=r.colorFactory,u=r.onValueChange,c=r.withoutName,l=r.description,d=t.useContext(g),f=y(null==d?void 0:d.user),p=function(e,t){return"object"===s(e)?e:t(String(e))}(i||(null==o?void 0:o.initialValue),a);return e.jsx("div",{className:"color widget",children:e.jsx(pe,{position:n,label:e.jsxs(ce,{children:[j(o.title,f),!c&&e.jsxs(e.Fragment,{children:[" ","(",e.jsx("code",{children:o.name}),")"]})]}),description:j(l,f),value:p,colorFactory:a,onValueChange:u})})};var be="SelectDropdown-module__description___f1qjY",me=function(n){var o=n.label,i=n.description,a=n.options,u=n.value,c=n.disabled,l=n.onValueChange,s=t.useContext(g),d=y(null==s?void 0:s.user),f=r.useCombobox({onDropdownClose:function(){return f.resetSelectedOption()}}),p=t.useMemo((function(){return(a||[]).find((function(e){return String(e.value)===String(u)}))}),[a,u]);return e.jsxs(e.Fragment,{children:[o&&e.jsx(ce,{children:o}),i&&e.jsx(r.InputDescription,{className:be,children:i}),e.jsxs(r.Combobox,{store:f,disabled:c,withinPortal:!0,width:"target",onOptionSubmit:function(e){null==l||l(e),f.closeDropdown()},children:[e.jsx(r.Combobox.Target,{children:e.jsx(r.InputBase,{disabled:c,component:"button",type:"button",pointer:!0,rightSection:e.jsx(r.Combobox.Chevron,{}),rightSectionPointerEvents:"none",onClick:function(){return f.toggleDropdown()},children:(null==p?void 0:p.label)||e.jsx(r.Input.Placeholder,{children:d?"選択してください":"Pick value"})})}),e.jsx(r.Combobox.Dropdown,{children:e.jsx(r.ScrollArea.Autosize,{mah:"min(50vh, 320px)",type:"scroll",children:e.jsx(r.Combobox.Options,{children:null==a?void 0:a.map((function(t,n){return e.jsx(r.Combobox.Option,{value:String(t.value),children:t.label},n)}))})})})]})]})},he=["value","onValueChange","withPrivate"];function ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ye(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ge(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var je=function(n){var o=n.value,i=n.onValueChange,a=n.withPrivate,u=H(n,he),c=t.useContext(g),l=y(null==c?void 0:c.user),s=t.useContext(G),d=t.useMemo((function(){return!Array.isArray(s)||s.length<=0?null:(a?s:s.filter((function(e){return!e.isPrivate}))).map((function(t){return{label:e.jsxs("span",{children:[t.isPrivate&&e.jsxs(e.Fragment,{children:[e.jsx(r.Pill,{size:"sm",children:l?"プライベート":"Private"})," "]}),e.jsx("span",{style:{fontFamily:t.isPrivate?t.key:t.en},children:l?t.ja:t.en})]}),value:t.isPrivate?t.key:t.en}}))}),[a,l,s]);return e.jsx(me,ye(ye({},u),{},{options:d,value:o,disabled:!d,onValueChange:i}))},xe=function(r){var n=r.widget,o=r.value,i=r.onValueChange,a=r.withPrivate,u=r.withoutName,c=r.description,l=t.useContext(g),s=y(null==l?void 0:l.user),d=void 0===o?n.initialValue:o;return e.jsx("div",{className:"font family widget",children:e.jsx(je,{withPrivate:a,label:e.jsxs(e.Fragment,{children:[j(n.title,s),!u&&e.jsxs(e.Fragment,{children:[" ","(",e.jsx("code",{children:n.name}),")"]})]}),description:j(c,s),value:d,onValueChange:i})})},Oe="NumericSlider-module__widget___6EwOt",we="NumericSlider-module__input___tGIR-",Pe="NumericSlider-module__text___wjhb9",Se=function(t){var n=t.disabled,o=t.min,i=t.max,a=t.value,u=t.onValueChange,c=t.withTextInput;return e.jsxs("div",{className:Oe,children:[e.jsx(r.Slider,{className:we,disabled:n,min:o,max:i,step:1,label:c?null:void 0,value:a,onChange:function(e){return null==u?void 0:u(e)}}),c&&e.jsx(r.TextInput,{className:Pe,disabled:n,value:String(a),type:"number",onChange:function(e){return null==u?void 0:u(parseInt(e.target.value))}})]})},Ce=function(n){var o=n.widget,i=n.value,a=n.onValueChange,u=n.withoutName,l=n.description,d=t.useContext(g),f=y(null==d?void 0:d.user),p=r.useCombobox({onDropdownClose:function(){return p.resetSelectedOption()}}),v=void 0===i?o.initialValue:i,b=t.useMemo((function(){if(!Array.isArray(o.params))return[];if(1===o.params.length&&"object"===s(o.params[0])&&!Array.isArray(o.params[0])){var e=o.params[0];return Object.entries(e).map((function(e){var t=c(e,2),r=t[0],n=t[1];return{label:String(n),value:r}}))}return o.params.map((function(e){return Array.isArray(e)?e.length>1?{label:String(e[1]),value:e[0]}:{label:String(e[0]),value:e[0]}:{label:String(e),value:e}}))}),[o.params]);return e.jsx("div",{className:"select widget",children:e.jsx(me,{label:e.jsxs(e.Fragment,{children:[j(o.title,f),!u&&e.jsxs(e.Fragment,{children:[" ","(",e.jsx("code",{children:o.name}),")"]})]}),description:j(l,f),options:b,value:v,onValueChange:a})})},_e=function(n){var o,i=n.widget,a=n.value,u=n.onValueChange,l=n.withTextInput,s=n.withoutName,d=n.description,f=t.useContext(g),p=y(null==f?void 0:f.user),v=t.useMemo((function(){var e=0,t=100;if(Array.isArray(i.params))switch(i.params.length){case 1:var r=parseInt(i.params[0]);isNaN(r)||(t=r);break;case 2:var n=parseInt(i.params[0]),o=parseInt(i.params[1]);isNaN(n)||isNaN(o)||(e=n,t=o)}return[e,t]}),[i.params]),b=c(v,2),m=b[0],h=b[1];return"number"!=typeof a||isNaN(a)?(o=parseInt(i.initialValue),isNaN(o)&&(o=(m+h)/2)):o=a,e.jsxs("div",{className:"slider widget",children:[e.jsxs(ce,{children:[j(i.title,p),!s&&e.jsxs(e.Fragment,{children:[" ","(",e.jsx("code",{children:i.name}),")"]})]}),d&&e.jsx(r.InputDescription,{children:j(d,p)}),e.jsx(Se,{min:m,max:h,value:o,onValueChange:u,withTextInput:l})]})},Ee=function(r){var n=r.position,o=r.widget,i=r.value,a=r.colorFactory,u=r.onValueChange,c=r.withPrivate,l=r.withoutName,s=r.description,d=t.useContext(g),f=y(null==d?void 0:d.user),p=t.useCallback((function(e){u(o.name,e)}),[o,u]);if(!o)return null;switch(o.className){case"Slider":return e.jsx(_e,{widget:o,value:i,withTextInput:!0,withoutName:l,description:s,onValueChange:p});case"Color":return e.jsx(ve,{position:n,widget:o,value:i,withoutName:l,description:s,colorFactory:a,onValueChange:p});case"Check":return e.jsx(le,{widget:o,value:i,withoutName:l,description:s,onValueChange:p});case"Select":return e.jsx(Ce,{widget:o,value:i,withoutName:l,description:s,onValueChange:p});case"FontFamily":return e.jsx(xe,{widget:o,value:i,withPrivate:c,withoutName:l,description:s,onValueChange:p});default:return e.jsxs("div",{className:"unsupported widget",children:[e.jsx("label",{children:f?"サポートされていないウィジェット":"Unsupported widget"}),e.jsx("p",{children:o.className})]})}};function ke(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var Ne=t.forwardRef((function(r,n){var o=r.widgets,i=r.initialValues,a=r.colorFactory,u=r.onValueChange,l=r.withPrivate,s=r.withoutName,d=c(t.useState(i||{}),2),p=d[0],v=d[1],b=t.useCallback((function(e,t){var r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ke(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ke(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},p);r[e]=t,v(r),u&&u(e,t)}),[p,u]);return t.useImperativeHandle(n,(function(){return{values:p,setValues:v}}),[p]),e.jsx("div",{className:"widgets",children:o.map((function(t){return e.jsx(Ee,{widget:t,value:p[t.name],colorFactory:a,onValueChange:b,withPrivate:l,withoutName:s},"widgets-".concat(t.name))}))})}));exports.CheckWidget=le,exports.ColorPicker=pe,exports.ColorWidget=ve,exports.ColorsContext=U,exports.FontFamilyDropdown=je,exports.FontFamilyWidget=xe,exports.FontsContext=G,exports.GraphicsDriverContext=h,exports.NumericSlider=Se,exports.Overlay=m,exports.Player=function(r){return t.useEffect((function(){console.warn('[TextAlive React API] import { Player } from "textalive-react-api" is deprecated; use ReactPlayer instead')}),[]),e.jsx(oe,ne({},r))},exports.PlayerContext=l,exports.PlayerControl=i,exports.PlayerLoaderStatus=a,exports.PlayerOverlay=function(r){var n=r.showStatus,o=r.svgLogoImage,a=r.onError,u=t.useContext(l),s=c(t.useState(!1),2),d=s[0],f=s[1],p=c(t.useState(!1),2),v=p[0],b=p[1],h=c(t.useState(!1),2),g=h[0],y=h[1];t.useEffect((function(){if(u){u.video&&f(!0),u.isPlaying&&b(!0),u.isVideoSeeking&&y(!0);var e={onVideoLoad:function(e){f(!1)},onVideoReady:function(e){f(!0)},onPlay:function(){b(!0)},onPause:function(){b(!1)},onStop:function(){b(!1)},onVideoSeekStart:function(){y(!0)},onVideoSeekEnd:function(){y(!1)}};return u.addListener(e),function(){u.removeListener(e)}}}),[u]);var j=t.useCallback((function(e){u&&u.video&&(e.preventDefault(),u.isPlaying?u.requestPause():u.requestPlay())}),[u]);return e.jsx(m,{active:n&&!d||!v&&!g,onClick:n&&!d?void 0:j,children:d?e.jsx(i,{svgLogoImage:o}):n&&e.jsx(B,{onError:a})})},exports.PlayerSeekbar=function(r){var n=r.disabled,o=r.player,i=t.useContext(l),a=o||i,u=c(t.useState(0),2),s=u[0],d=u[1],f=c(t.useState(0),2),p=f[0],v=f[1];t.useEffect((function(){var e;if(a){var t={onVideoReady:function(e){return v(e.duration)},onThrottledTimeUpdate:function(){return d(a.videoPosition)}};return a.addListener(t),"number"==typeof(null===(e=a.video)||void 0===e?void 0:e.duration)&&v(a.video.duration),d(a.videoPosition),function(){a.removeListener(t)}}}),[a]);var b=t.useCallback((function(e){null==a||a.setVideoPosition(e),d(e)}),[a]),m=t.useCallback((function(){null==a||a.startVideoSeek()}),[a]),h=t.useCallback((function(){a&&(a.endVideoSeek(),a.requestMediaSeek(a.videoPosition))}),[a]),g=!(!a||!a.video);return e.jsx(Q,{disabled:"boolean"==typeof n?n:!g,position:s,duration:p,onSeekStart:g?m:void 0,onSeek:g?b:void 0,onSeekEnd:g?h:void 0})},exports.PlayerStatus=B,exports.PlayerStatusItem=q,exports.PlayerWrapper=function(t){var r=t.children,n=t.overlayed,o=t.rounded,i=t.bordered;return e.jsx("div",{className:[Z.wrapper,n&&"overlayed",i&&"bordered",o&&"rounded"].filter((function(e){return!!e})).join(" "),children:r})},exports.ProfileContext=g,exports.ProfileProvider=function(r){var n=r.manager,o=r.children,i=c(t.useState(null),2),a=i[0],u=i[1];return t.useEffect((function(){if("undefined"!=typeof window){var e=!0,t={onUserProfileUpdated:function(e){u(e?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?X(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e):null)}};return n.addListener(t),n.getProfile().then((function(t){return e&&u(t)})),function(){n.removeListener(t),e=!1}}}),[n]),e.jsx(g.Provider,{value:a,children:o})},exports.ReactPlayer=oe,exports.Seekbar=Q,exports.SelectDropdown=me,exports.SelectWidget=Ce,exports.SliderWidget=_e,exports.Widget=Ee,exports.WidgetLabel=ce,exports.Widgets=Ne,exports.isJa=y,exports.msToString=x,exports.regionalText=j,exports.useResize=function(){var e=t.useRef(null),r=c(t.useState({width:0,height:0}),2),n=r[0],o=r[1];return t.useEffect((function(){if(window){var t=function(){if(e.current){var t=e.current,n=t.clientWidth,i=t.clientHeight;o({width:n,height:i})}r=null},r=null,n=function(){r||(r=setTimeout(t,200))};return window.addEventListener("resize",n),t(),function(){window.removeEventListener("resize",n)}}}),[]),[n,e]};
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("@mantine/core"),n=require("@mantine/hooks"),o="PlayerControl-module__control___2umaO",i=function(t){var r=t.svgLogoImage;return e.jsx("div",{className:o,dangerouslySetInnerHTML:r?{__html:r}:void 0})},a=function(e){return e[e.Idle=0]="Idle",e[e.Request=1]="Request",e[e.Success=2]="Success",e[e.Fail=3]="Fail",e}({});function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var l=t.createContext(null);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function d(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}function f(e,t,r){return(t=d(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p="Overlay-module__overlay___ernIt";function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var m=function(t){var r=b({},t),n=r.active;return delete r.active,e.jsx("div",b({className:"".concat(p," ").concat(n?"active":"inactive"," overlay")},r))},h=t.createContext(null),g=t.createContext(null);function y(e){if(!e){if("undefined"==typeof window)return!0;var t=window.navigator.languages&&window.navigator.languages[0]||window.navigator.language||window.navigator.userLanguage||window.navigator.browserLanguage,r=t.indexOf("ja"),n=t.indexOf("en");return r>=0&&(n<0||r<n)}return"en"!==e.language}function j(e){return"string"==typeof e?e:e?(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&e.ja||e.default:void 0}function x(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=Math.floor(e/1e3),n=Math.floor(r/60),o=Math.floor(n/60),i=Math.floor(e%1e3),a=r%60,u=n%60,c=String(o).padStart(2,"0"),l=String(u).padStart(2,"0"),s=String(a).padStart(2,"0"),d=String(i).padStart(3,"0");return t?"".concat(o>0?"".concat(c,"時間"):"").concat(l,"分").concat(s,".").concat(d,"秒"):"".concat(o>0?"".concat(c,":"):"").concat(l,":").concat(s,".").concat(d)}var O={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},w=t.createContext&&t.createContext(O),S=["attr","size","title"];function P(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},C.apply(this,arguments)}function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){k(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function k(e,t,r){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?n:n+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function N(e){return e&&e.map(((e,r)=>t.createElement(e.tag,E({key:r},e.attr),N(e.child))))}function D(e){return r=>t.createElement(L,C({attr:E({},e.attr)},r),N(e.child))}function L(e){var r=r=>{var n,{attr:o,size:i,title:a}=e,u=P(e,S),c=i||r.size||"1em";return r.className&&(n=r.className),e.className&&(n=(n?n+" ":"")+e.className),t.createElement("svg",C({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,o,u,{className:n,style:E(E({color:e.color||r.color},r.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),a&&t.createElement("title",null,a),e.children)};return void 0!==w?t.createElement(w.Consumer,null,(e=>r(e))):r(O)}function V(e){return D({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"},child:[]},{tag:"path",attr:{d:"M10.97 4.97a.75.75 0 0 1 1.071 1.05l-3.992 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z"},child:[]}]})(e)}function I(e){return D({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"},child:[]},{tag:"path",attr:{d:"M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0M7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0z"},child:[]}]})(e)}function F(e){return D({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"},child:[]},{tag:"path",attr:{d:"M11.354 4.646a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708l6-6a.5.5 0 0 1 .708 0"},child:[]}]})(e)}function R(e){return D({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"},child:[]}]})(e)}var M="PlayerStatusItem-module__tr___UXBxy",A="PlayerStatusItem-module__left___3VOvc",T="PlayerStatusItem-module__label___oXapr",z="PlayerStatusItem-module__logo___DsgYt",q=function(r){var n=r.label,o=r.status,i=t.useContext(g),u=y(null==i?void 0:i.user);return e.jsxs("tr",{className:"".concat(o===a.Idle?"idle":o===a.Request?"request":o===a.Success?"success":"failed"," ").concat(M),children:[e.jsx("td",{className:A,children:e.jsx("span",{className:T,children:n})}),e.jsxs("td",{className:z,children:[o===a.Idle&&e.jsx(F,{}),o===a.Request&&e.jsx(R,{}),o===a.Fail&&e.jsx(I,{}),o===a.Success&&e.jsx(V,{})]}),e.jsxs("td",{children:[o===a.Request&&(u?"読み込み中":"Loading"),o===a.Fail&&(u?"読み込み失敗":"Failed"),o===a.Success&&(u?"読み込み完了":"Loaded")]})]})},W="PlayerStatus-module__status___2lF7b",B=function(r){var n=r.onError,o=t.useContext(h),i=t.useContext(l),u=t.useContext(g),s=y(null==u?void 0:u.user),d=c(t.useState(a.Idle),2),f=d[0],p=d[1],v=c(t.useState(a.Idle),2),b=v[0],m=v[1],j=c(t.useState(a.Idle),2),x=j[0],O=j[1],w=c(t.useState(a.Idle),2),S=w[0],P=w[1],C=c(t.useState(a.Idle),2),_=C[0],E=C[1],k=c(t.useState(a.Idle),2),N=k[0],D=k[1],L=null!=i&&i.graphics||o?a.Success:a.Request;return t.useEffect((function(){if(i){var e,t=function(e,t){void 0!==t&&(null==n||n(e,t))},r={onVideoLoad:function(r,n){e=r,t("onVideoLoad",n),p(a.Request),m(a.Idle),O(a.Idle),P(a.Idle),E(a.Idle),D(a.Request)},onSongLoad:function(r,n){t("onSongLoad",n),r?(p(a.Success),m(a.Request)):e&&(e.songleCode||e.songleId>=0)?p(a.Fail):p(a.Idle)},onSongMapLoad:function(r,n){t("onSongMapLoad",n),m(r?a.Success:a.Fail),e&&e.lyricId>=0&&O(a.Request)},onLyricsLoad:function(e,r){t("onLyricsLoad",r),O(e?a.Success:a.Fail),e&&P(a.Request)},onTextLoad:function(e,r){t("onTextLoad",r),P(e?a.Success:a.Fail),E(a.Request)},onFontsLoad:function(e,r){t("onFontsLoad",r),E(e?a.Success:a.Fail)},onBackgroundGraphicsUpdate:function(e){D(a.Success)}};return i.addListener(r),function(){i.removeListener(r)}}}),[n,i]),e.jsx("table",{className:"player status ".concat(W),children:e.jsxs("tbody",{children:[e.jsx(q,{label:s?"グラフィックドライバ":"Graphics driver",status:L}),e.jsx(q,{label:s?"楽曲情報":"Song info",status:f}),e.jsx(q,{label:s?"音楽地図":"Song map",status:b}),e.jsx(q,{label:s?"歌詞":"Lyrics",status:x}),e.jsx(q,{label:s?"テキスト":"Text",status:S}),e.jsx(q,{label:s?"フォント":"Fonts",status:_}),e.jsx(q,{label:s?"背景グラフィック":"Background graphics",status:N})]})})};function H(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var U=t.createContext(null),G=t.createContext(null);function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var J="Seekbar-module__seekbar___pCDsH",Y=["position","duration","onSeekStart","onSeek","onSeekEnd"];function K(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?K(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Q=function(n){var o=n.position,i=n.duration,a=n.onSeekStart,u=n.onSeek,c=n.onSeekEnd,l=H(n,Y),s=t.useContext(g),d=y(null==s?void 0:s.user),f=t.useRef(!1),p=t.useRef(a),v=t.useRef(u),b=t.useRef(c),m=t.useRef(null),h=t.useRef(0);t.useEffect((function(){p.current=a,v.current=u,b.current=c}),[u,c,a]);var j=t.useCallback((function(){var e;(f.current||m.current)&&(f.current||(f.current=!0,null===(e=p.current)||void 0===e||e.call(p)))}),[]),O=t.useCallback((function(){var e;f.current&&(f.current=!1,m.current=null,null===(e=b.current)||void 0===e||e.call(b))}),[]),w=t.useCallback((function(e){var t;j(),null===(t=v.current)||void 0===t||t.call(v,e)}),[j]),S=t.useCallback((function(e){O()}),[O]),P=t.useCallback((function(e){return x(e,d)}),[d]),C=t.useCallback((function(e){m.current=e}),[]),_=t.useCallback((function(){return Date.now()-h.current<1e3}),[]),E=t.useCallback((function(e){h.current=Date.now(),C("capture:touchstart")}),[C]),k=t.useCallback((function(e){"mouse"===e.pointerType&&_()||("touch"===e.pointerType&&(h.current=Date.now()),C("capture:pointerdown:".concat(e.pointerType)))}),[C,_]),N=t.useCallback((function(e){_()||C("capture:mousedown")}),[C,_]);return t.useEffect((function(){var e=function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(h.current=Date.now()),O()},t=function(){"hidden"===document.visibilityState&&e()},r=function(){return e()},n=function(){return e(!0)},o=function(){return e(!0)},i=function(){return e()},a=function(){return e(!0)},u=function(){return e()};return document.addEventListener("mouseup",r),document.addEventListener("touchend",n),document.addEventListener("touchcancel",o),document.addEventListener("pointerup",i),document.addEventListener("pointercancel",a),window.addEventListener("blur",u),document.addEventListener("visibilitychange",t),function(){document.removeEventListener("mouseup",r),document.removeEventListener("touchend",n),document.removeEventListener("touchcancel",o),document.removeEventListener("pointerup",i),document.removeEventListener("pointercancel",a),window.removeEventListener("blur",u),document.removeEventListener("visibilitychange",t),O()}}),[O]),e.jsx("div",{className:"".concat(J," seekbar"),onTouchStartCapture:E,onPointerDownCapture:k,onMouseDownCapture:N,children:e.jsx(r.Slider,$($({},l),{},{value:o,min:0,max:i,onChange:w,onChangeEnd:S,label:P}))})},Z={wrapper:"PlayerWrapper-module__wrapper___fjlgO"},ee="ReactPlayer-module__player___rvJIC",te=["transparent","playerFactory","onInit","children"];function re(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?re(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var oe=function(r){var o=r.transparent,i=r.playerFactory,a=r.onInit,u=r.children,l=H(r,te),s=t.useRef(null),d=c(t.useState(null),2),f=d[0],p=d[1],v=t.useRef(null),b=t.useRef(l);b.current=l;var m=t.useRef(i);m.current=i;var h=n.useElementSize(),g=h.ref,y=h.width,j=h.height,x=l.graphics,O=l.unsafeAcceleration,w=l.mediaElement;return t.useEffect((function(){if(s.current&&x){var e=m.current(ne(ne({},b.current),{},{stageElement:s.current}));return v.current=e,p(e),function(){v.current===e&&(v.current=null),e.dispose()}}}),[x,O]),t.useEffect((function(){v.current&&v.current.mediaElement!==w&&(v.current.mediaElement=w)}),[w]),t.useEffect((function(){f&&v.current===f&&a&&a(f)}),[f]),t.useEffect((function(){f&&v.current===f&&f.resize({width:y||480,height:j||270})}),[f,y,j]),e.jsxs("div",{ref:g,className:"".concat(ee," textalive-player ").concat(o?"transparent":"white"),children:[e.jsx("canvas",{ref:s}),u]})},ie="WidgetLabel-module__label___UzNG4";function ae(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ae(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ae(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ce=function(t){return e.jsx(r.Text,ue(ue({component:"div"},t),{},{className:ie}))},le=function(n){var o=n.widget,i=n.value,a=n.onValueChange,u=n.withoutName,c=n.description,l=t.useContext(g),s=y(null==l?void 0:l.user),d="boolean"==typeof i?i:!!o.initialValue,f=t.useCallback((function(e){a&&a(e.currentTarget.checked)}),[a]);return e.jsxs("div",{className:"check widget",children:[e.jsxs(ce,{children:[j(o.title,s),!u&&e.jsxs(e.Fragment,{children:[" ","(",e.jsx("code",{children:o.name}),")"]})]}),e.jsx(r.Switch,{size:"md",description:j(c,s),checked:d,onChange:f})]})},se="ColorWidget-module__color___XheVj";function de(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?de(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):de(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var pe=function(n){var o=n.position,i=void 0===o?"leftAligned":o,a=n.label,u=n.labelTitle,c=n.description,l=n.value,s=n.withAlpha,d=void 0!==s&&s,f=n.colorFactory,p=n.onValueChange,v=t.useContext(U),b=t.useMemo((function(){return function(e){null==p||p(f(e))}}),[p,f]);return e.jsx("div",{className:se,children:e.jsx(r.ColorInput,fe(fe(fe({},i?{popoverProps:{position:"leftAligned"===i?"bottom-start":"rightAligned"===i?"bottom-end":"bottom"}}:{}),v?{swatches:v}:{}),{},{format:d?"hexa":"hex",label:e.jsx(ce,{children:a}),description:c||u,value:d?l.toString():l.rgb,onChange:b,withEyeDropper:!1}))})},ve=function(r){var n=r.position,o=r.withAlpha,i=r.widget,a=r.value,u=r.colorFactory,c=r.onValueChange,l=r.withoutName,d=r.description,f=t.useContext(g),p=y(null==f?void 0:f.user),v=function(e,t){return"object"===s(e)?e:t(String(e))}(a||(null==i?void 0:i.initialValue),u);return e.jsx("div",{className:"color widget",children:e.jsx(pe,{position:n,withAlpha:o,label:e.jsxs(ce,{children:[j(i.title,p),!l&&e.jsxs(e.Fragment,{children:[" ","(",e.jsx("code",{children:i.name}),")"]})]}),description:j(d,p),value:v,colorFactory:u,onValueChange:c})})};var be="SelectDropdown-module__description___f1qjY",me=function(n){var o=n.label,i=n.description,a=n.options,u=n.value,c=n.disabled,l=n.onValueChange,s=t.useContext(g),d=y(null==s?void 0:s.user),f=r.useCombobox({onDropdownClose:function(){return f.resetSelectedOption()}}),p=t.useMemo((function(){return(a||[]).find((function(e){return String(e.value)===String(u)}))}),[a,u]);return e.jsxs(e.Fragment,{children:[o&&e.jsx(ce,{children:o}),i&&e.jsx(r.InputDescription,{className:be,children:i}),e.jsxs(r.Combobox,{store:f,disabled:c,withinPortal:!0,width:"target",onOptionSubmit:function(e){null==l||l(e),f.closeDropdown()},children:[e.jsx(r.Combobox.Target,{children:e.jsx(r.InputBase,{disabled:c,component:"button",type:"button",pointer:!0,rightSection:e.jsx(r.Combobox.Chevron,{}),rightSectionPointerEvents:"none",onClick:function(){return f.toggleDropdown()},children:(null==p?void 0:p.label)||e.jsx(r.Input.Placeholder,{children:d?"選択してください":"Pick value"})})}),e.jsx(r.Combobox.Dropdown,{children:e.jsx(r.ScrollArea.Autosize,{mah:"min(50vh, 320px)",type:"scroll",children:e.jsx(r.Combobox.Options,{children:null==a?void 0:a.map((function(t,n){return e.jsx(r.Combobox.Option,{value:String(t.value),children:t.label},n)}))})})})]})]})},he=["value","onValueChange","withPrivate"];function ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ye(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ge(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var je=function(n){var o=n.value,i=n.onValueChange,a=n.withPrivate,u=H(n,he),c=t.useContext(g),l=y(null==c?void 0:c.user),s=t.useContext(G),d=t.useMemo((function(){return!Array.isArray(s)||s.length<=0?null:(a?s:s.filter((function(e){return!e.isPrivate}))).map((function(t){return{label:e.jsxs("span",{children:[t.isPrivate&&e.jsxs(e.Fragment,{children:[e.jsx(r.Pill,{size:"sm",children:l?"プライベート":"Private"})," "]}),e.jsx("span",{style:{fontFamily:t.isPrivate?t.key:t.en},children:l?t.ja:t.en})]}),value:t.isPrivate?t.key:t.en}}))}),[a,l,s]);return e.jsx(me,ye(ye({},u),{},{options:d,value:o,disabled:!d,onValueChange:i}))},xe=function(r){var n=r.widget,o=r.value,i=r.onValueChange,a=r.withPrivate,u=r.withoutName,c=r.description,l=t.useContext(g),s=y(null==l?void 0:l.user),d=void 0===o?n.initialValue:o;return e.jsx("div",{className:"font family widget",children:e.jsx(je,{withPrivate:a,label:e.jsxs(e.Fragment,{children:[j(n.title,s),!u&&e.jsxs(e.Fragment,{children:[" ","(",e.jsx("code",{children:n.name}),")"]})]}),description:j(c,s),value:d,onValueChange:i})})},Oe="NumericSlider-module__widget___6EwOt",we="NumericSlider-module__input___tGIR-",Se="NumericSlider-module__text___wjhb9",Pe=function(n){var o=n.disabled,i=n.min,a=n.max,u=n.step,l=void 0===u?1:u,s=n.ariaLabel,d=n.value,f=n.onValueChange,p=n.withTextInput,v=c(t.useState(String(d)),2),b=v[0],m=v[1];t.useEffect((function(){return m(String(d))}),[d]);return e.jsxs("div",{className:Oe,children:[e.jsx(r.Slider,{thumbLabel:s,className:we,disabled:o,min:i,max:a,step:l,label:p?null:void 0,value:d,onChange:function(e){return null==f?void 0:f(e)}}),p&&e.jsx(r.TextInput,{className:Se,disabled:o,"aria-label":s,value:b,type:"number",min:i,max:a,step:l,onChange:function(e){return m(e.target.value)},onBlur:function(){var e=Number(b);b.trim()&&Number.isFinite(e)&&e>=i&&e<=a&&Math.abs((e-i)/l-Math.round((e-i)/l))<1e-7?e!==Number(d)&&(null==f||f(e)):m(String(d))},onKeyDown:function(e){"Enter"===e.key&&e.currentTarget.blur(),"Escape"===e.key&&m(String(d))}})]})},Ce=function(n){var o=n.widget,i=n.value,a=n.onValueChange,u=n.withoutName,l=n.description,d=t.useContext(g),f=y(null==d?void 0:d.user),p=r.useCombobox({onDropdownClose:function(){return p.resetSelectedOption()}}),v=void 0===i?o.initialValue:i,b=t.useMemo((function(){if(!Array.isArray(o.params))return[];if(1===o.params.length&&"object"===s(o.params[0])&&!Array.isArray(o.params[0])){var e=o.params[0];return Object.entries(e).map((function(e){var t=c(e,2),r=t[0],n=t[1];return{label:String(n),value:r}}))}return o.params.map((function(e){return Array.isArray(e)?e.length>1?{label:String(e[1]),value:e[0]}:{label:String(e[0]),value:e[0]}:{label:String(e),value:e}}))}),[o.params]);return e.jsx("div",{className:"select widget",children:e.jsx(me,{label:e.jsxs(e.Fragment,{children:[j(o.title,f),!u&&e.jsxs(e.Fragment,{children:[" ","(",e.jsx("code",{children:o.name}),")"]})]}),description:j(l,f),options:b,value:v,onValueChange:a})})},_e=function(n){var o,i=n.widget,a=n.value,u=n.onValueChange,l=n.withTextInput,s=n.withoutName,d=n.description,f=t.useContext(g),p=y(null==f?void 0:f.user),v=c(t.useMemo((function(){var e=i.params;if(!Array.isArray(e)||!e.length)return[0,100,1];var t=1===e.length?0:Number(e[0]),r=Number(1===e.length?e[0]:e[1]),n=void 0===e[2]?1:Number(e[2]);return[Number.isFinite(t)?t:0,Number.isFinite(r)?r:100,Number.isFinite(n)&&n>0?n:1]}),[i.params]),3),b=v[0],m=v[1],h=v[2];return"number"!=typeof a||isNaN(a)?(o=Number(i.initialValue),isNaN(o)&&(o=(b+m)/2)):o=a,e.jsxs("div",{className:"slider widget",children:[e.jsxs(ce,{children:[j(i.title,p),!s&&e.jsxs(e.Fragment,{children:[" ","(",e.jsx("code",{children:i.name}),")"]})]}),d&&e.jsx(r.InputDescription,{children:j(d,p)}),e.jsx(Pe,{min:b,max:m,step:h,ariaLabel:String(j(i.title,p)||i.name),value:o,onValueChange:u,withTextInput:l})]})},Ee=function(r){var n=r.position,o=r.widget,i=r.value,a=r.colorFactory,u=r.onValueChange,c=r.withPrivate,l=r.withoutName,s=r.description,d=t.useContext(g),f=y(null==d?void 0:d.user),p=t.useCallback((function(e){u(o.name,e)}),[o,u]);if(!o)return null;switch(o.className){case"Slider":return e.jsx(_e,{widget:o,value:i,withTextInput:!0,withoutName:l,description:s,onValueChange:p});case"Color":return e.jsx(ve,{position:n,widget:o,value:i,withoutName:l,description:s,colorFactory:a,onValueChange:p});case"Check":return e.jsx(le,{widget:o,value:i,withoutName:l,description:s,onValueChange:p});case"Select":return e.jsx(Ce,{widget:o,value:i,withoutName:l,description:s,onValueChange:p});case"FontFamily":return e.jsx(xe,{widget:o,value:i,withPrivate:c,withoutName:l,description:s,onValueChange:p});default:return e.jsxs("div",{className:"unsupported widget",children:[e.jsx("label",{children:f?"サポートされていないウィジェット":"Unsupported widget"}),e.jsx("p",{children:o.className})]})}};function ke(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var Ne=t.forwardRef((function(r,n){var o=r.widgets,i=r.initialValues,a=r.colorFactory,u=r.onValueChange,l=r.withPrivate,s=r.withoutName,d=c(t.useState(i||{}),2),p=d[0],v=d[1],b=t.useCallback((function(e,t){var r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ke(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ke(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},p);r[e]=t,v(r),u&&u(e,t)}),[p,u]);return t.useImperativeHandle(n,(function(){return{values:p,setValues:v}}),[p]),e.jsx("div",{className:"widgets",children:o.map((function(t){return e.jsx(Ee,{widget:t,value:p[t.name],colorFactory:a,onValueChange:b,withPrivate:l,withoutName:s},"widgets-".concat(t.name))}))})}));exports.CheckWidget=le,exports.ColorPicker=pe,exports.ColorWidget=ve,exports.ColorsContext=U,exports.FontFamilyDropdown=je,exports.FontFamilyWidget=xe,exports.FontsContext=G,exports.GraphicsDriverContext=h,exports.NumericSlider=Pe,exports.Overlay=m,exports.Player=function(r){return t.useEffect((function(){console.warn('[TextAlive React API] import { Player } from "textalive-react-api" is deprecated; use ReactPlayer instead')}),[]),e.jsx(oe,ne({},r))},exports.PlayerContext=l,exports.PlayerControl=i,exports.PlayerLoaderStatus=a,exports.PlayerOverlay=function(r){var n=r.showStatus,o=r.svgLogoImage,a=r.onError,u=t.useContext(l),s=c(t.useState(!1),2),d=s[0],f=s[1],p=c(t.useState(!1),2),v=p[0],b=p[1],h=c(t.useState(!1),2),g=h[0],y=h[1];t.useEffect((function(){if(u){u.video&&f(!0),u.isPlaying&&b(!0),u.isVideoSeeking&&y(!0);var e={onVideoLoad:function(e){f(!1)},onVideoReady:function(e){f(!0)},onPlay:function(){b(!0)},onPause:function(){b(!1)},onStop:function(){b(!1)},onVideoSeekStart:function(){y(!0)},onVideoSeekEnd:function(){y(!1)}};return u.addListener(e),function(){u.removeListener(e)}}}),[u]);var j=t.useCallback((function(e){u&&u.video&&(e.preventDefault(),u.isPlaying?u.requestPause():u.requestPlay())}),[u]);return e.jsx(m,{active:n&&!d||!v&&!g,onClick:n&&!d?void 0:j,children:d?e.jsx(i,{svgLogoImage:o}):n&&e.jsx(B,{onError:a})})},exports.PlayerSeekbar=function(r){var n=r.disabled,o=r.player,i=t.useContext(l),a=o||i,u=c(t.useState(0),2),s=u[0],d=u[1],f=c(t.useState(0),2),p=f[0],v=f[1];t.useEffect((function(){var e;if(a){var t={onVideoReady:function(e){return v(e.duration)},onThrottledTimeUpdate:function(){return d(a.videoPosition)}};return a.addListener(t),"number"==typeof(null===(e=a.video)||void 0===e?void 0:e.duration)&&v(a.video.duration),d(a.videoPosition),function(){a.removeListener(t)}}}),[a]);var b=t.useCallback((function(e){null==a||a.setVideoPosition(e),d(e)}),[a]),m=t.useCallback((function(){null==a||a.startVideoSeek()}),[a]),h=t.useCallback((function(){a&&(a.endVideoSeek(),a.requestMediaSeek(a.videoPosition))}),[a]),g=!(!a||!a.video);return e.jsx(Q,{disabled:"boolean"==typeof n?n:!g,position:s,duration:p,onSeekStart:g?m:void 0,onSeek:g?b:void 0,onSeekEnd:g?h:void 0})},exports.PlayerStatus=B,exports.PlayerStatusItem=q,exports.PlayerWrapper=function(t){var r=t.children,n=t.overlayed,o=t.rounded,i=t.bordered;return e.jsx("div",{className:[Z.wrapper,n&&"overlayed",i&&"bordered",o&&"rounded"].filter((function(e){return!!e})).join(" "),children:r})},exports.ProfileContext=g,exports.ProfileProvider=function(r){var n=r.manager,o=r.children,i=c(t.useState(null),2),a=i[0],u=i[1];return t.useEffect((function(){if("undefined"!=typeof window){var e=!0,t={onUserProfileUpdated:function(e){u(e?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?X(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e):null)}};return n.addListener(t),n.getProfile().then((function(t){return e&&u(t)})),function(){n.removeListener(t),e=!1}}}),[n]),e.jsx(g.Provider,{value:a,children:o})},exports.ReactPlayer=oe,exports.Seekbar=Q,exports.SelectDropdown=me,exports.SelectWidget=Ce,exports.SliderWidget=_e,exports.Widget=Ee,exports.WidgetLabel=ce,exports.Widgets=Ne,exports.isJa=y,exports.msToString=x,exports.regionalText=j,exports.useResize=function(){var e=t.useRef(null),r=c(t.useState({width:0,height:0}),2),n=r[0],o=r[1];return t.useEffect((function(){if(window){var t=function(){if(e.current){var t=e.current,n=t.clientWidth,i=t.clientHeight;o({width:n,height:i})}r=null},r=null,n=function(){r||(r=setTimeout(t,200))};return window.addEventListener("resize",n),t(),function(){window.removeEventListener("resize",n)}}}),[]),[n,e]};
|
|
@@ -118,6 +118,7 @@ export declare interface ColorPickerProps {
|
|
|
118
118
|
labelTitle?: string;
|
|
119
119
|
description?: string;
|
|
120
120
|
value: IColor;
|
|
121
|
+
withAlpha?: boolean;
|
|
121
122
|
colorFactory(hexString: string): IColor;
|
|
122
123
|
onValueChange?(value: IColor): void;
|
|
123
124
|
}
|
|
@@ -128,6 +129,7 @@ export declare const ColorWidget: FC<ColorWidgetProps>;
|
|
|
128
129
|
|
|
129
130
|
export declare interface ColorWidgetProps {
|
|
130
131
|
position?: WidgetPosition;
|
|
132
|
+
withAlpha?: boolean;
|
|
131
133
|
widget: ParameterWidget;
|
|
132
134
|
value: ParameterValue;
|
|
133
135
|
colorFactory(hexString: string): IColor;
|
|
@@ -3216,6 +3218,8 @@ export declare interface NumericSliderProps {
|
|
|
3216
3218
|
disabled?: boolean;
|
|
3217
3219
|
min: number;
|
|
3218
3220
|
max: number;
|
|
3221
|
+
step?: number;
|
|
3222
|
+
ariaLabel?: string;
|
|
3219
3223
|
value: number | string;
|
|
3220
3224
|
onValueChange?(value: number): void;
|
|
3221
3225
|
withTextInput?: boolean;
|