@kinxcdn/commerce-player 1.6.3-alpha.0 → 1.6.3

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.
@@ -1,4 +1,4 @@
1
- !function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";function e(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function n(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var r,o,i={exports:{}},a={};function s(){if(r)return a;r=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.iterator;var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function v(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||h}function b(){}function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=v.prototype;var w=y.prototype=new b;w.constructor=y,m(w,v.prototype),w.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,E={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function C(t,n,r){var o,i={},a=null,s=null;if(null!=n)for(o in void 0!==n.ref&&(s=n.ref),void 0!==n.key&&(a=""+n.key),n)S.call(n,o)&&!k.hasOwnProperty(o)&&(i[o]=n[o]);var l=arguments.length-2;if(1===l)i.children=r;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];i.children=u}if(t&&t.defaultProps)for(o in l=t.defaultProps)void 0===i[o]&&(i[o]=l[o]);return{$$typeof:e,type:t,key:a,ref:s,props:i,_owner:E.current}}function T(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var P=/\/+/g;function O(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function M(n,r,o,i,a){var s=typeof n;"undefined"!==s&&"boolean"!==s||(n=null);var l=!1;if(null===n)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(n.$$typeof){case e:case t:l=!0}}if(l)return a=a(l=n),n=""===i?"."+O(l,0):i,x(a)?(o="",null!=n&&(o=n.replace(P,"$&/")+"/"),M(a,r,o,"",function(e){return e})):null!=a&&(T(a)&&(a=function(t,n){return{$$typeof:e,type:t.type,key:n,ref:t.ref,props:t.props,_owner:t._owner}}(a,o+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(P,"$&/")+"/")+n)),r.push(a)),1;if(l=0,i=""===i?".":i+":",x(n))for(var u=0;u<n.length;u++){var c=i+O(s=n[u],u);l+=M(s,r,o,c,a)}else if(c=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=p&&e[p]||e["@@iterator"])?e:null}(n),"function"==typeof c)for(n=c.call(n),u=0;!(s=n.next()).done;)l+=M(s=s.value,r,o,c=i+O(s,u++),a);else if("object"===s)throw r=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===r?"object with keys {"+Object.keys(n).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.");return l}function N(e,t,n){if(null==e)return e;var r=[],o=0;return M(e,r,"","",function(e){return t.call(n,e,o++)}),r}function _(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var R={current:null},z={transition:null},I={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:z,ReactCurrentOwner:E};function D(){throw Error("act(...) is not supported in production builds of React.")}return a.Children={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!T(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},a.Component=v,a.Fragment=n,a.Profiler=i,a.PureComponent=y,a.StrictMode=o,a.Suspense=c,a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,a.act=D,a.cloneElement=function(t,n,r){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var o=m({},t.props),i=t.key,a=t.ref,s=t._owner;if(null!=n){if(void 0!==n.ref&&(a=n.ref,s=E.current),void 0!==n.key&&(i=""+n.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(u in n)S.call(n,u)&&!k.hasOwnProperty(u)&&(o[u]=void 0===n[u]&&void 0!==l?l[u]:n[u])}var u=arguments.length-2;if(1===u)o.children=r;else if(1<u){l=Array(u);for(var c=0;c<u;c++)l[c]=arguments[c+2];o.children=l}return{$$typeof:e,type:t.type,key:i,ref:a,props:o,_owner:s}},a.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},a.createElement=C,a.createFactory=function(e){var t=C.bind(null,e);return t.type=e,t},a.createRef=function(){return{current:null}},a.forwardRef=function(e){return{$$typeof:u,render:e}},a.isValidElement=T,a.lazy=function(e){return{$$typeof:f,_payload:{_status:-1,_result:e},_init:_}},a.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},a.startTransition=function(e){var t=z.transition;z.transition={};try{e()}finally{z.transition=t}},a.unstable_act=D,a.useCallback=function(e,t){return R.current.useCallback(e,t)},a.useContext=function(e){return R.current.useContext(e)},a.useDebugValue=function(){},a.useDeferredValue=function(e){return R.current.useDeferredValue(e)},a.useEffect=function(e,t){return R.current.useEffect(e,t)},a.useId=function(){return R.current.useId()},a.useImperativeHandle=function(e,t,n){return R.current.useImperativeHandle(e,t,n)},a.useInsertionEffect=function(e,t){return R.current.useInsertionEffect(e,t)},a.useLayoutEffect=function(e,t){return R.current.useLayoutEffect(e,t)},a.useMemo=function(e,t){return R.current.useMemo(e,t)},a.useReducer=function(e,t,n){return R.current.useReducer(e,t,n)},a.useRef=function(e){return R.current.useRef(e)},a.useState=function(e){return R.current.useState(e)},a.useSyncExternalStore=function(e,t,n){return R.current.useSyncExternalStore(e,t,n)},a.useTransition=function(){return R.current.useTransition()},a.version="18.3.1",a}function l(){return o||(o=1,i.exports=s()),i.exports}var u,c,d,f,p,h=l(),m=t(h),g=e({__proto__:null,default:m},[h]),v={},b={exports:{}},y={},w={exports:{}},x={};function S(){return c||(c=1,w.exports=(u||(u=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<o(i,t)))break e;e[r]=t,e[n]=i,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,a=i>>>1;r<a;){var s=2*(r+1)-1,l=e[s],u=s+1,c=e[u];if(0>o(l,n))u<i&&0>o(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[s]=n,r=s);else{if(!(u<i&&0>o(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,d=null,f=3,p=!1,h=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,b="undefined"!=typeof setImmediate?setImmediate:null;function y(e){for(var o=n(u);null!==o;){if(null===o.callback)r(u);else{if(!(o.startTime<=e))break;r(u),o.sortIndex=o.expirationTime,t(l,o)}o=n(u)}}function w(e){if(m=!1,y(e),!h)if(null!==n(l))h=!0,R(x);else{var t=n(u);null!==t&&z(w,t.startTime-e)}}function x(t,o){h=!1,m&&(m=!1,v(C),C=-1),p=!0;var i=f;try{for(y(o),d=n(l);null!==d&&(!(d.expirationTime>o)||t&&!O());){var a=d.callback;if("function"==typeof a){d.callback=null,f=d.priorityLevel;var s=a(d.expirationTime<=o);o=e.unstable_now(),"function"==typeof s?d.callback=s:d===n(l)&&r(l),y(o)}else r(l);d=n(l)}if(null!==d)var c=!0;else{var g=n(u);null!==g&&z(w,g.startTime-o),c=!1}return c}finally{d=null,f=i,p=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,E=!1,k=null,C=-1,T=5,P=-1;function O(){return!(e.unstable_now()-P<T)}function M(){if(null!==k){var t=e.unstable_now();P=t;var n=!0;try{n=k(!0,t)}finally{n?S():(E=!1,k=null)}}else E=!1}if("function"==typeof b)S=function(){b(M)};else if("undefined"!=typeof MessageChannel){var N=new MessageChannel,_=N.port2;N.port1.onmessage=M,S=function(){_.postMessage(null)}}else S=function(){g(M,0)};function R(e){k=e,E||(E=!0,S())}function z(t,n){C=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){h||p||(h=!0,R(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,o,i){var a=e.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0<i?a+i:a,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return r={id:c++,callback:o,priorityLevel:r,startTime:i,expirationTime:s=i+s,sortIndex:-1},i>a?(r.sortIndex=i,t(u,r),null===n(l)&&r===n(u)&&(m?(v(C),C=-1):m=!0,z(w,i-a))):(r.sortIndex=s,t(l,r),h||p||(h=!0,R(x))),r},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(x)),x)),w.exports}
1
+ !function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";function e(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(e)}function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}var n,i,s={exports:{}},a={};function o(){if(n)return a;n=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,m={};function v(e,t,r){this.props=e,this.context=t,this.refs=m,this.updater=r||p}function y(){}function b(e,t,r){this.props=e,this.context=t,this.refs=m,this.updater=r||p}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=v.prototype;var w=b.prototype=new y;w.constructor=b,g(w,v.prototype),w.isPureReactComponent=!0;var E=Array.isArray,S=Object.prototype.hasOwnProperty,T={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function x(t,r,n){var i,s={},a=null,o=null;if(null!=r)for(i in void 0!==r.ref&&(o=r.ref),void 0!==r.key&&(a=""+r.key),r)S.call(r,i)&&!k.hasOwnProperty(i)&&(s[i]=r[i]);var l=arguments.length-2;if(1===l)s.children=n;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];s.children=u}if(t&&t.defaultProps)for(i in l=t.defaultProps)void 0===s[i]&&(s[i]=l[i]);return{$$typeof:e,type:t,key:a,ref:o,props:s,_owner:T.current}}function A(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var R=/\/+/g;function L(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function I(r,n,i,s,a){var o=typeof r;"undefined"!==o&&"boolean"!==o||(r=null);var l=!1;if(null===r)l=!0;else switch(o){case"string":case"number":l=!0;break;case"object":switch(r.$$typeof){case e:case t:l=!0}}if(l)return a=a(l=r),r=""===s?"."+L(l,0):s,E(a)?(i="",null!=r&&(i=r.replace(R,"$&/")+"/"),I(a,n,i,"",function(e){return e})):null!=a&&(A(a)&&(a=function(t,r){return{$$typeof:e,type:t.type,key:r,ref:t.ref,props:t.props,_owner:t._owner}}(a,i+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(R,"$&/")+"/")+r)),n.push(a)),1;if(l=0,s=""===s?".":s+":",E(r))for(var u=0;u<r.length;u++){var c=s+L(o=r[u],u);l+=I(o,n,i,c,a)}else if(c=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=f&&e[f]||e["@@iterator"])?e:null}(r),"function"==typeof c)for(r=c.call(r),u=0;!(o=r.next()).done;)l+=I(o=o.value,n,i,c=s+L(o,u++),a);else if("object"===o)throw n=String(r),Error("Objects are not valid as a React child (found: "+("[object Object]"===n?"object with keys {"+Object.keys(r).join(", ")+"}":n)+"). If you meant to render a collection of children, use an array instead.");return l}function C(e,t,r){if(null==e)return e;var n=[],i=0;return I(e,n,"","",function(e){return t.call(r,e,i++)}),n}function P(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var D={current:null},_={transition:null},M={ReactCurrentDispatcher:D,ReactCurrentBatchConfig:_,ReactCurrentOwner:T};function O(){throw Error("act(...) is not supported in production builds of React.")}return a.Children={map:C,forEach:function(e,t,r){C(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return C(e,function(){t++}),t},toArray:function(e){return C(e,function(e){return e})||[]},only:function(e){if(!A(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},a.Component=v,a.Fragment=r,a.Profiler=s,a.PureComponent=b,a.StrictMode=i,a.Suspense=c,a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=M,a.act=O,a.cloneElement=function(t,r,n){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var i=g({},t.props),s=t.key,a=t.ref,o=t._owner;if(null!=r){if(void 0!==r.ref&&(a=r.ref,o=T.current),void 0!==r.key&&(s=""+r.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(u in r)S.call(r,u)&&!k.hasOwnProperty(u)&&(i[u]=void 0===r[u]&&void 0!==l?l[u]:r[u])}var u=arguments.length-2;if(1===u)i.children=n;else if(1<u){l=Array(u);for(var c=0;c<u;c++)l[c]=arguments[c+2];i.children=l}return{$$typeof:e,type:t.type,key:s,ref:a,props:i,_owner:o}},a.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},a.createElement=x,a.createFactory=function(e){var t=x.bind(null,e);return t.type=e,t},a.createRef=function(){return{current:null}},a.forwardRef=function(e){return{$$typeof:u,render:e}},a.isValidElement=A,a.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:P}},a.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},a.startTransition=function(e){var t=_.transition;_.transition={};try{e()}finally{_.transition=t}},a.unstable_act=O,a.useCallback=function(e,t){return D.current.useCallback(e,t)},a.useContext=function(e){return D.current.useContext(e)},a.useDebugValue=function(){},a.useDeferredValue=function(e){return D.current.useDeferredValue(e)},a.useEffect=function(e,t){return D.current.useEffect(e,t)},a.useId=function(){return D.current.useId()},a.useImperativeHandle=function(e,t,r){return D.current.useImperativeHandle(e,t,r)},a.useInsertionEffect=function(e,t){return D.current.useInsertionEffect(e,t)},a.useLayoutEffect=function(e,t){return D.current.useLayoutEffect(e,t)},a.useMemo=function(e,t){return D.current.useMemo(e,t)},a.useReducer=function(e,t,r){return D.current.useReducer(e,t,r)},a.useRef=function(e){return D.current.useRef(e)},a.useState=function(e){return D.current.useState(e)},a.useSyncExternalStore=function(e,t,r){return D.current.useSyncExternalStore(e,t,r)},a.useTransition=function(){return D.current.useTransition()},a.version="18.3.1",a}function l(){return i||(i=1,s.exports=o()),s.exports}var u,c,d,h,f,p=l(),g=t(p),m=e({__proto__:null,default:g},[p]),v={},y={exports:{}},b={},w={exports:{}},E={};function S(){return c||(c=1,w.exports=(u||(u=1,function(e){function t(e,t){var r=e.length;e.push(t);e:for(;0<r;){var n=r-1>>>1,s=e[n];if(!(0<i(s,t)))break e;e[n]=t,e[r]=s,r=n}}function r(e){return 0===e.length?null:e[0]}function n(e){if(0===e.length)return null;var t=e[0],r=e.pop();if(r!==t){e[0]=r;e:for(var n=0,s=e.length,a=s>>>1;n<a;){var o=2*(n+1)-1,l=e[o],u=o+1,c=e[u];if(0>i(l,r))u<s&&0>i(c,l)?(e[n]=c,e[u]=r,n=u):(e[n]=l,e[o]=r,n=o);else{if(!(u<s&&0>i(c,r)))break e;e[n]=c,e[u]=r,n=u}}}return t}function i(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],u=[],c=1,d=null,h=3,f=!1,p=!1,g=!1,m="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var i=r(u);null!==i;){if(null===i.callback)n(u);else{if(!(i.startTime<=e))break;n(u),i.sortIndex=i.expirationTime,t(l,i)}i=r(u)}}function w(e){if(g=!1,b(e),!p)if(null!==r(l))p=!0,D(E);else{var t=r(u);null!==t&&_(w,t.startTime-e)}}function E(t,i){p=!1,g&&(g=!1,v(x),x=-1),f=!0;var s=h;try{for(b(i),d=r(l);null!==d&&(!(d.expirationTime>i)||t&&!L());){var a=d.callback;if("function"==typeof a){d.callback=null,h=d.priorityLevel;var o=a(d.expirationTime<=i);i=e.unstable_now(),"function"==typeof o?d.callback=o:d===r(l)&&n(l),b(i)}else n(l);d=r(l)}if(null!==d)var c=!0;else{var m=r(u);null!==m&&_(w,m.startTime-i),c=!1}return c}finally{d=null,h=s,f=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,T=!1,k=null,x=-1,A=5,R=-1;function L(){return!(e.unstable_now()-R<A)}function I(){if(null!==k){var t=e.unstable_now();R=t;var r=!0;try{r=k(!0,t)}finally{r?S():(T=!1,k=null)}}else T=!1}if("function"==typeof y)S=function(){y(I)};else if("undefined"!=typeof MessageChannel){var C=new MessageChannel,P=C.port2;C.port1.onmessage=I,S=function(){P.postMessage(null)}}else S=function(){m(I,0)};function D(e){k=e,T||(T=!0,S())}function _(t,r){x=m(function(){t(e.unstable_now())},r)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){p||f||(p=!0,D(E))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return r(l)},e.unstable_next=function(e){switch(h){case 1:case 2:case 3:var t=3;break;default:t=h}var r=h;h=t;try{return e()}finally{h=r}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=h;h=e;try{return t()}finally{h=r}},e.unstable_scheduleCallback=function(n,i,s){var a=e.unstable_now();switch(s="object"==typeof s&&null!==s&&"number"==typeof(s=s.delay)&&0<s?a+s:a,n){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return n={id:c++,callback:i,priorityLevel:n,startTime:s,expirationTime:o=s+o,sortIndex:-1},s>a?(n.sortIndex=s,t(u,n),null===r(l)&&n===r(u)&&(g?(v(x),x=-1):g=!0,_(w,s-a))):(n.sortIndex=o,t(l,n),p||f||(p=!0,D(E))),n},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(e){var t=h;return function(){var r=h;h=t;try{return e.apply(this,arguments)}finally{h=r}}}}(E)),E)),w.exports}
2
2
  /**
3
3
  * @license React
4
4
  * react-dom.production.min.js
@@ -7,32 +7,32 @@
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */function E(){if(d)return y;d=1;var e=l(),t=S();function n(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,o={};function i(e,t){a(e,t),a(e+"Capture",t)}function a(e,t){for(o[e]=t,e=0;e<t.length;e++)r.add(t[e])}var s=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),u=Object.prototype.hasOwnProperty,c=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},p={};function h(e,t,n,r,o,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var m={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){m[e]=new h(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];m[t]=new h(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){m[e]=new h(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){m[e]=new h(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){m[e]=new h(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){m[e]=new h(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){m[e]=new h(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){m[e]=new h(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){m[e]=new h(e,5,!1,e.toLowerCase(),null,!1,!1)});var g=/[\-:]([a-z])/g;function v(e){return e[1].toUpperCase()}function b(e,t,n,r){var o=m.hasOwnProperty(t)?m[t]:null;(null!==o?0!==o.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!u.call(p,e)||!u.call(f,e)&&(c.test(e)?p[e]=!0:(f[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(g,v);m[t]=new h(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(g,v);m[t]=new h(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(g,v);m[t]=new h(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){m[e]=new h(e,1,!1,e.toLowerCase(),null,!1,!1)}),m.xlinkHref=new h("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){m[e]=new h(e,1,!1,e.toLowerCase(),null,!0,!0)});var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,x=Symbol.for("react.element"),E=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),P=Symbol.for("react.provider"),O=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),D=Symbol.iterator;function L(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=D&&e[D]||e["@@iterator"])?e:null}var A,F=Object.assign;function $(e){if(void 0===A)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);A=t&&t[1]||""}return"\n"+A+e}var j=!1;function B(e,t){if(!e||j)return"";j=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var o=t.stack.split("\n"),i=r.stack.split("\n"),a=o.length-1,s=i.length-1;1<=a&&0<=s&&o[a]!==i[s];)s--;for(;1<=a&&0<=s;a--,s--)if(o[a]!==i[s]){if(1!==a||1!==s)do{if(a--,0>--s||o[a]!==i[s]){var l="\n"+o[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=a&&0<=s);break}}}finally{j=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?$(e):""}function W(e){switch(e.tag){case 5:return $(e.type);case 16:return $("Lazy");case 13:return $("Suspense");case 19:return $("SuspenseList");case 0:case 2:case 15:return e=B(e.type,!1);case 11:return e=B(e.type.render,!1);case 1:return e=B(e.type,!0);default:return""}}function U(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case k:return"Fragment";case E:return"Portal";case T:return"Profiler";case C:return"StrictMode";case N:return"Suspense";case _:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case O:return(e.displayName||"Context")+".Consumer";case P:return(e._context.displayName||"Context")+".Provider";case M:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case R:return null!==(t=e.displayName||null)?t:U(e.type)||"Memo";case z:t=e._payload,e=e._init;try{return U(e(t))}catch(e){}}return null}function H(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return U(t);case 8:return t===C?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function V(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function Y(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function q(e){e._valueTracker||(e._valueTracker=function(e){var t=Y(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function G(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Y(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function X(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function K(e,t){var n=t.checked;return F({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Q(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=V(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Z(e,t){null!=(t=t.checked)&&b(e,"checked",t,!1)}function J(e,t){Z(e,t);var n=V(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?te(e,t.type,n):t.hasOwnProperty("defaultValue")&&te(e,t.type,V(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function ee(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function te(e,t,n){"number"===t&&X(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ne=Array.isArray;function re(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+V(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function oe(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(n(91));return F({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ie(e,t){var r=t.value;if(null==r){if(r=t.children,t=t.defaultValue,null!=r){if(null!=t)throw Error(n(92));if(ne(r)){if(1<r.length)throw Error(n(93));r=r[0]}t=r}null==t&&(t=""),r=t}e._wrapperState={initialValue:V(r)}}function ae(e,t){var n=V(t.value),r=V(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function se(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function le(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ue(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?le(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ce,de=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n)})}:e}(function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ce=ce||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function fe(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var pe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},he=["Webkit","ms","Moz","O"];function me(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||pe.hasOwnProperty(e)&&pe[e]?(""+t).trim():t+"px"}function ge(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=me(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(pe).forEach(function(e){he.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pe[t]=pe[e]})});var ve=F({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function be(e,t){if(t){if(ve[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(n(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(n(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(n(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(n(62))}}function ye(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var we=null;function xe(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Se=null,Ee=null,ke=null;function Ce(e){if(e=wo(e)){if("function"!=typeof Se)throw Error(n(280));var t=e.stateNode;t&&(t=So(t),Se(e.stateNode,e.type,t))}}function Te(e){Ee?ke?ke.push(e):ke=[e]:Ee=e}function Pe(){if(Ee){var e=Ee,t=ke;if(ke=Ee=null,Ce(e),t)for(e=0;e<t.length;e++)Ce(t[e])}}function Oe(e,t){return e(t)}function Me(){}var Ne=!1;function _e(e,t,n){if(Ne)return e(t,n);Ne=!0;try{return Oe(e,t,n)}finally{Ne=!1,(null!==Ee||null!==ke)&&(Me(),Pe())}}function Re(e,t){var r=e.stateNode;if(null===r)return null;var o=So(r);if(null===o)return null;r=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(o=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!o;break e;default:e=!1}if(e)return null;if(r&&"function"!=typeof r)throw Error(n(231,t,typeof r));return r}var ze=!1;if(s)try{var Ie={};Object.defineProperty(Ie,"passive",{get:function(){ze=!0}}),window.addEventListener("test",Ie,Ie),window.removeEventListener("test",Ie,Ie)}catch(e){ze=!1}function De(e,t,n,r,o,i,a,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(e){this.onError(e)}}var Le=!1,Ae=null,Fe=!1,$e=null,je={onError:function(e){Le=!0,Ae=e}};function Be(e,t,n,r,o,i,a,s,l){Le=!1,Ae=null,De.apply(je,arguments)}function We(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Ue(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function He(e){if(We(e)!==e)throw Error(n(188))}function Ve(e){return e=function(e){var t=e.alternate;if(!t){if(null===(t=We(e)))throw Error(n(188));return t!==e?null:e}for(var r=e,o=t;;){var i=r.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(o=i.return)){r=o;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return He(i),e;if(a===o)return He(i),t;a=a.sibling}throw Error(n(188))}if(r.return!==o.return)r=i,o=a;else{for(var s=!1,l=i.child;l;){if(l===r){s=!0,r=i,o=a;break}if(l===o){s=!0,o=i,r=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===r){s=!0,r=a,o=i;break}if(l===o){s=!0,o=a,r=i;break}l=l.sibling}if(!s)throw Error(n(189))}}if(r.alternate!==o)throw Error(n(190))}if(3!==r.tag)throw Error(n(188));return r.stateNode.current===r?e:t}(e),null!==e?Ye(e):null}function Ye(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Ye(e);if(null!==t)return t;e=e.sibling}return null}var qe=t.unstable_scheduleCallback,Ge=t.unstable_cancelCallback,Xe=t.unstable_shouldYield,Ke=t.unstable_requestPaint,Qe=t.unstable_now,Ze=t.unstable_getCurrentPriorityLevel,Je=t.unstable_ImmediatePriority,et=t.unstable_UserBlockingPriority,tt=t.unstable_NormalPriority,nt=t.unstable_LowPriority,rt=t.unstable_IdlePriority,ot=null,it=null;var at=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(st(e)/lt|0)|0},st=Math.log,lt=Math.LN2;var ut=64,ct=4194304;function dt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ft(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~o;0!==s?r=dt(s):0!==(i&=a)&&(r=dt(i))}else 0!==(a=n&~o)?r=dt(a):0!==i&&(r=dt(i));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&o)&&((o=r&-r)>=(i=t&-t)||16===o&&4194240&i))return t;if(4&r&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)o=1<<(n=31-at(t)),r|=e[n],t&=~o;return r}function pt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function ht(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function mt(){var e=ut;return!(4194240&(ut<<=1))&&(ut=64),e}function gt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function vt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-at(t)]=n}function bt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-at(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var yt=0;function wt(e){return 1<(e&=-e)?4<e?268435455&e?16:536870912:4:1}var xt,St,Et,kt,Ct,Tt=!1,Pt=[],Ot=null,Mt=null,Nt=null,_t=new Map,Rt=new Map,zt=[],It="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Dt(e,t){switch(e){case"focusin":case"focusout":Ot=null;break;case"dragenter":case"dragleave":Mt=null;break;case"mouseover":case"mouseout":Nt=null;break;case"pointerover":case"pointerout":_t.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rt.delete(t.pointerId)}}function Lt(e,t,n,r,o,i){return null===e||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},null!==t&&(null!==(t=wo(t))&&St(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function At(e){var t=yo(e.target);if(null!==t){var n=We(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Ue(n)))return e.blockedOn=t,void Ct(e.priority,function(){Et(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Ft(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Xt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=wo(n))&&St(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);we=r,n.target.dispatchEvent(r),we=null,t.shift()}return!0}function $t(e,t,n){Ft(e)&&n.delete(t)}function jt(){Tt=!1,null!==Ot&&Ft(Ot)&&(Ot=null),null!==Mt&&Ft(Mt)&&(Mt=null),null!==Nt&&Ft(Nt)&&(Nt=null),_t.forEach($t),Rt.forEach($t)}function Bt(e,n){e.blockedOn===n&&(e.blockedOn=null,Tt||(Tt=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,jt)))}function Wt(e){function t(t){return Bt(t,e)}if(0<Pt.length){Bt(Pt[0],e);for(var n=1;n<Pt.length;n++){var r=Pt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Ot&&Bt(Ot,e),null!==Mt&&Bt(Mt,e),null!==Nt&&Bt(Nt,e),_t.forEach(t),Rt.forEach(t),n=0;n<zt.length;n++)(r=zt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<zt.length&&null===(n=zt[0]).blockedOn;)At(n),null===n.blockedOn&&zt.shift()}var Ut=w.ReactCurrentBatchConfig,Ht=!0;function Vt(e,t,n,r){var o=yt,i=Ut.transition;Ut.transition=null;try{yt=1,qt(e,t,n,r)}finally{yt=o,Ut.transition=i}}function Yt(e,t,n,r){var o=yt,i=Ut.transition;Ut.transition=null;try{yt=4,qt(e,t,n,r)}finally{yt=o,Ut.transition=i}}function qt(e,t,n,r){if(Ht){var o=Xt(e,t,n,r);if(null===o)Hr(e,t,r,Gt,n),Dt(e,r);else if(function(e,t,n,r,o){switch(t){case"focusin":return Ot=Lt(Ot,e,t,n,r,o),!0;case"dragenter":return Mt=Lt(Mt,e,t,n,r,o),!0;case"mouseover":return Nt=Lt(Nt,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return _t.set(i,Lt(_t.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Rt.set(i,Lt(Rt.get(i)||null,e,t,n,r,o)),!0}return!1}(o,e,t,n,r))r.stopPropagation();else if(Dt(e,r),4&t&&-1<It.indexOf(e)){for(;null!==o;){var i=wo(o);if(null!==i&&xt(i),null===(i=Xt(e,t,n,r))&&Hr(e,t,r,Gt,n),i===o)break;o=i}null!==o&&r.stopPropagation()}else Hr(e,t,r,null,n)}}var Gt=null;function Xt(e,t,n,r){if(Gt=null,null!==(e=yo(e=xe(r))))if(null===(t=We(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=Ue(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Gt=e,null}function Kt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ze()){case Je:return 1;case et:return 4;case tt:case nt:return 16;case rt:return 536870912;default:return 16}default:return 16}}var Qt=null,Zt=null,Jt=null;function en(){if(Jt)return Jt;var e,t,n=Zt,r=n.length,o="value"in Qt?Qt.value:Qt.textContent,i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return Jt=o.slice(e,1<t?1-t:void 0)}function tn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function nn(){return!0}function rn(){return!1}function on(e){function t(t,n,r,o,i){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(o):o[a]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?nn:rn,this.isPropagationStopped=rn,this}return F(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=nn)},persist:function(){},isPersistent:nn}),t}var an,sn,ln,un={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cn=on(un),dn=F({},un,{view:0,detail:0}),fn=on(dn),pn=F({},dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ln&&(ln&&"mousemove"===e.type?(an=e.screenX-ln.screenX,sn=e.screenY-ln.screenY):sn=an=0,ln=e),an)},movementY:function(e){return"movementY"in e?e.movementY:sn}}),hn=on(pn),mn=on(F({},pn,{dataTransfer:0})),gn=on(F({},dn,{relatedTarget:0})),vn=on(F({},un,{animationName:0,elapsedTime:0,pseudoElement:0})),bn=F({},un,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yn=on(bn),wn=on(F({},un,{data:0})),xn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},En={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=En[e])&&!!t[e]}function Cn(){return kn}var Tn=F({},dn,{key:function(e){if(e.key){var t=xn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Sn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cn,charCode:function(e){return"keypress"===e.type?tn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Pn=on(Tn),On=on(F({},pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Mn=on(F({},dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cn})),Nn=on(F({},un,{propertyName:0,elapsedTime:0,pseudoElement:0})),_n=F({},pn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Rn=on(_n),zn=[9,13,27,32],In=s&&"CompositionEvent"in window,Dn=null;s&&"documentMode"in document&&(Dn=document.documentMode);var Ln=s&&"TextEvent"in window&&!Dn,An=s&&(!In||Dn&&8<Dn&&11>=Dn),Fn=String.fromCharCode(32),$n=!1;function jn(e,t){switch(e){case"keyup":return-1!==zn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Wn=!1;var Un={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Hn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Un[e.type]:"textarea"===t}function Vn(e,t,n,r){Te(r),0<(t=Yr(t,"onChange")).length&&(n=new cn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Yn=null,qn=null;function Gn(e){Fr(e,0)}function Xn(e){if(G(xo(e)))return e}function Kn(e,t){if("change"===e)return t}var Qn=!1;if(s){var Zn;if(s){var Jn="oninput"in document;if(!Jn){var er=document.createElement("div");er.setAttribute("oninput","return;"),Jn="function"==typeof er.oninput}Zn=Jn}else Zn=!1;Qn=Zn&&(!document.documentMode||9<document.documentMode)}function tr(){Yn&&(Yn.detachEvent("onpropertychange",nr),qn=Yn=null)}function nr(e){if("value"===e.propertyName&&Xn(qn)){var t=[];Vn(t,qn,e,xe(e)),_e(Gn,t)}}function rr(e,t,n){"focusin"===e?(tr(),qn=n,(Yn=t).attachEvent("onpropertychange",nr)):"focusout"===e&&tr()}function or(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Xn(qn)}function ir(e,t){if("click"===e)return Xn(t)}function ar(e,t){if("input"===e||"change"===e)return Xn(t)}var sr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function lr(e,t){if(sr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!u.call(t,o)||!sr(e[o],t[o]))return!1}return!0}function ur(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cr(e,t){var n,r=ur(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ur(r)}}function dr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?dr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function fr(){for(var e=window,t=X();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=X((e=t.contentWindow).document)}return t}function pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function hr(e){var t=fr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&dr(n.ownerDocument.documentElement,n)){if(null!==r&&pr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=void 0===r.end?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=cr(n,i);var a=cr(n,r);o&&a&&(1!==e.rangeCount||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var mr=s&&"documentMode"in document&&11>=document.documentMode,gr=null,vr=null,br=null,yr=!1;function wr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;yr||null==gr||gr!==X(r)||("selectionStart"in(r=gr)&&pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},br&&lr(br,r)||(br=r,0<(r=Yr(vr,"onSelect")).length&&(t=new cn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=gr)))}function xr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Sr={animationend:xr("Animation","AnimationEnd"),animationiteration:xr("Animation","AnimationIteration"),animationstart:xr("Animation","AnimationStart"),transitionend:xr("Transition","TransitionEnd")},Er={},kr={};function Cr(e){if(Er[e])return Er[e];if(!Sr[e])return e;var t,n=Sr[e];for(t in n)if(n.hasOwnProperty(t)&&t in kr)return Er[e]=n[t];return e}s&&(kr=document.createElement("div").style,"AnimationEvent"in window||(delete Sr.animationend.animation,delete Sr.animationiteration.animation,delete Sr.animationstart.animation),"TransitionEvent"in window||delete Sr.transitionend.transition);var Tr=Cr("animationend"),Pr=Cr("animationiteration"),Or=Cr("animationstart"),Mr=Cr("transitionend"),Nr=new Map,_r="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Rr(e,t){Nr.set(e,t),i(t,[e])}for(var zr=0;zr<_r.length;zr++){var Ir=_r[zr];Rr(Ir.toLowerCase(),"on"+(Ir[0].toUpperCase()+Ir.slice(1)))}Rr(Tr,"onAnimationEnd"),Rr(Pr,"onAnimationIteration"),Rr(Or,"onAnimationStart"),Rr("dblclick","onDoubleClick"),Rr("focusin","onFocus"),Rr("focusout","onBlur"),Rr(Mr,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Dr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Lr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Dr));function Ar(e,t,r){var o=e.type||"unknown-event";e.currentTarget=r,function(e,t,r,o,i,a,s,l,u){if(Be.apply(this,arguments),Le){if(!Le)throw Error(n(198));var c=Ae;Le=!1,Ae=null,Fe||(Fe=!0,$e=c)}}(o,t,void 0,e),e.currentTarget=null}function Fr(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==i&&o.isPropagationStopped())break e;Ar(o,s,u),i=l}else for(a=0;a<r.length;a++){if(l=(s=r[a]).instance,u=s.currentTarget,s=s.listener,l!==i&&o.isPropagationStopped())break e;Ar(o,s,u),i=l}}}if(Fe)throw e=$e,Fe=!1,$e=null,e}function $r(e,t){var n=t[go];void 0===n&&(n=t[go]=new Set);var r=e+"__bubble";n.has(r)||(Ur(t,e,2,!1),n.add(r))}function jr(e,t,n){var r=0;t&&(r|=4),Ur(n,e,r,t)}var Br="_reactListening"+Math.random().toString(36).slice(2);function Wr(e){if(!e[Br]){e[Br]=!0,r.forEach(function(t){"selectionchange"!==t&&(Lr.has(t)||jr(t,!1,e),jr(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Br]||(t[Br]=!0,jr("selectionchange",!1,t))}}function Ur(e,t,n,r){switch(Kt(t)){case 1:var o=Vt;break;case 4:o=Yt;break;default:o=qt}n=o.bind(null,t,n,e),o=void 0,!ze||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Hr(e,t,n,r,o){var i=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var s=r.stateNode.containerInfo;if(s===o||8===s.nodeType&&s.parentNode===o)break;if(4===a)for(a=r.return;null!==a;){var l=a.tag;if((3===l||4===l)&&((l=a.stateNode.containerInfo)===o||8===l.nodeType&&l.parentNode===o))return;a=a.return}for(;null!==s;){if(null===(a=yo(s)))return;if(5===(l=a.tag)||6===l){r=i=a;continue e}s=s.parentNode}}r=r.return}_e(function(){var r=i,o=xe(n),a=[];e:{var s=Nr.get(e);if(void 0!==s){var l=cn,u=e;switch(e){case"keypress":if(0===tn(n))break e;case"keydown":case"keyup":l=Pn;break;case"focusin":u="focus",l=gn;break;case"focusout":u="blur",l=gn;break;case"beforeblur":case"afterblur":l=gn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=hn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=mn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Mn;break;case Tr:case Pr:case Or:l=vn;break;case Mr:l=Nn;break;case"scroll":l=fn;break;case"wheel":l=Rn;break;case"copy":case"cut":case"paste":l=yn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=On}var c=!!(4&t),d=!c&&"scroll"===e,f=c?null!==s?s+"Capture":null:s;c=[];for(var p,h=r;null!==h;){var m=(p=h).stateNode;if(5===p.tag&&null!==m&&(p=m,null!==f&&(null!=(m=Re(h,f))&&c.push(Vr(h,m,p)))),d)break;h=h.return}0<c.length&&(s=new l(s,u,null,n,o),a.push({event:s,listeners:c}))}}if(!(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===we||!(u=n.relatedTarget||n.fromElement)||!yo(u)&&!u[mo])&&(l||s)&&(s=o.window===o?o:(s=o.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(u=(u=n.relatedTarget||n.toElement)?yo(u):null)&&(u!==(d=We(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(l=null,u=r),l!==u)){if(c=hn,m="onMouseLeave",f="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(c=On,m="onPointerLeave",f="onPointerEnter",h="pointer"),d=null==l?s:xo(l),p=null==u?s:xo(u),(s=new c(m,h+"leave",l,n,o)).target=d,s.relatedTarget=p,m=null,yo(o)===r&&((c=new c(f,h+"enter",u,n,o)).target=p,c.relatedTarget=d,m=c),d=m,l&&u)e:{for(f=u,h=0,p=c=l;p;p=qr(p))h++;for(p=0,m=f;m;m=qr(m))p++;for(;0<h-p;)c=qr(c),h--;for(;0<p-h;)f=qr(f),p--;for(;h--;){if(c===f||null!==f&&c===f.alternate)break e;c=qr(c),f=qr(f)}c=null}else c=null;null!==l&&Gr(a,s,l,c,!1),null!==u&&null!==d&&Gr(a,d,u,c,!0)}if("select"===(l=(s=r?xo(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var g=Kn;else if(Hn(s))if(Qn)g=ar;else{g=or;var v=rr}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(g=ir);switch(g&&(g=g(e,r))?Vn(a,g,n,o):(v&&v(e,s,r),"focusout"===e&&(v=s._wrapperState)&&v.controlled&&"number"===s.type&&te(s,"number",s.value)),v=r?xo(r):window,e){case"focusin":(Hn(v)||"true"===v.contentEditable)&&(gr=v,vr=r,br=null);break;case"focusout":br=vr=gr=null;break;case"mousedown":yr=!0;break;case"contextmenu":case"mouseup":case"dragend":yr=!1,wr(a,n,o);break;case"selectionchange":if(mr)break;case"keydown":case"keyup":wr(a,n,o)}var b;if(In)e:{switch(e){case"compositionstart":var y="onCompositionStart";break e;case"compositionend":y="onCompositionEnd";break e;case"compositionupdate":y="onCompositionUpdate";break e}y=void 0}else Wn?jn(e,n)&&(y="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(y="onCompositionStart");y&&(An&&"ko"!==n.locale&&(Wn||"onCompositionStart"!==y?"onCompositionEnd"===y&&Wn&&(b=en()):(Zt="value"in(Qt=o)?Qt.value:Qt.textContent,Wn=!0)),0<(v=Yr(r,y)).length&&(y=new wn(y,e,null,n,o),a.push({event:y,listeners:v}),b?y.data=b:null!==(b=Bn(n))&&(y.data=b))),(b=Ln?function(e,t){switch(e){case"compositionend":return Bn(t);case"keypress":return 32!==t.which?null:($n=!0,Fn);case"textInput":return(e=t.data)===Fn&&$n?null:e;default:return null}}(e,n):function(e,t){if(Wn)return"compositionend"===e||!In&&jn(e,t)?(e=en(),Jt=Zt=Qt=null,Wn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return An&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Yr(r,"onBeforeInput")).length&&(o=new wn("onBeforeInput","beforeinput",null,n,o),a.push({event:o,listeners:r}),o.data=b))}Fr(a,t)})}function Vr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Yr(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,i=o.stateNode;5===o.tag&&null!==i&&(o=i,null!=(i=Re(e,n))&&r.unshift(Vr(e,i,o)),null!=(i=Re(e,t))&&r.push(Vr(e,i,o))),e=e.return}return r}function qr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Gr(e,t,n,r,o){for(var i=t._reactName,a=[];null!==n&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==u&&(s=u,o?null!=(l=Re(n,i))&&a.unshift(Vr(n,l,s)):o||null!=(l=Re(n,i))&&a.push(Vr(n,l,s))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}var Xr=/\r\n?/g,Kr=/\u0000|\uFFFD/g;function Qr(e){return("string"==typeof e?e:""+e).replace(Xr,"\n").replace(Kr,"")}function Zr(e,t,r){if(t=Qr(t),Qr(e)!==t&&r)throw Error(n(425))}function Jr(){}var eo=null,to=null;function no(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ro="function"==typeof setTimeout?setTimeout:void 0,oo="function"==typeof clearTimeout?clearTimeout:void 0,io="function"==typeof Promise?Promise:void 0,ao="function"==typeof queueMicrotask?queueMicrotask:void 0!==io?function(e){return io.resolve(null).then(e).catch(so)}:ro;function so(e){setTimeout(function(){throw e})}function lo(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&8===o.nodeType)if("/$"===(n=o.data)){if(0===r)return e.removeChild(o),void Wt(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=o}while(n);Wt(t)}function uo(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function co(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var fo=Math.random().toString(36).slice(2),po="__reactFiber$"+fo,ho="__reactProps$"+fo,mo="__reactContainer$"+fo,go="__reactEvents$"+fo,vo="__reactListeners$"+fo,bo="__reactHandles$"+fo;function yo(e){var t=e[po];if(t)return t;for(var n=e.parentNode;n;){if(t=n[mo]||n[po]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=co(e);null!==e;){if(n=e[po])return n;e=co(e)}return t}n=(e=n).parentNode}return null}function wo(e){return!(e=e[po]||e[mo])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function xo(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(n(33))}function So(e){return e[ho]||null}var Eo=[],ko=-1;function Co(e){return{current:e}}function To(e){0>ko||(e.current=Eo[ko],Eo[ko]=null,ko--)}function Po(e,t){ko++,Eo[ko]=e.current,e.current=t}var Oo={},Mo=Co(Oo),No=Co(!1),_o=Oo;function Ro(e,t){var n=e.type.contextTypes;if(!n)return Oo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function zo(e){return null!=(e=e.childContextTypes)}function Io(){To(No),To(Mo)}function Do(e,t,r){if(Mo.current!==Oo)throw Error(n(168));Po(Mo,t),Po(No,r)}function Lo(e,t,r){var o=e.stateNode;if(t=t.childContextTypes,"function"!=typeof o.getChildContext)return r;for(var i in o=o.getChildContext())if(!(i in t))throw Error(n(108,H(e)||"Unknown",i));return F({},r,o)}function Ao(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Oo,_o=Mo.current,Po(Mo,e),Po(No,No.current),!0}function Fo(e,t,r){var o=e.stateNode;if(!o)throw Error(n(169));r?(e=Lo(e,t,_o),o.__reactInternalMemoizedMergedChildContext=e,To(No),To(Mo),Po(Mo,e)):To(No),Po(No,r)}var $o=null,jo=!1,Bo=!1;function Wo(e){null===$o?$o=[e]:$o.push(e)}function Uo(){if(!Bo&&null!==$o){Bo=!0;var e=0,t=yt;try{var n=$o;for(yt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}$o=null,jo=!1}catch(t){throw null!==$o&&($o=$o.slice(e+1)),qe(Je,Uo),t}finally{yt=t,Bo=!1}}return null}var Ho=[],Vo=0,Yo=null,qo=0,Go=[],Xo=0,Ko=null,Qo=1,Zo="";function Jo(e,t){Ho[Vo++]=qo,Ho[Vo++]=Yo,Yo=e,qo=t}function ei(e,t,n){Go[Xo++]=Qo,Go[Xo++]=Zo,Go[Xo++]=Ko,Ko=e;var r=Qo;e=Zo;var o=32-at(r)-1;r&=~(1<<o),n+=1;var i=32-at(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,Qo=1<<32-at(t)+o|n<<o|r,Zo=i+e}else Qo=1<<i|n<<o|r,Zo=e}function ti(e){null!==e.return&&(Jo(e,1),ei(e,1,0))}function ni(e){for(;e===Yo;)Yo=Ho[--Vo],Ho[Vo]=null,qo=Ho[--Vo],Ho[Vo]=null;for(;e===Ko;)Ko=Go[--Xo],Go[Xo]=null,Zo=Go[--Xo],Go[Xo]=null,Qo=Go[--Xo],Go[Xo]=null}var ri=null,oi=null,ii=!1,ai=null;function si(e,t){var n=_u(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function li(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,ri=e,oi=uo(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,ri=e,oi=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Ko?{id:Qo,overflow:Zo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=_u(18,null,null,0)).stateNode=t,n.return=e,e.child=n,ri=e,oi=null,!0);default:return!1}}function ui(e){return!(!(1&e.mode)||128&e.flags)}function ci(e){if(ii){var t=oi;if(t){var r=t;if(!li(e,t)){if(ui(e))throw Error(n(418));t=uo(r.nextSibling);var o=ri;t&&li(e,t)?si(o,r):(e.flags=-4097&e.flags|2,ii=!1,ri=e)}}else{if(ui(e))throw Error(n(418));e.flags=-4097&e.flags|2,ii=!1,ri=e}}}function di(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ri=e}function fi(e){if(e!==ri)return!1;if(!ii)return di(e),ii=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!no(e.type,e.memoizedProps)),t&&(t=oi)){if(ui(e))throw pi(),Error(n(418));for(;t;)si(e,t),t=uo(t.nextSibling)}if(di(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(n(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var r=e.data;if("/$"===r){if(0===t){oi=uo(e.nextSibling);break e}t--}else"$"!==r&&"$!"!==r&&"$?"!==r||t++}e=e.nextSibling}oi=null}}else oi=ri?uo(e.stateNode.nextSibling):null;return!0}function pi(){for(var e=oi;e;)e=uo(e.nextSibling)}function hi(){oi=ri=null,ii=!1}function mi(e){null===ai?ai=[e]:ai.push(e)}var gi=w.ReactCurrentBatchConfig;function vi(e,t,r){if(null!==(e=r.ref)&&"function"!=typeof e&&"object"!=typeof e){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(n(309));var o=r.stateNode}if(!o)throw Error(n(147,e));var i=o,a=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===a?t.ref:(t=function(e){var t=i.refs;null===e?delete t[a]:t[a]=e},t._stringRef=a,t)}if("string"!=typeof e)throw Error(n(284));if(!r._owner)throw Error(n(290,e))}return e}function bi(e,t){throw e=Object.prototype.toString.call(t),Error(n(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function yi(e){return(0,e._init)(e._payload)}function wi(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function r(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function o(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=zu(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Au(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function u(e,t,n,r){var o=n.type;return o===k?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===o||"object"==typeof o&&null!==o&&o.$$typeof===z&&yi(o)===t.type)?((r=i(t,n.props)).ref=vi(e,t,n),r.return=e,r):((r=Iu(n.type,n.key,n.props,null,e.mode,r)).ref=vi(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Fu(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function d(e,t,n,r,o){return null===t||7!==t.tag?((t=Du(n,e.mode,r,o)).return=e,t):((t=i(t,n)).return=e,t)}function f(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=Au(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case x:return(n=Iu(t.type,t.key,t.props,null,e.mode,n)).ref=vi(e,null,t),n.return=e,n;case E:return(t=Fu(t,e.mode,n)).return=e,t;case z:return f(e,(0,t._init)(t._payload),n)}if(ne(t)||L(t))return(t=Du(t,e.mode,n,null)).return=e,t;bi(e,t)}return null}function p(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==o?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case x:return n.key===o?u(e,t,n,r):null;case E:return n.key===o?c(e,t,n,r):null;case z:return p(e,t,(o=n._init)(n._payload),r)}if(ne(n)||L(n))return null!==o?null:d(e,t,n,r,null);bi(e,n)}return null}function h(e,t,n,r,o){if("string"==typeof r&&""!==r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case x:return u(t,e=e.get(null===r.key?n:r.key)||null,r,o);case E:return c(t,e=e.get(null===r.key?n:r.key)||null,r,o);case z:return h(e,t,n,(0,r._init)(r._payload),o)}if(ne(r)||L(r))return d(t,e=e.get(n)||null,r,o,null);bi(t,r)}return null}function m(n,i,s,l){for(var u=null,c=null,d=i,m=i=0,g=null;null!==d&&m<s.length;m++){d.index>m?(g=d,d=null):g=d.sibling;var v=p(n,d,s[m],l);if(null===v){null===d&&(d=g);break}e&&d&&null===v.alternate&&t(n,d),i=a(v,i,m),null===c?u=v:c.sibling=v,c=v,d=g}if(m===s.length)return r(n,d),ii&&Jo(n,m),u;if(null===d){for(;m<s.length;m++)null!==(d=f(n,s[m],l))&&(i=a(d,i,m),null===c?u=d:c.sibling=d,c=d);return ii&&Jo(n,m),u}for(d=o(n,d);m<s.length;m++)null!==(g=h(d,n,m,s[m],l))&&(e&&null!==g.alternate&&d.delete(null===g.key?m:g.key),i=a(g,i,m),null===c?u=g:c.sibling=g,c=g);return e&&d.forEach(function(e){return t(n,e)}),ii&&Jo(n,m),u}function g(i,s,l,u){var c=L(l);if("function"!=typeof c)throw Error(n(150));if(null==(l=c.call(l)))throw Error(n(151));for(var d=c=null,m=s,g=s=0,v=null,b=l.next();null!==m&&!b.done;g++,b=l.next()){m.index>g?(v=m,m=null):v=m.sibling;var y=p(i,m,b.value,u);if(null===y){null===m&&(m=v);break}e&&m&&null===y.alternate&&t(i,m),s=a(y,s,g),null===d?c=y:d.sibling=y,d=y,m=v}if(b.done)return r(i,m),ii&&Jo(i,g),c;if(null===m){for(;!b.done;g++,b=l.next())null!==(b=f(i,b.value,u))&&(s=a(b,s,g),null===d?c=b:d.sibling=b,d=b);return ii&&Jo(i,g),c}for(m=o(i,m);!b.done;g++,b=l.next())null!==(b=h(m,i,g,b.value,u))&&(e&&null!==b.alternate&&m.delete(null===b.key?g:b.key),s=a(b,s,g),null===d?c=b:d.sibling=b,d=b);return e&&m.forEach(function(e){return t(i,e)}),ii&&Jo(i,g),c}return function e(n,o,a,l){if("object"==typeof a&&null!==a&&a.type===k&&null===a.key&&(a=a.props.children),"object"==typeof a&&null!==a){switch(a.$$typeof){case x:e:{for(var u=a.key,c=o;null!==c;){if(c.key===u){if((u=a.type)===k){if(7===c.tag){r(n,c.sibling),(o=i(c,a.props.children)).return=n,n=o;break e}}else if(c.elementType===u||"object"==typeof u&&null!==u&&u.$$typeof===z&&yi(u)===c.type){r(n,c.sibling),(o=i(c,a.props)).ref=vi(n,c,a),o.return=n,n=o;break e}r(n,c);break}t(n,c),c=c.sibling}a.type===k?((o=Du(a.props.children,n.mode,l,a.key)).return=n,n=o):((l=Iu(a.type,a.key,a.props,null,n.mode,l)).ref=vi(n,o,a),l.return=n,n=l)}return s(n);case E:e:{for(c=a.key;null!==o;){if(o.key===c){if(4===o.tag&&o.stateNode.containerInfo===a.containerInfo&&o.stateNode.implementation===a.implementation){r(n,o.sibling),(o=i(o,a.children||[])).return=n,n=o;break e}r(n,o);break}t(n,o),o=o.sibling}(o=Fu(a,n.mode,l)).return=n,n=o}return s(n);case z:return e(n,o,(c=a._init)(a._payload),l)}if(ne(a))return m(n,o,a,l);if(L(a))return g(n,o,a,l);bi(n,a)}return"string"==typeof a&&""!==a||"number"==typeof a?(a=""+a,null!==o&&6===o.tag?(r(n,o.sibling),(o=i(o,a)).return=n,n=o):(r(n,o),(o=Au(a,n.mode,l)).return=n,n=o),s(n)):r(n,o)}}var xi=wi(!0),Si=wi(!1),Ei=Co(null),ki=null,Ci=null,Ti=null;function Pi(){Ti=Ci=ki=null}function Oi(e){var t=Ei.current;To(Ei),e._currentValue=t}function Mi(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ni(e,t){ki=e,Ti=Ci=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(ys=!0),e.firstContext=null)}function _i(e){var t=e._currentValue;if(Ti!==e)if(e={context:e,memoizedValue:t,next:null},null===Ci){if(null===ki)throw Error(n(308));Ci=e,ki.dependencies={lanes:0,firstContext:e}}else Ci=Ci.next=e;return t}var Ri=null;function zi(e){null===Ri?Ri=[e]:Ri.push(e)}function Ii(e,t,n,r){var o=t.interleaved;return null===o?(n.next=n,zi(t)):(n.next=o.next,o.next=n),t.interleaved=n,Di(e,r)}function Di(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Li=!1;function Ai(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Fi(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function $i(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ji(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&Ol){var o=r.pending;return null===o?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Di(e,n)}return null===(o=r.interleaved)?(t.next=t,zi(r)):(t.next=o.next,o.next=t),r.interleaved=t,Di(e,n)}function Bi(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,bt(e,n)}}function Wi(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,i=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===i?o=i=a:i=i.next=a,n=n.next}while(null!==n);null===i?o=i=t:i=i.next=t}else o=i=t;return n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ui(e,t,n,r){var o=e.updateQueue;Li=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,s=o.shared.pending;if(null!==s){o.shared.pending=null;var l=s,u=l.next;l.next=null,null===a?i=u:a.next=u,a=l;var c=e.alternate;null!==c&&((s=(c=c.updateQueue).lastBaseUpdate)!==a&&(null===s?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(null!==i){var d=o.baseState;for(a=0,c=u=l=null,s=i;;){var f=s.lane,p=s.eventTime;if((r&f)===f){null!==c&&(c=c.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var h=e,m=s;switch(f=t,p=n,m.tag){case 1:if("function"==typeof(h=m.payload)){d=h.call(p,d,f);break e}d=h;break e;case 3:h.flags=-65537&h.flags|128;case 0:if(null==(f="function"==typeof(h=m.payload)?h.call(p,d,f):h))break e;d=F({},d,f);break e;case 2:Li=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(f=o.effects)?o.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===c?(u=c=p,l=d):c=c.next=p,a|=f;if(null===(s=s.next)){if(null===(s=o.shared.pending))break;s=(f=s).next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}if(null===c&&(l=d),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=c,null!==(t=o.shared.interleaved)){o=t;do{a|=o.lane,o=o.next}while(o!==t)}else null===i&&(o.shared.lanes=0);Ll|=a,e.lanes=a,e.memoizedState=d}}function Hi(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var o=e[t],i=o.callback;if(null!==i){if(o.callback=null,o=r,"function"!=typeof i)throw Error(n(191,i));i.call(o)}}}var Vi={},Yi=Co(Vi),qi=Co(Vi),Gi=Co(Vi);function Xi(e){if(e===Vi)throw Error(n(174));return e}function Ki(e,t){switch(Po(Gi,t),Po(qi,e),Po(Yi,Vi),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ue(null,"");break;default:t=ue(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}To(Yi),Po(Yi,t)}function Qi(){To(Yi),To(qi),To(Gi)}function Zi(e){Xi(Gi.current);var t=Xi(Yi.current),n=ue(t,e.type);t!==n&&(Po(qi,e),Po(Yi,n))}function Ji(e){qi.current===e&&(To(Yi),To(qi))}var ea=Co(0);function ta(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var na=[];function ra(){for(var e=0;e<na.length;e++)na[e]._workInProgressVersionPrimary=null;na.length=0}var oa=w.ReactCurrentDispatcher,ia=w.ReactCurrentBatchConfig,aa=0,sa=null,la=null,ua=null,ca=!1,da=!1,fa=0,pa=0;function ha(){throw Error(n(321))}function ma(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!sr(e[n],t[n]))return!1;return!0}function ga(e,t,r,o,i,a){if(aa=a,sa=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,oa.current=null===e||null===e.memoizedState?Ja:es,e=r(o,i),da){a=0;do{if(da=!1,fa=0,25<=a)throw Error(n(301));a+=1,ua=la=null,t.updateQueue=null,oa.current=ts,e=r(o,i)}while(da)}if(oa.current=Za,t=null!==la&&null!==la.next,aa=0,ua=la=sa=null,ca=!1,t)throw Error(n(300));return e}function va(){var e=0!==fa;return fa=0,e}function ba(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ua?sa.memoizedState=ua=e:ua=ua.next=e,ua}function ya(){if(null===la){var e=sa.alternate;e=null!==e?e.memoizedState:null}else e=la.next;var t=null===ua?sa.memoizedState:ua.next;if(null!==t)ua=t,la=e;else{if(null===e)throw Error(n(310));e={memoizedState:(la=e).memoizedState,baseState:la.baseState,baseQueue:la.baseQueue,queue:la.queue,next:null},null===ua?sa.memoizedState=ua=e:ua=ua.next=e}return ua}function wa(e,t){return"function"==typeof t?t(e):t}function xa(e){var t=ya(),r=t.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=e;var o=la,i=o.baseQueue,a=r.pending;if(null!==a){if(null!==i){var s=i.next;i.next=a.next,a.next=s}o.baseQueue=i=a,r.pending=null}if(null!==i){a=i.next,o=o.baseState;var l=s=null,u=null,c=a;do{var d=c.lane;if((aa&d)===d)null!==u&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),o=c.hasEagerState?c.eagerState:e(o,c.action);else{var f={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};null===u?(l=u=f,s=o):u=u.next=f,sa.lanes|=d,Ll|=d}c=c.next}while(null!==c&&c!==a);null===u?s=o:u.next=l,sr(o,t.memoizedState)||(ys=!0),t.memoizedState=o,t.baseState=s,t.baseQueue=u,r.lastRenderedState=o}if(null!==(e=r.interleaved)){i=e;do{a=i.lane,sa.lanes|=a,Ll|=a,i=i.next}while(i!==e)}else null===i&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Sa(e){var t=ya(),r=t.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=e;var o=r.dispatch,i=r.pending,a=t.memoizedState;if(null!==i){r.pending=null;var s=i=i.next;do{a=e(a,s.action),s=s.next}while(s!==i);sr(a,t.memoizedState)||(ys=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),r.lastRenderedState=a}return[a,o]}function Ea(){}function ka(e,t){var r=sa,o=ya(),i=t(),a=!sr(o.memoizedState,i);if(a&&(o.memoizedState=i,ys=!0),o=o.queue,La(Pa.bind(null,r,o,e),[e]),o.getSnapshot!==t||a||null!==ua&&1&ua.memoizedState.tag){if(r.flags|=2048,_a(9,Ta.bind(null,r,o,i,t),void 0,null),null===Ml)throw Error(n(349));30&aa||Ca(r,t,i)}return i}function Ca(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=sa.updateQueue)?(t={lastEffect:null,stores:null},sa.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ta(e,t,n,r){t.value=n,t.getSnapshot=r,Oa(t)&&Ma(e)}function Pa(e,t,n){return n(function(){Oa(t)&&Ma(e)})}function Oa(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!sr(e,n)}catch(e){return!0}}function Ma(e){var t=Di(e,1);null!==t&&nu(t,e,1,-1)}function Na(e){var t=ba();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:e},t.queue=e,e=e.dispatch=Ga.bind(null,sa,e),[t.memoizedState,e]}function _a(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=sa.updateQueue)?(t={lastEffect:null,stores:null},sa.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ra(){return ya().memoizedState}function za(e,t,n,r){var o=ba();sa.flags|=e,o.memoizedState=_a(1|t,n,void 0,void 0===r?null:r)}function Ia(e,t,n,r){var o=ya();r=void 0===r?null:r;var i=void 0;if(null!==la){var a=la.memoizedState;if(i=a.destroy,null!==r&&ma(r,a.deps))return void(o.memoizedState=_a(t,n,i,r))}sa.flags|=e,o.memoizedState=_a(1|t,n,i,r)}function Da(e,t){return za(8390656,8,e,t)}function La(e,t){return Ia(2048,8,e,t)}function Aa(e,t){return Ia(4,2,e,t)}function Fa(e,t){return Ia(4,4,e,t)}function $a(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function ja(e,t,n){return n=null!=n?n.concat([e]):null,Ia(4,4,$a.bind(null,t,e),n)}function Ba(){}function Wa(e,t){var n=ya();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ma(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ua(e,t){var n=ya();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ma(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ha(e,t,n){return 21&aa?(sr(n,t)||(n=mt(),sa.lanes|=n,Ll|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ys=!0),e.memoizedState=n)}function Va(e,t){var n=yt;yt=0!==n&&4>n?n:4,e(!0);var r=ia.transition;ia.transition={};try{e(!1),t()}finally{yt=n,ia.transition=r}}function Ya(){return ya().memoizedState}function qa(e,t,n){var r=tu(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Xa(e))Ka(t,n);else if(null!==(n=Ii(e,t,n,r))){nu(n,e,r,eu()),Qa(n,t,r)}}function Ga(e,t,n){var r=tu(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Xa(e))Ka(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,sr(s,a)){var l=t.interleaved;return null===l?(o.next=o,zi(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(e){}null!==(n=Ii(e,t,o,r))&&(nu(n,e,r,o=eu()),Qa(n,t,r))}}function Xa(e){var t=e.alternate;return e===sa||null!==t&&t===sa}function Ka(e,t){da=ca=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Qa(e,t,n){if(4194240&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,bt(e,n)}}var Za={readContext:_i,useCallback:ha,useContext:ha,useEffect:ha,useImperativeHandle:ha,useInsertionEffect:ha,useLayoutEffect:ha,useMemo:ha,useReducer:ha,useRef:ha,useState:ha,useDebugValue:ha,useDeferredValue:ha,useTransition:ha,useMutableSource:ha,useSyncExternalStore:ha,useId:ha,unstable_isNewReconciler:!1},Ja={readContext:_i,useCallback:function(e,t){return ba().memoizedState=[e,void 0===t?null:t],e},useContext:_i,useEffect:Da,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,za(4194308,4,$a.bind(null,t,e),n)},useLayoutEffect:function(e,t){return za(4194308,4,e,t)},useInsertionEffect:function(e,t){return za(4,2,e,t)},useMemo:function(e,t){var n=ba();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ba();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=qa.bind(null,sa,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},ba().memoizedState=e},useState:Na,useDebugValue:Ba,useDeferredValue:function(e){return ba().memoizedState=e},useTransition:function(){var e=Na(!1),t=e[0];return e=Va.bind(null,e[1]),ba().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var o=sa,i=ba();if(ii){if(void 0===r)throw Error(n(407));r=r()}else{if(r=t(),null===Ml)throw Error(n(349));30&aa||Ca(o,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,Da(Pa.bind(null,o,a,e),[e]),o.flags|=2048,_a(9,Ta.bind(null,o,a,r,t),void 0,null),r},useId:function(){var e=ba(),t=Ml.identifierPrefix;if(ii){var n=Zo;t=":"+t+"R"+(n=(Qo&~(1<<32-at(Qo)-1)).toString(32)+n),0<(n=fa++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=pa++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},es={readContext:_i,useCallback:Wa,useContext:_i,useEffect:La,useImperativeHandle:ja,useInsertionEffect:Aa,useLayoutEffect:Fa,useMemo:Ua,useReducer:xa,useRef:Ra,useState:function(){return xa(wa)},useDebugValue:Ba,useDeferredValue:function(e){return Ha(ya(),la.memoizedState,e)},useTransition:function(){return[xa(wa)[0],ya().memoizedState]},useMutableSource:Ea,useSyncExternalStore:ka,useId:Ya,unstable_isNewReconciler:!1},ts={readContext:_i,useCallback:Wa,useContext:_i,useEffect:La,useImperativeHandle:ja,useInsertionEffect:Aa,useLayoutEffect:Fa,useMemo:Ua,useReducer:Sa,useRef:Ra,useState:function(){return Sa(wa)},useDebugValue:Ba,useDeferredValue:function(e){var t=ya();return null===la?t.memoizedState=e:Ha(t,la.memoizedState,e)},useTransition:function(){return[Sa(wa)[0],ya().memoizedState]},useMutableSource:Ea,useSyncExternalStore:ka,useId:Ya,unstable_isNewReconciler:!1};function ns(e,t){if(e&&e.defaultProps){for(var n in t=F({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function rs(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:F({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var os={isMounted:function(e){return!!(e=e._reactInternals)&&We(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=eu(),o=tu(e),i=$i(r,o);i.payload=t,null!=n&&(i.callback=n),null!==(t=ji(e,i,o))&&(nu(t,e,o,r),Bi(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=eu(),o=tu(e),i=$i(r,o);i.tag=1,i.payload=t,null!=n&&(i.callback=n),null!==(t=ji(e,i,o))&&(nu(t,e,o,r),Bi(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=eu(),r=tu(e),o=$i(n,r);o.tag=2,null!=t&&(o.callback=t),null!==(t=ji(e,o,r))&&(nu(t,e,r,n),Bi(t,e,r))}};function is(e,t,n,r,o,i,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,a):!t.prototype||!t.prototype.isPureReactComponent||(!lr(n,r)||!lr(o,i))}function as(e,t,n){var r=!1,o=Oo,i=t.contextType;return"object"==typeof i&&null!==i?i=_i(i):(o=zo(t)?_o:Mo.current,i=(r=null!=(r=t.contextTypes))?Ro(e,o):Oo),t=new t(n,i),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=os,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function ss(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&os.enqueueReplaceState(t,t.state,null)}function ls(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Ai(e);var i=t.contextType;"object"==typeof i&&null!==i?o.context=_i(i):(i=zo(t)?_o:Mo.current,o.context=Ro(e,i)),o.state=e.memoizedState,"function"==typeof(i=t.getDerivedStateFromProps)&&(rs(e,t,i,n),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(t=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&os.enqueueReplaceState(o,o.state,null),Ui(e,n,o,r),o.state=e.memoizedState),"function"==typeof o.componentDidMount&&(e.flags|=4194308)}function us(e,t){try{var n="",r=t;do{n+=W(r),r=r.return}while(r);var o=n}catch(e){o="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:o,digest:null}}function cs(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function ds(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var fs="function"==typeof WeakMap?WeakMap:Map;function ps(e,t,n){(n=$i(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Hl||(Hl=!0,Vl=r),ds(0,t)},n}function hs(e,t,n){(n=$i(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){ds(0,t)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){ds(0,t),"function"!=typeof r&&(null===Yl?Yl=new Set([this]):Yl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function ms(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new fs;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Cu.bind(null,e,t,n),t.then(e,e))}function gs(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function vs(e,t,n,r,o){return 1&e.mode?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=$i(-1,1)).tag=2,ji(n,t,1))),n.lanes|=1),e)}var bs=w.ReactCurrentOwner,ys=!1;function ws(e,t,n,r){t.child=null===e?Si(t,null,n,r):xi(t,e.child,n,r)}function xs(e,t,n,r,o){n=n.render;var i=t.ref;return Ni(t,o),r=ga(e,t,n,r,i,o),n=va(),null===e||ys?(ii&&n&&ti(t),t.flags|=1,ws(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Hs(e,t,o))}function Ss(e,t,n,r,o){if(null===e){var i=n.type;return"function"!=typeof i||Ru(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Iu(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,Es(e,t,i,r,o))}if(i=e.child,0===(e.lanes&o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:lr)(a,r)&&e.ref===t.ref)return Hs(e,t,o)}return t.flags|=1,(e=zu(i,r)).ref=t.ref,e.return=t,t.child=e}function Es(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(lr(i,r)&&e.ref===t.ref){if(ys=!1,t.pendingProps=r=i,0===(e.lanes&o))return t.lanes=e.lanes,Hs(e,t,o);131072&e.flags&&(ys=!0)}}return Ts(e,t,n,r,o)}function ks(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(1&t.mode){if(!(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Po(zl,Rl),Rl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==i?i.baseLanes:n,Po(zl,Rl),Rl|=r}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Po(zl,Rl),Rl|=n;else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,Po(zl,Rl),Rl|=r;return ws(e,t,o,n),t.child}function Cs(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ts(e,t,n,r,o){var i=zo(n)?_o:Mo.current;return i=Ro(t,i),Ni(t,o),n=ga(e,t,n,r,i,o),r=va(),null===e||ys?(ii&&r&&ti(t),t.flags|=1,ws(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Hs(e,t,o))}function Ps(e,t,n,r,o){if(zo(n)){var i=!0;Ao(t)}else i=!1;if(Ni(t,o),null===t.stateNode)Us(e,t),as(t,n,r),ls(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;"object"==typeof u&&null!==u?u=_i(u):u=Ro(t,u=zo(n)?_o:Mo.current);var c=n.getDerivedStateFromProps,d="function"==typeof c||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==u)&&ss(t,a,r,u),Li=!1;var f=t.memoizedState;a.state=f,Ui(t,r,a,o),l=t.memoizedState,s!==r||f!==l||No.current||Li?("function"==typeof c&&(rs(t,n,c,r),l=t.memoizedState),(s=Li||is(t,n,s,r,f,l,u))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Fi(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:ns(t.type,s),a.props=u,d=t.pendingProps,f=a.context,"object"==typeof(l=n.contextType)&&null!==l?l=_i(l):l=Ro(t,l=zo(n)?_o:Mo.current);var p=n.getDerivedStateFromProps;(c="function"==typeof p||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||f!==l)&&ss(t,a,r,l),Li=!1,f=t.memoizedState,a.state=f,Ui(t,r,a,o);var h=t.memoizedState;s!==d||f!==h||No.current||Li?("function"==typeof p&&(rs(t,n,p,r),h=t.memoizedState),(u=Li||is(t,n,u,r,f,h,l)||!1)?(c||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,h,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,h,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),a.props=r,a.state=h,a.context=l,r=u):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Os(e,t,n,r,i,o)}function Os(e,t,n,r,o,i){Cs(e,t);var a=!!(128&t.flags);if(!r&&!a)return o&&Fo(t,n,!1),Hs(e,t,i);r=t.stateNode,bs.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=xi(t,e.child,null,i),t.child=xi(t,null,s,i)):ws(e,t,s,i),t.memoizedState=r.state,o&&Fo(t,n,!0),t.child}function Ms(e){var t=e.stateNode;t.pendingContext?Do(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Do(0,t.context,!1),Ki(e,t.containerInfo)}function Ns(e,t,n,r,o){return hi(),mi(o),t.flags|=256,ws(e,t,n,r),t.child}var _s,Rs,zs,Is,Ds={dehydrated:null,treeContext:null,retryLane:0};function Ls(e){return{baseLanes:e,cachePool:null,transitions:null}}function As(e,t,r){var o,i=t.pendingProps,a=ea.current,s=!1,l=!!(128&t.flags);if((o=l)||(o=(null===e||null!==e.memoizedState)&&!!(2&a)),o?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),Po(ea,1&a),null===e)return ci(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=i.children,e=i.fallback,s?(i=t.mode,s=t.child,l={mode:"hidden",children:l},1&i||null===s?s=Lu(l,i,0,null):(s.childLanes=0,s.pendingProps=l),e=Du(e,i,r,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Ls(r),t.memoizedState=Ds,e):Fs(t,l));if(null!==(a=e.memoizedState)&&null!==(o=a.dehydrated))return function(e,t,r,o,i,a,s){if(r)return 256&t.flags?(t.flags&=-257,$s(e,t,s,o=cs(Error(n(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=o.fallback,i=t.mode,o=Lu({mode:"visible",children:o.children},i,0,null),(a=Du(a,i,s,null)).flags|=2,o.return=t,a.return=t,o.sibling=a,t.child=o,1&t.mode&&xi(t,e.child,null,s),t.child.memoizedState=Ls(s),t.memoizedState=Ds,a);if(!(1&t.mode))return $s(e,t,s,null);if("$!"===i.data){if(o=i.nextSibling&&i.nextSibling.dataset)var l=o.dgst;return o=l,$s(e,t,s,o=cs(a=Error(n(419)),o,void 0))}if(l=0!==(s&e.childLanes),ys||l){if(null!==(o=Ml)){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=0!==(i&(o.suspendedLanes|s))?0:i)&&i!==a.retryLane&&(a.retryLane=i,Di(e,i),nu(o,e,i,-1))}return mu(),$s(e,t,s,o=cs(Error(n(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=Pu.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,oi=uo(i.nextSibling),ri=t,ii=!0,ai=null,null!==e&&(Go[Xo++]=Qo,Go[Xo++]=Zo,Go[Xo++]=Ko,Qo=e.id,Zo=e.overflow,Ko=t),t=Fs(t,o.children),t.flags|=4096,t)}(e,t,l,i,o,a,r);if(s){s=i.fallback,l=t.mode,o=(a=e.child).sibling;var u={mode:"hidden",children:i.children};return 1&l||t.child===a?(i=zu(a,u)).subtreeFlags=14680064&a.subtreeFlags:((i=t.child).childLanes=0,i.pendingProps=u,t.deletions=null),null!==o?s=zu(o,s):(s=Du(s,l,r,null)).flags|=2,s.return=t,i.return=t,i.sibling=s,t.child=i,i=s,s=t.child,l=null===(l=e.child.memoizedState)?Ls(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~r,t.memoizedState=Ds,i}return e=(s=e.child).sibling,i=zu(s,{mode:"visible",children:i.children}),!(1&t.mode)&&(i.lanes=r),i.return=t,i.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function Fs(e,t){return(t=Lu({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function $s(e,t,n,r){return null!==r&&mi(r),xi(t,e.child,null,n),(e=Fs(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function js(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Mi(e.return,t,n)}function Bs(e,t,n,r,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Ws(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(ws(e,t,r.children,n),2&(r=ea.current))r=1&r|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&js(e,n,t);else if(19===e.tag)js(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Po(ea,r),1&t.mode)switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===ta(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Bs(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===ta(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Bs(t,!0,n,null,i);break;case"together":Bs(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function Us(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Hs(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),Ll|=t.lanes,0===(r&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(n(153));if(null!==t.child){for(r=zu(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=zu(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function Vs(e,t){if(!ii)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ys(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function qs(e,t,r){var i=t.pendingProps;switch(ni(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ys(t),null;case 1:case 17:return zo(t.type)&&Io(),Ys(t),null;case 3:return i=t.stateNode,Qi(),To(No),To(Mo),ra(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),null!==e&&null!==e.child||(fi(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==ai&&(au(ai),ai=null))),Rs(e,t),Ys(t),null;case 5:Ji(t);var a=Xi(Gi.current);if(r=t.type,null!==e&&null!=t.stateNode)zs(e,t,r,i,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(null===t.stateNode)throw Error(n(166));return Ys(t),null}if(e=Xi(Yi.current),fi(t)){i=t.stateNode,r=t.type;var s=t.memoizedProps;switch(i[po]=t,i[ho]=s,e=!!(1&t.mode),r){case"dialog":$r("cancel",i),$r("close",i);break;case"iframe":case"object":case"embed":$r("load",i);break;case"video":case"audio":for(a=0;a<Dr.length;a++)$r(Dr[a],i);break;case"source":$r("error",i);break;case"img":case"image":case"link":$r("error",i),$r("load",i);break;case"details":$r("toggle",i);break;case"input":Q(i,s),$r("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!s.multiple},$r("invalid",i);break;case"textarea":ie(i,s),$r("invalid",i)}for(var l in be(r,s),a=null,s)if(s.hasOwnProperty(l)){var u=s[l];"children"===l?"string"==typeof u?i.textContent!==u&&(!0!==s.suppressHydrationWarning&&Zr(i.textContent,u,e),a=["children",u]):"number"==typeof u&&i.textContent!==""+u&&(!0!==s.suppressHydrationWarning&&Zr(i.textContent,u,e),a=["children",""+u]):o.hasOwnProperty(l)&&null!=u&&"onScroll"===l&&$r("scroll",i)}switch(r){case"input":q(i),ee(i,s,!0);break;case"textarea":q(i),se(i);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(i.onclick=Jr)}i=a,t.updateQueue=i,null!==i&&(t.flags|=4)}else{l=9===a.nodeType?a:a.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=le(r)),"http://www.w3.org/1999/xhtml"===e?"script"===r?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof i.is?e=l.createElement(r,{is:i.is}):(e=l.createElement(r),"select"===r&&(l=e,i.multiple?l.multiple=!0:i.size&&(l.size=i.size))):e=l.createElementNS(e,r),e[po]=t,e[ho]=i,_s(e,t,!1,!1),t.stateNode=e;e:{switch(l=ye(r,i),r){case"dialog":$r("cancel",e),$r("close",e),a=i;break;case"iframe":case"object":case"embed":$r("load",e),a=i;break;case"video":case"audio":for(a=0;a<Dr.length;a++)$r(Dr[a],e);a=i;break;case"source":$r("error",e),a=i;break;case"img":case"image":case"link":$r("error",e),$r("load",e),a=i;break;case"details":$r("toggle",e),a=i;break;case"input":Q(e,i),a=K(e,i),$r("invalid",e);break;case"option":default:a=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},a=F({},i,{value:void 0}),$r("invalid",e);break;case"textarea":ie(e,i),a=oe(e,i),$r("invalid",e)}for(s in be(r,a),u=a)if(u.hasOwnProperty(s)){var c=u[s];"style"===s?ge(e,c):"dangerouslySetInnerHTML"===s?null!=(c=c?c.__html:void 0)&&de(e,c):"children"===s?"string"==typeof c?("textarea"!==r||""!==c)&&fe(e,c):"number"==typeof c&&fe(e,""+c):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(o.hasOwnProperty(s)?null!=c&&"onScroll"===s&&$r("scroll",e):null!=c&&b(e,s,c,l))}switch(r){case"input":q(e),ee(e,i,!1);break;case"textarea":q(e),se(e);break;case"option":null!=i.value&&e.setAttribute("value",""+V(i.value));break;case"select":e.multiple=!!i.multiple,null!=(s=i.value)?re(e,!!i.multiple,s,!1):null!=i.defaultValue&&re(e,!!i.multiple,i.defaultValue,!0);break;default:"function"==typeof a.onClick&&(e.onclick=Jr)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Ys(t),null;case 6:if(e&&null!=t.stateNode)Is(e,t,e.memoizedProps,i);else{if("string"!=typeof i&&null===t.stateNode)throw Error(n(166));if(r=Xi(Gi.current),Xi(Yi.current),fi(t)){if(i=t.stateNode,r=t.memoizedProps,i[po]=t,(s=i.nodeValue!==r)&&null!==(e=ri))switch(e.tag){case 3:Zr(i.nodeValue,r,!!(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Zr(i.nodeValue,r,!!(1&e.mode))}s&&(t.flags|=4)}else(i=(9===r.nodeType?r:r.ownerDocument).createTextNode(i))[po]=t,t.stateNode=i}return Ys(t),null;case 13:if(To(ea),i=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(ii&&null!==oi&&1&t.mode&&!(128&t.flags))pi(),hi(),t.flags|=98560,s=!1;else if(s=fi(t),null!==i&&null!==i.dehydrated){if(null===e){if(!s)throw Error(n(318));if(!(s=null!==(s=t.memoizedState)?s.dehydrated:null))throw Error(n(317));s[po]=t}else hi(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Ys(t),s=!1}else null!==ai&&(au(ai),ai=null),s=!0;if(!s)return 65536&t.flags?t:null}return 128&t.flags?(t.lanes=r,t):((i=null!==i)!==(null!==e&&null!==e.memoizedState)&&i&&(t.child.flags|=8192,1&t.mode&&(null===e||1&ea.current?0===Il&&(Il=3):mu())),null!==t.updateQueue&&(t.flags|=4),Ys(t),null);case 4:return Qi(),Rs(e,t),null===e&&Wr(t.stateNode.containerInfo),Ys(t),null;case 10:return Oi(t.type._context),Ys(t),null;case 19:if(To(ea),null===(s=t.memoizedState))return Ys(t),null;if(i=!!(128&t.flags),null===(l=s.rendering))if(i)Vs(s,!1);else{if(0!==Il||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(l=ta(e))){for(t.flags|=128,Vs(s,!1),null!==(i=l.updateQueue)&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;null!==r;)e=i,(s=r).flags&=14680066,null===(l=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,e=l.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Po(ea,1&ea.current|2),t.child}e=e.sibling}null!==s.tail&&Qe()>Wl&&(t.flags|=128,i=!0,Vs(s,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=ta(l))){if(t.flags|=128,i=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.flags|=4),Vs(s,!0),null===s.tail&&"hidden"===s.tailMode&&!l.alternate&&!ii)return Ys(t),null}else 2*Qe()-s.renderingStartTime>Wl&&1073741824!==r&&(t.flags|=128,i=!0,Vs(s,!1),t.lanes=4194304);s.isBackwards?(l.sibling=t.child,t.child=l):(null!==(r=s.last)?r.sibling=l:t.child=l,s.last=l)}return null!==s.tail?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Qe(),t.sibling=null,r=ea.current,Po(ea,i?1&r|2:1&r),t):(Ys(t),null);case 22:case 23:return du(),i=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==i&&(t.flags|=8192),i&&1&t.mode?!!(1073741824&Rl)&&(Ys(t),6&t.subtreeFlags&&(t.flags|=8192)):Ys(t),null;case 24:case 25:return null}throw Error(n(156,t.tag))}function Gs(e,t){switch(ni(t),t.tag){case 1:return zo(t.type)&&Io(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Qi(),To(No),To(Mo),ra(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Ji(t),null;case 13:if(To(ea),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(n(340));hi()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return To(ea),null;case 4:return Qi(),null;case 10:return Oi(t.type._context),null;case 22:case 23:return du(),null;default:return null}}_s=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Rs=function(){},zs=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Xi(Yi.current);var a,s=null;switch(n){case"input":i=K(e,i),r=K(e,r),s=[];break;case"select":i=F({},i,{value:void 0}),r=F({},r,{value:void 0}),s=[];break;case"textarea":i=oe(e,i),r=oe(e,r),s=[];break;default:"function"!=typeof i.onClick&&"function"==typeof r.onClick&&(e.onclick=Jr)}for(c in be(n,r),n=null,i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&null!=i[c])if("style"===c){var l=i[c];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(o.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var u=r[c];if(l=null!=i?i[c]:void 0,r.hasOwnProperty(c)&&u!==l&&(null!=u||null!=l))if("style"===c)if(l){for(a in l)!l.hasOwnProperty(a)||u&&u.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in u)u.hasOwnProperty(a)&&l[a]!==u[a]&&(n||(n={}),n[a]=u[a])}else n||(s||(s=[]),s.push(c,n)),n=u;else"dangerouslySetInnerHTML"===c?(u=u?u.__html:void 0,l=l?l.__html:void 0,null!=u&&l!==u&&(s=s||[]).push(c,u)):"children"===c?"string"!=typeof u&&"number"!=typeof u||(s=s||[]).push(c,""+u):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(o.hasOwnProperty(c)?(null!=u&&"onScroll"===c&&$r("scroll",e),s||l===u||(s=[])):(s=s||[]).push(c,u))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}},Is=function(e,t,n,r){n!==r&&(t.flags|=4)};var Xs=!1,Ks=!1,Qs="function"==typeof WeakSet?WeakSet:Set,Zs=null;function Js(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){ku(e,t,n)}else n.current=null}function el(e,t,n){try{n()}catch(n){ku(e,t,n)}}var tl=!1;function nl(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,void 0!==i&&el(t,n,i)}o=o.next}while(o!==r)}}function rl(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ol(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function il(e){var t=e.alternate;null!==t&&(e.alternate=null,il(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[po],delete t[ho],delete t[go],delete t[vo],delete t[bo])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function al(e){return 5===e.tag||3===e.tag||4===e.tag}function sl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||al(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function ll(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Jr));else if(4!==r&&null!==(e=e.child))for(ll(e,t,n),e=e.sibling;null!==e;)ll(e,t,n),e=e.sibling}function ul(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(ul(e,t,n),e=e.sibling;null!==e;)ul(e,t,n),e=e.sibling}var cl=null,dl=!1;function fl(e,t,n){for(n=n.child;null!==n;)pl(e,t,n),n=n.sibling}function pl(e,t,n){if(it&&"function"==typeof it.onCommitFiberUnmount)try{it.onCommitFiberUnmount(ot,n)}catch(e){}switch(n.tag){case 5:Ks||Js(n,t);case 6:var r=cl,o=dl;cl=null,fl(e,t,n),dl=o,null!==(cl=r)&&(dl?(e=cl,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):cl.removeChild(n.stateNode));break;case 18:null!==cl&&(dl?(e=cl,n=n.stateNode,8===e.nodeType?lo(e.parentNode,n):1===e.nodeType&&lo(e,n),Wt(e)):lo(cl,n.stateNode));break;case 4:r=cl,o=dl,cl=n.stateNode.containerInfo,dl=!0,fl(e,t,n),cl=r,dl=o;break;case 0:case 11:case 14:case 15:if(!Ks&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,void 0!==a&&(2&i||4&i)&&el(n,t,a),o=o.next}while(o!==r)}fl(e,t,n);break;case 1:if(!Ks&&(Js(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){ku(n,t,e)}fl(e,t,n);break;case 21:fl(e,t,n);break;case 22:1&n.mode?(Ks=(r=Ks)||null!==n.memoizedState,fl(e,t,n),Ks=r):fl(e,t,n);break;default:fl(e,t,n)}}function hl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Qs),t.forEach(function(t){var r=Ou.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function ml(e,t){var r=t.deletions;if(null!==r)for(var o=0;o<r.length;o++){var i=r[o];try{var a=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 5:cl=l.stateNode,dl=!1;break e;case 3:case 4:cl=l.stateNode.containerInfo,dl=!0;break e}l=l.return}if(null===cl)throw Error(n(160));pl(a,s,i),cl=null,dl=!1;var u=i.alternate;null!==u&&(u.return=null),i.return=null}catch(e){ku(i,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)gl(t,e),t=t.sibling}function gl(e,t){var r=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ml(t,e),vl(e),4&o){try{nl(3,e,e.return),rl(3,e)}catch(t){ku(e,e.return,t)}try{nl(5,e,e.return)}catch(t){ku(e,e.return,t)}}break;case 1:ml(t,e),vl(e),512&o&&null!==r&&Js(r,r.return);break;case 5:if(ml(t,e),vl(e),512&o&&null!==r&&Js(r,r.return),32&e.flags){var i=e.stateNode;try{fe(i,"")}catch(t){ku(e,e.return,t)}}if(4&o&&null!=(i=e.stateNode)){var a=e.memoizedProps,s=null!==r?r.memoizedProps:a,l=e.type,u=e.updateQueue;if(e.updateQueue=null,null!==u)try{"input"===l&&"radio"===a.type&&null!=a.name&&Z(i,a),ye(l,s);var c=ye(l,a);for(s=0;s<u.length;s+=2){var d=u[s],f=u[s+1];"style"===d?ge(i,f):"dangerouslySetInnerHTML"===d?de(i,f):"children"===d?fe(i,f):b(i,d,f,c)}switch(l){case"input":J(i,a);break;case"textarea":ae(i,a);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var h=a.value;null!=h?re(i,!!a.multiple,h,!1):p!==!!a.multiple&&(null!=a.defaultValue?re(i,!!a.multiple,a.defaultValue,!0):re(i,!!a.multiple,a.multiple?[]:"",!1))}i[ho]=a}catch(t){ku(e,e.return,t)}}break;case 6:if(ml(t,e),vl(e),4&o){if(null===e.stateNode)throw Error(n(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(t){ku(e,e.return,t)}}break;case 3:if(ml(t,e),vl(e),4&o&&null!==r&&r.memoizedState.isDehydrated)try{Wt(t.containerInfo)}catch(t){ku(e,e.return,t)}break;case 4:default:ml(t,e),vl(e);break;case 13:ml(t,e),vl(e),8192&(i=e.child).flags&&(a=null!==i.memoizedState,i.stateNode.isHidden=a,!a||null!==i.alternate&&null!==i.alternate.memoizedState||(Bl=Qe())),4&o&&hl(e);break;case 22:if(d=null!==r&&null!==r.memoizedState,1&e.mode?(Ks=(c=Ks)||d,ml(t,e),Ks=c):ml(t,e),vl(e),8192&o){if(c=null!==e.memoizedState,(e.stateNode.isHidden=c)&&!d&&1&e.mode)for(Zs=e,d=e.child;null!==d;){for(f=Zs=d;null!==Zs;){switch(h=(p=Zs).child,p.tag){case 0:case 11:case 14:case 15:nl(4,p,p.return);break;case 1:Js(p,p.return);var m=p.stateNode;if("function"==typeof m.componentWillUnmount){o=p,r=p.return;try{t=o,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(e){ku(o,r,e)}}break;case 5:Js(p,p.return);break;case 22:if(null!==p.memoizedState){xl(f);continue}}null!==h?(h.return=p,Zs=h):xl(f)}d=d.sibling}e:for(d=null,f=e;;){if(5===f.tag){if(null===d){d=f;try{i=f.stateNode,c?"function"==typeof(a=i.style).setProperty?a.setProperty("display","none","important"):a.display="none":(l=f.stateNode,s=null!=(u=f.memoizedProps.style)&&u.hasOwnProperty("display")?u.display:null,l.style.display=me("display",s))}catch(t){ku(e,e.return,t)}}}else if(6===f.tag){if(null===d)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(t){ku(e,e.return,t)}}else if((22!==f.tag&&23!==f.tag||null===f.memoizedState||f===e)&&null!==f.child){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;null===f.sibling;){if(null===f.return||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:ml(t,e),vl(e),4&o&&hl(e);case 21:}}function vl(e){var t=e.flags;if(2&t){try{e:{for(var r=e.return;null!==r;){if(al(r)){var o=r;break e}r=r.return}throw Error(n(160))}switch(o.tag){case 5:var i=o.stateNode;32&o.flags&&(fe(i,""),o.flags&=-33),ul(e,sl(e),i);break;case 3:case 4:var a=o.stateNode.containerInfo;ll(e,sl(e),a);break;default:throw Error(n(161))}}catch(t){ku(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function bl(e,t,n){Zs=e,yl(e)}function yl(e,t,n){for(var r=!!(1&e.mode);null!==Zs;){var o=Zs,i=o.child;if(22===o.tag&&r){var a=null!==o.memoizedState||Xs;if(!a){var s=o.alternate,l=null!==s&&null!==s.memoizedState||Ks;s=Xs;var u=Ks;if(Xs=a,(Ks=l)&&!u)for(Zs=o;null!==Zs;)l=(a=Zs).child,22===a.tag&&null!==a.memoizedState?Sl(o):null!==l?(l.return=a,Zs=l):Sl(o);for(;null!==i;)Zs=i,yl(i),i=i.sibling;Zs=o,Xs=s,Ks=u}wl(e)}else 8772&o.subtreeFlags&&null!==i?(i.return=o,Zs=i):wl(e)}}function wl(e){for(;null!==Zs;){var t=Zs;if(8772&t.flags){var r=t.alternate;try{if(8772&t.flags)switch(t.tag){case 0:case 11:case 15:Ks||rl(5,t);break;case 1:var o=t.stateNode;if(4&t.flags&&!Ks)if(null===r)o.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:ns(t.type,r.memoizedProps);o.componentDidUpdate(i,r.memoizedState,o.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;null!==a&&Hi(t,a,o);break;case 3:var s=t.updateQueue;if(null!==s){if(r=null,null!==t.child)switch(t.child.tag){case 5:case 1:r=t.child.stateNode}Hi(t,s,r)}break;case 5:var l=t.stateNode;if(null===r&&4&t.flags){r=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&r.focus();break;case"img":u.src&&(r.src=u.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var c=t.alternate;if(null!==c){var d=c.memoizedState;if(null!==d){var f=d.dehydrated;null!==f&&Wt(f)}}}break;default:throw Error(n(163))}Ks||512&t.flags&&ol(t)}catch(e){ku(t,t.return,e)}}if(t===e){Zs=null;break}if(null!==(r=t.sibling)){r.return=t.return,Zs=r;break}Zs=t.return}}function xl(e){for(;null!==Zs;){var t=Zs;if(t===e){Zs=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Zs=n;break}Zs=t.return}}function Sl(e){for(;null!==Zs;){var t=Zs;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{rl(4,t)}catch(e){ku(t,n,e)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var o=t.return;try{r.componentDidMount()}catch(e){ku(t,o,e)}}var i=t.return;try{ol(t)}catch(e){ku(t,i,e)}break;case 5:var a=t.return;try{ol(t)}catch(e){ku(t,a,e)}}}catch(e){ku(t,t.return,e)}if(t===e){Zs=null;break}var s=t.sibling;if(null!==s){s.return=t.return,Zs=s;break}Zs=t.return}}var El,kl=Math.ceil,Cl=w.ReactCurrentDispatcher,Tl=w.ReactCurrentOwner,Pl=w.ReactCurrentBatchConfig,Ol=0,Ml=null,Nl=null,_l=0,Rl=0,zl=Co(0),Il=0,Dl=null,Ll=0,Al=0,Fl=0,$l=null,jl=null,Bl=0,Wl=1/0,Ul=null,Hl=!1,Vl=null,Yl=null,ql=!1,Gl=null,Xl=0,Kl=0,Ql=null,Zl=-1,Jl=0;function eu(){return 6&Ol?Qe():-1!==Zl?Zl:Zl=Qe()}function tu(e){return 1&e.mode?2&Ol&&0!==_l?_l&-_l:null!==gi.transition?(0===Jl&&(Jl=mt()),Jl):0!==(e=yt)?e:e=void 0===(e=window.event)?16:Kt(e.type):1}function nu(e,t,r,o){if(50<Kl)throw Kl=0,Ql=null,Error(n(185));vt(e,r,o),2&Ol&&e===Ml||(e===Ml&&(!(2&Ol)&&(Al|=r),4===Il&&su(e,_l)),ru(e,o),1===r&&0===Ol&&!(1&t.mode)&&(Wl=Qe()+500,jo&&Uo()))}function ru(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-at(i),s=1<<a,l=o[a];-1===l?0!==(s&n)&&0===(s&r)||(o[a]=pt(s,t)):l<=t&&(e.expiredLanes|=s),i&=~s}}(e,t);var r=ft(e,e===Ml?_l:0);if(0===r)null!==n&&Ge(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&Ge(n),1===t)0===e.tag?function(e){jo=!0,Wo(e)}(lu.bind(null,e)):Wo(lu.bind(null,e)),ao(function(){!(6&Ol)&&Uo()}),n=null;else{switch(wt(r)){case 1:n=Je;break;case 4:n=et;break;case 16:default:n=tt;break;case 536870912:n=rt}n=Mu(n,ou.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ou(e,t){if(Zl=-1,Jl=0,6&Ol)throw Error(n(327));var r=e.callbackNode;if(Su()&&e.callbackNode!==r)return null;var o=ft(e,e===Ml?_l:0);if(0===o)return null;if(30&o||0!==(o&e.expiredLanes)||t)t=gu(e,o);else{t=o;var i=Ol;Ol|=2;var a=hu();for(Ml===e&&_l===t||(Ul=null,Wl=Qe()+500,fu(e,t));;)try{bu();break}catch(t){pu(e,t)}Pi(),Cl.current=a,Ol=i,null!==Nl?t=0:(Ml=null,_l=0,t=Il)}if(0!==t){if(2===t&&(0!==(i=ht(e))&&(o=i,t=iu(e,i))),1===t)throw r=Dl,fu(e,0),su(e,o),ru(e,Qe()),r;if(6===t)su(e,o);else{if(i=e.current.alternate,!(30&o||function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!sr(i(),o))return!1}catch(e){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)||(t=gu(e,o),2===t&&(a=ht(e),0!==a&&(o=a,t=iu(e,a))),1!==t)))throw r=Dl,fu(e,0),su(e,o),ru(e,Qe()),r;switch(e.finishedWork=i,e.finishedLanes=o,t){case 0:case 1:throw Error(n(345));case 2:case 5:xu(e,jl,Ul);break;case 3:if(su(e,o),(130023424&o)===o&&10<(t=Bl+500-Qe())){if(0!==ft(e,0))break;if(((i=e.suspendedLanes)&o)!==o){eu(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ro(xu.bind(null,e,jl,Ul),t);break}xu(e,jl,Ul);break;case 4:if(su(e,o),(4194240&o)===o)break;for(t=e.eventTimes,i=-1;0<o;){var s=31-at(o);a=1<<s,(s=t[s])>i&&(i=s),o&=~a}if(o=i,10<(o=(120>(o=Qe()-o)?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*kl(o/1960))-o)){e.timeoutHandle=ro(xu.bind(null,e,jl,Ul),o);break}xu(e,jl,Ul);break;default:throw Error(n(329))}}}return ru(e,Qe()),e.callbackNode===r?ou.bind(null,e):null}function iu(e,t){var n=$l;return e.current.memoizedState.isDehydrated&&(fu(e,t).flags|=256),2!==(e=gu(e,t))&&(t=jl,jl=n,null!==t&&au(t)),e}function au(e){null===jl?jl=e:jl.push.apply(jl,e)}function su(e,t){for(t&=~Fl,t&=~Al,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-at(t),r=1<<n;e[n]=-1,t&=~r}}function lu(e){if(6&Ol)throw Error(n(327));Su();var t=ft(e,0);if(!(1&t))return ru(e,Qe()),null;var r=gu(e,t);if(0!==e.tag&&2===r){var o=ht(e);0!==o&&(t=o,r=iu(e,o))}if(1===r)throw r=Dl,fu(e,0),su(e,t),ru(e,Qe()),r;if(6===r)throw Error(n(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,xu(e,jl,Ul),ru(e,Qe()),null}function uu(e,t){var n=Ol;Ol|=1;try{return e(t)}finally{0===(Ol=n)&&(Wl=Qe()+500,jo&&Uo())}}function cu(e){null!==Gl&&0===Gl.tag&&!(6&Ol)&&Su();var t=Ol;Ol|=1;var n=Pl.transition,r=yt;try{if(Pl.transition=null,yt=1,e)return e()}finally{yt=r,Pl.transition=n,!(6&(Ol=t))&&Uo()}}function du(){Rl=zl.current,To(zl)}function fu(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,oo(n)),null!==Nl)for(n=Nl.return;null!==n;){var r=n;switch(ni(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&Io();break;case 3:Qi(),To(No),To(Mo),ra();break;case 5:Ji(r);break;case 4:Qi();break;case 13:case 19:To(ea);break;case 10:Oi(r.type._context);break;case 22:case 23:du()}n=n.return}if(Ml=e,Nl=e=zu(e.current,null),_l=Rl=t,Il=0,Dl=null,Fl=Al=Ll=0,jl=$l=null,null!==Ri){for(t=0;t<Ri.length;t++)if(null!==(r=(n=Ri[t]).interleaved)){n.interleaved=null;var o=r.next,i=n.pending;if(null!==i){var a=i.next;i.next=o,r.next=a}n.pending=r}Ri=null}return e}function pu(e,t){for(;;){var r=Nl;try{if(Pi(),oa.current=Za,ca){for(var o=sa.memoizedState;null!==o;){var i=o.queue;null!==i&&(i.pending=null),o=o.next}ca=!1}if(aa=0,ua=la=sa=null,da=!1,fa=0,Tl.current=null,null===r||null===r.return){Il=1,Dl=t,Nl=null;break}e:{var a=e,s=r.return,l=r,u=t;if(t=_l,l.flags|=32768,null!==u&&"object"==typeof u&&"function"==typeof u.then){var c=u,d=l,f=d.tag;if(!(1&d.mode||0!==f&&11!==f&&15!==f)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var h=gs(s);if(null!==h){h.flags&=-257,vs(h,s,l,0,t),1&h.mode&&ms(a,c,t),u=c;var m=(t=h).updateQueue;if(null===m){var g=new Set;g.add(u),t.updateQueue=g}else m.add(u);break e}if(!(1&t)){ms(a,c,t),mu();break e}u=Error(n(426))}else if(ii&&1&l.mode){var v=gs(s);if(null!==v){!(65536&v.flags)&&(v.flags|=256),vs(v,s,l,0,t),mi(us(u,l));break e}}a=u=us(u,l),4!==Il&&(Il=2),null===$l?$l=[a]:$l.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t,Wi(a,ps(0,u,t));break e;case 1:l=u;var b=a.type,y=a.stateNode;if(!(128&a.flags||"function"!=typeof b.getDerivedStateFromError&&(null===y||"function"!=typeof y.componentDidCatch||null!==Yl&&Yl.has(y)))){a.flags|=65536,t&=-t,a.lanes|=t,Wi(a,hs(a,l,t));break e}}a=a.return}while(null!==a)}wu(r)}catch(e){t=e,Nl===r&&null!==r&&(Nl=r=r.return);continue}break}}function hu(){var e=Cl.current;return Cl.current=Za,null===e?Za:e}function mu(){0!==Il&&3!==Il&&2!==Il||(Il=4),null===Ml||!(268435455&Ll)&&!(268435455&Al)||su(Ml,_l)}function gu(e,t){var r=Ol;Ol|=2;var o=hu();for(Ml===e&&_l===t||(Ul=null,fu(e,t));;)try{vu();break}catch(t){pu(e,t)}if(Pi(),Ol=r,Cl.current=o,null!==Nl)throw Error(n(261));return Ml=null,_l=0,Il}function vu(){for(;null!==Nl;)yu(Nl)}function bu(){for(;null!==Nl&&!Xe();)yu(Nl)}function yu(e){var t=El(e.alternate,e,Rl);e.memoizedProps=e.pendingProps,null===t?wu(e):Nl=t,Tl.current=null}function wu(e){var t=e;do{var n=t.alternate;if(e=t.return,32768&t.flags){if(null!==(n=Gs(n,t)))return n.flags&=32767,void(Nl=n);if(null===e)return Il=6,void(Nl=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}else if(null!==(n=qs(n,t,Rl)))return void(Nl=n);if(null!==(t=t.sibling))return void(Nl=t);Nl=t=e}while(null!==t);0===Il&&(Il=5)}function xu(e,t,r){var o=yt,i=Pl.transition;try{Pl.transition=null,yt=1,function(e,t,r,o){do{Su()}while(null!==Gl);if(6&Ol)throw Error(n(327));r=e.finishedWork;var i=e.finishedLanes;if(null===r)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(n(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-at(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}(e,a),e===Ml&&(Nl=Ml=null,_l=0),!(2064&r.subtreeFlags)&&!(2064&r.flags)||ql||(ql=!0,Mu(tt,function(){return Su(),null})),a=!!(15990&r.flags),!!(15990&r.subtreeFlags)||a){a=Pl.transition,Pl.transition=null;var s=yt;yt=1;var l=Ol;Ol|=4,Tl.current=null,function(e,t){if(eo=Ht,pr(e=fr())){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{var o=(r=(r=e.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(o&&0!==o.rangeCount){r=o.anchorNode;var i=o.anchorOffset,a=o.focusNode;o=o.focusOffset;try{r.nodeType,a.nodeType}catch(e){r=null;break e}var s=0,l=-1,u=-1,c=0,d=0,f=e,p=null;t:for(;;){for(var h;f!==r||0!==i&&3!==f.nodeType||(l=s+i),f!==a||0!==o&&3!==f.nodeType||(u=s+o),3===f.nodeType&&(s+=f.nodeValue.length),null!==(h=f.firstChild);)p=f,f=h;for(;;){if(f===e)break t;if(p===r&&++c===i&&(l=s),p===a&&++d===o&&(u=s),null!==(h=f.nextSibling))break;p=(f=p).parentNode}f=h}r=-1===l||-1===u?null:{start:l,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(to={focusedElem:e,selectionRange:r},Ht=!1,Zs=t;null!==Zs;)if(e=(t=Zs).child,1028&t.subtreeFlags&&null!==e)e.return=t,Zs=e;else for(;null!==Zs;){t=Zs;try{var m=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==m){var g=m.memoizedProps,v=m.memoizedState,b=t.stateNode,y=b.getSnapshotBeforeUpdate(t.elementType===t.type?g:ns(t.type,g),v);b.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var w=t.stateNode.containerInfo;1===w.nodeType?w.textContent="":9===w.nodeType&&w.documentElement&&w.removeChild(w.documentElement);break;default:throw Error(n(163))}}catch(e){ku(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,Zs=e;break}Zs=t.return}m=tl,tl=!1}(e,r),gl(r,e),hr(to),Ht=!!eo,to=eo=null,e.current=r,bl(r),Ke(),Ol=l,yt=s,Pl.transition=a}else e.current=r;if(ql&&(ql=!1,Gl=e,Xl=i),a=e.pendingLanes,0===a&&(Yl=null),function(e){if(it&&"function"==typeof it.onCommitFiberRoot)try{it.onCommitFiberRoot(ot,e,void 0,!(128&~e.current.flags))}catch(e){}}(r.stateNode),ru(e,Qe()),null!==t)for(o=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],o(i.value,{componentStack:i.stack,digest:i.digest});if(Hl)throw Hl=!1,e=Vl,Vl=null,e;!!(1&Xl)&&0!==e.tag&&Su(),a=e.pendingLanes,1&a?e===Ql?Kl++:(Kl=0,Ql=e):Kl=0,Uo()}(e,t,r,o)}finally{Pl.transition=i,yt=o}return null}function Su(){if(null!==Gl){var e=wt(Xl),t=Pl.transition,r=yt;try{if(Pl.transition=null,yt=16>e?16:e,null===Gl)var o=!1;else{if(e=Gl,Gl=null,Xl=0,6&Ol)throw Error(n(331));var i=Ol;for(Ol|=4,Zs=e.current;null!==Zs;){var a=Zs,s=a.child;if(16&Zs.flags){var l=a.deletions;if(null!==l){for(var u=0;u<l.length;u++){var c=l[u];for(Zs=c;null!==Zs;){var d=Zs;switch(d.tag){case 0:case 11:case 15:nl(8,d,a)}var f=d.child;if(null!==f)f.return=d,Zs=f;else for(;null!==Zs;){var p=(d=Zs).sibling,h=d.return;if(il(d),d===c){Zs=null;break}if(null!==p){p.return=h,Zs=p;break}Zs=h}}}var m=a.alternate;if(null!==m){var g=m.child;if(null!==g){m.child=null;do{var v=g.sibling;g.sibling=null,g=v}while(null!==g)}}Zs=a}}if(2064&a.subtreeFlags&&null!==s)s.return=a,Zs=s;else e:for(;null!==Zs;){if(2048&(a=Zs).flags)switch(a.tag){case 0:case 11:case 15:nl(9,a,a.return)}var b=a.sibling;if(null!==b){b.return=a.return,Zs=b;break e}Zs=a.return}}var y=e.current;for(Zs=y;null!==Zs;){var w=(s=Zs).child;if(2064&s.subtreeFlags&&null!==w)w.return=s,Zs=w;else e:for(s=y;null!==Zs;){if(2048&(l=Zs).flags)try{switch(l.tag){case 0:case 11:case 15:rl(9,l)}}catch(e){ku(l,l.return,e)}if(l===s){Zs=null;break e}var x=l.sibling;if(null!==x){x.return=l.return,Zs=x;break e}Zs=l.return}}if(Ol=i,Uo(),it&&"function"==typeof it.onPostCommitFiberRoot)try{it.onPostCommitFiberRoot(ot,e)}catch(e){}o=!0}return o}finally{yt=r,Pl.transition=t}}return!1}function Eu(e,t,n){e=ji(e,t=ps(0,t=us(n,t),1),1),t=eu(),null!==e&&(vt(e,1,t),ru(e,t))}function ku(e,t,n){if(3===e.tag)Eu(e,e,n);else for(;null!==t;){if(3===t.tag){Eu(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Yl||!Yl.has(r))){t=ji(t,e=hs(t,e=us(n,e),1),1),e=eu(),null!==t&&(vt(t,1,e),ru(t,e));break}}t=t.return}}function Cu(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=eu(),e.pingedLanes|=e.suspendedLanes&n,Ml===e&&(_l&n)===n&&(4===Il||3===Il&&(130023424&_l)===_l&&500>Qe()-Bl?fu(e,0):Fl|=n),ru(e,t)}function Tu(e,t){0===t&&(1&e.mode?(t=ct,!(130023424&(ct<<=1))&&(ct=4194304)):t=1);var n=eu();null!==(e=Di(e,t))&&(vt(e,t,n),ru(e,n))}function Pu(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Tu(e,n)}function Ou(e,t){var r=0;switch(e.tag){case 13:var o=e.stateNode,i=e.memoizedState;null!==i&&(r=i.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(n(314))}null!==o&&o.delete(t),Tu(e,r)}function Mu(e,t){return qe(e,t)}function Nu(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _u(e,t,n,r){return new Nu(e,t,n,r)}function Ru(e){return!(!(e=e.prototype)||!e.isReactComponent)}function zu(e,t){var n=e.alternate;return null===n?((n=_u(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Iu(e,t,r,o,i,a){var s=2;if(o=e,"function"==typeof e)Ru(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case k:return Du(r.children,i,a,t);case C:s=8,i|=8;break;case T:return(e=_u(12,r,t,2|i)).elementType=T,e.lanes=a,e;case N:return(e=_u(13,r,t,i)).elementType=N,e.lanes=a,e;case _:return(e=_u(19,r,t,i)).elementType=_,e.lanes=a,e;case I:return Lu(r,i,a,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case P:s=10;break e;case O:s=9;break e;case M:s=11;break e;case R:s=14;break e;case z:s=16,o=null;break e}throw Error(n(130,null==e?e:typeof e,""))}return(t=_u(s,r,t,i)).elementType=e,t.type=o,t.lanes=a,t}function Du(e,t,n,r){return(e=_u(7,e,r,t)).lanes=n,e}function Lu(e,t,n,r){return(e=_u(22,e,r,t)).elementType=I,e.lanes=n,e.stateNode={isHidden:!1},e}function Au(e,t,n){return(e=_u(6,e,null,t)).lanes=n,e}function Fu(e,t,n){return(t=_u(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function $u(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gt(0),this.expirationTimes=gt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gt(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function ju(e,t,n,r,o,i,a,s,l){return e=new $u(e,t,n,s,l),1===t?(t=1,!0===i&&(t|=8)):t=0,i=_u(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ai(i),e}function Bu(e){if(!e)return Oo;e:{if(We(e=e._reactInternals)!==e||1!==e.tag)throw Error(n(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(zo(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(n(171))}if(1===e.tag){var r=e.type;if(zo(r))return Lo(e,r,t)}return t}function Wu(e,t,n,r,o,i,a,s,l){return(e=ju(n,r,!0,e,0,i,0,s,l)).context=Bu(null),n=e.current,(i=$i(r=eu(),o=tu(n))).callback=null!=t?t:null,ji(n,i,o),e.current.lanes=o,vt(e,o,r),ru(e,r),e}function Uu(e,t,n,r){var o=t.current,i=eu(),a=tu(o);return n=Bu(n),null===t.context?t.context=n:t.pendingContext=n,(t=$i(i,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=ji(o,t,a))&&(nu(e,o,a,i),Bi(e,o,a)),a}function Hu(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Vu(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Yu(e,t){Vu(e,t),(e=e.alternate)&&Vu(e,t)}El=function(e,t,r){if(null!==e)if(e.memoizedProps!==t.pendingProps||No.current)ys=!0;else{if(0===(e.lanes&r)&&!(128&t.flags))return ys=!1,function(e,t,n){switch(t.tag){case 3:Ms(t),hi();break;case 5:Zi(t);break;case 1:zo(t.type)&&Ao(t);break;case 4:Ki(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Po(Ei,r._currentValue),r._currentValue=o;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(Po(ea,1&ea.current),t.flags|=128,null):0!==(n&t.child.childLanes)?As(e,t,n):(Po(ea,1&ea.current),null!==(e=Hs(e,t,n))?e.sibling:null);Po(ea,1&ea.current);break;case 19:if(r=0!==(n&t.childLanes),128&e.flags){if(r)return Ws(e,t,n);t.flags|=128}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),Po(ea,ea.current),r)break;return null;case 22:case 23:return t.lanes=0,ks(e,t,n)}return Hs(e,t,n)}(e,t,r);ys=!!(131072&e.flags)}else ys=!1,ii&&1048576&t.flags&&ei(t,qo,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;Us(e,t),e=t.pendingProps;var i=Ro(t,Mo.current);Ni(t,r),i=ga(null,t,o,e,i,r);var a=va();return t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,zo(o)?(a=!0,Ao(t)):a=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Ai(t),i.updater=os,t.stateNode=i,i._reactInternals=t,ls(t,o,e,r),t=Os(null,t,o,!0,a,r)):(t.tag=0,ii&&a&&ti(t),ws(null,t,i,r),t=t.child),t;case 16:o=t.elementType;e:{switch(Us(e,t),e=t.pendingProps,o=(i=o._init)(o._payload),t.type=o,i=t.tag=function(e){if("function"==typeof e)return Ru(e)?1:0;if(null!=e){if((e=e.$$typeof)===M)return 11;if(e===R)return 14}return 2}(o),e=ns(o,e),i){case 0:t=Ts(null,t,o,e,r);break e;case 1:t=Ps(null,t,o,e,r);break e;case 11:t=xs(null,t,o,e,r);break e;case 14:t=Ss(null,t,o,ns(o.type,e),r);break e}throw Error(n(306,o,""))}return t;case 0:return o=t.type,i=t.pendingProps,Ts(e,t,o,i=t.elementType===o?i:ns(o,i),r);case 1:return o=t.type,i=t.pendingProps,Ps(e,t,o,i=t.elementType===o?i:ns(o,i),r);case 3:e:{if(Ms(t),null===e)throw Error(n(387));o=t.pendingProps,i=(a=t.memoizedState).element,Fi(e,t),Ui(t,o,null,r);var s=t.memoizedState;if(o=s.element,a.isDehydrated){if(a={element:o,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=Ns(e,t,o,r,i=us(Error(n(423)),t));break e}if(o!==i){t=Ns(e,t,o,r,i=us(Error(n(424)),t));break e}for(oi=uo(t.stateNode.containerInfo.firstChild),ri=t,ii=!0,ai=null,r=Si(t,null,o,r),t.child=r;r;)r.flags=-3&r.flags|4096,r=r.sibling}else{if(hi(),o===i){t=Hs(e,t,r);break e}ws(e,t,o,r)}t=t.child}return t;case 5:return Zi(t),null===e&&ci(t),o=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,s=i.children,no(o,i)?s=null:null!==a&&no(o,a)&&(t.flags|=32),Cs(e,t),ws(e,t,s,r),t.child;case 6:return null===e&&ci(t),null;case 13:return As(e,t,r);case 4:return Ki(t,t.stateNode.containerInfo),o=t.pendingProps,null===e?t.child=xi(t,null,o,r):ws(e,t,o,r),t.child;case 11:return o=t.type,i=t.pendingProps,xs(e,t,o,i=t.elementType===o?i:ns(o,i),r);case 7:return ws(e,t,t.pendingProps,r),t.child;case 8:case 12:return ws(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(o=t.type._context,i=t.pendingProps,a=t.memoizedProps,s=i.value,Po(Ei,o._currentValue),o._currentValue=s,null!==a)if(sr(a.value,s)){if(a.children===i.children&&!No.current){t=Hs(e,t,r);break e}}else for(null!==(a=t.child)&&(a.return=t);null!==a;){var l=a.dependencies;if(null!==l){s=a.child;for(var u=l.firstContext;null!==u;){if(u.context===o){if(1===a.tag){(u=$i(-1,r&-r)).tag=2;var c=a.updateQueue;if(null!==c){var d=(c=c.shared).pending;null===d?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}a.lanes|=r,null!==(u=a.alternate)&&(u.lanes|=r),Mi(a.return,r,t),l.lanes|=r;break}u=u.next}}else if(10===a.tag)s=a.type===t.type?null:a.child;else if(18===a.tag){if(null===(s=a.return))throw Error(n(341));s.lanes|=r,null!==(l=s.alternate)&&(l.lanes|=r),Mi(s,r,t),s=a.sibling}else s=a.child;if(null!==s)s.return=a;else for(s=a;null!==s;){if(s===t){s=null;break}if(null!==(a=s.sibling)){a.return=s.return,s=a;break}s=s.return}a=s}ws(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,o=t.pendingProps.children,Ni(t,r),o=o(i=_i(i)),t.flags|=1,ws(e,t,o,r),t.child;case 14:return i=ns(o=t.type,t.pendingProps),Ss(e,t,o,i=ns(o.type,i),r);case 15:return Es(e,t,t.type,t.pendingProps,r);case 17:return o=t.type,i=t.pendingProps,i=t.elementType===o?i:ns(o,i),Us(e,t),t.tag=1,zo(o)?(e=!0,Ao(t)):e=!1,Ni(t,r),as(t,o,i),ls(t,o,i,r),Os(null,t,o,!0,e,r);case 19:return Ws(e,t,r);case 22:return ks(e,t,r)}throw Error(n(156,t.tag))};var qu="function"==typeof reportError?reportError:function(e){console.error(e)};function Gu(e){this._internalRoot=e}function Xu(e){this._internalRoot=e}function Ku(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Qu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Zu(){}function Ju(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i;if("function"==typeof o){var s=o;o=function(){var e=Hu(a);s.call(e)}}Uu(t,a,e,o)}else a=function(e,t,n,r,o){if(o){if("function"==typeof r){var i=r;r=function(){var e=Hu(a);i.call(e)}}var a=Wu(t,r,e,0,null,!1,0,"",Zu);return e._reactRootContainer=a,e[mo]=a.current,Wr(8===e.nodeType?e.parentNode:e),cu(),a}for(;o=e.lastChild;)e.removeChild(o);if("function"==typeof r){var s=r;r=function(){var e=Hu(l);s.call(e)}}var l=ju(e,0,!1,null,0,!1,0,"",Zu);return e._reactRootContainer=l,e[mo]=l.current,Wr(8===e.nodeType?e.parentNode:e),cu(function(){Uu(t,l,n,r)}),l}(n,t,e,o,r);return Hu(a)}Xu.prototype.render=Gu.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(n(409));Uu(e,t,null,null)},Xu.prototype.unmount=Gu.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;cu(function(){Uu(null,e,null,null)}),t[mo]=null}},Xu.prototype.unstable_scheduleHydration=function(e){if(e){var t=kt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<zt.length&&0!==t&&t<zt[n].priority;n++);zt.splice(n,0,e),0===n&&At(e)}},xt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=dt(t.pendingLanes);0!==n&&(bt(t,1|n),ru(t,Qe()),!(6&Ol)&&(Wl=Qe()+500,Uo()))}break;case 13:cu(function(){var t=Di(e,1);if(null!==t){var n=eu();nu(t,e,1,n)}}),Yu(e,1)}},St=function(e){if(13===e.tag){var t=Di(e,134217728);if(null!==t)nu(t,e,134217728,eu());Yu(e,134217728)}},Et=function(e){if(13===e.tag){var t=tu(e),n=Di(e,t);if(null!==n)nu(n,e,t,eu());Yu(e,t)}},kt=function(){return yt},Ct=function(e,t){var n=yt;try{return yt=e,t()}finally{yt=n}},Se=function(e,t,r){switch(t){case"input":if(J(e,r),t=r.name,"radio"===r.type&&null!=t){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var o=r[t];if(o!==e&&o.form===e.form){var i=So(o);if(!i)throw Error(n(90));G(o),J(o,i)}}}break;case"textarea":ae(e,r);break;case"select":null!=(t=r.value)&&re(e,!!r.multiple,t,!1)}},Oe=uu,Me=cu;var ec={usingClientEntryPoint:!1,Events:[wo,xo,So,Te,Pe,uu]},tc={findFiberByHostInstance:yo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},nc={bundleType:tc.bundleType,version:tc.version,rendererPackageName:tc.rendererPackageName,rendererConfig:tc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Ve(e))?null:e.stateNode},findFiberByHostInstance:tc.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rc.isDisabled&&rc.supportsFiber)try{ot=rc.inject(nc),it=rc}catch(e){}}return y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ec,y.createPortal=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Ku(t))throw Error(n(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:E,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,r)},y.createRoot=function(e,t){if(!Ku(e))throw Error(n(299));var r=!1,o="",i=qu;return null!=t&&(!0===t.unstable_strictMode&&(r=!0),void 0!==t.identifierPrefix&&(o=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError)),t=ju(e,1,!1,null,0,r,0,o,i),e[mo]=t.current,Wr(8===e.nodeType?e.parentNode:e),new Gu(t)},y.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(n(188));throw e=Object.keys(e).join(","),Error(n(268,e))}return e=null===(e=Ve(t))?null:e.stateNode},y.flushSync=function(e){return cu(e)},y.hydrate=function(e,t,r){if(!Qu(t))throw Error(n(200));return Ju(null,e,t,!0,r)},y.hydrateRoot=function(e,t,r){if(!Ku(e))throw Error(n(405));var o=null!=r&&r.hydratedSources||null,i=!1,a="",s=qu;if(null!=r&&(!0===r.unstable_strictMode&&(i=!0),void 0!==r.identifierPrefix&&(a=r.identifierPrefix),void 0!==r.onRecoverableError&&(s=r.onRecoverableError)),t=Wu(t,null,e,1,null!=r?r:null,i,0,a,s),e[mo]=t.current,Wr(e),o)for(e=0;e<o.length;e++)i=(i=(r=o[e])._getVersion)(r._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new Xu(t)},y.render=function(e,t,r){if(!Qu(t))throw Error(n(200));return Ju(null,e,t,!1,r)},y.unmountComponentAtNode=function(e){if(!Qu(e))throw Error(n(40));return!!e._reactRootContainer&&(cu(function(){Ju(null,null,e,!1,function(){e._reactRootContainer=null,e[mo]=null})}),!0)},y.unstable_batchedUpdates=uu,y.unstable_renderSubtreeIntoContainer=function(e,t,r,o){if(!Qu(r))throw Error(n(200));if(null==e||void 0===e._reactInternals)throw Error(n(38));return Ju(e,t,r,!1,o)},y.version="18.3.1-next-f1338f8080-20240426",y}function k(){if(f)return b.exports;return f=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),b.exports=E(),b.exports}var C=function(){if(p)return v;p=1;var e=k();return v.createRoot=e.createRoot,v.hydrateRoot=e.hydrateRoot,v}(),T=Object.defineProperty,P=(e,t,n)=>((e,t,n)=>t in e?T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);const O={stringify:e=>e.name,parse:(e,t,n)=>{const r=typeof window<"u"&&e in window?window[e]:typeof global<"u"&&e in global?global[e]:void 0;return"function"==typeof r?r.bind(n):void 0}},M={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},N={stringify:e=>`${e}`,parse:e=>parseFloat(e)},_={string:{stringify:e=>e,parse:e=>e},number:N,boolean:{stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},function:O,json:M};function R(e){return e.replace(/([a-z0-9])([A-Z])/g,(e,t,n)=>`${t}-${n.toLowerCase()}`)}const z=Symbol.for("r2wc.render"),I=Symbol.for("r2wc.connected"),D=Symbol.for("r2wc.context"),L=Symbol.for("r2wc.props");function A(e,t,n){const r=C.createRoot(e),o=m.createElement(t,n);return r.render(o),{root:r,ReactComponent:t}}function F({root:e,ReactComponent:t},n){const r=m.createElement(t,n);e.render(r)}function $({root:e}){e.unmount()}function j(e,t={}){return function(e,t,n){var r,o,i;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]),t.events||(t.events=[]);const a=Array.isArray(t.props)?t.props.slice():Object.keys(t.props),s=Array.isArray(t.events)?t.events.slice():Object.keys(t.events),l={},u={},c={},d={};for(const e of a){l[e]=Array.isArray(t.props)?"string":t.props[e];const n=R(e);c[e]=n,d[n]=e}for(const e of s)u[e]=Array.isArray(t.events)?{}:t.events[e];class f extends HTMLElement{constructor(){super(),P(this,i,!0),P(this,o),P(this,r,{}),P(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[L].container=this.container;for(const e of a){const t=c[e],n=this.getAttribute(t),r=l[e],o=r?_[r]:null;null!=o&&o.parse&&n&&(this[L][e]=o.parse(n,t,this))}for(const e of s)this[L][e]=t=>{const n=e.replace(/^on/,"").toLowerCase();this.dispatchEvent(new CustomEvent(n,{detail:t,...u[e]}))}}static get observedAttributes(){return Object.keys(d)}connectedCallback(){this[I]=!0,this[z]()}disconnectedCallback(){this[I]=!1,this[D]&&n.unmount(this[D]),delete this[D]}attributeChangedCallback(e,t,n){const r=d[e],o=l[r],i=o?_[o]:null;r in l&&null!=i&&i.parse&&n&&(this[L][r]=i.parse(n,e,this),this[z]())}[(i=I,o=D,r=L,z)](){this[I]&&(this[D]?n.update(this[D],this[L]):this[D]=n.mount(this.container,e,this[L]))}}for(const e of a){const t=c[e],n=l[e];Object.defineProperty(f.prototype,e,{enumerable:!0,configurable:!0,get(){return this[L][e]},set(r){this[L][e]=r;const o=n?_[n]:null;if(null!=o&&o.stringify){const e=o.stringify(r,t,this);this.getAttribute(t)!==e&&this.setAttribute(t,e)}else this[z]()}})}return f}(e,t,{mount:A,update:F,unmount:$})}var B,W,U,H,V,Y,q,G,X,K,Q=function(){return Q=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Q.apply(this,arguments)};function Z(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function J(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError,function(e){e.INSTA="INSTA",e.YOUTUBE="YOUTUBE",e.SQUARE="SQUARE"}(B||(B={})),function(e){e.MANY="MANY",e.ONE="ONE"}(W||(W={})),function(e){e.ALWAYS="ALWAYS",e.DAY="DAY",e.DISAPPEAR="DISAPPEAR",e.NONE="NONE"}(U||(U={})),function(e){e.POPUP="POPUP",e.PLATFORM="PLATFORM",e.TABLET="TABLET",e.GRID="GRID",e.VERTICAL="VERTICAL",e.HORIZONTAL="HORIZONTAL"}(H||(H={})),function(e){e.BOTTOM="BOTTOM",e.INNER="INNER"}(V||(V={})),function(e){e[e.PLATFORM=1]="PLATFORM",e[e.VERTICAL=2]="VERTICAL",e[e.PRODUCTS=3]="PRODUCTS",e[e.HORIZONTAL=4]="HORIZONTAL",e[e.TABLET=5]="TABLET"}(Y||(Y={})),function(e){e[e.UNLIVE=0]="UNLIVE",e[e.LIVE=1]="LIVE"}(q||(q={})),function(e){e[e.NOT_ON_SALE=0]="NOT_ON_SALE",e[e.ON_SALE=1]="ON_SALE"}(G||(G={})),function(e){e.LANDSCAPE="landscape",e.PORTRAIT="portrait"}(X||(X={})),function(e){e.LIVE="live",e.SHORTS="shorts",e.COLLECTION="collection"}(K||(K={}));const ee=e=>(document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}),te=()=>document.visibilityState,ne=()=>{throw Error("useVisibilityChange is a client-only hook")};function re(){return"visible"===h.useSyncExternalStore(ee,te,ne)}function oe(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=oe(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}const ie=e=>{const t=ue(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),ae(n,t)||le(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},ae=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?ae(e.slice(1),r):void 0;if(o)return o;if(0===t.validators.length)return;const i=e.join("-");return t.validators.find(({validator:e})=>e(i))?.classGroupId},se=/^\[(.+)\]$/,le=e=>{if(se.test(e)){const t=se.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},ue=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const e in n)ce(n[e],r,e,t);return r},ce=(e,t,n,r)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:de(t,e)).classGroupId=n)}if("function"==typeof e)return fe(e)?void ce(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach(([e,o])=>{ce(o,de(t,e),n,r)})})},de=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},fe=e=>e.isThemeGetter,pe=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(o(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):o(e,t)}}},he=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,o=0,i=0;for(let a=0;a<e.length;a++){let s=e[a];if(0===r&&0===o){if(":"===s){t.push(e.slice(i,a)),i=a+1;continue}if("/"===s){n=a;continue}}"["===s?r++:"]"===s?r--:"("===s?o++:")"===s&&o--}const a=0===t.length?e:e.substring(i),s=me(a);return{modifiers:t,hasImportantModifier:s!==a,baseClassName:s,maybePostfixModifierPosition:n&&n>i?n-i:void 0}};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},me=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,ge=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;const n=[];let r=[];return e.forEach(e=>{"["===e[0]||t[e]?(n.push(...r.sort(),e),r=[]):r.push(e)}),n.push(...r.sort()),n}},ve=/\s+/;function be(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=ye(e))&&(r&&(r+=" "),r+=t);return r}const ye=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ye(e[r]))&&(n&&(n+=" "),n+=t);return n};function we(e,...t){let n,r,o,i=function(s){const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:pe(e.cacheSize),parseClassName:he(e),sortModifiers:ge(e),...ie(e)}))(l),r=n.cache.get,o=n.cache.set,i=a,a(s)};function a(e){const t=r(e);if(t)return t;const i=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,a=[],s=e.trim().split(ve);let l="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{isExternal:u,modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(u){l=t+(l.length>0?" "+l:l);continue}let h=!!p,m=r(h?f.substring(0,p):f);if(!m){if(!h){l=t+(l.length>0?" "+l:l);continue}if(m=r(f),!m){l=t+(l.length>0?" "+l:l);continue}h=!1}const g=i(c).join(":"),v=d?g+"!":g,b=v+m;if(a.includes(b))continue;a.push(b);const y=o(m,h);for(let e=0;e<y.length;++e){const t=y[e];a.push(v+t)}l=t+(l.length>0?" "+l:l)}return l})(e,n);return o(e,i),i}return function(){return i(be.apply(null,arguments))}}const xe=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},Se=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ee=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ke=/^\d+\/\d+$/,Ce=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Te=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Pe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Oe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Me=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ne=e=>ke.test(e),_e=e=>!!e&&!Number.isNaN(Number(e)),Re=e=>!!e&&Number.isInteger(Number(e)),ze=e=>e.endsWith("%")&&_e(e.slice(0,-1)),Ie=e=>Ce.test(e),De=()=>!0,Le=e=>Te.test(e)&&!Pe.test(e),Ae=()=>!1,Fe=e=>Oe.test(e),$e=e=>Me.test(e),je=e=>!We(e)&&!Ge(e),Be=e=>tt(e,it,Ae),We=e=>Se.test(e),Ue=e=>tt(e,at,Le),He=e=>tt(e,st,_e),Ve=e=>tt(e,rt,Ae),Ye=e=>tt(e,ot,$e),qe=e=>tt(e,ut,Fe),Ge=e=>Ee.test(e),Xe=e=>nt(e,at),Ke=e=>nt(e,lt),Qe=e=>nt(e,rt),Ze=e=>nt(e,it),Je=e=>nt(e,ot),et=e=>nt(e,ut,!0),tt=(e,t,n)=>{const r=Se.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},nt=(e,t,n=!1)=>{const r=Ee.exec(e);return!!r&&(r[1]?t(r[1]):n)},rt=e=>"position"===e||"percentage"===e,ot=e=>"image"===e||"url"===e,it=e=>"length"===e||"size"===e||"bg-size"===e,at=e=>"length"===e,st=e=>"number"===e,lt=e=>"family-name"===e,ut=e=>"shadow"===e,ct=we(()=>{const e=xe("color"),t=xe("font"),n=xe("text"),r=xe("font-weight"),o=xe("tracking"),i=xe("leading"),a=xe("breakpoint"),s=xe("container"),l=xe("spacing"),u=xe("radius"),c=xe("shadow"),d=xe("inset-shadow"),f=xe("text-shadow"),p=xe("drop-shadow"),h=xe("blur"),m=xe("perspective"),g=xe("aspect"),v=xe("ease"),b=xe("animate"),y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Ge,We],w=()=>[Ge,We,l],x=()=>[Ne,"full","auto",...w()],S=()=>[Re,"none","subgrid",Ge,We],E=()=>["auto",{span:["full",Re,Ge,We]},Re,Ge,We],k=()=>[Re,"auto",Ge,We],C=()=>["auto","min","max","fr",Ge,We],T=()=>["auto",...w()],P=()=>[Ne,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],O=()=>[e,Ge,We],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Qe,Ve,{position:[Ge,We]}],N=()=>["auto","cover","contain",Ze,Be,{size:[Ge,We]}],_=()=>[ze,Xe,Ue],R=()=>["","none","full",u,Ge,We],z=()=>["",_e,Xe,Ue],I=()=>[_e,ze,Qe,Ve],D=()=>["","none",h,Ge,We],L=()=>["none",_e,Ge,We],A=()=>["none",_e,Ge,We],F=()=>[_e,Ge,We],$=()=>[Ne,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ie],breakpoint:[Ie],color:[De],container:[Ie],"drop-shadow":[Ie],ease:["in","out","in-out"],font:[je],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ie],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ie],shadow:[Ie],spacing:["px",_e],text:[Ie],"text-shadow":[Ie],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ne,We,Ge,g]}],container:["container"],columns:[{columns:[_e,We,Ge,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:y()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{start:x()}],end:[{end:x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:["visible","invisible","collapse"],z:[{z:[Re,"auto",Ge,We]}],basis:[{basis:[Ne,"full","auto",s,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,Ne,"auto","initial","none",We]}],grow:[{grow:["",_e,Ge,We]}],shrink:[{shrink:["",_e,Ge,We]}],order:[{order:[Re,"first","last","none",Ge,We]}],"grid-cols":[{"grid-cols":S()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":S()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":C()}],"auto-rows":[{"auto-rows":C()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:T()}],mx:[{mx:T()}],my:[{my:T()}],ms:[{ms:T()}],me:[{me:T()}],mt:[{mt:T()}],mr:[{mr:T()}],mb:[{mb:T()}],ml:[{ml:T()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:P()}],w:[{w:[s,"screen",...P()]}],"min-w":[{"min-w":[s,"screen","none",...P()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...P()]}],h:[{h:["screen",...P()]}],"min-h":[{"min-h":["screen","none",...P()]}],"max-h":[{"max-h":["screen",...P()]}],"font-size":[{text:["base",n,Xe,Ue]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ge,He]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ze,We]}],"font-family":[{font:[Ke,We,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Ge,We]}],"line-clamp":[{"line-clamp":[_e,"none",Ge,He]}],leading:[{leading:[i,...w()]}],"list-image":[{"list-image":["none",Ge,We]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ge,We]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",Ge,Ue]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[_e,"auto",Ge,We]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ge,We]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ge,We]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:N()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Re,Ge,We],radial:["",Ge,We],conic:[Re,Ge,We]},Je,Ye]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:_()}],"gradient-via-pos":[{via:_()}],"gradient-to-pos":[{to:_()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:R()}],"rounded-s":[{"rounded-s":R()}],"rounded-e":[{"rounded-e":R()}],"rounded-t":[{"rounded-t":R()}],"rounded-r":[{"rounded-r":R()}],"rounded-b":[{"rounded-b":R()}],"rounded-l":[{"rounded-l":R()}],"rounded-ss":[{"rounded-ss":R()}],"rounded-se":[{"rounded-se":R()}],"rounded-ee":[{"rounded-ee":R()}],"rounded-es":[{"rounded-es":R()}],"rounded-tl":[{"rounded-tl":R()}],"rounded-tr":[{"rounded-tr":R()}],"rounded-br":[{"rounded-br":R()}],"rounded-bl":[{"rounded-bl":R()}],"border-w":[{border:z()}],"border-w-x":[{"border-x":z()}],"border-w-y":[{"border-y":z()}],"border-w-s":[{"border-s":z()}],"border-w-e":[{"border-e":z()}],"border-w-t":[{"border-t":z()}],"border-w-r":[{"border-r":z()}],"border-w-b":[{"border-b":z()}],"border-w-l":[{"border-l":z()}],"divide-x":[{"divide-x":z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[_e,Ge,We]}],"outline-w":[{outline:["",_e,Xe,Ue]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","none",c,et,qe]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",d,et,qe]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[_e,Ue]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":z()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",f,et,qe]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[_e,Ge,We]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":I()}],"mask-image-linear-to-pos":[{"mask-linear-to":I()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":I()}],"mask-image-t-to-pos":[{"mask-t-to":I()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":I()}],"mask-image-r-to-pos":[{"mask-r-to":I()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":I()}],"mask-image-b-to-pos":[{"mask-b-to":I()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":I()}],"mask-image-l-to-pos":[{"mask-l-to":I()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":I()}],"mask-image-x-to-pos":[{"mask-x-to":I()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":I()}],"mask-image-y-to-pos":[{"mask-y-to":I()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[Ge,We]}],"mask-image-radial-from-pos":[{"mask-radial-from":I()}],"mask-image-radial-to-pos":[{"mask-radial-to":I()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":I()}],"mask-image-conic-to-pos":[{"mask-conic-to":I()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:N()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ge,We]}],filter:[{filter:["","none",Ge,We]}],blur:[{blur:D()}],brightness:[{brightness:[_e,Ge,We]}],contrast:[{contrast:[_e,Ge,We]}],"drop-shadow":[{"drop-shadow":["","none",p,et,qe]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:["",_e,Ge,We]}],"hue-rotate":[{"hue-rotate":[_e,Ge,We]}],invert:[{invert:["",_e,Ge,We]}],saturate:[{saturate:[_e,Ge,We]}],sepia:[{sepia:["",_e,Ge,We]}],"backdrop-filter":[{"backdrop-filter":["","none",Ge,We]}],"backdrop-blur":[{"backdrop-blur":D()}],"backdrop-brightness":[{"backdrop-brightness":[_e,Ge,We]}],"backdrop-contrast":[{"backdrop-contrast":[_e,Ge,We]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,Ge,We]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,Ge,We]}],"backdrop-invert":[{"backdrop-invert":["",_e,Ge,We]}],"backdrop-opacity":[{"backdrop-opacity":[_e,Ge,We]}],"backdrop-saturate":[{"backdrop-saturate":[_e,Ge,We]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,Ge,We]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ge,We]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_e,"initial",Ge,We]}],ease:[{ease:["linear","initial",v,Ge,We]}],delay:[{delay:[_e,Ge,We]}],animate:[{animate:["none",b,Ge,We]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,Ge,We]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:L()}],"rotate-x":[{"rotate-x":L()}],"rotate-y":[{"rotate-y":L()}],"rotate-z":[{"rotate-z":L()}],scale:[{scale:A()}],"scale-x":[{"scale-x":A()}],"scale-y":[{"scale-y":A()}],"scale-z":[{"scale-z":A()}],"scale-3d":["scale-3d"],skew:[{skew:F()}],"skew-x":[{"skew-x":F()}],"skew-y":[{"skew-y":F()}],transform:[{transform:[Ge,We,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:$()}],"translate-x":[{"translate-x":$()}],"translate-y":[{"translate-y":$()}],"translate-z":[{"translate-z":$()}],"translate-none":["translate-none"],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ge,We]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ge,We]}],fill:[{fill:["none",...O()]}],"stroke-w":[{stroke:[_e,Xe,Ue,He]}],stroke:[{stroke:["none",...O()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}}),dt="mbus-viewed-shorts",ft="mbus-last-played";var pt,ht={exports:{}};function mt(){return pt||(pt=1,ht.exports=function(){var e=1e3,t=6e4,n=36e5,r="millisecond",o="second",i="minute",a="hour",s="day",l="week",u="month",c="quarter",d="year",f="date",p="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},v=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},b={s:v,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),o=n%60;return(t<=0?"+":"-")+v(r,2,"0")+":"+v(o,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),o=t.clone().add(r,u),i=n-o<0,a=t.clone().add(r+(i?-1:1),u);return+(-(r+(n-o)/(i?o-a:a-o))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:d,w:l,d:s,D:f,h:a,m:i,s:o,ms:r,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},y="en",w={};w[y]=g;var x="$isDayjsObject",S=function(e){return e instanceof T||!(!e||!e[x])},E=function e(t,n,r){var o;if(!t)return y;if("string"==typeof t){var i=t.toLowerCase();w[i]&&(o=i),n&&(w[i]=n,o=i);var a=t.split("-");if(!o&&a.length>1)return e(a[0])}else{var s=t.name;w[s]=t,o=s}return!r&&o&&(y=o),o||!r&&y},k=function(e,t){if(S(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new T(n)},C=b;C.l=E,C.i=S,C.w=function(e,t){return k(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var T=function(){function g(e){this.$L=E(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var v=g.prototype;return v.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(C.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(h);if(r){var o=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.init()},v.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},v.$utils=function(){return C},v.isValid=function(){return!(this.$d.toString()===p)},v.isSame=function(e,t){var n=k(e);return this.startOf(t)<=n&&n<=this.endOf(t)},v.isAfter=function(e,t){return k(e)<this.startOf(t)},v.isBefore=function(e,t){return this.endOf(t)<k(e)},v.$g=function(e,t,n){return C.u(e)?this[t]:this.set(n,e)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(e,t){var n=this,r=!!C.u(t)||t,c=C.p(e),p=function(e,t){var o=C.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?o:o.endOf(s)},h=function(e,t){return C.w(n.toDate()[e].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},m=this.$W,g=this.$M,v=this.$D,b="set"+(this.$u?"UTC":"");switch(c){case d:return r?p(1,0):p(31,11);case u:return r?p(1,g):p(0,g+1);case l:var y=this.$locale().weekStart||0,w=(m<y?m+7:m)-y;return p(r?v-w:v+(6-w),g);case s:case f:return h(b+"Hours",0);case a:return h(b+"Minutes",1);case i:return h(b+"Seconds",2);case o:return h(b+"Milliseconds",3);default:return this.clone()}},v.endOf=function(e){return this.startOf(e,!1)},v.$set=function(e,t){var n,l=C.p(e),c="set"+(this.$u?"UTC":""),p=(n={},n[s]=c+"Date",n[f]=c+"Date",n[u]=c+"Month",n[d]=c+"FullYear",n[a]=c+"Hours",n[i]=c+"Minutes",n[o]=c+"Seconds",n[r]=c+"Milliseconds",n)[l],h=l===s?this.$D+(t-this.$W):t;if(l===u||l===d){var m=this.clone().set(f,1);m.$d[p](h),m.init(),this.$d=m.set(f,Math.min(this.$D,m.daysInMonth())).$d}else p&&this.$d[p](h);return this.init(),this},v.set=function(e,t){return this.clone().$set(e,t)},v.get=function(e){return this[C.p(e)]()},v.add=function(r,c){var f,p=this;r=Number(r);var h=C.p(c),m=function(e){var t=k(p);return C.w(t.date(t.date()+Math.round(e*r)),p)};if(h===u)return this.set(u,this.$M+r);if(h===d)return this.set(d,this.$y+r);if(h===s)return m(1);if(h===l)return m(7);var g=(f={},f[i]=t,f[a]=n,f[o]=e,f)[h]||1,v=this.$d.getTime()+r*g;return C.w(v,this)},v.subtract=function(e,t){return this.add(-1*e,t)},v.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||"YYYY-MM-DDTHH:mm:ssZ",o=C.z(this),i=this.$H,a=this.$m,s=this.$M,l=n.weekdays,u=n.months,c=n.meridiem,d=function(e,n,o,i){return e&&(e[n]||e(t,r))||o[n].slice(0,i)},f=function(e){return C.s(i%12||12,e,"0")},h=c||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(m,function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return C.s(t.$y,4,"0");case"M":return s+1;case"MM":return C.s(s+1,2,"0");case"MMM":return d(n.monthsShort,s,u,3);case"MMMM":return d(u,s);case"D":return t.$D;case"DD":return C.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(n.weekdaysMin,t.$W,l,2);case"ddd":return d(n.weekdaysShort,t.$W,l,3);case"dddd":return l[t.$W];case"H":return String(i);case"HH":return C.s(i,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return h(i,a,!0);case"A":return h(i,a,!1);case"m":return String(a);case"mm":return C.s(a,2,"0");case"s":return String(t.$s);case"ss":return C.s(t.$s,2,"0");case"SSS":return C.s(t.$ms,3,"0");case"Z":return o}return null}(e)||o.replace(":","")})},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(r,f,p){var h,m=this,g=C.p(f),v=k(r),b=(v.utcOffset()-this.utcOffset())*t,y=this-v,w=function(){return C.m(m,v)};switch(g){case d:h=w()/12;break;case u:h=w();break;case c:h=w()/3;break;case l:h=(y-b)/6048e5;break;case s:h=(y-b)/864e5;break;case a:h=y/n;break;case i:h=y/t;break;case o:h=y/e;break;default:h=y}return p?h:C.a(h)},v.daysInMonth=function(){return this.endOf(u).$D},v.$locale=function(){return w[this.$L]},v.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=E(e,t,!0);return r&&(n.$L=r),n},v.clone=function(){return C.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},g}(),P=T.prototype;return k.prototype=P,[["$ms",r],["$s",o],["$m",i],["$H",a],["$W",s],["$M",u],["$y",d],["$D",f]].forEach(function(e){P[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),k.extend=function(e,t){return e.$i||(e(t,T,k),e.$i=!0),k},k.locale=E,k.isDayjs=S,k.unix=function(e){return k(1e3*e)},k.en=w[y],k.Ls=w,k.p={},k}()),ht.exports}var gt,vt=t(mt()),bt={exports:{}};var yt,wt=(gt||(gt=1,bt.exports=function(){var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,o,i){var a=o.prototype;i.utc=function(e){return new o({date:e,utc:!0,args:arguments})},a.utc=function(t){var n=i(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var l=a.init;a.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var u=a.utcOffset;a.utcOffset=function(r,o){var i=this.$utils().u;if(i(r))return this.$u?0:i(this.$offset)?u.call(this):this.$offset;if("string"==typeof r&&(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var o=(""+r[0]).match(n)||["-",0,0],i=o[0],a=60*+o[1]+ +o[2];return 0===a?0:"+"===i?a:-a}(r),null===r))return this;var a=Math.abs(r)<=16?60*r:r;if(0===a)return this.utc(o);var s=this.clone();if(o)return s.$offset=a,s.$u=!1,s;var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(a+l,e)).$offset=a,s.$x.$localOffset=l,s};var c=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var d=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var f=a.diff;a.diff=function(e,t,n){if(e&&this.$u===e.$u)return f.call(this,e,t,n);var r=this.local(),o=i(e).local();return f.call(r,o,t,n)}}}()),bt.exports),xt=t(wt),St={exports:{}};yt||(yt=1,St.exports=function(e){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e),r={name:"ko",weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),ordinal:function(e){return e+"일"},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},meridiem:function(e){return e<12?"오전":"오후"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"}};return n.default.locale(r,null,!0),r}(mt()));var Et,kt={exports:{}};var Ct,Tt,Pt,Ot=(Et||(Et=1,kt.exports=(Ct={year:0,month:1,day:2,hour:3,minute:4,second:5},Tt={},function(e,t,n){var r,o=function(e,t,n){void 0===n&&(n={});var r=new Date(e),o=function(e,t){void 0===t&&(t={});var n=t.timeZoneName||"short",r=e+"|"+n,o=Tt[r];return o||(o=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:n}),Tt[r]=o),o}(t,n);return o.formatToParts(r)},i=function(e,t){for(var r=o(e,t),i=[],a=0;a<r.length;a+=1){var s=r[a],l=s.type,u=s.value,c=Ct[l];c>=0&&(i[c]=parseInt(u,10))}var d=i[3],f=24===d?0:d,p=i[0]+"-"+i[1]+"-"+i[2]+" "+f+":"+i[4]+":"+i[5]+":000",h=+e;return(n.utc(p).valueOf()-(h-=h%1e3))/6e4},a=t.prototype;a.tz=function(e,t){void 0===e&&(e=r);var o,i=this.utcOffset(),a=this.toDate(),s=a.toLocaleString("en-US",{timeZone:e}),l=Math.round((a-new Date(s))/1e3/60),u=15*-Math.round(a.getTimezoneOffset()/15)-l;if(Number(u)){if(o=n(s,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(u,!0),t){var c=o.utcOffset();o=o.add(i-c,"minute")}}else o=this.utcOffset(0,t);return o.$x.$timezone=e,o},a.offsetName=function(e){var t=this.$x.$timezone||n.tz.guess(),r=o(this.valueOf(),t,{timeZoneName:e}).find(function(e){return"timezonename"===e.type.toLowerCase()});return r&&r.value};var s=a.startOf;a.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return s.call(this,e,t);var r=n(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return s.call(r,e,t).tz(this.$x.$timezone,!0)},n.tz=function(e,t,o){var a=o&&t,s=o||t||r,l=i(+n(),s);if("string"!=typeof e)return n(e).tz(s);var u=function(e,t,n){var r=e-60*t*1e3,o=i(r,n);if(t===o)return[r,t];var a=i(r-=60*(o-t)*1e3,n);return o===a?[r,o]:[e-60*Math.min(o,a)*1e3,Math.max(o,a)]}(n.utc(e,a).valueOf(),l,s),c=u[0],d=u[1],f=n(c).utcOffset(d);return f.$x.$timezone=s,f},n.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},n.tz.setDefault=function(e){r=e}})),kt.exports),Mt=t(Ot),Nt={exports:{}};var _t=(Pt||(Pt=1,Nt.exports=function(){var e,t,n=1e3,r=6e4,o=36e5,i=864e5,a=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,s=31536e6,l=2628e6,u=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,c={years:s,months:l,days:i,hours:o,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},d=function(e){return e instanceof b},f=function(e,t,n){return new b(e,n,t.$l)},p=function(e){return t.p(e)+"s"},h=function(e){return e<0},m=function(e){return h(e)?Math.ceil(e):Math.floor(e)},g=function(e){return Math.abs(e)},v=function(e,t){return e?h(e)?{negative:!0,format:""+g(e)+t}:{negative:!1,format:""+e+t}:{negative:!1,format:""}},b=function(){function h(e,t,n){var r=this;if(this.$d={},this.$l=n,void 0===e&&(this.$ms=0,this.parseFromMilliseconds()),t)return f(e*c[p(t)],this);if("number"==typeof e)return this.$ms=e,this.parseFromMilliseconds(),this;if("object"==typeof e)return Object.keys(e).forEach(function(t){r.$d[p(t)]=e[t]}),this.calMilliseconds(),this;if("string"==typeof e){var o=e.match(u);if(o){var i=o.slice(2).map(function(e){return null!=e?Number(e):0});return this.$d.years=i[0],this.$d.months=i[1],this.$d.weeks=i[2],this.$d.days=i[3],this.$d.hours=i[4],this.$d.minutes=i[5],this.$d.seconds=i[6],this.calMilliseconds(),this}}return this}var g=h.prototype;return g.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce(function(t,n){return t+(e.$d[n]||0)*c[n]},0)},g.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=m(e/s),e%=s,this.$d.months=m(e/l),e%=l,this.$d.days=m(e/i),e%=i,this.$d.hours=m(e/o),e%=o,this.$d.minutes=m(e/r),e%=r,this.$d.seconds=m(e/n),e%=n,this.$d.milliseconds=e},g.toISOString=function(){var e=v(this.$d.years,"Y"),t=v(this.$d.months,"M"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=v(n,"D"),o=v(this.$d.hours,"H"),i=v(this.$d.minutes,"M"),a=this.$d.seconds||0;this.$d.milliseconds&&(a+=this.$d.milliseconds/1e3,a=Math.round(1e3*a)/1e3);var s=v(a,"S"),l=e.negative||t.negative||r.negative||o.negative||i.negative||s.negative,u=o.format||i.format||s.format?"T":"",c=(l?"-":"")+"P"+e.format+t.format+r.format+u+o.format+i.format+s.format;return"P"===c||"-P"===c?"P0D":c},g.toJSON=function(){return this.toISOString()},g.format=function(e){var n=e||"YYYY-MM-DDTHH:mm:ss",r={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return n.replace(a,function(e,t){return t||String(r[e])})},g.as=function(e){return this.$ms/c[p(e)]},g.get=function(e){var t=this.$ms,n=p(e);return"milliseconds"===n?t%=1e3:t="weeks"===n?m(t/c[n]):this.$d[n],t||0},g.add=function(e,t,n){var r;return r=t?e*c[p(t)]:d(e)?e.$ms:f(e,this).$ms,f(this.$ms+r*(n?-1:1),this)},g.subtract=function(e,t){return this.add(e,t,!0)},g.locale=function(e){var t=this.clone();return t.$l=e,t},g.clone=function(){return f(this.$ms,this)},g.humanize=function(t){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!t)},g.valueOf=function(){return this.asMilliseconds()},g.milliseconds=function(){return this.get("milliseconds")},g.asMilliseconds=function(){return this.as("milliseconds")},g.seconds=function(){return this.get("seconds")},g.asSeconds=function(){return this.as("seconds")},g.minutes=function(){return this.get("minutes")},g.asMinutes=function(){return this.as("minutes")},g.hours=function(){return this.get("hours")},g.asHours=function(){return this.as("hours")},g.days=function(){return this.get("days")},g.asDays=function(){return this.as("days")},g.weeks=function(){return this.get("weeks")},g.asWeeks=function(){return this.as("weeks")},g.months=function(){return this.get("months")},g.asMonths=function(){return this.as("months")},g.years=function(){return this.get("years")},g.asYears=function(){return this.as("years")},h}(),y=function(e,t,n){return e.add(t.years()*n,"y").add(t.months()*n,"M").add(t.days()*n,"d").add(t.hours()*n,"h").add(t.minutes()*n,"m").add(t.seconds()*n,"s").add(t.milliseconds()*n,"ms")};return function(n,r,o){e=o,t=o().$utils(),o.duration=function(e,t){var n=o.locale();return f(e,{$l:n},t)},o.isDuration=d;var i=r.prototype.add,a=r.prototype.subtract;r.prototype.add=function(e,t){return d(e)?y(this,e,1):i.bind(this)(e,t)},r.prototype.subtract=function(e,t){return d(e)?y(this,e,-1):a.bind(this)(e,t)}}}()),Nt.exports),Rt=t(_t);console.log("[commerce-player configs instance]",Math.random());const zt={API_BASE_URL:"https://api.midibus.im:8001",STATISTICS_BASE_URL:"https://playdata.midibus.im",PLAYER_BACK_BASE_URL:"https://back-playdata.midibus.im",PLAYER_BASE_URL:"https://mcommerce-play.midibus.kinxcdn.com"};function It(){return Object.assign(Object.assign({},zt),globalThis.__KINXCDN_COMMERCE_PLAYER_ENDPOINTS__||{})}function Dt(...e){return ct(function(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=oe(e))&&(r&&(r+=" "),r+=t);return r}(e))}vt.extend(xt),vt.extend(Mt),vt.extend(Rt),vt.locale("ko");const Lt=e=>e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),At=e=>{const{API_BASE_URL:t}=It();return`${t}/direct/${e}`},Ft=e=>{if(void 0===e||null==e)return"";return e.toString().replace(/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g,",")},$t=()=>{const e=new Date;return`${e.getFullYear()}${String(e.getMonth()+1).padStart(2,"0")}${String(e.getDate()).padStart(2,"0")}${String(e.getHours()).padStart(2,"0")}${String(e.getMinutes()).padStart(2,"0")}${String(e.getSeconds()).padStart(2,"0")}`},jt=()=>{if("undefined"!=typeof window&&window.crypto&&window.crypto.getRandomValues){const e=new Uint8Array(16);window.crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;const t=Array.from(e).map(e=>e.toString(16).padStart(2,"0"));return`${t.slice(0,4).join("")}-${t.slice(4,6).join("")}-${t.slice(6,8).join("")}-${t.slice(8,10).join("")}-${t.slice(10,16).join("")}`}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},Bt=e=>{const t=dt,n=JSON.parse(localStorage.getItem(t)||"[]"),r=n.includes(e);return r||(n.push(e),localStorage.setItem(t,JSON.stringify(n))),r},Wt=e=>{const t=ft,n=Math.floor((new Date).getTime()/1e3);let r=!0;switch(e){case U.NONE:r=!1;break;case U.DISAPPEAR:localStorage.getItem(t)&&(r=!1);break;case U.DAY:const e=localStorage.getItem(t);if(!e)break;n-parseInt(e)<86400&&(r=!1)}return r},Ut=e=>e.includes("https")?e:"https://"+e,Ht=e=>{e instanceof Error?console.error(e.toString()):console.error(e)};const Vt=(e,t)=>e>t?X.LANDSCAPE:X.PORTRAIT;var Yt=(e,t,n=!0)=>{const r=h.useRef(e),o=h.useRef(null),i=()=>{o.current&&(clearInterval(o.current),o.current=null)},a=h.useCallback(()=>{o.current||(o.current=setInterval(()=>r.current(),t))},[t]);return h.useEffect(()=>{r.current=e},[e]),h.useEffect(()=>(n&&a(),()=>i()),[a,n]),{clear:i,run:a}};const qt=()=>{const[e,t]=h.useState(0);Yt(()=>{t(e=>e+1)},1e3);return{playtime:e,resetPlaytime:()=>t(0)}};let Gt=0;const Xt=e=>J(void 0,void 0,void 0,function*(){const{PLAYER_BACK_BASE_URL:t}=It(),{contentId:n,uuid:r,type:o,userId:i}=e;try{if(3===Gt)return;const e=`${t}/statistics/play`,a=Object.assign({contentId:n,uuid:r,type:o,date:$t(),userId:+i,playtime:0,isLive:!1},"shorts"===o&&{isFinished:!1,playedOver5Sec:!1});yield fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}catch(e){console.error(`Error in statisticsApi.join - contentId: ${n}`),Ht(e),Gt++}}),Kt=e=>{const{PLAYER_BACK_BASE_URL:t}=It(),{contentId:n,uuid:r,type:o,isFinished:i,playtime:a,userId:s}=e,l=Object.assign({contentId:n,uuid:r,playtime:a,type:o,date:$t(),userId:+s,isLive:!1},"shorts"===o&&{isFinished:i,playedOver5Sec:Number(a)>5});fetch(`${t}/statistics/play`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l),keepalive:!0})},Qt=e=>J(void 0,void 0,void 0,function*(){const{PLAYER_BACK_BASE_URL:t}=It(),{contentProductId:n}=e;try{yield fetch(`${t}/statistics/products/${n}/clicks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Object.assign({date:$t()},e))})}catch(e){console.error(`Error in statisticsApi.productClick - contentProductId: ${n}`),Ht(e)}}),Zt=e=>J(void 0,void 0,void 0,function*(){const{STATISTICS_BASE_URL:t}=It();try{return(yield(yield fetch(`${t}/${e}/likes`)).json()).result||0}catch(t){return console.error(`Error in statisticsApi.getLike - contentId: ${e}`),Ht(t),0}}),Jt=e=>J(void 0,void 0,void 0,function*(){const{PLAYER_BACK_BASE_URL:t}=It();try{yield fetch(`${t}/statistics/like`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contentId:e,isLive:!1,isFirst:!1})})}catch(t){console.error(`Error in statisticsApi.getLike - contentId: ${e}`),Ht(t)}}),en=e=>J(void 0,[e],void 0,function*({collectionId:e,nextKey:t,size:n=5}){const{PLAYER_BACK_BASE_URL:r}=It();try{const o=new URLSearchParams;-1!==n&&o.set("size",String(n)),t&&o.set("nextKey",t);const i=yield fetch(`${r}/commerce/collection/${e}?${o.toString()}`);return i.ok?yield i.json():null}catch(e){return Ht(e),null}}),tn=(e,...t)=>J(void 0,[e,...t],void 0,function*(e,t=!1){const{API_BASE_URL:n,PLAYER_BACK_BASE_URL:r}=It();if(t)try{const t=(yield(yield fetch(`${n}/shorts/player/${e}`)).json()).result;if(!t.media)return null;t.file=`${n}/direct/${t.media.objectId}`;const{player:{viewPlayer:{width:r,height:o}}}=t;return Object.assign(Object.assign(Object.assign(Object.assign({layout:t.player.layout},t.player.shoppingPlayer),{aspectRatio:Vt(r,o)}),t),{uuid:jt()})}catch(e){return Ht(e),null}try{const t=yield fetch(`${r}/commerce/short-form/${e}`),n=yield t.json();return n.shortsId?n:null}catch(e){return Ht(e),null}}),nn=(e,t)=>J(void 0,void 0,void 0,function*(){const{API_BASE_URL:n}=It();try{const{result:r}=yield(yield fetch(`${n}/live/${e}/list?size=${t||6}`)).json();return r}catch(e){return console.error("Error in getLiveWidgetContents: ",e),[]}}),rn=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e))},a=t=e(r,o,i);return i},on=e=>e?rn(e):rn,an=e=>e;function sn(e,t=an){const n=m.useSyncExternalStore(e.subscribe,m.useCallback(()=>t(e.getState()),[e,t]),m.useCallback(()=>t(e.getInitialState()),[e,t]));return m.useDebugValue(n),n}const ln=e=>{const t=on(e),n=e=>sn(t,e);return Object.assign(n,t),n},un=e=>e?ln(e):ln,cn=un(e=>({priceText:"",isPreview:!1,setPriceText:t=>e({priceText:t}),setIsPreview:t=>e({isPreview:t})})),dn=m.createContext(null),fn=({children:e})=>{const t=m.useRef(null);return t.current||(t.current=on(e=>({collection:null,setCollection:t=>e({collection:t}),nextKey:"",setNextKey:t=>e({nextKey:t}),isFetching:!1,setIsFetching:t=>e({isFetching:t})}))),m.createElement(dn.Provider,{value:t.current},e)},pn=()=>(e=>{const t=m.useContext(dn);if(!t)throw new Error("Missing CollectionProvider");return sn(t,e)})(e=>e),hn=(e,t)=>{const{collection:n,setCollection:r,isFetching:o,setIsFetching:i,nextKey:a,setNextKey:s}=pn(),{isPreview:l}=cn(),u=(null==e?void 0:e.media)?e.media.duration.split(":").reduce((e,t,n)=>e+ +t*60**(2-n),0):0;const{resetPlaytime:c,playtime:d}=qt(),{playtime:f,resetPlaytime:p}=qt(),m=re(),g=()=>{if(!n)return;const{colId:t,uuid:r,userId:o}=n,i=ft,a=Math.floor((new Date).getTime()/1e3);localStorage.setItem(i,a.toString()),l||(Kt({contentId:t,uuid:r,type:K.COLLECTION,userId:o,playtime:f}),e&&Kt({contentId:e.shortsId,uuid:e.uuid,type:K.SHORTS,userId:o,playtime:d,isFinished:d>=u}),p(),c())};h.useEffect(()=>{m||g()},[m]);return{onSlideChange:f=>J(void 0,void 0,void 0,function*(){if(e&&n&&(yield(e=>J(void 0,void 0,void 0,function*(){var t,l;if(!n)return;const{contents:u,count:c}=n;if((null!=c?c:Number.MAX_SAFE_INTEGER)>u.length&&e>=u.length-5&&!o){i(!0);try{const e=yield en({collectionId:n.colId,nextKey:a});if(!e||!(null===(t=e.contents)||void 0===t?void 0:t.length))return;s((null===(l=e.contents.at(-1))||void 0===l?void 0:l.shortsId)||"");const o=new Set(n.contents.map(e=>e.shortsId)),i=e.contents.filter(e=>!o.has(e.shortsId));if(!i.length)return;const u=n.contents.concat(i);r(Object.assign(Object.assign({},n),{contents:u}))}catch(e){console.error(e)}finally{i(!1)}}}))(f),!l)){const{shortsId:r,uuid:o,userId:i}=e;Kt({contentId:r,uuid:o,type:K.SHORTS,playtime:d,isFinished:d>=u,userId:i}),c();const a=jt(),s=n.contents[f];t(Object.assign(Object.assign({},s),{uuid:a})),yield Xt({contentId:s.shortsId,uuid:a,type:K.SHORTS,userId:s.userId,isFirstPlay:!Bt(s.shortsId)})}}),onCollectionClose:g}};function mn(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function gn(e,t){void 0===e&&(e={}),void 0===t&&(t={}),Object.keys(t).forEach(n=>{void 0===e[n]?e[n]=t[n]:mn(t[n])&&mn(e[n])&&Object.keys(t[n]).length>0&&gn(e[n],t[n])})}const vn={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function bn(){const e="undefined"!=typeof document?document:{};return gn(e,vn),e}const yn={document:vn,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:e=>"undefined"==typeof setTimeout?(e(),null):setTimeout(e,0),cancelAnimationFrame(e){"undefined"!=typeof setTimeout&&clearTimeout(e)}};function wn(){const e="undefined"!=typeof window?window:{};return gn(e,yn),e}function xn(e,t){return void 0===t&&(t=0),setTimeout(e,t)}function Sn(){return Date.now()}function En(e,t){void 0===t&&(t="x");const n=wn();let r,o,i;const a=function(e){const t=wn();let n;return t.getComputedStyle&&(n=t.getComputedStyle(e,null)),!n&&e.currentStyle&&(n=e.currentStyle),n||(n=e.style),n}(e);return n.WebKitCSSMatrix?(o=a.transform||a.webkitTransform,o.split(",").length>6&&(o=o.split(", ").map(e=>e.replace(",",".")).join(", ")),i=new n.WebKitCSSMatrix("none"===o?"":o)):(i=a.MozTransform||a.OTransform||a.MsTransform||a.msTransform||a.transform||a.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),r=i.toString().split(",")),"x"===t&&(o=n.WebKitCSSMatrix?i.m41:16===r.length?parseFloat(r[12]):parseFloat(r[4])),"y"===t&&(o=n.WebKitCSSMatrix?i.m42:16===r.length?parseFloat(r[13]):parseFloat(r[5])),o||0}function kn(e){return"object"==typeof e&&null!==e&&e.constructor&&"Object"===Object.prototype.toString.call(e).slice(8,-1)}function Cn(e){return"undefined"!=typeof window&&void 0!==window.HTMLElement?e instanceof HTMLElement:e&&(1===e.nodeType||11===e.nodeType)}function Tn(){const e=Object(arguments.length<=0?void 0:arguments[0]),t=["__proto__","constructor","prototype"];for(let n=1;n<arguments.length;n+=1){const r=n<0||arguments.length<=n?void 0:arguments[n];if(null!=r&&!Cn(r)){const n=Object.keys(Object(r)).filter(e=>t.indexOf(e)<0);for(let t=0,o=n.length;t<o;t+=1){const o=n[t],i=Object.getOwnPropertyDescriptor(r,o);void 0!==i&&i.enumerable&&(kn(e[o])&&kn(r[o])?r[o].__swiper__?e[o]=r[o]:Tn(e[o],r[o]):!kn(e[o])&&kn(r[o])?(e[o]={},r[o].__swiper__?e[o]=r[o]:Tn(e[o],r[o])):e[o]=r[o])}}}return e}function Pn(e,t,n){e.style.setProperty(t,n)}function On(e){let{swiper:t,targetPosition:n,side:r}=e;const o=wn(),i=-t.translate;let a,s=null;const l=t.params.speed;t.wrapperEl.style.scrollSnapType="none",o.cancelAnimationFrame(t.cssModeFrameID);const u=n>i?"next":"prev",c=(e,t)=>"next"===u&&e>=t||"prev"===u&&e<=t,d=()=>{a=(new Date).getTime(),null===s&&(s=a);const e=Math.max(Math.min((a-s)/l,1),0),u=.5-Math.cos(e*Math.PI)/2;let f=i+u*(n-i);if(c(f,n)&&(f=n),t.wrapperEl.scrollTo({[r]:f}),c(f,n))return t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.scrollSnapType="",setTimeout(()=>{t.wrapperEl.style.overflow="",t.wrapperEl.scrollTo({[r]:f})}),void o.cancelAnimationFrame(t.cssModeFrameID);t.cssModeFrameID=o.requestAnimationFrame(d)};d()}function Mn(e){return e.querySelector(".swiper-slide-transform")||e.shadowRoot&&e.shadowRoot.querySelector(".swiper-slide-transform")||e}function Nn(e,t){void 0===t&&(t="");const n=[...e.children];return e instanceof HTMLSlotElement&&n.push(...e.assignedElements()),t?n.filter(e=>e.matches(t)):n}function _n(e){try{return void console.warn(e)}catch(e){}}function Rn(e,t){void 0===t&&(t=[]);const n=document.createElement(e);return n.classList.add(...Array.isArray(t)?t:function(e){return void 0===e&&(e=""),e.trim().split(" ").filter(e=>!!e.trim())}(t)),n}function zn(e,t){return wn().getComputedStyle(e,null).getPropertyValue(t)}function In(e){let t,n=e;if(n){for(t=0;null!==(n=n.previousSibling);)1===n.nodeType&&(t+=1);return t}}function Dn(e,t,n){const r=wn();return e["width"===t?"offsetWidth":"offsetHeight"]+parseFloat(r.getComputedStyle(e,null).getPropertyValue("width"===t?"margin-right":"margin-top"))+parseFloat(r.getComputedStyle(e,null).getPropertyValue("width"===t?"margin-left":"margin-bottom"))}let Ln,An,Fn;function $n(){return Ln||(Ln=function(){const e=wn(),t=bn();return{smoothScroll:t.documentElement&&t.documentElement.style&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in e||e.DocumentTouch&&t instanceof e.DocumentTouch)}}()),Ln}function jn(e){return void 0===e&&(e={}),An||(An=function(e){let{userAgent:t}=void 0===e?{}:e;const n=$n(),r=wn(),o=r.navigator.platform,i=t||r.navigator.userAgent,a={ios:!1,android:!1},s=r.screen.width,l=r.screen.height,u=i.match(/(Android);?[\s\/]+([\d.]+)?/);let c=i.match(/(iPad).*OS\s([\d_]+)/);const d=i.match(/(iPod)(.*OS\s([\d_]+))?/),f=!c&&i.match(/(iPhone\sOS|iOS)\s([\d_]+)/),p="Win32"===o;let h="MacIntel"===o;return!c&&h&&n.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(`${s}x${l}`)>=0&&(c=i.match(/(Version)\/([\d.]+)/),c||(c=[0,1,"13_0_0"]),h=!1),u&&!p&&(a.os="android",a.android=!0),(c||f||d)&&(a.os="ios",a.ios=!0),a}(e)),An}function Bn(){return Fn||(Fn=function(){const e=wn(),t=jn();let n=!1;function r(){const t=e.navigator.userAgent.toLowerCase();return t.indexOf("safari")>=0&&t.indexOf("chrome")<0&&t.indexOf("android")<0}if(r()){const t=String(e.navigator.userAgent);if(t.includes("Version/")){const[e,r]=t.split("Version/")[1].split(" ")[0].split(".").map(e=>Number(e));n=e<16||16===e&&r<2}}const o=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent),i=r();return{isSafari:n||i,needPerspectiveFix:n,need3dFix:i||o&&t.ios,isWebView:o}}()),Fn}var Wn={on(e,t,n){const r=this;if(!r.eventsListeners||r.destroyed)return r;if("function"!=typeof t)return r;const o=n?"unshift":"push";return e.split(" ").forEach(e=>{r.eventsListeners[e]||(r.eventsListeners[e]=[]),r.eventsListeners[e][o](t)}),r},once(e,t,n){const r=this;if(!r.eventsListeners||r.destroyed)return r;if("function"!=typeof t)return r;function o(){r.off(e,o),o.__emitterProxy&&delete o.__emitterProxy;for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];t.apply(r,i)}return o.__emitterProxy=t,r.on(e,o,n)},onAny(e,t){const n=this;if(!n.eventsListeners||n.destroyed)return n;if("function"!=typeof e)return n;const r=t?"unshift":"push";return n.eventsAnyListeners.indexOf(e)<0&&n.eventsAnyListeners[r](e),n},offAny(e){const t=this;if(!t.eventsListeners||t.destroyed)return t;if(!t.eventsAnyListeners)return t;const n=t.eventsAnyListeners.indexOf(e);return n>=0&&t.eventsAnyListeners.splice(n,1),t},off(e,t){const n=this;return!n.eventsListeners||n.destroyed?n:n.eventsListeners?(e.split(" ").forEach(e=>{void 0===t?n.eventsListeners[e]=[]:n.eventsListeners[e]&&n.eventsListeners[e].forEach((r,o)=>{(r===t||r.__emitterProxy&&r.__emitterProxy===t)&&n.eventsListeners[e].splice(o,1)})}),n):n},emit(){const e=this;if(!e.eventsListeners||e.destroyed)return e;if(!e.eventsListeners)return e;let t,n,r;for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];"string"==typeof i[0]||Array.isArray(i[0])?(t=i[0],n=i.slice(1,i.length),r=e):(t=i[0].events,n=i[0].data,r=i[0].context||e),n.unshift(r);return(Array.isArray(t)?t:t.split(" ")).forEach(t=>{e.eventsAnyListeners&&e.eventsAnyListeners.length&&e.eventsAnyListeners.forEach(e=>{e.apply(r,[t,...n])}),e.eventsListeners&&e.eventsListeners[t]&&e.eventsListeners[t].forEach(e=>{e.apply(r,n)})}),e}};const Un=(e,t,n)=>{t&&!e.classList.contains(n)?e.classList.add(n):!t&&e.classList.contains(n)&&e.classList.remove(n)};const Hn=(e,t,n)=>{t&&!e.classList.contains(n)?e.classList.add(n):!t&&e.classList.contains(n)&&e.classList.remove(n)};const Vn=(e,t)=>{if(!e||e.destroyed||!e.params)return;const n=t.closest(e.isElement?"swiper-slide":`.${e.params.slideClass}`);if(n){let t=n.querySelector(`.${e.params.lazyPreloaderClass}`);!t&&e.isElement&&(n.shadowRoot?t=n.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{n.shadowRoot&&(t=n.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`),t&&t.remove())})),t&&t.remove()}},Yn=(e,t)=>{if(!e.slides[t])return;const n=e.slides[t].querySelector('[loading="lazy"]');n&&n.removeAttribute("loading")},qn=e=>{if(!e||e.destroyed||!e.params)return;let t=e.params.lazyPreloadPrevNext;const n=e.slides.length;if(!n||!t||t<0)return;t=Math.min(t,n);const r="auto"===e.params.slidesPerView?e.slidesPerViewDynamic():Math.ceil(e.params.slidesPerView),o=e.activeIndex;if(e.params.grid&&e.params.grid.rows>1){const n=o,i=[n-t];return i.push(...Array.from({length:t}).map((e,t)=>n+r+t)),void e.slides.forEach((t,n)=>{i.includes(t.column)&&Yn(e,n)})}const i=o+r-1;if(e.params.rewind||e.params.loop)for(let r=o-t;r<=i+t;r+=1){const t=(r%n+n)%n;(t<o||t>i)&&Yn(e,t)}else for(let r=Math.max(o-t,0);r<=Math.min(i+t,n-1);r+=1)r!==o&&(r>i||r<o)&&Yn(e,r)};var Gn={updateSize:function(){const e=this;let t,n;const r=e.el;t=void 0!==e.params.width&&null!==e.params.width?e.params.width:r.clientWidth,n=void 0!==e.params.height&&null!==e.params.height?e.params.height:r.clientHeight,0===t&&e.isHorizontal()||0===n&&e.isVertical()||(t=t-parseInt(zn(r,"padding-left")||0,10)-parseInt(zn(r,"padding-right")||0,10),n=n-parseInt(zn(r,"padding-top")||0,10)-parseInt(zn(r,"padding-bottom")||0,10),Number.isNaN(t)&&(t=0),Number.isNaN(n)&&(n=0),Object.assign(e,{width:t,height:n,size:e.isHorizontal()?t:n}))},updateSlides:function(){const e=this;function t(t,n){return parseFloat(t.getPropertyValue(e.getDirectionLabel(n))||0)}const n=e.params,{wrapperEl:r,slidesEl:o,size:i,rtlTranslate:a,wrongRTL:s}=e,l=e.virtual&&n.virtual.enabled,u=l?e.virtual.slides.length:e.slides.length,c=Nn(o,`.${e.params.slideClass}, swiper-slide`),d=l?e.virtual.slides.length:c.length;let f=[];const p=[],h=[];let m=n.slidesOffsetBefore;"function"==typeof m&&(m=n.slidesOffsetBefore.call(e));let g=n.slidesOffsetAfter;"function"==typeof g&&(g=n.slidesOffsetAfter.call(e));const v=e.snapGrid.length,b=e.slidesGrid.length;let y=n.spaceBetween,w=-m,x=0,S=0;if(void 0===i)return;"string"==typeof y&&y.indexOf("%")>=0?y=parseFloat(y.replace("%",""))/100*i:"string"==typeof y&&(y=parseFloat(y)),e.virtualSize=-y,c.forEach(e=>{a?e.style.marginLeft="":e.style.marginRight="",e.style.marginBottom="",e.style.marginTop=""}),n.centeredSlides&&n.cssMode&&(Pn(r,"--swiper-centered-offset-before",""),Pn(r,"--swiper-centered-offset-after",""));const E=n.grid&&n.grid.rows>1&&e.grid;let k;E?e.grid.initSlides(c):e.grid&&e.grid.unsetSlides();const C="auto"===n.slidesPerView&&n.breakpoints&&Object.keys(n.breakpoints).filter(e=>void 0!==n.breakpoints[e].slidesPerView).length>0;for(let r=0;r<d;r+=1){let o;if(k=0,c[r]&&(o=c[r]),E&&e.grid.updateSlide(r,o,c),!c[r]||"none"!==zn(o,"display")){if("auto"===n.slidesPerView){C&&(c[r].style[e.getDirectionLabel("width")]="");const i=getComputedStyle(o),a=o.style.transform,s=o.style.webkitTransform;if(a&&(o.style.transform="none"),s&&(o.style.webkitTransform="none"),n.roundLengths)k=e.isHorizontal()?Dn(o,"width"):Dn(o,"height");else{const e=t(i,"width"),n=t(i,"padding-left"),r=t(i,"padding-right"),a=t(i,"margin-left"),s=t(i,"margin-right"),l=i.getPropertyValue("box-sizing");if(l&&"border-box"===l)k=e+a+s;else{const{clientWidth:t,offsetWidth:i}=o;k=e+n+r+a+s+(i-t)}}a&&(o.style.transform=a),s&&(o.style.webkitTransform=s),n.roundLengths&&(k=Math.floor(k))}else k=(i-(n.slidesPerView-1)*y)/n.slidesPerView,n.roundLengths&&(k=Math.floor(k)),c[r]&&(c[r].style[e.getDirectionLabel("width")]=`${k}px`);c[r]&&(c[r].swiperSlideSize=k),h.push(k),n.centeredSlides?(w=w+k/2+x/2+y,0===x&&0!==r&&(w=w-i/2-y),0===r&&(w=w-i/2-y),Math.abs(w)<.001&&(w=0),n.roundLengths&&(w=Math.floor(w)),S%n.slidesPerGroup===0&&f.push(w),p.push(w)):(n.roundLengths&&(w=Math.floor(w)),(S-Math.min(e.params.slidesPerGroupSkip,S))%e.params.slidesPerGroup===0&&f.push(w),p.push(w),w=w+k+y),e.virtualSize+=k+y,x=k,S+=1}}if(e.virtualSize=Math.max(e.virtualSize,i)+g,a&&s&&("slide"===n.effect||"coverflow"===n.effect)&&(r.style.width=`${e.virtualSize+y}px`),n.setWrapperSize&&(r.style[e.getDirectionLabel("width")]=`${e.virtualSize+y}px`),E&&e.grid.updateWrapperSize(k,f),!n.centeredSlides){const t=[];for(let r=0;r<f.length;r+=1){let o=f[r];n.roundLengths&&(o=Math.floor(o)),f[r]<=e.virtualSize-i&&t.push(o)}f=t,Math.floor(e.virtualSize-i)-Math.floor(f[f.length-1])>1&&f.push(e.virtualSize-i)}if(l&&n.loop){const t=h[0]+y;if(n.slidesPerGroup>1){const r=Math.ceil((e.virtual.slidesBefore+e.virtual.slidesAfter)/n.slidesPerGroup),o=t*n.slidesPerGroup;for(let e=0;e<r;e+=1)f.push(f[f.length-1]+o)}for(let r=0;r<e.virtual.slidesBefore+e.virtual.slidesAfter;r+=1)1===n.slidesPerGroup&&f.push(f[f.length-1]+t),p.push(p[p.length-1]+t),e.virtualSize+=t}if(0===f.length&&(f=[0]),0!==y){const t=e.isHorizontal()&&a?"marginLeft":e.getDirectionLabel("marginRight");c.filter((e,t)=>!(n.cssMode&&!n.loop)||t!==c.length-1).forEach(e=>{e.style[t]=`${y}px`})}if(n.centeredSlides&&n.centeredSlidesBounds){let e=0;h.forEach(t=>{e+=t+(y||0)}),e-=y;const t=e>i?e-i:0;f=f.map(e=>e<=0?-m:e>t?t+g:e)}if(n.centerInsufficientSlides){let e=0;h.forEach(t=>{e+=t+(y||0)}),e-=y;const t=(n.slidesOffsetBefore||0)+(n.slidesOffsetAfter||0);if(e+t<i){const n=(i-e-t)/2;f.forEach((e,t)=>{f[t]=e-n}),p.forEach((e,t)=>{p[t]=e+n})}}if(Object.assign(e,{slides:c,snapGrid:f,slidesGrid:p,slidesSizesGrid:h}),n.centeredSlides&&n.cssMode&&!n.centeredSlidesBounds){Pn(r,"--swiper-centered-offset-before",-f[0]+"px"),Pn(r,"--swiper-centered-offset-after",e.size/2-h[h.length-1]/2+"px");const t=-e.snapGrid[0],n=-e.slidesGrid[0];e.snapGrid=e.snapGrid.map(e=>e+t),e.slidesGrid=e.slidesGrid.map(e=>e+n)}if(d!==u&&e.emit("slidesLengthChange"),f.length!==v&&(e.params.watchOverflow&&e.checkOverflow(),e.emit("snapGridLengthChange")),p.length!==b&&e.emit("slidesGridLengthChange"),n.watchSlidesProgress&&e.updateSlidesOffset(),e.emit("slidesUpdated"),!(l||n.cssMode||"slide"!==n.effect&&"fade"!==n.effect)){const t=`${n.containerModifierClass}backface-hidden`,r=e.el.classList.contains(t);d<=n.maxBackfaceHiddenSlides?r||e.el.classList.add(t):r&&e.el.classList.remove(t)}},updateAutoHeight:function(e){const t=this,n=[],r=t.virtual&&t.params.virtual.enabled;let o,i=0;"number"==typeof e?t.setTransition(e):!0===e&&t.setTransition(t.params.speed);const a=e=>r?t.slides[t.getSlideIndexByData(e)]:t.slides[e];if("auto"!==t.params.slidesPerView&&t.params.slidesPerView>1)if(t.params.centeredSlides)(t.visibleSlides||[]).forEach(e=>{n.push(e)});else for(o=0;o<Math.ceil(t.params.slidesPerView);o+=1){const e=t.activeIndex+o;if(e>t.slides.length&&!r)break;n.push(a(e))}else n.push(a(t.activeIndex));for(o=0;o<n.length;o+=1)if(void 0!==n[o]){const e=n[o].offsetHeight;i=e>i?e:i}(i||0===i)&&(t.wrapperEl.style.height=`${i}px`)},updateSlidesOffset:function(){const e=this,t=e.slides,n=e.isElement?e.isHorizontal()?e.wrapperEl.offsetLeft:e.wrapperEl.offsetTop:0;for(let r=0;r<t.length;r+=1)t[r].swiperSlideOffset=(e.isHorizontal()?t[r].offsetLeft:t[r].offsetTop)-n-e.cssOverflowAdjustment()},updateSlidesProgress:function(e){void 0===e&&(e=this&&this.translate||0);const t=this,n=t.params,{slides:r,rtlTranslate:o,snapGrid:i}=t;if(0===r.length)return;void 0===r[0].swiperSlideOffset&&t.updateSlidesOffset();let a=-e;o&&(a=e),t.visibleSlidesIndexes=[],t.visibleSlides=[];let s=n.spaceBetween;"string"==typeof s&&s.indexOf("%")>=0?s=parseFloat(s.replace("%",""))/100*t.size:"string"==typeof s&&(s=parseFloat(s));for(let e=0;e<r.length;e+=1){const l=r[e];let u=l.swiperSlideOffset;n.cssMode&&n.centeredSlides&&(u-=r[0].swiperSlideOffset);const c=(a+(n.centeredSlides?t.minTranslate():0)-u)/(l.swiperSlideSize+s),d=(a-i[0]+(n.centeredSlides?t.minTranslate():0)-u)/(l.swiperSlideSize+s),f=-(a-u),p=f+t.slidesSizesGrid[e],h=f>=0&&f<=t.size-t.slidesSizesGrid[e],m=f>=0&&f<t.size-1||p>1&&p<=t.size||f<=0&&p>=t.size;m&&(t.visibleSlides.push(l),t.visibleSlidesIndexes.push(e)),Un(l,m,n.slideVisibleClass),Un(l,h,n.slideFullyVisibleClass),l.progress=o?-c:c,l.originalProgress=o?-d:d}},updateProgress:function(e){const t=this;if(void 0===e){const n=t.rtlTranslate?-1:1;e=t&&t.translate&&t.translate*n||0}const n=t.params,r=t.maxTranslate()-t.minTranslate();let{progress:o,isBeginning:i,isEnd:a,progressLoop:s}=t;const l=i,u=a;if(0===r)o=0,i=!0,a=!0;else{o=(e-t.minTranslate())/r;const n=Math.abs(e-t.minTranslate())<1,s=Math.abs(e-t.maxTranslate())<1;i=n||o<=0,a=s||o>=1,n&&(o=0),s&&(o=1)}if(n.loop){const n=t.getSlideIndexByData(0),r=t.getSlideIndexByData(t.slides.length-1),o=t.slidesGrid[n],i=t.slidesGrid[r],a=t.slidesGrid[t.slidesGrid.length-1],l=Math.abs(e);s=l>=o?(l-o)/a:(l+a-i)/a,s>1&&(s-=1)}Object.assign(t,{progress:o,progressLoop:s,isBeginning:i,isEnd:a}),(n.watchSlidesProgress||n.centeredSlides&&n.autoHeight)&&t.updateSlidesProgress(e),i&&!l&&t.emit("reachBeginning toEdge"),a&&!u&&t.emit("reachEnd toEdge"),(l&&!i||u&&!a)&&t.emit("fromEdge"),t.emit("progress",o)},updateSlidesClasses:function(){const e=this,{slides:t,params:n,slidesEl:r,activeIndex:o}=e,i=e.virtual&&n.virtual.enabled,a=e.grid&&n.grid&&n.grid.rows>1,s=e=>Nn(r,`.${n.slideClass}${e}, swiper-slide${e}`)[0];let l,u,c;if(i)if(n.loop){let t=o-e.virtual.slidesBefore;t<0&&(t=e.virtual.slides.length+t),t>=e.virtual.slides.length&&(t-=e.virtual.slides.length),l=s(`[data-swiper-slide-index="${t}"]`)}else l=s(`[data-swiper-slide-index="${o}"]`);else a?(l=t.filter(e=>e.column===o)[0],c=t.filter(e=>e.column===o+1)[0],u=t.filter(e=>e.column===o-1)[0]):l=t[o];l&&(a||(c=function(e,t){const n=[];for(;e.nextElementSibling;){const r=e.nextElementSibling;t?r.matches(t)&&n.push(r):n.push(r),e=r}return n}(l,`.${n.slideClass}, swiper-slide`)[0],n.loop&&!c&&(c=t[0]),u=function(e,t){const n=[];for(;e.previousElementSibling;){const r=e.previousElementSibling;t?r.matches(t)&&n.push(r):n.push(r),e=r}return n}(l,`.${n.slideClass}, swiper-slide`)[0],n.loop&&0===!u&&(u=t[t.length-1]))),t.forEach(e=>{Hn(e,e===l,n.slideActiveClass),Hn(e,e===c,n.slideNextClass),Hn(e,e===u,n.slidePrevClass)}),e.emitSlidesClasses()},updateActiveIndex:function(e){const t=this,n=t.rtlTranslate?t.translate:-t.translate,{snapGrid:r,params:o,activeIndex:i,realIndex:a,snapIndex:s}=t;let l,u=e;const c=e=>{let n=e-t.virtual.slidesBefore;return n<0&&(n=t.virtual.slides.length+n),n>=t.virtual.slides.length&&(n-=t.virtual.slides.length),n};if(void 0===u&&(u=function(e){const{slidesGrid:t,params:n}=e,r=e.rtlTranslate?e.translate:-e.translate;let o;for(let e=0;e<t.length;e+=1)void 0!==t[e+1]?r>=t[e]&&r<t[e+1]-(t[e+1]-t[e])/2?o=e:r>=t[e]&&r<t[e+1]&&(o=e+1):r>=t[e]&&(o=e);return n.normalizeSlideIndex&&(o<0||void 0===o)&&(o=0),o}(t)),r.indexOf(n)>=0)l=r.indexOf(n);else{const e=Math.min(o.slidesPerGroupSkip,u);l=e+Math.floor((u-e)/o.slidesPerGroup)}if(l>=r.length&&(l=r.length-1),u===i&&!t.params.loop)return void(l!==s&&(t.snapIndex=l,t.emit("snapIndexChange")));if(u===i&&t.params.loop&&t.virtual&&t.params.virtual.enabled)return void(t.realIndex=c(u));const d=t.grid&&o.grid&&o.grid.rows>1;let f;if(t.virtual&&o.virtual.enabled&&o.loop)f=c(u);else if(d){const e=t.slides.filter(e=>e.column===u)[0];let n=parseInt(e.getAttribute("data-swiper-slide-index"),10);Number.isNaN(n)&&(n=Math.max(t.slides.indexOf(e),0)),f=Math.floor(n/o.grid.rows)}else if(t.slides[u]){const e=t.slides[u].getAttribute("data-swiper-slide-index");f=e?parseInt(e,10):u}else f=u;Object.assign(t,{previousSnapIndex:s,snapIndex:l,previousRealIndex:a,realIndex:f,previousIndex:i,activeIndex:u}),t.initialized&&qn(t),t.emit("activeIndexChange"),t.emit("snapIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&(a!==f&&t.emit("realIndexChange"),t.emit("slideChange"))},updateClickedSlide:function(e,t){const n=this,r=n.params;let o=e.closest(`.${r.slideClass}, swiper-slide`);!o&&n.isElement&&t&&t.length>1&&t.includes(e)&&[...t.slice(t.indexOf(e)+1,t.length)].forEach(e=>{!o&&e.matches&&e.matches(`.${r.slideClass}, swiper-slide`)&&(o=e)});let i,a=!1;if(o)for(let e=0;e<n.slides.length;e+=1)if(n.slides[e]===o){a=!0,i=e;break}if(!o||!a)return n.clickedSlide=void 0,void(n.clickedIndex=void 0);n.clickedSlide=o,n.virtual&&n.params.virtual.enabled?n.clickedIndex=parseInt(o.getAttribute("data-swiper-slide-index"),10):n.clickedIndex=i,r.slideToClickedSlide&&void 0!==n.clickedIndex&&n.clickedIndex!==n.activeIndex&&n.slideToClickedSlide()}};var Xn={getTranslate:function(e){void 0===e&&(e=this.isHorizontal()?"x":"y");const{params:t,rtlTranslate:n,translate:r,wrapperEl:o}=this;if(t.virtualTranslate)return n?-r:r;if(t.cssMode)return r;let i=En(o,e);return i+=this.cssOverflowAdjustment(),n&&(i=-i),i||0},setTranslate:function(e,t){const n=this,{rtlTranslate:r,params:o,wrapperEl:i,progress:a}=n;let s,l=0,u=0;n.isHorizontal()?l=r?-e:e:u=e,o.roundLengths&&(l=Math.floor(l),u=Math.floor(u)),n.previousTranslate=n.translate,n.translate=n.isHorizontal()?l:u,o.cssMode?i[n.isHorizontal()?"scrollLeft":"scrollTop"]=n.isHorizontal()?-l:-u:o.virtualTranslate||(n.isHorizontal()?l-=n.cssOverflowAdjustment():u-=n.cssOverflowAdjustment(),i.style.transform=`translate3d(${l}px, ${u}px, 0px)`);const c=n.maxTranslate()-n.minTranslate();s=0===c?0:(e-n.minTranslate())/c,s!==a&&n.updateProgress(e),n.emit("setTranslate",n.translate,t)},minTranslate:function(){return-this.snapGrid[0]},maxTranslate:function(){return-this.snapGrid[this.snapGrid.length-1]},translateTo:function(e,t,n,r,o){void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===n&&(n=!0),void 0===r&&(r=!0);const i=this,{params:a,wrapperEl:s}=i;if(i.animating&&a.preventInteractionOnTransition)return!1;const l=i.minTranslate(),u=i.maxTranslate();let c;if(c=r&&e>l?l:r&&e<u?u:e,i.updateProgress(c),a.cssMode){const e=i.isHorizontal();if(0===t)s[e?"scrollLeft":"scrollTop"]=-c;else{if(!i.support.smoothScroll)return On({swiper:i,targetPosition:-c,side:e?"left":"top"}),!0;s.scrollTo({[e?"left":"top"]:-c,behavior:"smooth"})}return!0}return 0===t?(i.setTransition(0),i.setTranslate(c),n&&(i.emit("beforeTransitionStart",t,o),i.emit("transitionEnd"))):(i.setTransition(t),i.setTranslate(c),n&&(i.emit("beforeTransitionStart",t,o),i.emit("transitionStart")),i.animating||(i.animating=!0,i.onTranslateToWrapperTransitionEnd||(i.onTranslateToWrapperTransitionEnd=function(e){i&&!i.destroyed&&e.target===this&&(i.wrapperEl.removeEventListener("transitionend",i.onTranslateToWrapperTransitionEnd),i.onTranslateToWrapperTransitionEnd=null,delete i.onTranslateToWrapperTransitionEnd,i.animating=!1,n&&i.emit("transitionEnd"))}),i.wrapperEl.addEventListener("transitionend",i.onTranslateToWrapperTransitionEnd))),!0}};function Kn(e){let{swiper:t,runCallbacks:n,direction:r,step:o}=e;const{activeIndex:i,previousIndex:a}=t;let s=r;if(s||(s=i>a?"next":i<a?"prev":"reset"),t.emit(`transition${o}`),n&&i!==a){if("reset"===s)return void t.emit(`slideResetTransition${o}`);t.emit(`slideChangeTransition${o}`),"next"===s?t.emit(`slideNextTransition${o}`):t.emit(`slidePrevTransition${o}`)}}var Qn={setTransition:function(e,t){const n=this;n.params.cssMode||(n.wrapperEl.style.transitionDuration=`${e}ms`,n.wrapperEl.style.transitionDelay=0===e?"0ms":""),n.emit("setTransition",e,t)},transitionStart:function(e,t){void 0===e&&(e=!0);const n=this,{params:r}=n;r.cssMode||(r.autoHeight&&n.updateAutoHeight(),Kn({swiper:n,runCallbacks:e,direction:t,step:"Start"}))},transitionEnd:function(e,t){void 0===e&&(e=!0);const n=this,{params:r}=n;n.animating=!1,r.cssMode||(n.setTransition(0),Kn({swiper:n,runCallbacks:e,direction:t,step:"End"}))}};var Zn={slideTo:function(e,t,n,r,o){void 0===e&&(e=0),void 0===n&&(n=!0),"string"==typeof e&&(e=parseInt(e,10));const i=this;let a=e;a<0&&(a=0);const{params:s,snapGrid:l,slidesGrid:u,previousIndex:c,activeIndex:d,rtlTranslate:f,wrapperEl:p,enabled:h}=i;if(!h&&!r&&!o||i.destroyed||i.animating&&s.preventInteractionOnTransition)return!1;void 0===t&&(t=i.params.speed);const m=Math.min(i.params.slidesPerGroupSkip,a);let g=m+Math.floor((a-m)/i.params.slidesPerGroup);g>=l.length&&(g=l.length-1);const v=-l[g];if(s.normalizeSlideIndex)for(let e=0;e<u.length;e+=1){const t=-Math.floor(100*v),n=Math.floor(100*u[e]),r=Math.floor(100*u[e+1]);void 0!==u[e+1]?t>=n&&t<r-(r-n)/2?a=e:t>=n&&t<r&&(a=e+1):t>=n&&(a=e)}if(i.initialized&&a!==d){if(!i.allowSlideNext&&(f?v>i.translate&&v>i.minTranslate():v<i.translate&&v<i.minTranslate()))return!1;if(!i.allowSlidePrev&&v>i.translate&&v>i.maxTranslate()&&(d||0)!==a)return!1}let b;a!==(c||0)&&n&&i.emit("beforeSlideChangeStart"),i.updateProgress(v),b=a>d?"next":a<d?"prev":"reset";const y=i.virtual&&i.params.virtual.enabled;if(!(y&&o)&&(f&&-v===i.translate||!f&&v===i.translate))return i.updateActiveIndex(a),s.autoHeight&&i.updateAutoHeight(),i.updateSlidesClasses(),"slide"!==s.effect&&i.setTranslate(v),"reset"!==b&&(i.transitionStart(n,b),i.transitionEnd(n,b)),!1;if(s.cssMode){const e=i.isHorizontal(),n=f?v:-v;if(0===t)y&&(i.wrapperEl.style.scrollSnapType="none",i._immediateVirtual=!0),y&&!i._cssModeVirtualInitialSet&&i.params.initialSlide>0?(i._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{p[e?"scrollLeft":"scrollTop"]=n})):p[e?"scrollLeft":"scrollTop"]=n,y&&requestAnimationFrame(()=>{i.wrapperEl.style.scrollSnapType="",i._immediateVirtual=!1});else{if(!i.support.smoothScroll)return On({swiper:i,targetPosition:n,side:e?"left":"top"}),!0;p.scrollTo({[e?"left":"top"]:n,behavior:"smooth"})}return!0}return i.setTransition(t),i.setTranslate(v),i.updateActiveIndex(a),i.updateSlidesClasses(),i.emit("beforeTransitionStart",t,r),i.transitionStart(n,b),0===t?i.transitionEnd(n,b):i.animating||(i.animating=!0,i.onSlideToWrapperTransitionEnd||(i.onSlideToWrapperTransitionEnd=function(e){i&&!i.destroyed&&e.target===this&&(i.wrapperEl.removeEventListener("transitionend",i.onSlideToWrapperTransitionEnd),i.onSlideToWrapperTransitionEnd=null,delete i.onSlideToWrapperTransitionEnd,i.transitionEnd(n,b))}),i.wrapperEl.addEventListener("transitionend",i.onSlideToWrapperTransitionEnd)),!0},slideToLoop:function(e,t,n,r){if(void 0===e&&(e=0),void 0===n&&(n=!0),"string"==typeof e){e=parseInt(e,10)}const o=this;if(o.destroyed)return;void 0===t&&(t=o.params.speed);const i=o.grid&&o.params.grid&&o.params.grid.rows>1;let a=e;if(o.params.loop)if(o.virtual&&o.params.virtual.enabled)a+=o.virtual.slidesBefore;else{let e;if(i){const t=a*o.params.grid.rows;e=o.slides.filter(e=>1*e.getAttribute("data-swiper-slide-index")===t)[0].column}else e=o.getSlideIndexByData(a);const t=i?Math.ceil(o.slides.length/o.params.grid.rows):o.slides.length,{centeredSlides:n}=o.params;let s=o.params.slidesPerView;"auto"===s?s=o.slidesPerViewDynamic():(s=Math.ceil(parseFloat(o.params.slidesPerView,10)),n&&s%2==0&&(s+=1));let l=t-e<s;if(n&&(l=l||e<Math.ceil(s/2)),r&&n&&"auto"!==o.params.slidesPerView&&!i&&(l=!1),l){const r=n?e<o.activeIndex?"prev":"next":e-o.activeIndex-1<o.params.slidesPerView?"next":"prev";o.loopFix({direction:r,slideTo:!0,activeSlideIndex:"next"===r?e+1:e-t+1,slideRealIndex:"next"===r?o.realIndex:void 0})}if(i){const e=a*o.params.grid.rows;a=o.slides.filter(t=>1*t.getAttribute("data-swiper-slide-index")===e)[0].column}else a=o.getSlideIndexByData(a)}return requestAnimationFrame(()=>{o.slideTo(a,t,n,r)}),o},slideNext:function(e,t,n){void 0===t&&(t=!0);const r=this,{enabled:o,params:i,animating:a}=r;if(!o||r.destroyed)return r;void 0===e&&(e=r.params.speed);let s=i.slidesPerGroup;"auto"===i.slidesPerView&&1===i.slidesPerGroup&&i.slidesPerGroupAuto&&(s=Math.max(r.slidesPerViewDynamic("current",!0),1));const l=r.activeIndex<i.slidesPerGroupSkip?1:s,u=r.virtual&&i.virtual.enabled;if(i.loop){if(a&&!u&&i.loopPreventsSliding)return!1;if(r.loopFix({direction:"next"}),r._clientLeft=r.wrapperEl.clientLeft,r.activeIndex===r.slides.length-1&&i.cssMode)return requestAnimationFrame(()=>{r.slideTo(r.activeIndex+l,e,t,n)}),!0}return i.rewind&&r.isEnd?r.slideTo(0,e,t,n):r.slideTo(r.activeIndex+l,e,t,n)},slidePrev:function(e,t,n){void 0===t&&(t=!0);const r=this,{params:o,snapGrid:i,slidesGrid:a,rtlTranslate:s,enabled:l,animating:u}=r;if(!l||r.destroyed)return r;void 0===e&&(e=r.params.speed);const c=r.virtual&&o.virtual.enabled;if(o.loop){if(u&&!c&&o.loopPreventsSliding)return!1;r.loopFix({direction:"prev"}),r._clientLeft=r.wrapperEl.clientLeft}function d(e){return e<0?-Math.floor(Math.abs(e)):Math.floor(e)}const f=d(s?r.translate:-r.translate),p=i.map(e=>d(e));let h=i[p.indexOf(f)-1];if(void 0===h&&o.cssMode){let e;i.forEach((t,n)=>{f>=t&&(e=n)}),void 0!==e&&(h=i[e>0?e-1:e])}let m=0;if(void 0!==h&&(m=a.indexOf(h),m<0&&(m=r.activeIndex-1),"auto"===o.slidesPerView&&1===o.slidesPerGroup&&o.slidesPerGroupAuto&&(m=m-r.slidesPerViewDynamic("previous",!0)+1,m=Math.max(m,0))),o.rewind&&r.isBeginning){const o=r.params.virtual&&r.params.virtual.enabled&&r.virtual?r.virtual.slides.length-1:r.slides.length-1;return r.slideTo(o,e,t,n)}return o.loop&&0===r.activeIndex&&o.cssMode?(requestAnimationFrame(()=>{r.slideTo(m,e,t,n)}),!0):r.slideTo(m,e,t,n)},slideReset:function(e,t,n){void 0===t&&(t=!0);const r=this;if(!r.destroyed)return void 0===e&&(e=r.params.speed),r.slideTo(r.activeIndex,e,t,n)},slideToClosest:function(e,t,n,r){void 0===t&&(t=!0),void 0===r&&(r=.5);const o=this;if(o.destroyed)return;void 0===e&&(e=o.params.speed);let i=o.activeIndex;const a=Math.min(o.params.slidesPerGroupSkip,i),s=a+Math.floor((i-a)/o.params.slidesPerGroup),l=o.rtlTranslate?o.translate:-o.translate;if(l>=o.snapGrid[s]){const e=o.snapGrid[s];l-e>(o.snapGrid[s+1]-e)*r&&(i+=o.params.slidesPerGroup)}else{const e=o.snapGrid[s-1];l-e<=(o.snapGrid[s]-e)*r&&(i-=o.params.slidesPerGroup)}return i=Math.max(i,0),i=Math.min(i,o.slidesGrid.length-1),o.slideTo(i,e,t,n)},slideToClickedSlide:function(){const e=this;if(e.destroyed)return;const{params:t,slidesEl:n}=e,r="auto"===t.slidesPerView?e.slidesPerViewDynamic():t.slidesPerView;let o,i=e.clickedIndex;const a=e.isElement?"swiper-slide":`.${t.slideClass}`;if(t.loop){if(e.animating)return;o=parseInt(e.clickedSlide.getAttribute("data-swiper-slide-index"),10),t.centeredSlides?i<e.loopedSlides-r/2||i>e.slides.length-e.loopedSlides+r/2?(e.loopFix(),i=e.getSlideIndex(Nn(n,`${a}[data-swiper-slide-index="${o}"]`)[0]),xn(()=>{e.slideTo(i)})):e.slideTo(i):i>e.slides.length-r?(e.loopFix(),i=e.getSlideIndex(Nn(n,`${a}[data-swiper-slide-index="${o}"]`)[0]),xn(()=>{e.slideTo(i)})):e.slideTo(i)}else e.slideTo(i)}};var Jn={loopCreate:function(e){const t=this,{params:n,slidesEl:r}=t;if(!n.loop||t.virtual&&t.params.virtual.enabled)return;const o=()=>{Nn(r,`.${n.slideClass}, swiper-slide`).forEach((e,t)=>{e.setAttribute("data-swiper-slide-index",t)})},i=t.grid&&n.grid&&n.grid.rows>1,a=n.slidesPerGroup*(i?n.grid.rows:1),s=t.slides.length%a!==0,l=i&&t.slides.length%n.grid.rows!==0,u=e=>{for(let r=0;r<e;r+=1){const e=t.isElement?Rn("swiper-slide",[n.slideBlankClass]):Rn("div",[n.slideClass,n.slideBlankClass]);t.slidesEl.append(e)}};if(s){if(n.loopAddBlankSlides){u(a-t.slides.length%a),t.recalcSlides(),t.updateSlides()}else _n("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");o()}else if(l){if(n.loopAddBlankSlides){u(n.grid.rows-t.slides.length%n.grid.rows),t.recalcSlides(),t.updateSlides()}else _n("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");o()}else o();t.loopFix({slideRealIndex:e,direction:n.centeredSlides?void 0:"next"})},loopFix:function(e){let{slideRealIndex:t,slideTo:n=!0,direction:r,setTranslate:o,activeSlideIndex:i,byController:a,byMousewheel:s}=void 0===e?{}:e;const l=this;if(!l.params.loop)return;l.emit("beforeLoopFix");const{slides:u,allowSlidePrev:c,allowSlideNext:d,slidesEl:f,params:p}=l,{centeredSlides:h}=p;if(l.allowSlidePrev=!0,l.allowSlideNext=!0,l.virtual&&p.virtual.enabled)return n&&(p.centeredSlides||0!==l.snapIndex?p.centeredSlides&&l.snapIndex<p.slidesPerView?l.slideTo(l.virtual.slides.length+l.snapIndex,0,!1,!0):l.snapIndex===l.snapGrid.length-1&&l.slideTo(l.virtual.slidesBefore,0,!1,!0):l.slideTo(l.virtual.slides.length,0,!1,!0)),l.allowSlidePrev=c,l.allowSlideNext=d,void l.emit("loopFix");let m=p.slidesPerView;"auto"===m?m=l.slidesPerViewDynamic():(m=Math.ceil(parseFloat(p.slidesPerView,10)),h&&m%2==0&&(m+=1));const g=p.slidesPerGroupAuto?m:p.slidesPerGroup;let v=g;v%g!==0&&(v+=g-v%g),v+=p.loopAdditionalSlides,l.loopedSlides=v;const b=l.grid&&p.grid&&p.grid.rows>1;u.length<m+v?_n("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled and not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters"):b&&"row"===p.grid.fill&&_n("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const y=[],w=[];let x=l.activeIndex;void 0===i?i=l.getSlideIndex(u.filter(e=>e.classList.contains(p.slideActiveClass))[0]):x=i;const S="next"===r||!r,E="prev"===r||!r;let k=0,C=0;const T=b?Math.ceil(u.length/p.grid.rows):u.length,P=(b?u[i].column:i)+(h&&void 0===o?-m/2+.5:0);if(P<v){k=Math.max(v-P,g);for(let e=0;e<v-P;e+=1){const t=e-Math.floor(e/T)*T;if(b){const e=T-t-1;for(let t=u.length-1;t>=0;t-=1)u[t].column===e&&y.push(t)}else y.push(T-t-1)}}else if(P+m>T-v){C=Math.max(P-(T-2*v),g);for(let e=0;e<C;e+=1){const t=e-Math.floor(e/T)*T;b?u.forEach((e,n)=>{e.column===t&&w.push(n)}):w.push(t)}}if(l.__preventObserver__=!0,requestAnimationFrame(()=>{l.__preventObserver__=!1}),E&&y.forEach(e=>{u[e].swiperLoopMoveDOM=!0,f.prepend(u[e]),u[e].swiperLoopMoveDOM=!1}),S&&w.forEach(e=>{u[e].swiperLoopMoveDOM=!0,f.append(u[e]),u[e].swiperLoopMoveDOM=!1}),l.recalcSlides(),"auto"===p.slidesPerView?l.updateSlides():b&&(y.length>0&&E||w.length>0&&S)&&l.slides.forEach((e,t)=>{l.grid.updateSlide(t,e,l.slides)}),p.watchSlidesProgress&&l.updateSlidesOffset(),n)if(y.length>0&&E){if(void 0===t){const e=l.slidesGrid[x],t=l.slidesGrid[x+k]-e;s?l.setTranslate(l.translate-t):(l.slideTo(x+Math.ceil(k),0,!1,!0),o&&(l.touchEventsData.startTranslate=l.touchEventsData.startTranslate-t,l.touchEventsData.currentTranslate=l.touchEventsData.currentTranslate-t))}else if(o){const e=b?y.length/p.grid.rows:y.length;l.slideTo(l.activeIndex+e,0,!1,!0),l.touchEventsData.currentTranslate=l.translate}}else if(w.length>0&&S)if(void 0===t){const e=l.slidesGrid[x],t=l.slidesGrid[x-C]-e;s?l.setTranslate(l.translate-t):(l.slideTo(x-C,0,!1,!0),o&&(l.touchEventsData.startTranslate=l.touchEventsData.startTranslate-t,l.touchEventsData.currentTranslate=l.touchEventsData.currentTranslate-t))}else{const e=b?w.length/p.grid.rows:w.length;l.slideTo(l.activeIndex-e,0,!1,!0)}if(l.allowSlidePrev=c,l.allowSlideNext=d,l.controller&&l.controller.control&&!a){const e={slideRealIndex:t,direction:r,setTranslate:o,activeSlideIndex:i,byController:!0};Array.isArray(l.controller.control)?l.controller.control.forEach(t=>{!t.destroyed&&t.params.loop&&t.loopFix({...e,slideTo:t.params.slidesPerView===p.slidesPerView&&n})}):l.controller.control instanceof l.constructor&&l.controller.control.params.loop&&l.controller.control.loopFix({...e,slideTo:l.controller.control.params.slidesPerView===p.slidesPerView&&n})}l.emit("loopFix")},loopDestroy:function(){const e=this,{params:t,slidesEl:n}=e;if(!t.loop||e.virtual&&e.params.virtual.enabled)return;e.recalcSlides();const r=[];e.slides.forEach(e=>{const t=void 0===e.swiperSlideIndex?1*e.getAttribute("data-swiper-slide-index"):e.swiperSlideIndex;r[t]=e}),e.slides.forEach(e=>{e.removeAttribute("data-swiper-slide-index")}),r.forEach(e=>{n.append(e)}),e.recalcSlides(),e.slideTo(e.realIndex,0)}};function er(e,t,n){const r=wn(),{params:o}=e,i=o.edgeSwipeDetection,a=o.edgeSwipeThreshold;return!i||!(n<=a||n>=r.innerWidth-a)||"prevent"===i&&(t.preventDefault(),!0)}function tr(e){const t=this,n=bn();let r=e;r.originalEvent&&(r=r.originalEvent);const o=t.touchEventsData;if("pointerdown"===r.type){if(null!==o.pointerId&&o.pointerId!==r.pointerId)return;o.pointerId=r.pointerId}else"touchstart"===r.type&&1===r.targetTouches.length&&(o.touchId=r.targetTouches[0].identifier);if("touchstart"===r.type)return void er(t,r,r.targetTouches[0].pageX);const{params:i,touches:a,enabled:s}=t;if(!s)return;if(!i.simulateTouch&&"mouse"===r.pointerType)return;if(t.animating&&i.preventInteractionOnTransition)return;!t.animating&&i.cssMode&&i.loop&&t.loopFix();let l=r.target;if("wrapper"===i.touchEventsTarget&&!function(e,t){const n=t.contains(e);if(!n&&t instanceof HTMLSlotElement)return[...t.assignedElements()].includes(e);return n}(l,t.wrapperEl))return;if("which"in r&&3===r.which)return;if("button"in r&&r.button>0)return;if(o.isTouched&&o.isMoved)return;const u=!!i.noSwipingClass&&""!==i.noSwipingClass,c=r.composedPath?r.composedPath():r.path;u&&r.target&&r.target.shadowRoot&&c&&(l=c[0]);const d=i.noSwipingSelector?i.noSwipingSelector:`.${i.noSwipingClass}`,f=!(!r.target||!r.target.shadowRoot);if(i.noSwiping&&(f?function(e,t){return void 0===t&&(t=this),function t(n){if(!n||n===bn()||n===wn())return null;n.assignedSlot&&(n=n.assignedSlot);const r=n.closest(e);return r||n.getRootNode?r||t(n.getRootNode().host):null}(t)}(d,l):l.closest(d)))return void(t.allowClick=!0);if(i.swipeHandler&&!l.closest(i.swipeHandler))return;a.currentX=r.pageX,a.currentY=r.pageY;const p=a.currentX,h=a.currentY;if(!er(t,r,p))return;Object.assign(o,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),a.startX=p,a.startY=h,o.touchStartTime=Sn(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,i.threshold>0&&(o.allowThresholdMove=!1);let m=!0;l.matches(o.focusableElements)&&(m=!1,"SELECT"===l.nodeName&&(o.isTouched=!1)),n.activeElement&&n.activeElement.matches(o.focusableElements)&&n.activeElement!==l&&("mouse"===r.pointerType||"mouse"!==r.pointerType&&!l.matches(o.focusableElements))&&n.activeElement.blur();const g=m&&t.allowTouchMove&&i.touchStartPreventDefault;!i.touchStartForcePreventDefault&&!g||l.isContentEditable||r.preventDefault(),i.freeMode&&i.freeMode.enabled&&t.freeMode&&t.animating&&!i.cssMode&&t.freeMode.onTouchStart(),t.emit("touchStart",r)}function nr(e){const t=bn(),n=this,r=n.touchEventsData,{params:o,touches:i,rtlTranslate:a,enabled:s}=n;if(!s)return;if(!o.simulateTouch&&"mouse"===e.pointerType)return;let l,u=e;if(u.originalEvent&&(u=u.originalEvent),"pointermove"===u.type){if(null!==r.touchId)return;if(u.pointerId!==r.pointerId)return}if("touchmove"===u.type){if(l=[...u.changedTouches].filter(e=>e.identifier===r.touchId)[0],!l||l.identifier!==r.touchId)return}else l=u;if(!r.isTouched)return void(r.startMoving&&r.isScrolling&&n.emit("touchMoveOpposite",u));const c=l.pageX,d=l.pageY;if(u.preventedByNestedSwiper)return i.startX=c,void(i.startY=d);if(!n.allowTouchMove)return u.target.matches(r.focusableElements)||(n.allowClick=!1),void(r.isTouched&&(Object.assign(i,{startX:c,startY:d,currentX:c,currentY:d}),r.touchStartTime=Sn()));if(o.touchReleaseOnEdges&&!o.loop)if(n.isVertical()){if(d<i.startY&&n.translate<=n.maxTranslate()||d>i.startY&&n.translate>=n.minTranslate())return r.isTouched=!1,void(r.isMoved=!1)}else if(c<i.startX&&n.translate<=n.maxTranslate()||c>i.startX&&n.translate>=n.minTranslate())return;if(t.activeElement&&t.activeElement.matches(r.focusableElements)&&t.activeElement!==u.target&&"mouse"!==u.pointerType&&t.activeElement.blur(),t.activeElement&&u.target===t.activeElement&&u.target.matches(r.focusableElements))return r.isMoved=!0,void(n.allowClick=!1);r.allowTouchCallbacks&&n.emit("touchMove",u),i.previousX=i.currentX,i.previousY=i.currentY,i.currentX=c,i.currentY=d;const f=i.currentX-i.startX,p=i.currentY-i.startY;if(n.params.threshold&&Math.sqrt(f**2+p**2)<n.params.threshold)return;if(void 0===r.isScrolling){let e;n.isHorizontal()&&i.currentY===i.startY||n.isVertical()&&i.currentX===i.startX?r.isScrolling=!1:f*f+p*p>=25&&(e=180*Math.atan2(Math.abs(p),Math.abs(f))/Math.PI,r.isScrolling=n.isHorizontal()?e>o.touchAngle:90-e>o.touchAngle)}if(r.isScrolling&&n.emit("touchMoveOpposite",u),void 0===r.startMoving&&(i.currentX===i.startX&&i.currentY===i.startY||(r.startMoving=!0)),r.isScrolling||"touchmove"===u.type&&r.preventTouchMoveFromPointerMove)return void(r.isTouched=!1);if(!r.startMoving)return;n.allowClick=!1,!o.cssMode&&u.cancelable&&u.preventDefault(),o.touchMoveStopPropagation&&!o.nested&&u.stopPropagation();let h=n.isHorizontal()?f:p,m=n.isHorizontal()?i.currentX-i.previousX:i.currentY-i.previousY;o.oneWayMovement&&(h=Math.abs(h)*(a?1:-1),m=Math.abs(m)*(a?1:-1)),i.diff=h,h*=o.touchRatio,a&&(h=-h,m=-m);const g=n.touchesDirection;n.swipeDirection=h>0?"prev":"next",n.touchesDirection=m>0?"prev":"next";const v=n.params.loop&&!o.cssMode,b="next"===n.touchesDirection&&n.allowSlideNext||"prev"===n.touchesDirection&&n.allowSlidePrev;if(!r.isMoved){if(v&&b&&n.loopFix({direction:n.swipeDirection}),r.startTranslate=n.getTranslate(),n.setTransition(0),n.animating){const e=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0,detail:{bySwiperTouchMove:!0}});n.wrapperEl.dispatchEvent(e)}r.allowMomentumBounce=!1,!o.grabCursor||!0!==n.allowSlideNext&&!0!==n.allowSlidePrev||n.setGrabCursor(!0),n.emit("sliderFirstMove",u)}if((new Date).getTime(),r.isMoved&&r.allowThresholdMove&&g!==n.touchesDirection&&v&&b&&Math.abs(h)>=1)return Object.assign(i,{startX:c,startY:d,currentX:c,currentY:d,startTranslate:r.currentTranslate}),r.loopSwapReset=!0,void(r.startTranslate=r.currentTranslate);n.emit("sliderMove",u),r.isMoved=!0,r.currentTranslate=h+r.startTranslate;let y=!0,w=o.resistanceRatio;if(o.touchReleaseOnEdges&&(w=0),h>0?(v&&b&&r.allowThresholdMove&&r.currentTranslate>(o.centeredSlides?n.minTranslate()-n.slidesSizesGrid[n.activeIndex+1]-("auto"!==o.slidesPerView&&n.slides.length-o.slidesPerView>=2?n.slidesSizesGrid[n.activeIndex+1]+n.params.spaceBetween:0)-n.params.spaceBetween:n.minTranslate())&&n.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),r.currentTranslate>n.minTranslate()&&(y=!1,o.resistance&&(r.currentTranslate=n.minTranslate()-1+(-n.minTranslate()+r.startTranslate+h)**w))):h<0&&(v&&b&&r.allowThresholdMove&&r.currentTranslate<(o.centeredSlides?n.maxTranslate()+n.slidesSizesGrid[n.slidesSizesGrid.length-1]+n.params.spaceBetween+("auto"!==o.slidesPerView&&n.slides.length-o.slidesPerView>=2?n.slidesSizesGrid[n.slidesSizesGrid.length-1]+n.params.spaceBetween:0):n.maxTranslate())&&n.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:n.slides.length-("auto"===o.slidesPerView?n.slidesPerViewDynamic():Math.ceil(parseFloat(o.slidesPerView,10)))}),r.currentTranslate<n.maxTranslate()&&(y=!1,o.resistance&&(r.currentTranslate=n.maxTranslate()+1-(n.maxTranslate()-r.startTranslate-h)**w))),y&&(u.preventedByNestedSwiper=!0),!n.allowSlideNext&&"next"===n.swipeDirection&&r.currentTranslate<r.startTranslate&&(r.currentTranslate=r.startTranslate),!n.allowSlidePrev&&"prev"===n.swipeDirection&&r.currentTranslate>r.startTranslate&&(r.currentTranslate=r.startTranslate),n.allowSlidePrev||n.allowSlideNext||(r.currentTranslate=r.startTranslate),o.threshold>0){if(!(Math.abs(h)>o.threshold||r.allowThresholdMove))return void(r.currentTranslate=r.startTranslate);if(!r.allowThresholdMove)return r.allowThresholdMove=!0,i.startX=i.currentX,i.startY=i.currentY,r.currentTranslate=r.startTranslate,void(i.diff=n.isHorizontal()?i.currentX-i.startX:i.currentY-i.startY)}o.followFinger&&!o.cssMode&&((o.freeMode&&o.freeMode.enabled&&n.freeMode||o.watchSlidesProgress)&&(n.updateActiveIndex(),n.updateSlidesClasses()),o.freeMode&&o.freeMode.enabled&&n.freeMode&&n.freeMode.onTouchMove(),n.updateProgress(r.currentTranslate),n.setTranslate(r.currentTranslate))}function rr(e){const t=this,n=t.touchEventsData;let r,o=e;o.originalEvent&&(o=o.originalEvent);if("touchend"===o.type||"touchcancel"===o.type){if(r=[...o.changedTouches].filter(e=>e.identifier===n.touchId)[0],!r||r.identifier!==n.touchId)return}else{if(null!==n.touchId)return;if(o.pointerId!==n.pointerId)return;r=o}if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(o.type)){if(!(["pointercancel","contextmenu"].includes(o.type)&&(t.browser.isSafari||t.browser.isWebView)))return}n.pointerId=null,n.touchId=null;const{params:i,touches:a,rtlTranslate:s,slidesGrid:l,enabled:u}=t;if(!u)return;if(!i.simulateTouch&&"mouse"===o.pointerType)return;if(n.allowTouchCallbacks&&t.emit("touchEnd",o),n.allowTouchCallbacks=!1,!n.isTouched)return n.isMoved&&i.grabCursor&&t.setGrabCursor(!1),n.isMoved=!1,void(n.startMoving=!1);i.grabCursor&&n.isMoved&&n.isTouched&&(!0===t.allowSlideNext||!0===t.allowSlidePrev)&&t.setGrabCursor(!1);const c=Sn(),d=c-n.touchStartTime;if(t.allowClick){const e=o.path||o.composedPath&&o.composedPath();t.updateClickedSlide(e&&e[0]||o.target,e),t.emit("tap click",o),d<300&&c-n.lastClickTime<300&&t.emit("doubleTap doubleClick",o)}if(n.lastClickTime=Sn(),xn(()=>{t.destroyed||(t.allowClick=!0)}),!n.isTouched||!n.isMoved||!t.swipeDirection||0===a.diff&&!n.loopSwapReset||n.currentTranslate===n.startTranslate&&!n.loopSwapReset)return n.isTouched=!1,n.isMoved=!1,void(n.startMoving=!1);let f;if(n.isTouched=!1,n.isMoved=!1,n.startMoving=!1,f=i.followFinger?s?t.translate:-t.translate:-n.currentTranslate,i.cssMode)return;if(i.freeMode&&i.freeMode.enabled)return void t.freeMode.onTouchEnd({currentPos:f});const p=f>=-t.maxTranslate()&&!t.params.loop;let h=0,m=t.slidesSizesGrid[0];for(let e=0;e<l.length;e+=e<i.slidesPerGroupSkip?1:i.slidesPerGroup){const t=e<i.slidesPerGroupSkip-1?1:i.slidesPerGroup;void 0!==l[e+t]?(p||f>=l[e]&&f<l[e+t])&&(h=e,m=l[e+t]-l[e]):(p||f>=l[e])&&(h=e,m=l[l.length-1]-l[l.length-2])}let g=null,v=null;i.rewind&&(t.isBeginning?v=i.virtual&&i.virtual.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(g=0));const b=(f-l[h])/m,y=h<i.slidesPerGroupSkip-1?1:i.slidesPerGroup;if(d>i.longSwipesMs){if(!i.longSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&(b>=i.longSwipesRatio?t.slideTo(i.rewind&&t.isEnd?g:h+y):t.slideTo(h)),"prev"===t.swipeDirection&&(b>1-i.longSwipesRatio?t.slideTo(h+y):null!==v&&b<0&&Math.abs(b)>i.longSwipesRatio?t.slideTo(v):t.slideTo(h))}else{if(!i.shortSwipes)return void t.slideTo(t.activeIndex);t.navigation&&(o.target===t.navigation.nextEl||o.target===t.navigation.prevEl)?o.target===t.navigation.nextEl?t.slideTo(h+y):t.slideTo(h):("next"===t.swipeDirection&&t.slideTo(null!==g?g:h+y),"prev"===t.swipeDirection&&t.slideTo(null!==v?v:h))}}function or(){const e=this,{params:t,el:n}=e;if(n&&0===n.offsetWidth)return;t.breakpoints&&e.setBreakpoint();const{allowSlideNext:r,allowSlidePrev:o,snapGrid:i}=e,a=e.virtual&&e.params.virtual.enabled;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses();const s=a&&t.loop;!("auto"===t.slidesPerView||t.slidesPerView>1)||!e.isEnd||e.isBeginning||e.params.centeredSlides||s?e.params.loop&&!a?e.slideToLoop(e.realIndex,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0):e.slideTo(e.slides.length-1,0,!1,!0),e.autoplay&&e.autoplay.running&&e.autoplay.paused&&(clearTimeout(e.autoplay.resizeTimeout),e.autoplay.resizeTimeout=setTimeout(()=>{e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.resume()},500)),e.allowSlidePrev=o,e.allowSlideNext=r,e.params.watchOverflow&&i!==e.snapGrid&&e.checkOverflow()}function ir(e){const t=this;t.enabled&&(t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation())))}function ar(){const e=this,{wrapperEl:t,rtlTranslate:n,enabled:r}=e;if(!r)return;let o;e.previousTranslate=e.translate,e.isHorizontal()?e.translate=-t.scrollLeft:e.translate=-t.scrollTop,0===e.translate&&(e.translate=0),e.updateActiveIndex(),e.updateSlidesClasses();const i=e.maxTranslate()-e.minTranslate();o=0===i?0:(e.translate-e.minTranslate())/i,o!==e.progress&&e.updateProgress(n?-e.translate:e.translate),e.emit("setTranslate",e.translate,!1)}function sr(e){const t=this;Vn(t,e.target),t.params.cssMode||"auto"!==t.params.slidesPerView&&!t.params.autoHeight||t.update()}function lr(){const e=this;e.documentTouchHandlerProceeded||(e.documentTouchHandlerProceeded=!0,e.params.touchReleaseOnEdges&&(e.el.style.touchAction="auto"))}const ur=(e,t)=>{const n=bn(),{params:r,el:o,wrapperEl:i,device:a}=e,s=!!r.nested,l="on"===t?"addEventListener":"removeEventListener",u=t;o&&"string"!=typeof o&&(n[l]("touchstart",e.onDocumentTouchStart,{passive:!1,capture:s}),o[l]("touchstart",e.onTouchStart,{passive:!1}),o[l]("pointerdown",e.onTouchStart,{passive:!1}),n[l]("touchmove",e.onTouchMove,{passive:!1,capture:s}),n[l]("pointermove",e.onTouchMove,{passive:!1,capture:s}),n[l]("touchend",e.onTouchEnd,{passive:!0}),n[l]("pointerup",e.onTouchEnd,{passive:!0}),n[l]("pointercancel",e.onTouchEnd,{passive:!0}),n[l]("touchcancel",e.onTouchEnd,{passive:!0}),n[l]("pointerout",e.onTouchEnd,{passive:!0}),n[l]("pointerleave",e.onTouchEnd,{passive:!0}),n[l]("contextmenu",e.onTouchEnd,{passive:!0}),(r.preventClicks||r.preventClicksPropagation)&&o[l]("click",e.onClick,!0),r.cssMode&&i[l]("scroll",e.onScroll),r.updateOnWindowResize?e[u](a.ios||a.android?"resize orientationchange observerUpdate":"resize observerUpdate",or,!0):e[u]("observerUpdate",or,!0),o[l]("load",e.onLoad,{capture:!0}))};const cr=(e,t)=>e.grid&&t.grid&&t.grid.rows>1;var dr={setBreakpoint:function(){const e=this,{realIndex:t,initialized:n,params:r,el:o}=e,i=r.breakpoints;if(!i||i&&0===Object.keys(i).length)return;const a=e.getBreakpoint(i,e.params.breakpointsBase,e.el);if(!a||e.currentBreakpoint===a)return;const s=(a in i?i[a]:void 0)||e.originalParams,l=cr(e,r),u=cr(e,s),c=e.params.grabCursor,d=s.grabCursor,f=r.enabled;l&&!u?(o.classList.remove(`${r.containerModifierClass}grid`,`${r.containerModifierClass}grid-column`),e.emitContainerClasses()):!l&&u&&(o.classList.add(`${r.containerModifierClass}grid`),(s.grid.fill&&"column"===s.grid.fill||!s.grid.fill&&"column"===r.grid.fill)&&o.classList.add(`${r.containerModifierClass}grid-column`),e.emitContainerClasses()),c&&!d?e.unsetGrabCursor():!c&&d&&e.setGrabCursor(),["navigation","pagination","scrollbar"].forEach(t=>{if(void 0===s[t])return;const n=r[t]&&r[t].enabled,o=s[t]&&s[t].enabled;n&&!o&&e[t].disable(),!n&&o&&e[t].enable()});const p=s.direction&&s.direction!==r.direction,h=r.loop&&(s.slidesPerView!==r.slidesPerView||p),m=r.loop;p&&n&&e.changeDirection(),Tn(e.params,s);const g=e.params.enabled,v=e.params.loop;Object.assign(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),f&&!g?e.disable():!f&&g&&e.enable(),e.currentBreakpoint=a,e.emit("_beforeBreakpoint",s),n&&(h?(e.loopDestroy(),e.loopCreate(t),e.updateSlides()):!m&&v?(e.loopCreate(t),e.updateSlides()):m&&!v&&e.loopDestroy()),e.emit("breakpoint",s)},getBreakpoint:function(e,t,n){if(void 0===t&&(t="window"),!e||"container"===t&&!n)return;let r=!1;const o=wn(),i="window"===t?o.innerHeight:n.clientHeight,a=Object.keys(e).map(e=>{if("string"==typeof e&&0===e.indexOf("@")){const t=parseFloat(e.substr(1));return{value:i*t,point:e}}return{value:e,point:e}});a.sort((e,t)=>parseInt(e.value,10)-parseInt(t.value,10));for(let e=0;e<a.length;e+=1){const{point:i,value:s}=a[e];"window"===t?o.matchMedia(`(min-width: ${s}px)`).matches&&(r=i):s<=n.clientWidth&&(r=i)}return r||"max"}};var fr={init:!0,direction:"horizontal",oneWayMovement:!1,swiperElementNodeName:"SWIPER-CONTAINER",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function pr(e,t){return function(n){void 0===n&&(n={});const r=Object.keys(n)[0],o=n[r];"object"==typeof o&&null!==o?(!0===e[r]&&(e[r]={enabled:!0}),"navigation"===r&&e[r]&&e[r].enabled&&!e[r].prevEl&&!e[r].nextEl&&(e[r].auto=!0),["pagination","scrollbar"].indexOf(r)>=0&&e[r]&&e[r].enabled&&!e[r].el&&(e[r].auto=!0),r in e&&"enabled"in o?("object"!=typeof e[r]||"enabled"in e[r]||(e[r].enabled=!0),e[r]||(e[r]={enabled:!1}),Tn(t,n)):Tn(t,n)):Tn(t,n)}}const hr={eventsEmitter:Wn,update:Gn,translate:Xn,transition:Qn,slide:Zn,loop:Jn,grabCursor:{setGrabCursor:function(e){const t=this;if(!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)return;const n="container"===t.params.touchEventsTarget?t.el:t.wrapperEl;t.isElement&&(t.__preventObserver__=!0),n.style.cursor="move",n.style.cursor=e?"grabbing":"grab",t.isElement&&requestAnimationFrame(()=>{t.__preventObserver__=!1})},unsetGrabCursor:function(){const e=this;e.params.watchOverflow&&e.isLocked||e.params.cssMode||(e.isElement&&(e.__preventObserver__=!0),e["container"===e.params.touchEventsTarget?"el":"wrapperEl"].style.cursor="",e.isElement&&requestAnimationFrame(()=>{e.__preventObserver__=!1}))}},events:{attachEvents:function(){const e=this,{params:t}=e;e.onTouchStart=tr.bind(e),e.onTouchMove=nr.bind(e),e.onTouchEnd=rr.bind(e),e.onDocumentTouchStart=lr.bind(e),t.cssMode&&(e.onScroll=ar.bind(e)),e.onClick=ir.bind(e),e.onLoad=sr.bind(e),ur(e,"on")},detachEvents:function(){ur(this,"off")}},breakpoints:dr,checkOverflow:{checkOverflow:function(){const e=this,{isLocked:t,params:n}=e,{slidesOffsetBefore:r}=n;if(r){const t=e.slides.length-1,n=e.slidesGrid[t]+e.slidesSizesGrid[t]+2*r;e.isLocked=e.size>n}else e.isLocked=1===e.snapGrid.length;!0===n.allowSlideNext&&(e.allowSlideNext=!e.isLocked),!0===n.allowSlidePrev&&(e.allowSlidePrev=!e.isLocked),t&&t!==e.isLocked&&(e.isEnd=!1),t!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock")}},classes:{addClasses:function(){const e=this,{classNames:t,params:n,rtl:r,el:o,device:i}=e,a=function(e,t){const n=[];return e.forEach(e=>{"object"==typeof e?Object.keys(e).forEach(r=>{e[r]&&n.push(t+r)}):"string"==typeof e&&n.push(t+e)}),n}(["initialized",n.direction,{"free-mode":e.params.freeMode&&n.freeMode.enabled},{autoheight:n.autoHeight},{rtl:r},{grid:n.grid&&n.grid.rows>1},{"grid-column":n.grid&&n.grid.rows>1&&"column"===n.grid.fill},{android:i.android},{ios:i.ios},{"css-mode":n.cssMode},{centered:n.cssMode&&n.centeredSlides},{"watch-progress":n.watchSlidesProgress}],n.containerModifierClass);t.push(...a),o.classList.add(...t),e.emitContainerClasses()},removeClasses:function(){const{el:e,classNames:t}=this;e&&"string"!=typeof e&&(e.classList.remove(...t),this.emitContainerClasses())}}},mr={};let gr=class e{constructor(){let t,n;for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];1===o.length&&o[0].constructor&&"Object"===Object.prototype.toString.call(o[0]).slice(8,-1)?n=o[0]:[t,n]=o,n||(n={}),n=Tn({},n),t&&!n.el&&(n.el=t);const a=bn();if(n.el&&"string"==typeof n.el&&a.querySelectorAll(n.el).length>1){const t=[];return a.querySelectorAll(n.el).forEach(r=>{const o=Tn({},n,{el:r});t.push(new e(o))}),t}const s=this;s.__swiper__=!0,s.support=$n(),s.device=jn({userAgent:n.userAgent}),s.browser=Bn(),s.eventsListeners={},s.eventsAnyListeners=[],s.modules=[...s.__modules__],n.modules&&Array.isArray(n.modules)&&s.modules.push(...n.modules);const l={};s.modules.forEach(e=>{e({params:n,swiper:s,extendParams:pr(n,l),on:s.on.bind(s),once:s.once.bind(s),off:s.off.bind(s),emit:s.emit.bind(s)})});const u=Tn({},fr,l);return s.params=Tn({},u,mr,n),s.originalParams=Tn({},s.params),s.passedParams=Tn({},n),s.params&&s.params.on&&Object.keys(s.params.on).forEach(e=>{s.on(e,s.params.on[e])}),s.params&&s.params.onAny&&s.onAny(s.params.onAny),Object.assign(s,{enabled:s.params.enabled,el:t,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:()=>"horizontal"===s.params.direction,isVertical:()=>"vertical"===s.params.direction,activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:s.params.allowSlideNext,allowSlidePrev:s.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:s.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:s.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),s.emit("_swiper"),s.params.init&&s.init(),s}getDirectionLabel(e){return this.isHorizontal()?e:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[e]}getSlideIndex(e){const{slidesEl:t,params:n}=this,r=In(Nn(t,`.${n.slideClass}, swiper-slide`)[0]);return In(e)-r}getSlideIndexByData(e){return this.getSlideIndex(this.slides.filter(t=>1*t.getAttribute("data-swiper-slide-index")===e)[0])}recalcSlides(){const{slidesEl:e,params:t}=this;this.slides=Nn(e,`.${t.slideClass}, swiper-slide`)}enable(){const e=this;e.enabled||(e.enabled=!0,e.params.grabCursor&&e.setGrabCursor(),e.emit("enable"))}disable(){const e=this;e.enabled&&(e.enabled=!1,e.params.grabCursor&&e.unsetGrabCursor(),e.emit("disable"))}setProgress(e,t){const n=this;e=Math.min(Math.max(e,0),1);const r=n.minTranslate(),o=(n.maxTranslate()-r)*e+r;n.translateTo(o,void 0===t?0:t),n.updateActiveIndex(),n.updateSlidesClasses()}emitContainerClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=e.el.className.split(" ").filter(t=>0===t.indexOf("swiper")||0===t.indexOf(e.params.containerModifierClass));e.emit("_containerClasses",t.join(" "))}getSlideClasses(e){const t=this;return t.destroyed?"":e.className.split(" ").filter(e=>0===e.indexOf("swiper-slide")||0===e.indexOf(t.params.slideClass)).join(" ")}emitSlidesClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=[];e.slides.forEach(n=>{const r=e.getSlideClasses(n);t.push({slideEl:n,classNames:r}),e.emit("_slideClass",n,r)}),e.emit("_slideClasses",t)}slidesPerViewDynamic(e,t){void 0===e&&(e="current"),void 0===t&&(t=!1);const{params:n,slides:r,slidesGrid:o,slidesSizesGrid:i,size:a,activeIndex:s}=this;let l=1;if("number"==typeof n.slidesPerView)return n.slidesPerView;if(n.centeredSlides){let e,t=r[s]?Math.ceil(r[s].swiperSlideSize):0;for(let n=s+1;n<r.length;n+=1)r[n]&&!e&&(t+=Math.ceil(r[n].swiperSlideSize),l+=1,t>a&&(e=!0));for(let n=s-1;n>=0;n-=1)r[n]&&!e&&(t+=r[n].swiperSlideSize,l+=1,t>a&&(e=!0))}else if("current"===e)for(let e=s+1;e<r.length;e+=1){(t?o[e]+i[e]-o[s]<a:o[e]-o[s]<a)&&(l+=1)}else for(let e=s-1;e>=0;e-=1){o[s]-o[e]<a&&(l+=1)}return l}update(){const e=this;if(!e||e.destroyed)return;const{snapGrid:t,params:n}=e;function r(){const t=e.rtlTranslate?-1*e.translate:e.translate,n=Math.min(Math.max(t,e.maxTranslate()),e.minTranslate());e.setTranslate(n),e.updateActiveIndex(),e.updateSlidesClasses()}let o;if(n.breakpoints&&e.setBreakpoint(),[...e.el.querySelectorAll('[loading="lazy"]')].forEach(t=>{t.complete&&Vn(e,t)}),e.updateSize(),e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),n.freeMode&&n.freeMode.enabled&&!n.cssMode)r(),n.autoHeight&&e.updateAutoHeight();else{if(("auto"===n.slidesPerView||n.slidesPerView>1)&&e.isEnd&&!n.centeredSlides){const t=e.virtual&&n.virtual.enabled?e.virtual.slides:e.slides;o=e.slideTo(t.length-1,0,!1,!0)}else o=e.slideTo(e.activeIndex,0,!1,!0);o||r()}n.watchOverflow&&t!==e.snapGrid&&e.checkOverflow(),e.emit("update")}changeDirection(e,t){void 0===t&&(t=!0);const n=this,r=n.params.direction;return e||(e="horizontal"===r?"vertical":"horizontal"),e===r||"horizontal"!==e&&"vertical"!==e||(n.el.classList.remove(`${n.params.containerModifierClass}${r}`),n.el.classList.add(`${n.params.containerModifierClass}${e}`),n.emitContainerClasses(),n.params.direction=e,n.slides.forEach(t=>{"vertical"===e?t.style.width="":t.style.height=""}),n.emit("changeDirection"),t&&n.update()),n}changeLanguageDirection(e){const t=this;t.rtl&&"rtl"===e||!t.rtl&&"ltr"===e||(t.rtl="rtl"===e,t.rtlTranslate="horizontal"===t.params.direction&&t.rtl,t.rtl?(t.el.classList.add(`${t.params.containerModifierClass}rtl`),t.el.dir="rtl"):(t.el.classList.remove(`${t.params.containerModifierClass}rtl`),t.el.dir="ltr"),t.update())}mount(e){const t=this;if(t.mounted)return!0;let n=e||t.params.el;if("string"==typeof n&&(n=document.querySelector(n)),!n)return!1;n.swiper=t,n.parentNode&&n.parentNode.host&&n.parentNode.host.nodeName===t.params.swiperElementNodeName.toUpperCase()&&(t.isElement=!0);const r=()=>`.${(t.params.wrapperClass||"").trim().split(" ").join(".")}`;let o=(()=>{if(n&&n.shadowRoot&&n.shadowRoot.querySelector){return n.shadowRoot.querySelector(r())}return Nn(n,r())[0]})();return!o&&t.params.createElements&&(o=Rn("div",t.params.wrapperClass),n.append(o),Nn(n,`.${t.params.slideClass}`).forEach(e=>{o.append(e)})),Object.assign(t,{el:n,wrapperEl:o,slidesEl:t.isElement&&!n.parentNode.host.slideSlots?n.parentNode.host:o,hostEl:t.isElement?n.parentNode.host:n,mounted:!0,rtl:"rtl"===n.dir.toLowerCase()||"rtl"===zn(n,"direction"),rtlTranslate:"horizontal"===t.params.direction&&("rtl"===n.dir.toLowerCase()||"rtl"===zn(n,"direction")),wrongRTL:"-webkit-box"===zn(o,"display")}),!0}init(e){const t=this;if(t.initialized)return t;if(!1===t.mount(e))return t;t.emit("beforeInit"),t.params.breakpoints&&t.setBreakpoint(),t.addClasses(),t.updateSize(),t.updateSlides(),t.params.watchOverflow&&t.checkOverflow(),t.params.grabCursor&&t.enabled&&t.setGrabCursor(),t.params.loop&&t.virtual&&t.params.virtual.enabled?t.slideTo(t.params.initialSlide+t.virtual.slidesBefore,0,t.params.runCallbacksOnInit,!1,!0):t.slideTo(t.params.initialSlide,0,t.params.runCallbacksOnInit,!1,!0),t.params.loop&&t.loopCreate(),t.attachEvents();const n=[...t.el.querySelectorAll('[loading="lazy"]')];return t.isElement&&n.push(...t.hostEl.querySelectorAll('[loading="lazy"]')),n.forEach(e=>{e.complete?Vn(t,e):e.addEventListener("load",e=>{Vn(t,e.target)})}),qn(t),t.initialized=!0,qn(t),t.emit("init"),t.emit("afterInit"),t}destroy(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0);const n=this,{params:r,el:o,wrapperEl:i,slides:a}=n;return void 0===n.params||n.destroyed||(n.emit("beforeDestroy"),n.initialized=!1,n.detachEvents(),r.loop&&n.loopDestroy(),t&&(n.removeClasses(),o&&"string"!=typeof o&&o.removeAttribute("style"),i&&i.removeAttribute("style"),a&&a.length&&a.forEach(e=>{e.classList.remove(r.slideVisibleClass,r.slideFullyVisibleClass,r.slideActiveClass,r.slideNextClass,r.slidePrevClass),e.removeAttribute("style"),e.removeAttribute("data-swiper-slide-index")})),n.emit("destroy"),Object.keys(n.eventsListeners).forEach(e=>{n.off(e)}),!1!==e&&(n.el&&"string"!=typeof n.el&&(n.el.swiper=null),function(e){const t=e;Object.keys(t).forEach(e=>{try{t[e]=null}catch(e){}try{delete t[e]}catch(e){}})}(n)),n.destroyed=!0),null}static extendDefaults(e){Tn(mr,e)}static get extendedDefaults(){return mr}static get defaults(){return fr}static installModule(t){e.prototype.__modules__||(e.prototype.__modules__=[]);const n=e.prototype.__modules__;"function"==typeof t&&n.indexOf(t)<0&&n.push(t)}static use(t){return Array.isArray(t)?(t.forEach(t=>e.installModule(t)),e):(e.installModule(t),e)}};Object.keys(hr).forEach(e=>{Object.keys(hr[e]).forEach(t=>{gr.prototype[t]=hr[e][t]})}),gr.use([function(e){let{swiper:t,on:n,emit:r}=e;const o=wn();let i=null,a=null;const s=()=>{t&&!t.destroyed&&t.initialized&&(r("beforeResize"),r("resize"))},l=()=>{t&&!t.destroyed&&t.initialized&&r("orientationchange")};n("init",()=>{t.params.resizeObserver&&void 0!==o.ResizeObserver?t&&!t.destroyed&&t.initialized&&(i=new ResizeObserver(e=>{a=o.requestAnimationFrame(()=>{const{width:n,height:r}=t;let o=n,i=r;e.forEach(e=>{let{contentBoxSize:n,contentRect:r,target:a}=e;a&&a!==t.el||(o=r?r.width:(n[0]||n).inlineSize,i=r?r.height:(n[0]||n).blockSize)}),o===n&&i===r||s()})}),i.observe(t.el)):(o.addEventListener("resize",s),o.addEventListener("orientationchange",l))}),n("destroy",()=>{a&&o.cancelAnimationFrame(a),i&&i.unobserve&&t.el&&(i.unobserve(t.el),i=null),o.removeEventListener("resize",s),o.removeEventListener("orientationchange",l)})},function(e){let{swiper:t,extendParams:n,on:r,emit:o}=e;const i=[],a=wn(),s=function(e,n){void 0===n&&(n={});const r=new(a.MutationObserver||a.WebkitMutationObserver)(e=>{if(t.__preventObserver__)return;if(1===e.length)return void o("observerUpdate",e[0]);const n=function(){o("observerUpdate",e[0])};a.requestAnimationFrame?a.requestAnimationFrame(n):a.setTimeout(n,0)});r.observe(e,{attributes:void 0===n.attributes||n.attributes,childList:t.isElement||(void 0===n.childList||n).childList,characterData:void 0===n.characterData||n.characterData}),i.push(r)};n({observer:!1,observeParents:!1,observeSlideChildren:!1}),r("init",()=>{if(t.params.observer){if(t.params.observeParents){const e=function(e){const t=[];let n=e.parentElement;for(;n;)t.push(n),n=n.parentElement;return t}(t.hostEl);for(let t=0;t<e.length;t+=1)s(e[t])}s(t.hostEl,{childList:t.params.observeSlideChildren}),s(t.wrapperEl,{attributes:!1})}}),r("destroy",()=>{i.forEach(e=>{e.disconnect()}),i.splice(0,i.length)})}]);const vr=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","swiperElementNodeName","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopAdditionalSlides","loopAddBlankSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideFullyVisibleClass","slideNextClass","slidePrevClass","slideBlankClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function br(e){return"object"==typeof e&&null!==e&&e.constructor&&"Object"===Object.prototype.toString.call(e).slice(8,-1)&&!e.__swiper__}function yr(e,t){const n=["__proto__","constructor","prototype"];Object.keys(t).filter(e=>n.indexOf(e)<0).forEach(n=>{void 0===e[n]?e[n]=t[n]:br(t[n])&&br(e[n])&&Object.keys(t[n]).length>0?t[n].__swiper__?e[n]=t[n]:yr(e[n],t[n]):e[n]=t[n]})}function wr(e){return void 0===e&&(e={}),e.navigation&&void 0===e.navigation.nextEl&&void 0===e.navigation.prevEl}function xr(e){return void 0===e&&(e={}),e.pagination&&void 0===e.pagination.el}function Sr(e){return void 0===e&&(e={}),e.scrollbar&&void 0===e.scrollbar.el}function Er(e){void 0===e&&(e="");const t=e.split(" ").map(e=>e.trim()).filter(e=>!!e),n=[];return t.forEach(e=>{n.indexOf(e)<0&&n.push(e)}),n.join(" ")}function kr(e){return void 0===e&&(e=""),e?e.includes("swiper-wrapper")?e:`swiper-wrapper ${e}`:"swiper-wrapper"}function Cr(){return Cr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cr.apply(this,arguments)}function Tr(e){return e.type&&e.type.displayName&&e.type.displayName.includes("SwiperSlide")}function Pr(e){const t=[];return m.Children.toArray(e).forEach(e=>{Tr(e)?t.push(e):e.props&&e.props.children&&Pr(e.props.children).forEach(e=>t.push(e))}),t}function Or(e){const t=[],n={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return m.Children.toArray(e).forEach(e=>{if(Tr(e))t.push(e);else if(e.props&&e.props.slot&&n[e.props.slot])n[e.props.slot].push(e);else if(e.props&&e.props.children){const r=Pr(e.props.children);r.length>0?r.forEach(e=>t.push(e)):n["container-end"].push(e)}else n["container-end"].push(e)}),{slides:t,slots:n}}function Mr(e,t){return"undefined"==typeof window?h.useEffect(e,t):h.useLayoutEffect(e,t)}const Nr=h.createContext(null),_r=h.createContext(null),Rr=h.forwardRef(function(e,t){let{className:n,tag:r="div",wrapperTag:o="div",children:i,onSwiper:a,...s}=void 0===e?{}:e,l=!1;const[u,c]=h.useState("swiper"),[d,f]=h.useState(null),[p,g]=h.useState(!1),v=h.useRef(!1),b=h.useRef(null),y=h.useRef(null),w=h.useRef(null),x=h.useRef(null),S=h.useRef(null),E=h.useRef(null),k=h.useRef(null),C=h.useRef(null),{params:T,passedParams:P,rest:O,events:M}=function(e,t){void 0===e&&(e={}),void 0===t&&(t=!0);const n={on:{}},r={},o={};yr(n,fr),n._emitClasses=!0,n.init=!1;const i={},a=vr.map(e=>e.replace(/_/,"")),s=Object.assign({},e);return Object.keys(s).forEach(s=>{void 0!==e[s]&&(a.indexOf(s)>=0?br(e[s])?(n[s]={},o[s]={},yr(n[s],e[s]),yr(o[s],e[s])):(n[s]=e[s],o[s]=e[s]):0===s.search(/on[A-Z]/)&&"function"==typeof e[s]?t?r[`${s[2].toLowerCase()}${s.substr(3)}`]=e[s]:n.on[`${s[2].toLowerCase()}${s.substr(3)}`]=e[s]:i[s]=e[s])}),["navigation","pagination","scrollbar"].forEach(e=>{!0===n[e]&&(n[e]={}),!1===n[e]&&delete n[e]}),{params:n,passedParams:o,rest:i,events:r}}(s),{slides:N,slots:_}=Or(i),R=()=>{g(!p)};Object.assign(T.on,{_containerClasses(e,t){c(t)}});const z=()=>{Object.assign(T.on,M),l=!0;const e={...T};if(delete e.wrapperClass,y.current=new gr(e),y.current.virtual&&y.current.params.virtual.enabled){y.current.virtual.slides=N;const e={cache:!1,slides:N,renderExternal:f,renderExternalUpdate:!1};yr(y.current.params.virtual,e),yr(y.current.originalParams.virtual,e)}};b.current||z(),y.current&&y.current.on("_beforeBreakpoint",R);return h.useEffect(()=>()=>{y.current&&y.current.off("_beforeBreakpoint",R)}),h.useEffect(()=>{!v.current&&y.current&&(y.current.emitSlidesClasses(),v.current=!0)}),Mr(()=>{if(t&&(t.current=b.current),b.current)return y.current.destroyed&&z(),function(e,t){let{el:n,nextEl:r,prevEl:o,paginationEl:i,scrollbarEl:a,swiper:s}=e;wr(t)&&r&&o&&(s.params.navigation.nextEl=r,s.originalParams.navigation.nextEl=r,s.params.navigation.prevEl=o,s.originalParams.navigation.prevEl=o),xr(t)&&i&&(s.params.pagination.el=i,s.originalParams.pagination.el=i),Sr(t)&&a&&(s.params.scrollbar.el=a,s.originalParams.scrollbar.el=a),s.init(n)}({el:b.current,nextEl:S.current,prevEl:E.current,paginationEl:k.current,scrollbarEl:C.current,swiper:y.current},T),a&&!y.current.destroyed&&a(y.current),()=>{y.current&&!y.current.destroyed&&y.current.destroy(!0,!1)}},[]),Mr(()=>{!l&&M&&y.current&&Object.keys(M).forEach(e=>{y.current.on(e,M[e])});const e=function(e,t,n,r,o){const i=[];if(!t)return i;const a=e=>{i.indexOf(e)<0&&i.push(e)};if(n&&r){const e=r.map(o),t=n.map(o);e.join("")!==t.join("")&&a("children"),r.length!==n.length&&a("children")}return vr.filter(e=>"_"===e[0]).map(e=>e.replace(/_/,"")).forEach(n=>{if(n in e&&n in t)if(br(e[n])&&br(t[n])){const r=Object.keys(e[n]),o=Object.keys(t[n]);r.length!==o.length?a(n):(r.forEach(r=>{e[n][r]!==t[n][r]&&a(n)}),o.forEach(r=>{e[n][r]!==t[n][r]&&a(n)}))}else e[n]!==t[n]&&a(n)}),i}(P,w.current,N,x.current,e=>e.key);return w.current=P,x.current=N,e.length&&y.current&&!y.current.destroyed&&function(e){let{swiper:t,slides:n,passedParams:r,changedParams:o,nextEl:i,prevEl:a,scrollbarEl:s,paginationEl:l}=e;const u=o.filter(e=>"children"!==e&&"direction"!==e&&"wrapperClass"!==e),{params:c,pagination:d,navigation:f,scrollbar:p,virtual:h,thumbs:m}=t;let g,v,b,y,w,x,S,E;o.includes("thumbs")&&r.thumbs&&r.thumbs.swiper&&!r.thumbs.swiper.destroyed&&c.thumbs&&(!c.thumbs.swiper||c.thumbs.swiper.destroyed)&&(g=!0),o.includes("controller")&&r.controller&&r.controller.control&&c.controller&&!c.controller.control&&(v=!0),o.includes("pagination")&&r.pagination&&(r.pagination.el||l)&&(c.pagination||!1===c.pagination)&&d&&!d.el&&(b=!0),o.includes("scrollbar")&&r.scrollbar&&(r.scrollbar.el||s)&&(c.scrollbar||!1===c.scrollbar)&&p&&!p.el&&(y=!0),o.includes("navigation")&&r.navigation&&(r.navigation.prevEl||a)&&(r.navigation.nextEl||i)&&(c.navigation||!1===c.navigation)&&f&&!f.prevEl&&!f.nextEl&&(w=!0);const k=e=>{t[e]&&(t[e].destroy(),"navigation"===e?(t.isElement&&(t[e].prevEl.remove(),t[e].nextEl.remove()),c[e].prevEl=void 0,c[e].nextEl=void 0,t[e].prevEl=void 0,t[e].nextEl=void 0):(t.isElement&&t[e].el.remove(),c[e].el=void 0,t[e].el=void 0))};o.includes("loop")&&t.isElement&&(c.loop&&!r.loop?x=!0:!c.loop&&r.loop?S=!0:E=!0),u.forEach(e=>{if(br(c[e])&&br(r[e]))Object.assign(c[e],r[e]),"navigation"!==e&&"pagination"!==e&&"scrollbar"!==e||!("enabled"in r[e])||r[e].enabled||k(e);else{const t=r[e];!0!==t&&!1!==t||"navigation"!==e&&"pagination"!==e&&"scrollbar"!==e?c[e]=r[e]:!1===t&&k(e)}}),u.includes("controller")&&!v&&t.controller&&t.controller.control&&c.controller&&c.controller.control&&(t.controller.control=c.controller.control),o.includes("children")&&n&&h&&c.virtual.enabled?(h.slides=n,h.update(!0)):o.includes("virtual")&&h&&c.virtual.enabled&&(n&&(h.slides=n),h.update(!0)),o.includes("children")&&n&&c.loop&&(E=!0),g&&m.init()&&m.update(!0);v&&(t.controller.control=c.controller.control),b&&(!t.isElement||l&&"string"!=typeof l||(l=document.createElement("div"),l.classList.add("swiper-pagination"),l.part.add("pagination"),t.el.appendChild(l)),l&&(c.pagination.el=l),d.init(),d.render(),d.update()),y&&(!t.isElement||s&&"string"!=typeof s||(s=document.createElement("div"),s.classList.add("swiper-scrollbar"),s.part.add("scrollbar"),t.el.appendChild(s)),s&&(c.scrollbar.el=s),p.init(),p.updateSize(),p.setTranslate()),w&&(t.isElement&&(i&&"string"!=typeof i||(i=document.createElement("div"),i.classList.add("swiper-button-next"),i.innerHTML=t.hostEl.constructor.nextButtonSvg,i.part.add("button-next"),t.el.appendChild(i)),a&&"string"!=typeof a||(a=document.createElement("div"),a.classList.add("swiper-button-prev"),a.innerHTML=t.hostEl.constructor.prevButtonSvg,a.part.add("button-prev"),t.el.appendChild(a))),i&&(c.navigation.nextEl=i),a&&(c.navigation.prevEl=a),f.init(),f.update()),o.includes("allowSlideNext")&&(t.allowSlideNext=r.allowSlideNext),o.includes("allowSlidePrev")&&(t.allowSlidePrev=r.allowSlidePrev),o.includes("direction")&&t.changeDirection(r.direction,!1),(x||E)&&t.loopDestroy(),(S||E)&&t.loopCreate(),t.update()}({swiper:y.current,slides:N,passedParams:P,changedParams:e,nextEl:S.current,prevEl:E.current,scrollbarEl:C.current,paginationEl:k.current}),()=>{M&&y.current&&Object.keys(M).forEach(e=>{y.current.off(e,M[e])})}}),Mr(()=>{var e;!(e=y.current)||e.destroyed||!e.params.virtual||e.params.virtual&&!e.params.virtual.enabled||(e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),e.parallax&&e.params.parallax&&e.params.parallax.enabled&&e.parallax.setTranslate())},[d]),m.createElement(r,Cr({ref:b,className:Er(`${u}${n?` ${n}`:""}`)},O),m.createElement(_r.Provider,{value:y.current},_["container-start"],m.createElement(o,{className:kr(T.wrapperClass)},_["wrapper-start"],T.virtual?function(e,t,n){if(!n)return null;const r=e=>{let n=e;return e<0?n=t.length+e:n>=t.length&&(n-=t.length),n},o=e.isHorizontal()?{[e.rtlTranslate?"right":"left"]:`${n.offset}px`}:{top:`${n.offset}px`},{from:i,to:a}=n,s=e.params.loop?-t.length:0,l=e.params.loop?2*t.length:t.length,u=[];for(let e=s;e<l;e+=1)e>=i&&e<=a&&u.push(t[r(e)]);return u.map((t,n)=>m.cloneElement(t,{swiper:e,style:o,key:t.props.virtualIndex||t.key||`slide-${n}`}))}(y.current,N,d):N.map((e,t)=>m.cloneElement(e,{swiper:y.current,swiperSlideIndex:t})),_["wrapper-end"]),wr(T)&&m.createElement(m.Fragment,null,m.createElement("div",{ref:E,className:"swiper-button-prev"}),m.createElement("div",{ref:S,className:"swiper-button-next"})),Sr(T)&&m.createElement("div",{ref:C,className:"swiper-scrollbar"}),xr(T)&&m.createElement("div",{ref:k,className:"swiper-pagination"}),_["container-end"]))});Rr.displayName="Swiper";const zr=h.forwardRef(function(e,t){let{tag:n="div",children:r,className:o="",swiper:i,zoom:a,lazy:s,virtualIndex:l,swiperSlideIndex:u,...c}=void 0===e?{}:e;const d=h.useRef(null),[f,p]=h.useState("swiper-slide"),[g,v]=h.useState(!1);function b(e,t,n){t===d.current&&p(n)}Mr(()=>{if(void 0!==u&&(d.current.swiperSlideIndex=u),t&&(t.current=d.current),d.current&&i){if(!i.destroyed)return i.on("_slideClass",b),()=>{i&&i.off("_slideClass",b)};"swiper-slide"!==f&&p("swiper-slide")}}),Mr(()=>{i&&d.current&&!i.destroyed&&p(i.getSlideClasses(d.current))},[i]);const y={isActive:f.indexOf("swiper-slide-active")>=0,isVisible:f.indexOf("swiper-slide-visible")>=0,isPrev:f.indexOf("swiper-slide-prev")>=0,isNext:f.indexOf("swiper-slide-next")>=0},w=()=>"function"==typeof r?r(y):r;return m.createElement(n,Cr({ref:d,className:Er(`${f}${o?` ${o}`:""}`),"data-swiper-slide-index":l,onLoad:()=>{v(!0)}},c),a&&m.createElement(Nr.Provider,{value:y},m.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":"number"==typeof a?a:void 0},w(),s&&!g&&m.createElement("div",{className:"swiper-lazy-preloader"}))),!a&&m.createElement(Nr.Provider,{value:y},w(),s&&!g&&m.createElement("div",{className:"swiper-lazy-preloader"})))});function Ir(){const[e,t]=h.useState({width:window.innerWidth,height:window.innerHeight});return h.useEffect(()=>{const e=()=>t({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}zr.displayName="SwiperSlide";let Dr=null,Lr="";var Ar,Fr,$r={},jr={exports:{}},Br=jr.exports;function Wr(){return Ar||(Ar=1,e=jr,t=jr.exports,function(n,r){var o="function",i="undefined",a="object",s="string",l="major",u="model",c="name",d="type",f="vendor",p="version",h="architecture",m="console",g="mobile",v="tablet",b="smarttv",y="wearable",w="embedded",x="Amazon",S="Apple",E="ASUS",k="BlackBerry",C="Browser",T="Chrome",P="Firefox",O="Google",M="Huawei",N="LG",_="Microsoft",R="Motorola",z="Opera",I="Samsung",D="Sharp",L="Sony",A="Xiaomi",F="Zebra",$="Facebook",j="Chromium OS",B="Mac OS",W=" Browser",U=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},H=function(e,t){return typeof e===s&&-1!==V(t).indexOf(V(e))},V=function(e){return e.toLowerCase()},Y=function(e,t){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof t===i?e:e.substring(0,500)},q=function(e,t){for(var n,i,s,l,u,c,d=0;d<t.length&&!u;){var f=t[d],p=t[d+1];for(n=i=0;n<f.length&&!u&&f[n];)if(u=f[n++].exec(e))for(s=0;s<p.length;s++)c=u[++i],typeof(l=p[s])===a&&l.length>0?2===l.length?typeof l[1]==o?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==o||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):r:this[l[0]]=c?l[1].call(this,c,l[2]):r:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):r):this[l]=c||r;d+=2}},G=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var o=0;o<t[n].length;o++)if(H(t[n][o],e))return"?"===n?r:n}else if(H(t[n],e))return"?"===n?r:n;return t.hasOwnProperty("*")?t["*"]:e},X={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},K={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,p],[/opios[\/ ]+([\w\.]+)/i],[p,[c,z+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[p,[c,z+" GX"]],[/\bopr\/([\w\.]+)/i],[p,[c,z]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[p,[c,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[p,[c,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[c,p],[/quark(?:pc)?\/([-\w\.]+)/i],[p,[c,"Quark"]],[/\bddg\/([\w\.]+)/i],[p,[c,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[c,"UC"+C]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[p,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[c,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[c,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[p,[c,"Smart Lenovo "+C]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+C],p],[/\bfocus\/([\w\.]+)/i],[p,[c,P+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[c,z+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[c,z+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[c,"MIUI"+W]],[/fxios\/([\w\.-]+)/i],[p,[c,P]],[/\bqihoobrowser\/?([\w\.]*)/i],[p,[c,"360"]],[/\b(qq)\/([\w\.]+)/i],[[c,/(.+)/,"$1Browser"],p],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1"+W],p],[/samsungbrowser\/([\w\.]+)/i],[p,[c,I+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[p,[c,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[c,"Sogou Mobile"],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[c,p],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[c],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[p,c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,$],p],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[c,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[c,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[c,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[c,T+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,T+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[c,"Android "+C]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[p,G,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],p],[/(wolvic|librewolf)\/([\w\.]+)/i],[c,p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[c,P+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[c,[p,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[c,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,V]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[h,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[h,"armhf"]],[/windows (ce|mobile); ppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[h,/ower/,"",V]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[h,V]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[f,I],[d,v]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[u,[f,I],[d,g]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[f,S],[d,g]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[f,S],[d,v]],[/(macintosh);/i],[u,[f,S]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[f,D],[d,g]],[/(?:honor)([-\w ]+)[;\)]/i],[u,[f,"Honor"],[d,g]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[f,M],[d,v]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[f,M],[d,g]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[u,/_/g," "],[f,A],[d,g]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[f,A],[d,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[f,"OPPO"],[d,g]],[/\b(opd2\d{3}a?) bui/i],[u,[f,"OPPO"],[d,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[f,"Vivo"],[d,g]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[u,[f,"Realme"],[d,g]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[f,R],[d,g]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[f,R],[d,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[f,N],[d,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[f,N],[d,g]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[f,"Lenovo"],[d,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[f,"Nokia"],[d,g]],[/(pixel c)\b/i],[u,[f,O],[d,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[f,O],[d,g]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[f,L],[d,g]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[f,L],[d,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[f,"OnePlus"],[d,g]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[f,x],[d,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[f,x],[d,g]],[/(playbook);[-\w\),; ]+(rim)/i],[u,f,[d,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[f,k],[d,g]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[f,E],[d,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[f,E],[d,g]],[/(nexus 9)/i],[u,[f,"HTC"],[d,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[f,[u,/_/g," "],[d,g]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[u,[f,"TCL"],[d,v]],[/(itel) ((\w+))/i],[[f,V],u,[d,G,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[f,"Acer"],[d,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[f,"Meizu"],[d,g]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[u,[f,"Ulefone"],[d,g]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[u,[f,"Energizer"],[d,g]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[u,[f,"Cat"],[d,g]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[u,[f,"Smartfren"],[d,g]],[/droid.+; (a(?:015|06[35]|142p?))/i],[u,[f,"Nothing"],[d,g]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[f,u,[d,g]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[f,u,[d,v]],[/(surface duo)/i],[u,[f,_],[d,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[f,"Fairphone"],[d,g]],[/(u304aa)/i],[u,[f,"AT&T"],[d,g]],[/\bsie-(\w*)/i],[u,[f,"Siemens"],[d,g]],[/\b(rct\w+) b/i],[u,[f,"RCA"],[d,v]],[/\b(venue[\d ]{2,7}) b/i],[u,[f,"Dell"],[d,v]],[/\b(q(?:mv|ta)\w+) b/i],[u,[f,"Verizon"],[d,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[f,"Barnes & Noble"],[d,v]],[/\b(tm\d{3}\w+) b/i],[u,[f,"NuVision"],[d,v]],[/\b(k88) b/i],[u,[f,"ZTE"],[d,v]],[/\b(nx\d{3}j) b/i],[u,[f,"ZTE"],[d,g]],[/\b(gen\d{3}) b.+49h/i],[u,[f,"Swiss"],[d,g]],[/\b(zur\d{3}) b/i],[u,[f,"Swiss"],[d,v]],[/\b((zeki)?tb.*\b) b/i],[u,[f,"Zeki"],[d,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[f,"Dragon Touch"],u,[d,v]],[/\b(ns-?\w{0,9}) b/i],[u,[f,"Insignia"],[d,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[f,"NextBook"],[d,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],u,[d,g]],[/\b(lvtel\-)?(v1[12]) b/i],[[f,"LvTel"],u,[d,g]],[/\b(ph-1) /i],[u,[f,"Essential"],[d,g]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[f,"Envizen"],[d,v]],[/\b(trio[-\w\. ]+) b/i],[u,[f,"MachSpeed"],[d,v]],[/\btu_(1491) b/i],[u,[f,"Rotor"],[d,v]],[/(shield[\w ]+) b/i],[u,[f,"Nvidia"],[d,v]],[/(sprint) (\w+)/i],[f,u,[d,g]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[f,_],[d,g]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[f,F],[d,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[f,F],[d,g]],[/smart-tv.+(samsung)/i],[f,[d,b]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[f,I],[d,b]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[f,N],[d,b]],[/(apple) ?tv/i],[f,[u,S+" TV"],[d,b]],[/crkey/i],[[u,T+"cast"],[f,O],[d,b]],[/droid.+aft(\w+)( bui|\))/i],[u,[f,x],[d,b]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[f,D],[d,b]],[/(bravia[\w ]+)( bui|\))/i],[u,[f,L],[d,b]],[/(mitv-\w{5}) bui/i],[u,[f,A],[d,b]],[/Hbbtv.*(technisat) (.*);/i],[f,u,[d,b]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[f,Y],[u,Y],[d,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,u,[d,m]],[/droid.+; (shield) bui/i],[u,[f,"Nvidia"],[d,m]],[/(playstation [345portablevi]+)/i],[u,[f,L],[d,m]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[f,_],[d,m]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[u,[f,I],[d,y]],[/((pebble))app/i],[f,u,[d,y]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[f,S],[d,y]],[/droid.+; (glass) \d/i],[u,[f,O],[d,y]],[/droid.+; (wt63?0{2,3})\)/i],[u,[f,F],[d,y]],[/droid.+; (glass) \d/i],[u,[f,O],[d,y]],[/(pico) (4|neo3(?: link|pro)?)/i],[f,u,[d,y]],[/; (quest( \d| pro)?)/i],[u,[f,$],[d,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[f,[d,w]],[/(aeobc)\b/i],[u,[f,x],[d,w]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[u,[d,g]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[d,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,v]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,g]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[f,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[c,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[c,p],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[c,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,p],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[c,[p,G,X]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,G,X],[c,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,B],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,p],[/\(bb(10);/i],[p,[c,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[c,P+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[c,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[c,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[c,T+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[c,j],p],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,p],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[c,p]]},Q=function(e,t){if(typeof e===a&&(t=e,e=r),!(this instanceof Q))return new Q(e,t).getResult();var m=typeof n!==i&&n.navigator?n.navigator:r,b=e||(m&&m.userAgent?m.userAgent:""),y=m&&m.userAgentData?m.userAgentData:r,w=t?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}(K,t):K,x=m&&m.userAgent==b;return this.getBrowser=function(){var e,t={};return t[c]=r,t[p]=r,q.call(t,b,w.browser),t[l]=typeof(e=t[p])===s?e.replace(/[^\d\.]/g,"").split(".")[0]:r,x&&m&&m.brave&&typeof m.brave.isBrave==o&&(t[c]="Brave"),t},this.getCPU=function(){var e={};return e[h]=r,q.call(e,b,w.cpu),e},this.getDevice=function(){var e={};return e[f]=r,e[u]=r,e[d]=r,q.call(e,b,w.device),x&&!e[d]&&y&&y.mobile&&(e[d]=g),x&&"Macintosh"==e[u]&&m&&typeof m.standalone!==i&&m.maxTouchPoints&&m.maxTouchPoints>2&&(e[u]="iPad",e[d]=v),e},this.getEngine=function(){var e={};return e[c]=r,e[p]=r,q.call(e,b,w.engine),e},this.getOS=function(){var e={};return e[c]=r,e[p]=r,q.call(e,b,w.os),x&&!e[c]&&y&&y.platform&&"Unknown"!=y.platform&&(e[c]=y.platform.replace(/chrome os/i,j).replace(/macos/i,B)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return b},this.setUA=function(e){return b=typeof e===s&&e.length>500?Y(e,500):e,this},this.setUA(b),this};Q.VERSION="1.0.40",Q.BROWSER=U([c,p,l]),Q.CPU=U([h]),Q.DEVICE=U([u,f,d,m,g,b,v,y,w]),Q.ENGINE=Q.OS=U([c,p]),e.exports&&(t=e.exports=Q),t.UAParser=Q;var Z=typeof n!==i&&(n.jQuery||n.Zepto);if(Z&&!Z.ua){var J=new Q;Z.ua=J.getResult(),Z.ua.get=function(){return J.getUA()},Z.ua.set=function(e){J.setUA(e);var t=J.getResult();for(var n in t)Z.ua[n]=t[n]}}}("object"==typeof window?window:Br)),jr.exports;var e,t}var Ur=function(){if(Fr)return $r;Fr=1,Object.defineProperty($r,"__esModule",{value:!0});var e,t=l(),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,r=Wr(),o=new r,i=o.getBrowser(),a=o.getCPU(),s=o.getDevice(),u=o.getEngine(),c=o.getOS(),d=o.getUA(),f=function(e){return o.setUA(e)},p=function(e){if(e){var t=new r(e);return{UA:t,browser:t.getBrowser(),cpu:t.getCPU(),device:t.getDevice(),engine:t.getEngine(),os:t.getOS(),ua:t.getUA(),setUserAgent:function(e){return t.setUA(e)}}}console.error("No userAgent string was provided")},h=Object.freeze({ClientUAInstance:o,browser:i,cpu:a,device:s,engine:u,os:c,ua:d,setUa:f,parseUserAgent:p});function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function g(e){return g="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},g(e)}function v(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(){return y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y.apply(this,arguments)}function w(e){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},w(e)}function x(e,t){return x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},x(e,t)}function S(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return C(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var T="mobile",P="tablet",O="smarttv",M="console",N="wearable",_="embedded",R=void 0,z={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",EdgeChromium:"Edge Chromium",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},I={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},D={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},L=function(e){return e||(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none")},A=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},F=function(e){var t=A();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)},$=function(e,t,n,r){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach(function(t){b(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e,{vendor:L(t.vendor),model:L(t.model),os:L(n.name),osVersion:L(n.version),ua:L(r)})},j=function(e){return e.type===T},B=function(e){return e.type===P},W=function(e){var t=e.type;return t===T||t===P},U=function(e){return e.type===O},H=function(e){return e.type===R},V=function(e){return e.type===N},Y=function(e){return e.type===M},q=function(e){return e.type===_},G=function(e){var t=e.vendor;return L(t)},X=function(e){var t=e.model;return L(t)},K=function(e){var t=e.type;return L(t,"browser")},Q=function(e){return e.name===I.Android},Z=function(e){return e.name===I.Windows},J=function(e){return e.name===I.MAC_OS},ee=function(e){return e.name===I.WindowsPhone},te=function(e){return e.name===I.IOS},ne=function(e){var t=e.version;return L(t)},re=function(e){var t=e.name;return L(t)},oe=function(e){return e.name===z.Chrome},ie=function(e){return e.name===z.Firefox},ae=function(e){return e.name===z.Chromium},se=function(e){return e.name===z.Edge},le=function(e){return e.name===z.Yandex},ue=function(e){var t=e.name;return t===z.Safari||t===z.MobileSafari},ce=function(e){return e.name===z.MobileSafari},de=function(e){return e.name===z.Opera},fe=function(e){var t=e.name;return t===z.InternetExplorer||t===z.Ie},pe=function(e){return e.name===z.MIUI},he=function(e){return e.name===z.SamsungBrowser},me=function(e){var t=e.version;return L(t)},ge=function(e){var t=e.major;return L(t)},ve=function(e){var t=e.name;return L(t)},be=function(e){var t=e.name;return L(t)},ye=function(e){var t=e.version;return L(t)},we=function(){var e=A(),t=e&&e.userAgent&&e.userAgent.toLowerCase();return"string"==typeof t&&/electron/.test(t)},xe=function(e){return"string"==typeof e&&-1!==e.indexOf("Edg/")},Se=function(){var e=A();return e&&(/iPad|iPhone|iPod/.test(e.platform)||"MacIntel"===e.platform&&e.maxTouchPoints>1)&&!window.MSStream},Ee=function(){return F("iPad")},ke=function(){return F("iPhone")},Ce=function(){return F("iPod")},Te=function(e){return L(e)};function Pe(e){var t=e||h,n=t.device,r=t.browser,o=t.os,i=t.engine,a=t.ua;return{isSmartTV:U(n),isConsole:Y(n),isWearable:V(n),isEmbedded:q(n),isMobileSafari:ce(r)||Ee(),isChromium:ae(r),isMobile:W(n)||Ee(),isMobileOnly:j(n),isTablet:B(n)||Ee(),isBrowser:H(n),isDesktop:H(n),isAndroid:Q(o),isWinPhone:ee(o),isIOS:te(o)||Ee(),isChrome:oe(r),isFirefox:ie(r),isSafari:ue(r),isOpera:de(r),isIE:fe(r),osVersion:ne(o),osName:re(o),fullBrowserVersion:me(r),browserVersion:ge(r),browserName:ve(r),mobileVendor:G(n),mobileModel:X(n),engineName:be(i),engineVersion:ye(i),getUA:Te(a),isEdge:se(r)||xe(a),isYandex:le(r),deviceType:K(n),isIOS13:Se(),isIPad13:Ee(),isIPhone13:ke(),isIPod13:Ce(),isElectron:we(),isEdgeChromium:xe(a),isLegacyEdge:se(r)&&!xe(a),isWindows:Z(o),isMacOs:J(o),isMIUI:pe(r),isSamsungBrowser:he(r)}}var Oe=U(s),Me=Y(s),Ne=V(s),_e=q(s),Re=ce(i)||Ee(),ze=ae(i),Ie=W(s)||Ee(),De=j(s),Le=B(s)||Ee(),Ae=H(s),Fe=H(s),$e=Q(c),je=ee(c),Be=te(c)||Ee(),We=oe(i),Ue=ie(i),He=ue(i),Ve=de(i),Ye=fe(i),qe=ne(c),Ge=re(c),Xe=me(i),Ke=ge(i),Qe=ve(i),Ze=G(s),Je=X(s),et=be(u),tt=ye(u),nt=Te(d),rt=se(i)||xe(d),ot=le(i),it=K(s),at=Se(),st=Ee(),lt=ke(),ut=Ce(),ct=we(),dt=xe(d),ft=se(i)&&!xe(d),pt=Z(c),ht=J(c),mt=pe(i),gt=he(i);function vt(e){var t=e||window.navigator.userAgent;return p(t)}return $r.AndroidView=function(e){var r=e.renderWithFragment,o=e.children,i=S(e,["renderWithFragment","children"]);return $e?r?n.createElement(t.Fragment,null,o):n.createElement("div",i,o):null},$r.BrowserTypes=z,$r.BrowserView=function(e){var r=e.renderWithFragment,o=e.children,i=S(e,["renderWithFragment","children"]);return Ae?r?n.createElement(t.Fragment,null,o):n.createElement("div",i,o):null},$r.ConsoleView=function(e){var r=e.renderWithFragment,o=e.children,i=S(e,["renderWithFragment","children"]);return Me?r?n.createElement(t.Fragment,null,o):n.createElement("div",i,o):null},$r.CustomView=function(e){var r=e.renderWithFragment,o=e.children;e.viewClassName,e.style;var i=e.condition,a=S(e,["renderWithFragment","children","viewClassName","style","condition"]);return i?r?n.createElement(t.Fragment,null,o):n.createElement("div",a,o):null},$r.IEView=function(e){var r=e.renderWithFragment,o=e.children,i=S(e,["renderWithFragment","children"]);return Ye?r?n.createElement(t.Fragment,null,o):n.createElement("div",i,o):null},$r.IOSView=function(e){var r=e.renderWithFragment,o=e.children,i=S(e,["renderWithFragment","children"]);return Be?r?n.createElement(t.Fragment,null,o):n.createElement("div",i,o):null},$r.MobileOnlyView=function(e){var r=e.renderWithFragment,o=e.children;e.viewClassName,e.style;var i=S(e,["renderWithFragment","children","viewClassName","style"]);return De?r?n.createElement(t.Fragment,null,o):n.createElement("div",i,o):null},$r.MobileView=function(e){var r=e.renderWithFragment,o=e.children,i=S(e,["renderWithFragment","children"]);return Ie?r?n.createElement(t.Fragment,null,o):n.createElement("div",i,o):null},$r.OsTypes=I,$r.SmartTVView=function(e){var r=e.renderWithFragment,o=e.children,i=S(e,["renderWithFragment","children"]);return Oe?r?n.createElement(t.Fragment,null,o):n.createElement("div",i,o):null},$r.TabletView=function(e){var r=e.renderWithFragment,o=e.children,i=S(e,["renderWithFragment","children"]);return Le?r?n.createElement(t.Fragment,null,o):n.createElement("div",i,o):null},$r.WearableView=function(e){var r=e.renderWithFragment,o=e.children,i=S(e,["renderWithFragment","children"]);return Ne?r?n.createElement(t.Fragment,null,o):n.createElement("div",i,o):null},$r.WinPhoneView=function(e){var r=e.renderWithFragment,o=e.children,i=S(e,["renderWithFragment","children"]);return je?r?n.createElement(t.Fragment,null,o):n.createElement("div",i,o):null},$r.browserName=Qe,$r.browserVersion=Ke,$r.deviceDetect=function(e){var t=e?p(e):h,n=t.device,r=t.browser,o=t.engine,i=t.os,a=t.ua,s=function(e){switch(e){case T:return{isMobile:!0};case P:return{isTablet:!0};case O:return{isSmartTV:!0};case M:return{isConsole:!0};case N:return{isWearable:!0};case R:return{isBrowser:!0};case _:return{isEmbedded:!0};default:return D}}(n.type),l=s.isBrowser,u=s.isMobile,c=s.isTablet,d=s.isSmartTV,f=s.isConsole,m=s.isWearable,g=s.isEmbedded;return l?function(e,t,n,r,o){return{isBrowser:e,browserMajorVersion:L(t.major),browserFullVersion:L(t.version),browserName:L(t.name),engineName:L(n.name),engineVersion:L(n.version),osName:L(r.name),osVersion:L(r.version),userAgent:L(o)}}(l,r,o,i,a):d?function(e,t,n,r){return{isSmartTV:e,engineName:L(t.name),engineVersion:L(t.version),osName:L(n.name),osVersion:L(n.version),userAgent:L(r)}}(d,o,i,a):f?function(e,t,n,r){return{isConsole:e,engineName:L(t.name),engineVersion:L(t.version),osName:L(n.name),osVersion:L(n.version),userAgent:L(r)}}(f,o,i,a):u||c?$(s,n,i,a):m?function(e,t,n,r){return{isWearable:e,engineName:L(t.name),engineVersion:L(t.version),osName:L(n.name),osVersion:L(n.version),userAgent:L(r)}}(m,o,i,a):g?function(e,t,n,r,o){return{isEmbedded:e,vendor:L(t.vendor),model:L(t.model),engineName:L(n.name),engineVersion:L(n.version),osName:L(r.name),osVersion:L(r.version),userAgent:L(o)}}(g,n,o,i,a):void 0},$r.deviceType=it,$r.engineName=et,$r.engineVersion=tt,$r.fullBrowserVersion=Xe,$r.getSelectorsByUserAgent=function(e){if(e&&"string"==typeof e){var t=p(e);return Pe({device:t.device,browser:t.browser,os:t.os,engine:t.engine,ua:t.ua})}console.error("No valid user agent string was provided")},$r.getUA=nt,$r.isAndroid=$e,$r.isBrowser=Ae,$r.isChrome=We,$r.isChromium=ze,$r.isConsole=Me,$r.isDesktop=Fe,$r.isEdge=rt,$r.isEdgeChromium=dt,$r.isElectron=ct,$r.isEmbedded=_e,$r.isFirefox=Ue,$r.isIE=Ye,$r.isIOS=Be,$r.isIOS13=at,$r.isIPad13=st,$r.isIPhone13=lt,$r.isIPod13=ut,$r.isLegacyEdge=ft,$r.isMIUI=mt,$r.isMacOs=ht,$r.isMobile=Ie,$r.isMobileOnly=De,$r.isMobileSafari=Re,$r.isOpera=Ve,$r.isSafari=He,$r.isSamsungBrowser=gt,$r.isSmartTV=Oe,$r.isTablet=Le,$r.isWearable=Ne,$r.isWinPhone=je,$r.isWindows=pt,$r.isYandex=ot,$r.mobileModel=Je,$r.mobileVendor=Ze,$r.osName=Ge,$r.osVersion=qe,$r.parseUserAgent=p,$r.setUserAgent=function(e){return f(e)},$r.useDeviceData=vt,$r.useDeviceSelectors=function(e){var t=vt(e||window.navigator.userAgent);return[Pe(t),t]},$r.useMobileOrientation=function(){var e=k(t.useState(function(){var e=window.innerWidth>window.innerHeight?90:0;return{isPortrait:0===e,isLandscape:90===e,orientation:0===e?"portrait":"landscape"}}),2),n=e[0],r=e[1],o=t.useCallback(function(){var e=window.innerWidth>window.innerHeight?90:0,t={isPortrait:0===e,isLandscape:90===e,orientation:0===e?"portrait":"landscape"};n.orientation!==t.orientation&&r(t)},[n.orientation]);return t.useEffect(function(){return void 0!==("undefined"==typeof window?"undefined":g(window))&&Ie&&(o(),window.addEventListener("load",o,!1),window.addEventListener("resize",o,!1)),function(){window.removeEventListener("resize",o,!1),window.removeEventListener("load",o,!1)}},[o]),n},$r.withOrientationChange=function(e){return function(t){function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(t=function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return E(e)}(this,w(r).call(this,e))).isEventListenerAdded=!1,t.handleOrientationChange=t.handleOrientationChange.bind(E(t)),t.onOrientationChange=t.onOrientationChange.bind(E(t)),t.onPageLoad=t.onPageLoad.bind(E(t)),t.state={isLandscape:!1,isPortrait:!1},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&x(e,t)}(r,t),v(r,[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var e=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:0===e,isLandscape:90===e})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){void 0!==("undefined"==typeof window?"undefined":g(window))&&Ie&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return n.createElement(e,y({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),r}(n.Component)},$r}();
10
+ */function T(){if(d)return b;d=1;var e=l(),t=S();function r(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,i={};function s(e,t){a(e,t),a(e+"Capture",t)}function a(e,t){for(i[e]=t,e=0;e<t.length;e++)n.add(t[e])}var o=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),u=Object.prototype.hasOwnProperty,c=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},f={};function p(e,t,r,n,i,s,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=a}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){g[e]=new p(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];g[t]=new p(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){g[e]=new p(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){g[e]=new p(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){g[e]=new p(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){g[e]=new p(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){g[e]=new p(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){g[e]=new p(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){g[e]=new p(e,5,!1,e.toLowerCase(),null,!1,!1)});var m=/[\-:]([a-z])/g;function v(e){return e[1].toUpperCase()}function y(e,t,r,n){var i=g.hasOwnProperty(t)?g[t]:null;(null!==i?0!==i.type:n||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,r,n){if(null==t||function(e,t,r,n){if(null!==r&&0===r.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!n&&(null!==r?!r.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,r,n))return!0;if(n)return!1;if(null!==r)switch(r.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,r,i,n)&&(r=null),n||null===i?function(e){return!!u.call(f,e)||!u.call(h,e)&&(c.test(e)?f[e]=!0:(h[e]=!0,!1))}(t)&&(null===r?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=null===r?3!==i.type&&"":r:(t=i.attributeName,n=i.attributeNamespace,null===r?e.removeAttribute(t):(r=3===(i=i.type)||4===i&&!0===r?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(m,v);g[t]=new p(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(m,v);g[t]=new p(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(m,v);g[t]=new p(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){g[e]=new p(e,1,!1,e.toLowerCase(),null,!1,!1)}),g.xlinkHref=new p("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){g[e]=new p(e,1,!1,e.toLowerCase(),null,!0,!0)});var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,E=Symbol.for("react.element"),T=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),L=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),O=Symbol.iterator;function N(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=O&&e[O]||e["@@iterator"])?e:null}var F,$=Object.assign;function B(e){if(void 0===F)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);F=t&&t[1]||""}return"\n"+F+e}var U=!1;function z(e,t){if(!e||U)return"";U=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var n=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){n=e}e.call(t.prototype)}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var i=t.stack.split("\n"),s=n.stack.split("\n"),a=i.length-1,o=s.length-1;1<=a&&0<=o&&i[a]!==s[o];)o--;for(;1<=a&&0<=o;a--,o--)if(i[a]!==s[o]){if(1!==a||1!==o)do{if(a--,0>--o||i[a]!==s[o]){var l="\n"+i[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=a&&0<=o);break}}}finally{U=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?B(e):""}function j(e){switch(e.tag){case 5:return B(e.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return e=z(e.type,!1);case 11:return e=z(e.type.render,!1);case 1:return e=z(e.type,!0);default:return""}}function G(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case k:return"Fragment";case T:return"Portal";case A:return"Profiler";case x:return"StrictMode";case C:return"Suspense";case P:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case L:return(e.displayName||"Context")+".Consumer";case R:return(e._context.displayName||"Context")+".Provider";case I:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case D:return null!==(t=e.displayName||null)?t:G(e.type)||"Memo";case _:t=e._payload,e=e._init;try{return G(e(t))}catch(e){}}return null}function H(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return G(t);case 8:return t===x?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function V(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function W(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function K(e){e._valueTracker||(e._valueTracker=function(e){var t=W(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==r&&"function"==typeof r.get&&"function"==typeof r.set){var i=r.get,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=""+e,s.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Y(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=W(e)?e.checked?"true":"false":e.value),(e=n)!==r&&(t.setValue(e),!0)}function q(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function X(e,t){var r=t.checked;return $({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=r?r:e._wrapperState.initialChecked})}function Q(e,t){var r=null==t.defaultValue?"":t.defaultValue,n=null!=t.checked?t.checked:t.defaultChecked;r=V(null!=t.value?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Z(e,t){null!=(t=t.checked)&&y(e,"checked",t,!1)}function J(e,t){Z(e,t);var r=V(t.value),n=t.type;if(null!=r)"number"===n?(0===r&&""===e.value||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if("submit"===n||"reset"===n)return void e.removeAttribute("value");t.hasOwnProperty("value")?te(e,t.type,r):t.hasOwnProperty("defaultValue")&&te(e,t.type,V(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function ee(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!("submit"!==n&&"reset"!==n||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}""!==(r=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==r&&(e.name=r)}function te(e,t,r){"number"===t&&q(e.ownerDocument)===e||(null==r?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var re=Array.isArray;function ne(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+V(r),t=null,i=0;i<e.length;i++){if(e[i].value===r)return e[i].selected=!0,void(n&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function ie(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(r(91));return $({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function se(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(r(92));if(re(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:V(n)}}function ae(e,t){var r=V(t.value),n=V(t.defaultValue);null!=r&&((r=""+r)!==e.value&&(e.value=r),null==t.defaultValue&&e.defaultValue!==r&&(e.defaultValue=r)),null!=n&&(e.defaultValue=""+n)}function oe(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function le(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ue(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?le(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ce,de=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction(function(){return e(t,r)})}:e}(function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ce=ce||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function he(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&3===r.nodeType)return void(r.nodeValue=t)}e.textContent=t}var fe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pe=["Webkit","ms","Moz","O"];function ge(e,t,r){return null==t||"boolean"==typeof t||""===t?"":r||"number"!=typeof t||0===t||fe.hasOwnProperty(e)&&fe[e]?(""+t).trim():t+"px"}function me(e,t){for(var r in e=e.style,t)if(t.hasOwnProperty(r)){var n=0===r.indexOf("--"),i=ge(r,t[r],n);"float"===r&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}Object.keys(fe).forEach(function(e){pe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),fe[t]=fe[e]})});var ve=$({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ye(e,t){if(t){if(ve[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(r(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(r(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(r(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(r(62))}}function be(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var we=null;function Ee(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Se=null,Te=null,ke=null;function xe(e){if(e=bi(e)){if("function"!=typeof Se)throw Error(r(280));var t=e.stateNode;t&&(t=Ei(t),Se(e.stateNode,e.type,t))}}function Ae(e){Te?ke?ke.push(e):ke=[e]:Te=e}function Re(){if(Te){var e=Te,t=ke;if(ke=Te=null,xe(e),t)for(e=0;e<t.length;e++)xe(t[e])}}function Le(e,t){return e(t)}function Ie(){}var Ce=!1;function Pe(e,t,r){if(Ce)return e(t,r);Ce=!0;try{return Le(e,t,r)}finally{Ce=!1,(null!==Te||null!==ke)&&(Ie(),Re())}}function De(e,t){var n=e.stateNode;if(null===n)return null;var i=Ei(n);if(null===i)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(i=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!i;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(r(231,t,typeof n));return n}var _e=!1;if(o)try{var Me={};Object.defineProperty(Me,"passive",{get:function(){_e=!0}}),window.addEventListener("test",Me,Me),window.removeEventListener("test",Me,Me)}catch(e){_e=!1}function Oe(e,t,r,n,i,s,a,o,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(e){this.onError(e)}}var Ne=!1,Fe=null,$e=!1,Be=null,Ue={onError:function(e){Ne=!0,Fe=e}};function ze(e,t,r,n,i,s,a,o,l){Ne=!1,Fe=null,Oe.apply(Ue,arguments)}function je(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(r=t.return),e=t.return}while(e)}return 3===t.tag?r:null}function Ge(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function He(e){if(je(e)!==e)throw Error(r(188))}function Ve(e){return e=function(e){var t=e.alternate;if(!t){if(null===(t=je(e)))throw Error(r(188));return t!==e?null:e}for(var n=e,i=t;;){var s=n.return;if(null===s)break;var a=s.alternate;if(null===a){if(null!==(i=s.return)){n=i;continue}break}if(s.child===a.child){for(a=s.child;a;){if(a===n)return He(s),e;if(a===i)return He(s),t;a=a.sibling}throw Error(r(188))}if(n.return!==i.return)n=s,i=a;else{for(var o=!1,l=s.child;l;){if(l===n){o=!0,n=s,i=a;break}if(l===i){o=!0,i=s,n=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===n){o=!0,n=a,i=s;break}if(l===i){o=!0,i=a,n=s;break}l=l.sibling}if(!o)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(3!==n.tag)throw Error(r(188));return n.stateNode.current===n?e:t}(e),null!==e?We(e):null}function We(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=We(e);if(null!==t)return t;e=e.sibling}return null}var Ke=t.unstable_scheduleCallback,Ye=t.unstable_cancelCallback,qe=t.unstable_shouldYield,Xe=t.unstable_requestPaint,Qe=t.unstable_now,Ze=t.unstable_getCurrentPriorityLevel,Je=t.unstable_ImmediatePriority,et=t.unstable_UserBlockingPriority,tt=t.unstable_NormalPriority,rt=t.unstable_LowPriority,nt=t.unstable_IdlePriority,it=null,st=null;var at=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(ot(e)/lt|0)|0},ot=Math.log,lt=Math.LN2;var ut=64,ct=4194304;function dt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ht(e,t){var r=e.pendingLanes;if(0===r)return 0;var n=0,i=e.suspendedLanes,s=e.pingedLanes,a=268435455&r;if(0!==a){var o=a&~i;0!==o?n=dt(o):0!==(s&=a)&&(n=dt(s))}else 0!==(a=r&~i)?n=dt(a):0!==s&&(n=dt(s));if(0===n)return 0;if(0!==t&&t!==n&&0===(t&i)&&((i=n&-n)>=(s=t&-t)||16===i&&4194240&s))return t;if(4&n&&(n|=16&r),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=n;0<t;)i=1<<(r=31-at(t)),n|=e[r],t&=~i;return n}function ft(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function pt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function gt(){var e=ut;return!(4194240&(ut<<=1))&&(ut=64),e}function mt(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function vt(e,t,r){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-at(t)]=r}function yt(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-at(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var bt=0;function wt(e){return 1<(e&=-e)?4<e?268435455&e?16:536870912:4:1}var Et,St,Tt,kt,xt,At=!1,Rt=[],Lt=null,It=null,Ct=null,Pt=new Map,Dt=new Map,_t=[],Mt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Ot(e,t){switch(e){case"focusin":case"focusout":Lt=null;break;case"dragenter":case"dragleave":It=null;break;case"mouseover":case"mouseout":Ct=null;break;case"pointerover":case"pointerout":Pt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dt.delete(t.pointerId)}}function Nt(e,t,r,n,i,s){return null===e||e.nativeEvent!==s?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:s,targetContainers:[i]},null!==t&&(null!==(t=bi(t))&&St(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function Ft(e){var t=yi(e.target);if(null!==t){var r=je(t);if(null!==r)if(13===(t=r.tag)){if(null!==(t=Ge(r)))return e.blockedOn=t,void xt(e.priority,function(){Tt(r)})}else if(3===t&&r.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===r.tag?r.stateNode.containerInfo:null)}e.blockedOn=null}function $t(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var r=qt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==r)return null!==(t=bi(r))&&St(t),e.blockedOn=r,!1;var n=new(r=e.nativeEvent).constructor(r.type,r);we=n,r.target.dispatchEvent(n),we=null,t.shift()}return!0}function Bt(e,t,r){$t(e)&&r.delete(t)}function Ut(){At=!1,null!==Lt&&$t(Lt)&&(Lt=null),null!==It&&$t(It)&&(It=null),null!==Ct&&$t(Ct)&&(Ct=null),Pt.forEach(Bt),Dt.forEach(Bt)}function zt(e,r){e.blockedOn===r&&(e.blockedOn=null,At||(At=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ut)))}function jt(e){function t(t){return zt(t,e)}if(0<Rt.length){zt(Rt[0],e);for(var r=1;r<Rt.length;r++){var n=Rt[r];n.blockedOn===e&&(n.blockedOn=null)}}for(null!==Lt&&zt(Lt,e),null!==It&&zt(It,e),null!==Ct&&zt(Ct,e),Pt.forEach(t),Dt.forEach(t),r=0;r<_t.length;r++)(n=_t[r]).blockedOn===e&&(n.blockedOn=null);for(;0<_t.length&&null===(r=_t[0]).blockedOn;)Ft(r),null===r.blockedOn&&_t.shift()}var Gt=w.ReactCurrentBatchConfig,Ht=!0;function Vt(e,t,r,n){var i=bt,s=Gt.transition;Gt.transition=null;try{bt=1,Kt(e,t,r,n)}finally{bt=i,Gt.transition=s}}function Wt(e,t,r,n){var i=bt,s=Gt.transition;Gt.transition=null;try{bt=4,Kt(e,t,r,n)}finally{bt=i,Gt.transition=s}}function Kt(e,t,r,n){if(Ht){var i=qt(e,t,r,n);if(null===i)Hn(e,t,n,Yt,r),Ot(e,n);else if(function(e,t,r,n,i){switch(t){case"focusin":return Lt=Nt(Lt,e,t,r,n,i),!0;case"dragenter":return It=Nt(It,e,t,r,n,i),!0;case"mouseover":return Ct=Nt(Ct,e,t,r,n,i),!0;case"pointerover":var s=i.pointerId;return Pt.set(s,Nt(Pt.get(s)||null,e,t,r,n,i)),!0;case"gotpointercapture":return s=i.pointerId,Dt.set(s,Nt(Dt.get(s)||null,e,t,r,n,i)),!0}return!1}(i,e,t,r,n))n.stopPropagation();else if(Ot(e,n),4&t&&-1<Mt.indexOf(e)){for(;null!==i;){var s=bi(i);if(null!==s&&Et(s),null===(s=qt(e,t,r,n))&&Hn(e,t,n,Yt,r),s===i)break;i=s}null!==i&&n.stopPropagation()}else Hn(e,t,n,null,r)}}var Yt=null;function qt(e,t,r,n){if(Yt=null,null!==(e=yi(e=Ee(n))))if(null===(t=je(e)))e=null;else if(13===(r=t.tag)){if(null!==(e=Ge(t)))return e;e=null}else if(3===r){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Yt=e,null}function Xt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ze()){case Je:return 1;case et:return 4;case tt:case rt:return 16;case nt:return 536870912;default:return 16}default:return 16}}var Qt=null,Zt=null,Jt=null;function er(){if(Jt)return Jt;var e,t,r=Zt,n=r.length,i="value"in Qt?Qt.value:Qt.textContent,s=i.length;for(e=0;e<n&&r[e]===i[e];e++);var a=n-e;for(t=1;t<=a&&r[n-t]===i[s-t];t++);return Jt=i.slice(e,1<t?1-t:void 0)}function tr(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function rr(){return!0}function nr(){return!1}function ir(e){function t(t,r,n,i,s){for(var a in this._reactName=t,this._targetInst=n,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(i):i[a]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?rr:nr,this.isPropagationStopped=nr,this}return $(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=rr)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=rr)},persist:function(){},isPersistent:rr}),t}var sr,ar,or,lr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ur=ir(lr),cr=$({},lr,{view:0,detail:0}),dr=ir(cr),hr=$({},cr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kr,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==or&&(or&&"mousemove"===e.type?(sr=e.screenX-or.screenX,ar=e.screenY-or.screenY):ar=sr=0,or=e),sr)},movementY:function(e){return"movementY"in e?e.movementY:ar}}),fr=ir(hr),pr=ir($({},hr,{dataTransfer:0})),gr=ir($({},cr,{relatedTarget:0})),mr=ir($({},lr,{animationName:0,elapsedTime:0,pseudoElement:0})),vr=$({},lr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yr=ir(vr),br=ir($({},lr,{data:0})),wr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Er={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Sr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Tr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Sr[e])&&!!t[e]}function kr(){return Tr}var xr=$({},cr,{key:function(e){if(e.key){var t=wr[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tr(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Er[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kr,charCode:function(e){return"keypress"===e.type?tr(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tr(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Ar=ir(xr),Rr=ir($({},hr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Lr=ir($({},cr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kr})),Ir=ir($({},lr,{propertyName:0,elapsedTime:0,pseudoElement:0})),Cr=$({},hr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Pr=ir(Cr),Dr=[9,13,27,32],_r=o&&"CompositionEvent"in window,Mr=null;o&&"documentMode"in document&&(Mr=document.documentMode);var Or=o&&"TextEvent"in window&&!Mr,Nr=o&&(!_r||Mr&&8<Mr&&11>=Mr),Fr=String.fromCharCode(32),$r=!1;function Br(e,t){switch(e){case"keyup":return-1!==Dr.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ur(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var zr=!1;var jr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Gr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!jr[e.type]:"textarea"===t}function Hr(e,t,r,n){Ae(n),0<(t=Wn(t,"onChange")).length&&(r=new ur("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Vr=null,Wr=null;function Kr(e){$n(e,0)}function Yr(e){if(Y(wi(e)))return e}function qr(e,t){if("change"===e)return t}var Xr=!1;if(o){var Qr;if(o){var Zr="oninput"in document;if(!Zr){var Jr=document.createElement("div");Jr.setAttribute("oninput","return;"),Zr="function"==typeof Jr.oninput}Qr=Zr}else Qr=!1;Xr=Qr&&(!document.documentMode||9<document.documentMode)}function en(){Vr&&(Vr.detachEvent("onpropertychange",tn),Wr=Vr=null)}function tn(e){if("value"===e.propertyName&&Yr(Wr)){var t=[];Hr(t,Wr,e,Ee(e)),Pe(Kr,t)}}function rn(e,t,r){"focusin"===e?(en(),Wr=r,(Vr=t).attachEvent("onpropertychange",tn)):"focusout"===e&&en()}function nn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Yr(Wr)}function sn(e,t){if("click"===e)return Yr(t)}function an(e,t){if("input"===e||"change"===e)return Yr(t)}var on="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function ln(e,t){if(on(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!u.call(t,i)||!on(e[i],t[i]))return!1}return!0}function un(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cn(e,t){var r,n=un(e);for(e=0;n;){if(3===n.nodeType){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=un(n)}}function dn(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?dn(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function hn(){for(var e=window,t=q();t instanceof e.HTMLIFrameElement;){try{var r="string"==typeof t.contentWindow.location.href}catch(e){r=!1}if(!r)break;t=q((e=t.contentWindow).document)}return t}function fn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function pn(e){var t=hn(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&dn(r.ownerDocument.documentElement,r)){if(null!==n&&fn(r))if(t=n.start,void 0===(e=n.end)&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if((e=(t=r.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=void 0===n.end?s:Math.min(n.end,i),!e.extend&&s>n&&(i=n,n=s,s=i),i=cn(r,s);var a=cn(r,n);i&&a&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),s>n?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=r;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof r.focus&&r.focus(),r=0;r<t.length;r++)(e=t[r]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var gn=o&&"documentMode"in document&&11>=document.documentMode,mn=null,vn=null,yn=null,bn=!1;function wn(e,t,r){var n=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;bn||null==mn||mn!==q(n)||("selectionStart"in(n=mn)&&fn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},yn&&ln(yn,n)||(yn=n,0<(n=Wn(vn,"onSelect")).length&&(t=new ur("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=mn)))}function En(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Sn={animationend:En("Animation","AnimationEnd"),animationiteration:En("Animation","AnimationIteration"),animationstart:En("Animation","AnimationStart"),transitionend:En("Transition","TransitionEnd")},Tn={},kn={};function xn(e){if(Tn[e])return Tn[e];if(!Sn[e])return e;var t,r=Sn[e];for(t in r)if(r.hasOwnProperty(t)&&t in kn)return Tn[e]=r[t];return e}o&&(kn=document.createElement("div").style,"AnimationEvent"in window||(delete Sn.animationend.animation,delete Sn.animationiteration.animation,delete Sn.animationstart.animation),"TransitionEvent"in window||delete Sn.transitionend.transition);var An=xn("animationend"),Rn=xn("animationiteration"),Ln=xn("animationstart"),In=xn("transitionend"),Cn=new Map,Pn="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Dn(e,t){Cn.set(e,t),s(t,[e])}for(var _n=0;_n<Pn.length;_n++){var Mn=Pn[_n];Dn(Mn.toLowerCase(),"on"+(Mn[0].toUpperCase()+Mn.slice(1)))}Dn(An,"onAnimationEnd"),Dn(Rn,"onAnimationIteration"),Dn(Ln,"onAnimationStart"),Dn("dblclick","onDoubleClick"),Dn("focusin","onFocus"),Dn("focusout","onBlur"),Dn(In,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var On="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Nn=new Set("cancel close invalid load scroll toggle".split(" ").concat(On));function Fn(e,t,n){var i=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,i,s,a,o,l,u){if(ze.apply(this,arguments),Ne){if(!Ne)throw Error(r(198));var c=Fe;Ne=!1,Fe=null,$e||($e=!0,Be=c)}}(i,t,void 0,e),e.currentTarget=null}function $n(e,t){t=!!(4&t);for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var s=void 0;if(t)for(var a=n.length-1;0<=a;a--){var o=n[a],l=o.instance,u=o.currentTarget;if(o=o.listener,l!==s&&i.isPropagationStopped())break e;Fn(i,o,u),s=l}else for(a=0;a<n.length;a++){if(l=(o=n[a]).instance,u=o.currentTarget,o=o.listener,l!==s&&i.isPropagationStopped())break e;Fn(i,o,u),s=l}}}if($e)throw e=Be,$e=!1,Be=null,e}function Bn(e,t){var r=t[gi];void 0===r&&(r=t[gi]=new Set);var n=e+"__bubble";r.has(n)||(Gn(t,e,2,!1),r.add(n))}function Un(e,t,r){var n=0;t&&(n|=4),Gn(r,e,n,t)}var zn="_reactListening"+Math.random().toString(36).slice(2);function jn(e){if(!e[zn]){e[zn]=!0,n.forEach(function(t){"selectionchange"!==t&&(Nn.has(t)||Un(t,!1,e),Un(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[zn]||(t[zn]=!0,Un("selectionchange",!1,t))}}function Gn(e,t,r,n){switch(Xt(t)){case 1:var i=Vt;break;case 4:i=Wt;break;default:i=Kt}r=i.bind(null,t,r,e),i=void 0,!_e||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),n?void 0!==i?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):void 0!==i?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function Hn(e,t,r,n,i){var s=n;if(!(1&t||2&t||null===n))e:for(;;){if(null===n)return;var a=n.tag;if(3===a||4===a){var o=n.stateNode.containerInfo;if(o===i||8===o.nodeType&&o.parentNode===i)break;if(4===a)for(a=n.return;null!==a;){var l=a.tag;if((3===l||4===l)&&((l=a.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;a=a.return}for(;null!==o;){if(null===(a=yi(o)))return;if(5===(l=a.tag)||6===l){n=s=a;continue e}o=o.parentNode}}n=n.return}Pe(function(){var n=s,i=Ee(r),a=[];e:{var o=Cn.get(e);if(void 0!==o){var l=ur,u=e;switch(e){case"keypress":if(0===tr(r))break e;case"keydown":case"keyup":l=Ar;break;case"focusin":u="focus",l=gr;break;case"focusout":u="blur",l=gr;break;case"beforeblur":case"afterblur":l=gr;break;case"click":if(2===r.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=fr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=pr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Lr;break;case An:case Rn:case Ln:l=mr;break;case In:l=Ir;break;case"scroll":l=dr;break;case"wheel":l=Pr;break;case"copy":case"cut":case"paste":l=yr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=Rr}var c=!!(4&t),d=!c&&"scroll"===e,h=c?null!==o?o+"Capture":null:o;c=[];for(var f,p=n;null!==p;){var g=(f=p).stateNode;if(5===f.tag&&null!==g&&(f=g,null!==h&&(null!=(g=De(p,h))&&c.push(Vn(p,g,f)))),d)break;p=p.return}0<c.length&&(o=new l(o,u,null,r,i),a.push({event:o,listeners:c}))}}if(!(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(o="mouseover"===e||"pointerover"===e)||r===we||!(u=r.relatedTarget||r.fromElement)||!yi(u)&&!u[pi])&&(l||o)&&(o=i.window===i?i:(o=i.ownerDocument)?o.defaultView||o.parentWindow:window,l?(l=n,null!==(u=(u=r.relatedTarget||r.toElement)?yi(u):null)&&(u!==(d=je(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(l=null,u=n),l!==u)){if(c=fr,g="onMouseLeave",h="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(c=Rr,g="onPointerLeave",h="onPointerEnter",p="pointer"),d=null==l?o:wi(l),f=null==u?o:wi(u),(o=new c(g,p+"leave",l,r,i)).target=d,o.relatedTarget=f,g=null,yi(i)===n&&((c=new c(h,p+"enter",u,r,i)).target=f,c.relatedTarget=d,g=c),d=g,l&&u)e:{for(h=u,p=0,f=c=l;f;f=Kn(f))p++;for(f=0,g=h;g;g=Kn(g))f++;for(;0<p-f;)c=Kn(c),p--;for(;0<f-p;)h=Kn(h),f--;for(;p--;){if(c===h||null!==h&&c===h.alternate)break e;c=Kn(c),h=Kn(h)}c=null}else c=null;null!==l&&Yn(a,o,l,c,!1),null!==u&&null!==d&&Yn(a,d,u,c,!0)}if("select"===(l=(o=n?wi(n):window).nodeName&&o.nodeName.toLowerCase())||"input"===l&&"file"===o.type)var m=qr;else if(Gr(o))if(Xr)m=an;else{m=nn;var v=rn}else(l=o.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===o.type||"radio"===o.type)&&(m=sn);switch(m&&(m=m(e,n))?Hr(a,m,r,i):(v&&v(e,o,n),"focusout"===e&&(v=o._wrapperState)&&v.controlled&&"number"===o.type&&te(o,"number",o.value)),v=n?wi(n):window,e){case"focusin":(Gr(v)||"true"===v.contentEditable)&&(mn=v,vn=n,yn=null);break;case"focusout":yn=vn=mn=null;break;case"mousedown":bn=!0;break;case"contextmenu":case"mouseup":case"dragend":bn=!1,wn(a,r,i);break;case"selectionchange":if(gn)break;case"keydown":case"keyup":wn(a,r,i)}var y;if(_r)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else zr?Br(e,r)&&(b="onCompositionEnd"):"keydown"===e&&229===r.keyCode&&(b="onCompositionStart");b&&(Nr&&"ko"!==r.locale&&(zr||"onCompositionStart"!==b?"onCompositionEnd"===b&&zr&&(y=er()):(Zt="value"in(Qt=i)?Qt.value:Qt.textContent,zr=!0)),0<(v=Wn(n,b)).length&&(b=new br(b,e,null,r,i),a.push({event:b,listeners:v}),y?b.data=y:null!==(y=Ur(r))&&(b.data=y))),(y=Or?function(e,t){switch(e){case"compositionend":return Ur(t);case"keypress":return 32!==t.which?null:($r=!0,Fr);case"textInput":return(e=t.data)===Fr&&$r?null:e;default:return null}}(e,r):function(e,t){if(zr)return"compositionend"===e||!_r&&Br(e,t)?(e=er(),Jt=Zt=Qt=null,zr=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Nr&&"ko"!==t.locale?null:t.data}}(e,r))&&(0<(n=Wn(n,"onBeforeInput")).length&&(i=new br("onBeforeInput","beforeinput",null,r,i),a.push({event:i,listeners:n}),i.data=y))}$n(a,t)})}function Vn(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Wn(e,t){for(var r=t+"Capture",n=[];null!==e;){var i=e,s=i.stateNode;5===i.tag&&null!==s&&(i=s,null!=(s=De(e,r))&&n.unshift(Vn(e,s,i)),null!=(s=De(e,t))&&n.push(Vn(e,s,i))),e=e.return}return n}function Kn(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Yn(e,t,r,n,i){for(var s=t._reactName,a=[];null!==r&&r!==n;){var o=r,l=o.alternate,u=o.stateNode;if(null!==l&&l===n)break;5===o.tag&&null!==u&&(o=u,i?null!=(l=De(r,s))&&a.unshift(Vn(r,l,o)):i||null!=(l=De(r,s))&&a.push(Vn(r,l,o))),r=r.return}0!==a.length&&e.push({event:t,listeners:a})}var qn=/\r\n?/g,Xn=/\u0000|\uFFFD/g;function Qn(e){return("string"==typeof e?e:""+e).replace(qn,"\n").replace(Xn,"")}function Zn(e,t,n){if(t=Qn(t),Qn(e)!==t&&n)throw Error(r(425))}function Jn(){}var ei=null,ti=null;function ri(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ni="function"==typeof setTimeout?setTimeout:void 0,ii="function"==typeof clearTimeout?clearTimeout:void 0,si="function"==typeof Promise?Promise:void 0,ai="function"==typeof queueMicrotask?queueMicrotask:void 0!==si?function(e){return si.resolve(null).then(e).catch(oi)}:ni;function oi(e){setTimeout(function(){throw e})}function li(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&8===i.nodeType)if("/$"===(r=i.data)){if(0===n)return e.removeChild(i),void jt(t);n--}else"$"!==r&&"$?"!==r&&"$!"!==r||n++;r=i}while(r);jt(t)}function ui(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function ci(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var r=e.data;if("$"===r||"$!"===r||"$?"===r){if(0===t)return e;t--}else"/$"===r&&t++}e=e.previousSibling}return null}var di=Math.random().toString(36).slice(2),hi="__reactFiber$"+di,fi="__reactProps$"+di,pi="__reactContainer$"+di,gi="__reactEvents$"+di,mi="__reactListeners$"+di,vi="__reactHandles$"+di;function yi(e){var t=e[hi];if(t)return t;for(var r=e.parentNode;r;){if(t=r[pi]||r[hi]){if(r=t.alternate,null!==t.child||null!==r&&null!==r.child)for(e=ci(e);null!==e;){if(r=e[hi])return r;e=ci(e)}return t}r=(e=r).parentNode}return null}function bi(e){return!(e=e[hi]||e[pi])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function wi(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(r(33))}function Ei(e){return e[fi]||null}var Si=[],Ti=-1;function ki(e){return{current:e}}function xi(e){0>Ti||(e.current=Si[Ti],Si[Ti]=null,Ti--)}function Ai(e,t){Ti++,Si[Ti]=e.current,e.current=t}var Ri={},Li=ki(Ri),Ii=ki(!1),Ci=Ri;function Pi(e,t){var r=e.type.contextTypes;if(!r)return Ri;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i,s={};for(i in r)s[i]=t[i];return n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Di(e){return null!=(e=e.childContextTypes)}function _i(){xi(Ii),xi(Li)}function Mi(e,t,n){if(Li.current!==Ri)throw Error(r(168));Ai(Li,t),Ai(Ii,n)}function Oi(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,"function"!=typeof i.getChildContext)return n;for(var s in i=i.getChildContext())if(!(s in t))throw Error(r(108,H(e)||"Unknown",s));return $({},n,i)}function Ni(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ri,Ci=Li.current,Ai(Li,e),Ai(Ii,Ii.current),!0}function Fi(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=Oi(e,t,Ci),i.__reactInternalMemoizedMergedChildContext=e,xi(Ii),xi(Li),Ai(Li,e)):xi(Ii),Ai(Ii,n)}var $i=null,Bi=!1,Ui=!1;function zi(e){null===$i?$i=[e]:$i.push(e)}function ji(){if(!Ui&&null!==$i){Ui=!0;var e=0,t=bt;try{var r=$i;for(bt=1;e<r.length;e++){var n=r[e];do{n=n(!0)}while(null!==n)}$i=null,Bi=!1}catch(t){throw null!==$i&&($i=$i.slice(e+1)),Ke(Je,ji),t}finally{bt=t,Ui=!1}}return null}var Gi=[],Hi=0,Vi=null,Wi=0,Ki=[],Yi=0,qi=null,Xi=1,Qi="";function Zi(e,t){Gi[Hi++]=Wi,Gi[Hi++]=Vi,Vi=e,Wi=t}function Ji(e,t,r){Ki[Yi++]=Xi,Ki[Yi++]=Qi,Ki[Yi++]=qi,qi=e;var n=Xi;e=Qi;var i=32-at(n)-1;n&=~(1<<i),r+=1;var s=32-at(t)+i;if(30<s){var a=i-i%5;s=(n&(1<<a)-1).toString(32),n>>=a,i-=a,Xi=1<<32-at(t)+i|r<<i|n,Qi=s+e}else Xi=1<<s|r<<i|n,Qi=e}function es(e){null!==e.return&&(Zi(e,1),Ji(e,1,0))}function ts(e){for(;e===Vi;)Vi=Gi[--Hi],Gi[Hi]=null,Wi=Gi[--Hi],Gi[Hi]=null;for(;e===qi;)qi=Ki[--Yi],Ki[Yi]=null,Qi=Ki[--Yi],Ki[Yi]=null,Xi=Ki[--Yi],Ki[Yi]=null}var rs=null,ns=null,is=!1,ss=null;function as(e,t){var r=Pu(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,null===(t=e.deletions)?(e.deletions=[r],e.flags|=16):t.push(r)}function os(e,t){switch(e.tag){case 5:var r=e.type;return null!==(t=1!==t.nodeType||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,rs=e,ns=ui(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,rs=e,ns=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(r=null!==qi?{id:Xi,overflow:Qi}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},(r=Pu(18,null,null,0)).stateNode=t,r.return=e,e.child=r,rs=e,ns=null,!0);default:return!1}}function ls(e){return!(!(1&e.mode)||128&e.flags)}function us(e){if(is){var t=ns;if(t){var n=t;if(!os(e,t)){if(ls(e))throw Error(r(418));t=ui(n.nextSibling);var i=rs;t&&os(e,t)?as(i,n):(e.flags=-4097&e.flags|2,is=!1,rs=e)}}else{if(ls(e))throw Error(r(418));e.flags=-4097&e.flags|2,is=!1,rs=e}}}function cs(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;rs=e}function ds(e){if(e!==rs)return!1;if(!is)return cs(e),is=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!ri(e.type,e.memoizedProps)),t&&(t=ns)){if(ls(e))throw hs(),Error(r(418));for(;t;)as(e,t),t=ui(t.nextSibling)}if(cs(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(r(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){ns=ui(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}ns=null}}else ns=rs?ui(e.stateNode.nextSibling):null;return!0}function hs(){for(var e=ns;e;)e=ui(e.nextSibling)}function fs(){ns=rs=null,is=!1}function ps(e){null===ss?ss=[e]:ss.push(e)}var gs=w.ReactCurrentBatchConfig;function ms(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(r(309));var i=n.stateNode}if(!i)throw Error(r(147,e));var s=i,a=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===a?t.ref:(t=function(e){var t=s.refs;null===e?delete t[a]:t[a]=e},t._stringRef=a,t)}if("string"!=typeof e)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function vs(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ys(e){return(0,e._init)(e._payload)}function bs(e){function t(t,r){if(e){var n=t.deletions;null===n?(t.deletions=[r],t.flags|=16):n.push(r)}}function n(r,n){if(!e)return null;for(;null!==n;)t(r,n),n=n.sibling;return null}function i(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function s(e,t){return(e=_u(e,t)).index=0,e.sibling=null,e}function a(t,r,n){return t.index=n,e?null!==(n=t.alternate)?(n=n.index)<r?(t.flags|=2,r):n:(t.flags|=2,r):(t.flags|=1048576,r)}function o(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,r,n){return null===t||6!==t.tag?((t=Fu(r,e.mode,n)).return=e,t):((t=s(t,r)).return=e,t)}function u(e,t,r,n){var i=r.type;return i===k?d(e,t,r.props.children,n,r.key):null!==t&&(t.elementType===i||"object"==typeof i&&null!==i&&i.$$typeof===_&&ys(i)===t.type)?((n=s(t,r.props)).ref=ms(e,t,r),n.return=e,n):((n=Mu(r.type,r.key,r.props,null,e.mode,n)).ref=ms(e,t,r),n.return=e,n)}function c(e,t,r,n){return null===t||4!==t.tag||t.stateNode.containerInfo!==r.containerInfo||t.stateNode.implementation!==r.implementation?((t=$u(r,e.mode,n)).return=e,t):((t=s(t,r.children||[])).return=e,t)}function d(e,t,r,n,i){return null===t||7!==t.tag?((t=Ou(r,e.mode,n,i)).return=e,t):((t=s(t,r)).return=e,t)}function h(e,t,r){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=Fu(""+t,e.mode,r)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case E:return(r=Mu(t.type,t.key,t.props,null,e.mode,r)).ref=ms(e,null,t),r.return=e,r;case T:return(t=$u(t,e.mode,r)).return=e,t;case _:return h(e,(0,t._init)(t._payload),r)}if(re(t)||N(t))return(t=Ou(t,e.mode,r,null)).return=e,t;vs(e,t)}return null}function f(e,t,r,n){var i=null!==t?t.key:null;if("string"==typeof r&&""!==r||"number"==typeof r)return null!==i?null:l(e,t,""+r,n);if("object"==typeof r&&null!==r){switch(r.$$typeof){case E:return r.key===i?u(e,t,r,n):null;case T:return r.key===i?c(e,t,r,n):null;case _:return f(e,t,(i=r._init)(r._payload),n)}if(re(r)||N(r))return null!==i?null:d(e,t,r,n,null);vs(e,r)}return null}function p(e,t,r,n,i){if("string"==typeof n&&""!==n||"number"==typeof n)return l(t,e=e.get(r)||null,""+n,i);if("object"==typeof n&&null!==n){switch(n.$$typeof){case E:return u(t,e=e.get(null===n.key?r:n.key)||null,n,i);case T:return c(t,e=e.get(null===n.key?r:n.key)||null,n,i);case _:return p(e,t,r,(0,n._init)(n._payload),i)}if(re(n)||N(n))return d(t,e=e.get(r)||null,n,i,null);vs(t,n)}return null}function g(r,s,o,l){for(var u=null,c=null,d=s,g=s=0,m=null;null!==d&&g<o.length;g++){d.index>g?(m=d,d=null):m=d.sibling;var v=f(r,d,o[g],l);if(null===v){null===d&&(d=m);break}e&&d&&null===v.alternate&&t(r,d),s=a(v,s,g),null===c?u=v:c.sibling=v,c=v,d=m}if(g===o.length)return n(r,d),is&&Zi(r,g),u;if(null===d){for(;g<o.length;g++)null!==(d=h(r,o[g],l))&&(s=a(d,s,g),null===c?u=d:c.sibling=d,c=d);return is&&Zi(r,g),u}for(d=i(r,d);g<o.length;g++)null!==(m=p(d,r,g,o[g],l))&&(e&&null!==m.alternate&&d.delete(null===m.key?g:m.key),s=a(m,s,g),null===c?u=m:c.sibling=m,c=m);return e&&d.forEach(function(e){return t(r,e)}),is&&Zi(r,g),u}function m(s,o,l,u){var c=N(l);if("function"!=typeof c)throw Error(r(150));if(null==(l=c.call(l)))throw Error(r(151));for(var d=c=null,g=o,m=o=0,v=null,y=l.next();null!==g&&!y.done;m++,y=l.next()){g.index>m?(v=g,g=null):v=g.sibling;var b=f(s,g,y.value,u);if(null===b){null===g&&(g=v);break}e&&g&&null===b.alternate&&t(s,g),o=a(b,o,m),null===d?c=b:d.sibling=b,d=b,g=v}if(y.done)return n(s,g),is&&Zi(s,m),c;if(null===g){for(;!y.done;m++,y=l.next())null!==(y=h(s,y.value,u))&&(o=a(y,o,m),null===d?c=y:d.sibling=y,d=y);return is&&Zi(s,m),c}for(g=i(s,g);!y.done;m++,y=l.next())null!==(y=p(g,s,m,y.value,u))&&(e&&null!==y.alternate&&g.delete(null===y.key?m:y.key),o=a(y,o,m),null===d?c=y:d.sibling=y,d=y);return e&&g.forEach(function(e){return t(s,e)}),is&&Zi(s,m),c}return function e(r,i,a,l){if("object"==typeof a&&null!==a&&a.type===k&&null===a.key&&(a=a.props.children),"object"==typeof a&&null!==a){switch(a.$$typeof){case E:e:{for(var u=a.key,c=i;null!==c;){if(c.key===u){if((u=a.type)===k){if(7===c.tag){n(r,c.sibling),(i=s(c,a.props.children)).return=r,r=i;break e}}else if(c.elementType===u||"object"==typeof u&&null!==u&&u.$$typeof===_&&ys(u)===c.type){n(r,c.sibling),(i=s(c,a.props)).ref=ms(r,c,a),i.return=r,r=i;break e}n(r,c);break}t(r,c),c=c.sibling}a.type===k?((i=Ou(a.props.children,r.mode,l,a.key)).return=r,r=i):((l=Mu(a.type,a.key,a.props,null,r.mode,l)).ref=ms(r,i,a),l.return=r,r=l)}return o(r);case T:e:{for(c=a.key;null!==i;){if(i.key===c){if(4===i.tag&&i.stateNode.containerInfo===a.containerInfo&&i.stateNode.implementation===a.implementation){n(r,i.sibling),(i=s(i,a.children||[])).return=r,r=i;break e}n(r,i);break}t(r,i),i=i.sibling}(i=$u(a,r.mode,l)).return=r,r=i}return o(r);case _:return e(r,i,(c=a._init)(a._payload),l)}if(re(a))return g(r,i,a,l);if(N(a))return m(r,i,a,l);vs(r,a)}return"string"==typeof a&&""!==a||"number"==typeof a?(a=""+a,null!==i&&6===i.tag?(n(r,i.sibling),(i=s(i,a)).return=r,r=i):(n(r,i),(i=Fu(a,r.mode,l)).return=r,r=i),o(r)):n(r,i)}}var ws=bs(!0),Es=bs(!1),Ss=ki(null),Ts=null,ks=null,xs=null;function As(){xs=ks=Ts=null}function Rs(e){var t=Ss.current;xi(Ss),e._currentValue=t}function Ls(e,t,r){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==n&&(n.childLanes|=t)):null!==n&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Is(e,t){Ts=e,xs=ks=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(bo=!0),e.firstContext=null)}function Cs(e){var t=e._currentValue;if(xs!==e)if(e={context:e,memoizedValue:t,next:null},null===ks){if(null===Ts)throw Error(r(308));ks=e,Ts.dependencies={lanes:0,firstContext:e}}else ks=ks.next=e;return t}var Ps=null;function Ds(e){null===Ps?Ps=[e]:Ps.push(e)}function _s(e,t,r,n){var i=t.interleaved;return null===i?(r.next=r,Ds(t)):(r.next=i.next,i.next=r),t.interleaved=r,Ms(e,n)}function Ms(e,t){e.lanes|=t;var r=e.alternate;for(null!==r&&(r.lanes|=t),r=e,e=e.return;null!==e;)e.childLanes|=t,null!==(r=e.alternate)&&(r.childLanes|=t),r=e,e=e.return;return 3===r.tag?r.stateNode:null}var Os=!1;function Ns(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Fs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function $s(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Bs(e,t,r){var n=e.updateQueue;if(null===n)return null;if(n=n.shared,2&Ll){var i=n.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),n.pending=t,Ms(e,r)}return null===(i=n.interleaved)?(t.next=t,Ds(n)):(t.next=i.next,i.next=t),n.interleaved=t,Ms(e,r)}function Us(e,t,r){if(null!==(t=t.updateQueue)&&(t=t.shared,4194240&r)){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,yt(e,r)}}function zs(e,t){var r=e.updateQueue,n=e.alternate;if(null!==n&&r===(n=n.updateQueue)){var i=null,s=null;if(null!==(r=r.firstBaseUpdate)){do{var a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};null===s?i=s=a:s=s.next=a,r=r.next}while(null!==r);null===s?i=s=t:s=s.next=t}else i=s=t;return r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},void(e.updateQueue=r)}null===(e=r.lastBaseUpdate)?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function js(e,t,r,n){var i=e.updateQueue;Os=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(null!==o){i.shared.pending=null;var l=o,u=l.next;l.next=null,null===a?s=u:a.next=u,a=l;var c=e.alternate;null!==c&&((o=(c=c.updateQueue).lastBaseUpdate)!==a&&(null===o?c.firstBaseUpdate=u:o.next=u,c.lastBaseUpdate=l))}if(null!==s){var d=i.baseState;for(a=0,c=u=l=null,o=s;;){var h=o.lane,f=o.eventTime;if((n&h)===h){null!==c&&(c=c.next={eventTime:f,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var p=e,g=o;switch(h=t,f=r,g.tag){case 1:if("function"==typeof(p=g.payload)){d=p.call(f,d,h);break e}d=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null==(h="function"==typeof(p=g.payload)?p.call(f,d,h):p))break e;d=$({},d,h);break e;case 2:Os=!0}}null!==o.callback&&0!==o.lane&&(e.flags|=64,null===(h=i.effects)?i.effects=[o]:h.push(o))}else f={eventTime:f,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},null===c?(u=c=f,l=d):c=c.next=f,a|=h;if(null===(o=o.next)){if(null===(o=i.shared.pending))break;o=(h=o).next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}if(null===c&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,null!==(t=i.shared.interleaved)){i=t;do{a|=i.lane,i=i.next}while(i!==t)}else null===s&&(i.shared.lanes=0);Nl|=a,e.lanes=a,e.memoizedState=d}}function Gs(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var i=e[t],s=i.callback;if(null!==s){if(i.callback=null,i=n,"function"!=typeof s)throw Error(r(191,s));s.call(i)}}}var Hs={},Vs=ki(Hs),Ws=ki(Hs),Ks=ki(Hs);function Ys(e){if(e===Hs)throw Error(r(174));return e}function qs(e,t){switch(Ai(Ks,t),Ai(Ws,e),Ai(Vs,Hs),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ue(null,"");break;default:t=ue(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}xi(Vs),Ai(Vs,t)}function Xs(){xi(Vs),xi(Ws),xi(Ks)}function Qs(e){Ys(Ks.current);var t=Ys(Vs.current),r=ue(t,e.type);t!==r&&(Ai(Ws,e),Ai(Vs,r))}function Zs(e){Ws.current===e&&(xi(Vs),xi(Ws))}var Js=ki(0);function ea(e){for(var t=e;null!==t;){if(13===t.tag){var r=t.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||"$?"===r.data||"$!"===r.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ta=[];function ra(){for(var e=0;e<ta.length;e++)ta[e]._workInProgressVersionPrimary=null;ta.length=0}var na=w.ReactCurrentDispatcher,ia=w.ReactCurrentBatchConfig,sa=0,aa=null,oa=null,la=null,ua=!1,ca=!1,da=0,ha=0;function fa(){throw Error(r(321))}function pa(e,t){if(null===t)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!on(e[r],t[r]))return!1;return!0}function ga(e,t,n,i,s,a){if(sa=a,aa=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,na.current=null===e||null===e.memoizedState?Za:Ja,e=n(i,s),ca){a=0;do{if(ca=!1,da=0,25<=a)throw Error(r(301));a+=1,la=oa=null,t.updateQueue=null,na.current=eo,e=n(i,s)}while(ca)}if(na.current=Qa,t=null!==oa&&null!==oa.next,sa=0,la=oa=aa=null,ua=!1,t)throw Error(r(300));return e}function ma(){var e=0!==da;return da=0,e}function va(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===la?aa.memoizedState=la=e:la=la.next=e,la}function ya(){if(null===oa){var e=aa.alternate;e=null!==e?e.memoizedState:null}else e=oa.next;var t=null===la?aa.memoizedState:la.next;if(null!==t)la=t,oa=e;else{if(null===e)throw Error(r(310));e={memoizedState:(oa=e).memoizedState,baseState:oa.baseState,baseQueue:oa.baseQueue,queue:oa.queue,next:null},null===la?aa.memoizedState=la=e:la=la.next=e}return la}function ba(e,t){return"function"==typeof t?t(e):t}function wa(e){var t=ya(),n=t.queue;if(null===n)throw Error(r(311));n.lastRenderedReducer=e;var i=oa,s=i.baseQueue,a=n.pending;if(null!==a){if(null!==s){var o=s.next;s.next=a.next,a.next=o}i.baseQueue=s=a,n.pending=null}if(null!==s){a=s.next,i=i.baseState;var l=o=null,u=null,c=a;do{var d=c.lane;if((sa&d)===d)null!==u&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),i=c.hasEagerState?c.eagerState:e(i,c.action);else{var h={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};null===u?(l=u=h,o=i):u=u.next=h,aa.lanes|=d,Nl|=d}c=c.next}while(null!==c&&c!==a);null===u?o=i:u.next=l,on(i,t.memoizedState)||(bo=!0),t.memoizedState=i,t.baseState=o,t.baseQueue=u,n.lastRenderedState=i}if(null!==(e=n.interleaved)){s=e;do{a=s.lane,aa.lanes|=a,Nl|=a,s=s.next}while(s!==e)}else null===s&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ea(e){var t=ya(),n=t.queue;if(null===n)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,s=n.pending,a=t.memoizedState;if(null!==s){n.pending=null;var o=s=s.next;do{a=e(a,o.action),o=o.next}while(o!==s);on(a,t.memoizedState)||(bo=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,i]}function Sa(){}function Ta(e,t){var n=aa,i=ya(),s=t(),a=!on(i.memoizedState,s);if(a&&(i.memoizedState=s,bo=!0),i=i.queue,Oa(Aa.bind(null,n,i,e),[e]),i.getSnapshot!==t||a||null!==la&&1&la.memoizedState.tag){if(n.flags|=2048,Ca(9,xa.bind(null,n,i,s,t),void 0,null),null===Il)throw Error(r(349));30&sa||ka(n,t,s)}return s}function ka(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},null===(t=aa.updateQueue)?(t={lastEffect:null,stores:null},aa.updateQueue=t,t.stores=[e]):null===(r=t.stores)?t.stores=[e]:r.push(e)}function xa(e,t,r,n){t.value=r,t.getSnapshot=n,Ra(t)&&La(e)}function Aa(e,t,r){return r(function(){Ra(t)&&La(e)})}function Ra(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!on(e,r)}catch(e){return!0}}function La(e){var t=Ms(e,1);null!==t&&ru(t,e,1,-1)}function Ia(e){var t=va();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ba,lastRenderedState:e},t.queue=e,e=e.dispatch=Ka.bind(null,aa,e),[t.memoizedState,e]}function Ca(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},null===(t=aa.updateQueue)?(t={lastEffect:null,stores:null},aa.updateQueue=t,t.lastEffect=e.next=e):null===(r=t.lastEffect)?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e),e}function Pa(){return ya().memoizedState}function Da(e,t,r,n){var i=va();aa.flags|=e,i.memoizedState=Ca(1|t,r,void 0,void 0===n?null:n)}function _a(e,t,r,n){var i=ya();n=void 0===n?null:n;var s=void 0;if(null!==oa){var a=oa.memoizedState;if(s=a.destroy,null!==n&&pa(n,a.deps))return void(i.memoizedState=Ca(t,r,s,n))}aa.flags|=e,i.memoizedState=Ca(1|t,r,s,n)}function Ma(e,t){return Da(8390656,8,e,t)}function Oa(e,t){return _a(2048,8,e,t)}function Na(e,t){return _a(4,2,e,t)}function Fa(e,t){return _a(4,4,e,t)}function $a(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Ba(e,t,r){return r=null!=r?r.concat([e]):null,_a(4,4,$a.bind(null,t,e),r)}function Ua(){}function za(e,t){var r=ya();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&pa(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function ja(e,t){var r=ya();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&pa(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function Ga(e,t,r){return 21&sa?(on(r,t)||(r=gt(),aa.lanes|=r,Nl|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,bo=!0),e.memoizedState=r)}function Ha(e,t){var r=bt;bt=0!==r&&4>r?r:4,e(!0);var n=ia.transition;ia.transition={};try{e(!1),t()}finally{bt=r,ia.transition=n}}function Va(){return ya().memoizedState}function Wa(e,t,r){var n=tu(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Ya(e))qa(t,r);else if(null!==(r=_s(e,t,r,n))){ru(r,e,n,eu()),Xa(r,t,n)}}function Ka(e,t,r){var n=tu(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Ya(e))qa(t,i);else{var s=e.alternate;if(0===e.lanes&&(null===s||0===s.lanes)&&null!==(s=t.lastRenderedReducer))try{var a=t.lastRenderedState,o=s(a,r);if(i.hasEagerState=!0,i.eagerState=o,on(o,a)){var l=t.interleaved;return null===l?(i.next=i,Ds(t)):(i.next=l.next,l.next=i),void(t.interleaved=i)}}catch(e){}null!==(r=_s(e,t,i,n))&&(ru(r,e,n,i=eu()),Xa(r,t,n))}}function Ya(e){var t=e.alternate;return e===aa||null!==t&&t===aa}function qa(e,t){ca=ua=!0;var r=e.pending;null===r?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Xa(e,t,r){if(4194240&r){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,yt(e,r)}}var Qa={readContext:Cs,useCallback:fa,useContext:fa,useEffect:fa,useImperativeHandle:fa,useInsertionEffect:fa,useLayoutEffect:fa,useMemo:fa,useReducer:fa,useRef:fa,useState:fa,useDebugValue:fa,useDeferredValue:fa,useTransition:fa,useMutableSource:fa,useSyncExternalStore:fa,useId:fa,unstable_isNewReconciler:!1},Za={readContext:Cs,useCallback:function(e,t){return va().memoizedState=[e,void 0===t?null:t],e},useContext:Cs,useEffect:Ma,useImperativeHandle:function(e,t,r){return r=null!=r?r.concat([e]):null,Da(4194308,4,$a.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Da(4194308,4,e,t)},useInsertionEffect:function(e,t){return Da(4,2,e,t)},useMemo:function(e,t){var r=va();return t=void 0===t?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=va();return t=void 0!==r?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=Wa.bind(null,aa,e),[n.memoizedState,e]},useRef:function(e){return e={current:e},va().memoizedState=e},useState:Ia,useDebugValue:Ua,useDeferredValue:function(e){return va().memoizedState=e},useTransition:function(){var e=Ia(!1),t=e[0];return e=Ha.bind(null,e[1]),va().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=aa,s=va();if(is){if(void 0===n)throw Error(r(407));n=n()}else{if(n=t(),null===Il)throw Error(r(349));30&sa||ka(i,t,n)}s.memoizedState=n;var a={value:n,getSnapshot:t};return s.queue=a,Ma(Aa.bind(null,i,a,e),[e]),i.flags|=2048,Ca(9,xa.bind(null,i,a,n,t),void 0,null),n},useId:function(){var e=va(),t=Il.identifierPrefix;if(is){var r=Qi;t=":"+t+"R"+(r=(Xi&~(1<<32-at(Xi)-1)).toString(32)+r),0<(r=da++)&&(t+="H"+r.toString(32)),t+=":"}else t=":"+t+"r"+(r=ha++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Ja={readContext:Cs,useCallback:za,useContext:Cs,useEffect:Oa,useImperativeHandle:Ba,useInsertionEffect:Na,useLayoutEffect:Fa,useMemo:ja,useReducer:wa,useRef:Pa,useState:function(){return wa(ba)},useDebugValue:Ua,useDeferredValue:function(e){return Ga(ya(),oa.memoizedState,e)},useTransition:function(){return[wa(ba)[0],ya().memoizedState]},useMutableSource:Sa,useSyncExternalStore:Ta,useId:Va,unstable_isNewReconciler:!1},eo={readContext:Cs,useCallback:za,useContext:Cs,useEffect:Oa,useImperativeHandle:Ba,useInsertionEffect:Na,useLayoutEffect:Fa,useMemo:ja,useReducer:Ea,useRef:Pa,useState:function(){return Ea(ba)},useDebugValue:Ua,useDeferredValue:function(e){var t=ya();return null===oa?t.memoizedState=e:Ga(t,oa.memoizedState,e)},useTransition:function(){return[Ea(ba)[0],ya().memoizedState]},useMutableSource:Sa,useSyncExternalStore:Ta,useId:Va,unstable_isNewReconciler:!1};function to(e,t){if(e&&e.defaultProps){for(var r in t=$({},t),e=e.defaultProps)void 0===t[r]&&(t[r]=e[r]);return t}return t}function ro(e,t,r,n){r=null==(r=r(n,t=e.memoizedState))?t:$({},t,r),e.memoizedState=r,0===e.lanes&&(e.updateQueue.baseState=r)}var no={isMounted:function(e){return!!(e=e._reactInternals)&&je(e)===e},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=eu(),i=tu(e),s=$s(n,i);s.payload=t,null!=r&&(s.callback=r),null!==(t=Bs(e,s,i))&&(ru(t,e,i,n),Us(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=eu(),i=tu(e),s=$s(n,i);s.tag=1,s.payload=t,null!=r&&(s.callback=r),null!==(t=Bs(e,s,i))&&(ru(t,e,i,n),Us(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=eu(),n=tu(e),i=$s(r,n);i.tag=2,null!=t&&(i.callback=t),null!==(t=Bs(e,i,n))&&(ru(t,e,n,r),Us(t,e,n))}};function io(e,t,r,n,i,s,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(n,s,a):!t.prototype||!t.prototype.isPureReactComponent||(!ln(r,n)||!ln(i,s))}function so(e,t,r){var n=!1,i=Ri,s=t.contextType;return"object"==typeof s&&null!==s?s=Cs(s):(i=Di(t)?Ci:Li.current,s=(n=null!=(n=t.contextTypes))?Pi(e,i):Ri),t=new t(r,s),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=no,e.stateNode=t,t._reactInternals=e,n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function ao(e,t,r,n){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(r,n),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&no.enqueueReplaceState(t,t.state,null)}function oo(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},Ns(e);var s=t.contextType;"object"==typeof s&&null!==s?i.context=Cs(s):(s=Di(t)?Ci:Li.current,i.context=Pi(e,s)),i.state=e.memoizedState,"function"==typeof(s=t.getDerivedStateFromProps)&&(ro(e,t,s,r),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&no.enqueueReplaceState(i,i.state,null),js(e,r,i,n),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4194308)}function lo(e,t){try{var r="",n=t;do{r+=j(n),n=n.return}while(n);var i=r}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i,digest:null}}function uo(e,t,r){return{value:e,source:null,stack:null!=r?r:null,digest:null!=t?t:null}}function co(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var ho="function"==typeof WeakMap?WeakMap:Map;function fo(e,t,r){(r=$s(-1,r)).tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Hl||(Hl=!0,Vl=n),co(0,t)},r}function po(e,t,r){(r=$s(-1,r)).tag=3;var n=e.type.getDerivedStateFromError;if("function"==typeof n){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){co(0,t)}}var s=e.stateNode;return null!==s&&"function"==typeof s.componentDidCatch&&(r.callback=function(){co(0,t),"function"!=typeof n&&(null===Wl?Wl=new Set([this]):Wl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),r}function go(e,t,r){var n=e.pingCache;if(null===n){n=e.pingCache=new ho;var i=new Set;n.set(t,i)}else void 0===(i=n.get(t))&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=xu.bind(null,e,t,r),t.then(e,e))}function mo(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function vo(e,t,r,n,i){return 1&e.mode?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,1===r.tag&&(null===r.alternate?r.tag=17:((t=$s(-1,1)).tag=2,Bs(r,t,1))),r.lanes|=1),e)}var yo=w.ReactCurrentOwner,bo=!1;function wo(e,t,r,n){t.child=null===e?Es(t,null,r,n):ws(t,e.child,r,n)}function Eo(e,t,r,n,i){r=r.render;var s=t.ref;return Is(t,i),n=ga(e,t,r,n,s,i),r=ma(),null===e||bo?(is&&r&&es(t),t.flags|=1,wo(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Ho(e,t,i))}function So(e,t,r,n,i){if(null===e){var s=r.type;return"function"!=typeof s||Du(s)||void 0!==s.defaultProps||null!==r.compare||void 0!==r.defaultProps?((e=Mu(r.type,null,n,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=s,To(e,t,s,n,i))}if(s=e.child,0===(e.lanes&i)){var a=s.memoizedProps;if((r=null!==(r=r.compare)?r:ln)(a,n)&&e.ref===t.ref)return Ho(e,t,i)}return t.flags|=1,(e=_u(s,n)).ref=t.ref,e.return=t,t.child=e}function To(e,t,r,n,i){if(null!==e){var s=e.memoizedProps;if(ln(s,n)&&e.ref===t.ref){if(bo=!1,t.pendingProps=n=s,0===(e.lanes&i))return t.lanes=e.lanes,Ho(e,t,i);131072&e.flags&&(bo=!0)}}return Ao(e,t,r,n,i)}function ko(e,t,r){var n=t.pendingProps,i=n.children,s=null!==e?e.memoizedState:null;if("hidden"===n.mode)if(1&t.mode){if(!(1073741824&r))return e=null!==s?s.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ai(_l,Dl),Dl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=null!==s?s.baseLanes:r,Ai(_l,Dl),Dl|=n}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ai(_l,Dl),Dl|=r;else null!==s?(n=s.baseLanes|r,t.memoizedState=null):n=r,Ai(_l,Dl),Dl|=n;return wo(e,t,i,r),t.child}function xo(e,t){var r=t.ref;(null===e&&null!==r||null!==e&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Ao(e,t,r,n,i){var s=Di(r)?Ci:Li.current;return s=Pi(t,s),Is(t,i),r=ga(e,t,r,n,s,i),n=ma(),null===e||bo?(is&&n&&es(t),t.flags|=1,wo(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Ho(e,t,i))}function Ro(e,t,r,n,i){if(Di(r)){var s=!0;Ni(t)}else s=!1;if(Is(t,i),null===t.stateNode)Go(e,t),so(t,r,n),oo(t,r,n,i),n=!0;else if(null===e){var a=t.stateNode,o=t.memoizedProps;a.props=o;var l=a.context,u=r.contextType;"object"==typeof u&&null!==u?u=Cs(u):u=Pi(t,u=Di(r)?Ci:Li.current);var c=r.getDerivedStateFromProps,d="function"==typeof c||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==n||l!==u)&&ao(t,a,n,u),Os=!1;var h=t.memoizedState;a.state=h,js(t,n,a,i),l=t.memoizedState,o!==n||h!==l||Ii.current||Os?("function"==typeof c&&(ro(t,r,c,n),l=t.memoizedState),(o=Os||io(t,r,o,n,h,l,u))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=l),a.props=n,a.state=l,a.context=u,n=o):("function"==typeof a.componentDidMount&&(t.flags|=4194308),n=!1)}else{a=t.stateNode,Fs(e,t),o=t.memoizedProps,u=t.type===t.elementType?o:to(t.type,o),a.props=u,d=t.pendingProps,h=a.context,"object"==typeof(l=r.contextType)&&null!==l?l=Cs(l):l=Pi(t,l=Di(r)?Ci:Li.current);var f=r.getDerivedStateFromProps;(c="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==d||h!==l)&&ao(t,a,n,l),Os=!1,h=t.memoizedState,a.state=h,js(t,n,a,i);var p=t.memoizedState;o!==d||h!==p||Ii.current||Os?("function"==typeof f&&(ro(t,r,f,n),p=t.memoizedState),(u=Os||io(t,r,u,n,h,p,l)||!1)?(c||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(n,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(n,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=p),a.props=n,a.state=p,a.context=l,n=u):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return Lo(e,t,r,n,s,i)}function Lo(e,t,r,n,i,s){xo(e,t);var a=!!(128&t.flags);if(!n&&!a)return i&&Fi(t,r,!1),Ho(e,t,s);n=t.stateNode,yo.current=t;var o=a&&"function"!=typeof r.getDerivedStateFromError?null:n.render();return t.flags|=1,null!==e&&a?(t.child=ws(t,e.child,null,s),t.child=ws(t,null,o,s)):wo(e,t,o,s),t.memoizedState=n.state,i&&Fi(t,r,!0),t.child}function Io(e){var t=e.stateNode;t.pendingContext?Mi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Mi(0,t.context,!1),qs(e,t.containerInfo)}function Co(e,t,r,n,i){return fs(),ps(i),t.flags|=256,wo(e,t,r,n),t.child}var Po,Do,_o,Mo,Oo={dehydrated:null,treeContext:null,retryLane:0};function No(e){return{baseLanes:e,cachePool:null,transitions:null}}function Fo(e,t,n){var i,s=t.pendingProps,a=Js.current,o=!1,l=!!(128&t.flags);if((i=l)||(i=(null===e||null!==e.memoizedState)&&!!(2&a)),i?(o=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),Ai(Js,1&a),null===e)return us(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=s.children,e=s.fallback,o?(s=t.mode,o=t.child,l={mode:"hidden",children:l},1&s||null===o?o=Nu(l,s,0,null):(o.childLanes=0,o.pendingProps=l),e=Ou(e,s,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=No(n),t.memoizedState=Oo,e):$o(t,l));if(null!==(a=e.memoizedState)&&null!==(i=a.dehydrated))return function(e,t,n,i,s,a,o){if(n)return 256&t.flags?(t.flags&=-257,Bo(e,t,o,i=uo(Error(r(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=i.fallback,s=t.mode,i=Nu({mode:"visible",children:i.children},s,0,null),(a=Ou(a,s,o,null)).flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,1&t.mode&&ws(t,e.child,null,o),t.child.memoizedState=No(o),t.memoizedState=Oo,a);if(!(1&t.mode))return Bo(e,t,o,null);if("$!"===s.data){if(i=s.nextSibling&&s.nextSibling.dataset)var l=i.dgst;return i=l,Bo(e,t,o,i=uo(a=Error(r(419)),i,void 0))}if(l=0!==(o&e.childLanes),bo||l){if(null!==(i=Il)){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}0!==(s=0!==(s&(i.suspendedLanes|o))?0:s)&&s!==a.retryLane&&(a.retryLane=s,Ms(e,s),ru(i,e,s,-1))}return gu(),Bo(e,t,o,i=uo(Error(r(421))))}return"$?"===s.data?(t.flags|=128,t.child=e.child,t=Ru.bind(null,e),s._reactRetry=t,null):(e=a.treeContext,ns=ui(s.nextSibling),rs=t,is=!0,ss=null,null!==e&&(Ki[Yi++]=Xi,Ki[Yi++]=Qi,Ki[Yi++]=qi,Xi=e.id,Qi=e.overflow,qi=t),t=$o(t,i.children),t.flags|=4096,t)}(e,t,l,s,i,a,n);if(o){o=s.fallback,l=t.mode,i=(a=e.child).sibling;var u={mode:"hidden",children:s.children};return 1&l||t.child===a?(s=_u(a,u)).subtreeFlags=14680064&a.subtreeFlags:((s=t.child).childLanes=0,s.pendingProps=u,t.deletions=null),null!==i?o=_u(i,o):(o=Ou(o,l,n,null)).flags|=2,o.return=t,s.return=t,s.sibling=o,t.child=s,s=o,o=t.child,l=null===(l=e.child.memoizedState)?No(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},o.memoizedState=l,o.childLanes=e.childLanes&~n,t.memoizedState=Oo,s}return e=(o=e.child).sibling,s=_u(o,{mode:"visible",children:s.children}),!(1&t.mode)&&(s.lanes=n),s.return=t,s.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=s,t.memoizedState=null,s}function $o(e,t){return(t=Nu({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Bo(e,t,r,n){return null!==n&&ps(n),ws(t,e.child,null,r),(e=$o(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Uo(e,t,r){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),Ls(e.return,t,r)}function zo(e,t,r,n,i){var s=e.memoizedState;null===s?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i)}function jo(e,t,r){var n=t.pendingProps,i=n.revealOrder,s=n.tail;if(wo(e,t,n.children,r),2&(n=Js.current))n=1&n|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Uo(e,r,t);else if(19===e.tag)Uo(e,r,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Ai(Js,n),1&t.mode)switch(i){case"forwards":for(r=t.child,i=null;null!==r;)null!==(e=r.alternate)&&null===ea(e)&&(i=r),r=r.sibling;null===(r=i)?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),zo(t,!1,i,r,s);break;case"backwards":for(r=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===ea(e)){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}zo(t,!0,r,null,s);break;case"together":zo(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function Go(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ho(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Nl|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(r(153));if(null!==t.child){for(n=_u(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=_u(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Vo(e,t){if(!is)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?t||null===e.tail?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Wo(e){var t=null!==e.alternate&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;null!==i;)r|=i.lanes|i.childLanes,n|=14680064&i.subtreeFlags,n|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Ko(e,t,n){var s=t.pendingProps;switch(ts(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wo(t),null;case 1:case 17:return Di(t.type)&&_i(),Wo(t),null;case 3:return s=t.stateNode,Xs(),xi(Ii),xi(Li),ra(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),null!==e&&null!==e.child||(ds(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==ss&&(au(ss),ss=null))),Do(e,t),Wo(t),null;case 5:Zs(t);var a=Ys(Ks.current);if(n=t.type,null!==e&&null!=t.stateNode)_o(e,t,n,s,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(null===t.stateNode)throw Error(r(166));return Wo(t),null}if(e=Ys(Vs.current),ds(t)){s=t.stateNode,n=t.type;var o=t.memoizedProps;switch(s[hi]=t,s[fi]=o,e=!!(1&t.mode),n){case"dialog":Bn("cancel",s),Bn("close",s);break;case"iframe":case"object":case"embed":Bn("load",s);break;case"video":case"audio":for(a=0;a<On.length;a++)Bn(On[a],s);break;case"source":Bn("error",s);break;case"img":case"image":case"link":Bn("error",s),Bn("load",s);break;case"details":Bn("toggle",s);break;case"input":Q(s,o),Bn("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!o.multiple},Bn("invalid",s);break;case"textarea":se(s,o),Bn("invalid",s)}for(var l in ye(n,o),a=null,o)if(o.hasOwnProperty(l)){var u=o[l];"children"===l?"string"==typeof u?s.textContent!==u&&(!0!==o.suppressHydrationWarning&&Zn(s.textContent,u,e),a=["children",u]):"number"==typeof u&&s.textContent!==""+u&&(!0!==o.suppressHydrationWarning&&Zn(s.textContent,u,e),a=["children",""+u]):i.hasOwnProperty(l)&&null!=u&&"onScroll"===l&&Bn("scroll",s)}switch(n){case"input":K(s),ee(s,o,!0);break;case"textarea":K(s),oe(s);break;case"select":case"option":break;default:"function"==typeof o.onClick&&(s.onclick=Jn)}s=a,t.updateQueue=s,null!==s&&(t.flags|=4)}else{l=9===a.nodeType?a:a.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=le(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof s.is?e=l.createElement(n,{is:s.is}):(e=l.createElement(n),"select"===n&&(l=e,s.multiple?l.multiple=!0:s.size&&(l.size=s.size))):e=l.createElementNS(e,n),e[hi]=t,e[fi]=s,Po(e,t,!1,!1),t.stateNode=e;e:{switch(l=be(n,s),n){case"dialog":Bn("cancel",e),Bn("close",e),a=s;break;case"iframe":case"object":case"embed":Bn("load",e),a=s;break;case"video":case"audio":for(a=0;a<On.length;a++)Bn(On[a],e);a=s;break;case"source":Bn("error",e),a=s;break;case"img":case"image":case"link":Bn("error",e),Bn("load",e),a=s;break;case"details":Bn("toggle",e),a=s;break;case"input":Q(e,s),a=X(e,s),Bn("invalid",e);break;case"option":default:a=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},a=$({},s,{value:void 0}),Bn("invalid",e);break;case"textarea":se(e,s),a=ie(e,s),Bn("invalid",e)}for(o in ye(n,a),u=a)if(u.hasOwnProperty(o)){var c=u[o];"style"===o?me(e,c):"dangerouslySetInnerHTML"===o?null!=(c=c?c.__html:void 0)&&de(e,c):"children"===o?"string"==typeof c?("textarea"!==n||""!==c)&&he(e,c):"number"==typeof c&&he(e,""+c):"suppressContentEditableWarning"!==o&&"suppressHydrationWarning"!==o&&"autoFocus"!==o&&(i.hasOwnProperty(o)?null!=c&&"onScroll"===o&&Bn("scroll",e):null!=c&&y(e,o,c,l))}switch(n){case"input":K(e),ee(e,s,!1);break;case"textarea":K(e),oe(e);break;case"option":null!=s.value&&e.setAttribute("value",""+V(s.value));break;case"select":e.multiple=!!s.multiple,null!=(o=s.value)?ne(e,!!s.multiple,o,!1):null!=s.defaultValue&&ne(e,!!s.multiple,s.defaultValue,!0);break;default:"function"==typeof a.onClick&&(e.onclick=Jn)}switch(n){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Wo(t),null;case 6:if(e&&null!=t.stateNode)Mo(e,t,e.memoizedProps,s);else{if("string"!=typeof s&&null===t.stateNode)throw Error(r(166));if(n=Ys(Ks.current),Ys(Vs.current),ds(t)){if(s=t.stateNode,n=t.memoizedProps,s[hi]=t,(o=s.nodeValue!==n)&&null!==(e=rs))switch(e.tag){case 3:Zn(s.nodeValue,n,!!(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Zn(s.nodeValue,n,!!(1&e.mode))}o&&(t.flags|=4)}else(s=(9===n.nodeType?n:n.ownerDocument).createTextNode(s))[hi]=t,t.stateNode=s}return Wo(t),null;case 13:if(xi(Js),s=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(is&&null!==ns&&1&t.mode&&!(128&t.flags))hs(),fs(),t.flags|=98560,o=!1;else if(o=ds(t),null!==s&&null!==s.dehydrated){if(null===e){if(!o)throw Error(r(318));if(!(o=null!==(o=t.memoizedState)?o.dehydrated:null))throw Error(r(317));o[hi]=t}else fs(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Wo(t),o=!1}else null!==ss&&(au(ss),ss=null),o=!0;if(!o)return 65536&t.flags?t:null}return 128&t.flags?(t.lanes=n,t):((s=null!==s)!==(null!==e&&null!==e.memoizedState)&&s&&(t.child.flags|=8192,1&t.mode&&(null===e||1&Js.current?0===Ml&&(Ml=3):gu())),null!==t.updateQueue&&(t.flags|=4),Wo(t),null);case 4:return Xs(),Do(e,t),null===e&&jn(t.stateNode.containerInfo),Wo(t),null;case 10:return Rs(t.type._context),Wo(t),null;case 19:if(xi(Js),null===(o=t.memoizedState))return Wo(t),null;if(s=!!(128&t.flags),null===(l=o.rendering))if(s)Vo(o,!1);else{if(0!==Ml||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(l=ea(e))){for(t.flags|=128,Vo(o,!1),null!==(s=l.updateQueue)&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=n,n=t.child;null!==n;)e=s,(o=n).flags&=14680066,null===(l=o.alternate)?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=l.childLanes,o.lanes=l.lanes,o.child=l.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=l.memoizedProps,o.memoizedState=l.memoizedState,o.updateQueue=l.updateQueue,o.type=l.type,e=l.dependencies,o.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ai(Js,1&Js.current|2),t.child}e=e.sibling}null!==o.tail&&Qe()>jl&&(t.flags|=128,s=!0,Vo(o,!1),t.lanes=4194304)}else{if(!s)if(null!==(e=ea(l))){if(t.flags|=128,s=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Vo(o,!0),null===o.tail&&"hidden"===o.tailMode&&!l.alternate&&!is)return Wo(t),null}else 2*Qe()-o.renderingStartTime>jl&&1073741824!==n&&(t.flags|=128,s=!0,Vo(o,!1),t.lanes=4194304);o.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=o.last)?n.sibling=l:t.child=l,o.last=l)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Qe(),t.sibling=null,n=Js.current,Ai(Js,s?1&n|2:1&n),t):(Wo(t),null);case 22:case 23:return du(),s=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==s&&(t.flags|=8192),s&&1&t.mode?!!(1073741824&Dl)&&(Wo(t),6&t.subtreeFlags&&(t.flags|=8192)):Wo(t),null;case 24:case 25:return null}throw Error(r(156,t.tag))}function Yo(e,t){switch(ts(t),t.tag){case 1:return Di(t.type)&&_i(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Xs(),xi(Ii),xi(Li),ra(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Zs(t),null;case 13:if(xi(Js),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(r(340));fs()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return xi(Js),null;case 4:return Xs(),null;case 10:return Rs(t.type._context),null;case 22:case 23:return du(),null;default:return null}}Po=function(e,t){for(var r=t.child;null!==r;){if(5===r.tag||6===r.tag)e.appendChild(r.stateNode);else if(4!==r.tag&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},Do=function(){},_o=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,Ys(Vs.current);var a,o=null;switch(r){case"input":s=X(e,s),n=X(e,n),o=[];break;case"select":s=$({},s,{value:void 0}),n=$({},n,{value:void 0}),o=[];break;case"textarea":s=ie(e,s),n=ie(e,n),o=[];break;default:"function"!=typeof s.onClick&&"function"==typeof n.onClick&&(e.onclick=Jn)}for(c in ye(r,n),r=null,s)if(!n.hasOwnProperty(c)&&s.hasOwnProperty(c)&&null!=s[c])if("style"===c){var l=s[c];for(a in l)l.hasOwnProperty(a)&&(r||(r={}),r[a]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(i.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in n){var u=n[c];if(l=null!=s?s[c]:void 0,n.hasOwnProperty(c)&&u!==l&&(null!=u||null!=l))if("style"===c)if(l){for(a in l)!l.hasOwnProperty(a)||u&&u.hasOwnProperty(a)||(r||(r={}),r[a]="");for(a in u)u.hasOwnProperty(a)&&l[a]!==u[a]&&(r||(r={}),r[a]=u[a])}else r||(o||(o=[]),o.push(c,r)),r=u;else"dangerouslySetInnerHTML"===c?(u=u?u.__html:void 0,l=l?l.__html:void 0,null!=u&&l!==u&&(o=o||[]).push(c,u)):"children"===c?"string"!=typeof u&&"number"!=typeof u||(o=o||[]).push(c,""+u):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(i.hasOwnProperty(c)?(null!=u&&"onScroll"===c&&Bn("scroll",e),o||l===u||(o=[])):(o=o||[]).push(c,u))}r&&(o=o||[]).push("style",r);var c=o;(t.updateQueue=c)&&(t.flags|=4)}},Mo=function(e,t,r,n){r!==n&&(t.flags|=4)};var qo=!1,Xo=!1,Qo="function"==typeof WeakSet?WeakSet:Set,Zo=null;function Jo(e,t){var r=e.ref;if(null!==r)if("function"==typeof r)try{r(null)}catch(r){ku(e,t,r)}else r.current=null}function el(e,t,r){try{r()}catch(r){ku(e,t,r)}}var tl=!1;function rl(e,t,r){var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var i=n=n.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,void 0!==s&&el(t,r,s)}i=i.next}while(i!==n)}}function nl(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function il(e){var t=e.ref;if(null!==t){var r=e.stateNode;e.tag,e=r,"function"==typeof t?t(e):t.current=e}}function sl(e){var t=e.alternate;null!==t&&(e.alternate=null,sl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[hi],delete t[fi],delete t[gi],delete t[mi],delete t[vi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function al(e){return 5===e.tag||3===e.tag||4===e.tag}function ol(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||al(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function ll(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?8===r.nodeType?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(8===r.nodeType?(t=r.parentNode).insertBefore(e,r):(t=r).appendChild(e),null!=(r=r._reactRootContainer)||null!==t.onclick||(t.onclick=Jn));else if(4!==n&&null!==(e=e.child))for(ll(e,t,r),e=e.sibling;null!==e;)ll(e,t,r),e=e.sibling}function ul(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(4!==n&&null!==(e=e.child))for(ul(e,t,r),e=e.sibling;null!==e;)ul(e,t,r),e=e.sibling}var cl=null,dl=!1;function hl(e,t,r){for(r=r.child;null!==r;)fl(e,t,r),r=r.sibling}function fl(e,t,r){if(st&&"function"==typeof st.onCommitFiberUnmount)try{st.onCommitFiberUnmount(it,r)}catch(e){}switch(r.tag){case 5:Xo||Jo(r,t);case 6:var n=cl,i=dl;cl=null,hl(e,t,r),dl=i,null!==(cl=n)&&(dl?(e=cl,r=r.stateNode,8===e.nodeType?e.parentNode.removeChild(r):e.removeChild(r)):cl.removeChild(r.stateNode));break;case 18:null!==cl&&(dl?(e=cl,r=r.stateNode,8===e.nodeType?li(e.parentNode,r):1===e.nodeType&&li(e,r),jt(e)):li(cl,r.stateNode));break;case 4:n=cl,i=dl,cl=r.stateNode.containerInfo,dl=!0,hl(e,t,r),cl=n,dl=i;break;case 0:case 11:case 14:case 15:if(!Xo&&(null!==(n=r.updateQueue)&&null!==(n=n.lastEffect))){i=n=n.next;do{var s=i,a=s.destroy;s=s.tag,void 0!==a&&(2&s||4&s)&&el(r,t,a),i=i.next}while(i!==n)}hl(e,t,r);break;case 1:if(!Xo&&(Jo(r,t),"function"==typeof(n=r.stateNode).componentWillUnmount))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(e){ku(r,t,e)}hl(e,t,r);break;case 21:hl(e,t,r);break;case 22:1&r.mode?(Xo=(n=Xo)||null!==r.memoizedState,hl(e,t,r),Xo=n):hl(e,t,r);break;default:hl(e,t,r)}}function pl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var r=e.stateNode;null===r&&(r=e.stateNode=new Qo),t.forEach(function(t){var n=Lu.bind(null,e,t);r.has(t)||(r.add(t),t.then(n,n))})}}function gl(e,t){var n=t.deletions;if(null!==n)for(var i=0;i<n.length;i++){var s=n[i];try{var a=e,o=t,l=o;e:for(;null!==l;){switch(l.tag){case 5:cl=l.stateNode,dl=!1;break e;case 3:case 4:cl=l.stateNode.containerInfo,dl=!0;break e}l=l.return}if(null===cl)throw Error(r(160));fl(a,o,s),cl=null,dl=!1;var u=s.alternate;null!==u&&(u.return=null),s.return=null}catch(e){ku(s,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)ml(t,e),t=t.sibling}function ml(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(gl(t,e),vl(e),4&i){try{rl(3,e,e.return),nl(3,e)}catch(t){ku(e,e.return,t)}try{rl(5,e,e.return)}catch(t){ku(e,e.return,t)}}break;case 1:gl(t,e),vl(e),512&i&&null!==n&&Jo(n,n.return);break;case 5:if(gl(t,e),vl(e),512&i&&null!==n&&Jo(n,n.return),32&e.flags){var s=e.stateNode;try{he(s,"")}catch(t){ku(e,e.return,t)}}if(4&i&&null!=(s=e.stateNode)){var a=e.memoizedProps,o=null!==n?n.memoizedProps:a,l=e.type,u=e.updateQueue;if(e.updateQueue=null,null!==u)try{"input"===l&&"radio"===a.type&&null!=a.name&&Z(s,a),be(l,o);var c=be(l,a);for(o=0;o<u.length;o+=2){var d=u[o],h=u[o+1];"style"===d?me(s,h):"dangerouslySetInnerHTML"===d?de(s,h):"children"===d?he(s,h):y(s,d,h,c)}switch(l){case"input":J(s,a);break;case"textarea":ae(s,a);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!a.multiple;var p=a.value;null!=p?ne(s,!!a.multiple,p,!1):f!==!!a.multiple&&(null!=a.defaultValue?ne(s,!!a.multiple,a.defaultValue,!0):ne(s,!!a.multiple,a.multiple?[]:"",!1))}s[fi]=a}catch(t){ku(e,e.return,t)}}break;case 6:if(gl(t,e),vl(e),4&i){if(null===e.stateNode)throw Error(r(162));s=e.stateNode,a=e.memoizedProps;try{s.nodeValue=a}catch(t){ku(e,e.return,t)}}break;case 3:if(gl(t,e),vl(e),4&i&&null!==n&&n.memoizedState.isDehydrated)try{jt(t.containerInfo)}catch(t){ku(e,e.return,t)}break;case 4:default:gl(t,e),vl(e);break;case 13:gl(t,e),vl(e),8192&(s=e.child).flags&&(a=null!==s.memoizedState,s.stateNode.isHidden=a,!a||null!==s.alternate&&null!==s.alternate.memoizedState||(zl=Qe())),4&i&&pl(e);break;case 22:if(d=null!==n&&null!==n.memoizedState,1&e.mode?(Xo=(c=Xo)||d,gl(t,e),Xo=c):gl(t,e),vl(e),8192&i){if(c=null!==e.memoizedState,(e.stateNode.isHidden=c)&&!d&&1&e.mode)for(Zo=e,d=e.child;null!==d;){for(h=Zo=d;null!==Zo;){switch(p=(f=Zo).child,f.tag){case 0:case 11:case 14:case 15:rl(4,f,f.return);break;case 1:Jo(f,f.return);var g=f.stateNode;if("function"==typeof g.componentWillUnmount){i=f,n=f.return;try{t=i,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(e){ku(i,n,e)}}break;case 5:Jo(f,f.return);break;case 22:if(null!==f.memoizedState){El(h);continue}}null!==p?(p.return=f,Zo=p):El(h)}d=d.sibling}e:for(d=null,h=e;;){if(5===h.tag){if(null===d){d=h;try{s=h.stateNode,c?"function"==typeof(a=s.style).setProperty?a.setProperty("display","none","important"):a.display="none":(l=h.stateNode,o=null!=(u=h.memoizedProps.style)&&u.hasOwnProperty("display")?u.display:null,l.style.display=ge("display",o))}catch(t){ku(e,e.return,t)}}}else if(6===h.tag){if(null===d)try{h.stateNode.nodeValue=c?"":h.memoizedProps}catch(t){ku(e,e.return,t)}}else if((22!==h.tag&&23!==h.tag||null===h.memoizedState||h===e)&&null!==h.child){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;null===h.sibling;){if(null===h.return||h.return===e)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:gl(t,e),vl(e),4&i&&pl(e);case 21:}}function vl(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(al(n)){var i=n;break e}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var s=i.stateNode;32&i.flags&&(he(s,""),i.flags&=-33),ul(e,ol(e),s);break;case 3:case 4:var a=i.stateNode.containerInfo;ll(e,ol(e),a);break;default:throw Error(r(161))}}catch(t){ku(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function yl(e,t,r){Zo=e,bl(e)}function bl(e,t,r){for(var n=!!(1&e.mode);null!==Zo;){var i=Zo,s=i.child;if(22===i.tag&&n){var a=null!==i.memoizedState||qo;if(!a){var o=i.alternate,l=null!==o&&null!==o.memoizedState||Xo;o=qo;var u=Xo;if(qo=a,(Xo=l)&&!u)for(Zo=i;null!==Zo;)l=(a=Zo).child,22===a.tag&&null!==a.memoizedState?Sl(i):null!==l?(l.return=a,Zo=l):Sl(i);for(;null!==s;)Zo=s,bl(s),s=s.sibling;Zo=i,qo=o,Xo=u}wl(e)}else 8772&i.subtreeFlags&&null!==s?(s.return=i,Zo=s):wl(e)}}function wl(e){for(;null!==Zo;){var t=Zo;if(8772&t.flags){var n=t.alternate;try{if(8772&t.flags)switch(t.tag){case 0:case 11:case 15:Xo||nl(5,t);break;case 1:var i=t.stateNode;if(4&t.flags&&!Xo)if(null===n)i.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:to(t.type,n.memoizedProps);i.componentDidUpdate(s,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;null!==a&&Gs(t,a,i);break;case 3:var o=t.updateQueue;if(null!==o){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}Gs(t,o,n)}break;case 5:var l=t.stateNode;if(null===n&&4&t.flags){n=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var c=t.alternate;if(null!==c){var d=c.memoizedState;if(null!==d){var h=d.dehydrated;null!==h&&jt(h)}}}break;default:throw Error(r(163))}Xo||512&t.flags&&il(t)}catch(e){ku(t,t.return,e)}}if(t===e){Zo=null;break}if(null!==(n=t.sibling)){n.return=t.return,Zo=n;break}Zo=t.return}}function El(e){for(;null!==Zo;){var t=Zo;if(t===e){Zo=null;break}var r=t.sibling;if(null!==r){r.return=t.return,Zo=r;break}Zo=t.return}}function Sl(e){for(;null!==Zo;){var t=Zo;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{nl(4,t)}catch(e){ku(t,r,e)}break;case 1:var n=t.stateNode;if("function"==typeof n.componentDidMount){var i=t.return;try{n.componentDidMount()}catch(e){ku(t,i,e)}}var s=t.return;try{il(t)}catch(e){ku(t,s,e)}break;case 5:var a=t.return;try{il(t)}catch(e){ku(t,a,e)}}}catch(e){ku(t,t.return,e)}if(t===e){Zo=null;break}var o=t.sibling;if(null!==o){o.return=t.return,Zo=o;break}Zo=t.return}}var Tl,kl=Math.ceil,xl=w.ReactCurrentDispatcher,Al=w.ReactCurrentOwner,Rl=w.ReactCurrentBatchConfig,Ll=0,Il=null,Cl=null,Pl=0,Dl=0,_l=ki(0),Ml=0,Ol=null,Nl=0,Fl=0,$l=0,Bl=null,Ul=null,zl=0,jl=1/0,Gl=null,Hl=!1,Vl=null,Wl=null,Kl=!1,Yl=null,ql=0,Xl=0,Ql=null,Zl=-1,Jl=0;function eu(){return 6&Ll?Qe():-1!==Zl?Zl:Zl=Qe()}function tu(e){return 1&e.mode?2&Ll&&0!==Pl?Pl&-Pl:null!==gs.transition?(0===Jl&&(Jl=gt()),Jl):0!==(e=bt)?e:e=void 0===(e=window.event)?16:Xt(e.type):1}function ru(e,t,n,i){if(50<Xl)throw Xl=0,Ql=null,Error(r(185));vt(e,n,i),2&Ll&&e===Il||(e===Il&&(!(2&Ll)&&(Fl|=n),4===Ml&&ou(e,Pl)),nu(e,i),1===n&&0===Ll&&!(1&t.mode)&&(jl=Qe()+500,Bi&&ji()))}function nu(e,t){var r=e.callbackNode;!function(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var a=31-at(s),o=1<<a,l=i[a];-1===l?0!==(o&r)&&0===(o&n)||(i[a]=ft(o,t)):l<=t&&(e.expiredLanes|=o),s&=~o}}(e,t);var n=ht(e,e===Il?Pl:0);if(0===n)null!==r&&Ye(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(null!=r&&Ye(r),1===t)0===e.tag?function(e){Bi=!0,zi(e)}(lu.bind(null,e)):zi(lu.bind(null,e)),ai(function(){!(6&Ll)&&ji()}),r=null;else{switch(wt(n)){case 1:r=Je;break;case 4:r=et;break;case 16:default:r=tt;break;case 536870912:r=nt}r=Iu(r,iu.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function iu(e,t){if(Zl=-1,Jl=0,6&Ll)throw Error(r(327));var n=e.callbackNode;if(Su()&&e.callbackNode!==n)return null;var i=ht(e,e===Il?Pl:0);if(0===i)return null;if(30&i||0!==(i&e.expiredLanes)||t)t=mu(e,i);else{t=i;var s=Ll;Ll|=2;var a=pu();for(Il===e&&Pl===t||(Gl=null,jl=Qe()+500,hu(e,t));;)try{yu();break}catch(t){fu(e,t)}As(),xl.current=a,Ll=s,null!==Cl?t=0:(Il=null,Pl=0,t=Ml)}if(0!==t){if(2===t&&(0!==(s=pt(e))&&(i=s,t=su(e,s))),1===t)throw n=Ol,hu(e,0),ou(e,i),nu(e,Qe()),n;if(6===t)ou(e,i);else{if(s=e.current.alternate,!(30&i||function(e){for(var t=e;;){if(16384&t.flags){var r=t.updateQueue;if(null!==r&&null!==(r=r.stores))for(var n=0;n<r.length;n++){var i=r[n],s=i.getSnapshot;i=i.value;try{if(!on(s(),i))return!1}catch(e){return!1}}}if(r=t.child,16384&t.subtreeFlags&&null!==r)r.return=t,t=r;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(s)||(t=mu(e,i),2===t&&(a=pt(e),0!==a&&(i=a,t=su(e,a))),1!==t)))throw n=Ol,hu(e,0),ou(e,i),nu(e,Qe()),n;switch(e.finishedWork=s,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:case 5:Eu(e,Ul,Gl);break;case 3:if(ou(e,i),(130023424&i)===i&&10<(t=zl+500-Qe())){if(0!==ht(e,0))break;if(((s=e.suspendedLanes)&i)!==i){eu(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=ni(Eu.bind(null,e,Ul,Gl),t);break}Eu(e,Ul,Gl);break;case 4:if(ou(e,i),(4194240&i)===i)break;for(t=e.eventTimes,s=-1;0<i;){var o=31-at(i);a=1<<o,(o=t[o])>s&&(s=o),i&=~a}if(i=s,10<(i=(120>(i=Qe()-i)?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*kl(i/1960))-i)){e.timeoutHandle=ni(Eu.bind(null,e,Ul,Gl),i);break}Eu(e,Ul,Gl);break;default:throw Error(r(329))}}}return nu(e,Qe()),e.callbackNode===n?iu.bind(null,e):null}function su(e,t){var r=Bl;return e.current.memoizedState.isDehydrated&&(hu(e,t).flags|=256),2!==(e=mu(e,t))&&(t=Ul,Ul=r,null!==t&&au(t)),e}function au(e){null===Ul?Ul=e:Ul.push.apply(Ul,e)}function ou(e,t){for(t&=~$l,t&=~Fl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-at(t),n=1<<r;e[r]=-1,t&=~n}}function lu(e){if(6&Ll)throw Error(r(327));Su();var t=ht(e,0);if(!(1&t))return nu(e,Qe()),null;var n=mu(e,t);if(0!==e.tag&&2===n){var i=pt(e);0!==i&&(t=i,n=su(e,i))}if(1===n)throw n=Ol,hu(e,0),ou(e,t),nu(e,Qe()),n;if(6===n)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Eu(e,Ul,Gl),nu(e,Qe()),null}function uu(e,t){var r=Ll;Ll|=1;try{return e(t)}finally{0===(Ll=r)&&(jl=Qe()+500,Bi&&ji())}}function cu(e){null!==Yl&&0===Yl.tag&&!(6&Ll)&&Su();var t=Ll;Ll|=1;var r=Rl.transition,n=bt;try{if(Rl.transition=null,bt=1,e)return e()}finally{bt=n,Rl.transition=r,!(6&(Ll=t))&&ji()}}function du(){Dl=_l.current,xi(_l)}function hu(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(-1!==r&&(e.timeoutHandle=-1,ii(r)),null!==Cl)for(r=Cl.return;null!==r;){var n=r;switch(ts(n),n.tag){case 1:null!=(n=n.type.childContextTypes)&&_i();break;case 3:Xs(),xi(Ii),xi(Li),ra();break;case 5:Zs(n);break;case 4:Xs();break;case 13:case 19:xi(Js);break;case 10:Rs(n.type._context);break;case 22:case 23:du()}r=r.return}if(Il=e,Cl=e=_u(e.current,null),Pl=Dl=t,Ml=0,Ol=null,$l=Fl=Nl=0,Ul=Bl=null,null!==Ps){for(t=0;t<Ps.length;t++)if(null!==(n=(r=Ps[t]).interleaved)){r.interleaved=null;var i=n.next,s=r.pending;if(null!==s){var a=s.next;s.next=i,n.next=a}r.pending=n}Ps=null}return e}function fu(e,t){for(;;){var n=Cl;try{if(As(),na.current=Qa,ua){for(var i=aa.memoizedState;null!==i;){var s=i.queue;null!==s&&(s.pending=null),i=i.next}ua=!1}if(sa=0,la=oa=aa=null,ca=!1,da=0,Al.current=null,null===n||null===n.return){Ml=1,Ol=t,Cl=null;break}e:{var a=e,o=n.return,l=n,u=t;if(t=Pl,l.flags|=32768,null!==u&&"object"==typeof u&&"function"==typeof u.then){var c=u,d=l,h=d.tag;if(!(1&d.mode||0!==h&&11!==h&&15!==h)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=mo(o);if(null!==p){p.flags&=-257,vo(p,o,l,0,t),1&p.mode&&go(a,c,t),u=c;var g=(t=p).updateQueue;if(null===g){var m=new Set;m.add(u),t.updateQueue=m}else g.add(u);break e}if(!(1&t)){go(a,c,t),gu();break e}u=Error(r(426))}else if(is&&1&l.mode){var v=mo(o);if(null!==v){!(65536&v.flags)&&(v.flags|=256),vo(v,o,l,0,t),ps(lo(u,l));break e}}a=u=lo(u,l),4!==Ml&&(Ml=2),null===Bl?Bl=[a]:Bl.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t,zs(a,fo(0,u,t));break e;case 1:l=u;var y=a.type,b=a.stateNode;if(!(128&a.flags||"function"!=typeof y.getDerivedStateFromError&&(null===b||"function"!=typeof b.componentDidCatch||null!==Wl&&Wl.has(b)))){a.flags|=65536,t&=-t,a.lanes|=t,zs(a,po(a,l,t));break e}}a=a.return}while(null!==a)}wu(n)}catch(e){t=e,Cl===n&&null!==n&&(Cl=n=n.return);continue}break}}function pu(){var e=xl.current;return xl.current=Qa,null===e?Qa:e}function gu(){0!==Ml&&3!==Ml&&2!==Ml||(Ml=4),null===Il||!(268435455&Nl)&&!(268435455&Fl)||ou(Il,Pl)}function mu(e,t){var n=Ll;Ll|=2;var i=pu();for(Il===e&&Pl===t||(Gl=null,hu(e,t));;)try{vu();break}catch(t){fu(e,t)}if(As(),Ll=n,xl.current=i,null!==Cl)throw Error(r(261));return Il=null,Pl=0,Ml}function vu(){for(;null!==Cl;)bu(Cl)}function yu(){for(;null!==Cl&&!qe();)bu(Cl)}function bu(e){var t=Tl(e.alternate,e,Dl);e.memoizedProps=e.pendingProps,null===t?wu(e):Cl=t,Al.current=null}function wu(e){var t=e;do{var r=t.alternate;if(e=t.return,32768&t.flags){if(null!==(r=Yo(r,t)))return r.flags&=32767,void(Cl=r);if(null===e)return Ml=6,void(Cl=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}else if(null!==(r=Ko(r,t,Dl)))return void(Cl=r);if(null!==(t=t.sibling))return void(Cl=t);Cl=t=e}while(null!==t);0===Ml&&(Ml=5)}function Eu(e,t,n){var i=bt,s=Rl.transition;try{Rl.transition=null,bt=1,function(e,t,n,i){do{Su()}while(null!==Yl);if(6&Ll)throw Error(r(327));n=e.finishedWork;var s=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(function(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var i=31-at(r),s=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~s}}(e,a),e===Il&&(Cl=Il=null,Pl=0),!(2064&n.subtreeFlags)&&!(2064&n.flags)||Kl||(Kl=!0,Iu(tt,function(){return Su(),null})),a=!!(15990&n.flags),!!(15990&n.subtreeFlags)||a){a=Rl.transition,Rl.transition=null;var o=bt;bt=1;var l=Ll;Ll|=4,Al.current=null,function(e,t){if(ei=Ht,fn(e=hn())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var i=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(i&&0!==i.rangeCount){n=i.anchorNode;var s=i.anchorOffset,a=i.focusNode;i=i.focusOffset;try{n.nodeType,a.nodeType}catch(e){n=null;break e}var o=0,l=-1,u=-1,c=0,d=0,h=e,f=null;t:for(;;){for(var p;h!==n||0!==s&&3!==h.nodeType||(l=o+s),h!==a||0!==i&&3!==h.nodeType||(u=o+i),3===h.nodeType&&(o+=h.nodeValue.length),null!==(p=h.firstChild);)f=h,h=p;for(;;){if(h===e)break t;if(f===n&&++c===s&&(l=o),f===a&&++d===i&&(u=o),null!==(p=h.nextSibling))break;f=(h=f).parentNode}h=p}n=-1===l||-1===u?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(ti={focusedElem:e,selectionRange:n},Ht=!1,Zo=t;null!==Zo;)if(e=(t=Zo).child,1028&t.subtreeFlags&&null!==e)e.return=t,Zo=e;else for(;null!==Zo;){t=Zo;try{var g=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==g){var m=g.memoizedProps,v=g.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:to(t.type,m),v);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=t.stateNode.containerInfo;1===w.nodeType?w.textContent="":9===w.nodeType&&w.documentElement&&w.removeChild(w.documentElement);break;default:throw Error(r(163))}}catch(e){ku(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,Zo=e;break}Zo=t.return}g=tl,tl=!1}(e,n),ml(n,e),pn(ti),Ht=!!ei,ti=ei=null,e.current=n,yl(n),Xe(),Ll=l,bt=o,Rl.transition=a}else e.current=n;if(Kl&&(Kl=!1,Yl=e,ql=s),a=e.pendingLanes,0===a&&(Wl=null),function(e){if(st&&"function"==typeof st.onCommitFiberRoot)try{st.onCommitFiberRoot(it,e,void 0,!(128&~e.current.flags))}catch(e){}}(n.stateNode),nu(e,Qe()),null!==t)for(i=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],i(s.value,{componentStack:s.stack,digest:s.digest});if(Hl)throw Hl=!1,e=Vl,Vl=null,e;!!(1&ql)&&0!==e.tag&&Su(),a=e.pendingLanes,1&a?e===Ql?Xl++:(Xl=0,Ql=e):Xl=0,ji()}(e,t,n,i)}finally{Rl.transition=s,bt=i}return null}function Su(){if(null!==Yl){var e=wt(ql),t=Rl.transition,n=bt;try{if(Rl.transition=null,bt=16>e?16:e,null===Yl)var i=!1;else{if(e=Yl,Yl=null,ql=0,6&Ll)throw Error(r(331));var s=Ll;for(Ll|=4,Zo=e.current;null!==Zo;){var a=Zo,o=a.child;if(16&Zo.flags){var l=a.deletions;if(null!==l){for(var u=0;u<l.length;u++){var c=l[u];for(Zo=c;null!==Zo;){var d=Zo;switch(d.tag){case 0:case 11:case 15:rl(8,d,a)}var h=d.child;if(null!==h)h.return=d,Zo=h;else for(;null!==Zo;){var f=(d=Zo).sibling,p=d.return;if(sl(d),d===c){Zo=null;break}if(null!==f){f.return=p,Zo=f;break}Zo=p}}}var g=a.alternate;if(null!==g){var m=g.child;if(null!==m){g.child=null;do{var v=m.sibling;m.sibling=null,m=v}while(null!==m)}}Zo=a}}if(2064&a.subtreeFlags&&null!==o)o.return=a,Zo=o;else e:for(;null!==Zo;){if(2048&(a=Zo).flags)switch(a.tag){case 0:case 11:case 15:rl(9,a,a.return)}var y=a.sibling;if(null!==y){y.return=a.return,Zo=y;break e}Zo=a.return}}var b=e.current;for(Zo=b;null!==Zo;){var w=(o=Zo).child;if(2064&o.subtreeFlags&&null!==w)w.return=o,Zo=w;else e:for(o=b;null!==Zo;){if(2048&(l=Zo).flags)try{switch(l.tag){case 0:case 11:case 15:nl(9,l)}}catch(e){ku(l,l.return,e)}if(l===o){Zo=null;break e}var E=l.sibling;if(null!==E){E.return=l.return,Zo=E;break e}Zo=l.return}}if(Ll=s,ji(),st&&"function"==typeof st.onPostCommitFiberRoot)try{st.onPostCommitFiberRoot(it,e)}catch(e){}i=!0}return i}finally{bt=n,Rl.transition=t}}return!1}function Tu(e,t,r){e=Bs(e,t=fo(0,t=lo(r,t),1),1),t=eu(),null!==e&&(vt(e,1,t),nu(e,t))}function ku(e,t,r){if(3===e.tag)Tu(e,e,r);else for(;null!==t;){if(3===t.tag){Tu(t,e,r);break}if(1===t.tag){var n=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof n.componentDidCatch&&(null===Wl||!Wl.has(n))){t=Bs(t,e=po(t,e=lo(r,e),1),1),e=eu(),null!==t&&(vt(t,1,e),nu(t,e));break}}t=t.return}}function xu(e,t,r){var n=e.pingCache;null!==n&&n.delete(t),t=eu(),e.pingedLanes|=e.suspendedLanes&r,Il===e&&(Pl&r)===r&&(4===Ml||3===Ml&&(130023424&Pl)===Pl&&500>Qe()-zl?hu(e,0):$l|=r),nu(e,t)}function Au(e,t){0===t&&(1&e.mode?(t=ct,!(130023424&(ct<<=1))&&(ct=4194304)):t=1);var r=eu();null!==(e=Ms(e,t))&&(vt(e,t,r),nu(e,r))}function Ru(e){var t=e.memoizedState,r=0;null!==t&&(r=t.retryLane),Au(e,r)}function Lu(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,s=e.memoizedState;null!==s&&(n=s.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}null!==i&&i.delete(t),Au(e,n)}function Iu(e,t){return Ke(e,t)}function Cu(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pu(e,t,r,n){return new Cu(e,t,r,n)}function Du(e){return!(!(e=e.prototype)||!e.isReactComponent)}function _u(e,t){var r=e.alternate;return null===r?((r=Pu(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=14680064&e.flags,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Mu(e,t,n,i,s,a){var o=2;if(i=e,"function"==typeof e)Du(e)&&(o=1);else if("string"==typeof e)o=5;else e:switch(e){case k:return Ou(n.children,s,a,t);case x:o=8,s|=8;break;case A:return(e=Pu(12,n,t,2|s)).elementType=A,e.lanes=a,e;case C:return(e=Pu(13,n,t,s)).elementType=C,e.lanes=a,e;case P:return(e=Pu(19,n,t,s)).elementType=P,e.lanes=a,e;case M:return Nu(n,s,a,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case R:o=10;break e;case L:o=9;break e;case I:o=11;break e;case D:o=14;break e;case _:o=16,i=null;break e}throw Error(r(130,null==e?e:typeof e,""))}return(t=Pu(o,n,t,s)).elementType=e,t.type=i,t.lanes=a,t}function Ou(e,t,r,n){return(e=Pu(7,e,n,t)).lanes=r,e}function Nu(e,t,r,n){return(e=Pu(22,e,n,t)).elementType=M,e.lanes=r,e.stateNode={isHidden:!1},e}function Fu(e,t,r){return(e=Pu(6,e,null,t)).lanes=r,e}function $u(e,t,r){return(t=Pu(4,null!==e.children?e.children:[],e.key,t)).lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Bu(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=mt(0),this.expirationTimes=mt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Uu(e,t,r,n,i,s,a,o,l){return e=new Bu(e,t,r,o,l),1===t?(t=1,!0===s&&(t|=8)):t=0,s=Pu(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ns(s),e}function zu(e){if(!e)return Ri;e:{if(je(e=e._reactInternals)!==e||1!==e.tag)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Di(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(r(171))}if(1===e.tag){var n=e.type;if(Di(n))return Oi(e,n,t)}return t}function ju(e,t,r,n,i,s,a,o,l){return(e=Uu(r,n,!0,e,0,s,0,o,l)).context=zu(null),r=e.current,(s=$s(n=eu(),i=tu(r))).callback=null!=t?t:null,Bs(r,s,i),e.current.lanes=i,vt(e,i,n),nu(e,n),e}function Gu(e,t,r,n){var i=t.current,s=eu(),a=tu(i);return r=zu(r),null===t.context?t.context=r:t.pendingContext=r,(t=$s(s,a)).payload={element:e},null!==(n=void 0===n?null:n)&&(t.callback=n),null!==(e=Bs(i,t,a))&&(ru(e,i,a,s),Us(e,i,a)),a}function Hu(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Vu(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var r=e.retryLane;e.retryLane=0!==r&&r<t?r:t}}function Wu(e,t){Vu(e,t),(e=e.alternate)&&Vu(e,t)}Tl=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||Ii.current)bo=!0;else{if(0===(e.lanes&n)&&!(128&t.flags))return bo=!1,function(e,t,r){switch(t.tag){case 3:Io(t),fs();break;case 5:Qs(t);break;case 1:Di(t.type)&&Ni(t);break;case 4:qs(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Ai(Ss,n._currentValue),n._currentValue=i;break;case 13:if(null!==(n=t.memoizedState))return null!==n.dehydrated?(Ai(Js,1&Js.current),t.flags|=128,null):0!==(r&t.child.childLanes)?Fo(e,t,r):(Ai(Js,1&Js.current),null!==(e=Ho(e,t,r))?e.sibling:null);Ai(Js,1&Js.current);break;case 19:if(n=0!==(r&t.childLanes),128&e.flags){if(n)return jo(e,t,r);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ai(Js,Js.current),n)break;return null;case 22:case 23:return t.lanes=0,ko(e,t,r)}return Ho(e,t,r)}(e,t,n);bo=!!(131072&e.flags)}else bo=!1,is&&1048576&t.flags&&Ji(t,Wi,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Go(e,t),e=t.pendingProps;var s=Pi(t,Li.current);Is(t,n),s=ga(null,t,i,e,s,n);var a=ma();return t.flags|=1,"object"==typeof s&&null!==s&&"function"==typeof s.render&&void 0===s.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Di(i)?(a=!0,Ni(t)):a=!1,t.memoizedState=null!==s.state&&void 0!==s.state?s.state:null,Ns(t),s.updater=no,t.stateNode=s,s._reactInternals=t,oo(t,i,e,n),t=Lo(null,t,i,!0,a,n)):(t.tag=0,is&&a&&es(t),wo(null,t,s,n),t=t.child),t;case 16:i=t.elementType;e:{switch(Go(e,t),e=t.pendingProps,i=(s=i._init)(i._payload),t.type=i,s=t.tag=function(e){if("function"==typeof e)return Du(e)?1:0;if(null!=e){if((e=e.$$typeof)===I)return 11;if(e===D)return 14}return 2}(i),e=to(i,e),s){case 0:t=Ao(null,t,i,e,n);break e;case 1:t=Ro(null,t,i,e,n);break e;case 11:t=Eo(null,t,i,e,n);break e;case 14:t=So(null,t,i,to(i.type,e),n);break e}throw Error(r(306,i,""))}return t;case 0:return i=t.type,s=t.pendingProps,Ao(e,t,i,s=t.elementType===i?s:to(i,s),n);case 1:return i=t.type,s=t.pendingProps,Ro(e,t,i,s=t.elementType===i?s:to(i,s),n);case 3:e:{if(Io(t),null===e)throw Error(r(387));i=t.pendingProps,s=(a=t.memoizedState).element,Fs(e,t),js(t,i,null,n);var o=t.memoizedState;if(i=o.element,a.isDehydrated){if(a={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=Co(e,t,i,n,s=lo(Error(r(423)),t));break e}if(i!==s){t=Co(e,t,i,n,s=lo(Error(r(424)),t));break e}for(ns=ui(t.stateNode.containerInfo.firstChild),rs=t,is=!0,ss=null,n=Es(t,null,i,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(fs(),i===s){t=Ho(e,t,n);break e}wo(e,t,i,n)}t=t.child}return t;case 5:return Qs(t),null===e&&us(t),i=t.type,s=t.pendingProps,a=null!==e?e.memoizedProps:null,o=s.children,ri(i,s)?o=null:null!==a&&ri(i,a)&&(t.flags|=32),xo(e,t),wo(e,t,o,n),t.child;case 6:return null===e&&us(t),null;case 13:return Fo(e,t,n);case 4:return qs(t,t.stateNode.containerInfo),i=t.pendingProps,null===e?t.child=ws(t,null,i,n):wo(e,t,i,n),t.child;case 11:return i=t.type,s=t.pendingProps,Eo(e,t,i,s=t.elementType===i?s:to(i,s),n);case 7:return wo(e,t,t.pendingProps,n),t.child;case 8:case 12:return wo(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(i=t.type._context,s=t.pendingProps,a=t.memoizedProps,o=s.value,Ai(Ss,i._currentValue),i._currentValue=o,null!==a)if(on(a.value,o)){if(a.children===s.children&&!Ii.current){t=Ho(e,t,n);break e}}else for(null!==(a=t.child)&&(a.return=t);null!==a;){var l=a.dependencies;if(null!==l){o=a.child;for(var u=l.firstContext;null!==u;){if(u.context===i){if(1===a.tag){(u=$s(-1,n&-n)).tag=2;var c=a.updateQueue;if(null!==c){var d=(c=c.shared).pending;null===d?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}a.lanes|=n,null!==(u=a.alternate)&&(u.lanes|=n),Ls(a.return,n,t),l.lanes|=n;break}u=u.next}}else if(10===a.tag)o=a.type===t.type?null:a.child;else if(18===a.tag){if(null===(o=a.return))throw Error(r(341));o.lanes|=n,null!==(l=o.alternate)&&(l.lanes|=n),Ls(o,n,t),o=a.sibling}else o=a.child;if(null!==o)o.return=a;else for(o=a;null!==o;){if(o===t){o=null;break}if(null!==(a=o.sibling)){a.return=o.return,o=a;break}o=o.return}a=o}wo(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,i=t.pendingProps.children,Is(t,n),i=i(s=Cs(s)),t.flags|=1,wo(e,t,i,n),t.child;case 14:return s=to(i=t.type,t.pendingProps),So(e,t,i,s=to(i.type,s),n);case 15:return To(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:to(i,s),Go(e,t),t.tag=1,Di(i)?(e=!0,Ni(t)):e=!1,Is(t,n),so(t,i,s),oo(t,i,s,n),Lo(null,t,i,!0,e,n);case 19:return jo(e,t,n);case 22:return ko(e,t,n)}throw Error(r(156,t.tag))};var Ku="function"==typeof reportError?reportError:function(e){console.error(e)};function Yu(e){this._internalRoot=e}function qu(e){this._internalRoot=e}function Xu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Qu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Zu(){}function Ju(e,t,r,n,i){var s=r._reactRootContainer;if(s){var a=s;if("function"==typeof i){var o=i;i=function(){var e=Hu(a);o.call(e)}}Gu(t,a,e,i)}else a=function(e,t,r,n,i){if(i){if("function"==typeof n){var s=n;n=function(){var e=Hu(a);s.call(e)}}var a=ju(t,n,e,0,null,!1,0,"",Zu);return e._reactRootContainer=a,e[pi]=a.current,jn(8===e.nodeType?e.parentNode:e),cu(),a}for(;i=e.lastChild;)e.removeChild(i);if("function"==typeof n){var o=n;n=function(){var e=Hu(l);o.call(e)}}var l=Uu(e,0,!1,null,0,!1,0,"",Zu);return e._reactRootContainer=l,e[pi]=l.current,jn(8===e.nodeType?e.parentNode:e),cu(function(){Gu(t,l,r,n)}),l}(r,t,e,i,n);return Hu(a)}qu.prototype.render=Yu.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(r(409));Gu(e,t,null,null)},qu.prototype.unmount=Yu.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;cu(function(){Gu(null,e,null,null)}),t[pi]=null}},qu.prototype.unstable_scheduleHydration=function(e){if(e){var t=kt();e={blockedOn:null,target:e,priority:t};for(var r=0;r<_t.length&&0!==t&&t<_t[r].priority;r++);_t.splice(r,0,e),0===r&&Ft(e)}},Et=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=dt(t.pendingLanes);0!==r&&(yt(t,1|r),nu(t,Qe()),!(6&Ll)&&(jl=Qe()+500,ji()))}break;case 13:cu(function(){var t=Ms(e,1);if(null!==t){var r=eu();ru(t,e,1,r)}}),Wu(e,1)}},St=function(e){if(13===e.tag){var t=Ms(e,134217728);if(null!==t)ru(t,e,134217728,eu());Wu(e,134217728)}},Tt=function(e){if(13===e.tag){var t=tu(e),r=Ms(e,t);if(null!==r)ru(r,e,t,eu());Wu(e,t)}},kt=function(){return bt},xt=function(e,t){var r=bt;try{return bt=e,t()}finally{bt=r}},Se=function(e,t,n){switch(t){case"input":if(J(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var s=Ei(i);if(!s)throw Error(r(90));Y(i),J(i,s)}}}break;case"textarea":ae(e,n);break;case"select":null!=(t=n.value)&&ne(e,!!n.multiple,t,!1)}},Le=uu,Ie=cu;var ec={usingClientEntryPoint:!1,Events:[bi,wi,Ei,Ae,Re,uu]},tc={findFiberByHostInstance:yi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},rc={bundleType:tc.bundleType,version:tc.version,rendererPackageName:tc.rendererPackageName,rendererConfig:tc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Ve(e))?null:e.stateNode},findFiberByHostInstance:tc.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var nc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nc.isDisabled&&nc.supportsFiber)try{it=nc.inject(rc),st=nc}catch(e){}}return b.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ec,b.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Xu(t))throw Error(r(200));return function(e,t,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:T,key:null==n?null:""+n,children:e,containerInfo:t,implementation:r}}(e,t,null,n)},b.createRoot=function(e,t){if(!Xu(e))throw Error(r(299));var n=!1,i="",s=Ku;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(i=t.identifierPrefix),void 0!==t.onRecoverableError&&(s=t.onRecoverableError)),t=Uu(e,1,!1,null,0,n,0,i,s),e[pi]=t.current,jn(8===e.nodeType?e.parentNode:e),new Yu(t)},b.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(r(188));throw e=Object.keys(e).join(","),Error(r(268,e))}return e=null===(e=Ve(t))?null:e.stateNode},b.flushSync=function(e){return cu(e)},b.hydrate=function(e,t,n){if(!Qu(t))throw Error(r(200));return Ju(null,e,t,!0,n)},b.hydrateRoot=function(e,t,n){if(!Xu(e))throw Error(r(405));var i=null!=n&&n.hydratedSources||null,s=!1,a="",o=Ku;if(null!=n&&(!0===n.unstable_strictMode&&(s=!0),void 0!==n.identifierPrefix&&(a=n.identifierPrefix),void 0!==n.onRecoverableError&&(o=n.onRecoverableError)),t=ju(t,null,e,1,null!=n?n:null,s,0,a,o),e[pi]=t.current,jn(e),i)for(e=0;e<i.length;e++)s=(s=(n=i[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new qu(t)},b.render=function(e,t,n){if(!Qu(t))throw Error(r(200));return Ju(null,e,t,!1,n)},b.unmountComponentAtNode=function(e){if(!Qu(e))throw Error(r(40));return!!e._reactRootContainer&&(cu(function(){Ju(null,null,e,!1,function(){e._reactRootContainer=null,e[pi]=null})}),!0)},b.unstable_batchedUpdates=uu,b.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!Qu(n))throw Error(r(200));if(null==e||void 0===e._reactInternals)throw Error(r(38));return Ju(e,t,n,!1,i)},b.version="18.3.1-next-f1338f8080-20240426",b}function k(){if(h)return y.exports;return h=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),y.exports=T(),y.exports}var x=function(){if(f)return v;f=1;var e=k();return v.createRoot=e.createRoot,v.hydrateRoot=e.hydrateRoot,v}(),A=Object.defineProperty,R=(e,t,r)=>((e,t,r)=>t in e?A(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const L={stringify:e=>e.name,parse:(e,t,r)=>{const n=typeof window<"u"&&e in window?window[e]:typeof global<"u"&&e in global?global[e]:void 0;return"function"==typeof n?n.bind(r):void 0}},I={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},C={stringify:e=>`${e}`,parse:e=>parseFloat(e)},P={string:{stringify:e=>e,parse:e=>e},number:C,boolean:{stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},function:L,json:I};function D(e){return e.replace(/([a-z0-9])([A-Z])/g,(e,t,r)=>`${t}-${r.toLowerCase()}`)}const _=Symbol.for("r2wc.render"),M=Symbol.for("r2wc.connected"),O=Symbol.for("r2wc.context"),N=Symbol.for("r2wc.props");function F(e,t,r){const n=x.createRoot(e),i=g.createElement(t,r);return n.render(i),{root:n,ReactComponent:t}}function $({root:e,ReactComponent:t},r){const n=g.createElement(t,r);e.render(n)}function B({root:e}){e.unmount()}function U(e,t={}){return function(e,t,r){var n,i,s;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]),t.events||(t.events=[]);const a=Array.isArray(t.props)?t.props.slice():Object.keys(t.props),o=Array.isArray(t.events)?t.events.slice():Object.keys(t.events),l={},u={},c={},d={};for(const e of a){l[e]=Array.isArray(t.props)?"string":t.props[e];const r=D(e);c[e]=r,d[r]=e}for(const e of o)u[e]=Array.isArray(t.events)?{}:t.events[e];class h extends HTMLElement{constructor(){super(),R(this,s,!0),R(this,i),R(this,n,{}),R(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[N].container=this.container;for(const e of a){const t=c[e],r=this.getAttribute(t),n=l[e],i=n?P[n]:null;null!=i&&i.parse&&r&&(this[N][e]=i.parse(r,t,this))}for(const e of o)this[N][e]=t=>{const r=e.replace(/^on/,"").toLowerCase();this.dispatchEvent(new CustomEvent(r,{detail:t,...u[e]}))}}static get observedAttributes(){return Object.keys(d)}connectedCallback(){this[M]=!0,this[_]()}disconnectedCallback(){this[M]=!1,this[O]&&r.unmount(this[O]),delete this[O]}attributeChangedCallback(e,t,r){const n=d[e],i=l[n],s=i?P[i]:null;n in l&&null!=s&&s.parse&&r&&(this[N][n]=s.parse(r,e,this),this[_]())}[(s=M,i=O,n=N,_)](){this[M]&&(this[O]?r.update(this[O],this[N]):this[O]=r.mount(this.container,e,this[N]))}}for(const e of a){const t=c[e],r=l[e];Object.defineProperty(h.prototype,e,{enumerable:!0,configurable:!0,get(){return this[N][e]},set(n){this[N][e]=n;const i=r?P[r]:null;if(null!=i&&i.stringify){const e=i.stringify(n,t,this);this.getAttribute(t)!==e&&this.setAttribute(t,e)}else this[_]()}})}return h}(e,t,{mount:F,update:$,unmount:B})}var z,j,G,H,V,W,K,Y,q,X,Q=function(){return Q=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Q.apply(this,arguments)};function Z(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function J(e,t,r,n){return new(r||(r=Promise))(function(i,s){function a(e){try{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((n=n.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError,function(e){e.INSTA="INSTA",e.YOUTUBE="YOUTUBE",e.SQUARE="SQUARE"}(z||(z={})),function(e){e.MANY="MANY",e.ONE="ONE"}(j||(j={})),function(e){e.ALWAYS="ALWAYS",e.DAY="DAY",e.DISAPPEAR="DISAPPEAR",e.NONE="NONE"}(G||(G={})),function(e){e.POPUP="POPUP",e.PLATFORM="PLATFORM",e.TABLET="TABLET",e.GRID="GRID",e.VERTICAL="VERTICAL",e.HORIZONTAL="HORIZONTAL"}(H||(H={})),function(e){e.BOTTOM="BOTTOM",e.INNER="INNER"}(V||(V={})),function(e){e[e.PLATFORM=1]="PLATFORM",e[e.VERTICAL=2]="VERTICAL",e[e.PRODUCTS=3]="PRODUCTS",e[e.HORIZONTAL=4]="HORIZONTAL",e[e.TABLET=5]="TABLET"}(W||(W={})),function(e){e[e.UNLIVE=0]="UNLIVE",e[e.LIVE=1]="LIVE"}(K||(K={})),function(e){e[e.NOT_ON_SALE=0]="NOT_ON_SALE",e[e.ON_SALE=1]="ON_SALE"}(Y||(Y={})),function(e){e.LANDSCAPE="landscape",e.PORTRAIT="portrait"}(q||(q={})),function(e){e.LIVE="live",e.SHORTS="shorts",e.COLLECTION="collection"}(X||(X={}));const ee=e=>(document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}),te=()=>document.visibilityState,re=()=>{throw Error("useVisibilityChange is a client-only hook")};function ne(){return"visible"===p.useSyncExternalStore(ee,te,re)}function ie(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=ie(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}const se=e=>{const t=ue(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),ae(r,t)||le(e)},getConflictingClassGroupIds:(e,t)=>{const i=r[e]||[];return t&&n[e]?[...i,...n[e]]:i}}},ae=(e,t)=>{if(0===e.length)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),i=n?ae(e.slice(1),n):void 0;if(i)return i;if(0===t.validators.length)return;const s=e.join("-");return t.validators.find(({validator:e})=>e(s))?.classGroupId},oe=/^\[(.+)\]$/,le=e=>{if(oe.test(e)){const t=oe.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},ue=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const e in r)ce(r[e],n,e,t);return n},ce=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:de(t,e)).classGroupId=r)}if("function"==typeof e)return he(e)?void ce(e(n),t,r,n):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,i])=>{ce(i,de(t,e),r,n)})})},de=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},he=e=>e.isThemeGetter,fe=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const i=(i,s)=>{r.set(i,s),t++,t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(i(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):i(e,t)}}},pe=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,i=0,s=0;for(let a=0;a<e.length;a++){let o=e[a];if(0===n&&0===i){if(":"===o){t.push(e.slice(s,a)),s=a+1;continue}if("/"===o){r=a;continue}}"["===o?n++:"]"===o?n--:"("===o?i++:")"===o&&i--}const a=0===t.length?e:e.substring(s),o=ge(a);return{modifiers:t,hasImportantModifier:o!==a,baseClassName:o,maybePostfixModifierPosition:r&&r>s?r-s:void 0}};if(t){const e=t+":",r=n;n=t=>t.startsWith(e)?r(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(r){const e=n;n=t=>r({className:t,parseClassName:e})}return n},ge=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,me=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;const r=[];let n=[];return e.forEach(e=>{"["===e[0]||t[e]?(r.push(...n.sort(),e),n=[]):n.push(e)}),r.push(...n.sort()),r}},ve=/\s+/;function ye(){let e,t,r=0,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=be(e))&&(n&&(n+=" "),n+=t);return n}const be=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=be(e[n]))&&(r&&(r+=" "),r+=t);return r};function we(e,...t){let r,n,i,s=function(o){const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:fe(e.cacheSize),parseClassName:pe(e),sortModifiers:me(e),...se(e)}))(l),n=r.cache.get,i=r.cache.set,s=a,a(o)};function a(e){const t=n(e);if(t)return t;const s=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:s}=t,a=[],o=e.trim().split(ve);let l="";for(let e=o.length-1;e>=0;e-=1){const t=o[e],{isExternal:u,modifiers:c,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}=r(t);if(u){l=t+(l.length>0?" "+l:l);continue}let p=!!f,g=n(p?h.substring(0,f):h);if(!g){if(!p){l=t+(l.length>0?" "+l:l);continue}if(g=n(h),!g){l=t+(l.length>0?" "+l:l);continue}p=!1}const m=s(c).join(":"),v=d?m+"!":m,y=v+g;if(a.includes(y))continue;a.push(y);const b=i(g,p);for(let e=0;e<b.length;++e){const t=b[e];a.push(v+t)}l=t+(l.length>0?" "+l:l)}return l})(e,r);return i(e,s),s}return function(){return s(ye.apply(null,arguments))}}const Ee=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},Se=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Te=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ke=/^\d+\/\d+$/,xe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ae=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Re=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Le=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ie=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ce=e=>ke.test(e),Pe=e=>!!e&&!Number.isNaN(Number(e)),De=e=>!!e&&Number.isInteger(Number(e)),_e=e=>e.endsWith("%")&&Pe(e.slice(0,-1)),Me=e=>xe.test(e),Oe=()=>!0,Ne=e=>Ae.test(e)&&!Re.test(e),Fe=()=>!1,$e=e=>Le.test(e),Be=e=>Ie.test(e),Ue=e=>!je(e)&&!Ye(e),ze=e=>tt(e,st,Fe),je=e=>Se.test(e),Ge=e=>tt(e,at,Ne),He=e=>tt(e,ot,Pe),Ve=e=>tt(e,nt,Fe),We=e=>tt(e,it,Be),Ke=e=>tt(e,ut,$e),Ye=e=>Te.test(e),qe=e=>rt(e,at),Xe=e=>rt(e,lt),Qe=e=>rt(e,nt),Ze=e=>rt(e,st),Je=e=>rt(e,it),et=e=>rt(e,ut,!0),tt=(e,t,r)=>{const n=Se.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},rt=(e,t,r=!1)=>{const n=Te.exec(e);return!!n&&(n[1]?t(n[1]):r)},nt=e=>"position"===e||"percentage"===e,it=e=>"image"===e||"url"===e,st=e=>"length"===e||"size"===e||"bg-size"===e,at=e=>"length"===e,ot=e=>"number"===e,lt=e=>"family-name"===e,ut=e=>"shadow"===e,ct=we(()=>{const e=Ee("color"),t=Ee("font"),r=Ee("text"),n=Ee("font-weight"),i=Ee("tracking"),s=Ee("leading"),a=Ee("breakpoint"),o=Ee("container"),l=Ee("spacing"),u=Ee("radius"),c=Ee("shadow"),d=Ee("inset-shadow"),h=Ee("text-shadow"),f=Ee("drop-shadow"),p=Ee("blur"),g=Ee("perspective"),m=Ee("aspect"),v=Ee("ease"),y=Ee("animate"),b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Ye,je],w=()=>[Ye,je,l],E=()=>[Ce,"full","auto",...w()],S=()=>[De,"none","subgrid",Ye,je],T=()=>["auto",{span:["full",De,Ye,je]},De,Ye,je],k=()=>[De,"auto",Ye,je],x=()=>["auto","min","max","fr",Ye,je],A=()=>["auto",...w()],R=()=>[Ce,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],L=()=>[e,Ye,je],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Qe,Ve,{position:[Ye,je]}],C=()=>["auto","cover","contain",Ze,ze,{size:[Ye,je]}],P=()=>[_e,qe,Ge],D=()=>["","none","full",u,Ye,je],_=()=>["",Pe,qe,Ge],M=()=>[Pe,_e,Qe,Ve],O=()=>["","none",p,Ye,je],N=()=>["none",Pe,Ye,je],F=()=>["none",Pe,Ye,je],$=()=>[Pe,Ye,je],B=()=>[Ce,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Me],breakpoint:[Me],color:[Oe],container:[Me],"drop-shadow":[Me],ease:["in","out","in-out"],font:[Ue],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Me],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Me],shadow:[Me],spacing:["px",Pe],text:[Me],"text-shadow":[Me],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ce,je,Ye,m]}],container:["container"],columns:[{columns:[Pe,je,Ye,o]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:E()}],"inset-x":[{"inset-x":E()}],"inset-y":[{"inset-y":E()}],start:[{start:E()}],end:[{end:E()}],top:[{top:E()}],right:[{right:E()}],bottom:[{bottom:E()}],left:[{left:E()}],visibility:["visible","invisible","collapse"],z:[{z:[De,"auto",Ye,je]}],basis:[{basis:[Ce,"full","auto",o,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Pe,Ce,"auto","initial","none",je]}],grow:[{grow:["",Pe,Ye,je]}],shrink:[{shrink:["",Pe,Ye,je]}],order:[{order:[De,"first","last","none",Ye,je]}],"grid-cols":[{"grid-cols":S()}],"col-start-end":[{col:T()}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":S()}],"row-start-end":[{row:T()}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":x()}],"auto-rows":[{"auto-rows":x()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:R()}],w:[{w:[o,"screen",...R()]}],"min-w":[{"min-w":[o,"screen","none",...R()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...R()]}],h:[{h:["screen",...R()]}],"min-h":[{"min-h":["screen","none",...R()]}],"max-h":[{"max-h":["screen",...R()]}],"font-size":[{text:["base",r,qe,Ge]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Ye,He]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",_e,je]}],"font-family":[{font:[Xe,je,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Ye,je]}],"line-clamp":[{"line-clamp":[Pe,"none",Ye,He]}],leading:[{leading:[s,...w()]}],"list-image":[{"list-image":["none",Ye,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ye,je]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Pe,"from-font","auto",Ye,Ge]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Pe,"auto",Ye,je]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye,je]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ye,je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:C()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},De,Ye,je],radial:["",Ye,je],conic:[De,Ye,je]},Je,We]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:D()}],"rounded-s":[{"rounded-s":D()}],"rounded-e":[{"rounded-e":D()}],"rounded-t":[{"rounded-t":D()}],"rounded-r":[{"rounded-r":D()}],"rounded-b":[{"rounded-b":D()}],"rounded-l":[{"rounded-l":D()}],"rounded-ss":[{"rounded-ss":D()}],"rounded-se":[{"rounded-se":D()}],"rounded-ee":[{"rounded-ee":D()}],"rounded-es":[{"rounded-es":D()}],"rounded-tl":[{"rounded-tl":D()}],"rounded-tr":[{"rounded-tr":D()}],"rounded-br":[{"rounded-br":D()}],"rounded-bl":[{"rounded-bl":D()}],"border-w":[{border:_()}],"border-w-x":[{"border-x":_()}],"border-w-y":[{"border-y":_()}],"border-w-s":[{"border-s":_()}],"border-w-e":[{"border-e":_()}],"border-w-t":[{"border-t":_()}],"border-w-r":[{"border-r":_()}],"border-w-b":[{"border-b":_()}],"border-w-l":[{"border-l":_()}],"divide-x":[{"divide-x":_()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":_()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Pe,Ye,je]}],"outline-w":[{outline:["",Pe,qe,Ge]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",c,et,Ke]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",d,et,Ke]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:_()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Pe,Ge]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":_()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,et,Ke]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Pe,Ye,je]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Pe]}],"mask-image-linear-from-pos":[{"mask-linear-from":M()}],"mask-image-linear-to-pos":[{"mask-linear-to":M()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":M()}],"mask-image-t-to-pos":[{"mask-t-to":M()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":M()}],"mask-image-r-to-pos":[{"mask-r-to":M()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":M()}],"mask-image-b-to-pos":[{"mask-b-to":M()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":M()}],"mask-image-l-to-pos":[{"mask-l-to":M()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":M()}],"mask-image-x-to-pos":[{"mask-x-to":M()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":M()}],"mask-image-y-to-pos":[{"mask-y-to":M()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[Ye,je]}],"mask-image-radial-from-pos":[{"mask-radial-from":M()}],"mask-image-radial-to-pos":[{"mask-radial-to":M()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":M()}],"mask-image-conic-to-pos":[{"mask-conic-to":M()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:C()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ye,je]}],filter:[{filter:["","none",Ye,je]}],blur:[{blur:O()}],brightness:[{brightness:[Pe,Ye,je]}],contrast:[{contrast:[Pe,Ye,je]}],"drop-shadow":[{"drop-shadow":["","none",f,et,Ke]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Pe,Ye,je]}],"hue-rotate":[{"hue-rotate":[Pe,Ye,je]}],invert:[{invert:["",Pe,Ye,je]}],saturate:[{saturate:[Pe,Ye,je]}],sepia:[{sepia:["",Pe,Ye,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Ye,je]}],"backdrop-blur":[{"backdrop-blur":O()}],"backdrop-brightness":[{"backdrop-brightness":[Pe,Ye,je]}],"backdrop-contrast":[{"backdrop-contrast":[Pe,Ye,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Pe,Ye,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Pe,Ye,je]}],"backdrop-invert":[{"backdrop-invert":["",Pe,Ye,je]}],"backdrop-opacity":[{"backdrop-opacity":[Pe,Ye,je]}],"backdrop-saturate":[{"backdrop-saturate":[Pe,Ye,je]}],"backdrop-sepia":[{"backdrop-sepia":["",Pe,Ye,je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ye,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Pe,"initial",Ye,je]}],ease:[{ease:["linear","initial",v,Ye,je]}],delay:[{delay:[Pe,Ye,je]}],animate:[{animate:["none",y,Ye,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,Ye,je]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:N()}],"rotate-x":[{"rotate-x":N()}],"rotate-y":[{"rotate-y":N()}],"rotate-z":[{"rotate-z":N()}],scale:[{scale:F()}],"scale-x":[{"scale-x":F()}],"scale-y":[{"scale-y":F()}],"scale-z":[{"scale-z":F()}],"scale-3d":["scale-3d"],skew:[{skew:$()}],"skew-x":[{"skew-x":$()}],"skew-y":[{"skew-y":$()}],transform:[{transform:[Ye,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:B()}],"translate-x":[{"translate-x":B()}],"translate-y":[{"translate-y":B()}],"translate-z":[{"translate-z":B()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ye,je]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ye,je]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[Pe,qe,Ge,He]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}}),dt="mbus-viewed-shorts",ht="mbus-last-played";var ft,pt={exports:{}};function gt(){return ft||(ft=1,pt.exports=function(){var e=1e3,t=6e4,r=36e5,n="millisecond",i="second",s="minute",a="hour",o="day",l="week",u="month",c="quarter",d="year",h="date",f="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}},v=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},y={s:v,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),n=Math.floor(r/60),i=r%60;return(t<=0?"+":"-")+v(n,2,"0")+":"+v(i,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var n=12*(r.year()-t.year())+(r.month()-t.month()),i=t.clone().add(n,u),s=r-i<0,a=t.clone().add(n+(s?-1:1),u);return+(-(n+(r-i)/(s?i-a:a-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:d,w:l,d:o,D:h,h:a,m:s,s:i,ms:n,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",w={};w[b]=m;var E="$isDayjsObject",S=function(e){return e instanceof A||!(!e||!e[E])},T=function e(t,r,n){var i;if(!t)return b;if("string"==typeof t){var s=t.toLowerCase();w[s]&&(i=s),r&&(w[s]=r,i=s);var a=t.split("-");if(!i&&a.length>1)return e(a[0])}else{var o=t.name;w[o]=t,i=o}return!n&&i&&(b=i),i||!n&&b},k=function(e,t){if(S(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new A(r)},x=y;x.l=T,x.i=S,x.w=function(e,t){return k(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var A=function(){function m(e){this.$L=T(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[E]=!0}var v=m.prototype;return v.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(x.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(p);if(n){var i=n[2]-1||0,s=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)}}return new Date(t)}(e),this.init()},v.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},v.$utils=function(){return x},v.isValid=function(){return!(this.$d.toString()===f)},v.isSame=function(e,t){var r=k(e);return this.startOf(t)<=r&&r<=this.endOf(t)},v.isAfter=function(e,t){return k(e)<this.startOf(t)},v.isBefore=function(e,t){return this.endOf(t)<k(e)},v.$g=function(e,t,r){return x.u(e)?this[t]:this.set(r,e)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(e,t){var r=this,n=!!x.u(t)||t,c=x.p(e),f=function(e,t){var i=x.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return n?i:i.endOf(o)},p=function(e,t){return x.w(r.toDate()[e].apply(r.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},g=this.$W,m=this.$M,v=this.$D,y="set"+(this.$u?"UTC":"");switch(c){case d:return n?f(1,0):f(31,11);case u:return n?f(1,m):f(0,m+1);case l:var b=this.$locale().weekStart||0,w=(g<b?g+7:g)-b;return f(n?v-w:v+(6-w),m);case o:case h:return p(y+"Hours",0);case a:return p(y+"Minutes",1);case s:return p(y+"Seconds",2);case i:return p(y+"Milliseconds",3);default:return this.clone()}},v.endOf=function(e){return this.startOf(e,!1)},v.$set=function(e,t){var r,l=x.p(e),c="set"+(this.$u?"UTC":""),f=(r={},r[o]=c+"Date",r[h]=c+"Date",r[u]=c+"Month",r[d]=c+"FullYear",r[a]=c+"Hours",r[s]=c+"Minutes",r[i]=c+"Seconds",r[n]=c+"Milliseconds",r)[l],p=l===o?this.$D+(t-this.$W):t;if(l===u||l===d){var g=this.clone().set(h,1);g.$d[f](p),g.init(),this.$d=g.set(h,Math.min(this.$D,g.daysInMonth())).$d}else f&&this.$d[f](p);return this.init(),this},v.set=function(e,t){return this.clone().$set(e,t)},v.get=function(e){return this[x.p(e)]()},v.add=function(n,c){var h,f=this;n=Number(n);var p=x.p(c),g=function(e){var t=k(f);return x.w(t.date(t.date()+Math.round(e*n)),f)};if(p===u)return this.set(u,this.$M+n);if(p===d)return this.set(d,this.$y+n);if(p===o)return g(1);if(p===l)return g(7);var m=(h={},h[s]=t,h[a]=r,h[i]=e,h)[p]||1,v=this.$d.getTime()+n*m;return x.w(v,this)},v.subtract=function(e,t){return this.add(-1*e,t)},v.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||f;var n=e||"YYYY-MM-DDTHH:mm:ssZ",i=x.z(this),s=this.$H,a=this.$m,o=this.$M,l=r.weekdays,u=r.months,c=r.meridiem,d=function(e,r,i,s){return e&&(e[r]||e(t,n))||i[r].slice(0,s)},h=function(e){return x.s(s%12||12,e,"0")},p=c||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(g,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return x.s(t.$y,4,"0");case"M":return o+1;case"MM":return x.s(o+1,2,"0");case"MMM":return d(r.monthsShort,o,u,3);case"MMMM":return d(u,o);case"D":return t.$D;case"DD":return x.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(r.weekdaysMin,t.$W,l,2);case"ddd":return d(r.weekdaysShort,t.$W,l,3);case"dddd":return l[t.$W];case"H":return String(s);case"HH":return x.s(s,2,"0");case"h":return h(1);case"hh":return h(2);case"a":return p(s,a,!0);case"A":return p(s,a,!1);case"m":return String(a);case"mm":return x.s(a,2,"0");case"s":return String(t.$s);case"ss":return x.s(t.$s,2,"0");case"SSS":return x.s(t.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")})},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(n,h,f){var p,g=this,m=x.p(h),v=k(n),y=(v.utcOffset()-this.utcOffset())*t,b=this-v,w=function(){return x.m(g,v)};switch(m){case d:p=w()/12;break;case u:p=w();break;case c:p=w()/3;break;case l:p=(b-y)/6048e5;break;case o:p=(b-y)/864e5;break;case a:p=b/r;break;case s:p=b/t;break;case i:p=b/e;break;default:p=b}return f?p:x.a(p)},v.daysInMonth=function(){return this.endOf(u).$D},v.$locale=function(){return w[this.$L]},v.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=T(e,t,!0);return n&&(r.$L=n),r},v.clone=function(){return x.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},m}(),R=A.prototype;return k.prototype=R,[["$ms",n],["$s",i],["$m",s],["$H",a],["$W",o],["$M",u],["$y",d],["$D",h]].forEach(function(e){R[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),k.extend=function(e,t){return e.$i||(e(t,A,k),e.$i=!0),k},k.locale=T,k.isDayjs=S,k.unix=function(e){return k(1e3*e)},k.en=w[b],k.Ls=w,k.p={},k}()),pt.exports}var mt,vt=t(gt()),yt={exports:{}};var bt,wt=(mt||(mt=1,yt.exports=function(){var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,i,s){var a=i.prototype;s.utc=function(e){return new i({date:e,utc:!0,args:arguments})},a.utc=function(t){var r=s(this.toDate(),{locale:this.$L,utc:!0});return t?r.add(this.utcOffset(),e):r},a.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var o=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),o.call(this,e)};var l=a.init;a.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var u=a.utcOffset;a.utcOffset=function(n,i){var s=this.$utils().u;if(s(n))return this.$u?0:s(this.$offset)?u.call(this):this.$offset;if("string"==typeof n&&(n=function(e){void 0===e&&(e="");var n=e.match(t);if(!n)return null;var i=(""+n[0]).match(r)||["-",0,0],s=i[0],a=60*+i[1]+ +i[2];return 0===a?0:"+"===s?a:-a}(n),null===n))return this;var a=Math.abs(n)<=16?60*n:n;if(0===a)return this.utc(i);var o=this.clone();if(i)return o.$offset=a,o.$u=!1,o;var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(o=this.local().add(a+l,e)).$offset=a,o.$x.$localOffset=l,o};var c=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var d=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var h=a.diff;a.diff=function(e,t,r){if(e&&this.$u===e.$u)return h.call(this,e,t,r);var n=this.local(),i=s(e).local();return h.call(n,i,t,r)}}}()),yt.exports),Et=t(wt),St={exports:{}};bt||(bt=1,St.exports=function(e){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(e),n={name:"ko",weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),ordinal:function(e){return e+"일"},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},meridiem:function(e){return e<12?"오전":"오후"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"}};return r.default.locale(n,null,!0),n}(gt()));var Tt,kt={exports:{}};var xt,At,Rt,Lt=(Tt||(Tt=1,kt.exports=(xt={year:0,month:1,day:2,hour:3,minute:4,second:5},At={},function(e,t,r){var n,i=function(e,t,r){void 0===r&&(r={});var n=new Date(e),i=function(e,t){void 0===t&&(t={});var r=t.timeZoneName||"short",n=e+"|"+r,i=At[n];return i||(i=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:r}),At[n]=i),i}(t,r);return i.formatToParts(n)},s=function(e,t){for(var n=i(e,t),s=[],a=0;a<n.length;a+=1){var o=n[a],l=o.type,u=o.value,c=xt[l];c>=0&&(s[c]=parseInt(u,10))}var d=s[3],h=24===d?0:d,f=s[0]+"-"+s[1]+"-"+s[2]+" "+h+":"+s[4]+":"+s[5]+":000",p=+e;return(r.utc(f).valueOf()-(p-=p%1e3))/6e4},a=t.prototype;a.tz=function(e,t){void 0===e&&(e=n);var i,s=this.utcOffset(),a=this.toDate(),o=a.toLocaleString("en-US",{timeZone:e}),l=Math.round((a-new Date(o))/1e3/60),u=15*-Math.round(a.getTimezoneOffset()/15)-l;if(Number(u)){if(i=r(o,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(u,!0),t){var c=i.utcOffset();i=i.add(s-c,"minute")}}else i=this.utcOffset(0,t);return i.$x.$timezone=e,i},a.offsetName=function(e){var t=this.$x.$timezone||r.tz.guess(),n=i(this.valueOf(),t,{timeZoneName:e}).find(function(e){return"timezonename"===e.type.toLowerCase()});return n&&n.value};var o=a.startOf;a.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return o.call(this,e,t);var n=r(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return o.call(n,e,t).tz(this.$x.$timezone,!0)},r.tz=function(e,t,i){var a=i&&t,o=i||t||n,l=s(+r(),o);if("string"!=typeof e)return r(e).tz(o);var u=function(e,t,r){var n=e-60*t*1e3,i=s(n,r);if(t===i)return[n,t];var a=s(n-=60*(i-t)*1e3,r);return i===a?[n,i]:[e-60*Math.min(i,a)*1e3,Math.max(i,a)]}(r.utc(e,a).valueOf(),l,o),c=u[0],d=u[1],h=r(c).utcOffset(d);return h.$x.$timezone=o,h},r.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},r.tz.setDefault=function(e){n=e}})),kt.exports),It=t(Lt),Ct={exports:{}};var Pt=(Rt||(Rt=1,Ct.exports=function(){var e,t,r=1e3,n=6e4,i=36e5,s=864e5,a=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,o=31536e6,l=2628e6,u=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,c={years:o,months:l,days:s,hours:i,minutes:n,seconds:r,milliseconds:1,weeks:6048e5},d=function(e){return e instanceof y},h=function(e,t,r){return new y(e,r,t.$l)},f=function(e){return t.p(e)+"s"},p=function(e){return e<0},g=function(e){return p(e)?Math.ceil(e):Math.floor(e)},m=function(e){return Math.abs(e)},v=function(e,t){return e?p(e)?{negative:!0,format:""+m(e)+t}:{negative:!1,format:""+e+t}:{negative:!1,format:""}},y=function(){function p(e,t,r){var n=this;if(this.$d={},this.$l=r,void 0===e&&(this.$ms=0,this.parseFromMilliseconds()),t)return h(e*c[f(t)],this);if("number"==typeof e)return this.$ms=e,this.parseFromMilliseconds(),this;if("object"==typeof e)return Object.keys(e).forEach(function(t){n.$d[f(t)]=e[t]}),this.calMilliseconds(),this;if("string"==typeof e){var i=e.match(u);if(i){var s=i.slice(2).map(function(e){return null!=e?Number(e):0});return this.$d.years=s[0],this.$d.months=s[1],this.$d.weeks=s[2],this.$d.days=s[3],this.$d.hours=s[4],this.$d.minutes=s[5],this.$d.seconds=s[6],this.calMilliseconds(),this}}return this}var m=p.prototype;return m.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce(function(t,r){return t+(e.$d[r]||0)*c[r]},0)},m.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=g(e/o),e%=o,this.$d.months=g(e/l),e%=l,this.$d.days=g(e/s),e%=s,this.$d.hours=g(e/i),e%=i,this.$d.minutes=g(e/n),e%=n,this.$d.seconds=g(e/r),e%=r,this.$d.milliseconds=e},m.toISOString=function(){var e=v(this.$d.years,"Y"),t=v(this.$d.months,"M"),r=+this.$d.days||0;this.$d.weeks&&(r+=7*this.$d.weeks);var n=v(r,"D"),i=v(this.$d.hours,"H"),s=v(this.$d.minutes,"M"),a=this.$d.seconds||0;this.$d.milliseconds&&(a+=this.$d.milliseconds/1e3,a=Math.round(1e3*a)/1e3);var o=v(a,"S"),l=e.negative||t.negative||n.negative||i.negative||s.negative||o.negative,u=i.format||s.format||o.format?"T":"",c=(l?"-":"")+"P"+e.format+t.format+n.format+u+i.format+s.format+o.format;return"P"===c||"-P"===c?"P0D":c},m.toJSON=function(){return this.toISOString()},m.format=function(e){var r=e||"YYYY-MM-DDTHH:mm:ss",n={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return r.replace(a,function(e,t){return t||String(n[e])})},m.as=function(e){return this.$ms/c[f(e)]},m.get=function(e){var t=this.$ms,r=f(e);return"milliseconds"===r?t%=1e3:t="weeks"===r?g(t/c[r]):this.$d[r],t||0},m.add=function(e,t,r){var n;return n=t?e*c[f(t)]:d(e)?e.$ms:h(e,this).$ms,h(this.$ms+n*(r?-1:1),this)},m.subtract=function(e,t){return this.add(e,t,!0)},m.locale=function(e){var t=this.clone();return t.$l=e,t},m.clone=function(){return h(this.$ms,this)},m.humanize=function(t){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!t)},m.valueOf=function(){return this.asMilliseconds()},m.milliseconds=function(){return this.get("milliseconds")},m.asMilliseconds=function(){return this.as("milliseconds")},m.seconds=function(){return this.get("seconds")},m.asSeconds=function(){return this.as("seconds")},m.minutes=function(){return this.get("minutes")},m.asMinutes=function(){return this.as("minutes")},m.hours=function(){return this.get("hours")},m.asHours=function(){return this.as("hours")},m.days=function(){return this.get("days")},m.asDays=function(){return this.as("days")},m.weeks=function(){return this.get("weeks")},m.asWeeks=function(){return this.as("weeks")},m.months=function(){return this.get("months")},m.asMonths=function(){return this.as("months")},m.years=function(){return this.get("years")},m.asYears=function(){return this.as("years")},p}(),b=function(e,t,r){return e.add(t.years()*r,"y").add(t.months()*r,"M").add(t.days()*r,"d").add(t.hours()*r,"h").add(t.minutes()*r,"m").add(t.seconds()*r,"s").add(t.milliseconds()*r,"ms")};return function(r,n,i){e=i,t=i().$utils(),i.duration=function(e,t){var r=i.locale();return h(e,{$l:r},t)},i.isDuration=d;var s=n.prototype.add,a=n.prototype.subtract;n.prototype.add=function(e,t){return d(e)?b(this,e,1):s.bind(this)(e,t)},n.prototype.subtract=function(e,t){return d(e)?b(this,e,-1):a.bind(this)(e,t)}}}()),Ct.exports),Dt=t(Pt);console.log("[commerce-player configs instance]",Math.random());const _t={API_BASE_URL:"https://api.midibus.im:8001",STATISTICS_BASE_URL:"https://playdata.midibus.im",PLAYER_BACK_BASE_URL:"https://back-playdata.midibus.im",PLAYER_BASE_URL:"https://mcommerce-play.midibus.kinxcdn.com"};function Mt(){return Object.assign(Object.assign({},_t),globalThis.__KINXCDN_COMMERCE_PLAYER_ENDPOINTS__||{})}function Ot(...e){return ct(function(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=ie(e))&&(n&&(n+=" "),n+=t);return n}(e))}vt.extend(Et),vt.extend(It),vt.extend(Dt),vt.locale("ko");const Nt=e=>e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),Ft=e=>{const{API_BASE_URL:t}=Mt();return`${t}/direct/${e}`},$t=e=>{if(void 0===e||null==e)return"";return e.toString().replace(/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g,",")},Bt=()=>{const e=new Date;return`${e.getFullYear()}${String(e.getMonth()+1).padStart(2,"0")}${String(e.getDate()).padStart(2,"0")}${String(e.getHours()).padStart(2,"0")}${String(e.getMinutes()).padStart(2,"0")}${String(e.getSeconds()).padStart(2,"0")}`},Ut=()=>{if("undefined"!=typeof window&&window.crypto&&window.crypto.getRandomValues){const e=new Uint8Array(16);window.crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;const t=Array.from(e).map(e=>e.toString(16).padStart(2,"0"));return`${t.slice(0,4).join("")}-${t.slice(4,6).join("")}-${t.slice(6,8).join("")}-${t.slice(8,10).join("")}-${t.slice(10,16).join("")}`}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},zt=e=>{const t=dt,r=JSON.parse(localStorage.getItem(t)||"[]"),n=r.includes(e);return n||(r.push(e),localStorage.setItem(t,JSON.stringify(r))),n},jt=e=>{const t=ht,r=Math.floor((new Date).getTime()/1e3);let n=!0;switch(e){case G.NONE:n=!1;break;case G.DISAPPEAR:localStorage.getItem(t)&&(n=!1);break;case G.DAY:const e=localStorage.getItem(t);if(!e)break;r-parseInt(e)<86400&&(n=!1)}return n},Gt=e=>e.includes("https")?e:"https://"+e,Ht=e=>{e instanceof Error?console.error(e.toString()):console.error(e)};const Vt=(e,t)=>e>t?q.LANDSCAPE:q.PORTRAIT;var Wt=(e,t,r=!0)=>{const n=p.useRef(e),i=p.useRef(null),s=()=>{i.current&&(clearInterval(i.current),i.current=null)},a=p.useCallback(()=>{i.current||(i.current=setInterval(()=>n.current(),t))},[t]);return p.useEffect(()=>{n.current=e},[e]),p.useEffect(()=>(r&&a(),()=>s()),[a,r]),{clear:s,run:a}};const Kt=()=>{const[e,t]=p.useState(0);Wt(()=>{t(e=>e+1)},1e3);return{playtime:e,resetPlaytime:()=>t(0)}};var Yt;!function(e){e.latest="",e.views="pageView",e.likes="like"}(Yt||(Yt={}));let qt=0;const Xt=e=>J(void 0,void 0,void 0,function*(){const{PLAYER_BACK_BASE_URL:t}=Mt(),{contentId:r,uuid:n,type:i,userId:s}=e;try{if(3===qt)return;const e=`${t}/statistics/play`,a=Object.assign({contentId:r,uuid:n,type:i,date:Bt(),userId:+s,playtime:0,isLive:!1},"shorts"===i&&{isFinished:!1,playedOver5Sec:!1});yield fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}catch(e){console.error(`Error in statisticsApi.join - contentId: ${r}`),Ht(e),qt++}}),Qt=e=>{const{PLAYER_BACK_BASE_URL:t}=Mt(),{contentId:r,uuid:n,type:i,isFinished:s,playtime:a,userId:o}=e,l=Object.assign({contentId:r,uuid:n,playtime:a,type:i,date:Bt(),userId:+o,isLive:!1},"shorts"===i&&{isFinished:s,playedOver5Sec:Number(a)>5});fetch(`${t}/statistics/play`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l),keepalive:!0})},Zt=e=>J(void 0,void 0,void 0,function*(){const{PLAYER_BACK_BASE_URL:t}=Mt(),{contentProductId:r}=e;try{yield fetch(`${t}/statistics/products/${r}/clicks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Object.assign({date:Bt()},e))})}catch(e){console.error(`Error in statisticsApi.productClick - contentProductId: ${r}`),Ht(e)}}),Jt=e=>J(void 0,void 0,void 0,function*(){const{STATISTICS_BASE_URL:t}=Mt();try{return(yield(yield fetch(`${t}/${e}/likes`)).json()).result||0}catch(t){return console.error(`Error in statisticsApi.getLike - contentId: ${e}`),Ht(t),0}}),er=e=>J(void 0,void 0,void 0,function*(){const{PLAYER_BACK_BASE_URL:t}=Mt();try{yield fetch(`${t}/statistics/like`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contentId:e,isLive:!1,isFirst:!1})})}catch(t){console.error(`Error in statisticsApi.getLike - contentId: ${e}`),Ht(t)}}),tr=e=>J(void 0,[e],void 0,function*({collectionId:e,nextKey:t,size:r=5}){const{PLAYER_BACK_BASE_URL:n}=Mt();try{const i=new URLSearchParams;-1!==r&&i.set("size",String(r)),t&&i.set("nextKey",t);const s=yield fetch(`${n}/commerce/collection/${e}?${i.toString()}`);return s.ok?yield s.json():null}catch(e){return Ht(e),null}}),rr=(e,...t)=>J(void 0,[e,...t],void 0,function*(e,t=!1){const{API_BASE_URL:r,PLAYER_BACK_BASE_URL:n}=Mt();if(t)try{const t=(yield(yield fetch(`${r}/shorts/player/${e}`)).json()).result;if(!t.media)return null;t.file=`${r}/direct/${t.media.objectId}`;const{player:{viewPlayer:{width:n,height:i}}}=t;return Object.assign(Object.assign(Object.assign(Object.assign({layout:t.player.layout},t.player.shoppingPlayer),{aspectRatio:Vt(n,i)}),t),{uuid:Ut()})}catch(e){return Ht(e),null}try{const t=yield fetch(`${n}/commerce/short-form/${e}`),r=yield t.json();return r.shortsId?r:null}catch(e){return Ht(e),null}}),nr=(e,t,r,n)=>J(void 0,void 0,void 0,function*(){const{API_BASE_URL:i}=Mt();try{const s=yield fetch(`${i}/live/${e}/list?size=${r||6}&status=${t}${n&&Yt[n]?`&sortBy=${Yt[n]}`:""}`);return s.ok?(yield s.json()).result:(console.error("Error in getLiveWidgetContents "),[])}catch(e){return console.error("Error in getLiveWidgetContents: ",e),[]}}),ir=e=>{let t;const r=new Set,n=(e,n)=>{const i="function"==typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,s={setState:n,getState:i,getInitialState:()=>a,subscribe:e=>(r.add(e),()=>r.delete(e))},a=t=e(n,i,s);return s},sr=e=>e?ir(e):ir,ar=e=>e;function or(e,t=ar){const r=g.useSyncExternalStore(e.subscribe,g.useCallback(()=>t(e.getState()),[e,t]),g.useCallback(()=>t(e.getInitialState()),[e,t]));return g.useDebugValue(r),r}const lr=e=>{const t=sr(e),r=e=>or(t,e);return Object.assign(r,t),r},ur=e=>e?lr(e):lr,cr=ur(e=>({priceText:"",isPreview:!1,setPriceText:t=>e({priceText:t}),setIsPreview:t=>e({isPreview:t})})),dr=g.createContext(null),hr=({children:e})=>{const t=g.useRef(null);return t.current||(t.current=sr(e=>({collection:null,setCollection:t=>e({collection:t}),nextKey:"",setNextKey:t=>e({nextKey:t}),isFetching:!1,setIsFetching:t=>e({isFetching:t})}))),g.createElement(dr.Provider,{value:t.current},e)},fr=()=>(e=>{const t=g.useContext(dr);if(!t)throw new Error("Missing CollectionProvider");return or(t,e)})(e=>e),pr=(e,t)=>{const{collection:r,setCollection:n,isFetching:i,setIsFetching:s,nextKey:a,setNextKey:o}=fr(),{isPreview:l}=cr(),u=(null==e?void 0:e.media)?e.media.duration.split(":").reduce((e,t,r)=>e+ +t*60**(2-r),0):0;const{resetPlaytime:c,playtime:d}=Kt(),{playtime:h,resetPlaytime:f}=Kt(),g=ne(),m=()=>{if(!r)return;const{colId:t,uuid:n,userId:i}=r,s=ht,a=Math.floor((new Date).getTime()/1e3);localStorage.setItem(s,a.toString()),l||(Qt({contentId:t,uuid:n,type:X.COLLECTION,userId:i,playtime:h}),e&&Qt({contentId:e.shortsId,uuid:e.uuid,type:X.SHORTS,userId:i,playtime:d,isFinished:d>=u}),f(),c())};p.useEffect(()=>{g||m()},[g]);return{onSlideChange:h=>J(void 0,void 0,void 0,function*(){if(e&&r&&(yield(e=>J(void 0,void 0,void 0,function*(){var t,l;if(!r)return;const{contents:u,count:c}=r;if((null!=c?c:Number.MAX_SAFE_INTEGER)>u.length&&e>=u.length-5&&!i){s(!0);try{const e=yield tr({collectionId:r.colId,nextKey:a});if(!e||!(null===(t=e.contents)||void 0===t?void 0:t.length))return;o((null===(l=e.contents.at(-1))||void 0===l?void 0:l.shortsId)||"");const i=new Set(r.contents.map(e=>e.shortsId)),s=e.contents.filter(e=>!i.has(e.shortsId));if(!s.length)return;const u=r.contents.concat(s);n(Object.assign(Object.assign({},r),{contents:u}))}catch(e){console.error(e)}finally{s(!1)}}}))(h),!l)){const{shortsId:n,uuid:i,userId:s}=e;Qt({contentId:n,uuid:i,type:X.SHORTS,playtime:d,isFinished:d>=u,userId:s}),c();const a=Ut(),o=r.contents[h];t(Object.assign(Object.assign({},o),{uuid:a})),yield Xt({contentId:o.shortsId,uuid:a,type:X.SHORTS,userId:o.userId,isFirstPlay:!zt(o.shortsId)})}}),onCollectionClose:m}};function gr(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function mr(e,t){void 0===e&&(e={}),void 0===t&&(t={}),Object.keys(t).forEach(r=>{void 0===e[r]?e[r]=t[r]:gr(t[r])&&gr(e[r])&&Object.keys(t[r]).length>0&&mr(e[r],t[r])})}const vr={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function yr(){const e="undefined"!=typeof document?document:{};return mr(e,vr),e}const br={document:vr,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:e=>"undefined"==typeof setTimeout?(e(),null):setTimeout(e,0),cancelAnimationFrame(e){"undefined"!=typeof setTimeout&&clearTimeout(e)}};function wr(){const e="undefined"!=typeof window?window:{};return mr(e,br),e}function Er(e,t){return void 0===t&&(t=0),setTimeout(e,t)}function Sr(){return Date.now()}function Tr(e,t){void 0===t&&(t="x");const r=wr();let n,i,s;const a=function(e){const t=wr();let r;return t.getComputedStyle&&(r=t.getComputedStyle(e,null)),!r&&e.currentStyle&&(r=e.currentStyle),r||(r=e.style),r}(e);return r.WebKitCSSMatrix?(i=a.transform||a.webkitTransform,i.split(",").length>6&&(i=i.split(", ").map(e=>e.replace(",",".")).join(", ")),s=new r.WebKitCSSMatrix("none"===i?"":i)):(s=a.MozTransform||a.OTransform||a.MsTransform||a.msTransform||a.transform||a.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),n=s.toString().split(",")),"x"===t&&(i=r.WebKitCSSMatrix?s.m41:16===n.length?parseFloat(n[12]):parseFloat(n[4])),"y"===t&&(i=r.WebKitCSSMatrix?s.m42:16===n.length?parseFloat(n[13]):parseFloat(n[5])),i||0}function kr(e){return"object"==typeof e&&null!==e&&e.constructor&&"Object"===Object.prototype.toString.call(e).slice(8,-1)}function xr(e){return"undefined"!=typeof window&&void 0!==window.HTMLElement?e instanceof HTMLElement:e&&(1===e.nodeType||11===e.nodeType)}function Ar(){const e=Object(arguments.length<=0?void 0:arguments[0]),t=["__proto__","constructor","prototype"];for(let r=1;r<arguments.length;r+=1){const n=r<0||arguments.length<=r?void 0:arguments[r];if(null!=n&&!xr(n)){const r=Object.keys(Object(n)).filter(e=>t.indexOf(e)<0);for(let t=0,i=r.length;t<i;t+=1){const i=r[t],s=Object.getOwnPropertyDescriptor(n,i);void 0!==s&&s.enumerable&&(kr(e[i])&&kr(n[i])?n[i].__swiper__?e[i]=n[i]:Ar(e[i],n[i]):!kr(e[i])&&kr(n[i])?(e[i]={},n[i].__swiper__?e[i]=n[i]:Ar(e[i],n[i])):e[i]=n[i])}}}return e}function Rr(e,t,r){e.style.setProperty(t,r)}function Lr(e){let{swiper:t,targetPosition:r,side:n}=e;const i=wr(),s=-t.translate;let a,o=null;const l=t.params.speed;t.wrapperEl.style.scrollSnapType="none",i.cancelAnimationFrame(t.cssModeFrameID);const u=r>s?"next":"prev",c=(e,t)=>"next"===u&&e>=t||"prev"===u&&e<=t,d=()=>{a=(new Date).getTime(),null===o&&(o=a);const e=Math.max(Math.min((a-o)/l,1),0),u=.5-Math.cos(e*Math.PI)/2;let h=s+u*(r-s);if(c(h,r)&&(h=r),t.wrapperEl.scrollTo({[n]:h}),c(h,r))return t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.scrollSnapType="",setTimeout(()=>{t.wrapperEl.style.overflow="",t.wrapperEl.scrollTo({[n]:h})}),void i.cancelAnimationFrame(t.cssModeFrameID);t.cssModeFrameID=i.requestAnimationFrame(d)};d()}function Ir(e){return e.querySelector(".swiper-slide-transform")||e.shadowRoot&&e.shadowRoot.querySelector(".swiper-slide-transform")||e}function Cr(e,t){void 0===t&&(t="");const r=[...e.children];return e instanceof HTMLSlotElement&&r.push(...e.assignedElements()),t?r.filter(e=>e.matches(t)):r}function Pr(e){try{return void console.warn(e)}catch(e){}}function Dr(e,t){void 0===t&&(t=[]);const r=document.createElement(e);return r.classList.add(...Array.isArray(t)?t:function(e){return void 0===e&&(e=""),e.trim().split(" ").filter(e=>!!e.trim())}(t)),r}function _r(e,t){return wr().getComputedStyle(e,null).getPropertyValue(t)}function Mr(e){let t,r=e;if(r){for(t=0;null!==(r=r.previousSibling);)1===r.nodeType&&(t+=1);return t}}function Or(e,t,r){const n=wr();return e["width"===t?"offsetWidth":"offsetHeight"]+parseFloat(n.getComputedStyle(e,null).getPropertyValue("width"===t?"margin-right":"margin-top"))+parseFloat(n.getComputedStyle(e,null).getPropertyValue("width"===t?"margin-left":"margin-bottom"))}let Nr,Fr,$r;function Br(){return Nr||(Nr=function(){const e=wr(),t=yr();return{smoothScroll:t.documentElement&&t.documentElement.style&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in e||e.DocumentTouch&&t instanceof e.DocumentTouch)}}()),Nr}function Ur(e){return void 0===e&&(e={}),Fr||(Fr=function(e){let{userAgent:t}=void 0===e?{}:e;const r=Br(),n=wr(),i=n.navigator.platform,s=t||n.navigator.userAgent,a={ios:!1,android:!1},o=n.screen.width,l=n.screen.height,u=s.match(/(Android);?[\s\/]+([\d.]+)?/);let c=s.match(/(iPad).*OS\s([\d_]+)/);const d=s.match(/(iPod)(.*OS\s([\d_]+))?/),h=!c&&s.match(/(iPhone\sOS|iOS)\s([\d_]+)/),f="Win32"===i;let p="MacIntel"===i;return!c&&p&&r.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(`${o}x${l}`)>=0&&(c=s.match(/(Version)\/([\d.]+)/),c||(c=[0,1,"13_0_0"]),p=!1),u&&!f&&(a.os="android",a.android=!0),(c||h||d)&&(a.os="ios",a.ios=!0),a}(e)),Fr}function zr(){return $r||($r=function(){const e=wr(),t=Ur();let r=!1;function n(){const t=e.navigator.userAgent.toLowerCase();return t.indexOf("safari")>=0&&t.indexOf("chrome")<0&&t.indexOf("android")<0}if(n()){const t=String(e.navigator.userAgent);if(t.includes("Version/")){const[e,n]=t.split("Version/")[1].split(" ")[0].split(".").map(e=>Number(e));r=e<16||16===e&&n<2}}const i=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent),s=n();return{isSafari:r||s,needPerspectiveFix:r,need3dFix:s||i&&t.ios,isWebView:i}}()),$r}var jr={on(e,t,r){const n=this;if(!n.eventsListeners||n.destroyed)return n;if("function"!=typeof t)return n;const i=r?"unshift":"push";return e.split(" ").forEach(e=>{n.eventsListeners[e]||(n.eventsListeners[e]=[]),n.eventsListeners[e][i](t)}),n},once(e,t,r){const n=this;if(!n.eventsListeners||n.destroyed)return n;if("function"!=typeof t)return n;function i(){n.off(e,i),i.__emitterProxy&&delete i.__emitterProxy;for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];t.apply(n,s)}return i.__emitterProxy=t,n.on(e,i,r)},onAny(e,t){const r=this;if(!r.eventsListeners||r.destroyed)return r;if("function"!=typeof e)return r;const n=t?"unshift":"push";return r.eventsAnyListeners.indexOf(e)<0&&r.eventsAnyListeners[n](e),r},offAny(e){const t=this;if(!t.eventsListeners||t.destroyed)return t;if(!t.eventsAnyListeners)return t;const r=t.eventsAnyListeners.indexOf(e);return r>=0&&t.eventsAnyListeners.splice(r,1),t},off(e,t){const r=this;return!r.eventsListeners||r.destroyed?r:r.eventsListeners?(e.split(" ").forEach(e=>{void 0===t?r.eventsListeners[e]=[]:r.eventsListeners[e]&&r.eventsListeners[e].forEach((n,i)=>{(n===t||n.__emitterProxy&&n.__emitterProxy===t)&&r.eventsListeners[e].splice(i,1)})}),r):r},emit(){const e=this;if(!e.eventsListeners||e.destroyed)return e;if(!e.eventsListeners)return e;let t,r,n;for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];"string"==typeof s[0]||Array.isArray(s[0])?(t=s[0],r=s.slice(1,s.length),n=e):(t=s[0].events,r=s[0].data,n=s[0].context||e),r.unshift(n);return(Array.isArray(t)?t:t.split(" ")).forEach(t=>{e.eventsAnyListeners&&e.eventsAnyListeners.length&&e.eventsAnyListeners.forEach(e=>{e.apply(n,[t,...r])}),e.eventsListeners&&e.eventsListeners[t]&&e.eventsListeners[t].forEach(e=>{e.apply(n,r)})}),e}};const Gr=(e,t,r)=>{t&&!e.classList.contains(r)?e.classList.add(r):!t&&e.classList.contains(r)&&e.classList.remove(r)};const Hr=(e,t,r)=>{t&&!e.classList.contains(r)?e.classList.add(r):!t&&e.classList.contains(r)&&e.classList.remove(r)};const Vr=(e,t)=>{if(!e||e.destroyed||!e.params)return;const r=t.closest(e.isElement?"swiper-slide":`.${e.params.slideClass}`);if(r){let t=r.querySelector(`.${e.params.lazyPreloaderClass}`);!t&&e.isElement&&(r.shadowRoot?t=r.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{r.shadowRoot&&(t=r.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`),t&&t.remove())})),t&&t.remove()}},Wr=(e,t)=>{if(!e.slides[t])return;const r=e.slides[t].querySelector('[loading="lazy"]');r&&r.removeAttribute("loading")},Kr=e=>{if(!e||e.destroyed||!e.params)return;let t=e.params.lazyPreloadPrevNext;const r=e.slides.length;if(!r||!t||t<0)return;t=Math.min(t,r);const n="auto"===e.params.slidesPerView?e.slidesPerViewDynamic():Math.ceil(e.params.slidesPerView),i=e.activeIndex;if(e.params.grid&&e.params.grid.rows>1){const r=i,s=[r-t];return s.push(...Array.from({length:t}).map((e,t)=>r+n+t)),void e.slides.forEach((t,r)=>{s.includes(t.column)&&Wr(e,r)})}const s=i+n-1;if(e.params.rewind||e.params.loop)for(let n=i-t;n<=s+t;n+=1){const t=(n%r+r)%r;(t<i||t>s)&&Wr(e,t)}else for(let n=Math.max(i-t,0);n<=Math.min(s+t,r-1);n+=1)n!==i&&(n>s||n<i)&&Wr(e,n)};var Yr={updateSize:function(){const e=this;let t,r;const n=e.el;t=void 0!==e.params.width&&null!==e.params.width?e.params.width:n.clientWidth,r=void 0!==e.params.height&&null!==e.params.height?e.params.height:n.clientHeight,0===t&&e.isHorizontal()||0===r&&e.isVertical()||(t=t-parseInt(_r(n,"padding-left")||0,10)-parseInt(_r(n,"padding-right")||0,10),r=r-parseInt(_r(n,"padding-top")||0,10)-parseInt(_r(n,"padding-bottom")||0,10),Number.isNaN(t)&&(t=0),Number.isNaN(r)&&(r=0),Object.assign(e,{width:t,height:r,size:e.isHorizontal()?t:r}))},updateSlides:function(){const e=this;function t(t,r){return parseFloat(t.getPropertyValue(e.getDirectionLabel(r))||0)}const r=e.params,{wrapperEl:n,slidesEl:i,size:s,rtlTranslate:a,wrongRTL:o}=e,l=e.virtual&&r.virtual.enabled,u=l?e.virtual.slides.length:e.slides.length,c=Cr(i,`.${e.params.slideClass}, swiper-slide`),d=l?e.virtual.slides.length:c.length;let h=[];const f=[],p=[];let g=r.slidesOffsetBefore;"function"==typeof g&&(g=r.slidesOffsetBefore.call(e));let m=r.slidesOffsetAfter;"function"==typeof m&&(m=r.slidesOffsetAfter.call(e));const v=e.snapGrid.length,y=e.slidesGrid.length;let b=r.spaceBetween,w=-g,E=0,S=0;if(void 0===s)return;"string"==typeof b&&b.indexOf("%")>=0?b=parseFloat(b.replace("%",""))/100*s:"string"==typeof b&&(b=parseFloat(b)),e.virtualSize=-b,c.forEach(e=>{a?e.style.marginLeft="":e.style.marginRight="",e.style.marginBottom="",e.style.marginTop=""}),r.centeredSlides&&r.cssMode&&(Rr(n,"--swiper-centered-offset-before",""),Rr(n,"--swiper-centered-offset-after",""));const T=r.grid&&r.grid.rows>1&&e.grid;let k;T?e.grid.initSlides(c):e.grid&&e.grid.unsetSlides();const x="auto"===r.slidesPerView&&r.breakpoints&&Object.keys(r.breakpoints).filter(e=>void 0!==r.breakpoints[e].slidesPerView).length>0;for(let n=0;n<d;n+=1){let i;if(k=0,c[n]&&(i=c[n]),T&&e.grid.updateSlide(n,i,c),!c[n]||"none"!==_r(i,"display")){if("auto"===r.slidesPerView){x&&(c[n].style[e.getDirectionLabel("width")]="");const s=getComputedStyle(i),a=i.style.transform,o=i.style.webkitTransform;if(a&&(i.style.transform="none"),o&&(i.style.webkitTransform="none"),r.roundLengths)k=e.isHorizontal()?Or(i,"width"):Or(i,"height");else{const e=t(s,"width"),r=t(s,"padding-left"),n=t(s,"padding-right"),a=t(s,"margin-left"),o=t(s,"margin-right"),l=s.getPropertyValue("box-sizing");if(l&&"border-box"===l)k=e+a+o;else{const{clientWidth:t,offsetWidth:s}=i;k=e+r+n+a+o+(s-t)}}a&&(i.style.transform=a),o&&(i.style.webkitTransform=o),r.roundLengths&&(k=Math.floor(k))}else k=(s-(r.slidesPerView-1)*b)/r.slidesPerView,r.roundLengths&&(k=Math.floor(k)),c[n]&&(c[n].style[e.getDirectionLabel("width")]=`${k}px`);c[n]&&(c[n].swiperSlideSize=k),p.push(k),r.centeredSlides?(w=w+k/2+E/2+b,0===E&&0!==n&&(w=w-s/2-b),0===n&&(w=w-s/2-b),Math.abs(w)<.001&&(w=0),r.roundLengths&&(w=Math.floor(w)),S%r.slidesPerGroup===0&&h.push(w),f.push(w)):(r.roundLengths&&(w=Math.floor(w)),(S-Math.min(e.params.slidesPerGroupSkip,S))%e.params.slidesPerGroup===0&&h.push(w),f.push(w),w=w+k+b),e.virtualSize+=k+b,E=k,S+=1}}if(e.virtualSize=Math.max(e.virtualSize,s)+m,a&&o&&("slide"===r.effect||"coverflow"===r.effect)&&(n.style.width=`${e.virtualSize+b}px`),r.setWrapperSize&&(n.style[e.getDirectionLabel("width")]=`${e.virtualSize+b}px`),T&&e.grid.updateWrapperSize(k,h),!r.centeredSlides){const t=[];for(let n=0;n<h.length;n+=1){let i=h[n];r.roundLengths&&(i=Math.floor(i)),h[n]<=e.virtualSize-s&&t.push(i)}h=t,Math.floor(e.virtualSize-s)-Math.floor(h[h.length-1])>1&&h.push(e.virtualSize-s)}if(l&&r.loop){const t=p[0]+b;if(r.slidesPerGroup>1){const n=Math.ceil((e.virtual.slidesBefore+e.virtual.slidesAfter)/r.slidesPerGroup),i=t*r.slidesPerGroup;for(let e=0;e<n;e+=1)h.push(h[h.length-1]+i)}for(let n=0;n<e.virtual.slidesBefore+e.virtual.slidesAfter;n+=1)1===r.slidesPerGroup&&h.push(h[h.length-1]+t),f.push(f[f.length-1]+t),e.virtualSize+=t}if(0===h.length&&(h=[0]),0!==b){const t=e.isHorizontal()&&a?"marginLeft":e.getDirectionLabel("marginRight");c.filter((e,t)=>!(r.cssMode&&!r.loop)||t!==c.length-1).forEach(e=>{e.style[t]=`${b}px`})}if(r.centeredSlides&&r.centeredSlidesBounds){let e=0;p.forEach(t=>{e+=t+(b||0)}),e-=b;const t=e>s?e-s:0;h=h.map(e=>e<=0?-g:e>t?t+m:e)}if(r.centerInsufficientSlides){let e=0;p.forEach(t=>{e+=t+(b||0)}),e-=b;const t=(r.slidesOffsetBefore||0)+(r.slidesOffsetAfter||0);if(e+t<s){const r=(s-e-t)/2;h.forEach((e,t)=>{h[t]=e-r}),f.forEach((e,t)=>{f[t]=e+r})}}if(Object.assign(e,{slides:c,snapGrid:h,slidesGrid:f,slidesSizesGrid:p}),r.centeredSlides&&r.cssMode&&!r.centeredSlidesBounds){Rr(n,"--swiper-centered-offset-before",-h[0]+"px"),Rr(n,"--swiper-centered-offset-after",e.size/2-p[p.length-1]/2+"px");const t=-e.snapGrid[0],r=-e.slidesGrid[0];e.snapGrid=e.snapGrid.map(e=>e+t),e.slidesGrid=e.slidesGrid.map(e=>e+r)}if(d!==u&&e.emit("slidesLengthChange"),h.length!==v&&(e.params.watchOverflow&&e.checkOverflow(),e.emit("snapGridLengthChange")),f.length!==y&&e.emit("slidesGridLengthChange"),r.watchSlidesProgress&&e.updateSlidesOffset(),e.emit("slidesUpdated"),!(l||r.cssMode||"slide"!==r.effect&&"fade"!==r.effect)){const t=`${r.containerModifierClass}backface-hidden`,n=e.el.classList.contains(t);d<=r.maxBackfaceHiddenSlides?n||e.el.classList.add(t):n&&e.el.classList.remove(t)}},updateAutoHeight:function(e){const t=this,r=[],n=t.virtual&&t.params.virtual.enabled;let i,s=0;"number"==typeof e?t.setTransition(e):!0===e&&t.setTransition(t.params.speed);const a=e=>n?t.slides[t.getSlideIndexByData(e)]:t.slides[e];if("auto"!==t.params.slidesPerView&&t.params.slidesPerView>1)if(t.params.centeredSlides)(t.visibleSlides||[]).forEach(e=>{r.push(e)});else for(i=0;i<Math.ceil(t.params.slidesPerView);i+=1){const e=t.activeIndex+i;if(e>t.slides.length&&!n)break;r.push(a(e))}else r.push(a(t.activeIndex));for(i=0;i<r.length;i+=1)if(void 0!==r[i]){const e=r[i].offsetHeight;s=e>s?e:s}(s||0===s)&&(t.wrapperEl.style.height=`${s}px`)},updateSlidesOffset:function(){const e=this,t=e.slides,r=e.isElement?e.isHorizontal()?e.wrapperEl.offsetLeft:e.wrapperEl.offsetTop:0;for(let n=0;n<t.length;n+=1)t[n].swiperSlideOffset=(e.isHorizontal()?t[n].offsetLeft:t[n].offsetTop)-r-e.cssOverflowAdjustment()},updateSlidesProgress:function(e){void 0===e&&(e=this&&this.translate||0);const t=this,r=t.params,{slides:n,rtlTranslate:i,snapGrid:s}=t;if(0===n.length)return;void 0===n[0].swiperSlideOffset&&t.updateSlidesOffset();let a=-e;i&&(a=e),t.visibleSlidesIndexes=[],t.visibleSlides=[];let o=r.spaceBetween;"string"==typeof o&&o.indexOf("%")>=0?o=parseFloat(o.replace("%",""))/100*t.size:"string"==typeof o&&(o=parseFloat(o));for(let e=0;e<n.length;e+=1){const l=n[e];let u=l.swiperSlideOffset;r.cssMode&&r.centeredSlides&&(u-=n[0].swiperSlideOffset);const c=(a+(r.centeredSlides?t.minTranslate():0)-u)/(l.swiperSlideSize+o),d=(a-s[0]+(r.centeredSlides?t.minTranslate():0)-u)/(l.swiperSlideSize+o),h=-(a-u),f=h+t.slidesSizesGrid[e],p=h>=0&&h<=t.size-t.slidesSizesGrid[e],g=h>=0&&h<t.size-1||f>1&&f<=t.size||h<=0&&f>=t.size;g&&(t.visibleSlides.push(l),t.visibleSlidesIndexes.push(e)),Gr(l,g,r.slideVisibleClass),Gr(l,p,r.slideFullyVisibleClass),l.progress=i?-c:c,l.originalProgress=i?-d:d}},updateProgress:function(e){const t=this;if(void 0===e){const r=t.rtlTranslate?-1:1;e=t&&t.translate&&t.translate*r||0}const r=t.params,n=t.maxTranslate()-t.minTranslate();let{progress:i,isBeginning:s,isEnd:a,progressLoop:o}=t;const l=s,u=a;if(0===n)i=0,s=!0,a=!0;else{i=(e-t.minTranslate())/n;const r=Math.abs(e-t.minTranslate())<1,o=Math.abs(e-t.maxTranslate())<1;s=r||i<=0,a=o||i>=1,r&&(i=0),o&&(i=1)}if(r.loop){const r=t.getSlideIndexByData(0),n=t.getSlideIndexByData(t.slides.length-1),i=t.slidesGrid[r],s=t.slidesGrid[n],a=t.slidesGrid[t.slidesGrid.length-1],l=Math.abs(e);o=l>=i?(l-i)/a:(l+a-s)/a,o>1&&(o-=1)}Object.assign(t,{progress:i,progressLoop:o,isBeginning:s,isEnd:a}),(r.watchSlidesProgress||r.centeredSlides&&r.autoHeight)&&t.updateSlidesProgress(e),s&&!l&&t.emit("reachBeginning toEdge"),a&&!u&&t.emit("reachEnd toEdge"),(l&&!s||u&&!a)&&t.emit("fromEdge"),t.emit("progress",i)},updateSlidesClasses:function(){const e=this,{slides:t,params:r,slidesEl:n,activeIndex:i}=e,s=e.virtual&&r.virtual.enabled,a=e.grid&&r.grid&&r.grid.rows>1,o=e=>Cr(n,`.${r.slideClass}${e}, swiper-slide${e}`)[0];let l,u,c;if(s)if(r.loop){let t=i-e.virtual.slidesBefore;t<0&&(t=e.virtual.slides.length+t),t>=e.virtual.slides.length&&(t-=e.virtual.slides.length),l=o(`[data-swiper-slide-index="${t}"]`)}else l=o(`[data-swiper-slide-index="${i}"]`);else a?(l=t.filter(e=>e.column===i)[0],c=t.filter(e=>e.column===i+1)[0],u=t.filter(e=>e.column===i-1)[0]):l=t[i];l&&(a||(c=function(e,t){const r=[];for(;e.nextElementSibling;){const n=e.nextElementSibling;t?n.matches(t)&&r.push(n):r.push(n),e=n}return r}(l,`.${r.slideClass}, swiper-slide`)[0],r.loop&&!c&&(c=t[0]),u=function(e,t){const r=[];for(;e.previousElementSibling;){const n=e.previousElementSibling;t?n.matches(t)&&r.push(n):r.push(n),e=n}return r}(l,`.${r.slideClass}, swiper-slide`)[0],r.loop&&0===!u&&(u=t[t.length-1]))),t.forEach(e=>{Hr(e,e===l,r.slideActiveClass),Hr(e,e===c,r.slideNextClass),Hr(e,e===u,r.slidePrevClass)}),e.emitSlidesClasses()},updateActiveIndex:function(e){const t=this,r=t.rtlTranslate?t.translate:-t.translate,{snapGrid:n,params:i,activeIndex:s,realIndex:a,snapIndex:o}=t;let l,u=e;const c=e=>{let r=e-t.virtual.slidesBefore;return r<0&&(r=t.virtual.slides.length+r),r>=t.virtual.slides.length&&(r-=t.virtual.slides.length),r};if(void 0===u&&(u=function(e){const{slidesGrid:t,params:r}=e,n=e.rtlTranslate?e.translate:-e.translate;let i;for(let e=0;e<t.length;e+=1)void 0!==t[e+1]?n>=t[e]&&n<t[e+1]-(t[e+1]-t[e])/2?i=e:n>=t[e]&&n<t[e+1]&&(i=e+1):n>=t[e]&&(i=e);return r.normalizeSlideIndex&&(i<0||void 0===i)&&(i=0),i}(t)),n.indexOf(r)>=0)l=n.indexOf(r);else{const e=Math.min(i.slidesPerGroupSkip,u);l=e+Math.floor((u-e)/i.slidesPerGroup)}if(l>=n.length&&(l=n.length-1),u===s&&!t.params.loop)return void(l!==o&&(t.snapIndex=l,t.emit("snapIndexChange")));if(u===s&&t.params.loop&&t.virtual&&t.params.virtual.enabled)return void(t.realIndex=c(u));const d=t.grid&&i.grid&&i.grid.rows>1;let h;if(t.virtual&&i.virtual.enabled&&i.loop)h=c(u);else if(d){const e=t.slides.filter(e=>e.column===u)[0];let r=parseInt(e.getAttribute("data-swiper-slide-index"),10);Number.isNaN(r)&&(r=Math.max(t.slides.indexOf(e),0)),h=Math.floor(r/i.grid.rows)}else if(t.slides[u]){const e=t.slides[u].getAttribute("data-swiper-slide-index");h=e?parseInt(e,10):u}else h=u;Object.assign(t,{previousSnapIndex:o,snapIndex:l,previousRealIndex:a,realIndex:h,previousIndex:s,activeIndex:u}),t.initialized&&Kr(t),t.emit("activeIndexChange"),t.emit("snapIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&(a!==h&&t.emit("realIndexChange"),t.emit("slideChange"))},updateClickedSlide:function(e,t){const r=this,n=r.params;let i=e.closest(`.${n.slideClass}, swiper-slide`);!i&&r.isElement&&t&&t.length>1&&t.includes(e)&&[...t.slice(t.indexOf(e)+1,t.length)].forEach(e=>{!i&&e.matches&&e.matches(`.${n.slideClass}, swiper-slide`)&&(i=e)});let s,a=!1;if(i)for(let e=0;e<r.slides.length;e+=1)if(r.slides[e]===i){a=!0,s=e;break}if(!i||!a)return r.clickedSlide=void 0,void(r.clickedIndex=void 0);r.clickedSlide=i,r.virtual&&r.params.virtual.enabled?r.clickedIndex=parseInt(i.getAttribute("data-swiper-slide-index"),10):r.clickedIndex=s,n.slideToClickedSlide&&void 0!==r.clickedIndex&&r.clickedIndex!==r.activeIndex&&r.slideToClickedSlide()}};var qr={getTranslate:function(e){void 0===e&&(e=this.isHorizontal()?"x":"y");const{params:t,rtlTranslate:r,translate:n,wrapperEl:i}=this;if(t.virtualTranslate)return r?-n:n;if(t.cssMode)return n;let s=Tr(i,e);return s+=this.cssOverflowAdjustment(),r&&(s=-s),s||0},setTranslate:function(e,t){const r=this,{rtlTranslate:n,params:i,wrapperEl:s,progress:a}=r;let o,l=0,u=0;r.isHorizontal()?l=n?-e:e:u=e,i.roundLengths&&(l=Math.floor(l),u=Math.floor(u)),r.previousTranslate=r.translate,r.translate=r.isHorizontal()?l:u,i.cssMode?s[r.isHorizontal()?"scrollLeft":"scrollTop"]=r.isHorizontal()?-l:-u:i.virtualTranslate||(r.isHorizontal()?l-=r.cssOverflowAdjustment():u-=r.cssOverflowAdjustment(),s.style.transform=`translate3d(${l}px, ${u}px, 0px)`);const c=r.maxTranslate()-r.minTranslate();o=0===c?0:(e-r.minTranslate())/c,o!==a&&r.updateProgress(e),r.emit("setTranslate",r.translate,t)},minTranslate:function(){return-this.snapGrid[0]},maxTranslate:function(){return-this.snapGrid[this.snapGrid.length-1]},translateTo:function(e,t,r,n,i){void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===r&&(r=!0),void 0===n&&(n=!0);const s=this,{params:a,wrapperEl:o}=s;if(s.animating&&a.preventInteractionOnTransition)return!1;const l=s.minTranslate(),u=s.maxTranslate();let c;if(c=n&&e>l?l:n&&e<u?u:e,s.updateProgress(c),a.cssMode){const e=s.isHorizontal();if(0===t)o[e?"scrollLeft":"scrollTop"]=-c;else{if(!s.support.smoothScroll)return Lr({swiper:s,targetPosition:-c,side:e?"left":"top"}),!0;o.scrollTo({[e?"left":"top"]:-c,behavior:"smooth"})}return!0}return 0===t?(s.setTransition(0),s.setTranslate(c),r&&(s.emit("beforeTransitionStart",t,i),s.emit("transitionEnd"))):(s.setTransition(t),s.setTranslate(c),r&&(s.emit("beforeTransitionStart",t,i),s.emit("transitionStart")),s.animating||(s.animating=!0,s.onTranslateToWrapperTransitionEnd||(s.onTranslateToWrapperTransitionEnd=function(e){s&&!s.destroyed&&e.target===this&&(s.wrapperEl.removeEventListener("transitionend",s.onTranslateToWrapperTransitionEnd),s.onTranslateToWrapperTransitionEnd=null,delete s.onTranslateToWrapperTransitionEnd,s.animating=!1,r&&s.emit("transitionEnd"))}),s.wrapperEl.addEventListener("transitionend",s.onTranslateToWrapperTransitionEnd))),!0}};function Xr(e){let{swiper:t,runCallbacks:r,direction:n,step:i}=e;const{activeIndex:s,previousIndex:a}=t;let o=n;if(o||(o=s>a?"next":s<a?"prev":"reset"),t.emit(`transition${i}`),r&&s!==a){if("reset"===o)return void t.emit(`slideResetTransition${i}`);t.emit(`slideChangeTransition${i}`),"next"===o?t.emit(`slideNextTransition${i}`):t.emit(`slidePrevTransition${i}`)}}var Qr={setTransition:function(e,t){const r=this;r.params.cssMode||(r.wrapperEl.style.transitionDuration=`${e}ms`,r.wrapperEl.style.transitionDelay=0===e?"0ms":""),r.emit("setTransition",e,t)},transitionStart:function(e,t){void 0===e&&(e=!0);const r=this,{params:n}=r;n.cssMode||(n.autoHeight&&r.updateAutoHeight(),Xr({swiper:r,runCallbacks:e,direction:t,step:"Start"}))},transitionEnd:function(e,t){void 0===e&&(e=!0);const r=this,{params:n}=r;r.animating=!1,n.cssMode||(r.setTransition(0),Xr({swiper:r,runCallbacks:e,direction:t,step:"End"}))}};var Zr={slideTo:function(e,t,r,n,i){void 0===e&&(e=0),void 0===r&&(r=!0),"string"==typeof e&&(e=parseInt(e,10));const s=this;let a=e;a<0&&(a=0);const{params:o,snapGrid:l,slidesGrid:u,previousIndex:c,activeIndex:d,rtlTranslate:h,wrapperEl:f,enabled:p}=s;if(!p&&!n&&!i||s.destroyed||s.animating&&o.preventInteractionOnTransition)return!1;void 0===t&&(t=s.params.speed);const g=Math.min(s.params.slidesPerGroupSkip,a);let m=g+Math.floor((a-g)/s.params.slidesPerGroup);m>=l.length&&(m=l.length-1);const v=-l[m];if(o.normalizeSlideIndex)for(let e=0;e<u.length;e+=1){const t=-Math.floor(100*v),r=Math.floor(100*u[e]),n=Math.floor(100*u[e+1]);void 0!==u[e+1]?t>=r&&t<n-(n-r)/2?a=e:t>=r&&t<n&&(a=e+1):t>=r&&(a=e)}if(s.initialized&&a!==d){if(!s.allowSlideNext&&(h?v>s.translate&&v>s.minTranslate():v<s.translate&&v<s.minTranslate()))return!1;if(!s.allowSlidePrev&&v>s.translate&&v>s.maxTranslate()&&(d||0)!==a)return!1}let y;a!==(c||0)&&r&&s.emit("beforeSlideChangeStart"),s.updateProgress(v),y=a>d?"next":a<d?"prev":"reset";const b=s.virtual&&s.params.virtual.enabled;if(!(b&&i)&&(h&&-v===s.translate||!h&&v===s.translate))return s.updateActiveIndex(a),o.autoHeight&&s.updateAutoHeight(),s.updateSlidesClasses(),"slide"!==o.effect&&s.setTranslate(v),"reset"!==y&&(s.transitionStart(r,y),s.transitionEnd(r,y)),!1;if(o.cssMode){const e=s.isHorizontal(),r=h?v:-v;if(0===t)b&&(s.wrapperEl.style.scrollSnapType="none",s._immediateVirtual=!0),b&&!s._cssModeVirtualInitialSet&&s.params.initialSlide>0?(s._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{f[e?"scrollLeft":"scrollTop"]=r})):f[e?"scrollLeft":"scrollTop"]=r,b&&requestAnimationFrame(()=>{s.wrapperEl.style.scrollSnapType="",s._immediateVirtual=!1});else{if(!s.support.smoothScroll)return Lr({swiper:s,targetPosition:r,side:e?"left":"top"}),!0;f.scrollTo({[e?"left":"top"]:r,behavior:"smooth"})}return!0}return s.setTransition(t),s.setTranslate(v),s.updateActiveIndex(a),s.updateSlidesClasses(),s.emit("beforeTransitionStart",t,n),s.transitionStart(r,y),0===t?s.transitionEnd(r,y):s.animating||(s.animating=!0,s.onSlideToWrapperTransitionEnd||(s.onSlideToWrapperTransitionEnd=function(e){s&&!s.destroyed&&e.target===this&&(s.wrapperEl.removeEventListener("transitionend",s.onSlideToWrapperTransitionEnd),s.onSlideToWrapperTransitionEnd=null,delete s.onSlideToWrapperTransitionEnd,s.transitionEnd(r,y))}),s.wrapperEl.addEventListener("transitionend",s.onSlideToWrapperTransitionEnd)),!0},slideToLoop:function(e,t,r,n){if(void 0===e&&(e=0),void 0===r&&(r=!0),"string"==typeof e){e=parseInt(e,10)}const i=this;if(i.destroyed)return;void 0===t&&(t=i.params.speed);const s=i.grid&&i.params.grid&&i.params.grid.rows>1;let a=e;if(i.params.loop)if(i.virtual&&i.params.virtual.enabled)a+=i.virtual.slidesBefore;else{let e;if(s){const t=a*i.params.grid.rows;e=i.slides.filter(e=>1*e.getAttribute("data-swiper-slide-index")===t)[0].column}else e=i.getSlideIndexByData(a);const t=s?Math.ceil(i.slides.length/i.params.grid.rows):i.slides.length,{centeredSlides:r}=i.params;let o=i.params.slidesPerView;"auto"===o?o=i.slidesPerViewDynamic():(o=Math.ceil(parseFloat(i.params.slidesPerView,10)),r&&o%2==0&&(o+=1));let l=t-e<o;if(r&&(l=l||e<Math.ceil(o/2)),n&&r&&"auto"!==i.params.slidesPerView&&!s&&(l=!1),l){const n=r?e<i.activeIndex?"prev":"next":e-i.activeIndex-1<i.params.slidesPerView?"next":"prev";i.loopFix({direction:n,slideTo:!0,activeSlideIndex:"next"===n?e+1:e-t+1,slideRealIndex:"next"===n?i.realIndex:void 0})}if(s){const e=a*i.params.grid.rows;a=i.slides.filter(t=>1*t.getAttribute("data-swiper-slide-index")===e)[0].column}else a=i.getSlideIndexByData(a)}return requestAnimationFrame(()=>{i.slideTo(a,t,r,n)}),i},slideNext:function(e,t,r){void 0===t&&(t=!0);const n=this,{enabled:i,params:s,animating:a}=n;if(!i||n.destroyed)return n;void 0===e&&(e=n.params.speed);let o=s.slidesPerGroup;"auto"===s.slidesPerView&&1===s.slidesPerGroup&&s.slidesPerGroupAuto&&(o=Math.max(n.slidesPerViewDynamic("current",!0),1));const l=n.activeIndex<s.slidesPerGroupSkip?1:o,u=n.virtual&&s.virtual.enabled;if(s.loop){if(a&&!u&&s.loopPreventsSliding)return!1;if(n.loopFix({direction:"next"}),n._clientLeft=n.wrapperEl.clientLeft,n.activeIndex===n.slides.length-1&&s.cssMode)return requestAnimationFrame(()=>{n.slideTo(n.activeIndex+l,e,t,r)}),!0}return s.rewind&&n.isEnd?n.slideTo(0,e,t,r):n.slideTo(n.activeIndex+l,e,t,r)},slidePrev:function(e,t,r){void 0===t&&(t=!0);const n=this,{params:i,snapGrid:s,slidesGrid:a,rtlTranslate:o,enabled:l,animating:u}=n;if(!l||n.destroyed)return n;void 0===e&&(e=n.params.speed);const c=n.virtual&&i.virtual.enabled;if(i.loop){if(u&&!c&&i.loopPreventsSliding)return!1;n.loopFix({direction:"prev"}),n._clientLeft=n.wrapperEl.clientLeft}function d(e){return e<0?-Math.floor(Math.abs(e)):Math.floor(e)}const h=d(o?n.translate:-n.translate),f=s.map(e=>d(e));let p=s[f.indexOf(h)-1];if(void 0===p&&i.cssMode){let e;s.forEach((t,r)=>{h>=t&&(e=r)}),void 0!==e&&(p=s[e>0?e-1:e])}let g=0;if(void 0!==p&&(g=a.indexOf(p),g<0&&(g=n.activeIndex-1),"auto"===i.slidesPerView&&1===i.slidesPerGroup&&i.slidesPerGroupAuto&&(g=g-n.slidesPerViewDynamic("previous",!0)+1,g=Math.max(g,0))),i.rewind&&n.isBeginning){const i=n.params.virtual&&n.params.virtual.enabled&&n.virtual?n.virtual.slides.length-1:n.slides.length-1;return n.slideTo(i,e,t,r)}return i.loop&&0===n.activeIndex&&i.cssMode?(requestAnimationFrame(()=>{n.slideTo(g,e,t,r)}),!0):n.slideTo(g,e,t,r)},slideReset:function(e,t,r){void 0===t&&(t=!0);const n=this;if(!n.destroyed)return void 0===e&&(e=n.params.speed),n.slideTo(n.activeIndex,e,t,r)},slideToClosest:function(e,t,r,n){void 0===t&&(t=!0),void 0===n&&(n=.5);const i=this;if(i.destroyed)return;void 0===e&&(e=i.params.speed);let s=i.activeIndex;const a=Math.min(i.params.slidesPerGroupSkip,s),o=a+Math.floor((s-a)/i.params.slidesPerGroup),l=i.rtlTranslate?i.translate:-i.translate;if(l>=i.snapGrid[o]){const e=i.snapGrid[o];l-e>(i.snapGrid[o+1]-e)*n&&(s+=i.params.slidesPerGroup)}else{const e=i.snapGrid[o-1];l-e<=(i.snapGrid[o]-e)*n&&(s-=i.params.slidesPerGroup)}return s=Math.max(s,0),s=Math.min(s,i.slidesGrid.length-1),i.slideTo(s,e,t,r)},slideToClickedSlide:function(){const e=this;if(e.destroyed)return;const{params:t,slidesEl:r}=e,n="auto"===t.slidesPerView?e.slidesPerViewDynamic():t.slidesPerView;let i,s=e.clickedIndex;const a=e.isElement?"swiper-slide":`.${t.slideClass}`;if(t.loop){if(e.animating)return;i=parseInt(e.clickedSlide.getAttribute("data-swiper-slide-index"),10),t.centeredSlides?s<e.loopedSlides-n/2||s>e.slides.length-e.loopedSlides+n/2?(e.loopFix(),s=e.getSlideIndex(Cr(r,`${a}[data-swiper-slide-index="${i}"]`)[0]),Er(()=>{e.slideTo(s)})):e.slideTo(s):s>e.slides.length-n?(e.loopFix(),s=e.getSlideIndex(Cr(r,`${a}[data-swiper-slide-index="${i}"]`)[0]),Er(()=>{e.slideTo(s)})):e.slideTo(s)}else e.slideTo(s)}};var Jr={loopCreate:function(e){const t=this,{params:r,slidesEl:n}=t;if(!r.loop||t.virtual&&t.params.virtual.enabled)return;const i=()=>{Cr(n,`.${r.slideClass}, swiper-slide`).forEach((e,t)=>{e.setAttribute("data-swiper-slide-index",t)})},s=t.grid&&r.grid&&r.grid.rows>1,a=r.slidesPerGroup*(s?r.grid.rows:1),o=t.slides.length%a!==0,l=s&&t.slides.length%r.grid.rows!==0,u=e=>{for(let n=0;n<e;n+=1){const e=t.isElement?Dr("swiper-slide",[r.slideBlankClass]):Dr("div",[r.slideClass,r.slideBlankClass]);t.slidesEl.append(e)}};if(o){if(r.loopAddBlankSlides){u(a-t.slides.length%a),t.recalcSlides(),t.updateSlides()}else Pr("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");i()}else if(l){if(r.loopAddBlankSlides){u(r.grid.rows-t.slides.length%r.grid.rows),t.recalcSlides(),t.updateSlides()}else Pr("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");i()}else i();t.loopFix({slideRealIndex:e,direction:r.centeredSlides?void 0:"next"})},loopFix:function(e){let{slideRealIndex:t,slideTo:r=!0,direction:n,setTranslate:i,activeSlideIndex:s,byController:a,byMousewheel:o}=void 0===e?{}:e;const l=this;if(!l.params.loop)return;l.emit("beforeLoopFix");const{slides:u,allowSlidePrev:c,allowSlideNext:d,slidesEl:h,params:f}=l,{centeredSlides:p}=f;if(l.allowSlidePrev=!0,l.allowSlideNext=!0,l.virtual&&f.virtual.enabled)return r&&(f.centeredSlides||0!==l.snapIndex?f.centeredSlides&&l.snapIndex<f.slidesPerView?l.slideTo(l.virtual.slides.length+l.snapIndex,0,!1,!0):l.snapIndex===l.snapGrid.length-1&&l.slideTo(l.virtual.slidesBefore,0,!1,!0):l.slideTo(l.virtual.slides.length,0,!1,!0)),l.allowSlidePrev=c,l.allowSlideNext=d,void l.emit("loopFix");let g=f.slidesPerView;"auto"===g?g=l.slidesPerViewDynamic():(g=Math.ceil(parseFloat(f.slidesPerView,10)),p&&g%2==0&&(g+=1));const m=f.slidesPerGroupAuto?g:f.slidesPerGroup;let v=m;v%m!==0&&(v+=m-v%m),v+=f.loopAdditionalSlides,l.loopedSlides=v;const y=l.grid&&f.grid&&f.grid.rows>1;u.length<g+v?Pr("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled and not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters"):y&&"row"===f.grid.fill&&Pr("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const b=[],w=[];let E=l.activeIndex;void 0===s?s=l.getSlideIndex(u.filter(e=>e.classList.contains(f.slideActiveClass))[0]):E=s;const S="next"===n||!n,T="prev"===n||!n;let k=0,x=0;const A=y?Math.ceil(u.length/f.grid.rows):u.length,R=(y?u[s].column:s)+(p&&void 0===i?-g/2+.5:0);if(R<v){k=Math.max(v-R,m);for(let e=0;e<v-R;e+=1){const t=e-Math.floor(e/A)*A;if(y){const e=A-t-1;for(let t=u.length-1;t>=0;t-=1)u[t].column===e&&b.push(t)}else b.push(A-t-1)}}else if(R+g>A-v){x=Math.max(R-(A-2*v),m);for(let e=0;e<x;e+=1){const t=e-Math.floor(e/A)*A;y?u.forEach((e,r)=>{e.column===t&&w.push(r)}):w.push(t)}}if(l.__preventObserver__=!0,requestAnimationFrame(()=>{l.__preventObserver__=!1}),T&&b.forEach(e=>{u[e].swiperLoopMoveDOM=!0,h.prepend(u[e]),u[e].swiperLoopMoveDOM=!1}),S&&w.forEach(e=>{u[e].swiperLoopMoveDOM=!0,h.append(u[e]),u[e].swiperLoopMoveDOM=!1}),l.recalcSlides(),"auto"===f.slidesPerView?l.updateSlides():y&&(b.length>0&&T||w.length>0&&S)&&l.slides.forEach((e,t)=>{l.grid.updateSlide(t,e,l.slides)}),f.watchSlidesProgress&&l.updateSlidesOffset(),r)if(b.length>0&&T){if(void 0===t){const e=l.slidesGrid[E],t=l.slidesGrid[E+k]-e;o?l.setTranslate(l.translate-t):(l.slideTo(E+Math.ceil(k),0,!1,!0),i&&(l.touchEventsData.startTranslate=l.touchEventsData.startTranslate-t,l.touchEventsData.currentTranslate=l.touchEventsData.currentTranslate-t))}else if(i){const e=y?b.length/f.grid.rows:b.length;l.slideTo(l.activeIndex+e,0,!1,!0),l.touchEventsData.currentTranslate=l.translate}}else if(w.length>0&&S)if(void 0===t){const e=l.slidesGrid[E],t=l.slidesGrid[E-x]-e;o?l.setTranslate(l.translate-t):(l.slideTo(E-x,0,!1,!0),i&&(l.touchEventsData.startTranslate=l.touchEventsData.startTranslate-t,l.touchEventsData.currentTranslate=l.touchEventsData.currentTranslate-t))}else{const e=y?w.length/f.grid.rows:w.length;l.slideTo(l.activeIndex-e,0,!1,!0)}if(l.allowSlidePrev=c,l.allowSlideNext=d,l.controller&&l.controller.control&&!a){const e={slideRealIndex:t,direction:n,setTranslate:i,activeSlideIndex:s,byController:!0};Array.isArray(l.controller.control)?l.controller.control.forEach(t=>{!t.destroyed&&t.params.loop&&t.loopFix({...e,slideTo:t.params.slidesPerView===f.slidesPerView&&r})}):l.controller.control instanceof l.constructor&&l.controller.control.params.loop&&l.controller.control.loopFix({...e,slideTo:l.controller.control.params.slidesPerView===f.slidesPerView&&r})}l.emit("loopFix")},loopDestroy:function(){const e=this,{params:t,slidesEl:r}=e;if(!t.loop||e.virtual&&e.params.virtual.enabled)return;e.recalcSlides();const n=[];e.slides.forEach(e=>{const t=void 0===e.swiperSlideIndex?1*e.getAttribute("data-swiper-slide-index"):e.swiperSlideIndex;n[t]=e}),e.slides.forEach(e=>{e.removeAttribute("data-swiper-slide-index")}),n.forEach(e=>{r.append(e)}),e.recalcSlides(),e.slideTo(e.realIndex,0)}};function en(e,t,r){const n=wr(),{params:i}=e,s=i.edgeSwipeDetection,a=i.edgeSwipeThreshold;return!s||!(r<=a||r>=n.innerWidth-a)||"prevent"===s&&(t.preventDefault(),!0)}function tn(e){const t=this,r=yr();let n=e;n.originalEvent&&(n=n.originalEvent);const i=t.touchEventsData;if("pointerdown"===n.type){if(null!==i.pointerId&&i.pointerId!==n.pointerId)return;i.pointerId=n.pointerId}else"touchstart"===n.type&&1===n.targetTouches.length&&(i.touchId=n.targetTouches[0].identifier);if("touchstart"===n.type)return void en(t,n,n.targetTouches[0].pageX);const{params:s,touches:a,enabled:o}=t;if(!o)return;if(!s.simulateTouch&&"mouse"===n.pointerType)return;if(t.animating&&s.preventInteractionOnTransition)return;!t.animating&&s.cssMode&&s.loop&&t.loopFix();let l=n.target;if("wrapper"===s.touchEventsTarget&&!function(e,t){const r=t.contains(e);if(!r&&t instanceof HTMLSlotElement)return[...t.assignedElements()].includes(e);return r}(l,t.wrapperEl))return;if("which"in n&&3===n.which)return;if("button"in n&&n.button>0)return;if(i.isTouched&&i.isMoved)return;const u=!!s.noSwipingClass&&""!==s.noSwipingClass,c=n.composedPath?n.composedPath():n.path;u&&n.target&&n.target.shadowRoot&&c&&(l=c[0]);const d=s.noSwipingSelector?s.noSwipingSelector:`.${s.noSwipingClass}`,h=!(!n.target||!n.target.shadowRoot);if(s.noSwiping&&(h?function(e,t){return void 0===t&&(t=this),function t(r){if(!r||r===yr()||r===wr())return null;r.assignedSlot&&(r=r.assignedSlot);const n=r.closest(e);return n||r.getRootNode?n||t(r.getRootNode().host):null}(t)}(d,l):l.closest(d)))return void(t.allowClick=!0);if(s.swipeHandler&&!l.closest(s.swipeHandler))return;a.currentX=n.pageX,a.currentY=n.pageY;const f=a.currentX,p=a.currentY;if(!en(t,n,f))return;Object.assign(i,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),a.startX=f,a.startY=p,i.touchStartTime=Sr(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,s.threshold>0&&(i.allowThresholdMove=!1);let g=!0;l.matches(i.focusableElements)&&(g=!1,"SELECT"===l.nodeName&&(i.isTouched=!1)),r.activeElement&&r.activeElement.matches(i.focusableElements)&&r.activeElement!==l&&("mouse"===n.pointerType||"mouse"!==n.pointerType&&!l.matches(i.focusableElements))&&r.activeElement.blur();const m=g&&t.allowTouchMove&&s.touchStartPreventDefault;!s.touchStartForcePreventDefault&&!m||l.isContentEditable||n.preventDefault(),s.freeMode&&s.freeMode.enabled&&t.freeMode&&t.animating&&!s.cssMode&&t.freeMode.onTouchStart(),t.emit("touchStart",n)}function rn(e){const t=yr(),r=this,n=r.touchEventsData,{params:i,touches:s,rtlTranslate:a,enabled:o}=r;if(!o)return;if(!i.simulateTouch&&"mouse"===e.pointerType)return;let l,u=e;if(u.originalEvent&&(u=u.originalEvent),"pointermove"===u.type){if(null!==n.touchId)return;if(u.pointerId!==n.pointerId)return}if("touchmove"===u.type){if(l=[...u.changedTouches].filter(e=>e.identifier===n.touchId)[0],!l||l.identifier!==n.touchId)return}else l=u;if(!n.isTouched)return void(n.startMoving&&n.isScrolling&&r.emit("touchMoveOpposite",u));const c=l.pageX,d=l.pageY;if(u.preventedByNestedSwiper)return s.startX=c,void(s.startY=d);if(!r.allowTouchMove)return u.target.matches(n.focusableElements)||(r.allowClick=!1),void(n.isTouched&&(Object.assign(s,{startX:c,startY:d,currentX:c,currentY:d}),n.touchStartTime=Sr()));if(i.touchReleaseOnEdges&&!i.loop)if(r.isVertical()){if(d<s.startY&&r.translate<=r.maxTranslate()||d>s.startY&&r.translate>=r.minTranslate())return n.isTouched=!1,void(n.isMoved=!1)}else if(c<s.startX&&r.translate<=r.maxTranslate()||c>s.startX&&r.translate>=r.minTranslate())return;if(t.activeElement&&t.activeElement.matches(n.focusableElements)&&t.activeElement!==u.target&&"mouse"!==u.pointerType&&t.activeElement.blur(),t.activeElement&&u.target===t.activeElement&&u.target.matches(n.focusableElements))return n.isMoved=!0,void(r.allowClick=!1);n.allowTouchCallbacks&&r.emit("touchMove",u),s.previousX=s.currentX,s.previousY=s.currentY,s.currentX=c,s.currentY=d;const h=s.currentX-s.startX,f=s.currentY-s.startY;if(r.params.threshold&&Math.sqrt(h**2+f**2)<r.params.threshold)return;if(void 0===n.isScrolling){let e;r.isHorizontal()&&s.currentY===s.startY||r.isVertical()&&s.currentX===s.startX?n.isScrolling=!1:h*h+f*f>=25&&(e=180*Math.atan2(Math.abs(f),Math.abs(h))/Math.PI,n.isScrolling=r.isHorizontal()?e>i.touchAngle:90-e>i.touchAngle)}if(n.isScrolling&&r.emit("touchMoveOpposite",u),void 0===n.startMoving&&(s.currentX===s.startX&&s.currentY===s.startY||(n.startMoving=!0)),n.isScrolling||"touchmove"===u.type&&n.preventTouchMoveFromPointerMove)return void(n.isTouched=!1);if(!n.startMoving)return;r.allowClick=!1,!i.cssMode&&u.cancelable&&u.preventDefault(),i.touchMoveStopPropagation&&!i.nested&&u.stopPropagation();let p=r.isHorizontal()?h:f,g=r.isHorizontal()?s.currentX-s.previousX:s.currentY-s.previousY;i.oneWayMovement&&(p=Math.abs(p)*(a?1:-1),g=Math.abs(g)*(a?1:-1)),s.diff=p,p*=i.touchRatio,a&&(p=-p,g=-g);const m=r.touchesDirection;r.swipeDirection=p>0?"prev":"next",r.touchesDirection=g>0?"prev":"next";const v=r.params.loop&&!i.cssMode,y="next"===r.touchesDirection&&r.allowSlideNext||"prev"===r.touchesDirection&&r.allowSlidePrev;if(!n.isMoved){if(v&&y&&r.loopFix({direction:r.swipeDirection}),n.startTranslate=r.getTranslate(),r.setTransition(0),r.animating){const e=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0,detail:{bySwiperTouchMove:!0}});r.wrapperEl.dispatchEvent(e)}n.allowMomentumBounce=!1,!i.grabCursor||!0!==r.allowSlideNext&&!0!==r.allowSlidePrev||r.setGrabCursor(!0),r.emit("sliderFirstMove",u)}if((new Date).getTime(),n.isMoved&&n.allowThresholdMove&&m!==r.touchesDirection&&v&&y&&Math.abs(p)>=1)return Object.assign(s,{startX:c,startY:d,currentX:c,currentY:d,startTranslate:n.currentTranslate}),n.loopSwapReset=!0,void(n.startTranslate=n.currentTranslate);r.emit("sliderMove",u),n.isMoved=!0,n.currentTranslate=p+n.startTranslate;let b=!0,w=i.resistanceRatio;if(i.touchReleaseOnEdges&&(w=0),p>0?(v&&y&&n.allowThresholdMove&&n.currentTranslate>(i.centeredSlides?r.minTranslate()-r.slidesSizesGrid[r.activeIndex+1]-("auto"!==i.slidesPerView&&r.slides.length-i.slidesPerView>=2?r.slidesSizesGrid[r.activeIndex+1]+r.params.spaceBetween:0)-r.params.spaceBetween:r.minTranslate())&&r.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),n.currentTranslate>r.minTranslate()&&(b=!1,i.resistance&&(n.currentTranslate=r.minTranslate()-1+(-r.minTranslate()+n.startTranslate+p)**w))):p<0&&(v&&y&&n.allowThresholdMove&&n.currentTranslate<(i.centeredSlides?r.maxTranslate()+r.slidesSizesGrid[r.slidesSizesGrid.length-1]+r.params.spaceBetween+("auto"!==i.slidesPerView&&r.slides.length-i.slidesPerView>=2?r.slidesSizesGrid[r.slidesSizesGrid.length-1]+r.params.spaceBetween:0):r.maxTranslate())&&r.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:r.slides.length-("auto"===i.slidesPerView?r.slidesPerViewDynamic():Math.ceil(parseFloat(i.slidesPerView,10)))}),n.currentTranslate<r.maxTranslate()&&(b=!1,i.resistance&&(n.currentTranslate=r.maxTranslate()+1-(r.maxTranslate()-n.startTranslate-p)**w))),b&&(u.preventedByNestedSwiper=!0),!r.allowSlideNext&&"next"===r.swipeDirection&&n.currentTranslate<n.startTranslate&&(n.currentTranslate=n.startTranslate),!r.allowSlidePrev&&"prev"===r.swipeDirection&&n.currentTranslate>n.startTranslate&&(n.currentTranslate=n.startTranslate),r.allowSlidePrev||r.allowSlideNext||(n.currentTranslate=n.startTranslate),i.threshold>0){if(!(Math.abs(p)>i.threshold||n.allowThresholdMove))return void(n.currentTranslate=n.startTranslate);if(!n.allowThresholdMove)return n.allowThresholdMove=!0,s.startX=s.currentX,s.startY=s.currentY,n.currentTranslate=n.startTranslate,void(s.diff=r.isHorizontal()?s.currentX-s.startX:s.currentY-s.startY)}i.followFinger&&!i.cssMode&&((i.freeMode&&i.freeMode.enabled&&r.freeMode||i.watchSlidesProgress)&&(r.updateActiveIndex(),r.updateSlidesClasses()),i.freeMode&&i.freeMode.enabled&&r.freeMode&&r.freeMode.onTouchMove(),r.updateProgress(n.currentTranslate),r.setTranslate(n.currentTranslate))}function nn(e){const t=this,r=t.touchEventsData;let n,i=e;i.originalEvent&&(i=i.originalEvent);if("touchend"===i.type||"touchcancel"===i.type){if(n=[...i.changedTouches].filter(e=>e.identifier===r.touchId)[0],!n||n.identifier!==r.touchId)return}else{if(null!==r.touchId)return;if(i.pointerId!==r.pointerId)return;n=i}if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(i.type)){if(!(["pointercancel","contextmenu"].includes(i.type)&&(t.browser.isSafari||t.browser.isWebView)))return}r.pointerId=null,r.touchId=null;const{params:s,touches:a,rtlTranslate:o,slidesGrid:l,enabled:u}=t;if(!u)return;if(!s.simulateTouch&&"mouse"===i.pointerType)return;if(r.allowTouchCallbacks&&t.emit("touchEnd",i),r.allowTouchCallbacks=!1,!r.isTouched)return r.isMoved&&s.grabCursor&&t.setGrabCursor(!1),r.isMoved=!1,void(r.startMoving=!1);s.grabCursor&&r.isMoved&&r.isTouched&&(!0===t.allowSlideNext||!0===t.allowSlidePrev)&&t.setGrabCursor(!1);const c=Sr(),d=c-r.touchStartTime;if(t.allowClick){const e=i.path||i.composedPath&&i.composedPath();t.updateClickedSlide(e&&e[0]||i.target,e),t.emit("tap click",i),d<300&&c-r.lastClickTime<300&&t.emit("doubleTap doubleClick",i)}if(r.lastClickTime=Sr(),Er(()=>{t.destroyed||(t.allowClick=!0)}),!r.isTouched||!r.isMoved||!t.swipeDirection||0===a.diff&&!r.loopSwapReset||r.currentTranslate===r.startTranslate&&!r.loopSwapReset)return r.isTouched=!1,r.isMoved=!1,void(r.startMoving=!1);let h;if(r.isTouched=!1,r.isMoved=!1,r.startMoving=!1,h=s.followFinger?o?t.translate:-t.translate:-r.currentTranslate,s.cssMode)return;if(s.freeMode&&s.freeMode.enabled)return void t.freeMode.onTouchEnd({currentPos:h});const f=h>=-t.maxTranslate()&&!t.params.loop;let p=0,g=t.slidesSizesGrid[0];for(let e=0;e<l.length;e+=e<s.slidesPerGroupSkip?1:s.slidesPerGroup){const t=e<s.slidesPerGroupSkip-1?1:s.slidesPerGroup;void 0!==l[e+t]?(f||h>=l[e]&&h<l[e+t])&&(p=e,g=l[e+t]-l[e]):(f||h>=l[e])&&(p=e,g=l[l.length-1]-l[l.length-2])}let m=null,v=null;s.rewind&&(t.isBeginning?v=s.virtual&&s.virtual.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(m=0));const y=(h-l[p])/g,b=p<s.slidesPerGroupSkip-1?1:s.slidesPerGroup;if(d>s.longSwipesMs){if(!s.longSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&(y>=s.longSwipesRatio?t.slideTo(s.rewind&&t.isEnd?m:p+b):t.slideTo(p)),"prev"===t.swipeDirection&&(y>1-s.longSwipesRatio?t.slideTo(p+b):null!==v&&y<0&&Math.abs(y)>s.longSwipesRatio?t.slideTo(v):t.slideTo(p))}else{if(!s.shortSwipes)return void t.slideTo(t.activeIndex);t.navigation&&(i.target===t.navigation.nextEl||i.target===t.navigation.prevEl)?i.target===t.navigation.nextEl?t.slideTo(p+b):t.slideTo(p):("next"===t.swipeDirection&&t.slideTo(null!==m?m:p+b),"prev"===t.swipeDirection&&t.slideTo(null!==v?v:p))}}function sn(){const e=this,{params:t,el:r}=e;if(r&&0===r.offsetWidth)return;t.breakpoints&&e.setBreakpoint();const{allowSlideNext:n,allowSlidePrev:i,snapGrid:s}=e,a=e.virtual&&e.params.virtual.enabled;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses();const o=a&&t.loop;!("auto"===t.slidesPerView||t.slidesPerView>1)||!e.isEnd||e.isBeginning||e.params.centeredSlides||o?e.params.loop&&!a?e.slideToLoop(e.realIndex,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0):e.slideTo(e.slides.length-1,0,!1,!0),e.autoplay&&e.autoplay.running&&e.autoplay.paused&&(clearTimeout(e.autoplay.resizeTimeout),e.autoplay.resizeTimeout=setTimeout(()=>{e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.resume()},500)),e.allowSlidePrev=i,e.allowSlideNext=n,e.params.watchOverflow&&s!==e.snapGrid&&e.checkOverflow()}function an(e){const t=this;t.enabled&&(t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation())))}function on(){const e=this,{wrapperEl:t,rtlTranslate:r,enabled:n}=e;if(!n)return;let i;e.previousTranslate=e.translate,e.isHorizontal()?e.translate=-t.scrollLeft:e.translate=-t.scrollTop,0===e.translate&&(e.translate=0),e.updateActiveIndex(),e.updateSlidesClasses();const s=e.maxTranslate()-e.minTranslate();i=0===s?0:(e.translate-e.minTranslate())/s,i!==e.progress&&e.updateProgress(r?-e.translate:e.translate),e.emit("setTranslate",e.translate,!1)}function ln(e){const t=this;Vr(t,e.target),t.params.cssMode||"auto"!==t.params.slidesPerView&&!t.params.autoHeight||t.update()}function un(){const e=this;e.documentTouchHandlerProceeded||(e.documentTouchHandlerProceeded=!0,e.params.touchReleaseOnEdges&&(e.el.style.touchAction="auto"))}const cn=(e,t)=>{const r=yr(),{params:n,el:i,wrapperEl:s,device:a}=e,o=!!n.nested,l="on"===t?"addEventListener":"removeEventListener",u=t;i&&"string"!=typeof i&&(r[l]("touchstart",e.onDocumentTouchStart,{passive:!1,capture:o}),i[l]("touchstart",e.onTouchStart,{passive:!1}),i[l]("pointerdown",e.onTouchStart,{passive:!1}),r[l]("touchmove",e.onTouchMove,{passive:!1,capture:o}),r[l]("pointermove",e.onTouchMove,{passive:!1,capture:o}),r[l]("touchend",e.onTouchEnd,{passive:!0}),r[l]("pointerup",e.onTouchEnd,{passive:!0}),r[l]("pointercancel",e.onTouchEnd,{passive:!0}),r[l]("touchcancel",e.onTouchEnd,{passive:!0}),r[l]("pointerout",e.onTouchEnd,{passive:!0}),r[l]("pointerleave",e.onTouchEnd,{passive:!0}),r[l]("contextmenu",e.onTouchEnd,{passive:!0}),(n.preventClicks||n.preventClicksPropagation)&&i[l]("click",e.onClick,!0),n.cssMode&&s[l]("scroll",e.onScroll),n.updateOnWindowResize?e[u](a.ios||a.android?"resize orientationchange observerUpdate":"resize observerUpdate",sn,!0):e[u]("observerUpdate",sn,!0),i[l]("load",e.onLoad,{capture:!0}))};const dn=(e,t)=>e.grid&&t.grid&&t.grid.rows>1;var hn={setBreakpoint:function(){const e=this,{realIndex:t,initialized:r,params:n,el:i}=e,s=n.breakpoints;if(!s||s&&0===Object.keys(s).length)return;const a=e.getBreakpoint(s,e.params.breakpointsBase,e.el);if(!a||e.currentBreakpoint===a)return;const o=(a in s?s[a]:void 0)||e.originalParams,l=dn(e,n),u=dn(e,o),c=e.params.grabCursor,d=o.grabCursor,h=n.enabled;l&&!u?(i.classList.remove(`${n.containerModifierClass}grid`,`${n.containerModifierClass}grid-column`),e.emitContainerClasses()):!l&&u&&(i.classList.add(`${n.containerModifierClass}grid`),(o.grid.fill&&"column"===o.grid.fill||!o.grid.fill&&"column"===n.grid.fill)&&i.classList.add(`${n.containerModifierClass}grid-column`),e.emitContainerClasses()),c&&!d?e.unsetGrabCursor():!c&&d&&e.setGrabCursor(),["navigation","pagination","scrollbar"].forEach(t=>{if(void 0===o[t])return;const r=n[t]&&n[t].enabled,i=o[t]&&o[t].enabled;r&&!i&&e[t].disable(),!r&&i&&e[t].enable()});const f=o.direction&&o.direction!==n.direction,p=n.loop&&(o.slidesPerView!==n.slidesPerView||f),g=n.loop;f&&r&&e.changeDirection(),Ar(e.params,o);const m=e.params.enabled,v=e.params.loop;Object.assign(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),h&&!m?e.disable():!h&&m&&e.enable(),e.currentBreakpoint=a,e.emit("_beforeBreakpoint",o),r&&(p?(e.loopDestroy(),e.loopCreate(t),e.updateSlides()):!g&&v?(e.loopCreate(t),e.updateSlides()):g&&!v&&e.loopDestroy()),e.emit("breakpoint",o)},getBreakpoint:function(e,t,r){if(void 0===t&&(t="window"),!e||"container"===t&&!r)return;let n=!1;const i=wr(),s="window"===t?i.innerHeight:r.clientHeight,a=Object.keys(e).map(e=>{if("string"==typeof e&&0===e.indexOf("@")){const t=parseFloat(e.substr(1));return{value:s*t,point:e}}return{value:e,point:e}});a.sort((e,t)=>parseInt(e.value,10)-parseInt(t.value,10));for(let e=0;e<a.length;e+=1){const{point:s,value:o}=a[e];"window"===t?i.matchMedia(`(min-width: ${o}px)`).matches&&(n=s):o<=r.clientWidth&&(n=s)}return n||"max"}};var fn={init:!0,direction:"horizontal",oneWayMovement:!1,swiperElementNodeName:"SWIPER-CONTAINER",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function pn(e,t){return function(r){void 0===r&&(r={});const n=Object.keys(r)[0],i=r[n];"object"==typeof i&&null!==i?(!0===e[n]&&(e[n]={enabled:!0}),"navigation"===n&&e[n]&&e[n].enabled&&!e[n].prevEl&&!e[n].nextEl&&(e[n].auto=!0),["pagination","scrollbar"].indexOf(n)>=0&&e[n]&&e[n].enabled&&!e[n].el&&(e[n].auto=!0),n in e&&"enabled"in i?("object"!=typeof e[n]||"enabled"in e[n]||(e[n].enabled=!0),e[n]||(e[n]={enabled:!1}),Ar(t,r)):Ar(t,r)):Ar(t,r)}}const gn={eventsEmitter:jr,update:Yr,translate:qr,transition:Qr,slide:Zr,loop:Jr,grabCursor:{setGrabCursor:function(e){const t=this;if(!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)return;const r="container"===t.params.touchEventsTarget?t.el:t.wrapperEl;t.isElement&&(t.__preventObserver__=!0),r.style.cursor="move",r.style.cursor=e?"grabbing":"grab",t.isElement&&requestAnimationFrame(()=>{t.__preventObserver__=!1})},unsetGrabCursor:function(){const e=this;e.params.watchOverflow&&e.isLocked||e.params.cssMode||(e.isElement&&(e.__preventObserver__=!0),e["container"===e.params.touchEventsTarget?"el":"wrapperEl"].style.cursor="",e.isElement&&requestAnimationFrame(()=>{e.__preventObserver__=!1}))}},events:{attachEvents:function(){const e=this,{params:t}=e;e.onTouchStart=tn.bind(e),e.onTouchMove=rn.bind(e),e.onTouchEnd=nn.bind(e),e.onDocumentTouchStart=un.bind(e),t.cssMode&&(e.onScroll=on.bind(e)),e.onClick=an.bind(e),e.onLoad=ln.bind(e),cn(e,"on")},detachEvents:function(){cn(this,"off")}},breakpoints:hn,checkOverflow:{checkOverflow:function(){const e=this,{isLocked:t,params:r}=e,{slidesOffsetBefore:n}=r;if(n){const t=e.slides.length-1,r=e.slidesGrid[t]+e.slidesSizesGrid[t]+2*n;e.isLocked=e.size>r}else e.isLocked=1===e.snapGrid.length;!0===r.allowSlideNext&&(e.allowSlideNext=!e.isLocked),!0===r.allowSlidePrev&&(e.allowSlidePrev=!e.isLocked),t&&t!==e.isLocked&&(e.isEnd=!1),t!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock")}},classes:{addClasses:function(){const e=this,{classNames:t,params:r,rtl:n,el:i,device:s}=e,a=function(e,t){const r=[];return e.forEach(e=>{"object"==typeof e?Object.keys(e).forEach(n=>{e[n]&&r.push(t+n)}):"string"==typeof e&&r.push(t+e)}),r}(["initialized",r.direction,{"free-mode":e.params.freeMode&&r.freeMode.enabled},{autoheight:r.autoHeight},{rtl:n},{grid:r.grid&&r.grid.rows>1},{"grid-column":r.grid&&r.grid.rows>1&&"column"===r.grid.fill},{android:s.android},{ios:s.ios},{"css-mode":r.cssMode},{centered:r.cssMode&&r.centeredSlides},{"watch-progress":r.watchSlidesProgress}],r.containerModifierClass);t.push(...a),i.classList.add(...t),e.emitContainerClasses()},removeClasses:function(){const{el:e,classNames:t}=this;e&&"string"!=typeof e&&(e.classList.remove(...t),this.emitContainerClasses())}}},mn={};let vn=class e{constructor(){let t,r;for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];1===i.length&&i[0].constructor&&"Object"===Object.prototype.toString.call(i[0]).slice(8,-1)?r=i[0]:[t,r]=i,r||(r={}),r=Ar({},r),t&&!r.el&&(r.el=t);const a=yr();if(r.el&&"string"==typeof r.el&&a.querySelectorAll(r.el).length>1){const t=[];return a.querySelectorAll(r.el).forEach(n=>{const i=Ar({},r,{el:n});t.push(new e(i))}),t}const o=this;o.__swiper__=!0,o.support=Br(),o.device=Ur({userAgent:r.userAgent}),o.browser=zr(),o.eventsListeners={},o.eventsAnyListeners=[],o.modules=[...o.__modules__],r.modules&&Array.isArray(r.modules)&&o.modules.push(...r.modules);const l={};o.modules.forEach(e=>{e({params:r,swiper:o,extendParams:pn(r,l),on:o.on.bind(o),once:o.once.bind(o),off:o.off.bind(o),emit:o.emit.bind(o)})});const u=Ar({},fn,l);return o.params=Ar({},u,mn,r),o.originalParams=Ar({},o.params),o.passedParams=Ar({},r),o.params&&o.params.on&&Object.keys(o.params.on).forEach(e=>{o.on(e,o.params.on[e])}),o.params&&o.params.onAny&&o.onAny(o.params.onAny),Object.assign(o,{enabled:o.params.enabled,el:t,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:()=>"horizontal"===o.params.direction,isVertical:()=>"vertical"===o.params.direction,activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:o.params.allowSlideNext,allowSlidePrev:o.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:o.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:o.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),o.emit("_swiper"),o.params.init&&o.init(),o}getDirectionLabel(e){return this.isHorizontal()?e:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[e]}getSlideIndex(e){const{slidesEl:t,params:r}=this,n=Mr(Cr(t,`.${r.slideClass}, swiper-slide`)[0]);return Mr(e)-n}getSlideIndexByData(e){return this.getSlideIndex(this.slides.filter(t=>1*t.getAttribute("data-swiper-slide-index")===e)[0])}recalcSlides(){const{slidesEl:e,params:t}=this;this.slides=Cr(e,`.${t.slideClass}, swiper-slide`)}enable(){const e=this;e.enabled||(e.enabled=!0,e.params.grabCursor&&e.setGrabCursor(),e.emit("enable"))}disable(){const e=this;e.enabled&&(e.enabled=!1,e.params.grabCursor&&e.unsetGrabCursor(),e.emit("disable"))}setProgress(e,t){const r=this;e=Math.min(Math.max(e,0),1);const n=r.minTranslate(),i=(r.maxTranslate()-n)*e+n;r.translateTo(i,void 0===t?0:t),r.updateActiveIndex(),r.updateSlidesClasses()}emitContainerClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=e.el.className.split(" ").filter(t=>0===t.indexOf("swiper")||0===t.indexOf(e.params.containerModifierClass));e.emit("_containerClasses",t.join(" "))}getSlideClasses(e){const t=this;return t.destroyed?"":e.className.split(" ").filter(e=>0===e.indexOf("swiper-slide")||0===e.indexOf(t.params.slideClass)).join(" ")}emitSlidesClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=[];e.slides.forEach(r=>{const n=e.getSlideClasses(r);t.push({slideEl:r,classNames:n}),e.emit("_slideClass",r,n)}),e.emit("_slideClasses",t)}slidesPerViewDynamic(e,t){void 0===e&&(e="current"),void 0===t&&(t=!1);const{params:r,slides:n,slidesGrid:i,slidesSizesGrid:s,size:a,activeIndex:o}=this;let l=1;if("number"==typeof r.slidesPerView)return r.slidesPerView;if(r.centeredSlides){let e,t=n[o]?Math.ceil(n[o].swiperSlideSize):0;for(let r=o+1;r<n.length;r+=1)n[r]&&!e&&(t+=Math.ceil(n[r].swiperSlideSize),l+=1,t>a&&(e=!0));for(let r=o-1;r>=0;r-=1)n[r]&&!e&&(t+=n[r].swiperSlideSize,l+=1,t>a&&(e=!0))}else if("current"===e)for(let e=o+1;e<n.length;e+=1){(t?i[e]+s[e]-i[o]<a:i[e]-i[o]<a)&&(l+=1)}else for(let e=o-1;e>=0;e-=1){i[o]-i[e]<a&&(l+=1)}return l}update(){const e=this;if(!e||e.destroyed)return;const{snapGrid:t,params:r}=e;function n(){const t=e.rtlTranslate?-1*e.translate:e.translate,r=Math.min(Math.max(t,e.maxTranslate()),e.minTranslate());e.setTranslate(r),e.updateActiveIndex(),e.updateSlidesClasses()}let i;if(r.breakpoints&&e.setBreakpoint(),[...e.el.querySelectorAll('[loading="lazy"]')].forEach(t=>{t.complete&&Vr(e,t)}),e.updateSize(),e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),r.freeMode&&r.freeMode.enabled&&!r.cssMode)n(),r.autoHeight&&e.updateAutoHeight();else{if(("auto"===r.slidesPerView||r.slidesPerView>1)&&e.isEnd&&!r.centeredSlides){const t=e.virtual&&r.virtual.enabled?e.virtual.slides:e.slides;i=e.slideTo(t.length-1,0,!1,!0)}else i=e.slideTo(e.activeIndex,0,!1,!0);i||n()}r.watchOverflow&&t!==e.snapGrid&&e.checkOverflow(),e.emit("update")}changeDirection(e,t){void 0===t&&(t=!0);const r=this,n=r.params.direction;return e||(e="horizontal"===n?"vertical":"horizontal"),e===n||"horizontal"!==e&&"vertical"!==e||(r.el.classList.remove(`${r.params.containerModifierClass}${n}`),r.el.classList.add(`${r.params.containerModifierClass}${e}`),r.emitContainerClasses(),r.params.direction=e,r.slides.forEach(t=>{"vertical"===e?t.style.width="":t.style.height=""}),r.emit("changeDirection"),t&&r.update()),r}changeLanguageDirection(e){const t=this;t.rtl&&"rtl"===e||!t.rtl&&"ltr"===e||(t.rtl="rtl"===e,t.rtlTranslate="horizontal"===t.params.direction&&t.rtl,t.rtl?(t.el.classList.add(`${t.params.containerModifierClass}rtl`),t.el.dir="rtl"):(t.el.classList.remove(`${t.params.containerModifierClass}rtl`),t.el.dir="ltr"),t.update())}mount(e){const t=this;if(t.mounted)return!0;let r=e||t.params.el;if("string"==typeof r&&(r=document.querySelector(r)),!r)return!1;r.swiper=t,r.parentNode&&r.parentNode.host&&r.parentNode.host.nodeName===t.params.swiperElementNodeName.toUpperCase()&&(t.isElement=!0);const n=()=>`.${(t.params.wrapperClass||"").trim().split(" ").join(".")}`;let i=(()=>{if(r&&r.shadowRoot&&r.shadowRoot.querySelector){return r.shadowRoot.querySelector(n())}return Cr(r,n())[0]})();return!i&&t.params.createElements&&(i=Dr("div",t.params.wrapperClass),r.append(i),Cr(r,`.${t.params.slideClass}`).forEach(e=>{i.append(e)})),Object.assign(t,{el:r,wrapperEl:i,slidesEl:t.isElement&&!r.parentNode.host.slideSlots?r.parentNode.host:i,hostEl:t.isElement?r.parentNode.host:r,mounted:!0,rtl:"rtl"===r.dir.toLowerCase()||"rtl"===_r(r,"direction"),rtlTranslate:"horizontal"===t.params.direction&&("rtl"===r.dir.toLowerCase()||"rtl"===_r(r,"direction")),wrongRTL:"-webkit-box"===_r(i,"display")}),!0}init(e){const t=this;if(t.initialized)return t;if(!1===t.mount(e))return t;t.emit("beforeInit"),t.params.breakpoints&&t.setBreakpoint(),t.addClasses(),t.updateSize(),t.updateSlides(),t.params.watchOverflow&&t.checkOverflow(),t.params.grabCursor&&t.enabled&&t.setGrabCursor(),t.params.loop&&t.virtual&&t.params.virtual.enabled?t.slideTo(t.params.initialSlide+t.virtual.slidesBefore,0,t.params.runCallbacksOnInit,!1,!0):t.slideTo(t.params.initialSlide,0,t.params.runCallbacksOnInit,!1,!0),t.params.loop&&t.loopCreate(),t.attachEvents();const r=[...t.el.querySelectorAll('[loading="lazy"]')];return t.isElement&&r.push(...t.hostEl.querySelectorAll('[loading="lazy"]')),r.forEach(e=>{e.complete?Vr(t,e):e.addEventListener("load",e=>{Vr(t,e.target)})}),Kr(t),t.initialized=!0,Kr(t),t.emit("init"),t.emit("afterInit"),t}destroy(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0);const r=this,{params:n,el:i,wrapperEl:s,slides:a}=r;return void 0===r.params||r.destroyed||(r.emit("beforeDestroy"),r.initialized=!1,r.detachEvents(),n.loop&&r.loopDestroy(),t&&(r.removeClasses(),i&&"string"!=typeof i&&i.removeAttribute("style"),s&&s.removeAttribute("style"),a&&a.length&&a.forEach(e=>{e.classList.remove(n.slideVisibleClass,n.slideFullyVisibleClass,n.slideActiveClass,n.slideNextClass,n.slidePrevClass),e.removeAttribute("style"),e.removeAttribute("data-swiper-slide-index")})),r.emit("destroy"),Object.keys(r.eventsListeners).forEach(e=>{r.off(e)}),!1!==e&&(r.el&&"string"!=typeof r.el&&(r.el.swiper=null),function(e){const t=e;Object.keys(t).forEach(e=>{try{t[e]=null}catch(e){}try{delete t[e]}catch(e){}})}(r)),r.destroyed=!0),null}static extendDefaults(e){Ar(mn,e)}static get extendedDefaults(){return mn}static get defaults(){return fn}static installModule(t){e.prototype.__modules__||(e.prototype.__modules__=[]);const r=e.prototype.__modules__;"function"==typeof t&&r.indexOf(t)<0&&r.push(t)}static use(t){return Array.isArray(t)?(t.forEach(t=>e.installModule(t)),e):(e.installModule(t),e)}};Object.keys(gn).forEach(e=>{Object.keys(gn[e]).forEach(t=>{vn.prototype[t]=gn[e][t]})}),vn.use([function(e){let{swiper:t,on:r,emit:n}=e;const i=wr();let s=null,a=null;const o=()=>{t&&!t.destroyed&&t.initialized&&(n("beforeResize"),n("resize"))},l=()=>{t&&!t.destroyed&&t.initialized&&n("orientationchange")};r("init",()=>{t.params.resizeObserver&&void 0!==i.ResizeObserver?t&&!t.destroyed&&t.initialized&&(s=new ResizeObserver(e=>{a=i.requestAnimationFrame(()=>{const{width:r,height:n}=t;let i=r,s=n;e.forEach(e=>{let{contentBoxSize:r,contentRect:n,target:a}=e;a&&a!==t.el||(i=n?n.width:(r[0]||r).inlineSize,s=n?n.height:(r[0]||r).blockSize)}),i===r&&s===n||o()})}),s.observe(t.el)):(i.addEventListener("resize",o),i.addEventListener("orientationchange",l))}),r("destroy",()=>{a&&i.cancelAnimationFrame(a),s&&s.unobserve&&t.el&&(s.unobserve(t.el),s=null),i.removeEventListener("resize",o),i.removeEventListener("orientationchange",l)})},function(e){let{swiper:t,extendParams:r,on:n,emit:i}=e;const s=[],a=wr(),o=function(e,r){void 0===r&&(r={});const n=new(a.MutationObserver||a.WebkitMutationObserver)(e=>{if(t.__preventObserver__)return;if(1===e.length)return void i("observerUpdate",e[0]);const r=function(){i("observerUpdate",e[0])};a.requestAnimationFrame?a.requestAnimationFrame(r):a.setTimeout(r,0)});n.observe(e,{attributes:void 0===r.attributes||r.attributes,childList:t.isElement||(void 0===r.childList||r).childList,characterData:void 0===r.characterData||r.characterData}),s.push(n)};r({observer:!1,observeParents:!1,observeSlideChildren:!1}),n("init",()=>{if(t.params.observer){if(t.params.observeParents){const e=function(e){const t=[];let r=e.parentElement;for(;r;)t.push(r),r=r.parentElement;return t}(t.hostEl);for(let t=0;t<e.length;t+=1)o(e[t])}o(t.hostEl,{childList:t.params.observeSlideChildren}),o(t.wrapperEl,{attributes:!1})}}),n("destroy",()=>{s.forEach(e=>{e.disconnect()}),s.splice(0,s.length)})}]);const yn=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","swiperElementNodeName","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopAdditionalSlides","loopAddBlankSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideFullyVisibleClass","slideNextClass","slidePrevClass","slideBlankClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function bn(e){return"object"==typeof e&&null!==e&&e.constructor&&"Object"===Object.prototype.toString.call(e).slice(8,-1)&&!e.__swiper__}function wn(e,t){const r=["__proto__","constructor","prototype"];Object.keys(t).filter(e=>r.indexOf(e)<0).forEach(r=>{void 0===e[r]?e[r]=t[r]:bn(t[r])&&bn(e[r])&&Object.keys(t[r]).length>0?t[r].__swiper__?e[r]=t[r]:wn(e[r],t[r]):e[r]=t[r]})}function En(e){return void 0===e&&(e={}),e.navigation&&void 0===e.navigation.nextEl&&void 0===e.navigation.prevEl}function Sn(e){return void 0===e&&(e={}),e.pagination&&void 0===e.pagination.el}function Tn(e){return void 0===e&&(e={}),e.scrollbar&&void 0===e.scrollbar.el}function kn(e){void 0===e&&(e="");const t=e.split(" ").map(e=>e.trim()).filter(e=>!!e),r=[];return t.forEach(e=>{r.indexOf(e)<0&&r.push(e)}),r.join(" ")}function xn(e){return void 0===e&&(e=""),e?e.includes("swiper-wrapper")?e:`swiper-wrapper ${e}`:"swiper-wrapper"}function An(){return An=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},An.apply(this,arguments)}function Rn(e){return e.type&&e.type.displayName&&e.type.displayName.includes("SwiperSlide")}function Ln(e){const t=[];return g.Children.toArray(e).forEach(e=>{Rn(e)?t.push(e):e.props&&e.props.children&&Ln(e.props.children).forEach(e=>t.push(e))}),t}function In(e){const t=[],r={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return g.Children.toArray(e).forEach(e=>{if(Rn(e))t.push(e);else if(e.props&&e.props.slot&&r[e.props.slot])r[e.props.slot].push(e);else if(e.props&&e.props.children){const n=Ln(e.props.children);n.length>0?n.forEach(e=>t.push(e)):r["container-end"].push(e)}else r["container-end"].push(e)}),{slides:t,slots:r}}function Cn(e,t){return"undefined"==typeof window?p.useEffect(e,t):p.useLayoutEffect(e,t)}const Pn=p.createContext(null),Dn=p.createContext(null),_n=p.forwardRef(function(e,t){let{className:r,tag:n="div",wrapperTag:i="div",children:s,onSwiper:a,...o}=void 0===e?{}:e,l=!1;const[u,c]=p.useState("swiper"),[d,h]=p.useState(null),[f,m]=p.useState(!1),v=p.useRef(!1),y=p.useRef(null),b=p.useRef(null),w=p.useRef(null),E=p.useRef(null),S=p.useRef(null),T=p.useRef(null),k=p.useRef(null),x=p.useRef(null),{params:A,passedParams:R,rest:L,events:I}=function(e,t){void 0===e&&(e={}),void 0===t&&(t=!0);const r={on:{}},n={},i={};wn(r,fn),r._emitClasses=!0,r.init=!1;const s={},a=yn.map(e=>e.replace(/_/,"")),o=Object.assign({},e);return Object.keys(o).forEach(o=>{void 0!==e[o]&&(a.indexOf(o)>=0?bn(e[o])?(r[o]={},i[o]={},wn(r[o],e[o]),wn(i[o],e[o])):(r[o]=e[o],i[o]=e[o]):0===o.search(/on[A-Z]/)&&"function"==typeof e[o]?t?n[`${o[2].toLowerCase()}${o.substr(3)}`]=e[o]:r.on[`${o[2].toLowerCase()}${o.substr(3)}`]=e[o]:s[o]=e[o])}),["navigation","pagination","scrollbar"].forEach(e=>{!0===r[e]&&(r[e]={}),!1===r[e]&&delete r[e]}),{params:r,passedParams:i,rest:s,events:n}}(o),{slides:C,slots:P}=In(s),D=()=>{m(!f)};Object.assign(A.on,{_containerClasses(e,t){c(t)}});const _=()=>{Object.assign(A.on,I),l=!0;const e={...A};if(delete e.wrapperClass,b.current=new vn(e),b.current.virtual&&b.current.params.virtual.enabled){b.current.virtual.slides=C;const e={cache:!1,slides:C,renderExternal:h,renderExternalUpdate:!1};wn(b.current.params.virtual,e),wn(b.current.originalParams.virtual,e)}};y.current||_(),b.current&&b.current.on("_beforeBreakpoint",D);return p.useEffect(()=>()=>{b.current&&b.current.off("_beforeBreakpoint",D)}),p.useEffect(()=>{!v.current&&b.current&&(b.current.emitSlidesClasses(),v.current=!0)}),Cn(()=>{if(t&&(t.current=y.current),y.current)return b.current.destroyed&&_(),function(e,t){let{el:r,nextEl:n,prevEl:i,paginationEl:s,scrollbarEl:a,swiper:o}=e;En(t)&&n&&i&&(o.params.navigation.nextEl=n,o.originalParams.navigation.nextEl=n,o.params.navigation.prevEl=i,o.originalParams.navigation.prevEl=i),Sn(t)&&s&&(o.params.pagination.el=s,o.originalParams.pagination.el=s),Tn(t)&&a&&(o.params.scrollbar.el=a,o.originalParams.scrollbar.el=a),o.init(r)}({el:y.current,nextEl:S.current,prevEl:T.current,paginationEl:k.current,scrollbarEl:x.current,swiper:b.current},A),a&&!b.current.destroyed&&a(b.current),()=>{b.current&&!b.current.destroyed&&b.current.destroy(!0,!1)}},[]),Cn(()=>{!l&&I&&b.current&&Object.keys(I).forEach(e=>{b.current.on(e,I[e])});const e=function(e,t,r,n,i){const s=[];if(!t)return s;const a=e=>{s.indexOf(e)<0&&s.push(e)};if(r&&n){const e=n.map(i),t=r.map(i);e.join("")!==t.join("")&&a("children"),n.length!==r.length&&a("children")}return yn.filter(e=>"_"===e[0]).map(e=>e.replace(/_/,"")).forEach(r=>{if(r in e&&r in t)if(bn(e[r])&&bn(t[r])){const n=Object.keys(e[r]),i=Object.keys(t[r]);n.length!==i.length?a(r):(n.forEach(n=>{e[r][n]!==t[r][n]&&a(r)}),i.forEach(n=>{e[r][n]!==t[r][n]&&a(r)}))}else e[r]!==t[r]&&a(r)}),s}(R,w.current,C,E.current,e=>e.key);return w.current=R,E.current=C,e.length&&b.current&&!b.current.destroyed&&function(e){let{swiper:t,slides:r,passedParams:n,changedParams:i,nextEl:s,prevEl:a,scrollbarEl:o,paginationEl:l}=e;const u=i.filter(e=>"children"!==e&&"direction"!==e&&"wrapperClass"!==e),{params:c,pagination:d,navigation:h,scrollbar:f,virtual:p,thumbs:g}=t;let m,v,y,b,w,E,S,T;i.includes("thumbs")&&n.thumbs&&n.thumbs.swiper&&!n.thumbs.swiper.destroyed&&c.thumbs&&(!c.thumbs.swiper||c.thumbs.swiper.destroyed)&&(m=!0),i.includes("controller")&&n.controller&&n.controller.control&&c.controller&&!c.controller.control&&(v=!0),i.includes("pagination")&&n.pagination&&(n.pagination.el||l)&&(c.pagination||!1===c.pagination)&&d&&!d.el&&(y=!0),i.includes("scrollbar")&&n.scrollbar&&(n.scrollbar.el||o)&&(c.scrollbar||!1===c.scrollbar)&&f&&!f.el&&(b=!0),i.includes("navigation")&&n.navigation&&(n.navigation.prevEl||a)&&(n.navigation.nextEl||s)&&(c.navigation||!1===c.navigation)&&h&&!h.prevEl&&!h.nextEl&&(w=!0);const k=e=>{t[e]&&(t[e].destroy(),"navigation"===e?(t.isElement&&(t[e].prevEl.remove(),t[e].nextEl.remove()),c[e].prevEl=void 0,c[e].nextEl=void 0,t[e].prevEl=void 0,t[e].nextEl=void 0):(t.isElement&&t[e].el.remove(),c[e].el=void 0,t[e].el=void 0))};i.includes("loop")&&t.isElement&&(c.loop&&!n.loop?E=!0:!c.loop&&n.loop?S=!0:T=!0),u.forEach(e=>{if(bn(c[e])&&bn(n[e]))Object.assign(c[e],n[e]),"navigation"!==e&&"pagination"!==e&&"scrollbar"!==e||!("enabled"in n[e])||n[e].enabled||k(e);else{const t=n[e];!0!==t&&!1!==t||"navigation"!==e&&"pagination"!==e&&"scrollbar"!==e?c[e]=n[e]:!1===t&&k(e)}}),u.includes("controller")&&!v&&t.controller&&t.controller.control&&c.controller&&c.controller.control&&(t.controller.control=c.controller.control),i.includes("children")&&r&&p&&c.virtual.enabled?(p.slides=r,p.update(!0)):i.includes("virtual")&&p&&c.virtual.enabled&&(r&&(p.slides=r),p.update(!0)),i.includes("children")&&r&&c.loop&&(T=!0),m&&g.init()&&g.update(!0);v&&(t.controller.control=c.controller.control),y&&(!t.isElement||l&&"string"!=typeof l||(l=document.createElement("div"),l.classList.add("swiper-pagination"),l.part.add("pagination"),t.el.appendChild(l)),l&&(c.pagination.el=l),d.init(),d.render(),d.update()),b&&(!t.isElement||o&&"string"!=typeof o||(o=document.createElement("div"),o.classList.add("swiper-scrollbar"),o.part.add("scrollbar"),t.el.appendChild(o)),o&&(c.scrollbar.el=o),f.init(),f.updateSize(),f.setTranslate()),w&&(t.isElement&&(s&&"string"!=typeof s||(s=document.createElement("div"),s.classList.add("swiper-button-next"),s.innerHTML=t.hostEl.constructor.nextButtonSvg,s.part.add("button-next"),t.el.appendChild(s)),a&&"string"!=typeof a||(a=document.createElement("div"),a.classList.add("swiper-button-prev"),a.innerHTML=t.hostEl.constructor.prevButtonSvg,a.part.add("button-prev"),t.el.appendChild(a))),s&&(c.navigation.nextEl=s),a&&(c.navigation.prevEl=a),h.init(),h.update()),i.includes("allowSlideNext")&&(t.allowSlideNext=n.allowSlideNext),i.includes("allowSlidePrev")&&(t.allowSlidePrev=n.allowSlidePrev),i.includes("direction")&&t.changeDirection(n.direction,!1),(E||T)&&t.loopDestroy(),(S||T)&&t.loopCreate(),t.update()}({swiper:b.current,slides:C,passedParams:R,changedParams:e,nextEl:S.current,prevEl:T.current,scrollbarEl:x.current,paginationEl:k.current}),()=>{I&&b.current&&Object.keys(I).forEach(e=>{b.current.off(e,I[e])})}}),Cn(()=>{var e;!(e=b.current)||e.destroyed||!e.params.virtual||e.params.virtual&&!e.params.virtual.enabled||(e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),e.parallax&&e.params.parallax&&e.params.parallax.enabled&&e.parallax.setTranslate())},[d]),g.createElement(n,An({ref:y,className:kn(`${u}${r?` ${r}`:""}`)},L),g.createElement(Dn.Provider,{value:b.current},P["container-start"],g.createElement(i,{className:xn(A.wrapperClass)},P["wrapper-start"],A.virtual?function(e,t,r){if(!r)return null;const n=e=>{let r=e;return e<0?r=t.length+e:r>=t.length&&(r-=t.length),r},i=e.isHorizontal()?{[e.rtlTranslate?"right":"left"]:`${r.offset}px`}:{top:`${r.offset}px`},{from:s,to:a}=r,o=e.params.loop?-t.length:0,l=e.params.loop?2*t.length:t.length,u=[];for(let e=o;e<l;e+=1)e>=s&&e<=a&&u.push(t[n(e)]);return u.map((t,r)=>g.cloneElement(t,{swiper:e,style:i,key:t.props.virtualIndex||t.key||`slide-${r}`}))}(b.current,C,d):C.map((e,t)=>g.cloneElement(e,{swiper:b.current,swiperSlideIndex:t})),P["wrapper-end"]),En(A)&&g.createElement(g.Fragment,null,g.createElement("div",{ref:T,className:"swiper-button-prev"}),g.createElement("div",{ref:S,className:"swiper-button-next"})),Tn(A)&&g.createElement("div",{ref:x,className:"swiper-scrollbar"}),Sn(A)&&g.createElement("div",{ref:k,className:"swiper-pagination"}),P["container-end"]))});_n.displayName="Swiper";const Mn=p.forwardRef(function(e,t){let{tag:r="div",children:n,className:i="",swiper:s,zoom:a,lazy:o,virtualIndex:l,swiperSlideIndex:u,...c}=void 0===e?{}:e;const d=p.useRef(null),[h,f]=p.useState("swiper-slide"),[m,v]=p.useState(!1);function y(e,t,r){t===d.current&&f(r)}Cn(()=>{if(void 0!==u&&(d.current.swiperSlideIndex=u),t&&(t.current=d.current),d.current&&s){if(!s.destroyed)return s.on("_slideClass",y),()=>{s&&s.off("_slideClass",y)};"swiper-slide"!==h&&f("swiper-slide")}}),Cn(()=>{s&&d.current&&!s.destroyed&&f(s.getSlideClasses(d.current))},[s]);const b={isActive:h.indexOf("swiper-slide-active")>=0,isVisible:h.indexOf("swiper-slide-visible")>=0,isPrev:h.indexOf("swiper-slide-prev")>=0,isNext:h.indexOf("swiper-slide-next")>=0},w=()=>"function"==typeof n?n(b):n;return g.createElement(r,An({ref:d,className:kn(`${h}${i?` ${i}`:""}`),"data-swiper-slide-index":l,onLoad:()=>{v(!0)}},c),a&&g.createElement(Pn.Provider,{value:b},g.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":"number"==typeof a?a:void 0},w(),o&&!m&&g.createElement("div",{className:"swiper-lazy-preloader"}))),!a&&g.createElement(Pn.Provider,{value:b},w(),o&&!m&&g.createElement("div",{className:"swiper-lazy-preloader"})))});function On(){const[e,t]=p.useState({width:window.innerWidth,height:window.innerHeight});return p.useEffect(()=>{const e=()=>t({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}Mn.displayName="SwiperSlide";let Nn=null,Fn="";var $n,Bn,Un={},zn={exports:{}},jn=zn.exports;function Gn(){return $n||($n=1,e=zn,t=zn.exports,function(r,n){var i="function",s="undefined",a="object",o="string",l="major",u="model",c="name",d="type",h="vendor",f="version",p="architecture",g="console",m="mobile",v="tablet",y="smarttv",b="wearable",w="embedded",E="Amazon",S="Apple",T="ASUS",k="BlackBerry",x="Browser",A="Chrome",R="Firefox",L="Google",I="Huawei",C="LG",P="Microsoft",D="Motorola",_="Opera",M="Samsung",O="Sharp",N="Sony",F="Xiaomi",$="Zebra",B="Facebook",U="Chromium OS",z="Mac OS",j=" Browser",G=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},H=function(e,t){return typeof e===o&&-1!==V(t).indexOf(V(e))},V=function(e){return e.toLowerCase()},W=function(e,t){if(typeof e===o)return e=e.replace(/^\s\s*/,""),typeof t===s?e:e.substring(0,500)},K=function(e,t){for(var r,s,o,l,u,c,d=0;d<t.length&&!u;){var h=t[d],f=t[d+1];for(r=s=0;r<h.length&&!u&&h[r];)if(u=h[r++].exec(e))for(o=0;o<f.length;o++)c=u[++s],typeof(l=f[o])===a&&l.length>0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):n:this[l[0]]=c?l[1].call(this,c,l[2]):n:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):n):this[l]=c||n;d+=2}},Y=function(e,t){for(var r in t)if(typeof t[r]===a&&t[r].length>0){for(var i=0;i<t[r].length;i++)if(H(t[r][i],e))return"?"===r?n:r}else if(H(t[r],e))return"?"===r?n:r;return t.hasOwnProperty("*")?t["*"]:e},q={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},X={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,f],[/opios[\/ ]+([\w\.]+)/i],[f,[c,_+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[f,[c,_+" GX"]],[/\bopr\/([\w\.]+)/i],[f,[c,_]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[f,[c,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[f,[c,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[c,f],[/quark(?:pc)?\/([-\w\.]+)/i],[f,[c,"Quark"]],[/\bddg\/([\w\.]+)/i],[f,[c,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[c,"UC"+x]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[f,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[c,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[f,[c,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[f,[c,"Smart Lenovo "+x]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+x],f],[/\bfocus\/([\w\.]+)/i],[f,[c,R+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[c,_+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[c,_+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[c,"MIUI"+j]],[/fxios\/([\w\.-]+)/i],[f,[c,R]],[/\bqihoobrowser\/?([\w\.]*)/i],[f,[c,"360"]],[/\b(qq)\/([\w\.]+)/i],[[c,/(.+)/,"$1Browser"],f],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1"+j],f],[/samsungbrowser\/([\w\.]+)/i],[f,[c,M+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[f,[c,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[c,"Sogou Mobile"],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[c,f],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[c],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[f,c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,B],f],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[c,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[c,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[f,[c,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[c,A+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,A+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[c,"Android "+x]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[f,Y,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],f],[/(wolvic|librewolf)\/([\w\.]+)/i],[c,f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[c,R+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[c,[f,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[c,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[p,"amd64"]],[/(ia32(?=;))/i],[[p,V]],[/((?:i[346]|x)86)[;\)]/i],[[p,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[p,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[p,"armhf"]],[/windows (ce|mobile); ppc;/i],[[p,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[p,/ower/,"",V]],[/(sun4\w)[;\)]/i],[[p,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[p,V]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[h,M],[d,v]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[u,[h,M],[d,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[h,S],[d,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[h,S],[d,v]],[/(macintosh);/i],[u,[h,S]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[h,O],[d,m]],[/(?:honor)([-\w ]+)[;\)]/i],[u,[h,"Honor"],[d,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[h,I],[d,v]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[h,I],[d,m]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[u,/_/g," "],[h,F],[d,m]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[h,F],[d,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[h,"OPPO"],[d,m]],[/\b(opd2\d{3}a?) bui/i],[u,[h,"OPPO"],[d,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[h,"Vivo"],[d,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[u,[h,"Realme"],[d,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[h,D],[d,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[h,D],[d,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[h,C],[d,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[h,C],[d,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[h,"Lenovo"],[d,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[h,"Nokia"],[d,m]],[/(pixel c)\b/i],[u,[h,L],[d,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[h,L],[d,m]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[h,N],[d,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[h,N],[d,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[h,"OnePlus"],[d,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[h,E],[d,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[h,E],[d,m]],[/(playbook);[-\w\),; ]+(rim)/i],[u,h,[d,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[h,k],[d,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[h,T],[d,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[h,T],[d,m]],[/(nexus 9)/i],[u,[h,"HTC"],[d,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[u,/_/g," "],[d,m]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[u,[h,"TCL"],[d,v]],[/(itel) ((\w+))/i],[[h,V],u,[d,Y,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[h,"Acer"],[d,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[h,"Meizu"],[d,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[u,[h,"Ulefone"],[d,m]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[u,[h,"Energizer"],[d,m]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[u,[h,"Cat"],[d,m]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[u,[h,"Smartfren"],[d,m]],[/droid.+; (a(?:015|06[35]|142p?))/i],[u,[h,"Nothing"],[d,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,u,[d,m]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,u,[d,v]],[/(surface duo)/i],[u,[h,P],[d,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[h,"Fairphone"],[d,m]],[/(u304aa)/i],[u,[h,"AT&T"],[d,m]],[/\bsie-(\w*)/i],[u,[h,"Siemens"],[d,m]],[/\b(rct\w+) b/i],[u,[h,"RCA"],[d,v]],[/\b(venue[\d ]{2,7}) b/i],[u,[h,"Dell"],[d,v]],[/\b(q(?:mv|ta)\w+) b/i],[u,[h,"Verizon"],[d,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[h,"Barnes & Noble"],[d,v]],[/\b(tm\d{3}\w+) b/i],[u,[h,"NuVision"],[d,v]],[/\b(k88) b/i],[u,[h,"ZTE"],[d,v]],[/\b(nx\d{3}j) b/i],[u,[h,"ZTE"],[d,m]],[/\b(gen\d{3}) b.+49h/i],[u,[h,"Swiss"],[d,m]],[/\b(zur\d{3}) b/i],[u,[h,"Swiss"],[d,v]],[/\b((zeki)?tb.*\b) b/i],[u,[h,"Zeki"],[d,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],u,[d,v]],[/\b(ns-?\w{0,9}) b/i],[u,[h,"Insignia"],[d,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[h,"NextBook"],[d,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],u,[d,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],u,[d,m]],[/\b(ph-1) /i],[u,[h,"Essential"],[d,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[h,"Envizen"],[d,v]],[/\b(trio[-\w\. ]+) b/i],[u,[h,"MachSpeed"],[d,v]],[/\btu_(1491) b/i],[u,[h,"Rotor"],[d,v]],[/(shield[\w ]+) b/i],[u,[h,"Nvidia"],[d,v]],[/(sprint) (\w+)/i],[h,u,[d,m]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[h,P],[d,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[h,$],[d,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[h,$],[d,m]],[/smart-tv.+(samsung)/i],[h,[d,y]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[h,M],[d,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,C],[d,y]],[/(apple) ?tv/i],[h,[u,S+" TV"],[d,y]],[/crkey/i],[[u,A+"cast"],[h,L],[d,y]],[/droid.+aft(\w+)( bui|\))/i],[u,[h,E],[d,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[h,O],[d,y]],[/(bravia[\w ]+)( bui|\))/i],[u,[h,N],[d,y]],[/(mitv-\w{5}) bui/i],[u,[h,F],[d,y]],[/Hbbtv.*(technisat) (.*);/i],[h,u,[d,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,W],[u,W],[d,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,u,[d,g]],[/droid.+; (shield) bui/i],[u,[h,"Nvidia"],[d,g]],[/(playstation [345portablevi]+)/i],[u,[h,N],[d,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[h,P],[d,g]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[u,[h,M],[d,b]],[/((pebble))app/i],[h,u,[d,b]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[h,S],[d,b]],[/droid.+; (glass) \d/i],[u,[h,L],[d,b]],[/droid.+; (wt63?0{2,3})\)/i],[u,[h,$],[d,b]],[/droid.+; (glass) \d/i],[u,[h,L],[d,b]],[/(pico) (4|neo3(?: link|pro)?)/i],[h,u,[d,b]],[/; (quest( \d| pro)?)/i],[u,[h,B],[d,b]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[d,w]],[/(aeobc)\b/i],[u,[h,E],[d,w]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[u,[d,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[d,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,v]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,m]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[c,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[c,f],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[c,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,f],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[c,[f,Y,q]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[f,Y,q],[c,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,z],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,f],[/\(bb(10);/i],[f,[c,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[c,R+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[c,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[f,[c,"watchOS"]],[/crkey\/([\d\.]+)/i],[f,[c,A+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[c,U],f],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,f],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[c,f]]},Q=function(e,t){if(typeof e===a&&(t=e,e=n),!(this instanceof Q))return new Q(e,t).getResult();var g=typeof r!==s&&r.navigator?r.navigator:n,y=e||(g&&g.userAgent?g.userAgent:""),b=g&&g.userAgentData?g.userAgentData:n,w=t?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(X,t):X,E=g&&g.userAgent==y;return this.getBrowser=function(){var e={};return e[c]=n,e[f]=n,K.call(e,y,w.browser),e[l]=function(e){return typeof e===o?e.replace(/[^\d\.]/g,"").split(".")[0]:n}(e[f]),E&&g&&g.brave&&typeof g.brave.isBrave==i&&(e[c]="Brave"),e},this.getCPU=function(){var e={};return e[p]=n,K.call(e,y,w.cpu),e},this.getDevice=function(){var e={};return e[h]=n,e[u]=n,e[d]=n,K.call(e,y,w.device),E&&!e[d]&&b&&b.mobile&&(e[d]=m),E&&"Macintosh"==e[u]&&g&&typeof g.standalone!==s&&g.maxTouchPoints&&g.maxTouchPoints>2&&(e[u]="iPad",e[d]=v),e},this.getEngine=function(){var e={};return e[c]=n,e[f]=n,K.call(e,y,w.engine),e},this.getOS=function(){var e={};return e[c]=n,e[f]=n,K.call(e,y,w.os),E&&!e[c]&&b&&b.platform&&"Unknown"!=b.platform&&(e[c]=b.platform.replace(/chrome os/i,U).replace(/macos/i,z)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return y},this.setUA=function(e){return y=typeof e===o&&e.length>500?W(e,500):e,this},this.setUA(y),this};Q.VERSION="1.0.40",Q.BROWSER=G([c,f,l]),Q.CPU=G([p]),Q.DEVICE=G([u,h,d,g,m,y,v,b,w]),Q.ENGINE=Q.OS=G([c,f]),e.exports&&(t=e.exports=Q),t.UAParser=Q;var Z=typeof r!==s&&(r.jQuery||r.Zepto);if(Z&&!Z.ua){var J=new Q;Z.ua=J.getResult(),Z.ua.get=function(){return J.getUA()},Z.ua.set=function(e){J.setUA(e);var t=J.getResult();for(var r in t)Z.ua[r]=t[r]}}}("object"==typeof window?window:jn)),zn.exports;var e,t}var Hn=function(){if(Bn)return Un;Bn=1,Object.defineProperty(Un,"__esModule",{value:!0});var e,t=l(),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,n=Gn(),i=new n,s=i.getBrowser(),a=i.getCPU(),o=i.getDevice(),u=i.getEngine(),c=i.getOS(),d=i.getUA(),h=function(e){return i.setUA(e)},f=function(e){if(e){var t=new n(e);return{UA:t,browser:t.getBrowser(),cpu:t.getCPU(),device:t.getDevice(),engine:t.getEngine(),os:t.getOS(),ua:t.getUA(),setUserAgent:function(e){return t.setUA(e)}}}console.error("No userAgent string was provided")},p=Object.freeze({ClientUAInstance:i,browser:s,cpu:a,device:o,engine:u,os:c,ua:d,setUa:h,parseUserAgent:f});function g(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){return m="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},m(e)}function v(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(){return b=Object.assign||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},b.apply(this,arguments)}function w(e){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},w(e)}function E(e,t){return E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},E(e,t)}function S(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function T(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k(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)return;var n,i,s=[],a=!0,o=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(s.push(n.value),!t||s.length!==t);a=!0);}catch(e){o=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(o)throw i}}return s}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return x(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return x(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var A="mobile",R="tablet",L="smarttv",I="console",C="wearable",P="embedded",D=void 0,_={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",EdgeChromium:"Edge Chromium",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},M={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},O={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},N=function(e){return e||(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none")},F=function(){return!("undefined"==typeof window||!window.navigator&&!navigator)&&(window.navigator||navigator)},$=function(e){var t=F();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)},B=function(e,t,r,n){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach(function(t){y(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},e,{vendor:N(t.vendor),model:N(t.model),os:N(r.name),osVersion:N(r.version),ua:N(n)})},U=function(e){return e.type===A},z=function(e){return e.type===R},j=function(e){var t=e.type;return t===A||t===R},G=function(e){return e.type===L},H=function(e){return e.type===D},V=function(e){return e.type===C},W=function(e){return e.type===I},K=function(e){return e.type===P},Y=function(e){var t=e.vendor;return N(t)},q=function(e){var t=e.model;return N(t)},X=function(e){var t=e.type;return N(t,"browser")},Q=function(e){return e.name===M.Android},Z=function(e){return e.name===M.Windows},J=function(e){return e.name===M.MAC_OS},ee=function(e){return e.name===M.WindowsPhone},te=function(e){return e.name===M.IOS},re=function(e){var t=e.version;return N(t)},ne=function(e){var t=e.name;return N(t)},ie=function(e){return e.name===_.Chrome},se=function(e){return e.name===_.Firefox},ae=function(e){return e.name===_.Chromium},oe=function(e){return e.name===_.Edge},le=function(e){return e.name===_.Yandex},ue=function(e){var t=e.name;return t===_.Safari||t===_.MobileSafari},ce=function(e){return e.name===_.MobileSafari},de=function(e){return e.name===_.Opera},he=function(e){var t=e.name;return t===_.InternetExplorer||t===_.Ie},fe=function(e){return e.name===_.MIUI},pe=function(e){return e.name===_.SamsungBrowser},ge=function(e){var t=e.version;return N(t)},me=function(e){var t=e.major;return N(t)},ve=function(e){var t=e.name;return N(t)},ye=function(e){var t=e.name;return N(t)},be=function(e){var t=e.version;return N(t)},we=function(){var e=F(),t=e&&e.userAgent&&e.userAgent.toLowerCase();return"string"==typeof t&&/electron/.test(t)},Ee=function(e){return"string"==typeof e&&-1!==e.indexOf("Edg/")},Se=function(){var e=F();return e&&(/iPad|iPhone|iPod/.test(e.platform)||"MacIntel"===e.platform&&e.maxTouchPoints>1)&&!window.MSStream},Te=function(){return $("iPad")},ke=function(){return $("iPhone")},xe=function(){return $("iPod")},Ae=function(e){return N(e)};function Re(e){var t=e||p,r=t.device,n=t.browser,i=t.os,s=t.engine,a=t.ua;return{isSmartTV:G(r),isConsole:W(r),isWearable:V(r),isEmbedded:K(r),isMobileSafari:ce(n)||Te(),isChromium:ae(n),isMobile:j(r)||Te(),isMobileOnly:U(r),isTablet:z(r)||Te(),isBrowser:H(r),isDesktop:H(r),isAndroid:Q(i),isWinPhone:ee(i),isIOS:te(i)||Te(),isChrome:ie(n),isFirefox:se(n),isSafari:ue(n),isOpera:de(n),isIE:he(n),osVersion:re(i),osName:ne(i),fullBrowserVersion:ge(n),browserVersion:me(n),browserName:ve(n),mobileVendor:Y(r),mobileModel:q(r),engineName:ye(s),engineVersion:be(s),getUA:Ae(a),isEdge:oe(n)||Ee(a),isYandex:le(n),deviceType:X(r),isIOS13:Se(),isIPad13:Te(),isIPhone13:ke(),isIPod13:xe(),isElectron:we(),isEdgeChromium:Ee(a),isLegacyEdge:oe(n)&&!Ee(a),isWindows:Z(i),isMacOs:J(i),isMIUI:fe(n),isSamsungBrowser:pe(n)}}var Le=G(o),Ie=W(o),Ce=V(o),Pe=K(o),De=ce(s)||Te(),_e=ae(s),Me=j(o)||Te(),Oe=U(o),Ne=z(o)||Te(),Fe=H(o),$e=H(o),Be=Q(c),Ue=ee(c),ze=te(c)||Te(),je=ie(s),Ge=se(s),He=ue(s),Ve=de(s),We=he(s),Ke=re(c),Ye=ne(c),qe=ge(s),Xe=me(s),Qe=ve(s),Ze=Y(o),Je=q(o),et=ye(u),tt=be(u),rt=Ae(d),nt=oe(s)||Ee(d),it=le(s),st=X(o),at=Se(),ot=Te(),lt=ke(),ut=xe(),ct=we(),dt=Ee(d),ht=oe(s)&&!Ee(d),ft=Z(c),pt=J(c),gt=fe(s),mt=pe(s);function vt(e){var t=e||window.navigator.userAgent;return f(t)}return Un.AndroidView=function(e){var n=e.renderWithFragment,i=e.children,s=S(e,["renderWithFragment","children"]);return Be?n?r.createElement(t.Fragment,null,i):r.createElement("div",s,i):null},Un.BrowserTypes=_,Un.BrowserView=function(e){var n=e.renderWithFragment,i=e.children,s=S(e,["renderWithFragment","children"]);return Fe?n?r.createElement(t.Fragment,null,i):r.createElement("div",s,i):null},Un.ConsoleView=function(e){var n=e.renderWithFragment,i=e.children,s=S(e,["renderWithFragment","children"]);return Ie?n?r.createElement(t.Fragment,null,i):r.createElement("div",s,i):null},Un.CustomView=function(e){var n=e.renderWithFragment,i=e.children;e.viewClassName,e.style;var s=e.condition,a=S(e,["renderWithFragment","children","viewClassName","style","condition"]);return s?n?r.createElement(t.Fragment,null,i):r.createElement("div",a,i):null},Un.IEView=function(e){var n=e.renderWithFragment,i=e.children,s=S(e,["renderWithFragment","children"]);return We?n?r.createElement(t.Fragment,null,i):r.createElement("div",s,i):null},Un.IOSView=function(e){var n=e.renderWithFragment,i=e.children,s=S(e,["renderWithFragment","children"]);return ze?n?r.createElement(t.Fragment,null,i):r.createElement("div",s,i):null},Un.MobileOnlyView=function(e){var n=e.renderWithFragment,i=e.children;e.viewClassName,e.style;var s=S(e,["renderWithFragment","children","viewClassName","style"]);return Oe?n?r.createElement(t.Fragment,null,i):r.createElement("div",s,i):null},Un.MobileView=function(e){var n=e.renderWithFragment,i=e.children,s=S(e,["renderWithFragment","children"]);return Me?n?r.createElement(t.Fragment,null,i):r.createElement("div",s,i):null},Un.OsTypes=M,Un.SmartTVView=function(e){var n=e.renderWithFragment,i=e.children,s=S(e,["renderWithFragment","children"]);return Le?n?r.createElement(t.Fragment,null,i):r.createElement("div",s,i):null},Un.TabletView=function(e){var n=e.renderWithFragment,i=e.children,s=S(e,["renderWithFragment","children"]);return Ne?n?r.createElement(t.Fragment,null,i):r.createElement("div",s,i):null},Un.WearableView=function(e){var n=e.renderWithFragment,i=e.children,s=S(e,["renderWithFragment","children"]);return Ce?n?r.createElement(t.Fragment,null,i):r.createElement("div",s,i):null},Un.WinPhoneView=function(e){var n=e.renderWithFragment,i=e.children,s=S(e,["renderWithFragment","children"]);return Ue?n?r.createElement(t.Fragment,null,i):r.createElement("div",s,i):null},Un.browserName=Qe,Un.browserVersion=Xe,Un.deviceDetect=function(e){var t=e?f(e):p,r=t.device,n=t.browser,i=t.engine,s=t.os,a=t.ua,o=function(e){switch(e){case A:return{isMobile:!0};case R:return{isTablet:!0};case L:return{isSmartTV:!0};case I:return{isConsole:!0};case C:return{isWearable:!0};case D:return{isBrowser:!0};case P:return{isEmbedded:!0};default:return O}}(r.type),l=o.isBrowser,u=o.isMobile,c=o.isTablet,d=o.isSmartTV,h=o.isConsole,g=o.isWearable,m=o.isEmbedded;return l?function(e,t,r,n,i){return{isBrowser:e,browserMajorVersion:N(t.major),browserFullVersion:N(t.version),browserName:N(t.name),engineName:N(r.name),engineVersion:N(r.version),osName:N(n.name),osVersion:N(n.version),userAgent:N(i)}}(l,n,i,s,a):d?function(e,t,r,n){return{isSmartTV:e,engineName:N(t.name),engineVersion:N(t.version),osName:N(r.name),osVersion:N(r.version),userAgent:N(n)}}(d,i,s,a):h?function(e,t,r,n){return{isConsole:e,engineName:N(t.name),engineVersion:N(t.version),osName:N(r.name),osVersion:N(r.version),userAgent:N(n)}}(h,i,s,a):u||c?B(o,r,s,a):g?function(e,t,r,n){return{isWearable:e,engineName:N(t.name),engineVersion:N(t.version),osName:N(r.name),osVersion:N(r.version),userAgent:N(n)}}(g,i,s,a):m?function(e,t,r,n,i){return{isEmbedded:e,vendor:N(t.vendor),model:N(t.model),engineName:N(r.name),engineVersion:N(r.version),osName:N(n.name),osVersion:N(n.version),userAgent:N(i)}}(m,r,i,s,a):void 0},Un.deviceType=st,Un.engineName=et,Un.engineVersion=tt,Un.fullBrowserVersion=qe,Un.getSelectorsByUserAgent=function(e){if(e&&"string"==typeof e){var t=f(e);return Re({device:t.device,browser:t.browser,os:t.os,engine:t.engine,ua:t.ua})}console.error("No valid user agent string was provided")},Un.getUA=rt,Un.isAndroid=Be,Un.isBrowser=Fe,Un.isChrome=je,Un.isChromium=_e,Un.isConsole=Ie,Un.isDesktop=$e,Un.isEdge=nt,Un.isEdgeChromium=dt,Un.isElectron=ct,Un.isEmbedded=Pe,Un.isFirefox=Ge,Un.isIE=We,Un.isIOS=ze,Un.isIOS13=at,Un.isIPad13=ot,Un.isIPhone13=lt,Un.isIPod13=ut,Un.isLegacyEdge=ht,Un.isMIUI=gt,Un.isMacOs=pt,Un.isMobile=Me,Un.isMobileOnly=Oe,Un.isMobileSafari=De,Un.isOpera=Ve,Un.isSafari=He,Un.isSamsungBrowser=mt,Un.isSmartTV=Le,Un.isTablet=Ne,Un.isWearable=Ce,Un.isWinPhone=Ue,Un.isWindows=ft,Un.isYandex=it,Un.mobileModel=Je,Un.mobileVendor=Ze,Un.osName=Ye,Un.osVersion=Ke,Un.parseUserAgent=f,Un.setUserAgent=function(e){return h(e)},Un.useDeviceData=vt,Un.useDeviceSelectors=function(e){var t=vt(e||window.navigator.userAgent);return[Re(t),t]},Un.useMobileOrientation=function(){var e=k(t.useState(function(){var e=window.innerWidth>window.innerHeight?90:0;return{isPortrait:0===e,isLandscape:90===e,orientation:0===e?"portrait":"landscape"}}),2),r=e[0],n=e[1],i=t.useCallback(function(){var e=window.innerWidth>window.innerHeight?90:0,t={isPortrait:0===e,isLandscape:90===e,orientation:0===e?"portrait":"landscape"};r.orientation!==t.orientation&&n(t)},[r.orientation]);return t.useEffect(function(){return void 0!==("undefined"==typeof window?"undefined":m(window))&&Me&&(i(),window.addEventListener("load",i,!1),window.addEventListener("resize",i,!1)),function(){window.removeEventListener("resize",i,!1),window.removeEventListener("load",i,!1)}},[i]),r},Un.withOrientationChange=function(e){return function(t){function n(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(t=function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return T(e)}(this,w(n).call(this,e))).isEventListenerAdded=!1,t.handleOrientationChange=t.handleOrientationChange.bind(T(t)),t.onOrientationChange=t.onOrientationChange.bind(T(t)),t.onPageLoad=t.onPageLoad.bind(T(t)),t.state={isLandscape:!1,isPortrait:!1},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&E(e,t)}(n,t),v(n,[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var e=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:0===e,isLandscape:90===e})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){void 0!==("undefined"==typeof window?"undefined":m(window))&&Me&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return r.createElement(e,b({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),n}(r.Component)},Un}();
11
11
  /**
12
12
  * @license lucide-react v0.503.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const Hr=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Vr=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),Yr=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
16
+ */const Vn=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Wn=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),Kn=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
17
17
  /**
18
18
  * @license lucide-react v0.503.0 - ISC
19
19
  *
20
20
  * This source code is licensed under the ISC license.
21
21
  * See the LICENSE file in the root directory of this source tree.
22
22
  */
23
- var qr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
23
+ var Yn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
24
24
  /**
25
25
  * @license lucide-react v0.503.0 - ISC
26
26
  *
27
27
  * This source code is licensed under the ISC license.
28
28
  * See the LICENSE file in the root directory of this source tree.
29
- */const Gr=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:a,...s},l)=>h.createElement("svg",{ref:l,...qr,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:Vr("lucide",o),...!i&&!Yr(s)&&{"aria-hidden":"true"},...s},[...a.map(([e,t])=>h.createElement(e,t)),...Array.isArray(i)?i:[i]])),Xr=(e,t)=>{const n=h.forwardRef(({className:n,...r},o)=>{return h.createElement(Gr,{ref:o,iconNode:t,className:Vr(`lucide-${i=Hr(e),i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...r});var i});return n.displayName=Hr(e),n},Kr=Xr("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),Qr=Xr("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),Zr=Xr("heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]),Jr=Xr("pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]),eo=Xr("play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]),to=Xr("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),no=Xr("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),ro=Xr("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]),oo=Xr("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),io=({file:e,mute:t=!0,thumbnail:n,play:r=!0})=>{const o=h.useRef(null),i=h.useRef(null),a=h.useRef(!1);return h.useEffect(()=>{const r=o.current;let a=function(e,t){if(Dr&&Lr===t){Dr.style.cssText="width:100%;height:100%;object-fit:cover;",e.appendChild(Dr);const t=Dr;return Dr=null,Lr="",t}return null}(r,e);return a||(a=document.createElement("video"),a.playsInline=!0,a.setAttribute("playsinline",""),a.setAttribute("webkit-playsinline",""),a.loop=!0,a.autoplay=!0,a.preload="auto",a.crossOrigin="anonymous",a.style.cssText="width:100%;height:100%;object-fit:cover;",n&&(a.poster=n),a.src=e,a.load(),r.appendChild(a)),a.muted=t,i.current=a,a.onerror=e=>{console.error(e)},()=>{try{a.pause(),a.removeAttribute("src"),a.load()}catch(e){}a.parentElement===r&&r.removeChild(a),i.current=null}},[e]),h.useEffect(()=>{const e=i.current;e&&(e.muted=t)},[t]),h.useEffect(()=>{const e=i.current;if(!e)return;if(a.current=!!r,!r)return void e.pause();const t=J(void 0,void 0,void 0,function*(){if(!e||!a.current)return;try{return void(yield e.play())}catch(e){}let t=requestAnimationFrame(()=>J(void 0,void 0,void 0,function*(){if(e&&a.current)try{e.readyState<2&&(yield new Promise(t=>{const n=()=>{e.removeEventListener("loadeddata",n),t()};e.addEventListener("loadeddata",n,{once:!0})})),yield e.play()}catch(t){const n=e.muted;try{e.muted=!0,yield e.play()}catch(e){}const r=()=>{e.muted=n,e.play().catch(()=>{}),window.removeEventListener("touchstart",r,!0),window.removeEventListener("pointerup",r,!0)};window.addEventListener("touchstart",r,!0),window.addEventListener("pointerup",r,!0)}}));return()=>cancelAnimationFrame(t)});return()=>{"function"==typeof t&&t()}},[r]),m.createElement("div",{className:"w-full h-full relative"},m.createElement("div",{ref:o,className:"w-full h-full"}))},ao=()=>m.createElement("div",{className:"inline-block absolute pointer-events-none top-0 z-10 animate-float w-[24px] h-[24px]"},m.createElement(Zr,{className:"fill-red-500 text-transparent w-[24px] h-[24px]"})),so=({shortsId:e})=>{const{isPreview:t}=cn(),[n,r]=h.useState(t?123:0),[o,i]=h.useState([]);h.useEffect(()=>{t||J(void 0,void 0,void 0,function*(){try{const t=yield Zt(e);r(t)}catch(e){return console.error(`Error in statistics getLikeInLive: ${e.toString()}`),0}})},[]);return m.createElement("div",{className:"flex justify-center flex-col items-center relative w-[24px] h-[24px]"},m.createElement("button",{onClick:()=>J(void 0,void 0,void 0,function*(){(()=>{const e=Date.now();i(t=>[...t,e]),setTimeout(()=>{i(t=>t.filter(t=>t!==e))},2e3)})(),r(e=>e+1),t||(yield J(void 0,void 0,void 0,function*(){yield Jt(e)}))}),className:"z-[5] cursor-pointer"},m.createElement(Zr,{className:"text-xl fill-white w-[24px] h-[24px]"})),o.map(e=>m.createElement(ao,{key:e})),m.createElement("span",{className:"break-keep text-[10px]"},Ft(n)))};
29
+ */const qn=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:s,iconNode:a,...o},l)=>p.createElement("svg",{ref:l,...Yn,width:t,height:t,stroke:e,strokeWidth:n?24*Number(r)/Number(t):r,className:Wn("lucide",i),...!s&&!Kn(o)&&{"aria-hidden":"true"},...o},[...a.map(([e,t])=>p.createElement(e,t)),...Array.isArray(s)?s:[s]])),Xn=(e,t)=>{const r=p.forwardRef(({className:r,...n},i)=>{return p.createElement(qn,{ref:i,iconNode:t,className:Wn(`lucide-${s=Vn(e),s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...n});var s});return r.displayName=Vn(e),r},Qn=Xn("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),Zn=Xn("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),Jn=Xn("heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]),ei=Xn("pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]),ti=Xn("play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]),ri=Xn("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),ni=Xn("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),ii=Xn("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]),si=Xn("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ai=({file:e,mute:t=!0,thumbnail:r,play:n=!0})=>{const i=p.useRef(null),s=p.useRef(null),a=p.useRef(!1);return p.useEffect(()=>{const n=i.current;let a=function(e,t){if(Nn&&Fn===t){Nn.style.cssText="width:100%;height:100%;object-fit:cover;",e.appendChild(Nn);const t=Nn;return Nn=null,Fn="",t}return null}(n,e);return a||(a=document.createElement("video"),a.playsInline=!0,a.setAttribute("playsinline",""),a.setAttribute("webkit-playsinline",""),a.loop=!0,a.autoplay=!0,a.preload="auto",a.crossOrigin="anonymous",a.style.cssText="width:100%;height:100%;object-fit:cover;",r&&(a.poster=r),a.src=e,a.load(),n.appendChild(a)),a.muted=t,s.current=a,a.onerror=e=>{console.error(e)},()=>{try{a.pause(),a.removeAttribute("src"),a.load()}catch(e){}a.parentElement===n&&n.removeChild(a),s.current=null}},[e]),p.useEffect(()=>{const e=s.current;e&&(e.muted=t)},[t]),p.useEffect(()=>{const e=s.current;if(!e)return;if(a.current=!!n,!n)return void e.pause();const t=J(void 0,void 0,void 0,function*(){if(!e||!a.current)return;try{return void(yield e.play())}catch(e){}let t=requestAnimationFrame(()=>J(void 0,void 0,void 0,function*(){if(e&&a.current)try{e.readyState<2&&(yield new Promise(t=>{const r=()=>{e.removeEventListener("loadeddata",r),t()};e.addEventListener("loadeddata",r,{once:!0})})),yield e.play()}catch(t){const r=e.muted;try{e.muted=!0,yield e.play()}catch(e){}const n=()=>{e.muted=r,e.play().catch(()=>{}),window.removeEventListener("touchstart",n,!0),window.removeEventListener("pointerup",n,!0)};window.addEventListener("touchstart",n,!0),window.addEventListener("pointerup",n,!0)}}));return()=>cancelAnimationFrame(t)});return()=>{"function"==typeof t&&t()}},[n]),g.createElement("div",{className:"w-full h-full relative"},g.createElement("div",{ref:i,className:"w-full h-full"}))},oi=()=>g.createElement("div",{className:"inline-block absolute pointer-events-none top-0 z-10 animate-float w-[24px] h-[24px]"},g.createElement(Jn,{className:"fill-red-500 text-transparent w-[24px] h-[24px]"})),li=({shortsId:e})=>{const{isPreview:t}=cr(),[r,n]=p.useState(t?123:0),[i,s]=p.useState([]);p.useEffect(()=>{t||J(void 0,void 0,void 0,function*(){try{const t=yield Jt(e);n(t)}catch(e){return console.error(`Error in statistics getLikeInLive: ${e.toString()}`),0}})},[]);return g.createElement("div",{className:"flex justify-center flex-col items-center relative w-[24px] h-[24px]"},g.createElement("button",{onClick:()=>J(void 0,void 0,void 0,function*(){(()=>{const e=Date.now();s(t=>[...t,e]),setTimeout(()=>{s(t=>t.filter(t=>t!==e))},2e3)})(),n(e=>e+1),t||(yield J(void 0,void 0,void 0,function*(){yield er(e)}))}),className:"z-[5] cursor-pointer"},g.createElement(Jn,{className:"text-xl fill-white w-[24px] h-[24px]"})),i.map(e=>g.createElement(oi,{key:e})),g.createElement("span",{className:"break-keep text-[10px]"},$t(r)))};
30
30
  /**
31
31
  * @license lucide-react v0.503.0 - ISC
32
32
  *
33
33
  * This source code is licensed under the ISC license.
34
34
  * See the LICENSE file in the root directory of this source tree.
35
- */function lo({message:e,duration:t=3e3,visible:n,setVisible:r}){return h.useEffect(()=>{const e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)},[n]),n?m.createElement("div",{style:{position:"fixed",top:"1rem",left:"50%",transform:"translateX(-50%)",background:"rgba(0,0,0,0.8)",color:"#fff",padding:"0.75rem 1.25rem",borderRadius:"0.375rem",fontSize:"14px",zIndex:9999,boxShadow:"0 2px 10px rgba(0,0,0,0.2)"}},e):null}const uo=({shortForm:e,shareUrl:t})=>{const n=null!=t?t:window.location.href,[r,o]=h.useState(!1);return m.createElement(m.Fragment,null,m.createElement("button",{onClick:()=>J(void 0,void 0,void 0,function*(){try{o(!0),Ur.isMobile&&navigator.share&&e?yield navigator.share({title:e.title,url:n}):(e=>{if(void 0!==navigator.clipboard)navigator.clipboard.writeText(e).then(()=>{});else{const t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),t.setSelectionRange(0,99999);try{document.execCommand("copy")}catch(e){console.error("복사 실패",e)}t.setSelectionRange(0,0),document.body.removeChild(t)}})(n)}catch(e){console.error("Fail to copy on clipboard")}}),className:"cursor-pointer"},m.createElement(to,{size:22}),m.createElement(lo,{message:"공유 링크 복사 완료",setVisible:o,visible:r})))},co=({width:e,height:t})=>m.createElement("div",{className:"w-full h-full flex items-center justify-center"},m.createElement("img",{src:"public/images/noImage.svg",alt:"no image",width:e||50,height:t||50})),fo=({product:e,onError:t})=>m.createElement("img",{src:e.thumbPath,alt:e.productName,className:"object-cover p-0 flex-none",style:{height:"80px",width:"80px"},onError:t}),po=({product:e,hideMoreBtn:t,contentId:n})=>{const{isPreview:r,priceText:o}=cn(),[i,a]=h.useState(!1);return m.createElement("div",{style:{height:"80px"},className:"flex gap-2 items-center w-full",onClick:()=>J(void 0,void 0,void 0,function*(){t&&(window.open(e.linkPath,"_blank"),r||(yield Qt({contentProductId:e.eventProductId,contentId:n,productId:e.productId})))})},e.thumbPath&&!i?m.createElement(fo,{product:e,onError:()=>a(!0)}):m.createElement(co,null),m.createElement("div",{className:"flex flex-col text-left p-2 w-full justify-center"},e.brand&&m.createElement("span",{className:"break-keep line-clamp-1 text-gray-500",style:{fontSize:"10px"}},e.brand.brandName),m.createElement("div",{className:"text-gray-800 text-ellipsis line-clamp-1 ",style:{fontSize:"12px"}},e.productName),m.createElement("div",{className:"text-red-500 break-keep",style:{fontSize:"12px"}},o?o+" ":"할인가 ",m.createElement("span",{className:"font-semibold break-keep"},Ft(e.sellingPrice),"원"))))};function ho(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function mo(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function go(...e){return t=>{let n=!1;const r=e.map(e=>{const r=mo(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():mo(e[t],null)}}}}function vo(...e){return h.useCallback(go(...e),e)}var bo,yo,wo={exports:{}},xo={};var So=(yo||(yo=1,wo.exports=function(){if(bo)return xo;bo=1;var e=l(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(e,n,a){var s,l={},u=null,c=null;for(s in void 0!==a&&(u=""+a),void 0!==n.key&&(u=""+n.key),void 0!==n.ref&&(c=n.ref),n)r.call(n,s)&&!i.hasOwnProperty(s)&&(l[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps)void 0===l[s]&&(l[s]=n[s]);return{$$typeof:t,type:e,key:u,ref:c,props:l,_owner:o.current}}return xo.Fragment=n,xo.jsx=a,xo.jsxs=a,xo}()),wo.exports);function Eo(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const r=n.reduce((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]}),{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var ko=globalThis?.document?h.useLayoutEffect:()=>{},Co=g[" useId ".trim().toString()]||(()=>{}),To=0;function Po(e){const[t,n]=h.useState(Co());return ko(()=>{e||n(e=>e??String(To++))},[e]),e||(t?`radix-${t}`:"")}var Oo=g[" useInsertionEffect ".trim().toString()]||ko;function Mo({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=function({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),o=h.useRef(n),i=h.useRef(t);return Oo(()=>{i.current=t},[t]),h.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}({defaultProp:t,onChange:n}),s=void 0!==e,l=s?e:o;{const t=h.useRef(void 0!==e);h.useEffect(()=>{const e=t.current;if(e!==s){const t=e?"controlled":"uncontrolled",n=s?"controlled":"uncontrolled";console.warn(`${r} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=s},[s,r])}const u=h.useCallback(t=>{if(s){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&a.current?.(n)}else i(t)},[s,e,i,a]);return[l,u]}var No=k(),_o=t(No);function Ro(e){const t=zo(e),n=h.forwardRef((e,n)=>{const{children:r,...o}=e,i=h.Children.toArray(r),a=i.find(Do);if(a){const e=a.props.children,r=i.map(t=>t===a?h.Children.count(e)>1?h.Children.only(null):h.isValidElement(e)?e.props.children:null:t);return So.jsx(t,{...o,ref:n,children:h.isValidElement(e)?h.cloneElement(e,void 0,r):null})}return So.jsx(t,{...o,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function zo(e){const t=h.forwardRef((e,t)=>{const{children:n,...r}=e;if(h.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==h.Fragment&&(o.ref=t?go(t,e):e),h.cloneElement(n,o)}return h.Children.count(n)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Io=Symbol("radix.slottable");function Do(e){return h.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Io}var Lo=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=Ro(`Primitive.${t}`),r=h.forwardRef((e,r)=>{const{asChild:o,...i}=e,a=o?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),So.jsx(a,{...i,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ao(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...e)=>t.current?.(...e),[])}function Fo(e,t=globalThis?.document){const n=Ao(e);h.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}var $o,jo="dismissableLayer.update",Bo="dismissableLayer.pointerDownOutside",Wo="dismissableLayer.focusOutside",Uo=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ho=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...l}=e,u=h.useContext(Uo),[c,d]=h.useState(null),f=c?.ownerDocument??globalThis?.document,[,p]=h.useState({}),m=vo(t,e=>d(e)),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=g.indexOf(v),y=c?g.indexOf(c):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=b,S=function(e,t=globalThis?.document){const n=Ao(e),r=h.useRef(!1),o=h.useRef(()=>{});return h.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let r=function(){Yo(Bo,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{const t=e.target,n=[...u.branches].some(e=>e.contains(t));x&&!n&&(o?.(e),a?.(e),e.defaultPrevented||s?.())},f),E=function(e,t=globalThis?.document){const n=Ao(e),r=h.useRef(!1);return h.useEffect(()=>{const e=e=>{if(e.target&&!r.current){Yo(Wo,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(i?.(e),a?.(e),e.defaultPrevented||s?.())},f);return Fo(e=>{y===u.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),h.useEffect(()=>{if(c)return n&&(0===u.layersWithOutsidePointerEventsDisabled.size&&($o=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),Vo(),()=>{n&&1===u.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=$o)}},[c,f,n,u]),h.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),Vo())},[c,u]),h.useEffect(()=>{const e=()=>p({});return document.addEventListener(jo,e),()=>document.removeEventListener(jo,e)},[]),So.jsx(Lo.div,{...l,ref:m,style:{pointerEvents:w?x?"auto":"none":void 0,...e.style},onFocusCapture:ho(e.onFocusCapture,E.onFocusCapture),onBlurCapture:ho(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:ho(e.onPointerDownCapture,S.onPointerDownCapture)})});Ho.displayName="DismissableLayer";function Vo(){const e=new CustomEvent(jo);document.dispatchEvent(e)}function Yo(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&No.flushSync(()=>e.dispatchEvent(t))}(o,i):o.dispatchEvent(i)}h.forwardRef((e,t)=>{const n=h.useContext(Uo),r=h.useRef(null),o=vo(t,r);return h.useEffect(()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),So.jsx(Lo.div,{...e,ref:o})}).displayName="DismissableLayerBranch";var qo="focusScope.autoFocusOnMount",Go="focusScope.autoFocusOnUnmount",Xo={bubbles:!1,cancelable:!0},Ko=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,l]=h.useState(null),u=Ao(o),c=Ao(i),d=h.useRef(null),f=vo(t,e=>l(e)),p=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;const t=e.target;s.contains(t)?d.current=t:ei(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;const t=e.relatedTarget;null!==t&&(s.contains(t)||ei(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&ei(s)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[r,s,p.paused]),h.useEffect(()=>{if(s){ti.add(p);const t=document.activeElement;if(!s.contains(t)){const n=new CustomEvent(qo,Xo);s.addEventListener(qo,u),s.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ei(r,{select:t}),document.activeElement!==n)return}((e=Qo(s),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&ei(s))}return()=>{s.removeEventListener(qo,u),setTimeout(()=>{const e=new CustomEvent(Go,Xo);s.addEventListener(Go,c),s.dispatchEvent(e),e.defaultPrevented||ei(t??document.body,{select:!0}),s.removeEventListener(Go,c),ti.remove(p)},0)}}var e},[s,u,c,p]);const m=h.useCallback(e=>{if(!n&&!r)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,i]=function(e){const t=Qo(e),n=Zo(t,e),r=Zo(t.reverse(),e);return[n,r]}(t);r&&i?e.shiftKey||o!==i?e.shiftKey&&o===r&&(e.preventDefault(),n&&ei(i,{select:!0})):(e.preventDefault(),n&&ei(r,{select:!0})):o===t&&e.preventDefault()}},[n,r,p.paused]);return So.jsx(Lo.div,{tabIndex:-1,...a,ref:f,onKeyDown:m})});function Qo(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Zo(e,t){for(const n of e)if(!Jo(n,{upTo:t}))return n}function Jo(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function ei(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}Ko.displayName="FocusScope";var ti=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=ni(e,t),e.unshift(t)},remove(t){e=ni(e,t),e[0]?.resume()}}}();function ni(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var ri=h.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=h.useState(!1);ko(()=>i(!0),[]);const a=n||o&&globalThis?.document?.body;return a?_o.createPortal(So.jsx(Lo.div,{...r,ref:t}),a):null});ri.displayName="Portal";var oi=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=h.useState(),r=h.useRef(null),o=h.useRef(e),i=h.useRef("none"),a=e?"mounted":"unmounted",[s,l]=function(e,t){return h.useReducer((e,n)=>t[e][n]??e,e)}(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const e=ii(r.current);i.current="mounted"===s?e:"none"},[s]),ko(()=>{const t=r.current,n=o.current;if(n!==e){const r=i.current,a=ii(t);if(e)l("MOUNT");else if("none"===a||"none"===t?.display)l("UNMOUNT");else{l(n&&r!==a?"ANIMATION_OUT":"UNMOUNT")}o.current=e}},[e,l]),ko(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,a=i=>{const a=ii(r.current).includes(i.animationName);if(i.target===t&&a&&(l("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(i.current=ii(r.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:h.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}(t),o="function"==typeof n?n({present:r.isPresent}):h.Children.only(n),i=vo(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof n||r.isPresent?h.cloneElement(o,{ref:i}):null};function ii(e){return e?.animationName||"none"}oi.displayName="Presence";var ai=0;function si(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var li="right-scroll-bar-position",ui="width-before-scroll-bar";function ci(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var di="undefined"!=typeof window?h.useLayoutEffect:h.useEffect,fi=new WeakMap;function pi(e,t){var n,r,o,i=(n=null,r=function(t){return e.forEach(function(e){return ci(e,t)})},(o=h.useState(function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}})[0]).callback=r,o.facade);return di(function(){var t=fi.get(i);if(t){var n=new Set(t),r=new Set(e),o=i.current;n.forEach(function(e){r.has(e)||ci(e,null)}),r.forEach(function(e){n.has(e)||ci(e,o)})}fi.set(i,e)},[e]),i}function hi(e){return e}var mi=function(e){var t=e.sideCar,n=Z(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return h.createElement(r,Q({},n))};mi.isSideCarExport=!0;var gi=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=hi);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}};return o}(null);return t.options=Q({async:!0,ssr:!1},e),t}(),vi=function(){},bi=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:vi,onWheelCapture:vi,onTouchMoveCapture:vi}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,g=e.inert,v=e.allowPinchZoom,b=e.as,y=void 0===b?"div":b,w=e.gapMode,x=Z(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=f,E=pi([n,t]),k=Q(Q({},x),o);return h.createElement(h.Fragment,null,c&&h.createElement(S,{sideCar:gi,removeScrollBar:u,shards:d,noRelative:p,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:w}),a?h.cloneElement(h.Children.only(s),Q(Q({},k),{ref:E})):h.createElement(y,Q({},k,{className:l,ref:E}),s))});bi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},bi.classNames={fullWidth:ui,zeroRight:li};function yi(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var wi=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=yi())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},xi=function(){var e,t=(e=wi(),function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},Si={left:0,top:0,right:0,gap:0},Ei=function(e){return parseInt(e||"",10)||0},ki=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Si;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[Ei(n),Ei(r),Ei(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ci=xi(),Ti="data-scroll-locked",Pi=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat(Ti,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(li," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(ui," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(li," .").concat(li," {\n right: 0 ").concat(r,";\n }\n \n .").concat(ui," .").concat(ui," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(Ti,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},Oi=function(){var e=parseInt(document.body.getAttribute(Ti)||"0",10);return isFinite(e)?e:0},Mi=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;h.useEffect(function(){return document.body.setAttribute(Ti,(Oi()+1).toString()),function(){var e=Oi()-1;e<=0?document.body.removeAttribute(Ti):document.body.setAttribute(Ti,e.toString())}},[]);var i=h.useMemo(function(){return ki(o)},[o]);return h.createElement(Ci,{styles:Pi(i,!t,o,n?"":"!important")})},Ni=!1;if("undefined"!=typeof window)try{var _i=Object.defineProperty({},"passive",{get:function(){return Ni=!0,!0}});window.addEventListener("test",_i,_i),window.removeEventListener("test",_i,_i)}catch(e){Ni=!1}var Ri=!!Ni&&{passive:!1},zi=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},Ii=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),Di(e,r)){var o=Li(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Di=function(e,t){return"v"===e?function(e){return zi(e,"overflowY")}(t):function(e){return zi(e,"overflowX")}(t)},Li=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},Ai=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Fi=function(e){return[e.deltaX,e.deltaY]},$i=function(e){return e&&"current"in e?e.current:e},ji=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Bi=0,Wi=[];function Ui(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Hi,Vi=(Hi=function(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(Bi++)[0],i=h.useState(xi)[0],a=h.useRef(e);h.useEffect(function(){a.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map($i),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=h.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!a.current.allowPinchZoom;var o,i=Ai(e),s=n.current,l="deltaX"in e?e.deltaX:s[0]-i[0],u="deltaY"in e?e.deltaY:s[1]-i[1],c=e.target,d=Math.abs(l)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=Ii(d,c);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=Ii(d,c)),!f)return!1;if(!r.current&&"changedTouches"in e&&(l||u)&&(r.current=o),!o)return!0;var p=r.current||o;return function(e,t,n,r,o){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),u=!1,c=a>0,d=0,f=0;do{if(!s)break;var p=Li(e,s),h=p[0],m=p[1]-p[2]-i*h;(h||m)&&Di(e,s)&&(d+=m,f+=h);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return c&&(Math.abs(d)<1||!o)?u=!0:c||!(Math.abs(f)<1)&&o||(u=!0),u}(p,t,e,"h"===p?l:u,!0)},[]),l=h.useCallback(function(e){var n=e;if(Wi.length&&Wi[Wi.length-1]===i){var r="deltaY"in n?Fi(n):Ai(n),o=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,r)})[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var l=(a.current.shards||[]).map($i).filter(Boolean).filter(function(e){return e.contains(n.target)});(l.length>0?s(n,l[0]):!a.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=h.useCallback(function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:Ui(r)};t.current.push(i),setTimeout(function(){t.current=t.current.filter(function(e){return e!==i})},1)},[]),c=h.useCallback(function(e){n.current=Ai(e),r.current=void 0},[]),d=h.useCallback(function(t){u(t.type,Fi(t),t.target,s(t,e.lockRef.current))},[]),f=h.useCallback(function(t){u(t.type,Ai(t),t.target,s(t,e.lockRef.current))},[]);h.useEffect(function(){return Wi.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Ri),document.addEventListener("touchmove",l,Ri),document.addEventListener("touchstart",c,Ri),function(){Wi=Wi.filter(function(e){return e!==i}),document.removeEventListener("wheel",l,Ri),document.removeEventListener("touchmove",l,Ri),document.removeEventListener("touchstart",c,Ri)}},[]);var p=e.removeScrollBar,m=e.inert;return h.createElement(h.Fragment,null,m?h.createElement(i,{styles:ji(o)}):null,p?h.createElement(Mi,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},gi.useMedium(Hi),mi),Yi=h.forwardRef(function(e,t){return h.createElement(bi,Q({},e,{ref:t,sideCar:Vi}))});Yi.classNames=bi.classNames;var qi=new WeakMap,Gi=new WeakMap,Xi={},Ki=0,Qi=function(e){return e&&(e.host||Qi(e.parentNode))},Zi=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Qi(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);Xi[n]||(Xi[n]=new WeakMap);var i=Xi[n],a=[],s=new Set,l=new Set(o),u=function(e){e&&!s.has(e)&&(s.add(e),u(e.parentNode))};o.forEach(u);var c=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))c(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(qi.get(e)||0)+1,u=(i.get(e)||0)+1;qi.set(e,l),i.set(e,u),a.push(e),1===l&&o&&Gi.set(e,!0),1===u&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return c(t),s.clear(),Ki++,function(){a.forEach(function(e){var t=qi.get(e)-1,o=i.get(e)-1;qi.set(e,t),i.set(e,o),t||(Gi.has(e)||e.removeAttribute(r),Gi.delete(e)),o||e.removeAttribute(n)}),--Ki||(qi=new WeakMap,qi=new WeakMap,Gi=new WeakMap,Xi={})}},Ji=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Zi(r,o,n,"aria-hidden")):function(){return null}},ea="Dialog",[ta,na]=function(e,t=[]){let n=[];const r=()=>{const t=n.map(e=>h.createContext(e));return function(n){const r=n?.[e]||t;return h.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){const o=h.createContext(r),i=n.length;n=[...n,r];const a=t=>{const{scope:n,children:r,...a}=t,s=n?.[e]?.[i]||o,l=h.useMemo(()=>a,Object.values(a));return So.jsx(s.Provider,{value:l,children:r})};return a.displayName=t+"Provider",[a,function(n,a){const s=a?.[e]?.[i]||o,l=h.useContext(s);if(l)return l;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},Eo(r,...t)]}(ea),[ra,oa]=ta(ea),ia=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,s=h.useRef(null),l=h.useRef(null),[u,c]=Mo({prop:r,defaultProp:o??!1,onChange:i,caller:ea});return So.jsx(ra,{scope:t,triggerRef:s,contentRef:l,contentId:Po(),titleId:Po(),descriptionId:Po(),open:u,onOpenChange:c,onOpenToggle:h.useCallback(()=>c(e=>!e),[c]),modal:a,children:n})};ia.displayName=ea;var aa="DialogTrigger",sa=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=oa(aa,n),i=vo(t,o.triggerRef);return So.jsx(Lo.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Pa(o.open),...r,ref:i,onClick:ho(e.onClick,o.onOpenToggle)})});sa.displayName=aa;var la="DialogPortal",[ua,ca]=ta(la,{forceMount:void 0}),da=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=oa(la,t);return So.jsx(ua,{scope:t,forceMount:n,children:h.Children.map(r,e=>So.jsx(oi,{present:n||i.open,children:So.jsx(ri,{asChild:!0,container:o,children:e})}))})};da.displayName=la;var fa="DialogOverlay",pa=h.forwardRef((e,t)=>{const n=ca(fa,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=oa(fa,e.__scopeDialog);return i.modal?So.jsx(oi,{present:r||i.open,children:So.jsx(ma,{...o,ref:t})}):null});pa.displayName=fa;var ha=Ro("DialogOverlay.RemoveScroll"),ma=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=oa(fa,n);return So.jsx(Yi,{as:ha,allowPinchZoom:!0,shards:[o.contentRef],children:So.jsx(Lo.div,{"data-state":Pa(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ga="DialogContent",va=h.forwardRef((e,t)=>{const n=ca(ga,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=oa(ga,e.__scopeDialog);return So.jsx(oi,{present:r||i.open,children:i.modal?So.jsx(ba,{...o,ref:t}):So.jsx(ya,{...o,ref:t})})});va.displayName=ga;var ba=h.forwardRef((e,t)=>{const n=oa(ga,e.__scopeDialog),r=h.useRef(null),o=vo(t,n.contentRef,r);return h.useEffect(()=>{const e=r.current;if(e)return Ji(e)},[]),So.jsx(wa,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ho(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ho(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:ho(e.onFocusOutside,e=>e.preventDefault())})}),ya=h.forwardRef((e,t)=>{const n=oa(ga,e.__scopeDialog),r=h.useRef(!1),o=h.useRef(!1);return So.jsx(wa,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));const i=t.target,a=n.triggerRef.current?.contains(i);a&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})}),wa=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=oa(ga,n),l=h.useRef(null),u=vo(t,l);return h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??si()),document.body.insertAdjacentElement("beforeend",e[1]??si()),ai++,()=>{1===ai&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),ai--}},[]),So.jsxs(So.Fragment,{children:[So.jsx(Ko,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:So.jsx(Ho,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Pa(s.open),...a,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),So.jsxs(So.Fragment,{children:[So.jsx(_a,{titleId:s.titleId}),So.jsx(Ra,{contentRef:l,descriptionId:s.descriptionId})]})]})}),xa="DialogTitle",Sa=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=oa(xa,n);return So.jsx(Lo.h2,{id:o.titleId,...r,ref:t})});Sa.displayName=xa;var Ea="DialogDescription",ka=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=oa(Ea,n);return So.jsx(Lo.p,{id:o.descriptionId,...r,ref:t})});ka.displayName=Ea;var Ca="DialogClose",Ta=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=oa(Ca,n);return So.jsx(Lo.button,{type:"button",...r,ref:t,onClick:ho(e.onClick,()=>o.onOpenChange(!1))})});function Pa(e){return e?"open":"closed"}Ta.displayName=Ca;var Oa="DialogTitleWarning",[Ma,Na]=function(e,t){const n=h.createContext(t),r=e=>{const{children:t,...r}=e,o=h.useMemo(()=>r,Object.values(r));return So.jsx(n.Provider,{value:o,children:t})};return r.displayName=e+"Provider",[r,function(r){const o=h.useContext(n);if(o)return o;if(void 0!==t)return t;throw new Error(`\`${r}\` must be used within \`${e}\``)}]}(Oa,{contentName:ga,titleName:xa,docsSlug:"dialog"}),_a=({titleId:e})=>{const t=Na(Oa),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{if(e){document.getElementById(e)||console.error(n)}},[n,e]),null},Ra=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Na("DialogDescriptionWarning").contentName}}.`;return h.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");if(t&&r){document.getElementById(t)||console.warn(n)}},[n,e,t]),null},za=ia,Ia=sa,Da=da,La=pa,Aa=va,Fa=Sa,$a=ka,ja=Ta;const Ba=m.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),Wa=()=>{const e=m.useContext(Ba);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};function Ua(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Ha(){return Ya(/^iPad/)||Ya(/^Mac/)&&navigator.maxTouchPoints>1}function Va(){return Ya(/^iPhone/)||Ha()}function Ya(e){return"undefined"!=typeof window&&null!=window.navigator?e.test(window.navigator.platform):void 0}!function(e){if("undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");const qa="undefined"!=typeof window?h.useLayoutEffect:h.useEffect;function Ga(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}const Xa="undefined"!=typeof document&&window.visualViewport;function Ka(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Qa(e){for(Ka(e)&&(e=e.parentElement);e&&!Ka(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Za=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Ja,es=0;function ts(e={}){let{isDisabled:t}=e;qa(()=>{if(!t)return es++,1===es&&Va()&&(Ja=function(){let e,t=0,n=n=>{e=Qa(n.target),e===document.documentElement&&e===document.body||(t=n.changedTouches[0].pageY)},r=n=>{if(!e||e===document.documentElement||e===document.body)return void n.preventDefault();let r=n.changedTouches[0].pageY,o=e.scrollTop,i=e.scrollHeight-e.clientHeight;0!==i&&((o<=0&&r>t||o>=i&&r<t)&&n.preventDefault(),t=r)},o=e=>{let t=e.target;os(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},i=e=>{let t=e.target;os(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",Xa&&(Xa.height<window.innerHeight?requestAnimationFrame(()=>{rs(t)}):Xa.addEventListener("resize",()=>rs(t),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,u=Ga(function(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}(document.documentElement,"paddingRight",window.innerWidth-document.documentElement.clientWidth+"px"));window.scrollTo(0,0);let c=Ga(ns(document,"touchstart",n,{passive:!1,capture:!0}),ns(document,"touchmove",r,{passive:!1,capture:!0}),ns(document,"touchend",o,{passive:!1,capture:!0}),ns(document,"focus",i,!0),ns(window,"scroll",a));return()=>{u(),c(),window.scrollTo(s,l)}}()),()=>{es--,0===es&&(null==Ja||Ja())}},[t])}function ns(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function rs(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=Qa(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=r-n)}e=t.parentElement}}function os(e){return e instanceof HTMLInputElement&&!Za.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function is(...e){return h.useCallback(function(...e){return t=>e.forEach(e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t))}(...e),e)}const as=new WeakMap;function ss(e,t,n=!1){if(!(e&&e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([t,n])=>{t.startsWith("--")?e.style.setProperty(t,n):(r[t]=e.style[t],e.style[t]=n)}),n||as.set(e,r)}const ls=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function us(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[ls(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[ls(t)?5:4]):null)}function cs(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}const ds={DURATION:.5,EASE:[.32,.72,0,1]},fs=16,ps="vaul-dragging";function hs(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...e)=>null==t.current?void 0:t.current.call(t,...e),[])}function ms({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=function({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=hs(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,a=i?e:r,s=hs(n),l=m.useCallback(t=>{if(i){const n="function"==typeof t?t(e):t;n!==e&&s(n)}else o(t)},[i,e,o,s]);return[a,l]}let gs=null;function vs({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:i,shouldScaleBackground:a=!1,setBackgroundColorOnScale:s=!0,closeThreshold:l=.25,scrollLockTimeout:u=100,dismissible:c=!0,handleOnly:d=!1,fadeFromIndex:f=i&&i.length-1,activeSnapPoint:p,setActiveSnapPoint:h,fixed:g,modal:v=!0,onClose:b,nested:y,noBodyStyles:w=!1,direction:x="bottom",defaultOpen:S=!1,disablePreventScroll:E=!0,snapToSequentialPoint:k=!1,preventScrollRestoration:C=!1,repositionInputs:T=!0,onAnimationEnd:P,container:O,autoFocus:M=!1}){var N,_;const[R=!1,z]=ms({defaultProp:S,prop:e,onChange:e=>{null==t||t(e),e||y||ce(),setTimeout(()=>{null==P||P(e)},1e3*ds.DURATION),e&&!v&&"undefined"!=typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[I,D]=m.useState(!1),[L,A]=m.useState(!1),[F,$]=m.useState(!1),j=m.useRef(null),B=m.useRef(null),W=m.useRef(null),U=m.useRef(null),H=m.useRef(null),V=m.useRef(!1),Y=m.useRef(null),q=m.useRef(0),G=m.useRef(!1),X=m.useRef(!S),K=m.useRef(0),Q=m.useRef(null),Z=m.useRef((null==(N=Q.current)?void 0:N.getBoundingClientRect().height)||0),J=m.useRef((null==(_=Q.current)?void 0:_.getBoundingClientRect().width)||0),ee=m.useRef(0),te=m.useCallback(e=>{i&&e===ae.length-1&&(B.current=new Date)},[]),{activeSnapPoint:ne,activeSnapPointIndex:re,setActiveSnapPoint:oe,onRelease:ie,snapPointsOffset:ae,onDrag:se,shouldFade:le,getPercentageDragged:ue}=function({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:i,onSnapPointChange:a,direction:s="bottom",container:l,snapToSequentialPoint:u}){const[c,d]=ms({prop:e,defaultProp:null==n?void 0:n[0],onChange:t}),[f,p]=m.useState("undefined"!=typeof window?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);m.useEffect(()=>{function e(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const h=m.useMemo(()=>c===(null==n?void 0:n[n.length-1])||null,[n,c]),g=m.useMemo(()=>{var e;return null!=(e=null==n?void 0:n.findIndex(e=>e===c))?e:null},[n,c]),v=n&&n.length>0&&(i||0===i)&&!Number.isNaN(i)&&n[i]===c||!n,b=m.useMemo(()=>{const e=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:"undefined"!=typeof window?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var t;return null!=(t=null==n?void 0:n.map(t=>{const n="string"==typeof t;let r=0;if(n&&(r=parseInt(t,10)),ls(s)){const o=n?r:f?t*e.height:0;return f?"bottom"===s?e.height-o:-e.height+o:o}const o=n?r:f?t*e.width:0;return f?"right"===s?e.width-o:-e.width+o:o}))?t:[]},[n,f,l]),y=m.useMemo(()=>null!==g?null==b?void 0:b[g]:null,[b,g]),w=m.useCallback(e=>{var t;const l=null!=(t=null==b?void 0:b.findIndex(t=>t===e))?t:null;a(l),ss(r.current,{transition:`transform ${ds.DURATION}s cubic-bezier(${ds.EASE.join(",")})`,transform:ls(s)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),b&&l!==b.length-1&&void 0!==i&&l!==i&&l<i?ss(o.current,{transition:`opacity ${ds.DURATION}s cubic-bezier(${ds.EASE.join(",")})`,opacity:"0"}):ss(o.current,{transition:`opacity ${ds.DURATION}s cubic-bezier(${ds.EASE.join(",")})`,opacity:"1"}),d(null==n?void 0:n[Math.max(l,0)])},[r.current,n,b,i,o,d]);return m.useEffect(()=>{if(c||e){var t;const r=null!=(t=null==n?void 0:n.findIndex(t=>t===e||t===c))?t:-1;b&&-1!==r&&"number"==typeof b[r]&&w(b[r])}},[c,e,n,b,w]),{isLastSnapPoint:h,activeSnapPoint:c,shouldFade:v,getPercentageDragged:function(e,t){if(!n||"number"!=typeof g||!b||void 0===i)return null;const r=g===i-1;if(g>=i&&t)return 0;if(r&&!t)return 1;if(!v&&!r)return null;const o=r?g+1:g-1,a=r?b[o]-b[o-1]:b[o+1]-b[o],s=e/Math.abs(a);return r?1-s:s},setActiveSnapPoint:d,activeSnapPointIndex:g,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:r,dismissible:a}){if(void 0===i)return;const l="bottom"===s||"right"===s?(null!=y?y:0)-e:(null!=y?y:0)+e,c=0===g,d=e>0;if(g===i-1&&ss(o.current,{transition:`opacity ${ds.DURATION}s cubic-bezier(${ds.EASE.join(",")})`}),!u&&r>2&&!d)return void(a?t():w(b[0]));if(!u&&r>2&&d&&b&&n)return void w(b[n.length-1]);const f=null==b?void 0:b.reduce((e,t)=>"number"!=typeof e||"number"!=typeof t?e:Math.abs(t-l)<Math.abs(e-l)?t:e),p=ls(s)?window.innerHeight:window.innerWidth;if(r>.4&&Math.abs(e)<.4*p){const e=d?1:-1;if(e>0&&h&&n)return void w(b[n.length-1]);if(c&&e<0&&a&&t(),null===g)return;return void w(b[g+e])}w(f)},onDrag:function({draggedDistance:e}){if(null===y)return;const t="bottom"===s||"right"===s?y-e:y+e;("bottom"===s||"right"===s)&&t<b[b.length-1]||("top"===s||"left"===s)&&t>b[b.length-1]||ss(r.current,{transform:ls(s)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:b}}({snapPoints:i,activeSnapPointProp:p,setActiveSnapPointProp:h,drawerRef:Q,fadeFromIndex:f,overlayRef:j,onSnapPointChange:te,direction:x,container:O,snapToSequentialPoint:k});ts({isDisabled:!R||L||!v||F||!I||!T||!E});const{restorePositionSetting:ce}=function({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:i}){const[a,s]=m.useState(()=>"undefined"!=typeof window?window.location.href:""),l=m.useRef(0),u=m.useCallback(()=>{if(Ua()&&null===gs&&e&&!i){gs={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:e,innerHeight:t}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:-l.current+"px",left:-e+"px",right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const e=t-window.innerHeight;e&&l.current>=t&&(document.body.style.top=-(l.current+e)+"px")}),300)}},[e]),c=m.useCallback(()=>{if(Ua()&&null!==gs&&!i){const e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,gs),window.requestAnimationFrame(()=>{o&&a!==window.location.href?s(window.location.href):window.scrollTo(t,e)}),gs=null}},[a]);return m.useEffect(()=>{function e(){l.current=window.scrollY}return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),m.useEffect(()=>{if(t)return()=>{"undefined"!=typeof document&&(document.querySelector("[data-vaul-drawer]")||c())}},[t,c]),m.useEffect(()=>{!n&&r&&(e?(!window.matchMedia("(display-mode: standalone)").matches&&u(),t||window.setTimeout(()=>{c()},500)):c())},[e,r,a,t,n,u,c]),{restorePositionSetting:c}}({isOpen:R,modal:v,nested:null!=y&&y,hasBeenOpened:I,preventScrollRestoration:C,noBodyStyles:w});function de(){return(window.innerWidth-26)/window.innerWidth}function fe(e,t){var n;let r=e;const o=null==(n=window.getSelection())?void 0:n.toString(),i=Q.current?us(Q.current,x):null,a=new Date;if("SELECT"===r.tagName)return!1;if(r.hasAttribute("data-vaul-no-drag")||r.closest("[data-vaul-no-drag]"))return!1;if("right"===x||"left"===x)return!0;if(B.current&&a.getTime()-B.current.getTime()<500)return!1;if(null!==i&&("bottom"===x?i>0:i<0))return!0;if(o&&o.length>0)return!1;if(H.current&&a.getTime()-H.current.getTime()<u&&0===i)return H.current=a,!1;if(t)return H.current=a,!1;for(;r;){if(r.scrollHeight>r.clientHeight){if(0!==r.scrollTop)return H.current=new Date,!1;if("dialog"===r.getAttribute("role"))return!0}r=r.parentNode}return!0}function pe(e){!function(){if(!L||!Q.current)return;Q.current.classList.remove(ps),V.current=!1,A(!1),U.current=new Date}(),null==b||b(),e||z(!1),setTimeout(()=>{i&&oe(i[0])},1e3*ds.DURATION)}function he(){if(!Q.current)return;const e=document.querySelector("[data-vaul-drawer-wrapper]"),t=us(Q.current,x);ss(Q.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${ds.DURATION}s cubic-bezier(${ds.EASE.join(",")})`}),ss(j.current,{transition:`opacity ${ds.DURATION}s cubic-bezier(${ds.EASE.join(",")})`,opacity:"1"}),a&&t&&t>0&&R&&ss(e,{borderRadius:"8px",overflow:"hidden",...ls(x)?{transform:`scale(${de()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${de()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${ds.DURATION}s`,transitionTimingFunction:`cubic-bezier(${ds.EASE.join(",")})`},!0)}return m.useEffect(()=>{window.requestAnimationFrame(()=>{X.current=!0})},[]),m.useEffect(()=>{var e;function t(){if(!Q.current||!T)return;if(os(document.activeElement)||G.current){var e;const t=(null==(e=window.visualViewport)?void 0:e.height)||0,n=window.innerHeight;let r=n-t;const o=Q.current.getBoundingClientRect().height||0,a=o>.8*n;ee.current||(ee.current=o);const s=Q.current.getBoundingClientRect().top;if(Math.abs(K.current-r)>60&&(G.current=!G.current),i&&i.length>0&&ae&&re){r+=ae[re]||0}if(K.current=r,o>t||G.current){const e=Q.current.getBoundingClientRect().height;let n=e;e>t&&(n=t-(a?s:26)),Q.current.style.height=g?e-Math.max(r,0)+"px":`${Math.max(n,t-s)}px`}else(function(){const e=navigator.userAgent;return"undefined"!=typeof window&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))})()||(Q.current.style.height=`${ee.current}px`);i&&i.length>0&&!G.current?Q.current.style.bottom="0px":Q.current.style.bottom=`${Math.max(r,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}},[re,i,ae]),m.useEffect(()=>(R&&(ss(document.documentElement,{scrollBehavior:"auto"}),B.current=new Date),()=>{!function(e,t){if(!(e&&e instanceof HTMLElement))return;let n=as.get(e);n&&(e.style[t]=n[t])}(document.documentElement,"scrollBehavior")}),[R]),m.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),m.createElement(za,{defaultOpen:S,onOpenChange:e=>{(c||e)&&(e?D(!0):pe(!0),z(e))},open:R},m.createElement(Ba.Provider,{value:{activeSnapPoint:ne,snapPoints:i,setActiveSnapPoint:oe,drawerRef:Q,overlayRef:j,onOpenChange:t,onPress:function(e){var t,n;(c||i)&&(Q.current&&!Q.current.contains(e.target)||(Z.current=(null==(t=Q.current)?void 0:t.getBoundingClientRect().height)||0,J.current=(null==(n=Q.current)?void 0:n.getBoundingClientRect().width)||0,A(!0),W.current=new Date,Va()&&window.addEventListener("touchend",()=>V.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),q.current=ls(x)?e.pageY:e.pageX))},onRelease:function(e){if(!L||!Q.current)return;Q.current.classList.remove(ps),V.current=!1,A(!1),U.current=new Date;const t=us(Q.current,x);if(!e||!fe(e.target,!1)||!t||Number.isNaN(t))return;if(null===W.current)return;const n=U.current.getTime()-W.current.getTime(),r=q.current-(ls(x)?e.pageY:e.pageX),a=Math.abs(r)/n;if(a>.05&&($(!0),setTimeout(()=>{$(!1)},200)),i){return ie({draggedDistance:r*("bottom"===x||"right"===x?1:-1),closeDrawer:pe,velocity:a,dismissible:c}),void(null==o||o(e,!0))}if("bottom"===x||"right"===x?r>0:r<0)return he(),void(null==o||o(e,!0));if(a>.4)return pe(),void(null==o||o(e,!1));var s;const u=Math.min(null!=(s=Q.current.getBoundingClientRect().height)?s:0,window.innerHeight);var d;const f=Math.min(null!=(d=Q.current.getBoundingClientRect().width)?d:0,window.innerWidth),p="left"===x||"right"===x;if(Math.abs(t)>=(p?f:u)*l)return pe(),void(null==o||o(e,!1));null==o||o(e,!0),he()},onDrag:function(e){if(Q.current&&L){const t="bottom"===x||"right"===x?1:-1,n=(q.current-(ls(x)?e.pageY:e.pageX))*t,o=n>0,s=i&&!c&&!o;if(s&&0===re)return;const l=Math.abs(n),u=document.querySelector("[data-vaul-drawer-wrapper]");let d=l/("bottom"===x||"top"===x?Z.current:J.current);const p=ue(l,o);if(null!==p&&(d=p),s&&d>=1)return;if(!V.current&&!fe(e.target,o))return;if(Q.current.classList.add(ps),V.current=!0,ss(Q.current,{transition:"none"}),ss(j.current,{transition:"none"}),i&&se({draggedDistance:n}),o&&!i){const e=function(e){return 8*(Math.log(e+1)-2)}(n),r=Math.min(-1*e,0)*t;return void ss(Q.current,{transform:ls(x)?`translate3d(0, ${r}px, 0)`:`translate3d(${r}px, 0, 0)`})}const h=1-d;if((le||f&&re===f-1)&&(null==r||r(e,d),ss(j.current,{opacity:`${h}`,transition:"none"},!0)),u&&j.current&&a){const e=Math.min(de()+d*(1-de()),1),t=8-8*d,n=Math.max(0,14-14*d);ss(u,{borderRadius:`${t}px`,transform:ls(x)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!i){const e=l*t;ss(Q.current,{transform:ls(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:c,shouldAnimate:X,handleOnly:d,isOpen:R,isDragging:L,shouldFade:le,closeDrawer:pe,onNestedDrag:function(e,t){if(t<0)return;const n=(window.innerWidth-fs)/window.innerWidth,r=n+t*(1-n),o=t*fs-16;ss(Q.current,{transform:ls(x)?`scale(${r}) translate3d(0, ${o}px, 0)`:`scale(${r}) translate3d(${o}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){const t=e?(window.innerWidth-fs)/window.innerWidth:1,n=e?-16:0;Y.current&&window.clearTimeout(Y.current),ss(Q.current,{transition:`transform ${ds.DURATION}s cubic-bezier(${ds.EASE.join(",")})`,transform:ls(x)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&Q.current&&(Y.current=setTimeout(()=>{const e=us(Q.current,x);ss(Q.current,{transition:"none",transform:ls(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){const n=ls(x)?window.innerHeight:window.innerWidth,r=t?(n-fs)/n:1,o=t?-16:0;t&&ss(Q.current,{transition:`transform ${ds.DURATION}s cubic-bezier(${ds.EASE.join(",")})`,transform:ls(x)?`scale(${r}) translate3d(0, ${o}px, 0)`:`scale(${r}) translate3d(${o}px, 0, 0)`})},keyboardIsOpen:G,modal:v,snapPointsOffset:ae,activeSnapPointIndex:re,direction:x,shouldScaleBackground:a,setBackgroundColorOnScale:s,noBodyStyles:w,container:O,autoFocus:M}},n))}const bs=m.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:i,isOpen:a,modal:s,shouldAnimate:l}=Wa(),u=is(t,n),c=r&&r.length>0;if(!s)return null;const d=m.useCallback(e=>o(e),[o]);return m.createElement(La,{onMouseUp:d,ref:u,"data-vaul-overlay":"","data-vaul-snap-points":a&&c?"true":"false","data-vaul-snap-points-overlay":a&&i?"true":"false","data-vaul-animate":(null==l?void 0:l.current)?"true":"false",...e})});bs.displayName="Drawer.Overlay";const ys=m.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:i,onPress:a,onRelease:s,onDrag:l,keyboardIsOpen:u,snapPointsOffset:c,activeSnapPointIndex:d,modal:f,isOpen:p,direction:g,snapPoints:v,container:b,handleOnly:y,shouldAnimate:w,autoFocus:x}=Wa(),[S,E]=m.useState(!1),k=is(o,i),C=m.useRef(null),T=m.useRef(null),P=m.useRef(!1),O=v&&v.length>0;!function(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=Wa(),i=m.useRef(null),a=h.useMemo(()=>document.body.style.backgroundColor,[]);function s(){return(window.innerWidth-26)/window.innerWidth}m.useEffect(()=>{if(t&&n){i.current&&clearTimeout(i.current);const t=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!t)return;r&&!o&&cs(document.body,{background:"black"}),cs(t,{transformOrigin:ls(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${ds.DURATION}s`,transitionTimingFunction:`cubic-bezier(${ds.EASE.join(",")})`});const n=cs(t,{borderRadius:"8px",overflow:"hidden",...ls(e)?{transform:`scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),i.current=window.setTimeout(()=>{a?document.body.style.background=a:document.body.style.removeProperty("background")},1e3*ds.DURATION)}}},[t,n,a])}();function M(e){C.current=null,P.current=!1,s(e)}return m.useEffect(()=>{O&&window.requestAnimationFrame(()=>{E(!0)})},[]),m.createElement(Aa,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":S?"true":"false","data-vaul-snap-points":p&&O?"true":"false","data-vaul-custom-container":b?"true":"false","data-vaul-animate":(null==w?void 0:w.current)?"true":"false",...r,ref:k,style:c&&c.length>0?{"--snap-point-height":`${c[null!=d?d:0]}px`,...t}:t,onPointerDown:e=>{y||(null==r.onPointerDown||r.onPointerDown.call(r,e),C.current={x:e.pageX,y:e.pageY},a(e))},onOpenAutoFocus:e=>{null==n||n(e),x||e.preventDefault()},onPointerDownOutside:t=>{null==e||e(t),f&&!t.defaultPrevented?u.current&&(u.current=!1):t.preventDefault()},onFocusOutside:e=>{f||e.preventDefault()},onPointerMove:e=>{if(T.current=e,y)return;if(null==r.onPointerMove||r.onPointerMove.call(r,e),!C.current)return;const t=e.pageY-C.current.y,n=e.pageX-C.current.x,o="touch"===e.pointerType?10:2,i=((e,t,n=0)=>{if(P.current)return!0;const r=Math.abs(e.y),o=Math.abs(e.x),i=o>r,a=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*a<0)&&o>=0&&o<=n)return i}else if(!(e.y*a<0)&&r>=0&&r<=n)return!i;return P.current=!0,!0})({x:n,y:t},g,o);i?l(e):(Math.abs(n)>o||Math.abs(t)>o)&&(C.current=null)},onPointerUp:e=>{null==r.onPointerUp||r.onPointerUp.call(r,e),C.current=null,P.current=!1,s(e)},onPointerOut:e=>{null==r.onPointerOut||r.onPointerOut.call(r,e),M(T.current)},onContextMenu:e=>{null==r.onContextMenu||r.onContextMenu.call(r,e),T.current&&M(T.current)}})});ys.displayName="Drawer.Content";const ws=m.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:i,snapPoints:a,activeSnapPoint:s,setActiveSnapPoint:l,dismissible:u,handleOnly:c,isOpen:d,onPress:f,onDrag:p}=Wa(),h=m.useRef(null),g=m.useRef(!1);function v(){h.current&&window.clearTimeout(h.current),g.current=!1}return m.createElement("div",{onClick:function(){g.current?v():window.setTimeout(()=>{!function(){if(i||e||g.current)return void v();if(v(),!a||0===a.length)return void(u||o());if(s===a[a.length-1]&&u)return void o();const t=a.findIndex(e=>e===s);if(-1===t)return;const n=a[t+1];l(n)}()},120)},onPointerCancel:v,onPointerDown:e=>{c&&f(e),h.current=window.setTimeout(()=>{g.current=!0},250)},onPointerMove:e=>{c&&p(e)},ref:r,"data-vaul-drawer-visible":d?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},m.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});ws.displayName="Drawer.Handle";const xs={Root:vs,NestedRoot:function({onDrag:e,onOpenChange:t,open:n,...r}){const{onNestedDrag:o,onNestedOpenChange:i,onNestedRelease:a}=Wa();if(!o)throw new Error("Drawer.NestedRoot must be placed in another drawer");return m.createElement(vs,{nested:!0,open:n,onClose:()=>{i(!1)},onDrag:(t,n)=>{o(t,n),null==e||e(t,n)},onOpenChange:e=>{e&&i(e),null==t||t(e)},onRelease:a,...r})},Content:ys,Overlay:bs,Trigger:Ia,Portal:function(e){const t=Wa(),{container:n=t.container,...r}=e;return m.createElement(Da,{container:n,...r})},Handle:ws,Close:ja,Title:Fa,Description:$a};function Ss(e){var t=Z(e,[]);return h.createElement(xs.Root,Object.assign({"data-slot":"drawer"},t))}function Es(e){var t=Z(e,[]);return h.createElement(xs.Trigger,Object.assign({"data-slot":"drawer-trigger"},t))}function ks(e){var t=Z(e,[]);return h.createElement(xs.Portal,Object.assign({"data-slot":"drawer-portal"},t))}function Cs(e){var{className:t}=e,n=Z(e,["className"]);return h.createElement(xs.Overlay,Object.assign({"data-slot":"drawer-overlay",className:Dt("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[999999] bg-black/50",t)},n))}function Ts(e){var{className:t,children:n}=e,r=Z(e,["className","children"]);return h.createElement(ks,{"data-slot":"drawer-portal"},h.createElement(Cs,null),h.createElement(xs.Content,Object.assign({"data-slot":"drawer-content",className:Dt("group/drawer-content bg-background fixed z-[999999] flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",t)},r),h.createElement("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),n))}function Ps(e){var{className:t}=e,n=Z(e,["className"]);return h.createElement("div",Object.assign({"data-slot":"drawer-header",className:Dt("flex flex-col gap-1.5 p-4",t)},n))}function Os(e){var{className:t}=e,n=Z(e,["className"]);return h.createElement(xs.Title,Object.assign({"data-slot":"drawer-title",className:Dt("text-foreground font-semibold",t)},n))}const Ms=({children:e,products:t,contentId:n})=>{const{isPreview:r}=cn();return m.createElement(Ss,{direction:"right",fadeFromIndex:0,snapPoints:[1]},m.createElement(Es,{className:"w-full"},e),m.createElement(Ts,null,m.createElement(Ps,null,m.createElement(Os,null,"상품 목록")),m.createElement("div",{className:"overflow-y-scroll grid-cols-2 grid items-baseline justify-items-center scrollbar-hide"},t.map(e=>e.linkPath?m.createElement("a",{key:e.productId,className:"p-2 text-gray-800 w-full h-full flex flex-col items-center justify-center no-underline",href:e.linkPath,target:"_blank",onClick:()=>J(void 0,void 0,void 0,function*(){r||(yield Qt({contentId:n,contentProductId:e.eventProductId,productId:e.productId}))})},m.createElement(Ns,{product:e})):m.createElement(Ns,{key:e.productId,product:e})))))},Ns=({product:e})=>m.createElement("div",{className:"text-gray-800 w-32"},m.createElement("div",{className:"w-full aspect-square mb-2 border border-[#f4f3f6] rounded "},m.createElement("img",{src:e.thumbPath,alt:e.productName,className:"w-full h-full"})),e.brand&&m.createElement("p",{className:"text-xs text-gray-400 mb-1"},e.brand.brandName),m.createElement("p",{className:"w-full text-[12px] md:text-[15px] mb-1"},e.productName),m.createElement("div",{className:"w-full "},m.createElement("div",{className:"flex"},m.createElement("span",{className:"text-sm text-red-500 mr-2 font-semibold"},e.discount,"%"),m.createElement("span",{className:"font-semibold"},Lt(e.sellingPrice),"원"))));function _s(e){let t,n,{swiper:r,extendParams:o,on:i,emit:a,params:s}=e;r.autoplay={running:!1,paused:!1,timeLeft:0},o({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let l,u,c,d,f,p,h,m,g=s&&s.autoplay?s.autoplay.delay:3e3,v=s&&s.autoplay?s.autoplay.delay:3e3,b=(new Date).getTime();function y(e){r&&!r.destroyed&&r.wrapperEl&&e.target===r.wrapperEl&&(r.wrapperEl.removeEventListener("transitionend",y),m||e.detail&&e.detail.bySwiperTouchMove||C())}const w=()=>{if(r.destroyed||!r.autoplay.running)return;r.autoplay.paused?u=!0:u&&(v=l,u=!1);const e=r.autoplay.paused?l:b+v-(new Date).getTime();r.autoplay.timeLeft=e,a("autoplayTimeLeft",e,e/g),n=requestAnimationFrame(()=>{w()})},x=e=>{if(r.destroyed||!r.autoplay.running)return;cancelAnimationFrame(n),w();let o=void 0===e?r.params.autoplay.delay:e;g=r.params.autoplay.delay,v=r.params.autoplay.delay;const i=(()=>{let e;if(e=r.virtual&&r.params.virtual.enabled?r.slides.filter(e=>e.classList.contains("swiper-slide-active"))[0]:r.slides[r.activeIndex],!e)return;return parseInt(e.getAttribute("data-swiper-autoplay"),10)})();!Number.isNaN(i)&&i>0&&void 0===e&&(o=i,g=i,v=i),l=o;const s=r.params.speed,u=()=>{r&&!r.destroyed&&(r.params.autoplay.reverseDirection?!r.isBeginning||r.params.loop||r.params.rewind?(r.slidePrev(s,!0,!0),a("autoplay")):r.params.autoplay.stopOnLastSlide||(r.slideTo(r.slides.length-1,s,!0,!0),a("autoplay")):!r.isEnd||r.params.loop||r.params.rewind?(r.slideNext(s,!0,!0),a("autoplay")):r.params.autoplay.stopOnLastSlide||(r.slideTo(0,s,!0,!0),a("autoplay")),r.params.cssMode&&(b=(new Date).getTime(),requestAnimationFrame(()=>{x()})))};return o>0?(clearTimeout(t),t=setTimeout(()=>{u()},o)):requestAnimationFrame(()=>{u()}),o},S=()=>{b=(new Date).getTime(),r.autoplay.running=!0,x(),a("autoplayStart")},E=()=>{r.autoplay.running=!1,clearTimeout(t),cancelAnimationFrame(n),a("autoplayStop")},k=(e,n)=>{if(r.destroyed||!r.autoplay.running)return;clearTimeout(t),e||(h=!0);const o=()=>{a("autoplayPause"),r.params.autoplay.waitForTransition?r.wrapperEl.addEventListener("transitionend",y):C()};if(r.autoplay.paused=!0,n)return p&&(l=r.params.autoplay.delay),p=!1,void o();const i=l||r.params.autoplay.delay;l=i-((new Date).getTime()-b),r.isEnd&&l<0&&!r.params.loop||(l<0&&(l=0),o())},C=()=>{r.isEnd&&l<0&&!r.params.loop||r.destroyed||!r.autoplay.running||(b=(new Date).getTime(),h?(h=!1,x(l)):x(),r.autoplay.paused=!1,a("autoplayResume"))},T=()=>{if(r.destroyed||!r.autoplay.running)return;const e=bn();"hidden"===e.visibilityState&&(h=!0,k(!0)),"visible"===e.visibilityState&&C()},P=e=>{"mouse"===e.pointerType&&(h=!0,m=!0,r.animating||r.autoplay.paused||k(!0))},O=e=>{"mouse"===e.pointerType&&(m=!1,r.autoplay.paused&&C())};i("init",()=>{r.params.autoplay.enabled&&(r.params.autoplay.pauseOnMouseEnter&&(r.el.addEventListener("pointerenter",P),r.el.addEventListener("pointerleave",O)),bn().addEventListener("visibilitychange",T),S())}),i("destroy",()=>{r.el&&"string"!=typeof r.el&&(r.el.removeEventListener("pointerenter",P),r.el.removeEventListener("pointerleave",O)),bn().removeEventListener("visibilitychange",T),r.autoplay.running&&E()}),i("_freeModeStaticRelease",()=>{(d||h)&&C()}),i("_freeModeNoMomentumRelease",()=>{r.params.autoplay.disableOnInteraction?E():k(!0,!0)}),i("beforeTransitionStart",(e,t,n)=>{!r.destroyed&&r.autoplay.running&&(n||!r.params.autoplay.disableOnInteraction?k(!0,!0):E())}),i("sliderFirstMove",()=>{!r.destroyed&&r.autoplay.running&&(r.params.autoplay.disableOnInteraction?E():(c=!0,d=!1,h=!1,f=setTimeout(()=>{h=!0,d=!0,k(!0)},200)))}),i("touchEnd",()=>{if(!r.destroyed&&r.autoplay.running&&c){if(clearTimeout(f),clearTimeout(t),r.params.autoplay.disableOnInteraction)return d=!1,void(c=!1);d&&r.params.cssMode&&C(),d=!1,c=!1}}),i("slideChange",()=>{!r.destroyed&&r.autoplay.running&&(p=!0)}),Object.assign(r.autoplay,{start:S,stop:E,pause:k,resume:C})}function Rs(e,t){const n=Mn(t);return n!==t&&(n.style.backfaceVisibility="hidden",n.style["-webkit-backface-visibility"]="hidden"),n}function zs(e){let{swiper:t,duration:n,transformElements:r,allSlides:o}=e;const{activeIndex:i}=t;if(t.params.virtualTranslate&&0!==n){let e,n=!1;e=o?r:r.filter(e=>{const n=e.classList.contains("swiper-slide-transform")?(e=>{if(!e.parentElement)return t.slides.filter(t=>t.shadowRoot&&t.shadowRoot===e.parentNode)[0];return e.parentElement})(e):e;return t.getSlideIndex(n)===i}),e.forEach(e=>{!function(e,t){t&&e.addEventListener("transitionend",function n(r){r.target===e&&(t.call(e,r),e.removeEventListener("transitionend",n))})}(e,()=>{if(n)return;if(!t||t.destroyed)return;n=!0,t.animating=!1;const e=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});t.wrapperEl.dispatchEvent(e)})})}}function Is(e,t,n){const r=`swiper-slide-shadow swiper-slide-shadow-${e}`,o=Mn(t);let i=o.querySelector(`.${r.split(" ").join(".")}`);return i||(i=Rn("div",r.split(" ")),o.append(i)),i}function Ds(e){let{swiper:t,extendParams:n,on:r}=e;n({cardsEffect:{slideShadows:!0,rotate:!0,perSlideRotate:2,perSlideOffset:8}});!function(e){const{effect:t,swiper:n,on:r,setTranslate:o,setTransition:i,overwriteParams:a,perspective:s,recreateShadows:l,getEffectParams:u}=e;let c;r("beforeInit",()=>{if(n.params.effect!==t)return;n.classNames.push(`${n.params.containerModifierClass}${t}`),s&&s()&&n.classNames.push(`${n.params.containerModifierClass}3d`);const e=a?a():{};Object.assign(n.params,e),Object.assign(n.originalParams,e)}),r("setTranslate",()=>{n.params.effect===t&&o()}),r("setTransition",(e,r)=>{n.params.effect===t&&i(r)}),r("transitionEnd",()=>{if(n.params.effect===t&&l){if(!u||!u().slideShadows)return;n.slides.forEach(e=>{e.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(e=>e.remove())}),l()}}),r("virtualUpdate",()=>{n.params.effect===t&&(n.slides.length||(c=!0),requestAnimationFrame(()=>{c&&n.slides&&n.slides.length&&(o(),c=!1)}))})}({effect:"cards",swiper:t,on:r,setTranslate:()=>{const{slides:e,activeIndex:n,rtlTranslate:r}=t,o=t.params.cardsEffect,{startTranslate:i,isTouched:a}=t.touchEventsData,s=r?-t.translate:t.translate;for(let l=0;l<e.length;l+=1){const u=e[l],c=u.progress,d=Math.min(Math.max(c,-4),4);let f=u.swiperSlideOffset;t.params.centeredSlides&&!t.params.cssMode&&(t.wrapperEl.style.transform=`translateX(${t.minTranslate()}px)`),t.params.centeredSlides&&t.params.cssMode&&(f-=e[0].swiperSlideOffset);let p=t.params.cssMode?-f-t.translate:-f,h=0;const m=-100*Math.abs(d);let g=1,v=-o.perSlideRotate*d,b=o.perSlideOffset-.75*Math.abs(d);const y=t.virtual&&t.params.virtual.enabled?t.virtual.from+l:l,w=(y===n||y===n-1)&&d>0&&d<1&&(a||t.params.cssMode)&&s<i,x=(y===n||y===n+1)&&d<0&&d>-1&&(a||t.params.cssMode)&&s>i;if(w||x){const e=(1-Math.abs((Math.abs(d)-.5)/.5))**.5;v+=-28*d*e,g+=-.5*e,b+=96*e,h=-25*e*Math.abs(d)+"%"}if(p=d<0?`calc(${p}px ${r?"-":"+"} (${b*Math.abs(d)}%))`:d>0?`calc(${p}px ${r?"-":"+"} (-${b*Math.abs(d)}%))`:`${p}px`,!t.isHorizontal()){const e=h;h=p,p=e}const S=d<0?""+(1+(1-g)*d):""+(1-(1-g)*d),E=`\n translate3d(${p}, ${h}, ${m}px)\n rotateZ(${o.rotate?r?-v:v:0}deg)\n scale(${S})\n `;if(o.slideShadows){let e=u.querySelector(".swiper-slide-shadow");e||(e=Is("cards",u)),e&&(e.style.opacity=Math.min(Math.max((Math.abs(d)-.5)/.5,0),1))}u.style.zIndex=-Math.abs(Math.round(c))+e.length;Rs(0,u).style.transform=E}},setTransition:e=>{const n=t.slides.map(e=>Mn(e));n.forEach(t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow").forEach(t=>{t.style.transitionDuration=`${e}ms`})}),zs({swiper:t,duration:e,transformElements:n})},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!t.params.cssMode})})}const Ls=({products:e,useDrawer:t,contentId:n})=>{const r=h.useMemo(()=>(e=>{if(e.length>=3)return e;const t=[...e];for(;t.length<3;)t.push(...e);return t})(e),[e]),o=1===(null==e?void 0:e.length);return(null==e?void 0:e.length)?m.createElement("div",{className:"w-full",style:{height:"80px"}},o?m.createElement("div",{className:"bg-white overflow-hidden rounded-xl w-full",style:{borderRadius:"10px",height:"80px"}},t?m.createElement(Ms,{products:e,contentId:n},m.createElement(po,{product:e[0],productsLength:e.length,contentId:n})):m.createElement(po,{product:e[0],productsLength:e.length,hideMoreBtn:!0,contentId:n})):m.createElement(Rr,{nested:!0,modules:[Ds,_s],slidesPerView:1.1,effect:"cards",autoplay:!0,loop:!0,grabCursor:!0,cardsEffect:{rotate:!1},className:"w-full",style:{height:"80px"}},r.map((r,o)=>m.createElement(zr,{key:o+r.productId,className:"bg-white overflow-hidden rounded-xl",style:{borderRadius:"10px",height:"80px"}},t?m.createElement(Ms,{products:e,contentId:n},m.createElement(po,{product:r,productsLength:e.length,contentId:n})):m.createElement(po,{product:r,productsLength:e.length,hideMoreBtn:!0,contentId:n}))))):null},As=({shortForm:e,useDrawer:t,isPopup:n,shareUrl:r,handleClose:o})=>{const[i,a]=h.useState(!Boolean(n)),[s,l]=h.useState(!0),{logo:u,productsInfo:c,thumbPath:d,title:f,media:p,brand:g,shortsId:v}=e;return m.createElement("div",{className:"h-full w-full text-sm overflow-hidden text-white relative"},m.createElement("div",{style:{backgroundImage:"linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 50%, rgba(0,0,0,0.4) 100%)",padding:"15px"},className:"absolute h-full flex flex-col w-full z-[1] justify-between inset-0 bg-gradient-to-b from-black/40 via-transparent to-black/40"},m.createElement("div",{className:"flex gap-2 justify-between "},m.createElement("div",{className:"max-w-16"},(null==u?void 0:u.thumbPath)?m.createElement("img",{className:"mb-1",src:u.thumbPath,alt:u.logoName,width:100,height:100}):null),m.createElement("div",{className:"justify-self-end flex gap-2"},m.createElement("div",{className:"cursor-pointer text-white ",onClick:()=>{l(e=>!e)}},s?m.createElement(Jr,{size:20}):m.createElement(eo,{size:20})),m.createElement("div",{className:"cursor-pointer text-white ",onClick:()=>{a(e=>!e)}},i?m.createElement(ro,{size:20}):m.createElement(no,{size:20})),m.createElement("div",{className:"cursor-pointer text-white ",onClick:o},m.createElement(oo,{size:20})))),m.createElement("div",null,m.createElement("div",{className:"flex justify-between items-end mb-3 gap-3"},m.createElement("div",{className:"w-full"},g&&m.createElement("div",{className:"items-center flex gap-3 mb-2"},m.createElement("div",{className:"w-12 h-12 bg-white rounded-full border overflow-hidden"},m.createElement("img",{src:g.thumbPath,alt:g.brandName,width:100,height:100,className:"object-contain w-full h-full"})),m.createElement("p",{style:{fontSize:"14px",textAlign:"start"}},null==g?void 0:g.brandName)),m.createElement("p",{style:{fontSize:"14px",textAlign:"start"}},f)),m.createElement("div",{className:"flex flex-col items-center",style:{gap:"15px"}},m.createElement(so,{shortsId:v}),m.createElement("div",{className:"w-[24px] h-[24px] flex items-center justify-center"},m.createElement(uo,{shortForm:e,shareUrl:r})))),c&&m.createElement(Ls,{products:c,useDrawer:t,contentId:e.shortsId}))),m.createElement(io,{file:At(null==p?void 0:p.objectId),thumbnail:`${Ut(d)}`,mute:i,isVertical:(null==p?void 0:p.height)>(null==p?void 0:p.width),play:s}))},Fs=m.memo(({shortform:e,shareUrl:t,handleClose:n})=>m.createElement(m.Fragment,null,m.createElement("div",{onClick:e=>e.stopPropagation(),className:"overflow-hidden",style:{borderRadius:"10px",overflow:"hidden",width:"100%",height:"100%",backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"cover",backgroundImage:`url(${Ut(e.thumbPath)})`}},m.createElement(As,{handleClose:n,shortForm:e,useDrawer:!1,isPopup:!0,shareUrl:t})))),$s=m.memo(({shortform:e})=>m.createElement("div",{onClick:e=>{e.stopPropagation()},style:{width:"100%",height:"100%",borderRadius:"10px",backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"cover",backgroundImage:`url(${e.thumbPath.includes("https")?e.thumbPath:`https://${e.thumbPath}`})`}})),js=({shortform:e,shareUrl:t,handleClose:n})=>{const{isActive:r}=h.useContext(Nr),o=h.useContext(_r),i=Ir().width<430||Ur.isMobile;return m.createElement("div",{className:"flex items-center justify-center w-full h-full select-none",onClick:e=>{n()}},m.createElement("div",{className:"max-h-full flex items-center justify-center",style:{width:"100%",aspectRatio:i?"auto":"9 / 16",height:i?"100dvh":"auto",maxHeight:i?void 0:"90vh",transform:i?void 0:`scale(${r?1:.8})`,transition:"transform 180ms ease"}},r?m.createElement("div",{className:"flex items-center justify-between w-full h-full text-white relative"},m.createElement("div",{className:"cursor-pointer absolute",onClick:e=>{e.stopPropagation(),o.slidePrev()},style:{zIndex:1e5,left:i?"0":"-30px",top:"50%",transform:"translateY(-50%)",width:30,height:30,display:"grid",placeItems:"center",pointerEvents:"auto"}},m.createElement(Kr,{size:28})),m.createElement(Fs,{shortform:e,shareUrl:t,handleClose:n}),m.createElement("div",{className:"cursor-pointer absolute",style:{zIndex:1e5,right:i?"0":"-30px",top:"50%",transform:"translateY(-50%)",width:30,height:30,display:"grid",placeItems:"center",pointerEvents:"auto"},onClick:e=>{e.stopPropagation(),o.slideNext()}},m.createElement(Qr,{size:28}))):m.createElement($s,{shortform:e})))},{PLAYER_BACK_BASE_URL:Bs}=It(),Ws=({collection:e,initialShortsId:t,onSlideChange:n,onClosePlayer:r})=>{var o;const i=h.useMemo(()=>Math.max(e.contents.findIndex(e=>e.shortsId===t),0),[e.contents,t]),a=e.contents.length,s=Math.max(a,10),l=null!==(o=Ir().width)&&void 0!==o?o:0,u=l<430||Ur.isMobile,c=u?1:l>=1200?4:l>=900?3:2,d=h.useMemo(()=>(e=>{const t=[...e];for(;t.length<s;)t.push(...e);return t})(e.contents),[e.contents]),f=h.useRef(null);return m.createElement("div",{style:{minHeight:100,minWidth:300},className:"w-full"},m.createElement(Rr,{style:{minHeight:100,overflow:"visible"},initialSlide:i,ref:f,lazyPreloadPrevNext:2,className:"w-full",spaceBetween:u?8:l>=1200?24:l>=900?25:16,slidesPerView:c,grabCursor:!0,centeredSlides:1!==c,onSlideChangeTransitionEnd:t=>{const r=t.realIndex%a;null==n||n(r);const o=e.contents[(r+1)%a];var i;i=At(o.media.objectId),Dr||(Dr=document.createElement("video"),Dr.muted=!0,Dr.playsInline=!0,Dr.preload="metadata",Dr.loop=!0,Dr.style.cssText="position:fixed;left:-9999px;top:-9999px;width:1px;height:1px;opacity:0",document.body.appendChild(Dr)),Lr!==i&&(Dr.src=i,Dr.load(),Lr=i)},loop:!0,slideToClickedSlide:!0},d.map((t,n)=>m.createElement(zr,{key:n},m.createElement(js,{handleClose:r,shortform:t,shareUrl:`${Bs}/collection/${e.colId}?start=${t.shortsId}&layout=5`})))))},Us=({shortform:e,onThumbnailClick:t,iconSize:n,exposeTitle:r,borderLine:o})=>{const i=h.useMemo(()=>Wt(o),[o])?{background:"linear-gradient(#fff,#fff) padding-box, conic-gradient(#f58529,#f77737,#fd1d1d,#833ab4,#c13584,#f58529) border-box",border:"3px solid transparent"}:{background:"#fff",border:"3px solid #fff"};return m.createElement("div",{className:"flex flex-col w-full gap-2",onClick:()=>t(e.shortsId)},m.createElement("div",{className:"rounded-full overflow-hidden cursor-pointer",style:Object.assign({width:n,height:n,padding:4},i)},m.createElement("img",{src:Ut(e.thumbPath),alt:"thumbnail",className:"w-full h-full object-cover block rounded-full"})),r&&m.createElement("span",{style:{width:n},className:"text-black overflow-hidden text-[12px] whitespace-nowrap text-center text-clip cursor-default"},e.title))},Hs=un(e=>({open:!1,setOpen:t=>e({open:t})})),Vs=({product:e,productLength:t,hideMoreBadge:n=!1,contentId:r,lineClamp:o,showMoreBtn:i=!1,openProductPopup:a})=>{const{isPreview:s}=cn();return m.createElement(m.Fragment,null,m.createElement("div",{className:"product-banner border mbus-border",onClick:()=>J(void 0,void 0,void 0,function*(){n&&(window.open(e.linkPath,"_blank"),s||(yield Qt({contentProductId:e.eventProductId,contentId:r,productId:e.productId})))})},m.createElement("span",{className:"product-banner__clip","aria-hidden":!0},m.createElement("span",{className:"product-banner__sheen"})),m.createElement("div",{className:"relative",style:{width:"40%",minWidth:"40%"}},m.createElement("img",{style:{borderRadius:"0.625rem"},className:"aspect-square rounded-lg object-cover w-full",src:Ut(e.thumbPath),alt:e.productName}),!n&&m.createElement("p",{className:"absolute text-white rounded-lg",style:{backgroundColor:"#797979",top:-10,right:-10,padding:"2px 4px",fontSize:"10px",borderRadius:"0.625rem"}},"+",t)),m.createElement("div",{style:{position:"relative",zIndex:2,minWidth:0,flex:1,paddingRight:24}},m.createElement("p",{style:{display:"-webkit-box",WebkitLineClamp:o||2,WebkitBoxOrient:"vertical",overflow:"hidden",wordBreak:"break-word",fontWeight:600,color:"#494949"}},e.productName)),m.createElement("span",{className:"product-banner__arrow","aria-hidden":!0},"›")),i&&t>1&&m.createElement("div",{onClick:a,className:" flex items-center justify-center border mbus-border cursor-pointer",style:{borderRadius:"0.625rem",padding:"10px",backgroundColor:"#f5f5f5",fontWeight:600}},"+ 더보기 (",t,")"))},Ys=({products:e,iconSize:t,contentId:n,setSelectedProducts:r,showMoreBtn:o,hideMoreBadge:i})=>{const{setOpen:a}=Hs(),s=()=>{r({productsInfo:e,shortsId:n}),a(!0)};return m.createElement(m.Fragment,null,m.createElement("div",{onClick:()=>J(void 0,void 0,void 0,function*(){1===e.length||o||s()}),className:"flex flex-col gap-2 mt-4 text-gray-800",style:{maxWidth:t||"100%",fontSize:13}},m.createElement(Vs,{showMoreBtn:o,lineClamp:2,product:e[0],contentId:n,productLength:e.length,hideMoreBadge:null!=i?i:1===e.length,openProductPopup:s})))},qs=({product:e,maxWidth:t="100%",height:n,cardWidth:r})=>m.createElement("div",{className:"flex items-center justify-between gap-2 rounded-lg bg-white text-gray-900 ",style:{maxWidth:t,height:n,width:"100%",paddingRight:8}},m.createElement("img",{src:Ut(e.thumbPath),alt:e.productName,className:"rounded-md object-cover flex-shrink-0",style:{height:"100%",aspectRatio:"1 / 1"}}),m.createElement("div",{className:"flex-1 min-w-0 flex flex-col justify-center"},m.createElement("span",{className:"leading-tight truncate",style:{fontSize:12}},e.productName),m.createElement("span",{className:"leading-tight truncate",style:{fontSize:11}},"number"==typeof e.sellingPrice&&e.sellingPrice<e.price?"number"==typeof r&&r>=190?m.createElement(m.Fragment,null,m.createElement("span",{style:{color:"#dc2626",fontWeight:600,marginRight:4}},Lt(e.sellingPrice),"원"),m.createElement("span",{style:{color:"#9ca3af",textDecoration:"line-through"}},Lt(e.price),"원")):m.createElement("span",{style:{color:"#dc2626",fontWeight:600}},Lt(e.sellingPrice),"원"):m.createElement("span",{style:{color:"#dc2626",fontWeight:600}},Lt(e.price),"원")))),Gs=({playUrl:e,poster:t})=>m.createElement("div",{className:"w-full h-full absolute top-0 left-0 z-10 pointer-events-none",style:{backgroundImage:`url(${t})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}},m.createElement("video",{src:e,autoPlay:!0,muted:!0,preload:"auto",playsInline:!0,loop:!0,className:"w-full h-full object-cover"})),{API_BASE_URL:Xs}=It(),Ks=({shortform:e,onThumbnailClick:t,iconSize:n,exposeTitle:r,rounded:o,borderLine:i,titlePosition:a,exposeProductBanner:s,setSelectedProducts:l,iconRatio:u,hoverPlay:c,exposeProductBadge:d})=>{var f;const p=h.useMemo(()=>Wt(i),[i]),[g,v]=h.useState(!1);return m.createElement("div",{className:"relative"},m.createElement("div",{onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),onClick:()=>t(e.shortsId),style:Object.assign({width:n,aspectRatio:u},o&&{borderRadius:"10px"}),className:`cursor-pointer p-[3px] ${o&&"rounded-xl"} ${p&&"bg-insta"} relative overflow-hidden`},g&&c&&m.createElement(Gs,{playUrl:`${Xs}/direct/${e.media.objectId}`,poster:Ut(e.thumbPath)}),m.createElement("img",{style:Object.assign({},o&&{borderRadius:"10px"}),src:Ut(e.thumbPath),alt:"thumbnail",className:`w-full h-full object-cover ${o&&"rounded-xl"}`}),d&&(null===(f=e.productsInfo)||void 0===f?void 0:f.length)>0&&!(c&&g)&&m.createElement("div",{className:"absolute pointer-events-none flex items-center justify-center z-20",style:{left:2,right:2,bottom:10,height:"20%"}},m.createElement("div",{className:"h-full inline-block",style:{width:"95%"}},m.createElement(qs,{product:e.productsInfo[0],maxWidth:"100%",height:"100%",cardWidth:n})))),r&&!(c&&g&&a===V.INNER)&&m.createElement("p",{style:Object.assign({width:n,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},a===V.INNER&&d?{bottom:"22%"}:{}),className:`my-2 ${a===V.INNER?"absolute bottom-0 left-0 text-white px-2 z-10":""} text-[12px] cursor-default truncate`},e.title),s&&m.createElement(Ys,{setSelectedProducts:l,products:e.productsInfo,iconSize:n,contentId:e.shortsId}))},Qs=e=>{const{iconShape:t,collection:n}=e;return t===W.MANY?m.createElement(Zs,Object.assign({},e)):m.createElement(Js,Object.assign({},e,{shortform:n.contents[0]}))},Zs=e=>{const{collection:t}=e,{thumbnailAutoPlay:n}=e,{setCollection:r,nextKey:o,setNextKey:i,isFetching:a,setIsFetching:s}=pn();return m.createElement(Rr,{freeMode:!0,slidesPerView:"auto",spaceBetween:12,onReachEnd:()=>J(void 0,void 0,void 0,function*(){var e,n,l;if(t&&!(a||(null!==(e=t.count)&&void 0!==e?e:Number.MAX_SAFE_INTEGER)<=t.contents.length)){s(!0);try{const e=yield en({collectionId:t.colId,nextKey:o});if(!e||!(null===(n=e.contents)||void 0===n?void 0:n.length))return;i((null===(l=e.contents.at(-1))||void 0===l?void 0:l.shortsId)||"");const a=new Set(t.contents.map(e=>e.shortsId)),s=e.contents.filter(e=>!a.has(e.shortsId));if(!s.length)return;r(Object.assign(Object.assign({},t),{contents:[...t.contents,...s]}))}catch(e){console.error(e)}finally{s(!1)}}}),modules:n?[_s]:[],autoplay:!!n&&{delay:3e3,disableOnInteraction:!1,pauseOnMouseEnter:!0},loop:n||void 0},null==t?void 0:t.contents.map(t=>m.createElement(zr,{key:t.shortsId,className:"!w-auto"},m.createElement(Js,Object.assign({},e,{shortform:t})))))},Js=e=>{const{iconForm:t}=e;return t===B.INSTA?m.createElement(Us,Object.assign({},e)):m.createElement(Ks,Object.assign({},e))};function el(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function tl(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function nl(...e){return t=>{let n=!1;const r=e.map(e=>{const r=tl(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():tl(e[t],null)}}}}function rl(...e){return h.useCallback(nl(...e),e)}function ol(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const r=n.reduce((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]}),{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var il=globalThis?.document?h.useLayoutEffect:()=>{},al=g[" useId ".trim().toString()]||(()=>{}),sl=0;function ll(e){const[t,n]=h.useState(al());return il(()=>{e||n(e=>e??String(sl++))},[e]),e||(t?`radix-${t}`:"")}var ul=g[" useInsertionEffect ".trim().toString()]||il;function cl({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=function({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),o=h.useRef(n),i=h.useRef(t);return ul(()=>{i.current=t},[t]),h.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}({defaultProp:t,onChange:n}),s=void 0!==e,l=s?e:o;{const t=h.useRef(void 0!==e);h.useEffect(()=>{const e=t.current;if(e!==s){const t=e?"controlled":"uncontrolled",n=s?"controlled":"uncontrolled";console.warn(`${r} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=s},[s,r])}const u=h.useCallback(t=>{if(s){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&a.current?.(n)}else i(t)},[s,e,i,a]);return[l,u]}function dl(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function fl(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function pl(...e){return t=>{let n=!1;const r=e.map(e=>{const r=fl(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():fl(e[t],null)}}}}function hl(...e){return h.useCallback(pl(...e),e)}function ml(e){const t=h.forwardRef((e,t)=>{const{children:n,...r}=e;if(h.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==h.Fragment&&(o.ref=t?pl(t,e):e),h.cloneElement(n,o)}return h.Children.count(n)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gl=Symbol("radix.slottable");function vl(e){return h.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===gl}var bl=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=function(e){const t=ml(e),n=h.forwardRef((e,n)=>{const{children:r,...o}=e,i=h.Children.toArray(r),a=i.find(vl);if(a){const e=a.props.children,r=i.map(t=>t===a?h.Children.count(e)>1?h.Children.only(null):h.isValidElement(e)?e.props.children:null:t);return So.jsx(t,{...o,ref:n,children:h.isValidElement(e)?h.cloneElement(e,void 0,r):null})}return So.jsx(t,{...o,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}(`Primitive.${t}`),r=h.forwardRef((e,r)=>{const{asChild:o,...i}=e,a=o?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),So.jsx(a,{...i,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});var yl,wl="dismissableLayer.update",xl="dismissableLayer.pointerDownOutside",Sl="dismissableLayer.focusOutside",El=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),kl=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...l}=e,u=h.useContext(El),[c,d]=h.useState(null),f=c?.ownerDocument??globalThis?.document,[,p]=h.useState({}),m=hl(t,e=>d(e)),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=g.indexOf(v),y=c?g.indexOf(c):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=b,S=function(e,t=globalThis?.document){const n=Ao(e),r=h.useRef(!1),o=h.useRef(()=>{});return h.useEffect(()=>{const e=e=>{if(e.target&&!r.current){let r=function(){Tl(xl,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}(e=>{const t=e.target,n=[...u.branches].some(e=>e.contains(t));x&&!n&&(o?.(e),a?.(e),e.defaultPrevented||s?.())},f),E=function(e,t=globalThis?.document){const n=Ao(e),r=h.useRef(!1);return h.useEffect(()=>{const e=e=>{if(e.target&&!r.current){Tl(Sl,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(i?.(e),a?.(e),e.defaultPrevented||s?.())},f);return Fo(e=>{y===u.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),h.useEffect(()=>{if(c)return n&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(yl=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),Cl(),()=>{n&&1===u.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=yl)}},[c,f,n,u]),h.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),Cl())},[c,u]),h.useEffect(()=>{const e=()=>p({});return document.addEventListener(wl,e),()=>document.removeEventListener(wl,e)},[]),So.jsx(bl.div,{...l,ref:m,style:{pointerEvents:w?x?"auto":"none":void 0,...e.style},onFocusCapture:dl(e.onFocusCapture,E.onFocusCapture),onBlurCapture:dl(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:dl(e.onPointerDownCapture,S.onPointerDownCapture)})});kl.displayName="DismissableLayer";function Cl(){const e=new CustomEvent(wl);document.dispatchEvent(e)}function Tl(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&No.flushSync(()=>e.dispatchEvent(t))}(o,i):o.dispatchEvent(i)}h.forwardRef((e,t)=>{const n=h.useContext(El),r=h.useRef(null),o=hl(t,r);return h.useEffect(()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),So.jsx(bl.div,{...e,ref:o})}).displayName="DismissableLayerBranch";var Pl=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=h.useState(),r=h.useRef(null),o=h.useRef(e),i=h.useRef("none"),a=e?"mounted":"unmounted",[s,l]=function(e,t){return h.useReducer((e,n)=>t[e][n]??e,e)}(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const e=Ol(r.current);i.current="mounted"===s?e:"none"},[s]),il(()=>{const t=r.current,n=o.current;if(n!==e){const r=i.current,a=Ol(t);if(e)l("MOUNT");else if("none"===a||"none"===t?.display)l("UNMOUNT");else{l(n&&r!==a?"ANIMATION_OUT":"UNMOUNT")}o.current=e}},[e,l]),il(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,a=i=>{const a=Ol(r.current).includes(i.animationName);if(i.target===t&&a&&(l("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(i.current=Ol(r.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:h.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}(t),o="function"==typeof n?n({present:r.isPresent}):h.Children.only(n),i=rl(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof n||r.isPresent?h.cloneElement(o,{ref:i}):null};function Ol(e){return e?.animationName||"none"}function Ml(e){const t=Nl(e),n=h.forwardRef((e,n)=>{const{children:r,...o}=e,i=h.Children.toArray(r),a=i.find(Rl);if(a){const e=a.props.children,r=i.map(t=>t===a?h.Children.count(e)>1?h.Children.only(null):h.isValidElement(e)?e.props.children:null:t);return So.jsx(t,{...o,ref:n,children:h.isValidElement(e)?h.cloneElement(e,void 0,r):null})}return So.jsx(t,{...o,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Nl(e){const t=h.forwardRef((e,t)=>{const{children:n,...r}=e;if(h.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==h.Fragment&&(o.ref=t?nl(t,e):e),h.cloneElement(n,o)}return h.Children.count(n)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}Pl.displayName="Presence";var _l=Symbol("radix.slottable");function Rl(e){return h.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===_l}var zl=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=Ml(`Primitive.${t}`),r=h.forwardRef((e,r)=>{const{asChild:o,...i}=e,a=o?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),So.jsx(a,{...i,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Il=0;function Dl(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ll="Dialog",[Al,Fl]=function(e,t=[]){let n=[];const r=()=>{const t=n.map(e=>h.createContext(e));return function(n){const r=n?.[e]||t;return h.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){const o=h.createContext(r),i=n.length;n=[...n,r];const a=t=>{const{scope:n,children:r,...a}=t,s=n?.[e]?.[i]||o,l=h.useMemo(()=>a,Object.values(a));return So.jsx(s.Provider,{value:l,children:r})};return a.displayName=t+"Provider",[a,function(n,a){const s=a?.[e]?.[i]||o,l=h.useContext(s);if(l)return l;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},ol(r,...t)]}(Ll),[$l,jl]=Al(Ll),Bl=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,s=h.useRef(null),l=h.useRef(null),[u,c]=cl({prop:r,defaultProp:o??!1,onChange:i,caller:Ll});return So.jsx($l,{scope:t,triggerRef:s,contentRef:l,contentId:ll(),titleId:ll(),descriptionId:ll(),open:u,onOpenChange:c,onOpenToggle:h.useCallback(()=>c(e=>!e),[c]),modal:a,children:n})};Bl.displayName=Ll;var Wl="DialogTrigger";h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=jl(Wl,n),i=rl(t,o.triggerRef);return So.jsx(zl.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":lu(o.open),...r,ref:i,onClick:el(e.onClick,o.onOpenToggle)})}).displayName=Wl;var Ul="DialogPortal",[Hl,Vl]=Al(Ul,{forceMount:void 0}),Yl=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=jl(Ul,t);return So.jsx(Hl,{scope:t,forceMount:n,children:h.Children.map(r,e=>So.jsx(Pl,{present:n||i.open,children:So.jsx(ri,{asChild:!0,container:o,children:e})}))})};Yl.displayName=Ul;var ql="DialogOverlay",Gl=h.forwardRef((e,t)=>{const n=Vl(ql,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=jl(ql,e.__scopeDialog);return i.modal?So.jsx(Pl,{present:r||i.open,children:So.jsx(Kl,{...o,ref:t})}):null});Gl.displayName=ql;var Xl=Ml("DialogOverlay.RemoveScroll"),Kl=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=jl(ql,n);return So.jsx(Yi,{as:Xl,allowPinchZoom:!0,shards:[o.contentRef],children:So.jsx(zl.div,{"data-state":lu(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ql="DialogContent",Zl=h.forwardRef((e,t)=>{const n=Vl(Ql,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=jl(Ql,e.__scopeDialog);return So.jsx(Pl,{present:r||i.open,children:i.modal?So.jsx(Jl,{...o,ref:t}):So.jsx(eu,{...o,ref:t})})});Zl.displayName=Ql;var Jl=h.forwardRef((e,t)=>{const n=jl(Ql,e.__scopeDialog),r=h.useRef(null),o=rl(t,n.contentRef,r);return h.useEffect(()=>{const e=r.current;if(e)return Ji(e)},[]),So.jsx(tu,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:el(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:el(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:el(e.onFocusOutside,e=>e.preventDefault())})}),eu=h.forwardRef((e,t)=>{const n=jl(Ql,e.__scopeDialog),r=h.useRef(!1),o=h.useRef(!1);return So.jsx(tu,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));const i=t.target,a=n.triggerRef.current?.contains(i);a&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})}),tu=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=jl(Ql,n),l=h.useRef(null),u=rl(t,l);return h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Dl()),document.body.insertAdjacentElement("beforeend",e[1]??Dl()),Il++,()=>{1===Il&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Il--}},[]),So.jsxs(So.Fragment,{children:[So.jsx(Ko,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:So.jsx(kl,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":lu(s.open),...a,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),So.jsxs(So.Fragment,{children:[So.jsx(fu,{titleId:s.titleId}),So.jsx(pu,{contentRef:l,descriptionId:s.descriptionId})]})]})}),nu="DialogTitle",ru=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=jl(nu,n);return So.jsx(zl.h2,{id:o.titleId,...r,ref:t})});ru.displayName=nu;var ou="DialogDescription",iu=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=jl(ou,n);return So.jsx(zl.p,{id:o.descriptionId,...r,ref:t})});iu.displayName=ou;var au="DialogClose",su=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=jl(au,n);return So.jsx(zl.button,{type:"button",...r,ref:t,onClick:el(e.onClick,()=>o.onOpenChange(!1))})});function lu(e){return e?"open":"closed"}su.displayName=au;var uu="DialogTitleWarning",[cu,du]=function(e,t){const n=h.createContext(t),r=e=>{const{children:t,...r}=e,o=h.useMemo(()=>r,Object.values(r));return So.jsx(n.Provider,{value:o,children:t})};return r.displayName=e+"Provider",[r,function(r){const o=h.useContext(n);if(o)return o;if(void 0!==t)return t;throw new Error(`\`${r}\` must be used within \`${e}\``)}]}(uu,{contentName:Ql,titleName:nu,docsSlug:"dialog"}),fu=({titleId:e})=>{const t=du(uu),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{if(e){document.getElementById(e)||console.error(n)}},[n,e]),null},pu=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${du("DialogDescriptionWarning").contentName}}.`;return h.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");if(t&&r){document.getElementById(t)||console.warn(n)}},[n,e,t]),null},hu=Bl,mu=Yl,gu=Gl,vu=Zl,bu=ru,yu=su;function wu(e){return h.createElement(hu,Object.assign({"data-slot":"dialog"},e))}function xu(e){var t=Z(e,[]);return h.createElement(mu,Object.assign({"data-slot":"dialog-portal"},t))}function Su(e){var{className:t}=e,n=Z(e,["className"]);return h.createElement(gu,Object.assign({"data-slot":"dialog-overlay",className:Dt("fixed inset-0 z-50 bg-black/50",t)},n))}function Eu(e){var{className:t,children:n,showCloseButton:r=!0,container:o}=e,i=Z(e,["className","children","showCloseButton","container"]);return h.createElement(xu,{"data-slot":"dialog-portal",container:o},h.createElement(Su,null),h.createElement(vu,Object.assign({"data-slot":"dialog-content",style:{left:"50%",top:"50%",transform:"translate(-50%, -50%)",outline:"none"},className:Dt("fixed","z-50 grid w-full max-w-lg sm:mx-0 gap-4 p-6",t)},i),n,r&&h.createElement(yu,{"data-slot":"dialog-close",style:{right:"calc(var(--spacing) * 4)",top:"calc(var(--spacing) * 4)",outline:"none"},className:Dt("absolute right-4 top-4 rounded opacity-70 transition-opacity","hover:opacity-100 focus:outline-none","focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background","disabled:pointer-events-none"),"aria-label":"Close"},h.createElement(oo,{className:"h-4 w-4 pointer-events-none shrink-0",style:{height:"calc(var(--spacing) * 4)",width:"calc(var(--spacing) * 4)"}}))))}function ku(e){var{className:t}=e,n=Z(e,["className"]);return h.createElement("div",Object.assign({"data-slot":"dialog-header",className:Dt("flex flex-col gap-2 text-left",t)},n))}function Cu(e){var{className:t}=e,n=Z(e,["className"]);return h.createElement(bu,Object.assign({"data-slot":"dialog-title",className:Dt("text-lg leading-none font-semibold",t)},n))}function Tu({title:e,children:t,contentClassName:n,hideCloseButton:r=!1,portalContainer:o,description:i}){const{open:a,setOpen:s}=Hs();return m.createElement(wu,{open:a,onOpenChange:s},m.createElement(Eu,{container:o,className:n,showCloseButton:!r},e&&m.createElement(ku,null,m.createElement(Cu,{style:{color:"#494949"}},e||""),m.createElement(iu,{style:{color:"#5e5e5e",fontSize:"12.5px"}},i||"")),t))}const Pu=({products:e,contentId:t})=>{const n=Ir().width<430||Ur.isMobile;return m.createElement("div",{onWheel:e=>e.stopPropagation(),onTouchMove:e=>e.stopPropagation(),className:"grid gap-2 "+(n?"grid-cols-1":"grid-cols-2"),style:{fontSize:13}},e.map(n=>m.createElement(Vs,{key:n.productId,product:n,hideMoreBadge:!0,productLength:e.length,contentId:t})))},{PLAYER_BACK_BASE_URL:Ou}=It(),Mu=({widgetPlayerOption:e,setCollectionUuid:t,portalContainer:n})=>{const{player:r}=e,[o,i]=h.useState(null),{collection:a}=pn(),{isPreview:s}=cn(),{onSlideChange:l,onCollectionClose:u}=hn(o,i),{setOpen:c,open:d}=Hs();h.useEffect(()=>{d||(o&&(u(),i(null)),f&&p(null))},[d]);const[f,p]=h.useState();return m.createElement(m.Fragment,null,a&&m.createElement(Qs,Object.assign({collection:a},e,{onThumbnailClick:e=>J(void 0,void 0,void 0,function*(){if(r===H.POPUP){const n=jt(),r=jt();if(t(r),i(Object.assign(Object.assign({},a.contents.find(t=>t.shortsId===e)),{uuid:n})),c(!0),s)return;yield Promise.all([Xt({contentId:a.colId,uuid:r,type:K.COLLECTION,userId:a.userId,isFirstPlay:!Bt(a.colId)}),Xt({contentId:e,uuid:n,type:K.SHORTS,userId:a.userId,isFirstPlay:!Bt(e)})])}else{const t=(e=>{switch(e){case H.HORIZONTAL:return Y.HORIZONTAL;case H.VERTICAL:return Y.VERTICAL;case H.GRID:return Y.PRODUCTS;case H.TABLET:return Y.TABLET;default:return Y.PLATFORM}})(r),n=null==a?void 0:a.contents.findIndex(t=>t.shortsId===e);let o="";n&&n>1&&(o=(null==a?void 0:a.contents[n-1].shortsId)||""),open(`${Ou}/collection/${a.colId}?nextKey=${o}&layout=${t}`)}}),setSelectedProducts:p})),f&&m.createElement(Tu,{portalContainer:n,title:"상품 목록",contentClassName:"bg-white rounded p-4 product-dialog-container",description:"상품 정보를 확인해 보세요"},m.createElement(Pu,{products:f.productsInfo,contentId:f.shortsId})),a&&o&&m.createElement(Tu,{portalContainer:n,hideCloseButton:!0,contentClassName:"w-full max-w-none p-0 mx-0"},m.createElement(Ws,{collection:a,initialShortsId:o.shortsId,onClosePlayer:()=>J(void 0,void 0,void 0,function*(){u(),c(!1)}),onSlideChange:l})))};var Nu,_u={},Ru={};function zu(){if(Nu)return Ru;Nu=1;var e=l();function t(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=Object.prototype.hasOwnProperty,r=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,o={},i={};function a(e){return!!n.call(i,e)||!n.call(o,e)&&(r.test(e)?i[e]=!0:(o[e]=!0,!1))}function s(e,t,n,r,o,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var u={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){u[e]=new s(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];u[t]=new s(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){u[e]=new s(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){u[e]=new s(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){u[e]=new s(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){u[e]=new s(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){u[e]=new s(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){u[e]=new s(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){u[e]=new s(e,5,!1,e.toLowerCase(),null,!1,!1)});var c=/[\-:]([a-z])/g;function d(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(c,d);u[t]=new s(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(c,d);u[t]=new s(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(c,d);u[t]=new s(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){u[e]=new s(e,1,!1,e.toLowerCase(),null,!1,!1)}),u.xlinkHref=new s("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){u[e]=new s(e,1,!1,e.toLowerCase(),null,!0,!0)});var f={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},p=["Webkit","ms","Moz","O"];Object.keys(f).forEach(function(e){p.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),f[t]=f[e]})});var h=/["'&<>]/;function m(e){if("boolean"==typeof e||"number"==typeof e)return""+e;e=""+e;var t=h.exec(e);if(t){var n,r="",o=0;for(n=t.index;n<e.length;n++){switch(e.charCodeAt(n)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#x27;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}o!==n&&(r+=e.substring(o,n)),o=n+1,r+=t}e=o!==n?r+e.substring(o,n):r}return e}var g=/([A-Z])/g,v=/^ms-/,b=Array.isArray;function y(e,t){return{insertionMode:e,selectedValue:t}}var w=new Map;function x(e,r,o){if("object"!=typeof o)throw Error(t(62));for(var i in r=!0,o)if(n.call(o,i)){var a=o[i];if(null!=a&&"boolean"!=typeof a&&""!==a){if(0===i.indexOf("--")){var s=m(i);a=m((""+a).trim())}else{s=i;var l=w.get(s);void 0!==l||(l=m(s.replace(g,"-$1").toLowerCase().replace(v,"-ms-")),w.set(s,l)),s=l,a="number"==typeof a?0===a||n.call(f,i)?""+a:a+"px":m((""+a).trim())}r?(r=!1,e.push(' style="',s,":",a)):e.push(";",s,":",a)}}r||e.push('"')}function S(e,t,n,r){switch(n){case"style":return void x(e,t,r);case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":return}if(!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1])if(null!==(t=u.hasOwnProperty(n)?u[n]:null)){switch(typeof r){case"function":case"symbol":return;case"boolean":if(!t.acceptsBooleans)return}switch(n=t.attributeName,t.type){case 3:r&&e.push(" ",n,'=""');break;case 4:!0===r?e.push(" ",n,'=""'):!1!==r&&e.push(" ",n,'="',m(r),'"');break;case 5:isNaN(r)||e.push(" ",n,'="',m(r),'"');break;case 6:!isNaN(r)&&1<=r&&e.push(" ",n,'="',m(r),'"');break;default:t.sanitizeURL&&(r=""+r),e.push(" ",n,'="',m(r),'"')}}else if(a(n)){switch(typeof r){case"function":case"symbol":return;case"boolean":if("data-"!==(t=n.toLowerCase().slice(0,5))&&"aria-"!==t)return}e.push(" ",n,'="',m(r),'"')}}function E(e,n,r){if(null!=n){if(null!=r)throw Error(t(60));if("object"!=typeof n||!("__html"in n))throw Error(t(61));null!=(n=n.__html)&&e.push(""+n)}}function k(e,t,r,o){e.push(P(r));var i,a=r=null;for(i in t)if(n.call(t,i)){var s=t[i];if(null!=s)switch(i){case"children":r=s;break;case"dangerouslySetInnerHTML":a=s;break;default:S(e,o,i,s)}}return e.push(">"),E(e,a,r),"string"==typeof r?(e.push(m(r)),null):r}var C=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,T=new Map;function P(e){var n=T.get(e);if(void 0===n){if(!C.test(e))throw Error(t(65,e));n="<"+e,T.set(e,n)}return n}function O(r,o,i,s,l){switch(o){case"select":r.push(P("select"));var u=null,c=null;for(h in i)if(n.call(i,h)){var d=i[h];if(null!=d)switch(h){case"children":u=d;break;case"dangerouslySetInnerHTML":c=d;break;case"defaultValue":case"value":break;default:S(r,s,h,d)}}return r.push(">"),E(r,c,u),u;case"option":c=l.selectedValue,r.push(P("option"));var f=d=null,p=null,h=null;for(u in i)if(n.call(i,u)){var g=i[u];if(null!=g)switch(u){case"children":d=g;break;case"selected":p=g;break;case"dangerouslySetInnerHTML":h=g;break;case"value":f=g;default:S(r,s,u,g)}}if(null!=c)if(i=null!==f?""+f:function(t){var n="";return e.Children.forEach(t,function(e){null!=e&&(n+=e)}),n}(d),b(c)){for(s=0;s<c.length;s++)if(""+c[s]===i){r.push(' selected=""');break}}else""+c===i&&r.push(' selected=""');else p&&r.push(' selected=""');return r.push(">"),E(r,h,d),d;case"textarea":for(d in r.push(P("textarea")),h=c=u=null,i)if(n.call(i,d)&&null!=(f=i[d]))switch(d){case"children":h=f;break;case"value":u=f;break;case"defaultValue":c=f;break;case"dangerouslySetInnerHTML":throw Error(t(91));default:S(r,s,d,f)}if(null===u&&null!==c&&(u=c),r.push(">"),null!=h){if(null!=u)throw Error(t(92));if(b(h)&&1<h.length)throw Error(t(93));u=""+h}return"string"==typeof u&&"\n"===u[0]&&r.push("\n"),null!==u&&r.push(m(""+u)),null;case"input":for(c in r.push(P("input")),f=h=d=u=null,i)if(n.call(i,c)&&null!=(p=i[c]))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(t(399,"input"));case"defaultChecked":f=p;break;case"defaultValue":d=p;break;case"checked":h=p;break;case"value":u=p;break;default:S(r,s,c,p)}return null!==h?S(r,s,"checked",h):null!==f&&S(r,s,"checked",f),null!==u?S(r,s,"value",u):null!==d&&S(r,s,"value",d),r.push("/>"),null;case"menuitem":for(var v in r.push(P("menuitem")),i)if(n.call(i,v)&&null!=(u=i[v]))switch(v){case"children":case"dangerouslySetInnerHTML":throw Error(t(400));default:S(r,s,v,u)}return r.push(">"),null;case"title":for(g in r.push(P("title")),u=null,i)if(n.call(i,g)&&null!=(c=i[g]))switch(g){case"children":u=c;break;case"dangerouslySetInnerHTML":throw Error(t(434));default:S(r,s,g,c)}return r.push(">"),u;case"listing":case"pre":for(f in r.push(P(o)),c=u=null,i)if(n.call(i,f)&&null!=(d=i[f]))switch(f){case"children":u=d;break;case"dangerouslySetInnerHTML":c=d;break;default:S(r,s,f,d)}if(r.push(">"),null!=c){if(null!=u)throw Error(t(60));if("object"!=typeof c||!("__html"in c))throw Error(t(61));null!=(i=c.__html)&&("string"==typeof i&&0<i.length&&"\n"===i[0]?r.push("\n",i):r.push(""+i))}return"string"==typeof u&&"\n"===u[0]&&r.push("\n"),u;case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":for(var y in r.push(P(o)),i)if(n.call(i,y)&&null!=(u=i[y]))switch(y){case"children":case"dangerouslySetInnerHTML":throw Error(t(399,o));default:S(r,s,y,u)}return r.push("/>"),null;case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return k(r,i,o,s);case"html":return 0===l.insertionMode&&r.push("<!DOCTYPE html>"),k(r,i,o,s);default:if(-1===o.indexOf("-")&&"string"!=typeof i.is)return k(r,i,o,s);for(p in r.push(P(o)),c=u=null,i)if(n.call(i,p)&&null!=(d=i[p]))switch(p){case"children":u=d;break;case"dangerouslySetInnerHTML":c=d;break;case"style":x(r,s,d);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:a(p)&&"function"!=typeof d&&"symbol"!=typeof d&&r.push(" ",p,'="',m(d),'"')}return r.push(">"),E(r,c,u),u}}function M(e,n,r){if(e.push('\x3c!--$?--\x3e<template id="'),null===r)throw Error(t(395));return e.push(r),e.push('"></template>')}var N=/[<\u2028\u2029]/g;function _(e){return JSON.stringify(e).replace(N,function(e){switch(e){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}function R(e,t,n,r){return n.generateStaticMarkup?(e.push(m(t)),!1):(""===t?e=r:(r&&e.push("\x3c!-- --\x3e"),e.push(m(t)),e=!0),e)}var z=Object.assign,I=Symbol.for("react.element"),D=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),$=Symbol.for("react.provider"),j=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),Y=Symbol.for("react.scope"),q=Symbol.for("react.debug_trace_mode"),G=Symbol.for("react.legacy_hidden"),X=Symbol.for("react.default_value"),K=Symbol.iterator;function Q(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case L:return"Fragment";case D:return"Portal";case F:return"Profiler";case A:return"StrictMode";case W:return"Suspense";case U:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case j:return(e.displayName||"Context")+".Consumer";case $:return(e._context.displayName||"Context")+".Provider";case B:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case H:return null!==(t=e.displayName||null)?t:Q(e.type)||"Memo";case V:t=e._payload,e=e._init;try{return Q(e(t))}catch(e){}}return null}var Z={};function J(e,t){if(!(e=e.contextTypes))return Z;var n,r={};for(n in e)r[n]=t[n];return r}var ee=null;function te(e,n){if(e!==n){e.context._currentValue2=e.parentValue,e=e.parent;var r=n.parent;if(null===e){if(null!==r)throw Error(t(401))}else{if(null===r)throw Error(t(401));te(e,r)}n.context._currentValue2=n.value}}function ne(e){e.context._currentValue2=e.parentValue,null!==(e=e.parent)&&ne(e)}function re(e){var t=e.parent;null!==t&&re(t),e.context._currentValue2=e.value}function oe(e,n){if(e.context._currentValue2=e.parentValue,null===(e=e.parent))throw Error(t(402));e.depth===n.depth?te(e,n):oe(e,n)}function ie(e,n){var r=n.parent;if(null===r)throw Error(t(402));e.depth===r.depth?te(e,r):ie(e,r),n.context._currentValue2=n.value}function ae(e){var t=ee;t!==e&&(null===t?re(e):null===e?ne(t):t.depth===e.depth?te(t,e):t.depth>e.depth?oe(t,e):ie(t,e),ee=e)}var se={isMounted:function(){return!1},enqueueSetState:function(e,t){null!==(e=e._reactInternals).queue&&e.queue.push(t)},enqueueReplaceState:function(e,t){(e=e._reactInternals).replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}};function le(e,t,n,r){var o=void 0!==e.state?e.state:null;e.updater=se,e.props=n,e.state=o;var i={queue:[],replace:!1};e._reactInternals=i;var a=t.contextType;if(e.context="object"==typeof a&&null!==a?a._currentValue2:r,"function"==typeof(a=t.getDerivedStateFromProps)&&(o=null==(a=a(n,o))?o:z({},o,a),e.state=o),"function"!=typeof t.getDerivedStateFromProps&&"function"!=typeof e.getSnapshotBeforeUpdate&&("function"==typeof e.UNSAFE_componentWillMount||"function"==typeof e.componentWillMount))if(t=e.state,"function"==typeof e.componentWillMount&&e.componentWillMount(),"function"==typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),t!==e.state&&se.enqueueReplaceState(e,e.state,null),null!==i.queue&&0<i.queue.length)if(t=i.queue,a=i.replace,i.queue=null,i.replace=!1,a&&1===t.length)e.state=t[0];else{for(i=a?t[0]:e.state,o=!0,a=a?1:0;a<t.length;a++){var s=t[a];null!=(s="function"==typeof s?s.call(e,i,n,r):s)&&(o?(o=!1,i=z({},i,s)):z(i,s))}e.state=i}else i.queue=null}var ue={id:1,overflow:""};function ce(e,t,n){var r=e.id;e=e.overflow;var o=32-de(r)-1;r&=~(1<<o),n+=1;var i=32-de(t)+o;if(30<i){var a=o-o%5;return i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,{id:1<<32-de(t)+o|n<<o|r,overflow:i+e}}return{id:1<<i|n<<o|r,overflow:e}}var de=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(fe(e)/pe|0)|0},fe=Math.log,pe=Math.LN2;var he="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},me=null,ge=null,ve=null,be=null,ye=!1,we=!1,xe=0,Se=null,Ee=0;function ke(){if(null===me)throw Error(t(321));return me}function Ce(){if(0<Ee)throw Error(t(312));return{memoizedState:null,queue:null,next:null}}function Te(){return null===be?null===ve?(ye=!1,ve=be=Ce()):(ye=!0,be=ve):null===be.next?(ye=!1,be=be.next=Ce()):(ye=!0,be=be.next),be}function Pe(){ge=me=null,we=!1,ve=null,Ee=0,be=Se=null}function Oe(e,t){return"function"==typeof t?t(e):t}function Me(e,t,n){if(me=ke(),be=Te(),ye){var r=be.queue;if(t=r.dispatch,null!==Se&&void 0!==(n=Se.get(r))){Se.delete(r),r=be.memoizedState;do{r=e(r,n.action),n=n.next}while(null!==n);return be.memoizedState=r,[r,t]}return[be.memoizedState,t]}return e=e===Oe?"function"==typeof t?t():t:void 0!==n?n(t):t,be.memoizedState=e,e=(e=be.queue={last:null,dispatch:null}).dispatch=_e.bind(null,me,e),[be.memoizedState,e]}function Ne(e,t){if(me=ke(),t=void 0===t?null:t,null!==(be=Te())){var n=be.memoizedState;if(null!==n&&null!==t){var r=n[1];e:if(null===r)r=!1;else{for(var o=0;o<r.length&&o<t.length;o++)if(!he(t[o],r[o])){r=!1;break e}r=!0}if(r)return n[0]}}return e=e(),be.memoizedState=[e,t],e}function _e(e,n,r){if(25<=Ee)throw Error(t(301));if(e===me)if(we=!0,e={action:r,next:null},null===Se&&(Se=new Map),void 0===(r=Se.get(n)))Se.set(n,e);else{for(n=r;null!==n.next;)n=n.next;n.next=e}}function Re(){throw Error(t(394))}function ze(){}var Ie={readContext:function(e){return e._currentValue2},useContext:function(e){return ke(),e._currentValue2},useMemo:Ne,useReducer:Me,useRef:function(e){me=ke();var t=(be=Te()).memoizedState;return null===t?(e={current:e},be.memoizedState=e):t},useState:function(e){return Me(Oe,e)},useInsertionEffect:ze,useLayoutEffect:function(){},useCallback:function(e,t){return Ne(function(){return e},t)},useImperativeHandle:ze,useEffect:ze,useDebugValue:ze,useDeferredValue:function(e){return ke(),e},useTransition:function(){return ke(),[!1,Re]},useId:function(){var e=ge.treeContext,n=e.overflow;e=((e=e.id)&~(1<<32-de(e)-1)).toString(32)+n;var r=De;if(null===r)throw Error(t(404));return n=xe++,e=":"+r.idPrefix+"R"+e,0<n&&(e+="H"+n.toString(32)),e+":"},useMutableSource:function(e,t){return ke(),t(e._source)},useSyncExternalStore:function(e,n,r){if(void 0===r)throw Error(t(407));return r()}},De=null,Le=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;function Ae(e){return console.error(e),null}function Fe(){}function $e(e,t,n,r,o,i,a,s){e.allPendingTasks++,null===n?e.pendingRootTasks++:n.pendingTasks++;var l={node:t,ping:function(){var t=e.pingedTasks;t.push(l),1===t.length&&et(e)},blockedBoundary:n,blockedSegment:r,abortSet:o,legacyContext:i,context:a,treeContext:s};return o.add(l),l}function je(e,t,n,r,o,i){return{status:0,id:-1,index:t,parentFlushed:!1,chunks:[],children:[],formatContext:r,boundary:n,lastPushedText:o,textEmbedded:i}}function Be(e,t){if(null!=(e=e.onError(t))&&"string"!=typeof e)throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof e+'" instead');return e}function We(e,t){var n=e.onShellError;n(t),(n=e.onFatalError)(t),null!==e.destination?(e.status=2,e.destination.destroy(t)):(e.status=1,e.fatalError=t)}function Ue(e,t,n,r,o){for(me={},ge=t,xe=0,e=n(r,o);we;)we=!1,xe=0,Ee+=1,be=null,e=n(r,o);return Pe(),e}function He(e,n,r,o){var i=r.render(),a=o.childContextTypes;if(null!=a){var s=n.legacyContext;if("function"!=typeof r.getChildContext)o=s;else{for(var l in r=r.getChildContext())if(!(l in a))throw Error(t(108,Q(o)||"Unknown",l));o=z({},s,r)}n.legacyContext=o,qe(e,n,i),n.legacyContext=s}else qe(e,n,i)}function Ve(e,t){if(e&&e.defaultProps){for(var n in t=z({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function Ye(e,n,r,o,i){if("function"==typeof r)if(r.prototype&&r.prototype.isReactComponent){i=J(r,n.legacyContext);var a=r.contextType;le(a=new r(o,"object"==typeof a&&null!==a?a._currentValue2:i),r,o,i),He(e,n,a,r)}else{i=Ue(e,n,r,o,a=J(r,n.legacyContext));var s=0!==xe;if("object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof)le(i,r,o,a),He(e,n,i,r);else if(s){o=n.treeContext,n.treeContext=ce(o,1,0);try{qe(e,n,i)}finally{n.treeContext=o}}else qe(e,n,i)}else{if("string"!=typeof r){switch(r){case G:case q:case A:case F:case L:case U:return void qe(e,n,o.children);case Y:throw Error(t(343));case W:e:{r=n.blockedBoundary,i=n.blockedSegment,a=o.fallback,o=o.children;var l={id:null,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:s=new Set,errorDigest:null},u=je(0,i.chunks.length,l,i.formatContext,!1,!1);i.children.push(u),i.lastPushedText=!1;var c=je(0,0,null,i.formatContext,!1,!1);c.parentFlushed=!0,n.blockedBoundary=l,n.blockedSegment=c;try{if(Xe(e,n,o),e.responseState.generateStaticMarkup||c.lastPushedText&&c.textEmbedded&&c.chunks.push("\x3c!-- --\x3e"),c.status=1,Ze(l,c),0===l.pendingTasks)break e}catch(t){c.status=4,l.forceClientRender=!0,l.errorDigest=Be(e,t)}finally{n.blockedBoundary=r,n.blockedSegment=i}n=$e(e,a,r,u,s,n.legacyContext,n.context,n.treeContext),e.pingedTasks.push(n)}return}if("object"==typeof r&&null!==r)switch(r.$$typeof){case B:if(o=Ue(e,n,r.render,o,i),0!==xe){r=n.treeContext,n.treeContext=ce(r,1,0);try{qe(e,n,o)}finally{n.treeContext=r}}else qe(e,n,o);return;case H:return void Ye(e,n,r=r.type,o=Ve(r,o),i);case $:if(i=o.children,r=r._context,o=o.value,a=r._currentValue2,r._currentValue2=o,ee=o={parent:s=ee,depth:null===s?0:s.depth+1,context:r,parentValue:a,value:o},n.context=o,qe(e,n,i),null===(e=ee))throw Error(t(403));return o=e.parentValue,e.context._currentValue2=o===X?e.context._defaultValue:o,e=ee=e.parent,void(n.context=e);case j:return void qe(e,n,o=(o=o.children)(r._currentValue2));case V:return void Ye(e,n,r=(i=r._init)(r._payload),o=Ve(r,o),void 0)}throw Error(t(130,null==r?r:typeof r,""))}switch(a=O((i=n.blockedSegment).chunks,r,o,e.responseState,i.formatContext),i.lastPushedText=!1,s=i.formatContext,i.formatContext=function(e,t,n){switch(t){case"select":return y(1,null!=n.value?n.value:n.defaultValue);case"svg":return y(2,null);case"math":return y(3,null);case"foreignObject":return y(1,null);case"table":return y(4,null);case"thead":case"tbody":case"tfoot":return y(5,null);case"colgroup":return y(7,null);case"tr":return y(6,null)}return 4<=e.insertionMode||0===e.insertionMode?y(1,null):e}(s,r,o),Xe(e,n,a),i.formatContext=s,r){case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break;default:i.chunks.push("</",r,">")}i.lastPushedText=!1}}function qe(e,n,r){if(n.node=r,"object"==typeof r&&null!==r){switch(r.$$typeof){case I:return void Ye(e,n,r.type,r.props,r.ref);case D:throw Error(t(257));case V:var o=r._init;return void qe(e,n,r=o(r._payload))}if(b(r))return void Ge(e,n,r);if(null===r||"object"!=typeof r?o=null:o="function"==typeof(o=K&&r[K]||r["@@iterator"])?o:null,o&&(o=o.call(r))){if(!(r=o.next()).done){var i=[];do{i.push(r.value),r=o.next()}while(!r.done);Ge(e,n,i)}return}throw e=Object.prototype.toString.call(r),Error(t(31,"[object Object]"===e?"object with keys {"+Object.keys(r).join(", ")+"}":e))}"string"==typeof r?(o=n.blockedSegment).lastPushedText=R(n.blockedSegment.chunks,r,e.responseState,o.lastPushedText):"number"==typeof r&&((o=n.blockedSegment).lastPushedText=R(n.blockedSegment.chunks,""+r,e.responseState,o.lastPushedText))}function Ge(e,t,n){for(var r=n.length,o=0;o<r;o++){var i=t.treeContext;t.treeContext=ce(i,r,o);try{Xe(e,t,n[o])}finally{t.treeContext=i}}}function Xe(e,t,n){var r=t.blockedSegment.formatContext,o=t.legacyContext,i=t.context;try{return qe(e,t,n)}catch(l){if(Pe(),"object"!=typeof l||null===l||"function"!=typeof l.then)throw t.blockedSegment.formatContext=r,t.legacyContext=o,t.context=i,ae(i),l;n=l;var a=t.blockedSegment,s=je(0,a.chunks.length,null,a.formatContext,a.lastPushedText,!0);a.children.push(s),a.lastPushedText=!1,e=$e(e,t.node,t.blockedBoundary,s,t.abortSet,t.legacyContext,t.context,t.treeContext).ping,n.then(e,e),t.blockedSegment.formatContext=r,t.legacyContext=o,t.context=i,ae(i)}}function Ke(e){var t=e.blockedBoundary;(e=e.blockedSegment).status=3,Je(this,t,e)}function Qe(e,n,r){var o=e.blockedBoundary;e.blockedSegment.status=3,null===o?(n.allPendingTasks--,2!==n.status&&(n.status=2,null!==n.destination&&n.destination.push(null))):(o.pendingTasks--,o.forceClientRender||(o.forceClientRender=!0,e=void 0===r?Error(t(432)):r,o.errorDigest=n.onError(e),o.parentFlushed&&n.clientRenderedBoundaries.push(o)),o.fallbackAbortableTasks.forEach(function(e){return Qe(e,n,r)}),o.fallbackAbortableTasks.clear(),n.allPendingTasks--,0===n.allPendingTasks&&(o=n.onAllReady)())}function Ze(e,t){if(0===t.chunks.length&&1===t.children.length&&null===t.children[0].boundary){var n=t.children[0];n.id=t.id,n.parentFlushed=!0,1===n.status&&Ze(e,n)}else e.completedSegments.push(t)}function Je(e,n,r){if(null===n){if(r.parentFlushed){if(null!==e.completedRootSegment)throw Error(t(389));e.completedRootSegment=r}e.pendingRootTasks--,0===e.pendingRootTasks&&(e.onShellError=Fe,(n=e.onShellReady)())}else n.pendingTasks--,n.forceClientRender||(0===n.pendingTasks?(r.parentFlushed&&1===r.status&&Ze(n,r),n.parentFlushed&&e.completedBoundaries.push(n),n.fallbackAbortableTasks.forEach(Ke,e),n.fallbackAbortableTasks.clear()):r.parentFlushed&&1===r.status&&(Ze(n,r),1===n.completedSegments.length&&n.parentFlushed&&e.partialBoundaries.push(n)));e.allPendingTasks--,0===e.allPendingTasks&&(e=e.onAllReady)()}function et(e){if(2!==e.status){var t=ee,n=Le.current;Le.current=Ie;var r=De;De=e.responseState;try{var o,i=e.pingedTasks;for(o=0;o<i.length;o++){var a=i[o],s=e,l=a.blockedSegment;if(0===l.status){ae(a.context);try{qe(s,a,a.node),s.responseState.generateStaticMarkup||l.lastPushedText&&l.textEmbedded&&l.chunks.push("\x3c!-- --\x3e"),a.abortSet.delete(a),l.status=1,Je(s,a.blockedBoundary,l)}catch(e){if(Pe(),"object"==typeof e&&null!==e&&"function"==typeof e.then){var u=a.ping;e.then(u,u)}else{a.abortSet.delete(a),l.status=4;var c=a.blockedBoundary,d=e,f=Be(s,d);if(null===c?We(s,d):(c.pendingTasks--,c.forceClientRender||(c.forceClientRender=!0,c.errorDigest=f,c.parentFlushed&&s.clientRenderedBoundaries.push(c))),s.allPendingTasks--,0===s.allPendingTasks)(0,s.onAllReady)()}}}}i.splice(0,o),null!==e.destination&&at(e,e.destination)}catch(t){Be(e,t),We(e,t)}finally{De=r,Le.current=n,n===Ie&&ae(t)}}}function tt(e,n,r){switch(r.parentFlushed=!0,r.status){case 0:var o=r.id=e.nextSegmentId++;return r.lastPushedText=!1,r.textEmbedded=!1,e=e.responseState,n.push('<template id="'),n.push(e.placeholderPrefix),e=o.toString(16),n.push(e),n.push('"></template>');case 1:r.status=2;var i=!0;o=r.chunks;var a=0;r=r.children;for(var s=0;s<r.length;s++){for(i=r[s];a<i.index;a++)n.push(o[a]);i=nt(e,n,i)}for(;a<o.length-1;a++)n.push(o[a]);return a<o.length&&(i=n.push(o[a])),i;default:throw Error(t(390))}}function nt(e,n,r){var o=r.boundary;if(null===o)return tt(e,n,r);if(o.parentFlushed=!0,o.forceClientRender)return e.responseState.generateStaticMarkup||(o=o.errorDigest,n.push("\x3c!--$!--\x3e"),n.push("<template"),o&&(n.push(' data-dgst="'),o=m(o),n.push(o),n.push('"')),n.push("></template>")),tt(e,n,r),e=!!e.responseState.generateStaticMarkup||n.push("\x3c!--/$--\x3e");if(0<o.pendingTasks){o.rootSegmentID=e.nextSegmentId++,0<o.completedSegments.length&&e.partialBoundaries.push(o);var i=e.responseState,a=i.nextSuspenseID++;return i=i.boundaryPrefix+a.toString(16),o=o.id=i,M(n,e.responseState,o),tt(e,n,r),n.push("\x3c!--/$--\x3e")}if(o.byteSize>e.progressiveChunkSize)return o.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(o),M(n,e.responseState,o.id),tt(e,n,r),n.push("\x3c!--/$--\x3e");if(e.responseState.generateStaticMarkup||n.push("\x3c!--$--\x3e"),1!==(r=o.completedSegments).length)throw Error(t(391));return nt(e,n,r[0]),e=!!e.responseState.generateStaticMarkup||n.push("\x3c!--/$--\x3e")}function rt(e,n,r){return function(e,n,r,o){switch(r.insertionMode){case 0:case 1:return e.push('<div hidden id="'),e.push(n.segmentPrefix),n=o.toString(16),e.push(n),e.push('">');case 2:return e.push('<svg aria-hidden="true" style="display:none" id="'),e.push(n.segmentPrefix),n=o.toString(16),e.push(n),e.push('">');case 3:return e.push('<math aria-hidden="true" style="display:none" id="'),e.push(n.segmentPrefix),n=o.toString(16),e.push(n),e.push('">');case 4:return e.push('<table hidden id="'),e.push(n.segmentPrefix),n=o.toString(16),e.push(n),e.push('">');case 5:return e.push('<table hidden><tbody id="'),e.push(n.segmentPrefix),n=o.toString(16),e.push(n),e.push('">');case 6:return e.push('<table hidden><tr id="'),e.push(n.segmentPrefix),n=o.toString(16),e.push(n),e.push('">');case 7:return e.push('<table hidden><colgroup id="'),e.push(n.segmentPrefix),n=o.toString(16),e.push(n),e.push('">');default:throw Error(t(397))}}(n,e.responseState,r.formatContext,r.id),nt(e,n,r),function(e,n){switch(n.insertionMode){case 0:case 1:return e.push("</div>");case 2:return e.push("</svg>");case 3:return e.push("</math>");case 4:return e.push("</table>");case 5:return e.push("</tbody></table>");case 6:return e.push("</tr></table>");case 7:return e.push("</colgroup></table>");default:throw Error(t(397))}}(n,r.formatContext)}function ot(e,n,r){for(var o=r.completedSegments,i=0;i<o.length;i++)it(e,n,r,o[i]);if(o.length=0,e=e.responseState,o=r.id,r=r.rootSegmentID,n.push(e.startInlineScript),e.sentCompleteBoundaryFunction?n.push('$RC("'):(e.sentCompleteBoundaryFunction=!0,n.push('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("')),null===o)throw Error(t(395));return r=r.toString(16),n.push(o),n.push('","'),n.push(e.segmentPrefix),n.push(r),n.push('")<\/script>')}function it(e,n,r,o){if(2===o.status)return!0;var i=o.id;if(-1===i){if(-1===(o.id=r.rootSegmentID))throw Error(t(392));return rt(e,n,o)}return rt(e,n,o),e=e.responseState,n.push(e.startInlineScript),e.sentCompleteSegmentFunction?n.push('$RS("'):(e.sentCompleteSegmentFunction=!0,n.push('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("')),n.push(e.segmentPrefix),i=i.toString(16),n.push(i),n.push('","'),n.push(e.placeholderPrefix),n.push(i),n.push('")<\/script>')}function at(e,n){try{var r=e.completedRootSegment;if(null!==r&&0===e.pendingRootTasks){nt(e,n,r),e.completedRootSegment=null;var o=e.responseState.bootstrapChunks;for(r=0;r<o.length-1;r++)n.push(o[r]);r<o.length&&n.push(o[r])}var i,a=e.clientRenderedBoundaries;for(i=0;i<a.length;i++){var s=a[i];o=n;var l=e.responseState,u=s.id,c=s.errorDigest,d=s.errorMessage,f=s.errorComponentStack;if(o.push(l.startInlineScript),l.sentClientRenderFunction?o.push('$RX("'):(l.sentClientRenderFunction=!0,o.push('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("')),null===u)throw Error(t(395));if(o.push(u),o.push('"'),c||d||f){o.push(",");var p=_(c||"");o.push(p)}if(d||f){o.push(",");var h=_(d||"");o.push(h)}if(f){o.push(",");var m=_(f);o.push(m)}if(!o.push(")<\/script>"))return e.destination=null,i++,void a.splice(0,i)}a.splice(0,i);var g=e.completedBoundaries;for(i=0;i<g.length;i++)if(!ot(e,n,g[i]))return e.destination=null,i++,void g.splice(0,i);g.splice(0,i);var v=e.partialBoundaries;for(i=0;i<v.length;i++){var b=v[i];e:{a=e,s=n;var y=b.completedSegments;for(l=0;l<y.length;l++)if(!it(a,s,b,y[l])){l++,y.splice(0,l);var w=!1;break e}y.splice(0,l),w=!0}if(!w)return e.destination=null,i++,void v.splice(0,i)}v.splice(0,i);var x=e.completedBoundaries;for(i=0;i<x.length;i++)if(!ot(e,n,x[i]))return e.destination=null,i++,void x.splice(0,i);x.splice(0,i)}finally{0===e.allPendingTasks&&0===e.pingedTasks.length&&0===e.clientRenderedBoundaries.length&&0===e.completedBoundaries.length&&n.push(null)}}function st(e,t){try{var n=e.abortableTasks;n.forEach(function(n){return Qe(n,e,t)}),n.clear(),null!==e.destination&&at(e,e.destination)}catch(t){Be(e,t),We(e,t)}}function lt(){}function ut(e,n,r,o){var i=!1,a=null,s="",l={push:function(e){return null!==e&&(s+=e),!0},destroy:function(e){i=!0,a=e}},u=!1;if(e=function(e,t,n,r,o,i,a){var s=[],l=new Set;return(n=je(t={destination:null,responseState:t,progressiveChunkSize:void 0===r?12800:r,status:0,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:l,pingedTasks:s,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:void 0===o?Ae:o,onAllReady:Fe,onShellReady:void 0===a?Fe:a,onShellError:Fe,onFatalError:Fe},0,null,n,!1,!1)).parentFlushed=!0,e=$e(t,e,null,n,l,Z,null,ue),s.push(e),t}(e,function(e,t){return{bootstrapChunks:[],startInlineScript:"<script>",placeholderPrefix:(t=void 0===t?"":t)+"P:",segmentPrefix:t+"S:",boundaryPrefix:t+"B:",idPrefix:t,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1,generateStaticMarkup:e}}(r,n?n.identifierPrefix:void 0),{insertionMode:1,selectedValue:null},1/0,lt,0,function(){u=!0}),et(e),st(e,o),1===e.status)e.status=2,l.destroy(e.fatalError);else if(2!==e.status&&null===e.destination){e.destination=l;try{at(e,l)}catch(t){Be(e,t),We(e,t)}}if(i)throw a;if(!u)throw Error(t(426));return s}return Ru.renderToNodeStream=function(){throw Error(t(207))},Ru.renderToStaticMarkup=function(e,t){return ut(e,t,!0,'The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server')},Ru.renderToStaticNodeStream=function(){throw Error(t(208))},Ru.renderToString=function(e,t){return ut(e,t,!1,'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server')},Ru.version="18.3.1",Ru}var Iu,Du,Lu={};
35
+ */function ui({message:e,duration:t=3e3,visible:r,setVisible:n}){return p.useEffect(()=>{const e=setTimeout(()=>n(!1),t);return()=>clearTimeout(e)},[r]),r?g.createElement("div",{style:{position:"fixed",top:"1rem",left:"50%",transform:"translateX(-50%)",background:"rgba(0,0,0,0.8)",color:"#fff",padding:"0.75rem 1.25rem",borderRadius:"0.375rem",fontSize:"14px",zIndex:9999,boxShadow:"0 2px 10px rgba(0,0,0,0.2)"}},e):null}const ci=({shortForm:e,shareUrl:t})=>{const r=null!=t?t:window.location.href,[n,i]=p.useState(!1);return g.createElement(g.Fragment,null,g.createElement("button",{onClick:()=>J(void 0,void 0,void 0,function*(){try{i(!0),Hn.isMobile&&navigator.share&&e?yield navigator.share({title:e.title,url:r}):(e=>{if(void 0!==navigator.clipboard)navigator.clipboard.writeText(e).then(()=>{});else{const t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),t.setSelectionRange(0,99999);try{document.execCommand("copy")}catch(e){console.error("복사 실패",e)}t.setSelectionRange(0,0),document.body.removeChild(t)}})(r)}catch(e){console.error("Fail to copy on clipboard")}}),className:"cursor-pointer"},g.createElement(ri,{size:22}),g.createElement(ui,{message:"공유 링크 복사 완료",setVisible:i,visible:n})))},di=({width:e,height:t})=>g.createElement("div",{className:"w-full h-full flex items-center justify-center"},g.createElement("img",{src:"public/images/noImage.svg",alt:"no image",width:e||50,height:t||50})),hi=({product:e,onError:t})=>g.createElement("img",{src:e.thumbPath,alt:e.productName,className:"object-cover p-0 flex-none",style:{height:"80px",width:"80px"},onError:t}),fi=({product:e,hideMoreBtn:t,contentId:r})=>{const{isPreview:n,priceText:i}=cr(),[s,a]=p.useState(!1);return g.createElement("div",{style:{height:"80px"},className:"flex gap-2 items-center w-full",onClick:()=>J(void 0,void 0,void 0,function*(){t&&(window.open(e.linkPath,"_blank"),n||(yield Zt({contentProductId:e.eventProductId,contentId:r,productId:e.productId})))})},e.thumbPath&&!s?g.createElement(hi,{product:e,onError:()=>a(!0)}):g.createElement(di,null),g.createElement("div",{className:"flex flex-col text-left p-2 w-full justify-center"},e.brand&&g.createElement("span",{className:"break-keep line-clamp-1 text-gray-500",style:{fontSize:"10px"}},e.brand.brandName),g.createElement("div",{className:"text-gray-800 text-ellipsis line-clamp-1 ",style:{fontSize:"12px"}},e.productName),g.createElement("div",{className:"text-red-500 break-keep",style:{fontSize:"12px"}},i?i+" ":"할인가 ",g.createElement("span",{className:"font-semibold break-keep"},$t(e.sellingPrice),"원"))))};function pi(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function gi(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function mi(...e){return t=>{let r=!1;const n=e.map(e=>{const n=gi(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():gi(e[t],null)}}}}function vi(...e){return p.useCallback(mi(...e),e)}var yi,bi,wi={exports:{}},Ei={};var Si=(bi||(bi=1,wi.exports=function(){if(yi)return Ei;yi=1;var e=l(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function a(e,r,a){var o,l={},u=null,c=null;for(o in void 0!==a&&(u=""+a),void 0!==r.key&&(u=""+r.key),void 0!==r.ref&&(c=r.ref),r)n.call(r,o)&&!s.hasOwnProperty(o)&&(l[o]=r[o]);if(e&&e.defaultProps)for(o in r=e.defaultProps)void 0===l[o]&&(l[o]=r[o]);return{$$typeof:t,type:e,key:u,ref:c,props:l,_owner:i.current}}return Ei.Fragment=r,Ei.jsx=a,Ei.jsxs=a,Ei}()),wi.exports);function Ti(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}var ki=globalThis?.document?p.useLayoutEffect:()=>{},xi=m[" useId ".trim().toString()]||(()=>{}),Ai=0;function Ri(e){const[t,r]=p.useState(xi());return ki(()=>{e||r(e=>e??String(Ai++))},[e]),e||(t?`radix-${t}`:"")}var Li=m[" useInsertionEffect ".trim().toString()]||ki;function Ii({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[i,s,a]=function({defaultProp:e,onChange:t}){const[r,n]=p.useState(e),i=p.useRef(r),s=p.useRef(t);return Li(()=>{s.current=t},[t]),p.useEffect(()=>{i.current!==r&&(s.current?.(r),i.current=r)},[r,i]),[r,n,s]}({defaultProp:t,onChange:r}),o=void 0!==e,l=o?e:i;{const t=p.useRef(void 0!==e);p.useEffect(()=>{const e=t.current;if(e!==o){const t=e?"controlled":"uncontrolled",r=o?"controlled":"uncontrolled";console.warn(`${n} is changing from ${t} to ${r}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=o},[o,n])}const u=p.useCallback(t=>{if(o){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&a.current?.(r)}else s(t)},[o,e,s,a]);return[l,u]}var Ci=k(),Pi=t(Ci);function Di(e){const t=_i(e),r=p.forwardRef((e,r)=>{const{children:n,...i}=e,s=p.Children.toArray(n),a=s.find(Oi);if(a){const e=a.props.children,n=s.map(t=>t===a?p.Children.count(e)>1?p.Children.only(null):p.isValidElement(e)?e.props.children:null:t);return Si.jsx(t,{...i,ref:r,children:p.isValidElement(e)?p.cloneElement(e,void 0,n):null})}return Si.jsx(t,{...i,ref:r,children:n})});return r.displayName=`${e}.Slot`,r}function _i(e){const t=p.forwardRef((e,t)=>{const{children:r,...n}=e;if(p.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),i=function(e,t){const r={...t};for(const n in t){const i=e[n],s=t[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...e)=>{const t=s(...e);return i(...e),t}:i&&(r[n]=i):"style"===n?r[n]={...i,...s}:"className"===n&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==p.Fragment&&(i.ref=t?mi(t,e):e),p.cloneElement(r,i)}return p.Children.count(r)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Mi=Symbol("radix.slottable");function Oi(e){return p.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Mi}var Ni=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const r=Di(`Primitive.${t}`),n=p.forwardRef((e,n)=>{const{asChild:i,...s}=e,a=i?r:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),Si.jsx(a,{...s,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Fi(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...e)=>t.current?.(...e),[])}function $i(e,t=globalThis?.document){const r=Fi(e);p.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}var Bi,Ui="dismissableLayer.update",zi="dismissableLayer.pointerDownOutside",ji="dismissableLayer.focusOutside",Gi=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hi=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:o,...l}=e,u=p.useContext(Gi),[c,d]=p.useState(null),h=c?.ownerDocument??globalThis?.document,[,f]=p.useState({}),g=vi(t,e=>d(e)),m=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(v),b=c?m.indexOf(c):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,E=b>=y,S=function(e,t=globalThis?.document){const r=Fi(e),n=p.useRef(!1),i=p.useRef(()=>{});return p.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){Wi(zi,r,s,{discrete:!0})};const s={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",i.current),i.current=n,t.addEventListener("click",i.current,{once:!0})):n()}else t.removeEventListener("click",i.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",e),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{const t=e.target,r=[...u.branches].some(e=>e.contains(t));E&&!r&&(i?.(e),a?.(e),e.defaultPrevented||o?.())},h),T=function(e,t=globalThis?.document){const r=Fi(e),n=p.useRef(!1);return p.useEffect(()=>{const e=e=>{if(e.target&&!n.current){Wi(ji,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(s?.(e),a?.(e),e.defaultPrevented||o?.())},h);return $i(e=>{b===u.layers.size-1&&(n?.(e),!e.defaultPrevented&&o&&(e.preventDefault(),o()))},h),p.useEffect(()=>{if(c)return r&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(Bi=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),Vi(),()=>{r&&1===u.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Bi)}},[c,h,r,u]),p.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),Vi())},[c,u]),p.useEffect(()=>{const e=()=>f({});return document.addEventListener(Ui,e),()=>document.removeEventListener(Ui,e)},[]),Si.jsx(Ni.div,{...l,ref:g,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:pi(e.onFocusCapture,T.onFocusCapture),onBlurCapture:pi(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:pi(e.onPointerDownCapture,S.onPointerDownCapture)})});Hi.displayName="DismissableLayer";function Vi(){const e=new CustomEvent(Ui);document.dispatchEvent(e)}function Wi(e,t,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?function(e,t){e&&Ci.flushSync(()=>e.dispatchEvent(t))}(i,s):i.dispatchEvent(s)}p.forwardRef((e,t)=>{const r=p.useContext(Gi),n=p.useRef(null),i=vi(t,n);return p.useEffect(()=>{const e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),Si.jsx(Ni.div,{...e,ref:i})}).displayName="DismissableLayerBranch";var Ki="focusScope.autoFocusOnMount",Yi="focusScope.autoFocusOnUnmount",qi={bubbles:!1,cancelable:!0},Xi=p.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=e,[o,l]=p.useState(null),u=Fi(i),c=Fi(s),d=p.useRef(null),h=vi(t,e=>l(e)),f=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(n){let e=function(e){if(f.paused||!o)return;const t=e.target;o.contains(t)?d.current=t:es(d.current,{select:!0})},t=function(e){if(f.paused||!o)return;const t=e.relatedTarget;null!==t&&(o.contains(t)||es(d.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&es(o)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return o&&n.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[n,o,f.paused]),p.useEffect(()=>{if(o){ts.add(f);const t=document.activeElement;if(!o.contains(t)){const r=new CustomEvent(Ki,qi);o.addEventListener(Ki,u),o.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(es(n,{select:t}),document.activeElement!==r)return}((e=Qi(o),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&es(o))}return()=>{o.removeEventListener(Ki,u),setTimeout(()=>{const e=new CustomEvent(Yi,qi);o.addEventListener(Yi,c),o.dispatchEvent(e),e.defaultPrevented||es(t??document.body,{select:!0}),o.removeEventListener(Yi,c),ts.remove(f)},0)}}var e},[o,u,c,f]);const g=p.useCallback(e=>{if(!r&&!n)return;if(f.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){const t=e.currentTarget,[n,s]=function(e){const t=Qi(e),r=Zi(t,e),n=Zi(t.reverse(),e);return[r,n]}(t);n&&s?e.shiftKey||i!==s?e.shiftKey&&i===n&&(e.preventDefault(),r&&es(s,{select:!0})):(e.preventDefault(),r&&es(n,{select:!0})):i===t&&e.preventDefault()}},[r,n,f.paused]);return Si.jsx(Ni.div,{tabIndex:-1,...a,ref:h,onKeyDown:g})});function Qi(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Zi(e,t){for(const r of e)if(!Ji(r,{upTo:t}))return r}function Ji(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function es(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}Xi.displayName="FocusScope";var ts=function(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=rs(e,t),e.unshift(t)},remove(t){e=rs(e,t),e[0]?.resume()}}}();function rs(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var ns=p.forwardRef((e,t)=>{const{container:r,...n}=e,[i,s]=p.useState(!1);ki(()=>s(!0),[]);const a=r||i&&globalThis?.document?.body;return a?Pi.createPortal(Si.jsx(Ni.div,{...n,ref:t}),a):null});ns.displayName="Portal";var is=e=>{const{present:t,children:r}=e,n=function(e){const[t,r]=p.useState(),n=p.useRef(null),i=p.useRef(e),s=p.useRef("none"),a=e?"mounted":"unmounted",[o,l]=function(e,t){return p.useReducer((e,r)=>t[e][r]??e,e)}(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const e=ss(n.current);s.current="mounted"===o?e:"none"},[o]),ki(()=>{const t=n.current,r=i.current;if(r!==e){const n=s.current,a=ss(t);if(e)l("MOUNT");else if("none"===a||"none"===t?.display)l("UNMOUNT");else{l(r&&n!==a?"ANIMATION_OUT":"UNMOUNT")}i.current=e}},[e,l]),ki(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,a=s=>{const a=ss(n.current).includes(s.animationName);if(s.target===t&&a&&(l("ANIMATION_END"),!i.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},o=e=>{e.target===t&&(s.current=ss(n.current))};return t.addEventListener("animationstart",o),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",o),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:p.useCallback(e=>{n.current=e?getComputedStyle(e):null,r(e)},[])}}(t),i="function"==typeof r?r({present:n.isPresent}):p.Children.only(r),s=vi(n.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(i));return"function"==typeof r||n.isPresent?p.cloneElement(i,{ref:s}):null};function ss(e){return e?.animationName||"none"}is.displayName="Presence";var as=0;function os(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ls="right-scroll-bar-position",us="width-before-scroll-bar";function cs(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var ds="undefined"!=typeof window?p.useLayoutEffect:p.useEffect,hs=new WeakMap;function fs(e,t){var r,n,i,s=(r=null,n=function(t){return e.forEach(function(e){return cs(e,t)})},(i=p.useState(function(){return{value:r,callback:n,facade:{get current(){return i.value},set current(e){var t=i.value;t!==e&&(i.value=e,i.callback(e,t))}}}})[0]).callback=n,i.facade);return ds(function(){var t=hs.get(s);if(t){var r=new Set(t),n=new Set(e),i=s.current;r.forEach(function(e){n.has(e)||cs(e,null)}),n.forEach(function(e){r.has(e)||cs(e,i)})}hs.set(s,e)},[e]),s}function ps(e){return e}var gs=function(e){var t=e.sideCar,r=Z(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return p.createElement(n,Q({},r))};gs.isSideCarExport=!0;var ms=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=ps);var r=[],n=!1,i={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(e){var i=t(e,n);return r.push(i),function(){r=r.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var i=r;r=[],i.forEach(e),t=r}var s=function(){var r=t;t=[],r.forEach(e)},a=function(){return Promise.resolve().then(s)};a(),r={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),r}}}};return i}(null);return t.options=Q({async:!0,ssr:!1},e),t}(),vs=function(){},ys=p.forwardRef(function(e,t){var r=p.useRef(null),n=p.useState({onScrollCapture:vs,onWheelCapture:vs,onTouchMoveCapture:vs}),i=n[0],s=n[1],a=e.forwardProps,o=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,d=e.shards,h=e.sideCar,f=e.noRelative,g=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,b=void 0===y?"div":y,w=e.gapMode,E=Z(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=h,T=fs([r,t]),k=Q(Q({},E),i);return p.createElement(p.Fragment,null,c&&p.createElement(S,{sideCar:ms,removeScrollBar:u,shards:d,noRelative:f,noIsolation:g,inert:m,setCallbacks:s,allowPinchZoom:!!v,lockRef:r,gapMode:w}),a?p.cloneElement(p.Children.only(o),Q(Q({},k),{ref:T})):p.createElement(b,Q({},k,{className:l,ref:T}),o))});ys.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ys.classNames={fullWidth:us,zeroRight:ls};function bs(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var ws=function(){var e=0,t=null;return{add:function(r){var n,i;0==e&&(t=bs())&&(i=r,(n=t).styleSheet?n.styleSheet.cssText=i:n.appendChild(document.createTextNode(i)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Es=function(){var e,t=(e=ws(),function(t,r){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])});return function(e){var r=e.styles,n=e.dynamic;return t(r,n),null}},Ss={left:0,top:0,right:0,gap:0},Ts=function(e){return parseInt(e||"",10)||0},ks=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Ss;var t=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],i=t["padding"===e?"paddingRight":"marginRight"];return[Ts(r),Ts(n),Ts(i)]}(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},xs=Es(),As="data-scroll-locked",Rs=function(e,t,r,n){var i=e.left,s=e.top,a=e.right,o=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(o,"px ").concat(n,";\n }\n body[").concat(As,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(i,"px;\n padding-top: ").concat(s,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(o,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(o,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(ls," {\n right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(us," {\n margin-right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(ls," .").concat(ls," {\n right: 0 ").concat(n,";\n }\n \n .").concat(us," .").concat(us," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(As,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(o,"px;\n }\n")},Ls=function(){var e=parseInt(document.body.getAttribute(As)||"0",10);return isFinite(e)?e:0},Is=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=void 0===n?"margin":n;p.useEffect(function(){return document.body.setAttribute(As,(Ls()+1).toString()),function(){var e=Ls()-1;e<=0?document.body.removeAttribute(As):document.body.setAttribute(As,e.toString())}},[]);var s=p.useMemo(function(){return ks(i)},[i]);return p.createElement(xs,{styles:Rs(s,!t,i,r?"":"!important")})},Cs=!1;if("undefined"!=typeof window)try{var Ps=Object.defineProperty({},"passive",{get:function(){return Cs=!0,!0}});window.addEventListener("test",Ps,Ps),window.removeEventListener("test",Ps,Ps)}catch(e){Cs=!1}var Ds=!!Cs&&{passive:!1},_s=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},Ms=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),Os(e,n)){var i=Ns(e,n);if(i[1]>i[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Os=function(e,t){return"v"===e?function(e){return _s(e,"overflowY")}(t):function(e){return _s(e,"overflowX")}(t)},Ns=function(e,t){return"v"===e?[(r=t).scrollTop,r.scrollHeight,r.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var r},Fs=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$s=function(e){return[e.deltaX,e.deltaY]},Bs=function(e){return e&&"current"in e?e.current:e},Us=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},zs=0,js=[];function Gs(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Hs,Vs=(Hs=function(e){var t=p.useRef([]),r=p.useRef([0,0]),n=p.useRef(),i=p.useState(zs++)[0],s=p.useState(Es)[0],a=p.useRef(e);p.useEffect(function(){a.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var t=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,s=t.length;i<s;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(Bs),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var o=p.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!a.current.allowPinchZoom;var i,s=Fs(e),o=r.current,l="deltaX"in e?e.deltaX:o[0]-s[0],u="deltaY"in e?e.deltaY:o[1]-s[1],c=e.target,d=Math.abs(l)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var h=Ms(d,c);if(!h)return!0;if(h?i=d:(i="v"===d?"h":"v",h=Ms(d,c)),!h)return!1;if(!n.current&&"changedTouches"in e&&(l||u)&&(n.current=i),!i)return!0;var f=n.current||i;return function(e,t,r,n,i){var s=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=s*n,o=r.target,l=t.contains(o),u=!1,c=a>0,d=0,h=0;do{if(!o)break;var f=Ns(e,o),p=f[0],g=f[1]-f[2]-s*p;(p||g)&&Os(e,o)&&(d+=g,h+=p);var m=o.parentNode;o=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!l&&o!==document.body||l&&(t.contains(o)||t===o));return c&&(Math.abs(d)<1||!i)?u=!0:c||!(Math.abs(h)<1)&&i||(u=!0),u}(f,t,e,"h"===f?l:u,!0)},[]),l=p.useCallback(function(e){var r=e;if(js.length&&js[js.length-1]===s){var n="deltaY"in r?$s(r):Fs(r),i=t.current.filter(function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,n)})[0];if(i&&i.should)r.cancelable&&r.preventDefault();else if(!i){var l=(a.current.shards||[]).map(Bs).filter(Boolean).filter(function(e){return e.contains(r.target)});(l.length>0?o(r,l[0]):!a.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),u=p.useCallback(function(e,r,n,i){var s={name:e,delta:r,target:n,should:i,shadowParent:Gs(n)};t.current.push(s),setTimeout(function(){t.current=t.current.filter(function(e){return e!==s})},1)},[]),c=p.useCallback(function(e){r.current=Fs(e),n.current=void 0},[]),d=p.useCallback(function(t){u(t.type,$s(t),t.target,o(t,e.lockRef.current))},[]),h=p.useCallback(function(t){u(t.type,Fs(t),t.target,o(t,e.lockRef.current))},[]);p.useEffect(function(){return js.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Ds),document.addEventListener("touchmove",l,Ds),document.addEventListener("touchstart",c,Ds),function(){js=js.filter(function(e){return e!==s}),document.removeEventListener("wheel",l,Ds),document.removeEventListener("touchmove",l,Ds),document.removeEventListener("touchstart",c,Ds)}},[]);var f=e.removeScrollBar,g=e.inert;return p.createElement(p.Fragment,null,g?p.createElement(s,{styles:Us(i)}):null,f?p.createElement(Is,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},ms.useMedium(Hs),gs),Ws=p.forwardRef(function(e,t){return p.createElement(ys,Q({},e,{ref:t,sideCar:Vs}))});Ws.classNames=ys.classNames;var Ks=new WeakMap,Ys=new WeakMap,qs={},Xs=0,Qs=function(e){return e&&(e.host||Qs(e.parentNode))},Zs=function(e,t,r,n){var i=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=Qs(t);return r&&e.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);qs[r]||(qs[r]=new WeakMap);var s=qs[r],a=[],o=new Set,l=new Set(i),u=function(e){e&&!o.has(e)&&(o.add(e),u(e.parentNode))};i.forEach(u);var c=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(o.has(e))c(e);else try{var t=e.getAttribute(n),i=null!==t&&"false"!==t,l=(Ks.get(e)||0)+1,u=(s.get(e)||0)+1;Ks.set(e,l),s.set(e,u),a.push(e),1===l&&i&&Ys.set(e,!0),1===u&&e.setAttribute(r,"true"),i||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return c(t),o.clear(),Xs++,function(){a.forEach(function(e){var t=Ks.get(e)-1,i=s.get(e)-1;Ks.set(e,t),s.set(e,i),t||(Ys.has(e)||e.removeAttribute(n),Ys.delete(e)),i||e.removeAttribute(r)}),--Xs||(Ks=new WeakMap,Ks=new WeakMap,Ys=new WeakMap,qs={})}},Js=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),Zs(n,i,r,"aria-hidden")):function(){return null}},ea="Dialog",[ta,ra]=function(e,t=[]){let r=[];const n=()=>{const t=r.map(e=>p.createContext(e));return function(r){const n=r?.[e]||t;return p.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return n.scopeName=e,[function(t,n){const i=p.createContext(n),s=r.length;r=[...r,n];const a=t=>{const{scope:r,children:n,...a}=t,o=r?.[e]?.[s]||i,l=p.useMemo(()=>a,Object.values(a));return Si.jsx(o.Provider,{value:l,children:n})};return a.displayName=t+"Provider",[a,function(r,a){const o=a?.[e]?.[s]||i,l=p.useContext(o);if(l)return l;if(void 0!==n)return n;throw new Error(`\`${r}\` must be used within \`${t}\``)}]},Ti(n,...t)]}(ea),[na,ia]=ta(ea),sa=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,o=p.useRef(null),l=p.useRef(null),[u,c]=Ii({prop:n,defaultProp:i??!1,onChange:s,caller:ea});return Si.jsx(na,{scope:t,triggerRef:o,contentRef:l,contentId:Ri(),titleId:Ri(),descriptionId:Ri(),open:u,onOpenChange:c,onOpenToggle:p.useCallback(()=>c(e=>!e),[c]),modal:a,children:r})};sa.displayName=ea;var aa="DialogTrigger",oa=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=ia(aa,r),s=vi(t,i.triggerRef);return Si.jsx(Ni.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ra(i.open),...n,ref:s,onClick:pi(e.onClick,i.onOpenToggle)})});oa.displayName=aa;var la="DialogPortal",[ua,ca]=ta(la,{forceMount:void 0}),da=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,s=ia(la,t);return Si.jsx(ua,{scope:t,forceMount:r,children:p.Children.map(n,e=>Si.jsx(is,{present:r||s.open,children:Si.jsx(ns,{asChild:!0,container:i,children:e})}))})};da.displayName=la;var ha="DialogOverlay",fa=p.forwardRef((e,t)=>{const r=ca(ha,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,s=ia(ha,e.__scopeDialog);return s.modal?Si.jsx(is,{present:n||s.open,children:Si.jsx(ga,{...i,ref:t})}):null});fa.displayName=ha;var pa=Di("DialogOverlay.RemoveScroll"),ga=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=ia(ha,r);return Si.jsx(Ws,{as:pa,allowPinchZoom:!0,shards:[i.contentRef],children:Si.jsx(Ni.div,{"data-state":Ra(i.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),ma="DialogContent",va=p.forwardRef((e,t)=>{const r=ca(ma,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,s=ia(ma,e.__scopeDialog);return Si.jsx(is,{present:n||s.open,children:s.modal?Si.jsx(ya,{...i,ref:t}):Si.jsx(ba,{...i,ref:t})})});va.displayName=ma;var ya=p.forwardRef((e,t)=>{const r=ia(ma,e.__scopeDialog),n=p.useRef(null),i=vi(t,r.contentRef,n);return p.useEffect(()=>{const e=n.current;if(e)return Js(e)},[]),Si.jsx(wa,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:pi(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:pi(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:pi(e.onFocusOutside,e=>e.preventDefault())})}),ba=p.forwardRef((e,t)=>{const r=ia(ma,e.__scopeDialog),n=p.useRef(!1),i=p.useRef(!1);return Si.jsx(wa,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||r.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));const s=t.target,a=r.triggerRef.current?.contains(s);a&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),wa=p.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=e,o=ia(ma,r),l=p.useRef(null),u=vi(t,l);return p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??os()),document.body.insertAdjacentElement("beforeend",e[1]??os()),as++,()=>{1===as&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),as--}},[]),Si.jsxs(Si.Fragment,{children:[Si.jsx(Xi,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s,children:Si.jsx(Hi,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":Ra(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),Si.jsxs(Si.Fragment,{children:[Si.jsx(Pa,{titleId:o.titleId}),Si.jsx(Da,{contentRef:l,descriptionId:o.descriptionId})]})]})}),Ea="DialogTitle",Sa=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=ia(Ea,r);return Si.jsx(Ni.h2,{id:i.titleId,...n,ref:t})});Sa.displayName=Ea;var Ta="DialogDescription",ka=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=ia(Ta,r);return Si.jsx(Ni.p,{id:i.descriptionId,...n,ref:t})});ka.displayName=Ta;var xa="DialogClose",Aa=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=ia(xa,r);return Si.jsx(Ni.button,{type:"button",...n,ref:t,onClick:pi(e.onClick,()=>i.onOpenChange(!1))})});function Ra(e){return e?"open":"closed"}Aa.displayName=xa;var La="DialogTitleWarning",[Ia,Ca]=function(e,t){const r=p.createContext(t),n=e=>{const{children:t,...n}=e,i=p.useMemo(()=>n,Object.values(n));return Si.jsx(r.Provider,{value:i,children:t})};return n.displayName=e+"Provider",[n,function(n){const i=p.useContext(r);if(i)return i;if(void 0!==t)return t;throw new Error(`\`${n}\` must be used within \`${e}\``)}]}(La,{contentName:ma,titleName:Ea,docsSlug:"dialog"}),Pa=({titleId:e})=>{const t=Ca(La),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{if(e){document.getElementById(e)||console.error(r)}},[r,e]),null},Da=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ca("DialogDescriptionWarning").contentName}}.`;return p.useEffect(()=>{const n=e.current?.getAttribute("aria-describedby");if(t&&n){document.getElementById(t)||console.warn(r)}},[r,e,t]),null},_a=sa,Ma=oa,Oa=da,Na=fa,Fa=va,$a=Sa,Ba=ka,Ua=Aa;const za=g.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),ja=()=>{const e=g.useContext(za);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};function Ga(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Ha(){return Wa(/^iPad/)||Wa(/^Mac/)&&navigator.maxTouchPoints>1}function Va(){return Wa(/^iPhone/)||Ha()}function Wa(e){return"undefined"!=typeof window&&null!=window.navigator?e.test(window.navigator.platform):void 0}!function(e){if("undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");const Ka="undefined"!=typeof window?p.useLayoutEffect:p.useEffect;function Ya(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}const qa="undefined"!=typeof document&&window.visualViewport;function Xa(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Qa(e){for(Xa(e)&&(e=e.parentElement);e&&!Xa(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Za=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Ja,eo=0;function to(e={}){let{isDisabled:t}=e;Ka(()=>{if(!t)return eo++,1===eo&&Va()&&(Ja=function(){let e,t=0,r=r=>{e=Qa(r.target),e===document.documentElement&&e===document.body||(t=r.changedTouches[0].pageY)},n=r=>{if(!e||e===document.documentElement||e===document.body)return void r.preventDefault();let n=r.changedTouches[0].pageY,i=e.scrollTop,s=e.scrollHeight-e.clientHeight;0!==s&&((i<=0&&n>t||i>=s&&n<t)&&r.preventDefault(),t=n)},i=e=>{let t=e.target;io(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},s=e=>{let t=e.target;io(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",qa&&(qa.height<window.innerHeight?requestAnimationFrame(()=>{no(t)}):qa.addEventListener("resize",()=>no(t),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},o=window.pageXOffset,l=window.pageYOffset,u=Ya(function(e,t,r){let n=e.style[t];return e.style[t]=r,()=>{e.style[t]=n}}(document.documentElement,"paddingRight",window.innerWidth-document.documentElement.clientWidth+"px"));window.scrollTo(0,0);let c=Ya(ro(document,"touchstart",r,{passive:!1,capture:!0}),ro(document,"touchmove",n,{passive:!1,capture:!0}),ro(document,"touchend",i,{passive:!1,capture:!0}),ro(document,"focus",s,!0),ro(window,"scroll",a));return()=>{u(),c(),window.scrollTo(o,l)}}()),()=>{eo--,0===eo&&(null==Ja||Ja())}},[t])}function ro(e,t,r,n){return e.addEventListener(t,r,n),()=>{e.removeEventListener(t,r,n)}}function no(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=Qa(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let r=t.getBoundingClientRect().top,n=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=n-r)}e=t.parentElement}}function io(e){return e instanceof HTMLInputElement&&!Za.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function so(...e){return p.useCallback(function(...e){return t=>e.forEach(e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t))}(...e),e)}const ao=new WeakMap;function oo(e,t,r=!1){if(!(e&&e instanceof HTMLElement))return;let n={};Object.entries(t).forEach(([t,r])=>{t.startsWith("--")?e.style.setProperty(t,r):(n[t]=e.style[t],e.style[t]=r)}),r||ao.set(e,n)}const lo=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function uo(e,t){if(!e)return null;const r=window.getComputedStyle(e),n=r.transform||r.webkitTransform||r.mozTransform;let i=n.match(/^matrix3d\((.+)\)$/);return i?parseFloat(i[1].split(", ")[lo(t)?13:12]):(i=n.match(/^matrix\((.+)\)$/),i?parseFloat(i[1].split(", ")[lo(t)?5:4]):null)}function co(e,t){if(!e)return()=>{};const r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}const ho={DURATION:.5,EASE:[.32,.72,0,1]},fo=16,po="vaul-dragging";function go(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...e)=>null==t.current?void 0:t.current.call(t,...e),[])}function mo({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,i]=function({defaultProp:e,onChange:t}){const r=g.useState(e),[n]=r,i=g.useRef(n),s=go(t);return g.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}({defaultProp:t,onChange:r}),s=void 0!==e,a=s?e:n,o=go(r),l=g.useCallback(t=>{if(s){const r="function"==typeof t?t(e):t;r!==e&&o(r)}else i(t)},[s,e,i,o]);return[a,l]}let vo=null;function yo({open:e,onOpenChange:t,children:r,onDrag:n,onRelease:i,snapPoints:s,shouldScaleBackground:a=!1,setBackgroundColorOnScale:o=!0,closeThreshold:l=.25,scrollLockTimeout:u=100,dismissible:c=!0,handleOnly:d=!1,fadeFromIndex:h=s&&s.length-1,activeSnapPoint:f,setActiveSnapPoint:p,fixed:m,modal:v=!0,onClose:y,nested:b,noBodyStyles:w=!1,direction:E="bottom",defaultOpen:S=!1,disablePreventScroll:T=!0,snapToSequentialPoint:k=!1,preventScrollRestoration:x=!1,repositionInputs:A=!0,onAnimationEnd:R,container:L,autoFocus:I=!1}){var C,P;const[D=!1,_]=mo({defaultProp:S,prop:e,onChange:e=>{null==t||t(e),e||b||ce(),setTimeout(()=>{null==R||R(e)},1e3*ho.DURATION),e&&!v&&"undefined"!=typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[M,O]=g.useState(!1),[N,F]=g.useState(!1),[$,B]=g.useState(!1),U=g.useRef(null),z=g.useRef(null),j=g.useRef(null),G=g.useRef(null),H=g.useRef(null),V=g.useRef(!1),W=g.useRef(null),K=g.useRef(0),Y=g.useRef(!1),q=g.useRef(!S),X=g.useRef(0),Q=g.useRef(null),Z=g.useRef((null==(C=Q.current)?void 0:C.getBoundingClientRect().height)||0),J=g.useRef((null==(P=Q.current)?void 0:P.getBoundingClientRect().width)||0),ee=g.useRef(0),te=g.useCallback(e=>{s&&e===ae.length-1&&(z.current=new Date)},[]),{activeSnapPoint:re,activeSnapPointIndex:ne,setActiveSnapPoint:ie,onRelease:se,snapPointsOffset:ae,onDrag:oe,shouldFade:le,getPercentageDragged:ue}=function({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:r,drawerRef:n,overlayRef:i,fadeFromIndex:s,onSnapPointChange:a,direction:o="bottom",container:l,snapToSequentialPoint:u}){const[c,d]=mo({prop:e,defaultProp:null==r?void 0:r[0],onChange:t}),[h,f]=g.useState("undefined"!=typeof window?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);g.useEffect(()=>{function e(){f({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const p=g.useMemo(()=>c===(null==r?void 0:r[r.length-1])||null,[r,c]),m=g.useMemo(()=>{var e;return null!=(e=null==r?void 0:r.findIndex(e=>e===c))?e:null},[r,c]),v=r&&r.length>0&&(s||0===s)&&!Number.isNaN(s)&&r[s]===c||!r,y=g.useMemo(()=>{const e=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:"undefined"!=typeof window?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var t;return null!=(t=null==r?void 0:r.map(t=>{const r="string"==typeof t;let n=0;if(r&&(n=parseInt(t,10)),lo(o)){const i=r?n:h?t*e.height:0;return h?"bottom"===o?e.height-i:-e.height+i:i}const i=r?n:h?t*e.width:0;return h?"right"===o?e.width-i:-e.width+i:i}))?t:[]},[r,h,l]),b=g.useMemo(()=>null!==m?null==y?void 0:y[m]:null,[y,m]),w=g.useCallback(e=>{var t;const l=null!=(t=null==y?void 0:y.findIndex(t=>t===e))?t:null;a(l),oo(n.current,{transition:`transform ${ho.DURATION}s cubic-bezier(${ho.EASE.join(",")})`,transform:lo(o)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),y&&l!==y.length-1&&void 0!==s&&l!==s&&l<s?oo(i.current,{transition:`opacity ${ho.DURATION}s cubic-bezier(${ho.EASE.join(",")})`,opacity:"0"}):oo(i.current,{transition:`opacity ${ho.DURATION}s cubic-bezier(${ho.EASE.join(",")})`,opacity:"1"}),d(null==r?void 0:r[Math.max(l,0)])},[n.current,r,y,s,i,d]);return g.useEffect(()=>{if(c||e){var t;const n=null!=(t=null==r?void 0:r.findIndex(t=>t===e||t===c))?t:-1;y&&-1!==n&&"number"==typeof y[n]&&w(y[n])}},[c,e,r,y,w]),{isLastSnapPoint:p,activeSnapPoint:c,shouldFade:v,getPercentageDragged:function(e,t){if(!r||"number"!=typeof m||!y||void 0===s)return null;const n=m===s-1;if(m>=s&&t)return 0;if(n&&!t)return 1;if(!v&&!n)return null;const i=n?m+1:m-1,a=n?y[i]-y[i-1]:y[i+1]-y[i],o=e/Math.abs(a);return n?1-o:o},setActiveSnapPoint:d,activeSnapPointIndex:m,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:n,dismissible:a}){if(void 0===s)return;const l="bottom"===o||"right"===o?(null!=b?b:0)-e:(null!=b?b:0)+e,c=0===m,d=e>0;if(m===s-1&&oo(i.current,{transition:`opacity ${ho.DURATION}s cubic-bezier(${ho.EASE.join(",")})`}),!u&&n>2&&!d)return void(a?t():w(y[0]));if(!u&&n>2&&d&&y&&r)return void w(y[r.length-1]);const h=null==y?void 0:y.reduce((e,t)=>"number"!=typeof e||"number"!=typeof t?e:Math.abs(t-l)<Math.abs(e-l)?t:e),f=lo(o)?window.innerHeight:window.innerWidth;if(n>.4&&Math.abs(e)<.4*f){const e=d?1:-1;if(e>0&&p&&r)return void w(y[r.length-1]);if(c&&e<0&&a&&t(),null===m)return;return void w(y[m+e])}w(h)},onDrag:function({draggedDistance:e}){if(null===b)return;const t="bottom"===o||"right"===o?b-e:b+e;("bottom"===o||"right"===o)&&t<y[y.length-1]||("top"===o||"left"===o)&&t>y[y.length-1]||oo(n.current,{transform:lo(o)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:y}}({snapPoints:s,activeSnapPointProp:f,setActiveSnapPointProp:p,drawerRef:Q,fadeFromIndex:h,overlayRef:U,onSnapPointChange:te,direction:E,container:L,snapToSequentialPoint:k});to({isDisabled:!D||N||!v||$||!M||!A||!T});const{restorePositionSetting:ce}=function({isOpen:e,modal:t,nested:r,hasBeenOpened:n,preventScrollRestoration:i,noBodyStyles:s}){const[a,o]=g.useState(()=>"undefined"!=typeof window?window.location.href:""),l=g.useRef(0),u=g.useCallback(()=>{if(Ga()&&null===vo&&e&&!s){vo={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:e,innerHeight:t}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:-l.current+"px",left:-e+"px",right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const e=t-window.innerHeight;e&&l.current>=t&&(document.body.style.top=-(l.current+e)+"px")}),300)}},[e]),c=g.useCallback(()=>{if(Ga()&&null!==vo&&!s){const e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,vo),window.requestAnimationFrame(()=>{i&&a!==window.location.href?o(window.location.href):window.scrollTo(t,e)}),vo=null}},[a]);return g.useEffect(()=>{function e(){l.current=window.scrollY}return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),g.useEffect(()=>{if(t)return()=>{"undefined"!=typeof document&&(document.querySelector("[data-vaul-drawer]")||c())}},[t,c]),g.useEffect(()=>{!r&&n&&(e?(!window.matchMedia("(display-mode: standalone)").matches&&u(),t||window.setTimeout(()=>{c()},500)):c())},[e,n,a,t,r,u,c]),{restorePositionSetting:c}}({isOpen:D,modal:v,nested:null!=b&&b,hasBeenOpened:M,preventScrollRestoration:x,noBodyStyles:w});function de(){return(window.innerWidth-26)/window.innerWidth}function he(e,t){var r;let n=e;const i=null==(r=window.getSelection())?void 0:r.toString(),s=Q.current?uo(Q.current,E):null,a=new Date;if("SELECT"===n.tagName)return!1;if(n.hasAttribute("data-vaul-no-drag")||n.closest("[data-vaul-no-drag]"))return!1;if("right"===E||"left"===E)return!0;if(z.current&&a.getTime()-z.current.getTime()<500)return!1;if(null!==s&&("bottom"===E?s>0:s<0))return!0;if(i&&i.length>0)return!1;if(H.current&&a.getTime()-H.current.getTime()<u&&0===s)return H.current=a,!1;if(t)return H.current=a,!1;for(;n;){if(n.scrollHeight>n.clientHeight){if(0!==n.scrollTop)return H.current=new Date,!1;if("dialog"===n.getAttribute("role"))return!0}n=n.parentNode}return!0}function fe(e){!function(){if(!N||!Q.current)return;Q.current.classList.remove(po),V.current=!1,F(!1),G.current=new Date}(),null==y||y(),e||_(!1),setTimeout(()=>{s&&ie(s[0])},1e3*ho.DURATION)}function pe(){if(!Q.current)return;const e=document.querySelector("[data-vaul-drawer-wrapper]"),t=uo(Q.current,E);oo(Q.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${ho.DURATION}s cubic-bezier(${ho.EASE.join(",")})`}),oo(U.current,{transition:`opacity ${ho.DURATION}s cubic-bezier(${ho.EASE.join(",")})`,opacity:"1"}),a&&t&&t>0&&D&&oo(e,{borderRadius:"8px",overflow:"hidden",...lo(E)?{transform:`scale(${de()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${de()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${ho.DURATION}s`,transitionTimingFunction:`cubic-bezier(${ho.EASE.join(",")})`},!0)}return g.useEffect(()=>{window.requestAnimationFrame(()=>{q.current=!0})},[]),g.useEffect(()=>{var e;function t(){if(!Q.current||!A)return;if(io(document.activeElement)||Y.current){var e;const t=(null==(e=window.visualViewport)?void 0:e.height)||0,r=window.innerHeight;let n=r-t;const i=Q.current.getBoundingClientRect().height||0,a=i>.8*r;ee.current||(ee.current=i);const o=Q.current.getBoundingClientRect().top;if(Math.abs(X.current-n)>60&&(Y.current=!Y.current),s&&s.length>0&&ae&&ne){n+=ae[ne]||0}if(X.current=n,i>t||Y.current){const e=Q.current.getBoundingClientRect().height;let r=e;e>t&&(r=t-(a?o:26)),Q.current.style.height=m?e-Math.max(n,0)+"px":`${Math.max(r,t-o)}px`}else(function(){const e=navigator.userAgent;return"undefined"!=typeof window&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))})()||(Q.current.style.height=`${ee.current}px`);s&&s.length>0&&!Y.current?Q.current.style.bottom="0px":Q.current.style.bottom=`${Math.max(n,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}},[ne,s,ae]),g.useEffect(()=>(D&&(oo(document.documentElement,{scrollBehavior:"auto"}),z.current=new Date),()=>{!function(e,t){if(!(e&&e instanceof HTMLElement))return;let r=ao.get(e);r&&(e.style[t]=r[t])}(document.documentElement,"scrollBehavior")}),[D]),g.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),g.createElement(_a,{defaultOpen:S,onOpenChange:e=>{(c||e)&&(e?O(!0):fe(!0),_(e))},open:D},g.createElement(za.Provider,{value:{activeSnapPoint:re,snapPoints:s,setActiveSnapPoint:ie,drawerRef:Q,overlayRef:U,onOpenChange:t,onPress:function(e){var t,r;(c||s)&&(Q.current&&!Q.current.contains(e.target)||(Z.current=(null==(t=Q.current)?void 0:t.getBoundingClientRect().height)||0,J.current=(null==(r=Q.current)?void 0:r.getBoundingClientRect().width)||0,F(!0),j.current=new Date,Va()&&window.addEventListener("touchend",()=>V.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),K.current=lo(E)?e.pageY:e.pageX))},onRelease:function(e){if(!N||!Q.current)return;Q.current.classList.remove(po),V.current=!1,F(!1),G.current=new Date;const t=uo(Q.current,E);if(!e||!he(e.target,!1)||!t||Number.isNaN(t))return;if(null===j.current)return;const r=G.current.getTime()-j.current.getTime(),n=K.current-(lo(E)?e.pageY:e.pageX),a=Math.abs(n)/r;if(a>.05&&(B(!0),setTimeout(()=>{B(!1)},200)),s){return se({draggedDistance:n*("bottom"===E||"right"===E?1:-1),closeDrawer:fe,velocity:a,dismissible:c}),void(null==i||i(e,!0))}if("bottom"===E||"right"===E?n>0:n<0)return pe(),void(null==i||i(e,!0));if(a>.4)return fe(),void(null==i||i(e,!1));var o;const u=Math.min(null!=(o=Q.current.getBoundingClientRect().height)?o:0,window.innerHeight);var d;const h=Math.min(null!=(d=Q.current.getBoundingClientRect().width)?d:0,window.innerWidth),f="left"===E||"right"===E;if(Math.abs(t)>=(f?h:u)*l)return fe(),void(null==i||i(e,!1));null==i||i(e,!0),pe()},onDrag:function(e){if(Q.current&&N){const t="bottom"===E||"right"===E?1:-1,r=(K.current-(lo(E)?e.pageY:e.pageX))*t,i=r>0,o=s&&!c&&!i;if(o&&0===ne)return;const l=Math.abs(r),u=document.querySelector("[data-vaul-drawer-wrapper]");let d=l/("bottom"===E||"top"===E?Z.current:J.current);const f=ue(l,i);if(null!==f&&(d=f),o&&d>=1)return;if(!V.current&&!he(e.target,i))return;if(Q.current.classList.add(po),V.current=!0,oo(Q.current,{transition:"none"}),oo(U.current,{transition:"none"}),s&&oe({draggedDistance:r}),i&&!s){const e=function(e){return 8*(Math.log(e+1)-2)}(r),n=Math.min(-1*e,0)*t;return void oo(Q.current,{transform:lo(E)?`translate3d(0, ${n}px, 0)`:`translate3d(${n}px, 0, 0)`})}const p=1-d;if((le||h&&ne===h-1)&&(null==n||n(e,d),oo(U.current,{opacity:`${p}`,transition:"none"},!0)),u&&U.current&&a){const e=Math.min(de()+d*(1-de()),1),t=8-8*d,r=Math.max(0,14-14*d);oo(u,{borderRadius:`${t}px`,transform:lo(E)?`scale(${e}) translate3d(0, ${r}px, 0)`:`scale(${e}) translate3d(${r}px, 0, 0)`,transition:"none"},!0)}if(!s){const e=l*t;oo(Q.current,{transform:lo(E)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:c,shouldAnimate:q,handleOnly:d,isOpen:D,isDragging:N,shouldFade:le,closeDrawer:fe,onNestedDrag:function(e,t){if(t<0)return;const r=(window.innerWidth-fo)/window.innerWidth,n=r+t*(1-r),i=t*fo-16;oo(Q.current,{transform:lo(E)?`scale(${n}) translate3d(0, ${i}px, 0)`:`scale(${n}) translate3d(${i}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){const t=e?(window.innerWidth-fo)/window.innerWidth:1,r=e?-16:0;W.current&&window.clearTimeout(W.current),oo(Q.current,{transition:`transform ${ho.DURATION}s cubic-bezier(${ho.EASE.join(",")})`,transform:lo(E)?`scale(${t}) translate3d(0, ${r}px, 0)`:`scale(${t}) translate3d(${r}px, 0, 0)`}),!e&&Q.current&&(W.current=setTimeout(()=>{const e=uo(Q.current,E);oo(Q.current,{transition:"none",transform:lo(E)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){const r=lo(E)?window.innerHeight:window.innerWidth,n=t?(r-fo)/r:1,i=t?-16:0;t&&oo(Q.current,{transition:`transform ${ho.DURATION}s cubic-bezier(${ho.EASE.join(",")})`,transform:lo(E)?`scale(${n}) translate3d(0, ${i}px, 0)`:`scale(${n}) translate3d(${i}px, 0, 0)`})},keyboardIsOpen:Y,modal:v,snapPointsOffset:ae,activeSnapPointIndex:ne,direction:E,shouldScaleBackground:a,setBackgroundColorOnScale:o,noBodyStyles:w,container:L,autoFocus:I}},r))}const bo=g.forwardRef(function({...e},t){const{overlayRef:r,snapPoints:n,onRelease:i,shouldFade:s,isOpen:a,modal:o,shouldAnimate:l}=ja(),u=so(t,r),c=n&&n.length>0;if(!o)return null;const d=g.useCallback(e=>i(e),[i]);return g.createElement(Na,{onMouseUp:d,ref:u,"data-vaul-overlay":"","data-vaul-snap-points":a&&c?"true":"false","data-vaul-snap-points-overlay":a&&s?"true":"false","data-vaul-animate":(null==l?void 0:l.current)?"true":"false",...e})});bo.displayName="Drawer.Overlay";const wo=g.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:r,...n},i){const{drawerRef:s,onPress:a,onRelease:o,onDrag:l,keyboardIsOpen:u,snapPointsOffset:c,activeSnapPointIndex:d,modal:h,isOpen:f,direction:m,snapPoints:v,container:y,handleOnly:b,shouldAnimate:w,autoFocus:E}=ja(),[S,T]=g.useState(!1),k=so(i,s),x=g.useRef(null),A=g.useRef(null),R=g.useRef(!1),L=v&&v.length>0;!function(){const{direction:e,isOpen:t,shouldScaleBackground:r,setBackgroundColorOnScale:n,noBodyStyles:i}=ja(),s=g.useRef(null),a=p.useMemo(()=>document.body.style.backgroundColor,[]);function o(){return(window.innerWidth-26)/window.innerWidth}g.useEffect(()=>{if(t&&r){s.current&&clearTimeout(s.current);const t=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!t)return;n&&!i&&co(document.body,{background:"black"}),co(t,{transformOrigin:lo(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${ho.DURATION}s`,transitionTimingFunction:`cubic-bezier(${ho.EASE.join(",")})`});const r=co(t,{borderRadius:"8px",overflow:"hidden",...lo(e)?{transform:`scale(${o()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${o()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{r(),s.current=window.setTimeout(()=>{a?document.body.style.background=a:document.body.style.removeProperty("background")},1e3*ho.DURATION)}}},[t,r,a])}();function I(e){x.current=null,R.current=!1,o(e)}return g.useEffect(()=>{L&&window.requestAnimationFrame(()=>{T(!0)})},[]),g.createElement(Fa,{"data-vaul-drawer-direction":m,"data-vaul-drawer":"","data-vaul-delayed-snap-points":S?"true":"false","data-vaul-snap-points":f&&L?"true":"false","data-vaul-custom-container":y?"true":"false","data-vaul-animate":(null==w?void 0:w.current)?"true":"false",...n,ref:k,style:c&&c.length>0?{"--snap-point-height":`${c[null!=d?d:0]}px`,...t}:t,onPointerDown:e=>{b||(null==n.onPointerDown||n.onPointerDown.call(n,e),x.current={x:e.pageX,y:e.pageY},a(e))},onOpenAutoFocus:e=>{null==r||r(e),E||e.preventDefault()},onPointerDownOutside:t=>{null==e||e(t),h&&!t.defaultPrevented?u.current&&(u.current=!1):t.preventDefault()},onFocusOutside:e=>{h||e.preventDefault()},onPointerMove:e=>{if(A.current=e,b)return;if(null==n.onPointerMove||n.onPointerMove.call(n,e),!x.current)return;const t=e.pageY-x.current.y,r=e.pageX-x.current.x,i="touch"===e.pointerType?10:2,s=((e,t,r=0)=>{if(R.current)return!0;const n=Math.abs(e.y),i=Math.abs(e.x),s=i>n,a=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*a<0)&&i>=0&&i<=r)return s}else if(!(e.y*a<0)&&n>=0&&n<=r)return!s;return R.current=!0,!0})({x:r,y:t},m,i);s?l(e):(Math.abs(r)>i||Math.abs(t)>i)&&(x.current=null)},onPointerUp:e=>{null==n.onPointerUp||n.onPointerUp.call(n,e),x.current=null,R.current=!1,o(e)},onPointerOut:e=>{null==n.onPointerOut||n.onPointerOut.call(n,e),I(A.current)},onContextMenu:e=>{null==n.onContextMenu||n.onContextMenu.call(n,e),A.current&&I(A.current)}})});wo.displayName="Drawer.Content";const Eo=g.forwardRef(function({preventCycle:e=!1,children:t,...r},n){const{closeDrawer:i,isDragging:s,snapPoints:a,activeSnapPoint:o,setActiveSnapPoint:l,dismissible:u,handleOnly:c,isOpen:d,onPress:h,onDrag:f}=ja(),p=g.useRef(null),m=g.useRef(!1);function v(){p.current&&window.clearTimeout(p.current),m.current=!1}return g.createElement("div",{onClick:function(){m.current?v():window.setTimeout(()=>{!function(){if(s||e||m.current)return void v();if(v(),!a||0===a.length)return void(u||i());if(o===a[a.length-1]&&u)return void i();const t=a.findIndex(e=>e===o);if(-1===t)return;const r=a[t+1];l(r)}()},120)},onPointerCancel:v,onPointerDown:e=>{c&&h(e),p.current=window.setTimeout(()=>{m.current=!0},250)},onPointerMove:e=>{c&&f(e)},ref:n,"data-vaul-drawer-visible":d?"true":"false","data-vaul-handle":"","aria-hidden":"true",...r},g.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});Eo.displayName="Drawer.Handle";const So={Root:yo,NestedRoot:function({onDrag:e,onOpenChange:t,open:r,...n}){const{onNestedDrag:i,onNestedOpenChange:s,onNestedRelease:a}=ja();if(!i)throw new Error("Drawer.NestedRoot must be placed in another drawer");return g.createElement(yo,{nested:!0,open:r,onClose:()=>{s(!1)},onDrag:(t,r)=>{i(t,r),null==e||e(t,r)},onOpenChange:e=>{e&&s(e),null==t||t(e)},onRelease:a,...n})},Content:wo,Overlay:bo,Trigger:Ma,Portal:function(e){const t=ja(),{container:r=t.container,...n}=e;return g.createElement(Oa,{container:r,...n})},Handle:Eo,Close:Ua,Title:$a,Description:Ba};function To(e){var t=Z(e,[]);return p.createElement(So.Root,Object.assign({"data-slot":"drawer"},t))}function ko(e){var t=Z(e,[]);return p.createElement(So.Trigger,Object.assign({"data-slot":"drawer-trigger"},t))}function xo(e){var t=Z(e,[]);return p.createElement(So.Portal,Object.assign({"data-slot":"drawer-portal"},t))}function Ao(e){var{className:t}=e,r=Z(e,["className"]);return p.createElement(So.Overlay,Object.assign({"data-slot":"drawer-overlay",className:Ot("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[999999] bg-black/50",t)},r))}function Ro(e){var{className:t,children:r}=e,n=Z(e,["className","children"]);return p.createElement(xo,{"data-slot":"drawer-portal"},p.createElement(Ao,null),p.createElement(So.Content,Object.assign({"data-slot":"drawer-content",className:Ot("group/drawer-content bg-background fixed z-[999999] flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",t)},n),p.createElement("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),r))}function Lo(e){var{className:t}=e,r=Z(e,["className"]);return p.createElement("div",Object.assign({"data-slot":"drawer-header",className:Ot("flex flex-col gap-1.5 p-4",t)},r))}function Io(e){var{className:t}=e,r=Z(e,["className"]);return p.createElement(So.Title,Object.assign({"data-slot":"drawer-title",className:Ot("text-foreground font-semibold",t)},r))}const Co=({children:e,products:t,contentId:r})=>{const{isPreview:n}=cr();return g.createElement(To,{direction:"right",fadeFromIndex:0,snapPoints:[1]},g.createElement(ko,{className:"w-full"},e),g.createElement(Ro,null,g.createElement(Lo,null,g.createElement(Io,null,"상품 목록")),g.createElement("div",{className:"overflow-y-scroll grid-cols-2 grid items-baseline justify-items-center scrollbar-hide"},t.map(e=>e.linkPath?g.createElement("a",{key:e.productId,className:"p-2 text-gray-800 w-full h-full flex flex-col items-center justify-center no-underline",href:e.linkPath,target:"_blank",onClick:()=>J(void 0,void 0,void 0,function*(){n||(yield Zt({contentId:r,contentProductId:e.eventProductId,productId:e.productId}))})},g.createElement(Po,{product:e})):g.createElement(Po,{key:e.productId,product:e})))))},Po=({product:e})=>g.createElement("div",{className:"text-gray-800 w-32"},g.createElement("div",{className:"w-full aspect-square mb-2 border border-[#f4f3f6] rounded "},g.createElement("img",{src:e.thumbPath,alt:e.productName,className:"w-full h-full"})),e.brand&&g.createElement("p",{className:"text-xs text-gray-400 mb-1"},e.brand.brandName),g.createElement("p",{className:"w-full text-[12px] md:text-[15px] mb-1"},e.productName),g.createElement("div",{className:"w-full "},g.createElement("div",{className:"flex"},g.createElement("span",{className:"text-sm text-red-500 mr-2 font-semibold"},e.discount,"%"),g.createElement("span",{className:"font-semibold"},Nt(e.sellingPrice),"원"))));function Do(e){let t,r,{swiper:n,extendParams:i,on:s,emit:a,params:o}=e;n.autoplay={running:!1,paused:!1,timeLeft:0},i({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let l,u,c,d,h,f,p,g,m=o&&o.autoplay?o.autoplay.delay:3e3,v=o&&o.autoplay?o.autoplay.delay:3e3,y=(new Date).getTime();function b(e){n&&!n.destroyed&&n.wrapperEl&&e.target===n.wrapperEl&&(n.wrapperEl.removeEventListener("transitionend",b),g||e.detail&&e.detail.bySwiperTouchMove||x())}const w=()=>{if(n.destroyed||!n.autoplay.running)return;n.autoplay.paused?u=!0:u&&(v=l,u=!1);const e=n.autoplay.paused?l:y+v-(new Date).getTime();n.autoplay.timeLeft=e,a("autoplayTimeLeft",e,e/m),r=requestAnimationFrame(()=>{w()})},E=e=>{if(n.destroyed||!n.autoplay.running)return;cancelAnimationFrame(r),w();let i=void 0===e?n.params.autoplay.delay:e;m=n.params.autoplay.delay,v=n.params.autoplay.delay;const s=(()=>{let e;if(e=n.virtual&&n.params.virtual.enabled?n.slides.filter(e=>e.classList.contains("swiper-slide-active"))[0]:n.slides[n.activeIndex],!e)return;return parseInt(e.getAttribute("data-swiper-autoplay"),10)})();!Number.isNaN(s)&&s>0&&void 0===e&&(i=s,m=s,v=s),l=i;const o=n.params.speed,u=()=>{n&&!n.destroyed&&(n.params.autoplay.reverseDirection?!n.isBeginning||n.params.loop||n.params.rewind?(n.slidePrev(o,!0,!0),a("autoplay")):n.params.autoplay.stopOnLastSlide||(n.slideTo(n.slides.length-1,o,!0,!0),a("autoplay")):!n.isEnd||n.params.loop||n.params.rewind?(n.slideNext(o,!0,!0),a("autoplay")):n.params.autoplay.stopOnLastSlide||(n.slideTo(0,o,!0,!0),a("autoplay")),n.params.cssMode&&(y=(new Date).getTime(),requestAnimationFrame(()=>{E()})))};return i>0?(clearTimeout(t),t=setTimeout(()=>{u()},i)):requestAnimationFrame(()=>{u()}),i},S=()=>{y=(new Date).getTime(),n.autoplay.running=!0,E(),a("autoplayStart")},T=()=>{n.autoplay.running=!1,clearTimeout(t),cancelAnimationFrame(r),a("autoplayStop")},k=(e,r)=>{if(n.destroyed||!n.autoplay.running)return;clearTimeout(t),e||(p=!0);const i=()=>{a("autoplayPause"),n.params.autoplay.waitForTransition?n.wrapperEl.addEventListener("transitionend",b):x()};if(n.autoplay.paused=!0,r)return f&&(l=n.params.autoplay.delay),f=!1,void i();const s=l||n.params.autoplay.delay;l=s-((new Date).getTime()-y),n.isEnd&&l<0&&!n.params.loop||(l<0&&(l=0),i())},x=()=>{n.isEnd&&l<0&&!n.params.loop||n.destroyed||!n.autoplay.running||(y=(new Date).getTime(),p?(p=!1,E(l)):E(),n.autoplay.paused=!1,a("autoplayResume"))},A=()=>{if(n.destroyed||!n.autoplay.running)return;const e=yr();"hidden"===e.visibilityState&&(p=!0,k(!0)),"visible"===e.visibilityState&&x()},R=e=>{"mouse"===e.pointerType&&(p=!0,g=!0,n.animating||n.autoplay.paused||k(!0))},L=e=>{"mouse"===e.pointerType&&(g=!1,n.autoplay.paused&&x())};s("init",()=>{n.params.autoplay.enabled&&(n.params.autoplay.pauseOnMouseEnter&&(n.el.addEventListener("pointerenter",R),n.el.addEventListener("pointerleave",L)),yr().addEventListener("visibilitychange",A),S())}),s("destroy",()=>{n.el&&"string"!=typeof n.el&&(n.el.removeEventListener("pointerenter",R),n.el.removeEventListener("pointerleave",L)),yr().removeEventListener("visibilitychange",A),n.autoplay.running&&T()}),s("_freeModeStaticRelease",()=>{(d||p)&&x()}),s("_freeModeNoMomentumRelease",()=>{n.params.autoplay.disableOnInteraction?T():k(!0,!0)}),s("beforeTransitionStart",(e,t,r)=>{!n.destroyed&&n.autoplay.running&&(r||!n.params.autoplay.disableOnInteraction?k(!0,!0):T())}),s("sliderFirstMove",()=>{!n.destroyed&&n.autoplay.running&&(n.params.autoplay.disableOnInteraction?T():(c=!0,d=!1,p=!1,h=setTimeout(()=>{p=!0,d=!0,k(!0)},200)))}),s("touchEnd",()=>{if(!n.destroyed&&n.autoplay.running&&c){if(clearTimeout(h),clearTimeout(t),n.params.autoplay.disableOnInteraction)return d=!1,void(c=!1);d&&n.params.cssMode&&x(),d=!1,c=!1}}),s("slideChange",()=>{!n.destroyed&&n.autoplay.running&&(f=!0)}),Object.assign(n.autoplay,{start:S,stop:T,pause:k,resume:x})}function _o(e,t){const r=Ir(t);return r!==t&&(r.style.backfaceVisibility="hidden",r.style["-webkit-backface-visibility"]="hidden"),r}function Mo(e){let{swiper:t,duration:r,transformElements:n,allSlides:i}=e;const{activeIndex:s}=t;if(t.params.virtualTranslate&&0!==r){let e,r=!1;e=i?n:n.filter(e=>{const r=e.classList.contains("swiper-slide-transform")?(e=>{if(!e.parentElement)return t.slides.filter(t=>t.shadowRoot&&t.shadowRoot===e.parentNode)[0];return e.parentElement})(e):e;return t.getSlideIndex(r)===s}),e.forEach(e=>{!function(e,t){t&&e.addEventListener("transitionend",function r(n){n.target===e&&(t.call(e,n),e.removeEventListener("transitionend",r))})}(e,()=>{if(r)return;if(!t||t.destroyed)return;r=!0,t.animating=!1;const e=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});t.wrapperEl.dispatchEvent(e)})})}}function Oo(e,t,r){const n=`swiper-slide-shadow swiper-slide-shadow-${e}`,i=Ir(t);let s=i.querySelector(`.${n.split(" ").join(".")}`);return s||(s=Dr("div",n.split(" ")),i.append(s)),s}function No(e){let{swiper:t,extendParams:r,on:n}=e;r({cardsEffect:{slideShadows:!0,rotate:!0,perSlideRotate:2,perSlideOffset:8}});!function(e){const{effect:t,swiper:r,on:n,setTranslate:i,setTransition:s,overwriteParams:a,perspective:o,recreateShadows:l,getEffectParams:u}=e;let c;n("beforeInit",()=>{if(r.params.effect!==t)return;r.classNames.push(`${r.params.containerModifierClass}${t}`),o&&o()&&r.classNames.push(`${r.params.containerModifierClass}3d`);const e=a?a():{};Object.assign(r.params,e),Object.assign(r.originalParams,e)}),n("setTranslate",()=>{r.params.effect===t&&i()}),n("setTransition",(e,n)=>{r.params.effect===t&&s(n)}),n("transitionEnd",()=>{if(r.params.effect===t&&l){if(!u||!u().slideShadows)return;r.slides.forEach(e=>{e.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(e=>e.remove())}),l()}}),n("virtualUpdate",()=>{r.params.effect===t&&(r.slides.length||(c=!0),requestAnimationFrame(()=>{c&&r.slides&&r.slides.length&&(i(),c=!1)}))})}({effect:"cards",swiper:t,on:n,setTranslate:()=>{const{slides:e,activeIndex:r,rtlTranslate:n}=t,i=t.params.cardsEffect,{startTranslate:s,isTouched:a}=t.touchEventsData,o=n?-t.translate:t.translate;for(let l=0;l<e.length;l+=1){const u=e[l],c=u.progress,d=Math.min(Math.max(c,-4),4);let h=u.swiperSlideOffset;t.params.centeredSlides&&!t.params.cssMode&&(t.wrapperEl.style.transform=`translateX(${t.minTranslate()}px)`),t.params.centeredSlides&&t.params.cssMode&&(h-=e[0].swiperSlideOffset);let f=t.params.cssMode?-h-t.translate:-h,p=0;const g=-100*Math.abs(d);let m=1,v=-i.perSlideRotate*d,y=i.perSlideOffset-.75*Math.abs(d);const b=t.virtual&&t.params.virtual.enabled?t.virtual.from+l:l,w=(b===r||b===r-1)&&d>0&&d<1&&(a||t.params.cssMode)&&o<s,E=(b===r||b===r+1)&&d<0&&d>-1&&(a||t.params.cssMode)&&o>s;if(w||E){const e=(1-Math.abs((Math.abs(d)-.5)/.5))**.5;v+=-28*d*e,m+=-.5*e,y+=96*e,p=-25*e*Math.abs(d)+"%"}if(f=d<0?`calc(${f}px ${n?"-":"+"} (${y*Math.abs(d)}%))`:d>0?`calc(${f}px ${n?"-":"+"} (-${y*Math.abs(d)}%))`:`${f}px`,!t.isHorizontal()){const e=p;p=f,f=e}const S=d<0?""+(1+(1-m)*d):""+(1-(1-m)*d),T=`\n translate3d(${f}, ${p}, ${g}px)\n rotateZ(${i.rotate?n?-v:v:0}deg)\n scale(${S})\n `;if(i.slideShadows){let e=u.querySelector(".swiper-slide-shadow");e||(e=Oo("cards",u)),e&&(e.style.opacity=Math.min(Math.max((Math.abs(d)-.5)/.5,0),1))}u.style.zIndex=-Math.abs(Math.round(c))+e.length;_o(0,u).style.transform=T}},setTransition:e=>{const r=t.slides.map(e=>Ir(e));r.forEach(t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow").forEach(t=>{t.style.transitionDuration=`${e}ms`})}),Mo({swiper:t,duration:e,transformElements:r})},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!t.params.cssMode})})}const Fo=({products:e,useDrawer:t,contentId:r})=>{const n=p.useMemo(()=>(e=>{if(e.length>=3)return e;const t=[...e];for(;t.length<3;)t.push(...e);return t})(e),[e]),i=1===(null==e?void 0:e.length);return(null==e?void 0:e.length)?g.createElement("div",{className:"w-full",style:{height:"80px"}},i?g.createElement("div",{className:"bg-white overflow-hidden rounded-xl w-full",style:{borderRadius:"10px",height:"80px"}},t?g.createElement(Co,{products:e,contentId:r},g.createElement(fi,{product:e[0],productsLength:e.length,contentId:r})):g.createElement(fi,{product:e[0],productsLength:e.length,hideMoreBtn:!0,contentId:r})):g.createElement(_n,{nested:!0,modules:[No,Do],slidesPerView:1.1,effect:"cards",autoplay:!0,loop:!0,grabCursor:!0,cardsEffect:{rotate:!1},className:"w-full",style:{height:"80px"}},n.map((n,i)=>g.createElement(Mn,{key:i+n.productId,className:"bg-white overflow-hidden rounded-xl",style:{borderRadius:"10px",height:"80px"}},t?g.createElement(Co,{products:e,contentId:r},g.createElement(fi,{product:n,productsLength:e.length,contentId:r})):g.createElement(fi,{product:n,productsLength:e.length,hideMoreBtn:!0,contentId:r}))))):null},$o=({shortForm:e,useDrawer:t,isPopup:r,shareUrl:n,handleClose:i})=>{const[s,a]=p.useState(!Boolean(r)),[o,l]=p.useState(!0),{logo:u,productsInfo:c,thumbPath:d,title:h,media:f,brand:m,shortsId:v}=e;return g.createElement("div",{className:"h-full w-full text-sm overflow-hidden text-white relative"},g.createElement("div",{style:{backgroundImage:"linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 50%, rgba(0,0,0,0.4) 100%)",padding:"15px"},className:"absolute h-full flex flex-col w-full z-[1] justify-between inset-0 bg-gradient-to-b from-black/40 via-transparent to-black/40"},g.createElement("div",{className:"flex gap-2 justify-between "},g.createElement("div",{className:"max-w-16"},(null==u?void 0:u.thumbPath)?g.createElement("img",{className:"mb-1",src:u.thumbPath,alt:u.logoName,width:100,height:100}):null),g.createElement("div",{className:"justify-self-end flex gap-2"},g.createElement("div",{className:"cursor-pointer text-white ",onClick:()=>{l(e=>!e)}},o?g.createElement(ei,{size:20}):g.createElement(ti,{size:20})),g.createElement("div",{className:"cursor-pointer text-white ",onClick:()=>{a(e=>!e)}},s?g.createElement(ii,{size:20}):g.createElement(ni,{size:20})),g.createElement("div",{className:"cursor-pointer text-white ",onClick:i},g.createElement(si,{size:20})))),g.createElement("div",null,g.createElement("div",{className:"flex justify-between items-end mb-3 gap-3"},g.createElement("div",{className:"w-full"},m&&g.createElement("div",{className:"items-center flex gap-3 mb-2"},g.createElement("div",{className:"w-12 h-12 bg-white rounded-full border overflow-hidden"},g.createElement("img",{src:m.thumbPath,alt:m.brandName,width:100,height:100,className:"object-contain w-full h-full"})),g.createElement("p",{style:{fontSize:"14px",textAlign:"start"}},null==m?void 0:m.brandName)),g.createElement("p",{style:{fontSize:"14px",textAlign:"start"}},h)),g.createElement("div",{className:"flex flex-col items-center",style:{gap:"15px"}},g.createElement(li,{shortsId:v}),g.createElement("div",{className:"w-[24px] h-[24px] flex items-center justify-center"},g.createElement(ci,{shortForm:e,shareUrl:n})))),c&&g.createElement(Fo,{products:c,useDrawer:t,contentId:e.shortsId}))),g.createElement(ai,{file:Ft(null==f?void 0:f.objectId),thumbnail:`${Gt(d)}`,mute:s,isVertical:(null==f?void 0:f.height)>(null==f?void 0:f.width),play:o}))},Bo=g.memo(({shortform:e,shareUrl:t,handleClose:r})=>g.createElement(g.Fragment,null,g.createElement("div",{onClick:e=>e.stopPropagation(),className:"overflow-hidden",style:{borderRadius:"10px",overflow:"hidden",width:"100%",height:"100%",backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"cover",backgroundImage:`url(${Gt(e.thumbPath)})`}},g.createElement($o,{handleClose:r,shortForm:e,useDrawer:!1,isPopup:!0,shareUrl:t})))),Uo=g.memo(({shortform:e})=>g.createElement("div",{onClick:e=>{e.stopPropagation()},style:{width:"100%",height:"100%",borderRadius:"10px",backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"cover",backgroundImage:`url(${e.thumbPath.includes("https")?e.thumbPath:`https://${e.thumbPath}`})`}})),zo=({shortform:e,shareUrl:t,handleClose:r})=>{const{isActive:n}=p.useContext(Pn),i=p.useContext(Dn),s=On().width<430||Hn.isMobile;return g.createElement("div",{className:"flex items-center justify-center w-full h-full select-none",onClick:e=>{r()}},g.createElement("div",{className:"max-h-full flex items-center justify-center",style:{width:"100%",aspectRatio:s?"auto":"9 / 16",height:s?"100dvh":"auto",maxHeight:s?void 0:"90vh",transform:s?void 0:`scale(${n?1:.8})`,transition:"transform 180ms ease"}},n?g.createElement("div",{className:"flex items-center justify-between w-full h-full text-white relative"},g.createElement("div",{className:"cursor-pointer absolute",onClick:e=>{e.stopPropagation(),i.slidePrev()},style:{zIndex:1e5,left:s?"0":"-30px",top:"50%",transform:"translateY(-50%)",width:30,height:30,display:"grid",placeItems:"center",pointerEvents:"auto"}},g.createElement(Qn,{size:28})),g.createElement(Bo,{shortform:e,shareUrl:t,handleClose:r}),g.createElement("div",{className:"cursor-pointer absolute",style:{zIndex:1e5,right:s?"0":"-30px",top:"50%",transform:"translateY(-50%)",width:30,height:30,display:"grid",placeItems:"center",pointerEvents:"auto"},onClick:e=>{e.stopPropagation(),i.slideNext()}},g.createElement(Zn,{size:28}))):g.createElement(Uo,{shortform:e})))},{PLAYER_BACK_BASE_URL:jo}=Mt(),Go=({collection:e,initialShortsId:t,onSlideChange:r,onClosePlayer:n})=>{var i;const s=p.useMemo(()=>Math.max(e.contents.findIndex(e=>e.shortsId===t),0),[e.contents,t]),a=e.contents.length,o=Math.max(a,10),l=null!==(i=On().width)&&void 0!==i?i:0,u=l<430||Hn.isMobile,c=u?1:l>=1200?4:l>=900?3:2,d=p.useMemo(()=>(e=>{const t=[...e];for(;t.length<o;)t.push(...e);return t})(e.contents),[e.contents]),h=p.useRef(null);return g.createElement("div",{style:{minHeight:100,minWidth:300},className:"w-full"},g.createElement(_n,{style:{minHeight:100,overflow:"visible"},initialSlide:s,ref:h,lazyPreloadPrevNext:2,className:"w-full",spaceBetween:u?8:l>=1200?24:l>=900?25:16,slidesPerView:c,grabCursor:!0,centeredSlides:1!==c,onSlideChangeTransitionEnd:t=>{const n=t.realIndex%a;null==r||r(n);const i=e.contents[(n+1)%a];var s;s=Ft(i.media.objectId),Nn||(Nn=document.createElement("video"),Nn.muted=!0,Nn.playsInline=!0,Nn.preload="metadata",Nn.loop=!0,Nn.style.cssText="position:fixed;left:-9999px;top:-9999px;width:1px;height:1px;opacity:0",document.body.appendChild(Nn)),Fn!==s&&(Nn.src=s,Nn.load(),Fn=s)},loop:!0,slideToClickedSlide:!0},d.map((t,r)=>g.createElement(Mn,{key:r},g.createElement(zo,{handleClose:n,shortform:t,shareUrl:`${jo}/collection/${e.colId}?start=${t.shortsId}&layout=5`})))))},Ho=({shortform:e,onThumbnailClick:t,iconSize:r,exposeTitle:n,borderLine:i})=>{const s=p.useMemo(()=>jt(i),[i])?{background:"linear-gradient(#fff,#fff) padding-box, conic-gradient(#f58529,#f77737,#fd1d1d,#833ab4,#c13584,#f58529) border-box",border:"3px solid transparent"}:{background:"#fff",border:"3px solid #fff"};return g.createElement("div",{className:"flex flex-col w-full gap-2",onClick:()=>t(e.shortsId)},g.createElement("div",{className:"rounded-full overflow-hidden cursor-pointer",style:Object.assign({width:r,height:r,padding:4},s)},g.createElement("img",{src:Gt(e.thumbPath),alt:"thumbnail",className:"w-full h-full object-cover block rounded-full"})),n&&g.createElement("span",{style:{width:r},className:"text-black overflow-hidden text-[12px] whitespace-nowrap text-center text-clip cursor-default"},e.title))},Vo=ur(e=>({open:!1,setOpen:t=>e({open:t})})),Wo=({product:e,productLength:t,hideMoreBadge:r=!1,contentId:n,lineClamp:i,showMoreBtn:s=!1,openProductPopup:a})=>{const{isPreview:o}=cr();return g.createElement(g.Fragment,null,g.createElement("div",{className:"product-banner border mbus-border",onClick:()=>J(void 0,void 0,void 0,function*(){r&&(window.open(e.linkPath,"_blank"),o||(yield Zt({contentProductId:e.eventProductId,contentId:n,productId:e.productId})))})},g.createElement("span",{className:"product-banner__clip","aria-hidden":!0},g.createElement("span",{className:"product-banner__sheen"})),g.createElement("div",{className:"relative",style:{width:"40%",minWidth:"40%"}},g.createElement("img",{style:{borderRadius:"0.625rem"},className:"aspect-square rounded-lg object-cover w-full",src:Gt(e.thumbPath),alt:e.productName}),!r&&g.createElement("p",{className:"absolute text-white rounded-lg",style:{backgroundColor:"#797979",top:-10,right:-10,padding:"2px 4px",fontSize:"10px",borderRadius:"0.625rem"}},"+",t)),g.createElement("div",{style:{position:"relative",zIndex:2,minWidth:0,flex:1,paddingRight:24}},g.createElement("p",{style:{display:"-webkit-box",WebkitLineClamp:i||2,WebkitBoxOrient:"vertical",overflow:"hidden",wordBreak:"break-word",fontWeight:600,color:"#494949"}},e.productName)),g.createElement("span",{className:"product-banner__arrow","aria-hidden":!0},"›")),s&&t>1&&g.createElement("div",{onClick:a,className:" flex items-center justify-center border mbus-border cursor-pointer",style:{borderRadius:"0.625rem",padding:"10px",backgroundColor:"#f5f5f5",fontWeight:600}},"+ 더보기 (",t,")"))},Ko=({products:e,iconSize:t,contentId:r,setSelectedProducts:n,showMoreBtn:i,hideMoreBadge:s})=>{const{setOpen:a}=Vo(),o=()=>{n({productsInfo:e,shortsId:r}),a(!0)};return g.createElement(g.Fragment,null,g.createElement("div",{onClick:()=>J(void 0,void 0,void 0,function*(){1===e.length||i||o()}),className:"flex flex-col gap-2 mt-4 text-gray-800",style:{maxWidth:t||"100%",fontSize:13}},g.createElement(Wo,{showMoreBtn:i,lineClamp:2,product:e[0],contentId:r,productLength:e.length,hideMoreBadge:null!=s?s:1===e.length,openProductPopup:o})))},Yo=({product:e,maxWidth:t="100%",height:r,cardWidth:n})=>g.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,borderRadius:8,backgroundColor:"#ffffff",color:"#111827",maxWidth:t,height:r,width:"100%",paddingRight:8}},g.createElement("img",{src:Gt(e.thumbPath),alt:e.productName,style:{height:"100%",aspectRatio:"1 / 1",borderRadius:6,objectFit:"cover",flexShrink:0}}),g.createElement("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",justifyContent:"center"}},g.createElement("span",{style:{lineHeight:1.25,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontSize:12}},e.productName),g.createElement("span",{style:{lineHeight:1.25,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontSize:11}},"number"==typeof e.sellingPrice&&e.sellingPrice<e.price?"number"==typeof n&&n>=190?g.createElement(g.Fragment,null,g.createElement("span",{style:{color:"#dc2626",fontWeight:600,marginRight:4}},Nt(e.sellingPrice),"원"),g.createElement("span",{style:{color:"#9ca3af",textDecoration:"line-through"}},Nt(e.price),"원")):g.createElement("span",{style:{color:"#dc2626",fontWeight:600}},Nt(e.sellingPrice),"원"):g.createElement("span",{style:{color:"#dc2626",fontWeight:600}},Nt(e.price),"원")))),qo=({playUrl:e,poster:t})=>g.createElement("div",{className:"w-full h-full absolute top-0 left-0 z-10 pointer-events-none",style:{backgroundImage:`url(${t})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}},g.createElement("video",{src:e,autoPlay:!0,muted:!0,preload:"auto",playsInline:!0,loop:!0,className:"w-full h-full object-cover"})),Xo=({shortform:e,onThumbnailClick:t,iconSize:r,exposeTitle:n,rounded:i,borderLine:s,titlePosition:a,exposeProductBanner:o,setSelectedProducts:l,iconRatio:u,hoverPlay:c,exposeProductBadge:d})=>{var h;const f=p.useMemo(()=>jt(s),[s]),[m,v]=p.useState(!1),{API_BASE_URL:y}=Mt();return g.createElement("div",{className:"relative"},g.createElement("div",{onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),onClick:()=>t(e.shortsId),style:Object.assign({width:r,aspectRatio:u},i&&{borderRadius:"10px"}),className:`cursor-pointer p-[3px] ${i&&"rounded-xl"} ${f&&"bg-insta"} relative overflow-hidden`},m&&c&&g.createElement(qo,{playUrl:`${y}/direct/${e.media.objectId}`,poster:Gt(e.thumbPath)}),g.createElement("img",{style:Object.assign({},i&&{borderRadius:"10px"}),src:Gt(e.thumbPath),alt:"thumbnail",className:`w-full h-full object-cover ${i&&"rounded-xl"}`}),d&&(null===(h=e.productsInfo)||void 0===h?void 0:h.length)>0&&!(c&&m)&&g.createElement("div",{className:"absolute pointer-events-none flex items-center justify-center z-20",style:{left:2,right:2,bottom:10,height:"20%"}},g.createElement("div",{className:"h-full inline-block",style:{width:"95%"}},g.createElement(Yo,{product:e.productsInfo[0],maxWidth:"100%",height:"100%",cardWidth:r})))),n&&!(c&&m&&a===V.INNER)&&g.createElement("p",{style:Object.assign({width:r,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},a===V.INNER&&d?{bottom:"22%"}:{}),className:`my-2 ${a===V.INNER?"absolute bottom-0 left-0 text-white px-2 z-10":""} text-[12px] cursor-default truncate`},e.title),o&&g.createElement(Ko,{setSelectedProducts:l,products:e.productsInfo,iconSize:r,contentId:e.shortsId}))},Qo=e=>{const{iconShape:t,collection:r}=e;return t===j.MANY?g.createElement(Zo,Object.assign({},e)):g.createElement(Jo,Object.assign({},e,{shortform:r.contents[0]}))},Zo=e=>{const{collection:t}=e,{thumbnailAutoPlay:r}=e,{setCollection:n,nextKey:i,setNextKey:s,isFetching:a,setIsFetching:o}=fr();return g.createElement(_n,{freeMode:!0,slidesPerView:"auto",spaceBetween:12,onReachEnd:()=>J(void 0,void 0,void 0,function*(){var e,r,l;if(t&&!(a||(null!==(e=t.count)&&void 0!==e?e:Number.MAX_SAFE_INTEGER)<=t.contents.length)){o(!0);try{const e=yield tr({collectionId:t.colId,nextKey:i});if(!e||!(null===(r=e.contents)||void 0===r?void 0:r.length))return;s((null===(l=e.contents.at(-1))||void 0===l?void 0:l.shortsId)||"");const a=new Set(t.contents.map(e=>e.shortsId)),o=e.contents.filter(e=>!a.has(e.shortsId));if(!o.length)return;n(Object.assign(Object.assign({},t),{contents:[...t.contents,...o]}))}catch(e){console.error(e)}finally{o(!1)}}}),modules:r?[Do]:[],autoplay:!!r&&{delay:3e3,disableOnInteraction:!1,pauseOnMouseEnter:!0},loop:r||void 0},null==t?void 0:t.contents.map(t=>g.createElement(Mn,{key:t.shortsId,className:"!w-auto"},g.createElement(Jo,Object.assign({},e,{shortform:t})))))},Jo=e=>{const{iconForm:t}=e;return t===z.INSTA?g.createElement(Ho,Object.assign({},e)):g.createElement(Xo,Object.assign({},e))};function el(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function tl(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function rl(...e){return t=>{let r=!1;const n=e.map(e=>{const n=tl(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():tl(e[t],null)}}}}function nl(...e){return p.useCallback(rl(...e),e)}function il(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}var sl=globalThis?.document?p.useLayoutEffect:()=>{},al=m[" useId ".trim().toString()]||(()=>{}),ol=0;function ll(e){const[t,r]=p.useState(al());return sl(()=>{e||r(e=>e??String(ol++))},[e]),e||(t?`radix-${t}`:"")}var ul=m[" useInsertionEffect ".trim().toString()]||sl;function cl({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[i,s,a]=function({defaultProp:e,onChange:t}){const[r,n]=p.useState(e),i=p.useRef(r),s=p.useRef(t);return ul(()=>{s.current=t},[t]),p.useEffect(()=>{i.current!==r&&(s.current?.(r),i.current=r)},[r,i]),[r,n,s]}({defaultProp:t,onChange:r}),o=void 0!==e,l=o?e:i;{const t=p.useRef(void 0!==e);p.useEffect(()=>{const e=t.current;if(e!==o){const t=e?"controlled":"uncontrolled",r=o?"controlled":"uncontrolled";console.warn(`${n} is changing from ${t} to ${r}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=o},[o,n])}const u=p.useCallback(t=>{if(o){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&a.current?.(r)}else s(t)},[o,e,s,a]);return[l,u]}function dl(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function hl(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function fl(...e){return t=>{let r=!1;const n=e.map(e=>{const n=hl(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():hl(e[t],null)}}}}function pl(...e){return p.useCallback(fl(...e),e)}function gl(e){const t=p.forwardRef((e,t)=>{const{children:r,...n}=e;if(p.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),i=function(e,t){const r={...t};for(const n in t){const i=e[n],s=t[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...e)=>{const t=s(...e);return i(...e),t}:i&&(r[n]=i):"style"===n?r[n]={...i,...s}:"className"===n&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==p.Fragment&&(i.ref=t?fl(t,e):e),p.cloneElement(r,i)}return p.Children.count(r)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ml=Symbol("radix.slottable");function vl(e){return p.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===ml}var yl=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const r=function(e){const t=gl(e),r=p.forwardRef((e,r)=>{const{children:n,...i}=e,s=p.Children.toArray(n),a=s.find(vl);if(a){const e=a.props.children,n=s.map(t=>t===a?p.Children.count(e)>1?p.Children.only(null):p.isValidElement(e)?e.props.children:null:t);return Si.jsx(t,{...i,ref:r,children:p.isValidElement(e)?p.cloneElement(e,void 0,n):null})}return Si.jsx(t,{...i,ref:r,children:n})});return r.displayName=`${e}.Slot`,r}(`Primitive.${t}`),n=p.forwardRef((e,n)=>{const{asChild:i,...s}=e,a=i?r:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),Si.jsx(a,{...s,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});var bl,wl="dismissableLayer.update",El="dismissableLayer.pointerDownOutside",Sl="dismissableLayer.focusOutside",Tl=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),kl=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:o,...l}=e,u=p.useContext(Tl),[c,d]=p.useState(null),h=c?.ownerDocument??globalThis?.document,[,f]=p.useState({}),g=pl(t,e=>d(e)),m=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(v),b=c?m.indexOf(c):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,E=b>=y,S=function(e,t=globalThis?.document){const r=Fi(e),n=p.useRef(!1),i=p.useRef(()=>{});return p.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){Al(El,r,s,{discrete:!0})};const s={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",i.current),i.current=n,t.addEventListener("click",i.current,{once:!0})):n()}else t.removeEventListener("click",i.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",e),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{const t=e.target,r=[...u.branches].some(e=>e.contains(t));E&&!r&&(i?.(e),a?.(e),e.defaultPrevented||o?.())},h),T=function(e,t=globalThis?.document){const r=Fi(e),n=p.useRef(!1);return p.useEffect(()=>{const e=e=>{if(e.target&&!n.current){Al(Sl,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(s?.(e),a?.(e),e.defaultPrevented||o?.())},h);return $i(e=>{b===u.layers.size-1&&(n?.(e),!e.defaultPrevented&&o&&(e.preventDefault(),o()))},h),p.useEffect(()=>{if(c)return r&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(bl=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),xl(),()=>{r&&1===u.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=bl)}},[c,h,r,u]),p.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),xl())},[c,u]),p.useEffect(()=>{const e=()=>f({});return document.addEventListener(wl,e),()=>document.removeEventListener(wl,e)},[]),Si.jsx(yl.div,{...l,ref:g,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:dl(e.onFocusCapture,T.onFocusCapture),onBlurCapture:dl(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:dl(e.onPointerDownCapture,S.onPointerDownCapture)})});kl.displayName="DismissableLayer";function xl(){const e=new CustomEvent(wl);document.dispatchEvent(e)}function Al(e,t,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?function(e,t){e&&Ci.flushSync(()=>e.dispatchEvent(t))}(i,s):i.dispatchEvent(s)}p.forwardRef((e,t)=>{const r=p.useContext(Tl),n=p.useRef(null),i=pl(t,n);return p.useEffect(()=>{const e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),Si.jsx(yl.div,{...e,ref:i})}).displayName="DismissableLayerBranch";var Rl=e=>{const{present:t,children:r}=e,n=function(e){const[t,r]=p.useState(),n=p.useRef(null),i=p.useRef(e),s=p.useRef("none"),a=e?"mounted":"unmounted",[o,l]=function(e,t){return p.useReducer((e,r)=>t[e][r]??e,e)}(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const e=Ll(n.current);s.current="mounted"===o?e:"none"},[o]),sl(()=>{const t=n.current,r=i.current;if(r!==e){const n=s.current,a=Ll(t);if(e)l("MOUNT");else if("none"===a||"none"===t?.display)l("UNMOUNT");else{l(r&&n!==a?"ANIMATION_OUT":"UNMOUNT")}i.current=e}},[e,l]),sl(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,a=s=>{const a=Ll(n.current).includes(s.animationName);if(s.target===t&&a&&(l("ANIMATION_END"),!i.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},o=e=>{e.target===t&&(s.current=Ll(n.current))};return t.addEventListener("animationstart",o),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",o),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:p.useCallback(e=>{n.current=e?getComputedStyle(e):null,r(e)},[])}}(t),i="function"==typeof r?r({present:n.isPresent}):p.Children.only(r),s=nl(n.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(i));return"function"==typeof r||n.isPresent?p.cloneElement(i,{ref:s}):null};function Ll(e){return e?.animationName||"none"}function Il(e){const t=Cl(e),r=p.forwardRef((e,r)=>{const{children:n,...i}=e,s=p.Children.toArray(n),a=s.find(Dl);if(a){const e=a.props.children,n=s.map(t=>t===a?p.Children.count(e)>1?p.Children.only(null):p.isValidElement(e)?e.props.children:null:t);return Si.jsx(t,{...i,ref:r,children:p.isValidElement(e)?p.cloneElement(e,void 0,n):null})}return Si.jsx(t,{...i,ref:r,children:n})});return r.displayName=`${e}.Slot`,r}function Cl(e){const t=p.forwardRef((e,t)=>{const{children:r,...n}=e;if(p.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),i=function(e,t){const r={...t};for(const n in t){const i=e[n],s=t[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...e)=>{const t=s(...e);return i(...e),t}:i&&(r[n]=i):"style"===n?r[n]={...i,...s}:"className"===n&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==p.Fragment&&(i.ref=t?rl(t,e):e),p.cloneElement(r,i)}return p.Children.count(r)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}Rl.displayName="Presence";var Pl=Symbol("radix.slottable");function Dl(e){return p.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Pl}var _l=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const r=Il(`Primitive.${t}`),n=p.forwardRef((e,n)=>{const{asChild:i,...s}=e,a=i?r:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),Si.jsx(a,{...s,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ml=0;function Ol(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Nl="Dialog",[Fl,$l]=function(e,t=[]){let r=[];const n=()=>{const t=r.map(e=>p.createContext(e));return function(r){const n=r?.[e]||t;return p.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return n.scopeName=e,[function(t,n){const i=p.createContext(n),s=r.length;r=[...r,n];const a=t=>{const{scope:r,children:n,...a}=t,o=r?.[e]?.[s]||i,l=p.useMemo(()=>a,Object.values(a));return Si.jsx(o.Provider,{value:l,children:n})};return a.displayName=t+"Provider",[a,function(r,a){const o=a?.[e]?.[s]||i,l=p.useContext(o);if(l)return l;if(void 0!==n)return n;throw new Error(`\`${r}\` must be used within \`${t}\``)}]},il(n,...t)]}(Nl),[Bl,Ul]=Fl(Nl),zl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,o=p.useRef(null),l=p.useRef(null),[u,c]=cl({prop:n,defaultProp:i??!1,onChange:s,caller:Nl});return Si.jsx(Bl,{scope:t,triggerRef:o,contentRef:l,contentId:ll(),titleId:ll(),descriptionId:ll(),open:u,onOpenChange:c,onOpenToggle:p.useCallback(()=>c(e=>!e),[c]),modal:a,children:r})};zl.displayName=Nl;var jl="DialogTrigger";p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Ul(jl,r),s=nl(t,i.triggerRef);return Si.jsx(_l.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":lu(i.open),...n,ref:s,onClick:el(e.onClick,i.onOpenToggle)})}).displayName=jl;var Gl="DialogPortal",[Hl,Vl]=Fl(Gl,{forceMount:void 0}),Wl=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,s=Ul(Gl,t);return Si.jsx(Hl,{scope:t,forceMount:r,children:p.Children.map(n,e=>Si.jsx(Rl,{present:r||s.open,children:Si.jsx(ns,{asChild:!0,container:i,children:e})}))})};Wl.displayName=Gl;var Kl="DialogOverlay",Yl=p.forwardRef((e,t)=>{const r=Vl(Kl,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,s=Ul(Kl,e.__scopeDialog);return s.modal?Si.jsx(Rl,{present:n||s.open,children:Si.jsx(Xl,{...i,ref:t})}):null});Yl.displayName=Kl;var ql=Il("DialogOverlay.RemoveScroll"),Xl=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Ul(Kl,r);return Si.jsx(Ws,{as:ql,allowPinchZoom:!0,shards:[i.contentRef],children:Si.jsx(_l.div,{"data-state":lu(i.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Ql="DialogContent",Zl=p.forwardRef((e,t)=>{const r=Vl(Ql,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,s=Ul(Ql,e.__scopeDialog);return Si.jsx(Rl,{present:n||s.open,children:s.modal?Si.jsx(Jl,{...i,ref:t}):Si.jsx(eu,{...i,ref:t})})});Zl.displayName=Ql;var Jl=p.forwardRef((e,t)=>{const r=Ul(Ql,e.__scopeDialog),n=p.useRef(null),i=nl(t,r.contentRef,n);return p.useEffect(()=>{const e=n.current;if(e)return Js(e)},[]),Si.jsx(tu,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:el(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:el(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:el(e.onFocusOutside,e=>e.preventDefault())})}),eu=p.forwardRef((e,t)=>{const r=Ul(Ql,e.__scopeDialog),n=p.useRef(!1),i=p.useRef(!1);return Si.jsx(tu,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||r.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));const s=t.target,a=r.triggerRef.current?.contains(s);a&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),tu=p.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=e,o=Ul(Ql,r),l=p.useRef(null),u=nl(t,l);return p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ol()),document.body.insertAdjacentElement("beforeend",e[1]??Ol()),Ml++,()=>{1===Ml&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Ml--}},[]),Si.jsxs(Si.Fragment,{children:[Si.jsx(Xi,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s,children:Si.jsx(kl,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":lu(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),Si.jsxs(Si.Fragment,{children:[Si.jsx(hu,{titleId:o.titleId}),Si.jsx(fu,{contentRef:l,descriptionId:o.descriptionId})]})]})}),ru="DialogTitle",nu=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Ul(ru,r);return Si.jsx(_l.h2,{id:i.titleId,...n,ref:t})});nu.displayName=ru;var iu="DialogDescription",su=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Ul(iu,r);return Si.jsx(_l.p,{id:i.descriptionId,...n,ref:t})});su.displayName=iu;var au="DialogClose",ou=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Ul(au,r);return Si.jsx(_l.button,{type:"button",...n,ref:t,onClick:el(e.onClick,()=>i.onOpenChange(!1))})});function lu(e){return e?"open":"closed"}ou.displayName=au;var uu="DialogTitleWarning",[cu,du]=function(e,t){const r=p.createContext(t),n=e=>{const{children:t,...n}=e,i=p.useMemo(()=>n,Object.values(n));return Si.jsx(r.Provider,{value:i,children:t})};return n.displayName=e+"Provider",[n,function(n){const i=p.useContext(r);if(i)return i;if(void 0!==t)return t;throw new Error(`\`${n}\` must be used within \`${e}\``)}]}(uu,{contentName:Ql,titleName:ru,docsSlug:"dialog"}),hu=({titleId:e})=>{const t=du(uu),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{if(e){document.getElementById(e)||console.error(r)}},[r,e]),null},fu=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${du("DialogDescriptionWarning").contentName}}.`;return p.useEffect(()=>{const n=e.current?.getAttribute("aria-describedby");if(t&&n){document.getElementById(t)||console.warn(r)}},[r,e,t]),null},pu=zl,gu=Wl,mu=Yl,vu=Zl,yu=nu,bu=ou;function wu(e){return p.createElement(pu,Object.assign({"data-slot":"dialog"},e))}function Eu(e){var t=Z(e,[]);return p.createElement(gu,Object.assign({"data-slot":"dialog-portal"},t))}function Su(e){var{className:t}=e,r=Z(e,["className"]);return p.createElement(mu,Object.assign({"data-slot":"dialog-overlay",className:Ot("fixed inset-0 z-50 bg-black/50",t)},r))}function Tu(e){var{className:t,children:r,showCloseButton:n=!0,container:i}=e,s=Z(e,["className","children","showCloseButton","container"]);return p.createElement(Eu,{"data-slot":"dialog-portal",container:i},p.createElement(Su,null),p.createElement(vu,Object.assign({"data-slot":"dialog-content",style:{left:"50%",top:"50%",transform:"translate(-50%, -50%)",outline:"none"},className:Ot("fixed","z-50 grid w-full max-w-lg sm:mx-0 gap-4 p-6",t)},s),r,n&&p.createElement(bu,{"data-slot":"dialog-close",style:{right:"calc(var(--spacing) * 4)",top:"calc(var(--spacing) * 4)",outline:"none"},className:Ot("absolute right-4 top-4 rounded opacity-70 transition-opacity","hover:opacity-100 focus:outline-none","focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background","disabled:pointer-events-none"),"aria-label":"Close"},p.createElement(si,{className:"h-4 w-4 pointer-events-none shrink-0",style:{height:"calc(var(--spacing) * 4)",width:"calc(var(--spacing) * 4)"}}))))}function ku(e){var{className:t}=e,r=Z(e,["className"]);return p.createElement("div",Object.assign({"data-slot":"dialog-header",className:Ot("flex flex-col gap-2 text-left",t)},r))}function xu(e){var{className:t}=e,r=Z(e,["className"]);return p.createElement(yu,Object.assign({"data-slot":"dialog-title",className:Ot("text-lg leading-none font-semibold",t)},r))}function Au({title:e,children:t,contentClassName:r,hideCloseButton:n=!1,portalContainer:i,description:s}){const{open:a,setOpen:o}=Vo();return g.createElement(wu,{open:a,onOpenChange:o},g.createElement(Tu,{container:i,className:r,showCloseButton:!n},e&&g.createElement(ku,null,g.createElement(xu,{style:{color:"#494949"}},e||""),g.createElement(su,{style:{color:"#5e5e5e",fontSize:"12.5px"}},s||"")),t))}const Ru=({products:e,contentId:t})=>{const r=On().width<430||Hn.isMobile;return g.createElement("div",{onWheel:e=>e.stopPropagation(),onTouchMove:e=>e.stopPropagation(),className:"grid gap-2 "+(r?"grid-cols-1":"grid-cols-2"),style:{fontSize:13}},e.map(r=>g.createElement(Wo,{key:r.productId,product:r,hideMoreBadge:!0,productLength:e.length,contentId:t})))},{PLAYER_BACK_BASE_URL:Lu}=Mt(),Iu=({widgetPlayerOption:e,setCollectionUuid:t,portalContainer:r})=>{const{player:n}=e,[i,s]=p.useState(null),{collection:a}=fr(),{isPreview:o}=cr(),{onSlideChange:l,onCollectionClose:u}=pr(i,s),{setOpen:c,open:d}=Vo();p.useEffect(()=>{d||(i&&(u(),s(null)),h&&f(null))},[d]);const[h,f]=p.useState();return g.createElement(g.Fragment,null,a&&g.createElement(Qo,Object.assign({collection:a},e,{onThumbnailClick:e=>J(void 0,void 0,void 0,function*(){if(n===H.POPUP){const r=Ut(),n=Ut();if(t(n),s(Object.assign(Object.assign({},a.contents.find(t=>t.shortsId===e)),{uuid:r})),c(!0),o)return;yield Promise.all([Xt({contentId:a.colId,uuid:n,type:X.COLLECTION,userId:a.userId,isFirstPlay:!zt(a.colId)}),Xt({contentId:e,uuid:r,type:X.SHORTS,userId:a.userId,isFirstPlay:!zt(e)})])}else{const t=(e=>{switch(e){case H.HORIZONTAL:return W.HORIZONTAL;case H.VERTICAL:return W.VERTICAL;case H.GRID:return W.PRODUCTS;case H.TABLET:return W.TABLET;default:return W.PLATFORM}})(n),r=null==a?void 0:a.contents.findIndex(t=>t.shortsId===e);let i="";r&&r>1&&(i=(null==a?void 0:a.contents[r-1].shortsId)||""),open(`${Lu}/collection/${a.colId}?nextKey=${i}&layout=${t}`)}}),setSelectedProducts:f})),h&&g.createElement(Au,{portalContainer:r,title:"상품 목록",contentClassName:"bg-white rounded p-4 product-dialog-container",description:"상품 정보를 확인해 보세요"},g.createElement(Ru,{products:h.productsInfo,contentId:h.shortsId})),a&&i&&g.createElement(Au,{portalContainer:r,hideCloseButton:!0,contentClassName:"w-full max-w-none p-0 mx-0"},g.createElement(Go,{collection:a,initialShortsId:i.shortsId,onClosePlayer:()=>J(void 0,void 0,void 0,function*(){u(),c(!1)}),onSlideChange:l})))};var Cu,Pu={},Du={};function _u(){if(Cu)return Du;Cu=1;var e=l();function t(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=Object.prototype.hasOwnProperty,n=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,i={},s={};function a(e){return!!r.call(s,e)||!r.call(i,e)&&(n.test(e)?s[e]=!0:(i[e]=!0,!1))}function o(e,t,r,n,i,s,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=a}var u={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){u[e]=new o(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];u[t]=new o(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){u[e]=new o(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){u[e]=new o(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){u[e]=new o(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){u[e]=new o(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){u[e]=new o(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){u[e]=new o(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){u[e]=new o(e,5,!1,e.toLowerCase(),null,!1,!1)});var c=/[\-:]([a-z])/g;function d(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(c,d);u[t]=new o(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(c,d);u[t]=new o(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(c,d);u[t]=new o(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){u[e]=new o(e,1,!1,e.toLowerCase(),null,!1,!1)}),u.xlinkHref=new o("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){u[e]=new o(e,1,!1,e.toLowerCase(),null,!0,!0)});var h={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},f=["Webkit","ms","Moz","O"];Object.keys(h).forEach(function(e){f.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),h[t]=h[e]})});var p=/["'&<>]/;function g(e){if("boolean"==typeof e||"number"==typeof e)return""+e;e=""+e;var t=p.exec(e);if(t){var r,n="",i=0;for(r=t.index;r<e.length;r++){switch(e.charCodeAt(r)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#x27;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}i!==r&&(n+=e.substring(i,r)),i=r+1,n+=t}e=i!==r?n+e.substring(i,r):n}return e}var m=/([A-Z])/g,v=/^ms-/,y=Array.isArray;function b(e,t){return{insertionMode:e,selectedValue:t}}var w=new Map;function E(e,n,i){if("object"!=typeof i)throw Error(t(62));for(var s in n=!0,i)if(r.call(i,s)){var a=i[s];if(null!=a&&"boolean"!=typeof a&&""!==a){if(0===s.indexOf("--")){var o=g(s);a=g((""+a).trim())}else{o=s;var l=w.get(o);void 0!==l||(l=g(o.replace(m,"-$1").toLowerCase().replace(v,"-ms-")),w.set(o,l)),o=l,a="number"==typeof a?0===a||r.call(h,s)?""+a:a+"px":g((""+a).trim())}n?(n=!1,e.push(' style="',o,":",a)):e.push(";",o,":",a)}}n||e.push('"')}function S(e,t,r,n){switch(r){case"style":return void E(e,t,n);case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":return}if(!(2<r.length)||"o"!==r[0]&&"O"!==r[0]||"n"!==r[1]&&"N"!==r[1])if(null!==(t=u.hasOwnProperty(r)?u[r]:null)){switch(typeof n){case"function":case"symbol":return;case"boolean":if(!t.acceptsBooleans)return}switch(r=t.attributeName,t.type){case 3:n&&e.push(" ",r,'=""');break;case 4:!0===n?e.push(" ",r,'=""'):!1!==n&&e.push(" ",r,'="',g(n),'"');break;case 5:isNaN(n)||e.push(" ",r,'="',g(n),'"');break;case 6:!isNaN(n)&&1<=n&&e.push(" ",r,'="',g(n),'"');break;default:t.sanitizeURL&&(n=""+n),e.push(" ",r,'="',g(n),'"')}}else if(a(r)){switch(typeof n){case"function":case"symbol":return;case"boolean":if("data-"!==(t=r.toLowerCase().slice(0,5))&&"aria-"!==t)return}e.push(" ",r,'="',g(n),'"')}}function T(e,r,n){if(null!=r){if(null!=n)throw Error(t(60));if("object"!=typeof r||!("__html"in r))throw Error(t(61));null!=(r=r.__html)&&e.push(""+r)}}function k(e,t,n,i){e.push(R(n));var s,a=n=null;for(s in t)if(r.call(t,s)){var o=t[s];if(null!=o)switch(s){case"children":n=o;break;case"dangerouslySetInnerHTML":a=o;break;default:S(e,i,s,o)}}return e.push(">"),T(e,a,n),"string"==typeof n?(e.push(g(n)),null):n}var x=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,A=new Map;function R(e){var r=A.get(e);if(void 0===r){if(!x.test(e))throw Error(t(65,e));r="<"+e,A.set(e,r)}return r}function L(n,i,s,o,l){switch(i){case"select":n.push(R("select"));var u=null,c=null;for(p in s)if(r.call(s,p)){var d=s[p];if(null!=d)switch(p){case"children":u=d;break;case"dangerouslySetInnerHTML":c=d;break;case"defaultValue":case"value":break;default:S(n,o,p,d)}}return n.push(">"),T(n,c,u),u;case"option":c=l.selectedValue,n.push(R("option"));var h=d=null,f=null,p=null;for(u in s)if(r.call(s,u)){var m=s[u];if(null!=m)switch(u){case"children":d=m;break;case"selected":f=m;break;case"dangerouslySetInnerHTML":p=m;break;case"value":h=m;default:S(n,o,u,m)}}if(null!=c)if(s=null!==h?""+h:function(t){var r="";return e.Children.forEach(t,function(e){null!=e&&(r+=e)}),r}(d),y(c)){for(o=0;o<c.length;o++)if(""+c[o]===s){n.push(' selected=""');break}}else""+c===s&&n.push(' selected=""');else f&&n.push(' selected=""');return n.push(">"),T(n,p,d),d;case"textarea":for(d in n.push(R("textarea")),p=c=u=null,s)if(r.call(s,d)&&null!=(h=s[d]))switch(d){case"children":p=h;break;case"value":u=h;break;case"defaultValue":c=h;break;case"dangerouslySetInnerHTML":throw Error(t(91));default:S(n,o,d,h)}if(null===u&&null!==c&&(u=c),n.push(">"),null!=p){if(null!=u)throw Error(t(92));if(y(p)&&1<p.length)throw Error(t(93));u=""+p}return"string"==typeof u&&"\n"===u[0]&&n.push("\n"),null!==u&&n.push(g(""+u)),null;case"input":for(c in n.push(R("input")),h=p=d=u=null,s)if(r.call(s,c)&&null!=(f=s[c]))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(t(399,"input"));case"defaultChecked":h=f;break;case"defaultValue":d=f;break;case"checked":p=f;break;case"value":u=f;break;default:S(n,o,c,f)}return null!==p?S(n,o,"checked",p):null!==h&&S(n,o,"checked",h),null!==u?S(n,o,"value",u):null!==d&&S(n,o,"value",d),n.push("/>"),null;case"menuitem":for(var v in n.push(R("menuitem")),s)if(r.call(s,v)&&null!=(u=s[v]))switch(v){case"children":case"dangerouslySetInnerHTML":throw Error(t(400));default:S(n,o,v,u)}return n.push(">"),null;case"title":for(m in n.push(R("title")),u=null,s)if(r.call(s,m)&&null!=(c=s[m]))switch(m){case"children":u=c;break;case"dangerouslySetInnerHTML":throw Error(t(434));default:S(n,o,m,c)}return n.push(">"),u;case"listing":case"pre":for(h in n.push(R(i)),c=u=null,s)if(r.call(s,h)&&null!=(d=s[h]))switch(h){case"children":u=d;break;case"dangerouslySetInnerHTML":c=d;break;default:S(n,o,h,d)}if(n.push(">"),null!=c){if(null!=u)throw Error(t(60));if("object"!=typeof c||!("__html"in c))throw Error(t(61));null!=(s=c.__html)&&("string"==typeof s&&0<s.length&&"\n"===s[0]?n.push("\n",s):n.push(""+s))}return"string"==typeof u&&"\n"===u[0]&&n.push("\n"),u;case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":for(var b in n.push(R(i)),s)if(r.call(s,b)&&null!=(u=s[b]))switch(b){case"children":case"dangerouslySetInnerHTML":throw Error(t(399,i));default:S(n,o,b,u)}return n.push("/>"),null;case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return k(n,s,i,o);case"html":return 0===l.insertionMode&&n.push("<!DOCTYPE html>"),k(n,s,i,o);default:if(-1===i.indexOf("-")&&"string"!=typeof s.is)return k(n,s,i,o);for(f in n.push(R(i)),c=u=null,s)if(r.call(s,f)&&null!=(d=s[f]))switch(f){case"children":u=d;break;case"dangerouslySetInnerHTML":c=d;break;case"style":E(n,o,d);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:a(f)&&"function"!=typeof d&&"symbol"!=typeof d&&n.push(" ",f,'="',g(d),'"')}return n.push(">"),T(n,c,u),u}}function I(e,r,n){if(e.push('\x3c!--$?--\x3e<template id="'),null===n)throw Error(t(395));return e.push(n),e.push('"></template>')}var C=/[<\u2028\u2029]/g;function P(e){return JSON.stringify(e).replace(C,function(e){switch(e){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}function D(e,t,r,n){return r.generateStaticMarkup?(e.push(g(t)),!1):(""===t?e=n:(n&&e.push("\x3c!-- --\x3e"),e.push(g(t)),e=!0),e)}var _=Object.assign,M=Symbol.for("react.element"),O=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),B=Symbol.for("react.provider"),U=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),W=Symbol.for("react.scope"),K=Symbol.for("react.debug_trace_mode"),Y=Symbol.for("react.legacy_hidden"),q=Symbol.for("react.default_value"),X=Symbol.iterator;function Q(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case N:return"Fragment";case O:return"Portal";case $:return"Profiler";case F:return"StrictMode";case j:return"Suspense";case G:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case U:return(e.displayName||"Context")+".Consumer";case B:return(e._context.displayName||"Context")+".Provider";case z:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case H:return null!==(t=e.displayName||null)?t:Q(e.type)||"Memo";case V:t=e._payload,e=e._init;try{return Q(e(t))}catch(e){}}return null}var Z={};function J(e,t){if(!(e=e.contextTypes))return Z;var r,n={};for(r in e)n[r]=t[r];return n}var ee=null;function te(e,r){if(e!==r){e.context._currentValue2=e.parentValue,e=e.parent;var n=r.parent;if(null===e){if(null!==n)throw Error(t(401))}else{if(null===n)throw Error(t(401));te(e,n)}r.context._currentValue2=r.value}}function re(e){e.context._currentValue2=e.parentValue,null!==(e=e.parent)&&re(e)}function ne(e){var t=e.parent;null!==t&&ne(t),e.context._currentValue2=e.value}function ie(e,r){if(e.context._currentValue2=e.parentValue,null===(e=e.parent))throw Error(t(402));e.depth===r.depth?te(e,r):ie(e,r)}function se(e,r){var n=r.parent;if(null===n)throw Error(t(402));e.depth===n.depth?te(e,n):se(e,n),r.context._currentValue2=r.value}function ae(e){var t=ee;t!==e&&(null===t?ne(e):null===e?re(t):t.depth===e.depth?te(t,e):t.depth>e.depth?ie(t,e):se(t,e),ee=e)}var oe={isMounted:function(){return!1},enqueueSetState:function(e,t){null!==(e=e._reactInternals).queue&&e.queue.push(t)},enqueueReplaceState:function(e,t){(e=e._reactInternals).replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}};function le(e,t,r,n){var i=void 0!==e.state?e.state:null;e.updater=oe,e.props=r,e.state=i;var s={queue:[],replace:!1};e._reactInternals=s;var a=t.contextType;if(e.context="object"==typeof a&&null!==a?a._currentValue2:n,"function"==typeof(a=t.getDerivedStateFromProps)&&(i=null==(a=a(r,i))?i:_({},i,a),e.state=i),"function"!=typeof t.getDerivedStateFromProps&&"function"!=typeof e.getSnapshotBeforeUpdate&&("function"==typeof e.UNSAFE_componentWillMount||"function"==typeof e.componentWillMount))if(t=e.state,"function"==typeof e.componentWillMount&&e.componentWillMount(),"function"==typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),t!==e.state&&oe.enqueueReplaceState(e,e.state,null),null!==s.queue&&0<s.queue.length)if(t=s.queue,a=s.replace,s.queue=null,s.replace=!1,a&&1===t.length)e.state=t[0];else{for(s=a?t[0]:e.state,i=!0,a=a?1:0;a<t.length;a++){var o=t[a];null!=(o="function"==typeof o?o.call(e,s,r,n):o)&&(i?(i=!1,s=_({},s,o)):_(s,o))}e.state=s}else s.queue=null}var ue={id:1,overflow:""};function ce(e,t,r){var n=e.id;e=e.overflow;var i=32-de(n)-1;n&=~(1<<i),r+=1;var s=32-de(t)+i;if(30<s){var a=i-i%5;return s=(n&(1<<a)-1).toString(32),n>>=a,i-=a,{id:1<<32-de(t)+i|r<<i|n,overflow:s+e}}return{id:1<<s|r<<i|n,overflow:e}}var de=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(he(e)/fe|0)|0},he=Math.log,fe=Math.LN2;var pe="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},ge=null,me=null,ve=null,ye=null,be=!1,we=!1,Ee=0,Se=null,Te=0;function ke(){if(null===ge)throw Error(t(321));return ge}function xe(){if(0<Te)throw Error(t(312));return{memoizedState:null,queue:null,next:null}}function Ae(){return null===ye?null===ve?(be=!1,ve=ye=xe()):(be=!0,ye=ve):null===ye.next?(be=!1,ye=ye.next=xe()):(be=!0,ye=ye.next),ye}function Re(){me=ge=null,we=!1,ve=null,Te=0,ye=Se=null}function Le(e,t){return"function"==typeof t?t(e):t}function Ie(e,t,r){if(ge=ke(),ye=Ae(),be){var n=ye.queue;if(t=n.dispatch,null!==Se&&void 0!==(r=Se.get(n))){Se.delete(n),n=ye.memoizedState;do{n=e(n,r.action),r=r.next}while(null!==r);return ye.memoizedState=n,[n,t]}return[ye.memoizedState,t]}return e=e===Le?"function"==typeof t?t():t:void 0!==r?r(t):t,ye.memoizedState=e,e=(e=ye.queue={last:null,dispatch:null}).dispatch=Pe.bind(null,ge,e),[ye.memoizedState,e]}function Ce(e,t){if(ge=ke(),t=void 0===t?null:t,null!==(ye=Ae())){var r=ye.memoizedState;if(null!==r&&null!==t){var n=r[1];e:if(null===n)n=!1;else{for(var i=0;i<n.length&&i<t.length;i++)if(!pe(t[i],n[i])){n=!1;break e}n=!0}if(n)return r[0]}}return e=e(),ye.memoizedState=[e,t],e}function Pe(e,r,n){if(25<=Te)throw Error(t(301));if(e===ge)if(we=!0,e={action:n,next:null},null===Se&&(Se=new Map),void 0===(n=Se.get(r)))Se.set(r,e);else{for(r=n;null!==r.next;)r=r.next;r.next=e}}function De(){throw Error(t(394))}function _e(){}var Me={readContext:function(e){return e._currentValue2},useContext:function(e){return ke(),e._currentValue2},useMemo:Ce,useReducer:Ie,useRef:function(e){ge=ke();var t=(ye=Ae()).memoizedState;return null===t?(e={current:e},ye.memoizedState=e):t},useState:function(e){return Ie(Le,e)},useInsertionEffect:_e,useLayoutEffect:function(){},useCallback:function(e,t){return Ce(function(){return e},t)},useImperativeHandle:_e,useEffect:_e,useDebugValue:_e,useDeferredValue:function(e){return ke(),e},useTransition:function(){return ke(),[!1,De]},useId:function(){var e=me.treeContext,r=e.overflow;e=((e=e.id)&~(1<<32-de(e)-1)).toString(32)+r;var n=Oe;if(null===n)throw Error(t(404));return r=Ee++,e=":"+n.idPrefix+"R"+e,0<r&&(e+="H"+r.toString(32)),e+":"},useMutableSource:function(e,t){return ke(),t(e._source)},useSyncExternalStore:function(e,r,n){if(void 0===n)throw Error(t(407));return n()}},Oe=null,Ne=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;function Fe(e){return console.error(e),null}function $e(){}function Be(e,t,r,n,i,s,a,o){e.allPendingTasks++,null===r?e.pendingRootTasks++:r.pendingTasks++;var l={node:t,ping:function(){var t=e.pingedTasks;t.push(l),1===t.length&&et(e)},blockedBoundary:r,blockedSegment:n,abortSet:i,legacyContext:s,context:a,treeContext:o};return i.add(l),l}function Ue(e,t,r,n,i,s){return{status:0,id:-1,index:t,parentFlushed:!1,chunks:[],children:[],formatContext:n,boundary:r,lastPushedText:i,textEmbedded:s}}function ze(e,t){if(null!=(e=e.onError(t))&&"string"!=typeof e)throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof e+'" instead');return e}function je(e,t){var r=e.onShellError;r(t),(r=e.onFatalError)(t),null!==e.destination?(e.status=2,e.destination.destroy(t)):(e.status=1,e.fatalError=t)}function Ge(e,t,r,n,i){for(ge={},me=t,Ee=0,e=r(n,i);we;)we=!1,Ee=0,Te+=1,ye=null,e=r(n,i);return Re(),e}function He(e,r,n,i){var s=n.render(),a=i.childContextTypes;if(null!=a){var o=r.legacyContext;if("function"!=typeof n.getChildContext)i=o;else{for(var l in n=n.getChildContext())if(!(l in a))throw Error(t(108,Q(i)||"Unknown",l));i=_({},o,n)}r.legacyContext=i,Ke(e,r,s),r.legacyContext=o}else Ke(e,r,s)}function Ve(e,t){if(e&&e.defaultProps){for(var r in t=_({},t),e=e.defaultProps)void 0===t[r]&&(t[r]=e[r]);return t}return t}function We(e,r,n,i,s){if("function"==typeof n)if(n.prototype&&n.prototype.isReactComponent){s=J(n,r.legacyContext);var a=n.contextType;le(a=new n(i,"object"==typeof a&&null!==a?a._currentValue2:s),n,i,s),He(e,r,a,n)}else{s=Ge(e,r,n,i,a=J(n,r.legacyContext));var o=0!==Ee;if("object"==typeof s&&null!==s&&"function"==typeof s.render&&void 0===s.$$typeof)le(s,n,i,a),He(e,r,s,n);else if(o){i=r.treeContext,r.treeContext=ce(i,1,0);try{Ke(e,r,s)}finally{r.treeContext=i}}else Ke(e,r,s)}else{if("string"!=typeof n){switch(n){case Y:case K:case F:case $:case N:case G:return void Ke(e,r,i.children);case W:throw Error(t(343));case j:e:{n=r.blockedBoundary,s=r.blockedSegment,a=i.fallback,i=i.children;var l={id:null,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:o=new Set,errorDigest:null},u=Ue(0,s.chunks.length,l,s.formatContext,!1,!1);s.children.push(u),s.lastPushedText=!1;var c=Ue(0,0,null,s.formatContext,!1,!1);c.parentFlushed=!0,r.blockedBoundary=l,r.blockedSegment=c;try{if(qe(e,r,i),e.responseState.generateStaticMarkup||c.lastPushedText&&c.textEmbedded&&c.chunks.push("\x3c!-- --\x3e"),c.status=1,Ze(l,c),0===l.pendingTasks)break e}catch(t){c.status=4,l.forceClientRender=!0,l.errorDigest=ze(e,t)}finally{r.blockedBoundary=n,r.blockedSegment=s}r=Be(e,a,n,u,o,r.legacyContext,r.context,r.treeContext),e.pingedTasks.push(r)}return}if("object"==typeof n&&null!==n)switch(n.$$typeof){case z:if(i=Ge(e,r,n.render,i,s),0!==Ee){n=r.treeContext,r.treeContext=ce(n,1,0);try{Ke(e,r,i)}finally{r.treeContext=n}}else Ke(e,r,i);return;case H:return void We(e,r,n=n.type,i=Ve(n,i),s);case B:if(s=i.children,n=n._context,i=i.value,a=n._currentValue2,n._currentValue2=i,ee=i={parent:o=ee,depth:null===o?0:o.depth+1,context:n,parentValue:a,value:i},r.context=i,Ke(e,r,s),null===(e=ee))throw Error(t(403));return i=e.parentValue,e.context._currentValue2=i===q?e.context._defaultValue:i,e=ee=e.parent,void(r.context=e);case U:return void Ke(e,r,i=(i=i.children)(n._currentValue2));case V:return void We(e,r,n=(s=n._init)(n._payload),i=Ve(n,i),void 0)}throw Error(t(130,null==n?n:typeof n,""))}switch(a=L((s=r.blockedSegment).chunks,n,i,e.responseState,s.formatContext),s.lastPushedText=!1,o=s.formatContext,s.formatContext=function(e,t,r){switch(t){case"select":return b(1,null!=r.value?r.value:r.defaultValue);case"svg":return b(2,null);case"math":return b(3,null);case"foreignObject":return b(1,null);case"table":return b(4,null);case"thead":case"tbody":case"tfoot":return b(5,null);case"colgroup":return b(7,null);case"tr":return b(6,null)}return 4<=e.insertionMode||0===e.insertionMode?b(1,null):e}(o,n,i),qe(e,r,a),s.formatContext=o,n){case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break;default:s.chunks.push("</",n,">")}s.lastPushedText=!1}}function Ke(e,r,n){if(r.node=n,"object"==typeof n&&null!==n){switch(n.$$typeof){case M:return void We(e,r,n.type,n.props,n.ref);case O:throw Error(t(257));case V:var i=n._init;return void Ke(e,r,n=i(n._payload))}if(y(n))return void Ye(e,r,n);if(null===n||"object"!=typeof n?i=null:i="function"==typeof(i=X&&n[X]||n["@@iterator"])?i:null,i&&(i=i.call(n))){if(!(n=i.next()).done){var s=[];do{s.push(n.value),n=i.next()}while(!n.done);Ye(e,r,s)}return}throw e=Object.prototype.toString.call(n),Error(t(31,"[object Object]"===e?"object with keys {"+Object.keys(n).join(", ")+"}":e))}"string"==typeof n?(i=r.blockedSegment).lastPushedText=D(r.blockedSegment.chunks,n,e.responseState,i.lastPushedText):"number"==typeof n&&((i=r.blockedSegment).lastPushedText=D(r.blockedSegment.chunks,""+n,e.responseState,i.lastPushedText))}function Ye(e,t,r){for(var n=r.length,i=0;i<n;i++){var s=t.treeContext;t.treeContext=ce(s,n,i);try{qe(e,t,r[i])}finally{t.treeContext=s}}}function qe(e,t,r){var n=t.blockedSegment.formatContext,i=t.legacyContext,s=t.context;try{return Ke(e,t,r)}catch(l){if(Re(),"object"!=typeof l||null===l||"function"!=typeof l.then)throw t.blockedSegment.formatContext=n,t.legacyContext=i,t.context=s,ae(s),l;r=l;var a=t.blockedSegment,o=Ue(0,a.chunks.length,null,a.formatContext,a.lastPushedText,!0);a.children.push(o),a.lastPushedText=!1,e=Be(e,t.node,t.blockedBoundary,o,t.abortSet,t.legacyContext,t.context,t.treeContext).ping,r.then(e,e),t.blockedSegment.formatContext=n,t.legacyContext=i,t.context=s,ae(s)}}function Xe(e){var t=e.blockedBoundary;(e=e.blockedSegment).status=3,Je(this,t,e)}function Qe(e,r,n){var i=e.blockedBoundary;e.blockedSegment.status=3,null===i?(r.allPendingTasks--,2!==r.status&&(r.status=2,null!==r.destination&&r.destination.push(null))):(i.pendingTasks--,i.forceClientRender||(i.forceClientRender=!0,e=void 0===n?Error(t(432)):n,i.errorDigest=r.onError(e),i.parentFlushed&&r.clientRenderedBoundaries.push(i)),i.fallbackAbortableTasks.forEach(function(e){return Qe(e,r,n)}),i.fallbackAbortableTasks.clear(),r.allPendingTasks--,0===r.allPendingTasks&&(i=r.onAllReady)())}function Ze(e,t){if(0===t.chunks.length&&1===t.children.length&&null===t.children[0].boundary){var r=t.children[0];r.id=t.id,r.parentFlushed=!0,1===r.status&&Ze(e,r)}else e.completedSegments.push(t)}function Je(e,r,n){if(null===r){if(n.parentFlushed){if(null!==e.completedRootSegment)throw Error(t(389));e.completedRootSegment=n}e.pendingRootTasks--,0===e.pendingRootTasks&&(e.onShellError=$e,(r=e.onShellReady)())}else r.pendingTasks--,r.forceClientRender||(0===r.pendingTasks?(n.parentFlushed&&1===n.status&&Ze(r,n),r.parentFlushed&&e.completedBoundaries.push(r),r.fallbackAbortableTasks.forEach(Xe,e),r.fallbackAbortableTasks.clear()):n.parentFlushed&&1===n.status&&(Ze(r,n),1===r.completedSegments.length&&r.parentFlushed&&e.partialBoundaries.push(r)));e.allPendingTasks--,0===e.allPendingTasks&&(e=e.onAllReady)()}function et(e){if(2!==e.status){var t=ee,r=Ne.current;Ne.current=Me;var n=Oe;Oe=e.responseState;try{var i,s=e.pingedTasks;for(i=0;i<s.length;i++){var a=s[i],o=e,l=a.blockedSegment;if(0===l.status){ae(a.context);try{Ke(o,a,a.node),o.responseState.generateStaticMarkup||l.lastPushedText&&l.textEmbedded&&l.chunks.push("\x3c!-- --\x3e"),a.abortSet.delete(a),l.status=1,Je(o,a.blockedBoundary,l)}catch(e){if(Re(),"object"==typeof e&&null!==e&&"function"==typeof e.then){var u=a.ping;e.then(u,u)}else{a.abortSet.delete(a),l.status=4;var c=a.blockedBoundary,d=e,h=ze(o,d);if(null===c?je(o,d):(c.pendingTasks--,c.forceClientRender||(c.forceClientRender=!0,c.errorDigest=h,c.parentFlushed&&o.clientRenderedBoundaries.push(c))),o.allPendingTasks--,0===o.allPendingTasks)(0,o.onAllReady)()}}}}s.splice(0,i),null!==e.destination&&at(e,e.destination)}catch(t){ze(e,t),je(e,t)}finally{Oe=n,Ne.current=r,r===Me&&ae(t)}}}function tt(e,r,n){switch(n.parentFlushed=!0,n.status){case 0:var i=n.id=e.nextSegmentId++;return n.lastPushedText=!1,n.textEmbedded=!1,e=e.responseState,r.push('<template id="'),r.push(e.placeholderPrefix),e=i.toString(16),r.push(e),r.push('"></template>');case 1:n.status=2;var s=!0;i=n.chunks;var a=0;n=n.children;for(var o=0;o<n.length;o++){for(s=n[o];a<s.index;a++)r.push(i[a]);s=rt(e,r,s)}for(;a<i.length-1;a++)r.push(i[a]);return a<i.length&&(s=r.push(i[a])),s;default:throw Error(t(390))}}function rt(e,r,n){var i=n.boundary;if(null===i)return tt(e,r,n);if(i.parentFlushed=!0,i.forceClientRender)return e.responseState.generateStaticMarkup||(i=i.errorDigest,r.push("\x3c!--$!--\x3e"),r.push("<template"),i&&(r.push(' data-dgst="'),i=g(i),r.push(i),r.push('"')),r.push("></template>")),tt(e,r,n),e=!!e.responseState.generateStaticMarkup||r.push("\x3c!--/$--\x3e");if(0<i.pendingTasks){i.rootSegmentID=e.nextSegmentId++,0<i.completedSegments.length&&e.partialBoundaries.push(i);var s=e.responseState,a=s.nextSuspenseID++;return s=s.boundaryPrefix+a.toString(16),i=i.id=s,I(r,e.responseState,i),tt(e,r,n),r.push("\x3c!--/$--\x3e")}if(i.byteSize>e.progressiveChunkSize)return i.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(i),I(r,e.responseState,i.id),tt(e,r,n),r.push("\x3c!--/$--\x3e");if(e.responseState.generateStaticMarkup||r.push("\x3c!--$--\x3e"),1!==(n=i.completedSegments).length)throw Error(t(391));return rt(e,r,n[0]),e=!!e.responseState.generateStaticMarkup||r.push("\x3c!--/$--\x3e")}function nt(e,r,n){return function(e,r,n,i){switch(n.insertionMode){case 0:case 1:return e.push('<div hidden id="'),e.push(r.segmentPrefix),r=i.toString(16),e.push(r),e.push('">');case 2:return e.push('<svg aria-hidden="true" style="display:none" id="'),e.push(r.segmentPrefix),r=i.toString(16),e.push(r),e.push('">');case 3:return e.push('<math aria-hidden="true" style="display:none" id="'),e.push(r.segmentPrefix),r=i.toString(16),e.push(r),e.push('">');case 4:return e.push('<table hidden id="'),e.push(r.segmentPrefix),r=i.toString(16),e.push(r),e.push('">');case 5:return e.push('<table hidden><tbody id="'),e.push(r.segmentPrefix),r=i.toString(16),e.push(r),e.push('">');case 6:return e.push('<table hidden><tr id="'),e.push(r.segmentPrefix),r=i.toString(16),e.push(r),e.push('">');case 7:return e.push('<table hidden><colgroup id="'),e.push(r.segmentPrefix),r=i.toString(16),e.push(r),e.push('">');default:throw Error(t(397))}}(r,e.responseState,n.formatContext,n.id),rt(e,r,n),function(e,r){switch(r.insertionMode){case 0:case 1:return e.push("</div>");case 2:return e.push("</svg>");case 3:return e.push("</math>");case 4:return e.push("</table>");case 5:return e.push("</tbody></table>");case 6:return e.push("</tr></table>");case 7:return e.push("</colgroup></table>");default:throw Error(t(397))}}(r,n.formatContext)}function it(e,r,n){for(var i=n.completedSegments,s=0;s<i.length;s++)st(e,r,n,i[s]);if(i.length=0,e=e.responseState,i=n.id,n=n.rootSegmentID,r.push(e.startInlineScript),e.sentCompleteBoundaryFunction?r.push('$RC("'):(e.sentCompleteBoundaryFunction=!0,r.push('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("')),null===i)throw Error(t(395));return n=n.toString(16),r.push(i),r.push('","'),r.push(e.segmentPrefix),r.push(n),r.push('")<\/script>')}function st(e,r,n,i){if(2===i.status)return!0;var s=i.id;if(-1===s){if(-1===(i.id=n.rootSegmentID))throw Error(t(392));return nt(e,r,i)}return nt(e,r,i),e=e.responseState,r.push(e.startInlineScript),e.sentCompleteSegmentFunction?r.push('$RS("'):(e.sentCompleteSegmentFunction=!0,r.push('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("')),r.push(e.segmentPrefix),s=s.toString(16),r.push(s),r.push('","'),r.push(e.placeholderPrefix),r.push(s),r.push('")<\/script>')}function at(e,r){try{var n=e.completedRootSegment;if(null!==n&&0===e.pendingRootTasks){rt(e,r,n),e.completedRootSegment=null;var i=e.responseState.bootstrapChunks;for(n=0;n<i.length-1;n++)r.push(i[n]);n<i.length&&r.push(i[n])}var s,a=e.clientRenderedBoundaries;for(s=0;s<a.length;s++){var o=a[s];i=r;var l=e.responseState,u=o.id,c=o.errorDigest,d=o.errorMessage,h=o.errorComponentStack;if(i.push(l.startInlineScript),l.sentClientRenderFunction?i.push('$RX("'):(l.sentClientRenderFunction=!0,i.push('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("')),null===u)throw Error(t(395));if(i.push(u),i.push('"'),c||d||h){i.push(",");var f=P(c||"");i.push(f)}if(d||h){i.push(",");var p=P(d||"");i.push(p)}if(h){i.push(",");var g=P(h);i.push(g)}if(!i.push(")<\/script>"))return e.destination=null,s++,void a.splice(0,s)}a.splice(0,s);var m=e.completedBoundaries;for(s=0;s<m.length;s++)if(!it(e,r,m[s]))return e.destination=null,s++,void m.splice(0,s);m.splice(0,s);var v=e.partialBoundaries;for(s=0;s<v.length;s++){var y=v[s];e:{a=e,o=r;var b=y.completedSegments;for(l=0;l<b.length;l++)if(!st(a,o,y,b[l])){l++,b.splice(0,l);var w=!1;break e}b.splice(0,l),w=!0}if(!w)return e.destination=null,s++,void v.splice(0,s)}v.splice(0,s);var E=e.completedBoundaries;for(s=0;s<E.length;s++)if(!it(e,r,E[s]))return e.destination=null,s++,void E.splice(0,s);E.splice(0,s)}finally{0===e.allPendingTasks&&0===e.pingedTasks.length&&0===e.clientRenderedBoundaries.length&&0===e.completedBoundaries.length&&r.push(null)}}function ot(e,t){try{var r=e.abortableTasks;r.forEach(function(r){return Qe(r,e,t)}),r.clear(),null!==e.destination&&at(e,e.destination)}catch(t){ze(e,t),je(e,t)}}function lt(){}function ut(e,r,n,i){var s=!1,a=null,o="",l={push:function(e){return null!==e&&(o+=e),!0},destroy:function(e){s=!0,a=e}},u=!1;if(e=function(e,t,r,n,i,s,a){var o=[],l=new Set;return(r=Ue(t={destination:null,responseState:t,progressiveChunkSize:void 0===n?12800:n,status:0,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:l,pingedTasks:o,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:void 0===i?Fe:i,onAllReady:$e,onShellReady:void 0===a?$e:a,onShellError:$e,onFatalError:$e},0,null,r,!1,!1)).parentFlushed=!0,e=Be(t,e,null,r,l,Z,null,ue),o.push(e),t}(e,function(e,t){return{bootstrapChunks:[],startInlineScript:"<script>",placeholderPrefix:(t=void 0===t?"":t)+"P:",segmentPrefix:t+"S:",boundaryPrefix:t+"B:",idPrefix:t,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1,generateStaticMarkup:e}}(n,r?r.identifierPrefix:void 0),{insertionMode:1,selectedValue:null},1/0,lt,0,function(){u=!0}),et(e),ot(e,i),1===e.status)e.status=2,l.destroy(e.fatalError);else if(2!==e.status&&null===e.destination){e.destination=l;try{at(e,l)}catch(t){ze(e,t),je(e,t)}}if(s)throw a;if(!u)throw Error(t(426));return o}return Du.renderToNodeStream=function(){throw Error(t(207))},Du.renderToStaticMarkup=function(e,t){return ut(e,t,!0,'The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server')},Du.renderToStaticNodeStream=function(){throw Error(t(208))},Du.renderToString=function(e,t){return ut(e,t,!1,'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server')},Du.version="18.3.1",Du}var Mu,Ou,Nu={};
36
36
  /**
37
37
  * @license React
38
38
  * react-dom-server.browser.production.min.js
@@ -41,4 +41,4 @@ var qr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
41
41
  *
42
42
  * This source code is licensed under the MIT license found in the
43
43
  * LICENSE file in the root directory of this source tree.
44
- */function Au(){if(Iu)return Lu;Iu=1;var e=l();function t(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=null,r=0;function o(e,t){if(0!==t.length)if(512<t.length)0<r&&(e.enqueue(new Uint8Array(n.buffer,0,r)),n=new Uint8Array(512),r=0),e.enqueue(t);else{var o=n.length-r;o<t.length&&(0===o?e.enqueue(n):(n.set(t.subarray(0,o),r),e.enqueue(n),t=t.subarray(o)),n=new Uint8Array(512),r=0),n.set(t,r),r+=t.length}}function i(e,t){return o(e,t),!0}function a(e){n&&0<r&&(e.enqueue(new Uint8Array(n.buffer,0,r)),n=null,r=0)}var s=new TextEncoder;function u(e){return s.encode(e)}function c(e){return s.encode(e)}function d(e,t){"function"==typeof e.error?e.error(t):e.close()}var f=Object.prototype.hasOwnProperty,p=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},m={};function g(e){return!!f.call(m,e)||!f.call(h,e)&&(p.test(e)?m[e]=!0:(h[e]=!0,!1))}function v(e,t,n,r,o,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new v(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];b[t]=new v(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new v(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){b[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){b[e]=new v(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){b[e]=new v(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){b[e]=new v(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){b[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var y=/[\-:]([a-z])/g;function w(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(y,w);b[t]=new v(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(y,w);b[t]=new v(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(y,w);b[t]=new v(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){b[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),b.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){b[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});var x={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},S=["Webkit","ms","Moz","O"];Object.keys(x).forEach(function(e){S.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),x[t]=x[e]})});var E=/["'&<>]/;function k(e){if("boolean"==typeof e||"number"==typeof e)return""+e;e=""+e;var t=E.exec(e);if(t){var n,r="",o=0;for(n=t.index;n<e.length;n++){switch(e.charCodeAt(n)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#x27;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}o!==n&&(r+=e.substring(o,n)),o=n+1,r+=t}e=o!==n?r+e.substring(o,n):r}return e}var C=/([A-Z])/g,T=/^ms-/,P=Array.isArray,O=c("<script>"),M=c("<\/script>"),N=c('<script src="'),_=c('<script type="module" src="'),R=c('" async=""><\/script>'),z=/(<\/|<)(s)(cript)/gi;function I(e,t,n,r){return t+("s"===n?"\\u0073":"\\u0053")+r}function D(e,t){return{insertionMode:e,selectedValue:t}}var L=c("\x3c!-- --\x3e");function A(e,t,n,r){return""===t?r:(r&&e.push(L),e.push(u(k(t))),!0)}var F=new Map,$=c(' style="'),j=c(":"),B=c(";");function W(e,n,r){if("object"!=typeof r)throw Error(t(62));for(var o in n=!0,r)if(f.call(r,o)){var i=r[o];if(null!=i&&"boolean"!=typeof i&&""!==i){if(0===o.indexOf("--")){var a=u(k(o));i=u(k((""+i).trim()))}else{a=o;var s=F.get(a);void 0!==s||(s=c(k(a.replace(C,"-$1").toLowerCase().replace(T,"-ms-"))),F.set(a,s)),a=s,i="number"==typeof i?0===i||f.call(x,o)?u(""+i):u(i+"px"):u(k((""+i).trim()))}n?(n=!1,e.push($,a,j,i)):e.push(B,a,j,i)}}n||e.push(V)}var U=c(" "),H=c('="'),V=c('"'),Y=c('=""');function q(e,t,n,r){switch(n){case"style":return void W(e,t,r);case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":return}if(!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1])if(null!==(t=b.hasOwnProperty(n)?b[n]:null)){switch(typeof r){case"function":case"symbol":return;case"boolean":if(!t.acceptsBooleans)return}switch(n=u(t.attributeName),t.type){case 3:r&&e.push(U,n,Y);break;case 4:!0===r?e.push(U,n,Y):!1!==r&&e.push(U,n,H,u(k(r)),V);break;case 5:isNaN(r)||e.push(U,n,H,u(k(r)),V);break;case 6:!isNaN(r)&&1<=r&&e.push(U,n,H,u(k(r)),V);break;default:t.sanitizeURL&&(r=""+r),e.push(U,n,H,u(k(r)),V)}}else if(g(n)){switch(typeof r){case"function":case"symbol":return;case"boolean":if("data-"!==(t=n.toLowerCase().slice(0,5))&&"aria-"!==t)return}e.push(U,u(n),H,u(k(r)),V)}}var G=c(">"),X=c("/>");function K(e,n,r){if(null!=n){if(null!=r)throw Error(t(60));if("object"!=typeof n||!("__html"in n))throw Error(t(61));null!=(n=n.__html)&&e.push(u(""+n))}}var Q=c(' selected=""');function Z(e,t,n,r){e.push(ne(n));var o,i=n=null;for(o in t)if(f.call(t,o)){var a=t[o];if(null!=a)switch(o){case"children":n=a;break;case"dangerouslySetInnerHTML":i=a;break;default:q(e,r,o,a)}}return e.push(G),K(e,i,n),"string"==typeof n?(e.push(u(k(n))),null):n}var J=c("\n"),ee=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,te=new Map;function ne(e){var n=te.get(e);if(void 0===n){if(!ee.test(e))throw Error(t(65,e));n=c("<"+e),te.set(e,n)}return n}var re=c("<!DOCTYPE html>");function oe(n,r,o,i,a){switch(r){case"select":n.push(ne("select"));var s=null,l=null;for(h in o)if(f.call(o,h)){var c=o[h];if(null!=c)switch(h){case"children":s=c;break;case"dangerouslySetInnerHTML":l=c;break;case"defaultValue":case"value":break;default:q(n,i,h,c)}}return n.push(G),K(n,l,s),s;case"option":l=a.selectedValue,n.push(ne("option"));var d=c=null,p=null,h=null;for(s in o)if(f.call(o,s)){var m=o[s];if(null!=m)switch(s){case"children":c=m;break;case"selected":p=m;break;case"dangerouslySetInnerHTML":h=m;break;case"value":d=m;default:q(n,i,s,m)}}if(null!=l)if(o=null!==d?""+d:function(t){var n="";return e.Children.forEach(t,function(e){null!=e&&(n+=e)}),n}(c),P(l)){for(i=0;i<l.length;i++)if(""+l[i]===o){n.push(Q);break}}else""+l===o&&n.push(Q);else p&&n.push(Q);return n.push(G),K(n,h,c),c;case"textarea":for(c in n.push(ne("textarea")),h=l=s=null,o)if(f.call(o,c)&&null!=(d=o[c]))switch(c){case"children":h=d;break;case"value":s=d;break;case"defaultValue":l=d;break;case"dangerouslySetInnerHTML":throw Error(t(91));default:q(n,i,c,d)}if(null===s&&null!==l&&(s=l),n.push(G),null!=h){if(null!=s)throw Error(t(92));if(P(h)&&1<h.length)throw Error(t(93));s=""+h}return"string"==typeof s&&"\n"===s[0]&&n.push(J),null!==s&&n.push(u(k(""+s))),null;case"input":for(l in n.push(ne("input")),d=h=c=s=null,o)if(f.call(o,l)&&null!=(p=o[l]))switch(l){case"children":case"dangerouslySetInnerHTML":throw Error(t(399,"input"));case"defaultChecked":d=p;break;case"defaultValue":c=p;break;case"checked":h=p;break;case"value":s=p;break;default:q(n,i,l,p)}return null!==h?q(n,i,"checked",h):null!==d&&q(n,i,"checked",d),null!==s?q(n,i,"value",s):null!==c&&q(n,i,"value",c),n.push(X),null;case"menuitem":for(var v in n.push(ne("menuitem")),o)if(f.call(o,v)&&null!=(s=o[v]))switch(v){case"children":case"dangerouslySetInnerHTML":throw Error(t(400));default:q(n,i,v,s)}return n.push(G),null;case"title":for(m in n.push(ne("title")),s=null,o)if(f.call(o,m)&&null!=(l=o[m]))switch(m){case"children":s=l;break;case"dangerouslySetInnerHTML":throw Error(t(434));default:q(n,i,m,l)}return n.push(G),s;case"listing":case"pre":for(d in n.push(ne(r)),l=s=null,o)if(f.call(o,d)&&null!=(c=o[d]))switch(d){case"children":s=c;break;case"dangerouslySetInnerHTML":l=c;break;default:q(n,i,d,c)}if(n.push(G),null!=l){if(null!=s)throw Error(t(60));if("object"!=typeof l||!("__html"in l))throw Error(t(61));null!=(o=l.__html)&&("string"==typeof o&&0<o.length&&"\n"===o[0]?n.push(J,u(o)):n.push(u(""+o)))}return"string"==typeof s&&"\n"===s[0]&&n.push(J),s;case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":for(var b in n.push(ne(r)),o)if(f.call(o,b)&&null!=(s=o[b]))switch(b){case"children":case"dangerouslySetInnerHTML":throw Error(t(399,r));default:q(n,i,b,s)}return n.push(X),null;case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return Z(n,o,r,i);case"html":return 0===a.insertionMode&&n.push(re),Z(n,o,r,i);default:if(-1===r.indexOf("-")&&"string"!=typeof o.is)return Z(n,o,r,i);for(p in n.push(ne(r)),l=s=null,o)if(f.call(o,p)&&null!=(c=o[p]))switch(p){case"children":s=c;break;case"dangerouslySetInnerHTML":l=c;break;case"style":W(n,i,c);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:g(p)&&"function"!=typeof c&&"symbol"!=typeof c&&n.push(U,u(p),H,u(k(c)),V)}return n.push(G),K(n,l,s),s}}var ie=c("</"),ae=c(">"),se=c('<template id="'),le=c('"></template>'),ue=c("\x3c!--$--\x3e"),ce=c('\x3c!--$?--\x3e<template id="'),de=c('"></template>'),fe=c("\x3c!--$!--\x3e"),pe=c("\x3c!--/$--\x3e"),he=c("<template"),me=c('"'),ge=c(' data-dgst="');c(' data-msg="'),c(' data-stck="');var ve=c("></template>");function be(e,n,r){if(o(e,ce),null===r)throw Error(t(395));return o(e,r),i(e,de)}var ye=c('<div hidden id="'),we=c('">'),xe=c("</div>"),Se=c('<svg aria-hidden="true" style="display:none" id="'),Ee=c('">'),ke=c("</svg>"),Ce=c('<math aria-hidden="true" style="display:none" id="'),Te=c('">'),Pe=c("</math>"),Oe=c('<table hidden id="'),Me=c('">'),Ne=c("</table>"),_e=c('<table hidden><tbody id="'),Re=c('">'),ze=c("</tbody></table>"),Ie=c('<table hidden><tr id="'),De=c('">'),Le=c("</tr></table>"),Ae=c('<table hidden><colgroup id="'),Fe=c('">'),$e=c("</colgroup></table>");var je=c('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'),Be=c('$RS("'),We=c('","'),Ue=c('")<\/script>'),He=c('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("'),Ve=c('$RC("'),Ye=c('","'),qe=c('")<\/script>'),Ge=c('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("'),Xe=c('$RX("'),Ke=c('"'),Qe=c(")<\/script>"),Ze=c(","),Je=/[<\u2028\u2029]/g;function et(e){return JSON.stringify(e).replace(Je,function(e){switch(e){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}var tt=Object.assign,nt=Symbol.for("react.element"),rt=Symbol.for("react.portal"),ot=Symbol.for("react.fragment"),it=Symbol.for("react.strict_mode"),at=Symbol.for("react.profiler"),st=Symbol.for("react.provider"),lt=Symbol.for("react.context"),ut=Symbol.for("react.forward_ref"),ct=Symbol.for("react.suspense"),dt=Symbol.for("react.suspense_list"),ft=Symbol.for("react.memo"),pt=Symbol.for("react.lazy"),ht=Symbol.for("react.scope"),mt=Symbol.for("react.debug_trace_mode"),gt=Symbol.for("react.legacy_hidden"),vt=Symbol.for("react.default_value"),bt=Symbol.iterator;function yt(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case ot:return"Fragment";case rt:return"Portal";case at:return"Profiler";case it:return"StrictMode";case ct:return"Suspense";case dt:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case lt:return(e.displayName||"Context")+".Consumer";case st:return(e._context.displayName||"Context")+".Provider";case ut:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case ft:return null!==(t=e.displayName||null)?t:yt(e.type)||"Memo";case pt:t=e._payload,e=e._init;try{return yt(e(t))}catch(e){}}return null}var wt={};function xt(e,t){if(!(e=e.contextTypes))return wt;var n,r={};for(n in e)r[n]=t[n];return r}var St=null;function Et(e,n){if(e!==n){e.context._currentValue=e.parentValue,e=e.parent;var r=n.parent;if(null===e){if(null!==r)throw Error(t(401))}else{if(null===r)throw Error(t(401));Et(e,r)}n.context._currentValue=n.value}}function kt(e){e.context._currentValue=e.parentValue,null!==(e=e.parent)&&kt(e)}function Ct(e){var t=e.parent;null!==t&&Ct(t),e.context._currentValue=e.value}function Tt(e,n){if(e.context._currentValue=e.parentValue,null===(e=e.parent))throw Error(t(402));e.depth===n.depth?Et(e,n):Tt(e,n)}function Pt(e,n){var r=n.parent;if(null===r)throw Error(t(402));e.depth===r.depth?Et(e,r):Pt(e,r),n.context._currentValue=n.value}function Ot(e){var t=St;t!==e&&(null===t?Ct(e):null===e?kt(t):t.depth===e.depth?Et(t,e):t.depth>e.depth?Tt(t,e):Pt(t,e),St=e)}var Mt={isMounted:function(){return!1},enqueueSetState:function(e,t){null!==(e=e._reactInternals).queue&&e.queue.push(t)},enqueueReplaceState:function(e,t){(e=e._reactInternals).replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}};function Nt(e,t,n,r){var o=void 0!==e.state?e.state:null;e.updater=Mt,e.props=n,e.state=o;var i={queue:[],replace:!1};e._reactInternals=i;var a=t.contextType;if(e.context="object"==typeof a&&null!==a?a._currentValue:r,"function"==typeof(a=t.getDerivedStateFromProps)&&(o=null==(a=a(n,o))?o:tt({},o,a),e.state=o),"function"!=typeof t.getDerivedStateFromProps&&"function"!=typeof e.getSnapshotBeforeUpdate&&("function"==typeof e.UNSAFE_componentWillMount||"function"==typeof e.componentWillMount))if(t=e.state,"function"==typeof e.componentWillMount&&e.componentWillMount(),"function"==typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),t!==e.state&&Mt.enqueueReplaceState(e,e.state,null),null!==i.queue&&0<i.queue.length)if(t=i.queue,a=i.replace,i.queue=null,i.replace=!1,a&&1===t.length)e.state=t[0];else{for(i=a?t[0]:e.state,o=!0,a=a?1:0;a<t.length;a++){var s=t[a];null!=(s="function"==typeof s?s.call(e,i,n,r):s)&&(o?(o=!1,i=tt({},i,s)):tt(i,s))}e.state=i}else i.queue=null}var _t={id:1,overflow:""};function Rt(e,t,n){var r=e.id;e=e.overflow;var o=32-zt(r)-1;r&=~(1<<o),n+=1;var i=32-zt(t)+o;if(30<i){var a=o-o%5;return i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,{id:1<<32-zt(t)+o|n<<o|r,overflow:i+e}}return{id:1<<i|n<<o|r,overflow:e}}var zt=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(It(e)/Dt|0)|0},It=Math.log,Dt=Math.LN2;var Lt="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},At=null,Ft=null,$t=null,jt=null,Bt=!1,Wt=!1,Ut=0,Ht=null,Vt=0;function Yt(){if(null===At)throw Error(t(321));return At}function qt(){if(0<Vt)throw Error(t(312));return{memoizedState:null,queue:null,next:null}}function Gt(){return null===jt?null===$t?(Bt=!1,$t=jt=qt()):(Bt=!0,jt=$t):null===jt.next?(Bt=!1,jt=jt.next=qt()):(Bt=!0,jt=jt.next),jt}function Xt(){Ft=At=null,Wt=!1,$t=null,Vt=0,jt=Ht=null}function Kt(e,t){return"function"==typeof t?t(e):t}function Qt(e,t,n){if(At=Yt(),jt=Gt(),Bt){var r=jt.queue;if(t=r.dispatch,null!==Ht&&void 0!==(n=Ht.get(r))){Ht.delete(r),r=jt.memoizedState;do{r=e(r,n.action),n=n.next}while(null!==n);return jt.memoizedState=r,[r,t]}return[jt.memoizedState,t]}return e=e===Kt?"function"==typeof t?t():t:void 0!==n?n(t):t,jt.memoizedState=e,e=(e=jt.queue={last:null,dispatch:null}).dispatch=Jt.bind(null,At,e),[jt.memoizedState,e]}function Zt(e,t){if(At=Yt(),t=void 0===t?null:t,null!==(jt=Gt())){var n=jt.memoizedState;if(null!==n&&null!==t){var r=n[1];e:if(null===r)r=!1;else{for(var o=0;o<r.length&&o<t.length;o++)if(!Lt(t[o],r[o])){r=!1;break e}r=!0}if(r)return n[0]}}return e=e(),jt.memoizedState=[e,t],e}function Jt(e,n,r){if(25<=Vt)throw Error(t(301));if(e===At)if(Wt=!0,e={action:r,next:null},null===Ht&&(Ht=new Map),void 0===(r=Ht.get(n)))Ht.set(n,e);else{for(n=r;null!==n.next;)n=n.next;n.next=e}}function en(){throw Error(t(394))}function tn(){}var nn={readContext:function(e){return e._currentValue},useContext:function(e){return Yt(),e._currentValue},useMemo:Zt,useReducer:Qt,useRef:function(e){At=Yt();var t=(jt=Gt()).memoizedState;return null===t?(e={current:e},jt.memoizedState=e):t},useState:function(e){return Qt(Kt,e)},useInsertionEffect:tn,useLayoutEffect:function(){},useCallback:function(e,t){return Zt(function(){return e},t)},useImperativeHandle:tn,useEffect:tn,useDebugValue:tn,useDeferredValue:function(e){return Yt(),e},useTransition:function(){return Yt(),[!1,en]},useId:function(){var e=Ft.treeContext,n=e.overflow;e=((e=e.id)&~(1<<32-zt(e)-1)).toString(32)+n;var r=rn;if(null===r)throw Error(t(404));return n=Ut++,e=":"+r.idPrefix+"R"+e,0<n&&(e+="H"+n.toString(32)),e+":"},useMutableSource:function(e,t){return Yt(),t(e._source)},useSyncExternalStore:function(e,n,r){if(void 0===r)throw Error(t(407));return r()}},rn=null,on=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;function an(e){return console.error(e),null}function sn(){}function ln(e,t,n,r,o,i,a,s){e.allPendingTasks++,null===n?e.pendingRootTasks++:n.pendingTasks++;var l={node:t,ping:function(){var t=e.pingedTasks;t.push(l),1===t.length&&En(e)},blockedBoundary:n,blockedSegment:r,abortSet:o,legacyContext:i,context:a,treeContext:s};return o.add(l),l}function un(e,t,n,r,o,i){return{status:0,id:-1,index:t,parentFlushed:!1,chunks:[],children:[],formatContext:r,boundary:n,lastPushedText:o,textEmbedded:i}}function cn(e,t){if(null!=(e=e.onError(t))&&"string"!=typeof e)throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof e+'" instead');return e}function dn(e,t){var n=e.onShellError;n(t),(n=e.onFatalError)(t),null!==e.destination?(e.status=2,d(e.destination,t)):(e.status=1,e.fatalError=t)}function fn(e,t,n,r,o){for(At={},Ft=t,Ut=0,e=n(r,o);Wt;)Wt=!1,Ut=0,Vt+=1,jt=null,e=n(r,o);return Xt(),e}function pn(e,n,r,o){var i=r.render(),a=o.childContextTypes;if(null!=a){var s=n.legacyContext;if("function"!=typeof r.getChildContext)o=s;else{for(var l in r=r.getChildContext())if(!(l in a))throw Error(t(108,yt(o)||"Unknown",l));o=tt({},s,r)}n.legacyContext=o,gn(e,n,i),n.legacyContext=s}else gn(e,n,i)}function hn(e,t){if(e&&e.defaultProps){for(var n in t=tt({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function mn(e,n,r,o,i){if("function"==typeof r)if(r.prototype&&r.prototype.isReactComponent){i=xt(r,n.legacyContext);var a=r.contextType;Nt(a=new r(o,"object"==typeof a&&null!==a?a._currentValue:i),r,o,i),pn(e,n,a,r)}else{i=fn(e,n,r,o,a=xt(r,n.legacyContext));var s=0!==Ut;if("object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof)Nt(i,r,o,a),pn(e,n,i,r);else if(s){o=n.treeContext,n.treeContext=Rt(o,1,0);try{gn(e,n,i)}finally{n.treeContext=o}}else gn(e,n,i)}else{if("string"!=typeof r){switch(r){case gt:case mt:case it:case at:case ot:case dt:return void gn(e,n,o.children);case ht:throw Error(t(343));case ct:e:{r=n.blockedBoundary,i=n.blockedSegment,a=o.fallback,o=o.children;var l={id:null,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:s=new Set,errorDigest:null},c=un(0,i.chunks.length,l,i.formatContext,!1,!1);i.children.push(c),i.lastPushedText=!1;var d=un(0,0,null,i.formatContext,!1,!1);d.parentFlushed=!0,n.blockedBoundary=l,n.blockedSegment=d;try{if(bn(e,n,o),d.lastPushedText&&d.textEmbedded&&d.chunks.push(L),d.status=1,xn(l,d),0===l.pendingTasks)break e}catch(t){d.status=4,l.forceClientRender=!0,l.errorDigest=cn(e,t)}finally{n.blockedBoundary=r,n.blockedSegment=i}n=ln(e,a,r,c,s,n.legacyContext,n.context,n.treeContext),e.pingedTasks.push(n)}return}if("object"==typeof r&&null!==r)switch(r.$$typeof){case ut:if(o=fn(e,n,r.render,o,i),0!==Ut){r=n.treeContext,n.treeContext=Rt(r,1,0);try{gn(e,n,o)}finally{n.treeContext=r}}else gn(e,n,o);return;case ft:return void mn(e,n,r=r.type,o=hn(r,o),i);case st:if(i=o.children,r=r._context,o=o.value,a=r._currentValue,r._currentValue=o,St=o={parent:s=St,depth:null===s?0:s.depth+1,context:r,parentValue:a,value:o},n.context=o,gn(e,n,i),null===(e=St))throw Error(t(403));return o=e.parentValue,e.context._currentValue=o===vt?e.context._defaultValue:o,e=St=e.parent,void(n.context=e);case lt:return void gn(e,n,o=(o=o.children)(r._currentValue));case pt:return void mn(e,n,r=(i=r._init)(r._payload),o=hn(r,o),void 0)}throw Error(t(130,null==r?r:typeof r,""))}switch(a=oe((i=n.blockedSegment).chunks,r,o,e.responseState,i.formatContext),i.lastPushedText=!1,s=i.formatContext,i.formatContext=function(e,t,n){switch(t){case"select":return D(1,null!=n.value?n.value:n.defaultValue);case"svg":return D(2,null);case"math":return D(3,null);case"foreignObject":return D(1,null);case"table":return D(4,null);case"thead":case"tbody":case"tfoot":return D(5,null);case"colgroup":return D(7,null);case"tr":return D(6,null)}return 4<=e.insertionMode||0===e.insertionMode?D(1,null):e}(s,r,o),bn(e,n,a),i.formatContext=s,r){case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break;default:i.chunks.push(ie,u(r),ae)}i.lastPushedText=!1}}function gn(e,n,r){if(n.node=r,"object"==typeof r&&null!==r){switch(r.$$typeof){case nt:return void mn(e,n,r.type,r.props,r.ref);case rt:throw Error(t(257));case pt:var o=r._init;return void gn(e,n,r=o(r._payload))}if(P(r))return void vn(e,n,r);if(null===r||"object"!=typeof r?o=null:o="function"==typeof(o=bt&&r[bt]||r["@@iterator"])?o:null,o&&(o=o.call(r))){if(!(r=o.next()).done){var i=[];do{i.push(r.value),r=o.next()}while(!r.done);vn(e,n,i)}return}throw e=Object.prototype.toString.call(r),Error(t(31,"[object Object]"===e?"object with keys {"+Object.keys(r).join(", ")+"}":e))}"string"==typeof r?(o=n.blockedSegment).lastPushedText=A(n.blockedSegment.chunks,r,e.responseState,o.lastPushedText):"number"==typeof r&&((o=n.blockedSegment).lastPushedText=A(n.blockedSegment.chunks,""+r,e.responseState,o.lastPushedText))}function vn(e,t,n){for(var r=n.length,o=0;o<r;o++){var i=t.treeContext;t.treeContext=Rt(i,r,o);try{bn(e,t,n[o])}finally{t.treeContext=i}}}function bn(e,t,n){var r=t.blockedSegment.formatContext,o=t.legacyContext,i=t.context;try{return gn(e,t,n)}catch(l){if(Xt(),"object"!=typeof l||null===l||"function"!=typeof l.then)throw t.blockedSegment.formatContext=r,t.legacyContext=o,t.context=i,Ot(i),l;n=l;var a=t.blockedSegment,s=un(0,a.chunks.length,null,a.formatContext,a.lastPushedText,!0);a.children.push(s),a.lastPushedText=!1,e=ln(e,t.node,t.blockedBoundary,s,t.abortSet,t.legacyContext,t.context,t.treeContext).ping,n.then(e,e),t.blockedSegment.formatContext=r,t.legacyContext=o,t.context=i,Ot(i)}}function yn(e){var t=e.blockedBoundary;(e=e.blockedSegment).status=3,Sn(this,t,e)}function wn(e,n,r){var o=e.blockedBoundary;e.blockedSegment.status=3,null===o?(n.allPendingTasks--,2!==n.status&&(n.status=2,null!==n.destination&&n.destination.close())):(o.pendingTasks--,o.forceClientRender||(o.forceClientRender=!0,e=void 0===r?Error(t(432)):r,o.errorDigest=n.onError(e),o.parentFlushed&&n.clientRenderedBoundaries.push(o)),o.fallbackAbortableTasks.forEach(function(e){return wn(e,n,r)}),o.fallbackAbortableTasks.clear(),n.allPendingTasks--,0===n.allPendingTasks&&(o=n.onAllReady)())}function xn(e,t){if(0===t.chunks.length&&1===t.children.length&&null===t.children[0].boundary){var n=t.children[0];n.id=t.id,n.parentFlushed=!0,1===n.status&&xn(e,n)}else e.completedSegments.push(t)}function Sn(e,n,r){if(null===n){if(r.parentFlushed){if(null!==e.completedRootSegment)throw Error(t(389));e.completedRootSegment=r}e.pendingRootTasks--,0===e.pendingRootTasks&&(e.onShellError=sn,(n=e.onShellReady)())}else n.pendingTasks--,n.forceClientRender||(0===n.pendingTasks?(r.parentFlushed&&1===r.status&&xn(n,r),n.parentFlushed&&e.completedBoundaries.push(n),n.fallbackAbortableTasks.forEach(yn,e),n.fallbackAbortableTasks.clear()):r.parentFlushed&&1===r.status&&(xn(n,r),1===n.completedSegments.length&&n.parentFlushed&&e.partialBoundaries.push(n)));e.allPendingTasks--,0===e.allPendingTasks&&(e=e.onAllReady)()}function En(e){if(2!==e.status){var t=St,n=on.current;on.current=nn;var r=rn;rn=e.responseState;try{var o,i=e.pingedTasks;for(o=0;o<i.length;o++){var a=i[o],s=e,l=a.blockedSegment;if(0===l.status){Ot(a.context);try{gn(s,a,a.node),l.lastPushedText&&l.textEmbedded&&l.chunks.push(L),a.abortSet.delete(a),l.status=1,Sn(s,a.blockedBoundary,l)}catch(e){if(Xt(),"object"==typeof e&&null!==e&&"function"==typeof e.then){var u=a.ping;e.then(u,u)}else{a.abortSet.delete(a),l.status=4;var c=a.blockedBoundary,d=e,f=cn(s,d);if(null===c?dn(s,d):(c.pendingTasks--,c.forceClientRender||(c.forceClientRender=!0,c.errorDigest=f,c.parentFlushed&&s.clientRenderedBoundaries.push(c))),s.allPendingTasks--,0===s.allPendingTasks)(0,s.onAllReady)()}}}}i.splice(0,o),null!==e.destination&&Mn(e,e.destination)}catch(t){cn(e,t),dn(e,t)}finally{rn=r,on.current=n,n===nn&&Ot(t)}}}function kn(e,n,r){switch(r.parentFlushed=!0,r.status){case 0:var a=r.id=e.nextSegmentId++;return r.lastPushedText=!1,r.textEmbedded=!1,e=e.responseState,o(n,se),o(n,e.placeholderPrefix),o(n,e=u(a.toString(16))),i(n,le);case 1:r.status=2;var s=!0;a=r.chunks;var l=0;r=r.children;for(var c=0;c<r.length;c++){for(s=r[c];l<s.index;l++)o(n,a[l]);s=Cn(e,n,s)}for(;l<a.length-1;l++)o(n,a[l]);return l<a.length&&(s=i(n,a[l])),s;default:throw Error(t(390))}}function Cn(e,n,r){var a=r.boundary;if(null===a)return kn(e,n,r);if(a.parentFlushed=!0,a.forceClientRender)a=a.errorDigest,i(n,fe),o(n,he),a&&(o(n,ge),o(n,u(k(a))),o(n,me)),i(n,ve),kn(e,n,r);else if(0<a.pendingTasks){a.rootSegmentID=e.nextSegmentId++,0<a.completedSegments.length&&e.partialBoundaries.push(a);var s=e.responseState,l=s.nextSuspenseID++;s=c(s.boundaryPrefix+l.toString(16)),a=a.id=s,be(n,e.responseState,a),kn(e,n,r)}else if(a.byteSize>e.progressiveChunkSize)a.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(a),be(n,e.responseState,a.id),kn(e,n,r);else{if(i(n,ue),1!==(r=a.completedSegments).length)throw Error(t(391));Cn(e,n,r[0])}return i(n,pe)}function Tn(e,n,r){return function(e,n,r,a){switch(r.insertionMode){case 0:case 1:return o(e,ye),o(e,n.segmentPrefix),o(e,u(a.toString(16))),i(e,we);case 2:return o(e,Se),o(e,n.segmentPrefix),o(e,u(a.toString(16))),i(e,Ee);case 3:return o(e,Ce),o(e,n.segmentPrefix),o(e,u(a.toString(16))),i(e,Te);case 4:return o(e,Oe),o(e,n.segmentPrefix),o(e,u(a.toString(16))),i(e,Me);case 5:return o(e,_e),o(e,n.segmentPrefix),o(e,u(a.toString(16))),i(e,Re);case 6:return o(e,Ie),o(e,n.segmentPrefix),o(e,u(a.toString(16))),i(e,De);case 7:return o(e,Ae),o(e,n.segmentPrefix),o(e,u(a.toString(16))),i(e,Fe);default:throw Error(t(397))}}(n,e.responseState,r.formatContext,r.id),Cn(e,n,r),function(e,n){switch(n.insertionMode){case 0:case 1:return i(e,xe);case 2:return i(e,ke);case 3:return i(e,Pe);case 4:return i(e,Ne);case 5:return i(e,ze);case 6:return i(e,Le);case 7:return i(e,$e);default:throw Error(t(397))}}(n,r.formatContext)}function Pn(e,n,r){for(var a=r.completedSegments,s=0;s<a.length;s++)On(e,n,r,a[s]);if(a.length=0,e=e.responseState,a=r.id,r=r.rootSegmentID,o(n,e.startInlineScript),e.sentCompleteBoundaryFunction?o(n,Ve):(e.sentCompleteBoundaryFunction=!0,o(n,He)),null===a)throw Error(t(395));return r=u(r.toString(16)),o(n,a),o(n,Ye),o(n,e.segmentPrefix),o(n,r),i(n,qe)}function On(e,n,r,a){if(2===a.status)return!0;var s=a.id;if(-1===s){if(-1===(a.id=r.rootSegmentID))throw Error(t(392));return Tn(e,n,a)}return Tn(e,n,a),o(n,(e=e.responseState).startInlineScript),e.sentCompleteSegmentFunction?o(n,Be):(e.sentCompleteSegmentFunction=!0,o(n,je)),o(n,e.segmentPrefix),o(n,s=u(s.toString(16))),o(n,We),o(n,e.placeholderPrefix),o(n,s),i(n,Ue)}function Mn(e,s){n=new Uint8Array(512),r=0;try{var l=e.completedRootSegment;if(null!==l&&0===e.pendingRootTasks){Cn(e,s,l),e.completedRootSegment=null;var c=e.responseState.bootstrapChunks;for(l=0;l<c.length-1;l++)o(s,c[l]);l<c.length&&i(s,c[l])}var d,f=e.clientRenderedBoundaries;for(d=0;d<f.length;d++){var p=f[d];c=s;var h=e.responseState,m=p.id,g=p.errorDigest,v=p.errorMessage,b=p.errorComponentStack;if(o(c,h.startInlineScript),h.sentClientRenderFunction?o(c,Xe):(h.sentClientRenderFunction=!0,o(c,Ge)),null===m)throw Error(t(395));o(c,m),o(c,Ke),(g||v||b)&&(o(c,Ze),o(c,u(et(g||"")))),(v||b)&&(o(c,Ze),o(c,u(et(v||"")))),b&&(o(c,Ze),o(c,u(et(b)))),i(c,Qe)}f.splice(0,d);var y=e.completedBoundaries;for(d=0;d<y.length;d++)Pn(e,s,y[d]);y.splice(0,d),a(s),n=new Uint8Array(512),r=0;var w=e.partialBoundaries;for(d=0;d<w.length;d++){var x=w[d];e:{f=e,p=s;var S=x.completedSegments;for(h=0;h<S.length;h++)if(!On(f,p,x,S[h])){h++,S.splice(0,h);var E=!1;break e}S.splice(0,h),E=!0}if(!E)return e.destination=null,d++,void w.splice(0,d)}w.splice(0,d);var k=e.completedBoundaries;for(d=0;d<k.length;d++)Pn(e,s,k[d]);k.splice(0,d)}finally{a(s),0===e.allPendingTasks&&0===e.pingedTasks.length&&0===e.clientRenderedBoundaries.length&&0===e.completedBoundaries.length&&s.close()}}function Nn(e,t){try{var n=e.abortableTasks;n.forEach(function(n){return wn(n,e,t)}),n.clear(),null!==e.destination&&Mn(e,e.destination)}catch(t){cn(e,t),dn(e,t)}}return Lu.renderToReadableStream=function(e,t){return new Promise(function(n,r){var o,i,a=new Promise(function(e,t){i=e,o=t}),s=function(e,t,n,r,o,i,a,s,l){var u=[],c=new Set;return(n=un(t={destination:null,responseState:t,progressiveChunkSize:void 0===r?12800:r,status:0,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:c,pingedTasks:u,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:void 0===o?an:o,onAllReady:void 0===i?sn:i,onShellReady:void 0===a?sn:a,onShellError:void 0===s?sn:s,onFatalError:void 0===l?sn:l},0,null,n,!1,!1)).parentFlushed=!0,e=ln(t,e,null,n,c,wt,null,_t),u.push(e),t}(e,function(e,t,n,r,o){e=void 0===e?"":e,t=void 0===t?O:c('<script nonce="'+k(t)+'">');var i=[];if(void 0!==n&&i.push(t,u((""+n).replace(z,I)),M),void 0!==r)for(n=0;n<r.length;n++)i.push(N,u(k(r[n])),R);if(void 0!==o)for(r=0;r<o.length;r++)i.push(_,u(k(o[r])),R);return{bootstrapChunks:i,startInlineScript:t,placeholderPrefix:c(e+"P:"),segmentPrefix:c(e+"S:"),boundaryPrefix:e+"B:",idPrefix:e,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1}}(t?t.identifierPrefix:void 0,t?t.nonce:void 0,t?t.bootstrapScriptContent:void 0,t?t.bootstrapScripts:void 0,t?t.bootstrapModules:void 0),function(e){return D("http://www.w3.org/2000/svg"===e?2:"http://www.w3.org/1998/Math/MathML"===e?3:0,null)}(t?t.namespaceURI:void 0),t?t.progressiveChunkSize:void 0,t?t.onError:void 0,i,function(){var e=new ReadableStream({type:"bytes",pull:function(e){if(1===s.status)s.status=2,d(e,s.fatalError);else if(2!==s.status&&null===s.destination){s.destination=e;try{Mn(s,e)}catch(e){cn(s,e),dn(s,e)}}},cancel:function(){Nn(s)}},{highWaterMark:0});e.allReady=a,n(e)},function(e){a.catch(function(){}),r(e)},o);if(t&&t.signal){var l=t.signal,f=function(){Nn(s,l.reason),l.removeEventListener("abort",f)};l.addEventListener("abort",f)}En(s)})},Lu.version="18.3.1",Lu}var Fu,$u,ju,Bu,Wu,Uu=function(){return Du||(Du=1,e=zu(),t=Au(),_u.version=e.version,_u.renderToString=e.renderToString,_u.renderToStaticMarkup=e.renderToStaticMarkup,_u.renderToNodeStream=e.renderToNodeStream,_u.renderToStaticNodeStream=e.renderToStaticNodeStream,_u.renderToReadableStream=t.renderToReadableStream),_u;var e,t}(),Hu={exports:{}};function Vu(){if($u)return Fu;$u=1;return Fu="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Yu(){if(Bu)return ju;Bu=1;var e=Vu();function t(){}function n(){}return n.resetWarningCache=t,ju=function(){function r(t,n,r,o,i,a){if(a!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}function qu(){return Wu||(Wu=1,Hu.exports=Yu()()),Hu.exports}var Gu=t(qu()),Xu="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ku(e,t){return e(t={exports:{}},t.exports),t.exports}var Qu=Ku(function(e){!function(t){var n=function(e,t,r){if(!l(t)||c(t)||d(t)||f(t)||s(t))return t;var o,i=0,a=0;if(u(t))for(o=[],a=t.length;i<a;i++)o.push(n(e,t[i],r));else for(var p in o={},t)Object.prototype.hasOwnProperty.call(t,p)&&(o[e(p,r)]=n(e,t[p],r));return o},r=function(e){return p(e)?e:(e=e.replace(/[\-_\s]+(.)?/g,function(e,t){return t?t.toUpperCase():""})).substr(0,1).toLowerCase()+e.substr(1)},o=function(e){var t=r(e);return t.substr(0,1).toUpperCase()+t.substr(1)},i=function(e,t){return function(e,t){var n=(t=t||{}).separator||"_",r=t.split||/(?=[A-Z])/;return e.split(r).join(n)}(e,t).toLowerCase()},a=Object.prototype.toString,s=function(e){return"function"==typeof e},l=function(e){return e===Object(e)},u=function(e){return"[object Array]"==a.call(e)},c=function(e){return"[object Date]"==a.call(e)},d=function(e){return"[object RegExp]"==a.call(e)},f=function(e){return"[object Boolean]"==a.call(e)},p=function(e){return(e-=0)==e},h=function(e,t){var n=t&&"process"in t?t.process:t;return"function"!=typeof n?e:function(t,r){return n(t,e,r)}},m={camelize:r,decamelize:i,pascalize:o,depascalize:i,camelizeKeys:function(e,t){return n(h(r,t),e)},decamelizeKeys:function(e,t){return n(h(i,t),e,t)},pascalizeKeys:function(e,t){return n(h(o,t),e)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}};e.exports?e.exports=m:t.humps=m}(Xu)}).decamelize,Zu=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Ju=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Zu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zu(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.")}()},ec=Ku(function(e){function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},t.apply(this,arguments)}e.exports=t}),tc=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o},nc=h.createContext(null);function rc(e){var t=e.children,n=void 0===t?"":t,r=tc(e,["children"]);return"string"!=typeof n&&(n=Uu.renderToString(n)),m.createElement("template",ec({},r,{dangerouslySetInnerHTML:{__html:n}}))}function oc(e){var t=e.root,n=e.children;return No.createPortal(void 0===n?null:n,t)}rc.propTypes={children:Gu.oneOfType([Gu.string,Gu.node])},oc.propTypes={root:Gu.object.isRequired,children:Gu.node};var ic=new Map;var ac=function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"core",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e){return e.children};return new Proxy(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{get:function(n,r){var o=Qu(r,{separator:"-"}),i="".concat(e,"-").concat(o);return ic.has(i)||ic.set(i,function(e){var t=h.forwardRef(function(t,n){var r,o,i=t.mode,a=void 0===i?"open":i,s=t.delegatesFocus,l=void 0!==s&&s,u=t.styleSheets,c=void 0===u?[]:u,d=t.ssr,f=void 0!==d&&d,p=t.children,g=tc(t,["mode","delegatesFocus","styleSheets","ssr","children"]),v=(o=h.useRef((r=n)&&r.current),h.useEffect(function(){r&&(r.current=o.current)},[r]),o),b=h.useState(null),y=Ju(b,2),w=y[0],x=y[1],S="node_".concat(a).concat(l);return h.useLayoutEffect(function(){if(v.current)try{if("function"==typeof n&&n(v.current),f){var e=v.current.shadowRoot;return void x(e)}var t=v.current.attachShadow({mode:a,delegatesFocus:l});c.length>0&&(t.adoptedStyleSheets=c),x(t)}catch(e){!function(e){var t=e.error,n=e.styleSheets,r=e.root;if("NotSupportedError"!==t.name)throw t;n.length>0&&(r.adoptedStyleSheets=n)}({error:e,styleSheets:c,root:w})}},[n,v,c]),m.createElement(m.Fragment,null,m.createElement(e.tag,ec({key:S,ref:v},g),(w||f)&&m.createElement(nc.Provider,{value:w},f?m.createElement(rc,{shadowroot:a,shadowrootmode:a},e.render({root:w,ssr:f,children:p})):m.createElement(oc,{root:w},e.render({root:w,ssr:f,children:p})))))});return t.propTypes={mode:Gu.oneOf(["open","closed"]),delegatesFocus:Gu.bool,styleSheets:Gu.arrayOf(Gu.instanceOf(globalThis.CSSStyleSheet)),ssr:Gu.bool,children:Gu.node},t}({tag:o,render:t})),ic.get(i)}})}();function sc(e){const[t,n]=m.useState(null),r=h.useRef(null),{open:o,setOpen:i}=Hs();return h.useEffect(()=>{r.current&&(r.current.style.display=o?"block":"none")},[o]),m.useLayoutEffect(()=>{const t=document.createElement("div");t.style.position="fixed",t.style.inset="0",t.style.zIndex="214748348",t.style.display="none",document.body.appendChild(t),r.current=t;const o=t.attachShadow({mode:"open"}),i=document.createElement("link");i.rel="stylesheet",i.href=e.cssHref;const a=document.createElement("style");a.innerHTML="\n /* Dialog size override for small viewports */\n .product-dialog-container{ \n max-height: 70vh;\n overflow-y: auto;\n width: 100%;\n max-width: min(82vw, 500px) !important;\n }\n ",o.appendChild(a),o.appendChild(i);const s=document.createElement("div");return o.appendChild(s),n(s),()=>t.remove()},[]),{container:t,setOpen:i}}const lc=e=>{const{collectionId:t,isPreview:n,priceText:r,container:o,cssText:i}=e,{setIsPreview:a,setPriceText:s}=cn(),{setCollection:l,setNextKey:u,collection:c}=pn();h.useEffect(()=>{r&&s(r);const e=Boolean(n);e&&a(e)},[]),h.useEffect(()=>{J(void 0,void 0,void 0,function*(){var e;const n=yield en({collectionId:t,size:10});if(!n)return;const{contents:r,count:o}=n;(null==r?void 0:r.length)&&u(null===(e=r.at(-1))||void 0===e?void 0:e.shortsId),l(Object.assign(Object.assign({},n),{count:o}))})},[t]);const d=function(e){var t,n,r,o,i,a,s,l,u,c,d,f;const p=null!==(t=e.iconForm)&&void 0!==t?t:B.INSTA,h={collectionId:e.collectionId,iconForm:p,iconShape:null!==(n=e.iconShape)&&void 0!==n?n:W.MANY,iconSize:null!==(r=e.iconSize)&&void 0!==r?r:120,borderLine:null!==(o=e.borderLine)&&void 0!==o?o:U.DAY,exposeTitle:null===(i=e.exposeTitle)||void 0===i||i,player:null!==(a=e.player)&&void 0!==a?a:H.POPUP,rounded:null===(s=e.rounded)||void 0===s||s,titlePosition:null!==(l=e.titlePosition)&&void 0!==l?l:V.BOTTOM,exposeProductBanner:null!==(u=e.exposeProductBanner)&&void 0!==u&&u,exposeProductBadge:null!==(c=e.exposeProductBadge)&&void 0!==c&&c,priceText:e.priceText||"할인가",hoverPlay:null!==(d=e.hoverPlay)&&void 0!==d&&d,thumbnailAutoPlay:null!==(f=e.thumbnailAutoPlay)&&void 0!==f&&f};return p===B.YOUTUBE?Object.assign(Object.assign({},h),{iconForm:B.YOUTUBE,iconRatio:e.iconRatio||"9/16"}):Object.assign(Object.assign({},h),{iconForm:B.INSTA})}(e),{containerRef:f}=function({collectionId:e,iconSize:t}){const{collection:n,setCollection:r,nextKey:o,setNextKey:i,isFetching:a,setIsFetching:s}=pn(),l=m.useRef(null),[u,c]=m.useState(0);return m.useEffect(()=>{if(!l.current)return;const e=new ResizeObserver(e=>{var t,n,r;const o=null!==(r=null===(n=null===(t=e[0])||void 0===t?void 0:t.contentRect)||void 0===n?void 0:n.width)&&void 0!==r?r:0;c(o)});return e.observe(l.current),()=>e.disconnect()},[]),m.useEffect(()=>{var e;if(!n||!n.contents)return;const l=Math.max(1,t+12),c=Math.ceil((u||0)/l)+4,d=null!==(e=n.count)&&void 0!==e?e:Number.MAX_SAFE_INTEGER,f=Math.min(d,c);if(n.contents.length>=f||a)return;console.log(n.contents);let p=!1;return(()=>{J(this,void 0,void 0,function*(){var e,t,a,l,u;try{s(!0);let c=n,d=o||(null===(e=c.contents.at(-1))||void 0===e?void 0:e.shortsId)||void 0;const h=new Set(c.contents.map(e=>e.shortsId));for(;!p&&c.contents.length<f;){const e=Math.max(6,f-c.contents.length),n=yield en({collectionId:c.colId,nextKey:d,size:e});if(!n||!(null===(t=n.contents)||void 0===t?void 0:t.length))break;d=null!==(l=null===(a=n.contents.at(-1))||void 0===a?void 0:a.shortsId)&&void 0!==l?l:d;const o=n.contents.filter(e=>!h.has(e.shortsId));if(!o.length)break;if(o.forEach(e=>h.add(e.shortsId)),c=Object.assign(Object.assign({},c),{contents:[...c.contents,...o]}),r(c),i(d||""),c.contents.length>=(null!==(u=c.count)&&void 0!==u?u:Number.MAX_SAFE_INTEGER))break}}finally{s(!1)}})})(),()=>{p=!0}},[null==n?void 0:n.colId,null==n?void 0:n.count,null==n?void 0:n.contents.length,u,t,a,o,r,s,i]),{containerRef:l}}({collectionId:t,iconSize:d.iconSize});return m.createElement(ac.div,null,m.createElement("style",null,i),m.createElement("div",{ref:f},m.createElement(Mu,{widgetPlayerOption:d,setCollectionUuid:e=>{l(Object.assign(Object.assign({},c),{uuid:e}))},portalContainer:o})))},uc=({portalContainer:e,aspectRatio:t})=>{var n;const{collection:r,setNextKey:o}=pn(),[i,a]=h.useState(),{setOpen:s,open:l}=Hs();h.useEffect(()=>{l||i&&a(null)},[l]);const u=(null!==(n=Ir().width)&&void 0!==n?n:0)<430||Ur.isMobile;return m.createElement(m.Fragment,null,m.createElement("div",{className:"grid gap-4",style:{gridTemplateColumns:`repeat(${u?2:5}, 1fr)`}},null==r?void 0:r.contents.map(e=>m.createElement("div",null,m.createElement("div",{className:"overflow-hidden",style:{borderRadius:"0.625rem",aspectRatio:null!=t?t:"9/16"}},m.createElement("video",{loop:!0,className:"w-full h-full object-cover",muted:!0,autoPlay:!0,playsInline:!0,src:At(e.media.objectId),poster:Ut(e.thumbPath)})),m.createElement(Ys,{hideMoreBadge:!0,showMoreBtn:!0,products:e.productsInfo,contentId:e.shortsId,setSelectedProducts:a})))),i&&m.createElement(Tu,{portalContainer:e,title:"상품 목록",contentClassName:"bg-white rounded p-4 product-dialog-container",description:"연결된 전체 상품 정보를 확인해 보세요"},m.createElement(Pu,{products:i.productsInfo,contentId:i.shortsId})))},cc=({collectionId:e,aspectRatio:t,container:n,cssText:r,isPreview:o})=>{const{setCollection:i,setNextKey:a}=pn();return h.useEffect(()=>{J(void 0,void 0,void 0,function*(){var t;const n=yield en({collectionId:e,size:-1});if(!n)return;const{contents:r,count:o}=n;(null==r?void 0:r.length)&&a(null===(t=r.at(-1))||void 0===t?void 0:t.shortsId),i(Object.assign(Object.assign({},n),{count:o}))})},[e]),m.createElement(ac.div,null,m.createElement("style",null,r),m.createElement(uc,{portalContainer:n,aspectRatio:t}))},dc=un(e=>({shortform:null,setShortform:t=>e({shortform:t})}));var fc={exports:{}},pc={};function hc(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=hc(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function mc(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=hc(e))&&(r&&(r+=" "),r+=t);return r}var gc,vc=n(Object.freeze({__proto__:null,clsx:mc,default:mc})),bc={},yc={};function wc(){if(gc)return yc;return gc=1,Object.defineProperty(yc,"__esModule",{value:!0}),yc.dontSetMe=function(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))},yc.findInArray=function(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]},yc.int=function(e){return parseInt(e,10)},yc.isFunction=function(e){return"function"==typeof e||"[object Function]"===Object.prototype.toString.call(e)},yc.isNum=function(e){return"number"==typeof e&&!isNaN(e)},yc}var xc,Sc,Ec={};function kc(){if(Sc)return bc;Sc=1,Object.defineProperty(bc,"__esModule",{value:!0}),bc.addClassName=a,bc.addEvent=function(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},bc.addUserSelectStyles=function(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t));e.body&&a(e.body,"react-draggable-transparent-selection")},bc.createCSSTransform=function(e,n){const r=i(e,n,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:r}},bc.createSVGTransform=function(e,t){return i(e,t,"")},bc.getTouch=function(t,n){return t.targetTouches&&(0,e.findInArray)(t.targetTouches,e=>n===e.identifier)||t.changedTouches&&(0,e.findInArray)(t.changedTouches,e=>n===e.identifier)},bc.getTouchIdentifier=function(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier},bc.getTranslation=i,bc.innerHeight=function(t){let n=t.clientHeight;const r=t.ownerDocument.defaultView.getComputedStyle(t);return n-=(0,e.int)(r.paddingTop),n-=(0,e.int)(r.paddingBottom),n},bc.innerWidth=function(t){let n=t.clientWidth;const r=t.ownerDocument.defaultView.getComputedStyle(t);return n-=(0,e.int)(r.paddingLeft),n-=(0,e.int)(r.paddingRight),n},bc.matchesSelector=o,bc.matchesSelectorAndParentsTo=function(e,t,n){let r=e;do{if(o(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1},bc.offsetXYFromParent=function(e,t,n){const r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-r.left)/n,i=(e.clientY+t.scrollTop-r.top)/n;return{x:o,y:i}},bc.outerHeight=function(t){let n=t.clientHeight;const r=t.ownerDocument.defaultView.getComputedStyle(t);return n+=(0,e.int)(r.borderTopWidth),n+=(0,e.int)(r.borderBottomWidth),n},bc.outerWidth=function(t){let n=t.clientWidth;const r=t.ownerDocument.defaultView.getComputedStyle(t);return n+=(0,e.int)(r.borderLeftWidth),n+=(0,e.int)(r.borderRightWidth),n},bc.removeClassName=s,bc.removeEvent=function(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},bc.removeUserSelectStyles=function(e){if(!e)return;try{if(e.body&&s(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(e){}};var e=wc(),t=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}o.default=e,r&&r.set(e,o);return o}(function(){if(xc)return Ec;xc=1,Object.defineProperty(Ec,"__esModule",{value:!0}),Ec.browserPrefixToKey=n,Ec.browserPrefixToStyle=function(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e},Ec.default=void 0,Ec.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){var t;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window)return"";const o=null===(t=window.document)||void 0===t||null===(t=t.documentElement)||void 0===t?void 0:t.style;if(!o)return"";if(r in o)return"";for(let t=0;t<e.length;t++)if(n(r,e[t])in o)return e[t];return""}function n(e,t){return t?"".concat(t).concat(function(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):"-"===e[r]?n=!0:t+=e[r];return t}(e)):e}return Ec.default=t(),Ec}());function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}let r="";function o(t,n){return r||(r=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,e.isFunction)(t[n])})),!!(0,e.isFunction)(t[r])&&t[r](n)}function i(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const e="".concat("string"==typeof t.x?t.x:t.x+n),r="".concat("string"==typeof t.y?t.y:t.y+n);i="translate(".concat(e,", ").concat(r,")")+i}return i}function a(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function s(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}return bc}var Cc,Tc={};function Pc(){if(Cc)return Tc;Cc=1,Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.canDragX=function(e){return"both"===e.props.axis||"x"===e.props.axis},Tc.canDragY=function(e){return"both"===e.props.axis||"y"===e.props.axis},Tc.createCoreData=function(t,r,o){const i=!(0,e.isNum)(t.lastX),a=n(t);return i?{node:a,deltaX:0,deltaY:0,lastX:r,lastY:o,x:r,y:o}:{node:a,deltaX:r-t.lastX,deltaY:o-t.lastY,lastX:t.lastX,lastY:t.lastY,x:r,y:o}},Tc.createDraggableData=function(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}},Tc.getBoundPosition=function(r,o,i){if(!r.props.bounds)return[o,i];let{bounds:a}=r.props;a="string"==typeof a?a:function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(a);const s=n(r);if("string"==typeof a){const{ownerDocument:n}=s,r=n.defaultView;let o;if(o="parent"===a?s.parentNode:n.querySelector(a),!(o instanceof r.HTMLElement))throw new Error('Bounds selector "'+a+'" could not find an element.');const i=o,l=r.getComputedStyle(s),u=r.getComputedStyle(i);a={left:-s.offsetLeft+(0,e.int)(u.paddingLeft)+(0,e.int)(l.marginLeft),top:-s.offsetTop+(0,e.int)(u.paddingTop)+(0,e.int)(l.marginTop),right:(0,t.innerWidth)(i)-(0,t.outerWidth)(s)-s.offsetLeft+(0,e.int)(u.paddingRight)-(0,e.int)(l.marginRight),bottom:(0,t.innerHeight)(i)-(0,t.outerHeight)(s)-s.offsetTop+(0,e.int)(u.paddingBottom)-(0,e.int)(l.marginBottom)}}(0,e.isNum)(a.right)&&(o=Math.min(o,a.right));(0,e.isNum)(a.bottom)&&(i=Math.min(i,a.bottom));(0,e.isNum)(a.left)&&(o=Math.max(o,a.left));(0,e.isNum)(a.top)&&(i=Math.max(i,a.top));return[o,i]},Tc.getControlPosition=function(e,r,o){const i="number"==typeof r?(0,t.getTouch)(e,r):null;if("number"==typeof r&&!i)return null;const a=n(o),s=o.props.offsetParent||a.offsetParent||a.ownerDocument.body;return(0,t.offsetXYFromParent)(i||e,s,o.props.scale)},Tc.snapToGrid=function(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]};var e=wc(),t=kc();function n(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}return Tc}var Oc,Mc,Nc,_c,Rc={},zc={};function Ic(){if(Oc)return zc;return Oc=1,Object.defineProperty(zc,"__esModule",{value:!0}),zc.default=function(){},zc}function Dc(){if(Mc)return Rc;Mc=1,Object.defineProperty(Rc,"__esModule",{value:!0}),Rc.default=void 0;var e=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(l()),t=s(qu()),n=s(k()),r=kc(),o=Pc(),i=wc(),a=s(Ic());function s(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function c(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const d={start:"touchstart",move:"touchmove",stop:"touchend"},f={start:"mousedown",move:"mousemove",stop:"mouseup"};let p=f,h=class extends e.Component{constructor(){super(...arguments),c(this,"dragging",!1),c(this,"lastX",NaN),c(this,"lastY",NaN),c(this,"touchIdentifier",null),c(this,"mounted",!1),c(this,"handleDragStart",e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&"number"==typeof e.button&&0!==e.button)return!1;const t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(e.target,this.props.handle,t)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(e.target,this.props.cancel,t))return;"touchstart"===e.type&&e.preventDefault();const i=(0,r.getTouchIdentifier)(e);this.touchIdentifier=i;const s=(0,o.getControlPosition)(e,i,this);if(null==s)return;const{x:l,y:u}=s,c=(0,o.createCoreData)(this,l,u);(0,a.default)("DraggableCore: handleDragStart: %j",c),(0,a.default)("calling",this.props.onStart);!1!==this.props.onStart(e,c)&&!1!==this.mounted&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(n),this.dragging=!0,this.lastX=l,this.lastY=u,(0,r.addEvent)(n,p.move,this.handleDrag),(0,r.addEvent)(n,p.stop,this.handleDragStop))}),c(this,"handleDrag",e=>{const t=(0,o.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=(0,o.snapToGrid)(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}const i=(0,o.createCoreData)(this,n,r);(0,a.default)("DraggableCore: handleDrag: %j",i);if(!1!==this.props.onDrag(e,i)&&!1!==this.mounted)this.lastX=n,this.lastY=r;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch(e){const t=document.createEvent("MouseEvents");t.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(t)}}),c(this,"handleDragStop",e=>{if(!this.dragging)return;const t=(0,o.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:i}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=i-this.lastY||0;[e,t]=(0,o.snapToGrid)(this.props.grid,e,t),n=this.lastX+e,i=this.lastY+t}const s=(0,o.createCoreData)(this,n,i);if(!1===this.props.onStop(e,s)||!1===this.mounted)return!1;const l=this.findDOMNode();l&&this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(l.ownerDocument),(0,a.default)("DraggableCore: handleDragStop: %j",s),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,l&&((0,a.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(l.ownerDocument,p.move,this.handleDrag),(0,r.removeEvent)(l.ownerDocument,p.stop,this.handleDragStop))}),c(this,"onMouseDown",e=>(p=f,this.handleDragStart(e))),c(this,"onMouseUp",e=>(p=f,this.handleDragStop(e))),c(this,"onTouchStart",e=>(p=d,this.handleDragStart(e))),c(this,"onTouchEnd",e=>(p=d,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,r.addEvent)(e,d.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:t}=e;(0,r.removeEvent)(t,f.move,this.handleDrag),(0,r.removeEvent)(t,d.move,this.handleDrag),(0,r.removeEvent)(t,f.stop,this.handleDragStop),(0,r.removeEvent)(t,d.stop,this.handleDragStop),(0,r.removeEvent)(e,d.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(t)}}findDOMNode(){var e,t;return null!==(e=this.props)&&void 0!==e&&e.nodeRef?null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Rc.default=h,c(h,"displayName","DraggableCore"),c(h,"propTypes",{allowAnyClick:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:i.dontSetMe,style:i.dontSetMe,transform:i.dontSetMe}),c(h,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Rc}function Lc(){return Nc||(Nc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return u.default}}),e.default=void 0;var t=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}r.default=e,n&&n.set(e,r);return r}(l()),n=d(qu()),r=d(k()),o=d(vc),i=kc(),a=Pc(),s=wc(),u=d(Dc()),c=d(Ic());function d(e){return e&&e.__esModule?e:{default:e}}function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(this,arguments)}function h(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class m extends t.Component{static getDerivedStateFromProps(e,t){let{position:n}=e,{prevPropsPosition:r}=t;return!n||r&&n.x===r.x&&n.y===r.y?null:((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:n,prevPropsPosition:r}),{x:n.x,y:n.y,prevPropsPosition:{...n}})}constructor(e){super(e),h(this,"onDragStart",(e,t)=>{(0,c.default)("Draggable: onDragStart: %j",t);if(!1===this.props.onStart(e,(0,a.createDraggableData)(this,t)))return!1;this.setState({dragging:!0,dragged:!0})}),h(this,"onDrag",(e,t)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",t);const n=(0,a.createDraggableData)(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){const{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;const[o,i]=(0,a.getBoundPosition)(this,r.x,r.y);r.x=o,r.y=i,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(!1===this.props.onDrag(e,n))return!1;this.setState(r)}),h(this,"onDragStop",(e,t)=>{if(!this.state.dragging)return!1;if(!1===this.props.onStop(e,(0,a.createDraggableData)(this,t)))return!1;(0,c.default)("Draggable: onDragStop: %j",t);const n={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){const{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)}),this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},!e.position||e.onDrag||e.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){void 0!==window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var e,t;return null!==(e=null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current)&&void 0!==e?e:r.default.findDOMNode(this)}render(){const{axis:e,bounds:n,children:r,defaultPosition:s,defaultClassName:l,defaultClassNameDragging:c,defaultClassNameDragged:d,position:f,positionOffset:h,scale:m,...g}=this.props;let v={},b=null;const y=!Boolean(f)||this.state.dragging,w=f||s,x={x:(0,a.canDragX)(this)&&y?this.state.x:w.x,y:(0,a.canDragY)(this)&&y?this.state.y:w.y};this.state.isElementSVG?b=(0,i.createSVGTransform)(x,h):v=(0,i.createCSSTransform)(x,h);const S=(0,o.default)(r.props.className||"",l,{[c]:this.state.dragging,[d]:this.state.dragged});return t.createElement(u.default,p({},g,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(r),{className:S,style:{...r.props.style,...v},transform:b}))}}e.default=m,h(m,"displayName","Draggable"),h(m,"propTypes",{...u.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),h(m,"defaultProps",{...u.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(pc)),pc}var Ac=function(){if(_c)return fc.exports;_c=1;const{default:e,DraggableCore:t}=Lc();return fc.exports=e,fc.exports.default=e,fc.exports.DraggableCore=t,fc.exports}(),Fc=t(Ac),$c=function(){return $c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},$c.apply(this,arguments)},jc={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},Bc={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Wc={width:"20px",height:"20px",position:"absolute",zIndex:1},Uc={top:$c($c({},jc),{top:"-5px"}),right:$c($c({},Bc),{left:void 0,right:"-5px"}),bottom:$c($c({},jc),{top:void 0,bottom:"-5px"}),left:$c($c({},Bc),{left:"-5px"}),topRight:$c($c({},Wc),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:$c($c({},Wc),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:$c($c({},Wc),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:$c($c({},Wc),{left:"-10px",top:"-10px",cursor:"nw-resize"})},Hc=h.memo(function(e){var t=e.onResizeStart,n=e.direction,r=e.children,o=e.replaceStyles,i=e.className,a=h.useCallback(function(e){t(e,n)},[t,n]),s=h.useCallback(function(e){t(e,n)},[t,n]),l=h.useMemo(function(){return $c($c({position:"absolute",userSelect:"none"},Uc[n]),null!=o?o:{})},[o,n]);return So.jsx("div",{className:i||void 0,style:l,onMouseDown:a,onTouchStart:s,children:r})}),Vc=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yc=function(){return Yc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Yc.apply(this,arguments)},qc={width:"auto",height:"auto"},Gc=function(e,t,n){return Math.max(Math.min(e,n),t)},Xc=function(e,t,n){var r=Math.round(e/t);return r*t+n*(r-1)},Kc=function(e,t){return new RegExp(e,"i").test(t)},Qc=function(e){return Boolean(e.touches&&e.touches.length)},Zc=function(e,t,n){void 0===n&&(n=0);var r=t.reduce(function(n,r,o){return Math.abs(r-e)<Math.abs(t[n]-e)?o:n},0),o=Math.abs(t[r]-e);return 0===n||o<n?t[r]:e},Jc=function(e){return"auto"===(e=e.toString())||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:"".concat(e,"px")},ed=function(e,t,n,r){if(e&&"string"==typeof e){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%"))return t*(Number(e.replace("%",""))/100);if(e.endsWith("vw"))return n*(Number(e.replace("vw",""))/100);if(e.endsWith("vh"))return r*(Number(e.replace("vh",""))/100)}return e},td=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],nd="__resizable_base__",rd=function(e){function t(t){var n,r,o,i,a=e.call(this,t)||this;return a.ratio=1,a.resizable=null,a.parentLeft=0,a.parentTop=0,a.resizableLeft=0,a.resizableRight=0,a.resizableTop=0,a.resizableBottom=0,a.targetLeft=0,a.targetTop=0,a.delta={width:0,height:0},a.appendBase=function(){if(!a.resizable||!a.window)return null;var e=a.parentNode;if(!e)return null;var t=a.window.document.createElement("div");return t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.transform="scale(0, 0)",t.style.left="0",t.style.flex="0 0 100%",t.classList?t.classList.add(nd):t.className+=nd,e.appendChild(t),t},a.removeBase=function(e){var t=a.parentNode;t&&t.removeChild(e)},a.state={isResizing:!1,width:null!==(r=null===(n=a.propsSize)||void 0===n?void 0:n.width)&&void 0!==r?r:"auto",height:null!==(i=null===(o=a.propsSize)||void 0===o?void 0:o.height)&&void 0!==i?i:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},a.onResizeStart=a.onResizeStart.bind(a),a.onMouseMove=a.onMouseMove.bind(a),a.onMouseUp=a.onMouseUp.bind(a),a}return Vc(t,e),Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||qc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var e=0,t=0;if(this.resizable&&this.window){var n=this.resizable.offsetWidth,r=this.resizable.offsetHeight,o=this.resizable.style.position;"relative"!==o&&(this.resizable.style.position="relative"),e="auto"!==this.resizable.style.width?this.resizable.offsetWidth:n,t="auto"!==this.resizable.style.height?this.resizable.offsetHeight:r,this.resizable.style.position=o}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var e=this,t=this.props.size,n=function(t){var n;if(void 0===e.state[t]||"auto"===e.state[t])return"auto";if(e.propsSize&&e.propsSize[t]&&(null===(n=e.propsSize[t])||void 0===n?void 0:n.toString().endsWith("%"))){if(e.state[t].toString().endsWith("%"))return e.state[t].toString();var r=e.getParentSize(),o=Number(e.state[t].toString().replace("px",""))/r[t]*100;return"".concat(o,"%")}return Jc(e.state[t])};return{width:t&&void 0!==t.width&&!this.state.isResizing?Jc(t.width):n("width"),height:t&&void 0!==t.height&&!this.state.isResizing?Jc(t.height):n("height")}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,n=this.parentNode.style.flexWrap;"wrap"!==n&&(t=!0,this.parentNode.style.flexWrap="wrap"),e.style.position="relative",e.style.minWidth="100%",e.style.minHeight="100%";var r={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=n),this.removeBase(e),r},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(this.resizable&&this.window){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==e.flexBasis?e.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(e,t){var n=this.propsSize&&this.propsSize[t];return"auto"!==this.state[t]||this.state.original[t]!==e||void 0!==n&&"auto"!==n?e:"auto"},t.prototype.calculateNewMaxFromBoundary=function(e,t){var n,r,o=this.props.boundsByDirection,i=this.state.direction,a=o&&Kc("left",i),s=o&&Kc("top",i);if("parent"===this.props.bounds){var l=this.parentNode;l&&(n=a?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),r=s?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(n=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,r=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(n=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),r=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return n&&Number.isFinite(n)&&(e=e&&e<n?e:n),r&&Number.isFinite(r)&&(t=t&&t<r?t:r),{maxWidth:e,maxHeight:t}},t.prototype.calculateNewSizeFromDirection=function(e,t){var n,r=this.props.scale||1,o=(n=this.props.resizeRatio||1,Array.isArray(n)?n:[n,n]),i=o[0],a=o[1],s=this.state,l=s.direction,u=s.original,c=this.props,d=c.lockAspectRatio,f=c.lockAspectRatioExtraHeight,p=c.lockAspectRatioExtraWidth,h=u.width,m=u.height,g=f||0,v=p||0;return Kc("right",l)&&(h=u.width+(e-u.x)*i/r,d&&(m=(h-v)/this.ratio+g)),Kc("left",l)&&(h=u.width-(e-u.x)*i/r,d&&(m=(h-v)/this.ratio+g)),Kc("bottom",l)&&(m=u.height+(t-u.y)*a/r,d&&(h=(m-g)*this.ratio+v)),Kc("top",l)&&(m=u.height-(t-u.y)*a/r,d&&(h=(m-g)*this.ratio+v)),{newWidth:h,newHeight:m}},t.prototype.calculateNewSizeFromAspectRatio=function(e,t,n,r){var o=this.props,i=o.lockAspectRatio,a=o.lockAspectRatioExtraHeight,s=o.lockAspectRatioExtraWidth,l=void 0===r.width?10:r.width,u=void 0===n.width||n.width<0?e:n.width,c=void 0===r.height?10:r.height,d=void 0===n.height||n.height<0?t:n.height,f=a||0,p=s||0;if(i){var h=(c-f)*this.ratio+p,m=(d-f)*this.ratio+p,g=(l-p)/this.ratio+f,v=(u-p)/this.ratio+f,b=Math.max(l,h),y=Math.min(u,m),w=Math.max(c,g),x=Math.min(d,v);e=Gc(e,b,y),t=Gc(t,w,x)}else e=Gc(e,l,u),t=Gc(t,c,d);return{newWidth:e,newHeight:t}},t.prototype.setBoundingClientRect=function(){var e=1/(this.props.scale||1);if("parent"===this.props.bounds){var t=this.parentNode;if(t){var n=t.getBoundingClientRect();this.parentLeft=n.left*e,this.parentTop=n.top*e}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var r=this.props.bounds.getBoundingClientRect();this.targetLeft=r.left*e,this.targetTop=r.top*e}if(this.resizable){var o=this.resizable.getBoundingClientRect(),i=o.left,a=o.top,s=o.right,l=o.bottom;this.resizableLeft=i*e,this.resizableRight=s*e,this.resizableTop=a*e,this.resizableBottom=l*e}},t.prototype.onResizeStart=function(e,t){if(this.resizable&&this.window){var n,r=0,o=0;if(e.nativeEvent&&function(e){return Boolean((e.clientX||0===e.clientX)&&(e.clientY||0===e.clientY))}(e.nativeEvent)?(r=e.nativeEvent.clientX,o=e.nativeEvent.clientY):e.nativeEvent&&Qc(e.nativeEvent)&&(r=e.nativeEvent.touches[0].clientX,o=e.nativeEvent.touches[0].clientY),this.props.onResizeStart)if(this.resizable)if(!1===this.props.onResizeStart(e,t,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var i=this.window.getComputedStyle(this.resizable);if("auto"!==i.flexBasis){var a=this.parentNode;if(a){var s=this.window.getComputedStyle(a).flexDirection;this.flexDir=s.startsWith("row")?"row":"column",n=i.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:r,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Yc(Yc({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||"auto"}),direction:t,flexBasis:n};this.setState(l)}},t.prototype.onMouseMove=function(e){var t=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&Qc(e))try{e.preventDefault(),e.stopPropagation()}catch(e){}var n=this.props,r=n.maxWidth,o=n.maxHeight,i=n.minWidth,a=n.minHeight,s=Qc(e)?e.touches[0].clientX:e.clientX,l=Qc(e)?e.touches[0].clientY:e.clientY,u=this.state,c=u.direction,d=u.original,f=u.width,p=u.height,h=this.getParentSize(),m=function(e,t,n,r,o,i,a){return r=ed(r,e.width,t,n),o=ed(o,e.height,t,n),i=ed(i,e.width,t,n),a=ed(a,e.height,t,n),{maxWidth:void 0===r?void 0:Number(r),maxHeight:void 0===o?void 0:Number(o),minWidth:void 0===i?void 0:Number(i),minHeight:void 0===a?void 0:Number(a)}}(h,this.window.innerWidth,this.window.innerHeight,r,o,i,a);r=m.maxWidth,o=m.maxHeight,i=m.minWidth,a=m.minHeight;var g=this.calculateNewSizeFromDirection(s,l),v=g.newHeight,b=g.newWidth,y=this.calculateNewMaxFromBoundary(r,o);this.props.snap&&this.props.snap.x&&(b=Zc(b,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(v=Zc(v,this.props.snap.y,this.props.snapGap));var w=this.calculateNewSizeFromAspectRatio(b,v,{width:y.maxWidth,height:y.maxHeight},{width:i,height:a});if(b=w.newWidth,v=w.newHeight,this.props.grid){var x=Xc(b,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),S=Xc(v,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),E=this.props.snapGap||0;b=0===E||Math.abs(x-b)<=E?x:b,v=0===E||Math.abs(S-v)<=E?S:v}var k={width:b-d.width,height:v-d.height};if(this.delta=k,f&&"string"==typeof f)if(f.endsWith("%")){var C=b/h.width*100;b="".concat(C,"%")}else if(f.endsWith("vw")){var T=b/this.window.innerWidth*100;b="".concat(T,"vw")}else if(f.endsWith("vh")){var P=b/this.window.innerHeight*100;b="".concat(P,"vh")}if(p&&"string"==typeof p)if(p.endsWith("%")){C=v/h.height*100;v="".concat(C,"%")}else if(p.endsWith("vw")){T=v/this.window.innerWidth*100;v="".concat(T,"vw")}else if(p.endsWith("vh")){P=v/this.window.innerHeight*100;v="".concat(P,"vh")}var O={width:this.createSizeForCssProperty(b,"width"),height:this.createSizeForCssProperty(v,"height")};"row"===this.flexDir?O.flexBasis=O.width:"column"===this.flexDir&&(O.flexBasis=O.height);var M=this.state.width!==O.width,N=this.state.height!==O.height,_=this.state.flexBasis!==O.flexBasis,R=M||N||_;R&&No.flushSync(function(){t.setState(O)}),this.props.onResize&&R&&this.props.onResize(e,c,this.resizable,k)}},t.prototype.onMouseUp=function(e){var t,n,r=this.state,o=r.isResizing,i=r.direction;r.original,o&&this.resizable&&(this.props.onResizeStop&&this.props.onResizeStop(e,i,this.resizable,this.delta),this.props.size&&this.setState({width:null!==(t=this.props.size.width)&&void 0!==t?t:"auto",height:null!==(n=this.props.size.height)&&void 0!==n?n:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Yc(Yc({},this.state.backgroundStyle),{cursor:"auto"})}))},t.prototype.updateSize=function(e){var t,n;this.setState({width:null!==(t=e.width)&&void 0!==t?t:"auto",height:null!==(n=e.height)&&void 0!==n?n:"auto"})},t.prototype.renderResizer=function(){var e=this,t=this.props,n=t.enable,r=t.handleStyles,o=t.handleClasses,i=t.handleWrapperStyle,a=t.handleWrapperClass,s=t.handleComponent;if(!n)return null;var l=Object.keys(n).map(function(t){return!1!==n[t]?So.jsx(Hc,{direction:t,onResizeStart:e.onResizeStart,replaceStyles:r&&r[t],className:o&&o[t],children:s&&s[t]?s[t]:null},t):null});return So.jsx("div",{className:a,style:i,children:l})},t.prototype.render=function(){var e=this,t=Object.keys(this.props).reduce(function(t,n){return-1!==td.indexOf(n)||(t[n]=e.props[n]),t},{}),n=Yc(Yc(Yc({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(n.flexBasis=this.state.flexBasis);var r=this.props.as||"div";return So.jsxs(r,Yc({style:n,className:this.props.className},t,{ref:function(t){t&&(e.resizable=t)},children:[this.state.isResizing&&So.jsx("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(h.PureComponent),od=function(e,t){return od=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},od(e,t)};var id=function(){return id=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},id.apply(this,arguments)};var ad={width:"auto",height:"auto",display:"inline-block",position:"absolute",top:0,left:0},sd=function(e){function t(t){var n=e.call(this,t)||this;return n.resizingPosition={x:0,y:0},n.offsetFromParent={left:0,top:0},n.resizableElement={current:null},n.originalPosition={x:0,y:0},n.state={resizing:!1,bounds:{top:0,right:0,bottom:0,left:0},maxWidth:t.maxWidth,maxHeight:t.maxHeight},n.onResizeStart=n.onResizeStart.bind(n),n.onResize=n.onResize.bind(n),n.onResizeStop=n.onResizeStop.bind(n),n.onDragStart=n.onDragStart.bind(n),n.onDrag=n.onDrag.bind(n),n.onDragStop=n.onDragStop.bind(n),n.getMaxSizesFromProps=n.getMaxSizesFromProps.bind(n),n}return function(e,t){function n(){this.constructor=e}od(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){this.updateOffsetFromParent();var e=this.offsetFromParent,t=e.left,n=e.top,r=this.getDraggablePosition(),o=r.x,i=r.y;this.draggable.setState({x:o-t,y:i-n}),this.forceUpdate()},t.prototype.getDraggablePosition=function(){var e=this.draggable.state;return{x:e.x,y:e.y}},t.prototype.getParent=function(){return this.resizable&&this.resizable.parentNode},t.prototype.getParentSize=function(){return this.resizable.getParentSize()},t.prototype.getMaxSizesFromProps=function(){return{maxWidth:void 0===this.props.maxWidth?Number.MAX_SAFE_INTEGER:this.props.maxWidth,maxHeight:void 0===this.props.maxHeight?Number.MAX_SAFE_INTEGER:this.props.maxHeight}},t.prototype.getSelfElement=function(){return this.resizable&&this.resizable.resizable},t.prototype.getOffsetHeight=function(e){var t=this.props.scale;switch(this.props.bounds){case"window":return window.innerHeight/t;case"body":return document.body.offsetHeight/t;default:return e.offsetHeight}},t.prototype.getOffsetWidth=function(e){var t=this.props.scale;switch(this.props.bounds){case"window":return window.innerWidth/t;case"body":return document.body.offsetWidth/t;default:return e.offsetWidth}},t.prototype.onDragStart=function(e,t){this.props.onDragStart&&this.props.onDragStart(e,t);var n=this.getDraggablePosition();if(this.originalPosition=n,this.props.bounds){var r,o=this.getParent(),i=this.props.scale;if("parent"===this.props.bounds)r=o;else{if("body"===this.props.bounds){var a=o.getBoundingClientRect(),s=a.left,l=a.top,u=document.body.getBoundingClientRect(),c=-(s-o.offsetLeft*i-u.left)/i,d=-(l-o.offsetTop*i-u.top)/i,f=(document.body.offsetWidth-this.resizable.size.width*i)/i+c,p=(document.body.offsetHeight-this.resizable.size.height*i)/i+d;return this.setState({bounds:{top:d,right:f,bottom:p,left:c}})}if("window"===this.props.bounds){if(!this.resizable)return;var h=o.getBoundingClientRect(),m=h.left,g=h.top,v=-(m-o.offsetLeft*i)/i,b=-(g-o.offsetTop*i)/i;f=(window.innerWidth-this.resizable.size.width*i)/i+v,p=(window.innerHeight-this.resizable.size.height*i)/i+b;return this.setState({bounds:{top:b,right:f,bottom:p,left:v}})}"string"==typeof this.props.bounds?r=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(r=this.props.bounds)}if(r instanceof HTMLElement&&o instanceof HTMLElement){var y=r.getBoundingClientRect(),w=y.left,x=y.top,S=o.getBoundingClientRect(),E=(w-S.left)/i,k=x-S.top;if(this.resizable){this.updateOffsetFromParent();var C=this.offsetFromParent;this.setState({bounds:{top:k-C.top,right:E+(r.offsetWidth-this.resizable.size.width)-C.left/i,bottom:k+(r.offsetHeight-this.resizable.size.height)-C.top,left:E-C.left/i}})}}}},t.prototype.onDrag=function(e,t){if(this.props.onDrag){var n=this.offsetFromParent,r=n.left,o=n.top;return this.props.dragAxis&&"both"!==this.props.dragAxis?"x"===this.props.dragAxis?this.props.onDrag(e,id(id({},t),{x:t.x+r,y:this.originalPosition.y+o,deltaY:0})):"y"===this.props.dragAxis?this.props.onDrag(e,id(id({},t),{x:this.originalPosition.x+r,y:t.y+o,deltaX:0})):void 0:this.props.onDrag(e,id(id({},t),{x:t.x+r,y:t.y+o}))}},t.prototype.onDragStop=function(e,t){if(this.props.onDragStop){var n=this.offsetFromParent,r=n.left,o=n.top;return this.props.dragAxis&&"both"!==this.props.dragAxis?"x"===this.props.dragAxis?this.props.onDragStop(e,id(id({},t),{x:t.x+r,y:this.originalPosition.y+o,deltaY:0})):"y"===this.props.dragAxis?this.props.onDragStop(e,id(id({},t),{x:this.originalPosition.x+r,y:t.y+o,deltaX:0})):void 0:this.props.onDragStop(e,id(id({},t),{x:t.x+r,y:t.y+o}))}},t.prototype.onResizeStart=function(e,t,n){e.stopPropagation(),this.setState({resizing:!0});var r=this.props.scale,o=this.offsetFromParent,i=this.getDraggablePosition();if(this.resizingPosition={x:i.x+o.left,y:i.y+o.top},this.originalPosition=i,this.props.bounds){var a=this.getParent(),s=void 0;"parent"===this.props.bounds?s=a:"body"===this.props.bounds?s=document.body:"window"===this.props.bounds?s=window:"string"==typeof this.props.bounds?s=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(s=this.props.bounds);var l=this.getSelfElement();if(l instanceof Element&&(s instanceof HTMLElement||s===window)&&a instanceof HTMLElement){var u=this.getMaxSizesFromProps(),c=u.maxWidth,d=u.maxHeight,f=this.getParentSize();if(c&&"string"==typeof c)if(c.endsWith("%")){var p=Number(c.replace("%",""))/100;c=f.width*p}else c.endsWith("px")&&(c=Number(c.replace("px","")));if(d&&"string"==typeof d)if(d.endsWith("%")){p=Number(d.replace("%",""))/100;d=f.height*p}else d.endsWith("px")&&(d=Number(d.replace("px","")));var h=l.getBoundingClientRect(),m=h.left,g=h.top,v="window"===this.props.bounds?{left:0,top:0}:s.getBoundingClientRect(),b=v.left,y=v.top,w=this.getOffsetWidth(s),x=this.getOffsetHeight(s),S=t.toLowerCase().endsWith("left"),E=t.toLowerCase().endsWith("right"),k=t.startsWith("top"),C=t.startsWith("bottom");if((S||k)&&this.resizable){var T=(m-b)/r+this.resizable.size.width;this.setState({maxWidth:T>Number(c)?c:T})}if(E||this.props.lockAspectRatio&&!S&&!k){T=w+(b-m)/r;this.setState({maxWidth:T>Number(c)?c:T})}if((k||S)&&this.resizable){T=(g-y)/r+this.resizable.size.height;this.setState({maxHeight:T>Number(d)?d:T})}if(C||this.props.lockAspectRatio&&!k&&!S){T=x+(y-g)/r;this.setState({maxHeight:T>Number(d)?d:T})}}}else this.setState({maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight});this.props.onResizeStart&&this.props.onResizeStart(e,t,n)},t.prototype.onResize=function(e,t,n,r){var o=this,i={x:this.originalPosition.x,y:this.originalPosition.y},a=-r.width,s=-r.height;["top","left","topLeft","bottomLeft","topRight"].includes(t)&&("bottomLeft"===t?i.x+=a:("topRight"===t||(i.x+=a),i.y+=s));var l=this.draggable.state;i.x===l.x&&i.y===l.y||No.flushSync(function(){o.draggable.setState(i)}),this.updateOffsetFromParent();var u=this.offsetFromParent,c=this.getDraggablePosition().x+u.left,d=this.getDraggablePosition().y+u.top;this.resizingPosition={x:c,y:d},this.props.onResize&&this.props.onResize(e,t,n,r,{x:c,y:d})},t.prototype.onResizeStop=function(e,t,n,r){this.setState({resizing:!1});var o=this.getMaxSizesFromProps(),i=o.maxWidth,a=o.maxHeight;this.setState({maxWidth:i,maxHeight:a}),this.props.onResizeStop&&this.props.onResizeStop(e,t,n,r,this.resizingPosition)},t.prototype.updateSize=function(e){this.resizable&&this.resizable.updateSize({width:e.width,height:e.height})},t.prototype.updatePosition=function(e){this.draggable.setState(e)},t.prototype.updateOffsetFromParent=function(){var e=this.props.scale,t=this.getParent(),n=this.getSelfElement();if(!t||null===n)return{top:0,left:0};var r=t.getBoundingClientRect(),o=r.left,i=r.top,a=n.getBoundingClientRect(),s=this.getDraggablePosition(),l=t.scrollLeft,u=t.scrollTop;this.offsetFromParent={left:a.left-o+l-s.x*e,top:a.top-i+u-s.y*e}},t.prototype.render=function(){var e=this,t=this.props,n=t.disableDragging,r=t.style,o=t.dragHandleClassName,i=t.position,a=t.onMouseDown,s=t.onMouseUp,l=t.dragAxis,u=t.dragGrid,c=t.bounds,d=t.enableUserSelectHack,f=t.cancel,p=t.children;t.onResizeStart,t.onResize,t.onResizeStop,t.onDragStart,t.onDrag,t.onDragStop;var m=t.resizeHandleStyles,g=t.resizeHandleClasses,v=t.resizeHandleComponent,b=t.enableResizing,y=t.resizeGrid,w=t.resizeHandleWrapperClass,x=t.resizeHandleWrapperStyle,S=t.scale,E=t.allowAnyClick,k=t.dragPositionOffset,C=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["disableDragging","style","dragHandleClassName","position","onMouseDown","onMouseUp","dragAxis","dragGrid","bounds","enableUserSelectHack","cancel","children","onResizeStart","onResize","onResizeStop","onDragStart","onDrag","onDragStop","resizeHandleStyles","resizeHandleClasses","resizeHandleComponent","enableResizing","resizeGrid","resizeHandleWrapperClass","resizeHandleWrapperStyle","scale","allowAnyClick","dragPositionOffset"]),T=this.props.default?id({},this.props.default):void 0;delete C.default;var P,O=n||o?{cursor:"auto"}:{cursor:"move"},M=id(id(id({},ad),O),r),N=this.offsetFromParent,_=N.left,R=N.top;i&&(P={x:i.x-_,y:i.y-R});var z,I=this.state.resizing?void 0:P,D=this.state.resizing?"both":l;return h.createElement(Fc,{ref:function(t){t&&(e.draggable=t)},handle:o?".".concat(o):void 0,defaultPosition:T,onMouseDown:a,onMouseUp:s,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,axis:D,disabled:n,grid:u,bounds:c?this.state.bounds:void 0,position:I,enableUserSelectHack:d,cancel:f,scale:S,allowAnyClick:E,nodeRef:this.resizableElement,positionOffset:k},h.createElement(rd,id({},C,{ref:function(t){t&&(e.resizable=t,e.resizableElement.current=t.resizable)},defaultSize:T,size:this.props.size,enable:"boolean"==typeof b?(z=b,{bottom:z,bottomLeft:z,bottomRight:z,left:z,right:z,top:z,topLeft:z,topRight:z}):b,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,style:M,minWidth:this.props.minWidth,minHeight:this.props.minHeight,maxWidth:this.state.resizing?this.state.maxWidth:this.props.maxWidth,maxHeight:this.state.resizing?this.state.maxHeight:this.props.maxHeight,grid:y,handleWrapperClass:w,handleWrapperStyle:x,lockAspectRatio:this.props.lockAspectRatio,lockAspectRatioExtraWidth:this.props.lockAspectRatioExtraWidth,lockAspectRatioExtraHeight:this.props.lockAspectRatioExtraHeight,handleStyles:m,handleClasses:g,handleComponent:v,scale:this.props.scale}),p))},t.defaultProps={maxWidth:Number.MAX_SAFE_INTEGER,maxHeight:Number.MAX_SAFE_INTEGER,scale:1,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},onDragStart:function(){},onDrag:function(){},onDragStop:function(){}},t}(h.PureComponent);const ld=({shortform:e,mute:t,play:n})=>{const r=At(e.media.objectId);return Object.assign({hideProducts:!0},e.playerSettings),m.createElement("div",{className:"relative w-full h-full text-white"},m.createElement(io,{file:r,mute:t,play:n}))},ud=({shortform:e,setClose:t})=>{const[n,r]=m.useState(!0),[o,i]=h.useState(!0),[a,s]=h.useState(!1),l=m.useRef(null),u=()=>{l.current&&(window.clearTimeout(l.current),l.current=null)},c=(e=1500)=>{u(),l.current=window.setTimeout(()=>s(!1),e)};return h.useEffect(()=>()=>u(),[]),m.createElement("div",{className:"relative w-full h-full",onClick:()=>{s(!0),c(2e3)},onMouseLeave:()=>c(800),onMouseEnter:()=>a&&c(1500)},m.createElement("div",{className:"absolute inset-0 bg-black",style:{zIndex:1,opacity:a?.4:0,transition:"opacity 300ms ease",pointerEvents:a?"auto":"none"}}),m.createElement("div",{className:"absolute inset-0",style:{zIndex:2,opacity:a?1:0,transition:"opacity 300ms ease",pointerEvents:a?"auto":"none"}},m.createElement("div",{className:"absolute text-white flex gap-2",style:{zIndex:3,top:8,right:8}},m.createElement("button",{className:"cursor-pointer",onClick:e=>{e.stopPropagation(),r(e=>!e)},"aria-label":n?"Unmute":"Mute"},n?m.createElement(ro,{size:20}):m.createElement(no,{size:20})),m.createElement("button",{className:"cursor-pointer",onClick:e=>{null==e||e.stopPropagation(),t()},"aria-label":"Close"},m.createElement(oo,{size:20}))),m.createElement("div",{className:"absolute inset-0 flex items-center justify-center",style:{pointerEvents:"none"}},m.createElement("button",{onClick:e=>{null==e||e.stopPropagation(),i(e=>!e)},"aria-label":o?"Pause":"Play",className:"cursor-pointer text-white p-2 ",style:{pointerEvents:"auto"}},o?m.createElement(Jr,{size:28}):m.createElement(eo,{size:28})))),m.createElement(ld,{shortform:e,mute:n,play:o}))},cd=({shortsId:e,type:t})=>{const{shortform:n}=dc(),[r,o]=h.useState(!1),{playtime:i}=qt(),a=()=>{if(!n)return;o(!0);const{shortsId:e,uuid:t,userId:r}=n;Kt({contentId:e,uuid:t,type:K.SHORTS,playtime:i,userId:r})};return(({shorform:e,playtime:t})=>{h.useEffect(()=>{if(!e)return;const{shortsId:t,shortsUuid:n,userId:r}=e;Xt({contentId:t,uuid:n,type:K.SHORTS,userId:r,isFirstPlay:!Bt(t)})},[]);const n=re();h.useEffect(()=>{if(!e||n)return;const{shortsId:r,uuid:o,userId:i}=e;Kt({contentId:r,uuid:o,type:K.SHORTS,playtime:t,userId:i})},[n])})({shorform:n,playtime:i}),n&&!r&&m.createElement(sd,{minWidth:240,lockAspectRatio:9/16,style:{zIndex:99999},default:{width:240,height:427,x:window.innerWidth-240-50,y:window.innerHeight-427-50},bounds:"window"},"shopping"===t?m.createElement(As,{shortForm:n,handleClose:a}):m.createElement(ud,{shortform:n,setClose:a}))};var dd;!function(e){e[e.PLATFORM=1]="PLATFORM",e[e.GRID=2]="GRID",e[e.VERTICAL=3]="VERTICAL",e[e.HORIZONTAL=4]="HORIZONTAL"}(dd||(dd={}));const fd=un(e=>({liveWidget:null,setLiveWidget:t=>e({liveWidget:t}),nextKey:"",setNextKey:t=>e({nextKey:t}),isFetching:!1,setIsFetching:t=>e({isFetching:t})})),pd=({opacity:e=.4,className:t})=>{const n=Math.max(0,Math.min(1,e));return m.createElement("div",{"aria-hidden":!0,role:"presentation",className:`absolute inset-0 pointer-events-none ${null!=t?t:""}`,style:{backgroundColor:`rgba(0,0,0,${n})`,borderRadius:"inherit"}})},hd=({content:e})=>{const{PLAYER_BASE_URL:t}=It();return m.createElement("iframe",{src:`${t}/live/${e.eventId}`,className:"w-full h-full block",style:{border:0,display:"block"},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,scrolling:"no",referrerPolicy:"no-referrer-when-downgrade"})},md=({content:e,aspectRatio:t="9/16",cursor:n="default",borderRadius:r})=>{var o,i;const{leftTime:a}=(e=>{const{start:t}=e,n=vt().tz("Asia/Seoul").unix(),[r,o]=h.useState(t-n>0?t-n:0);return Yt(()=>{o(r<=0?0:e=>e-1)},1e3),{leftTime:r}})(e),s=null===(i=null===(o=null==e?void 0:e.designInfo)||void 0===o?void 0:o.thumbPath)||void 0===i?void 0:i.preview,l=m.useRef(null),[u,c]=m.useState({primary:24,secondary:14}),[d,f]=m.useState({});m.useEffect(()=>{const e=l.current;if(!e)return;const n=()=>{const n=e.getBoundingClientRect(),r=Math.max(0,Math.floor(n.width)),o=Math.max(0,Math.floor(n.height)),[i,a]=t.includes("/")?t.split("/").map(e=>parseFloat(e)):[1,1],s=a/i;let l,u;r>0&&o>0?(l=r,u=Math.round(l*s),u>o&&(u=o,l=Math.round(u/s)),f({width:l,height:u})):f({});const d="number"==typeof l?l:r,p=Math.max(16,Math.round(.08*d)),h=Math.max(12,Math.round(.045*d));c({primary:p,secondary:h})};if(n(),"undefined"!=typeof ResizeObserver){const t=new ResizeObserver(()=>n());return t.observe(e),()=>t.disconnect()}{const e=()=>n();return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}},[t]);const{PLAYER_BASE_URL:p}=It();return m.createElement("div",{className:"w-full h-full flex items-center justify-center",ref:l},m.createElement("div",{className:"relative rounded overflow-hidden",style:{width:d.width?`${d.width}px`:"100%",height:d.height?`${d.height}px`:"100%",borderRadius:`${null!=r?r:10}px`,backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:d.height?void 0:t,backgroundImage:s?`url(${Ut(s)})`:void 0,backgroundColor:s?void 0:"black"}},1===e.openStatus?m.createElement(m.Fragment,null,m.createElement(hd,{content:e}),m.createElement("a",{href:`${p}/live/${e.eventId}`,target:"_blank",rel:"noopener noreferrer","aria-label":`${e.eventName} 바로가기`,style:{position:"absolute",inset:0,zIndex:30,display:"block",textDecoration:"none",cursor:"pointer",background:"transparent"}})):m.createElement(m.Fragment,null,m.createElement(pd,null),m.createElement("div",{className:"text-white flex flex-col items-center justify-center absolute inset-0",style:{zIndex:10,gap:"20px",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",cursor:n,pointerEvents:"none"}},m.createElement("p",{style:{fontSize:`${u.primary}px`}},((e,t)=>{if(e>86400)return vt.unix(t).tz("Asia/Seoul").format("M월 D일 A h시 mm분");const n=vt.duration(e,"seconds");return`${n.hours().toString().padStart(2,"0")}:${n.minutes().toString().padStart(2,"0")}:${n.seconds().toString().padStart(2,"0")}`})(a,e.start)),m.createElement("p",{style:{fontSize:`${u.secondary}px`}},"곧 라이브가 시작됩니다!")))))},gd=e=>{var t,n,r,o;const{content:i,title:a,aspectRatio:s="9/16",card:l,titleFontSize:u,layout:c}=e,d=null!==(t=null==l?void 0:l.layout)&&void 0!==t?t:"slider",f=null!==(n=null==l?void 0:l.sliderPerView)&&void 0!==n?n:3,p=null!==(r=null==l?void 0:l.gridColumns)&&void 0!==r?r:3,g=null!==(o=null==l?void 0:l.gap)&&void 0!==o?o:12,v=null==l?void 0:l.width,b=v?"auto":f,y=h.useMemo(()=>({fontSize:u?`${u}px`:void 0,fontWeight:600}),[u]);return i&&0!==i.length?m.createElement("div",{className:"flex flex-col w-full",style:{gap:g}},m.createElement("p",{className:"truncate",style:Object.assign(Object.assign({},y),{userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",cursor:"default"})},a||"예정된 라이브"),"slider"===d?m.createElement("div",null,m.createElement(Rr,{slidesPerView:b,spaceBetween:g},i.map(t=>{var n,r;return m.createElement(zr,{key:t.eventId,style:v?{width:`${v}px`}:void 0},m.createElement("a",{href:`https://player.midibus.im/live/${t.eventId}`,target:"_blank",rel:"noopener noreferrer",className:"flex flex-col",style:{gap:6,textDecoration:"none",cursor:"pointer"}},m.createElement(md,{content:t,aspectRatio:s,cursor:"pointer",borderRadius:null==l?void 0:l.borderRadius}),m.createElement("p",{className:"truncate",style:{color:null!==(r=null===(n=e.theme)||void 0===n?void 0:n.textColor)&&void 0!==r?r:"black",fontSize:14,userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"}},t.eventName)))}))):m.createElement("div",{style:{overflowY:"auto"}},m.createElement("div",{style:{display:"grid",gridTemplateColumns:`repeat(${p}, minmax(0, 1fr))`,gap:g}},i.map(t=>{var n,r;return m.createElement("a",{key:t.eventId,href:`https://player.midibus.im/live/${t.eventId}`,target:"_blank",rel:"noopener noreferrer",className:"flex flex-col",style:{gap:6,textDecoration:"none",cursor:"pointer"}},m.createElement(md,{content:t,aspectRatio:s,cursor:"pointer",borderRadius:null==l?void 0:l.borderRadius}),m.createElement("p",{className:"truncate",style:{color:null!==(r=null===(n=e.theme)||void 0===n?void 0:n.textColor)&&void 0!==r?r:"black",fontSize:14,userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"}},t.eventName))})))):null};var vd;!function(e){e[e.READY=1]="READY",e[e.STREAMING=2]="STREAMING",e[e.PAUSED=3]="PAUSED"}(vd||(vd={}));const bd=({content:e})=>{const t=m.useMemo(()=>vt(e.start).tz("Asia/Seoul").format("M월 D일 A HH:mm"),[e.start]),n=e.eventStatus!==vd.READY;return m.createElement("div",{className:"flex-1 flex flex-col gap-5 items-center justify-center"},m.createElement("p",{style:{fontWeight:"bold",fontSize:"24px"}},e.eventName),!n&&m.createElement("p",null,t),m.createElement("button",{onClick:()=>{window.open(`https://player.midibus.im/live/${e.eventId}`,"_blank")},className:"rounded bg-black text-white cursor-pointer",style:{width:"70%",padding:"10px"}},"라이브 입장하기"))},yd=e=>{var t,n;const{content:r,aspectRatio:o="9/16",videoAlign:i}=e,a=null===(t=e.card)||void 0===t?void 0:t.borderRadius,s=null===(n=e.card)||void 0===n?void 0:n.width,{PLAYER_BASE_URL:l}=It();return m.createElement("div",{className:"flex w-full h-full items-center justify-center"},"only"===i?m.createElement("a",{className:"w-full h-full",href:`${l}/live/${r.eventId}`,target:"_blank",rel:"noopener noreferrer",style:s?{width:`${s}px`}:void 0},m.createElement(md,{content:r,aspectRatio:o,borderRadius:a,cursor:"pointer"})):"left"===i?m.createElement(m.Fragment,null,m.createElement("div",{className:"flex-1"},m.createElement("a",{href:`${l}/live/${r.eventId}`,target:"_blank",rel:"noopener noreferrer",style:s?{width:`${s}px`}:void 0},m.createElement(md,{content:r,aspectRatio:o,borderRadius:a,cursor:"pointer"}))),m.createElement(bd,{content:r})):m.createElement(m.Fragment,null,m.createElement(bd,{content:r}),m.createElement("div",{className:"flex-1"},m.createElement("a",{href:`${l}/live/${r.eventId}`,target:"_blank",rel:"noopener noreferrer",style:s?{width:`${s}px`}:void 0},m.createElement(md,{content:r,aspectRatio:o,borderRadius:a,cursor:"pointer"})))))},wd=e=>{var t;const{theme:n,titleFontSize:r,title:o}=e;return m.createElement("div",{className:"w-full h-full flex flex-col",style:{color:null!==(t=null==n?void 0:n.textColor)&&void 0!==t?t:"#252525"}},m.createElement("p",{style:Object.assign(Object.assign({},r&&{fontSize:r}),{fontWeight:"bold",color:null==n?void 0:n.textColor,paddingTop:"10px",paddingBottom:"10px",marginBottom:"30px"})},o," 라이브 제목"),m.createElement("div",{className:"self-center text-center h-full flex flex-col items-center justify-center",style:{minHeight:"200px"}},m.createElement("p",{style:{fontSize:"20px",marginBottom:"10px"}},"예정된 라이브가 없어요."),m.createElement("span",{style:{fontWeight:"lighter"}},"곧 혜택 가득한 라이브로 찾아올게요!")))},xd=e=>{var t,n,r,o;const{widgetType:i,theme:a,layout:s}=e,{liveWidget:l}=fd(),u=null!==(t=null==s?void 0:s.paddingTop)&&void 0!==t?t:0,c=null!==(n=null==s?void 0:s.paddingBottom)&&void 0!==n?n:0,d=null!==(r=null==s?void 0:s.paddingLeft)&&void 0!==r?r:0,f=null!==(o=null==s?void 0:s.paddingRight)&&void 0!==o?o:0;return l&&0!==l.length?m.createElement("div",{className:"w-full h-full",style:{backgroundColor:null==a?void 0:a.backgroundColor,color:null==a?void 0:a.textColor,paddingTop:u,paddingBottom:c,paddingLeft:d,paddingRight:f}},"ONE"===i?m.createElement(yd,Object.assign({content:l[0]},e)):m.createElement(gd,Object.assign({content:l},e))):m.createElement(wd,Object.assign({},e))},Sd=()=>{const[e,t]=h.useState("");return h.useEffect(()=>{J(void 0,void 0,void 0,function*(){function e(e){return J(this,void 0,void 0,function*(){const t=yield fetch(e);if(!t.ok)throw new Error(String(t.status));return t.text()})}let n="";try{n+=(yield e("https://unpkg.com/@kinxcdn/commerce-player@latest/dist/styles.css"))}catch(t){n+=(yield e("https://mbus-player-sy.s3.ap-northeast-2.amazonaws.com/styles.css"))}t(n)}).catch(()=>console.error("Failed to load styles.css"))},[]),{cssText:e}},Ed=j(e=>{const[t,n]=h.useState("");h.useEffect(()=>{J(void 0,void 0,void 0,function*(){function e(e){return J(this,void 0,void 0,function*(){const t=yield fetch(e);if(!t.ok)throw new Error(String(t.status));return t.text()})}let t="";try{t=yield e("https://unpkg.com/@kinxcdn/commerce-player@latest/dist/styles.css")}catch(n){t=yield e("https://mbus-player-sy.s3.ap-northeast-2.amazonaws.com/styles.css")}n(t)}).catch(()=>console.error("Failed to load styles.css"))},[]);const{container:r}=sc({cssHref:"https://unpkg.com/@kinxcdn/commerce-player@latest/dist/styles.css"});return r&&t?m.createElement(fn,null,m.createElement(lc,Object.assign({},e,{container:r,cssText:t}))):null},{props:{collectionId:"string",iconForm:"string",iconShape:"string",iconSize:"number",borderLine:"string",exposeTitle:"boolean",titlePosition:"string",player:"string",rounded:"boolean",exposeProductBanner:"boolean",exposeProductBadge:"boolean",priceText:"string",iconRatio:"string",hoverPlay:"boolean",thumbnailAutoPlay:"boolean"}}),kd=j(e=>{const[t,n]=h.useState("");h.useEffect(()=>{J(void 0,void 0,void 0,function*(){function e(e){return J(this,void 0,void 0,function*(){const t=yield fetch(e);if(!t.ok)throw new Error(String(t.status));return t.text()})}let t="";try{t+=(yield e("https://unpkg.com/@kinxcdn/commerce-player@latest/dist/styles.css"))}catch(n){t+=(yield e("https://mbus-player-sy.s3.ap-northeast-2.amazonaws.com/styles.css"))}n(t)}).catch(()=>console.error("Failed to load styles.css"))},[]);const{container:r}=sc({cssHref:"https://unpkg.com/@kinxcdn/commerce-player@latest/dist/styles.css"});return r&&t?m.createElement(fn,null,m.createElement(cc,Object.assign({},e,{container:r,cssText:t}))):null},{props:{collectionId:"string",aspectRatio:"string"}}),Cd=j(({shortsId:e,type:t,isPreview:n})=>{const{setShortform:r,shortform:o}=dc();h.useEffect(()=>{if(!e)return;e&&J(void 0,void 0,void 0,function*(){const t=yield tn(e,n);t&&r(Object.assign(Object.assign({},t),{uuid:jt()}))})},[e]);const[i,a]=h.useState("");h.useEffect(()=>{J(void 0,void 0,void 0,function*(){function e(e){return J(this,void 0,void 0,function*(){const t=yield fetch(e);if(!t.ok)throw new Error(String(t.status));return t.text()})}let t="";try{t=yield e("https://unpkg.com/@kinxcdn/commerce-player@latest/dist/styles.css")}catch(n){t=yield e("https://mbus-player-sy.s3.ap-northeast-2.amazonaws.com/styles.css")}a(t)}).catch(()=>console.error("Failed to load styles.css"))},[]);const{container:s}=sc({cssHref:"https://unpkg.com/@kinxcdn/commerce-player@latest/dist/styles.css"});return s&&i&&o&&m.createElement(ac.div,null,m.createElement("style",null,i),m.createElement("div",null,m.createElement(cd,{shortsId:e,type:t})))},{props:{shortsId:"string",type:"string"}}),Td=j(e=>{const{cssText:t}=Sd(),{setLiveWidget:n,liveWidget:r}=fd(),{userId:o,card:i,includeRepresentative:a}=e;return h.useEffect(()=>{if(!o)return;if(r&&(null==i?void 0:i.visibleCount)&&r.length>Number(i.visibleCount))return void n(r.slice(0,null==i?void 0:i.visibleCount));J(void 0,void 0,void 0,function*(){const e=yield nn(o,null==i?void 0:i.visibleCount);e&&n(a?e.slice(0,(null==i?void 0:i.visibleCount)||5):e.slice(1,(null==i?void 0:i.visibleCount)||5))})},[o,null==i?void 0:i.visibleCount]),t?m.createElement(ac.div,{className:"w-full h-full"},m.createElement("style",null,t),m.createElement(xd,Object.assign({},e))):null},{props:{userId:"string",title:"string",titleFontSize:"number",isPreview:"boolean",liveType:"string",widgetType:"string",videoAlign:"string",aspectRatio:"string",playback:"string",includeRepresentative:"boolean",theme:"json",layout:"json",card:"json",sorting:"string"}});customElements.define("mc-widget-player",Ed),customElements.define("mc-collection-showcase",kd),customElements.define("mc-floating-player",Cd),customElements.define("mc-live-widget",Td)});
44
+ */function Fu(){if(Mu)return Nu;Mu=1;var e=l();function t(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=null,n=0;function i(e,t){if(0!==t.length)if(512<t.length)0<n&&(e.enqueue(new Uint8Array(r.buffer,0,n)),r=new Uint8Array(512),n=0),e.enqueue(t);else{var i=r.length-n;i<t.length&&(0===i?e.enqueue(r):(r.set(t.subarray(0,i),n),e.enqueue(r),t=t.subarray(i)),r=new Uint8Array(512),n=0),r.set(t,n),n+=t.length}}function s(e,t){return i(e,t),!0}function a(e){r&&0<n&&(e.enqueue(new Uint8Array(r.buffer,0,n)),r=null,n=0)}var o=new TextEncoder;function u(e){return o.encode(e)}function c(e){return o.encode(e)}function d(e,t){"function"==typeof e.error?e.error(t):e.close()}var h=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},g={};function m(e){return!!h.call(g,e)||!h.call(p,e)&&(f.test(e)?g[e]=!0:(p[e]=!0,!1))}function v(e,t,r,n,i,s,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=a}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){y[e]=new v(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function w(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(b,w);y[t]=new v(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(b,w);y[t]=new v(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(b,w);y[t]=new v(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});var E={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},S=["Webkit","ms","Moz","O"];Object.keys(E).forEach(function(e){S.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),E[t]=E[e]})});var T=/["'&<>]/;function k(e){if("boolean"==typeof e||"number"==typeof e)return""+e;e=""+e;var t=T.exec(e);if(t){var r,n="",i=0;for(r=t.index;r<e.length;r++){switch(e.charCodeAt(r)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#x27;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}i!==r&&(n+=e.substring(i,r)),i=r+1,n+=t}e=i!==r?n+e.substring(i,r):n}return e}var x=/([A-Z])/g,A=/^ms-/,R=Array.isArray,L=c("<script>"),I=c("<\/script>"),C=c('<script src="'),P=c('<script type="module" src="'),D=c('" async=""><\/script>'),_=/(<\/|<)(s)(cript)/gi;function M(e,t,r,n){return t+("s"===r?"\\u0073":"\\u0053")+n}function O(e,t){return{insertionMode:e,selectedValue:t}}var N=c("\x3c!-- --\x3e");function F(e,t,r,n){return""===t?n:(n&&e.push(N),e.push(u(k(t))),!0)}var $=new Map,B=c(' style="'),U=c(":"),z=c(";");function j(e,r,n){if("object"!=typeof n)throw Error(t(62));for(var i in r=!0,n)if(h.call(n,i)){var s=n[i];if(null!=s&&"boolean"!=typeof s&&""!==s){if(0===i.indexOf("--")){var a=u(k(i));s=u(k((""+s).trim()))}else{a=i;var o=$.get(a);void 0!==o||(o=c(k(a.replace(x,"-$1").toLowerCase().replace(A,"-ms-"))),$.set(a,o)),a=o,s="number"==typeof s?0===s||h.call(E,i)?u(""+s):u(s+"px"):u(k((""+s).trim()))}r?(r=!1,e.push(B,a,U,s)):e.push(z,a,U,s)}}r||e.push(V)}var G=c(" "),H=c('="'),V=c('"'),W=c('=""');function K(e,t,r,n){switch(r){case"style":return void j(e,t,n);case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":return}if(!(2<r.length)||"o"!==r[0]&&"O"!==r[0]||"n"!==r[1]&&"N"!==r[1])if(null!==(t=y.hasOwnProperty(r)?y[r]:null)){switch(typeof n){case"function":case"symbol":return;case"boolean":if(!t.acceptsBooleans)return}switch(r=u(t.attributeName),t.type){case 3:n&&e.push(G,r,W);break;case 4:!0===n?e.push(G,r,W):!1!==n&&e.push(G,r,H,u(k(n)),V);break;case 5:isNaN(n)||e.push(G,r,H,u(k(n)),V);break;case 6:!isNaN(n)&&1<=n&&e.push(G,r,H,u(k(n)),V);break;default:t.sanitizeURL&&(n=""+n),e.push(G,r,H,u(k(n)),V)}}else if(m(r)){switch(typeof n){case"function":case"symbol":return;case"boolean":if("data-"!==(t=r.toLowerCase().slice(0,5))&&"aria-"!==t)return}e.push(G,u(r),H,u(k(n)),V)}}var Y=c(">"),q=c("/>");function X(e,r,n){if(null!=r){if(null!=n)throw Error(t(60));if("object"!=typeof r||!("__html"in r))throw Error(t(61));null!=(r=r.__html)&&e.push(u(""+r))}}var Q=c(' selected=""');function Z(e,t,r,n){e.push(re(r));var i,s=r=null;for(i in t)if(h.call(t,i)){var a=t[i];if(null!=a)switch(i){case"children":r=a;break;case"dangerouslySetInnerHTML":s=a;break;default:K(e,n,i,a)}}return e.push(Y),X(e,s,r),"string"==typeof r?(e.push(u(k(r))),null):r}var J=c("\n"),ee=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,te=new Map;function re(e){var r=te.get(e);if(void 0===r){if(!ee.test(e))throw Error(t(65,e));r=c("<"+e),te.set(e,r)}return r}var ne=c("<!DOCTYPE html>");function ie(r,n,i,s,a){switch(n){case"select":r.push(re("select"));var o=null,l=null;for(p in i)if(h.call(i,p)){var c=i[p];if(null!=c)switch(p){case"children":o=c;break;case"dangerouslySetInnerHTML":l=c;break;case"defaultValue":case"value":break;default:K(r,s,p,c)}}return r.push(Y),X(r,l,o),o;case"option":l=a.selectedValue,r.push(re("option"));var d=c=null,f=null,p=null;for(o in i)if(h.call(i,o)){var g=i[o];if(null!=g)switch(o){case"children":c=g;break;case"selected":f=g;break;case"dangerouslySetInnerHTML":p=g;break;case"value":d=g;default:K(r,s,o,g)}}if(null!=l)if(i=null!==d?""+d:function(t){var r="";return e.Children.forEach(t,function(e){null!=e&&(r+=e)}),r}(c),R(l)){for(s=0;s<l.length;s++)if(""+l[s]===i){r.push(Q);break}}else""+l===i&&r.push(Q);else f&&r.push(Q);return r.push(Y),X(r,p,c),c;case"textarea":for(c in r.push(re("textarea")),p=l=o=null,i)if(h.call(i,c)&&null!=(d=i[c]))switch(c){case"children":p=d;break;case"value":o=d;break;case"defaultValue":l=d;break;case"dangerouslySetInnerHTML":throw Error(t(91));default:K(r,s,c,d)}if(null===o&&null!==l&&(o=l),r.push(Y),null!=p){if(null!=o)throw Error(t(92));if(R(p)&&1<p.length)throw Error(t(93));o=""+p}return"string"==typeof o&&"\n"===o[0]&&r.push(J),null!==o&&r.push(u(k(""+o))),null;case"input":for(l in r.push(re("input")),d=p=c=o=null,i)if(h.call(i,l)&&null!=(f=i[l]))switch(l){case"children":case"dangerouslySetInnerHTML":throw Error(t(399,"input"));case"defaultChecked":d=f;break;case"defaultValue":c=f;break;case"checked":p=f;break;case"value":o=f;break;default:K(r,s,l,f)}return null!==p?K(r,s,"checked",p):null!==d&&K(r,s,"checked",d),null!==o?K(r,s,"value",o):null!==c&&K(r,s,"value",c),r.push(q),null;case"menuitem":for(var v in r.push(re("menuitem")),i)if(h.call(i,v)&&null!=(o=i[v]))switch(v){case"children":case"dangerouslySetInnerHTML":throw Error(t(400));default:K(r,s,v,o)}return r.push(Y),null;case"title":for(g in r.push(re("title")),o=null,i)if(h.call(i,g)&&null!=(l=i[g]))switch(g){case"children":o=l;break;case"dangerouslySetInnerHTML":throw Error(t(434));default:K(r,s,g,l)}return r.push(Y),o;case"listing":case"pre":for(d in r.push(re(n)),l=o=null,i)if(h.call(i,d)&&null!=(c=i[d]))switch(d){case"children":o=c;break;case"dangerouslySetInnerHTML":l=c;break;default:K(r,s,d,c)}if(r.push(Y),null!=l){if(null!=o)throw Error(t(60));if("object"!=typeof l||!("__html"in l))throw Error(t(61));null!=(i=l.__html)&&("string"==typeof i&&0<i.length&&"\n"===i[0]?r.push(J,u(i)):r.push(u(""+i)))}return"string"==typeof o&&"\n"===o[0]&&r.push(J),o;case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":for(var y in r.push(re(n)),i)if(h.call(i,y)&&null!=(o=i[y]))switch(y){case"children":case"dangerouslySetInnerHTML":throw Error(t(399,n));default:K(r,s,y,o)}return r.push(q),null;case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return Z(r,i,n,s);case"html":return 0===a.insertionMode&&r.push(ne),Z(r,i,n,s);default:if(-1===n.indexOf("-")&&"string"!=typeof i.is)return Z(r,i,n,s);for(f in r.push(re(n)),l=o=null,i)if(h.call(i,f)&&null!=(c=i[f]))switch(f){case"children":o=c;break;case"dangerouslySetInnerHTML":l=c;break;case"style":j(r,s,c);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:m(f)&&"function"!=typeof c&&"symbol"!=typeof c&&r.push(G,u(f),H,u(k(c)),V)}return r.push(Y),X(r,l,o),o}}var se=c("</"),ae=c(">"),oe=c('<template id="'),le=c('"></template>'),ue=c("\x3c!--$--\x3e"),ce=c('\x3c!--$?--\x3e<template id="'),de=c('"></template>'),he=c("\x3c!--$!--\x3e"),fe=c("\x3c!--/$--\x3e"),pe=c("<template"),ge=c('"'),me=c(' data-dgst="');c(' data-msg="'),c(' data-stck="');var ve=c("></template>");function ye(e,r,n){if(i(e,ce),null===n)throw Error(t(395));return i(e,n),s(e,de)}var be=c('<div hidden id="'),we=c('">'),Ee=c("</div>"),Se=c('<svg aria-hidden="true" style="display:none" id="'),Te=c('">'),ke=c("</svg>"),xe=c('<math aria-hidden="true" style="display:none" id="'),Ae=c('">'),Re=c("</math>"),Le=c('<table hidden id="'),Ie=c('">'),Ce=c("</table>"),Pe=c('<table hidden><tbody id="'),De=c('">'),_e=c("</tbody></table>"),Me=c('<table hidden><tr id="'),Oe=c('">'),Ne=c("</tr></table>"),Fe=c('<table hidden><colgroup id="'),$e=c('">'),Be=c("</colgroup></table>");var Ue=c('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'),ze=c('$RS("'),je=c('","'),Ge=c('")<\/script>'),He=c('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("'),Ve=c('$RC("'),We=c('","'),Ke=c('")<\/script>'),Ye=c('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("'),qe=c('$RX("'),Xe=c('"'),Qe=c(")<\/script>"),Ze=c(","),Je=/[<\u2028\u2029]/g;function et(e){return JSON.stringify(e).replace(Je,function(e){switch(e){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}})}var tt=Object.assign,rt=Symbol.for("react.element"),nt=Symbol.for("react.portal"),it=Symbol.for("react.fragment"),st=Symbol.for("react.strict_mode"),at=Symbol.for("react.profiler"),ot=Symbol.for("react.provider"),lt=Symbol.for("react.context"),ut=Symbol.for("react.forward_ref"),ct=Symbol.for("react.suspense"),dt=Symbol.for("react.suspense_list"),ht=Symbol.for("react.memo"),ft=Symbol.for("react.lazy"),pt=Symbol.for("react.scope"),gt=Symbol.for("react.debug_trace_mode"),mt=Symbol.for("react.legacy_hidden"),vt=Symbol.for("react.default_value"),yt=Symbol.iterator;function bt(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case it:return"Fragment";case nt:return"Portal";case at:return"Profiler";case st:return"StrictMode";case ct:return"Suspense";case dt:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case lt:return(e.displayName||"Context")+".Consumer";case ot:return(e._context.displayName||"Context")+".Provider";case ut:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case ht:return null!==(t=e.displayName||null)?t:bt(e.type)||"Memo";case ft:t=e._payload,e=e._init;try{return bt(e(t))}catch(e){}}return null}var wt={};function Et(e,t){if(!(e=e.contextTypes))return wt;var r,n={};for(r in e)n[r]=t[r];return n}var St=null;function Tt(e,r){if(e!==r){e.context._currentValue=e.parentValue,e=e.parent;var n=r.parent;if(null===e){if(null!==n)throw Error(t(401))}else{if(null===n)throw Error(t(401));Tt(e,n)}r.context._currentValue=r.value}}function kt(e){e.context._currentValue=e.parentValue,null!==(e=e.parent)&&kt(e)}function xt(e){var t=e.parent;null!==t&&xt(t),e.context._currentValue=e.value}function At(e,r){if(e.context._currentValue=e.parentValue,null===(e=e.parent))throw Error(t(402));e.depth===r.depth?Tt(e,r):At(e,r)}function Rt(e,r){var n=r.parent;if(null===n)throw Error(t(402));e.depth===n.depth?Tt(e,n):Rt(e,n),r.context._currentValue=r.value}function Lt(e){var t=St;t!==e&&(null===t?xt(e):null===e?kt(t):t.depth===e.depth?Tt(t,e):t.depth>e.depth?At(t,e):Rt(t,e),St=e)}var It={isMounted:function(){return!1},enqueueSetState:function(e,t){null!==(e=e._reactInternals).queue&&e.queue.push(t)},enqueueReplaceState:function(e,t){(e=e._reactInternals).replace=!0,e.queue=[t]},enqueueForceUpdate:function(){}};function Ct(e,t,r,n){var i=void 0!==e.state?e.state:null;e.updater=It,e.props=r,e.state=i;var s={queue:[],replace:!1};e._reactInternals=s;var a=t.contextType;if(e.context="object"==typeof a&&null!==a?a._currentValue:n,"function"==typeof(a=t.getDerivedStateFromProps)&&(i=null==(a=a(r,i))?i:tt({},i,a),e.state=i),"function"!=typeof t.getDerivedStateFromProps&&"function"!=typeof e.getSnapshotBeforeUpdate&&("function"==typeof e.UNSAFE_componentWillMount||"function"==typeof e.componentWillMount))if(t=e.state,"function"==typeof e.componentWillMount&&e.componentWillMount(),"function"==typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),t!==e.state&&It.enqueueReplaceState(e,e.state,null),null!==s.queue&&0<s.queue.length)if(t=s.queue,a=s.replace,s.queue=null,s.replace=!1,a&&1===t.length)e.state=t[0];else{for(s=a?t[0]:e.state,i=!0,a=a?1:0;a<t.length;a++){var o=t[a];null!=(o="function"==typeof o?o.call(e,s,r,n):o)&&(i?(i=!1,s=tt({},s,o)):tt(s,o))}e.state=s}else s.queue=null}var Pt={id:1,overflow:""};function Dt(e,t,r){var n=e.id;e=e.overflow;var i=32-_t(n)-1;n&=~(1<<i),r+=1;var s=32-_t(t)+i;if(30<s){var a=i-i%5;return s=(n&(1<<a)-1).toString(32),n>>=a,i-=a,{id:1<<32-_t(t)+i|r<<i|n,overflow:s+e}}return{id:1<<s|r<<i|n,overflow:e}}var _t=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(Mt(e)/Ot|0)|0},Mt=Math.log,Ot=Math.LN2;var Nt="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},Ft=null,$t=null,Bt=null,Ut=null,zt=!1,jt=!1,Gt=0,Ht=null,Vt=0;function Wt(){if(null===Ft)throw Error(t(321));return Ft}function Kt(){if(0<Vt)throw Error(t(312));return{memoizedState:null,queue:null,next:null}}function Yt(){return null===Ut?null===Bt?(zt=!1,Bt=Ut=Kt()):(zt=!0,Ut=Bt):null===Ut.next?(zt=!1,Ut=Ut.next=Kt()):(zt=!0,Ut=Ut.next),Ut}function qt(){$t=Ft=null,jt=!1,Bt=null,Vt=0,Ut=Ht=null}function Xt(e,t){return"function"==typeof t?t(e):t}function Qt(e,t,r){if(Ft=Wt(),Ut=Yt(),zt){var n=Ut.queue;if(t=n.dispatch,null!==Ht&&void 0!==(r=Ht.get(n))){Ht.delete(n),n=Ut.memoizedState;do{n=e(n,r.action),r=r.next}while(null!==r);return Ut.memoizedState=n,[n,t]}return[Ut.memoizedState,t]}return e=e===Xt?"function"==typeof t?t():t:void 0!==r?r(t):t,Ut.memoizedState=e,e=(e=Ut.queue={last:null,dispatch:null}).dispatch=Jt.bind(null,Ft,e),[Ut.memoizedState,e]}function Zt(e,t){if(Ft=Wt(),t=void 0===t?null:t,null!==(Ut=Yt())){var r=Ut.memoizedState;if(null!==r&&null!==t){var n=r[1];e:if(null===n)n=!1;else{for(var i=0;i<n.length&&i<t.length;i++)if(!Nt(t[i],n[i])){n=!1;break e}n=!0}if(n)return r[0]}}return e=e(),Ut.memoizedState=[e,t],e}function Jt(e,r,n){if(25<=Vt)throw Error(t(301));if(e===Ft)if(jt=!0,e={action:n,next:null},null===Ht&&(Ht=new Map),void 0===(n=Ht.get(r)))Ht.set(r,e);else{for(r=n;null!==r.next;)r=r.next;r.next=e}}function er(){throw Error(t(394))}function tr(){}var rr={readContext:function(e){return e._currentValue},useContext:function(e){return Wt(),e._currentValue},useMemo:Zt,useReducer:Qt,useRef:function(e){Ft=Wt();var t=(Ut=Yt()).memoizedState;return null===t?(e={current:e},Ut.memoizedState=e):t},useState:function(e){return Qt(Xt,e)},useInsertionEffect:tr,useLayoutEffect:function(){},useCallback:function(e,t){return Zt(function(){return e},t)},useImperativeHandle:tr,useEffect:tr,useDebugValue:tr,useDeferredValue:function(e){return Wt(),e},useTransition:function(){return Wt(),[!1,er]},useId:function(){var e=$t.treeContext,r=e.overflow;e=((e=e.id)&~(1<<32-_t(e)-1)).toString(32)+r;var n=nr;if(null===n)throw Error(t(404));return r=Gt++,e=":"+n.idPrefix+"R"+e,0<r&&(e+="H"+r.toString(32)),e+":"},useMutableSource:function(e,t){return Wt(),t(e._source)},useSyncExternalStore:function(e,r,n){if(void 0===n)throw Error(t(407));return n()}},nr=null,ir=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;function sr(e){return console.error(e),null}function ar(){}function or(e,t,r,n,i,s,a,o){e.allPendingTasks++,null===r?e.pendingRootTasks++:r.pendingTasks++;var l={node:t,ping:function(){var t=e.pingedTasks;t.push(l),1===t.length&&Sr(e)},blockedBoundary:r,blockedSegment:n,abortSet:i,legacyContext:s,context:a,treeContext:o};return i.add(l),l}function lr(e,t,r,n,i,s){return{status:0,id:-1,index:t,parentFlushed:!1,chunks:[],children:[],formatContext:n,boundary:r,lastPushedText:i,textEmbedded:s}}function ur(e,t){if(null!=(e=e.onError(t))&&"string"!=typeof e)throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof e+'" instead');return e}function cr(e,t){var r=e.onShellError;r(t),(r=e.onFatalError)(t),null!==e.destination?(e.status=2,d(e.destination,t)):(e.status=1,e.fatalError=t)}function dr(e,t,r,n,i){for(Ft={},$t=t,Gt=0,e=r(n,i);jt;)jt=!1,Gt=0,Vt+=1,Ut=null,e=r(n,i);return qt(),e}function hr(e,r,n,i){var s=n.render(),a=i.childContextTypes;if(null!=a){var o=r.legacyContext;if("function"!=typeof n.getChildContext)i=o;else{for(var l in n=n.getChildContext())if(!(l in a))throw Error(t(108,bt(i)||"Unknown",l));i=tt({},o,n)}r.legacyContext=i,gr(e,r,s),r.legacyContext=o}else gr(e,r,s)}function fr(e,t){if(e&&e.defaultProps){for(var r in t=tt({},t),e=e.defaultProps)void 0===t[r]&&(t[r]=e[r]);return t}return t}function pr(e,r,n,i,s){if("function"==typeof n)if(n.prototype&&n.prototype.isReactComponent){s=Et(n,r.legacyContext);var a=n.contextType;Ct(a=new n(i,"object"==typeof a&&null!==a?a._currentValue:s),n,i,s),hr(e,r,a,n)}else{s=dr(e,r,n,i,a=Et(n,r.legacyContext));var o=0!==Gt;if("object"==typeof s&&null!==s&&"function"==typeof s.render&&void 0===s.$$typeof)Ct(s,n,i,a),hr(e,r,s,n);else if(o){i=r.treeContext,r.treeContext=Dt(i,1,0);try{gr(e,r,s)}finally{r.treeContext=i}}else gr(e,r,s)}else{if("string"!=typeof n){switch(n){case mt:case gt:case st:case at:case it:case dt:return void gr(e,r,i.children);case pt:throw Error(t(343));case ct:e:{n=r.blockedBoundary,s=r.blockedSegment,a=i.fallback,i=i.children;var l={id:null,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:o=new Set,errorDigest:null},c=lr(0,s.chunks.length,l,s.formatContext,!1,!1);s.children.push(c),s.lastPushedText=!1;var d=lr(0,0,null,s.formatContext,!1,!1);d.parentFlushed=!0,r.blockedBoundary=l,r.blockedSegment=d;try{if(vr(e,r,i),d.lastPushedText&&d.textEmbedded&&d.chunks.push(N),d.status=1,wr(l,d),0===l.pendingTasks)break e}catch(t){d.status=4,l.forceClientRender=!0,l.errorDigest=ur(e,t)}finally{r.blockedBoundary=n,r.blockedSegment=s}r=or(e,a,n,c,o,r.legacyContext,r.context,r.treeContext),e.pingedTasks.push(r)}return}if("object"==typeof n&&null!==n)switch(n.$$typeof){case ut:if(i=dr(e,r,n.render,i,s),0!==Gt){n=r.treeContext,r.treeContext=Dt(n,1,0);try{gr(e,r,i)}finally{r.treeContext=n}}else gr(e,r,i);return;case ht:return void pr(e,r,n=n.type,i=fr(n,i),s);case ot:if(s=i.children,n=n._context,i=i.value,a=n._currentValue,n._currentValue=i,St=i={parent:o=St,depth:null===o?0:o.depth+1,context:n,parentValue:a,value:i},r.context=i,gr(e,r,s),null===(e=St))throw Error(t(403));return i=e.parentValue,e.context._currentValue=i===vt?e.context._defaultValue:i,e=St=e.parent,void(r.context=e);case lt:return void gr(e,r,i=(i=i.children)(n._currentValue));case ft:return void pr(e,r,n=(s=n._init)(n._payload),i=fr(n,i),void 0)}throw Error(t(130,null==n?n:typeof n,""))}switch(a=ie((s=r.blockedSegment).chunks,n,i,e.responseState,s.formatContext),s.lastPushedText=!1,o=s.formatContext,s.formatContext=function(e,t,r){switch(t){case"select":return O(1,null!=r.value?r.value:r.defaultValue);case"svg":return O(2,null);case"math":return O(3,null);case"foreignObject":return O(1,null);case"table":return O(4,null);case"thead":case"tbody":case"tfoot":return O(5,null);case"colgroup":return O(7,null);case"tr":return O(6,null)}return 4<=e.insertionMode||0===e.insertionMode?O(1,null):e}(o,n,i),vr(e,r,a),s.formatContext=o,n){case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break;default:s.chunks.push(se,u(n),ae)}s.lastPushedText=!1}}function gr(e,r,n){if(r.node=n,"object"==typeof n&&null!==n){switch(n.$$typeof){case rt:return void pr(e,r,n.type,n.props,n.ref);case nt:throw Error(t(257));case ft:var i=n._init;return void gr(e,r,n=i(n._payload))}if(R(n))return void mr(e,r,n);if(null===n||"object"!=typeof n?i=null:i="function"==typeof(i=yt&&n[yt]||n["@@iterator"])?i:null,i&&(i=i.call(n))){if(!(n=i.next()).done){var s=[];do{s.push(n.value),n=i.next()}while(!n.done);mr(e,r,s)}return}throw e=Object.prototype.toString.call(n),Error(t(31,"[object Object]"===e?"object with keys {"+Object.keys(n).join(", ")+"}":e))}"string"==typeof n?(i=r.blockedSegment).lastPushedText=F(r.blockedSegment.chunks,n,e.responseState,i.lastPushedText):"number"==typeof n&&((i=r.blockedSegment).lastPushedText=F(r.blockedSegment.chunks,""+n,e.responseState,i.lastPushedText))}function mr(e,t,r){for(var n=r.length,i=0;i<n;i++){var s=t.treeContext;t.treeContext=Dt(s,n,i);try{vr(e,t,r[i])}finally{t.treeContext=s}}}function vr(e,t,r){var n=t.blockedSegment.formatContext,i=t.legacyContext,s=t.context;try{return gr(e,t,r)}catch(l){if(qt(),"object"!=typeof l||null===l||"function"!=typeof l.then)throw t.blockedSegment.formatContext=n,t.legacyContext=i,t.context=s,Lt(s),l;r=l;var a=t.blockedSegment,o=lr(0,a.chunks.length,null,a.formatContext,a.lastPushedText,!0);a.children.push(o),a.lastPushedText=!1,e=or(e,t.node,t.blockedBoundary,o,t.abortSet,t.legacyContext,t.context,t.treeContext).ping,r.then(e,e),t.blockedSegment.formatContext=n,t.legacyContext=i,t.context=s,Lt(s)}}function yr(e){var t=e.blockedBoundary;(e=e.blockedSegment).status=3,Er(this,t,e)}function br(e,r,n){var i=e.blockedBoundary;e.blockedSegment.status=3,null===i?(r.allPendingTasks--,2!==r.status&&(r.status=2,null!==r.destination&&r.destination.close())):(i.pendingTasks--,i.forceClientRender||(i.forceClientRender=!0,e=void 0===n?Error(t(432)):n,i.errorDigest=r.onError(e),i.parentFlushed&&r.clientRenderedBoundaries.push(i)),i.fallbackAbortableTasks.forEach(function(e){return br(e,r,n)}),i.fallbackAbortableTasks.clear(),r.allPendingTasks--,0===r.allPendingTasks&&(i=r.onAllReady)())}function wr(e,t){if(0===t.chunks.length&&1===t.children.length&&null===t.children[0].boundary){var r=t.children[0];r.id=t.id,r.parentFlushed=!0,1===r.status&&wr(e,r)}else e.completedSegments.push(t)}function Er(e,r,n){if(null===r){if(n.parentFlushed){if(null!==e.completedRootSegment)throw Error(t(389));e.completedRootSegment=n}e.pendingRootTasks--,0===e.pendingRootTasks&&(e.onShellError=ar,(r=e.onShellReady)())}else r.pendingTasks--,r.forceClientRender||(0===r.pendingTasks?(n.parentFlushed&&1===n.status&&wr(r,n),r.parentFlushed&&e.completedBoundaries.push(r),r.fallbackAbortableTasks.forEach(yr,e),r.fallbackAbortableTasks.clear()):n.parentFlushed&&1===n.status&&(wr(r,n),1===r.completedSegments.length&&r.parentFlushed&&e.partialBoundaries.push(r)));e.allPendingTasks--,0===e.allPendingTasks&&(e=e.onAllReady)()}function Sr(e){if(2!==e.status){var t=St,r=ir.current;ir.current=rr;var n=nr;nr=e.responseState;try{var i,s=e.pingedTasks;for(i=0;i<s.length;i++){var a=s[i],o=e,l=a.blockedSegment;if(0===l.status){Lt(a.context);try{gr(o,a,a.node),l.lastPushedText&&l.textEmbedded&&l.chunks.push(N),a.abortSet.delete(a),l.status=1,Er(o,a.blockedBoundary,l)}catch(e){if(qt(),"object"==typeof e&&null!==e&&"function"==typeof e.then){var u=a.ping;e.then(u,u)}else{a.abortSet.delete(a),l.status=4;var c=a.blockedBoundary,d=e,h=ur(o,d);if(null===c?cr(o,d):(c.pendingTasks--,c.forceClientRender||(c.forceClientRender=!0,c.errorDigest=h,c.parentFlushed&&o.clientRenderedBoundaries.push(c))),o.allPendingTasks--,0===o.allPendingTasks)(0,o.onAllReady)()}}}}s.splice(0,i),null!==e.destination&&Lr(e,e.destination)}catch(t){ur(e,t),cr(e,t)}finally{nr=n,ir.current=r,r===rr&&Lt(t)}}}function Tr(e,r,n){switch(n.parentFlushed=!0,n.status){case 0:var a=n.id=e.nextSegmentId++;return n.lastPushedText=!1,n.textEmbedded=!1,e=e.responseState,i(r,oe),i(r,e.placeholderPrefix),i(r,e=u(a.toString(16))),s(r,le);case 1:n.status=2;var o=!0;a=n.chunks;var l=0;n=n.children;for(var c=0;c<n.length;c++){for(o=n[c];l<o.index;l++)i(r,a[l]);o=kr(e,r,o)}for(;l<a.length-1;l++)i(r,a[l]);return l<a.length&&(o=s(r,a[l])),o;default:throw Error(t(390))}}function kr(e,r,n){var a=n.boundary;if(null===a)return Tr(e,r,n);if(a.parentFlushed=!0,a.forceClientRender)a=a.errorDigest,s(r,he),i(r,pe),a&&(i(r,me),i(r,u(k(a))),i(r,ge)),s(r,ve),Tr(e,r,n);else if(0<a.pendingTasks){a.rootSegmentID=e.nextSegmentId++,0<a.completedSegments.length&&e.partialBoundaries.push(a);var o=e.responseState,l=o.nextSuspenseID++;o=c(o.boundaryPrefix+l.toString(16)),a=a.id=o,ye(r,e.responseState,a),Tr(e,r,n)}else if(a.byteSize>e.progressiveChunkSize)a.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(a),ye(r,e.responseState,a.id),Tr(e,r,n);else{if(s(r,ue),1!==(n=a.completedSegments).length)throw Error(t(391));kr(e,r,n[0])}return s(r,fe)}function xr(e,r,n){return function(e,r,n,a){switch(n.insertionMode){case 0:case 1:return i(e,be),i(e,r.segmentPrefix),i(e,u(a.toString(16))),s(e,we);case 2:return i(e,Se),i(e,r.segmentPrefix),i(e,u(a.toString(16))),s(e,Te);case 3:return i(e,xe),i(e,r.segmentPrefix),i(e,u(a.toString(16))),s(e,Ae);case 4:return i(e,Le),i(e,r.segmentPrefix),i(e,u(a.toString(16))),s(e,Ie);case 5:return i(e,Pe),i(e,r.segmentPrefix),i(e,u(a.toString(16))),s(e,De);case 6:return i(e,Me),i(e,r.segmentPrefix),i(e,u(a.toString(16))),s(e,Oe);case 7:return i(e,Fe),i(e,r.segmentPrefix),i(e,u(a.toString(16))),s(e,$e);default:throw Error(t(397))}}(r,e.responseState,n.formatContext,n.id),kr(e,r,n),function(e,r){switch(r.insertionMode){case 0:case 1:return s(e,Ee);case 2:return s(e,ke);case 3:return s(e,Re);case 4:return s(e,Ce);case 5:return s(e,_e);case 6:return s(e,Ne);case 7:return s(e,Be);default:throw Error(t(397))}}(r,n.formatContext)}function Ar(e,r,n){for(var a=n.completedSegments,o=0;o<a.length;o++)Rr(e,r,n,a[o]);if(a.length=0,e=e.responseState,a=n.id,n=n.rootSegmentID,i(r,e.startInlineScript),e.sentCompleteBoundaryFunction?i(r,Ve):(e.sentCompleteBoundaryFunction=!0,i(r,He)),null===a)throw Error(t(395));return n=u(n.toString(16)),i(r,a),i(r,We),i(r,e.segmentPrefix),i(r,n),s(r,Ke)}function Rr(e,r,n,a){if(2===a.status)return!0;var o=a.id;if(-1===o){if(-1===(a.id=n.rootSegmentID))throw Error(t(392));return xr(e,r,a)}return xr(e,r,a),i(r,(e=e.responseState).startInlineScript),e.sentCompleteSegmentFunction?i(r,ze):(e.sentCompleteSegmentFunction=!0,i(r,Ue)),i(r,e.segmentPrefix),i(r,o=u(o.toString(16))),i(r,je),i(r,e.placeholderPrefix),i(r,o),s(r,Ge)}function Lr(e,o){r=new Uint8Array(512),n=0;try{var l=e.completedRootSegment;if(null!==l&&0===e.pendingRootTasks){kr(e,o,l),e.completedRootSegment=null;var c=e.responseState.bootstrapChunks;for(l=0;l<c.length-1;l++)i(o,c[l]);l<c.length&&s(o,c[l])}var d,h=e.clientRenderedBoundaries;for(d=0;d<h.length;d++){var f=h[d];c=o;var p=e.responseState,g=f.id,m=f.errorDigest,v=f.errorMessage,y=f.errorComponentStack;if(i(c,p.startInlineScript),p.sentClientRenderFunction?i(c,qe):(p.sentClientRenderFunction=!0,i(c,Ye)),null===g)throw Error(t(395));i(c,g),i(c,Xe),(m||v||y)&&(i(c,Ze),i(c,u(et(m||"")))),(v||y)&&(i(c,Ze),i(c,u(et(v||"")))),y&&(i(c,Ze),i(c,u(et(y)))),s(c,Qe)}h.splice(0,d);var b=e.completedBoundaries;for(d=0;d<b.length;d++)Ar(e,o,b[d]);b.splice(0,d),a(o),r=new Uint8Array(512),n=0;var w=e.partialBoundaries;for(d=0;d<w.length;d++){var E=w[d];e:{h=e,f=o;var S=E.completedSegments;for(p=0;p<S.length;p++)if(!Rr(h,f,E,S[p])){p++,S.splice(0,p);var T=!1;break e}S.splice(0,p),T=!0}if(!T)return e.destination=null,d++,void w.splice(0,d)}w.splice(0,d);var k=e.completedBoundaries;for(d=0;d<k.length;d++)Ar(e,o,k[d]);k.splice(0,d)}finally{a(o),0===e.allPendingTasks&&0===e.pingedTasks.length&&0===e.clientRenderedBoundaries.length&&0===e.completedBoundaries.length&&o.close()}}function Ir(e,t){try{var r=e.abortableTasks;r.forEach(function(r){return br(r,e,t)}),r.clear(),null!==e.destination&&Lr(e,e.destination)}catch(t){ur(e,t),cr(e,t)}}return Nu.renderToReadableStream=function(e,t){return new Promise(function(r,n){var i,s,a=new Promise(function(e,t){s=e,i=t}),o=function(e,t,r,n,i,s,a,o,l){var u=[],c=new Set;return(r=lr(t={destination:null,responseState:t,progressiveChunkSize:void 0===n?12800:n,status:0,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:c,pingedTasks:u,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:void 0===i?sr:i,onAllReady:void 0===s?ar:s,onShellReady:void 0===a?ar:a,onShellError:void 0===o?ar:o,onFatalError:void 0===l?ar:l},0,null,r,!1,!1)).parentFlushed=!0,e=or(t,e,null,r,c,wt,null,Pt),u.push(e),t}(e,function(e,t,r,n,i){e=void 0===e?"":e,t=void 0===t?L:c('<script nonce="'+k(t)+'">');var s=[];if(void 0!==r&&s.push(t,u((""+r).replace(_,M)),I),void 0!==n)for(r=0;r<n.length;r++)s.push(C,u(k(n[r])),D);if(void 0!==i)for(n=0;n<i.length;n++)s.push(P,u(k(i[n])),D);return{bootstrapChunks:s,startInlineScript:t,placeholderPrefix:c(e+"P:"),segmentPrefix:c(e+"S:"),boundaryPrefix:e+"B:",idPrefix:e,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1}}(t?t.identifierPrefix:void 0,t?t.nonce:void 0,t?t.bootstrapScriptContent:void 0,t?t.bootstrapScripts:void 0,t?t.bootstrapModules:void 0),function(e){return O("http://www.w3.org/2000/svg"===e?2:"http://www.w3.org/1998/Math/MathML"===e?3:0,null)}(t?t.namespaceURI:void 0),t?t.progressiveChunkSize:void 0,t?t.onError:void 0,s,function(){var e=new ReadableStream({type:"bytes",pull:function(e){if(1===o.status)o.status=2,d(e,o.fatalError);else if(2!==o.status&&null===o.destination){o.destination=e;try{Lr(o,e)}catch(e){ur(o,e),cr(o,e)}}},cancel:function(){Ir(o)}},{highWaterMark:0});e.allReady=a,r(e)},function(e){a.catch(function(){}),n(e)},i);if(t&&t.signal){var l=t.signal,h=function(){Ir(o,l.reason),l.removeEventListener("abort",h)};l.addEventListener("abort",h)}Sr(o)})},Nu.version="18.3.1",Nu}var $u,Bu,Uu,zu,ju,Gu=function(){return Ou||(Ou=1,e=_u(),t=Fu(),Pu.version=e.version,Pu.renderToString=e.renderToString,Pu.renderToStaticMarkup=e.renderToStaticMarkup,Pu.renderToNodeStream=e.renderToNodeStream,Pu.renderToStaticNodeStream=e.renderToStaticNodeStream,Pu.renderToReadableStream=t.renderToReadableStream),Pu;var e,t}(),Hu={exports:{}};function Vu(){if(Bu)return $u;Bu=1;return $u="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Wu(){if(zu)return Uu;zu=1;var e=Vu();function t(){}function r(){}return r.resetWarningCache=t,Uu=function(){function n(t,r,n,i,s,a){if(a!==e){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function i(){return n}n.isRequired=n;var s={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:r,resetWarningCache:t};return s.PropTypes=s,s}}function Ku(){return ju||(ju=1,Hu.exports=Wu()()),Hu.exports}var Yu=t(Ku()),qu="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Xu(e,t){return e(t={exports:{}},t.exports),t.exports}var Qu=Xu(function(e){!function(t){var r=function(e,t,n){if(!l(t)||c(t)||d(t)||h(t)||o(t))return t;var i,s=0,a=0;if(u(t))for(i=[],a=t.length;s<a;s++)i.push(r(e,t[s],n));else for(var f in i={},t)Object.prototype.hasOwnProperty.call(t,f)&&(i[e(f,n)]=r(e,t[f],n));return i},n=function(e){return f(e)?e:(e=e.replace(/[\-_\s]+(.)?/g,function(e,t){return t?t.toUpperCase():""})).substr(0,1).toLowerCase()+e.substr(1)},i=function(e){var t=n(e);return t.substr(0,1).toUpperCase()+t.substr(1)},s=function(e,t){return function(e,t){var r=(t=t||{}).separator||"_",n=t.split||/(?=[A-Z])/;return e.split(n).join(r)}(e,t).toLowerCase()},a=Object.prototype.toString,o=function(e){return"function"==typeof e},l=function(e){return e===Object(e)},u=function(e){return"[object Array]"==a.call(e)},c=function(e){return"[object Date]"==a.call(e)},d=function(e){return"[object RegExp]"==a.call(e)},h=function(e){return"[object Boolean]"==a.call(e)},f=function(e){return(e-=0)==e},p=function(e,t){var r=t&&"process"in t?t.process:t;return"function"!=typeof r?e:function(t,n){return r(t,e,n)}},g={camelize:n,decamelize:s,pascalize:i,depascalize:s,camelizeKeys:function(e,t){return r(p(n,t),e)},decamelizeKeys:function(e,t){return r(p(s,t),e,t)},pascalizeKeys:function(e,t){return r(p(i,t),e)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}};e.exports?e.exports=g:t.humps=g}(qu)}).decamelize,Zu=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},Ju=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,i=!1,s=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,s=e}finally{try{n||null==o.return||o.return()}finally{if(i)throw s}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Zu(e,t);var r=Object.prototype.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)?Zu(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.")}()},ec=Xu(function(e){function t(){return e.exports=t=Object.assign||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},t.apply(this,arguments)}e.exports=t}),tc=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i},rc=p.createContext(null);function nc(e){var t=e.children,r=void 0===t?"":t,n=tc(e,["children"]);return"string"!=typeof r&&(r=Gu.renderToString(r)),g.createElement("template",ec({},n,{dangerouslySetInnerHTML:{__html:r}}))}function ic(e){var t=e.root,r=e.children;return Ci.createPortal(void 0===r?null:r,t)}nc.propTypes={children:Yu.oneOfType([Yu.string,Yu.node])},ic.propTypes={root:Yu.object.isRequired,children:Yu.node};var sc=new Map;var ac=function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"core",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(e){return e.children};return new Proxy(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{get:function(r,n){var i=Qu(n,{separator:"-"}),s="".concat(e,"-").concat(i);return sc.has(s)||sc.set(s,function(e){var t=p.forwardRef(function(t,r){var n,i,s=t.mode,a=void 0===s?"open":s,o=t.delegatesFocus,l=void 0!==o&&o,u=t.styleSheets,c=void 0===u?[]:u,d=t.ssr,h=void 0!==d&&d,f=t.children,m=tc(t,["mode","delegatesFocus","styleSheets","ssr","children"]),v=(i=p.useRef((n=r)&&n.current),p.useEffect(function(){n&&(n.current=i.current)},[n]),i),y=p.useState(null),b=Ju(y,2),w=b[0],E=b[1],S="node_".concat(a).concat(l);return p.useLayoutEffect(function(){if(v.current)try{if("function"==typeof r&&r(v.current),h){var e=v.current.shadowRoot;return void E(e)}var t=v.current.attachShadow({mode:a,delegatesFocus:l});c.length>0&&(t.adoptedStyleSheets=c),E(t)}catch(e){!function(e){var t=e.error,r=e.styleSheets,n=e.root;if("NotSupportedError"!==t.name)throw t;r.length>0&&(n.adoptedStyleSheets=r)}({error:e,styleSheets:c,root:w})}},[r,v,c]),g.createElement(g.Fragment,null,g.createElement(e.tag,ec({key:S,ref:v},m),(w||h)&&g.createElement(rc.Provider,{value:w},h?g.createElement(nc,{shadowroot:a,shadowrootmode:a},e.render({root:w,ssr:h,children:f})):g.createElement(ic,{root:w},e.render({root:w,ssr:h,children:f})))))});return t.propTypes={mode:Yu.oneOf(["open","closed"]),delegatesFocus:Yu.bool,styleSheets:Yu.arrayOf(Yu.instanceOf(globalThis.CSSStyleSheet)),ssr:Yu.bool,children:Yu.node},t}({tag:i,render:t})),sc.get(s)}})}();const oc='/*! tailwindcss v4.0.12 | MIT License | https://tailwindcss.com */@layer theme, base, components, utilities;@layer theme{:host,:root{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-500:oklch(0.637 0.237 25.331);--color-blue-200:oklch(0.882 0.059 254.128);--color-blue-300:oklch(0.809 0.105 251.813);--color-gray-400:oklch(0.707 0.022 261.325);--color-gray-500:oklch(0.551 0.027 264.364);--color-gray-700:oklch(0.373 0.034 259.733);--color-gray-800:oklch(0.278 0.033 256.848);--color-gray-900:oklch(0.21 0.034 264.665);--color-zinc-700:oklch(0.37 0.013 285.805);--color-black:#000;--color-white:#fff;--spacing:0.25rem;--container-sm:24rem;--container-lg:32rem;--text-xs:0.75rem;--text-xs--line-height:1.33333;--text-sm:0.875rem;--text-sm--line-height:1.42857;--text-lg:1.125rem;--text-lg--line-height:1.55556;--text-xl:1.25rem;--text-xl--line-height:1.4;--font-weight-medium:500;--font-weight-semibold:600;--leading-tight:1.25;--ease-in:cubic-bezier(0.4,0,1,1);--ease-in-out:cubic-bezier(0.4,0,0.2,1);--aspect-video:16/9;--default-transition-duration:150ms;--default-transition-timing-function:cubic-bezier(0.4,0,0.2,1);--default-font-family:var(--font-sans);--default-font-feature-settings:var(--font-sans--font-feature-settings);--default-font-variation-settings:var(\n --font-sans--font-variation-settings\n );--default-mono-font-family:var(--font-mono);--default-mono-font-feature-settings:var(\n --font-mono--font-feature-settings\n );--default-mono-font-variation-settings:var(\n --font-mono--font-variation-settings\n );--animate-float:float 2s ease}}@layer base{*,::backdrop,::file-selector-button,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:var(--default-font-feature-settings,normal);-webkit-tap-highlight-color:transparent;font-family:var( --default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji" );font-variation-settings:var( --default-font-variation-settings,normal );line-height:1.5;tab-size:4}body{line-height:inherit}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:var( --default-mono-font-feature-settings,normal );font-family:var( --default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace );font-size:1em;font-variation-settings:var( --default-mono-font-variation-settings,normal )}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}::file-selector-button,button,input,optgroup,select,textarea{font-feature-settings:inherit;background-color:transparent;border-radius:0;color:inherit;font:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{color:color-mix(in oklab,currentColor 50%,transparent);opacity:1}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-year-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}::file-selector-button,button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-4{top:calc(var(--spacing)*4)}.right-4{right:calc(var(--spacing)*4)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\\[1\\]{z-index:1}.z-\\[5\\]{z-index:5}.z-\\[999\\]{z-index:999}.z-\\[999999\\]{z-index:999999}.container{width:100%;@media (width >= 40rem){max-width:40rem}@media (width >= 48rem){max-width:48rem}@media (width >= 64rem){max-width:64rem}@media (width >= 80rem){max-width:80rem}@media (width >= 96rem){max-width:96rem}}.mx-0{margin-inline:calc(var(--spacing)*0)}.mx-10{margin-inline:calc(var(--spacing)*10)}.mx-auto{margin-inline:auto}.my-0{margin-block:calc(var(--spacing)*0)}.my-2{margin-block:calc(var(--spacing)*2)}.my-10{margin-block:calc(var(--spacing)*10)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-auto{margin-top:auto}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.line-clamp-1{-webkit-line-clamp:1}.line-clamp-1,.line-clamp-2{-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-2{-webkit-line-clamp:2}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.table{display:table}.aspect-\\[9\\/16\\]{aspect-ratio:9/16}.aspect-square{aspect-ratio:1/1}.aspect-video{aspect-ratio:var(--aspect-video)}.size-3{height:calc(var(--spacing)*3);width:calc(var(--spacing)*3)}.size-4{height:calc(var(--spacing)*4);width:calc(var(--spacing)*4)}.h-1{height:calc(var(--spacing)*1)}.h-2{height:calc(var(--spacing)*2)}.h-4{height:calc(var(--spacing)*4)}.h-6{height:calc(var(--spacing)*6)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-14{height:calc(var(--spacing)*14)}.h-16{height:calc(var(--spacing)*16)}.h-\\[24px\\]{height:24px}.h-\\[60px\\]{height:60px}.h-\\[80\\%\\]{height:80%}.h-\\[100px\\]{height:100px}.h-\\[125px\\]{height:125px}.h-\\[500px\\]{height:500px}.h-\\[600px\\]{height:600px}.h-auto{height:auto}.h-full{height:100%}.max-h-\\[150px\\]{max-height:150px}.max-h-\\[300px\\]{max-height:300px}.max-h-fit{max-height:fit-content}.max-h-full{max-height:100%}.\\!w-auto{width:auto!important}.w-4{width:calc(var(--spacing)*4)}.w-12{width:calc(var(--spacing)*12)}.w-14{width:calc(var(--spacing)*14)}.w-16{width:calc(var(--spacing)*16)}.w-32{width:calc(var(--spacing)*32)}.w-\\[24px\\]{width:24px}.w-\\[50px\\]{width:50px}.w-\\[80\\%\\]{width:80%}.w-\\[100px\\]{width:100px}.w-\\[400px\\]{width:400px}.w-\\[500px\\]{width:500px}.w-\\[1024px\\]{width:1024px}.w-full{width:100%}.max-w-16{max-width:calc(var(--spacing)*16)}.max-w-52{max-width:calc(var(--spacing)*52)}.max-w-\\[40\\%\\]{max-width:40%}.max-w-\\[800px\\]{max-width:800px}.max-w-fit{max-width:fit-content}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-none{max-width:none}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-44{min-width:calc(var(--spacing)*44)}.min-w-\\[768px\\]{min-width:768px}.flex-1{flex:1}.flex-\\[2\\]{flex:2}.flex-none{flex:none}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.translate-y-0\\.5{--tw-translate-y:calc(var(--spacing)*0.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x) var(--tw-rotate-y) var(--tw-rotate-z) var(--tw-skew-x) var(--tw-skew-y)}.animate-float{animation:var(--animate-float)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-items-center{justify-items:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-5{gap:calc(var(--spacing)*5)}.gap-10{gap:calc(var(--spacing)*10)}.self-center{align-self:center}.justify-self-end{justify-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap}.overflow-hidden,.truncate{overflow:hidden}.overflow-scroll{overflow:scroll}.overflow-y-auto{overflow-y:auto}.overflow-y-scroll{overflow-y:scroll}.rounded{border-radius:.25rem}.rounded-full{border-radius:calc(infinity * 1px)}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-none{--tw-border-style:none;border-style:none}.border-\\[\\#f4f3f6\\]{border-color:#f4f3f6}.bg-\\[\\#0ab060\\]{background-color:#0ab060}.bg-\\[\\#eeeeee\\]{background-color:#eee}.bg-\\[\\#f4f4f4\\]{background-color:#f4f4f4}.bg-\\[rgba\\(0\\,0\\,0\\,\\.3\\)\\]{background-color:rgba(0,0,0,.3)}.bg-background{background-color:var(--background)}.bg-black{background-color:var(--color-black)}.bg-black\\/50{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}.bg-blue-200{background-color:var(--color-blue-200)}.bg-blue-300{background-color:var(--color-blue-300)}.bg-muted{background-color:var(--muted)}.bg-white{background-color:var(--color-white)}.bg-zinc-700{background-color:var(--color-zinc-700)}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-black\\/40{--tw-gradient-from:color-mix(in oklab,var(--color-black) 40%,transparent);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from) var(--tw-gradient-from-position),var(--tw-gradient-to) var(--tw-gradient-to-position))}.via-transparent{--tw-gradient-via:transparent;--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from) var(--tw-gradient-from-position),var(--tw-gradient-via) var(--tw-gradient-via-position),var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-black\\/40{--tw-gradient-to:color-mix(in oklab,var(--color-black) 40%,transparent);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from) var(--tw-gradient-from-position),var(--tw-gradient-to) var(--tw-gradient-to-position))}.fill-black{fill:var(--color-black)}.fill-red-500{fill:var(--color-red-500)}.fill-white{fill:var(--color-white)}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.object-center{object-position:center}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-10{padding:calc(var(--spacing)*10)}.p-\\[3px\\]{padding:3px}.px-2{padding-inline:calc(var(--spacing)*2)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-\\[24px\\]{padding-inline:24px}.py-2{padding-block:calc(var(--spacing)*2)}.py-4{padding-block:calc(var(--spacing)*4)}.pt-0{padding-top:calc(var(--spacing)*0)}.pr-1{padding-right:calc(var(--spacing)*1)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pb-10{padding-bottom:calc(var(--spacing)*10)}.text-center{text-align:center}.text-left{text-align:left}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[10px\\]{font-size:10px}.text-\\[12px\\]{font-size:12px}.leading-none{--tw-leading:1;line-height:1}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.break-keep{word-break:keep-all}.text-clip{text-overflow:clip}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-black{color:var(--color-black)}.text-foreground{color:var(--foreground)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-muted-foreground{color:var(--muted-foreground)}.text-red-500{color:var(--color-red-500)}.text-transparent{color:transparent}.text-white{color:var(--color-white)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.opacity-50{opacity:50%}.opacity-70{opacity:70%}.shadow,.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,rgba(0,0,0,.1)),0 1px 2px -1px var(--tw-shadow-color,rgba(0,0,0,.1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-ring\\/30{--tw-ring-color:color-mix(in oklab,var(--ring) 30%,transparent)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.transition-\\[color\\,box-shadow\\]{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.transition-all{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.transition-opacity{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.transition-transform{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.duration-200{--tw-duration:200ms;transition-duration:.2s}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.duration-200{animation-duration:.2s}.ease-in{animation-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.fade-in{--tw-enter-opacity:0}.group-data-\\[vaul-drawer-direction\\=bottom\\]\\/drawer-content\\:block{&:is(:where(.group\\/drawer-content)[data-vaul-drawer-direction=bottom] *){display:block}}.last\\:border-b-0{&:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}}.hover\\:underline{&:hover{@media (hover:hover){text-decoration-line:underline}}}.hover\\:opacity-100{&:hover{@media (hover:hover){opacity:100%}}}.hover\\:ring-4{&:hover{@media (hover:hover){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}}.focus\\:ring-2{&:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\\:ring-ring{&:focus{--tw-ring-color:var(--ring)}}.focus\\:ring-offset-2{&:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}}.focus\\:ring-offset-background{&:focus{--tw-ring-offset-color:var(--background)}}.focus\\:outline-none{&:focus{--tw-outline-style:none;outline-style:none}}.focus-visible\\:border-ring{&:focus-visible{border-color:var(--ring)}}.focus-visible\\:ring-4{&:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus-visible\\:ring-\\[3px\\]{&:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentColor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus-visible\\:ring-ring\\/50{&:focus-visible{--tw-ring-color:color-mix(in oklab,var(--ring) 50%,transparent)}}.focus-visible\\:outline-hidden{&:focus-visible{--tw-outline-style:none;outline-style:none;@media (forced-colors:active){outline:2px solid transparent;outline-offset:2px}}}.disabled\\:pointer-events-none{&:disabled{pointer-events:none}}.disabled\\:opacity-50{&:disabled{opacity:50%}}.data-\\[disabled\\]\\:opacity-50{&[data-disabled]{opacity:50%}}.data-\\[orientation\\=horizontal\\]\\:h-1\\.5{&[data-orientation=horizontal]{height:calc(var(--spacing)*1.5)}}.data-\\[orientation\\=horizontal\\]\\:h-full{&[data-orientation=horizontal]{height:100%}}.data-\\[orientation\\=horizontal\\]\\:w-full{&[data-orientation=horizontal]{width:100%}}.data-\\[orientation\\=vertical\\]\\:h-full{&[data-orientation=vertical]{height:100%}}.data-\\[orientation\\=vertical\\]\\:min-h-44{&[data-orientation=vertical]{min-height:calc(var(--spacing)*44)}}.data-\\[orientation\\=vertical\\]\\:w-1\\.5{&[data-orientation=vertical]{width:calc(var(--spacing)*1.5)}}.data-\\[orientation\\=vertical\\]\\:w-auto{&[data-orientation=vertical]{width:auto}}.data-\\[orientation\\=vertical\\]\\:w-full{&[data-orientation=vertical]{width:100%}}.data-\\[orientation\\=vertical\\]\\:flex-col{&[data-orientation=vertical]{flex-direction:column}}.data-\\[state\\=closed\\]\\:animate-out{&[data-state=closed]{--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial;animation-duration:.15s;animation-name:exit}}.data-\\[state\\=closed\\]\\:fade-out-0{&[data-state=closed]{--tw-exit-opacity:0}}.data-\\[state\\=open\\]\\:animate-in{&[data-state=open]{--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial;animation-duration:.15s;animation-name:enter}}.data-\\[state\\=open\\]\\:fade-in-0{&[data-state=open]{--tw-enter-opacity:0}}.data-\\[vaul-drawer-direction\\=bottom\\]\\:inset-x-0{&[data-vaul-drawer-direction=bottom]{inset-inline:calc(var(--spacing)*0)}}.data-\\[vaul-drawer-direction\\=bottom\\]\\:bottom-0{&[data-vaul-drawer-direction=bottom]{bottom:calc(var(--spacing)*0)}}.data-\\[vaul-drawer-direction\\=bottom\\]\\:mt-24{&[data-vaul-drawer-direction=bottom]{margin-top:calc(var(--spacing)*24)}}.data-\\[vaul-drawer-direction\\=bottom\\]\\:max-h-\\[80vh\\]{&[data-vaul-drawer-direction=bottom]{max-height:80vh}}.data-\\[vaul-drawer-direction\\=bottom\\]\\:rounded-t-lg{&[data-vaul-drawer-direction=bottom]{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}}.data-\\[vaul-drawer-direction\\=bottom\\]\\:border-t{&[data-vaul-drawer-direction=bottom]{border-top-style:var(--tw-border-style);border-top-width:1px}}.data-\\[vaul-drawer-direction\\=left\\]\\:inset-y-0{&[data-vaul-drawer-direction=left]{inset-block:calc(var(--spacing)*0)}}.data-\\[vaul-drawer-direction\\=left\\]\\:left-0{&[data-vaul-drawer-direction=left]{left:calc(var(--spacing)*0)}}.data-\\[vaul-drawer-direction\\=left\\]\\:w-3\\/4{&[data-vaul-drawer-direction=left]{width:75%}}.data-\\[vaul-drawer-direction\\=left\\]\\:border-r{&[data-vaul-drawer-direction=left]{border-right-style:var(--tw-border-style);border-right-width:1px}}.data-\\[vaul-drawer-direction\\=right\\]\\:inset-y-0{&[data-vaul-drawer-direction=right]{inset-block:calc(var(--spacing)*0)}}.data-\\[vaul-drawer-direction\\=right\\]\\:right-0{&[data-vaul-drawer-direction=right]{right:calc(var(--spacing)*0)}}.data-\\[vaul-drawer-direction\\=right\\]\\:w-3\\/4{&[data-vaul-drawer-direction=right]{width:75%}}.data-\\[vaul-drawer-direction\\=right\\]\\:border-l{&[data-vaul-drawer-direction=right]{border-left-style:var(--tw-border-style);border-left-width:1px}}.data-\\[vaul-drawer-direction\\=top\\]\\:inset-x-0{&[data-vaul-drawer-direction=top]{inset-inline:calc(var(--spacing)*0)}}.data-\\[vaul-drawer-direction\\=top\\]\\:top-0{&[data-vaul-drawer-direction=top]{top:calc(var(--spacing)*0)}}.data-\\[vaul-drawer-direction\\=top\\]\\:mb-24{&[data-vaul-drawer-direction=top]{margin-bottom:calc(var(--spacing)*24)}}.data-\\[vaul-drawer-direction\\=top\\]\\:max-h-\\[80vh\\]{&[data-vaul-drawer-direction=top]{max-height:80vh}}.data-\\[vaul-drawer-direction\\=top\\]\\:rounded-b-lg{&[data-vaul-drawer-direction=top]{border-bottom-left-radius:var(--radius);border-bottom-right-radius:var(--radius)}}.data-\\[vaul-drawer-direction\\=top\\]\\:border-b{&[data-vaul-drawer-direction=top]{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}}.data-\\[vaul-drawer-direction\\=left\\]\\:sm\\:max-w-sm,.sm\\:flex-row,.sm\\:justify-end,.sm\\:mx-0{&[data-vaul-drawer-direction=left]{@media (width >= 40rem){max-width:var(--container-sm)}}}.data-\\[vaul-drawer-direction\\=right\\]\\:sm\\:max-w-sm{&[data-vaul-drawer-direction=right]{@media (width >= 40rem){max-width:var(--container-sm)}}}.\\[\\&\\[data-state\\=open\\]\\>svg\\]\\:rotate-180,.md\\:text-\\[15px\\]{&[data-state=open]>svg{rotate:180deg}}}body{--background:oklch(1 0 0);--foreground:oklch(0.145 0 0);--card:oklch(1 0 0);--card-foreground:oklch(0.145 0 0);--popover:oklch(1 0 0);--popover-foreground:oklch(0.145 0 0);--primary:oklch(0.205 0 0);--primary-foreground:oklch(0.985 0 0);--secondary:oklch(0.97 0 0);--secondary-foreground:oklch(0.205 0 0);--muted:oklch(0.97 0 0);--muted-foreground:oklch(0.556 0 0);--accent:oklch(0.97 0 0);--accent-foreground:oklch(0.205 0 0);--destructive:oklch(0.577 0.245 27.325);--destructive-foreground:oklch(0.577 0.245 27.325);--border:oklch(0.922 0 0);--input:oklch(0.922 0 0);--ring:oklch(0.708 0 0);--chart-1:oklch(0.646 0.222 41.116);--chart-2:oklch(0.6 0.118 184.704);--chart-3:oklch(0.398 0.07 227.392);--chart-4:oklch(0.828 0.189 84.429);--chart-5:oklch(0.769 0.188 70.08);--radius:0.625rem;--sidebar:oklch(0.985 0 0);--sidebar-foreground:oklch(0.145 0 0);--sidebar-primary:oklch(0.205 0 0);--sidebar-primary-foreground:oklch(0.985 0 0);--sidebar-accent:oklch(0.97 0 0);--sidebar-accent-foreground:oklch(0.205 0 0);--sidebar-border:oklch(0.922 0 0);--sidebar-ring:oklch(0.708 0 0);outline:none}.dark{--background:oklch(0.145 0 0);--foreground:oklch(0.985 0 0);--card:oklch(0.145 0 0);--card-foreground:oklch(0.985 0 0);--popover:oklch(0.145 0 0);--popover-foreground:oklch(0.985 0 0);--primary:oklch(0.985 0 0);--primary-foreground:oklch(0.205 0 0);--secondary:oklch(0.269 0 0);--secondary-foreground:oklch(0.985 0 0);--muted:oklch(0.269 0 0);--muted-foreground:oklch(0.708 0 0);--accent:oklch(0.269 0 0);--accent-foreground:oklch(0.985 0 0);--destructive:oklch(0.396 0.141 25.723);--destructive-foreground:oklch(0.637 0.237 25.331);--border:oklch(0.269 0 0);--input:oklch(0.269 0 0);--ring:oklch(0.439 0 0);--chart-1:oklch(0.488 0.243 264.376);--chart-2:oklch(0.696 0.17 162.48);--chart-3:oklch(0.769 0.188 70.08);--chart-4:oklch(0.627 0.265 303.9);--chart-5:oklch(0.645 0.246 16.439);--sidebar:oklch(0.205 0 0);--sidebar-foreground:oklch(0.985 0 0);--sidebar-primary:oklch(0.488 0.243 264.376);--sidebar-primary-foreground:oklch(0.985 0 0);--sidebar-accent:oklch(0.269 0 0);--sidebar-accent-foreground:oklch(0.985 0 0);--sidebar-border:oklch(0.269 0 0);--sidebar-ring:oklch(0.439 0 0)}@layer base{*{border-color:var(--border);outline-color:color-mix(in oklab,var(--ring) 50%,transparent)}body{background-color:var(--background);color:var(--foreground)}}html.overflow-hidden{overflow:hidden}.scrollbar-hide::-webkit-scrollbar{display:none}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}.bg-insta{background-image:linear-gradient(to top right,#facc15,#ec4899,#9333ea)}.product-banner{align-items:center;background:#fff;border-radius:8px;cursor:pointer;display:flex;gap:8px;position:relative}.product-banner__clip{border-radius:inherit;overflow:hidden}.product-banner__clip,.product-banner__sheen{inset:0;pointer-events:none;position:absolute;z-index:1}.product-banner__sheen{background:linear-gradient(270deg,rgba(0,0,0,.1),transparent);transform:translateX(100%);transition:transform .3s ease}.product-banner:hover .product-banner__sheen{transform:translateX(0)}.product-banner__arrow{opacity:0;pointer-events:none;position:absolute;right:8px;top:50%;transform:translate(4px,-50%);transition:transform .3s ease,opacity .3s ease;z-index:2}.product-banner:hover .product-banner__arrow{opacity:1;transform:translateY(-50%)}.product-dialog-container{max-height:70vh;max-width:min(82vw,500px);overflow-y:auto;width:100%}.border{border:1px solid oklch(.922 0 0)}@font-face{font-family:swiper-icons;font-style:normal;font-weight:400;src:url("data:application/font-woff;charset=utf-8;base64, d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAAAWgAAAAIwAAACQAYABXR1BPUwAABhQAAAAuAAAANuAY7+xHU1VCAAAFxAAAAFAAAABm2fPczU9TLzIAAAHcAAAASgAAAGBP9V5RY21hcAAAAkQAAACIAAABYt6F0cBjdnQgAAACzAAAAAQAAAAEABEBRGdhc3AAAAWYAAAACAAAAAj//wADZ2x5ZgAAAywAAADMAAAD2MHtryVoZWFkAAABbAAAADAAAAA2E2+eoWhoZWEAAAGcAAAAHwAAACQC9gDzaG10eAAAAigAAAAZAAAArgJkABFsb2NhAAAC0AAAAFoAAABaFQAUGG1heHAAAAG8AAAAHwAAACAAcABAbmFtZQAAA/gAAAE5AAACXvFdBwlwb3N0AAAFNAAAAGIAAACE5s74hXjaY2BkYGAAYpf5Hu/j+W2+MnAzMYDAzaX6QjD6/4//Bxj5GA8AuRwMYGkAPywL13jaY2BkYGA88P8Agx4j+/8fQDYfA1AEBWgDAIB2BOoAeNpjYGRgYNBh4GdgYgABEMnIABJzYNADCQAACWgAsQB42mNgYfzCOIGBlYGB0YcxjYGBwR1Kf2WQZGhhYGBiYGVmgAFGBiQQkOaawtDAoMBQxXjg/wEGPcYDDA4wNUA2CCgwsAAAO4EL6gAAeNpj2M0gyAACqxgGNWBkZ2D4/wMA+xkDdgAAAHjaY2BgYGaAYBkGRgYQiAHyGMF8FgYHIM3DwMHABGQrMOgyWDLEM1T9/w8UBfEMgLzE////P/5//f/V/xv+r4eaAAeMbAxwIUYmIMHEgKYAYjUcsDAwsLKxc3BycfPw8jEQA/gZBASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTQZBgMAAMR+E+gAEQFEAAAAKgAqACoANAA+AEgAUgBcAGYAcAB6AIQAjgCYAKIArAC2AMAAygDUAN4A6ADyAPwBBgEQARoBJAEuATgBQgFMAVYBYAFqAXQBfgGIAZIBnAGmAbIBzgHsAAB42u2NMQ6CUAyGW568x9AneYYgm4MJbhKFaExIOAVX8ApewSt4Bic4AfeAid3VOBixDxfPYEza5O+Xfi04YADggiUIULCuEJK8VhO4bSvpdnktHI5QCYtdi2sl8ZnXaHlqUrNKzdKcT8cjlq+rwZSvIVczNiezsfnP/uznmfPFBNODM2K7MTQ45YEAZqGP81AmGGcF3iPqOop0r1SPTaTbVkfUe4HXj97wYE+yNwWYxwWu4v1ugWHgo3S1XdZEVqWM7ET0cfnLGxWfkgR42o2PvWrDMBSFj/IHLaF0zKjRgdiVMwScNRAoWUoH78Y2icB/yIY09An6AH2Bdu/UB+yxopYshQiEvnvu0dURgDt8QeC8PDw7Fpji3fEA4z/PEJ6YOB5hKh4dj3EvXhxPqH/SKUY3rJ7srZ4FZnh1PMAtPhwP6fl2PMJMPDgeQ4rY8YT6Gzao0eAEA409DuggmTnFnOcSCiEiLMgxCiTI6Cq5DZUd3Qmp10vO0LaLTd2cjN4fOumlc7lUYbSQcZFkutRG7g6JKZKy0RmdLY680CDnEJ+UMkpFFe1RN7nxdVpXrC4aTtnaurOnYercZg2YVmLN/d/gczfEimrE/fs/bOuq29Zmn8tloORaXgZgGa78yO9/cnXm2BpaGvq25Dv9S4E9+5SIc9PqupJKhYFSSl47+Qcr1mYNAAAAeNptw0cKwkAAAMDZJA8Q7OUJvkLsPfZ6zFVERPy8qHh2YER+3i/BP83vIBLLySsoKimrqKqpa2hp6+jq6RsYGhmbmJqZSy0sraxtbO3sHRydnEMU4uR6yx7JJXveP7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8CBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA")}:root{--swiper-theme-color:#007aff}:host{display:block;margin-left:auto;margin-right:auto;position:relative;z-index:1}.swiper{display:block;list-style:none;margin-left:auto;margin-right:auto;overflow:hidden;padding:0;position:relative;z-index:1}.swiper-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{box-sizing:content-box;display:flex;height:100%;position:relative;transition-property:transform;transition-timing-function:var(--swiper-wrapper-transition-timing-function,initial);width:100%;z-index:1}.swiper-android .swiper-slide,.swiper-ios .swiper-slide,.swiper-wrapper{transform:translateZ(0)}.swiper-horizontal{touch-action:pan-y}.swiper-vertical{touch-action:pan-x}.swiper-slide{display:block;flex-shrink:0;height:100%;position:relative;transition-property:transform;width:100%}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{align-items:flex-start;transition-property:transform,height}.swiper-backface-hidden .swiper-slide{-webkit-backface-visibility:hidden;backface-visibility:hidden;transform:translateZ(0)}.swiper-3d.swiper-css-mode .swiper-wrapper{perspective:1200px}.swiper-3d .swiper-wrapper{transform-style:preserve-3d}.swiper-3d{perspective:1200px}.swiper-3d .swiper-cube-shadow,.swiper-3d .swiper-slide{transform-style:preserve-3d}.swiper-css-mode>.swiper-wrapper{-ms-overflow-style:none;overflow:auto;scrollbar-width:none}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-css-mode.swiper-horizontal>.swiper-wrapper{scroll-snap-type:x mandatory}.swiper-css-mode.swiper-vertical>.swiper-wrapper{scroll-snap-type:y mandatory}.swiper-css-mode.swiper-free-mode>.swiper-wrapper{scroll-snap-type:none}.swiper-css-mode.swiper-free-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:none}.swiper-css-mode.swiper-centered>.swiper-wrapper:before{content:"";flex-shrink:0;order:9999}.swiper-css-mode.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center;scroll-snap-stop:always}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper:before{height:100%;min-height:1px;width:var(--swiper-centered-offset-after)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper:before{height:var(--swiper-centered-offset-after);min-width:1px;width:100%}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-bottom,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top{height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:10}.swiper-3d .swiper-slide-shadow{background:rgba(0,0,0,.15)}.swiper-3d .swiper-slide-shadow-left{background-image:linear-gradient(270deg,rgba(0,0,0,.5),transparent)}.swiper-3d .swiper-slide-shadow-right{background-image:linear-gradient(90deg,rgba(0,0,0,.5),transparent)}.swiper-3d .swiper-slide-shadow-top{background-image:linear-gradient(0deg,rgba(0,0,0,.5),transparent)}.swiper-3d .swiper-slide-shadow-bottom{background-image:linear-gradient(180deg,rgba(0,0,0,.5),transparent)}.swiper-lazy-preloader{border:4px solid var(--swiper-preloader-color,var(--swiper-theme-color));border-radius:50%;border-top:4px solid transparent;box-sizing:border-box;height:42px;left:50%;margin-left:-21px;margin-top:-21px;position:absolute;top:50%;transform-origin:50%;width:42px;z-index:10}.swiper-watch-progress .swiper-slide-visible .swiper-lazy-preloader,.swiper:not(.swiper-watch-progress) .swiper-lazy-preloader{animation:swiper-preloader-spin 1s linear infinite}.swiper-lazy-preloader-white{--swiper-preloader-color:#fff}.swiper-lazy-preloader-black{--swiper-preloader-color:#000}@keyframes swiper-preloader-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.swiper.swiper-cards{overflow:visible}.swiper-cards .swiper-slide{-webkit-backface-visibility:hidden;backface-visibility:hidden;overflow:hidden;transform-origin:center bottom}.swiper-grid>.swiper-wrapper{flex-wrap:wrap}.swiper-grid-column>.swiper-wrapper{flex-direction:column;flex-wrap:wrap}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false;initial-value:rotateX(0)}@property --tw-rotate-y{syntax:"*";inherits:false;initial-value:rotateY(0)}@property --tw-rotate-z{syntax:"*";inherits:false;initial-value:rotateZ(0)}@property --tw-skew-x{syntax:"*";inherits:false;initial-value:skewX(0)}@property --tw-skew-y{syntax:"*";inherits:false;initial-value:skewY(0)}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes float{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-200px)}}',lc=oc.trim().length>0,uc="undefined"!=typeof window&&"adoptedStyleSheets"in Document.prototype&&"undefined"!=typeof CSSStyleSheet&&"replaceSync"in CSSStyleSheet.prototype;let cc=null;function dc(e){return cc||(cc=new CSSStyleSheet,cc.replaceSync(e)),cc}function hc(){return lc?oc:function(){const e=[];for(const t of Array.from(document.styleSheets))try{e.push(Array.from(t.cssRules).map(e=>e.cssText).join("\n"))}catch(e){}return e.join("\n")}()}const fc=({extra:e})=>{const t=hc()+(e?"\n"+e:"");return g.createElement("style",null,t)};function pc(){const[e,t]=g.useState(null),r=p.useRef(null),{open:n,setOpen:i}=Vo();return p.useEffect(()=>{r.current&&(r.current.style.display=n?"block":"none")},[n]),g.useLayoutEffect(()=>{const e=document.createElement("div");e.style.position="fixed",e.style.inset="0",e.style.zIndex="214748348",e.style.display="none",document.body.appendChild(e),r.current=e;const n=e.attachShadow({mode:"open"});!function(e){const t=hc();if(uc)e.adoptedStyleSheets=[dc(t)];else{const r=document.createElement("style");r.textContent=t,e.appendChild(r)}}(n);const i=document.createElement("style");i.innerHTML="\n .product-dialog-container{\n max-height: 70vh;\n overflow-y: auto;\n width: 100%;\n max-width: min(82vw, 500px) !important;\n }\n ",n.appendChild(i);const s=document.createElement("div");return n.appendChild(s),t(s),()=>e.remove()},[]),{container:e,setOpen:i}}const gc=e=>{const{collectionId:t,isPreview:r,priceText:n,container:i}=e,{setIsPreview:s,setPriceText:a}=cr(),{setCollection:o,setNextKey:l,collection:u}=fr();p.useEffect(()=>{n&&a(n);const e=Boolean(r);e&&s(e)},[]),p.useEffect(()=>{J(void 0,void 0,void 0,function*(){var e;const r=yield tr({collectionId:t,size:10});if(!r)return;const{contents:n,count:i}=r;(null==n?void 0:n.length)&&l(null===(e=n.at(-1))||void 0===e?void 0:e.shortsId),o(Object.assign(Object.assign({},r),{count:i}))})},[t]);const c=function(e){var t,r,n,i,s,a,o,l,u,c,d,h;const f=null!==(t=e.iconForm)&&void 0!==t?t:z.INSTA,p={collectionId:e.collectionId,iconForm:f,iconShape:null!==(r=e.iconShape)&&void 0!==r?r:j.MANY,iconSize:null!==(n=e.iconSize)&&void 0!==n?n:120,borderLine:null!==(i=e.borderLine)&&void 0!==i?i:G.DAY,exposeTitle:null===(s=e.exposeTitle)||void 0===s||s,player:null!==(a=e.player)&&void 0!==a?a:H.POPUP,rounded:null===(o=e.rounded)||void 0===o||o,titlePosition:null!==(l=e.titlePosition)&&void 0!==l?l:V.BOTTOM,exposeProductBanner:null!==(u=e.exposeProductBanner)&&void 0!==u&&u,exposeProductBadge:null!==(c=e.exposeProductBadge)&&void 0!==c&&c,priceText:e.priceText||"할인가",hoverPlay:null!==(d=e.hoverPlay)&&void 0!==d&&d,thumbnailAutoPlay:null!==(h=e.thumbnailAutoPlay)&&void 0!==h&&h};return f===z.YOUTUBE?Object.assign(Object.assign({},p),{iconForm:z.YOUTUBE,iconRatio:e.iconRatio||"9/16"}):Object.assign(Object.assign({},p),{iconForm:z.INSTA})}(e),{containerRef:d}=function({collectionId:e,iconSize:t}){const{collection:r,setCollection:n,nextKey:i,setNextKey:s,isFetching:a,setIsFetching:o}=fr(),l=g.useRef(null),[u,c]=g.useState(0);return g.useEffect(()=>{if(!l.current)return;const e=new ResizeObserver(e=>{var t,r,n;const i=null!==(n=null===(r=null===(t=e[0])||void 0===t?void 0:t.contentRect)||void 0===r?void 0:r.width)&&void 0!==n?n:0;c(i)});return e.observe(l.current),()=>e.disconnect()},[]),g.useEffect(()=>{var e;if(!r||!r.contents)return;const l=Math.max(1,t+12),c=Math.ceil((u||0)/l)+4,d=null!==(e=r.count)&&void 0!==e?e:Number.MAX_SAFE_INTEGER,h=Math.min(d,c);if(r.contents.length>=h||a)return;let f=!1;return(()=>{J(this,void 0,void 0,function*(){var e,t,a,l,u;try{o(!0);let c=r,d=i||(null===(e=c.contents.at(-1))||void 0===e?void 0:e.shortsId)||void 0;const p=new Set(c.contents.map(e=>e.shortsId));for(;!f&&c.contents.length<h;){const e=Math.max(6,h-c.contents.length),r=yield tr({collectionId:c.colId,nextKey:d,size:e});if(!r||!(null===(t=r.contents)||void 0===t?void 0:t.length))break;d=null!==(l=null===(a=r.contents.at(-1))||void 0===a?void 0:a.shortsId)&&void 0!==l?l:d;const i=r.contents.filter(e=>!p.has(e.shortsId));if(!i.length)break;if(i.forEach(e=>p.add(e.shortsId)),c=Object.assign(Object.assign({},c),{contents:[...c.contents,...i]}),n(c),s(d||""),c.contents.length>=(null!==(u=c.count)&&void 0!==u?u:Number.MAX_SAFE_INTEGER))break}}finally{o(!1)}})})(),()=>{f=!0}},[null==r?void 0:r.colId,null==r?void 0:r.count,null==r?void 0:r.contents.length,u,t,a,i,n,o,s]),{containerRef:l}}({collectionId:t,iconSize:c.iconSize});return g.createElement(ac.div,null,g.createElement(fc,null),g.createElement("div",{ref:d},g.createElement(Iu,{widgetPlayerOption:c,setCollectionUuid:e=>{o(Object.assign(Object.assign({},u),{uuid:e}))},portalContainer:i})))},mc=({portalContainer:e,aspectRatio:t})=>{var r;const{collection:n,setNextKey:i}=fr(),[s,a]=p.useState(),{setOpen:o,open:l}=Vo();p.useEffect(()=>{l||s&&a(null)},[l]);const u=(null!==(r=On().width)&&void 0!==r?r:0)<430||Hn.isMobile;return g.createElement(g.Fragment,null,g.createElement("div",{className:"grid gap-4",style:{gridTemplateColumns:`repeat(${u?2:5}, 1fr)`}},null==n?void 0:n.contents.map(e=>g.createElement("div",null,g.createElement("div",{className:"overflow-hidden",style:{borderRadius:"0.625rem",aspectRatio:null!=t?t:"9/16"}},g.createElement("video",{loop:!0,className:"w-full h-full object-cover",muted:!0,autoPlay:!0,playsInline:!0,src:Ft(e.media.objectId),poster:Gt(e.thumbPath)})),g.createElement(Ko,{hideMoreBadge:!0,showMoreBtn:!0,products:e.productsInfo,contentId:e.shortsId,setSelectedProducts:a})))),s&&g.createElement(Au,{portalContainer:e,title:"상품 목록",contentClassName:"bg-white rounded p-4 product-dialog-container",description:"연결된 전체 상품 정보를 확인해 보세요"},g.createElement(Ru,{products:s.productsInfo,contentId:s.shortsId})))},vc=({collectionId:e,aspectRatio:t,container:r,isPreview:n})=>{const{setCollection:i,setNextKey:s}=fr();return p.useEffect(()=>{J(void 0,void 0,void 0,function*(){var t;const r=yield tr({collectionId:e,size:-1});if(!r)return;const{contents:n,count:a}=r;(null==n?void 0:n.length)&&s(null===(t=n.at(-1))||void 0===t?void 0:t.shortsId),i(Object.assign(Object.assign({},r),{count:a}))})},[e]),g.createElement(ac.div,null,g.createElement(fc,null),g.createElement(mc,{portalContainer:r,aspectRatio:t}))},yc=ur(e=>({shortform:null,setShortform:t=>e({shortform:t})}));var bc={exports:{}},wc={};function Ec(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Ec(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Sc(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Ec(e))&&(n&&(n+=" "),n+=t);return n}var Tc,kc=r(Object.freeze({__proto__:null,clsx:Sc,default:Sc})),xc={},Ac={};function Rc(){if(Tc)return Ac;return Tc=1,Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.dontSetMe=function(e,t,r){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(r," - do not set this, set it on the child."))},Ac.findInArray=function(e,t){for(let r=0,n=e.length;r<n;r++)if(t.apply(t,[e[r],r,e]))return e[r]},Ac.int=function(e){return parseInt(e,10)},Ac.isFunction=function(e){return"function"==typeof e||"[object Function]"===Object.prototype.toString.call(e)},Ac.isNum=function(e){return"number"==typeof e&&!isNaN(e)},Ac}var Lc,Ic,Cc={};function Pc(){if(Ic)return xc;Ic=1,Object.defineProperty(xc,"__esModule",{value:!0}),xc.addClassName=a,xc.addEvent=function(e,t,r,n){if(!e)return;const i={capture:!0,...n};e.addEventListener?e.addEventListener(t,r,i):e.attachEvent?e.attachEvent("on"+t,r):e["on"+t]=r},xc.addUserSelectStyles=function(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t));e.body&&a(e.body,"react-draggable-transparent-selection")},xc.createCSSTransform=function(e,r){const n=s(e,r,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:n}},xc.createSVGTransform=function(e,t){return s(e,t,"")},xc.getTouch=function(t,r){return t.targetTouches&&(0,e.findInArray)(t.targetTouches,e=>r===e.identifier)||t.changedTouches&&(0,e.findInArray)(t.changedTouches,e=>r===e.identifier)},xc.getTouchIdentifier=function(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier},xc.getTranslation=s,xc.innerHeight=function(t){let r=t.clientHeight;const n=t.ownerDocument.defaultView.getComputedStyle(t);return r-=(0,e.int)(n.paddingTop),r-=(0,e.int)(n.paddingBottom),r},xc.innerWidth=function(t){let r=t.clientWidth;const n=t.ownerDocument.defaultView.getComputedStyle(t);return r-=(0,e.int)(n.paddingLeft),r-=(0,e.int)(n.paddingRight),r},xc.matchesSelector=i,xc.matchesSelectorAndParentsTo=function(e,t,r){let n=e;do{if(i(n,t))return!0;if(n===r)return!1;n=n.parentNode}while(n);return!1},xc.offsetXYFromParent=function(e,t,r){const n=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-n.left)/r,s=(e.clientY+t.scrollTop-n.top)/r;return{x:i,y:s}},xc.outerHeight=function(t){let r=t.clientHeight;const n=t.ownerDocument.defaultView.getComputedStyle(t);return r+=(0,e.int)(n.borderTopWidth),r+=(0,e.int)(n.borderBottomWidth),r},xc.outerWidth=function(t){let r=t.clientWidth;const n=t.ownerDocument.defaultView.getComputedStyle(t);return r+=(0,e.int)(n.borderLeftWidth),r+=(0,e.int)(n.borderRightWidth),r},xc.removeClassName=o,xc.removeEvent=function(e,t,r,n){if(!e)return;const i={capture:!0,...n};e.removeEventListener?e.removeEventListener(t,r,i):e.detachEvent?e.detachEvent("on"+t,r):e["on"+t]=null},xc.removeUserSelectStyles=function(e){if(!e)return;try{if(e.body&&o(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(e){}};var e=Rc(),t=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=r(t);if(n&&n.has(e))return n.get(e);var i={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=s?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(i,a,o):i[a]=e[a]}i.default=e,n&&n.set(e,i);return i}(function(){if(Lc)return Cc;Lc=1,Object.defineProperty(Cc,"__esModule",{value:!0}),Cc.browserPrefixToKey=r,Cc.browserPrefixToStyle=function(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e},Cc.default=void 0,Cc.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){var t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window)return"";const i=null===(t=window.document)||void 0===t||null===(t=t.documentElement)||void 0===t?void 0:t.style;if(!i)return"";if(n in i)return"";for(let t=0;t<e.length;t++)if(r(n,e[t])in i)return e[t];return""}function r(e,t){return t?"".concat(t).concat(function(e){let t="",r=!0;for(let n=0;n<e.length;n++)r?(t+=e[n].toUpperCase(),r=!1):"-"===e[n]?r=!0:t+=e[n];return t}(e)):e}return Cc.default=t(),Cc}());function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(r=function(e){return e?n:t})(e)}let n="";function i(t,r){return n||(n=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(r){return(0,e.isFunction)(t[r])})),!!(0,e.isFunction)(t[n])&&t[n](r)}function s(e,t,r){let{x:n,y:i}=e,s="translate(".concat(n).concat(r,",").concat(i).concat(r,")");if(t){const e="".concat("string"==typeof t.x?t.x:t.x+r),n="".concat("string"==typeof t.y?t.y:t.y+r);s="translate(".concat(e,", ").concat(n,")")+s}return s}function a(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function o(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}return xc}var Dc,_c={};function Mc(){if(Dc)return _c;Dc=1,Object.defineProperty(_c,"__esModule",{value:!0}),_c.canDragX=function(e){return"both"===e.props.axis||"x"===e.props.axis},_c.canDragY=function(e){return"both"===e.props.axis||"y"===e.props.axis},_c.createCoreData=function(t,n,i){const s=!(0,e.isNum)(t.lastX),a=r(t);return s?{node:a,deltaX:0,deltaY:0,lastX:n,lastY:i,x:n,y:i}:{node:a,deltaX:n-t.lastX,deltaY:i-t.lastY,lastX:t.lastX,lastY:t.lastY,x:n,y:i}},_c.createDraggableData=function(e,t){const r=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/r,y:e.state.y+t.deltaY/r,deltaX:t.deltaX/r,deltaY:t.deltaY/r,lastX:e.state.x,lastY:e.state.y}},_c.getBoundPosition=function(n,i,s){if(!n.props.bounds)return[i,s];let{bounds:a}=n.props;a="string"==typeof a?a:function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(a);const o=r(n);if("string"==typeof a){const{ownerDocument:r}=o,n=r.defaultView;let i;if(i="parent"===a?o.parentNode:r.querySelector(a),!(i instanceof n.HTMLElement))throw new Error('Bounds selector "'+a+'" could not find an element.');const s=i,l=n.getComputedStyle(o),u=n.getComputedStyle(s);a={left:-o.offsetLeft+(0,e.int)(u.paddingLeft)+(0,e.int)(l.marginLeft),top:-o.offsetTop+(0,e.int)(u.paddingTop)+(0,e.int)(l.marginTop),right:(0,t.innerWidth)(s)-(0,t.outerWidth)(o)-o.offsetLeft+(0,e.int)(u.paddingRight)-(0,e.int)(l.marginRight),bottom:(0,t.innerHeight)(s)-(0,t.outerHeight)(o)-o.offsetTop+(0,e.int)(u.paddingBottom)-(0,e.int)(l.marginBottom)}}(0,e.isNum)(a.right)&&(i=Math.min(i,a.right));(0,e.isNum)(a.bottom)&&(s=Math.min(s,a.bottom));(0,e.isNum)(a.left)&&(i=Math.max(i,a.left));(0,e.isNum)(a.top)&&(s=Math.max(s,a.top));return[i,s]},_c.getControlPosition=function(e,n,i){const s="number"==typeof n?(0,t.getTouch)(e,n):null;if("number"==typeof n&&!s)return null;const a=r(i),o=i.props.offsetParent||a.offsetParent||a.ownerDocument.body;return(0,t.offsetXYFromParent)(s||e,o,i.props.scale)},_c.snapToGrid=function(e,t,r){const n=Math.round(t/e[0])*e[0],i=Math.round(r/e[1])*e[1];return[n,i]};var e=Rc(),t=Pc();function r(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}return _c}var Oc,Nc,Fc,$c,Bc={},Uc={};function zc(){if(Oc)return Uc;return Oc=1,Object.defineProperty(Uc,"__esModule",{value:!0}),Uc.default=function(){},Uc}function jc(){if(Nc)return Bc;Nc=1,Object.defineProperty(Bc,"__esModule",{value:!0}),Bc.default=void 0;var e=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=i?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}n.default=e,r&&r.set(e,n);return n}(l()),t=o(Ku()),r=o(k()),n=Pc(),i=Mc(),s=Rc(),a=o(zc());function o(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function c(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const d={start:"touchstart",move:"touchmove",stop:"touchend"},h={start:"mousedown",move:"mousemove",stop:"mouseup"};let f=h,p=class extends e.Component{constructor(){super(...arguments),c(this,"dragging",!1),c(this,"lastX",NaN),c(this,"lastY",NaN),c(this,"touchIdentifier",null),c(this,"mounted",!1),c(this,"handleDragStart",e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&"number"==typeof e.button&&0!==e.button)return!1;const t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=t;if(this.props.disabled||!(e.target instanceof r.defaultView.Node)||this.props.handle&&!(0,n.matchesSelectorAndParentsTo)(e.target,this.props.handle,t)||this.props.cancel&&(0,n.matchesSelectorAndParentsTo)(e.target,this.props.cancel,t))return;"touchstart"===e.type&&e.preventDefault();const s=(0,n.getTouchIdentifier)(e);this.touchIdentifier=s;const o=(0,i.getControlPosition)(e,s,this);if(null==o)return;const{x:l,y:u}=o,c=(0,i.createCoreData)(this,l,u);(0,a.default)("DraggableCore: handleDragStart: %j",c),(0,a.default)("calling",this.props.onStart);!1!==this.props.onStart(e,c)&&!1!==this.mounted&&(this.props.enableUserSelectHack&&(0,n.addUserSelectStyles)(r),this.dragging=!0,this.lastX=l,this.lastY=u,(0,n.addEvent)(r,f.move,this.handleDrag),(0,n.addEvent)(r,f.stop,this.handleDragStop))}),c(this,"handleDrag",e=>{const t=(0,i.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:r,y:n}=t;if(Array.isArray(this.props.grid)){let e=r-this.lastX,t=n-this.lastY;if([e,t]=(0,i.snapToGrid)(this.props.grid,e,t),!e&&!t)return;r=this.lastX+e,n=this.lastY+t}const s=(0,i.createCoreData)(this,r,n);(0,a.default)("DraggableCore: handleDrag: %j",s);if(!1!==this.props.onDrag(e,s)&&!1!==this.mounted)this.lastX=r,this.lastY=n;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch(e){const t=document.createEvent("MouseEvents");t.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(t)}}),c(this,"handleDragStop",e=>{if(!this.dragging)return;const t=(0,i.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:r,y:s}=t;if(Array.isArray(this.props.grid)){let e=r-this.lastX||0,t=s-this.lastY||0;[e,t]=(0,i.snapToGrid)(this.props.grid,e,t),r=this.lastX+e,s=this.lastY+t}const o=(0,i.createCoreData)(this,r,s);if(!1===this.props.onStop(e,o)||!1===this.mounted)return!1;const l=this.findDOMNode();l&&this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(l.ownerDocument),(0,a.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,l&&((0,a.default)("DraggableCore: Removing handlers"),(0,n.removeEvent)(l.ownerDocument,f.move,this.handleDrag),(0,n.removeEvent)(l.ownerDocument,f.stop,this.handleDragStop))}),c(this,"onMouseDown",e=>(f=h,this.handleDragStart(e))),c(this,"onMouseUp",e=>(f=h,this.handleDragStop(e))),c(this,"onTouchStart",e=>(f=d,this.handleDragStart(e))),c(this,"onTouchEnd",e=>(f=d,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,n.addEvent)(e,d.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:t}=e;(0,n.removeEvent)(t,h.move,this.handleDrag),(0,n.removeEvent)(t,d.move,this.handleDrag),(0,n.removeEvent)(t,h.stop,this.handleDragStop),(0,n.removeEvent)(t,d.stop,this.handleDragStop),(0,n.removeEvent)(e,d.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(t)}}findDOMNode(){var e,t;return null!==(e=this.props)&&void 0!==e&&e.nodeRef?null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current:r.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Bc.default=p,c(p,"displayName","DraggableCore"),c(p,"propTypes",{allowAnyClick:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),c(p,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Bc}function Gc(){return Fc||(Fc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return u.default}}),e.default=void 0;var t=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=h(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=i?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}n.default=e,r&&r.set(e,n);return n}(l()),r=d(Ku()),n=d(k()),i=d(kc),s=Pc(),a=Mc(),o=Rc(),u=d(jc()),c=d(zc());function d(e){return e&&e.__esModule?e:{default:e}}function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(h=function(e){return e?r:t})(e)}function f(){return f=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},f.apply(this,arguments)}function p(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class g extends t.Component{static getDerivedStateFromProps(e,t){let{position:r}=e,{prevPropsPosition:n}=t;return!r||n&&r.x===n.x&&r.y===n.y?null:((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:r,prevPropsPosition:n}),{x:r.x,y:r.y,prevPropsPosition:{...r}})}constructor(e){super(e),p(this,"onDragStart",(e,t)=>{(0,c.default)("Draggable: onDragStart: %j",t);if(!1===this.props.onStart(e,(0,a.createDraggableData)(this,t)))return!1;this.setState({dragging:!0,dragged:!0})}),p(this,"onDrag",(e,t)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",t);const r=(0,a.createDraggableData)(this,t),n={x:r.x,y:r.y,slackX:0,slackY:0};if(this.props.bounds){const{x:e,y:t}=n;n.x+=this.state.slackX,n.y+=this.state.slackY;const[i,s]=(0,a.getBoundPosition)(this,n.x,n.y);n.x=i,n.y=s,n.slackX=this.state.slackX+(e-n.x),n.slackY=this.state.slackY+(t-n.y),r.x=n.x,r.y=n.y,r.deltaX=n.x-this.state.x,r.deltaY=n.y-this.state.y}if(!1===this.props.onDrag(e,r))return!1;this.setState(n)}),p(this,"onDragStop",(e,t)=>{if(!this.state.dragging)return!1;if(!1===this.props.onStop(e,(0,a.createDraggableData)(this,t)))return!1;(0,c.default)("Draggable: onDragStop: %j",t);const r={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){const{x:e,y:t}=this.props.position;r.x=e,r.y=t}this.setState(r)}),this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},!e.position||e.onDrag||e.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){void 0!==window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var e,t;return null!==(e=null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current)&&void 0!==e?e:n.default.findDOMNode(this)}render(){const{axis:e,bounds:r,children:n,defaultPosition:o,defaultClassName:l,defaultClassNameDragging:c,defaultClassNameDragged:d,position:h,positionOffset:p,scale:g,...m}=this.props;let v={},y=null;const b=!Boolean(h)||this.state.dragging,w=h||o,E={x:(0,a.canDragX)(this)&&b?this.state.x:w.x,y:(0,a.canDragY)(this)&&b?this.state.y:w.y};this.state.isElementSVG?y=(0,s.createSVGTransform)(E,p):v=(0,s.createCSSTransform)(E,p);const S=(0,i.default)(n.props.className||"",l,{[c]:this.state.dragging,[d]:this.state.dragged});return t.createElement(u.default,f({},m,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(n),{className:S,style:{...n.props.style,...v},transform:y}))}}e.default=g,p(g,"displayName","Draggable"),p(g,"propTypes",{...u.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:o.dontSetMe,style:o.dontSetMe,transform:o.dontSetMe}),p(g,"defaultProps",{...u.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(wc)),wc}var Hc=function(){if($c)return bc.exports;$c=1;const{default:e,DraggableCore:t}=Gc();return bc.exports=e,bc.exports.default=e,bc.exports.DraggableCore=t,bc.exports}(),Vc=t(Hc),Wc=function(){return Wc=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Wc.apply(this,arguments)},Kc={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},Yc={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},qc={width:"20px",height:"20px",position:"absolute",zIndex:1},Xc={top:Wc(Wc({},Kc),{top:"-5px"}),right:Wc(Wc({},Yc),{left:void 0,right:"-5px"}),bottom:Wc(Wc({},Kc),{top:void 0,bottom:"-5px"}),left:Wc(Wc({},Yc),{left:"-5px"}),topRight:Wc(Wc({},qc),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:Wc(Wc({},qc),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:Wc(Wc({},qc),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:Wc(Wc({},qc),{left:"-10px",top:"-10px",cursor:"nw-resize"})},Qc=p.memo(function(e){var t=e.onResizeStart,r=e.direction,n=e.children,i=e.replaceStyles,s=e.className,a=p.useCallback(function(e){t(e,r)},[t,r]),o=p.useCallback(function(e){t(e,r)},[t,r]),l=p.useMemo(function(){return Wc(Wc({position:"absolute",userSelect:"none"},Xc[r]),null!=i?i:{})},[i,r]);return Si.jsx("div",{className:s||void 0,style:l,onMouseDown:a,onTouchStart:o,children:n})}),Zc=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Jc=function(){return Jc=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Jc.apply(this,arguments)},ed={width:"auto",height:"auto"},td=function(e,t,r){return Math.max(Math.min(e,r),t)},rd=function(e,t,r){var n=Math.round(e/t);return n*t+r*(n-1)},nd=function(e,t){return new RegExp(e,"i").test(t)},id=function(e){return Boolean(e.touches&&e.touches.length)},sd=function(e,t,r){void 0===r&&(r=0);var n=t.reduce(function(r,n,i){return Math.abs(n-e)<Math.abs(t[r]-e)?i:r},0),i=Math.abs(t[n]-e);return 0===r||i<r?t[n]:e},ad=function(e){return"auto"===(e=e.toString())||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:"".concat(e,"px")},od=function(e,t,r,n){if(e&&"string"==typeof e){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%"))return t*(Number(e.replace("%",""))/100);if(e.endsWith("vw"))return r*(Number(e.replace("vw",""))/100);if(e.endsWith("vh"))return n*(Number(e.replace("vh",""))/100)}return e},ld=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],ud="__resizable_base__",cd=function(e){function t(t){var r,n,i,s,a=e.call(this,t)||this;return a.ratio=1,a.resizable=null,a.parentLeft=0,a.parentTop=0,a.resizableLeft=0,a.resizableRight=0,a.resizableTop=0,a.resizableBottom=0,a.targetLeft=0,a.targetTop=0,a.delta={width:0,height:0},a.appendBase=function(){if(!a.resizable||!a.window)return null;var e=a.parentNode;if(!e)return null;var t=a.window.document.createElement("div");return t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.transform="scale(0, 0)",t.style.left="0",t.style.flex="0 0 100%",t.classList?t.classList.add(ud):t.className+=ud,e.appendChild(t),t},a.removeBase=function(e){var t=a.parentNode;t&&t.removeChild(e)},a.state={isResizing:!1,width:null!==(n=null===(r=a.propsSize)||void 0===r?void 0:r.width)&&void 0!==n?n:"auto",height:null!==(s=null===(i=a.propsSize)||void 0===i?void 0:i.height)&&void 0!==s?s:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},a.onResizeStart=a.onResizeStart.bind(a),a.onMouseMove=a.onMouseMove.bind(a),a.onMouseUp=a.onMouseUp.bind(a),a}return Zc(t,e),Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||ed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var e=0,t=0;if(this.resizable&&this.window){var r=this.resizable.offsetWidth,n=this.resizable.offsetHeight,i=this.resizable.style.position;"relative"!==i&&(this.resizable.style.position="relative"),e="auto"!==this.resizable.style.width?this.resizable.offsetWidth:r,t="auto"!==this.resizable.style.height?this.resizable.offsetHeight:n,this.resizable.style.position=i}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var e=this,t=this.props.size,r=function(t){var r;if(void 0===e.state[t]||"auto"===e.state[t])return"auto";if(e.propsSize&&e.propsSize[t]&&(null===(r=e.propsSize[t])||void 0===r?void 0:r.toString().endsWith("%"))){if(e.state[t].toString().endsWith("%"))return e.state[t].toString();var n=e.getParentSize(),i=Number(e.state[t].toString().replace("px",""))/n[t]*100;return"".concat(i,"%")}return ad(e.state[t])};return{width:t&&void 0!==t.width&&!this.state.isResizing?ad(t.width):r("width"),height:t&&void 0!==t.height&&!this.state.isResizing?ad(t.height):r("height")}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,r=this.parentNode.style.flexWrap;"wrap"!==r&&(t=!0,this.parentNode.style.flexWrap="wrap"),e.style.position="relative",e.style.minWidth="100%",e.style.minHeight="100%";var n={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=r),this.removeBase(e),n},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(this.resizable&&this.window){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==e.flexBasis?e.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(e,t){var r=this.propsSize&&this.propsSize[t];return"auto"!==this.state[t]||this.state.original[t]!==e||void 0!==r&&"auto"!==r?e:"auto"},t.prototype.calculateNewMaxFromBoundary=function(e,t){var r,n,i=this.props.boundsByDirection,s=this.state.direction,a=i&&nd("left",s),o=i&&nd("top",s);if("parent"===this.props.bounds){var l=this.parentNode;l&&(r=a?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),n=o?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(r=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,n=o?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(r=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),n=o?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return r&&Number.isFinite(r)&&(e=e&&e<r?e:r),n&&Number.isFinite(n)&&(t=t&&t<n?t:n),{maxWidth:e,maxHeight:t}},t.prototype.calculateNewSizeFromDirection=function(e,t){var r,n=this.props.scale||1,i=(r=this.props.resizeRatio||1,Array.isArray(r)?r:[r,r]),s=i[0],a=i[1],o=this.state,l=o.direction,u=o.original,c=this.props,d=c.lockAspectRatio,h=c.lockAspectRatioExtraHeight,f=c.lockAspectRatioExtraWidth,p=u.width,g=u.height,m=h||0,v=f||0;return nd("right",l)&&(p=u.width+(e-u.x)*s/n,d&&(g=(p-v)/this.ratio+m)),nd("left",l)&&(p=u.width-(e-u.x)*s/n,d&&(g=(p-v)/this.ratio+m)),nd("bottom",l)&&(g=u.height+(t-u.y)*a/n,d&&(p=(g-m)*this.ratio+v)),nd("top",l)&&(g=u.height-(t-u.y)*a/n,d&&(p=(g-m)*this.ratio+v)),{newWidth:p,newHeight:g}},t.prototype.calculateNewSizeFromAspectRatio=function(e,t,r,n){var i=this.props,s=i.lockAspectRatio,a=i.lockAspectRatioExtraHeight,o=i.lockAspectRatioExtraWidth,l=void 0===n.width?10:n.width,u=void 0===r.width||r.width<0?e:r.width,c=void 0===n.height?10:n.height,d=void 0===r.height||r.height<0?t:r.height,h=a||0,f=o||0;if(s){var p=(c-h)*this.ratio+f,g=(d-h)*this.ratio+f,m=(l-f)/this.ratio+h,v=(u-f)/this.ratio+h,y=Math.max(l,p),b=Math.min(u,g),w=Math.max(c,m),E=Math.min(d,v);e=td(e,y,b),t=td(t,w,E)}else e=td(e,l,u),t=td(t,c,d);return{newWidth:e,newHeight:t}},t.prototype.setBoundingClientRect=function(){var e=1/(this.props.scale||1);if("parent"===this.props.bounds){var t=this.parentNode;if(t){var r=t.getBoundingClientRect();this.parentLeft=r.left*e,this.parentTop=r.top*e}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var n=this.props.bounds.getBoundingClientRect();this.targetLeft=n.left*e,this.targetTop=n.top*e}if(this.resizable){var i=this.resizable.getBoundingClientRect(),s=i.left,a=i.top,o=i.right,l=i.bottom;this.resizableLeft=s*e,this.resizableRight=o*e,this.resizableTop=a*e,this.resizableBottom=l*e}},t.prototype.onResizeStart=function(e,t){if(this.resizable&&this.window){var r,n=0,i=0;if(e.nativeEvent&&function(e){return Boolean((e.clientX||0===e.clientX)&&(e.clientY||0===e.clientY))}(e.nativeEvent)?(n=e.nativeEvent.clientX,i=e.nativeEvent.clientY):e.nativeEvent&&id(e.nativeEvent)&&(n=e.nativeEvent.touches[0].clientX,i=e.nativeEvent.touches[0].clientY),this.props.onResizeStart)if(this.resizable)if(!1===this.props.onResizeStart(e,t,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var s=this.window.getComputedStyle(this.resizable);if("auto"!==s.flexBasis){var a=this.parentNode;if(a){var o=this.window.getComputedStyle(a).flexDirection;this.flexDir=o.startsWith("row")?"row":"column",r=s.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:n,y:i,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Jc(Jc({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||"auto"}),direction:t,flexBasis:r};this.setState(l)}},t.prototype.onMouseMove=function(e){var t=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&id(e))try{e.preventDefault(),e.stopPropagation()}catch(e){}var r=this.props,n=r.maxWidth,i=r.maxHeight,s=r.minWidth,a=r.minHeight,o=id(e)?e.touches[0].clientX:e.clientX,l=id(e)?e.touches[0].clientY:e.clientY,u=this.state,c=u.direction,d=u.original,h=u.width,f=u.height,p=this.getParentSize(),g=function(e,t,r,n,i,s,a){return n=od(n,e.width,t,r),i=od(i,e.height,t,r),s=od(s,e.width,t,r),a=od(a,e.height,t,r),{maxWidth:void 0===n?void 0:Number(n),maxHeight:void 0===i?void 0:Number(i),minWidth:void 0===s?void 0:Number(s),minHeight:void 0===a?void 0:Number(a)}}(p,this.window.innerWidth,this.window.innerHeight,n,i,s,a);n=g.maxWidth,i=g.maxHeight,s=g.minWidth,a=g.minHeight;var m=this.calculateNewSizeFromDirection(o,l),v=m.newHeight,y=m.newWidth,b=this.calculateNewMaxFromBoundary(n,i);this.props.snap&&this.props.snap.x&&(y=sd(y,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(v=sd(v,this.props.snap.y,this.props.snapGap));var w=this.calculateNewSizeFromAspectRatio(y,v,{width:b.maxWidth,height:b.maxHeight},{width:s,height:a});if(y=w.newWidth,v=w.newHeight,this.props.grid){var E=rd(y,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),S=rd(v,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),T=this.props.snapGap||0;y=0===T||Math.abs(E-y)<=T?E:y,v=0===T||Math.abs(S-v)<=T?S:v}var k={width:y-d.width,height:v-d.height};if(this.delta=k,h&&"string"==typeof h)if(h.endsWith("%")){var x=y/p.width*100;y="".concat(x,"%")}else if(h.endsWith("vw")){var A=y/this.window.innerWidth*100;y="".concat(A,"vw")}else if(h.endsWith("vh")){var R=y/this.window.innerHeight*100;y="".concat(R,"vh")}if(f&&"string"==typeof f)if(f.endsWith("%")){x=v/p.height*100;v="".concat(x,"%")}else if(f.endsWith("vw")){A=v/this.window.innerWidth*100;v="".concat(A,"vw")}else if(f.endsWith("vh")){R=v/this.window.innerHeight*100;v="".concat(R,"vh")}var L={width:this.createSizeForCssProperty(y,"width"),height:this.createSizeForCssProperty(v,"height")};"row"===this.flexDir?L.flexBasis=L.width:"column"===this.flexDir&&(L.flexBasis=L.height);var I=this.state.width!==L.width,C=this.state.height!==L.height,P=this.state.flexBasis!==L.flexBasis,D=I||C||P;D&&Ci.flushSync(function(){t.setState(L)}),this.props.onResize&&D&&this.props.onResize(e,c,this.resizable,k)}},t.prototype.onMouseUp=function(e){var t,r,n=this.state,i=n.isResizing,s=n.direction;n.original,i&&this.resizable&&(this.props.onResizeStop&&this.props.onResizeStop(e,s,this.resizable,this.delta),this.props.size&&this.setState({width:null!==(t=this.props.size.width)&&void 0!==t?t:"auto",height:null!==(r=this.props.size.height)&&void 0!==r?r:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Jc(Jc({},this.state.backgroundStyle),{cursor:"auto"})}))},t.prototype.updateSize=function(e){var t,r;this.setState({width:null!==(t=e.width)&&void 0!==t?t:"auto",height:null!==(r=e.height)&&void 0!==r?r:"auto"})},t.prototype.renderResizer=function(){var e=this,t=this.props,r=t.enable,n=t.handleStyles,i=t.handleClasses,s=t.handleWrapperStyle,a=t.handleWrapperClass,o=t.handleComponent;if(!r)return null;var l=Object.keys(r).map(function(t){return!1!==r[t]?Si.jsx(Qc,{direction:t,onResizeStart:e.onResizeStart,replaceStyles:n&&n[t],className:i&&i[t],children:o&&o[t]?o[t]:null},t):null});return Si.jsx("div",{className:a,style:s,children:l})},t.prototype.render=function(){var e=this,t=Object.keys(this.props).reduce(function(t,r){return-1!==ld.indexOf(r)||(t[r]=e.props[r]),t},{}),r=Jc(Jc(Jc({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(r.flexBasis=this.state.flexBasis);var n=this.props.as||"div";return Si.jsxs(n,Jc({style:r,className:this.props.className},t,{ref:function(t){t&&(e.resizable=t)},children:[this.state.isResizing&&Si.jsx("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(p.PureComponent),dd=function(e,t){return dd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},dd(e,t)};var hd=function(){return hd=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},hd.apply(this,arguments)};var fd={width:"auto",height:"auto",display:"inline-block",position:"absolute",top:0,left:0},pd=function(e){function t(t){var r=e.call(this,t)||this;return r.resizingPosition={x:0,y:0},r.offsetFromParent={left:0,top:0},r.resizableElement={current:null},r.originalPosition={x:0,y:0},r.state={resizing:!1,bounds:{top:0,right:0,bottom:0,left:0},maxWidth:t.maxWidth,maxHeight:t.maxHeight},r.onResizeStart=r.onResizeStart.bind(r),r.onResize=r.onResize.bind(r),r.onResizeStop=r.onResizeStop.bind(r),r.onDragStart=r.onDragStart.bind(r),r.onDrag=r.onDrag.bind(r),r.onDragStop=r.onDragStop.bind(r),r.getMaxSizesFromProps=r.getMaxSizesFromProps.bind(r),r}return function(e,t){function r(){this.constructor=e}dd(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t.prototype.componentDidMount=function(){this.updateOffsetFromParent();var e=this.offsetFromParent,t=e.left,r=e.top,n=this.getDraggablePosition(),i=n.x,s=n.y;this.draggable.setState({x:i-t,y:s-r}),this.forceUpdate()},t.prototype.getDraggablePosition=function(){var e=this.draggable.state;return{x:e.x,y:e.y}},t.prototype.getParent=function(){return this.resizable&&this.resizable.parentNode},t.prototype.getParentSize=function(){return this.resizable.getParentSize()},t.prototype.getMaxSizesFromProps=function(){return{maxWidth:void 0===this.props.maxWidth?Number.MAX_SAFE_INTEGER:this.props.maxWidth,maxHeight:void 0===this.props.maxHeight?Number.MAX_SAFE_INTEGER:this.props.maxHeight}},t.prototype.getSelfElement=function(){return this.resizable&&this.resizable.resizable},t.prototype.getOffsetHeight=function(e){var t=this.props.scale;switch(this.props.bounds){case"window":return window.innerHeight/t;case"body":return document.body.offsetHeight/t;default:return e.offsetHeight}},t.prototype.getOffsetWidth=function(e){var t=this.props.scale;switch(this.props.bounds){case"window":return window.innerWidth/t;case"body":return document.body.offsetWidth/t;default:return e.offsetWidth}},t.prototype.onDragStart=function(e,t){this.props.onDragStart&&this.props.onDragStart(e,t);var r=this.getDraggablePosition();if(this.originalPosition=r,this.props.bounds){var n,i=this.getParent(),s=this.props.scale;if("parent"===this.props.bounds)n=i;else{if("body"===this.props.bounds){var a=i.getBoundingClientRect(),o=a.left,l=a.top,u=document.body.getBoundingClientRect(),c=-(o-i.offsetLeft*s-u.left)/s,d=-(l-i.offsetTop*s-u.top)/s,h=(document.body.offsetWidth-this.resizable.size.width*s)/s+c,f=(document.body.offsetHeight-this.resizable.size.height*s)/s+d;return this.setState({bounds:{top:d,right:h,bottom:f,left:c}})}if("window"===this.props.bounds){if(!this.resizable)return;var p=i.getBoundingClientRect(),g=p.left,m=p.top,v=-(g-i.offsetLeft*s)/s,y=-(m-i.offsetTop*s)/s;h=(window.innerWidth-this.resizable.size.width*s)/s+v,f=(window.innerHeight-this.resizable.size.height*s)/s+y;return this.setState({bounds:{top:y,right:h,bottom:f,left:v}})}"string"==typeof this.props.bounds?n=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(n=this.props.bounds)}if(n instanceof HTMLElement&&i instanceof HTMLElement){var b=n.getBoundingClientRect(),w=b.left,E=b.top,S=i.getBoundingClientRect(),T=(w-S.left)/s,k=E-S.top;if(this.resizable){this.updateOffsetFromParent();var x=this.offsetFromParent;this.setState({bounds:{top:k-x.top,right:T+(n.offsetWidth-this.resizable.size.width)-x.left/s,bottom:k+(n.offsetHeight-this.resizable.size.height)-x.top,left:T-x.left/s}})}}}},t.prototype.onDrag=function(e,t){if(this.props.onDrag){var r=this.offsetFromParent,n=r.left,i=r.top;return this.props.dragAxis&&"both"!==this.props.dragAxis?"x"===this.props.dragAxis?this.props.onDrag(e,hd(hd({},t),{x:t.x+n,y:this.originalPosition.y+i,deltaY:0})):"y"===this.props.dragAxis?this.props.onDrag(e,hd(hd({},t),{x:this.originalPosition.x+n,y:t.y+i,deltaX:0})):void 0:this.props.onDrag(e,hd(hd({},t),{x:t.x+n,y:t.y+i}))}},t.prototype.onDragStop=function(e,t){if(this.props.onDragStop){var r=this.offsetFromParent,n=r.left,i=r.top;return this.props.dragAxis&&"both"!==this.props.dragAxis?"x"===this.props.dragAxis?this.props.onDragStop(e,hd(hd({},t),{x:t.x+n,y:this.originalPosition.y+i,deltaY:0})):"y"===this.props.dragAxis?this.props.onDragStop(e,hd(hd({},t),{x:this.originalPosition.x+n,y:t.y+i,deltaX:0})):void 0:this.props.onDragStop(e,hd(hd({},t),{x:t.x+n,y:t.y+i}))}},t.prototype.onResizeStart=function(e,t,r){e.stopPropagation(),this.setState({resizing:!0});var n=this.props.scale,i=this.offsetFromParent,s=this.getDraggablePosition();if(this.resizingPosition={x:s.x+i.left,y:s.y+i.top},this.originalPosition=s,this.props.bounds){var a=this.getParent(),o=void 0;"parent"===this.props.bounds?o=a:"body"===this.props.bounds?o=document.body:"window"===this.props.bounds?o=window:"string"==typeof this.props.bounds?o=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(o=this.props.bounds);var l=this.getSelfElement();if(l instanceof Element&&(o instanceof HTMLElement||o===window)&&a instanceof HTMLElement){var u=this.getMaxSizesFromProps(),c=u.maxWidth,d=u.maxHeight,h=this.getParentSize();if(c&&"string"==typeof c)if(c.endsWith("%")){var f=Number(c.replace("%",""))/100;c=h.width*f}else c.endsWith("px")&&(c=Number(c.replace("px","")));if(d&&"string"==typeof d)if(d.endsWith("%")){f=Number(d.replace("%",""))/100;d=h.height*f}else d.endsWith("px")&&(d=Number(d.replace("px","")));var p=l.getBoundingClientRect(),g=p.left,m=p.top,v="window"===this.props.bounds?{left:0,top:0}:o.getBoundingClientRect(),y=v.left,b=v.top,w=this.getOffsetWidth(o),E=this.getOffsetHeight(o),S=t.toLowerCase().endsWith("left"),T=t.toLowerCase().endsWith("right"),k=t.startsWith("top"),x=t.startsWith("bottom");if((S||k)&&this.resizable){var A=(g-y)/n+this.resizable.size.width;this.setState({maxWidth:A>Number(c)?c:A})}if(T||this.props.lockAspectRatio&&!S&&!k){A=w+(y-g)/n;this.setState({maxWidth:A>Number(c)?c:A})}if((k||S)&&this.resizable){A=(m-b)/n+this.resizable.size.height;this.setState({maxHeight:A>Number(d)?d:A})}if(x||this.props.lockAspectRatio&&!k&&!S){A=E+(b-m)/n;this.setState({maxHeight:A>Number(d)?d:A})}}}else this.setState({maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight});this.props.onResizeStart&&this.props.onResizeStart(e,t,r)},t.prototype.onResize=function(e,t,r,n){var i=this,s={x:this.originalPosition.x,y:this.originalPosition.y},a=-n.width,o=-n.height;["top","left","topLeft","bottomLeft","topRight"].includes(t)&&("bottomLeft"===t?s.x+=a:("topRight"===t||(s.x+=a),s.y+=o));var l=this.draggable.state;s.x===l.x&&s.y===l.y||Ci.flushSync(function(){i.draggable.setState(s)}),this.updateOffsetFromParent();var u=this.offsetFromParent,c=this.getDraggablePosition().x+u.left,d=this.getDraggablePosition().y+u.top;this.resizingPosition={x:c,y:d},this.props.onResize&&this.props.onResize(e,t,r,n,{x:c,y:d})},t.prototype.onResizeStop=function(e,t,r,n){this.setState({resizing:!1});var i=this.getMaxSizesFromProps(),s=i.maxWidth,a=i.maxHeight;this.setState({maxWidth:s,maxHeight:a}),this.props.onResizeStop&&this.props.onResizeStop(e,t,r,n,this.resizingPosition)},t.prototype.updateSize=function(e){this.resizable&&this.resizable.updateSize({width:e.width,height:e.height})},t.prototype.updatePosition=function(e){this.draggable.setState(e)},t.prototype.updateOffsetFromParent=function(){var e=this.props.scale,t=this.getParent(),r=this.getSelfElement();if(!t||null===r)return{top:0,left:0};var n=t.getBoundingClientRect(),i=n.left,s=n.top,a=r.getBoundingClientRect(),o=this.getDraggablePosition(),l=t.scrollLeft,u=t.scrollTop;this.offsetFromParent={left:a.left-i+l-o.x*e,top:a.top-s+u-o.y*e}},t.prototype.render=function(){var e=this,t=this.props,r=t.disableDragging,n=t.style,i=t.dragHandleClassName,s=t.position,a=t.onMouseDown,o=t.onMouseUp,l=t.dragAxis,u=t.dragGrid,c=t.bounds,d=t.enableUserSelectHack,h=t.cancel,f=t.children;t.onResizeStart,t.onResize,t.onResizeStop,t.onDragStart,t.onDrag,t.onDragStop;var g=t.resizeHandleStyles,m=t.resizeHandleClasses,v=t.resizeHandleComponent,y=t.enableResizing,b=t.resizeGrid,w=t.resizeHandleWrapperClass,E=t.resizeHandleWrapperStyle,S=t.scale,T=t.allowAnyClick,k=t.dragPositionOffset,x=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(t,["disableDragging","style","dragHandleClassName","position","onMouseDown","onMouseUp","dragAxis","dragGrid","bounds","enableUserSelectHack","cancel","children","onResizeStart","onResize","onResizeStop","onDragStart","onDrag","onDragStop","resizeHandleStyles","resizeHandleClasses","resizeHandleComponent","enableResizing","resizeGrid","resizeHandleWrapperClass","resizeHandleWrapperStyle","scale","allowAnyClick","dragPositionOffset"]),A=this.props.default?hd({},this.props.default):void 0;delete x.default;var R,L=r||i?{cursor:"auto"}:{cursor:"move"},I=hd(hd(hd({},fd),L),n),C=this.offsetFromParent,P=C.left,D=C.top;s&&(R={x:s.x-P,y:s.y-D});var _,M=this.state.resizing?void 0:R,O=this.state.resizing?"both":l;return p.createElement(Vc,{ref:function(t){t&&(e.draggable=t)},handle:i?".".concat(i):void 0,defaultPosition:A,onMouseDown:a,onMouseUp:o,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,axis:O,disabled:r,grid:u,bounds:c?this.state.bounds:void 0,position:M,enableUserSelectHack:d,cancel:h,scale:S,allowAnyClick:T,nodeRef:this.resizableElement,positionOffset:k},p.createElement(cd,hd({},x,{ref:function(t){t&&(e.resizable=t,e.resizableElement.current=t.resizable)},defaultSize:A,size:this.props.size,enable:"boolean"==typeof y?(_=y,{bottom:_,bottomLeft:_,bottomRight:_,left:_,right:_,top:_,topLeft:_,topRight:_}):y,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,style:I,minWidth:this.props.minWidth,minHeight:this.props.minHeight,maxWidth:this.state.resizing?this.state.maxWidth:this.props.maxWidth,maxHeight:this.state.resizing?this.state.maxHeight:this.props.maxHeight,grid:b,handleWrapperClass:w,handleWrapperStyle:E,lockAspectRatio:this.props.lockAspectRatio,lockAspectRatioExtraWidth:this.props.lockAspectRatioExtraWidth,lockAspectRatioExtraHeight:this.props.lockAspectRatioExtraHeight,handleStyles:g,handleClasses:m,handleComponent:v,scale:this.props.scale}),f))},t.defaultProps={maxWidth:Number.MAX_SAFE_INTEGER,maxHeight:Number.MAX_SAFE_INTEGER,scale:1,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},onDragStart:function(){},onDrag:function(){},onDragStop:function(){}},t}(p.PureComponent);const gd=({shortform:e,mute:t,play:r})=>{const n=Ft(e.media.objectId);return Object.assign({hideProducts:!0},e.playerSettings),g.createElement("div",{className:"relative w-full h-full text-white"},g.createElement(ai,{file:n,mute:t,play:r}))},md=({shortform:e,setClose:t})=>{const[r,n]=g.useState(!0),[i,s]=p.useState(!0),[a,o]=p.useState(!1),l=g.useRef(null),u=()=>{l.current&&(window.clearTimeout(l.current),l.current=null)},c=(e=1500)=>{u(),l.current=window.setTimeout(()=>o(!1),e)};return p.useEffect(()=>()=>u(),[]),g.createElement("div",{className:"relative w-full h-full",onClick:()=>{o(!0),c(2e3)},onMouseLeave:()=>c(800),onMouseEnter:()=>a&&c(1500)},g.createElement("div",{className:"absolute inset-0 bg-black",style:{zIndex:1,opacity:a?.4:0,transition:"opacity 300ms ease",pointerEvents:a?"auto":"none"}}),g.createElement("div",{className:"absolute inset-0",style:{zIndex:2,opacity:a?1:0,transition:"opacity 300ms ease",pointerEvents:a?"auto":"none"}},g.createElement("div",{className:"absolute text-white flex gap-2",style:{zIndex:3,top:8,right:8}},g.createElement("button",{className:"cursor-pointer",onClick:e=>{e.stopPropagation(),n(e=>!e)},"aria-label":r?"Unmute":"Mute"},r?g.createElement(ii,{size:20}):g.createElement(ni,{size:20})),g.createElement("button",{className:"cursor-pointer",onClick:e=>{null==e||e.stopPropagation(),t()},"aria-label":"Close"},g.createElement(si,{size:20}))),g.createElement("div",{className:"absolute inset-0 flex items-center justify-center",style:{pointerEvents:"none"}},g.createElement("button",{onClick:e=>{null==e||e.stopPropagation(),s(e=>!e)},"aria-label":i?"Pause":"Play",className:"cursor-pointer text-white p-2 ",style:{pointerEvents:"auto"}},i?g.createElement(ei,{size:28}):g.createElement(ti,{size:28})))),g.createElement(gd,{shortform:e,mute:r,play:i}))},vd=({shortsId:e,type:t})=>{const{shortform:r}=yc(),[n,i]=p.useState(!1),{playtime:s}=Kt(),a=()=>{if(!r)return;i(!0);const{shortsId:e,uuid:t,userId:n}=r;Qt({contentId:e,uuid:t,type:X.SHORTS,playtime:s,userId:n})};(({shorform:e,playtime:t})=>{p.useEffect(()=>{if(!e)return;const{shortsId:t,shortsUuid:r,userId:n}=e;Xt({contentId:t,uuid:r,type:X.SHORTS,userId:n,isFirstPlay:!zt(t)})},[]);const r=ne();p.useEffect(()=>{if(!e||r)return;const{shortsId:n,uuid:i,userId:s}=e;Qt({contentId:n,uuid:i,type:X.SHORTS,playtime:t,userId:s})},[r])})({shorform:r,playtime:s});const{w:o,h:l,left:u,top:c}=(()=>{const e=window.visualViewport;return e?{w:e.width,h:e.height,left:e.offsetLeft,top:e.offsetTop}:{w:window.innerWidth,h:window.innerHeight,left:0,top:0}})();return r&&!n&&g.createElement(pd,{minWidth:240,lockAspectRatio:9/16,style:{zIndex:99999},default:{width:240,height:427,x:u+o-240-50,y:c+l-427-50},bounds:"window"},"shopping"===t&&r.productsInfo.length>0?g.createElement($o,{shortForm:r,handleClose:a}):g.createElement(md,{shortform:r,setClose:a}))};var yd;!function(e){e[e.PLATFORM=1]="PLATFORM",e[e.GRID=2]="GRID",e[e.VERTICAL=3]="VERTICAL",e[e.HORIZONTAL=4]="HORIZONTAL"}(yd||(yd={}));const bd=ur(e=>({liveWidget:null,setLiveWidget:t=>e({liveWidget:t}),nextKey:"",setNextKey:t=>e({nextKey:t}),isFetching:!1,setIsFetching:t=>e({isFetching:t})})),wd=({opacity:e=.4,className:t})=>{const r=Math.max(0,Math.min(1,e));return g.createElement("div",{"aria-hidden":!0,role:"presentation",className:`absolute inset-0 pointer-events-none ${null!=t?t:""}`,style:{backgroundColor:`rgba(0,0,0,${r})`,borderRadius:"inherit"}})},Ed=({content:e})=>{const{PLAYER_BASE_URL:t}=Mt();return g.createElement("iframe",{src:`${t}/live/${e.eventId}`,className:"w-full h-full block",style:{border:0,display:"block"},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,scrolling:"no",referrerPolicy:"no-referrer-when-downgrade"})},Sd=(e,t)=>{const[r,n]=g.useState({}),[i,s]=g.useState({primary:20,secondary:12});return g.useEffect(()=>{const r=t.current;if(!r)return;const i=()=>{const t=r.getBoundingClientRect(),i=Math.max(0,Math.floor(t.width)),a=Math.max(0,Math.floor(t.height)),[o,l]=e.includes("/")?e.split("/").map(e=>parseFloat(e)):[1,1],u=l/o;let c,d;i>0&&a>0?(c=i,d=Math.round(c*u),d>a&&(d=a,c=Math.round(d/u)),n({width:c,height:d})):n({});const h="number"==typeof c?c:i,f=Math.max(16,Math.round(.075*h)),p=Math.max(11,Math.round(.042*h));s({primary:f,secondary:p})};if("undefined"!=typeof ResizeObserver){const e=new ResizeObserver(()=>i());return e.observe(r),()=>e.disconnect()}{const e=()=>i();return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}},[e]),{fontSize:i,boxSize:r}},Td=({content:e,aspectRatio:t="9/16",cursor:r="default",borderRadius:n})=>{var i,s;const{leftTime:a}=(e=>{const{start:t}=e,r=vt().tz("Asia/Seoul").unix(),[n,i]=p.useState(t-r>0?t-r:0);return Wt(()=>{i(n<=0?0:e=>e-1)},1e3),{leftTime:n}})(e),o=null===(s=null===(i=null==e?void 0:e.designInfo)||void 0===i?void 0:i.thumbPath)||void 0===s?void 0:s.preview,l=g.useRef(null),{boxSize:u,fontSize:c}=Sd(t,l),{PLAYER_BASE_URL:d}=Mt(),h=Math.floor(Date.now()/1e3),f="number"==typeof e.end&&e.end>0&&e.end<h;return g.createElement("div",{className:"w-full h-full flex items-center justify-center",ref:l},g.createElement("div",{className:"relative rounded overflow-hidden",style:{width:u.width?`${u.width}px`:"100%",height:u.height?`${u.height}px`:"100%",borderRadius:`${null!=n?n:10}px`,backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:u.height?void 0:t,backgroundImage:o?`url(${Gt(o)})`:void 0,backgroundColor:o?void 0:"black"}},1===e.openStatus?g.createElement(g.Fragment,null,g.createElement(Ed,{content:e}),g.createElement("a",{href:`${d}/live/${e.eventId}`,target:"_blank",rel:"noopener noreferrer","aria-label":`${e.eventName} 바로가기`,style:{position:"absolute",inset:0,zIndex:30,display:"block",textDecoration:"none",cursor:"pointer",background:"transparent"}})):f?g.createElement(g.Fragment,null,g.createElement(wd,null),g.createElement("div",{className:"text-white flex flex-col items-center justify-center absolute inset-0",style:{zIndex:10,gap:"12px",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",cursor:r,pointerEvents:"none"}},g.createElement("p",{style:{fontSize:`${c.primary}px`,fontWeight:700}},"다시보기"),g.createElement("p",{style:{fontSize:`${c.secondary}px`}},"라이브가 종료되었습니다"))):g.createElement(g.Fragment,null,g.createElement(wd,null),g.createElement("div",{className:"text-white flex flex-col items-center justify-center absolute inset-0",style:{zIndex:10,gap:"20px",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",cursor:r,pointerEvents:"none"}},g.createElement("p",{style:{fontSize:`${c.primary}px`}},((e,t)=>{if(e>86400)return vt.unix(t).tz("Asia/Seoul").format("M월 D일 A h시 mm분");const r=vt.duration(e,"seconds");return`${r.hours().toString().padStart(2,"0")}:${r.minutes().toString().padStart(2,"0")}:${r.seconds().toString().padStart(2,"0")}`})(a,e.start)),g.createElement("p",{style:{fontSize:`${c.secondary}px`}},"곧 라이브가 시작됩니다!")))))},kd=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},xd=Number.isSafeInteger||function(e){return"number"==typeof e&&Math.abs(e)<=Ad},Ad=Number.MAX_SAFE_INTEGER||9007199254740991;let Rd=function(e){return e.NETWORK_ERROR="networkError",e.MEDIA_ERROR="mediaError",e.KEY_SYSTEM_ERROR="keySystemError",e.MUX_ERROR="muxError",e.OTHER_ERROR="otherError",e}({}),Ld=function(e){return e.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",e.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",e.KEY_SYSTEM_NO_SESSION="keySystemNoSession",e.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",e.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",e.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",e.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",e.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",e.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",e.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",e.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",e.MANIFEST_LOAD_ERROR="manifestLoadError",e.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",e.MANIFEST_PARSING_ERROR="manifestParsingError",e.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",e.LEVEL_EMPTY_ERROR="levelEmptyError",e.LEVEL_LOAD_ERROR="levelLoadError",e.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",e.LEVEL_PARSING_ERROR="levelParsingError",e.LEVEL_SWITCH_ERROR="levelSwitchError",e.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",e.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",e.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",e.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",e.FRAG_LOAD_ERROR="fragLoadError",e.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",e.FRAG_DECRYPT_ERROR="fragDecryptError",e.FRAG_PARSING_ERROR="fragParsingError",e.FRAG_GAP="fragGap",e.REMUX_ALLOC_ERROR="remuxAllocError",e.KEY_LOAD_ERROR="keyLoadError",e.KEY_LOAD_TIMEOUT="keyLoadTimeOut",e.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",e.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",e.BUFFER_APPEND_ERROR="bufferAppendError",e.BUFFER_APPENDING_ERROR="bufferAppendingError",e.BUFFER_STALLED_ERROR="bufferStalledError",e.BUFFER_FULL_ERROR="bufferFullError",e.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",e.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",e.ASSET_LIST_LOAD_ERROR="assetListLoadError",e.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",e.ASSET_LIST_PARSING_ERROR="assetListParsingError",e.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",e.INTERNAL_EXCEPTION="internalException",e.INTERNAL_ABORTED="aborted",e.ATTACH_MEDIA_ERROR="attachMediaError",e.UNKNOWN="unknown",e}({}),Id=function(e){return e.MEDIA_ATTACHING="hlsMediaAttaching",e.MEDIA_ATTACHED="hlsMediaAttached",e.MEDIA_DETACHING="hlsMediaDetaching",e.MEDIA_DETACHED="hlsMediaDetached",e.MEDIA_ENDED="hlsMediaEnded",e.STALL_RESOLVED="hlsStallResolved",e.BUFFER_RESET="hlsBufferReset",e.BUFFER_CODECS="hlsBufferCodecs",e.BUFFER_CREATED="hlsBufferCreated",e.BUFFER_APPENDING="hlsBufferAppending",e.BUFFER_APPENDED="hlsBufferAppended",e.BUFFER_EOS="hlsBufferEos",e.BUFFERED_TO_END="hlsBufferedToEnd",e.BUFFER_FLUSHING="hlsBufferFlushing",e.BUFFER_FLUSHED="hlsBufferFlushed",e.MANIFEST_LOADING="hlsManifestLoading",e.MANIFEST_LOADED="hlsManifestLoaded",e.MANIFEST_PARSED="hlsManifestParsed",e.LEVEL_SWITCHING="hlsLevelSwitching",e.LEVEL_SWITCHED="hlsLevelSwitched",e.LEVEL_LOADING="hlsLevelLoading",e.LEVEL_LOADED="hlsLevelLoaded",e.LEVEL_UPDATED="hlsLevelUpdated",e.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",e.LEVELS_UPDATED="hlsLevelsUpdated",e.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",e.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",e.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",e.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",e.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",e.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",e.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",e.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",e.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",e.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",e.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",e.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",e.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",e.CUES_PARSED="hlsCuesParsed",e.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",e.INIT_PTS_FOUND="hlsInitPtsFound",e.FRAG_LOADING="hlsFragLoading",e.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",e.FRAG_LOADED="hlsFragLoaded",e.FRAG_DECRYPTED="hlsFragDecrypted",e.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",e.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",e.FRAG_PARSING_METADATA="hlsFragParsingMetadata",e.FRAG_PARSED="hlsFragParsed",e.FRAG_BUFFERED="hlsFragBuffered",e.FRAG_CHANGED="hlsFragChanged",e.FPS_DROP="hlsFpsDrop",e.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",e.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",e.ERROR="hlsError",e.DESTROYING="hlsDestroying",e.KEY_LOADING="hlsKeyLoading",e.KEY_LOADED="hlsKeyLoaded",e.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",e.BACK_BUFFER_REACHED="hlsBackBufferReached",e.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",e.ASSET_LIST_LOADING="hlsAssetListLoading",e.ASSET_LIST_LOADED="hlsAssetListLoaded",e.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",e.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",e.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",e.INTERSTITIAL_STARTED="hlsInterstitialStarted",e.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",e.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",e.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",e.INTERSTITIAL_ENDED="hlsInterstitialEnded",e.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",e.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",e.EVENT_CUE_ENTER="hlsEventCueEnter",e}({});var Cd="manifest",Pd="level",Dd="audioTrack",_d="subtitleTrack",Md="main",Od="audio",Nd="subtitle";class Fd{constructor(e,t=0,r=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=r}sample(e,t){const r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class $d{constructor(e,t,r,n=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Fd(e),this.fast_=new Fd(t),this.defaultTTFB_=n,this.ttfb_=new Fd(e)}update(e,t){const{slow_:r,fast_:n,ttfb_:i}=this;r.halfLife!==e&&(this.slow_=new Fd(e,r.getEstimate(),r.getTotalWeight())),n.halfLife!==t&&(this.fast_=new Fd(t,n.getEstimate(),n.getTotalWeight())),i.halfLife!==e&&(this.ttfb_=new Fd(e,i.getEstimate(),i.getTotalWeight()))}sample(e,t){const r=(e=Math.max(e,this.minDelayMs_))/1e3,n=8*t/r;this.fast_.sample(r,n),this.slow_.sample(r,n)}sampleTTFB(e){const t=e/1e3,r=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(r,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function Bd(e,t,r){return(t=function(e){var t=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)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ud(){return Ud=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ud.apply(null,arguments)}function zd(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 jd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?zd(Object(r),!0).forEach(function(t){Bd(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zd(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}class Gd{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const r=`[${e}]:`;this.trace=Hd,this.debug=t.debug.bind(null,r),this.log=t.log.bind(null,r),this.warn=t.warn.bind(null,r),this.info=t.info.bind(null,r),this.error=t.error.bind(null,r)}}const Hd=function(){},Vd={trace:Hd,debug:Hd,log:Hd,warn:Hd,info:Hd,error:Hd};function Wd(){return Ud({},Vd)}function Kd(e,t,r){return t[e]?t[e].bind(t):function(e,t){const r=self.console[e];return r?r.bind(self.console,`${t?"["+t+"] ":""}[${e}] >`):Hd}(e,r)}const Yd=Wd();const qd=Yd;function Xd(e=!0){if("undefined"==typeof self)return;return(e||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Qd(e,t){const r=Object.keys(e),n=Object.keys(t),i=r.length,s=n.length;return!i||!s||i===s&&!r.some(e=>-1===n.indexOf(e))}function Zd(e,t=!1){if("undefined"!=typeof TextDecoder){const r=new TextDecoder("utf-8").decode(e);if(t){const e=r.indexOf("\0");return-1!==e?r.substring(0,e):r}return r.replace(/\0/g,"")}const r=e.length;let n,i,s,a="",o=0;for(;o<r;){if(n=e[o++],0===n&&t)return a;if(0!==n&&3!==n)switch(n>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=String.fromCharCode(n);break;case 12:case 13:i=e[o++],a+=String.fromCharCode((31&n)<<6|63&i);break;case 14:i=e[o++],s=e[o++],a+=String.fromCharCode((15&n)<<12|(63&i)<<6|63&s)}}return a}function Jd(e){let t="";for(let r=0;r<e.length;r++){let n=e[r].toString(16);n.length<2&&(n="0"+n),t+=n}return t}function eh(e){return Uint8Array.from(e.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function th(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rh,nh={exports:{}};var ih,sh,ah,oh,lh,uh=(rh||(rh=1,ih=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,sh=/^(?=([^\/?#]*))\1([^]*)$/,ah=/(?:\/|^)\.(?=\/)/g,oh=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,nh.exports=lh={buildAbsoluteURL:function(e,t,r){if(r=r||{},e=e.trim(),!(t=t.trim())){if(!r.alwaysNormalize)return e;var n=lh.parseURL(e);if(!n)throw new Error("Error trying to parse base URL.");return n.path=lh.normalizePath(n.path),lh.buildURLFromParts(n)}var i=lh.parseURL(t);if(!i)throw new Error("Error trying to parse relative URL.");if(i.scheme)return r.alwaysNormalize?(i.path=lh.normalizePath(i.path),lh.buildURLFromParts(i)):t;var s=lh.parseURL(e);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var a=sh.exec(s.path);s.netLoc=a[1],s.path=a[2]}s.netLoc&&!s.path&&(s.path="/");var o={scheme:s.scheme,netLoc:i.netLoc,path:null,params:i.params,query:i.query,fragment:i.fragment};if(!i.netLoc&&(o.netLoc=s.netLoc,"/"!==i.path[0]))if(i.path){var l=s.path,u=l.substring(0,l.lastIndexOf("/")+1)+i.path;o.path=lh.normalizePath(u)}else o.path=s.path,i.params||(o.params=s.params,i.query||(o.query=s.query));return null===o.path&&(o.path=r.alwaysNormalize?lh.normalizePath(i.path):i.path),lh.buildURLFromParts(o)},parseURL:function(e){var t=ih.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(ah,"");e.length!==(e=e.replace(oh,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}}),nh.exports);class ch{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var dh="audio",hh="video",fh="audiovideo";class ph{constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,"string"==typeof e&&(e={url:e}),this.base=e,function(e,t){const r=yh(e,t);r&&(r.enumerable=!0,Object.defineProperty(e,t,r))}(this,"stats")}setByteRange(e,t){const r=e.split("@",2);let n;n=1===r.length?(null==t?void 0:t.byteRangeEndOffset)||0:parseInt(r[1]),this._byteRange=[n,parseInt(r[0])+n]}get baseurl(){return this.base.url}get byteRange(){return null===this._byteRange?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return null===this._streams&&(this._streams={[dh]:null,[hh]:null,[fh]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return null!==this._stats}get hasStreams(){return null!==this._streams}get stats(){return null===this._stats&&(this._stats=new ch),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=uh.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[dh]=null,e[hh]=null,e[fh]=null}}function gh(e){return"initSegment"!==e.sn}class mh extends ph{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange.length){const e=this.byteRange[0],t=this.byteRange[1];if(kd(e)&&kd(t))return t-e}return null}get bitrate(){return this.byteLength?8*this.byteLength/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){var e;const{levelkeys:t}=this;if(!t||t.NONE)return null;if(t.identity)this._decryptdata||(this._decryptdata=t.identity.getDecryptData(this.sn));else if(null==(e=this._decryptdata)||!e.keyId){const e=Object.keys(t);if(1===e.length){const r=this._decryptdata=t[e[0]]||null;r&&(this._decryptdata=r.getDecryptData(this.sn,t))}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(null===this.programDateTime)return null;const e=kd(this.duration)?this.duration:0;return this.programDateTime+1e3*e}get encrypted(){var e;if(null!=(e=this._decryptdata)&&e.encrypted)return!0;if(this.levelkeys){var t;const e=Object.keys(this.levelkeys),r=e.length;if(r>1||1===r&&null!=(t=this.levelkeys[e[0]])&&t.encrypted)return!0}return!1}get programDateTime(){return null===this._programDateTime&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){kd(e)?this._programDateTime=e:this._programDateTime=this.rawProgramDateTime=null}get ref(){return gh(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){const t=this.levelkeys;if(t){var r;const n=t[e];!n||null!=(r=this._decryptdata)&&r.keyId||(this._decryptdata=n.getDecryptData(this.sn,t))}}abortRequests(){var e,t;null==(e=this.loader)||e.abort(),null==(t=this.keyLoader)||t.abort()}setElementaryStreamInfo(e,t,r,n,i,s=!1){const{elementaryStreams:a}=this,o=a[e];o?(o.startPTS=Math.min(o.startPTS,t),o.endPTS=Math.max(o.endPTS,r),o.startDTS=Math.min(o.startDTS,n),o.endDTS=Math.max(o.endDTS,i)):a[e]={startPTS:t,endPTS:r,startDTS:n,endDTS:i,partial:s}}}class vh extends ph{constructor(e,t,r,n,i){super(r),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=n;const s=e.enumeratedString("BYTERANGE");s&&this.setByteRange(s,i),i&&(this.fragOffset=i.fragOffset+i.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function yh(e,t){const r=Object.getPrototypeOf(e);if(r){const e=Object.getOwnPropertyDescriptor(r,t);return e||yh(r,t)}}const bh=Math.pow(2,32)-1,wh=[].push,Eh={video:1,audio:2,id3:3,text:4};function Sh(e){return String.fromCharCode.apply(null,e)}function Th(e,t){const r=e[t]<<8|e[t+1];return r<0?65536+r:r}function kh(e,t){const r=Ah(e,t);return r<0?4294967296+r:r}function xh(e,t){let r=kh(e,t);return r*=Math.pow(2,32),r+=kh(e,t+4),r}function Ah(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function Rh(e,t){const r=[];if(!t.length)return r;const n=e.byteLength;for(let i=0;i<n;){const s=kh(e,i),a=s>1?i+s:n;if(Sh(e.subarray(i+4,i+8))===t[0])if(1===t.length)r.push(e.subarray(i+8,a));else{const n=Rh(e.subarray(i+8,a),t.slice(1));n.length&&wh.apply(r,n)}i=a}return r}function Lh(e){const t=[],r=e[0];let n=8;const i=kh(e,n);n+=4;let s=0,a=0;0===r?(s=kh(e,n),a=kh(e,n+4),n+=8):(s=xh(e,n),a=xh(e,n+8),n+=16),n+=2;let o=e.length+a;const l=Th(e,n);n+=2;for(let r=0;r<l;r++){let r=n;const s=kh(e,r);r+=4;const a=2147483647&s;if(1===(2147483648&s)>>>31)return qd.warn("SIDX has hierarchical references (not supported)"),null;const l=kh(e,r);r+=4,t.push({referenceSize:a,subsegmentDuration:l,info:{duration:l/i,start:o,end:o+a-1}}),o+=a,r+=4,n=r}return{earliestPresentationTime:s,timescale:i,version:r,referencesCount:l,references:t}}function Ih(e){const t=[],r=Rh(e,["moov","trak"]);for(let e=0;e<r.length;e++){const n=r[e],i=Rh(n,["tkhd"])[0];if(i){let e=i[0];const r=kh(i,0===e?12:20),s=Rh(n,["mdia","mdhd"])[0];if(s){e=s[0];const i=kh(s,0===e?12:20),a=Rh(n,["mdia","hdlr"])[0];if(a){const e=Sh(a.subarray(8,12)),s={soun:dh,vide:hh}[e],o=Ch(Rh(n,["mdia","minf","stbl","stsd"])[0]);s?(t[r]={timescale:i,type:s,stsd:o},t[s]=jd({timescale:i,id:r},o)):t[r]={timescale:i,type:e,stsd:o}}}}}return Rh(e,["moov","mvex","trex"]).forEach(e=>{const r=kh(e,4),n=t[r];n&&(n.default={duration:kh(e,12),flags:kh(e,20)})}),t}function Ch(e){const t=e.subarray(8),r=t.subarray(86),n=Sh(t.subarray(4,8));let i,s=n;const a="enca"===n||"encv"===n;if(a){const e=Rh(t,[n])[0];Rh(e.subarray("enca"===n?28:78),["sinf"]).forEach(e=>{const t=Rh(e,["schm"])[0];if(t){const r=Sh(t.subarray(4,8));if("cbcs"===r||"cenc"===r){const t=Rh(e,["frma"])[0];t&&(s=Sh(t))}}})}const o=s;switch(s){case"avc1":case"avc2":case"avc3":case"avc4":{const e=Rh(r,["avcC"])[0];e&&e.length>3&&(s+="."+_h(e[1])+_h(e[2])+_h(e[3]),i=Ph("avc1"===o?"dva1":"dvav",r));break}case"mp4a":{const e=Rh(t,[n])[0],r=Rh(e.subarray(28),["esds"])[0];if(r&&r.length>7){let e=4;if(3!==r[e++])break;e=Dh(r,e),e+=2;const t=r[e++];if(128&t&&(e+=2),64&t&&(e+=r[e++]),4!==r[e++])break;e=Dh(r,e);const n=r[e++];if(64!==n)break;if(s+="."+_h(n),e+=12,5!==r[e++])break;e=Dh(r,e);const i=r[e++];let a=(248&i)>>3;31===a&&(a+=1+((7&i)<<3)+((224&r[e])>>5)),s+="."+a}break}case"hvc1":case"hev1":{const e=Rh(r,["hvcC"])[0];if(e&&e.length>12){const t=e[1],r=["","A","B","C"][t>>6],n=31&t,i=kh(e,2),a=(32&t)>>5?"H":"L",o=e[12],l=e.subarray(6,12);s+="."+r+n,s+="."+function(e){let t=0;for(let r=0;r<32;r++)t|=(e>>r&1)<<31-r;return t>>>0}(i).toString(16).toUpperCase(),s+="."+a+o;let u="";for(let e=l.length;e--;){const t=l[e];if(t||u){u="."+t.toString(16).toUpperCase()+u}}s+=u}i=Ph("hev1"==o?"dvhe":"dvh1",r);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":s=Ph(s,r)||s;break;case"vp09":{const e=Rh(r,["vpcC"])[0];if(e&&e.length>6){const t=e[4],r=e[5],n=e[6]>>4&15;s+="."+Mh(t)+"."+Mh(r)+"."+Mh(n)}break}case"av01":{const e=Rh(r,["av1C"])[0];if(e&&e.length>2){const t=e[1]>>>5,n=31&e[1],a=e[2]>>>7?"H":"M",o=(64&e[2])>>6,l=(32&e[2])>>5,u=2===t&&o?l?12:10:o?10:8,c=(16&e[2])>>4,d=(8&e[2])>>3,h=(4&e[2])>>2,f=3&e[2],p=1,g=1,m=1,v=0;s+="."+t+"."+Mh(n)+a+"."+Mh(u)+"."+c+"."+d+h+f+"."+Mh(p)+"."+Mh(g)+"."+Mh(m)+"."+v,i=Ph("dav1",r)}break}}return{codec:s,encrypted:a,supplemental:i}}function Ph(e,t){const r=Rh(t,["dvvC"]),n=r.length?r[0]:Rh(t,["dvcC"])[0];if(n){const t=n[2]>>1&127,r=n[2]<<5&32|n[3]>>3&31;return e+"."+Mh(t)+"."+Mh(r)}}function Dh(e,t){const r=t+5;for(;128&e[t++]&&t<r;);return t}function _h(e){return("0"+e.toString(16).toUpperCase()).slice(-2)}function Mh(e){return(e<10?"0":"")+e}function Oh(e,t){Rh(e,["moov","trak"]).forEach(e=>{const r=Rh(e,["mdia","minf","stbl","stsd"])[0];if(!r)return;const n=r.subarray(8);let i=Rh(n,["enca"]);const s=i.length>0;s||(i=Rh(n,["encv"])),i.forEach(e=>{Rh(s?e.subarray(28):e.subarray(78),["sinf"]).forEach(e=>{const r=Nh(e);r&&t(r,s)})})})}function Nh(e){const t=Rh(e,["schm"])[0];if(t){const r=Sh(t.subarray(4,8));if("cbcs"===r||"cenc"===r){const t=Rh(e,["schi","tenc"])[0];if(t)return t}}}function Fh(e,t){const r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}function $h(e,t){const r=[],n=t.samples,i=t.timescale,s=t.id;let a=!1;return Rh(n,["moof"]).map(o=>{const l=o.byteOffset-8;Rh(o,["traf"]).map(o=>{const u=Rh(o,["tfdt"]).map(e=>{const t=e[0];let r=kh(e,4);return 1===t&&(r*=Math.pow(2,32),r+=kh(e,8)),r/i})[0];return void 0!==u&&(e=u),Rh(o,["tfhd"]).map(u=>{const c=kh(u,4),d=16777215&kh(u,0);let h=0;const f=!!(16&d);let p=0;const g=!!(32&d);let m=8;c===s&&(!!(1&d)&&(m+=8),!!(2&d)&&(m+=4),!!(8&d)&&(h=kh(u,m),m+=4),f&&(p=kh(u,m),m+=4),g&&(m+=4),"video"===t.type&&(a=Bh(t.codec)),Rh(o,["trun"]).map(s=>{const o=s[0],u=16777215&kh(s,0),c=!!(1&u);let d=0;const f=!!(4&u),g=!!(256&u);let m=0;const v=!!(512&u);let y=0;const b=!!(1024&u),w=!!(2048&u);let E=0;const S=kh(s,4);let T=8;c&&(d=kh(s,T),T+=4),f&&(T+=4);let k=d+l;for(let l=0;l<S;l++){if(g?(m=kh(s,T),T+=4):m=h,v?(y=kh(s,T),T+=4):y=p,b&&(T+=4),w&&(E=0===o?kh(s,T):Ah(s,T),T+=4),t.type===hh){let t=0;for(;t<y;){const s=kh(n,k);if(k+=4,Uh(a,n[k])){zh(n.subarray(k,k+s),a?2:1,e+E/i,r)}k+=s,t+=s+4}}e+=m/i}}))})})}),r}function Bh(e){if(!e)return!1;const t=e.substring(0,4);return"hvc1"===t||"hev1"===t||"dvh1"===t||"dvhe"===t}function Uh(e,t){if(e){const e=t>>1&63;return 39===e||40===e}return 6===(31&t)}function zh(e,t,r,n){const i=jh(e);let s=0;s+=t;let a=0,o=0,l=0;for(;s<i.length;){a=0;do{if(s>=i.length)break;l=i[s++],a+=l}while(255===l);o=0;do{if(s>=i.length)break;l=i[s++],o+=l}while(255===l);const e=i.length-s;let t=s;if(o<e)s+=o;else if(o>e){qd.error(`Malformed SEI payload. ${o} is too small, only ${e} bytes left to parse.`);break}if(4===a){if(181===i[t++]){const e=Th(i,t);if(t+=2,49===e){const e=kh(i,t);if(t+=4,1195456820===e){const e=i[t++];if(3===e){const s=i[t++],o=64&s,l=o?2+3*(31&s):0,u=new Uint8Array(l);if(o){u[0]=s;for(let e=1;e<l;e++)u[e]=i[t++]}n.push({type:e,payloadType:a,pts:r,bytes:u})}}}}}else if(5===a&&o>16){const e=[];for(let r=0;r<16;r++){const n=i[t++].toString(16);e.push(1==n.length?"0"+n:n),3!==r&&5!==r&&7!==r&&9!==r||e.push("-")}const s=o-16,l=new Uint8Array(s);for(let e=0;e<s;e++)l[e]=i[t++];n.push({payloadType:a,pts:r,uuid:e.join(""),userData:Zd(l),userDataBytes:l})}}}function jh(e){const t=e.byteLength,r=[];let n=1;for(;n<t-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(r.push(n+2),n+=2):n++;if(0===r.length)return e;const i=t-r.length,s=new Uint8Array(i);let a=0;for(n=0;n<i;a++,n++)a===r[0]&&(a++,r.shift()),s[n]=e[a];return s}function Gh(e,t,r){if(16!==e.byteLength)throw new RangeError("Invalid system id");let n,i,s;n=0,i=new Uint8Array,s=new Uint8Array;const a=new Uint8Array(4);return r.byteLength>0&&new DataView(a.buffer).setUint32(0,r.byteLength,!1),function(e,...t){const r=t.length;let n=8,i=r;for(;i--;)n+=t[i].byteLength;const s=new Uint8Array(n);for(s[0]=n>>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=255&n,s.set(e,4),i=0,n=8;i<r;i++)s.set(t[i],n),n+=t[i].byteLength;return s}([112,115,115,104],new Uint8Array([0,0,0,0]),e,s,i,a,r)}function Hh(e){const t=e.getUint32(0),r=e.byteOffset,n=e.byteLength;if(n<t)return{offset:r,size:n};if(1886614376!==e.getUint32(4))return{offset:r,size:t};const i=e.getUint32(8)>>>24;if(0!==i&&1!==i)return{offset:r,size:t};const s=e.buffer,a=Jd(new Uint8Array(s,r+12,16));let o=null,l=null,u=0;if(0===i)u=28;else{const i=e.getUint32(28);if(!i||n<32+16*i)return{offset:r,size:t};o=[];for(let e=0;e<i;e++)o.push(new Uint8Array(s,r+32+16*e,16));u=32+16*i}if(!u)return{offset:r,size:t};const c=e.getUint32(u);return t-32<c?{offset:r,size:t}:(l=new Uint8Array(s,r+u+4,c),{version:i,systemId:a,kids:o,data:l,offset:r,size:t})}const Vh=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),Wh={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function Kh(e,t){const r=Wh[t];return!!r&&!!r[e.slice(0,4)]}function Yh(e,t,r=!0){return!e.split(",").some(e=>!qh(e,t,r))}function qh(e,t,r=!0){var n;const i=Xd(r);return null!=(n=null==i?void 0:i.isTypeSupported(Xh(e,t)))&&n}function Xh(e,t){return`${t}/mp4;codecs=${e}`}function Qh(e){if(e){const t=e.substring(0,4);return Wh.video[t]}return 2}function Zh(e){const t=Vh();return e.split(",").reduce((e,r)=>{const n=t&&Bh(r)?9:Wh.video[r];return n?(2*n+e)/(e?3:2):(Wh.audio[r]+e)/(e?2:1)},0)}const Jh={};const ef=/flac|opus|mp4a\.40\.34/i;function tf(e,t=!0){return e.replace(ef,e=>function(e,t=!0){if(Jh[e])return Jh[e];const r={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[e];for(let i=0;i<r.length;i++){var n;if(qh(r[i],"audio",t))return Jh[e]=r[i],r[i];if("mp3"===r[i]&&null!=(n=Xd(t))&&n.isTypeSupported("audio/mpeg"))return""}return e}(e.toLowerCase(),t))}function rf(e,t){if(e&&(e.length>4||-1!==["ac-3","ec-3","alac","fLaC","Opus"].indexOf(e))&&(nf(e,"audio")||nf(e,"video")))return e;if(t){const r=t.split(",");if(r.length>1){if(e)for(let t=r.length;t--;)if(r[t].substring(0,4)===e.substring(0,4))return r[t];return r[0]}}return t||e}function nf(e,t){return Kh(e,t)&&qh(e,t)}function sf(e){if(e.startsWith("av01.")){const t=e.split("."),r=["0","111","01","01","01","0"];for(let e=t.length;e>4&&e<10;e++)t[e]=r[e-4];return t.join(".")}return e}function af(e){const t=Xd(e)||{isTypeSupported:()=>!1};return{mpeg:t.isTypeSupported("audio/mpeg"),mp3:t.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:t.isTypeSupported('audio/mp4; codecs="ac-3"')}}function of(e){return e.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const lf={supported:!1,smooth:!1,powerEfficient:!1},uf={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function cf(e,t){return{supported:!1,configurations:t,decodingInfoResults:[lf],error:e}}function df(e,t,r,n,i,s){const a=e.videoCodec,o=e.audioCodec?e.audioGroups:null,l=null==s?void 0:s.audioCodec,u=null==s?void 0:s.channels,c=u?parseInt(u):l?1/0:2;let d=null;if(null!=o&&o.length)try{d=1===o.length&&o[0]?t.groups[o[0]].channels:o.reduce((e,r)=>{if(r){const n=t.groups[r];if(!n)throw new Error(`Audio track group ${r} not found`);Object.keys(n.channels).forEach(t=>{e[t]=(e[t]||0)+n.channels[t]})}return e},{2:0})}catch(e){return!0}return void 0!==a&&(a.split(",").some(e=>Bh(e))||e.width>1920&&e.height>1088||e.height>1920&&e.width>1088||e.frameRate>Math.max(n,30)||"SDR"!==e.videoRange&&e.videoRange!==r||e.bitrate>Math.max(i,8e6))||!!d&&kd(c)&&Object.keys(d).some(e=>parseInt(e)>c)}function hf(e,t,r,n={}){const i=e.videoCodec;if(!i&&!e.audioCodec||!r)return Promise.resolve(uf);const s=[],a=function(e){var t;const r=null==(t=e.videoCodec)?void 0:t.split(","),n=pf(e),i=e.width||640,s=e.height||480,a=e.frameRate||30,o=e.videoRange.toLowerCase();return r?r.map(e=>{const t={contentType:Xh(sf(e),"video"),width:i,height:s,bitrate:n,framerate:a};return"sdr"!==o&&(t.transferFunction=o),t}):[]}(e),o=a.length,l=function(e,t,r){var n;const i=null==(n=e.audioCodec)?void 0:n.split(","),s=pf(e);if(i&&e.audioGroups)return e.audioGroups.reduce((e,n)=>{var a;const o=n?null==(a=t.groups[n])?void 0:a.tracks:null;return o?o.reduce((e,t)=>{if(t.groupId===n){const n=parseFloat(t.channels||"");i.forEach(t=>{const i={contentType:Xh(t,"audio"),bitrate:r?ff(t,s):s};n&&(i.channels=""+n),e.push(i)})}return e},e):e},[]);return[]}(e,t,o>0),u=l.length;for(let e=o||1*u||1;e--;){const t={type:"media-source"};if(o&&(t.video=a[e%o]),u){t.audio=l[e%u];const r=t.audio.bitrate;t.video&&r&&(t.video.bitrate-=r)}s.push(t)}if(i){const e=navigator.userAgent;if(i.split(",").some(e=>Bh(e))&&Vh())return Promise.resolve(cf(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${e})`),s))}return Promise.all(s.map(e=>{const t=function(e){let t="";const{audio:r,video:n}=e;if(n){t+=`${of(n.contentType)}_r${n.height}x${n.width}f${Math.ceil(n.framerate)}${n.transferFunction||"sd"}_${Math.ceil(n.bitrate/1e5)}`}if(r){t+=`${n?"_":""}${of(r.contentType)}_c${r.channels}`}return t}(e);return n[t]||(n[t]=r.decodingInfo(e))})).then(e=>({supported:!e.some(e=>!e.supported),configurations:s,decodingInfoResults:e})).catch(e=>({supported:!1,configurations:s,decodingInfoResults:[],error:e}))}function ff(e,t){if(t<=1)return 1;let r=128e3;return"ec-3"===e?r=768e3:"ac-3"===e&&(r=64e4),Math.min(t/2,r)}function pf(e){return 1e3*Math.ceil(Math.max(.9*e.bitrate,e.averageBitrate)/1e3)||1}const gf=["NONE","TYPE-0","TYPE-1",null];const mf=["SDR","PQ","HLG"];var vf="",yf="YES",bf="v2";function wf(e){const{canSkipUntil:t,canSkipDateRanges:r,age:n}=e;return t&&n<t/2?r?bf:yf:vf}class Ef{constructor(e,t,r){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=r}addDirectives(e){const t=new self.URL(e);return void 0!==this.msn&&t.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class Sf{constructor(e){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(e=>!!e).map(e=>e.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const r=null==(t=e.supplemental)?void 0:t.videoCodec;r&&r!==e.videoCodec&&(this.codecSet+=`,${r.substring(0,4)}`)}this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return Tf(this._audioGroups,e)}hasSubtitleGroup(e){return Tf(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t)if("audio"===e){let e=this._audioGroups;e||(e=this._audioGroups=[]),-1===e.indexOf(t)&&e.push(t)}else if("text"===e){let e=this._subtitleGroups;e||(e=this._subtitleGroups=[]),-1===e.indexOf(t)&&e.push(t)}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return null==(e=this.audioGroups)?void 0:e[0]}get textGroupId(){var e;return null==(e=this.subtitleGroups)?void 0:e[0]}addFallback(){}}function Tf(e,t){return!(!t||!e)&&-1!==e.indexOf(t)}function kf(e,t){let r=!1,n=[];if(e&&(r="SDR"!==e,n=[e]),t){n=t.allowedVideoRanges||mf.slice(0);const e="SDR"!==n.join("")&&!t.videoCodec;r=void 0!==t.preferHDR?t.preferHDR:e&&function(){if("function"==typeof matchMedia){const e=matchMedia("(dynamic-range: high)"),t=matchMedia("bad query");if(e.media!==t.media)return!0===e.matches}return!1}(),r||(n=["SDR"])}return{preferHDR:r,allowedVideoRanges:n}}const xf=(e,t)=>JSON.stringify(e,(e=>{const t=new WeakSet;return(r,n)=>{if(e&&(n=e(r,n)),"object"==typeof n&&null!==n){if(t.has(n))return;t.add(n)}return n}})(t));function Af(e,t){qd.log(`[abr] start candidates with "${e}" ignored because ${t}`)}function Rf(e){return e.reduce((e,t)=>{let r=e.groups[t.groupId];r||(r=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),r.tracks.push(t);const n=t.channels||"2";return r.channels[n]=(r.channels[n]||0)+1,r.hasDefault=r.hasDefault||t.default,r.hasAutoSelect=r.hasAutoSelect||t.autoselect,r.hasDefault&&(e.hasDefaultAudio=!0),r.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function Lf(e){if(!e)return e;const{lang:t,assocLang:r,characteristics:n,channels:i,audioCodec:s}=e;return{lang:t,assocLang:r,characteristics:n,channels:i,audioCodec:s}}function If(e,t,r){if("attrs"in e){const r=t.indexOf(e);if(-1!==r)return r}for(let n=0;n<t.length;n++){if(Cf(e,t[n],r))return n}return-1}function Cf(e,t,r){const{groupId:n,name:i,lang:s,assocLang:a,default:o}=e,l=e.forced;return(void 0===n||t.groupId===n)&&(void 0===i||t.name===i)&&(void 0===s||function(e,t="--"){if(e.length===t.length)return e===t;return e.startsWith(t)||t.startsWith(e)}(s,t.lang))&&(void 0===s||t.assocLang===a)&&(void 0===o||t.default===o)&&(void 0===l||t.forced===l)&&(!("characteristics"in e)||function(e,t=""){const r=e.split(","),n=t.split(",");return r.length===n.length&&!r.some(e=>-1===n.indexOf(e))}(e.characteristics||"",t.characteristics))&&(void 0===r||r(e,t))}function Pf(e,t){const{audioCodec:r,channels:n}=e;return!(void 0!==r&&(t.audioCodec||"").substring(0,4)!==r.substring(0,4)||void 0!==n&&n!==(t.channels||"2"))}function Df(e,t,r){for(let n=t;n>-1;n--)if(r(e[n]))return n;for(let n=t+1;n<e.length;n++)if(r(e[n]))return n;return-1}function _f(e,t){var r;return!!e&&e!==(null==(r=t.loadLevelObj)?void 0:r.uri)}const Mf=function(e,t){let r=0,n=e.length-1,i=null,s=null;for(;r<=n;){i=(r+n)/2|0,s=e[i];const a=t(s);if(a>0)r=i+1;else{if(!(a<0))return s;n=i-1}}return null};function Of(e,t,r=0,n=0,i=.005){let s=null;if(e){s=t[1+e.sn-t[0].sn]||null;const n=e.endDTS-r;n>0&&n<15e-7&&(r+=15e-7),s&&e.level!==s.level&&s.end<=e.end&&(s=t[2+e.sn-t[0].sn]||null)}else 0===r&&0===t[0].start&&(s=t[0]);if(s&&((!e||e.level===s.level)&&0===Nf(r,n,s)||function(e,t,r){if(t&&0===t.start&&t.level<e.level&&(t.endPTS||0)>0){const n=t.tagList.reduce((e,t)=>("INF"===t[0]&&(e+=parseFloat(t[1])),e),r);return e.start<=n}return!1}(s,e,Math.min(i,n))))return s;const a=Mf(t,Nf.bind(null,r,n));return!a||a===e&&s?s:a}function Nf(e=0,t=0,r){if(r.start<=e&&r.start+r.duration>e)return 0;const n=Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return r.start+r.duration-n<=e?1:r.start-n>e&&r.start?-1:0}function Ff(e,t,r){const n=1e3*Math.min(t,r.duration+(r.deltaPTS?r.deltaPTS:0));return(r.endProgramDateTime||0)-n>e}function $f(e,t,r){if(e&&e.startCC<=t&&e.endCC>=t){let n=e.fragments;const{fragmentHint:i}=e;let s;return i&&(n=n.concat(i)),Mf(n,e=>e.cc<t?1:e.cc>t?-1:(s=e,e.end<=r?1:e.start>r?-1:0)),s||null}return null}function Bf(e){switch(e.details){case Ld.FRAG_LOAD_TIMEOUT:case Ld.KEY_LOAD_TIMEOUT:case Ld.LEVEL_LOAD_TIMEOUT:case Ld.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Uf(e){return e.details.startsWith("key")}function zf(e){return Uf(e)&&!!e.frag&&!e.frag.decryptdata}function jf(e,t){const r=Bf(t);return e.default[(r?"timeout":"error")+"Retry"]}function Gf(e,t){const r="linear"===e.backoff?1:Math.pow(2,t);return Math.min(r*e.retryDelayMs,e.maxRetryDelayMs)}function Hf(e){return jd(jd({},e),{errorRetry:null,timeoutRetry:null})}function Vf(e,t,r,n){if(!e)return!1;const i=null==n?void 0:n.code,s=t<e.maxNumRetry&&(function(e){return Wf(e)||!!e&&(e<400||e>499)}(i)||!!r);return e.shouldRetry?e.shouldRetry(e,t,r,n,s):s}function Wf(e){return 0===e&&!1===navigator.onLine}var Kf=0,Yf=2,qf=3,Xf=5,Qf=0,Zf=1,Jf=2,ep=4;function tp(e){const t={action:Kf,flags:Qf};return e&&(t.resolved=!0),t}var rp="NOT_LOADED",np="APPENDING",ip="PARTIAL",sp="OK";class ap{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e&&(e.on(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Id.BUFFER_APPENDED,this.onBufferAppended,this),e.on(Id.FRAG_BUFFERED,this.onFragBuffered,this),e.on(Id.FRAG_LOADED,this.onFragLoaded,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Id.BUFFER_APPENDED,this.onBufferAppended,this),e.off(Id.FRAG_BUFFERED,this.onFragBuffered,this),e.off(Id.FRAG_LOADED,this.onFragLoaded,this))}destroy(){this._unregisterListeners(),this.hls=this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const r=this.activePartLists[t];if(r)for(let t=r.length;t--;){const n=r[t];if(!n)break;if(n.start<=e&&e<=n.end&&n.loaded)return n}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,r){const{fragments:n}=this,i=Object.keys(n);for(let s=i.length;s--;){const a=n[i[s]];if((null==a?void 0:a.body.type)===t&&(!r||a.buffered)){const t=a.body;if(t.start<=e&&e<=t.end)return t}}return null}detectEvictedFragments(e,t,r,n,i){this.timeRanges&&(this.timeRanges[e]=t);const s=(null==n?void 0:n.fragment.sn)||-1;Object.keys(this.fragments).forEach(n=>{const a=this.fragments[n];if(!a)return;if(s>=a.body.sn)return;if(!a.buffered&&(!a.loaded||i))return void(a.body.type===r&&this.removeFragment(a.body));const o=a.range[e];o&&(0!==o.time.length?o.time.some(e=>{const r=!this.isTimeBuffered(e.startPTS,e.endPTS,t);return r&&this.removeFragment(a.body),r}):this.removeFragment(a.body))})}detectPartialFragments(e){const t=this.timeRanges;if(!t||"initSegment"===e.frag.sn)return;const r=e.frag,n=lp(r),i=this.fragments[n];if(!i||i.buffered&&r.gap)return;const s=!r.relurl;Object.keys(t).forEach(n=>{const a=r.elementaryStreams[n];if(!a)return;const o=t[n],l=s||!0===a.partial;i.range[n]=this.getBufferedTimes(r,e.part,l,o)}),i.loaded=null,Object.keys(i.range).length?(this.bufferedEnd(i,r),op(i)||this.removeParts(r.sn-1,r.type)):this.removeFragment(i.body)}bufferedEnd(e,t){e.buffered=!0;(e.body.endList=t.endList||e.body.endList)&&(this.endListFragments[e.body.type]=e)}removeParts(e,t){const r=this.activePartLists[t];r&&(this.activePartLists[t]=up(r,t=>t.fragment.sn>=e))}fragBuffered(e,t){const r=lp(e);let n=this.fragments[r];!n&&t&&(n=this.fragments[r]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),n&&(n.loaded=null,this.bufferedEnd(n,e))}getBufferedTimes(e,t,r,n){const i={time:[],partial:r},s=e.start,a=e.end,o=e.minEndPTS||a,l=e.maxStartPTS||s;for(let e=0;e<n.length;e++){const t=n.start(e)-this.bufferPadding,r=n.end(e)+this.bufferPadding;if(l>=t&&o<=r){i.time.push({startPTS:Math.max(s,n.start(e)),endPTS:Math.min(a,n.end(e))});break}if(s<r&&a>t){const t=Math.max(s,n.start(e)),r=Math.min(a,n.end(e));r>t&&(i.partial=!0,i.time.push({startPTS:t,endPTS:r}))}else if(a<=t)break}return i}getPartialFragment(e){let t,r,n,i=null,s=0;const{bufferPadding:a,fragments:o}=this;return Object.keys(o).forEach(l=>{const u=o[l];u&&op(u)&&(r=u.body.start-a,n=u.body.end+a,e>=r&&e<=n&&(t=Math.min(e-r,n-e),s<=t&&(i=u.body,s=t)))}),i}isEndListAppended(e){const t=this.endListFragments[e];return void 0!==t&&(t.buffered||op(t))}getState(e){const t=lp(e),r=this.fragments[t];return r?r.buffered?op(r)?ip:sp:np:rp}isTimeBuffered(e,t,r){let n,i;for(let s=0;s<r.length;s++){if(n=r.start(s)-this.bufferPadding,i=r.end(s)+this.bufferPadding,e>=n&&t<=i)return!0;if(t<=n)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if("initSegment"===t.frag.sn||t.frag.bitrateTest)return;const r=t.frag,n=t.part?null:t,i=lp(r);this.fragments[i]={body:r,appendedPTS:null,loaded:n,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:r,part:n,timeRanges:i,type:s}=t;if("initSegment"===r.sn)return;const a=r.type;if(n){let e=this.activePartLists[a];e||(this.activePartLists[a]=e=[]),e.push(n)}this.timeRanges=i;const o=i[s];this.detectEvictedFragments(s,o,a,n)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=lp(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,r=Object.keys(t);if(!e)return r.length>0;for(let n=r.length;n--;){const i=t[r[n]];if((null==i?void 0:i.body.type)===e)return!0}return!1}hasParts(e){var t;return!(null==(t=this.activePartLists[e])||!t.length)}removeFragmentsInRange(e,t,r,n,i){n&&!this.hasGaps||Object.keys(this.fragments).forEach(s=>{const a=this.fragments[s];if(!a)return;const o=a.body;o.type!==r||n&&!o.gap||o.start<t&&o.end>e&&(a.buffered||i)&&this.removeFragment(o)})}removeFragment(e){const t=lp(e);e.clearElementaryStreamInfo();const r=this.activePartLists[e.type];if(r){const t=e.sn;this.activePartLists[e.type]=up(r,e=>e.fragment.sn!==t)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const t=null==(e=this.hls)||null==(e=e.latestLevelDetails)?void 0:e.partList;t&&t.forEach(e=>e.clearElementaryStreamInfo())}}function op(e){var t,r,n;return e.buffered&&!!(e.body.gap||null!=(t=e.range.video)&&t.partial||null!=(r=e.range.audio)&&r.partial||null!=(n=e.range.audiovideo)&&n.partial)}function lp(e){return`${e.type}_${e.level}_${e.sn}`}function up(e,t){return e.filter(e=>{const r=t(e);return r||e.clearElementaryStreamInfo(),r})}var cp=0,dp=1;class hp{constructor(e,t,r){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=r}decrypt(e,t){switch(this.aesMode){case cp:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case dp:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},t,e);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}class fp{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),r=new Uint32Array(4);for(let e=0;e<4;e++)r[e]=t.getUint32(4*e);return r}initTable(){const e=this.sBox,t=this.invSBox,r=this.subMix,n=r[0],i=r[1],s=r[2],a=r[3],o=this.invSubMix,l=o[0],u=o[1],c=o[2],d=o[3],h=new Uint32Array(256);let f=0,p=0,g=0;for(g=0;g<256;g++)h[g]=g<128?g<<1:g<<1^283;for(g=0;g<256;g++){let r=p^p<<1^p<<2^p<<3^p<<4;r=r>>>8^255&r^99,e[f]=r,t[r]=f;const o=h[f],g=h[o],m=h[g];let v=257*h[r]^16843008*r;n[f]=v<<24|v>>>8,i[f]=v<<16|v>>>16,s[f]=v<<8|v>>>24,a[f]=v,v=16843009*m^65537*g^257*o^16843008*f,l[r]=v<<24|v>>>8,u[r]=v<<16|v>>>16,c[r]=v<<8|v>>>24,d[r]=v,f?(f=o^h[h[h[m^o]]],p^=h[h[p]]):f=p=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let r=!0,n=0;for(;n<t.length&&r;)r=t[n]===this.key[n],n++;if(r)return;this.key=t;const i=this.keySize=t.length;if(4!==i&&6!==i&&8!==i)throw new Error("Invalid aes key size="+i);const s=this.ksRows=4*(i+6+1);let a,o;const l=this.keySchedule=new Uint32Array(s),u=this.invKeySchedule=new Uint32Array(s),c=this.sBox,d=this.rcon,h=this.invSubMix,f=h[0],p=h[1],g=h[2],m=h[3];let v,y;for(a=0;a<s;a++)a<i?v=l[a]=t[a]:(y=v,a%i===0?(y=y<<8|y>>>24,y=c[y>>>24]<<24|c[y>>>16&255]<<16|c[y>>>8&255]<<8|c[255&y],y^=d[a/i|0]<<24):i>6&&a%i===4&&(y=c[y>>>24]<<24|c[y>>>16&255]<<16|c[y>>>8&255]<<8|c[255&y]),l[a]=v=(l[a-i]^y)>>>0);for(o=0;o<s;o++)a=s-o,y=3&o?l[a]:l[a-4],u[o]=o<4||a<=4?y:f[c[y>>>24]]^p[c[y>>>16&255]]^g[c[y>>>8&255]]^m[c[255&y]],u[o]=u[o]>>>0}networkToHostOrderSwap(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24}decrypt(e,t,r){const n=this.keySize+6,i=this.invKeySchedule,s=this.invSBox,a=this.invSubMix,o=a[0],l=a[1],u=a[2],c=a[3],d=this.uint8ArrayToUint32Array_(r);let h=d[0],f=d[1],p=d[2],g=d[3];const m=new Int32Array(e),v=new Int32Array(m.length);let y,b,w,E,S,T,k,x,A,R,L,I,C,P;const D=this.networkToHostOrderSwap;for(;t<m.length;){for(A=D(m[t]),R=D(m[t+1]),L=D(m[t+2]),I=D(m[t+3]),S=A^i[0],T=I^i[1],k=L^i[2],x=R^i[3],C=4,P=1;P<n;P++)y=o[S>>>24]^l[T>>16&255]^u[k>>8&255]^c[255&x]^i[C],b=o[T>>>24]^l[k>>16&255]^u[x>>8&255]^c[255&S]^i[C+1],w=o[k>>>24]^l[x>>16&255]^u[S>>8&255]^c[255&T]^i[C+2],E=o[x>>>24]^l[S>>16&255]^u[T>>8&255]^c[255&k]^i[C+3],S=y,T=b,k=w,x=E,C+=4;y=s[S>>>24]<<24^s[T>>16&255]<<16^s[k>>8&255]<<8^s[255&x]^i[C],b=s[T>>>24]<<24^s[k>>16&255]<<16^s[x>>8&255]<<8^s[255&S]^i[C+1],w=s[k>>>24]<<24^s[x>>16&255]<<16^s[S>>8&255]<<8^s[255&T]^i[C+2],E=s[x>>>24]<<24^s[S>>16&255]<<16^s[T>>8&255]<<8^s[255&k]^i[C+3],v[t]=D(y^h),v[t+1]=D(E^f),v[t+2]=D(w^p),v[t+3]=D(b^g),h=A,f=R,p=L,g=I,t+=4}return v.buffer}}class pp{constructor(e,t,r){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=r}expandKey(){const e=function(e){switch(e){case cp:return"AES-CBC";case dp:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${e}`)}}(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}class gp{constructor(e,{removePKCS7Padding:t=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.enableSoftwareAES=void 0,this.enableSoftwareAES=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const e=self.crypto;e&&(this.subtle=e.subtle||e.webkitSubtle)}catch(e){}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const r=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?function(e){const t=e.byteLength,r=t&&new DataView(e.buffer).getUint8(t-1);return r?e.slice(0,t-r):e}(r):r}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,r,n){return this.useSoftware?new Promise((i,s)=>{const a=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(a,t,r,n);const o=this.flush();o?i(o.buffer):s(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,r,n)}softwareDecrypt(e,t,r,n){const{currentIV:i,currentResult:s,remainderData:a}=this;if(n!==cp||16!==t.byteLength)return qd.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),a&&(e=Fh(a,e),this.remainderData=null);const o=this.getValidChunk(e);if(!o.length)return null;i&&(r=i);let l=this.softwareDecrypter;l||(l=this.softwareDecrypter=new fp),l.expandKey(t);const u=s;return this.currentResult=l.decrypt(o.buffer,0,r),this.currentIV=o.slice(-16).buffer,u||null}webCryptoDecrypt(e,t,r,n){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,r,n));this.key=t,this.fastAesKey=new pp(this.subtle,t,n)}return this.fastAesKey.expandKey().then(t=>{if(!this.subtle)return Promise.reject(new Error("web crypto not initialized"));this.logOnce("WebCrypto AES decrypt");return new hp(this.subtle,new Uint8Array(r),n).decrypt(e.buffer,t)}).catch(i=>(qd.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${i.name}: ${i.message}`),this.onWebCryptoError(e,t,r,n)))}onWebCryptoError(e,t,r,n){const i=this.enableSoftwareAES;if(i){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,r,n);const i=this.flush();if(i)return i.buffer}throw new Error("WebCrypto"+(i?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const r=e.length-e.length%16;return r!==e.length&&(t=e.slice(0,r),this.remainderData=e.slice(r)),t}logOnce(e){this.logEnabled&&(qd.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const mp=Math.pow(2,17);class vp{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const r=e.url;if(!r)return Promise.reject(new wp({type:Rd.NETWORK_ERROR,details:Ld.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error("Fragment does not have a "+(r?"part list":"url")),networkDetails:null}));this.abort();const n=this.config,i=n.fLoader,s=n.loader;return new Promise((a,o)=>{if(this.loader&&this.loader.destroy(),e.gap){if(e.tagList.some(e=>"GAP"===e[0]))return void o(bp(e));e.gap=!1}const l=this.loader=i?new i(n):new s(n),u=yp(e);e.loader=l;const c=Hf(n.fragLoadPolicy.default),d={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===e.sn?1/0:mp};e.stats=l.stats;const h={onSuccess:(t,r,n,i)=>{this.resetLoader(e,l);let s=t.data;n.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(s.slice(0,16)),s=s.slice(16)),a({frag:e,part:null,payload:s,networkDetails:i})},onError:(t,n,i,s)=>{this.resetLoader(e,l),o(new wp({type:Rd.NETWORK_ERROR,details:Ld.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:jd({url:r,data:void 0},t),error:new Error(`HTTP Error ${t.code} ${t.text}`),networkDetails:i,stats:s}))},onAbort:(t,r,n)=>{this.resetLoader(e,l),o(new wp({type:Rd.NETWORK_ERROR,details:Ld.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:n,stats:t}))},onTimeout:(t,r,n)=>{this.resetLoader(e,l),o(new wp({type:Rd.NETWORK_ERROR,details:Ld.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:n,stats:t}))}};t&&(h.onProgress=(r,n,i,s)=>t({frag:e,part:null,payload:i,networkDetails:s})),l.load(u,d,h)})}loadPart(e,t,r){this.abort();const n=this.config,i=n.fLoader,s=n.loader;return new Promise((a,o)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap)return void o(bp(e,t));const l=this.loader=i?new i(n):new s(n),u=yp(e,t);e.loader=l;const c=Hf(n.fragLoadPolicy.default),d={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:mp};t.stats=l.stats,l.load(u,d,{onSuccess:(n,i,s,o)=>{this.resetLoader(e,l),this.updateStatsFromPart(e,t);const u={frag:e,part:t,payload:n.data,networkDetails:o};r(u),a(u)},onError:(r,n,i,s)=>{this.resetLoader(e,l),o(new wp({type:Rd.NETWORK_ERROR,details:Ld.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:jd({url:u.url,data:void 0},r),error:new Error(`HTTP Error ${r.code} ${r.text}`),networkDetails:i,stats:s}))},onAbort:(r,n,i)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,l),o(new wp({type:Rd.NETWORK_ERROR,details:Ld.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:i,stats:r}))},onTimeout:(r,n,i)=>{this.resetLoader(e,l),o(new wp({type:Rd.NETWORK_ERROR,details:Ld.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:i,stats:r}))}})})}updateStatsFromPart(e,t){const r=e.stats,n=t.stats,i=n.total;if(r.loaded+=n.loaded,i){const n=Math.round(e.duration/t.duration),s=Math.min(Math.round(r.loaded/i),n),a=(n-s)*Math.round(r.loaded/s);r.total=r.loaded+a}else r.total=Math.max(r.loaded,r.total);const s=r.loading,a=n.loading;s.start?s.first+=a.first-a.start:(s.start=a.start,s.first=a.first),s.end=a.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function yp(e,t=null){const r=t||e,n={frag:e,part:t,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},i=r.byteRangeStartOffset,s=r.byteRangeEndOffset;if(kd(i)&&kd(s)){var a;let t=i,r=s;if("initSegment"===e.sn&&("AES-128"===(o=null==(a=e.decryptdata)?void 0:a.method)||"AES-256"===o)){const e=s-i;e%16&&(r=s+(16-e%16)),0!==i&&(n.resetIV=!0,t=i-16)}n.rangeStart=t,n.rangeEnd=r}var o;return n}function bp(e,t){const r=new Error(`GAP ${e.gap?"tag":"attribute"} found`),n={type:Rd.MEDIA_ERROR,details:Ld.FRAG_GAP,fatal:!1,frag:e,error:r,networkDetails:null};return t&&(n.part=t),(t||e).stats.aborted=!0,new wp(n)}class wp extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Ep extends Gd{constructor(e,t){super(e,t),this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return!this._tickInterval&&(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)}clearNextTick(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)}tick(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class Sp{constructor(e,t,r,n=0,i=-1,s=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=e,this.sn=t,this.id=r,this.size=n,this.part=i,this.partial=s}}const Tp={length:0,start:()=>0,end:()=>0};class kp{static isBuffered(e,t){if(e){const r=kp.getBuffered(e);for(let e=r.length;e--;)if(t>=r.start(e)&&t<=r.end(e))return!0}return!1}static bufferedRanges(e){if(e){const t=kp.getBuffered(e);return kp.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let r=0;r<e.length;r++)t.push({start:e.start(r),end:e.end(r)});return t}static bufferInfo(e,t,r){if(e){const n=kp.bufferedRanges(e);if(n.length)return kp.bufferedInfo(n,t,r)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,r){t=Math.max(0,t),e.length>1&&e.sort((e,t)=>e.start-t.start||t.end-e.end);let n=-1,i=[];if(r)for(let s=0;s<e.length;s++){t>=e[s].start&&t<=e[s].end&&(n=s);const a=i.length;if(a){const t=i[a-1].end;e[s].start-t<r?e[s].end>t&&(i[a-1].end=e[s].end):i.push(e[s])}else i.push(e[s])}else i=e;let s,a=0,o=t,l=t;for(let e=0;e<i.length;e++){const u=i[e].start,c=i[e].end;if(-1===n&&t>=u&&t<=c&&(n=e),t+r>=u&&t<c)o=u,l=c,a=l-t;else if(t+r<u){s=u;break}}return{len:a,start:o||0,end:l||0,nextStart:s,buffered:e,bufferedIndex:n}}static getBuffered(e){try{return e.buffered||Tp}catch(e){return qd.log("failed to get media.buffered",e),Tp}}}const xp=/\{\$([a-zA-Z0-9-_]+)\}/g;function Ap(e){return xp.test(e)}function Rp(e,t){if(null!==e.variableList||e.hasVariableRefs){const r=e.variableList;return t.replace(xp,t=>{const n=t.substring(2,t.length-1),i=null==r?void 0:r[n];return void 0===i?(e.playlistParsingError||(e.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${n}"`)),t):i})}return t}function Lp(e,t,r){let n,i,s=e.variableList;if(s||(e.variableList=s={}),"QUERYPARAM"in t){n=t.QUERYPARAM;try{const e=new self.URL(r).searchParams;if(!e.has(n))throw new Error(`"${n}" does not match any query parameter in URI: "${r}"`);i=e.get(n)}catch(t){e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${t.message}`))}}else n=t.NAME,i=t.VALUE;n in s?e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${n}"`)):s[n]=i||""}function Ip(e,t,r){const n=t.IMPORT;if(r&&n in r){let t=e.variableList;t||(e.variableList=t={}),t[n]=r[n]}else e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${n}"`))}const Cp=/^(\d+)x(\d+)$/,Pp=/(.+?)=(".*?"|.*?)(?:,|$)/g;class Dp{constructor(e,t){"string"==typeof e&&(e=Dp.parseAttrList(e,t)),Ud(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>"X-"===e.substring(0,2))}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;const r=new Uint8Array(t.length/2);for(let e=0;e<t.length/2;e++)r[e]=parseInt(t.slice(2*e,2*e+2),16);return r}return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const r=this[e];return r?parseFloat(r):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const r=this[e];return(r?r.split(/[ ,]+/):[]).reduce((e,t)=>(e[t.toLowerCase()]=!0,e),t)}bool(e){return"YES"===this[e]}decimalResolution(e){const t=Cp.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let r;const n={};for(Pp.lastIndex=0;null!==(r=Pp.exec(e));){const i=r[1].trim();let s=r[2];const a=0===s.indexOf('"')&&s.lastIndexOf('"')===s.length-1;let o=!1;if(a)s=s.slice(1,-1);else switch(i){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":o=!0}if(t&&(a||o))s=Rp(t,s);else if(!o&&!a)switch(i){case"CLOSED-CAPTIONS":if("NONE"===s)break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":qd.warn(`${e}: attribute ${i} is missing quotes`)}n[i]=s}return n}}function _p(e){return"ID"!==e&&"CLASS"!==e&&"CUE"!==e&&"START-DATE"!==e&&"DURATION"!==e&&"END-DATE"!==e&&"END-ON-NEXT"!==e}function Mp(e){return"SCTE35-OUT"===e||"SCTE35-IN"===e||"SCTE35-CMD"===e}class Op{constructor(e,t,r=0){var n;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(null==t?void 0:t.tagAnchor)||null,this.tagOrder=null!=(n=null==t?void 0:t.tagOrder)?n:r,t){const r=t.attr;for(const t in r)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==r[t]){qd.warn(`DATERANGE tag attribute: "${t}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=t;break}e=Ud(new Dp({}),r,e)}if(this.attr=e,t?(this._startDate=t._startDate,this._cue=t._cue,this._endDate=t._endDate,this._dateAtEnd=t._dateAtEnd):this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const e=(null==t?void 0:t.endDate)||new Date(this.attr["END-DATE"]);kd(e.getTime())&&(this._endDate=e)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const e=this._cue;return void 0===e?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):e}get startTime(){const{tagAnchor:e}=this;return null===e||null===e.programDateTime?(qd.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`),NaN):e.start+(this.startDate.getTime()-e.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const e=this._endDate||this._dateAtEnd;if(e)return e;const t=this.duration;return null!==t?this._dateAtEnd=new Date(this._startDate.getTime()+1e3*t):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(kd(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isInterstitial(){return"com.apple.hls.interstitial"===this.class}get isValid(){return!!this.id&&!this._badValueForSameId&&kd(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}class Np{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e)return this.advanced=!0,void(this.updated=!0);const t=this.lastPartSn-e.lastPartSn,r=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!r||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||0===t&&r>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1}hasKey(e){return this.encryptedFragments.some(t=>{let r=t.decryptdata;return r||(t.setKeyFormat(e.keyFormat),r=t.decryptdata),!!r&&e.matches(r)})}get hasProgramDateTime(){return!!this.fragments.length&&kd(this.fragments[this.fragments.length-1].programDateTime)}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||10}get drift(){const e=this.driftEndTime-this.driftStartTime;if(e>0){return 1e3*(this.driftEnd-this.driftStart)/e}return 1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){return this.fragments.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){return this.fragments.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const t=this.lastPartIndex;if(-1!==t){for(let r=e.length;r--;)if(e[r].index>t)return e[r].index;return t}}return 0}get lastPartSn(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const e=this.partEnd-this.fragmentStart;return this.age>Math.max(e,this.totalduration)+this.levelTargetDuration}return!1}}function Fp(e,t){return e.length===t.length&&!e.some((e,r)=>e!==t[r])}function $p(e,t){return!e&&!t||!(!e||!t)&&Fp(e,t)}function Bp(e){return"AES-128"===e||"AES-256"===e||"AES-256-CTR"===e}function Up(e){switch(e){case"AES-128":case"AES-256":return cp;case"AES-256-CTR":return dp;default:throw new Error(`invalid full segment method ${e}`)}}function zp(e){return Uint8Array.from(atob(e),e=>e.charCodeAt(0))}function jp(e){return Uint8Array.from(unescape(encodeURIComponent(e)),e=>e.charCodeAt(0))}function Gp(e){const t=function(e,t,r){const n=e[t];e[t]=e[r],e[r]=n};t(e,0,3),t(e,1,2),t(e,4,5),t(e,6,7)}function Hp(e){const t=e.split(":");let r=null;if("data"===t[0]&&2===t.length){const e=t[1].split(";"),n=e[e.length-1].split(",");if(2===n.length){const t="base64"===n[0],i=n[1];t?(e.splice(-1,1),r=zp(i)):r=function(e){const t=jp(e).subarray(0,16),r=new Uint8Array(16);return r.set(t,16-t.length),r}(i)}}return r}const Vp="undefined"!=typeof self?self:void 0;var Wp={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Kp="org.w3.clearkey",Yp="com.apple.streamingkeydelivery",qp="com.microsoft.playready",Xp="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";function Qp(e){switch(e){case Yp:return Wp.FAIRPLAY;case qp:return Wp.PLAYREADY;case Xp:return Wp.WIDEVINE;case Kp:return Wp.CLEARKEY}}function Zp(e){switch(e){case Wp.FAIRPLAY:return Yp;case Wp.PLAYREADY:return qp;case Wp.WIDEVINE:return Xp;case Wp.CLEARKEY:return Kp}}function Jp(e){const{drmSystems:t,widevineLicenseUrl:r}=e,n=t?[Wp.FAIRPLAY,Wp.WIDEVINE,Wp.PLAYREADY,Wp.CLEARKEY].filter(e=>!!t[e]):[];return!n[Wp.WIDEVINE]&&r&&n.push(Wp.WIDEVINE),n}const eg=null!=Vp&&null!=(tg=Vp.navigator)&&tg.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;var tg;function rg(e){const t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),r=String.fromCharCode.apply(null,Array.from(t)),n=r.substring(r.indexOf("<"),r.length),i=(new DOMParser).parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(i){const e=i.childNodes[0]?i.childNodes[0].nodeValue:i.getAttribute("VALUE");if(e){const t=zp(e).subarray(0,16);return Gp(t),t}}return null}let ng={};class ig{static clearKeyUriToKeyIdMap(){ng={}}static setKeyIdForUri(e,t){ng[e]=t}static addKeyIdForUri(e){const t=Object.keys(ng).length%Number.MAX_SAFE_INTEGER,r=new Uint8Array(16);return new DataView(r.buffer,12,4).setUint32(0,t),ng[e]=r,r}constructor(e,t,r,n=[1],i=null,s){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=r,this.keyFormatVersions=n,this.iv=i,this.encrypted=!!e&&"NONE"!==e,this.isCommonEncryption=this.encrypted&&!Bp(e),null!=s&&s.startsWith("0x")&&(this.keyId=new Uint8Array(eh(s)))}matches(e){return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&Fp(e.keyFormatVersions,this.keyFormatVersions)&&$p(e.iv,this.iv)&&$p(e.keyId,this.keyId)}isSupported(){if(this.method){if(Bp(this.method)||"NONE"===this.method)return!0;if("identity"===this.keyFormat)return"SAMPLE-AES"===this.method;switch(this.keyFormat){case Yp:case Xp:case qp:case Kp:return-1!==["SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)}}return!1}getDecryptData(e,t){if(!this.encrypted||!this.uri)return null;if(Bp(this.method)){let t=this.iv;t||("number"!=typeof e&&(qd.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0),t=function(e){const t=new Uint8Array(16);for(let r=12;r<16;r++)t[r]=e>>8*(15-r)&255;return t}(e));return new ig(this.method,this.uri,"identity",this.keyFormatVersions,t)}if(this.keyId){const e=ng[this.uri];if(e&&!Fp(this.keyId,e)&&ig.setKeyIdForUri(this.uri,this.keyId),this.pssh)return this}const r=Hp(this.uri);if(r)switch(this.keyFormat){case Xp:if(this.pssh=r,!this.keyId){const e=function(e){const t=[];if(e instanceof ArrayBuffer){const r=e.byteLength;let n=0;for(;n+32<r;){const r=Hh(new DataView(e,n));t.push(r),n+=r.size}}return t}(r.buffer);if(e.length){var n;const t=e[0];this.keyId=null!=(n=t.kids)&&n.length?t.kids[0]:null}}this.keyId||(this.keyId=sg(t));break;case qp:{const e=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Gh(e,0,r),this.keyId=rg(r);break}default:{let e=r.subarray(0,16);if(16!==e.length){const t=new Uint8Array(16);t.set(e,16-e.length),e=t}this.keyId=e;break}}if(!this.keyId||16!==this.keyId.byteLength){let e;e=function(e){const t=null==e?void 0:e[Xp];if(t)return t.keyId;return null}(t),e||(e=sg(t),e||(e=ng[this.uri])),e&&(this.keyId=e,ig.setKeyIdForUri(this.uri,e))}return this}}function sg(e){const t=null==e?void 0:e[qp];if(t){const e=Hp(t.uri);if(e)return rg(e)}return null}const ag=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,og=/#EXT-X-MEDIA:(.*)/g,lg=/^#EXT(?:INF|-X-TARGETDURATION):/m,ug=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),cg=new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class dg{static findGroup(e,t){for(let r=0;r<e.length;r++){const n=e[r];if(n.id===t)return n}}static resolve(e,t){return uh.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return lg.test(e)}static parseMasterPlaylist(e,t){const r={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:Ap(e)},n=[];if(ag.lastIndex=0,!e.startsWith("#EXTM3U"))return r.playlistParsingError=new Error("no EXTM3U delimiter"),r;let i;for(;null!=(i=ag.exec(e));)if(i[1]){var s;const e=new Dp(i[1],r),a=Rp(r,i[2]),o={attrs:e,bitrate:e.decimalInteger("BANDWIDTH")||e.decimalInteger("AVERAGE-BANDWIDTH"),name:e.NAME,url:dg.resolve(a,t)},l=e.decimalResolution("RESOLUTION");l&&(o.width=l.width,o.height=l.height),mg(e.CODECS,o);const u=e["SUPPLEMENTAL-CODECS"];u&&(o.supplemental={},mg(u,o.supplemental)),null!=(s=o.unknownCodecs)&&s.length||n.push(o),r.levels.push(o)}else if(i[3]){const e=i[3],n=i[4];switch(e){case"SESSION-DATA":{const e=new Dp(n,r),t=e["DATA-ID"];t&&(null===r.sessionData&&(r.sessionData={}),r.sessionData[t]=e);break}case"SESSION-KEY":{const e=pg(n,t,r);e.encrypted&&e.isSupported()?(null===r.sessionKeys&&(r.sessionKeys=[]),r.sessionKeys.push(e)):qd.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${n}"`);break}case"DEFINE":Lp(r,new Dp(n,r),t);break;case"CONTENT-STEERING":{const e=new Dp(n,r);r.contentSteering={uri:dg.resolve(e["SERVER-URI"],t),pathwayId:e["PATHWAY-ID"]||"."};break}case"START":r.startTimeOffset=gg(n)}}const a=n.length>0&&n.length<r.levels.length;return r.levels=a?n:r.levels,0===r.levels.length&&(r.playlistParsingError=new Error("no levels found in manifest")),r}static parseMasterPlaylistMedia(e,t,r){let n;const i={},s=r.levels,a={AUDIO:s.map(e=>({id:e.attrs.AUDIO,audioCodec:e.audioCodec})),SUBTITLES:s.map(e=>({id:e.attrs.SUBTITLES,textCodec:e.textCodec})),"CLOSED-CAPTIONS":[]};let o=0;for(og.lastIndex=0;null!==(n=og.exec(e));){const e=new Dp(n[1],r),s=e.TYPE;if(s){const r=a[s],n=i[s]||[];i[s]=n;const l=e.LANGUAGE,u=e["ASSOC-LANGUAGE"],c=e.CHANNELS,d=e.CHARACTERISTICS,h=e["INSTREAM-ID"],f={attrs:e,bitrate:0,id:o++,groupId:e["GROUP-ID"]||"",name:e.NAME||l||"",type:s,default:e.bool("DEFAULT"),autoselect:e.bool("AUTOSELECT"),forced:e.bool("FORCED"),lang:l,url:e.URI?dg.resolve(e.URI,t):""};if(u&&(f.assocLang=u),c&&(f.channels=c),d&&(f.characteristics=d),h&&(f.instreamId=h),null!=r&&r.length){const e=dg.findGroup(r,f.groupId)||r[0];vg(f,e,"audioCodec"),vg(f,e,"textCodec")}n.push(f)}}return i}static parseLevelPlaylist(e,t,r,n,i,s){var a;const o={url:t},l=new Np(t),u=l.fragments,c=[];let d,h,f,p,g=null,m=0,v=0,y=0,b=0,w=0,E=null,S=new mh(n,o),T=-1,k=!1,x=null;if(ug.lastIndex=0,l.m3u8=e,l.hasVariableRefs=Ap(e),"#EXTM3U"!==(null==(a=ug.exec(e))?void 0:a[0]))return l.playlistParsingError=new Error("Missing format identifier #EXTM3U"),l;for(;null!==(d=ug.exec(e));){k&&(k=!1,S=new mh(n,o),S.playlistOffset=y,S.setStart(y),S.sn=m,S.cc=b,w&&(S.bitrate=w),S.level=r,g&&(S.initSegment=g,g.rawProgramDateTime&&(S.rawProgramDateTime=g.rawProgramDateTime,g.rawProgramDateTime=null),x&&(S.setByteRange(x),x=null)));const e=d[1];if(e){S.duration=parseFloat(e);const t=(" "+d[2]).slice(1);S.title=t||null,S.tagList.push(t?["INF",e,t]:["INF",e])}else if(d[3]){if(kd(S.duration)){S.playlistOffset=y,S.setStart(y),f&&wg(S,f,l),S.sn=m,S.level=r,S.cc=b,u.push(S);const e=(" "+d[3]).slice(1);S.relurl=Rp(l,e),yg(S,E,c),E=S,y+=S.duration,m++,v=0,k=!0}}else{if(d=d[0].match(cg),!d){qd.warn("No matches on slow regex match for level playlist!");continue}for(h=1;h<d.length&&void 0===d[h];h++);const e=(" "+d[h]).slice(1),i=(" "+d[h+1]).slice(1),a=d[h+2]?(" "+d[h+2]).slice(1):null;switch(e){case"BYTERANGE":E?S.setByteRange(i,E):S.setByteRange(i);break;case"PROGRAM-DATE-TIME":S.rawProgramDateTime=i,S.tagList.push(["PROGRAM-DATE-TIME",i]),-1===T&&(T=u.length);break;case"PLAYLIST-TYPE":l.type&&Eg(l,e,d),l.type=i.toUpperCase();break;case"MEDIA-SEQUENCE":0!==l.startSN?Eg(l,e,d):u.length>0&&Sg(l,e,d),m=l.startSN=parseInt(i);break;case"SKIP":{l.skippedSegments&&Eg(l,e,d);const t=new Dp(i,l),r=t.decimalInteger("SKIPPED-SEGMENTS");if(kd(r)){l.skippedSegments+=r;for(let e=r;e--;)u.push(null);m+=r}const n=t.enumeratedString("RECENTLY-REMOVED-DATERANGES");n&&(l.recentlyRemovedDateranges=(l.recentlyRemovedDateranges||[]).concat(n.split("\t")));break}case"TARGETDURATION":0!==l.targetduration&&Eg(l,e,d),l.targetduration=Math.max(parseInt(i),1);break;case"VERSION":null!==l.version&&Eg(l,e,d),l.version=parseInt(i);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":l.live||Eg(l,e,d),l.live=!1;break;case"#":(i||a)&&S.tagList.push(a?[i,a]:[i]);break;case"DISCONTINUITY":b++,S.tagList.push(["DIS"]);break;case"GAP":S.gap=!0,S.tagList.push([e]);break;case"BITRATE":S.tagList.push([e,i]),w=1e3*parseInt(i),kd(w)?S.bitrate=w:w=0;break;case"DATERANGE":{const e=new Dp(i,l),t=new Op(e,l.dateRanges[e.ID],l.dateRangeTagCount);l.dateRangeTagCount++,t.isValid||l.skippedSegments?l.dateRanges[t.id]=t:qd.warn(`Ignoring invalid DATERANGE tag: "${i}"`),S.tagList.push(["EXT-X-DATERANGE",i]);break}case"DEFINE":{const e=new Dp(i,l);"IMPORT"in e?Ip(l,e,s):Lp(l,e,t)}break;case"DISCONTINUITY-SEQUENCE":0!==l.startCC?Eg(l,e,d):u.length>0&&Sg(l,e,d),l.startCC=b=parseInt(i);break;case"KEY":{const e=pg(i,t,l);if(e.isSupported()){if("NONE"===e.method){f=void 0;break}f||(f={});const t=f[e.keyFormat];null!=t&&t.matches(e)||(t&&(f=Ud({},f)),f[e.keyFormat]=e)}else qd.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${i}"`);break}case"START":l.startTimeOffset=gg(i);break;case"MAP":{const e=new Dp(i,l);if(S.duration){const t=new mh(n,o);bg(t,e,r,f),g=t,S.initSegment=g,g.rawProgramDateTime&&!S.rawProgramDateTime&&(S.rawProgramDateTime=g.rawProgramDateTime)}else{const t=S.byteRangeEndOffset;if(t){const e=S.byteRangeStartOffset;x=`${t-e}@${e}`}else x=null;bg(S,e,r,f),g=S,k=!0}g.cc=b;break}case"SERVER-CONTROL":p&&Eg(l,e,d),p=new Dp(i),l.canBlockReload=p.bool("CAN-BLOCK-RELOAD"),l.canSkipUntil=p.optionalFloat("CAN-SKIP-UNTIL",0),l.canSkipDateRanges=l.canSkipUntil>0&&p.bool("CAN-SKIP-DATERANGES"),l.partHoldBack=p.optionalFloat("PART-HOLD-BACK",0),l.holdBack=p.optionalFloat("HOLD-BACK",0);break;case"PART-INF":{l.partTarget&&Eg(l,e,d);const t=new Dp(i);l.partTarget=t.decimalFloatingPoint("PART-TARGET");break}case"PART":{let e=l.partList;e||(e=l.partList=[]);const t=v>0?e[e.length-1]:void 0,r=v++,n=new Dp(i,l),s=new vh(n,S,o,r,t);e.push(s),S.duration+=s.duration;break}case"PRELOAD-HINT":{const e=new Dp(i,l);l.preloadHint=e;break}case"RENDITION-REPORT":{const e=new Dp(i,l);l.renditionReports=l.renditionReports||[],l.renditionReports.push(e);break}default:qd.warn(`line parsed but not handled: ${d}`)}}}E&&!E.relurl?(u.pop(),y-=E.duration,l.partList&&(l.fragmentHint=E)):l.partList&&(yg(S,E,c),S.cc=b,l.fragmentHint=S,f&&wg(S,f,l)),l.targetduration||(l.playlistParsingError=new Error("Missing Target Duration"));const A=u.length,R=u[0],L=u[A-1];if(y+=l.skippedSegments*l.targetduration,y>0&&A&&L){l.averagetargetduration=y/A;const e=L.sn;l.endSN="initSegment"!==e?e:0,l.live||(L.endList=!0),T>0&&(!function(e,t){let r=e[t];for(let n=t;n--;){const t=e[n];if(!t)return;t.programDateTime=r.programDateTime-1e3*t.duration,r=t}}(u,T),R&&c.unshift(R))}return l.fragmentHint&&(y+=l.fragmentHint.duration),l.totalduration=y,c.length&&l.dateRangeTagCount&&R&&hg(c,l),l.endCC=b,l}}function hg(e,t){let r=e.length;if(!r){if(!t.hasProgramDateTime)return;{const n=t.fragments[t.fragments.length-1];e.push(n),r++}}const n=e[r-1],i=t.live?1/0:t.totalduration,s=Object.keys(t.dateRanges);for(let o=s.length;o--;){const l=t.dateRanges[s[o]],u=l.startDate.getTime();l.tagAnchor=n.ref;for(let n=r;n--;){var a;if((null==(a=e[n])?void 0:a.sn)<t.startSN)break;const r=fg(t,u,e,n,i);if(-1!==r){l.tagAnchor=t.fragments[r].ref;break}}}}function fg(e,t,r,n,i){const s=r[n];if(s){const o=s.programDateTime;if(t>=o||0===n){var a;if(t<=o+1e3*(((null==(a=r[n+1])?void 0:a.start)||i)-s.start)){const i=r[n].sn-e.startSN;if(i<0)return-1;const s=e.fragments;if(s.length>r.length){for(let a=(r[n+1]||s[s.length-1]).sn-e.startSN;a>i;a--){const e=s[a].programDateTime;if(t>=e&&t<e+1e3*s[a].duration)return a}}return i}}}return-1}function pg(e,t,r){var n,i;const s=new Dp(e,r),a=null!=(n=s.METHOD)?n:"",o=s.URI,l=s.hexadecimalInteger("IV"),u=s.KEYFORMATVERSIONS,c=null!=(i=s.KEYFORMAT)?i:"identity";o&&s.IV&&!l&&qd.error(`Invalid IV: ${s.IV}`);const d=o?dg.resolve(o,t):"",h=(u||"1").split("/").map(Number).filter(Number.isFinite);return new ig(a,d,c,h,l,s.KEYID)}function gg(e){const t=new Dp(e).decimalFloatingPoint("TIME-OFFSET");return kd(t)?t:null}function mg(e,t){let r=(e||"").split(/[ ,]+/).filter(e=>e);["video","audio","text"].forEach(e=>{const n=r.filter(t=>Kh(t,e));n.length&&(t[`${e}Codec`]=n.map(e=>e.split("/")[0]).join(","),r=r.filter(e=>-1===n.indexOf(e)))}),t.unknownCodecs=r}function vg(e,t,r){const n=t[r];n&&(e[r]=n)}function yg(e,t,r){e.rawProgramDateTime?r.push(e):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime)}function bg(e,t,r,n){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=r,e.sn="initSegment",n&&(e.levelkeys=n),e.initSegment=null}function wg(e,t,r){e.levelkeys=t;const{encryptedFragments:n}=r;n.length&&n[n.length-1].levelkeys===t||!Object.keys(t).some(e=>t[e].isCommonEncryption)||n.push(e)}function Eg(e,t,r){e.playlistParsingError=new Error(`#EXT-X-${t} must not appear more than once (${r[0]})`)}function Sg(e,t,r){e.playlistParsingError=new Error(`#EXT-X-${t} must appear before the first Media Segment (${r[0]})`)}function Tg(e,t){const r=t.startPTS;if(kd(r)){let n,i=0;t.sn>e.sn?(i=r-e.start,n=e):(i=e.start-r,n=t),n.duration!==i&&n.setDuration(i)}else if(t.sn>e.sn){e.cc===t.cc&&e.minEndPTS?t.setStart(e.start+(e.minEndPTS-e.start)):t.setStart(e.start+e.duration)}else t.setStart(Math.max(e.start-t.duration,0))}function kg(e,t,r,n,i,s,a){n-r<=0&&(a.warn("Fragment should have a positive duration",t),n=r+t.duration,s=i+t.duration);let o=r,l=n;const u=t.startPTS,c=t.endPTS;if(kd(u)){const d=Math.abs(u-r);e&&d>e.totalduration?a.warn(`media timestamps and playlist times differ by ${d}s for level ${t.level} ${e.url}`):kd(t.deltaPTS)?t.deltaPTS=Math.max(d,t.deltaPTS):t.deltaPTS=d,o=Math.max(r,u),r=Math.min(r,u),i=void 0!==t.startDTS?Math.min(i,t.startDTS):i,l=Math.min(n,c),n=Math.max(n,c),s=void 0!==t.endDTS?Math.max(s,t.endDTS):s}const d=r-t.start;0!==t.start&&t.setStart(r),t.setDuration(n-t.start),t.startPTS=r,t.maxStartPTS=o,t.startDTS=i,t.endPTS=n,t.minEndPTS=l,t.endDTS=s;const h=t.sn;if(!e||h<e.startSN||h>e.endSN)return 0;let f;const p=h-e.startSN,g=e.fragments;for(g[p]=t,f=p;f>0;f--)Tg(g[f],g[f-1]);for(f=p;f<g.length-1;f++)Tg(g[f],g[f+1]);return e.fragmentHint&&Tg(g[g.length-1],e.fragmentHint),e.PTSKnown=e.alignedSliding=!0,d}function xg(e,t,r){if(e===t)return;let n=null;const i=e.fragments;for(let e=i.length-1;e>=0;e--){const t=i[e].initSegment;if(t){n=t;break}}let s;e.fragmentHint&&delete e.fragmentHint.endPTS,function(e,t,r){const n=t.skippedSegments,i=Math.max(e.startSN,t.startSN)-t.startSN,s=(e.fragmentHint?1:0)+(n?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,a=t.startSN-e.startSN,o=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments;for(let u=i;u<=s;u++){const i=l[a+u];let s=o[u];if(n&&!s&&i&&(s=t.fragments[u]=i),i&&s){r(i,s,u,o);const n=i.relurl,a=s.relurl;if(n&&Mg(n,a))return void(t.playlistParsingError=Ag(`media sequence mismatch ${s.sn}:`,e,t,i,s));if(i.cc!==s.cc)return void(t.playlistParsingError=Ag(`discontinuity sequence mismatch (${i.cc}!=${s.cc})`,e,t,i,s))}}}(e,t,(e,r,i,a)=>{if((!t.startCC||t.skippedSegments)&&r.cc!==e.cc){const n=e.cc-r.cc;for(let e=i;e<a.length;e++)a[e].cc+=n;t.endCC=a[a.length-1].cc}kd(e.startPTS)&&kd(e.endPTS)&&(r.setStart(r.startPTS=e.startPTS),r.startDTS=e.startDTS,r.maxStartPTS=e.maxStartPTS,r.endPTS=e.endPTS,r.endDTS=e.endDTS,r.minEndPTS=e.minEndPTS,r.setDuration(e.endPTS-e.startPTS),r.duration&&(s=r),t.PTSKnown=t.alignedSliding=!0),e.hasStreams&&(r.elementaryStreams=e.elementaryStreams),r.loader=e.loader,e.hasStats&&(r.stats=e.stats),e.initSegment&&(r.initSegment=e.initSegment,n=e.initSegment)});const a=t.fragments,o=t.fragmentHint?a.concat(t.fragmentHint):a;if(n&&o.forEach(e=>{var t;!e||e.initSegment&&e.initSegment.relurl!==(null==(t=n)?void 0:t.relurl)||(e.initSegment=n)}),t.skippedSegments){if(t.deltaUpdateFailed=a.some(e=>!e),t.deltaUpdateFailed){r.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let e=t.skippedSegments;e--;)a.shift();t.startSN=a[0].sn}else{t.canSkipDateRanges&&(t.dateRanges=function(e,t,r){const{dateRanges:n,recentlyRemovedDateranges:i}=t,s=Ud({},e);i&&i.forEach(e=>{delete s[e]});const a=Object.keys(s).length;if(!a)return n;return Object.keys(n).forEach(e=>{const t=s[e],i=new Op(n[e].attr,t);i.isValid?(s[e]=i,t||(i.tagOrder+=a)):r.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${xf(n[e].attr)}"`)}),s}(e.dateRanges,t,r));const n=e.fragments.filter(e=>e.rawProgramDateTime);if(e.hasProgramDateTime&&!t.hasProgramDateTime)for(let e=1;e<o.length;e++)null===o[e].programDateTime&&yg(o[e],o[e-1],n);hg(n,t)}t.endCC=a[a.length-1].cc}if(!t.startCC){var l;const r=Cg(e,t.startSN-1);t.startCC=null!=(l=null==r?void 0:r.cc)?l:a[0].cc}!function(e,t,r){if(e&&t){let n=0;for(let i=0,s=e.length;i<=s;i++){const s=e[i],a=t[i+n];s&&a&&s.index===a.index&&s.fragment.sn===a.fragment.sn?r(s,a):n--}}}(e.partList,t.partList,(e,t)=>{t.elementaryStreams=e.elementaryStreams,t.stats=e.stats}),s?kg(t,s,s.startPTS,s.endPTS,s.startDTS,s.endDTS,r):Rg(e,t),a.length&&(t.totalduration=t.edge-a[0].start),t.driftStartTime=e.driftStartTime,t.driftStart=e.driftStart;const u=t.advancedDateTime;if(t.advanced&&u){const e=t.edge;t.driftStart||(t.driftStartTime=u,t.driftStart=e),t.driftEndTime=u,t.driftEnd=e}else t.driftEndTime=e.driftEndTime,t.driftEnd=e.driftEnd,t.advancedDateTime=e.advancedDateTime;-1===t.requestScheduled&&(t.requestScheduled=e.requestScheduled)}function Ag(e,t,r,n,i){return new Error(`${e} ${i.url}\nPlaylist starting @${t.startSN}\n${t.m3u8}\n\nPlaylist starting @${r.startSN}\n${r.m3u8}`)}function Rg(e,t,r=!0){const n=t.startSN+t.skippedSegments-e.startSN,i=e.fragments,s=n>=0;let a=0;if(s&&n<i.length)a=i[n].start;else if(s&&t.startSN===e.endSN+1)a=e.fragmentEnd;else if(s&&r)a=e.fragmentStart+n*t.levelTargetDuration;else{if(t.skippedSegments||0!==t.fragmentStart)return;a=e.fragmentStart}Lg(t,a)}function Lg(e,t){if(t){const r=e.fragments;for(let n=e.skippedSegments;n<r.length;n++)r[n].addStart(t);e.fragmentHint&&e.fragmentHint.addStart(t)}}function Ig(e,t=1/0){let r=1e3*e.targetduration;if(e.updated){const n=e.fragments,i=4;if(n.length&&r*i>t){const e=1e3*n[n.length-1].duration;e<r&&(r=e)}}else r/=2;return Math.round(r)}function Cg(e,t,r){if(!e)return null;let n=e.fragments[t-e.startSN];return n||(n=e.fragmentHint,n&&n.sn===t?n:t<e.startSN&&r&&r.sn===t?r:null)}function Pg(e,t,r){return e?Dg(e.partList,t,r):null}function Dg(e,t,r){if(e)for(let n=e.length;n--;){const i=e[n];if(i.index===r&&i.fragment.sn===t)return i}return null}function _g(e){e.forEach((e,t)=>{var r;null==(r=e.details)||r.fragments.forEach(e=>{e.level=t,e.initSegment&&(e.initSegment.level=t)})})}function Mg(e,t){return!(e===t||!t)&&Og(e)!==Og(t)}function Og(e){return e.replace(/\?[^?]*$/,"")}function Ng(e,t){for(let n=0,i=e.length;n<i;n++){var r;if((null==(r=e[n])?void 0:r.cc)===t)return e[n]}return null}function Fg(e,t){const r=e.start+t;e.startPTS=r,e.setStart(r),e.endPTS=r+e.duration}function $g(e,t){const r=t.fragments;for(let t=0,n=r.length;t<n;t++)Fg(r[t],e);t.fragmentHint&&Fg(t.fragmentHint,e),t.alignedSliding=!0}function Bg(e,t){if(!function(e,t){return!!(e&&t.startCC<e.endCC&&t.endCC>e.startCC)}(t,e))return;const r=Math.min(t.endCC,e.endCC),n=Ng(t.fragments,r),i=Ng(e.fragments,r);if(!n||!i)return;qd.log(`Aligning playlist at start of dicontinuity sequence ${r}`);$g(n.start-i.start,e)}function Ug(e,t){if(!e.hasProgramDateTime||!t.hasProgramDateTime)return;const r=e.fragments,n=t.fragments;if(!r.length||!n.length)return;let i,s;const a=Math.min(t.endCC,e.endCC);t.startCC<a&&e.startCC<a&&(i=Ng(n,a),s=Ng(r,a)),i&&s||(i=n[Math.floor(n.length/2)],s=Ng(r,i.cc)||r[Math.floor(r.length/2)]);const o=i.programDateTime,l=s.programDateTime;if(!o||!l)return;$g((l-o)/1e3-(s.start-i.start),e)}function zg(e,t,r){jg(e,t,r),e.addEventListener(t,r)}function jg(e,t,r){e.removeEventListener(t,r)}const Gg=function(e){let t="";const r=e.length;for(let n=0;n<r;n++)t+=`[${e.start(n).toFixed(3)}-${e.end(n).toFixed(3)}]`;return t},Hg="STOPPED",Vg="IDLE",Wg="KEY_LOADING",Kg="FRAG_LOADING",Yg="FRAG_LOADING_WAITING_RETRY",qg="WAITING_TRACK",Xg="PARSING",Qg="PARSED",Zg="ENDED",Jg="ERROR",em="WAITING_INIT_PTS",tm="WAITING_LEVEL";class rm extends Ep{constructor(e,t,r,n,i){super(n,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=Hg,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:e,fragCurrent:t,media:r,mediaBuffer:n,state:i}=this,s=r?r.currentTime:0,a=kp.bufferInfo(n||r,s,e.maxBufferHole),o=!a.len;if(this.log(`Media seeking to ${kd(s)?s.toFixed(3):s}, state: ${i}, ${o?"out of":"in"} buffer`),this.state===Zg)this.resetLoadingState();else if(t){const r=e.maxFragLookUpTolerance,n=t.start-r,i=t.start+t.duration+r;if(o||i<a.start||n>a.end){const e=s>i;(s<n||e)&&(e&&t.loader&&(this.log(`Cancelling fragment load for seek (sn: ${t.sn})`),t.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(r){this.fragmentTracker.removeFragmentsInRange(s,1/0,this.playlistType,!0);if(s>this.lastCurrentTime&&(this.lastCurrentTime=s),!this.loadingParts){const e=Math.max(a.end,s),t=this.shouldLoadParts(this.getLevelDetails(),e);t&&(this.log(`LL-Part loading ON after seeking to ${s.toFixed(2)} with buffer @${e.toFixed(2)}`),this.loadingParts=t)}}this.hls.hasEnoughToStart||(this.log(`Setting ${o?"startPosition":"nextLoadPosition"} to ${s} for seek without enough to start`),this.nextLoadPosition=s,o&&(this.startPosition=s)),o&&this.state===Vg&&this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=i,this.hls=e,this.fragmentLoader=new vp(e.config),this.keyLoader=r,this.fragmentTracker=t,this.config=e.config,this.decrypter=new gp(e.config)}registerListeners(){const{hls:e}=this;e.on(Id.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Id.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Id.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Id.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(Id.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Id.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Id.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Id.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===Hg)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;null!=e&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=Hg}get startPositionValue(){const{nextLoadPosition:e,startPosition:t}=this;return-1===t&&e?e:t}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(e,t){if(t.live||!this.media)return!1;const r=e.end||0,n=this.config.timelineOffset||0;if(r<=n)return!1;const i=e.buffered;this.config.maxBufferHole&&i&&i.length>1&&(e=kp.bufferedInfo(i,e.start,0));const s=e.nextStart;if(s&&s>n&&s<t.edge)return!1;if(this.media.currentTime<e.start)return!1;const a=t.partList;if(null!=a&&a.length){const e=a[a.length-1];return kp.isBuffered(this.media,e.start+e.duration/2)}const o=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(o)}getLevelDetails(){if(this.levels&&null!==this.levelLastLoaded)return this.levelLastLoaded.details}get timelineOffset(){const e=this.config.timelineOffset;var t;return e?(null==(t=this.getLevelDetails())?void 0:t.appliedTimelineOffset)||e:0}onMediaAttached(e,t){const r=this.media=this.mediaBuffer=t.media;zg(r,"seeking",this.onMediaSeeking),zg(r,"ended",this.onMediaEnded);const n=this.config;this.levels&&n.autoStartLoad&&this.state===Hg&&this.startLoad(n.startPosition)}onMediaDetaching(e,t){const r=!!t.transferMedia,n=this.media;if(null!==n){if(n.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),jg(n,"seeking",this.onMediaSeeking),jg(n,"ended",this.onMediaEnded),this.keyLoader&&!r&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,r)return this.resetLoadingState(),void this.resetTransmuxer();this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(e,t){}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=Hg,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,r){this.startFragRequested=!0,this._loadFragForPlayback(e,t,r)}_loadFragForPlayback(e,t,r){this._doFragLoad(e,t,r,e=>{const t=e.frag;if(this.fragContextChanged(t))return this.warn(`${t.type} sn: ${t.sn}${e.part?" part: "+e.part.index:""} of ${this.fragInfo(t,!1,e.part)}) was dropped during download.`),void this.fragmentTracker.removeFragment(t);t.stats.chunkCount++,this._handleFragmentLoadProgress(e)}).then(e=>{if(!e)return;const t=this.state,r=e.frag;this.fragContextChanged(r)?(t===Kg||!this.fragCurrent&&t===Xg)&&(this.fragmentTracker.removeFragment(r),this.state=Vg):("payload"in e&&(this.log(`Loaded ${r.type} sn: ${r.sn} of ${this.playlistLabel()} ${r.level}`),this.hls.trigger(Id.FRAG_LOADED,e)),this._handleFragmentLoadComplete(e))}).catch(t=>{this.state!==Hg&&this.state!==Jg&&(this.warn(`Frag error: ${(null==t?void 0:t.message)||t}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:r}=this;if(r.getState(e)===np){const t=e.type,n=this.getFwdBufferInfo(this.mediaBuffer,t),i=Math.max(e.duration,n?n.len:this.config.maxBufferLength),s=this.backtrackFragment;(1===(s?e.sn-s.sn:0)||this.reduceMaxBufferLength(i,e.duration))&&r.removeFragment(e)}else 0===(null==(t=this.mediaBuffer)?void 0:t.buffered.length)?r.removeAllFragments():r.hasParts(e.type)&&(r.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),r.getState(e)===ip&&r.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}waitForLive(e){const t=e.details;return(null==t?void 0:t.live)&&"EVENT"!==t.type&&(this.levelLastLoaded!==e||t.expired)}flushMainBuffer(e,t,r=null){if(!(e-t))return;const n={startOffset:e,endOffset:t,type:r};this.hls.trigger(Id.BUFFER_FLUSHING,n)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(e=>{const t=null==e?void 0:e.frag;if(!t||this.fragContextChanged(t)||!this.levels)throw new Error("init load aborted");return e}).then(e=>{const{hls:t}=this,{frag:r,payload:n}=e,i=r.decryptdata;if(n&&n.byteLength>0&&null!=i&&i.key&&i.iv&&Bp(i.method)){const s=self.performance.now();return this.decrypter.decrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer,Up(i.method)).catch(e=>{throw t.trigger(Id.ERROR,{type:Rd.MEDIA_ERROR,details:Ld.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:r}),e}).then(n=>{const i=self.performance.now();return t.trigger(Id.FRAG_DECRYPTED,{frag:r,payload:n,stats:{tstart:s,tdecrypt:i}}),e.payload=n,this.completeInitSegmentLoad(e)})}return this.completeInitSegmentLoad(e)}).catch(t=>{this.state!==Hg&&this.state!==Jg&&(this.warn(t),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const r=e.frag.stats;this.state!==Hg&&(this.state=Vg),e.frag.data=new Uint8Array(e.payload),r.parsing.start=r.buffering.start=self.performance.now(),r.parsing.end=r.buffering.end=self.performance.now(),this.tick()}unhandledEncryptionError(e,t){var r,n;const i=e.tracks;if(i&&!t.encrypted&&(null!=(r=i.audio)&&r.encrypted||null!=(n=i.video)&&n.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){const e=this.media,r=new Error(`Encrypted track with no key in ${this.fragInfo(t)} (media ${e?"attached mediaKeys: "+e.mediaKeys:"detached"})`);return this.warn(r.message),!e||e.mediaKeys?!1:(this.hls.trigger(Id.ERROR,{type:Rd.KEY_SYSTEM_ERROR,details:Ld.KEY_SYSTEM_NO_KEYS,fatal:!1,error:r,frag:t}),this.resetTransmuxer(),!0)}return!1}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){const r=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)} > buffer:${r?Gg(kp.getBuffered(r)):"(detached)"})`),gh(e)){var n;if(e.type!==Nd){const t=e.elementaryStreams;if(!Object.keys(t).some(e=>!!t[e]))return void(this.state=Vg)}const t=null==(n=this.levels)?void 0:n[e.level];null!=t&&t.fragmentError&&(this.log(`Resetting level fragment error count of ${t.fragmentError} on frag buffered`),t.fragmentError=0)}this.state=Vg}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:r,part:n,partsLoaded:i}=e,s=!i||0===i.length||i.some(e=>!e),a=new Sp(r.level,r.sn,r.stats.chunkCount+1,0,n?n.index:-1,!s);t.flush(a)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,r=null,n){var i;this.fragCurrent=e;const s=t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let a=null;if(!e.encrypted||null!=(i=e.decryptdata)&&i.key)e.encrypted||(a=this.keyLoader.loadClear(e,s.encryptedFragments,this.startFragRequested),a&&this.log("[eme] blocking frag load until media-keys acquired"));else if(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=Wg,this.fragCurrent=e,a=this.keyLoader.load(e).then(e=>{if(!this.fragContextChanged(e.frag))return this.hls.trigger(Id.KEY_LOADED,e),this.state===Wg&&(this.state=Vg),e}),this.hls.trigger(Id.KEY_LOADING,{frag:e}),null===this.fragCurrent)return this.log("context changed in KEY_LOADING"),Promise.resolve(null);const o=this.fragPrevious;if(gh(e)&&(!o||e.sn!==o.sn)){const r=this.shouldLoadParts(t.details,e.end);r!==this.loadingParts&&(this.log(`LL-Part loading ${r?"ON":"OFF"} loading sn ${null==o?void 0:o.sn}->${e.sn}`),this.loadingParts=r)}if(r=Math.max(e.start,r||0),this.loadingParts&&gh(e)){const i=s.partList;if(i&&n){r>s.fragmentEnd&&s.fragmentHint&&(e=s.fragmentHint);const o=this.getNextPart(i,e,r);if(o>-1){const l=i[o];let u;return e=this.fragCurrent=l.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${l.index} (${o}/${i.length-1}) of ${this.fragInfo(e,!1,l)}) cc: ${e.cc} [${s.startSN}-${s.endSN}], target: ${parseFloat(r.toFixed(3))}`),this.nextLoadPosition=l.start+l.duration,this.state=Kg,u=a?a.then(r=>!r||this.fragContextChanged(r.frag)?null:this.doFragPartsLoad(e,l,t,n)).catch(e=>this.handleFragLoadError(e)):this.doFragPartsLoad(e,l,t,n).catch(e=>this.handleFragLoadError(e)),this.hls.trigger(Id.FRAG_LOADING,{frag:e,part:l,targetBufferTime:r}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):u}if(!e.url||this.loadedEndOfParts(i,r))return Promise.resolve(null)}}var l;if(gh(e)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${r.toFixed(2)} Check buffer at sn: ${e.sn} loaded parts: ${null==(l=s.partList)?void 0:l.filter(e=>e.loaded).map(e=>`[${e.start}-${e.end}]`)}`),this.loadingParts=!1;else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${"["+s.startSN+"-"+s.endSN+"]"}, target: ${parseFloat(r.toFixed(3))}`),kd(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=Kg;const u=this.config.progressive&&e.type!==Nd;let c;return c=u&&a?a.then(t=>!t||this.fragContextChanged(t.frag)?null:this.fragmentLoader.load(e,n)).catch(e=>this.handleFragLoadError(e)):Promise.all([this.fragmentLoader.load(e,u?n:void 0),a]).then(([e])=>(!u&&n&&n(e),e)).catch(e=>this.handleFragLoadError(e)),this.hls.trigger(Id.FRAG_LOADING,{frag:e,targetBufferTime:r}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):c}doFragPartsLoad(e,t,r,n){return new Promise((i,s)=>{var a;const o=[],l=null==(a=r.details)?void 0:a.partList,u=t=>{this.fragmentLoader.loadPart(e,t,n).then(n=>{o[t.index]=n;const s=n.part;this.hls.trigger(Id.FRAG_LOADED,n);const a=Pg(r.details,e.sn,t.index+1)||Dg(l,e.sn,t.index+1);if(!a)return i({frag:e,part:s,partsLoaded:o});u(a)}).catch(s)};u(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;t.frag&&t.details===Ld.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):t.frag&&t.type===Rd.KEY_SYSTEM_ERROR?(t.frag.abortRequests(),this.resetStartWhenNotLoaded(),this.resetFragmentLoading(t.frag)):this.hls.trigger(Id.ERROR,t)}else this.hls.trigger(Id.ERROR,{type:Rd.OTHER_ERROR,details:Ld.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==Xg)return void(this.fragCurrent||this.state===Hg||this.state===Jg||(this.state=Vg));const{frag:r,part:n,level:i}=t,s=self.performance.now();r.stats.parsing.end=s,n&&(n.stats.parsing.end=s);const a=this.getLevelDetails(),o=a&&r.sn>a.endSN||this.shouldLoadParts(a,r.end);o!==this.loadingParts&&(this.log(`LL-Part loading ${o?"ON":"OFF"} after parsing segment ending @${r.end.toFixed(2)}`),this.loadingParts=o),this.updateLevelTiming(r,n,i,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e.partList){var r;const i=e.partList[0];if(i.fragment.type===Nd)return!1;if(t>=i.end+((null==(r=e.fragmentHint)?void 0:r.duration)||0)){var n;if((this.hls.hasEnoughToStart?(null==(n=this.media)?void 0:n.currentTime)||this.lastCurrentTime:this.getLoadPosition())>i.start-i.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:r}=this,{level:n,sn:i,part:s}=e;if(null==t||!t[n])return this.warn(`Levels object was unset while buffering fragment ${i} of ${this.playlistLabel()} ${n}. The current chunk will not be buffered.`),null;const a=t[n],o=a.details,l=s>-1?Pg(o,i,s):null,u=l?l.fragment:Cg(o,i,r);return u?(r&&r!==u&&(u.stats=r.stats),{frag:u,part:l,level:a}):null}bufferFragmentData(e,t,r,n,i){if(this.state!==Xg)return;const{data1:s,data2:a}=e;let o=s;if(a&&(o=Fh(s,a)),!o.length)return;const l=this.initPTS[t.cc],u=l?-l.baseTime/l.timescale:void 0,c={type:e.type,frag:t,part:r,chunkMeta:n,offset:u,parent:t.type,data:o};if(this.hls.trigger(Id.BUFFER_APPENDING,c),e.dropped&&e.independent&&!r){if(i)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!kp.isBuffered(t,t.currentTime))return void this.flushMainBuffer(0,e.start);const r=t.currentTime,n=kp.bufferInfo(t,r,0),i=e.duration,s=Math.min(2*this.config.maxFragLookUpTolerance,.25*i),a=Math.max(Math.min(e.start-s,n.end-s),r+s);e.start-a>s&&this.flushMainBuffer(a,e.start)}getFwdBufferInfo(e,t){var r;const n=this.getLoadPosition();if(!kd(n))return null;const i=this.lastCurrentTime>n||null!=(r=this.media)&&r.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,n,t,i)}getFwdBufferInfoAtPos(e,t,r,n){const i=kp.bufferInfo(e,t,n);if(0===i.len&&void 0!==i.nextStart){const s=this.fragmentTracker.getBufferedFrag(t,r);if(s&&(i.nextStart<=s.end||s.gap)){const r=Math.max(Math.min(i.nextStart,s.end)-t,n);return kp.bufferInfo(e,t,r)}}return i}getMaxBufferLength(e){const{config:t}=this;let r;return r=e?Math.max(8*t.maxBufferSize/e,t.maxBufferLength):t.maxBufferLength,Math.min(r,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const r=this.config,n=Math.max(Math.min(e-t,r.maxBufferLength),t),i=Math.max(e-3*t,r.maxMaxBufferLength/2,n);return i>=n&&(r.maxMaxBufferLength=i,this.warn(`Reduce max buffer length to ${i}s`),!0)}getAppendedFrag(e,t=Md){const r=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(e,t):null;return r&&"fragment"in r?r.fragment:r}getNextFragment(e,t){const r=t.fragments,n=r.length;if(!n)return null;const{config:i}=this,s=r[0].start,a=i.lowLatencyMode&&!!t.partList;let o=null;if(t.live){const r=i.initialLiveManifestSize;if(n<r)return this.warn(`Not enough fragments to start playback (have: ${n}, need: ${r})`),null;if(!t.PTSKnown&&!this.startFragRequested&&-1===this.startPosition||e<s){var l;a&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),o=this.getInitialLiveFragment(t);const r=this.hls.startPosition,n=this.hls.liveSyncPosition,i=o?(-1!==r&&r>=s?r:n)||o.start:e;this.log(`Setting startPosition to ${i} to match start frag at live edge. mainStart: ${r} liveSyncPosition: ${n} frag.start: ${null==(l=o)?void 0:l.start}`),this.startPosition=this.nextLoadPosition=i}}else e<=s&&(o=r[0]);if(!o){const r=this.loadingParts?t.partEnd:t.fragmentEnd;o=this.getFragmentAtPosition(e,r,t)}let u=this.filterReplacedPrimary(o,t);if(!u&&o){const e=o.sn-t.startSN;u=this.filterReplacedPrimary(r[e+1]||null,t)}return this.mapToInitFragWhenRequired(u)}isLoopLoading(e,t){const r=this.fragmentTracker.getState(e);return(r===sp||r===ip&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,r,n,i){let s=null;if(e.gap&&(s=this.getNextFragment(this.nextLoadPosition,t),s&&!s.gap&&r.nextStart)){const e=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,r.nextStart,n,0);if(null!==e&&r.len+e.len>=i){const e=s.sn;return this.loopSn!==e&&(this.log(`buffer full after gaps in "${n}" playlist starting at sn: ${e}`),this.loopSn=e),null}}return this.loopSn=void 0,s}get primaryPrefetch(){if(nm(this.config)){var e;if(null==(e=this.hls.interstitialsManager)||null==(e=e.playingItem)?void 0:e.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(nm(this.config)&&e.type!==Nd){const r=this.hls.interstitialsManager,n=null==r?void 0:r.bufferingItem;if(n){const r=n.event;if(r){if(r.appendInPlace||Math.abs(e.start-n.start)>1||0===n.start)return null}else{if(e.end<=n.start&&!1===(null==t?void 0:t.live))return null;if(e.start>n.end&&n.nextEvent&&(n.nextEvent.appendInPlace||e.start-n.end>1))return null}}const i=null==r?void 0:r.playerQueue;if(i)for(let t=i.length;t--;){const r=i[t].interstitial;if(r.appendInPlace&&e.start>=r.startTime&&e.end<=r.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return null==e||!e.initSegment||e.initSegment.data||this.bitrateTest?e:e.initSegment}getNextPart(e,t,r){let n=-1,i=!1,s=!0;for(let a=0,o=e.length;a<o;a++){const o=e[a];if(s=s&&!o.independent,n>-1&&r<o.start)break;const l=o.loaded;l?n=-1:(i||(o.independent||s)&&o.fragment===t)&&(o.fragment!==t&&this.warn(`Need buffer at ${r} but next unloaded part starts at ${o.start}`),n=a),i=l}return n}loadedEndOfParts(e,t){let r;for(let n=e.length;n--;){if(r=e[n],!r.loaded)return!1;if(t>r.start)return!0}return!1}getInitialLiveFragment(e){const t=e.fragments,r=this.fragPrevious;let n=null;if(r){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${r.programDateTime}`),n=function(e,t,r){if(null===t||!Array.isArray(e)||!e.length||!kd(t))return null;if(t<(e[0].programDateTime||0))return null;if(t>=(e[e.length-1].endProgramDateTime||0))return null;for(let n=0;n<e.length;++n){const i=e[n];if(Ff(t,r,i))return i}return null}(t,r.endProgramDateTime,this.config.maxFragLookUpTolerance)),!n){const i=r.sn+1;if(i>=e.startSN&&i<=e.endSN){const s=t[i-e.startSN];r.cc===s.cc&&(n=s,this.log(`Live playlist, switching playlist, load frag with next SN: ${n.sn}`))}n||(n=$f(e,r.cc,r.end),n&&this.log(`Live playlist, switching playlist, load frag with same CC: ${n.sn}`))}}else{const t=this.hls.liveSyncPosition;null!==t&&(n=this.getFragmentAtPosition(t,this.bitrateTest?e.fragmentEnd:e.edge,e))}return n}getFragmentAtPosition(e,t,r){const{config:n}=this;let{fragPrevious:i}=this,{fragments:s,endSN:a}=r;const{fragmentHint:o}=r,{maxFragLookUpTolerance:l}=n,u=r.partList,c=!!(this.loadingParts&&null!=u&&u.length&&o);let d;if(c&&!this.bitrateTest&&u[u.length-1].fragment.sn===o.sn&&(s=s.concat(o),a=o.sn),e<t){var h;d=Of(i,s,e,e<this.lastCurrentTime||e>t-l||null!=(h=this.media)&&h.paused||!this.startFragRequested?0:l)}else d=s[s.length-1];if(d){const e=d.sn-r.startSN,t=this.fragmentTracker.getState(d);if((t===sp||t===ip&&d.gap)&&(i=d),i&&d.sn===i.sn&&(!c||u[0].fragment.sn>d.sn||!r.live)){if(d.level===i.level){const t=s[e+1];d=d.sn<a&&this.fragmentTracker.getState(t)!==sp?t:null}}}return d}alignPlaylists(e,t,r){const n=e.fragments.length;if(!n)return this.warn("No fragments in live playlist"),0;const i=e.fragmentStart,s=!t,a=e.alignedSliding&&kd(i);if(s||!a&&!i){!function(e,t){e&&(Bg(t,e),t.alignedSliding||Ug(t,e),t.alignedSliding||t.skippedSegments||Rg(e,t,!1))}(r,e);const i=e.fragmentStart;return this.log(`Live playlist sliding: ${i.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${n}`),i}return i}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,3*e.partTarget)}setStartPosition(e,t){let r=this.startPosition;r<t&&(r=-1);const n=this.timelineOffset;if(-1===r){const i=null!==this.startTimeOffset,s=i?this.startTimeOffset:e.startTimeOffset;null!==s&&kd(s)?(r=t+s,s<0&&(r+=e.edge),r=Math.min(Math.max(t,r),t+e.totalduration),this.log(`Setting startPosition to ${r} for start time offset ${s} found in ${i?"multivariant":"media"} playlist`),this.startPosition=r):e.live?(r=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${r}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=r=0),this.lastCurrentTime=r+n}this.nextLoadPosition=r+n}getLoadPosition(){var e;const{media:t}=this;let r=0;return null!=(e=this.hls)&&e.hasEnoughToStart&&t?r=t.currentTime:this.nextLoadPosition>=0&&(r=this.nextLoadPosition),r}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&gh(e)&&e.stats.aborted&&(this.log(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){this.fragCurrent&&(this.fragContextChanged(e)||this.state===Yg)||(this.state=Vg)}onFragmentOrKeyLoadError(e,t){var r;if(t.chunkMeta&&!t.frag){const e=this.getCurrentContext(t.chunkMeta);e&&(t.frag=e.frag)}const n=t.frag;if(!n||n.type!==e||!this.levels)return;var i;if(this.fragContextChanged(n))return void this.warn(`Frag load error must match current frag to retry ${n.url} > ${null==(i=this.fragCurrent)?void 0:i.url}`);const s=t.details===Ld.FRAG_GAP;s&&this.fragmentTracker.fragBuffered(n,!0);const a=t.errorAction;if(!a)return void(this.state=Jg);const{action:o,flags:l,retryCount:u=0,retryConfig:c}=a,d=!!c,h=d&&o===Xf,f=d&&!a.resolved&&l===Zf,p=null==(r=this.hls.latestLevelDetails)?void 0:r.live;if(!h&&f&&gh(n)&&!n.endList&&p&&!zf(t))this.resetFragmentErrors(e),this.treatAsGap(n),a.resolved=!0;else if((h||f)&&u<c.maxNumRetry){var g;const r=Wf(null==(g=t.response)?void 0:g.code),i=Gf(c,u);if(this.resetStartWhenNotLoaded(),this.retryDate=self.performance.now()+i,this.state=Yg,a.resolved=!0,r)return this.log("Waiting for connection (offline)"),this.retryDate=1/0,void(t.reason="offline");this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${u+1}/${c.maxNumRetry} in ${i}ms`)}else if(c){if(this.resetFragmentErrors(e),!(u<c.maxNumRetry))return void this.warn(`${t.details} reached or exceeded max retry (${u})`);s||o===qf||(a.resolved=!0)}else this.state=o===Yf?tm:Jg;this.tickImmediate()}checkRetryDate(){const e=self.performance.now(),t=this.retryDate,r=t===1/0;(!t||e>=t||r&&!Wf(0))&&(r&&this.log("Connection restored (online)"),this.resetStartWhenNotLoaded(),this.state=Vg)}reduceLengthAndFlushBuffer(e){if(this.state===Xg||this.state===Qg){const t=e.frag,r=e.parent,n=this.getFwdBufferInfo(this.mediaBuffer,r),i=n&&n.len>.5;i&&this.reduceMaxBufferLength(n.len,(null==t?void 0:t.duration)||10);const s=!i;return s&&this.warn(`Buffer full error while media.currentTime (${this.getLoadPosition()}) is not buffered, flush ${r} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(e){e===Od&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==Hg&&(this.state=Vg)}afterBufferFlushed(e,t,r){if(!e)return;const n=kp.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,n,r),this.state===Zg&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==Hg&&(this.state=Vg)}resetStartWhenNotLoaded(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const e=this.levelLastLoaded,t=e?e.details:null;null!=t&&t.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(t,t.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.log(`Loading context changed while buffering sn ${e.sn} of ${this.playlistLabel()} ${-1===e.level?"<removed>":e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,r,n){const i=r.details;if(!i)return void this.warn("level.details undefined");if(!Object.keys(e.elementaryStreams).reduce((t,s)=>{const a=e.elementaryStreams[s];if(a){const o=a.endPTS-a.startPTS;if(o<=0)return this.warn(`Could not parse fragment ${e.sn} ${s} duration reliably (${o})`),t||!1;const l=n?0:kg(i,e,a.startPTS,a.endPTS,a.startDTS,a.endDTS,this);return this.hls.trigger(Id.LEVEL_PTS_UPDATED,{details:i,level:r,drift:l,type:s,frag:e,start:a.startPTS,end:a.endPTS}),!0}return t},!1)){var s;const t=null===(null==(s=this.transmuxer)?void 0:s.error);if((0===r.fragmentError||t&&(r.fragmentError<2||e.endList))&&this.treatAsGap(e,r),t){const t=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(t.message),this.hls.trigger(Id.ERROR,{type:Rd.MEDIA_ERROR,details:Ld.FRAG_PARSING_ERROR,fatal:!1,error:t,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${r.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=Qg,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(Id.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===Md?"level":"track"}fragInfo(e,t=!0,r){var n,i;return`${this.playlistLabel()} ${e.level} (${r?"part":"frag"}:[${(null!=(n=t&&!r?e.startPTS:(r||e).start)?n:NaN).toFixed(3)}-${(null!=(i=t&&!r?e.endPTS:(r||e).end)?i:NaN).toFixed(3)}]${r&&"main"===e.type?"INDEPENDENT="+(r.independent?"YES":"NO"):""}`}treatAsGap(e,t){t&&t.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)}resetTransmuxer(){var e;null==(e=this.transmuxer)||e.reset()}recoverWorkerError(e){"demuxerWorker"===e.event&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function nm(e){return!!e.interstitialsController&&!1!==e.enableInterstitialPlayback}class im{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let r;return e.length?(r=1===e.length?e[0]:function(e,t){const r=new Uint8Array(t);let n=0;for(let t=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}(e,t),this.reset(),r):new Uint8Array(0)}reset(){this.chunks.length=0,this.dataLength=0}}var sm,am={exports:{}};var om=(sm||(sm=1,function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function s(e,t,n,s,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new i(n,s||e,a),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new n:delete e._events[t]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),o.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},o.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,a=new Array(s);i<s;i++)a[i]=n[i].fn;return a},o.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},o.prototype.emit=function(e,t,n,i,s,a){var o=r?r+e:e;if(!this._events[o])return!1;var l,u,c=this._events[o],d=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),d){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,s),!0;case 6:return c.fn.call(c.context,t,n,i,s,a),!0}for(u=1,l=new Array(d-1);u<d;u++)l[u-1]=arguments[u];c.fn.apply(c.context,l)}else{var h,f=c.length;for(u=0;u<f;u++)switch(c[u].once&&this.removeListener(e,c[u].fn,void 0,!0),d){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,n);break;case 4:c[u].fn.call(c[u].context,t,n,i);break;default:if(!l)for(h=1,l=new Array(d-1);h<d;h++)l[h-1]=arguments[h];c[u].fn.apply(c[u].context,l)}}return!0},o.prototype.on=function(e,t,r){return s(this,e,t,r,!1)},o.prototype.once=function(e,t,r){return s(this,e,t,r,!0)},o.prototype.removeListener=function(e,t,n,i){var s=r?r+e:e;if(!this._events[s])return this;if(!t)return a(this,s),this;var o=this._events[s];if(o.fn)o.fn!==t||i&&!o.once||n&&o.context!==n||a(this,s);else{for(var l=0,u=[],c=o.length;l<c;l++)(o[l].fn!==t||i&&!o[l].once||n&&o[l].context!==n)&&u.push(o[l]);u.length?this._events[s]=1===u.length?u[0]:u:a(this,s)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o}(am)),am.exports),lm=th(om);const um="1.6.15",cm={};function dm(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}function hm(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}function fm(e,t){let r=0;return r=(127&e[t])<<21,r|=(127&e[t+1])<<14,r|=(127&e[t+2])<<7,r|=127&e[t+3],r}function pm(e,t){const r=t;let n=0;for(;hm(e,t);){n+=10;n+=fm(e,t+6),dm(e,t+10)&&(n+=10),t+=n}if(n>0)return e.subarray(r,r+n)}function gm(e,t){return 255===e[t]&&240==(246&e[t+1])}function mm(e,t){return 1&e[t+1]?7:9}function vm(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function ym(e,t){return t+1<e.length&&gm(e,t)}function bm(e,t){if(ym(e,t)){const r=mm(e,t);if(t+r>=e.length)return!1;const n=vm(e,t);if(n<=r)return!1;const i=t+n;return i===e.length||ym(e,i)}return!1}function wm(e,t,r,n,i){if(!e.samplerate){const s=function(e,t,r,n){const i=t[r+2],s=i>>2&15;if(s>12){const t=new Error(`invalid ADTS sampling index:${s}`);return void e.emit(Id.ERROR,Id.ERROR,{type:Rd.MEDIA_ERROR,details:Ld.FRAG_PARSING_ERROR,fatal:!0,error:t,reason:t.message})}const a=1+(i>>6&3),o=t[r+3]>>6&3|(1&i)<<2,l="mp4a.40."+a,u=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350][s];let c=s;5!==a&&29!==a||(c-=3);const d=[a<<3|(14&c)>>1,(1&c)<<7|o<<3];return qd.log(`manifest codec:${n}, parsed codec:${l}, channels:${o}, rate:${u} (ADTS object type:${a} sampling index:${s})`),{config:d,samplerate:u,channelCount:o,codec:l,parsedCodec:l,manifestCodec:n}}(t,r,n,i);if(!s)return;Ud(e,s)}}function Em(e){return 9216e4/e}function Sm(e,t,r,n,i){const s=n+i*Em(e.samplerate),a=function(e,t){const r=mm(e,t);if(t+r<=e.length){const n=vm(e,t)-r;if(n>0)return{headerLength:r,frameLength:n}}}(t,r);let o;if(a){const{frameLength:n,headerLength:i}=a,l=i+n,u=Math.max(0,r+l-t.length);u?(o=new Uint8Array(l-i),o.set(t.subarray(r+i,t.length),0)):o=t.subarray(r+i,r+l);const c={unit:o,pts:s};return u||e.samples.push(c),{sample:c,length:l,missing:u}}const l=t.length-r;o=new Uint8Array(l),o.set(t.subarray(r,t.length),0);return{sample:{unit:o,pts:s},length:l,missing:-1}}function Tm(e,t){return hm(e,t)&&fm(e,t+6)+10<=e.length-t}function km(e,t=0,r=1/0){return function(e,t,r,n){const i=function(e){return e instanceof ArrayBuffer?e:e.buffer}(e);let s=1;"BYTES_PER_ELEMENT"in n&&(s=n.BYTES_PER_ELEMENT);const a=(d=e,d&&d.buffer instanceof ArrayBuffer&&void 0!==d.byteLength&&void 0!==d.byteOffset?e.byteOffset:0),o=(a+e.byteLength)/s,l=(a+t)/s,u=Math.floor(Math.max(0,Math.min(l,o))),c=Math.floor(Math.min(u+Math.max(r,0),o));var d;return new n(i,u,c-u)}(e,t,r,Uint8Array)}function xm(e){const t={key:e.type,description:"",data:"",mimeType:null,pictureType:null};if(e.size<2)return;if(3!==e.data[0])return void console.log("Ignore frame with unrecognized character encoding");const r=e.data.subarray(1).indexOf(0);if(-1===r)return;const n=Zd(km(e.data,1,r)),i=e.data[2+r],s=e.data.subarray(3+r).indexOf(0);if(-1===s)return;const a=Zd(km(e.data,3+r,s));let o;return o="--\x3e"===n?Zd(km(e.data,4+r+s)):function(e){return e instanceof ArrayBuffer?e:0==e.byteOffset&&e.byteLength==e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer}(e.data.subarray(4+r+s)),t.mimeType=n,t.pictureType=i,t.description=a,t.data=o,t}function Am(e){return"PRIV"===e.type?function(e){if(e.size<2)return;const t=Zd(e.data,!0),r=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:r.buffer}}(e):"W"===e.type[0]?function(e){if("WXXX"===e.type){if(e.size<2)return;let t=1;const r=Zd(e.data.subarray(t),!0);t+=r.length+1;const n=Zd(e.data.subarray(t));return{key:e.type,info:r,data:n}}const t=Zd(e.data);return{key:e.type,info:"",data:t}}(e):"APIC"===e.type?xm(e):function(e){if(e.size<2)return;if("TXXX"===e.type){let t=1;const r=Zd(e.data.subarray(t),!0);t+=r.length+1;const n=Zd(e.data.subarray(t));return{key:e.type,info:r,data:n}}const t=Zd(e.data.subarray(1));return{key:e.type,info:"",data:t}}(e)}function Rm(e){const t=String.fromCharCode(e[0],e[1],e[2],e[3]),r=fm(e,4);return{type:t,size:r,data:e.subarray(10,10+r)}}function Lm(e){let t=0;const r=[];for(;hm(e,t);){const n=fm(e,t+6);e[t+5]>>6&1&&(t+=10),t+=10;const i=t+n;for(;t+10<i;){const n=Rm(e.subarray(t)),i=Am(n);i&&r.push(i),t+=n.size+10}dm(e,t)&&(t+=10)}return r}function Im(e){return e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info}function Cm(e){if(8===e.data.byteLength){const t=new Uint8Array(e.data),r=1&t[3];let n=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return n/=45,r&&(n+=47721858.84),Math.round(n)}}function Pm(e){const t=Lm(e);for(let e=0;e<t.length;e++){const r=t[e];if(Im(r))return Cm(r)}}let Dm=function(e){return e.audioId3="org.id3",e.dateRange="com.apple.quicktime.HLS",e.emsg="https://aomedia.org/emsg/ID3",e.misbklv="urn:misb:KLV:bin:1910.1",e}({});function _m(e="",t=9e4){return{type:e,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}class Mm{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,r,n){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,r){}demux(e,t){this.cachedData&&(e=Fh(this.cachedData,e),this.cachedData=null);let r,n=pm(e,0),i=n?n.length:0;const s=this._audioTrack,a=this._id3Track,o=n?Pm(n):void 0,l=e.length;for((null===this.basePTS||0===this.frameIndex&&kd(o))&&(this.basePTS=Om(o,t,this.initPTS),this.lastPTS=this.basePTS),null===this.lastPTS&&(this.lastPTS=this.basePTS),n&&n.length>0&&a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:Dm.audioId3,duration:Number.POSITIVE_INFINITY});i<l;){if(this.canParse(e,i)){const t=this.appendFrame(s,e,i);t?(this.frameIndex++,this.lastPTS=t.sample.pts,i+=t.length,r=i):i=l}else Tm(e,i)?(n=pm(e,i),a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:Dm.audioId3,duration:Number.POSITIVE_INFINITY}),i+=n.length,r=i):i++;if(i===l&&r!==l){const t=e.slice(r);this.cachedData?this.cachedData=Fh(this.cachedData,t):this.cachedData=t}}return{audioTrack:s,videoTrack:_m(),id3Track:a,textTrack:_m()}}demuxSampleAes(e,t,r){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:_m(),id3Track:this._id3Track,textTrack:_m()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const Om=(e,t,r)=>{if(kd(e))return 90*e;return 9e4*t+(r?9e4*r.baseTime/r.timescale:0)};let Nm=null;const Fm=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],$m=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Bm=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Um=[0,1,1,4];function zm(e,t,r,n,i){if(r+24>t.length)return;const s=jm(t,r);if(s&&r+s.frameLength<=t.length){const a=n+i*(9e4*s.samplesPerFrame/s.sampleRate),o={unit:t.subarray(r,r+s.frameLength),pts:a,dts:a};return e.config=[],e.channelCount=s.channelCount,e.samplerate=s.sampleRate,e.samples.push(o),{sample:o,length:s.frameLength,missing:0}}}function jm(e,t){const r=e[t+1]>>3&3,n=e[t+1]>>1&3,i=e[t+2]>>4&15,s=e[t+2]>>2&3;if(1!==r&&0!==i&&15!==i&&3!==s){const a=e[t+2]>>1&1,o=e[t+3]>>6,l=1e3*Fm[14*(3===r?3-n:3===n?3:4)+i-1],u=$m[3*(3===r?0:2===r?1:2)+s],c=3===o?1:2,d=Bm[r][n],h=Um[n],f=8*d*h,p=Math.floor(d*l/u+a)*h;if(null===Nm){const e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Nm=e?parseInt(e[1]):0}return!!Nm&&Nm<=87&&2===n&&l>=224e3&&0===o&&(e[t+3]=128|e[t+3]),{sampleRate:u,channelCount:c,frameLength:p,samplesPerFrame:f}}}function Gm(e,t){return!(255!==e[t]||224&~e[t+1]||!(6&e[t+1]))}function Hm(e,t){return t+1<e.length&&Gm(e,t)}function Vm(e,t){if(t+1<e.length&&Gm(e,t)){const r=4,n=jm(e,t);let i=r;null!=n&&n.frameLength&&(i=n.frameLength);const s=t+i;return s===e.length||Hm(e,s)}return!1}const Wm=(e,t)=>{let r=0,n=5;t+=n;const i=new Uint32Array(1),s=new Uint32Array(1),a=new Uint8Array(1);for(;n>0;){a[0]=e[t];const o=Math.min(n,8),l=8-o;s[0]=4278190080>>>24+l<<l,i[0]=(a[0]&s[0])>>l,r=r?r<<o|i[0]:i[0],t+=1,n-=o}return r};class Km extends Mm{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,r,n){super.resetInitSegment(e,t,r,n),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:n,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,r){const n=Ym(e,t,r,this.basePTS,this.frameIndex);if(-1!==n){return{sample:e.samples[e.samples.length-1],length:n,missing:0}}}static probe(e){if(!e)return!1;const t=pm(e,0);if(!t)return!1;const r=t.length;return 11===e[r]&&119===e[r+1]&&void 0!==Pm(t)&&Wm(e,r)<16}}function Ym(e,t,r,n,i){if(r+8>t.length)return-1;if(11!==t[r]||119!==t[r+1])return-1;const s=t[r+4]>>6;if(s>=3)return-1;const a=[48e3,44100,32e3][s],o=63&t[r+4],l=2*[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][3*o+s];if(r+l>t.length)return-1;const u=t[r+6]>>5;let c=0;2===u?c+=2:(1&u&&1!==u&&(c+=2),4&u&&(c+=2));const d=(t[r+6]<<8|t[r+7])>>12-c&1,h=[2,1,2,3,3,4,4,5][u]+d,f=t[r+5]>>3,p=7&t[r+5],g=new Uint8Array([s<<6|f<<1|p>>2,(3&p)<<6|u<<3|d<<2|o>>4,o<<4&224]),m=n+i*(1536/a*9e4),v=t.subarray(r,r+l);return e.config=g,e.channelCount=h,e.samplerate=a,e.samples.push({unit:v,pts:m}),l}const qm=/\/emsg[-/]ID3/i;function Xm(e,t){return kd(e.presentationTime)?e.presentationTime/e.timeScale:t+e.presentationTimeDelta/e.timeScale}class Qm{constructor(e,t,r){this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new gp(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,cp)}decryptAacSample(e,t,r){const n=e[t].unit;if(n.length<=16)return;const i=n.subarray(16,n.length-n.length%16),s=i.buffer.slice(i.byteOffset,i.byteOffset+i.length);this.decryptBuffer(s).then(i=>{const s=new Uint8Array(i);n.set(s,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,r)}).catch(r)}decryptAacSamples(e,t,r){for(;;t++){if(t>=e.length)return void r();if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,r),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=16*Math.floor((e.length-48)/160)+16,r=new Int8Array(t);let n=0;for(let t=32;t<e.length-16;t+=160,n+=16)r.set(e.subarray(t,t+16),n);return r}getAvcDecryptedUnit(e,t){const r=new Uint8Array(t);let n=0;for(let t=32;t<e.length-16;t+=160,n+=16)e.set(r.subarray(n,n+16),t);return e}decryptAvcSample(e,t,r,n,i){const s=jh(i.data),a=this.getAvcEncryptedData(s);this.decryptBuffer(a.buffer).then(a=>{i.data=this.getAvcDecryptedUnit(s,a),this.decrypter.isSync()||this.decryptAvcSamples(e,t,r+1,n)}).catch(n)}decryptAvcSamples(e,t,r,n){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,r=0){if(t>=e.length)return void n();const i=e[t].units;for(;!(r>=i.length);r++){const s=i[r];if(!(s.data.length<=48||1!==s.type&&5!==s.type||(this.decryptAvcSample(e,t,r,n,s),this.decrypter.isSync())))return}}}}class Zm{constructor(){this.VideoSample=null}createVideoSample(e,t,r){return{key:e,frame:!1,pts:t,dts:r,units:[],length:0}}getLastNalUnit(e){var t;let r,n=this.VideoSample;if(n&&0!==n.units.length||(n=e[e.length-1]),null!=(t=n)&&t.units){const e=n.units;r=e[e.length-1]}return r}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){const r=t.samples,n=r.length;if(!n)return void t.dropped++;{const t=r[n-1];e.pts=t.pts,e.dts=t.dts}}t.samples.push(e)}}parseNALu(e,t,r){const n=t.byteLength;let i=e.naluState||0;const s=i,a=[];let o,l,u,c=0,d=-1,h=0;for(-1===i&&(d=0,h=this.getNALuType(t,0),i=0,c=1);c<n;)if(o=t[c++],i)if(1!==i)if(o)if(1===o){if(l=c-i-1,d>=0){const e={data:t.subarray(d,l),type:h};a.push(e)}else{const r=this.getLastNalUnit(e.samples);r&&(s&&c<=4-s&&r.state&&(r.data=r.data.subarray(0,r.data.byteLength-s)),l>0&&(r.data=Fh(r.data,t.subarray(0,l)),r.state=0))}c<n?(u=this.getNALuType(t,c),d=c,h=u,i=0):i=-1}else i=0;else i=3;else i=o?0:2;else i=o?0:1;if(d>=0&&i>=0){const e={data:t.subarray(d,n),type:h,state:i};a.push(e)}if(0===a.length){const r=this.getLastNalUnit(e.samples);r&&(r.data=Fh(r.data,t))}return e.naluState=i,a}}class Jm{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,r=e.byteLength-t,n=new Uint8Array(4),i=Math.min(4,t);if(0===i)throw new Error("no bytes available");n.set(e.subarray(r,r+i)),this.word=new DataView(n.buffer).getUint32(0),this.bitsAvailable=8*i,this.bytesAvailable-=i}skipBits(e){let t;e=Math.min(e,8*this.bytesAvailable+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(t=(e-=this.bitsAvailable)>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const r=this.word>>>32-t;if(e>32&&qd.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return t=e-t,t>0&&this.bitsAvailable?r<<t|this.readBits(t):r}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(this.word&2147483648>>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return 1===this.readBits(1)}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class ev extends Zm{parsePES(e,t,r,n){const i=this.parseNALu(e,r.data,n);let s,a=this.VideoSample,o=!1;r.data=null,a&&i.length&&!e.audFound&&(this.pushAccessUnit(a,e),a=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts)),i.forEach(n=>{var i,l;switch(n.type){case 1:{let t=!1;s=!0;const i=n.data;if(o&&i.length>4){const e=this.readSliceType(i);2!==e&&4!==e&&7!==e&&9!==e||(t=!0)}var u;if(t)null!=(u=a)&&u.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null);a||(a=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),a.frame=!0,a.key=t;break}case 5:s=!0,null!=(i=a)&&i.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null),a||(a=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),a.key=!0,a.frame=!0;break;case 6:s=!0,zh(n.data,1,r.pts,t.samples);break;case 7:{var c,d;s=!0,o=!0;const t=n.data,r=this.readSPS(t);if(!e.sps||e.width!==r.width||e.height!==r.height||(null==(c=e.pixelRatio)?void 0:c[0])!==r.pixelRatio[0]||(null==(d=e.pixelRatio)?void 0:d[1])!==r.pixelRatio[1]){e.width=r.width,e.height=r.height,e.pixelRatio=r.pixelRatio,e.sps=[t];const n=t.subarray(1,4);let i="avc1.";for(let e=0;e<3;e++){let t=n[e].toString(16);t.length<2&&(t="0"+t),i+=t}e.codec=i}break}case 8:s=!0,e.pps=[n.data];break;case 9:s=!0,e.audFound=!0,null!=(l=a)&&l.frame&&(this.pushAccessUnit(a,e),a=null),a||(a=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts));break;case 12:s=!0;break;default:s=!1}if(a&&s){a.units.push(n)}}),n&&a&&(this.pushAccessUnit(a,e),this.VideoSample=null)}getNALuType(e,t){return 31&e[t]}readSliceType(e){const t=new Jm(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let r,n=8,i=8;for(let s=0;s<e;s++)0!==i&&(r=t.readEG(),i=(n+r+256)%256),n=0===i?n:i}readSPS(e){const t=new Jm(e);let r,n,i,s=0,a=0,o=0,l=0;const u=t.readUByte.bind(t),c=t.readBits.bind(t),d=t.readUEG.bind(t),h=t.readBoolean.bind(t),f=t.skipBits.bind(t),p=t.skipEG.bind(t),g=t.skipUEG.bind(t),m=this.skipScalingList.bind(this);u();const v=u();if(c(5),f(3),u(),g(),100===v||110===v||122===v||244===v||44===v||83===v||86===v||118===v||128===v){const e=d();if(3===e&&f(1),g(),g(),f(1),h())for(n=3!==e?8:12,i=0;i<n;i++)h()&&m(i<6?16:64,t)}g();const y=d();if(0===y)d();else if(1===y)for(f(1),p(),p(),r=d(),i=0;i<r;i++)p();g(),f(1);const b=d(),w=d(),E=c(1);0===E&&f(1),f(1),h()&&(s=d(),a=d(),o=d(),l=d());let S=[1,1];if(h()&&h()){switch(u()){case 1:S=[1,1];break;case 2:S=[12,11];break;case 3:S=[10,11];break;case 4:S=[16,11];break;case 5:S=[40,33];break;case 6:S=[24,11];break;case 7:S=[20,11];break;case 8:S=[32,11];break;case 9:S=[80,33];break;case 10:S=[18,11];break;case 11:S=[15,11];break;case 12:S=[64,33];break;case 13:S=[160,99];break;case 14:S=[4,3];break;case 15:S=[3,2];break;case 16:S=[2,1];break;case 255:S=[u()<<8|u(),u()<<8|u()]}}return{width:Math.ceil(16*(b+1)-2*s-2*a),height:(2-E)*(w+1)*16-(E?2:4)*(o+l),pixelRatio:S}}}class tv extends Zm{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,r,n){const i=this.parseNALu(e,r.data,n);let s,a=this.VideoSample,o=!1;r.data=null,a&&i.length&&!e.audFound&&(this.pushAccessUnit(a,e),a=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts)),i.forEach(n=>{var i,l;switch(n.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:a||(a=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts)),a.frame=!0,s=!0;break;case 16:case 17:case 18:case 21:var u;if(s=!0,o)null!=(u=a)&&u.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null);a||(a=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),a.key=!0,a.frame=!0;break;case 19:case 20:s=!0,null!=(i=a)&&i.frame&&!a.key&&(this.pushAccessUnit(a,e),a=this.VideoSample=null),a||(a=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),a.key=!0,a.frame=!0;break;case 39:s=!0,zh(n.data,2,r.pts,t.samples);break;case 32:s=!0,e.vps||("object"!=typeof e.params&&(e.params={}),e.params=Ud(e.params,this.readVPS(n.data)),this.initVPS=n.data),e.vps=[n.data];break;case 33:if(s=!0,o=!0,void 0===e.vps||e.vps[0]===this.initVPS||void 0===e.sps||this.matchSPS(e.sps[0],n.data)||(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const t=this.readSPS(n.data);e.width=t.width,e.height=t.height,e.pixelRatio=t.pixelRatio,e.codec=t.codecString,e.sps=[],"object"!=typeof e.params&&(e.params={});for(const r in t.params)e.params[r]=t.params[r]}this.pushParameterSet(e.sps,n.data,e.vps),a||(a=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),a.key=!0;break;case 34:if(s=!0,"object"==typeof e.params){if(!e.pps){e.pps=[];const t=this.readPPS(n.data);for(const r in t)e.params[r]=t[r]}this.pushParameterSet(e.pps,n.data,e.vps)}break;case 35:s=!0,e.audFound=!0,null!=(l=a)&&l.frame&&(this.pushAccessUnit(a,e),a=null),a||(a=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts));break;default:s=!1}if(a&&s){a.units.push(n)}}),n&&a&&(this.pushAccessUnit(a,e),this.VideoSample=null)}pushParameterSet(e,t,r){(r&&r[0]===this.initVPS||!r&&!e.length)&&e.push(t)}getNALuType(e,t){return(126&e[t])>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let r=0;for(let n=0;n<e.byteLength;n++)n>=2&&3===e[n]&&0===e[n-1]&&0===e[n-2]||(t[r]=e[n],r++);return new Uint8Array(t.buffer,0,r)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new Jm(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);return{numTemporalLayers:t.readBits(3)+1,temporalIdNested:t.readBoolean()}}readSPS(e){const t=new Jm(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const r=t.readBits(3);t.readBoolean();const n=t.readBits(2),i=t.readBoolean(),s=t.readBits(5),a=t.readUByte(),o=t.readUByte(),l=t.readUByte(),u=t.readUByte(),c=t.readUByte(),d=t.readUByte(),h=t.readUByte(),f=t.readUByte(),p=t.readUByte(),g=t.readUByte(),m=t.readUByte(),v=[],y=[];for(let e=0;e<r;e++)v.push(t.readBoolean()),y.push(t.readBoolean());if(r>0)for(let e=r;e<8;e++)t.readBits(2);for(let e=0;e<r;e++)v[e]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),y[e]&&t.readUByte();t.readUEG();const b=t.readUEG();3==b&&t.skipBits(1);const w=t.readUEG(),E=t.readUEG(),S=t.readBoolean();let T=0,k=0,x=0,A=0;S&&(T+=t.readUEG(),k+=t.readUEG(),x+=t.readUEG(),A+=t.readUEG());const R=t.readUEG(),L=t.readUEG(),I=t.readUEG();for(let e=t.readBoolean()?0:r;e<=r;e++)t.skipUEG(),t.skipUEG(),t.skipUEG();t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG();if(t.readBoolean()){if(t.readBoolean())for(let e=0;e<4;e++)for(let r=0;r<(3===e?2:6);r++){if(t.readBoolean()){const r=Math.min(64,1<<4+(e<<1));e>1&&t.readEG();for(let e=0;e<r;e++)t.readEG()}else t.readUEG()}}t.readBoolean(),t.readBoolean();t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const C=t.readUEG();let P=0;for(let e=0;e<C;e++){let r=!1;if(0!==e&&(r=t.readBoolean()),r){e===C&&t.readUEG(),t.readBoolean(),t.readUEG();let r=0;for(let e=0;e<=P;e++){const e=t.readBoolean();let n=!1;e||(n=t.readBoolean()),(e||n)&&r++}P=r}else{const e=t.readUEG(),r=t.readUEG();P=e+r;for(let r=0;r<e;r++)t.readUEG(),t.readBoolean();for(let e=0;e<r;e++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const e=t.readUEG();for(let r=0;r<e;r++){for(let e=0;e<I+4;e++)t.readBits(1);t.readBits(1)}}let D=0,_=1,M=1,O=!0,N=1,F=0;t.readBoolean(),t.readBoolean();let $=!1;if(t.readBoolean()){if(t.readBoolean()){const e=t.readUByte();e>0&&e<16?(_=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][e-1],M=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][e-1]):255===e&&(_=t.readBits(16),M=t.readBits(16))}t.readBoolean()&&t.readBoolean();if(t.readBoolean()){t.readBits(3),t.readBoolean();t.readBoolean()&&(t.readUByte(),t.readUByte(),t.readUByte())}t.readBoolean()&&(t.readUEG(),t.readUEG()),t.readBoolean(),t.readBoolean(),t.readBoolean(),$=t.readBoolean(),$&&(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG());if(t.readBoolean()){N=t.readBits(32),F=t.readBits(32);t.readBoolean()&&t.readUEG();if(t.readBoolean()){const e=t.readBoolean(),n=t.readBoolean();let i=!1;(e||n)&&(i=t.readBoolean(),i&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),i&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let s=0;s<=r;s++){O=t.readBoolean();let r=!1;O||t.readBoolean()?t.readEG():r=t.readBoolean();const s=r?1:t.readUEG()+1;if(e)for(let e=0;e<s;e++)t.readUEG(),t.readUEG(),i&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(n)for(let e=0;e<s;e++)t.readUEG(),t.readUEG(),i&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),D=t.readUEG())}let B=w,U=E;if(S){let e=1,t=1;1===b?e=t=2:2==b&&(e=2),B=w-e*k-e*T,U=E-t*A-t*x}const z=n?["A","B","C"][n]:"",j=a<<24|o<<16|l<<8|u;let G=0;for(let e=0;e<32;e++)G=(G|(j>>e&1)<<31-e)>>>0;let H=G.toString(16);1===s&&"2"===H&&(H="6");return{codecString:`hvc1.${z}${s}.${H}.${i?"H":"L"}${m}.B0`,params:{general_tier_flag:i,general_profile_idc:s,general_profile_space:n,general_profile_compatibility_flags:[a,o,l,u],general_constraint_indicator_flags:[c,d,h,f,p,g],general_level_idc:m,bit_depth:R+8,bit_depth_luma_minus8:R,bit_depth_chroma_minus8:L,min_spatial_segmentation_idc:D,chroma_format_idc:b,frame_rate:{fixed:O,fps:F/N}},width:B,height:U,pixelRatio:[_,M]}}readPPS(e){const t=new Jm(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.skipUEG(),t.skipUEG(),t.skipBits(2),t.skipBits(3),t.skipBits(2),t.skipUEG(),t.skipUEG(),t.skipEG(),t.skipBits(2);t.readBoolean()&&t.skipUEG(),t.skipEG(),t.skipEG(),t.skipBits(4);const r=t.readBoolean(),n=t.readBoolean();let i=1;return n&&r?i=0:n?i=3:r&&(i=2),{parallelismType:i}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const rv=188;class nv{constructor(e,t,r,n){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=r,this.logger=n,this.videoParser=null}static probe(e,t){const r=nv.syncOffset(e);return r>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${r}`),-1!==r}static syncOffset(e){const t=e.length;let r=Math.min(940,t-rv)+1,n=0;for(;n<r;){let i=!1,s=-1,a=0;for(let o=n;o<t;o+=rv){if(71!==e[o]||t-o!==rv&&71!==e[o+rv]){if(a)return-1;break}if(a++,-1===s&&(s=o,0!==s&&(r=Math.min(s+18612,e.length-rv)+1)),i||(i=0===iv(e,o)),i&&a>1&&(0===s&&a>2||o+rv>r))return s}n++}return-1}static createTrack(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:Eh[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}}resetInitSegment(e,t,r,n){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=nv.createTrack("video"),this._videoTrack.duration=n,this._audioTrack=nv.createTrack("audio",n),this._id3Track=nv.createTrack("id3"),this._txtTrack=nv.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=r}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:r}=this;e&&(e.pesData=null),t&&(t.pesData=null),r&&(r.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,r=!1,n=!1){let i;r||(this.sampleAes=null);const s=this._videoTrack,a=this._audioTrack,o=this._id3Track,l=this._txtTrack;let u=s.pid,c=s.pesData,d=a.pid,h=o.pid,f=a.pesData,p=o.pesData,g=null,m=this.pmtParsed,v=this._pmtId,y=e.length;if(this.remainderData&&(y=(e=Fh(this.remainderData,e)).length,this.remainderData=null),y<rv&&!n)return this.remainderData=e,{audioTrack:a,videoTrack:s,id3Track:o,textTrack:l};const b=Math.max(0,nv.syncOffset(e));y-=(y-b)%rv,y<e.byteLength&&!n&&(this.remainderData=new Uint8Array(e.buffer,y,e.buffer.byteLength-y));let w=0;for(let t=b;t<y;t+=rv)if(71===e[t]){const n=!!(64&e[t+1]),y=iv(e,t);let w;if((48&e[t+3])>>4>1){if(w=t+5+e[t+4],w===t+rv)continue}else w=t+4;switch(y){case u:n&&(c&&(i=uv(c,this.logger))&&(this.readyVideoParser(s.segmentCodec),null!==this.videoParser&&this.videoParser.parsePES(s,l,i,!1)),c={data:[],size:0}),c&&(c.data.push(e.subarray(w,t+rv)),c.size+=t+rv-w);break;case d:if(n){if(f&&(i=uv(f,this.logger)))switch(a.segmentCodec){case"aac":this.parseAACPES(a,i);break;case"mp3":this.parseMPEGPES(a,i);break;case"ac3":this.parseAC3PES(a,i)}f={data:[],size:0}}f&&(f.data.push(e.subarray(w,t+rv)),f.size+=t+rv-w);break;case h:n&&(p&&(i=uv(p,this.logger))&&this.parseID3PES(o,i),p={data:[],size:0}),p&&(p.data.push(e.subarray(w,t+rv)),p.size+=t+rv-w);break;case 0:n&&(w+=e[w]+1),v=this._pmtId=sv(e,w);break;case v:{n&&(w+=e[w]+1);const i=av(e,w,this.typeSupported,r,this.observer,this.logger);u=i.videoPid,u>0&&(s.pid=u,s.segmentCodec=i.segmentVideoCodec),d=i.audioPid,d>0&&(a.pid=d,a.segmentCodec=i.segmentAudioCodec),h=i.id3Pid,h>0&&(o.pid=h),null===g||m||(this.logger.warn(`MPEG-TS PMT found at ${t} after unknown PID '${g}'. Backtracking to sync byte @${b} to parse all TS packets.`),g=null,t=b-188),m=this.pmtParsed=!0;break}case 17:case 8191:break;default:g=y}}else w++;w>0&&ov(this.observer,new Error(`Found ${w} TS packet/s that do not start with 0x47`),void 0,this.logger),s.pesData=c,a.pesData=f,o.pesData=p;const E={audioTrack:a,videoTrack:s,id3Track:o,textTrack:l};return n&&this.extractRemainingSamples(E),E}flush(){const{remainderData:e}=this;let t;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:r,id3Track:n,textTrack:i}=e,s=r.pesData,a=t.pesData,o=n.pesData;let l;if(s&&(l=uv(s,this.logger))?(this.readyVideoParser(r.segmentCodec),null!==this.videoParser&&(this.videoParser.parsePES(r,i,l,!0),r.pesData=null)):r.pesData=s,a&&(l=uv(a,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,l);break;case"mp3":this.parseMPEGPES(t,l);break;case"ac3":this.parseAC3PES(t,l)}t.pesData=null}else null!=a&&a.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=a;o&&(l=uv(o,this.logger))?(this.parseID3PES(n,l),n.pesData=null):n.pesData=o}demuxSampleAes(e,t,r){const n=this.demux(e,r,!0,!this.config.progressive),i=this.sampleAes=new Qm(this.observer,this.config,t);return this.decrypt(n,i)}readyVideoParser(e){null===this.videoParser&&("avc"===e?this.videoParser=new ev:"hevc"===e&&(this.videoParser=new tv))}decrypt(e,t){return new Promise(r=>{const{audioTrack:n,videoTrack:i}=e;n.samples&&"aac"===n.segmentCodec?t.decryptAacSamples(n.samples,0,()=>{i.samples?t.decryptAvcSamples(i.samples,0,0,()=>{r(e)}):r(e)}):i.samples&&t.decryptAvcSamples(i.samples,0,0,()=>{r(e)})})}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(e,t){let r=0;const n=this.aacOverFlow;let i,s,a,o=t.data;if(n){this.aacOverFlow=null;const t=n.missing,i=n.sample.unit.byteLength;if(-1===t)o=Fh(n.sample.unit,o);else{const s=i-t;n.sample.unit.set(o.subarray(0,t),s),e.samples.push(n.sample),r=n.missing}}for(i=r,s=o.length;i<s-1&&!ym(o,i);i++);if(i!==r){let e;const t=i<s-1;if(e=t?`AAC PES did not start with ADTS header,offset:${i}`:"No ADTS header found in AAC PES",ov(this.observer,new Error(e),t,this.logger),!t)return}if(wm(e,this.observer,o,i,this.audioCodec),void 0!==t.pts)a=t.pts;else{if(!n)return void this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");{const t=Em(e.samplerate);a=n.sample.pts+t}}let l,u=0;for(;i<s;){if(l=Sm(e,o,i,a,u),i+=l.length,l.missing){this.aacOverFlow=l;break}for(u++;i<s-1&&!ym(o,i);i++);}}parseMPEGPES(e,t){const r=t.data,n=r.length;let i=0,s=0;const a=t.pts;if(void 0!==a)for(;s<n;)if(Hm(r,s)){const t=zm(e,r,s,a,i);if(!t)break;s+=t.length,i++}else s++;else this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS")}parseAC3PES(e,t){{const r=t.data,n=t.pts;if(void 0===n)return void this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");const i=r.length;let s,a=0,o=0;for(;o<i&&(s=Ym(e,r,o,n,a++))>0;)o+=s}}parseID3PES(e,t){if(void 0===t.pts)return void this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");const r=Ud({},t,{type:this._videoTrack?Dm.emsg:Dm.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(r)}}function iv(e,t){return((31&e[t+1])<<8)+e[t+2]}function sv(e,t){return(31&e[t+10])<<8|e[t+11]}function av(e,t,r,n,i,s){const a={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},o=t+3+((15&e[t+1])<<8|e[t+2])-4;for(t+=12+((15&e[t+10])<<8|e[t+11]);t<o;){const o=iv(e,t),l=(15&e[t+3])<<8|e[t+4];switch(e[t]){case 207:if(!n){lv("ADTS AAC",s);break}case 15:-1===a.audioPid&&(a.audioPid=o);break;case 21:-1===a.id3Pid&&(a.id3Pid=o);break;case 219:if(!n){lv("H.264",s);break}case 27:-1===a.videoPid&&(a.videoPid=o);break;case 3:case 4:r.mpeg||r.mp3?-1===a.audioPid&&(a.audioPid=o,a.segmentAudioCodec="mp3"):s.log("MPEG audio found, not supported in this browser");break;case 193:if(!n){lv("AC-3",s);break}case 129:r.ac3?-1===a.audioPid&&(a.audioPid=o,a.segmentAudioCodec="ac3"):s.log("AC-3 audio found, not supported in this browser");break;case 6:if(-1===a.audioPid&&l>0){let n=t+5,i=l;for(;i>2;){if(106===e[n])!0!==r.ac3?s.log("AC-3 audio found, not supported in this browser for now"):(a.audioPid=o,a.segmentAudioCodec="ac3");const t=e[n+1]+2;n+=t,i-=t}}break;case 194:case 135:return ov(i,new Error("Unsupported EC-3 in M2TS found"),void 0,s),a;case 36:-1===a.videoPid&&(a.videoPid=o,a.segmentVideoCodec="hevc",s.log("HEVC in M2TS found"))}t+=l+5}return a}function ov(e,t,r,n){n.warn(`parsing error: ${t.message}`),e.emit(Id.ERROR,Id.ERROR,{type:Rd.MEDIA_ERROR,details:Ld.FRAG_PARSING_ERROR,fatal:!1,levelRetry:r,error:t,reason:t.message})}function lv(e,t){t.log(`${e} with AES-128-CBC encryption found in unencrypted stream`)}function uv(e,t){let r,n,i,s,a,o=0;const l=e.data;if(!e||0===e.size)return null;for(;l[0].length<19&&l.length>1;)l[0]=Fh(l[0],l[1]),l.splice(1,1);r=l[0];if(1===(r[0]<<16)+(r[1]<<8)+r[2]){if(n=(r[4]<<8)+r[5],n&&n>e.size-6)return null;const u=r[7];192&u&&(s=536870912*(14&r[9])+4194304*(255&r[10])+16384*(254&r[11])+128*(255&r[12])+(254&r[13])/2,64&u?(a=536870912*(14&r[14])+4194304*(255&r[15])+16384*(254&r[16])+128*(255&r[17])+(254&r[18])/2,s-a>54e5&&(t.warn(`${Math.round((s-a)/9e4)}s delta between PTS and DTS, align them`),s=a)):a=s),i=r[8];let c=i+9;if(e.size<=c)return null;e.size-=c;const d=new Uint8Array(e.size);for(let e=0,t=l.length;e<t;e++){r=l[e];let t=r.byteLength;if(c){if(c>t){c-=t;continue}r=r.subarray(c),t-=c,c=0}d.set(r,o),o+=t}return n&&(n-=i+3),{data:d,pts:s,dts:a,len:n}}return null}class cv{static getSilentFrame(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}const dv=Math.pow(2,32)-1;class hv{static init(){let e;for(e in hv.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},hv.types)hv.types.hasOwnProperty(e)&&(hv.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),r=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);hv.HDLR_TYPES={video:t,audio:r};const n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i=new Uint8Array([0,0,0,0,0,0,0,0]);hv.STTS=hv.STSC=hv.STCO=i,hv.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),hv.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),hv.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),hv.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const s=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);hv.FTYP=hv.box(hv.types.ftyp,s,o,s,a),hv.DINF=hv.box(hv.types.dinf,hv.box(hv.types.dref,n))}static box(e,...t){let r=8,n=t.length;const i=n;for(;n--;)r+=t[n].byteLength;const s=new Uint8Array(r);for(s[0]=r>>24&255,s[1]=r>>16&255,s[2]=r>>8&255,s[3]=255&r,s.set(e,4),n=0,r=8;n<i;n++)s.set(t[n],r),r+=t[n].byteLength;return s}static hdlr(e){return hv.box(hv.types.hdlr,hv.HDLR_TYPES[e])}static mdat(e){return hv.box(hv.types.mdat,e)}static mdhd(e,t){t*=e;const r=Math.floor(t/(dv+1)),n=Math.floor(t%(dv+1));return hv.box(hv.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,n>>24,n>>16&255,n>>8&255,255&n,85,196,0,0]))}static mdia(e){return hv.box(hv.types.mdia,hv.mdhd(e.timescale||0,e.duration||0),hv.hdlr(e.type),hv.minf(e))}static mfhd(e){return hv.box(hv.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))}static minf(e){return"audio"===e.type?hv.box(hv.types.minf,hv.box(hv.types.smhd,hv.SMHD),hv.DINF,hv.stbl(e)):hv.box(hv.types.minf,hv.box(hv.types.vmhd,hv.VMHD),hv.DINF,hv.stbl(e))}static moof(e,t,r){return hv.box(hv.types.moof,hv.mfhd(e),hv.traf(r,t))}static moov(e){let t=e.length;const r=[];for(;t--;)r[t]=hv.trak(e[t]);return hv.box.apply(null,[hv.types.moov,hv.mvhd(e[0].timescale||0,e[0].duration||0)].concat(r).concat(hv.mvex(e)))}static mvex(e){let t=e.length;const r=[];for(;t--;)r[t]=hv.trex(e[t]);return hv.box.apply(null,[hv.types.mvex,...r])}static mvhd(e,t){t*=e;const r=Math.floor(t/(dv+1)),n=Math.floor(t%(dv+1)),i=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24,r>>16&255,r>>8&255,255&r,n>>24,n>>16&255,n>>8&255,255&n,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return hv.box(hv.types.mvhd,i)}static sdtp(e){const t=e.samples||[],r=new Uint8Array(4+t.length);let n,i;for(n=0;n<t.length;n++)i=t[n].flags,r[n+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return hv.box(hv.types.sdtp,r)}static stbl(e){return hv.box(hv.types.stbl,hv.stsd(e),hv.box(hv.types.stts,hv.STTS),hv.box(hv.types.stsc,hv.STSC),hv.box(hv.types.stsz,hv.STSZ),hv.box(hv.types.stco,hv.STCO))}static avc1(e){let t,r,n,i=[],s=[];for(t=0;t<e.sps.length;t++)r=e.sps[t],n=r.byteLength,i.push(n>>>8&255),i.push(255&n),i=i.concat(Array.prototype.slice.call(r));for(t=0;t<e.pps.length;t++)r=e.pps[t],n=r.byteLength,s.push(n>>>8&255),s.push(255&n),s=s.concat(Array.prototype.slice.call(r));const a=hv.box(hv.types.avcC,new Uint8Array([1,i[3],i[4],i[5],255,224|e.sps.length].concat(i).concat([e.pps.length]).concat(s))),o=e.width,l=e.height,u=e.pixelRatio[0],c=e.pixelRatio[1];return hv.box(hv.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,o>>8&255,255&o,l>>8&255,255&l,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a,hv.box(hv.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),hv.box(hv.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,255&u,c>>24,c>>16&255,c>>8&255,255&c])))}static esds(e){const t=e.config;return new Uint8Array([0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,...t,6,1,2])}static audioStsd(e){const t=e.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount||0,0,16,0,0,0,0,t>>8&255,255&t,0,0])}static mp4a(e){return hv.box(hv.types.mp4a,hv.audioStsd(e),hv.box(hv.types.esds,hv.esds(e)))}static mp3(e){return hv.box(hv.types[".mp3"],hv.audioStsd(e))}static ac3(e){return hv.box(hv.types["ac-3"],hv.audioStsd(e),hv.box(hv.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if("audio"===e.type){if("aac"===t)return hv.box(hv.types.stsd,hv.STSD,hv.mp4a(e));if("ac3"===t&&e.config)return hv.box(hv.types.stsd,hv.STSD,hv.ac3(e));if("mp3"===t&&"mp3"===e.codec)return hv.box(hv.types.stsd,hv.STSD,hv.mp3(e))}else{if(!e.pps||!e.sps)throw new Error("video track missing pps or sps");if("avc"===t)return hv.box(hv.types.stsd,hv.STSD,hv.avc1(e));if("hevc"===t&&e.vps)return hv.box(hv.types.stsd,hv.STSD,hv.hvc1(e))}throw new Error(`unsupported ${e.type} segment codec (${t}/${e.codec})`)}static tkhd(e){const t=e.id,r=(e.duration||0)*(e.timescale||0),n=e.width||0,i=e.height||0,s=Math.floor(r/(dv+1)),a=Math.floor(r%(dv+1));return hv.box(hv.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,a>>24,a>>16&255,a>>8&255,255&a,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,n>>8&255,255&n,0,0,i>>8&255,255&i,0,0]))}static traf(e,t){const r=hv.sdtp(e),n=e.id,i=Math.floor(t/(dv+1)),s=Math.floor(t%(dv+1));return hv.box(hv.types.traf,hv.box(hv.types.tfhd,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n])),hv.box(hv.types.tfdt,new Uint8Array([1,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,s>>24,s>>16&255,s>>8&255,255&s])),hv.trun(e,r.length+16+20+8+16+8+8),r)}static trak(e){return e.duration=e.duration||4294967295,hv.box(hv.types.trak,hv.tkhd(e),hv.mdia(e))}static trex(e){const t=e.id;return hv.box(hv.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const r=e.samples||[],n=r.length,i=12+16*n,s=new Uint8Array(i);let a,o,l,u,c,d;for(t+=8+i,s.set(["video"===e.type?1:0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0),a=0;a<n;a++)o=r[a],l=o.duration,u=o.size,c=o.flags,d=o.cts,s.set([l>>>24&255,l>>>16&255,l>>>8&255,255&l,u>>>24&255,u>>>16&255,u>>>8&255,255&u,c.isLeading<<2|c.dependsOn,c.isDependedOn<<6|c.hasRedundancy<<4|c.paddingValue<<1|c.isNonSync,61440&c.degradPrio,15&c.degradPrio,d>>>24&255,d>>>16&255,d>>>8&255,255&d],12+16*a);return hv.box(hv.types.trun,s)}static initSegment(e){hv.types||hv.init();const t=hv.moov(e);return Fh(hv.FTYP,t)}static hvc1(e){const t=e.params,r=[e.vps,e.sps,e.pps],n=new Uint8Array([1,t.general_profile_space<<6|(t.general_tier_flag?32:0)|t.general_profile_idc,t.general_profile_compatibility_flags[0],t.general_profile_compatibility_flags[1],t.general_profile_compatibility_flags[2],t.general_profile_compatibility_flags[3],t.general_constraint_indicator_flags[0],t.general_constraint_indicator_flags[1],t.general_constraint_indicator_flags[2],t.general_constraint_indicator_flags[3],t.general_constraint_indicator_flags[4],t.general_constraint_indicator_flags[5],t.general_level_idc,240|t.min_spatial_segmentation_idc>>8,255&t.min_spatial_segmentation_idc,252|t.parallelismType,252|t.chroma_format_idc,248|t.bit_depth_luma_minus8,248|t.bit_depth_chroma_minus8,0,parseInt(t.frame_rate.fps),3|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),r.length]);let i=n.length;for(let e=0;e<r.length;e+=1){i+=3;for(let t=0;t<r[e].length;t+=1)i+=2+r[e][t].length}const s=new Uint8Array(i);s.set(n,0),i=n.length;const a=r.length-1;for(let e=0;e<r.length;e+=1){s.set(new Uint8Array([32+e|(e===a?128:0),0,r[e].length]),i),i+=3;for(let t=0;t<r[e].length;t+=1)s.set(new Uint8Array([r[e][t].length>>8,255&r[e][t].length]),i),i+=2,s.set(r[e][t],i),i+=r[e][t].length}const o=hv.box(hv.types.hvcC,s),l=e.width,u=e.height,c=e.pixelRatio[0],d=e.pixelRatio[1];return hv.box(hv.types.hvc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,255&l,u>>8&255,255&u,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,hv.box(hv.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),hv.box(hv.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,d>>24,d>>16&255,d>>8&255,255&d])))}}hv.types=void 0,hv.HDLR_TYPES=void 0,hv.STTS=void 0,hv.STSC=void 0,hv.STCO=void 0,hv.STSZ=void 0,hv.VMHD=void 0,hv.SMHD=void 0,hv.STSD=void 0,hv.FTYP=void 0,hv.DINF=void 0;function fv(e,t,r=1,n=!1){const i=e*t*r;return n?Math.round(i):i}function pv(e,t=!1){return fv(e,1e3,1/9e4,t)}function gv(e){const{baseTime:t,timescale:r,trackId:n}=e;return`${t/r} (${t}/${r}) trackId: ${n}`}let mv,vv=null,yv=null;function bv(e,t,r,n){return{duration:t,size:r,cts:n,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:e?2:1,isNonSync:e?0:1}}}class wv extends Gd{constructor(e,t,r,n){if(super("mp4-remuxer",n),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextVideoTs=null,this.nextAudioTs=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=r,this.ISGenerated=!1,null===vv){const e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);vv=e?parseInt(e[1]):0}if(null===yv){const e=navigator.userAgent.match(/Safari\/(\d+)/i);yv=e?parseInt(e[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){const t=this._initPTS;t&&e&&e.trackId===t.trackId&&e.baseTime===t.baseTime&&e.timescale===t.timescale||this.log(`Reset initPTS: ${t?gv(t):t} > ${e?gv(e):e}`),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.log("reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.log("ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const r=e[0].pts,n=e.reduce((e,n)=>{let i=n.pts,s=i-e;return s<-4294967296&&(t=!0,i=Ev(i,r),s=i-e),s>0?e:i},r);return t&&this.debug("PTS rollover detected"),n}remux(e,t,r,n,i,s,a,o){let l,u,c,d,h,f,p=i,g=i;const m=e.pid>-1,v=t.pid>-1,y=t.samples.length,b=e.samples.length>0,w=a&&y>0||y>1;if((!m||b)&&(!v||w)||this.ISGenerated||a){if(this.ISGenerated){var E,S,T,k;const e=this.videoTrackConfig;(e&&(t.width!==e.width||t.height!==e.height||(null==(E=t.pixelRatio)?void 0:E[0])!==(null==(S=e.pixelRatio)?void 0:S[0])||(null==(T=t.pixelRatio)?void 0:T[1])!==(null==(k=e.pixelRatio)?void 0:k[1]))||!e&&w||null===this.nextAudioTs&&b)&&this.resetInitSegment()}this.ISGenerated||(c=this.generateIS(e,t,i,s));const r=this.isVideoContiguous;let n,a=-1;if(w&&(a=function(e){for(let t=0;t<e.length;t++)if(e[t].key)return t;return-1}(t.samples),!r&&this.config.forceKeyFrameOnDiscontinuity))if(f=!0,a>0){this.warn(`Dropped ${a} out of ${y} video samples due to a missing keyframe`);const e=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(a),t.dropped+=a,g+=(t.samples[0].pts-e)/t.inputTimeScale,n=g}else-1===a&&(this.warn(`No keyframe found out of ${y} video samples`),f=!1);if(this.ISGenerated){if(b&&w){const r=this.getVideoStartPts(t.samples),n=(Ev(e.samples[0].pts,r)-r)/t.inputTimeScale;p+=Math.max(0,n),g+=Math.max(0,-n)}if(b){if(e.samplerate||(this.warn("regenerate InitSegment as audio detected"),c=this.generateIS(e,t,i,s)),u=this.remuxAudio(e,p,this.isAudioContiguous,s,v||w||o===Od?g:void 0),w){const n=u?u.endPTS-u.startPTS:0;t.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),c=this.generateIS(e,t,i,s)),l=this.remuxVideo(t,g,r,n)}}else w&&(l=this.remuxVideo(t,g,r,0));l&&(l.firstKeyFrame=a,l.independent=-1!==a,l.firstKeyFramePTS=n)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(r.samples.length&&(h=Sv(r,i,this._initPTS,this._initDTS)),n.samples.length&&(d=Tv(n,i,this._initPTS))),{audio:u,video:l,initSegment:c,independent:f,text:d,id3:h}}computeInitPts(e,t,r,n){const i=Math.round(r*t);let s=Ev(e,i);if(s<i+t)for(this.log(`Adjusting PTS for rollover in timeline near ${(i-s)/t} ${n}`);s<i+t;)s+=8589934592;return s-i}generateIS(e,t,r,n){const i=e.samples,s=t.samples,a=this.typeSupported,o={},l=this._initPTS;let u,c,d,h=!l||n,f="audio/mp4",p=-1;if(h&&(u=c=1/0),e.config&&i.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":a.mpeg?(f="audio/mpeg",e.codec=""):a.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3"}o.audio={id:"audio",container:f,codec:e.codec,initSegment:"mp3"===e.segmentCodec&&a.mpeg?new Uint8Array(0):hv.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(p=e.id,d=e.inputTimeScale,l&&d===l.timescale?h=!1:u=c=this.computeInitPts(i[0].pts,d,r,"audio"))}if(t.sps&&t.pps&&s.length){if(t.timescale=t.inputTimeScale,o.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:hv.initSegment([t]),metadata:{width:t.width,height:t.height}},h)if(p=t.id,d=t.inputTimeScale,l&&d===l.timescale)h=!1;else{const e=this.getVideoStartPts(s),t=Ev(s[0].dts,e),n=this.computeInitPts(t,d,r,"video"),i=this.computeInitPts(e,d,r,"video");c=Math.min(c,n),u=Math.min(u,i)}this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(o).length)return this.ISGenerated=!0,h?(l&&this.warn(`Timestamps at playlist time: ${n?"":"~"}${r} ${u/d} != initPTS: ${l.baseTime/l.timescale} (${l.baseTime}/${l.timescale}) trackId: ${l.trackId}`),this.log(`Found initPTS at playlist time: ${r} offset: ${u/d} (${u}/${d}) trackId: ${p}`),this._initPTS={baseTime:u,timescale:d,trackId:p},this._initDTS={baseTime:c,timescale:d,trackId:p}):u=d=void 0,{tracks:o,initPTS:u,timescale:d,trackId:p}}remuxVideo(e,t,r,n){const i=e.inputTimeScale,s=e.samples,a=[],o=s.length,l=this._initPTS,u=l.baseTime*i/l.timescale;let c,d,h=this.nextVideoTs,f=8,p=this.videoSampleDuration,g=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,v=!1;if(!r||null===h){const e=u+t*i,n=s[0].pts-Ev(s[0].dts,s[0].pts);vv&&null!==h&&Math.abs(e-n-(h+u))<15e3?r=!0:h=e-n-u}const y=h+u;for(let e=0;e<o;e++){const t=s[e];t.pts=Ev(t.pts,y),t.dts=Ev(t.dts,y),t.dts<s[e>0?e-1:e].dts&&(v=!0)}v&&s.sort(function(e,t){const r=e.dts-t.dts,n=e.pts-t.pts;return r||n}),c=s[0].dts,d=s[s.length-1].dts;const b=d-c,w=b?Math.round(b/(o-1)):p||e.inputTimeScale/30;if(r){const r=c-y,n=r>w,i=r<-1;if((n||i)&&(n?this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${pv(r,!0)} ms (${r}dts) hole between fragments detected at ${t.toFixed(3)}`):this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${pv(-r,!0)} ms (${r}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!i||y>=s[0].pts||vv)){c=y;const e=s[0].pts-r;if(n)s[0].dts=c,s[0].pts=e;else{let t=!0;for(let n=0;n<s.length&&!(s[n].dts>e&&t);n++){const e=s[n].pts;if(s[n].dts-=r,s[n].pts-=r,n<s.length-1){const r=s[n+1].pts;t=r<=s[n].pts==r<=e}}}this.log(`Video: Initial PTS/DTS adjusted: ${pv(e,!0)}/${pv(c,!0)}, delta: ${pv(r,!0)} ms`)}}c=Math.max(0,c);let E=0,S=0,T=c;for(let e=0;e<o;e++){const t=s[e],r=t.units,n=r.length;let i=0;for(let e=0;e<n;e++)i+=r[e].data.length;S+=i,E+=n,t.length=i,t.dts<T?(t.dts=T,T+=w/4|0||1):T=t.dts,g=Math.min(t.pts,g),m=Math.max(t.pts,m)}d=s[o-1].dts;const k=S+4*E+8;let x;try{x=new Uint8Array(k)}catch(e){return void this.observer.emit(Id.ERROR,Id.ERROR,{type:Rd.MUX_ERROR,details:Ld.REMUX_ALLOC_ERROR,fatal:!1,error:e,bytes:k,reason:`fail allocating video mdat ${k}`})}const A=new DataView(x.buffer);A.setUint32(0,k),x.set(hv.types.mdat,4);let R=!1,L=Number.POSITIVE_INFINITY,I=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,P=Number.NEGATIVE_INFINITY;for(let e=0;e<o;e++){const t=s[e],r=t.units;let l,c=0;for(let e=0,t=r.length;e<t;e++){const t=r[e],n=t.data,i=t.data.byteLength;A.setUint32(f,i),f+=4,x.set(n,f),f+=i,c+=4+i}if(e<o-1)p=s[e+1].dts-t.dts,l=s[e+1].pts-t.pts;else{const r=this.config,a=e>0?t.dts-s[e-1].dts:w;if(l=e>0?t.pts-s[e-1].pts:w,r.stretchShortVideoTrack&&null!==this.nextAudioTs){const e=Math.floor(r.maxBufferHole*i),s=(n?g+n*i:this.nextAudioTs+u)-t.pts;s>e?(p=s-a,p<0?p=a:R=!0,this.log(`It is approximately ${s/90} ms to the next segment; using duration ${p/90} ms for the last video frame.`)):p=a}else p=a}const d=Math.round(t.pts-t.dts);L=Math.min(L,p),C=Math.max(C,p),I=Math.min(I,l),P=Math.max(P,l),a.push(bv(t.key,p,c,d))}if(a.length)if(vv){if(vv<70){const e=a[0].flags;e.dependsOn=2,e.isNonSync=0}}else if(yv&&P-I<C-L&&w/C<.025&&0===a[0].cts){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let e=c;for(let t=0,r=a.length;t<r;t++){const n=e+a[t].duration,i=e+a[t].cts;if(t<r-1){const e=n+a[t+1].cts;a[t].duration=e-i}else a[t].duration=t?a[t-1].duration:w;a[t].cts=0,e=n}}p=R||!p?w:p;const D=d+p;this.nextVideoTs=h=D-u,this.videoSampleDuration=p,this.isVideoContiguous=!0;const _={data1:hv.moof(e.sequenceNumber++,c,Ud(e,{samples:a})),data2:x,startPTS:(g-u)/i,endPTS:(m+p-u)/i,startDTS:(c-u)/i,endDTS:h/i,type:"video",hasAudio:!1,hasVideo:!0,nb:a.length,dropped:e.dropped};return e.samples=[],e.dropped=0,_}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return 1152;case"ac3":return 1536;default:return 1024}}remuxAudio(e,t,r,n,i){const s=e.inputTimeScale,a=s/(e.samplerate?e.samplerate:s),o=this.getSamplesPerFrame(e),l=o*a,u=this._initPTS,c="mp3"===e.segmentCodec&&this.typeSupported.mpeg,d=[],h=void 0!==i;let f=e.samples,p=c?0:8,g=this.nextAudioTs||-1;const m=u.baseTime*s/u.timescale,v=m+t*s;if(this.isAudioContiguous=r=r||f.length&&g>0&&(n&&Math.abs(v-(g+m))<9e3||Math.abs(Ev(f[0].pts,v)-(g+m))<20*l),f.forEach(function(e){e.pts=Ev(e.pts,v)}),!r||g<0){const e=f.length;if(f=f.filter(e=>e.pts>=0),e!==f.length&&this.warn(`Removed ${f.length-e} of ${e} samples (initPTS ${m} / ${s})`),!f.length)return;g=0===i?0:n&&!h?Math.max(0,v-m):f[0].pts-m}if("aac"===e.segmentCodec){const t=this.config.maxAudioFramesDrift;for(let r=0,n=g+m;r<f.length;r++){const i=f[r],a=i.pts,o=a-n,u=Math.abs(1e3*o/s);if(o<=-t*l&&h)0===r&&(this.warn(`Audio frame @ ${(a/s).toFixed(3)}s overlaps marker by ${Math.round(1e3*o/s)} ms.`),this.nextAudioTs=g=a-m,n=a);else if(o>=t*l&&u<1e4&&h){let t=Math.round(o/l);for(n=a-t*l;n<0&&t&&l;)t--,n+=l;0===r&&(this.nextAudioTs=g=n-m),this.warn(`Injecting ${t} audio frames @ ${((n-m)/s).toFixed(3)}s due to ${Math.round(1e3*o/s)} ms gap.`);for(let s=0;s<t;s++){let t=cv.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);t||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),t=i.unit.subarray()),f.splice(r,0,{unit:t,pts:n}),n+=l,r++}}i.pts=n,n+=l}}let y,b=null,w=null,E=0,S=f.length;for(;S--;)E+=f[S].unit.byteLength;for(let t=0,n=f.length;t<n;t++){const n=f[t],i=n.unit;let s=n.pts;if(null!==w){d[t-1].duration=Math.round((s-w)/a)}else{if(r&&"aac"===e.segmentCodec&&(s=g+m),b=s,!(E>0))return;E+=p;try{y=new Uint8Array(E)}catch(e){return void this.observer.emit(Id.ERROR,Id.ERROR,{type:Rd.MUX_ERROR,details:Ld.REMUX_ALLOC_ERROR,fatal:!1,error:e,bytes:E,reason:`fail allocating audio mdat ${E}`})}if(!c){new DataView(y.buffer).setUint32(0,E),y.set(hv.types.mdat,4)}}y.set(i,p);const l=i.byteLength;p+=l,d.push(bv(!0,o,l,0)),w=s}const T=d.length;if(!T)return;const k=d[d.length-1];g=w-m,this.nextAudioTs=g+a*k.duration;const x=c?new Uint8Array(0):hv.moof(e.sequenceNumber++,b/a,Ud({},e,{samples:d}));e.samples=[];const A=(b-m)/s,R=this.nextAudioTs/s,L={data1:x,data2:y,startPTS:A,endPTS:R,startDTS:A,endDTS:R,type:"audio",hasAudio:!0,hasVideo:!1,nb:T};return this.isAudioContiguous=!0,L}}function Ev(e,t){let r;if(null===t)return e;for(r=t<e?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=r;return e}function Sv(e,t,r,n){const i=e.samples.length;if(!i)return;const s=e.inputTimeScale;for(let a=0;a<i;a++){const i=e.samples[a];i.pts=Ev(i.pts-r.baseTime*s/r.timescale,t*s)/s,i.dts=Ev(i.dts-n.baseTime*s/n.timescale,t*s)/s}const a=e.samples;return e.samples=[],{samples:a}}function Tv(e,t,r){const n=e.samples.length;if(!n)return;const i=e.inputTimeScale;for(let s=0;s<n;s++){const n=e.samples[s];n.pts=Ev(n.pts-r.baseTime*i/r.timescale,t*i)/i}e.samples.sort((e,t)=>e.pts-t.pts);const s=e.samples;return e.samples=[],{samples:s}}function kv(e,t,r=!1){return void 0!==(null==e?void 0:e.start)?(e.start+(r?e.duration:0))/e.timescale:t}function xv(e,t,r){const n=e.codec;if(n&&n.length>4)return n;if(t===dh){if("ec-3"===n||"ac-3"===n||"alac"===n)return n;if("fLaC"===n||"Opus"===n){return tf(n,!1)}return r.warn(`Unhandled audio codec "${n}" in mp4 MAP`),n||"mp4a"}return r.warn(`Unhandled video codec "${n}" in mp4 MAP`),n||"avc1"}try{mv=self.performance.now.bind(self.performance)}catch(e){mv=Date.now}const Av=[{demux:class{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,r,n){const i=this.videoTrack=_m("video",1),s=this.audioTrack=_m("audio",1),a=this.txtTrack=_m("text",1);if(this.id3Track=_m("id3",1),this.timeOffset=0,null==e||!e.byteLength)return;const o=Ih(e);if(o.video){const{id:e,timescale:t,codec:r,supplemental:n}=o.video;i.id=e,i.timescale=a.timescale=t,i.codec=r,i.supplemental=n}if(o.audio){const{id:e,timescale:t,codec:r}=o.audio;s.id=e,s.timescale=t,s.codec=r}a.id=Eh.text,i.sampleDuration=0,i.duration=s.duration=n}resetContiguity(){this.remainderData=null}static probe(e){return function(e){const t=e.byteLength;for(let r=0;r<t;){const n=kh(e,r);if(n>8&&109===e[r+4]&&111===e[r+5]&&111===e[r+6]&&102===e[r+7])return!0;r=n>1?r+n:t}return!1}(e)}demux(e,t){this.timeOffset=t;let r=e;const n=this.videoTrack,i=this.txtTrack;if(this.config.progressive){this.remainderData&&(r=Fh(this.remainderData,e));const t=function(e){const t={valid:null,remainder:null},r=Rh(e,["moof"]);if(r.length<2)return t.remainder=e,t;const n=r[r.length-1];return t.valid=e.slice(0,n.byteOffset-8),t.remainder=e.slice(n.byteOffset-8),t}(r);this.remainderData=t.remainder,n.samples=t.valid||new Uint8Array}else n.samples=r;const s=this.extractID3Track(n,t);return i.samples=$h(t,n),{videoTrack:n,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,r=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const n=this.extractID3Track(t,this.timeOffset);return r.samples=$h(e,t),{videoTrack:t,audioTrack:_m(),id3Track:n,textTrack:_m()}}extractID3Track(e,t){const r=this.id3Track;if(e.samples.length){const n=Rh(e.samples,["emsg"]);n&&n.forEach(e=>{const n=function(e){const t=e[0];let r="",n="",i=0,s=0,a=0,o=0,l=0,u=0;if(0===t){for(;"\0"!==Sh(e.subarray(u,u+1));)r+=Sh(e.subarray(u,u+1)),u+=1;for(r+=Sh(e.subarray(u,u+1)),u+=1;"\0"!==Sh(e.subarray(u,u+1));)n+=Sh(e.subarray(u,u+1)),u+=1;n+=Sh(e.subarray(u,u+1)),u+=1,i=kh(e,12),s=kh(e,16),o=kh(e,20),l=kh(e,24),u=28}else if(1===t){u+=4,i=kh(e,u),u+=4;const t=kh(e,u);u+=4;const s=kh(e,u);for(u+=4,a=2**32*t+s,xd(a)||(a=Number.MAX_SAFE_INTEGER,qd.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=kh(e,u),u+=4,l=kh(e,u),u+=4;"\0"!==Sh(e.subarray(u,u+1));)r+=Sh(e.subarray(u,u+1)),u+=1;for(r+=Sh(e.subarray(u,u+1)),u+=1;"\0"!==Sh(e.subarray(u,u+1));)n+=Sh(e.subarray(u,u+1)),u+=1;n+=Sh(e.subarray(u,u+1)),u+=1}return{schemeIdUri:r,value:n,timeScale:i,presentationTime:a,presentationTimeDelta:s,eventDuration:o,id:l,payload:e.subarray(u,e.byteLength)}}(e);if(qm.test(n.schemeIdUri)){const e=Xm(n,t);let i=4294967295===n.eventDuration?Number.POSITIVE_INFINITY:n.eventDuration/n.timeScale;i<=.001&&(i=Number.POSITIVE_INFINITY);const s=n.payload;r.samples.push({data:s,len:s.byteLength,dts:e,pts:e,type:Dm.emsg,duration:i})}else if(this.config.enableEmsgKLVMetadata&&n.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const e=Xm(n,t);r.samples.push({data:n.payload,len:n.payload.byteLength,dts:e,pts:e,type:Dm.misbklv,duration:Number.POSITIVE_INFINITY})}})}return r}demuxSampleAes(e,t,r){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}},remux:class extends Gd{constructor(e,t,r,n){super("passthrough-remuxer",n),this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.isVideoContiguous=!1}destroy(){}resetTimeStamp(e){this.lastEndTime=null;const t=this.initPTS;t&&e&&t.baseTime===e.baseTime&&t.timescale===e.timescale||(this.initPTS=e)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(e,t,r,n){this.audioCodec=t,this.videoCodec=r,this.generateInitSegment(e,n),this.emitInitSegment=!0}generateInitSegment(e,t){let{audioCodec:r,videoCodec:n}=this;if(null==e||!e.byteLength)return this.initTracks=void 0,void(this.initData=void 0);const{audio:i,video:s}=this.initData=Ih(e);if(t)!function(e,t){if(!e||!t)return;const r=t.keyId;r&&t.isCommonEncryption&&Oh(e,(e,t)=>{const n=e.subarray(8,24);n.some(e=>0!==e)||(qd.log(`[eme] Patching keyId in 'enc${t?"a":"v"}>sinf>>tenc' box: ${Jd(n)} -> ${Jd(r)}`),e.set(r,8))})}(e,t);else{const e=i||s;null!=e&&e.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${e.codec}")!`)}i&&(r=xv(i,dh,this)),s&&(n=xv(s,hh,this));const a={};i&&s?a.audiovideo={container:"video/mp4",codec:r+","+n,supplemental:s.supplemental,encrypted:s.encrypted,initSegment:e,id:"main"}:i?a.audio={container:"audio/mp4",codec:r,encrypted:i.encrypted,initSegment:e,id:"audio"}:s?a.video={container:"video/mp4",codec:n,supplemental:s.supplemental,encrypted:s.encrypted,initSegment:e,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=a}remux(e,t,r,n,i,s){var a,o;let{initPTS:l,lastEndTime:u}=this;const c={audio:void 0,video:void 0,text:n,id3:r,initSegment:void 0};kd(u)||(u=this.lastEndTime=i||0);const d=t.samples;if(!d.length)return c;const h={initPTS:void 0,timescale:void 0,trackId:void 0};let f=this.initData;if(null!=(a=f)&&a.length||(this.generateInitSegment(d),f=this.initData),null==(o=f)||!o.length)return this.warn("Failed to generate initSegment."),c;this.emitInitSegment&&(h.tracks=this.initTracks,this.emitInitSegment=!1);const p=function(e,t,r){const n={},i=Rh(e,["moof","traf"]);for(let e=0;e<i.length;e++){const s=i[e],a=Rh(s,["tfhd"])[0],o=kh(a,4),l=t[o];if(!l)continue;n[o]||(n[o]={start:NaN,duration:0,sampleCount:0,timescale:l.timescale,type:l.type});const u=n[o],c=Rh(s,["tfdt"])[0];if(c){const e=c[0];let t=kh(c,4);1===e&&(t===bh?r.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(t*=bh+1,t+=kh(c,8))),kd(t)&&(!kd(u.start)||t<u.start)&&(u.start=t)}const d=l.default,h=kh(a,0)|(null==d?void 0:d.flags);let f=(null==d?void 0:d.duration)||0;8&h&&(f=kh(a,2&h?12:8));const p=Rh(s,["trun"]);let g=u.start||0,m=0,v=f;for(let e=0;e<p.length;e++){const t=p[e],r=kh(t,4),n=u.sampleCount;u.sampleCount+=r;const i=1&t[3],s=4&t[3],a=1&t[2],o=2&t[2],l=4&t[2],c=8&t[2];let d=8,h=r;for(i&&(d+=4),s&&r&&(1&t[d+1]||void 0!==u.keyFrameIndex||(u.keyFrameIndex=n),d+=4,a?(v=kh(t,d),d+=4):v=f,o&&(d+=4),c&&(d+=4),g+=v,m+=v,h--);h--;)a?(v=kh(t,d),d+=4):v=f,o&&(d+=4),l&&(1&t[d+1]||void 0===u.keyFrameIndex&&(u.keyFrameIndex=u.sampleCount-(h+1),u.keyFrameStart=g),d+=4),c&&(d+=4),g+=v,m+=v;!m&&f&&(m+=f*r)}u.duration+=m}if(!Object.keys(n).some(e=>n[e].duration)){let t=1/0,r=0;const i=Rh(e,["sidx"]);for(let e=0;e<i.length;e++){const n=Lh(i[e]);if(null!=n&&n.references){t=Math.min(t,n.earliestPresentationTime/n.timescale);const e=n.references.reduce((e,t)=>e+t.info.duration||0,0);r=Math.max(r,e+n.earliestPresentationTime/n.timescale)}}r&&kd(r)&&Object.keys(n).forEach(e=>{n[e].duration||(n[e].duration=r*n[e].timescale-n[e].start)})}return n}(d,f,this),g=f.audio?p[f.audio.id]:null,m=f.video?p[f.video.id]:null,v=kv(m,1/0),y=kv(g,1/0),b=kv(m,0,!0),w=kv(g,0,!0);let E=i,S=0;const T=g&&(!m||!l&&y<v||l&&l.trackId===f.audio.id),k=T?g:m;if(k){const e=k.timescale,t=k.start-i*e,r=T?f.audio.id:f.video.id;E=k.start/e,S=T?w-y:b-v,!s&&l||!function(e,t,r,n){if(null===e)return!0;const i=Math.max(n,1),s=t-e.baseTime/e.timescale;return Math.abs(s-r)>i}(l,E,i,S)&&e===l.timescale||(l&&this.warn(`Timestamps at playlist time: ${s?"":"~"}${i} ${t/e} != initPTS: ${l.baseTime/l.timescale} (${l.baseTime}/${l.timescale}) trackId: ${l.trackId}`),this.log(`Found initPTS at playlist time: ${i} offset: ${E-i} (${t}/${e}) trackId: ${r}`),l=null,h.initPTS=t,h.timescale=e,h.trackId=r)}else this.warn(`No audio or video samples found for initPTS at playlist time: ${i}`);l?(h.initPTS=l.baseTime,h.timescale=l.timescale,h.trackId=l.trackId):(h.timescale&&void 0!==h.trackId&&void 0!==h.initPTS||(this.warn("Could not set initPTS"),h.initPTS=E,h.timescale=1,h.trackId=-1),this.initPTS=l={baseTime:h.initPTS,timescale:h.timescale,trackId:h.trackId});const x=E-l.baseTime/l.timescale,A=x+S;S>0?this.lastEndTime=A:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const R=!!f.audio,L=!!f.video;let I="";R&&(I+="audio"),L&&(I+="video");const C={data1:d,startPTS:x,startDTS:x,endPTS:A,endDTS:A,type:I,hasAudio:R,hasVideo:L,nb:1,dropped:0,encrypted:!!f.audio&&f.audio.encrypted||!!f.video&&f.video.encrypted};c.audio=R&&!L?C:void 0,c.video=L?C:void 0;const P=null==m?void 0:m.sampleCount;if(P){const e=m.keyFrameIndex,t=-1!==e;C.nb=P,C.dropped=0===e||this.isVideoContiguous?0:t?e:P,C.independent=t,C.firstKeyFrame=e,t&&m.keyFrameStart&&(C.firstKeyFramePTS=(m.keyFrameStart-l.baseTime)/l.timescale),this.isVideoContiguous||(c.independent=t),this.isVideoContiguous||(this.isVideoContiguous=t),C.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${e}/${P} dropped: ${C.dropped} start: ${C.firstKeyFramePTS||"NA"}`)}return c.initSegment=h,c.id3=Sv(r,i,l,l),n.samples.length&&(c.text=Tv(n,i,l)),c}}},{demux:nv,remux:wv},{demux:class extends Mm{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,r,n){super.resetInitSegment(e,t,r,n),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:n,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const r=pm(e,0);let n=(null==r?void 0:r.length)||0;if(Vm(e,n))return!1;for(let r=e.length;n<r;n++)if(bm(e,n))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return function(e,t){return function(e,t){return t+5<e.length}(e,t)&&gm(e,t)&&vm(e,t)<=e.length-t}(e,t)}appendFrame(e,t,r){wm(e,this.observer,t,r,e.manifestCodec);const n=Sm(e,t,r,this.basePTS,this.frameIndex);if(n&&0===n.missing)return n}},remux:wv},{demux:class extends Mm{resetInitSegment(e,t,r,n){super.resetInitSegment(e,t,r,n),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:n,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=pm(e,0);let r=(null==t?void 0:t.length)||0;if(t&&11===e[r]&&119===e[r+1]&&void 0!==Pm(t)&&Wm(e,r)<=16)return!1;for(let t=e.length;r<t;r++)if(Vm(e,r))return qd.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return function(e,t){return Gm(e,t)&&4<=e.length-t}(e,t)}appendFrame(e,t,r){if(null!==this.basePTS)return zm(e,t,r,this.basePTS,this.frameIndex)}},remux:wv}];Av.splice(2,0,{demux:Km,remux:wv});class Rv{constructor(e,t,r,n,i,s){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=r,this.id=i,this.logger=s}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,r,n){const i=r.transmuxing;i.executeStart=mv();let s=new Uint8Array(e);const{currentTransmuxState:a,transmuxConfig:o}=this;n&&(this.currentTransmuxState=n);const{contiguous:l,discontinuity:u,trackSwitch:c,accurateTimeOffset:d,timeOffset:h,initSegmentChange:f}=n||a,{audioCodec:p,videoCodec:g,defaultInitPts:m,duration:v,initSegmentData:y}=o,b=function(e,t){let r=null;e.byteLength>0&&null!=(null==t?void 0:t.key)&&null!==t.iv&&null!=t.method&&(r=t);return r}(s,t);if(b&&Bp(b.method)){const e=this.getDecrypter(),t=Up(b.method);if(!e.isSync())return this.asyncResult=!0,this.decryptionPromise=e.webCryptoDecrypt(s,b.key.buffer,b.iv.buffer,t).then(e=>{const t=this.push(e,null,r);return this.decryptionPromise=null,t}),this.decryptionPromise;{let n=e.softwareDecrypt(s,b.key.buffer,b.iv.buffer,t);if(r.part>-1){const t=e.flush();n=t?t.buffer:t}if(!n)return i.executeEnd=mv(),Lv(r);s=new Uint8Array(n)}}const w=this.needsProbing(u,c);if(w){const e=this.configureTransmuxer(s);if(e)return this.logger.warn(`[transmuxer] ${e.message}`),this.observer.emit(Id.ERROR,Id.ERROR,{type:Rd.MEDIA_ERROR,details:Ld.FRAG_PARSING_ERROR,fatal:!1,error:e,reason:e.message}),i.executeEnd=mv(),Lv(r)}(u||c||f||w)&&this.resetInitSegment(y,p,g,v,t),(u||f||w)&&this.resetInitialTimestamp(m),l||this.resetContiguity();const E=this.transmux(s,b,h,d,r);this.asyncResult=Iv(E);const S=this.currentTransmuxState;return S.contiguous=!0,S.discontinuity=!1,S.trackSwitch=!1,i.executeEnd=mv(),E}flush(e){const t=e.transmuxing;t.executeStart=mv();const{decrypter:r,currentTransmuxState:n,decryptionPromise:i}=this;if(i)return this.asyncResult=!0,i.then(()=>this.flush(e));const s=[],{timeOffset:a}=n;if(r){const t=r.flush();t&&s.push(this.push(t.buffer,null,e))}const{demuxer:o,remuxer:l}=this;if(!o||!l){t.executeEnd=mv();const r=[Lv(e)];return this.asyncResult?Promise.resolve(r):r}const u=o.flush(a);return Iv(u)?(this.asyncResult=!0,u.then(t=>(this.flushRemux(s,t,e),s))):(this.flushRemux(s,u,e),this.asyncResult?Promise.resolve(s):s)}flushRemux(e,t,r){const{audioTrack:n,videoTrack:i,id3Track:s,textTrack:a}=t,{accurateTimeOffset:o,timeOffset:l}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${r.sn}${r.part>-1?" part: "+r.part:""} of ${this.id===Md?"level":"track"} ${r.level}`);const u=this.remuxer.remux(n,i,s,a,l,o,!0,this.id);e.push({remuxResult:u,chunkMeta:r}),r.transmuxing.executeEnd=mv()}resetInitialTimestamp(e){const{demuxer:t,remuxer:r}=this;t&&r&&(t.resetTimeStamp(e),r.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,r,n,i){const{demuxer:s,remuxer:a}=this;s&&a&&(s.resetInitSegment(e,t,r,n),a.resetInitSegment(e,t,r,i))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,r,n,i){let s;return s=t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,r,n,i):this.transmuxUnencrypted(e,r,n,i),s}transmuxUnencrypted(e,t,r,n){const{audioTrack:i,videoTrack:s,id3Track:a,textTrack:o}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(i,s,a,o,t,r,!1,this.id),chunkMeta:n}}transmuxSampleAes(e,t,r,n,i){return this.demuxer.demuxSampleAes(e,t,r).then(e=>({remuxResult:this.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,r,n,!1,this.id),chunkMeta:i}))}configureTransmuxer(e){const{config:t,observer:r,typeSupported:n}=this;let i;for(let t=0,r=Av.length;t<r;t++){var s;if(null!=(s=Av[t].demux)&&s.probe(e,this.logger)){i=Av[t];break}}if(!i)return new Error("Failed to find demuxer by probing fragment data");const a=this.demuxer,o=this.remuxer,l=i.remux,u=i.demux;o&&o instanceof l||(this.remuxer=new l(r,t,n,this.logger)),a&&a instanceof u||(this.demuxer=new u(r,t,n,this.logger),this.probe=u.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new gp(this.config)),e}}const Lv=e=>({remuxResult:{},chunkMeta:e});function Iv(e){return"then"in e&&e.then instanceof Function}class Cv{constructor(e,t,r,n,i){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=r,this.duration=n,this.defaultInitPts=i||null}}class Pv{constructor(e,t,r,n,i,s){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=r,this.trackSwitch=n,this.timeOffset=i,this.initSegmentChange=s}}let Dv=0;class _v{constructor(e,t,r,n){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=Dv++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=e=>{const t=e.data,r=this.hls;if(r&&null!=t&&t.event&&t.instanceNo===this.instanceNo)switch(t.event){case"init":{var n;const e=null==(n=this.workerContext)?void 0:n.objectURL;e&&self.URL.revokeObjectURL(e);break}case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;case"workerLog":r.logger[t.data.logType]&&r.logger[t.data.logType](t.data.message);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.part=this.part,t.data.id=this.id,r.trigger(t.event,t.data)}},this.onWorkerError=e=>{if(!this.hls)return;const t=new Error(`${e.message} (${e.filename}:${e.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(Id.ERROR,{type:Rd.OTHER_ERROR,details:Ld.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:t})};const i=e.config;this.hls=e,this.id=t,this.useWorker=!!i.enableWorker,this.onTransmuxComplete=r,this.onFlush=n;const s=(e,t)=>{(t=t||{}).frag=this.frag||void 0,e===Id.ERROR&&(t.parent=this.id,t.part=this.part,this.error=t.error),this.hls.trigger(e,t)};this.observer=new lm,this.observer.on(Id.FRAG_DECRYPTED,s),this.observer.on(Id.ERROR,s);const a=af(i.preferManagedMediaSource);if(this.useWorker&&"undefined"!=typeof Worker){const r=this.hls.logger;if(i.workerPath||"function"==typeof __HLS_WORKER_BUNDLE__){try{i.workerPath?(r.log(`loading Web Worker ${i.workerPath} for "${t}"`),this.workerContext=function(e){const t=cm[e];if(t)return t.clientCount++,t;const r=new self.URL(e,self.location.href).href,n={worker:new self.Worker(r),scriptURL:r,clientCount:1};return cm[e]=n,n}(i.workerPath)):(r.log(`injecting Web Worker for "${t}"`),this.workerContext=function(){const e=cm[um];if(e)return e.clientCount++,e;const t=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),r=self.URL.createObjectURL(t),n={worker:new self.Worker(r),objectURL:r,clientCount:1};return cm[um]=n,n}());const{worker:e}=this.workerContext;e.addEventListener("message",this.onWorkerMessage),e.addEventListener("error",this.onWorkerError),e.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:a,id:t,config:xf(i)})}catch(n){r.warn(`Error setting up "${t}" Web Worker, fallback to inline`,n),this.terminateWorker(),this.error=null,this.transmuxer=new Rv(this.observer,a,i,"",t,e.logger)}return}}this.transmuxer=new Rv(this.observer,a,i,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=Dv++;const t=this.hls.config,r=af(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:r,id:this.id,config:xf(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),function(e){const t=cm[e||um];if(t&&1===t.clientCount--){const{worker:r,objectURL:n}=t;delete cm[e||um],n&&self.URL.revokeObjectURL(n),r.terminate()}}(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(e,t,r,n,i,s,a,o,l,u){var c,d;l.transmuxing.start=self.performance.now();const{instanceNo:h,transmuxer:f}=this,p=s?s.start:i.start,g=i.decryptdata,m=this.frag,v=!(m&&i.cc===m.cc),y=!(m&&l.level===m.level),b=m?l.sn-m.sn:-1,w=this.part?l.part-this.part.index:-1,E=0===b&&l.id>1&&l.id===(null==m?void 0:m.stats.chunkCount),S=!y&&(1===b||0===b&&(1===w||E&&w<=0)),T=self.performance.now();(y||b||0===i.stats.parsing.start)&&(i.stats.parsing.start=T),!s||!w&&S||(s.stats.parsing.start=T);const k=!(m&&(null==(c=i.initSegment)?void 0:c.url)===(null==(d=m.initSegment)?void 0:d.url)),x=new Pv(v,S,o,y,p,k);if(!S||v||k){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${i.type} sn: ${l.sn}${l.part>-1?" part: "+l.part:""} ${this.id===Md?"level":"track"}: ${l.level} id: ${l.id}\n discontinuity: ${v}\n trackSwitch: ${y}\n contiguous: ${S}\n accurateTimeOffset: ${o}\n timeOffset: ${p}\n initSegmentChange: ${k}`);const e=new Cv(r,n,t,a,u);this.configureTransmuxer(e)}if(this.frag=i,this.part=s,this.workerContext)this.workerContext.worker.postMessage({instanceNo:h,cmd:"demux",data:e,decryptdata:g,chunkMeta:l,state:x},e instanceof ArrayBuffer?[e]:[]);else if(f){const t=f.push(e,g,l,x);Iv(t)?t.then(e=>{this.handleTransmuxComplete(e)}).catch(e=>{this.transmuxerError(e,l,"transmuxer-interface push error")}):this.handleTransmuxComplete(t)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:r}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(r){const t=r.flush(e);Iv(t)?t.then(t=>{this.handleFlushResult(t,e)}).catch(t=>{this.transmuxerError(t,e,"transmuxer-interface flush error")}):this.handleFlushResult(t,e)}}transmuxerError(e,t,r){this.hls&&(this.error=e,this.hls.trigger(Id.ERROR,{type:Rd.MEDIA_ERROR,details:Ld.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:r}))}handleFlushResult(e,t){e.forEach(e=>{this.handleTransmuxComplete(e)}),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:r}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):r&&r.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}class Mv extends Gd{constructor(e,t){super(t,e.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){-1!==this.timer&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,r){const n=null==t?void 0:t.renditionReports;if(n){let i=-1;for(let r=0;r<n.length;r++){const s=n[r];let a;try{a=new self.URL(s.URI,t.url).href}catch(e){this.warn(`Could not construct new URL for Rendition Report: ${e}`),a=s.URI||""}if(a===e){i=r;break}a===e.substring(0,a.length)&&(i=r)}if(-1!==i){const e=n[i],s=parseInt(e["LAST-MSN"])||t.lastPartSn;let a=parseInt(e["LAST-PART"])||t.lastPartIndex;if(this.hls.config.lowLatencyMode){const e=Math.min(t.age-t.partTarget,t.targetduration);a>=0&&e>t.partTarget&&(a+=1)}const o=r&&wf(r);return new Ef(s,a>=0?a:void 0,o)}}}loadPlaylist(e){this.clearTimer()}loadingPlaylist(e,t){this.clearTimer()}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}getUrlWithDirectives(e,t){if(t)try{return t.addDirectives(e)}catch(e){this.warn(`Could not construct new URL with HLS Delivery Directives: ${e}`)}return e}playlistLoaded(e,t,r){const{details:n,stats:i}=t,s=self.performance.now(),a=i.loading.first?Math.max(0,s-i.loading.first):0;n.advancedDateTime=Date.now()-a;const o=this.hls.config.timelineOffset;if(o!==n.appliedTimelineOffset){const e=Math.max(o||0,0);n.appliedTimelineOffset=e,n.fragments.forEach(t=>{t.setStart(t.playlistOffset+e)})}if(n.live||null!=r&&r.live){const o="levelInfo"in t?t.levelInfo:t.track;if(n.reloaded(r),r&&n.fragments.length>0){xg(r,n,this);const e=n.playlistParsingError;if(e){this.warn(e);const r=this.hls;if(!r.config.ignorePlaylistParsingErrors){var l;const{networkDetails:s}=t;return void r.trigger(Id.ERROR,{type:Rd.NETWORK_ERROR,details:Ld.LEVEL_PARSING_ERROR,fatal:!1,url:n.url,error:e,reason:e.message,level:t.level||void 0,parent:null==(l=n.fragments[0])?void 0:l.type,networkDetails:s,stats:i})}n.playlistParsingError=null}}-1===n.requestScheduled&&(n.requestScheduled=i.loading.start);const u=this.hls.mainForwardBufferInfo,c=u?u.end-u.len:0,d=Ig(n,1e3*(n.edge-c));if(n.requestScheduled+d<s?n.requestScheduled=s:n.requestScheduled+=d,this.log(`live playlist ${e} ${n.advanced?"REFRESHED "+n.lastPartSn+"-"+n.lastPartIndex:n.updated?"UPDATED":"MISSED"}`),!this.canLoad||!n.live)return;let h,f,p;if(n.canBlockReload&&n.endSN&&n.advanced){const e=this.hls.config.lowLatencyMode,i=n.lastPartSn,a=n.endSN,l=n.lastPartIndex,u=i===a;-1!==l?u?(f=a+1,p=e?0:l):(f=i,p=e?l+1:n.maxPartIndex):f=a+1;const c=n.age,d=c+n.ageHeader;let g=Math.min(d-n.partTarget,1.5*n.targetduration);if(g>0){if(d>3*n.targetduration)this.log(`Playlist last advanced ${c.toFixed(2)}s ago. Omitting segment and part directives.`),f=void 0,p=void 0;else if(null!=r&&r.tuneInGoal&&d-n.partTarget>r.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${r.tuneInGoal} to: ${g} with playlist age: ${n.age}`),g=0;else{const e=Math.floor(g/n.targetduration);if(f+=e,void 0!==p){p+=Math.round(g%n.targetduration/n.partTarget)}this.log(`CDN Tune-in age: ${n.ageHeader}s last advanced ${c.toFixed(2)}s goal: ${g} skip sn ${e} to part ${p}`)}n.tuneInGoal=g}if(h=this.getDeliveryDirectives(n,t.deliveryDirectives,f,p),e||!u)return n.requestScheduled=s,void this.loadingPlaylist(o,h)}else(n.canBlockReload||n.canSkipUntil)&&(h=this.getDeliveryDirectives(n,t.deliveryDirectives,f,p));h&&void 0!==f&&n.canBlockReload&&(n.requestScheduled=i.loading.first+Math.max(d-2*a,d/2)),this.scheduleLoading(o,h,n)}else this.clearTimer()}scheduleLoading(e,t,r){const n=r||e.details;if(!n)return void this.loadingPlaylist(e,t);const i=self.performance.now(),s=n.requestScheduled;if(i>=s)return void this.loadingPlaylist(e,t);const a=s-i;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(a)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,t),a)}getDeliveryDirectives(e,t,r,n){let i=wf(e);return null!=t&&t.skip&&e.deltaUpdateFailed&&(r=t.msn,n=t.part,i=vf),new Ef(r,n,i)}checkRetry(e){const t=e.details,r=Bf(e),n=e.errorAction,{action:i,retryCount:s=0,retryConfig:a}=n||{},o=!!n&&!!a&&(i===Xf||!n.resolved&&i===Yf);if(o){var l;if(s>=a.maxNumRetry)return!1;if(r&&null!=(l=e.context)&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${a.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const e=Gf(a,s);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),e),this.warn(`Retrying playlist loading ${s+1}/${a.maxNumRetry} after "${t}" in ${e}ms`)}e.levelRetry=!0,n.resolved=!0}return o}}function Ov(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!Nv(e[r].attrs,t[r].attrs))return!1;return!0}function Nv(e,t,r){const n=e["STABLE-RENDITION-ID"];return n&&!r?n===t["STABLE-RENDITION-ID"]:!(r||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(r=>e[r]!==t[r])}function Fv(e,t){return t.label.toLowerCase()===e.name.toLowerCase()&&(!t.language||t.language.toLowerCase()===(e.lang||"").toLowerCase())}class $v{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,r){if(null===this.queues||null===this.tracks)return;const n=this.queues[t];n.push(e),1!==n.length||r||this.executeNext(t)}appendBlocker(e){return new Promise(t=>{const r={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(r,e)})}prependBlocker(e){return new Promise(t=>{if(this.queues){const r={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(r)}})}removeBlockers(){null!==this.queues&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{var t;const r=null==(t=e[0])?void 0:t.label;"async-blocker"!==r&&"async-blocker-prepend"!==r||(e[0].execute(),e.splice(0,1))})}unblockAudio(e){if(null===this.queues)return;this.queues.audio[0]===e&&this.shiftAndExecuteNext("audio")}executeNext(e){if(null===this.queues||null===this.tracks)return;const t=this.queues[e];if(t.length){const n=t[0];try{n.execute()}catch(t){var r;if(n.onError(t),null===this.queues||null===this.tracks)return;const i=null==(r=this.tracks[e])?void 0:r.buffer;null!=i&&i.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){null!==this.queues&&(this.queues[e].shift(),this.executeNext(e))}current(e){var t;return(null==(t=this.queues)?void 0:t[e][0])||null}toString(){const{queues:e,tracks:t}=this;return null===e||null===t?"<destroyed>":`\n${this.list("video")}\n${this.list("audio")}\n${this.list("audiovideo")}}`}list(e){var t,r;return null!=(t=this.queues)&&t[e]||null!=(r=this.tracks)&&r[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const r=null==(t=this.tracks)?void 0:t[e],n=null==r?void 0:r.buffer;return n?`SourceBuffer${n.updating?" updating":""}${r.ended?" ended":""}${r.ending?" ending":""}`:"none"}listOps(e){var t;return(null==(t=this.queues)?void 0:t[e].map(e=>e.label).join(", "))||""}}const Bv=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,Uv="HlsJsTrackRemovedError";class zv extends Error{constructor(e){super(e),this.name=Uv}}function jv(e){const t=e.querySelectorAll("source");[].slice.call(t).forEach(t=>{e.removeChild(t)})}function Gv(e){return"audio"===e?1:0}class Hv{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(Id.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(Id.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Id.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Id.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(Id.BUFFER_CODECS,this.onBufferCodecs,this),e.on(Id.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(Id.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(Id.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Id.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Id.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(Id.BUFFER_CODECS,this.onBufferCodecs,this),e.off(Id.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const r=this.hls.levels[t.droppedLevel];this.isLevelAllowed(r)&&this.restrictedLevels.push({bitrate:r.bitrate,height:r.height,width:r.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const r=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,r.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&kd(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0)return void(this.clientRect=null);const e=this.hls.levels;if(e.length){const t=this.hls,r=this.getMaxLevel(e.length-1);r!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${r}: ${e[r].height}p@${e[r].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=r,t.autoLevelEnabled&&t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const r=t.filter((t,r)=>this.isLevelAllowed(t)&&r<=e);return this.clientRect=null,Hv.getMaxLevelByMediaSize(r,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const r=e.getBoundingClientRect();t.width=r.width,t.height=r.height,t.width||t.height||(t.width=r.right-r.left||e.width||0,t.height=r.bottom-r.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(e){}return Math.min(e,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(e){return!this.restrictedLevels.some(t=>e.bitrate===t.bitrate&&e.width===t.width&&e.height===t.height)}static getMaxLevelByMediaSize(e,t,r){if(null==e||!e.length)return-1;const n=(e,t)=>!t||(e.width!==t.width||e.height!==t.height);let i=e.length-1;const s=Math.max(t,r);for(let t=0;t<e.length;t+=1){const r=e[t];if((r.width>=s||r.height>=s)&&n(r,e[t+1])){i=t;break}}return i}}const Vv={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},Wv={HLS:"h"};class Kv{constructor(e,t){Array.isArray(e)&&(e=e.map(e=>e instanceof Kv?e:new Kv(e))),this.value=e,this.params=t}}function Yv(e,t,r,n){return new Error(`failed to ${e} "${i=t,Array.isArray(i)?JSON.stringify(i):i instanceof Map?"Map{}":i instanceof Set?"Set{}":"object"==typeof i?JSON.stringify(i):String(i)}" as ${r}`,{cause:n});var i}function qv(e,t,r){return Yv("serialize",e,t,r)}class Xv{constructor(e){this.description=e}}const Qv="Bare Item";function Zv(e){if(!1===ArrayBuffer.isView(e))throw qv(e,"Byte Sequence");return`:${t=e,btoa(String.fromCharCode(...t))}:`;var t}function Jv(e){if(function(e){return e<-999999999999999||999999999999999<e}(e))throw qv(e,"Integer");return e.toString()}function ey(e,t){if(e<0)return-ey(-e,t);const r=Math.pow(10,t);if(Math.abs(e*r%1-.5)<Number.EPSILON){const t=Math.floor(e*r);return(t%2==0?t:t+1)/r}return Math.round(e*r)/r}function ty(e){const t=ey(e,3);if(Math.floor(Math.abs(t)).toString().length>12)throw qv(e,"Decimal");const r=t.toString();return r.includes(".")?r:`${r}.0`}const ry=/[\x00-\x1f\x7f]+/;function ny(e){const t=(r=e).description||r.toString().slice(7,-1);var r;if(!1===/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(t))throw qv(t,"Token");return t}function iy(e){switch(typeof e){case"number":if(!kd(e))throw qv(e,Qv);return Number.isInteger(e)?Jv(e):ty(e);case"string":return function(e){if(ry.test(e))throw qv(e,"String");return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}(e);case"symbol":return ny(e);case"boolean":return function(e){if("boolean"!=typeof e)throw qv(e,"Boolean");return e?"?1":"?0"}(e);case"object":if(e instanceof Date)return function(e){return`@${Jv(e.getTime()/1e3)}`}(e);if(e instanceof Uint8Array)return Zv(e);if(e instanceof Xv)return ny(e);default:throw qv(e,Qv)}}function sy(e){if(!1===/^[a-z*][a-z0-9\-_.*]*$/.test(e))throw qv(e,"Key");return e}function ay(e){return null==e?"":Object.entries(e).map(([e,t])=>!0===t?`;${sy(e)}`:`;${sy(e)}=${iy(t)}`).join("")}function oy(e){return e instanceof Kv?`${iy(e.value)}${ay(e.params)}`:iy(e)}function ly(e,t={whitespace:!0}){if("object"!=typeof e||null==e)throw qv(e,"Dict");const r=e instanceof Map?e.entries():Object.entries(e),n=(null==t?void 0:t.whitespace)?" ":"";return Array.from(r).map(([e,t])=>{t instanceof Kv==!1&&(t=new Kv(t));let r=sy(e);var n;return!0===t.value?r+=ay(t.params):(r+="=",Array.isArray(t.value)?r+=`(${(n=t).value.map(oy).join(" ")})${ay(n.params)}`:r+=oy(t)),r}).join(`,${n}`)}function uy(e,t){return ly(e,t)}const cy="CMCD-Object",dy="CMCD-Request",hy="CMCD-Session",fy="CMCD-Status",py={br:cy,ab:cy,d:cy,ot:cy,tb:cy,tpb:cy,lb:cy,tab:cy,lab:cy,url:cy,pb:dy,bl:dy,tbl:dy,dl:dy,ltc:dy,mtp:dy,nor:dy,nrr:dy,rc:dy,sn:dy,sta:dy,su:dy,ttfb:dy,ttfbb:dy,ttlb:dy,cmsdd:dy,cmsds:dy,smrt:dy,df:dy,cs:dy,ts:dy,cid:hy,pr:hy,sf:hy,sid:hy,st:hy,v:hy,msd:hy,bs:fy,bsd:fy,cdn:fy,rtp:fy,bg:fy,pt:fy,ec:fy,e:fy},gy=dy;function my(e,t){const r={};if(!e)return r;const n=Object.keys(e),i=t?(s=t,Object.keys(s).reduce((e,t)=>{var r;return null===(r=s[t])||void 0===r||r.forEach(r=>e[r]=t),e},{})):{};var s;return n.reduce((t,r)=>{var n;const s=py[r]||i[r]||gy;return(null!==(n=t[s])&&void 0!==n?n:t[s]={})[r]=e[r],t},r)}const vy="event";const yy=e=>Math.round(e),by=(e,t)=>Array.isArray(e)?e.map(e=>by(e,t)):e instanceof Kv&&"string"==typeof e.value?new Kv(by(e.value,t),e.params):(t.baseUrl&&(e=function(e,t){const r=new URL(e),n=new URL(t);if(r.origin!==n.origin)return e;const i=r.pathname.split("/").slice(1),s=n.pathname.split("/").slice(1,-1);for(;i[0]===s[0];)i.shift(),s.shift();for(;s.length;)s.shift(),i.unshift("..");return i.join("/")+r.search+r.hash}(e,t.baseUrl)),1===t.version?encodeURIComponent(e):e),wy=e=>100*yy(e/100),Ey={br:yy,d:yy,bl:wy,dl:wy,mtp:wy,nor:(e,t)=>{let r=e;return t.version>=2&&(e instanceof Kv&&"string"==typeof e.value?r=new Kv([e]):"string"==typeof e&&(r=[e])),by(r,t)},rtp:wy,tb:yy},Sy="request",Ty="response",ky=["ab","bg","bl","br","bs","bsd","cdn","cid","cs","df","ec","lab","lb","ltc","msd","mtp","pb","pr","pt","sf","sid","sn","st","sta","tab","tb","tbl","tpb","ts","v"],xy=["e"],Ay=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function Ry(e){return Ay.test(e)}const Ly=["d","dl","nor","ot","rtp","su"];const Iy=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"];const Cy=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"];function Py(e){return Cy.includes(e)||Ry(e)}const Dy={[Ty]:function(e){return ky.includes(e)||Ly.includes(e)||Iy.includes(e)||Ry(e)},[vy]:function(e){return ky.includes(e)||xy.includes(e)||Ry(e)},[Sy]:function(e){return ky.includes(e)||Ly.includes(e)||Ry(e)}};function _y(e,t={}){const r={};if(null==e||"object"!=typeof e)return r;const n=t.version||e.v||1,i=t.reportingMode||Sy,s=1===n?Py:Dy[i];let a=Object.keys(e).filter(s);const o=t.filter;"function"==typeof o&&(a=a.filter(o));const l=i===Ty||i===vy;l&&!a.includes("ts")&&a.push("ts"),n>1&&!a.includes("v")&&a.push("v");const u=Ud({},Ey,t.formatters),c={version:n,reportingMode:i,baseUrl:t.baseUrl};return a.sort().forEach(t=>{let i=e[t];const s=u[t];if("function"==typeof s&&(i=s(i,c)),"v"===t){if(1===n)return;i=n}"pr"==t&&1===i||(l&&"ts"===t&&!kd(i)&&(i=Date.now()),function(e){return"number"==typeof e?kd(e):null!=e&&""!==e&&!1!==e}(i)&&(function(e){return["ot","sf","st","e","sta"].includes(e)}(t)&&"string"==typeof i&&(i=new Xv(i)),r[t]=i))}),r}function My(e,t,r){return Ud(e,function(e,t={}){const r={};if(!e)return r;const n=my(_y(e,t),null==t?void 0:t.customHeaderMap);return Object.entries(n).reduce((e,[t,r])=>{const n=uy(r,{whitespace:!1});return n&&(e[t]=n),e},r)}(t,r))}function Oy(e,t={}){if(!e)return"";const r=function(e,t={}){return e?uy(_y(e,t),{whitespace:!1}):""}(e,t);return encodeURIComponent(r)}const Ny=/CMCD=[^&#]+/;function Fy(e,t,r){const n=function(e,t={}){return e?`CMCD=${Oy(e,t)}`:""}(t,r);if(!n)return e;if(Ny.test(e))return e.replace(Ny,n);const i=e.includes("?")?"&":"?";return`${e}${i}${n}`}function $y(e,t,r,n){e&&Object.keys(t).forEach(i=>{const s=e.filter(e=>e.groupId===i).map(e=>{const s=Ud({},e);return s.details=void 0,s.attrs=new Dp(s.attrs),s.url=s.attrs.URI=By(e.url,e.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",r),s.groupId=s.attrs["GROUP-ID"]=t[i],s.attrs["PATHWAY-ID"]=n,s});e.push(...s)})}function By(e,t,r,n){const{HOST:i,PARAMS:s,[r]:a}=n;let o;t&&(o=null==a?void 0:a[t],o&&(e=o));const l=new self.URL(e);return i&&!o&&(l.host=i),s&&Object.keys(s).sort().forEach(e=>{e&&l.searchParams.set(e,s[e])}),l.href}class Uy extends Gd{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.mediaResolved=void 0,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=Uy.CDMCleanupPromise?[Uy.CDMCleanupPromise]:[],this.bannedKeyIds={},this.onMediaEncrypted=e=>{const{initDataType:t,initData:r}=e,n=`"${e.type}" event: init data type: "${t}"`;if(this.debug(n),null!==r){if(!this.keyFormatPromise){let e=Object.keys(this.keySystemAccessPromises);e.length||(e=Jp(this.config));const t=e.map(Zp).filter(e=>!!e);this.keyFormatPromise=this.getKeyFormatPromise(t)}this.keyFormatPromise.then(i=>{const s=Qp(i);if("sinf"!==t||s!==Wp.FAIRPLAY)return void this.log(`Ignoring "${e.type}" event with init data type: "${t}" for selected key-system ${s}`);let a;try{const e=Sh(new Uint8Array(r)),t=Nh(zp(JSON.parse(e).sinf));if(!t)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");a=new Uint8Array(t.subarray(8,24))}catch(e){return void this.warn(`${n} Failed to parse sinf: ${e}`)}const o=Jd(a),{keyIdToKeySessionPromise:l,mediaKeySessions:u}=this;let c=l[o];for(let e=0;e<u.length;e++){const n=u[e],i=n.decryptdata;if(!i.keyId)continue;const s=Jd(i.keyId);if(Fp(a,i.keyId)||-1!==i.uri.replace(/-/g,"").indexOf(o)){if(c=l[s],!c)continue;if(i.pssh)break;delete l[s],i.pssh=new Uint8Array(r),i.keyId=a,c=l[o]=c.then(()=>this.generateRequestWithPreferredKeySession(n,t,r,"encrypted-event-key-match")),c.catch(e=>this.handleError(e));break}}c||this.handleError(new Error(`Key ID ${o} not encountered in playlist. Key-system sessions ${u.length}.`))}).catch(e=>this.handleError(e))}},this.onWaitingForKey=e=>{this.log(`"${e.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.onDestroying(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(Id.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(Id.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(Id.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(Id.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(Id.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(Id.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(Id.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(Id.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(Id.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(Id.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:r}=this.config,n=null==t?void 0:t[e];return n?n.licenseUrl:e===Wp.WIDEVINE&&r?r:void 0}getLicenseServerUrlOrThrow(e){const t=this.getLicenseServerUrl(e);if(void 0===t)throw new Error(`no license server URL configured for key-system "${e}"`);return t}getServerCertificateUrl(e){const{drmSystems:t}=this.config,r=null==t?void 0:t[e];if(r)return r.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,r=(e,t,r)=>!!e&&r.indexOf(e)===t,n=t.map(e=>e.audioCodec).filter(r),i=t.map(e=>e.videoCodec).filter(r);return n.length+i.length===0&&i.push("avc1.42e01e"),new Promise((t,r)=>{const s=e=>{const a=e.shift();this.getMediaKeysPromise(a,n,i).then(e=>t({keySystem:a,mediaKeys:e})).catch(t=>{e.length?s(e):r(t instanceof Gy?t:new Gy({type:Rd.KEY_SYSTEM_ERROR,details:Ld.KEY_SYSTEM_NO_ACCESS,error:t,fatal:!0},t.message))})};s(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:r}=this.config;if("function"!=typeof r){let e=`Configured requestMediaKeySystemAccess is not a function ${r}`;return null===eg&&"http:"===self.location.protocol&&(e=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(e))}return r(e,t)}getMediaKeysPromise(e,t,r){var n;const i=function(e,t,r,n){let i;switch(e){case Wp.FAIRPLAY:i=["cenc","sinf"];break;case Wp.WIDEVINE:case Wp.PLAYREADY:i=["cenc"];break;case Wp.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${e}`)}return function(e,t,r,n){return[{initDataTypes:e,persistentState:n.persistentState||"optional",distinctiveIdentifier:n.distinctiveIdentifier||"optional",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:t.map(e=>({contentType:`audio/mp4; codecs=${e}`,robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null})),videoCapabilities:r.map(e=>({contentType:`video/mp4; codecs=${e}`,robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null}))}]}(i,t,r,n)}(e,t,r,this.config.drmSystemOptions||{});let s=this.keySystemAccessPromises[e],a=null==(n=s)?void 0:n.keySystemAccess;if(!a){this.log(`Requesting encrypted media "${e}" key-system access with config: ${xf(i)}`),a=this.requestMediaKeySystemAccess(e,i);const t=s=this.keySystemAccessPromises[e]={keySystemAccess:a};return a.catch(t=>{this.log(`Failed to obtain access to key-system "${e}": ${t}`)}),a.then(r=>{this.log(`Access for key-system "${r.keySystem}" obtained`);const n=this.fetchServerCertificate(e);this.log(`Create media-keys for "${e}"`);const i=t.mediaKeys=r.createMediaKeys().then(r=>(this.log(`Media-keys created for "${e}"`),t.hasMediaKeys=!0,n.then(t=>t?this.setMediaKeysServerCertificate(r,e,t):r)));return i.catch(t=>{this.error(`Failed to create media-keys for "${e}"}: ${t}`)}),i})}return a.then(()=>s.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:r}){this.log(`Creating key-system session "${t}" keyId: ${Jd(e.keyId||[])} keyUri: ${e.uri}`);const n=r.createSession(),i={decryptdata:e,keySystem:t,mediaKeys:r,mediaKeysSession:n,keyStatus:"status-pending"};return this.mediaKeySessions.push(i),i}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const r=this.createMediaKeySessionContext(e),n=zy(t),i="cenc";this.keyIdToKeySessionPromise[n]=this.generateRequestWithPreferredKeySession(r,i,t.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}updateKeySession(e,t){const r=e.mediaKeysSession;return this.log(`Updating key-session "${r.sessionId}" for keyId ${Jd(e.decryptdata.keyId||[])}\n } (data length: ${t.byteLength})`),r.update(t)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys})).filter(({hasMediaKeys:e})=>!!e).map(({keySystem:e})=>Zp(e)).filter(e=>!!e)}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then(({keySystem:e,mediaKeys:t})=>this.attemptSetMediaKeys(e,t))}selectKeySystem(e){return new Promise((t,r)=>{this.getKeySystemSelectionPromise(e).then(({keySystem:e})=>{const n=Zp(e);n?t(n):r(new Error(`Unable to find format for key-system "${e}"`))}).catch(r)})}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){const t=Jp(this.config),r=e.map(Qp).filter(e=>!!e&&-1!==t.indexOf(e));return this.selectKeySystem(r)}getKeyStatus(e){const{mediaKeySessions:t}=this;for(let r=0;r<t.length;r++){const n=jy(e,t[r]);if(n)return n}}loadKey(e){const t=e.keyInfo.decryptdata,r=zy(t),n=this.bannedKeyIds[r];if(n||"internal-error"===this.getKeyStatus(t)){const r=Hy(n||"internal-error",t);return this.handleError(r,e.frag),Promise.reject(r)}const i=`(keyId: ${r} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${i}`);const s=this.keyIdToKeySessionPromise[r];if(!s){const n=this.getKeySystemForKeyPromise(t).then(({keySystem:r,mediaKeys:n})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${i}`),this.attemptSetMediaKeys(r,n).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:r,mediaKeys:n,decryptdata:t}))))).then(e=>{const r=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(e,"cenc",r,"playlist-key")});return n.catch(t=>this.handleError(t,e.frag)),this.keyIdToKeySessionPromise[r]=n,n}return s.catch(r=>{if(r instanceof Gy){const n=jd({},r.data);"internal-error"===this.getKeyStatus(t)&&(n.decryptdata=t);const i=new Gy(n,r.message);this.handleError(i,e.frag)}}),s}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e,t){if(this.hls)if(e instanceof Gy){t&&(e.data.frag=t);const r=e.data.decryptdata;this.error(`${e.message}${r?` (${Jd(r.keyId||[])})`:""}`),this.hls.trigger(Id.ERROR,e.data)}else this.error(e.message),this.hls.trigger(Id.ERROR,{type:Rd.KEY_SYSTEM_ERROR,details:Ld.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0})}getKeySystemForKeyPromise(e){const t=zy(e),r=this.keyIdToKeySessionPromise[t];if(!r){const t=Qp(e.keyFormat),r=t?[t]:Jp(this.config);return this.attemptKeySystemAccess(r)}return r}getKeySystemSelectionPromise(e){if(e.length||(e=Jp(this.config)),0===e.length)throw new Gy({type:Rd.KEY_SYSTEM_ERROR,details:Ld.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${xf({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){if(this.mediaResolved=void 0,this.mediaKeys===t)return Promise.resolve();const r=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const n=Promise.all(r).then(()=>this.media?this.media.setMediaKeys(t):new Promise((e,r)=>{this.mediaResolved=()=>{if(this.mediaResolved=void 0,!this.media)return r(new Error("Attempted to set mediaKeys without media element attached"));this.mediaKeys=t,this.media.setMediaKeys(t).then(e).catch(r)}}));return this.mediaKeys=t,this.setMediaKeysQueue.push(n),n.then(()=>{this.log(`Media-keys set for "${e}"`),r.push(n),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(e=>-1===r.indexOf(e))})}generateRequestWithPreferredKeySession(e,t,r,n){var i;const s=null==(i=this.config.drmSystems)||null==(i=i[e.keySystem])?void 0:i.generateRequest;if(s)try{const n=s.call(this.hls,t,r,e);if(!n)throw new Error("Invalid response from configured generateRequest filter");t=n.initDataType,r=n.initData?n.initData:null,e.decryptdata.pssh=r?new Uint8Array(r):null}catch(e){if(this.warn(e.message),this.hls&&this.hls.config.debug)throw e}if(null===r)return this.log(`Skipping key-session request for "${n}" (no initData)`),Promise.resolve(e);const a=zy(e.decryptdata),o=e.decryptdata.uri;this.log(`Generating key-session request for "${n}" keyId: ${a} URI: ${o} (init data type: ${t} length: ${r.byteLength})`);const l=new lm,u=e._onmessage=t=>{const r=e.mediaKeysSession;if(!r)return void l.emit("error",new Error("invalid state"));const{messageType:n,message:i}=t;this.log(`"${n}" message event for session "${r.sessionId}" message size: ${i.byteLength}`),"license-request"===n||"license-renewal"===n?this.renewLicense(e,i).catch(e=>{l.eventNames().length?l.emit("error",e):this.handleError(e)}):"license-release"===n?e.keySystem===Wp.FAIRPLAY&&this.updateKeySession(e,jp("acknowledged")).then(()=>this.removeSession(e)).catch(e=>this.handleError(e)):this.warn(`unhandled media key message type "${n}"`)},c=(e,t)=>{let r;t.keyStatus=e,e.startsWith("usable")?l.emit("resolved"):"internal-error"===e||"output-restricted"===e||"output-downscaled"===e?r=Hy(e,t.decryptdata):"expired"===e?r=new Error(`key expired (keyId: ${a})`):"released"===e?r=new Error("key released"):"status-pending"===e||this.warn(`unhandled key status change "${e}" (keyId: ${a})`),r&&(l.eventNames().length?l.emit("error",r):this.handleError(r))},d=e._onkeystatuseschange=t=>{if(!e.mediaKeysSession)return void l.emit("error",new Error("invalid state"));const r=this.getKeyStatuses(e);if(!Object.keys(r).some(e=>"status-pending"!==r[e]))return;if("expired"===r[a])return this.log(`Expired key ${xf(r)} in key-session "${e.mediaKeysSession.sessionId}"`),void this.renewKeySession(e);let n=r[a];if(n)c(n,e);else{var i;const t=1e3;e.keyStatusTimeouts||(e.keyStatusTimeouts={}),(i=e.keyStatusTimeouts)[a]||(i[a]=self.setTimeout(()=>{if(!e.mediaKeysSession||!this.mediaKeys)return;const r=this.getKeyStatus(e.decryptdata);if(r&&"status-pending"!==r)return this.log(`No status for keyId ${a} in key-session "${e.mediaKeysSession.sessionId}". Using session key-status ${r} from other session.`),c(r,e);this.log(`key status for ${a} in key-session "${e.mediaKeysSession.sessionId}" timed out after ${t}ms`),n="internal-error",c(n,e)},t)),this.log(`No status for keyId ${a} (${xf(r)}).`)}};zg(e.mediaKeysSession,"message",u),zg(e.mediaKeysSession,"keystatuseschange",d);const h=new Promise((e,t)=>{l.on("error",t),l.on("resolved",e)});return e.mediaKeysSession.generateRequest(t,r).then(()=>{this.log(`Request generated for key-session "${e.mediaKeysSession.sessionId}" keyId: ${a} URI: ${o}`)}).catch(t=>{throw new Gy({type:Rd.KEY_SYSTEM_ERROR,details:Ld.KEY_SYSTEM_NO_SESSION,error:t,decryptdata:e.decryptdata,fatal:!1},`Error generating key-session request: ${t}`)}).then(()=>h).catch(t=>(l.removeAllListeners(),this.removeSession(e).then(()=>{throw t}))).then(()=>(l.removeAllListeners(),e))}getKeyStatuses(e){const t={};return e.mediaKeysSession.keyStatuses.forEach((r,n)=>{if("string"==typeof n&&"object"==typeof r){const e=n;n=r,r=e}const i="buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n);if(e.keySystem===Wp.PLAYREADY&&16===i.length){const e=Jd(i);t[e]=r,Gp(i)}const s=Jd(i);"internal-error"===r&&(this.bannedKeyIds[s]=r),this.log(`key status change "${r}" for keyStatuses keyId: ${s} key-session "${e.mediaKeysSession.sessionId}"`),t[s]=r}),t}fetchServerCertificate(e){const t=this.config,r=new(0,t.loader)(t),n=this.getServerCertificateUrl(e);return n?(this.log(`Fetching server certificate for "${e}"`),new Promise((i,s)=>{const a={responseType:"arraybuffer",url:n},o=t.certLoadPolicy.default,l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(e,t,r,n)=>{i(e.data)},onError:(t,r,i,o)=>{s(new Gy({type:Rd.KEY_SYSTEM_ERROR,details:Ld.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:i,response:jd({url:a.url,data:void 0},t)},`"${e}" certificate request failed (${n}). Status: ${t.code} (${t.text})`))},onTimeout:(t,r,i)=>{s(new Gy({type:Rd.KEY_SYSTEM_ERROR,details:Ld.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:i,response:{url:a.url,data:void 0}},`"${e}" certificate request timed out (${n})`))},onAbort:(e,t,r)=>{s(new Error("aborted"))}};r.load(a,l,u)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,r){return new Promise((n,i)=>{e.setServerCertificate(r).then(i=>{this.log(`setServerCertificate ${i?"success":"not supported by CDM"} (${r.byteLength}) on "${t}"`),n(e)}).catch(e=>{i(new Gy({type:Rd.KEY_SYSTEM_ERROR,details:Ld.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:e,fatal:!0},e.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(t=>this.updateKeySession(e,new Uint8Array(t)).catch(t=>{throw new Gy({type:Rd.KEY_SYSTEM_ERROR,details:Ld.KEY_SYSTEM_SESSION_UPDATE_FAILED,decryptdata:e.decryptdata,error:t,fatal:!1},t.message)}))}unpackPlayReadyKeyMessage(e,t){const r=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!r.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const n=(new DOMParser).parseFromString(r,"application/xml"),i=n.querySelectorAll("HttpHeader");if(i.length>0){let t;for(let r=0,n=i.length;r<n;r++){var s,a;t=i[r];const n=null==(s=t.querySelector("name"))?void 0:s.textContent,o=null==(a=t.querySelector("value"))?void 0:a.textContent;n&&o&&e.setRequestHeader(n,o)}}const o=n.querySelector("Challenge"),l=null==o?void 0:o.textContent;if(!l)throw new Error("Cannot find <Challenge> in key message");return jp(atob(l))}setupLicenseXHR(e,t,r,n){const i=this.config.licenseXhrSetup;return i?Promise.resolve().then(()=>{if(!r.decryptdata)throw new Error("Key removed");return i.call(this.hls,e,t,r,n)}).catch(s=>{if(!r.decryptdata)throw s;return e.open("POST",t,!0),i.call(this.hls,e,t,r,n)}).then(r=>{e.readyState||e.open("POST",t,!0);return{xhr:e,licenseChallenge:r||n}}):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:n}))}requestLicense(e,t){const r=this.config.keyLoadPolicy.default;return new Promise((n,i)=>{const s=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${s}`);const a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return i(new Error("invalid state"));if(4===a.readyState)if(200===a.status){this._requestLicenseFailureCount=0;let t=a.response;this.log(`License received ${t instanceof ArrayBuffer?t.byteLength:t}`);const r=this.config.licenseResponseCallback;if(r)try{t=r.call(this.hls,a,s,e)}catch(e){this.error(e)}n(t)}else{const o=r.errorRetry,l=o?o.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>l||a.status>=400&&a.status<500)i(new Gy({type:Rd.KEY_SYSTEM_ERROR,details:Ld.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:e.decryptdata,fatal:!0,networkDetails:a,response:{url:s,data:void 0,code:a.status,text:a.statusText}},`License Request XHR failed (${s}). Status: ${a.status} (${a.statusText})`));else{const r=l-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${r} attempts left`),this.requestLicense(e,t).then(n,i)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=a,this.setupLicenseXHR(a,s,e,t).then(({xhr:t,licenseChallenge:r})=>{e.keySystem==Wp.PLAYREADY&&(r=this.unpackPlayReadyKeyMessage(t,r)),t.send(r)}).catch(i)})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const r=t.media;this.media=r,zg(r,"encrypted",this.onMediaEncrypted),zg(r,"waitingforkey",this.onWaitingForKey);const n=this.mediaResolved;n?n():this.mediaKeys=r.mediaKeys}onMediaDetached(){const e=this.media;e&&(jg(e,"encrypted",this.onMediaEncrypted),jg(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var e;this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},this.bannedKeyIds={};const t=this.mediaResolved;if(t&&t(),!this.mediaKeys&&!this.mediaKeySessions.length)return;const r=this.media,n=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,ig.clearKeyUriToKeyIdMap();const i=n.length;Uy.CDMCleanupPromise=Promise.all(n.map(e=>this.removeSession(e)).concat((null==r||null==(e=r.setMediaKeys(null))?void 0:e.catch(e=>{this.log(`Could not clear media keys: ${e}`),this.hls&&this.hls.trigger(Id.ERROR,{type:Rd.OTHER_ERROR,details:Ld.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${e}`)})}))||Promise.resolve())).catch(e=>{this.log(`Could not close sessions and clear media keys: ${e}`),this.hls&&this.hls.trigger(Id.ERROR,{type:Rd.OTHER_ERROR,details:Ld.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${e}`)})}).then(()=>{i&&this.log("finished closing key sessions and clearing media keys")})}onManifestLoading(){this._clear()}onManifestLoaded(e,{sessionKeys:t}){if(t&&this.config.emeEnabled&&!this.keyFormatPromise){const e=t.reduce((e,t)=>(-1===e.indexOf(t.keyFormat)&&e.push(t.keyFormat),e),[]);this.log(`Selecting key-system from session-keys ${e.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(e)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:r,decryptdata:n}=e;if(t){this.log(`Remove licenses and keys and close session "${t.sessionId}" keyId: ${Jd((null==n?void 0:n.keyId)||[])}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),r&&r.readyState!==XMLHttpRequest.DONE&&r.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const i=this.mediaKeySessions.indexOf(e);i>-1&&this.mediaKeySessions.splice(i,1);const{keyStatusTimeouts:s}=e;s&&Object.keys(s).forEach(e=>self.clearTimeout(s[e]));const{drmSystemOptions:a}=this.config,o=function(e){var t;return!(!e||"persistent-license"!==e.sessionType&&(null==(t=e.sessionTypes)||!t.some(e=>"persistent-license"===e)))}(a)?new Promise((e,r)=>{self.setTimeout(()=>r(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(e).catch(r)}):Promise.resolve();return o.catch(e=>{this.log(`Could not remove session: ${e}`),this.hls&&this.hls.trigger(Id.ERROR,{type:Rd.OTHER_ERROR,details:Ld.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${e}`)})}).then(()=>t.close()).catch(e=>{this.log(`Could not close session: ${e}`),this.hls&&this.hls.trigger(Id.ERROR,{type:Rd.OTHER_ERROR,details:Ld.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${e}`)})})}return Promise.resolve()}}function zy(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(null===e.keyId)throw new Error("keyId is null");return Jd(e.keyId)}function jy(e,t){return e.keyId&&t.mediaKeysSession.keyStatuses.has(e.keyId)?t.mediaKeysSession.keyStatuses.get(e.keyId):e.matches(t.decryptdata)?t.keyStatus:void 0}Uy.CDMCleanupPromise=void 0;class Gy extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}function Hy(e,t){const r="output-restricted"===e,n=r?Ld.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:Ld.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new Gy({type:Rd.KEY_SYSTEM_ERROR,details:n,fatal:!1,decryptdata:t},r?"HDCP level output restricted":`key status changed to "${e}"`)}function Vy(e,t){let r;try{r=new Event("addtrack")}catch(e){r=document.createEvent("Event"),r.initEvent("addtrack",!1,!1)}r.track=e,t.dispatchEvent(r)}function Wy(e,t){const r=e.mode;if("disabled"===r&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error(`addCue is failed for: ${t}`)}catch(r){qd.debug(`[texttrack-utils]: ${r}`);try{const r=new self.TextTrackCue(t.startTime,t.endTime,t.text);r.id=t.id,e.addCue(r)}catch(e){qd.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${e}`)}}"disabled"===r&&(e.mode=r)}function Ky(e,t){const r=e.mode;if("disabled"===r&&(e.mode="hidden"),e.cues)for(let r=e.cues.length;r--;)t&&e.cues[r].removeEventListener("enter",t),e.removeCue(e.cues[r]);"disabled"===r&&(e.mode=r)}function Yy(e,t,r,n){const i=e.mode;if("disabled"===i&&(e.mode="hidden"),e.cues&&e.cues.length>0){const i=function(e,t,r){const n=[],i=function(e,t){if(t<=e[0].startTime)return 0;const r=e.length-1;if(t>e[r].endTime)return-1;let n,i=0,s=r;for(;i<=s;)if(n=Math.floor((s+i)/2),t<e[n].startTime)s=n-1;else{if(!(t>e[n].startTime&&i<r))return n;i=n+1}return e[i].startTime-t<t-e[s].startTime?i:s}(e,t);if(i>-1)for(let s=i,a=e.length;s<a;s++){const i=e[s];if(i.startTime>=t&&i.endTime<=r)n.push(i);else if(i.startTime>r)return n}return n}(e.cues,t,r);for(let t=0;t<i.length;t++)n&&!n(i[t])||e.removeCue(i[t])}"disabled"===i&&(e.mode=i)}function qy(e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];"subtitles"!==n.kind&&"captions"!==n.kind||!n.label||t.push(e[r])}return t}function Xy(e){let t=5381,r=e.length;for(;r;)t=33*t^e.charCodeAt(--r);return(t>>>0).toString()}const Qy=.025;let Zy=function(e){return e[e.Point=0]="Point",e[e.Range=1]="Range",e}({});function Jy(e,t,r){return`${e.identifier}-${r+1}-${Xy(t)}`}class eb{constructor(e,t){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=t,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,null==(e=this.assetListLoader)||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){var t;if(e>0&&e>=this.assetList.length)return!0;const r=this.playoutLimit;if(e<=0||isNaN(r))return!1;if(0===r)return!0;return((null==(t=this.assetList[e])?void 0:t.startOffset)||0)>r}findAssetIndex(e){return this.assetList.indexOf(e)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const e=this.dateRange.startTime;if(this.snapOptions.out){const t=this.dateRange.tagAnchor;if(t)return tb(e,t)}return e}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(0===this.startTime||this.snapOptions.out)return!0;const e=this.dateRange.tagAnchor;if(e){const t=this.dateRange.startTime;return t-tb(t,e)<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=kd(e)?e:this.duration;return this.cumulativeDuration+t}get resumeTime(){const e=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const t=this.resumeAnchor;if(t)return tb(e,t)}return e}get appendInPlace(){return!!this.appendInPlaceStarted||!this.appendInPlaceDisabled&&!(this.cue.once||this.cue.pre||!this.startIsAligned||!(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<Qy))}set appendInPlace(e){this.appendInPlaceStarted?this.resetOnResume=!e:this.appendInPlaceDisabled=!e}get timelineStart(){return null!==this._timelineStart?this._timelineStart:this.startTime}set timelineStart(e){this._timelineStart=e}get duration(){const e=this.playoutLimit;let t;return t=null!==this._duration?this._duration:this.dateRange.duration?this.dateRange.duration:this.dateRange.plannedDuration||0,!isNaN(e)&&e<t&&(t=e),t}set duration(e){this._duration=e}get cue(){return this.dateRange.cue}get timelineOccupancy(){return"RANGE"===this.dateRange.attr["X-TIMELINE-OCCUPIES"]?Zy.Range:Zy.Point}get supplementsPrimary(){return"PRIMARY"===this.dateRange.attr["X-TIMELINE-STYLE"]}get contentMayVary(){return"NO"!==this.dateRange.attr["X-CONTENT-MAY-VARY"]}get assetUrl(){return this.dateRange.attr["X-ASSET-URI"]}get assetListUrl(){return this.dateRange.attr["X-ASSET-LIST"]}get baseUrl(){return this.base.url}get assetListLoaded(){return this.assetList.length>0||null!==this.assetListResponse}toString(){return`["${(e=this).identifier}" ${e.cue.pre?"<pre>":e.cue.post?"<post>":""}${e.timelineStart.toFixed(2)}-${e.resumeTime.toFixed(2)}]`;var e}}function tb(e,t){return e-t.start<t.duration/2&&!(Math.abs(e-(t.start+t.duration))<Qy)?t.start:t.start+t.duration}function rb(e,t,r){const n=new self.URL(e,r);return"data:"!==n.protocol&&n.searchParams.set("_HLS_primary_id",t),n}function nb(e,t){for(;null!=(r=e.assetList[++t])&&r.error;)var r;return t}function ib(e){const t=e.timelineStart,r=e.duration||0;return`["${e.identifier}" ${t.toFixed(2)}-${(t+r).toFixed(2)}]`}class sb{constructor(e,t,r,n){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls&&this.hls.trigger(Id.PLAYOUT_LIMIT_REACHED,{})};const i=this.hls=new e(t);this.interstitial=r,this.assetItem=n;const s=()=>{this.hasDetails=!0};i.once(Id.LEVEL_LOADED,s),i.once(Id.AUDIO_TRACK_LOADED,s),i.once(Id.SUBTITLE_TRACK_LOADED,s),i.on(Id.MEDIA_ATTACHING,(e,{media:t})=>{this.removeMediaListeners(),this.mediaAttached=t;this.interstitial.playoutLimit&&(t.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&i.on(Id.BUFFER_APPENDED,()=>{const e=this.bufferedEnd;this.reachedPlayout(e)&&(this._bufferedEosTime=e,i.trigger(Id.BUFFERED_TO_END,void 0))}))})}get appendInPlace(){return this.interstitial.appendInPlace}loadSource(){const e=this.hls;if(e)if(e.url)e.levels.length&&!e.started&&e.startLoad(-1,!0);else{let t=this.assetItem.uri;try{t=rb(t,e.config.primarySessionId||"").href}catch(e){}e.loadSource(t)}}bufferedInPlaceToEnd(e){var t;if(!this.appendInPlace)return!1;if(null!=(t=this.hls)&&t.bufferedToEnd)return!0;if(!e)return!1;const r=Math.min(this._bufferedEosTime||1/0,this.duration),n=this.timelineOffset,i=kp.bufferInfo(e,n,0);return this.getAssetTime(i.end)>=r-.02}reachedPlayout(e){const t=this.interstitial.playoutLimit;return this.startOffset+e>=t}get destroyed(){var e;return!(null!=(e=this.hls)&&e.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var e;return(null==(e=this.hls)?void 0:e.media)||null}get bufferedEnd(){const e=this.media||this.mediaAttached;if(!e)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const t=kp.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}get currentTime(){const e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){const e=this.assetItem.duration;if(!e)return 0;const t=this.interstitial.playoutLimit;if(t){const r=t-this.startOffset;if(r>0&&r<e)return r}return e}get remaining(){const e=this.duration;return e?Math.max(0,e-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var e;return(null==(e=this.hls)?void 0:e.config.timelineOffset)||0}set timelineOffset(e){const t=this.timelineOffset;if(e!==t){const r=e-t;if(Math.abs(r)>1/9e4&&this.hls){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const t=this.timelineOffset,r=this.duration;return Math.min(Math.max(0,e-t),r)}removeMediaListeners(){const e=this.mediaAttached;e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){var e;this.mediaAttached&&(null!=(e=this.hls)&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd))}destroy(){this.removeMediaListeners(),this.hls&&this.hls.destroy(),this.hls=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){var t;this.loadSource(),null==(t=this.hls)||t.attachMedia(e)}detachMedia(){var e;this.removeMediaListeners(),this.mediaAttached=null,null==(e=this.hls)||e.detachMedia()}resumeBuffering(){var e;null==(e=this.hls)||e.resumeBuffering()}pauseBuffering(){var e;null==(e=this.hls)||e.pauseBuffering()}transferMedia(){var e;return this.bufferSnapShot(),(null==(e=this.hls)?void 0:e.transferMedia())||null}resetDetails(){const e=this.hls;if(e&&this.hasDetails){e.stopLoad();const t=e=>delete e.details;e.levels.forEach(t),e.allAudioTracks.forEach(t),e.allSubtitleTracks.forEach(t),this.hasDetails=!1}}on(e,t,r){var n;null==(n=this.hls)||n.on(e,t)}once(e,t,r){var n;null==(n=this.hls)||n.once(e,t)}off(e,t,r){var n;null==(n=this.hls)||n.off(e,t)}toString(){var e;return`HlsAssetPlayer: ${ib(this.assetItem)} ${null==(e=this.hls)?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}class ab extends Gd{constructor(e,t){super("interstitials-sched",t),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=e}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach(e=>e.reset()),this.events=this.items=null}resetErrorsInRange(e,t){return this.events?this.events.reduce((r,n)=>e<=n.startOffset&&t>n.startOffset?(delete n.error,r+1):r,0):0}get duration(){const e=this.items;return e?e[e.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(e){return e&&this.eventMap[e]||null}hasEvent(e){return e in this.eventMap}findItemIndex(e,t){if(e.event)return this.findEventIndex(e.event.identifier);let r=-1;e.nextEvent?r=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(r=this.findEventIndex(e.previousEvent.identifier)+1);const n=this.items;if(n)for(n[r]||(void 0===t&&(t=e.start),r=this.findItemIndexAtTime(t));r>=0&&null!=(i=n[r])&&i.event;){var i;r--}return r}findItemIndexAtTime(e,t){const r=this.items;if(r)for(let n=0;n<r.length;n++){let i=r[n];if(t&&"primary"!==t&&(i=i[t]),e===i.start||e>i.start&&e<i.end)return n}return-1}findJumpRestrictedIndex(e,t){const r=this.items;if(r)for(let n=e;n<=t&&r[n];n++){const e=r[n].event;if(null!=e&&e.restrictions.jump&&!e.appendInPlace)return n}return-1}findEventIndex(e){const t=this.items;if(t)for(let n=t.length;n--;){var r;if((null==(r=t[n].event)?void 0:r.identifier)===e)return n}return-1}findAssetIndex(e,t){const r=e.assetList,n=r.length;if(n>1)for(let e=0;e<n;e++){const i=r[e];if(!i.error){const r=i.timelineStart;if(t===r||t>r&&(t<r+(i.duration||0)||e===n-1))return e}}return 0}get assetIdAtEnd(){var e;const t=null==(e=this.items)||null==(e=e[this.length-1])?void 0:e.event;if(t){const e=t.assetList,r=e[e.length-1];if(r)return r.identifier}return null}parseInterstitialDateRanges(e,t){const r=e.main.details,{dateRanges:n}=r,i=this.events,s=this.parseDateRanges(n,{url:r.url},t),a=Object.keys(n),o=i?i.filter(e=>!a.includes(e.identifier)):[];s.length&&s.sort((e,t)=>{const r=e.cue.pre,n=e.cue.post,i=t.cue.pre,s=t.cue.post;if(r&&!i)return-1;if(i&&!r)return 1;if(n&&!s)return 1;if(s&&!n)return-1;if(!(r||i||n||s)){const r=e.startTime,n=t.startTime;if(r!==n)return r-n}return e.dateRange.tagOrder-t.dateRange.tagOrder}),this.events=s,o.forEach(e=>{this.removeEvent(e)}),this.updateSchedule(e,o)}updateSchedule(e,t=[],r=!1){const n=this.events||[];if(n.length||t.length||this.length<2){const i=this.items,s=this.parseSchedule(n,e),a=r||t.length||(null==i?void 0:i.length)!==s.length||s.some((e,t)=>Math.abs(e.playout.start-i[t].playout.start)>.005||Math.abs(e.playout.end-i[t].playout.end)>.005);a&&(this.items=s,this.onScheduleUpdate(t,i))}}parseDateRanges(e,t,r){const n=[],i=Object.keys(e);for(let s=0;s<i.length;s++){const a=i[s],o=e[a];if(o.isInterstitial){let e=this.eventMap[a];e?e.setDateRange(o):(e=new eb(o,t),this.eventMap[a]=e,!1===r&&(e.appendInPlace=r)),n.push(e)}}return n}parseSchedule(e,t){const r=[],n=t.main.details,i=n.live?1/0:n.edge;let s=0;if((e=e.filter(e=>!(e.error||e.cue.once&&e.hasPlayed))).length){this.resolveOffsets(e,t);let n=0,o=0;if(e.forEach((t,a)=>{const l=t.cue.pre,u=t.cue.post,c=e[a-1]||null,d=t.appendInPlace,h=u?i:t.startOffset,f=t.duration,p=t.timelineOccupancy===Zy.Range?f:0,g=t.resumptionOffset,m=(null==c?void 0:c.startTime)===h,v=h+t.cumulativeDuration;let y=d?v+f:h+g;if(l||!u&&h<=0){const e=o;o+=p,t.timelineStart=v;const n=s;s+=f,r.push({event:t,start:v,end:y,playout:{start:n,end:s},integrated:{start:e,end:o}})}else{if(!(h<=i))return;{if(!m){const i=h-n;if(i>.033){const l=n,u=o;o+=i;const c=s;s+=i;const d={previousEvent:e[a-1]||null,nextEvent:t,start:l,end:l+i,playout:{start:c,end:s},integrated:{start:u,end:o}};r.push(d)}else i>0&&c&&(c.cumulativeDuration+=i,r[r.length-1].end=h)}u&&(y=v),t.timelineStart=v;const i=o;o+=p;const l=s;s+=f,r.push({event:t,start:v,end:y,playout:{start:l,end:s},integrated:{start:i,end:o}})}}const b=t.resumeTime;n=u||b>i?i:b}),n<i){var a;const e=n,t=o,l=i-n;o+=l;const u=s;s+=l,r.push({previousEvent:(null==(a=r[r.length-1])?void 0:a.event)||null,nextEvent:null,start:n,end:e+l,playout:{start:u,end:s},integrated:{start:t,end:o}})}this.setDurations(i,s,o)}else{const e=0;r.push({previousEvent:null,nextEvent:null,start:e,end:i,playout:{start:e,end:i},integrated:{start:e,end:i}}),this.setDurations(i,i,i)}return r}setDurations(e,t,r){this.durations={primary:e,playout:t,integrated:r}}resolveOffsets(e,t){const r=t.main.details,n=r.live?1/0:r.edge;let i=0,s=-1;e.forEach((a,o)=>{const l=a.cue.pre,u=a.cue.post,c=l?0:u?n:a.startTime;this.updateAssetDurations(a);if(s===c?a.cumulativeDuration=i:(i=0,s=c),!u&&a.snapOptions.in&&(a.resumeAnchor=Of(null,r.fragments,a.startOffset+a.resumptionOffset,0,0)||void 0),a.appendInPlace&&!a.appendInPlaceStarted){this.primaryCanResumeInPlaceAt(a,t)||(a.appendInPlace=!1)}if(!a.appendInPlace&&o+1<e.length){e[o+1].startTime-e[o].resumeTime<.033&&(e[o+1].appendInPlace=!1,e[o+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${a}`))}const d=kd(a.resumeOffset)?a.resumeOffset:a.duration;i+=d})}primaryCanResumeInPlaceAt(e,t){const r=e.resumeTime,n=e.startTime+e.resumptionOffset;if(Math.abs(r-n)>Qy)return this.log(`"${e.identifier}" resumption ${r} not aligned with estimated timeline end ${n}`),!1;return!Object.keys(t).some(n=>{const i=t[n].details,s=i.edge;if(r>=s)return this.log(`"${e.identifier}" resumption ${r} past ${n} playlist end ${s}`),!1;const a=Of(null,i.fragments,r);if(!a)return this.log(`"${e.identifier}" resumption ${r} does not align with any fragments in ${n} playlist (${i.fragStart}-${i.fragmentEnd})`),!0;const o="audio"===n?.175:0;return!(Math.abs(a.start-r)<Qy+o||Math.abs(a.end-r)<Qy+o)&&(this.log(`"${e.identifier}" resumption ${r} not aligned with ${n} fragment bounds (${a.start}-${a.end} sn: ${a.sn} cc: ${a.cc})`),!0)})}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let r=0,n=!1,i=!1;for(let s=0;s<e.assetList.length;s++){const a=e.assetList[s],o=t+r;a.startOffset=r,a.timelineStart=o,n||(n=null===a.duration),i||(i=!!a.error);r+=a.error?0:a.duration||0}e.duration=n&&!i?Math.max(r,e.duration):r}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function ob(e){return`[${e.event?'"'+e.event.identifier+'"':"primary"}: ${e.start.toFixed(2)}-${e.end.toFixed(2)}]`}class lb{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const r=e.assetListUrl;let n;try{n=rb(r,this.hls.sessionId,e.baseUrl)}catch(t){const n=this.assignAssetListError(e,Ld.ASSET_LIST_LOAD_ERROR,t,r);return void this.hls.trigger(Id.ERROR,n)}t&&"data:"!==n.protocol&&n.searchParams.set("_HLS_start_offset",""+t);const i=this.hls.config,s=new(0,i.loader)(i),a={responseType:"json",url:n.href},o=i.interstitialAssetListLoadPolicy.default,l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(t,r,n,i)=>{const s=t.data,a=null==s?void 0:s.ASSETS;if(!Array.isArray(a)){const t=this.assignAssetListError(e,Ld.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),n.url,r,i);return void this.hls.trigger(Id.ERROR,t)}e.assetListResponse=s,this.hls.trigger(Id.ASSET_LIST_LOADED,{event:e,assetListResponse:s,networkDetails:i})},onError:(t,r,n,i)=>{const s=this.assignAssetListError(e,Ld.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${t.code} ${t.text} (${r.url})`),r.url,i,n);this.hls.trigger(Id.ERROR,s)},onTimeout:(t,r,n)=>{const i=this.assignAssetListError(e,Ld.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${r.url})`),r.url,t,n);this.hls.trigger(Id.ERROR,i)}};return s.load(a,l,u),this.hls.trigger(Id.ASSET_LIST_LOADING,{event:e}),s}assignAssetListError(e,t,r,n,i,s){return e.error=r,{type:Rd.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:n,error:r,networkDetails:s,stats:i}}}function ub(e){var t;null==e||null==(t=e.play())||t.catch(()=>{})}function cb(e,t){return`[${e}] Advancing timeline position to ${t}`}class db{constructor(e){this.buffered=void 0;const t=(t,r,n)=>{if((r>>>=0)>n-1)throw new DOMException(`Failed to execute '${t}' on 'TimeRanges': The index provided (${r}) is greater than the maximum bound (${n})`);return e[r][t]};this.buffered={get length(){return e.length},end:r=>t("end",r,e.length),start:r=>t("start",r,e.length)}}}const hb={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},fb=e=>String.fromCharCode(hb[e]||e),pb=15,gb=100,mb={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},vb={17:2,18:4,21:6,22:8,23:10,19:13,20:15},yb={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},bb={25:2,26:4,29:6,30:8,31:10,27:13,28:15},wb=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Eb{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const r="function"==typeof t?t():t;qd.log(`${this.time} [${e}] ${r}`)}}}const Sb=function(e){const t=[];for(let r=0;r<e.length;r++)t.push(e[r].toString(16));return t};class Tb{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let r=0;r<t.length;r++){const n=t[r];e.hasOwnProperty(n)&&(this[n]=e[n])}}isDefault(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class kb{constructor(){this.uchar=" ",this.penState=new Tb}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return" "===this.uchar&&this.penState.isDefault()}}class xb{constructor(e){this.chars=[],this.pos=0,this.currPenState=new Tb,this.cueStartTime=null,this.logger=void 0;for(let e=0;e<gb;e++)this.chars.push(new kb);this.logger=e}equals(e){for(let t=0;t<gb;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<gb;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<gb;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>gb&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=gb)}moveCursor(e){const t=this.pos+e;if(e>1)for(let e=this.pos+1;e<t+1;e++)this.chars[e].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=fb(e);this.pos>=gb?this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))}clearFromPos(e){let t;for(t=e;t<gb;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let r=0;r<gb;r++){const n=this.chars[r].uchar;" "!==n&&(t=!1),e.push(n)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e);this.chars[this.pos].setPenState(this.currPenState)}}class Ab{constructor(e){this.rows=[],this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<pb;t++)this.rows.push(new xb(e));this.logger=e}reset(){for(let e=0;e<pb;e++)this.rows[e].clear();this.currRow=14}equals(e){let t=!0;for(let r=0;r<pb;r++)if(!this.rows[r].equals(e.rows[r])){t=!1;break}return t}copy(e){for(let t=0;t<pb;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<pb;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e);this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,()=>"pacData = "+xf(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let e=0;e<pb;e++)this.rows[e].clear();const e=this.currRow+1-this.nrRollUpRows,r=this.lastOutputScreen;if(r){const n=r.rows[e].cueStartTime,i=this.logger.time;if(null!==n&&null!==i&&n<i)for(let n=0;n<this.nrRollUpRows;n++)this.rows[t-this.nrRollUpRows+n+1].copy(r.rows[e+n])}}this.currRow=t;const r=this.rows[this.currRow];if(null!==e.indent){const t=e.indent,n=Math.max(t-1,0);r.setCursor(e.indent),e.color=r.chars[n].penState.foreground}const n={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(n)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+xf(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(null===this.nrRollUpRows)return void this.logger.log(3,"roll_up but nrRollUpRows not set yet");this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let r="",n=-1;for(let r=0;r<pb;r++){const i=this.rows[r].getTextString();i&&(n=r+1,e?t.push("Row "+n+": '"+i+"'"):t.push(i.trim()))}return t.length>0&&(r=e?"["+t.join(" | ")+"]":t.join("\n")),r}getTextAndFormat(){return this.rows}}class Rb{constructor(e,t,r){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new Ab(r),this.nonDisplayedMemory=new Ab(r),this.lastOutputScreen=new Ab(r),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=r}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>t+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{const r=Math.floor(e/2)-16,n=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=n[r]}this.logger.log(2,"MIDROW: "+xf(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class Lb{constructor(e,t,r){this.channels=void 0,this.currentChannel=0,this.cmdHistory={a:null,b:null},this.logger=void 0;const n=this.logger=new Eb;this.channels=[null,new Rb(e,t,n),new Rb(e+1,r,n)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let e=0;e<t.length;e+=2){const r=127&t[e],n=127&t[e+1];let i=!1,s=null;if(0===r&&0===n)continue;this.logger.log(3,()=>"["+Sb([t[e],t[e+1]])+"] -> ("+Sb([r,n])+")");const a=this.cmdHistory;if(r>=16&&r<=31){if(Cb(r,n,a)){Ib(null,null,a),this.logger.log(3,()=>"Repeated command ("+Sb([r,n])+") is dropped");continue}Ib(r,n,this.cmdHistory),i=this.parseCmd(r,n),i||(i=this.parseMidrow(r,n)),i||(i=this.parsePAC(r,n)),i||(i=this.parseBackgroundAttributes(r,n))}else Ib(null,null,a);if(!i&&(s=this.parseChars(r,n),s)){const e=this.currentChannel;if(e&&e>0){this.channels[e].insertChars(s)}else this.logger.log(2,"No channel found yet. TEXT-MODE?")}i||s||this.logger.log(2,()=>"Couldn't parse cleaned data "+Sb([r,n])+" orig: "+Sb([t[e],t[e+1]]))}}parseCmd(e,t){if(!((20===e||28===e||21===e||29===e)&&t>=32&&t<=47)&&!((23===e||31===e)&&t>=33&&t<=35))return!1;const r=20===e||21===e||23===e?1:2,n=this.channels[r];return 20===e||21===e||28===e||29===e?32===t?n.ccRCL():33===t?n.ccBS():34===t?n.ccAOF():35===t?n.ccAON():36===t?n.ccDER():37===t?n.ccRU(2):38===t?n.ccRU(3):39===t?n.ccRU(4):40===t?n.ccFON():41===t?n.ccRDC():42===t?n.ccTR():43===t?n.ccRTD():44===t?n.ccEDM():45===t?n.ccCR():46===t?n.ccENM():47===t&&n.ccEOC():n.ccTO(t-32),this.currentChannel=r,!0}parseMidrow(e,t){let r=0;if((17===e||25===e)&&t>=32&&t<=47){if(r=17===e?1:2,r!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const n=this.channels[r];return!!n&&(n.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+Sb([e,t])+")"),!0)}return!1}parsePAC(e,t){let r;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127)&&!((16===e||24===e)&&t>=64&&t<=95))return!1;const n=e<=23?1:2;r=t>=64&&t<=95?1===n?mb[e]:yb[e]:1===n?vb[e]:bb[e];const i=this.channels[n];return!!i&&(i.setPAC(this.interpretPAC(r,t)),this.currentChannel=n,!0)}interpretPAC(e,t){let r;const n={color:null,italics:!1,indent:null,underline:!1,row:e};return r=t>95?t-96:t-64,n.underline=!(1&~r),r<=13?n.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(n.italics=!0,n.color="white"):n.indent=4*Math.floor((r-16)/2),n}parseChars(e,t){let r,n=null,i=null;if(e>=25?(r=2,i=e-8):(r=1,i=e),i>=17&&i<=19){let e;e=17===i?t+80:18===i?t+112:t+144,this.logger.log(2,()=>"Special char '"+fb(e)+"' in channel "+r),n=[e]}else e>=32&&e<=127&&(n=0===t?[e]:[e,t]);return n&&this.logger.log(3,()=>"Char codes = "+Sb(n).join(",")),n}parseBackgroundAttributes(e,t){if(!((16===e||24===e)&&t>=32&&t<=47)&&!((23===e||31===e)&&t>=45&&t<=47))return!1;let r;const n={};16===e||24===e?(r=Math.floor((t-32)/2),n.background=wb[r],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0));const i=e<=23?1:2;return this.channels[i].setBkgData(n),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}Ib(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const r=this.channels[t];r&&r.cueSplitAtTime(e)}}}function Ib(e,t,r){r.a=e,r.b=t}function Cb(e,t,r){return r.a===e&&r.b===t}var Pb=function(){if(null!=Vp&&Vp.VTTCue)return self.VTTCue;const e=["","lr","rl"],t=["start","middle","end","left","right"];function r(e,t){if("string"!=typeof t)return!1;if(!Array.isArray(e))return!1;const r=t.toLowerCase();return!!~e.indexOf(r)&&r}function n(e){return r(t,e)}function i(e,...t){let r=1;for(;r<arguments.length;r++){const t=arguments[r];for(const r in t)e[r]=t[r]}return e}function s(t,s,a){const o=this,l={enumerable:!0};o.hasBeenReset=!1;let u="",c=!1,d=t,h=s,f=a,p=null,g="",m=!0,v="auto",y="start",b=50,w="middle",E=50,S="middle";Object.defineProperty(o,"id",i({},l,{get:function(){return u},set:function(e){u=""+e}})),Object.defineProperty(o,"pauseOnExit",i({},l,{get:function(){return c},set:function(e){c=!!e}})),Object.defineProperty(o,"startTime",i({},l,{get:function(){return d},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");d=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"endTime",i({},l,{get:function(){return h},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");h=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"text",i({},l,{get:function(){return f},set:function(e){f=""+e,this.hasBeenReset=!0}})),Object.defineProperty(o,"region",i({},l,{get:function(){return p},set:function(e){p=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"vertical",i({},l,{get:function(){return g},set:function(t){const n=function(t){return r(e,t)}(t);if(!1===n)throw new SyntaxError("An invalid or illegal string was specified.");g=n,this.hasBeenReset=!0}})),Object.defineProperty(o,"snapToLines",i({},l,{get:function(){return m},set:function(e){m=!!e,this.hasBeenReset=!0}})),Object.defineProperty(o,"line",i({},l,{get:function(){return v},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("An invalid number or illegal string was specified.");v=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"lineAlign",i({},l,{get:function(){return y},set:function(e){const t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");y=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"position",i({},l,{get:function(){return b},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",i({},l,{get:function(){return w},set:function(e){const t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");w=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",i({},l,{get:function(){return E},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");E=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",i({},l,{get:function(){return S},set:function(e){const t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");S=t,this.hasBeenReset=!0}})),o.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class Db{decode(e,t){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function _b(e){function t(e,t,r,n){return 3600*(0|e)+60*(0|t)+(0|r)+parseFloat(n||0)}const r=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return r?parseFloat(r[2])>59?t(r[2],r[3],0,r[4]):t(r[1],r[2],r[3],r[4]):null}class Mb{constructor(){this.values=Object.create(null)}set(e,t){this.get(e)||""===t||(this.values[e]=t)}get(e,t,r){return r?this.has(e)?this.values[e]:t[r]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,r){for(let n=0;n<r.length;++n)if(t===r[n]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const r=parseFloat(t);if(r>=0&&r<=100)return this.set(e,r),!0}return!1}}function Ob(e,t,r,n){const i=n?e.split(n):[e];for(const e in i){if("string"!=typeof i[e])continue;const n=i[e].split(r);if(2!==n.length)continue;t(n[0],n[1])}}const Nb=new Pb(0,0,""),Fb="middle"===Nb.align?"middle":"center";function $b(e,t,r){const n=e;function i(){const t=_b(e);if(null===t)throw new Error("Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function s(){e=e.replace(/^\s+/,"")}if(s(),t.startTime=i(),s(),"--\x3e"!==e.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.slice(3),s(),t.endTime=i(),s(),function(e,t){const n=new Mb;Ob(e,function(e,t){let i;switch(e){case"region":for(let i=r.length-1;i>=0;i--)if(r[i].id===t){n.set(e,r[i].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":i=t.split(","),n.integer(e,i[0]),n.percent(e,i[0])&&n.set("snapToLines",!1),n.alt(e,i[0],["auto"]),2===i.length&&n.alt("lineAlign",i[1],["start",Fb,"end"]);break;case"position":i=t.split(","),n.percent(e,i[0]),2===i.length&&n.alt("positionAlign",i[1],["start",Fb,"end","line-left","line-right","auto"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start",Fb,"end","left","right"])}},/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");let i=n.get("line","auto");"auto"===i&&-1===Nb.line&&(i=-1),t.line=i,t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100),t.align=n.get("align",Fb);let s=n.get("position","auto");"auto"===s&&50===Nb.position&&(s="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=s}(e,t)}function Bb(e){return e.replace(/<br(?: \/)?>/gi,"\n")}class Ub{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Db,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;function r(){let e=t.buffer,r=0;for(e=Bb(e);r<e.length&&"\r"!==e[r]&&"\n"!==e[r];)++r;const n=e.slice(0,r);return"\r"===e[r]&&++r,"\n"===e[r]&&++r,t.buffer=e.slice(r),n}function n(e){Ob(e,function(e,t){},/:/)}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{let e="";if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;e=r();const n=e.match(/^()?WEBVTT([ \t].*)?$/);if(null==n||!n[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let i=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(i?i=!1:e=r(),t.state){case"HEADER":/:/.test(e)?n(e):e||(t.state="ID");continue;case"NOTE":e||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(e)){t.state="NOTE";break}if(!e)continue;if(t.cue=new Pb(0,0,""),t.state="CUE",-1===e.indexOf("--\x3e")){t.cue.id=e;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{$b(e,t.cue,t.regionList)}catch(e){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const r=-1!==e.indexOf("--\x3e");if(!e||r&&(i=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(null===t.cue)continue;t.cue.text&&(t.cue.text+="\n"),t.cue.text+=e}continue;case"BADCUE":e||(t.state="ID")}}}catch(e){"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state||"BADWEBVTT"===e.state)throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const zb=/\r\n|\n\r|\n|\r/g,jb=function(e,t,r=0){return e.slice(r,r+t.length)===t};function Gb(e,t,r){return Xy(e.toString())+Xy(t.toString())+Xy(r)}function Hb(e,t,r,n,i,s,a){const o=new Ub,l=Zd(new Uint8Array(e)).trim().replace(zb,"\n").split("\n"),u=[],c=t?function(e,t=1){return fv(e,9e4,1/t)}(t.baseTime,t.timescale):0;let d,h="00:00.000",f=0,p=0,g=!0;o.oncue=function(e){const s=r[n];let a=r.ccOffset;const o=(f-c)/9e4;if(null!=s&&s.new&&(void 0!==p?a=r.ccOffset=s.start:function(e,t,r){let n=e[t],i=e[n.prevCC];if(!i||!i.new&&n.new)return e.ccOffset=e.presentationOffset=n.start,void(n.new=!1);for(;null!=(s=i)&&s.new;){var s;e.ccOffset+=n.start-i.start,n.new=!1,n=i,i=e[n.prevCC]}e.presentationOffset=r}(r,n,o)),o){if(!t)return void(d=new Error("Missing initPTS for VTT MPEGTS"));a=o-r.presentationOffset}const l=e.endTime-e.startTime,h=Ev(9e4*(e.startTime+a-p),9e4*i)/9e4;e.startTime=Math.max(h,0),e.endTime=Math.max(h+l,0);const g=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(g)),e.id||(e.id=Gb(e.startTime,e.endTime,g)),e.endTime>0&&u.push(e)},o.onparsingerror=function(e){d=e},o.onflush=function(){d?a(d):s(u)},l.forEach(e=>{if(g){if(jb(e,"X-TIMESTAMP-MAP=")){g=!1,e.slice(16).split(",").forEach(e=>{jb(e,"LOCAL:")?h=e.slice(6):jb(e,"MPEGTS:")&&(f=parseInt(e.slice(7)))});try{p=function(e){let t=parseInt(e.slice(-3));const r=parseInt(e.slice(-6,-4)),n=parseInt(e.slice(-9,-7)),i=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!(kd(t)&&kd(r)&&kd(n)&&kd(i)))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*r,t+=6e4*n,t+=36e5*i,t}(h)/1e3}catch(e){d=e}return}""===e&&(g=!1)}o.parse(e+"\n")}),o.flush()}const Vb="stpp.ttml.im1t",Wb=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Kb=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,Yb={left:"start",center:"center",right:"end",start:"start",end:"end"};function qb(e,t,r,n){const i=Rh(new Uint8Array(e),["mdat"]);if(0===i.length)return void n(new Error("Could not parse IMSC1 mdat"));const s=i.map(e=>Zd(e)),a=function(e,t,r=1,n=!1){return fv(e,t,1/r,n)}(t.baseTime,1,t.timescale);try{s.forEach(e=>r(function(e,t){const r=(new DOMParser).parseFromString(e,"text/xml"),n=r.getElementsByTagName("tt")[0];if(!n)throw new Error("Invalid ttml");const i={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},s=Object.keys(i).reduce((e,t)=>(e[t]=n.getAttribute(`ttp:${t}`)||i[t],e),{}),a="preserve"!==n.getAttribute("xml:space"),o=Qb(Xb(n,"styling","style")),l=Qb(Xb(n,"layout","region")),u=Xb(n,"body","[begin]");return[].map.call(u,e=>{const r=Zb(e,a);if(!r||!e.hasAttribute("begin"))return null;const n=tw(e.getAttribute("begin"),s),i=tw(e.getAttribute("dur"),s);let u=tw(e.getAttribute("end"),s);if(null===n)throw ew(e);if(null===u){if(null===i)throw ew(e);u=n+i}const c=new Pb(n-t,u-t,r);c.id=Gb(c.startTime,c.endTime,c.text);const d=function(e,t,r){const n="http://www.w3.org/ns/ttml#styling";let i=null;const s=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],a=null!=e&&e.hasAttribute("style")?e.getAttribute("style"):null;a&&r.hasOwnProperty(a)&&(i=r[a]);return s.reduce((r,s)=>{const a=Jb(t,n,s)||Jb(e,n,s)||Jb(i,n,s);return a&&(r[s]=a),r},{})}(l[e.getAttribute("region")],o[e.getAttribute("style")],o),{textAlign:h}=d;if(h){const e=Yb[h];e&&(c.lineAlign=e),c.align=h}return Ud(c,d),c}).filter(e=>null!==e)}(e,a)))}catch(e){n(e)}}function Xb(e,t,r){const n=e.getElementsByTagName(t)[0];return n?[].slice.call(n.querySelectorAll(r)):[]}function Qb(e){return e.reduce((e,t)=>{const r=t.getAttribute("xml:id");return r&&(e[r]=t),e},{})}function Zb(e,t){return[].slice.call(e.childNodes).reduce((e,r,n)=>{var i;return"br"===r.nodeName&&n?e+"\n":null!=(i=r.childNodes)&&i.length?Zb(r,t):t?e+r.textContent.trim().replace(/\s+/g," "):e+r.textContent},"")}function Jb(e,t,r){return e&&e.hasAttributeNS(t,r)?e.getAttributeNS(t,r):null}function ew(e){return new Error(`Could not parse ttml timestamp ${e}`)}function tw(e,t){if(!e)return null;let r=_b(e);return null===r&&(Wb.test(e)?r=function(e,t){const r=Wb.exec(e),n=(0|r[4])+(0|r[5])/t.subFrameRate;return 3600*(0|r[1])+60*(0|r[2])+(0|r[3])+n/t.frameRate}(e,t):Kb.test(e)&&(r=function(e,t){const r=Kb.exec(e),n=Number(r[1]);switch(r[2]){case"h":return 3600*n;case"m":return 60*n;case"ms":return 1e3*n;case"f":return n/t.frameRate;case"t":return n/t.tickRate}return n}(e,t))),r}class rw{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,r){(null===this.startTime||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}function nw(e){return e.characteristics&&/transcribes-spoken-dialog/gi.test(e.characteristics)&&/describes-music-and-sound/gi.test(e.characteristics)?"captions":"subtitles"}function iw(e,t){return!!e&&e.kind===nw(t)&&Fv(t,e)}function sw(e,t,r,n){return Math.min(t,n)-Math.max(e,r)}const aw=/\s/,ow={newCue(e,t,r,n){const i=[];let s,a,o,l,u;const c=self.VTTCue||self.TextTrackCue;for(let h=0;h<n.rows.length;h++)if(s=n.rows[h],o=!0,l=0,u="",!s.isEmpty()){var d;for(let e=0;e<s.chars.length;e++)aw.test(s.chars[e].uchar)&&o?l++:(u+=s.chars[e].uchar,o=!1);s.cueStartTime=t,t===r&&(r+=1e-4),l>=16?l--:l++;const n=Bb(u.trim()),f=Gb(t,r,n);null!=e&&null!=(d=e.cues)&&d.getCueById(f)||(a=new c(t,r,n),a.id=f,a.line=h+1,a.align="left",a.position=10+Math.min(80,10*Math.floor(8*l/32)),i.push(a))}return e&&i.length&&(i.sort((e,t)=>"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line),i.forEach(t=>Wy(e,t))),i}};const lw=/(\d+)-(\d+)\/(\d+)/;class uw{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||cw,this.controller=new self.AbortController,this.stats=new ch}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,r){const n=this.stats;if(n.loading.start)throw new Error("Loader can only be used once.");n.loading.start=self.performance.now();const i=function(e,t){const r={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(Ud({},e.headers))};e.rangeEnd&&r.headers.set("Range","bytes="+e.rangeStart+"-"+String(e.rangeEnd-1));return r}(e,this.controller.signal),s="arraybuffer"===e.responseType,a=s?"byteLength":"length",{maxTimeToFirstByteMs:o,maxLoadTimeMs:l}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=r,this.request=this.fetchSetup(e,i),self.clearTimeout(this.requestTimeout),t.timeout=o&&kd(o)?o:l,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(n,e,this.response))},t.timeout);(Iv(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(r=>{var i;this.response=this.loader=r;const a=Math.max(self.performance.now(),n.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=l,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(n,e,this.response))},l-(a-n.loading.start)),!r.ok){const{status:e,statusText:t}=r;throw new dw(t||"fetch, bad network response",e,r)}n.loading.first=a,n.total=function(e){const t=e.get("Content-Range");if(t){const e=function(e){const t=lw.exec(e);if(t)return parseInt(t[2])-parseInt(t[1])+1}(t);if(kd(e))return e}const r=e.get("Content-Length");if(r)return parseInt(r)}(r.headers)||n.total;const o=null==(i=this.callbacks)?void 0:i.onProgress;return o&&kd(t.highWaterMark)?this.loadProgressively(r,n,e,t.highWaterMark,o):s?r.arrayBuffer():"json"===e.responseType?r.json():r.text()}).then(r=>{var i,s;const o=this.response;if(!o)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),n.loading.end=Math.max(self.performance.now(),n.loading.first);const l=r[a];l&&(n.loaded=n.total=l);const u={url:o.url,data:r,code:o.status},c=null==(i=this.callbacks)?void 0:i.onProgress;c&&!kd(t.highWaterMark)&&c(n,e,r,o),null==(s=this.callbacks)||s.onSuccess(u,n,e,o)}).catch(t=>{var r;if(self.clearTimeout(this.requestTimeout),n.aborted)return;const i=t&&t.code||0,s=t?t.message:null;null==(r=this.callbacks)||r.onError({code:i,text:s},e,t?t.details:null,n)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,r,n=0,i){const s=new im,a=e.body.getReader(),o=()=>a.read().then(a=>{if(a.done)return s.dataLength&&i(t,r,s.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const l=a.value,u=l.length;return t.loaded+=u,u<n||s.dataLength?(s.push(l),s.dataLength>=n&&i(t,r,s.flush().buffer,e)):i(t,r,l.buffer,e),o()}).catch(()=>Promise.reject());return o()}}function cw(e,t){return new self.Request(e.url,t)}class dw extends Error{constructor(e,t,r){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=r}}const hw=/^age:\s*[\d.]+\s*$/im;class fw{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new ch,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,r){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=r,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const r=this.loader=new self.XMLHttpRequest,n=this.stats;n.loading.first=0,n.loaded=0,n.aborted=!1;const i=this.xhrSetup;i?Promise.resolve().then(()=>{if(this.loader===r&&!this.stats.aborted)return i(r,t.url)}).catch(e=>{if(this.loader===r&&!this.stats.aborted)return r.open("GET",t.url,!0),i(r,t.url)}).then(()=>{this.loader!==r||this.stats.aborted||this.openAndSendXhr(r,t,e)}).catch(e=>{var i;null==(i=this.callbacks)||i.onError({code:r.status,text:e.message},t,r,n)}):this.openAndSendXhr(r,t,e)}openAndSendXhr(e,t,r){e.readyState||e.open("GET",t.url,!0);const n=t.headers,{maxTimeToFirstByteMs:i,maxLoadTimeMs:s}=r.loadPolicy;if(n)for(const t in n)e.setRequestHeader(t,n[t]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),r.timeout=i&&kd(i)?i:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:r}=this;if(!e||!t)return;const n=t.readyState,i=this.config;if(!r.aborted&&n>=2&&(0===r.loading.first&&(r.loading.first=Math.max(self.performance.now(),r.loading.start),i.timeout!==i.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),i.timeout=i.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.loadPolicy.maxLoadTimeMs-(r.loading.first-r.loading.start)))),4===n)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const n=t.status,l="text"===t.responseType?t.responseText:null;if(n>=200&&n<300){const i=null!=l?l:t.response;if(null!=i){var s,a;r.loading.end=Math.max(self.performance.now(),r.loading.first);const o="arraybuffer"===t.responseType?i.byteLength:i.length;r.loaded=r.total=o,r.bwEstimate=8e3*r.total/(r.loading.end-r.loading.first);const l=null==(s=this.callbacks)?void 0:s.onProgress;l&&l(r,e,i,t);const u={url:t.responseURL,data:i,code:n};return void(null==(a=this.callbacks)||a.onSuccess(u,r,e,t))}}const u=i.loadPolicy.errorRetry;var o;if(Vf(u,r.retry,!1,{url:e.url,data:void 0,code:n}))this.retry(u);else qd.error(`${n} while loading ${e.url}`),null==(o=this.callbacks)||o.onError({code:n,text:t.statusText},e,t,r)}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry;if(Vf(e,this.stats.retry,!0))this.retry(e);else{var t;qd.warn(`timeout while loading ${null==(t=this.context)?void 0:t.url}`);const e=this.callbacks;e&&(this.abortInternal(),e.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:r}=this;this.retryDelay=Gf(e,r.retry),r.retry++,qd.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${null==t?void 0:t.url}, retrying ${r.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&hw.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const pw=jd(jd({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:6e7,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:fw,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:class extends Gd{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=e=>{var t;const{fragCurrent:r,partCurrent:n,hls:i}=this,{autoLevelEnabled:s,media:a}=i;if(!r||!a)return;const o=performance.now(),l=n?n.stats:r.stats,u=n?n.duration:r.duration,c=o-l.loading.start,d=i.minAutoLevel,h=r.level,f=this._nextAutoLevel;if(l.aborted||l.loaded&&l.loaded===l.total||h<=d)return this.clearTimer(),void(this._nextAutoLevel=-1);if(!s)return;const p=f>-1&&f!==h,g=!!e||p;if(!g&&(a.paused||!a.playbackRate||!a.readyState))return;const m=i.mainForwardBufferInfo;if(!g&&null===m)return;const v=this.bwEstimator.getEstimateTTFB(),y=Math.abs(a.playbackRate);if(c<=Math.max(v,u/(2*y)*1e3))return;const b=m?m.len/y:0,w=l.loading.first?l.loading.first-l.loading.start:-1,E=l.loaded&&w>-1,S=this.getBwEstimate(),T=i.levels,k=T[h],x=Math.max(l.loaded,Math.round(u*(r.bitrate||k.averageBitrate)/8));let A=E?c-w:c;A<1&&E&&(A=Math.min(c,8*l.loaded/S));const R=E?1e3*l.loaded/A:0,L=v/1e3,I=R?(x-l.loaded)/R:8*x/S+L;if(I<=b)return;const C=R?8*R:S,P=!0===(null==(t=(null==e?void 0:e.details)||this.hls.latestLevelDetails)?void 0:t.live),D=this.hls.config.abrBandWidthUpFactor;let _,M=Number.POSITIVE_INFINITY;for(_=h-1;_>d;_--){const e=T[_].maxBitrate,t=!T[_].details||P;if(M=this.getTimeToLoadFrag(L,C,u*e,t),M<Math.min(b,u+L))break}if(M>=I)return;if(M>10*u)return;E?this.bwEstimator.sample(c-Math.min(v,w),l.loaded):this.bwEstimator.sampleTTFB(c);const O=T[_].maxBitrate;this.getBwEstimate()*D>O&&this.resetEstimator(O);const N=this.findBestLevel(O,d,_,0,b,1,1);N>-1&&(_=N),this.warn(`Fragment ${r.sn}${n?" part "+n.index:""} of level ${h} is loading too slowly;\n Fragment duration: ${r.duration.toFixed(3)}\n Time to underbuffer: ${b.toFixed(3)} s\n Estimated load time for current fragment: ${I.toFixed(3)} s\n Estimated load time for down switch fragment: ${M.toFixed(3)} s\n TTFB estimate: ${0|w} ms\n Current BW estimate: ${kd(S)?0|S:"Unknown"} bps\n New BW estimate: ${0|this.getBwEstimate()} bps\n Switching to level ${_} @ ${0|O} bps`),i.nextLoadLevel=i.nextAutoLevel=_,this.clearTimer();const F=()=>{if(this.clearTimer(),this.fragCurrent===r&&this.hls.loadLevel===_&&_>0){const e=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${_>0?"and switching down":""}\n Fragment duration: ${r.duration.toFixed(3)} s\n Time to underbuffer: ${e.toFixed(3)} s`),r.abortRequests(),this.fragCurrent=this.partCurrent=null,_>d){let t=this.findBestLevel(this.hls.levels[d].bitrate,d,_,0,e,1,1);-1===t&&(t=d),this.hls.nextLoadLevel=this.hls.nextAutoLevel=t,this.resetEstimator(this.hls.levels[t].bitrate)}}};p||I>2*M?F():this.timer=self.setInterval(F,1e3*M),i.trigger(Id.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,part:n,stats:l})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(this.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new $d(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Id.FRAG_LOADING,this.onFragLoading,this),e.on(Id.FRAG_LOADED,this.onFragLoaded,this),e.on(Id.FRAG_BUFFERED,this.onFragBuffered,this),e.on(Id.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(Id.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Id.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(Id.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(Id.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Id.FRAG_LOADING,this.onFragLoading,this),e.off(Id.FRAG_LOADED,this.onFragLoaded,this),e.off(Id.FRAG_BUFFERED,this.onFragBuffered,this),e.off(Id.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(Id.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Id.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(Id.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(Id.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const r=t.frag;if(!this.ignoreFragment(r)){var n;if(!r.bitrateTest)this.fragCurrent=r,this.partCurrent=null!=(n=t.part)?n:null;this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case Ld.BUFFER_ADD_CODEC_ERROR:case Ld.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case Ld.FRAG_LOAD_TIMEOUT:{const e=t.frag,{fragCurrent:r,partCurrent:n}=this;if(e&&r&&e.sn===r.sn&&e.level===r.level){const t=performance.now(),r=n?n.stats:e.stats,i=t-r.loading.start,s=r.loading.first?r.loading.first-r.loading.start:-1;if(r.loaded&&s>-1){const e=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(i-Math.min(e,s),r.loaded)}else this.bwEstimator.sampleTTFB(i)}break}}}getTimeToLoadFrag(e,t,r,n){return e+r/t+(n?e+this.lastLevelLoadSec:0)}onLevelLoaded(e,t){const r=this.hls.config,{loading:n}=t.stats,i=n.end-n.first;kd(i)&&(this.lastLevelLoadSec=i/1e3),t.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:r}){const n=r?r.stats:t.stats;if(t.type===Md&&this.bwEstimator.sampleTTFB(n.loading.first-n.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const e=r?r.duration:t.duration,i=this.hls.levels[t.level],s=(i.loaded?i.loaded.bytes:0)+n.loaded,a=(i.loaded?i.loaded.duration:0)+e;i.loaded={bytes:s,duration:a},i.realBitrate=Math.round(8*s/a)}if(t.bitrateTest){const e={stats:n,frag:t,part:r,id:t.type};this.onFragBuffered(Id.FRAG_BUFFERED,e),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:r,part:n}=t,i=null!=n&&n.stats.loaded?n.stats:r.stats;if(i.aborted)return;if(this.ignoreFragment(r))return;const s=i.parsing.end-i.loading.start-Math.min(i.loading.first-i.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(s,i.loaded),i.bwEstimate=this.getBwEstimate(),r.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==Md||"initSegment"===e.sn}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,r=this.getBwEstimate(),n=this.hls.config.maxStarvationDelay,i=this.findBestLevel(r,t,e,0,n,1,1);if(i>-1)return i;const s=this.hls.firstLevel,a=Math.min(Math.max(s,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${s} clamped to ${a}`),a}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,t=this.bwEstimator.canEstimate(),r=this.lastLoadedFragLevel>-1;if(!(-1===e||t&&r&&this.nextAutoLevelKey!==this.getAutoLevelKey()))return e;const n=t&&r?this.getNextABRAutoLevel():this.firstAutoLevel;if(-1!==e){const t=this.hls.levels;if(t.length>Math.max(e,n)&&t[e].loadError<=t[n].loadError)return e}return this._nextAutoLevel=n,this.nextAutoLevelKey=this.getAutoLevelKey(),n}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:r}=this;if(r.levels.length<=1)return r.loadLevel;const{maxAutoLevel:n,config:i,minAutoLevel:s}=r,a=t?t.duration:e?e.duration:0,o=this.getBwEstimate(),l=this.getStarvationDelay();let u=i.abrBandWidthFactor,c=i.abrBandWidthUpFactor;if(l){const e=this.findBestLevel(o,s,n,l,0,u,c);if(e>=0)return this.rebufferNotice=-1,e}let d=a?Math.min(a,i.maxStarvationDelay):i.maxStarvationDelay;if(!l){const e=this.bitrateTestDelay;if(e){d=(a?Math.min(a,i.maxLoadingDelay):i.maxLoadingDelay)-e,this.info(`bitrate test took ${Math.round(1e3*e)}ms, set first fragment max fetchDuration to ${Math.round(1e3*d)} ms`),u=c=1}}const h=this.findBestLevel(o,s,n,l,d,u,c);if(this.rebufferNotice!==h&&(this.rebufferNotice=h,this.info(`${l?"rebuffering expected":"buffer is empty"}, optimal quality level ${h}`)),h>-1)return h;const f=r.levels[s],p=r.loadLevelObj;return p&&(null==f?void 0:f.bitrate)<p.bitrate?s:r.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const r=t&&0!==t.playbackRate?Math.abs(t.playbackRate):1,n=e.mainForwardBufferInfo;return(n?n.len:0)/r}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,r,n,i,s,a){var o;const l=n+i,u=this.lastLoadedFragLevel,c=-1===u?this.hls.firstLevel:u,{fragCurrent:d,partCurrent:h}=this,{levels:f,allAudioTracks:p,loadLevel:g,config:m}=this.hls;if(1===f.length)return 0;const v=f[c],y=!(null==(o=this.hls.latestLevelDetails)||!o.live),b=-1===g||-1===u;let w,E="SDR",S=(null==v?void 0:v.frameRate)||0;const{audioPreference:T,videoPreference:k}=m,x=this.audioTracksByGroup||(this.audioTracksByGroup=Rf(p));let A=-1;if(b){if(-1!==this.firstSelection)return this.firstSelection;const n=this.codecTiers||(this.codecTiers=function(e,t,r,n){return e.slice(r,n+1).reduce((e,r,n)=>{if(!r.codecSet)return e;const i=r.audioGroups;let s=e[r.codecSet];s||(e[r.codecSet]=s={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:n,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!i,fragmentError:0}),s.minBitrate=Math.min(s.minBitrate,r.bitrate);const a=Math.min(r.height,r.width);return s.minHeight=Math.min(s.minHeight,a),s.minFramerate=Math.min(s.minFramerate,r.frameRate),s.minIndex=Math.min(s.minIndex,n),s.maxScore=Math.max(s.maxScore,r.score),s.fragmentError+=r.fragmentError,s.videoRanges[r.videoRange]=(s.videoRanges[r.videoRange]||0)+1,i&&i.forEach(e=>{if(!e)return;const r=t.groups[e];r&&(s.hasDefaultAudio=s.hasDefaultAudio||t.hasDefaultAudio?r.hasDefault:r.hasAutoSelect||!t.hasDefaultAudio&&!t.hasAutoSelectAudio,Object.keys(r.channels).forEach(e=>{s.channels[e]=(s.channels[e]||0)+r.channels[e]}))}),e},{})}(f,x,t,r)),i=function(e,t,r,n,i){const s=Object.keys(e),a=null==n?void 0:n.channels,o=null==n?void 0:n.audioCodec,l=null==i?void 0:i.videoCodec,u=a&&2===parseInt(a);let c=!1,d=!1,h=1/0,f=1/0,p=1/0,g=1/0,m=0,v=[];const{preferHDR:y,allowedVideoRanges:b}=kf(t,i);for(let t=s.length;t--;){const r=e[s[t]];c||(c=r.channels[2]>0),h=Math.min(h,r.minHeight),f=Math.min(f,r.minFramerate),p=Math.min(p,r.minBitrate),b.filter(e=>r.videoRanges[e]>0).length>0&&(d=!0)}h=kd(h)?h:0,f=kd(f)?f:0;const w=Math.max(1080,h),E=Math.max(30,f);p=kd(p)?p:r,r=Math.max(p,r),d||(t=void 0);const S=s.length>1;return{codecSet:s.reduce((t,n)=>{const i=e[n];if(n===t)return t;if(v=d?b.filter(e=>i.videoRanges[e]>0):[],S){if(i.minBitrate>r)return Af(n,`min bitrate of ${i.minBitrate} > current estimate of ${r}`),t;if(!i.hasDefaultAudio)return Af(n,"no renditions with default or auto-select sound found"),t;if(o&&n.indexOf(o.substring(0,4))%5!=0)return Af(n,`audio codec preference "${o}" not found`),t;if(a&&!u){if(!i.channels[a])return Af(n,`no renditions with ${a} channel sound found (channels options: ${Object.keys(i.channels)})`),t}else if((!o||u)&&c&&0===i.channels[2])return Af(n,"no renditions with stereo sound found"),t;if(i.minHeight>w)return Af(n,`min resolution of ${i.minHeight} > maximum of ${w}`),t;if(i.minFramerate>E)return Af(n,`min framerate of ${i.minFramerate} > maximum of ${E}`),t;if(!v.some(e=>i.videoRanges[e]>0))return Af(n,`no variants with VIDEO-RANGE of ${xf(v)} found`),t;if(l&&n.indexOf(l.substring(0,4))%5!=0)return Af(n,`video codec preference "${l}" not found`),t;if(i.maxScore<m)return Af(n,`max score of ${i.maxScore} < selected max of ${m}`),t}return t&&(Zh(n)>=Zh(t)||i.fragmentError>e[t].fragmentError)?t:(g=i.minIndex,m=i.maxScore,n)},void 0),videoRanges:v,preferHDR:y,minFramerate:f,minBitrate:p,minIndex:g}}(n,E,e,T,k),{codecSet:s,videoRanges:a,minFramerate:o,minBitrate:l,minIndex:u,preferHDR:c}=i;A=u,w=s,E=c?a[a.length-1]:a[0],S=o,e=Math.max(e,l),this.log(`picked start tier ${xf(i)}`)}else w=null==v?void 0:v.codecSet,E=null==v?void 0:v.videoRange;const R=h?h.duration:d?d.duration:0,L=this.bwEstimator.getEstimateTTFB()/1e3,I=[];for(let o=r;o>=t;o--){var C;const t=f[o],d=o>c;if(!t)continue;if(m.useMediaCapabilities&&!t.supportedResult&&!t.supportedPromise){const r=navigator.mediaCapabilities;"function"==typeof(null==r?void 0:r.decodingInfo)&&df(t,x,E,S,e,T)?(t.supportedPromise=hf(t,x,r,this.supportedCache),t.supportedPromise.then(e=>{if(!this.hls)return;t.supportedResult=e;const r=this.hls.levels,n=r.indexOf(t);e.error?this.warn(`MediaCapabilities decodingInfo error: "${e.error}" for level ${n} ${xf(e)}`):e.supported?e.decodingInfoResults.some(e=>!1===e.smooth||!1===e.powerEfficient)&&this.log(`MediaCapabilities decodingInfo for level ${n} not smooth or powerEfficient: ${xf(e)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${n} ${xf(e)}`),n>-1&&r.length>1&&(this.log(`Removing unsupported level ${n}`),this.hls.removeLevel(n),-1===this.hls.loadLevel&&(this.hls.nextLoadLevel=0)))}).catch(e=>{this.warn(`Error handling MediaCapabilities decodingInfo: ${e}`)})):t.supportedResult=uf}if((w&&t.codecSet!==w||E&&t.videoRange!==E||d&&S>t.frameRate||!d&&S>0&&S<t.frameRate||null!=(C=t.supportedResult)&&null!=(C=C.decodingInfoResults)&&C.some(e=>!1===e.smooth))&&(!b||o!==A)){I.push(o);continue}const p=t.details,v=(h?null==p?void 0:p.partTarget:null==p?void 0:p.averagetargetduration)||R;let k;k=d?a*e:s*e;const P=R&&n>=2*R&&0===i?t.averageBitrate:t.maxBitrate,D=this.getTimeToLoadFrag(L,k,P*v,void 0===p);if(k>=P&&(o===u||0===t.loadError&&0===t.fragmentError)&&(D<=L||!kd(D)||y&&!this.bitrateTestDelay||D<l)){const e=this.forcedAutoLevel;return o===g||-1!==e&&e===g||(I.length&&this.trace(`Skipped level(s) ${I.join(",")} of ${r} max with CODECS and VIDEO-RANGE:"${f[I[0]].codecs}" ${f[I[0]].videoRange}; not compatible with "${w}" ${E}`),this.info(`switch candidate:${c}->${o} adjustedbw(${Math.round(k)})-bitrate=${Math.round(k-P)} ttfb:${L.toFixed(1)} avgDuration:${v.toFixed(1)} maxFetchDuration:${l.toFixed(1)} fetchDuration:${D.toFixed(1)} firstSelection:${b} codecSet:${t.codecSet} videoRange:${t.videoRange} hls.loadLevel:${g}`)),b&&(this.firstSelection=o),o}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:r}=this.hls;return Math.min(Math.max(e,r),t)}},bufferController:class extends Gd{constructor(e,t){var r;super("buffer-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=e=>{var t;this.hls&&"open"===(null==(t=this.mediaSource)?void 0:t.readyState)&&this.hls.pauseBuffering()},this._onStartStreaming=e=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=e=>{const{media:t,mediaSource:r}=this;e&&this.log("Media source opened"),t&&r&&(r.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(Id.MEDIA_ATTACHED,{media:t,mediaSource:r}),null!==this.mediaSource&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:e,_objectUrl:t}=this;e!==t&&this.error(`Media element src was set while attaching MediaSource (${t} > ${e})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=(r=Xd(e.config.preferManagedMediaSource),"undefined"!=typeof self&&r===self.ManagedMediaSource),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:e}=this;e.on(Id.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Id.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Id.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Id.BUFFER_RESET,this.onBufferReset,this),e.on(Id.BUFFER_APPENDING,this.onBufferAppending,this),e.on(Id.BUFFER_CODECS,this.onBufferCodecs,this),e.on(Id.BUFFER_EOS,this.onBufferEos,this),e.on(Id.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(Id.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(Id.FRAG_PARSED,this.onFragParsed,this),e.on(Id.FRAG_CHANGED,this.onFragChanged,this),e.on(Id.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(Id.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Id.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Id.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Id.BUFFER_RESET,this.onBufferReset,this),e.off(Id.BUFFER_APPENDING,this.onBufferAppending,this),e.off(Id.BUFFER_CODECS,this.onBufferCodecs,this),e.off(Id.BUFFER_EOS,this.onBufferEos,this),e.off(Id.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(Id.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(Id.FRAG_PARSED,this.onFragParsed,this),e.off(Id.FRAG_CHANGED,this.onFragChanged,this),e.off(Id.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const r={};if(this.operationQueue){const e=this.isUpdating();e||this.operationQueue.removeBlockers();const t=this.isQueued();(e||t)&&this.warn(`Transfering MediaSource with${t?" operations in queue":""}${e?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const n=this.transferData;return!this.sourceBufferCount&&n&&n.mediaSource===t?Ud(r,n.tracks):this.sourceBuffers.forEach(e=>{const[t]=e;t&&(r[t]=Ud({},this.tracks[t]),this.removeBuffer(t)),e[0]=e[1]=null}),{media:e,mediaSource:t,tracks:r}}initTracks(){this.sourceBuffers=[[null,null],[null,null]],this.tracks={},this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){var r;let n=2;(t.audio&&!t.video||!t.altAudio)&&(n=1),this.bufferCodecEventsTotal=n,this.log(`${n} bufferCodec event(s) expected.`),null!=(r=this.transferData)&&r.mediaSource&&this.sourceBufferCount&&n&&this.bufferCreated()}onMediaAttaching(e,t){const r=this.media=t.media;this.transferData=this.overrides=void 0;const n=Xd(this.appendSource);if(n){const e=!!t.mediaSource;(e||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const i=this.mediaSource=t.mediaSource||new n;if(this.assignMediaSource(i),e)this._objectUrl=r.src,this.attachTransferred();else{const e=this._objectUrl=self.URL.createObjectURL(i);if(this.appendSource)try{r.removeAttribute("src");const t=self.ManagedMediaSource;r.disableRemotePlayback=r.disableRemotePlayback||t&&i instanceof t,jv(r),function(e,t){const r=self.document.createElement("source");r.type="video/mp4",r.src=t,e.appendChild(r)}(r,e),r.load()}catch(t){r.src=e}else r.src=e}r.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,r;this.log(`${(null==(t=this.transferData)?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${null==(r=e.constructor)?void 0:r.name}`),e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.addEventListener("startstreaming",this._onStartStreaming),e.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const e=this.media,t=this.transferData;if(!t||!e)return;const r=this.tracks,n=t.tracks,i=n?Object.keys(n):null,s=i?i.length:0,a=()=>{Promise.resolve().then(()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()})};if(n&&i&&s){if(!this.tracksReady)return this.hls.config.startFragPrefetch=!0,void this.log("attachTransferred: waiting for SourceBuffer track info");if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})\nrequired tracks: ${xf(r,(e,t)=>"initSegment"===e?void 0:t)};\ntransfer tracks: ${xf(n,(e,t)=>"initSegment"===e?void 0:t)}}`),!Qd(n,r)){t.mediaSource=null,t.tracks=void 0;const i=e.currentTime,s=this.details,a=Math.max(i,(null==s?void 0:s.fragments[0].start)||0);return a-i>1?void this.log(`attachTransferred: waiting for playback to reach new tracks start time ${i} -> ${a}`):(this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(n)}"->"${Object.keys(r)}") start time: ${a} currentTime: ${i}`),this.onMediaDetaching(Id.MEDIA_DETACHING,{}),this.onMediaAttaching(Id.MEDIA_ATTACHING,t),void(e.currentTime=a))}this.transferData=void 0,i.forEach(e=>{const t=e,r=n[t];if(r){const e=r.buffer;if(e){const n=this.fragmentTracker,i=r.id;if(n.hasFragments(i)||n.hasParts(i)){const r=kp.getBuffered(e);n.detectEvictedFragments(t,r,i,null,!0)}const s=Gv(t),a=[t,e];this.sourceBuffers[s]=a,e.updating&&this.operationQueue&&this.operationQueue.prependBlocker(t),this.trackSourceBuffer(t,r)}}}),a(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),a()}get mediaSourceOpenOrEnded(){var e;const t=null==(e=this.mediaSource)?void 0:e.readyState;return"open"===t||"ended"===t}onMediaDetaching(e,t){const r=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:n,mediaSource:i,_objectUrl:s}=this;if(i){if(this.log("media source "+(r?"transferring":"detaching")),r)this.sourceBuffers.forEach(([e])=>{e&&this.removeBuffer(e)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const e="open"===i.readyState;try{const t=i.sourceBuffers;for(let r=t.length;r--;)e&&t[r].abort(),i.removeSourceBuffer(t[r]);e&&i.endOfStream()}catch(e){this.warn(`onMediaDetaching: ${e.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(i.removeEventListener("startstreaming",this._onStartStreaming),i.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}n&&(n.removeEventListener("emptied",this._onMediaEmptied),r||(s&&self.URL.revokeObjectURL(s),this.mediaSrc===s?(n.removeAttribute("src"),this.appendSource&&jv(n),n.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(Id.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach(([e])=>{e&&this.resetBuffer(e)}),this.initTracks()}resetBuffer(e){var t;const r=null==(t=this.tracks[e])?void 0:t.buffer;if(this.removeBuffer(e),r)try{var n;null!=(n=this.mediaSource)&&n.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(r)}catch(t){this.warn(`onBufferReset ${e}`,t)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[Gv(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new $v(this.tracks)}onBufferCodecs(e,t){var r;const n=this.tracks,i=Object.keys(t);this.log(`BUFFER_CODECS: "${i}" (current SB count ${this.sourceBufferCount})`);const s="audiovideo"in t&&(n.audio||n.video)||n.audiovideo&&("audio"in t||"video"in t),a=!s&&this.sourceBufferCount&&this.media&&i.some(e=>!n[e]);s||a?this.warn(`Unsupported transition between "${Object.keys(n)}" and "${i}" SourceBuffers`):(i.forEach(e=>{var r,i;const s=t[e],{id:a,codec:o,levelCodec:l,container:u,metadata:c,supplemental:d}=s;let h=n[e];const f=null==(r=this.transferData)||null==(r=r.tracks)?void 0:r[e],p=null!=f&&f.buffer?f:h,g=(null==p?void 0:p.pendingCodec)||(null==p?void 0:p.codec),m=null==p?void 0:p.levelCodec;h||(h=n[e]={buffer:void 0,listeners:[],codec:o,supplemental:d,container:u,levelCodec:l,metadata:c,id:a});const v=rf(g,m),y=null==v?void 0:v.replace(Bv,"$1");let b=rf(o,l);const w=null==(i=b)?void 0:i.replace(Bv,"$1");b&&v&&y!==w&&("audio"===e.slice(0,5)&&(b=tf(b,this.appendSource)),this.log(`switching codec ${g} to ${b}`),b!==(h.pendingCodec||h.codec)&&(h.pendingCodec=b),h.container=u,this.appendChangeType(e,u,b))}),(this.tracksReady||this.sourceBufferCount)&&(t.tracks=this.sourceBufferTracks),this.sourceBufferCount||(this.bufferCodecEventsTotal>1&&!this.tracks.video&&!t.video&&"main"===(null==(r=t.audio)?void 0:r.id)&&(this.log("Main audio-only"),this.bufferCodecEventsTotal=1),this.mediaSourceOpenOrEnded&&this.checkPendingTracks()))}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((e,t)=>{const r=this.tracks[t];return e[t]={id:r.id,container:r.container,codec:r.codec,levelCodec:r.levelCodec},e},{})}appendChangeType(e,t,r){const n=`${t};codecs=${r}`,i={label:`change-type=${n}`,execute:()=>{const i=this.tracks[e];if(i){const s=i.buffer;null!=s&&s.changeType&&(this.log(`changing ${e} sourceBuffer type to ${n}`),s.changeType(n),i.codec=r,i.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:t=>{this.warn(`Failed to change ${e} SourceBuffer type`,t)}};this.append(i,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const r=e.start,n=r+.05*e.duration;if(!0===(null==(t=this.fragmentTracker.getAppendedFrag(r,Md))?void 0:t.gap))return;const i={label:"block-audio",execute:()=>{var e;const t=this.tracks.video;(this.lastVideoAppendEnd>n||null!=t&&t.buffer&&kp.isBuffered(t.buffer,n)||!0===(null==(e=this.fragmentTracker.getAppendedFrag(n,Md))?void 0:e.gap))&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:e=>{this.warn("Error executing block-audio operation",e)}};this.blockedAudioAppend={op:i,frag:e},this.append(i,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){const{tracks:r}=this,{data:n,type:i,parent:s,frag:a,part:o,chunkMeta:l,offset:u}=t,c=l.buffering[i],{sn:d,cc:h}=a,f=self.performance.now();c.start=f;const p=a.stats.buffering,g=o?o.stats.buffering:null;0===p.start&&(p.start=f),g&&0===g.start&&(g.start=f);const m=r.audio;let v=!1;"audio"===i&&"audio/mpeg"===(null==m?void 0:m.container)&&(v=!this.lastMpegAudioChunk||1===l.id||this.lastMpegAudioChunk.sn!==l.sn,this.lastMpegAudioChunk=l);const y=r.video,b=null==y?void 0:y.buffer;if(b&&"initSegment"!==d){const e=o||a,t=this.blockedAudioAppend;if("audio"!==i||"main"===s||this.blockedAudioAppend||y.ending||y.ended){if("video"===i){const r=e.end;if(t){const e=t.frag.start;(r>e||r<this.lastVideoAppendEnd||kp.isBuffered(b,e))&&this.unblockAudio()}this.lastVideoAppendEnd=r}}else{const t=e.start+.05*e.duration,r=b.buffered,n=this.currentOp("video");r.length||n?!n&&!kp.isBuffered(b,t)&&this.lastVideoAppendEnd<t&&this.blockAudio(e):this.blockAudio(e)}}const w=(o||a).start,E={label:`append-${i}`,execute:()=>{var e;c.executeStart=self.performance.now();const t=null==(e=this.tracks[i])?void 0:e.buffer;t&&(v?this.updateTimestampOffset(t,w,.1,i,d,h):void 0!==u&&kd(u)&&this.updateTimestampOffset(t,u,1e-6,i,d,h)),this.appendExecutor(n,i)},onStart:()=>{},onComplete:()=>{const e=self.performance.now();c.executeEnd=c.end=e,0===p.first&&(p.first=e),g&&0===g.first&&(g.first=e);const t={};this.sourceBuffers.forEach(([e,r])=>{e&&(t[e]=kp.getBuffered(r))}),this.appendErrors[i]=0,"audio"===i||"video"===i?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(Id.BUFFER_APPENDED,{type:i,frag:a,part:o,chunkMeta:l,parent:a.type,timeRanges:t})},onError:e=>{var t;const r={type:Rd.MEDIA_ERROR,parent:a.type,details:Ld.BUFFER_APPEND_ERROR,sourceBufferName:i,frag:a,part:o,chunkMeta:l,error:e,err:e,fatal:!1},n=null==(t=this.media)?void 0:t.error;if(e.code===DOMException.QUOTA_EXCEEDED_ERR||"QuotaExceededError"==e.name||"quota"in e)r.details=Ld.BUFFER_FULL_ERROR;else if(e.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!n)r.errorAction=tp(!0);else if(e.name===Uv&&0===this.sourceBufferCount)r.errorAction=tp(!0);else{const e=++this.appendErrors[i];this.warn(`Failed ${e}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${i}" sourceBuffer (${n||"no media error"})`),(e>=this.hls.config.appendErrorMaxRetry||n)&&(r.fatal=!0)}this.hls.trigger(Id.ERROR,r)}};this.log(`queuing "${i}" append sn: ${d}${o?" p: "+o.index:""} of ${a.type===Md?"level":"track"} ${a.level} cc: ${h}`),this.append(E,i,this.isPending(this.tracks[i]))}getFlushOp(e,t,r){return this.log(`queuing "${e}" remove ${t}-${r}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,r)},onStart:()=>{},onComplete:()=>{this.hls.trigger(Id.BUFFER_FLUSHED,{type:e})},onError:n=>{this.warn(`Failed to remove ${t}-${r} from "${e}" SourceBuffer`,n)}}}onBufferFlushing(e,t){const{type:r,startOffset:n,endOffset:i}=t;r?this.append(this.getFlushOp(r,n,i),r):this.sourceBuffers.forEach(([e])=>{e&&this.append(this.getFlushOp(e,n,i),e)})}onFragParsed(e,t){const{frag:r,part:n}=t,i=[],s=n?n.elementaryStreams:r.elementaryStreams;s[fh]?i.push("audiovideo"):(s[dh]&&i.push("audio"),s[hh]&&i.push("video"));0===i.length&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${r.type} level: ${r.level} sn: ${r.sn}`),this.blockBuffers(()=>{const e=self.performance.now();r.stats.buffering.end=e,n&&(n.stats.buffering.end=e);const t=n?n.stats:r.stats;this.hls.trigger(Id.FRAG_BUFFERED,{frag:r,part:n,stats:t,id:r.type})},i).catch(e=>{this.warn(`Fragment buffered callback ${e}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{if(e){const t=this.tracks[e];if(t)return!t.ended||t.ending}return!1})}onBufferEos(e,t){var r;this.sourceBuffers.forEach(([e])=>{if(e){const r=this.tracks[e];t.type&&t.type!==e||(r.ending=!0,r.ended||(r.ended=!0,this.log(`${e} buffer reached EOS`)))}});const n=!1!==(null==(r=this.overrides)?void 0:r.endOfStream);this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{var t;return e&&!(null!=(t=this.tracks[e])&&t.ended)})?n?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:e}=this;e&&"open"===e.readyState?(this.log("Calling mediaSource.endOfStream()"),e.endOfStream(),this.hls.trigger(Id.BUFFERED_TO_END,void 0)):e&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${e.readyState}`)})):(this.tracksEnded(),this.hls.trigger(Id.BUFFERED_TO_END,void 0)):"video"===t.type&&this.unblockAudio()}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(null!==e){const t=this.tracks[e];t&&(t.ending=!1)}})}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){this.blockUntilOpen(()=>{const e=this.getDurationAndRange();e&&this.updateMediaSource(e)})}onError(e,t){if(t.details===Ld.BUFFER_APPEND_ERROR&&t.frag){var r;const e=null==(r=t.errorAction)?void 0:r.nextAutoLevel;kd(e)&&e!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:r}=this;if(!r||null===t)return;if(!this.sourceBufferCount)return;const n=e.config,i=r.currentTime,s=t.levelTargetDuration,a=t.live&&null!==n.liveBackBufferLength?n.liveBackBufferLength:n.backBufferLength;if(kd(a)&&a>=0){const e=Math.max(a,s),t=Math.floor(i/s)*s-e;this.flushBackBuffer(i,s,t)}const o=n.frontBufferFlushThreshold;if(kd(o)&&o>0){const e=Math.max(n.maxBufferLength,o),t=Math.max(e,s),r=Math.floor(i/s)*s+t;this.flushFrontBuffer(i,s,r)}}flushBackBuffer(e,t,r){this.sourceBuffers.forEach(([e,t])=>{if(t){const i=kp.getBuffered(t);if(i.length>0&&r>i.start(0)){var n;this.hls.trigger(Id.BACK_BUFFER_REACHED,{bufferEnd:r});const t=this.tracks[e];if(null!=(n=this.details)&&n.live)this.hls.trigger(Id.LIVE_BACK_BUFFER_REACHED,{bufferEnd:r});else if(null!=t&&t.ended)return void this.log(`Cannot flush ${e} back buffer while SourceBuffer is in ended state`);this.hls.trigger(Id.BUFFER_FLUSHING,{startOffset:0,endOffset:r,type:e})}}})}flushFrontBuffer(e,t,r){this.sourceBuffers.forEach(([t,n])=>{if(n){const i=kp.getBuffered(n),s=i.length;if(s<2)return;const a=i.start(s-1),o=i.end(s-1);if(r>a||e>=a&&e<=o)return;this.hls.trigger(Id.BUFFER_FLUSHING,{startOffset:a,endOffset:1/0,type:t})}})}getDurationAndRange(){var e;const{details:t,mediaSource:r}=this;if(!t||!this.media||"open"!==(null==r?void 0:r.readyState))return null;const n=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&r.setLiveSeekableRange){const e=Math.max(0,t.fragmentStart);return{duration:1/0,start:e,end:Math.max(e,n)}}return{duration:1/0}}const i=null==(e=this.overrides)?void 0:e.duration;if(i)return kd(i)?{duration:i}:null;const s=this.media.duration;return n>(kd(r.duration)?r.duration:0)&&n>s||!kd(s)?{duration:n}:null}updateMediaSource({duration:e,start:t,end:r}){const n=this.mediaSource;this.media&&n&&"open"===n.readyState&&(n.duration!==e&&(kd(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),n.duration=e),void 0!==t&&void 0!==r&&(this.log(`MediaSource duration is set to ${n.duration}. Setting seekable range to ${t}-${r}.`),n.setLiveSeekableRange(t,r)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:r}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${xf(r)}`),this.tracksReady){var n;const e=null==(n=this.transferData)?void 0:n.tracks;e&&Object.keys(e).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach(([t,r])=>{if(t){const n=this.tracks[t];e[t]={buffer:r,container:n.container,codec:n.codec,supplemental:n.supplemental,levelCodec:n.levelCodec,id:n.id,metadata:n.metadata}}}),this.hls.trigger(Id.BUFFER_CREATED,{tracks:e}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach(([e])=>{this.executeNext(e)})}else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(Id.ERROR,{type:Rd.MEDIA_ERROR,details:Ld.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:r}=this;if(!r)throw new Error("createSourceBuffers called when mediaSource was null");for(const i in e){const s=i,a=e[s];if(this.isPending(a)){const e=this.getTrackCodec(a,s),i=`${a.container};codecs=${e}`;a.codec=e,this.log(`creating sourceBuffer(${i})${this.currentOp(s)?" Queued":""} ${xf(a)}`);try{const e=r.addSourceBuffer(i),n=Gv(s),o=[s,e];t[n]=o,a.buffer=e}catch(e){var n;return this.error(`error while trying to add sourceBuffer: ${e.message}`),this.shiftAndExecuteNext(s),null==(n=this.operationQueue)||n.removeBlockers(),delete this.tracks[s],void this.hls.trigger(Id.ERROR,{type:Rd.MEDIA_ERROR,details:Ld.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:e,sourceBufferName:s,mimeType:i,parent:a.id})}this.trackSourceBuffer(s,a)}}this.bufferCreated()}getTrackCodec(e,t){const r=e.supplemental;let n=e.codec;r&&("video"===t||"audiovideo"===t)&&Yh(r,"video")&&(n=function(e,t){const r=[];if(e){const t=e.split(",");for(let e=0;e<t.length;e++)Kh(t[e],"video")||r.push(t[e])}return t&&r.push(t),r.join(",")}(n,r));const i=rf(n,e.levelCodec);return i?"audio"===t.slice(0,5)?tf(i,this.appendSource):i:""}trackSourceBuffer(e,t){const r=t.buffer;if(!r)return;const n=this.getTrackCodec(t,e);this.tracks[e]={buffer:r,codec:n,container:t.container,levelCodec:t.levelCodec,supplemental:t.supplemental,metadata:t.metadata,id:t.id,listeners:[]},this.removeBufferListeners(e),this.addBufferListener(e,"updatestart",this.onSBUpdateStart),this.addBufferListener(e,"updateend",this.onSBUpdateEnd),this.addBufferListener(e,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(e,"bufferedchange",(e,t)=>{const r=t.removedRanges;null!=r&&r.length&&this.hls.trigger(Id.BUFFER_FLUSHED,{type:e})})}get mediaSrc(){var e,t;const r=(null==(e=this.media)||null==(t=e.querySelector)?void 0:t.call(e,"source"))||this.media;return null==r?void 0:r.src}onSBUpdateStart(e){const t=this.currentOp(e);t&&t.onStart()}onSBUpdateEnd(e){var t;if("closed"===(null==(t=this.mediaSource)?void 0:t.readyState))return void this.resetBuffer(e);const r=this.currentOp(e);r&&(r.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var r;const n=new Error(`${e} SourceBuffer error. MediaSource readyState: ${null==(r=this.mediaSource)?void 0:r.readyState}`);this.error(`${n}`,t),this.hls.trigger(Id.ERROR,{type:Rd.MEDIA_ERROR,details:Ld.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:n,fatal:!1});const i=this.currentOp(e);i&&i.onError(n)}updateTimestampOffset(e,t,r,n,i,s){const a=t-e.timestampOffset;Math.abs(a)>=r&&(this.log(`Updating ${n} SourceBuffer timestampOffset to ${t} (sn: ${i} cc: ${s})`),e.timestampOffset=t)}removeExecutor(e,t,r){const{media:n,mediaSource:i}=this,s=this.tracks[e],a=null==s?void 0:s.buffer;if(!n||!i||!a)return this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),void this.shiftAndExecuteNext(e);const o=kd(n.duration)?n.duration:1/0,l=kd(i.duration)?i.duration:1/0,u=Math.max(0,t),c=Math.min(r,o,l);c>u&&(!s.ending||s.ended)?(s.ended=!1,this.log(`Removing [${u},${c}] from the ${e} SourceBuffer`),a.remove(u,c)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const r=this.tracks[t],n=null==r?void 0:r.buffer;if(!n)throw new zv(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);r.ending=!1,r.ended=!1,n.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch(e=>{this.warn(`SourceBuffer blocked callback ${e}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{e()}catch(e){this.warn(`Callback run without blocking ${this.operationQueue} ${e}`)}}isUpdating(){return this.sourceBuffers.some(([e,t])=>e&&t.updating)}isQueued(){return this.sourceBuffers.some(([e])=>e&&!!this.currentOp(e))}isPending(e){return!!e&&!e.buffer}blockBuffers(e,t=this.sourceBufferTypes){if(!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);const{operationQueue:r}=this,n=t.map(e=>this.appendBlocker(e));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(n).then(t=>{r===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(e){e.forEach(e=>{var t;const r=null==(t=this.tracks[e])?void 0:t.buffer;r&&!r.updating&&this.shiftAndExecuteNext(e)})}append(e,t,r){this.operationQueue&&this.operationQueue.append(e,t,r)}appendBlocker(e){if(this.operationQueue)return this.operationQueue.appendBlocker(e)}currentOp(e){return this.operationQueue?this.operationQueue.current(e):null}executeNext(e){e&&this.operationQueue&&this.operationQueue.executeNext(e)}shiftAndExecuteNext(e){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(e)}get pendingTrackCount(){return Object.keys(this.tracks).reduce((e,t)=>e+(this.isPending(this.tracks[t])?1:0),0)}get sourceBufferCount(){return this.sourceBuffers.reduce((e,[t])=>e+(t?1:0),0)}get sourceBufferTypes(){return this.sourceBuffers.map(([e])=>e).filter(e=>!!e)}addBufferListener(e,t,r){const n=this.tracks[e];if(!n)return;const i=n.buffer;if(!i)return;const s=r.bind(this,e);n.listeners.push({event:t,listener:s}),i.addEventListener(t,s)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const r=t.buffer;r&&(t.listeners.forEach(e=>{r.removeEventListener(e.event,e.listener)}),t.listeners.length=0)}},capLevelController:Hv,errorController:class extends Gd{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(Id.ERROR,this.onError,this),e.on(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Id.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(Id.ERROR,this.onError,this),e.off(Id.ERROR,this.onErrorOut,this),e.off(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Id.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(null==e?void 0:e.type)===Md?e.level:this.getVariantIndex()}getVariantIndex(){var e;const t=this.hls,r=t.currentLevel;return null!=(e=t.loadLevelObj)&&e.details||-1===r?t.loadLevel:r}variantHasKey(e,t){if(e){var r;if(null!=(r=e.details)&&r.hasKey(t))return!0;const n=e.audioGroups;if(n){return this.hls.allAudioTracks.filter(e=>n.indexOf(e.groupId)>=0).some(e=>{var r;return null==(r=e.details)?void 0:r.hasKey(t)})}}return!1}onManifestLoading(){this.playlistError=0}onLevelUpdated(){this.playlistError=0}onError(e,t){var r;if(t.fatal)return;const n=this.hls,i=t.context;switch(t.details){case Ld.FRAG_LOAD_ERROR:case Ld.FRAG_LOAD_TIMEOUT:case Ld.KEY_LOAD_ERROR:case Ld.KEY_LOAD_TIMEOUT:return void(t.errorAction=this.getFragRetryOrSwitchAction(t));case Ld.FRAG_PARSING_ERROR:if(null!=(r=t.frag)&&r.gap)return void(t.errorAction=tp());case Ld.FRAG_GAP:case Ld.FRAG_DECRYPT_ERROR:return t.errorAction=this.getFragRetryOrSwitchAction(t),void(t.errorAction.action=Yf);case Ld.LEVEL_EMPTY_ERROR:case Ld.LEVEL_PARSING_ERROR:{var s;const e=t.parent===Md?t.level:n.loadLevel;t.details===Ld.LEVEL_EMPTY_ERROR&&null!=(s=t.context)&&null!=(s=s.levelDetails)&&s.live?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,e):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,e))}return;case Ld.LEVEL_LOAD_ERROR:case Ld.LEVEL_LOAD_TIMEOUT:return void("number"==typeof(null==i?void 0:i.level)&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.level)));case Ld.AUDIO_TRACK_LOAD_ERROR:case Ld.AUDIO_TRACK_LOAD_TIMEOUT:case Ld.SUBTITLE_LOAD_ERROR:case Ld.SUBTITLE_TRACK_LOAD_TIMEOUT:if(i){const e=n.loadLevelObj;if(e&&(i.type===Dd&&e.hasAudioGroup(i.groupId)||i.type===_d&&e.hasSubtitleGroup(i.groupId)))return t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.loadLevel),t.errorAction.action=Yf,void(t.errorAction.flags=Zf)}return;case Ld.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:return void(t.errorAction={action:Yf,flags:Jf});case Ld.KEY_SYSTEM_SESSION_UPDATE_FAILED:case Ld.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case Ld.KEY_SYSTEM_NO_SESSION:return void(t.errorAction={action:Yf,flags:ep});case Ld.BUFFER_ADD_CODEC_ERROR:case Ld.REMUX_ALLOC_ERROR:case Ld.BUFFER_APPEND_ERROR:var a;if(!t.errorAction)t.errorAction=this.getLevelSwitchAction(t,null!=(a=t.level)?a:n.loadLevel);return;case Ld.INTERNAL_EXCEPTION:case Ld.BUFFER_APPENDING_ERROR:case Ld.BUFFER_FULL_ERROR:case Ld.LEVEL_SWITCH_ERROR:case Ld.BUFFER_STALLED_ERROR:case Ld.BUFFER_SEEK_OVER_HOLE:case Ld.BUFFER_NUDGE_ON_STALL:return void(t.errorAction=tp())}t.type===Rd.KEY_SYSTEM_ERROR&&(t.levelRetry=!1,t.errorAction=tp())}getPlaylistRetryOrSwitchAction(e,t){const r=jf(this.hls.config.playlistLoadPolicy,e),n=this.playlistError++;if(Vf(r,n,Bf(e),e.response))return{action:Xf,flags:Qf,retryConfig:r,retryCount:n};const i=this.getLevelSwitchAction(e,t);return r&&(i.retryConfig=r,i.retryCount=n),i}getFragRetryOrSwitchAction(e){const t=this.hls,r=this.getVariantLevelIndex(e.frag),n=t.levels[r],{fragLoadPolicy:i,keyLoadPolicy:s}=t.config,a=jf(Uf(e)?s:i,e),o=t.levels.reduce((e,t)=>e+t.fragmentError,0);if(n&&(e.details!==Ld.FRAG_GAP&&n.fragmentError++,!zf(e))){if(Vf(a,o,Bf(e),e.response))return{action:Xf,flags:Qf,retryConfig:a,retryCount:o}}const l=this.getLevelSwitchAction(e,r);return a&&(l.retryConfig=a,l.retryCount=o),l}getLevelSwitchAction(e,t){const r=this.hls;null==t&&(t=r.loadLevel);const n=this.hls.levels[t];if(n){var i,s;const t=e.details;n.loadError++,t===Ld.BUFFER_APPEND_ERROR&&n.fragmentError++;let l=-1;const{levels:u,loadLevel:c,minAutoLevel:d,maxAutoLevel:h}=r;r.autoLevelEnabled||r.config.preserveManualLevelOnError||(r.loadLevel=-1);const f=null==(i=e.frag)?void 0:i.type,p=(f===Od&&t===Ld.FRAG_PARSING_ERROR||"audio"===e.sourceBufferName&&(t===Ld.BUFFER_ADD_CODEC_ERROR||t===Ld.BUFFER_APPEND_ERROR))&&u.some(({audioCodec:e})=>n.audioCodec!==e),g="video"===e.sourceBufferName&&(t===Ld.BUFFER_ADD_CODEC_ERROR||t===Ld.BUFFER_APPEND_ERROR)&&u.some(({codecSet:e,audioCodec:t})=>n.codecSet!==e&&n.audioCodec===t),{type:m,groupId:v}=null!=(s=e.context)?s:{};for(let r=u.length;r--;){const i=(r+c)%u.length;if(i!==c&&i>=d&&i<=h&&0===u[i].loadError){var a,o;const r=u[i];if(t===Ld.FRAG_GAP&&f===Md&&e.frag){const t=u[i].details;if(t){const r=Of(e.frag,t.fragments,e.frag.start);if(null!=r&&r.gap)continue}}else{if(m===Dd&&r.hasAudioGroup(v)||m===_d&&r.hasSubtitleGroup(v))continue;if(f===Od&&null!=(a=n.audioGroups)&&a.some(e=>r.hasAudioGroup(e))||f===Nd&&null!=(o=n.subtitleGroups)&&o.some(e=>r.hasSubtitleGroup(e))||p&&n.audioCodec===r.audioCodec||g&&n.codecSet===r.codecSet||!p&&n.codecSet!==r.codecSet)continue}l=i;break}}if(l>-1&&r.loadLevel!==l)return e.levelRetry=!0,this.playlistError=0,{action:Yf,flags:Qf,nextAutoLevel:l}}return{action:Yf,flags:Zf}}onErrorOut(e,t){var r;switch(null==(r=t.errorAction)?void 0:r.action){case Kf:break;case Yf:this.sendAlternateToPenaltyBox(t),t.errorAction.resolved||t.details===Ld.FRAG_GAP?/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError()):t.fatal=!0}t.fatal&&this.hls.stopLoad()}sendAlternateToPenaltyBox(e){const t=this.hls,r=e.errorAction;if(!r)return;const{flags:n}=r,i=r.nextAutoLevel;switch(n){case Qf:this.switchLevel(e,i);break;case Jf:{const n=this.getVariantLevelIndex(e.frag),i=t.levels[n],s=null==i?void 0:i.attrs["HDCP-LEVEL"];if(r.hdcpLevel=s,"NONE"===s)this.warn("HDCP policy resticted output with HDCP-LEVEL=NONE");else if(s){t.maxHdcpLevel=gf[gf.indexOf(s)-1],r.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}}case ep:{const t=e.decryptdata;if(t){const n=this.hls.levels,i=n.length;for(let r=i;r--;){var s,a;if(this.variantHasKey(n[r],t))this.log(`Banned key found in level ${r} (${n[r].bitrate}bps) or audio group "${null==(s=n[r].audioGroups)?void 0:s.join(",")}" (${null==(a=e.frag)?void 0:a.type} fragment) ${Jd(t.keyId||[])}`),n[r].fragmentError++,n[r].loadError++,this.log(`Removing level ${r} with key error (${e.error})`),this.hls.removeLevel(r)}const o=e.frag;if(this.hls.levels.length<i)r.resolved=!0;else if(o&&o.type!==Md){const e=o.decryptdata;e&&!t.matches(e)&&(r.resolved=!0)}}break}}r.resolved||this.switchLevel(e,i)}switchLevel(e,t){if(void 0!==t&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,e.details===Ld.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&"audiovideo"!==e.sourceBufferName)){const t=of(e.mimeType),r=this.hls.levels;for(let n=r.length;n--;)r[n][`${e.sourceBufferName}Codec`]===t&&(this.log(`Removing level ${n} for ${e.details} ("${t}" not supported)`),this.hls.removeLevel(n))}}},fpsController:class{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(Id.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(Id.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(Id.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(Id.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const r=this.hls.config;if(r.capLevelOnFPSDrop){const e=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=e,e&&"function"==typeof e.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),r.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,r){const n=performance.now();if(t){if(this.lastTime){const e=n-this.lastTime,i=r-this.lastDroppedFrames,s=t-this.lastDecodedFrames,a=1e3*i/e,o=this.hls;if(o.trigger(Id.FPS_DROP,{currentDropped:i,currentDecoded:s,totalDroppedFrames:r}),a>0&&i>o.config.fpsDroppedMonitoringThreshold*s){let e=o.currentLevel;o.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+e),e>0&&(-1===o.autoLevelCapping||o.autoLevelCapping>=e)&&(e-=1,o.trigger(Id.FPS_DROP_LEVEL_CAPPING,{level:e,droppedLevel:o.currentLevel}),o.autoLevelCapping=e,this.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=r,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}},stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:eg,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},{cueHandler:ow,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:class extends rm{constructor(e,t,r){super(e,t,r,"subtitle-stream-controller",Nd),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(Id.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Id.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(Id.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(Id.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(Id.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(Id.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(Id.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Id.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(Id.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(Id.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(Id.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(Id.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=Vg,this.setInterval(500),this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(e,t){this.tracksBuffered=[],super.onMediaDetaching(e,t)}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:r,success:n}=t;if(this.fragContextChanged(r)||(gh(r)&&(this.fragPrevious=r),this.state=Vg),!n)return;const i=this.tracksBuffered[this.currentTrackId];if(!i)return;let s;const a=r.start;for(let e=0;e<i.length;e++)if(a>=i[e].start&&a<=i[e].end){s=i[e];break}const o=r.start+r.duration;s?s.end=o:(s={start:a,end:o},i.push(s)),this.fragmentTracker.fragBuffered(r),this.fragBufferedComplete(r,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:r,endOffset:n}=t;if(0===r&&n!==Number.POSITIVE_INFINITY){const e=n-1;if(e<=0)return;t.endOffsetSubtitles=Math.max(0,e),this.tracksBuffered.forEach(t=>{for(let r=0;r<t.length;)if(t[r].end<=e)t.shift();else{if(!(t[r].start<e))break;t[r].start=e,r++}}),this.fragmentTracker.removeFragmentsInRange(r,e,Nd)}}onError(e,t){const r=t.frag;(null==r?void 0:r.type)===Nd&&(t.details===Ld.FRAG_GAP&&this.fragmentTracker.fragBuffered(r,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==Hg&&(this.state=Vg))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){this.levels&&Ov(this.levels,t)?this.levels=t.map(e=>new Sf(e)):(this.tracksBuffered=[],this.levels=t.map(e=>{const t=new Sf(e);return this.tracksBuffered[t.id]=[],t}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,Nd),this.fragPrevious=null,this.mediaBuffer=null)}onSubtitleTrackSwitch(e,t){var r;if(this.currentTrackId=t.id,null==(r=this.levels)||!r.length||-1===this.currentTrackId)return void this.clearInterval();const n=this.levels[this.currentTrackId];null!=n&&n.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,n&&this.state!==Hg&&this.setInterval(500)}onSubtitleTrackLoaded(e,t){var r;const{currentTrackId:n,levels:i}=this,{details:s,id:a}=t;if(!i)return void this.warn(`Subtitle tracks were reset while loading level ${a}`);const o=i[a];if(a>=i.length||!o)return;this.log(`Subtitle track ${a} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let l=0;if(s.live||null!=(r=o.details)&&r.live){if(s.deltaUpdateFailed)return;const e=this.mainDetails;if(!e)return void(this.startFragRequested=!1);const t=e.fragments[0];var u;if(o.details)l=this.alignPlaylists(s,o.details,null==(u=this.levelLastLoaded)?void 0:u.details),0===l&&t&&(l=t.start,Lg(s,l));else s.hasProgramDateTime&&e.hasProgramDateTime?(Ug(s,e),l=s.fragmentStart):t&&(l=t.start,Lg(s,l));e&&!this.startFragRequested&&this.setStartPosition(e,l)}if(o.details=s,this.levelLastLoaded=o,a===n&&(this.hls.trigger(Id.SUBTITLE_TRACK_UPDATED,{details:s,id:a,groupId:t.groupId}),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===Vg)){Of(null,s.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),o.details=void 0)}}_handleFragmentLoadComplete(e){const{frag:t,payload:r}=e,n=t.decryptdata,i=this.hls;if(!this.fragContextChanged(t)&&r&&r.byteLength>0&&null!=n&&n.key&&n.iv&&Bp(n.method)){const e=performance.now();this.decrypter.decrypt(new Uint8Array(r),n.key.buffer,n.iv.buffer,Up(n.method)).catch(e=>{throw i.trigger(Id.ERROR,{type:Rd.MEDIA_ERROR,details:Ld.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:t}),e}).then(r=>{const n=performance.now();i.trigger(Id.FRAG_DECRYPTED,{frag:t,payload:r,stats:{tstart:e,tdecrypt:n}})}).catch(e=>{this.warn(`${e.name}: ${e.message}`),this.state=Vg})}}doTick(){if(this.media){if(this.state===Vg){const{currentTrackId:e,levels:t}=this,r=null==t?void 0:t[e];if(!r||!t.length||!r.details)return;if(this.waitForLive(r))return;const{config:n}=this,i=this.getLoadPosition(),s=kp.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],i,n.maxBufferHole),{end:a,len:o}=s,l=r.details;if(o>this.hls.maxBufferLength+l.levelTargetDuration)return;const u=l.fragments,c=u.length,d=l.edge;let h=null;const f=this.fragPrevious;if(a<d){const e=n.maxFragLookUpTolerance,t=a>d-e?0:e;h=Of(f,u,Math.max(u[0].start,a),t),!h&&f&&f.start<u[0].start&&(h=u[0])}else h=u[c-1];if(h=this.filterReplacedPrimary(h,r.details),!h)return;const p=u[h.sn-l.startSN-1];if(p&&p.cc===h.cc&&this.fragmentTracker.getState(p)===rp&&(h=p),this.fragmentTracker.getState(h)===rp){const e=this.mapToInitFragWhenRequired(h);e&&this.loadFragment(e,r,a)}}}else this.state=Vg}loadFragment(e,t,r){gh(e)?super.loadFragment(e,t,r):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new db(this.tracksBuffered[this.currentTrackId]||[])}},subtitleTrackController:class extends Mv{constructor(e){super(e,"subtitle-track-controller"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let e=null;const t=qy(this.media.textTracks);for(let r=0;r<t.length;r++)if("hidden"===t[r].mode)e=t[r];else if("showing"===t[r].mode){e=t[r];break}const r=this.findTrackForTextTrack(e);this.subtitleTrack!==r&&this.setSubtitleTrack(r)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(Id.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Id.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Id.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Id.LEVEL_LOADING,this.onLevelLoading,this),e.on(Id.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(Id.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(Id.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(Id.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Id.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Id.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Id.LEVEL_LOADING,this.onLevelLoading,this),e.off(Id.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(Id.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(Id.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(e,t){const r=this.media;if(!r)return;const n=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||r.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,n)return;qy(r.textTracks).forEach(e=>{Ky(e)})}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:r,groupId:n,details:i}=t,s=this.tracksInGroup[r];if(!s||s.groupId!==n)return void this.warn(`Subtitle track with id:${r} and group:${n} not found in active group ${null==s?void 0:s.groupId}`);const a=s.details;s.details=t.details,this.log(`Subtitle track ${r} "${s.name}" lang:${s.lang} group:${n} loaded [${i.startSN}-${i.endSN}]`),r===this.trackId&&this.playlistLoaded(r,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const r=t.subtitleGroups||null,n=this.groupIds;let i=this.currentTrack;if(!r||(null==n?void 0:n.length)!==(null==r?void 0:r.length)||null!=r&&r.some(e=>-1===(null==n?void 0:n.indexOf(e)))){this.groupIds=r,this.trackId=-1,this.currentTrack=null;const e=this.tracks.filter(e=>!r||-1!==r.indexOf(e.groupId));if(e.length)this.selectDefaultTrack&&!e.some(e=>e.default)&&(this.selectDefaultTrack=!1),e.forEach((e,t)=>{e.id=t});else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=e;const t=this.hls.config.subtitlePreference;if(!i&&t){this.selectDefaultTrack=!1;const r=If(t,e);if(r>-1)i=e[r];else{const e=If(t,this.tracks);i=this.tracks[e]}}let n=this.findTrackId(i);-1===n&&i&&(n=this.findTrackId(null));const s={subtitleTracks:e};this.log(`Updating subtitle tracks, ${e.length} track(s) found in "${null==r?void 0:r.join(",")}" group-id`),this.hls.trigger(Id.SUBTITLE_TRACKS_UPDATED,s),-1!==n&&-1===this.trackId&&this.setSubtitleTrack(n)}}findTrackId(e){const t=this.tracksInGroup,r=this.selectDefaultTrack;for(let n=0;n<t.length;n++){const i=t[n];if((!r||i.default)&&(r||e)&&(!e||Cf(i,e)))return n}if(e){for(let r=0;r<t.length;r++){const n=t[r];if(Nv(e.attrs,n.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return r}for(let r=0;r<t.length;r++){const n=t[r];if(Nv(e.attrs,n.attrs,["LANGUAGE"]))return r}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let r=0;r<t.length;r++){if(Fv(t[r],e))return r}}return-1}onError(e,t){!t.fatal&&t.context&&(t.context.type!==_d||t.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(t.context.groupId)||this.checkRetry(t))}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1,this.setSubtitleTrack(e)}setSubtitleOption(e){if(this.hls.config.subtitlePreference=e,e){if(-1===e.id)return this.setSubtitleTrack(-1),null;const t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const r=this.currentTrack;if(r&&Cf(e,r))return r;const n=If(e,this.tracksInGroup);if(n>-1){const e=this.tracksInGroup[n];return this.setSubtitleTrack(n),e}if(r)return null;{const r=If(e,t);if(r>-1)return t[r]}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const r=e.id,n=e.groupId,i=this.getUrlWithDirectives(e.url,t),s=e.details,a=null==s?void 0:s.age;this.log(`Loading subtitle ${r} "${e.name}" lang:${e.lang} group:${n}${void 0!==(null==t?void 0:t.msn)?" at sn "+t.msn+" part "+t.part:""}${a&&s.live?" age "+a.toFixed(1)+(s.type&&" "+s.type||""):""} ${i}`),this.hls.trigger(Id.SUBTITLE_TRACK_LOADING,{url:i,id:r,groupId:n,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=qy(e.textTracks),r=this.currentTrack;let n;if(r&&(n=t.filter(e=>Fv(r,e))[0],n||this.warn(`Unable to find subtitle TextTrack with name "${r.name}" and language "${r.lang}"`)),[].slice.call(t).forEach(e=>{"disabled"!==e.mode&&e!==n&&(e.mode="disabled")}),n){const e=this.subtitleDisplay?"showing":"hidden";n.mode!==e&&(n.mode=e)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media)return void(this.queuedDefaultTrack=e);if(e<-1||e>=t.length||!kd(e))return void this.warn(`Invalid subtitle track id: ${e}`);this.selectDefaultTrack=!1;const r=this.currentTrack,n=t[e]||null;if(this.trackId=e,this.currentTrack=n,this.toggleTrackModes(),!n)return void this.hls.trigger(Id.SUBTITLE_TRACK_SWITCH,{id:e});const i=!!n.details&&!n.details.live;if(e===this.trackId&&n===r&&i)return;this.log(`Switching to subtitle-track ${e}`+(n?` "${n.name}" lang:${n.lang} group:${n.groupId}`:""));const{id:s,groupId:a="",name:o,type:l,url:u}=n;this.hls.trigger(Id.SUBTITLE_TRACK_SWITCH,{id:s,groupId:a,name:o,type:l,url:u});const c=this.switchParams(n.url,null==r?void 0:r.details,n.details);this.loadPlaylist(c)}},timelineController:class{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(Id.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Id.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Id.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Id.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(Id.FRAG_LOADING,this.onFragLoading,this),e.on(Id.FRAG_LOADED,this.onFragLoaded,this),e.on(Id.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(Id.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(Id.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(Id.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(Id.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(Id.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Id.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Id.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Id.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(Id.FRAG_LOADING,this.onFragLoading,this),e.off(Id.FRAG_LOADED,this.onFragLoaded,this),e.off(Id.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(Id.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(Id.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(Id.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(Id.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new rw(this,"textTrack1"),t=new rw(this,"textTrack2"),r=new rw(this,"textTrack3"),n=new rw(this,"textTrack4");this.cea608Parser1=new Lb(1,e,t),this.cea608Parser2=new Lb(3,r,n)}addCues(e,t,r,n,i){let s=!1;for(let e=i.length;e--;){const n=i[e],a=sw(n[0],n[1],t,r);if(a>=0&&(n[0]=Math.min(n[0],t),n[1]=Math.max(n[1],r),s=!0,a/(r-t)>.5))return}if(s||i.push([t,r]),this.config.renderTextTracksNatively){const i=this.captionsTracks[e];this.Cues.newCue(i,t,r,n)}else{const i=this.Cues.newCue(null,t,r,n);this.hls.trigger(Id.CUES_PARSED,{type:"captions",cues:i,track:e})}}onInitPtsFound(e,{frag:t,id:r,initPTS:n,timescale:i,trackId:s}){const{unparsedVttFrags:a}=this;r===Md&&(this.initPTS[t.cc]={baseTime:n,timescale:i,trackId:s}),a.length&&(this.unparsedVttFrags=[],a.forEach(e=>{this.initPTS[e.frag.cc]?this.onFragLoaded(Id.FRAG_LOADED,e):this.hls.trigger(Id.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e.frag,error:new Error("Subtitle discontinuity domain does not match main")})}))}getExistingTrack(e,t){const{media:r}=this;if(r)for(let n=0;n<r.textTracks.length;n++){const i=r.textTracks[n];if(iw(i,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return i}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:r,media:n}=this,{label:i,languageCode:s}=t[e],a=this.getExistingTrack(i,s);if(a)r[e]=a,Ky(r[e]),Vy(r[e],n);else{const t=this.createTextTrack("captions",i,s);t&&(t[e]=!0,r[e]=t)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const r={_id:e,label:t.label,kind:"captions",default:!!t.media&&!!t.media.default,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=r,this.hls.trigger(Id.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[r]})}createTextTrack(e,t,r){const n=this.media;if(n)return n.addTextTrack(e,t,r)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const r=!!t.transferMedia;if(this.media=null,r)return;const{captionsTracks:n}=this;Object.keys(n).forEach(e=>{Ky(n[e]),delete n[e]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let e=0;e<t.length;e++)Ky(t[e])}onSubtitleTracksUpdated(e,t){const r=t.subtitleTracks||[],n=r.some(e=>e.textCodec===Vb);if(this.config.enableWebVTT||n&&this.config.enableIMSC1){if(Ov(this.tracks,r))return void(this.tracks=r);if(this.textTracks=[],this.tracks=r,this.config.renderTextTracksNatively){const e=this.media,t=e?qy(e.textTracks):null;if(this.tracks.forEach((e,r)=>{let n;if(t){let r=null;for(let n=0;n<t.length;n++)if(t[n]&&iw(t[n],e)){r=t[n],t[n]=null;break}r&&(n=r)}if(n)Ky(n);else{const t=nw(e);n=this.createTextTrack(t,e.name,e.lang),n&&(n.mode="disabled")}n&&this.textTracks.push(n)}),null!=t&&t.length){const e=t.filter(e=>null!==e).map(e=>e.label);e.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${e.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const e=this.tracks.map(e=>({label:e.name,kind:e.type.toLowerCase(),default:e.default,subtitleTrack:e}));this.hls.trigger(Id.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:e})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(e=>{const t=/(?:CC|SERVICE)([1-4])/.exec(e.instreamId);if(!t)return;const r=`textTrack${t[1]}`,n=this.captionsProperties[r];n&&(n.label=e.name,e.lang&&(n.languageCode=e.lang),n.media=e)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return null==t?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===Md){var r,n;const{cea608Parser1:e,cea608Parser2:i,lastSn:s}=this,{cc:a,sn:o}=t.frag,l=null!=(r=null==(n=t.part)?void 0:n.index)?r:-1;e&&i&&(o!==s+1||o===s&&l!==this.lastPartIndex+1||a!==this.lastCc)&&(e.reset(),i.reset()),this.lastCc=a,this.lastSn=o,this.lastPartIndex=l}}onFragLoaded(e,t){const{frag:r,payload:n}=t;if(r.type===Nd)if(n.byteLength){const e=r.decryptdata,i="stats"in t;if(null==e||!e.encrypted||i){const e=this.tracks[r.level],i=this.vttCCs;i[r.cc]||(i[r.cc]={start:r.start,prevCC:this.prevCC,new:!0},this.prevCC=r.cc),e&&e.textCodec===Vb?this._parseIMSC1(r,n):this._parseVTTs(t)}}else this.hls.trigger(Id.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const r=this.hls;qb(t,this.initPTS[e.cc],t=>{this._appendCues(t,e.level),r.trigger(Id.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},t=>{r.logger.log(`Failed to parse IMSC1: ${t}`),r.trigger(Id.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})})}_parseVTTs(e){var t;const{frag:r,payload:n}=e,{initPTS:i,unparsedVttFrags:s}=this,a=i.length-1;if(!i[r.cc]&&-1===a)return void s.push(e);const o=this.hls;Hb(null!=(t=r.initSegment)&&t.data?Fh(r.initSegment.data,new Uint8Array(n)).buffer:n,this.initPTS[r.cc],this.vttCCs,r.cc,r.start,e=>{this._appendCues(e,r.level),o.trigger(Id.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:r})},t=>{const i="Missing initPTS for VTT MPEGTS"===t.message;i?s.push(e):this._fallbackToIMSC1(r,n),o.logger.log(`Failed to parse VTT cue: ${t}`),i&&a>r.cc||o.trigger(Id.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:t})})}_fallbackToIMSC1(e,t){const r=this.tracks[e.level];r.textCodec||qb(t,this.initPTS[e.cc],()=>{r.textCodec=Vb,this._parseIMSC1(e,t)},()=>{r.textCodec="wvtt"})}_appendCues(e,t){const r=this.hls;if(this.config.renderTextTracksNatively){const r=this.textTracks[t];if(!r||"disabled"===r.mode)return;e.forEach(e=>Wy(r,e))}else{const n=this.tracks[t];if(!n)return;const i=n.default?"default":"subtitles"+t;r.trigger(Id.CUES_PARSED,{type:"subtitles",cues:e,track:i})}}onFragDecrypted(e,t){const{frag:r}=t;r.type===Nd&&this.onFragLoaded(Id.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:r,samples:n}=t;if(r.type!==Md||"NONE"!==this.closedCaptionsForLevel(r))for(let e=0;e<n.length;e++){const t=n[e].bytes;if(t){this.cea608Parser1||this.initCea608Parsers();const r=this.extractCea608Data(t);this.cea608Parser1.addData(n[e].pts,r[0]),this.cea608Parser2.addData(n[e].pts,r[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:r,endOffsetSubtitles:n,type:i}){const{media:s}=this;if(s&&!(s.currentTime<r)){if(!i||"video"===i){const{captionsTracks:e}=this;Object.keys(e).forEach(n=>Yy(e[n],t,r))}if(this.config.renderTextTracksNatively&&0===t&&void 0!==n){const{textTracks:e}=this;Object.keys(e).forEach(r=>Yy(e[r],t,n))}}}extractCea608Data(e){const t=[[],[]],r=31&e[0];let n=2;for(let i=0;i<r;i++){const r=e[n++],i=127&e[n++],s=127&e[n++];if(0===i&&0===s)continue;if(!!(4&r)){const e=3&r;0!==e&&1!==e||(t[e].push(i),t[e].push(s))}}return t}},audioStreamController:class extends rm{constructor(e,t,r){super(e,t,r,"audio-stream-controller",Od),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(Id.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Id.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(Id.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(Id.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(Id.BUFFER_RESET,this.onBufferReset,this),e.on(Id.BUFFER_CREATED,this.onBufferCreated,this),e.on(Id.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(Id.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(Id.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(Id.FRAG_LOADING,this.onFragLoading,this),e.on(Id.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(Id.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Id.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(Id.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(Id.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(Id.BUFFER_RESET,this.onBufferReset,this),e.off(Id.BUFFER_CREATED,this.onBufferCreated,this),e.off(Id.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(Id.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(Id.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(Id.FRAG_LOADING,this.onFragLoading,this),e.off(Id.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:r,initPTS:n,timescale:i,trackId:s}){if(r===Md){const e=t.cc,r=this.fragCurrent;if(this.initPTS[e]={baseTime:n,timescale:i,trackId:s},this.log(`InitPTS for cc: ${e} found from main: ${n/i} (${n}/${i}) trackId: ${s}`),this.mainAnchor=t,this.state===em){const r=this.waitingData;(!r&&!this.loadingParts||r&&r.frag.cc!==e)&&this.syncWithAnchor(t,null==r?void 0:r.frag)}else!this.hls.hasEnoughToStart&&r&&r.cc!==e?(r.abortRequests(),this.syncWithAnchor(t,r)):this.state===Vg&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(e,t){var r;const n=(null==(r=this.mainFragLoading)?void 0:r.frag)||null;if(t&&(null==n?void 0:n.cc)===t.cc)return;const i=(n||e).cc,s=$f(this.getLevelDetails(),i,this.getLoadPosition());s&&(this.log(`Syncing with main frag at ${s.start} cc ${s.cc}`),this.startFragRequested=!1,this.nextLoadPosition=s.start,this.resetLoadingState(),this.state===Vg&&this.doTickIdle())}startLoad(e,t){if(!this.levels)return this.startPosition=e,void(this.state=Hg);const r=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),r>0&&-1===e?(this.log(`Override startPosition with lastCurrentTime @${r.toFixed(3)}`),e=r,this.state=Vg):this.state=qg,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case Vg:this.doTickIdle();break;case qg:{const{levels:e,trackId:t}=this,r=null==e?void 0:e[t],n=null==r?void 0:r.details;if(n&&!this.waitForLive(r)){if(this.waitForCdnTuneIn(n))break;this.state=em}break}case Yg:this.checkRetryDate();break;case em:{const e=this.waitingData;if(e){const{frag:t,part:r,cache:n,complete:i}=e,s=this.mainAnchor;if(void 0!==this.initPTS[t.cc]){this.waitingData=null,this.state=Kg;const e={frag:t,part:r,payload:n.flush().buffer,networkDetails:null};this._handleFragmentLoadProgress(e),i&&super._handleFragmentLoadComplete(e)}else s&&s.cc!==e.frag.cc&&this.syncWithAnchor(s,e.frag)}else this.state=Vg}}this.onTickEnd()}resetLoadingState(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:e}=this;null!=e&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:r,media:n,trackId:i}=this,s=t.config;if(!this.buffering||!n&&!this.primaryPrefetch&&(this.startFragRequested||!s.startFragPrefetch)||null==r||!r[i])return;const a=r[i],o=a.details;if(!o||this.waitForLive(a)||this.waitForCdnTuneIn(o))return this.state=qg,void(this.startFragRequested=!1);const l=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&l&&(this.bufferFlushed=!1,this.afterBufferFlushed(l,dh,Od));const u=this.getFwdBufferInfo(l,Od);if(null===u)return;if(!this.switchingTrack&&this._streamEnded(u,o))return t.trigger(Id.BUFFER_EOS,{type:"audio"}),void(this.state=Zg);const c=u.len,d=t.maxBufferLength,h=o.fragments,f=h[0].start,p=this.getLoadPosition(),g=this.flushing?p:u.end;if(this.switchingTrack&&n){const e=p;o.PTSKnown&&e<f&&(u.end>f||u.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),n.currentTime=f+.05)}if(c>=d&&!this.switchingTrack&&g<h[h.length-1].start)return;let m=this.getNextFragment(g,o);if(m&&this.isLoopLoading(m,g)&&(m=this.getNextFragmentLoopLoading(m,o,u,Md,d)),!m)return void(this.bufferFlushed=!0);let v=(null==(e=this.mainFragLoading)?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&v&&gh(m)&&!m.endList&&(!o.live||!this.loadingParts&&g<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(v)===sp&&(this.mainFragLoading=v=null),v&&gh(v))){if(m.start>v.end){const e=this.fragmentTracker.getFragAtPos(g,Md);e&&e.end>v.end&&(v=e,this.mainFragLoading={frag:e,targetBufferTime:null})}if(m.start>v.end)return}this.loadFragment(m,a,g)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(e=>new Sf(e))}onAudioTrackSwitching(e,t){const r=!!t.url;this.trackId=t.id;const{fragCurrent:n}=this;n&&(n.abortRequests(),this.removeUnbufferedFrags(n.start)),this.resetLoadingState(),r?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==Hg&&(this.setInterval(100),this.state=Vg,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=t,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(e,t){this.mainDetails=t.details;const r=this.cachedTrackLoadedData;r&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(Id.AUDIO_TRACK_LOADED,r))}onAudioTrackLoaded(e,t){var r;const{levels:n}=this,{details:i,id:s,groupId:a,track:o}=t;if(!n)return void this.warn(`Audio tracks reset while loading track ${s} "${o.name}" of "${a}"`);const l=this.mainDetails;if(!l||i.endCC>l.endCC||l.expired)return this.cachedTrackLoadedData=t,void(this.state!==Hg&&(this.state=qg));this.cachedTrackLoadedData=null,this.log(`Audio track ${s} "${o.name}" of "${a}" loaded [${i.startSN},${i.endSN}]${i.lastPartSn?`[part-${i.lastPartSn}-${i.lastPartIndex}]`:""},duration:${i.totalduration}`);const u=n[s];let c=0;if(i.live||null!=(r=u.details)&&r.live){if(this.checkLiveUpdate(i),i.deltaUpdateFailed)return;var d;if(u.details)c=this.alignPlaylists(i,u.details,null==(d=this.levelLastLoaded)?void 0:d.details);i.alignedSliding||(Bg(i,l),i.alignedSliding||Ug(i,l),c=i.fragmentStart)}u.details=i,this.levelLastLoaded=u,this.startFragRequested||this.setStartPosition(l,c),this.hls.trigger(Id.AUDIO_TRACK_UPDATED,{details:i,id:s,groupId:t.groupId}),this.state!==qg||this.waitForCdnTuneIn(i)||(this.state=Vg),this.tick()}_handleFragmentLoadProgress(e){var t;const r=e.frag,{part:n,payload:i}=e,{config:s,trackId:a,levels:o}=this;if(!o)return void this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${r.sn} of level ${r.level} will not be buffered`);const l=o[a];if(!l)return void this.warn("Audio track is undefined on fragment load progress");const u=l.details;if(!u)return this.warn("Audio track details undefined on fragment load progress"),void this.removeUnbufferedFrags(r.start);const c=s.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let d=this.transmuxer;d||(d=this.transmuxer=new _v(this.hls,Od,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const h=this.initPTS[r.cc],f=null==(t=r.initSegment)?void 0:t.data;if(void 0!==h){const e=!1,t=n?n.index:-1,s=-1!==t,a=new Sp(r.level,r.sn,r.stats.chunkCount,i.byteLength,t,s);d.push(i,f,c,"",r,n,u.totalduration,e,a,h)}else{this.log(`Unknown video PTS for cc ${r.cc}, waiting for video PTS before demuxing audio frag ${r.sn} of [${u.startSN} ,${u.endSN}],track ${a}`);const{cache:e}=this.waitingData=this.waitingData||{frag:r,part:n,cache:new im,complete:!1};e.push(new Uint8Array(i)),this.state!==Hg&&(this.state=em)}}_handleFragmentLoadComplete(e){this.waitingData?this.waitingData.complete=!0:super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(e,t){this.bufferFlushed=this.flushing=!1;const r=t.tracks.audio;r&&(this.mediaBuffer=r.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===Md&&gh(t.frag)&&(this.mainFragLoading=t,this.state===Vg&&this.tick())}onFragBuffered(e,t){const{frag:r,part:n}=t;if(r.type===Od)if(this.fragContextChanged(r))this.warn(`Fragment ${r.sn}${n?" p: "+n.index:""} of level ${r.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);else{if(gh(r)){this.fragPrevious=r;const e=this.switchingTrack;e&&(this.bufferedTrack=e,this.switchingTrack=null,this.hls.trigger(Id.AUDIO_TRACK_SWITCHED,jd({},e)))}this.fragBufferedComplete(r,n),this.media&&this.tick()}else this.audioOnly||r.type!==Md||r.elementaryStreams.video||r.elementaryStreams.audiovideo||(this.audioOnly=!0,this.mainFragLoading=null)}onError(e,t){var r;if(t.fatal)this.state=Jg;else switch(t.details){case Ld.FRAG_GAP:case Ld.FRAG_PARSING_ERROR:case Ld.FRAG_DECRYPT_ERROR:case Ld.FRAG_LOAD_ERROR:case Ld.FRAG_LOAD_TIMEOUT:case Ld.KEY_LOAD_ERROR:case Ld.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Od,t);break;case Ld.AUDIO_TRACK_LOAD_ERROR:case Ld.AUDIO_TRACK_LOAD_TIMEOUT:case Ld.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==qg||(null==(r=t.context)?void 0:r.type)!==Dd||(this.state=Vg);break;case Ld.BUFFER_ADD_CODEC_ERROR:case Ld.BUFFER_APPEND_ERROR:if("audio"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)||this.resetLoadingState();break;case Ld.BUFFER_FULL_ERROR:if("audio"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case Ld.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}onBufferFlushing(e,{type:t}){t!==hh&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==hh){this.flushing=!1,this.bufferFlushed=!0,this.state===Zg&&(this.state=Vg);const e=this.mediaBuffer||this.media;e&&(this.afterBufferFlushed(e,t,Od),this.tick())}}_handleTransmuxComplete(e){var t;const r="audio",{hls:n}=this,{remuxResult:i,chunkMeta:s}=e,a=this.getCurrentContext(s);if(!a)return void this.resetWhenMissingContext(s);const{frag:o,part:l,level:u}=a,{details:c}=u,{audio:d,text:h,id3:f,initSegment:p}=i;if(!this.fragContextChanged(o)&&c){if(this.state=Xg,this.switchingTrack&&d&&this.completeAudioSwitch(this.switchingTrack),null!=p&&p.tracks){const e=o.initSegment||o;if(this.unhandledEncryptionError(p,o))return;this._bufferInitSegment(u,p.tracks,e,s),n.trigger(Id.FRAG_PARSING_INIT_SEGMENT,{frag:e,id:r,tracks:p.tracks})}if(d){const{startPTS:e,endPTS:t,startDTS:r,endDTS:n}=d;l&&(l.elementaryStreams[dh]={startPTS:e,endPTS:t,startDTS:r,endDTS:n}),o.setElementaryStreamInfo(dh,e,t,r,n),this.bufferFragmentData(d,o,l,s)}if(null!=f&&null!=(t=f.samples)&&t.length){const e=Ud({id:r,frag:o,details:c},f);n.trigger(Id.FRAG_PARSING_METADATA,e)}if(h){const e=Ud({id:r,frag:o,details:c},h);n.trigger(Id.FRAG_PARSING_USERDATA,e)}}else this.fragmentTracker.removeFragment(o)}_bufferInitSegment(e,t,r,n){if(this.state!==Xg)return;if(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio)return;const i=t.audio;i.id=Od;const s=e.audioCodec;this.log(`Init audio buffer, container:${i.container}, codecs[level/parsed]=[${s}/${i.codec}]`),s&&1===s.split(",").length&&(i.levelCodec=s),this.hls.trigger(Id.BUFFER_CODECS,t);const a=i.initSegment;if(null!=a&&a.byteLength){const e={type:"audio",frag:r,part:null,chunkMeta:n,parent:r.type,data:a};this.hls.trigger(Id.BUFFER_APPENDING,e)}this.tickImmediate()}loadFragment(e,t,r){const n=this.fragmentTracker.getState(e);var i;if(this.switchingTrack||n===rp||n===ip)if(gh(e))if(null!=(i=t.details)&&i.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=em;const r=this.mainDetails;r&&r.fragmentStart!==t.details.fragmentStart&&Ug(t.details,r)}else super.loadFragment(e,t,r);else this._loadInitSegment(e,t);else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:r,assocLang:n,characteristics:i,audioCodec:s,channels:a}=this.bufferedTrack;Cf({name:t,lang:r,assocLang:n,characteristics:i,audioCodec:s,channels:a},e,Pf)||(_f(e.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=e)}}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(Id.AUDIO_TRACK_SWITCHED,jd({},e))}},audioTrackController:class extends Mv{constructor(e){super(e,"audio-track-controller"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Id.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Id.LEVEL_LOADING,this.onLevelLoading,this),e.on(Id.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(Id.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(Id.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Id.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Id.LEVEL_LOADING,this.onLevelLoading,this),e.off(Id.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(Id.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(Id.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:r,groupId:n,details:i}=t,s=this.tracksInGroup[r];if(!s||s.groupId!==n)return void this.warn(`Audio track with id:${r} and group:${n} not found in active group ${null==s?void 0:s.groupId}`);const a=s.details;s.details=t.details,this.log(`Audio track ${r} "${s.name}" lang:${s.lang} group:${n} loaded [${i.startSN}-${i.endSN}]`),r===this.trackId&&this.playlistLoaded(r,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const r=t.audioGroups||null,n=this.groupIds;let i=this.currentTrack;if(!r||(null==n?void 0:n.length)!==(null==r?void 0:r.length)||null!=r&&r.some(e=>-1===(null==n?void 0:n.indexOf(e)))){this.groupIds=r,this.trackId=-1,this.currentTrack=null;const e=this.tracks.filter(e=>!r||-1!==r.indexOf(e.groupId));if(e.length)this.selectDefaultTrack&&!e.some(e=>e.default)&&(this.selectDefaultTrack=!1),e.forEach((e,t)=>{e.id=t});else if(!i&&!this.tracksInGroup.length)return;this.tracksInGroup=e;const t=this.hls.config.audioPreference;if(!i&&t){const r=If(t,e,Pf);if(r>-1)i=e[r];else{const e=If(t,this.tracks);i=this.tracks[e]}}let n=this.findTrackId(i);-1===n&&i&&(n=this.findTrackId(null));const a={audioTracks:e};this.log(`Updating audio tracks, ${e.length} track(s) found in group(s): ${null==r?void 0:r.join(",")}`),this.hls.trigger(Id.AUDIO_TRACKS_UPDATED,a);const o=this.trackId;if(-1!==n&&-1===o)this.setAudioTrack(n);else if(e.length&&-1===o){var s;const t=new Error(`No audio track selected for current audio group-ID(s): ${null==(s=this.groupIds)?void 0:s.join(",")} track count: ${e.length}`);this.warn(t.message),this.hls.trigger(Id.ERROR,{type:Rd.MEDIA_ERROR,details:Ld.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:t})}}}onError(e,t){!t.fatal&&t.context&&(t.context.type!==Dd||t.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(t.context.groupId)||this.checkRetry(t))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const r=this.allAudioTracks;if(this.selectDefaultTrack=!1,r.length){const n=this.currentTrack;if(n&&Cf(e,n,Pf))return n;const i=If(e,this.tracksInGroup,Pf);if(i>-1){const e=this.tracksInGroup[i];return this.setAudioTrack(i),e}if(n){let n=t.loadLevel;-1===n&&(n=t.firstAutoLevel);const i=function(e,t,r,n,i){const s=t[n],a=t.reduce((e,t,r)=>{const n=t.uri;return(e[n]||(e[n]=[])).push(r),e},{})[s.uri];a.length>1&&(n=Math.max.apply(Math,a));const o=s.videoRange,l=s.frameRate,u=s.codecSet.substring(0,4),c=Df(t,n,t=>{if(t.videoRange!==o||t.frameRate!==l||t.codecSet.substring(0,4)!==u)return!1;const n=t.audioGroups,s=r.filter(e=>!n||-1!==n.indexOf(e.groupId));return If(e,s,i)>-1});return c>-1?c:Df(t,n,t=>{const n=t.audioGroups,s=r.filter(e=>!n||-1!==n.indexOf(e.groupId));return If(e,s,i)>-1})}(e,t.levels,r,n,Pf);if(-1===i)return null;t.nextLoadLevel=i}if(e.channels||e.audioCodec){const t=If(e,r);if(t>-1)return r[t]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length)return void this.warn(`Invalid audio track id: ${e}`);this.selectDefaultTrack=!1;const r=this.currentTrack,n=t[e],i=n.details&&!n.details.live;if(e===this.trackId&&n===r&&i)return;if(this.log(`Switching to audio-track ${e} "${n.name}" lang:${n.lang} group:${n.groupId} channels:${n.channels}`),this.trackId=e,this.currentTrack=n,this.hls.trigger(Id.AUDIO_TRACK_SWITCHING,jd({},n)),i)return;const s=this.switchParams(n.url,null==r?void 0:r.details,n.details);this.loadPlaylist(s)}findTrackId(e){const t=this.tracksInGroup;for(let r=0;r<t.length;r++){const n=t[r];if((!this.selectDefaultTrack||n.default)&&(!e||Cf(e,n,Pf)))return r}if(e){const{name:r,lang:n,assocLang:i,characteristics:s,audioCodec:a,channels:o}=e;for(let e=0;e<t.length;e++){if(Cf({name:r,lang:n,assocLang:i,characteristics:s,audioCodec:a,channels:o},t[e],Pf))return e}for(let r=0;r<t.length;r++){const n=t[r];if(Nv(e.attrs,n.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return r}for(let r=0;r<t.length;r++){const n=t[r];if(Nv(e.attrs,n.attrs,["LANGUAGE"]))return r}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&_f(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const r=e.id,n=e.groupId,i=this.getUrlWithDirectives(e.url,t),s=e.details,a=null==s?void 0:s.age;this.log(`Loading audio-track ${r} "${e.name}" lang:${e.lang} group:${n}${void 0!==(null==t?void 0:t.msn)?" at sn "+t.msn+" part "+t.part:""}${a&&s.live?" age "+a.toFixed(1)+(s.type&&" "+s.type||""):""} ${i}`),this.hls.trigger(Id.AUDIO_TRACK_LOADING,{url:i,id:r,groupId:n,deliveryDirectives:t||null,track:e})}},emeController:Uy,cmcdController:class{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=e=>{try{this.apply(e,{ot:Vv.MANIFEST,su:!this.initialized})}catch(e){this.hls.logger.warn("Could not generate manifest CMCD data.",e)}},this.applyFragmentData=e=>{try{const{frag:t,part:r}=e,n=this.hls.levels[t.level],i=this.getObjectType(t),s={d:1e3*(r||t).duration,ot:i};i!==Vv.VIDEO&&i!==Vv.AUDIO&&i!=Vv.MUXED||(s.br=n.bitrate/1e3,s.tb=this.getTopBandwidth(i)/1e3,s.bl=this.getBufferLength(i));const a=r?this.getNextPart(r):this.getNextFrag(t);null!=a&&a.url&&a.url!==t.url&&(s.nor=a.url),this.apply(e,s)}catch(e){this.hls.logger.warn("Could not generate segment CMCD data.",e)}},this.hls=e;const t=this.config=e.config,{cmcd:r}=t;null!=r&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=r.sessionId||e.sessionId,this.cid=r.contentId,this.useHeaders=!0===r.useHeaders,this.includeKeys=r.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(Id.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Id.MEDIA_DETACHED,this.onMediaDetached,this),e.on(Id.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(Id.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Id.MEDIA_DETACHED,this.onMediaDetached,this),e.off(Id.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var r,n;this.audioBuffer=null==(r=t.tracks.audio)?void 0:r.buffer,this.videoBuffer=null==(n=t.tracks.video)?void 0:n.buffer}createData(){var e;return{v:1,sf:Wv.HLS,sid:this.sid,cid:this.cid,pr:null==(e=this.media)?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){Ud(t,this.createData());const r=t.ot===Vv.INIT||t.ot===Vv.VIDEO||t.ot===Vv.MUXED;this.starved&&r&&(t.bs=!0,t.su=!0,this.starved=!1),null==t.su&&(t.su=this.buffering);const{includeKeys:n}=this;n&&(t=Object.keys(t).reduce((e,r)=>(n.includes(r)&&(e[r]=t[r]),e),{}));const i={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),My(e.headers,t,i)):e.url=Fy(e.url,t,i)}getNextFrag(e){var t;const r=null==(t=this.hls.levels[e.level])?void 0:t.details;if(r){const t=e.sn-r.startSN;return r.fragments[t+1]}}getNextPart(e){var t;const{index:r,fragment:n}=e,i=null==(t=this.hls.levels[n.level])||null==(t=t.details)?void 0:t.partList;if(i){const{sn:e}=n;for(let t=i.length-1;t>=0;t--){const n=i[t];if(n.index===r&&n.fragment.sn===e)return i[t+1]}}}getObjectType(e){const{type:t}=e;return"subtitle"===t?Vv.TIMED_TEXT:"initSegment"===e.sn?Vv.INIT:"audio"===t?Vv.AUDIO:"main"===t?this.hls.audioTracks.length?Vv.VIDEO:Vv.MUXED:void 0}getTopBandwidth(e){let t,r=0;const n=this.hls;if(e===Vv.AUDIO)t=n.audioTracks;else{const e=n.maxAutoLevel,r=e>-1?e+1:n.levels.length;t=n.levels.slice(0,r)}return t.forEach(e=>{e.bitrate>r&&(r=e.bitrate)}),r>0?r:NaN}getBufferLength(e){const t=this.media,r=e===Vv.AUDIO?this.audioBuffer:this.videoBuffer;if(!r||!t)return NaN;return 1e3*kp.bufferInfo(r,t.currentTime,this.config.maxBufferHole).len}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,r=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new r(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,r,n){t(e),this.loader.load(e,r,n)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,r=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new r(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,r,n){t(e),this.loader.load(e,r,n)}}}},contentSteeringController:class extends Gd{constructor(e){super("content-steering",e.logger),this.hls=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this._pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Id.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Id.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Id.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Id.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Id.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Id.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce((e,t)=>(-1===e.indexOf(t.pathwayId)&&e.push(t.pathwayId),e),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(e){this.updatePathwayPriority(e)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=1e3*this.timeToLoad-(performance.now()-this.updated);if(e>0)return void this.scheduleRefresh(this.uri,e)}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){-1!==this.reloadTimer&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(t=>t!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:r}=t;null!==r&&(this.pathwayId=r.pathwayId,this.uri=r.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:r}=t;if((null==r?void 0:r.action)===Yf&&r.flags===Zf){const e=this.levels;let n=this._pathwayPriority,i=this.pathwayId;if(t.context){const{groupId:r,pathwayId:n,type:s}=t.context;r&&e?i=this.getPathwayForGroupId(r,s,i):n&&(i=n)}i in this.penalizedPathways||(this.penalizedPathways[i]=performance.now()),!n&&e&&(n=this.pathways()),n&&n.length>1&&(this.updatePathwayPriority(n),r.resolved=this.pathwayId!==i),t.details!==Ld.BUFFER_APPEND_ERROR||t.fatal?r.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${i} levels: ${e?e.length:e} priorities: ${xf(n)} penalized: ${xf(this.penalizedPathways)}`):r.resolved=!0}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(0===t.length){const r=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${r}"`),t=this.getLevelsForPathway(r),this.pathwayId=r}return t.length!==e.length&&this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t}getLevelsForPathway(e){return null===this.levels?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){let t;this._pathwayPriority=e;const r=this.penalizedPathways,n=performance.now();Object.keys(r).forEach(e=>{n-r[e]>3e5&&delete r[e]});for(let n=0;n<e.length;n++){const i=e[n];if(i in r)continue;if(i===this.pathwayId)return;const s=this.hls.nextLoadLevel,a=this.hls.levels[s];if(t=this.getLevelsForPathway(i),t.length>0){this.log(`Setting Pathway to "${i}"`),this.pathwayId=i,_g(t),this.hls.trigger(Id.LEVELS_UPDATED,{levels:t});const e=this.hls.levels[s];a&&e&&this.levels&&(e.attrs["STABLE-VARIANT-ID"]!==a.attrs["STABLE-VARIANT-ID"]&&e.bitrate!==a.bitrate&&this.log(`Unstable Pathways change from bitrate ${a.bitrate} to ${e.bitrate}`),this.hls.nextLoadLevel=s);break}}}getPathwayForGroupId(e,t,r){const n=this.getLevelsForPathway(r).concat(this.levels||[]);for(let r=0;r<n.length;r++)if(t===Dd&&n[r].hasAudioGroup(e)||t===_d&&n[r].hasSubtitleGroup(e))return n[r].pathwayId;return r}clonePathways(e){const t=this.levels;if(!t)return;const r={},n={};e.forEach(e=>{const{ID:i,"BASE-ID":s,"URI-REPLACEMENT":a}=e;if(t.some(e=>e.pathwayId===i))return;const o=this.getLevelsForPathway(s).map(e=>{const t=new Dp(e.attrs);t["PATHWAY-ID"]=i;const s=t.AUDIO&&`${t.AUDIO}_clone_${i}`,o=t.SUBTITLES&&`${t.SUBTITLES}_clone_${i}`;s&&(r[t.AUDIO]=s,t.AUDIO=s),o&&(n[t.SUBTITLES]=o,t.SUBTITLES=o);const l=By(e.uri,t["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",a),u=new Sf({attrs:t,audioCodec:e.audioCodec,bitrate:e.bitrate,height:e.height,name:e.name,url:l,videoCodec:e.videoCodec,width:e.width});if(e.audioGroups)for(let t=1;t<e.audioGroups.length;t++)u.addGroupId("audio",`${e.audioGroups[t]}_clone_${i}`);if(e.subtitleGroups)for(let t=1;t<e.subtitleGroups.length;t++)u.addGroupId("text",`${e.subtitleGroups[t]}_clone_${i}`);return u});t.push(...o),$y(this.audioTracks,r,a,i),$y(this.subtitleTracks,n,a,i)})}loadSteeringManifest(e){const t=this.hls.config,r=t.loader;let n;this.loader&&this.loader.destroy(),this.loader=new r(t);try{n=new self.URL(e)}catch(t){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest URI: ${e}`)}if("data:"!==n.protocol){const e=0|(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate);n.searchParams.set("_HLS_pathway",this.pathwayId),n.searchParams.set("_HLS_throughput",""+e)}const i={responseType:"json",url:n.href},s=t.steeringManifestLoadPolicy.default,a=s.errorRetry||s.timeoutRetry||{},o={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},l={onSuccess:(e,t,r,i)=>{this.log(`Loaded steering manifest: "${n}"`);const s=e.data;if(1!==(null==s?void 0:s.VERSION))return void this.log(`Steering VERSION ${s.VERSION} not supported!`);this.updated=performance.now(),this.timeToLoad=s.TTL;const{"RELOAD-URI":a,"PATHWAY-CLONES":o,"PATHWAY-PRIORITY":l}=s;if(a)try{this.uri=new self.URL(a,n).href}catch(e){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest RELOAD-URI: ${a}`)}this.scheduleRefresh(this.uri||r.url),o&&this.clonePathways(o);const u={steeringManifest:s,url:n.toString()};this.hls.trigger(Id.STEERING_MANIFEST_LOADED,u),l&&this.updatePathwayPriority(l)},onError:(e,t,r,n)=>{if(this.log(`Error loading steering manifest: ${e.code} ${e.text} (${t.url})`),this.stopLoad(),410===e.code)return this.enabled=!1,void this.log(`Steering manifest ${t.url} no longer available`);let i=1e3*this.timeToLoad;if(429===e.code){const e=this.loader;if("function"==typeof(null==e?void 0:e.getResponseHeader)){const t=e.getResponseHeader("Retry-After");t&&(i=1e3*parseFloat(t))}return void this.log(`Steering manifest ${t.url} rate limited`)}this.scheduleRefresh(this.uri||t.url,i)},onTimeout:(e,t,r)=>{this.log(`Timeout loading steering manifest (${t.url})`),this.scheduleRefresh(this.uri||t.url)}};this.log(`Requesting steering manifest: ${n}`),this.loader.load(i,o,l)}scheduleRefresh(e,t=1e3*this.timeToLoad){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var t;const r=null==(t=this.hls)?void 0:t.media;!r||r.ended?this.scheduleRefresh(e,1e3*this.timeToLoad):this.loadSteeringManifest(e)},t)}},interstitialsController:class extends Gd{constructor(e,t){super("interstitials",e.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{const e=this.currentTime;if(void 0===e||this.playbackDisabled||!this.schedule)return;const t=e-this.timelinePos;if(Math.abs(t)<1/7056e5)return;const r=t<=-.01;this.timelinePos=e,this.bufferedPos=e;const n=this.playingItem;if(!n)return void this.checkBuffer();if(r){this.schedule.resetErrorsInRange(e,e-t)&&this.updateSchedule(!0)}if(this.checkBuffer(),r&&e<n.start||e>=n.end){var i;const t=this.findItemIndex(n);let s=this.schedule.findItemIndexAtTime(e);if(-1===s&&(s=t+(r?-1:1),this.log(`seeked ${r?"back ":""}to position not covered by schedule ${e} (resolving from ${t} to ${s})`)),!this.isInterstitial(n)&&null!=(i=this.media)&&i.paused&&(this.shouldPlay=!1),!r&&s>t){const e=this.schedule.findJumpRestrictedIndex(t+1,s);if(e>t)return void this.setSchedulePosition(e)}return void this.setSchedulePosition(s)}const s=this.playingAsset;if(!s){if(this.playingLastItem&&this.isInterstitial(n)){const t=n.event.assetList[0];t&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(e,t))}return}const a=s.timelineStart,o=s.duration||0;var l;(r&&e<a||e>=a+o)&&(null!=(l=n.event)&&l.appendInPlace&&(this.clearAssetPlayers(n.event,n),this.flushFrontBuffer(e)),this.setScheduleToAssetAtTime(e,s))},this.onTimeupdate=()=>{const e=this.currentTime;if(void 0===e||this.playbackDisabled)return;if(!(e>this.timelinePos))return;this.timelinePos=e,e>this.bufferedPos&&this.checkBuffer();const t=this.playingItem;if(!t||this.playingLastItem)return;if(e>=t.end){this.timelinePos=t.end;const e=this.findItemIndex(t);this.setSchedulePosition(e+1)}const r=this.playingAsset;if(!r)return;e>=r.timelineStart+(r.duration||0)&&this.setScheduleToAssetAtTime(e,r)},this.onScheduleUpdate=(e,t)=>{const r=this.schedule;if(!r)return;const n=this.playingItem,i=r.events||[],s=r.items||[],a=r.durations,o=e.map(e=>e.identifier),l=!(!i.length&&!o.length);(l||t)&&this.log(`INTERSTITIALS_UPDATED (${i.length}): ${i}\nSchedule: ${s.map(e=>ob(e))} pos: ${this.timelinePos}`),o.length&&this.log(`Removed events ${o}`);let u=null,c=null;n&&(u=this.updateItem(n,this.timelinePos),this.itemsMatch(n,u)?this.playingItem=u:this.waitingItem=this.endedItem=null),this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const d=this.bufferingItem;if(d&&(c=this.updateItem(d,this.bufferedPos),this.itemsMatch(d,c)?this.bufferingItem=c:d.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(d.event,null))),e.forEach(e=>{e.assetList.forEach(e=>{this.clearAssetPlayer(e.identifier,null)})}),this.playerQueue.forEach(e=>{if(e.interstitial.appendInPlace){const t=e.assetItem.timelineStart,r=e.timelineOffset-t;if(r)try{e.timelineOffset=t}catch(n){Math.abs(r)>Qy&&this.warn(`${n} ("${e.assetId}" ${e.timelineOffset}->${t})`)}}}),l||t){if(this.hls.trigger(Id.INTERSTITIALS_UPDATED,{events:i.slice(0),schedule:s.slice(0),durations:a,removedIds:o}),this.isInterstitial(n)&&o.includes(n.event.identifier))return this.warn(`Interstitial "${n.event.identifier}" removed while playing`),void this.primaryFallback(n.event);n&&this.trimInPlace(u,n),d&&c!==u&&this.trimInPlace(c,d),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new lb(e),this.schedule=new ab(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e&&(e.on(Id.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Id.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Id.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Id.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(Id.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(Id.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(Id.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(Id.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(Id.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(Id.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(Id.BUFFER_APPENDED,this.onBufferAppended,this),e.on(Id.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(Id.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(Id.MEDIA_ENDED,this.onMediaEnded,this),e.on(Id.ERROR,this.onError,this),e.on(Id.DESTROYING,this.onDestroying,this))}unregisterListeners(){const e=this.hls;e&&(e.off(Id.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Id.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Id.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Id.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(Id.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(Id.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(Id.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(Id.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(Id.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(Id.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(Id.BUFFER_CODECS,this.onBufferCodecs,this),e.off(Id.BUFFER_APPENDED,this.onBufferAppended,this),e.off(Id.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(Id.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(Id.MEDIA_ENDED,this.onMediaEnded,this),e.off(Id.ERROR,this.onError,this),e.off(Id.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var e;null==(e=this.getBufferingPlayer())||e.resumeBuffering()}pauseBuffering(){var e;null==(e=this.getBufferingPlayer())||e.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.schedule=this.manager=null,this.hls=this.HlsPlayerClass=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){jg(e,"play",this.onPlay),jg(e,"pause",this.onPause),jg(e,"seeking",this.onSeeking),jg(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const r=this.media=t.media;zg(r,"seeking",this.onSeeking),zg(r,"timeupdate",this.onTimeupdate),zg(r,"play",this.onPlay),zg(r,"pause",this.onPause)}onMediaAttached(e,t){const r=this.effectivePlayingItem,n=this.detachedData;if(this.detachedData=null,null===r)this.checkStart();else if(!n){this.clearScheduleState();const e=this.findItemIndex(r);this.setSchedulePosition(e)}}clearScheduleState(){this.log("clear schedule state"),this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const r=!!t.transferMedia,n=this.media;if(this.media=null,!r&&(n&&this.removeMediaListeners(n),this.detachedData)){const e=this.getBufferingPlayer();e&&(this.log(`Removing schedule state for detachedData and ${e}`),this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,e.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.hls)return null;if(this.manager)return this.manager;const e=this,t=()=>e.bufferingItem||e.waitingItem,r=t=>t?e.getAssetPlayer(t.identifier):t,n=(t,n,s,a,o)=>{if(t){let l=t[n].start;const u=t.event;if(u){if("playout"===n||u.timelineOccupancy!==Zy.Point){const e=r(s);(null==e?void 0:e.interstitial)===u&&(l+=e.assetItem.startOffset+e[o])}}else{l+=("bufferedPos"===a?i():e[a])-t.start}return l}return 0},i=()=>{const t=e.bufferedPos;return t===Number.MAX_VALUE?s("primary"):Math.max(t,0)},s=t=>{var r,n;return null!=(r=e.primaryDetails)&&r.live?e.primaryDetails.edge:(null==(n=e.schedule)?void 0:n.durations[t])||0},a=(t,i)=>{var s,a;const o=e.effectivePlayingItem;if(null!=o&&null!=(s=o.event)&&s.restrictions.skip||!e.schedule)return;e.log(`seek to ${t} "${i}"`);const l=e.effectivePlayingItem,u=e.schedule.findItemIndexAtTime(t,i),c=null==(a=e.schedule.items)?void 0:a[u],d=e.getBufferingPlayer(),h=null==d?void 0:d.interstitial,f=null==h?void 0:h.appendInPlace,p=l&&e.itemsMatch(l,c);if(l&&(f||p)){const s=r(e.playingAsset),a=(null==s?void 0:s.media)||e.primaryMedia;if(a){const r="primary"===i?a.currentTime:n(l,i,e.playingAsset,"timelinePos","currentTime"),o=t-r,u=(f?r:a.currentTime)+o;if(u>=0&&(!s||f||u<=s.duration))return void(a.currentTime=u)}}if(c){let r=t;if("primary"!==i){const e=t-c[i].start;r=c.start+e}const n=!e.isInterstitial(c);if(e.isInterstitial(l)&&!l.event.appendInPlace||!n&&!c.event.appendInPlace){if(l){const s=e.findItemIndex(l);if(u>s){const t=e.schedule.findJumpRestrictedIndex(s+1,u);if(t>s)return void e.setSchedulePosition(t)}let a=0;if(n)e.timelinePos=r,e.checkBuffer();else{const e=c.event.assetList,r=t-(c[i]||c).start;for(let t=e.length;t--;){const n=e[t];if(n.duration&&r>=n.startOffset&&r<n.startOffset+n.duration){a=t;break}}}e.setSchedulePosition(u,a)}}else{const t=e.media||(f?null==d?void 0:d.media:null);t&&(t.currentTime=r)}}},o=()=>{const r=e.effectivePlayingItem;if(e.isInterstitial(r))return r;const n=t();return e.isInterstitial(n)?n:null},l={get bufferedEnd(){const r=t(),i=e.bufferingItem;var s;return i&&i===r&&(n(i,"playout",e.bufferingAsset,"bufferedPos","bufferedEnd")-i.playout.start||(null==(s=e.bufferingAsset)?void 0:s.startOffset))||0},get currentTime(){const t=o(),r=e.effectivePlayingItem;return r&&r===t?n(r,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-r.playout.start:0},set currentTime(t){const r=o(),n=e.effectivePlayingItem;n&&n===r&&a(t+n.playout.start,"playout")},get duration(){const e=o();return e?e.playout.end-e.playout.start:0},get assetPlayers(){var t;const r=null==(t=o())?void 0:t.event.assetList;return r?r.map(t=>e.getAssetPlayer(t.identifier)):[]},get playingIndex(){var t;const r=null==(t=o())?void 0:t.event;return r&&e.effectivePlayingAsset?r.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return o()}};return this.manager={get events(){var t;return(null==(t=e.schedule)||null==(t=t.events)?void 0:t.slice(0))||[]},get schedule(){var t;return(null==(t=e.schedule)||null==(t=t.items)?void 0:t.slice(0))||[]},get interstitialPlayer(){return o()?l:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const r=t();return e.findItemIndex(r)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const t=e.effectivePlayingItem;return e.findItemIndex(t)},primary:{get bufferedEnd(){return i()},get currentTime(){const t=e.timelinePos;return t>0?t:0},set currentTime(e){a(e,"primary")},get duration(){return s("primary")},get seekableStart(){var t;return(null==(t=e.primaryDetails)?void 0:t.fragmentStart)||0}},integrated:{get bufferedEnd(){return n(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return n(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(e){a(e,"integrated")},get duration(){return s("integrated")},get seekableStart(){var t;return((t,r)=>{var n;if(0!==t&&"primary"!==r&&null!=(n=e.schedule)&&n.length){var i;const n=e.schedule.findItemIndexAtTime(t),s=null==(i=e.schedule.items)?void 0:i[n];if(s)return t+(s[r].start-s.start)}return t})((null==(t=e.primaryDetails)?void 0:t.fragmentStart)||0,"integrated")}},skip:()=>{const t=e.effectivePlayingItem,r=null==t?void 0:t.event;if(r&&!r.restrictions.skip){const n=e.findItemIndex(t);if(r.appendInPlace){const e=t.playout.start+t.event.duration;a(e+.001,"playout")}else e.advanceAfterAssetEnded(r,n,1/0)}}}}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,r=null==(e=this.schedule)?void 0:e.items;return!!(this.playbackStarted&&t&&r)&&this.findItemIndex(t)===r.length-1}get playbackStarted(){return null!==this.effectivePlayingItem}get currentTime(){var e,t;if(null===this.mediaSelection)return;const r=this.waitingItem||this.playingItem;if(this.isInterstitial(r)&&!r.event.appendInPlace)return;let n=this.media;!n&&null!=(e=this.bufferingItem)&&null!=(e=e.event)&&e.appendInPlace&&(n=this.primaryMedia);const i=null==(t=n)?void 0:t.currentTime;return void 0!==i&&kd(i)?i:void 0}get primaryMedia(){var e;return this.media||(null==(e=this.detachedData)?void 0:e.media)||null}isInterstitial(e){return!(null==e||!e.event)}retreiveMediaSource(e,t){const r=this.getAssetPlayer(e);r&&this.transferMediaFromPlayer(r,t)}transferMediaFromPlayer(e,t){const r=e.interstitial.appendInPlace,n=e.media;if(r&&n===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&n)return void(this.detachedData={media:n});const r=e.transferMedia();this.log(`transfer MediaSource from ${e} ${xf(r)}`),this.detachedData=r}else t&&n&&(this.shouldPlay||(this.shouldPlay=!n.paused))}transferMediaTo(e,t){var r,n;if(e.media===t)return;let i=null;const s=this.hls,a=e!==s,o=a&&e.interstitial.appendInPlace,l=null==(r=this.detachedData)?void 0:r.mediaSource;let u;if(s.media)o&&(i=s.transferMedia(),this.detachedData=i),u="Primary";else if(l){const e=this.getBufferingPlayer();e?(i=e.transferMedia(),u=`${e}`):u="detached MediaSource"}else u="detached media";if(!i)if(l)i=this.detachedData,this.log(`using detachedData: MediaSource ${xf(i)}`);else if(!this.detachedData||s.media===t){const e=this.playerQueue;e.length>1&&e.forEach(e=>{if(a&&e.interstitial.appendInPlace!==o){const t=e.interstitial;this.clearInterstitial(e.interstitial,null),t.appendInPlace=!1,t.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${t}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}const c=i&&"mediaSource"in i&&"closed"!==(null==(n=i.mediaSource)?void 0:n.readyState),d=c&&i?i:t;this.log(`${c?"transfering MediaSource":"attaching media"} to ${a?e:"Primary"} from ${u} (media.currentTime: ${t.currentTime})`);const h=this.schedule;if(d===i&&h){const t=a&&e.assetId===h.assetIdAtEnd;d.overrides={duration:h.duration,endOfStream:!a||t,cueRemoval:!a}}e.attachMedia(d)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=null==e?void 0:e.events;if(!t||this.playbackDisabled||!this.media)return;-1===this.bufferedPos&&(this.bufferedPos=0);const r=this.timelinePos,n=this.effectivePlayingItem;if(-1===r){const r=this.hls.startPosition;if(this.log(cb("checkStart",r)),this.timelinePos=r,t.length&&t[0].cue.pre){const r=e.findEventIndex(t[0].identifier);this.setSchedulePosition(r)}else if(r>=0||!this.primaryLive){const t=this.timelinePos=r>0?r:0,n=e.findItemIndexAtTime(t);this.setSchedulePosition(n)}}else if(n&&!this.playingItem){const t=e.findItemIndex(n);this.setSchedulePosition(t)}}advanceAssetBuffering(e,t){const r=e.event,n=r.findAssetIndex(t),i=nb(r,n);if(r.isAssetPastPlayoutLimit(i)){if(this.schedule){var s;const t=null==(s=this.schedule.items)?void 0:s[this.findItemIndex(e)+1];t&&this.bufferedToItem(t)}}else this.bufferedToEvent(e,i)}advanceAfterAssetEnded(e,t,r){const n=nb(e,r);if(e.isAssetPastPlayoutLimit(n)){if(this.schedule){const r=this.schedule.items;if(r){const n=t+1;if(n>=r.length)return void this.setSchedulePosition(-1);const i=e.resumeTime;this.timelinePos<i&&(this.log(cb("advanceAfterAssetEnded",i)),this.timelinePos=i,e.appendInPlace&&this.advanceInPlace(i),this.checkBuffer(this.bufferedPos<i)),this.setSchedulePosition(n)}}}else{if(e.appendInPlace){const t=e.assetList[n];t&&this.advanceInPlace(t.timelineStart)}this.setSchedulePosition(t,n)}}setScheduleToAssetAtTime(e,t){const r=this.schedule;if(!r)return;const n=t.parentIdentifier,i=r.getEvent(n);if(i){const t=r.findEventIndex(n),s=r.findAssetIndex(i,e);this.advanceAfterAssetEnded(i,t,s-1)}}setSchedulePosition(e,t){var r;const n=null==(r=this.schedule)?void 0:r.items;if(!n||this.playbackDisabled)return;const i=e>=0?n[e]:null;this.log(`setSchedulePosition ${e}, ${t} (${i?ob(i):i}) pos: ${this.timelinePos}`);const s=this.waitingItem||this.playingItem,a=this.playingLastItem;if(this.isInterstitial(s)){const r=s.event,u=this.playingAsset,c=null==u?void 0:u.identifier,d=c?this.getAssetPlayer(c):null;if(d&&c&&(!this.eventItemsMatch(s,i)||void 0!==t&&c!==r.assetList[t].identifier)){var o;const t=r.findAssetIndex(u);if(this.log(`INTERSTITIAL_ASSET_ENDED ${t+1}/${r.assetList.length} ${ib(u)}`),this.endedAsset=u,this.playingAsset=null,this.hls.trigger(Id.INTERSTITIAL_ASSET_ENDED,{asset:u,assetListIndex:t,event:r,schedule:n.slice(0),scheduleIndex:e,player:d}),s!==this.playingItem)return void(this.itemsMatch(s,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(r,this.findItemIndex(this.playingItem),t));this.retreiveMediaSource(c,i),!d.media||null!=(o=this.detachedData)&&o.mediaSource||d.detachMedia()}if(!this.eventItemsMatch(s,i)&&(this.endedItem=s,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${r} ${ob(s)}`),r.hasPlayed=!0,this.hls.trigger(Id.INTERSTITIAL_ENDED,{event:r,schedule:n.slice(0),scheduleIndex:e}),r.cue.once)){var l;this.updateSchedule();const e=null==(l=this.schedule)?void 0:l.items;if(i&&e){const r=this.findItemIndex(i);this.advanceSchedule(r,e,t,s,a)}return}}this.advanceSchedule(e,n,t,s,a)}advanceSchedule(e,t,r,n,i){const s=this.schedule;if(!s)return;const a=t[e]||null,o=this.primaryMedia,l=this.playerQueue;if(l.length&&l.forEach(t=>{const r=t.interstitial,n=s.findEventIndex(r.identifier);(n<e||n>e+1)&&this.clearInterstitial(r,a)}),this.isInterstitial(a)){this.timelinePos=Math.min(Math.max(this.timelinePos,a.start),a.end);const i=a.event;if(void 0===r){const t=nb(i,(r=s.findAssetIndex(i,this.timelinePos))-1);if(i.isAssetPastPlayoutLimit(t)||i.appendInPlace&&this.timelinePos===a.end)return void this.advanceAfterAssetEnded(i,e,r);r=t}const l=this.waitingItem;this.assetsBuffered(a,o)||this.setBufferingItem(a);let u=this.preloadAssets(i,r);if(this.eventItemsMatch(a,l||n)||(this.waitingItem=a,this.log(`INTERSTITIAL_STARTED ${ob(a)} ${i.appendInPlace?"append in place":""}`),this.hls.trigger(Id.INTERSTITIAL_STARTED,{event:i,schedule:t.slice(0),scheduleIndex:e})),!i.assetListLoaded)return void this.log(`Waiting for ASSET-LIST to complete loading ${i}`);if(i.assetListLoader&&(i.assetListLoader.destroy(),i.assetListLoader=void 0),!o)return void this.log(`Waiting for attachMedia to start Interstitial ${i}`);this.waitingItem=this.endedItem=null,this.playingItem=a;const c=i.assetList[r];if(!c)return void this.advanceAfterAssetEnded(i,e,r||0);if(u||(u=this.getAssetPlayer(c.identifier)),null===u||u.destroyed){const e=i.assetList.length;this.warn(`asset ${r+1}/${e} player destroyed ${i}`),u=this.createAssetPlayer(i,c,r),u.loadSource()}if(!this.eventItemsMatch(a,this.bufferingItem)&&i.appendInPlace&&this.isAssetBuffered(c))return;this.startAssetPlayer(u,r,t,e,o),this.shouldPlay&&ub(u.media)}else a?(this.resumePrimary(a,e,n),this.shouldPlay&&ub(this.hls.media)):i&&this.isInterstitial(n)&&(this.endedItem=null,this.playingItem=n,n.event.appendInPlace||this.attachPrimary(s.durations.primary,null))}get playbackDisabled(){return!1===this.hls.config.enableInterstitialPlayback}get primaryDetails(){var e;return null==(e=this.mediaSelection)?void 0:e.main.details}get primaryLive(){var e;return!(null==(e=this.primaryDetails)||!e.live)}resumePrimary(e,t,r){var n,i;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${ob(e)}`),null==(n=this.detachedData)||!n.mediaSource){let r=this.timelinePos;(r<e.start||r>=e.end)&&(r=this.getPrimaryResumption(e,t),this.log(cb("resumePrimary",r)),this.timelinePos=r),this.attachPrimary(r,e)}if(!r)return;const s=null==(i=this.schedule)?void 0:i.items;s&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${ob(e)}`),this.hls.trigger(Id.INTERSTITIALS_PRIMARY_RESUMED,{schedule:s.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const r=e.start;if(this.primaryLive){const e=this.primaryDetails;if(0===t)return this.hls.startPosition;if(e&&(r<e.fragmentStart||r>e.edge))return this.hls.liveSyncPosition||-1}return r}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);if(null!=t&&t.hls)return t.hls.bufferedToEnd;return kp.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,r){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const n=this.primaryMedia;if(!n)return;const i=this.hls;i.media?this.checkBuffer():(this.transferMediaTo(i,n),r&&this.startLoadingPrimaryAt(e,r)),r||(this.log(cb("attachPrimary",e)),this.timelinePos=e,this.startLoadingPrimaryAt(e,r))}startLoadingPrimaryAt(e,t){var r;const n=this.hls;!n.loadingEnabled||!n.media||Math.abs(((null==(r=n.mainForwardBufferInfo)?void 0:r.start)||n.media.currentTime)-e)>.5?n.startLoad(e,t):n.bufferingEnabled||n.resumeBuffering()}onManifestLoading(){var e;this.stopLoad(),null==(e=this.schedule)||e.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(Id.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(Id.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(-1===t.level||!this.schedule)return;const r=this.hls.levels[t.level];if(!r.details)return;const n=jd(jd({},this.mediaSelection||this.altSelection),{},{main:r});this.mediaSelection=n,this.schedule.parseInterstitialDateRanges(n,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const r=this.hls.audioTracks[t.id],n=this.mediaSelection;if(!n)return void(this.altSelection=jd(jd({},this.altSelection),{},{audio:r}));const i=jd(jd({},n),{},{audio:r});this.mediaSelection=i}onSubtitleTrackUpdated(e,t){const r=this.hls.subtitleTracks[t.id],n=this.mediaSelection;if(!n)return void(this.altSelection=jd(jd({},this.altSelection),{},{subtitles:r}));const i=jd(jd({},n),{},{subtitles:r});this.mediaSelection=i}onAudioTrackSwitching(e,t){const r=Lf(t);this.playerQueue.forEach(({hls:e})=>e&&(e.setAudioOption(t)||e.setAudioOption(r)))}onSubtitleTrackSwitch(e,t){const r=Lf(t);this.playerQueue.forEach(({hls:e})=>e&&(e.setSubtitleOption(t)||-1!==t.id&&e.setSubtitleOption(r)))}onBufferCodecs(e,t){const r=t.tracks;r&&(this.requiredTracks=r)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const r=this.playingItem;if(r&&!this.itemsMatch(r,this.bufferingItem)&&!this.isInterstitial(r)){const e=this.timelinePos;this.bufferedPos=e,this.checkBuffer()}}onBufferedToEnd(e){if(!this.schedule)return;const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let e=0;e<t.length;e++){const n=t[e];if(n.cue.post){var r;const e=this.schedule.findEventIndex(n.identifier),t=null==(r=this.schedule.items)?void 0:r[e];this.isInterstitial(t)&&this.eventItemsMatch(t,this.bufferingItem)&&this.bufferedToItem(t,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const t=this.playingItem;if(!this.playingLastItem&&t){const e=this.findItemIndex(t);this.setSchedulePosition(e+1)}else this.shouldPlay=!1}updateItem(e,t){var r;const n=null==(r=this.schedule)?void 0:r.items;if(e&&n){return n[this.findItemIndex(e,t)]||null}return null}trimInPlace(e,t){if(this.isInterstitial(e)&&e.event.appendInPlace&&t.end-e.end>.25){e.event.assetList.forEach((t,r)=>{e.event.isAssetPastPlayoutLimit(r)&&this.clearAssetPlayer(t.identifier,null)});const r=e.end+.25,n=kp.bufferInfo(this.primaryMedia,r,0);if(n.end>r||(n.nextStart||0)>r){this.log(`trim buffered interstitial ${ob(e)} (was ${ob(t)})`);const n=!0;this.attachPrimary(r,null,n),this.flushFrontBuffer(r)}}}itemsMatch(e,t){return!!t&&(e===t||e.event&&t.event&&this.eventItemsMatch(e,t)||!e.event&&!t.event&&this.findItemIndex(e)===this.findItemIndex(t))}eventItemsMatch(e,t){var r;return!!t&&(e===t||e.event.identifier===(null==(r=t.event)?void 0:r.identifier))}findItemIndex(e,t){return e&&this.schedule?this.schedule.findItemIndex(e,t):-1}updateSchedule(e=!1){var t;const r=this.mediaSelection;r&&(null==(t=this.schedule)||t.updateSchedule(r,[],e))}checkBuffer(e){var t;const r=null==(t=this.schedule)?void 0:t.items;if(!r)return;const n=kp.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=n.len<1),this.updateBufferedPos(n.end,r,e)}updateBufferedPos(e,t,r){const n=this.schedule,i=this.bufferingItem;if(this.bufferedPos>e||!n)return;if(1===t.length&&this.itemsMatch(t[0],i))return void(this.bufferedPos=e);const s=this.playingItem,a=this.findItemIndex(s);let o=n.findItemIndexAtTime(e);if(this.bufferedPos<e){var l;const r=this.findItemIndex(i),n=Math.min(r+1,t.length-1),s=t[n];if((-1===o&&i&&e>=i.end||null!=(l=s.event)&&l.appendInPlace&&e+.01>=s.start)&&(o=n),this.isInterstitial(i)){const e=i.event;if(n-a>1&&!1===e.appendInPlace)return;if(0===e.assetList.length&&e.assetListLoader)return}if(this.bufferedPos=e,o>r&&o>a)this.bufferedToItem(s);else{const t=this.primaryDetails;this.primaryLive&&t&&e>t.edge-t.targetduration&&s.start<t.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(s)&&this.preloadAssets(s.event,0)}}else r&&s&&!this.itemsMatch(s,i)&&(o===a?this.bufferedToItem(s):o===a+1&&this.bufferedToItem(t[o]))}assetsBuffered(e,t){return 0!==e.event.assetList.length&&!e.event.assetList.some(e=>{const r=this.getAssetPlayer(e.identifier);return!(null!=r&&r.bufferedInPlaceToEnd(t))})}setBufferingItem(e){const t=this.bufferingItem,r=this.schedule;if(!this.itemsMatch(e,t)&&r){const{items:n,events:i}=r;if(!n||!i)return t;const s=this.isInterstitial(e),a=this.getBufferingPlayer();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));const o=a?a.remaining:t?t.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${ob(e)}`+(t?` (${o.toFixed(2)} remaining)`:"")),!this.playbackDisabled)if(s){const t=r.findAssetIndex(e.event,this.bufferedPos);e.event.assetList.forEach((e,r)=>{const n=this.getAssetPlayer(e.identifier);n&&(r===t&&n.loadSource(),n.resumeBuffering())})}else this.hls.resumeBuffering(),this.playerQueue.forEach(e=>e.pauseBuffering());this.hls.trigger(Id.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:i.slice(0),schedule:n.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}else this.bufferingItem!==e&&(this.bufferingItem=e);return t}bufferedToItem(e,t=0){const r=this.setBufferingItem(e);if(!this.playbackDisabled)if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(null!==r){this.bufferingAsset=null;const t=this.detachedData;if(t)if(t.mediaSource){const t=!0;this.attachPrimary(e.start,e,t)}else this.preloadPrimary(e);else this.preloadPrimary(e)}}preloadPrimary(e){const t=this.findItemIndex(e),r=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(r)}bufferedToEvent(e,t){const r=e.event,n=0===r.assetList.length&&!r.assetListLoader,i=r.cue.once;if(n||!i){const e=this.preloadAssets(r,t);if(null!=e&&e.interstitial.appendInPlace){const t=this.primaryMedia;t&&this.bufferAssetPlayer(e,t)}}}preloadAssets(e,t){const r=e.assetUrl,n=e.assetList.length,i=0===n&&!e.assetListLoader,s=e.cue.once;if(i){const i=e.timelineStart;if(e.appendInPlace){var a;const t=this.playingItem;this.isInterstitial(t)||(null==t||null==(a=t.nextEvent)?void 0:a.identifier)!==e.identifier||this.flushFrontBuffer(i+.25)}let s,o=0;if(!this.playingItem&&this.primaryLive&&(o=this.hls.startPosition,-1===o&&(o=this.hls.liveSyncPosition||0)),o&&!e.cue.pre&&!e.cue.post){const e=o-i;e>0&&(s=Math.round(1e3*e)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${r?1:n} ${e}${s?` live-start: ${o} start-offset: ${s}`:""}`),r)return this.createAsset(e,0,0,i,e.duration,r);const l=this.assetListLoader.loadAssetList(e,s);l&&(e.assetListLoader=l)}else if(!s&&n){for(let r=t;r<n;r++){const t=e.assetList[r],n=this.getAssetPlayerQueueIndex(t.identifier);-1!==n&&!this.playerQueue[n].destroyed||t.error||this.createAssetPlayer(e,t,r)}const r=e.assetList[t];if(r){const e=this.getAssetPlayer(r.identifier);return e&&e.loadSource(),e}}return null}flushFrontBuffer(e){const t=this.requiredTracks;if(!t)return;this.log(`Removing front buffer starting at ${e}`);Object.keys(t).forEach(t=>{this.hls.trigger(Id.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:t})})}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let r=0;r<t.length;r++)if(e===t[r].assetId)return r;return-1}getAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);return this.playerQueue[t]||null}getBufferingPlayer(){const{playerQueue:e,primaryMedia:t}=this;if(t)for(let r=0;r<e.length;r++)if(e[r].media===t)return e[r];return null}createAsset(e,t,r,n,i,s){const a={parentIdentifier:e.identifier,identifier:Jy(e,s,t),duration:i,startOffset:r,timelineStart:n,uri:s};return this.createAssetPlayer(e,a,t)}createAssetPlayer(e,t,r){const n=this.hls,i=n.userConfig;let s=i.videoPreference;const a=n.loadLevelObj||n.levels[n.currentLevel];(s||a)&&(s=Ud({},s),a.videoCodec&&(s.videoCodec=a.videoCodec),a.videoRange&&(s.allowedVideoRanges=[a.videoRange]));const o=n.audioTracks[n.audioTrack],l=n.subtitleTracks[n.subtitleTrack];let u=0;if(this.primaryLive||e.appendInPlace){const e=this.timelinePos-t.timelineStart;if(e>1){const r=t.duration;r&&e<r&&(u=e)}}const c=t.identifier,d=jd(jd({},i),{},{maxMaxBufferLength:Math.min(180,n.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:n.sessionId,assetPlayerId:c,abrEwmaDefaultEstimate:n.bandwidthEstimate,interstitialsController:void 0,startPosition:u,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:s,audioPreference:o||i.audioPreference,subtitlePreference:l||i.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(d.timelineOffset=t.timelineStart));const h=d.cmcd;null!=h&&h.sessionId&&h.contentId&&(d.cmcd=Ud({},h,{contentId:Xy(t.uri)})),this.getAssetPlayer(c)&&this.warn(`Duplicate date range identifier ${e} and asset ${c}`);const f=new sb(this.HlsPlayerClass,d,e,t);this.playerQueue.push(f),e.assetList[r]=t;let p=!0;const g=n=>{if(n.live){var i;const t=new Error(`Interstitials MUST be VOD assets ${e}`),n={fatal:!0,type:Rd.OTHER_ERROR,details:Ld.INTERSTITIAL_ASSET_ITEM_ERROR,error:t},s=(null==(i=this.schedule)?void 0:i.findEventIndex(e.identifier))||-1;return void this.handleAssetItemError(n,e,s,r,t.message)}const s=n.edge-n.fragmentStart,a=t.duration;(p||null===a||s>a)&&(p=!1,this.log(`Interstitial asset "${c}" duration change ${a} > ${s}`),t.duration=s,this.updateSchedule())};f.on(Id.LEVEL_UPDATED,(e,{details:t})=>g(t)),f.on(Id.LEVEL_PTS_UPDATED,(e,{details:t})=>g(t)),f.on(Id.EVENT_CUE_ENTER,()=>this.onInterstitialCueEnter());const m=(e,t)=>{const r=this.getAssetPlayer(c);if(r&&t.tracks){r.off(Id.BUFFER_CODECS,m),r.tracks=t.tracks;const e=this.primaryMedia;this.bufferingAsset===r.assetItem&&e&&!r.media&&this.bufferAssetPlayer(r,e)}};f.on(Id.BUFFER_CODECS,m);f.on(Id.BUFFERED_TO_END,()=>{var r;const n=this.getAssetPlayer(c);if(this.log(`buffered to end of asset ${n}`),!n||!this.schedule)return;const i=this.schedule.findEventIndex(e.identifier),s=null==(r=this.schedule.items)?void 0:r[i];this.isInterstitial(s)&&this.advanceAssetBuffering(s,t)});const v=t=>()=>{if(!this.getAssetPlayer(c)||!this.schedule)return;this.shouldPlay=!0;const r=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,r,t)};return f.once(Id.MEDIA_ENDED,v(r)),f.once(Id.PLAYOUT_LIMIT_REACHED,v(1/0)),f.on(Id.ERROR,(t,n)=>{if(!this.schedule)return;const i=this.getAssetPlayer(c);if(n.details===Ld.BUFFER_STALLED_ERROR)return null!=i&&i.appendInPlace?void this.handleInPlaceStall(e):(this.onTimeupdate(),void this.checkBuffer(!0));this.handleAssetItemError(n,e,this.schedule.findEventIndex(e.identifier),r,`Asset player error ${n.error} ${e}`)}),f.on(Id.DESTROYING,()=>{if(!this.getAssetPlayer(c)||!this.schedule)return;const t=new Error(`Asset player destroyed unexpectedly ${c}`),n={fatal:!0,type:Rd.OTHER_ERROR,details:Ld.INTERSTITIAL_ASSET_ITEM_ERROR,error:t};this.handleAssetItemError(n,e,this.schedule.findEventIndex(e.identifier),r,t.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${ib(t)}`),this.hls.trigger(Id.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:r,event:e,player:f}),f}clearInterstitial(e,t){this.clearAssetPlayers(e,t),e.reset()}clearAssetPlayers(e,t){e.assetList.forEach(e=>{this.clearAssetPlayer(e.identifier,t)})}resetAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);if(-1!==t){this.log(`reset asset player "${e}" after error`);const r=this.playerQueue[t];this.transferMediaFromPlayer(r,null),r.resetDetails()}}clearAssetPlayer(e,t){const r=this.getAssetPlayerQueueIndex(e);if(-1!==r){const e=this.playerQueue[r];this.log(`clear ${e} toSegment: ${t?ob(t):t}`),this.transferMediaFromPlayer(e,t),this.playerQueue.splice(r,1),e.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,r,n,i){const{interstitial:s,assetItem:a,assetId:o}=e,l=s.assetList.length,u=this.playingAsset;this.endedAsset=null,this.playingAsset=a,u&&u.identifier===o||(u&&(this.clearAssetPlayer(u.identifier,r[n]),delete u.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${l} ${ib(a)}`),this.hls.trigger(Id.INTERSTITIAL_ASSET_STARTED,{asset:a,assetListIndex:t,event:s,schedule:r.slice(0),scheduleIndex:n,player:e})),this.bufferAssetPlayer(e,i)}bufferAssetPlayer(e,t){var r,n;if(!this.schedule)return;const{interstitial:i,assetItem:s}=e,a=this.schedule.findEventIndex(i.identifier),o=null==(r=this.schedule.items)?void 0:r[a];if(!o)return;e.loadSource(),this.setBufferingItem(o),this.bufferingAsset=s;const l=this.getBufferingPlayer();if(l===e)return;const u=i.appendInPlace;if(u&&!1===(null==l?void 0:l.interstitial.appendInPlace))return;const c=(null==l?void 0:l.tracks)||(null==(n=this.detachedData)?void 0:n.tracks)||this.requiredTracks;if(u&&s!==this.playingAsset){if(!e.tracks)return void this.log(`Waiting for track info before buffering ${e}`);if(c&&!Qd(c,e.tracks)){const t=new Error(`Asset ${ib(s)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(c)}')`),r={fatal:!0,type:Rd.OTHER_ERROR,details:Ld.INTERSTITIAL_ASSET_ITEM_ERROR,error:t},n=i.findAssetIndex(s);return void this.handleAssetItemError(r,i,a,n,t.message)}}this.transferMediaTo(e,t)}handleInPlaceStall(e){const t=this.schedule,r=this.primaryMedia;if(!t||!r)return;const n=r.currentTime,i=t.findAssetIndex(e,n),s=e.assetList[i];if(s){const a=this.getAssetPlayer(s.identifier);if(a){const o=a.currentTime||n-s.timelineStart,l=a.duration-o;if(this.warn(`Stalled at ${o} of ${o+l} in ${a} ${e} (media.currentTime: ${n})`),o&&(l/r.playbackRate<.5||a.bufferedInPlaceToEnd(r))&&a.hls){const r=t.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,r,i)}}}}advanceInPlace(e){const t=this.primaryMedia;t&&t.currentTime<e&&(t.currentTime=e)}handleAssetItemError(e,t,r,n,i){if(e.details===Ld.BUFFER_STALLED_ERROR)return;const s=t.assetList[n]||null;if(this.warn(`INTERSTITIAL_ASSET_ERROR ${s?ib(s):s} ${e.error}`),!this.schedule)return;const a=(null==s?void 0:s.identifier)||"",o=this.getAssetPlayerQueueIndex(a),l=this.playerQueue[o]||null,u=this.schedule.items,c=Ud({},e,{fatal:!1,errorAction:tp(!0),asset:s,assetListIndex:n,event:t,schedule:u,scheduleIndex:r,player:l});if(this.hls.trigger(Id.INTERSTITIAL_ASSET_ERROR,c),!e.fatal)return;const d=this.playingAsset,h=this.bufferingAsset,f=new Error(i);if(s&&(this.clearAssetPlayer(a,null),s.error=f),t.assetList.some(e=>!e.error))for(let e=n;e<t.assetList.length;e++)this.resetAssetPlayer(t.assetList[e].identifier);else t.error=f;this.updateSchedule(!0),t.error?this.primaryFallback(t):d&&d.identifier===a?this.advanceAfterAssetEnded(t,r,n):h&&h.identifier===a&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,h)}primaryFallback(e){const t=e.timelineStart,r=this.effectivePlayingItem;let n=this.timelinePos;if(r){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${n} playing: ${ob(r)} error: ${e.error}`),-1===n&&(n=this.hls.startPosition);const i=this.updateItem(r,n);this.itemsMatch(r,i)&&this.clearInterstitial(e,null),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t))}else if(-1===n)return void this.checkStart();if(!this.schedule)return;const i=this.schedule.findItemIndexAtTime(n);this.setSchedulePosition(i)}onAssetListLoaded(e,t){var r,n;const i=t.event,s=i.identifier,a=t.assetListResponse.ASSETS;if(null==(r=this.schedule)||!r.hasEvent(s))return;const o=i.timelineStart,l=i.duration;let u=0;a.forEach((e,t)=>{const r=parseFloat(e.DURATION);this.createAsset(i,t,u,o+u,r,e.URI),u+=r}),i.duration=u,this.log(`Loaded asset-list with duration: ${u} (was: ${l}) ${i}`);const c=this.waitingItem,d=(null==c?void 0:c.event.identifier)===s;this.updateSchedule();const h=null==(n=this.bufferingItem)?void 0:n.event;if(d){var f;const e=this.schedule.findEventIndex(s),t=null==(f=this.schedule.items)?void 0:f[e];if(t){if(!this.playingItem&&this.timelinePos>t.end){if(this.schedule.findItemIndexAtTime(this.timelinePos)!==e)return i.error=new Error(`Interstitial ${a.length?"no longer within playback range":"asset-list is empty"} ${this.timelinePos} ${i}`),this.log(i.error.message),this.updateSchedule(!0),void this.primaryFallback(i)}this.setBufferingItem(t)}this.setSchedulePosition(e)}else if((null==h?void 0:h.identifier)===s){const e=i.assetList[0];if(e){const t=this.getAssetPlayer(e.identifier);if(h.appendInPlace){const e=this.primaryMedia;t&&e&&this.bufferAssetPlayer(t,e)}else t&&t.loadSource()}}}onError(e,t){if(this.schedule)switch(t.details){case Ld.ASSET_LIST_PARSING_ERROR:case Ld.ASSET_LIST_LOAD_ERROR:case Ld.ASSET_LIST_LOAD_TIMEOUT:{const e=t.interstitial;e&&(this.updateSchedule(!0),this.primaryFallback(e));break}case Ld.BUFFER_STALLED_ERROR:{const e=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(e)&&e.event.appendInPlace)return void this.handleInPlaceStall(e.event);this.log(`Primary player stall @${this.timelinePos} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}}});function gw(e){return e&&"object"==typeof e?Array.isArray(e)?e.map(gw):Object.keys(e).reduce((t,r)=>(t[r]=gw(e[r]),t),{}):e}function mw(e,t){const r=e.loader;if(r!==uw&&r!==fw)t.log("[config]: Custom loader detected, cannot enable progressive streaming"),e.progressive=!1;else{(function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(e){}return!1})()&&(e.loader=uw,e.progressive=!0,e.enableSoftwareAES=!0,t.log("[config]: Progressive streaming enabled, using FetchLoader"))}}class vw extends Ep{constructor(e,t){super("gap-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var e;null!=(e=this.media)&&e.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{var e;this.hls&&(this.ended=(null==(e=this.media)?void 0:e.currentTime)||1,this.hls.trigger(Id.MEDIA_ENDED,{stalled:!1}))},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(Id.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Id.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Id.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(Id.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Id.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Id.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(e,t){this.setInterval(100),this.mediaSource=t.mediaSource;const r=this.media=t.media;zg(r,"playing",this.onMediaPlaying),zg(r,"waiting",this.onMediaWaiting),zg(r,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:r}=this;r&&(jg(r,"playing",this.onMediaPlaying),jg(r,"waiting",this.onMediaWaiting),jg(r,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(null==(e=this.media)||!e.readyState||!this.hasBuffered)return;const t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){var r,n;const i=null==(r=this.hls)?void 0:r.config;if(!i)return;const s=this.media;if(!s)return;const{seeking:a}=s,o=this.seeking&&!a,l=!this.seeking&&a,u=s.paused&&!a||s.ended||0===s.playbackRate;if(this.seeking=a,e!==t)return t&&(this.ended=0),this.moved=!0,a||(this.nudgeRetry=0,i.nudgeOnVideoHole&&!u&&e>t&&this.nudgeOnVideoHole(e,t)),void(0===this.waiting&&this.stallResolved(e));if(l||o)return void(o&&this.stallResolved(e));if(u)return this.nudgeRetry=0,this.stallResolved(e),void(!this.ended&&s.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(Id.MEDIA_ENDED,{stalled:!1})));if(!kp.getBuffered(s).length)return void(this.nudgeRetry=0);const c=kp.bufferInfo(s,e,0),d=c.nextStart||0,h=this.fragmentTracker;if(a&&h&&this.hls){const t=yw(this.hls.inFlightFragments,e),r=c.len>2,n=!d||t||d-e>2&&!h.getPartialFragment(e);if(r||n)return;this.moved=!1}const f=null==(n=this.hls)?void 0:n.latestLevelDetails;if(!this.moved&&null!==this.stalled&&h){if(!(c.len>0)&&!d)return;const t=Math.max(d,c.start||0)-e,r=!(null==f||!f.live)?2*f.targetduration:2,n=ww(e,h);if(t>0&&(t<=r||n))return void(s.paused||this._trySkipBufferHole(n))}const p=i.detectStallWithCurrentTimeMs,g=self.performance.now(),m=this.waiting;let v=this.stalled;if(null===v){if(!(m>0&&g-m<p))return void(this.stalled=g);v=this.stalled=m}const y=g-v;if(!a&&(y>=p||m)&&this.hls){var b;if("ended"===(null==(b=this.mediaSource)?void 0:b.readyState)&&(null==f||!f.live)&&Math.abs(e-((null==f?void 0:f.edge)||0))<1){if(this.ended)return;return this.ended=e||1,void this.hls.trigger(Id.MEDIA_ENDED,{stalled:!0})}if(this._reportStall(c),!this.media||!this.hls)return}const w=kp.bufferInfo(s,e,i.maxBufferHole);this._tryFixBufferStall(w,y,e)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const r=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(r)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(Id.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var r;const n=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&null!=(r=this.buffered.audio)&&r.length&&n&&n.length>1&&e>n.end(0)){const r=kp.bufferedInfo(kp.timeRangesToArray(this.buffered.audio),e,0);if(r.len>1&&t>=r.start){const r=kp.timeRangesToArray(n),i=kp.bufferedInfo(r,t,0).bufferedIndex;if(i>-1&&i<r.length-1){const t=kp.bufferedInfo(r,e,0).bufferedIndex,n=r[i].end,s=r[i+1].start;if((-1===t||t>i)&&s-n<1&&e-n<2){const r=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${n} -> ${s} buffered index: ${t}`);this.warn(r.message),this.media.currentTime+=1e-6;let i=ww(e,this.fragmentTracker);i&&"fragment"in i?i=i.fragment:i||(i=void 0);const a=kp.bufferInfo(this.media,e,0);this.hls.trigger(Id.ERROR,{type:Rd.MEDIA_ERROR,details:Ld.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:r,reason:r.message,frag:i,buffer:a.len,bufferInfo:a})}}}}}_tryFixBufferStall(e,t,r){var n,i;const{fragmentTracker:s,media:a}=this,o=null==(n=this.hls)?void 0:n.config;if(!a||!s||!o)return;const l=null==(i=this.hls)?void 0:i.latestLevelDetails,u=ww(r,s);if(u||null!=l&&l.live&&r<l.fragmentStart){if(this._trySkipBufferHole(u)||!this.media)return}const c=e.buffered,d=this.adjacentTraversal(e,r);(c&&c.length>1&&e.len>o.maxBufferHole||e.nextStart&&(e.nextStart-r<o.maxBufferHole||d))&&(t>1e3*o.highBufferWatchdogPeriod||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){const r=this.fragmentTracker,n=e.nextStart;if(r&&n){const e=r.getFragAtPos(t,Md),i=r.getFragAtPos(n,Md);if(e&&i)return i.sn-e.sn<2}return!1}_reportStall(e){const{hls:t,media:r,stallReported:n,stalled:i}=this;if(!n&&null!==i&&r&&t){this.stallReported=!0;const n=new Error(`Playback stalling at @${r.currentTime} due to low buffer (${xf(e)})`);this.warn(n.message),t.trigger(Id.ERROR,{type:Rd.MEDIA_ERROR,details:Ld.BUFFER_STALLED_ERROR,fatal:!1,error:n,buffer:e.len,bufferInfo:e,stalled:{start:i}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:r,media:n}=this,i=null==(t=this.hls)?void 0:t.config;if(!n||!r||!i)return 0;const s=n.currentTime,a=kp.bufferInfo(n,s,0),o=s<a.start?a.start:a.nextStart;if(o&&this.hls){const t=a.len<=i.maxBufferHole,u=a.len>0&&a.len<1&&n.readyState<3,c=o-s;if(c>0&&(t||u)){if(c>i.maxBufferHole){let t=!1;if(0===s){const e=r.getAppendedFrag(0,Md);e&&o<e.end&&(t=!0)}if(!t&&e){var l;if(null==(l=this.hls.loadLevelObj)||!l.details)return 0;if(yw(this.hls.inFlightFragments,o))return 0;let t=!1,n=e.end;for(;n<o;){const e=ww(n,r);if(!e){t=!0;break}n+=e.duration}if(t)return 0}}const t=Math.max(o+.05,s+.1);if(this.warn(`skipping hole, adjusting currentTime from ${s} to ${t}`),this.moved=!0,n.currentTime=t,null==e||!e.gap){const r=new Error(`fragment loaded with buffer holes, seeking from ${s} to ${t}`),n={type:Rd.MEDIA_ERROR,details:Ld.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:r,reason:r.message,buffer:a.len,bufferInfo:a};e&&("fragment"in e?n.part=e:n.frag=e),this.hls.trigger(Id.ERROR,n)}return t}}return 0}_tryNudgeBuffer(e){const{hls:t,media:r,nudgeRetry:n}=this,i=null==t?void 0:t.config;if(!r||!i)return 0;const s=r.currentTime;if(this.nudgeRetry++,n<i.nudgeMaxRetry){const a=s+(n+1)*i.nudgeOffset,o=new Error(`Nudging 'currentTime' from ${s} to ${a}`);this.warn(o.message),r.currentTime=a,t.trigger(Id.ERROR,{type:Rd.MEDIA_ERROR,details:Ld.BUFFER_NUDGE_ON_STALL,error:o,fatal:!1,buffer:e.len,bufferInfo:e})}else{const r=new Error(`Playhead still not moving while enough data buffered @${s} after ${i.nudgeMaxRetry} nudges`);this.error(r.message),t.trigger(Id.ERROR,{type:Rd.MEDIA_ERROR,details:Ld.BUFFER_STALLED_ERROR,error:r,fatal:!0,buffer:e.len,bufferInfo:e})}}}function yw(e,t){const r=bw(e.main);if(r&&r.start<=t)return r;const n=bw(e.audio);return n&&n.start<=t?n:null}function bw(e){if(!e)return null;switch(e.state){case Vg:case Hg:case Zg:case Jg:return null}return e.frag}function ww(e,t){return t.getAppendedFrag(e,Md)||t.getPartialFragment(e)}function Ew(){if("undefined"!=typeof self)return self.VTTCue||self.TextTrackCue}function Sw(e,t,r,n,i){let s=new e(t,r,"");try{s.value=n,i&&(s.type=i)}catch(a){s=new e(t,r,xf(i?jd({type:i},n):n))}return s}const Tw=(()=>{const e=Ew();try{e&&new e(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class kw{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(Id.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e&&(e.on(Id.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Id.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Id.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Id.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(Id.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(Id.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(Id.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(Id.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Id.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Id.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Id.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(Id.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(Id.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(Id.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(e,t){var r;this.media=t.media,!1===(null==(r=t.overrides)?void 0:r.cueRemoval)&&(this.removeCues=!1)}onMediaAttached(){var e;const t=null==(e=this.hls)?void 0:e.latestLevelDetails;t&&this.updateDateRangeCues(t)}onMediaDetaching(e,t){this.media=null;!!t.transferMedia||(this.id3Track&&(this.removeCues&&Ky(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const r=e[t];if("metadata"===r.kind&&"id3"===r.label)return Vy(r,this.media),r}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media||!this.hls)return;const{enableEmsgMetadataCues:r,enableID3MetadataCues:n}=this.hls.config;if(!r&&!n)return;const{samples:i}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=Ew();if(s)for(let e=0;e<i.length;e++){const t=i[e].type;if(t===Dm.emsg&&!r||!n)continue;const a=Lm(i[e].data),o=i[e].pts;let l=o+i[e].duration;l>Tw&&(l=Tw);l-o<=0&&(l=o+.25);for(let e=0;e<a.length;e++){const r=a[e];if(!Im(r)){this.updateId3CueEnds(o,t);const e=Sw(s,o,l,r,t);e&&this.id3Track.addCue(e)}}}}updateId3CueEnds(e,t){var r;const n=null==(r=this.id3Track)?void 0:r.cues;if(n)for(let r=n.length;r--;){const i=n[r];i.type===t&&i.startTime<e&&i.endTime===Tw&&(i.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:r,type:n}){const{id3Track:i,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:a,enableID3MetadataCues:o}}=s;if(i&&(a||o)){let e;e="audio"===n?e=>e.type===Dm.audioId3&&o:"video"===n?e=>e.type===Dm.emsg&&a:e=>e.type===Dm.audioId3&&o||e.type===Dm.emsg&&a,Yy(i,t,r,e)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.hls||!this.media)return;const{assetPlayerId:r,timelineOffset:n,enableDateRangeMetadataCues:i,interstitialsController:s}=this.hls.config;if(!i)return;const a=Ew();if(r&&n&&!s){const{fragmentStart:t,fragmentEnd:n}=e;let i=this.assetCue;i?(i.startTime=t,i.endTime=n):a&&(i=this.assetCue=Sw(a,t,n,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),i&&(i.id=r,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(i),i.addEventListener("enter",this.onEventCueEnter)))}if(!e.hasProgramDateTime)return;const{id3Track:o}=this,{dateRanges:l}=e,u=Object.keys(l);let c=this.dateRangeCuesAppended;var d;if(o&&t)if(null!=(d=o.cues)&&d.length){const e=Object.keys(c).filter(e=>!u.includes(e));for(let t=e.length;t--;){var h;const r=e[t],n=null==(h=c[r])?void 0:h.cues;delete c[r],n&&Object.keys(n).forEach(e=>{const t=n[e];if(t){t.removeEventListener("enter",this.onEventCueEnter);try{o.removeCue(t)}catch(e){}}})}}else c=this.dateRangeCuesAppended={};const f=e.fragments[e.fragments.length-1];if(0!==u.length&&kd(null==f?void 0:f.programDateTime)){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let e=0;e<u.length;e++){const t=u[e],r=l[t],n=r.startTime,i=c[t],o=(null==i?void 0:i.cues)||{};let d=(null==i?void 0:i.durationKnown)||!1,h=Tw;const{duration:f,endDate:p}=r;if(p&&null!==f)h=n+f,d=!0;else if(r.endOnNext&&!d){const e=u.reduce((e,t)=>{if(t!==r.id){const n=l[t];if(n.class===r.class&&n.startDate>r.startDate&&(!e||r.startDate<e.startDate))return n}return e},null);e&&(h=e.startTime,d=!0)}const g=Object.keys(r.attr);for(let e=0;e<g.length;e++){const l=g[e];if(!_p(l))continue;const u=o[l];if(u)!d||null!=i&&i.durationKnown?Math.abs(u.startTime-n)>.01&&(u.startTime=n,u.endTime=h):u.endTime=h;else if(a){let e=r.attr[l];Mp(l)&&(e=eh(e));const i=Sw(a,n,h,{key:l,data:e},Dm.dateRange);i&&(i.id=t,this.id3Track.addCue(i),o[l]=i,s&&("X-ASSET-LIST"!==l&&"X-ASSET-URL"!==l||i.addEventListener("enter",this.onEventCueEnter)))}}c[t]={cues:o,dateRange:r,durationKnown:d}}}}}class xw{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:e}=this,t=this.levelDetails;if(!e||!t)return;this.currentTime=e.currentTime;const r=this.computeLatency();if(null===r)return;this._latency=r;const{lowLatencyMode:n,maxLiveSyncPlaybackRate:i}=this.config;if(!n||1===i||!t.live)return;const s=this.targetLatency;if(null===s)return;const a=r-s;if(a<Math.min(this.maxLatency,s+t.targetduration)&&a>.05&&this.forwardBufferLength>1){const t=Math.min(2,Math.max(1,i)),r=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20,n=Math.min(t,Math.max(1,r));this.changeMediaPlaybackRate(e,n)}else 1!==e.playbackRate&&0!==e.playbackRate&&this.changeMediaPlaybackRate(e,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){var e;return(null==(e=this.hls)?void 0:e.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:e}=this;if(void 0!==e.liveMaxLatencyDuration)return e.liveMaxLatencyDuration;const t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const e=this.levelDetails;if(null===e||null===this.hls)return null;const{holdBack:t,partHoldBack:r,targetduration:n}=e,{liveSyncDuration:i,liveSyncDurationCount:s,lowLatencyMode:a}=this.config,o=this.hls.userConfig;let l=a&&r||t;(this._targetLatencyUpdated||o.liveSyncDuration||o.liveSyncDurationCount||0===l)&&(l=void 0!==i?i:s*n);const u=n;return l+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,u)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency;if(null===e||null===t)return null;const r=this.levelDetails;if(null===r)return null;const n=r.edge,i=e-t-this.edgeStalled,s=n-r.totalduration,a=n-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(s,i),a)}get drift(){const e=this.levelDetails;return null===e?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(null===e)return 0;const t=3*(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const r=e.buffered.length;return(r?e.buffered.end(r-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(Id.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Id.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Id.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(Id.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(Id.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Id.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Id.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(Id.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(e,t){var r;t.details===Ld.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&null!=(r=this.levelDetails)&&r.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var r,n;e.playbackRate!==t&&(null==(r=this.hls)||r.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${null==(n=this.targetLatency)?void 0:n.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){const e=this.levelDetails;return null===e?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return null===e?null:e-this.currentTime}}class Aw extends Mv{constructor(e,t){super(e,"level-controller"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Id.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Id.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Id.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(Id.FRAG_BUFFERED,this.onFragBuffered,this),e.on(Id.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Id.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Id.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Id.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(Id.FRAG_BUFFERED,this.onFragBuffered,this),e.off(Id.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(e=>{e.loadError=0,e.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const r=this.hls.config.preferManagedMediaSource,n=[],i={},s={};let a=!1,o=!1,l=!1;t.levels.forEach(e=>{const t=e.attrs;let{audioCodec:u,videoCodec:c}=e;u&&(e.audioCodec=u=tf(u,r)||void 0),c&&(c=e.videoCodec=function(e){const t=e.split(",");for(let e=0;e<t.length;e++){const r=t[e].split(".");r.length>2&&"avc1"===r[0]&&(t[e]=`avc1.${parseInt(r[1]).toString(16)}${("000"+parseInt(r[2]).toString(16)).slice(-4)}`)}return t.join(",")}(c));const{width:d,height:h,unknownCodecs:f}=e,p=(null==f?void 0:f.length)||0;if(a||(a=!(!d||!h)),o||(o=!!c),l||(l=!!u),p||u&&!this.isAudioSupported(u)||c&&!this.isVideoSupported(c))return void this.log(`Some or all CODECS not supported "${t.CODECS}"`);const{CODECS:g,"FRAME-RATE":m,"HDCP-LEVEL":v,"PATHWAY-ID":y,RESOLUTION:b,"VIDEO-RANGE":w}=t,E=`${`${y||"."}-`}${e.bitrate}-${b}-${m}-${g}-${w}-${v}`;if(i[E])if(i[E].uri===e.url||e.attrs["PATHWAY-ID"])i[E].addGroupId("audio",t.AUDIO),i[E].addGroupId("text",t.SUBTITLES);else{const t=s[E]+=1;e.attrs["PATHWAY-ID"]=new Array(t+1).join(".");const r=this.createLevel(e);i[E]=r,n.push(r)}else{const t=this.createLevel(e);i[E]=t,s[E]=1,n.push(t)}}),this.filterAndSortMediaOptions(n,t,a,o,l)}createLevel(e){const t=new Sf(e),r=e.supplemental;if(null!=r&&r.videoCodec&&!this.isVideoSupported(r.videoCodec)){const e=new Error(`SUPPLEMENTAL-CODECS not supported "${r.videoCodec}"`);this.log(e.message),t.supportedResult=cf(e,[])}return t}isAudioSupported(e){return Yh(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return Yh(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,r,n,i){var s;let a=[],o=[],l=e;const u=(null==(s=t.stats)?void 0:s.parsing)||{};if((r||n)&&i&&(l=l.filter(({videoCodec:e,videoRange:t,width:r,height:n})=>{return(!!e||!(!r||!n))&&(!!(i=t)&&mf.indexOf(i)>-1);var i})),0===l.length)return Promise.resolve().then(()=>{if(this.hls){let e="no level with compatible codecs found in manifest",r=e;t.levels.length&&(r=`one or more CODECS in variant not supported: ${xf(t.levels.map(e=>e.attrs.CODECS).filter((e,t,r)=>r.indexOf(e)===t))}`,this.warn(r),e+=` (${r})`);const n=new Error(e);this.hls.trigger(Id.ERROR,{type:Rd.MEDIA_ERROR,details:Ld.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:n,reason:r})}}),void(u.end=performance.now());t.audioTracks&&(a=t.audioTracks.filter(e=>!e.audioCodec||this.isAudioSupported(e.audioCodec)),Rw(a)),t.subtitles&&(o=t.subtitles,Rw(o));const c=l.slice(0);l.sort((e,t)=>{if(e.attrs["HDCP-LEVEL"]!==t.attrs["HDCP-LEVEL"])return(e.attrs["HDCP-LEVEL"]||"")>(t.attrs["HDCP-LEVEL"]||"")?1:-1;if(r&&e.height!==t.height)return e.height-t.height;if(e.frameRate!==t.frameRate)return e.frameRate-t.frameRate;if(e.videoRange!==t.videoRange)return mf.indexOf(e.videoRange)-mf.indexOf(t.videoRange);if(e.videoCodec!==t.videoCodec){const r=Qh(e.videoCodec),n=Qh(t.videoCodec);if(r!==n)return n-r}if(e.uri===t.uri&&e.codecSet!==t.codecSet){const r=Zh(e.codecSet),n=Zh(t.codecSet);if(r!==n)return n-r}return e.averageBitrate!==t.averageBitrate?e.averageBitrate-t.averageBitrate:0});let d=c[0];if(this.steering&&(l=this.steering.filterParsedLevels(l),l.length!==c.length))for(let e=0;e<c.length;e++)if(c[e].pathwayId===l[0].pathwayId){d=c[e];break}this._levels=l;for(let e=0;e<l.length;e++)if(l[e]===d){var h;this._firstLevel=e;const t=d.bitrate,r=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${l.length} level(s) found, first bitrate: ${t}`),void 0===(null==(h=this.hls.userConfig)?void 0:h.abrEwmaDefaultEstimate)){const e=Math.min(t,this.hls.config.abrEwmaDefaultEstimateMax);e>r&&r===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=e)}break}const f=i&&!n,p=this.hls.config,g=!(!p.audioStreamController||!p.audioTrackController),m={levels:l,audioTracks:a,subtitleTracks:o,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:i,video:n,altAudio:g&&!f&&a.some(e=>!!e.url)};u.end=performance.now(),this.hls.trigger(Id.MANIFEST_PARSED,m)}get levels(){return 0===this._levels.length?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(0===t.length)return;if(e<0||e>=t.length){const r=new Error("invalid level idx"),n=e<0;if(this.hls.trigger(Id.ERROR,{type:Rd.OTHER_ERROR,details:Ld.LEVEL_SWITCH_ERROR,level:e,fatal:n,error:r,reason:r.message}),n)return;e=Math.min(e,t.length-1)}const r=this.currentLevelIndex,n=this.currentLevel,i=n?n.attrs["PATHWAY-ID"]:void 0,s=t[e],a=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,r===e&&n&&i===a)return;this.log(`Switching to level ${e} (${s.height?s.height+"p ":""}${s.videoRange?s.videoRange+" ":""}${s.codecSet?s.codecSet+" ":""}@${s.bitrate})${a?" with Pathway "+a:""} from level ${r}${i?" with Pathway "+i:""}`);const o={level:e,attrs:s.attrs,details:s.details,bitrate:s.bitrate,averageBitrate:s.averageBitrate,maxBitrate:s.maxBitrate,realBitrate:s.realBitrate,width:s.width,height:s.height,codecSet:s.codecSet,audioCodec:s.audioCodec,videoCodec:s.videoCodec,audioGroups:s.audioGroups,subtitleGroups:s.subtitleGroups,loaded:s.loaded,loadError:s.loadError,fragmentError:s.fragmentError,name:s.name,id:s.id,uri:s.uri,url:s.url,urlId:0,audioGroupIds:s.audioGroupIds,textGroupIds:s.textGroupIds};this.hls.trigger(Id.LEVEL_SWITCHING,o);const l=s.details;if(!l||l.live){const e=this.switchParams(s.uri,null==n?void 0:n.details,l);this.loadPlaylist(e)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(void 0===this._startLevel){const e=this.hls.config.startLevel;return void 0!==e?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){const t=this.steering.pathways(),r=e.filter(e=>-1!==t.indexOf(e));if(e.length<1)return void this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);this.steering.pathwayPriority=r}}onError(e,t){!t.fatal&&t.context&&t.context.type===Pd&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(void 0!==t&&t.type===Md){const e=t.elementaryStreams;if(!Object.keys(e).some(t=>!!e[t]))return;const r=this._levels[t.level];null!=r&&r.loadError&&(this.log(`Resetting level error count of ${r.loadError} on frag buffered`),r.loadError=0)}}onLevelLoaded(e,t){var r;const{level:n,details:i}=t,s=t.levelInfo;var a;if(!s)return this.warn(`Invalid level index ${n}`),void(null!=(a=t.deliveryDirectives)&&a.skip&&(i.deltaUpdateFailed=!0));if(s===this.currentLevel||t.withoutMultiVariant){0===s.fragmentError&&(s.loadError=0);let e=s.details;e===t.details&&e.advanced&&(e=void 0),this.playlistLoaded(n,t,e)}else null!=(r=t.deliveryDirectives)&&r.skip&&(i.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const r=this.getUrlWithDirectives(e.uri,t),n=this.currentLevelIndex,i=e.attrs["PATHWAY-ID"],s=e.details,a=null==s?void 0:s.age;this.log(`Loading level index ${n}${void 0!==(null==t?void 0:t.msn)?" at sn "+t.msn+" part "+t.part:""}${i?" Pathway "+i:""}${a&&s.live?" age "+a.toFixed(1)+(s.type&&" "+s.type||""):""} ${r}`),this.hls.trigger(Id.LEVEL_LOADING,{url:r,level:n,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(1===this._levels.length)return;const r=this._levels.filter((t,r)=>r!==e||(this.steering&&this.steering.removeLevel(t),t===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,t.details&&t.details.fragments.forEach(e=>e.level=-1)),!1));_g(r),this._levels=r,this.currentLevelIndex>-1&&null!=(t=this.currentLevel)&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const n=r.length-1;this._firstLevel=Math.min(this._firstLevel,n),this._startLevel&&(this._startLevel=Math.min(this._startLevel,n)),this.hls.trigger(Id.LEVELS_UPDATED,{levels:r})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:r}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(Id.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:r}))}}function Rw(e){const t={};e.forEach(e=>{const r=e.groupId||"";e.id=t[r]=t[r]||0,t[r]++})}function Lw(){return self.SourceBuffer||self.WebKitSourceBuffer}function Iw(){if(!Xd())return!1;const e=Lw();return!e||e.prototype&&"function"==typeof e.prototype.appendBuffer&&"function"==typeof e.prototype.remove}class Cw extends rm{constructor(e,t,r){super(e,t,r,"stream-controller",Md),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const e=this.media,t=e?e.currentTime:null;if(null===t||!kd(t))return;if(this.log(`Media seeked to ${t.toFixed(3)}`),!this.getBufferedFrag(t))return;const r=this.getFwdBufferInfoAtPos(e,t,Md,0);null!==r&&0!==r.len?this.tick():this.warn(`Main forward buffer length at ${t} on "seeked" event ${r?r.len:"empty"})`)},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(Id.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Id.LEVEL_LOADING,this.onLevelLoading,this),e.on(Id.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Id.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(Id.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(Id.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(Id.BUFFER_CREATED,this.onBufferCreated,this),e.on(Id.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(Id.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(Id.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(Id.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Id.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Id.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(Id.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(Id.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(Id.BUFFER_CREATED,this.onBufferCreated,this),e.off(Id.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(Id.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(Id.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:r,hls:n}=this;if(this.stopLoad(),this.setInterval(100),this.level=-1,!this.startFragRequested){let e=n.startLevel;-1===e&&(n.config.testBandwidth&&this.levels.length>1?(e=0,this.bitrateTest=!0):e=n.firstAutoLevel),n.nextLoadLevel=e,this.level=n.loadLevel,this._hasEnoughToStart=!!t}r>0&&-1===e&&!t&&(this.log(`Override startPosition with lastCurrentTime @${r.toFixed(3)}`),e=r),this.state=Vg,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=Hg}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case tm:{const{levels:e,level:t}=this,r=null==e?void 0:e[t],n=null==r?void 0:r.details;if(n&&(!n.live||this.levelLastLoaded===r&&!this.waitForLive(r))){if(this.waitForCdnTuneIn(n))break;this.state=Vg;break}if(this.hls.nextLoadLevel!==this.level){this.state=Vg;break}break}case Yg:this.checkRetryDate()}this.state===Vg&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),null!=(e=this.media)&&e.readyState&&!1===this.media.seeking&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:r,media:n}=this;if(null===t||!n&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;const i=this.buffering?e.nextLoadLevel:e.loadLevel;if(null==r||!r[i])return;const s=r[i],a=this.getMainFwdBufferInfo();if(null===a)return;const o=this.getLevelDetails();if(o&&this._streamEnded(a,o)){const e={};return 2===this.altAudio&&(e.type="video"),this.hls.trigger(Id.BUFFER_EOS,e),void(this.state=Zg)}if(!this.buffering)return;e.loadLevel!==i&&-1===e.manualLevel&&this.log(`Adapting to level ${i} from level ${this.level}`),this.level=e.nextLoadLevel=i;const l=s.details;if(!l||this.state===tm||this.waitForLive(s))return this.level=i,this.state=tm,void(this.startFragRequested=!1);const u=a.len,c=this.getMaxBufferLength(s.maxBitrate);if(u>=c)return;this.backtrackFragment&&this.backtrackFragment.start>a.end&&(this.backtrackFragment=null);const d=this.backtrackFragment?this.backtrackFragment.start:a.end;let h=this.getNextFragment(d,l);if(this.couldBacktrack&&!this.fragPrevious&&h&&gh(h)&&this.fragmentTracker.getState(h)!==sp){var f;const e=(null!=(f=this.backtrackFragment)?f:h).sn-l.startSN,t=l.fragments[e-1];t&&h.cc===t.cc&&(h=t,this.fragmentTracker.removeFragment(t))}else this.backtrackFragment&&a.len&&(this.backtrackFragment=null);if(h&&this.isLoopLoading(h,d)){if(!h.gap){const e=this.audioOnly&&!this.altAudio?dh:hh,t=(e===hh?this.videoBuffer:this.mediaBuffer)||this.media;t&&this.afterBufferFlushed(t,e,Md)}h=this.getNextFragmentLoopLoading(h,l,a,Md,c)}h&&(!h.initSegment||h.initSegment.data||this.bitrateTest||(h=h.initSegment),this.loadFragment(h,s,d))}loadFragment(e,t,r){const n=this.fragmentTracker.getState(e);n===rp||n===ip?gh(e)?this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):super.loadFragment(e,t,r):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,Md)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(null!=t&&t.readyState){let r;const n=this.getAppendedFrag(t.currentTime);n&&n.start>1&&this.flushMainBuffer(0,n.start-1);const i=this.getLevelDetails();if(null!=i&&i.live){const e=this.getMainFwdBufferInfo();if(!e||e.len<2*i.targetduration)return}if(!t.paused&&e){const t=e[this.hls.nextLoadLevel],n=this.fragLastKbps;r=n&&this.fragCurrent?this.fragCurrent.duration*t.maxBitrate/(1e3*n)+1:0}else r=0;const s=this.getBufferedFrag(t.currentTime+r);if(s){const e=this.followingBufferedFrag(s);if(e){this.abortCurrentFrag();const t=e.maxStartPTS?e.maxStartPTS:e.start,r=e.duration,n=Math.max(s.end,t+Math.min(Math.max(r-this.config.maxFragLookUpTolerance,r*(this.couldBacktrack?.5:.125)),r*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(n,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case Wg:case Kg:case Yg:case Xg:case Qg:this.state=Vg}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,2===this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const r=t.media;zg(r,"playing",this.onMediaPlaying),zg(r,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:r}=this;r&&(jg(r,"playing",this.onMediaPlaying),jg(r,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,t);!!t.transferMedia||(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(Id.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,t){let r=!1,n=!1;for(let e=0;e<t.levels.length;e++){const i=t.levels[e].audioCodec;i&&(r=r||-1!==i.indexOf("mp4a.40.2"),n=n||-1!==i.indexOf("mp4a.40.5"))}this.audioCodecSwitch=r&&n&&!function(){var e;const t=Lw();return"function"==typeof(null==t||null==(e=t.prototype)?void 0:e.changeType)}(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:r}=this;if(!r||this.state!==Vg)return;const n=t.levelInfo;(!n.details||n.details.live&&(this.levelLastLoaded!==n||n.details.expired)||this.waitForCdnTuneIn(n.details))&&(this.state=tm)}onLevelLoaded(e,t){var r;const{levels:n,startFragRequested:i}=this,s=t.level,a=t.details,o=a.totalduration;if(!n)return void this.warn(`Levels were reset while loading level ${s}`);this.log(`Level ${s} loaded [${a.startSN},${a.endSN}]${a.lastPartSn?`[part-${a.lastPartSn}-${a.lastPartIndex}]`:""}, cc [${a.startCC}, ${a.endCC}] duration:${o}`);const l=t.levelInfo,u=this.fragCurrent;!u||this.state!==Kg&&this.state!==Yg||u.level!==t.level&&u.loader&&this.abortCurrentFrag();let c=0;if(a.live||null!=(r=l.details)&&r.live){var d;if(this.checkLiveUpdate(a),a.deltaUpdateFailed)return;c=this.alignPlaylists(a,l.details,null==(d=this.levelLastLoaded)?void 0:d.details)}if(l.details=a,this.levelLastLoaded=l,i||this.setStartPosition(a,c),this.hls.trigger(Id.LEVEL_UPDATED,{details:a,level:s}),this.state===tm){if(this.waitForCdnTuneIn(a))return;this.state=Vg}i&&a.live&&this.synchronizeToLiveEdge(a),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:r}=this;if(!r)return;const n=this.hls.liveSyncPosition,i=this.getLoadPosition(),s=e.fragmentStart,a=e.edge,o=i>=s-t.maxFragLookUpTolerance&&i<=a;if(null!==n&&r.duration>n&&(i<n||!o)){const s=void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!o&&r.readyState<4||i<a-s)&&(this._hasEnoughToStart||(this.nextLoadPosition=n),r.readyState))if(this.warn(`Playback: ${i.toFixed(3)} is located too far from the end of live sliding playlist: ${a}, reset currentTime to : ${n.toFixed(3)}`),"buffered"===this.config.liveSyncMode){var l;const e=kp.bufferInfo(r,n,0);if(null==(l=e.buffered)||!l.length)return void(r.currentTime=n);if(e.start<=i)return void(r.currentTime=n);const{nextStart:t}=kp.bufferedInfo(e.buffered,i,0);t&&(r.currentTime=t)}else r.currentTime=n}}_handleFragmentLoadProgress(e){var t;const r=e.frag,{part:n,payload:i}=e,{levels:s}=this;if(!s)return void this.warn(`Levels were reset while fragment load was in progress. Fragment ${r.sn} of level ${r.level} will not be buffered`);const a=s[r.level];if(!a)return void this.warn(`Level ${r.level} not found on progress`);const o=a.details;if(!o)return this.warn(`Dropping fragment ${r.sn} of level ${r.level} after level details were reset`),void this.fragmentTracker.removeFragment(r);const l=a.videoCodec,u=o.PTSKnown||!o.live,c=null==(t=r.initSegment)?void 0:t.data,d=this._getAudioCodec(a),h=this.transmuxer=this.transmuxer||new _v(this.hls,Md,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=n?n.index:-1,p=-1!==f,g=new Sp(r.level,r.sn,r.stats.chunkCount,i.byteLength,f,p),m=this.initPTS[r.cc];h.push(i,c,d,l,r,n,o.totalduration,u,g,m)}onAudioTrackSwitching(e,t){const r=this.hls,n=0!==this.altAudio;if(_f(t.url,r))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const e=this.fragCurrent;e&&(this.log("Switching to main audio track, cancel main fragment load"),e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(n)return this.altAudio=0,this.fragmentTracker.removeAllFragments(),r.once(Id.BUFFER_FLUSHED,()=>{this.hls&&this.hls.trigger(Id.AUDIO_TRACK_SWITCHED,t)}),void r.trigger(Id.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});r.trigger(Id.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const r=_f(t.url,this.hls);if(r){const e=this.videoBuffer;e&&this.mediaBuffer!==e&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=e)}this.altAudio=r?2:0,this.tick()}onBufferCreated(e,t){const r=t.tracks;let n,i,s=!1;for(const e in r){const t=r[e];if("main"===t.id){if(i=e,n=t,"video"===e){const t=r[e];t&&(this.videoBuffer=t.buffer)}}else s=!0}s&&n?(this.log(`Alternate track found, use ${i}.buffered to schedule main fragment loading`),this.mediaBuffer=n.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:r,part:n}=t,i=r.type===Md;if(i){if(this.fragContextChanged(r))return this.warn(`Fragment ${r.sn}${n?" p: "+n.index:""} of level ${r.level} finished buffering, but was aborted. state: ${this.state}`),void(this.state===Qg&&(this.state=Vg));const e=n?n.stats:r.stats;this.fragLastKbps=Math.round(8*e.total/(e.buffering.end-e.loading.first)),gh(r)&&(this.fragPrevious=r),this.fragBufferedComplete(r,n)}const s=this.media;s&&(!this._hasEnoughToStart&&kp.getBuffered(s).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),i&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var r;if(t.fatal)this.state=Jg;else switch(t.details){case Ld.FRAG_GAP:case Ld.FRAG_PARSING_ERROR:case Ld.FRAG_DECRYPT_ERROR:case Ld.FRAG_LOAD_ERROR:case Ld.FRAG_LOAD_TIMEOUT:case Ld.KEY_LOAD_ERROR:case Ld.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Md,t);break;case Ld.LEVEL_LOAD_ERROR:case Ld.LEVEL_LOAD_TIMEOUT:case Ld.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==tm||(null==(r=t.context)?void 0:r.type)!==Pd||(this.state=Vg);break;case Ld.BUFFER_ADD_CODEC_ERROR:case Ld.BUFFER_APPEND_ERROR:if("main"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case Ld.BUFFER_FULL_ERROR:if("main"!==t.parent)return;if(this.reduceLengthAndFlushBuffer(t)){!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}break;case Ld.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}onFragLoadEmergencyAborted(){this.state=Vg,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==dh||!this.altAudio){const e=(t===hh?this.videoBuffer:this.mediaBuffer)||this.media;e&&(this.afterBufferFlushed(e,t,Md),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,-1===this.level&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let r=this.startPosition;if(r>=0&&t<r){if(e.seeking)return void this.log(`could not seek to ${r}, already seeking at ${t}`);const n=this.timelineOffset;n&&r&&(r+=n);const i=this.getLevelDetails(),s=kp.getBuffered(e),a=s.length?s.start(0):0,o=a-r,l=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||o>0&&(o<l||this.loadingParts&&o<2*((null==i?void 0:i.partTarget)||0)))&&(this.log(`adjusting start position by ${o} to match buffer start`),r+=o,this.startPosition=r),t<r&&(this.log(`seek to target start position ${r} from current time ${t} buffer start ${a}`),e.currentTime=r)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(e=>{const{hls:r}=this,n=null==e?void 0:e.frag;if(!n||this.fragContextChanged(n))return;t.fragmentError=0,this.state=Vg,this.startFragRequested=!1,this.bitrateTest=!1;const i=n.stats;i.parsing.start=i.parsing.end=i.buffering.start=i.buffering.end=self.performance.now(),r.trigger(Id.FRAG_LOADED,e),n.bitrateTest=!1}).catch(t=>{this.state!==Hg&&this.state!==Jg&&(this.warn(t),this.resetFragmentLoading(e))})}_handleTransmuxComplete(e){const t=this.playlistType,{hls:r}=this,{remuxResult:n,chunkMeta:i}=e,s=this.getCurrentContext(i);if(!s)return void this.resetWhenMissingContext(i);const{frag:a,part:o,level:l}=s,{video:u,text:c,id3:d,initSegment:h}=n,{details:f}=l,p=this.altAudio?void 0:n.audio;if(this.fragContextChanged(a))this.fragmentTracker.removeFragment(a);else{if(this.state=Xg,h){const e=h.tracks;if(e){const n=a.initSegment||a;if(this.unhandledEncryptionError(h,a))return;this._bufferInitSegment(l,e,n,i),r.trigger(Id.FRAG_PARSING_INIT_SEGMENT,{frag:n,id:t,tracks:e})}const n=h.initPTS,s=h.timescale,o=this.initPTS[a.cc];if(kd(n)&&(!o||o.baseTime!==n||o.timescale!==s)){const e=h.trackId;this.initPTS[a.cc]={baseTime:n,timescale:s,trackId:e},r.trigger(Id.INIT_PTS_FOUND,{frag:a,id:t,initPTS:n,timescale:s,trackId:e})}}if(u&&f){p&&"audiovideo"===u.type&&this.logMuxedErr(a);const e=f.fragments[a.sn-1-f.startSN],t=a.sn===f.startSN,r=!e||a.cc>e.cc;if(!1!==n.independent){const{startPTS:e,endPTS:n,startDTS:s,endDTS:l}=u;if(o)o.elementaryStreams[u.type]={startPTS:e,endPTS:n,startDTS:s,endDTS:l};else if(u.firstKeyFrame&&u.independent&&1===i.id&&!r&&(this.couldBacktrack=!0),u.dropped&&u.independent){const i=this.getMainFwdBufferInfo(),s=(i?i.end:this.getLoadPosition())+this.config.maxBufferHole,o=u.firstKeyFramePTS?u.firstKeyFramePTS:e;if(!t&&s<o-this.config.maxBufferHole&&!r)return void this.backtrack(a);r&&(a.gap=!0),a.setElementaryStreamInfo(u.type,a.start,n,a.start,l,!0)}else t&&e-(f.appliedTimelineOffset||0)>2&&(a.gap=!0);a.setElementaryStreamInfo(u.type,e,n,s,l),this.backtrackFragment&&(this.backtrackFragment=a),this.bufferFragmentData(u,a,o,i,t||r)}else{if(!t&&!r)return void this.backtrack(a);a.gap=!0}}if(p){const{startPTS:e,endPTS:t,startDTS:r,endDTS:n}=p;o&&(o.elementaryStreams[dh]={startPTS:e,endPTS:t,startDTS:r,endDTS:n}),a.setElementaryStreamInfo(dh,e,t,r,n),this.bufferFragmentData(p,a,o,i)}if(f&&null!=d&&d.samples.length){const e={id:t,frag:a,details:f,samples:d.samples};r.trigger(Id.FRAG_PARSING_METADATA,e)}if(f&&c){const e={id:t,frag:a,details:f,samples:c.samples};r.trigger(Id.FRAG_PARSING_USERDATA,e)}}}logMuxedErr(e){this.warn(`${gh(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,r,n){if(this.state!==Xg)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(r));const{audio:i,video:s,audiovideo:a}=t;if(i){const r=e.audioCodec;let n=rf(i.codec,r);"mp4a"===n&&(n="mp4a.40.5");const s=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){n&&(n=-1!==n.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5");const e=i.metadata;e&&"channelCount"in e&&1!==(e.channelCount||1)&&-1===s.indexOf("firefox")&&(n="mp4a.40.5")}n&&-1!==n.indexOf("mp4a.40.5")&&-1!==s.indexOf("android")&&"audio/mpeg"!==i.container&&(n="mp4a.40.2",this.log(`Android: force audio codec to ${n}`)),r&&r!==n&&this.log(`Swapping manifest audio codec "${r}" for "${n}"`),i.levelCodec=n,i.id=Md,this.log(`Init audio buffer, container:${i.container}, codecs[selected/level/parsed]=[${n||""}/${r||""}/${i.codec}]`),delete t.audiovideo}if(s){s.levelCodec=e.videoCodec,s.id=Md;const r=s.codec;if(4===(null==r?void 0:r.length))switch(r){case"hvc1":case"hev1":s.codec="hvc1.1.6.L120.90";break;case"av01":s.codec="av01.0.04M.08";break;case"avc1":s.codec="avc1.42e01e"}this.log(`Init video buffer, container:${s.container}, codecs[level/parsed]=[${e.videoCodec||""}/${r}]${s.codec!==r?" parsed-corrected="+s.codec:""}${s.supplemental?" supplemental="+s.supplemental:""}`),delete t.audiovideo}a&&(this.log(`Init audiovideo buffer, container:${a.container}, codecs[level/parsed]=[${e.codecs}/${a.codec}]`),delete t.video,delete t.audio);const o=Object.keys(t);if(o.length){if(this.hls.trigger(Id.BUFFER_CODECS,t),!this.hls)return;o.forEach(e=>{const i=t[e].initSegment;null!=i&&i.byteLength&&this.hls.trigger(Id.BUFFER_APPENDING,{type:e,data:i,frag:r,part:null,chunkMeta:n,parent:r.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&2===this.altAudio?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,Md)}get maxBufferLength(){const{levels:e,level:t}=this,r=null==e?void 0:e[t];return r?this.getMaxBufferLength(r.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=Vg}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&!1===e.seeking){const r=e.currentTime;if(kp.isBuffered(e,r)?t=this.getAppendedFrag(r):kp.isBuffered(e,r+.1)&&(t=this.getAppendedFrag(r+.1)),t){this.backtrackFragment=null;const e=this.fragPlaying,r=t.level;e&&t.sn===e.sn&&e.level===r||(this.fragPlaying=t,this.hls.trigger(Id.FRAG_CHANGED,{frag:t}),e&&e.level===r||this.hls.trigger(Id.LEVEL_SWITCHED,{level:r}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){var e;if(this.fragPlaying)return this.fragPlaying;const t=(null==(e=this.media)?void 0:e.currentTime)||this.lastCurrentTime;return kd(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=(null==(e=this.media)?void 0:e.currentTime)||this.lastCurrentTime;if(kd(t)){const e=this.getLevelDetails(),r=this.currentFrag||(e?Of(null,e.fragments,t):null);if(r){const e=r.programDateTime;if(null!==e){const n=e+1e3*(t-r.start);return new Date(n)}}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class Pw extends Gd{constructor(e,t){super("key-loader",t),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const r in this.keyIdToKeyInfo){const n=this.keyIdToKeyInfo[r].loader;if(n){var t;if(e&&e!==(null==(t=n.context)?void 0:t.frag.type))return;n.abort()}}}detach(){for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e].loader;t&&t.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(e,t=Ld.KEY_LOAD_ERROR,r,n,i){return new wp({type:Rd.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:i,error:r,networkDetails:n})}loadClear(e,t,r){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(let n=0,i=t.length;n<i;n++){const s=t[n];if(e.cc<=s.cc&&(!gh(e)||!gh(s)||e.sn<s.sn)||!r&&n==i-1)return this.emeController.selectKeySystemFormat(s).then(e=>{if(!this.emeController)return;s.setKeyFormat(e);const t=Qp(e);return t?this.emeController.getKeySystemAccess([t]):void 0})}if(this.config.requireKeySystemAccessOnStart){const e=Jp(this.config);if(e.length)return this.emeController.getKeySystemAccess(e)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var r,n;t&&e.setKeyFormat(t);const i=e.decryptdata;if(!i){const r=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(e,Ld.KEY_LOAD_ERROR,r))}const s=i.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,Ld.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));const a=Dw(i);let o=this.keyIdToKeyInfo[a];if(null!=(r=o)&&r.decryptdata.key)return i.key=o.decryptdata.key,Promise.resolve({frag:e,keyInfo:o});if(this.emeController&&null!=(n=o)&&n.keyLoadPromise){switch(this.emeController.getKeyStatus(o.decryptdata)){case"usable":case"usable-in-future":return o.keyLoadPromise.then(t=>{const{keyInfo:r}=t;return i.key=r.decryptdata.key,{frag:e,keyInfo:r}})}}switch(this.log(`${this.keyIdToKeyInfo[a]?"Rel":"L"}oading${i.keyId?" keyId: "+Jd(i.keyId):""} URI: ${i.uri} from ${e.type} ${e.level}`),o=this.keyIdToKeyInfo[a]={decryptdata:i,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},i.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return"identity"===i.keyFormat?this.loadKeyHTTP(o,e):this.loadKeyEME(o,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(o,e);default:return Promise.reject(this.createKeyLoadError(e,Ld.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${i.method}"`)))}}loadKeyEME(e,t){const r={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){var n;if(!e.decryptdata.keyId&&null!=(n=t.initSegment)&&n.data){const r=function(e){const t=[];return Oh(e,e=>t.push(e.subarray(8,24))),t}(t.initSegment.data);if(r.length){let t=r[0];t.some(e=>0!==e)?(this.log(`Using keyId found in init segment ${Jd(t)}`),ig.setKeyIdForUri(e.decryptdata.uri,t)):(t=ig.addKeyIdForUri(e.decryptdata.uri),this.log(`Generating keyId to patch media ${Jd(t)}`)),e.decryptdata.keyId=t}}if(!e.decryptdata.keyId&&!gh(t))return Promise.resolve(r);const i=this.emeController.loadKey(r);return(e.keyLoadPromise=i.then(t=>(e.mediaKeySessionContext=t,r))).catch(r=>{throw e.keyLoadPromise=null,"data"in r&&(r.data.frag=t),r})}return Promise.resolve(r)}loadKeyHTTP(e,t){const r=this.config,n=new(0,r.loader)(r);return t.keyLoader=e.loader=n,e.keyLoadPromise=new Promise((i,s)=>{const a={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},o=r.keyLoadPolicy.default,l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:(e,t,r,n)=>{const{frag:a,keyInfo:o}=r,l=Dw(o.decryptdata);if(!a.decryptdata||o!==this.keyIdToKeyInfo[l])return s(this.createKeyLoadError(a,Ld.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),n));o.decryptdata.key=a.decryptdata.key=new Uint8Array(e.data),a.keyLoader=null,o.loader=null,i({frag:a,keyInfo:o})},onError:(e,r,n,i)=>{this.resetLoader(r),s(this.createKeyLoadError(t,Ld.KEY_LOAD_ERROR,new Error(`HTTP Error ${e.code} loading key ${e.text}`),n,jd({url:a.url,data:void 0},e)))},onTimeout:(e,r,n)=>{this.resetLoader(r),s(this.createKeyLoadError(t,Ld.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),n))},onAbort:(e,r,n)=>{this.resetLoader(r),s(this.createKeyLoadError(t,Ld.INTERNAL_ABORTED,new Error("key loading aborted"),n))}};n.load(a,l,u)})}resetLoader(e){const{frag:t,keyInfo:r,url:n}=e,i=r.loader;t.keyLoader===i&&(t.keyLoader=null,r.loader=null);const s=Dw(r.decryptdata)||n;delete this.keyIdToKeyInfo[s],i&&i.destroy()}}function Dw(e){if(e.keyFormat!==Yp){const t=e.keyId;if(t)return Jd(t)}return e.uri}function _w(e){const{type:t}=e;switch(t){case Dd:return Od;case _d:return Nd;default:return Md}}function Mw(e,t){let r=e.url;return void 0!==r&&0!==r.indexOf("data:")||(r=t.url),r}class Ow{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Id.LEVEL_LOADING,this.onLevelLoading,this),e.on(Id.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(Id.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(Id.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(Id.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Id.LEVEL_LOADING,this.onLevelLoading,this),e.off(Id.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(Id.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(Id.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,r=t.pLoader,n=t.loader,i=new(r||n)(t);return this.loaders[e.type]=i,i}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:r}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:Cd,url:r,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:r,level:n,pathwayId:i,url:s,deliveryDirectives:a,levelInfo:o}=t;this.load({id:r,level:n,pathwayId:i,responseType:"text",type:Pd,url:s,deliveryDirectives:a,levelOrTrack:o})}onAudioTrackLoading(e,t){const{id:r,groupId:n,url:i,deliveryDirectives:s,track:a}=t;this.load({id:r,groupId:n,level:null,responseType:"text",type:Dd,url:i,deliveryDirectives:s,levelOrTrack:a})}onSubtitleTrackLoading(e,t){const{id:r,groupId:n,url:i,deliveryDirectives:s,track:a}=t;this.load({id:r,groupId:n,level:null,responseType:"text",type:_d,url:i,deliveryDirectives:s,levelOrTrack:a})}onLevelsUpdated(e,t){const r=this.loaders[Pd];if(r){const e=r.context;e&&!t.levels.some(t=>t===e.levelOrTrack)&&(r.abort(),delete this.loaders[Pd])}}load(e){var t;const r=this.hls.config;let n,i=this.getInternalLoader(e);if(i){const t=this.hls.logger,r=i.context;if(r&&r.levelOrTrack===e.levelOrTrack&&(r.url===e.url||r.deliveryDirectives&&!e.deliveryDirectives))return void(r.url===e.url?t.log(`[playlist-loader]: ignore ${e.url} ongoing request`):t.log(`[playlist-loader]: ignore ${e.url} in favor of ${r.url}`));t.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),i.abort()}if(n=e.type===Cd?r.manifestLoadPolicy.default:Ud({},r.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),i=this.createInternalLoader(e),kd(null==(t=e.deliveryDirectives)?void 0:t.part)){let t;if(e.type===Pd&&null!==e.level?t=this.hls.levels[e.level].details:e.type===Dd&&null!==e.id?t=this.hls.audioTracks[e.id].details:e.type===_d&&null!==e.id&&(t=this.hls.subtitleTracks[e.id].details),t){const e=t.partTarget,r=t.targetduration;if(e&&r){const t=1e3*Math.max(3*e,.8*r);n=Ud({},n,{maxTimeToFirstByteMs:Math.min(t,n.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(t,n.maxTimeToFirstByteMs)})}}}const s=n.errorRetry||n.timeoutRetry||{},a={loadPolicy:n,timeout:n.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},o={onSuccess:(e,t,r,n)=>{const i=this.getInternalLoader(r);this.resetInternalLoader(r.type);const s=e.data;t.parsing.start=performance.now(),dg.isMediaPlaylist(s)||r.type!==Cd?this.handleTrackOrLevelPlaylist(e,t,r,n||null,i):this.handleMasterPlaylist(e,t,r,n)},onError:(e,t,r,n)=>{this.handleNetworkError(t,r,!1,e,n)},onTimeout:(e,t,r)=>{this.handleNetworkError(t,r,!0,void 0,e)}};i.load(e,a,o)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:r}=this.hls;(e||r)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,r,n){const i=this.hls,s=e.data,a=Mw(e,r),o=dg.parseMasterPlaylist(s,a);if(o.playlistParsingError)return t.parsing.end=performance.now(),void this.handleManifestParsingError(e,r,o.playlistParsingError,n,t);const{contentSteering:l,levels:u,sessionData:c,sessionKeys:d,startTimeOffset:h,variableList:f}=o;this.variableList=f,u.forEach(e=>{const{unknownCodecs:t}=e;if(t){const{preferManagedMediaSource:r}=this.hls.config;let{audioCodec:n,videoCodec:i}=e;for(let s=t.length;s--;){const a=t[s];Yh(a,"audio",r)?(e.audioCodec=n=n?`${n},${a}`:a,Wh.audio[n.substring(0,4)]=2,t.splice(s,1)):Yh(a,"video",r)&&(e.videoCodec=i=i?`${i},${a}`:a,Wh.video[i.substring(0,4)]=2,t.splice(s,1))}}});const{AUDIO:p=[],SUBTITLES:g,"CLOSED-CAPTIONS":m}=dg.parseMasterPlaylistMedia(s,a,o);if(p.length){p.some(e=>!e.url)||!u[0].audioCodec||u[0].attrs.AUDIO||(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),p.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Dp({}),bitrate:0,url:""}))}i.trigger(Id.MANIFEST_LOADED,{levels:u,audioTracks:p,subtitles:g,captions:m,contentSteering:l,url:a,stats:t,networkDetails:n,sessionData:c,sessionKeys:d,startTimeOffset:h,variableList:f})}handleTrackOrLevelPlaylist(e,t,r,n,i){const s=this.hls,{id:a,level:o,type:l}=r,u=Mw(e,r),c=kd(o)?o:kd(a)?a:0,d=_w(r),h=dg.parseLevelPlaylist(e.data,u,c,d,0,this.variableList);if(l===Cd){const e={attrs:new Dp({}),bitrate:0,details:h,name:"",url:u};h.requestScheduled=t.loading.start+Ig(h,0),s.trigger(Id.MANIFEST_LOADED,{levels:[e],audioTracks:[],url:u,stats:t,networkDetails:n,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),r.levelDetails=h,this.handlePlaylistLoaded(h,e,t,r,n,i)}handleManifestParsingError(e,t,r,n,i){this.hls.trigger(Id.ERROR,{type:Rd.NETWORK_ERROR,details:Ld.MANIFEST_PARSING_ERROR,fatal:t.type===Cd,url:e.url,err:r,error:r,reason:r.message,response:e,context:t,networkDetails:n,stats:i})}handleNetworkError(e,t,r=!1,n,i){let s=`A network ${r?"timeout":"error"+(n?" (status "+n.code+")":"")} occurred while loading ${e.type}`;e.type===Pd?s+=`: ${e.level} id: ${e.id}`:e.type!==Dd&&e.type!==_d||(s+=` id: ${e.id} group-id: "${e.groupId}"`);const a=new Error(s);this.hls.logger.warn(`[playlist-loader]: ${s}`);let o=Ld.UNKNOWN,l=!1;const u=this.getInternalLoader(e);switch(e.type){case Cd:o=r?Ld.MANIFEST_LOAD_TIMEOUT:Ld.MANIFEST_LOAD_ERROR,l=!0;break;case Pd:o=r?Ld.LEVEL_LOAD_TIMEOUT:Ld.LEVEL_LOAD_ERROR,l=!1;break;case Dd:o=r?Ld.AUDIO_TRACK_LOAD_TIMEOUT:Ld.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case _d:o=r?Ld.SUBTITLE_TRACK_LOAD_TIMEOUT:Ld.SUBTITLE_LOAD_ERROR,l=!1}u&&this.resetInternalLoader(e.type);const c={type:Rd.NETWORK_ERROR,details:o,fatal:l,url:e.url,loader:u,context:e,error:a,networkDetails:t,stats:i};if(n){const r=(null==t?void 0:t.url)||e.url;c.response=jd({url:r,data:void 0},n)}this.hls.trigger(Id.ERROR,c)}handlePlaylistLoaded(e,t,r,n,i,s){const a=this.hls,{type:o,level:l,levelOrTrack:u,id:c,groupId:d,deliveryDirectives:h}=n,f=Mw(t,n),p=_w(n);let g="number"==typeof n.level&&p===Md?l:void 0;const m=e.playlistParsingError;if(m){if(this.hls.logger.warn(`${m} ${e.url}`),!a.config.ignorePlaylistParsingErrors)return void a.trigger(Id.ERROR,{type:Rd.NETWORK_ERROR,details:Ld.LEVEL_PARSING_ERROR,fatal:!1,url:f,error:m,reason:m.message,response:t,context:n,level:g,parent:p,networkDetails:i,stats:r});e.playlistParsingError=null}if(!e.fragments.length){const s=e.playlistParsingError=new Error("No Segments found in Playlist");return void a.trigger(Id.ERROR,{type:Rd.NETWORK_ERROR,details:Ld.LEVEL_EMPTY_ERROR,fatal:!1,url:f,error:s,reason:s.message,response:t,context:n,level:g,parent:p,networkDetails:i,stats:r})}switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),s.getCacheAge&&!isNaN(e.ageHeader)||(e.ageHeader=0)),o){case Cd:case Pd:if(g)if(u){if(u!==a.levels[g]){const e=a.levels.indexOf(u);e>-1&&(g=e)}}else g=0;a.trigger(Id.LEVEL_LOADED,{details:e,levelInfo:u||a.levels[0],level:g||0,id:c||0,stats:r,networkDetails:i,deliveryDirectives:h,withoutMultiVariant:o===Cd});break;case Dd:a.trigger(Id.AUDIO_TRACK_LOADED,{details:e,track:u,id:c||0,groupId:d||"",stats:r,networkDetails:i,deliveryDirectives:h});break;case _d:a.trigger(Id.SUBTITLE_TRACK_LOADED,{details:e,track:u,id:c||0,groupId:d||"",stats:r,networkDetails:i,deliveryDirectives:h})}}}class Nw{static get version(){return um}static isMSESupported(){return Iw()}static isSupported(){return function(){if(!Iw())return!1;const e=Xd();return"function"==typeof(null==e?void 0:e.isTypeSupported)&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(t=>e.isTypeSupported(Xh(t,"video")))||["mp4a.40.2","fLaC"].some(t=>e.isTypeSupported(Xh(t,"audio"))))}()}static getMediaSource(){return Xd()}static get Events(){return Id}static get MetadataSchema(){return Dm}static get ErrorTypes(){return Rd}static get ErrorDetails(){return Ld}static get DefaultConfig(){return Nw.defaultConfig?Nw.defaultConfig:pw}static set DefaultConfig(e){Nw.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new lm,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const t=this.logger=function(e,t,r){const n=Wd();if("object"==typeof console&&!0===e||"object"==typeof e){const i=["debug","log","info","warn","error"];i.forEach(t=>{n[t]=Kd(t,e,r)});try{n.log(`Debug logs enabled for "${t}" in hls.js version 1.6.15`)}catch(e){return Wd()}i.forEach(t=>{Yd[t]=Kd(t,e)})}else Ud(Yd,n);return n}(e.debug||!1,"Hls instance",e.assetPlayerId),r=this.config=function(e,t,r){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==t.liveMaxLatencyDurationCount&&(void 0===t.liveSyncDurationCount||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(void 0===t.liveSyncDuration||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const n=gw(e),i=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return["manifest","level","frag"].forEach(e=>{const s=`${"level"===e?"playlist":e}LoadPolicy`,a=void 0===t[s],o=[];i.forEach(r=>{const i=`${e}Loading${r}`,l=t[i];if(void 0!==l&&a){o.push(i);const e=n[s].default;switch(t[s]={default:e},r){case"TimeOut":e.maxLoadTimeMs=l,e.maxTimeToFirstByteMs=l;break;case"MaxRetry":e.errorRetry.maxNumRetry=l,e.timeoutRetry.maxNumRetry=l;break;case"RetryDelay":e.errorRetry.retryDelayMs=l,e.timeoutRetry.retryDelayMs=l;break;case"MaxRetryTimeout":e.errorRetry.maxRetryDelayMs=l,e.timeoutRetry.maxRetryDelayMs=l}}}),o.length&&r.warn(`hls.js config: "${o.join('", "')}" setting(s) are deprecated, use "${s}": ${xf(t[s])}`)}),jd(jd({},n),t)}(Nw.DefaultConfig,e,t);this.userConfig=e,r.progressive&&mw(r,t);const{abrController:n,bufferController:i,capLevelController:s,errorController:a,fpsController:o}=r,l=new a(this),u=this.abrController=new n(this),c=new ap(this),d=r.interstitialsController,h=d?this.interstitialsController=new d(this,Nw):null,f=this.bufferController=new i(this,c),p=this.capLevelController=new s(this),g=new o(this),m=new Ow(this),v=r.contentSteeringController,y=v?new v(this):null,b=this.levelController=new Aw(this,y),w=new kw(this),E=new Pw(this.config,this.logger),S=this.streamController=new Cw(this,c,E),T=this.gapController=new vw(this,c);p.setStreamController(S),g.setStreamController(S);const k=[m,b,S];h&&k.splice(1,0,h),y&&k.splice(1,0,y),this.networkControllers=k;const x=[u,f,T,p,g,w,c];this.audioTrackController=this.createController(r.audioTrackController,k);const A=r.audioStreamController;A&&k.push(this.audioStreamController=new A(this,c,E)),this.subtitleTrackController=this.createController(r.subtitleTrackController,k);const R=r.subtitleStreamController;R&&k.push(this.subtititleStreamController=new R(this,c,E)),this.createController(r.timelineController,x),E.emeController=this.emeController=this.createController(r.emeController,x),this.cmcdController=this.createController(r.cmcdController,x),this.latencyController=this.createController(xw,x),this.coreComponents=x,k.push(l);const L=l.onErrorOut;"function"==typeof L&&this.on(Id.ERROR,L,l),this.on(Id.MANIFEST_LOADED,m.onManifestLoaded,m)}createController(e,t){if(e){const r=new e(this);return t&&t.push(r),r}return null}on(e,t,r=this){this._emitter.on(e,t,r)}once(e,t,r=this){this._emitter.once(e,t,r)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,r=this,n){this._emitter.off(e,t,r,n)}listeners(e){return this._emitter.listeners(e)}emit(e,t,r){return this._emitter.emit(e,t,r)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(t){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+t.message+'". Here is a stacktrace:',t),!this.triggeringException){this.triggeringException=!0;const r=e===Id.ERROR;this.trigger(Id.ERROR,{type:Rd.OTHER_ERROR,details:Ld.INTERNAL_EXCEPTION,fatal:r,event:e,error:t}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(Id.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(e=>e.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(e=>e.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||"media"in e&&!e.media){const t=new Error(`attachMedia failed: invalid argument (${e})`);return void this.trigger(Id.ERROR,{type:Rd.OTHER_ERROR,details:Ld.ATTACH_MEDIA_ERROR,fatal:!0,error:t})}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,r=t?e.media:e,n=t?e:{media:r};this._media=r,this.trigger(Id.MEDIA_ATTACHING,n)}detachMedia(){this.logger.log("detachMedia"),this.trigger(Id.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(Id.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,r=this._url,n=this._url=uh.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${n}`),t&&r&&(r!==n||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(Id.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let r=0;r<this.networkControllers.length&&(this.networkControllers[r].startLoad(e,t),this.started&&this.networkControllers);r++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!this.started&&this.networkControllers);e++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach(e=>{e.resumeBuffering&&e.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()}))}get inFlightFragments(){const e={[Md]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[Od]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[Nd]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const e=this._media,t=null==e?void 0:e.currentTime;this.detachMedia(),e&&(this.attachMedia(e),t&&this.startLoad(t))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||(e=this._sessionId=function(){try{return crypto.randomUUID()}catch(e){try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch(e){let t=(new Date).getTime();const r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?r:3&r|8).toString(16)});return r}}}()),e}get levels(){const e=this.levelController.levels;return e||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){this.logger.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){this.logger.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){this.logger.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){this.logger.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return-1===e&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){this.logger.log(`set startLevel:${e}`),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get abrEwmaDefaultEstimate(){const{bwEstimator:e}=this.abrController;return e?e.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(this.logger.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){(function(e){return gf.indexOf(e)>-1})(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return-1===this.levelController.manualLevel}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const r=e.length;for(let n=0;n<r;n++)if(e[n].maxBitrate>=t)return n;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:r}=this;let n;if(n=-1===t&&null!=e&&e.length?e.length-1:t,r)for(let t=n;t--;){const n=e[t].attrs["HDCP-LEVEL"];if(n&&n<=r)return t}return n}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var t;return(null==(t=this.audioTrackController)?void 0:t.setAudioOption(e))||null}setSubtitleOption(e){var t;return(null==(t=this.subtitleTrackController)?void 0:t.setSubtitleOption(e))||null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return!!e&&e.subtitleDisplay}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!(null==(e=this.bufferController)||!e.bufferedToEnd)}get interstitialsManager(){var e;return(null==(e=this.interstitialsController)?void 0:e.interstitialsManager)||null}getMediaDecodingInfo(e,t=this.allAudioTracks){return hf(e,Rf(t),navigator.mediaCapabilities)}}Nw.defaultConfig=void 0;const Fw=({file:e,startTime:t,poster:r,autoplay:n=!0,active:i=!0,visible:s=!0,muted:a=!0})=>{const o=p.useRef(null),{isReady:l,prewarm:u,setLowestResolution:c,startBufferBasedUpshift:d}=(({file:e,videoRef:t,autoplay:r=!0,startTime:n,enabled:i=!0,onReady:s,onError:a})=>{const o=p.useRef(null),l=p.useRef(null),u=p.useRef(0),c=p.useRef(0),d=p.useRef(!1),h=p.useRef(!1),[f,g]=p.useState("idle"),[m,v]=p.useState(0),[y,b]=p.useState(!1),[w,E]=p.useState([]),[S,T]=p.useState("auto"),k=()=>{null!=l.current&&(clearTimeout(l.current),l.current=null)},x=(e=1e3)=>{if(null!=l.current)return;const t=u.current;if(t>=5)return g("error"),k(),void(null==a||a(new Error("Max retry reached")));const r=Math.min(15e3,e*Math.pow(2,Math.min(t,4)));g("loading"),console.log(`[HLS] schedule retry #${t+1} in ${r}ms`),l.current=window.setTimeout(()=>{l.current=null,u.current+=1,console.log(`[HLS] retryCount => ${u.current}`),v(e=>e+1)},r)};p.useEffect(()=>{u.current=0,c.current=0,h.current=!1,b(!1),v(0),g(e?"loading":"idle"),k()},[e]);const A=p.useCallback(()=>J(void 0,void 0,void 0,function*(){if(e)try{yield fetch(e,{method:"HEAD",mode:"cors",credentials:"omit"})}catch(e){}}),[e]);p.useEffect(()=>{var n;const l=t.current;if(!l||!e||!i)return void(e&&!i&&(h.current=!1,b(!1),g("idle")));let f=()=>{};try{null===(n=o.current)||void 0===n||n.destroy()}catch(e){}if(o.current=null,h.current=!1,b(!1),g("loading"),Nw.isSupported()){d.current=!1;const t=new Nw({lowLatencyMode:!1,backBufferLength:0,maxBufferLength:2,maxMaxBufferLength:4,maxBufferSize:2e6,maxBufferHole:.5,startFragPrefetch:!0,capLevelToPlayerSize:!0});o.current=t;const n=()=>{const e=(t.levels||[]).map((e,t)=>{const r=e.height,n=e.width,i=e.bitrate,s=e.name;return{id:t,height:r,width:n,bitrate:i,name:s,label:s||(r?`${r}p`:`Level ${t}`)}});E(e);const r=t.currentLevel;T(null==r||r<0?"auto":r)},i=()=>{h.current||(h.current=!0,b(!0),g("ready"),u.current=0,k(),null==s||s(),r&&l.play().catch(()=>{}))};t.on(Nw.Events.MANIFEST_PARSED,()=>{n(),r||L()}),t.on(Nw.Events.FRAG_BUFFERED,i),t.on(Nw.Events.BUFFER_APPENDED,i),t.on(Nw.Events.LEVEL_SWITCHED,(e,t)=>{const r=null==t?void 0:t.level;T(null==r||r<0?"auto":r)}),t.on(Nw.Events.ERROR,(e,r)=>{var n,i,s,l,d;const f=500===(null!==(l=null!==(i=null===(n=null==r?void 0:r.response)||void 0===n?void 0:n.code)&&void 0!==i?i:null===(s=null==r?void 0:r.response)||void 0===s?void 0:s.status)&&void 0!==l?l:null===(d=null==r?void 0:r.response)||void 0===d?void 0:d.statusCode);if(r.type!==Nw.ErrorTypes.NETWORK_ERROR||r.fatal){if(r.fatal){if(r.type===Nw.ErrorTypes.MEDIA_ERROR){if(c.current+=1,c.current<=2){try{t.recoverMediaError()}catch(e){}return void g("loading")}try{t.destroy()}catch(e){}return o.current=null,h.current=!1,b(!1),void x()}if(f){console.warn("[HLS] fatal 500 response - no retry");try{t.destroy()}catch(e){}return o.current=null,h.current=!1,b(!1),k(),g("error"),void(null==a||a(new Error("HTTP 500")))}try{t.destroy()}catch(e){}return o.current=null,h.current=!1,b(!1),void x()}}else{if(f){console.warn("[HLS] 500 response detected - no retry"),g("error");try{t.destroy()}catch(e){}return o.current=null,k(),void(null==a||a(new Error("HTTP 500")))}try{if(u.current>=5){g("error");try{t.destroy()}catch(e){}return o.current=null,void(null==a||a(new Error("Max retry reached")))}u.current+=1,console.log(`[HLS] non-fatal network retry => ${u.current}`),t.startLoad()}catch(e){}}}),t.attachMedia(l),t.loadSource(e),f=()=>{try{t.destroy()}catch(e){}o.current=null}}else if(l.canPlayType("application/vnd.apple.mpegURL")){d.current=!0,l.src!==e&&(l.src=e);const t=()=>{h.current||(h.current=!0,b(!0),g("ready"),u.current=0,k(),null==s||s(),r&&l.play().catch(()=>{}))},n=()=>{if(h.current=!1,b(!1),u.current>=5)return g("error"),void(null==a||a(new Error("Max retry reached")));x()};l.addEventListener("loadedmetadata",t),l.addEventListener("error",n),r&&l.play().catch(()=>{}),f=()=>{l.removeEventListener("loadedmetadata",t),l.removeEventListener("error",n)}}else g("error"),null==a||a(new Error("HLS not supported"));return()=>{f(),k()}},[e,m,r,s,a,t,i]),p.useEffect(()=>{if(!y)return;if(null==n||n<=0)return;const e=t.current;if(e)try{Math.abs(e.currentTime-n)>.5&&(e.currentTime=n)}catch(e){}},[y,n,t]),p.useEffect(()=>{const e=t.current;if(!e)return;const r=()=>g("ready"),n=()=>g("ready"),i=()=>{"error"!==f&&g("loading")},s=()=>g("loading"),o=()=>{g("error"),null==a||a()};return e.addEventListener("playing",r),e.addEventListener("canplay",n),e.addEventListener("waiting",i),e.addEventListener("stalled",s),e.addEventListener("error",o),()=>{e.removeEventListener("playing",r),e.removeEventListener("canplay",n),e.removeEventListener("waiting",i),e.removeEventListener("stalled",s),e.removeEventListener("error",o)}},[f,a,t]);const R=p.useCallback(()=>{const e=o.current;e&&!d.current&&(console.log("Set auto resolution"),e.nextLevel=-1,T("auto"))},[]),L=p.useCallback(()=>{var e,t;const r=o.current;if(!r)return;const n=r.levels||[];if(n.length){let i=0;for(let r=1;r<n.length;r++)(null!==(e=n[r].height)&&void 0!==e?e:99999)<(null!==(t=n[i].height)&&void 0!==t?t:99999)&&(i=r);r.currentLevel=i}},[]),I=p.useCallback((e=2)=>{const r=o.current,n=t.current;if(!r||!n||d.current)return()=>{};let i=!1;const s=()=>{if(!i)if(r.autoLevelEnabled)i=!0;else try{n.buffered.length>0&&n.buffered.end(0)-n.currentTime>=e&&(r.nextLevel=-1,T("auto"),i=!0)}catch(e){}};return r.on(Nw.Events.FRAG_BUFFERED,s),()=>{r.off(Nw.Events.FRAG_BUFFERED,s)}},[t]);return{playbackStatus:f,isReady:y,qualities:w,currentLevel:S,isAutoQuality:p.useMemo(()=>"auto"===S,[S]),canSetResolution:!d.current&&Nw.isSupported(),setResolution:e=>{const t=o.current;if(!t||d.current)return;if("string"==typeof e&&"auto"===e.toLowerCase())return t.currentLevel=-1,void T("auto");const r="number"==typeof e?e:parseInt(e,10);if(!Number.isFinite(r)){const r=w.find(t=>t.label.toLowerCase()===String(e).toLowerCase());return void(r&&(t.currentLevel=r.id,T(r.id)))}const n=[...w].filter(e=>e.height).sort((e,t)=>(t.height||0)-(e.height||0)),i=n.find(e=>(e.height||0)<=r)||n[n.length-1];i&&(t.currentLevel=i.id,T(i.id))},setAutoResolution:R,prewarm:A,setLowestResolution:L,startBufferBasedUpshift:I}})({file:e,videoRef:o,autoplay:n,startTime:t,enabled:n||i});return p.useEffect(()=>{u()},[u]),g.useEffect(()=>{var e,t;const r=o.current;if(r)if(i)null===(e=r.play)||void 0===e||e.call(r).catch(()=>{});else try{null===(t=r.pause)||void 0===t||t.call(r)}catch(e){}},[i,l]),p.useEffect(()=>{if(!i)return;c();return d(2)},[i,c,d]),g.createElement("video",{ref:o,playsInline:!0,autoPlay:n,muted:a,poster:Gt(r||""),preload:"metadata",className:"w-full h-full object-cover object-center bg-black",style:{opacity:s&&l?1:0,transition:"opacity 200ms ease-in-out"}})},$w=({view:e})=>g.createElement("div",{className:"absolute",style:{top:8,left:8,borderRadius:"4px",color:"white",overflow:"hidden",fontSize:11}},g.createElement("span",{style:{backgroundColor:"rgba(62,213,69,0.71)",color:"white",padding:4,paddingLeft:9,paddingRight:9,display:"inline-block",lineHeight:1}},"다시보기"),g.createElement("span",{style:{backgroundColor:"rgba(58,58,58,0.52)",color:"white",padding:4,paddingLeft:9,paddingRight:9,display:"inline-block",lineHeight:1}},e," 시청")),Bw=({content:e,aspectRatio:t="9/16",cursor:r="default",borderRadius:n,playback:i="hover"})=>{var s,a,o,l,u;const c=g.useRef(null),[d,h]=g.useState(!1),f=g.useRef(null),[p,m]=g.useState(!1),[v,y]=g.useState(!0),[b,w]=g.useState(!1),{boxSize:E}=Sd(t,c),S=e.thumbPath||(null===(a=null===(s=null==e?void 0:e.designInfo)||void 0===s?void 0:s.thumbPath)||void 0===a?void 0:a.preview),T=3===e.status,{API_BASE_URL:k,PLAYER_BASE_URL:x}=Mt(),A=`${k}/hls/${null===(o=e.replay)||void 0===o?void 0:o.objectId}`;g.useEffect(()=>{const e=c.current;if(!e)return;const t=new IntersectionObserver(e=>{const t=e[0];w(t.isIntersecting&&t.intersectionRatio>=.5)},{root:null,threshold:[0,.5,1]});return t.observe(e),()=>t.disconnect()},[i]),g.useEffect(()=>{var e;if("undefined"!=typeof window&&window.matchMedia)try{const t=window.matchMedia("(pointer: fine)"),r=()=>y(t.matches);return r(),null===(e=t.addEventListener)||void 0===e||e.call(t,"change",r),()=>{var e;return null===(e=t.removeEventListener)||void 0===e?void 0:e.call(t,"change",r)}}catch(e){}},[i]);const R=()=>{null!=f.current&&(clearTimeout(f.current),f.current=null)},L=()=>{m(!0),R(),h(!1)};g.useEffect(()=>{const e=()=>m(!1);return window.addEventListener("mouseup",e),window.addEventListener("touchend",e),window.addEventListener("pointerup",e),()=>{window.removeEventListener("mouseup",e),window.removeEventListener("touchend",e),window.removeEventListener("pointerup",e)}},[i]);const I="hover"===i&&v,C=Boolean(A&&("autoplay"===i&&b||I&&d));return g.createElement("div",{className:"w-full h-full flex flex-col items-center justify-center",ref:c,onMouseEnter:()=>{"hover"===i&&v&&(p||(R(),f.current=window.setTimeout(()=>{h(!0)},150)))},onMouseLeave:()=>{R(),h(!1)},onMouseDown:L,onTouchStart:L},g.createElement("div",{className:"relative rounded overflow-hidden",style:{width:E.width?`${E.width}px`:"100%",height:E.height?`${E.height}px`:"100%",borderRadius:`${null!=n?n:10}px`,backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:E.height?void 0:t,backgroundImage:S?`url(${Gt(S)})`:void 0,backgroundColor:S?void 0:"black"}},T?g.createElement("iframe",{src:`${x}/live/${e.eventId}`,className:"w-full h-full"}):g.createElement(g.Fragment,null,g.createElement("div",{className:"absolute inset-0 w-full h-full object-cover",style:{pointerEvents:"none"}},g.createElement(Fw,{file:A,poster:S,autoplay:"autoplay"===i,active:"autoplay"===i&&b||I&&d,visible:C,muted:!0})),!C&&g.createElement(wd,null),g.createElement($w,{view:null!==(u=null===(l=e.statistics)||void 0===l?void 0:l.pageView)&&void 0!==u?u:0}))))},Uw=e=>{var t,r,n,i;const{content:s,title:a,aspectRatio:o="9/16",card:l,titleFontSize:u}=e,c=null!==(t=null==l?void 0:l.layout)&&void 0!==t?t:"slider",d=null!==(r=null==l?void 0:l.sliderPerView)&&void 0!==r?r:3,h=null!==(n=null==l?void 0:l.gridColumns)&&void 0!==n?n:3,f=null!==(i=null==l?void 0:l.gap)&&void 0!==i?i:12,m=null==l?void 0:l.width,v=m?"auto":d,y=p.useMemo(()=>({fontSize:u?`${u}px`:void 0,fontWeight:600}),[u]),{PLAYER_BASE_URL:b}=Mt(),w=p.useMemo(()=>"past"===e.liveType?s.filter(e=>{var t,r;return 1===e.openStatus||Boolean(null===(t=e.replay)||void 0===t?void 0:t.objectId)&&Boolean(null===(r=e.replay)||void 0===r?void 0:r.isReplayOpen)}):s,[s,e.liveType]);return s&&0!==s.length?g.createElement("div",{className:"flex flex-col w-full",style:{gap:f}},g.createElement("p",{className:"truncate",style:Object.assign(Object.assign({},y),{userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",cursor:"default"})},a||("past"===e.liveType?"지난 라이브":"예정된 라이브")),"slider"===c?g.createElement("div",null,g.createElement(_n,{key:`${v}-${null!=m?m:""}-${f}`,slidesPerView:v,spaceBetween:f},w.map(t=>{var r,n;return g.createElement(Mn,{key:t.eventId,style:m?{width:`${m}px`}:void 0},g.createElement("a",{href:`${b}/live/${t.eventId}`,target:"_blank",rel:"noopener noreferrer",className:"flex flex-col",style:{gap:6,textDecoration:"none",cursor:"pointer"}},"past"===e.liveType?g.createElement(Bw,{content:t,aspectRatio:o,cursor:"pointer",borderRadius:null==l?void 0:l.borderRadius,playback:e.playback}):g.createElement(Td,{content:t,aspectRatio:o,cursor:"pointer",borderRadius:null==l?void 0:l.borderRadius}),g.createElement("p",{className:"truncate",style:{color:null!==(n=null===(r=e.theme)||void 0===r?void 0:r.textColor)&&void 0!==n?n:"black",fontSize:14,userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"}},t.eventName)))}))):g.createElement("div",{style:{overflowY:"auto"}},g.createElement("div",{style:{display:"grid",gridTemplateColumns:m?`repeat(auto-fill, ${m}px)`:`repeat(${h}, minmax(0, 1fr))`,gap:f}},w.map(t=>{var r,n;return g.createElement("a",{key:t.eventId,href:`${b}/live/${t.eventId}`,target:"_blank",rel:"noopener noreferrer",className:"flex flex-col",style:{gap:6,textDecoration:"none",cursor:"pointer"}},"past"===e.liveType?g.createElement(Bw,{content:t,aspectRatio:o,cursor:"pointer",borderRadius:null==l?void 0:l.borderRadius,playback:e.playback}):g.createElement(Td,{content:t,aspectRatio:o,cursor:"pointer",borderRadius:null==l?void 0:l.borderRadius}),g.createElement("p",{className:"truncate",style:{color:null!==(n=null===(r=e.theme)||void 0===r?void 0:r.textColor)&&void 0!==n?n:"black",fontSize:14,userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"}},t.eventName))})))):null};var zw;!function(e){e[e.READY=1]="READY",e[e.STREAMING=2]="STREAMING",e[e.PAUSED=3]="PAUSED"}(zw||(zw={}));const jw=({content:e})=>{const t=g.useMemo(()=>vt(e.start).tz("Asia/Seoul").format("M월 D일 A HH:mm"),[e.start]),r=e.eventStatus!==zw.READY;return g.createElement("div",{className:"flex-1 flex flex-col gap-5 items-center justify-center"},g.createElement("p",{style:{fontWeight:"bold",fontSize:"24px"}},e.eventName),!r&&g.createElement("p",null,t),g.createElement("button",{onClick:()=>{window.open(`https://player.midibus.im/live/${e.eventId}`,"_blank")},className:"rounded bg-black text-white cursor-pointer",style:{width:"70%",padding:"10px"}},"라이브 입장하기"))},Gw=e=>{var t,r;const{content:n,aspectRatio:i="9/16",videoAlign:s}=e,a=null===(t=e.card)||void 0===t?void 0:t.borderRadius,o=null===(r=e.card)||void 0===r?void 0:r.width,{PLAYER_BASE_URL:l}=Mt();return g.createElement("div",{className:"flex w-full h-full items-center justify-center"},"only"===s?g.createElement("a",{className:"w-full h-full",href:`${l}/live/${n.eventId}`,target:"_blank",rel:"noopener noreferrer",style:o?{width:`${o}px`}:void 0},g.createElement(Td,{content:n,aspectRatio:i,borderRadius:a,cursor:"pointer"})):"left"===s?g.createElement(g.Fragment,null,g.createElement("div",{className:"flex-1"},g.createElement("a",{href:`${l}/live/${n.eventId}`,target:"_blank",rel:"noopener noreferrer",style:o?{width:`${o}px`}:void 0},g.createElement(Td,{content:n,aspectRatio:i,borderRadius:a,cursor:"pointer"}))),g.createElement(jw,{content:n})):g.createElement(g.Fragment,null,g.createElement(jw,{content:n}),g.createElement("div",{className:"flex-1"},g.createElement("a",{href:`${l}/live/${n.eventId}`,target:"_blank",rel:"noopener noreferrer",style:o?{width:`${o}px`}:void 0},g.createElement(Td,{content:n,aspectRatio:i,borderRadius:a,cursor:"pointer"})))))},Hw=e=>{var t;const{theme:r,titleFontSize:n,title:i}=e;return g.createElement("div",{className:"w-full h-full flex flex-col",style:{color:null!==(t=null==r?void 0:r.textColor)&&void 0!==t?t:"#252525"}},g.createElement("p",{style:Object.assign(Object.assign({},n&&{fontSize:n}),{fontWeight:"bold",color:null==r?void 0:r.textColor,paddingTop:"10px",paddingBottom:"10px",marginBottom:"30px"})},i||("past"===e.liveType?"지난 라이브":"예정된 라이브")),g.createElement("div",{className:"self-center text-center h-full flex flex-col items-center justify-center",style:{minHeight:"200px"}},g.createElement("p",{style:{fontSize:"20px",marginBottom:"10px"}},"past"===e.liveType?"지난 라이브가 없어요.":"예정된 라이브가 없어요."),g.createElement("span",{style:{fontWeight:"lighter"}},"past"===e.liveType?"다른 콘텐츠도 확인해 보세요.":"곧 혜택 가득한 라이브로 찾아올게요!")))},Vw=e=>{var t,r,n,i;const{widgetType:s,theme:a,layout:o}=e,{liveWidget:l}=bd(),u=null!==(t=null==o?void 0:o.paddingTop)&&void 0!==t?t:0,c=null!==(r=null==o?void 0:o.paddingBottom)&&void 0!==r?r:0,d=null!==(n=null==o?void 0:o.paddingLeft)&&void 0!==n?n:0,h=null!==(i=null==o?void 0:o.paddingRight)&&void 0!==i?i:0;return l&&0!==l.length?g.createElement("div",{className:"w-full h-full",style:{backgroundColor:null==a?void 0:a.backgroundColor,color:null==a?void 0:a.textColor,paddingTop:u,paddingBottom:c,paddingLeft:d,paddingRight:h}},"ONE"===s&&"past"!==e.liveType?g.createElement(Gw,Object.assign({content:l[0]},e)):g.createElement(Uw,Object.assign({content:l},e))):g.createElement(Hw,Object.assign({},e))},Ww=U(e=>{const{container:t}=pc();return t?g.createElement(hr,null,g.createElement(gc,Object.assign({},e,{container:t}))):null},{props:{collectionId:"string",iconForm:"string",iconShape:"string",iconSize:"number",borderLine:"string",exposeTitle:"boolean",titlePosition:"string",player:"string",rounded:"boolean",exposeProductBanner:"boolean",exposeProductBadge:"boolean",priceText:"string",iconRatio:"string",hoverPlay:"boolean",thumbnailAutoPlay:"boolean"}}),Kw=U(e=>{const{container:t}=pc();return t?g.createElement(hr,null,g.createElement(vc,Object.assign({},e,{container:t}))):null},{props:{collectionId:"string",aspectRatio:"string"}}),Yw=U(({shortsId:e,type:t,isPreview:r})=>{const{setShortform:n,shortform:i}=yc();return p.useEffect(()=>{if(!e)return;e&&J(void 0,void 0,void 0,function*(){const t=yield rr(e,r);t&&n(Object.assign(Object.assign({},t),{uuid:Ut()}))})},[e]),i?g.createElement(ac.div,{style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:99999}},g.createElement(fc,null),g.createElement("div",{style:{pointerEvents:"auto"}},g.createElement(vd,{shortsId:e,type:t}))):null},{props:{shortsId:"string",type:"string"}}),qw=U(e=>{const{setLiveWidget:t,liveWidget:r}=bd(),{userId:n,card:i,includeRepresentative:s,liveType:a}=e;return p.useEffect(()=>{if(!n)return;if(r&&(null==i?void 0:i.visibleCount)&&r.length>Number(i.visibleCount))return void t(r.slice(0,null==i?void 0:i.visibleCount));const o=()=>J(void 0,void 0,void 0,function*(){const r=(null==i?void 0:i.visibleCount)||6,a=yield nr(n,"FINISHED",r,e.sorting);if(!a)return;let o;if(s){const e=yield nr(n,"UPCOMING",1);if(e&&0!==e.length){const t=Math.max(0,r-1);o=[e[0],...a.slice(0,t)]}else o=a.slice(0,r)}else o=a.slice(0,r);yield Promise.all(o.map(e=>J(void 0,void 0,void 0,function*(){const t=yield((e,t)=>J(void 0,void 0,void 0,function*(){const{STATISTICS_BASE_URL:r}=Mt(),n=`${r}/replay/${e}/${t}/summary`,i=yield fetch(n);if(404!==i.status){if(!i.ok){const e=yield i.text().catch(()=>"");return console.error(`[ReplayStatistics] ${i.status} ${i.statusText} ${e}`),{pageView:0,like:0}}return i.json()}}))(n,e.eventId);e.statistics=t}))),t(o)});J(void 0,void 0,void 0,function*(){"past"===a?yield o():yield J(void 0,void 0,void 0,function*(){const e=yield nr(n,"UPCOMING",(null==i?void 0:i.visibleCount)||6);e&&t(s?e.slice(0,(null==i?void 0:i.visibleCount)||6):e.slice(1,(null==i?void 0:i.visibleCount)+1||7))})})},[n,null==i?void 0:i.visibleCount,a,e.sorting,s]),g.createElement(ac.div,{className:"w-full h-full"},g.createElement(fc,null),g.createElement(Vw,Object.assign({},e)))},{props:{userId:"string",title:"string",titleFontSize:"number",isPreview:"boolean",liveType:"string",widgetType:"string",videoAlign:"string",aspectRatio:"string",playback:"string",includeRepresentative:"boolean",theme:"json",layout:"json",card:"json",sorting:"string"}});customElements.define("mc-widget-player",Ww),customElements.define("mc-collection-showcase",Kw),customElements.define("mc-floating-player",Yw),customElements.define("mc-live-widget",qw)});