/*! For license information please see TabsContext.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports["l3-style"]=t(require("react")):e["l3-style"]=t(e.react)}(this,(e=>(()=>{var t={94184:(e,t)=>{var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)){if(r.length){var u=o.apply(null,r);u&&e.push(u)}}else if("object"===i){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){e.push(r.toString());continue}for(var a in r)n.call(r,a)&&r[a]&&e.push(a)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},30351:(e,t,r)=>{"use strict";r.r(t)},42487:(e,t,r)=>{"use strict";r.r(t)},75251:(e,t,r)=>{"use strict";var n=r(8156),o=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),t.Fragment=i("react.fragment")}var u=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};function f(e,t,r){var n,i={},f=null,c=null;for(n in void 0!==r&&(f=""+r),void 0!==t.key&&(f=""+t.key),void 0!==t.ref&&(c=t.ref),t)a.call(t,n)&&!s.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===i[n]&&(i[n]=t[n]);return{$$typeof:o,type:e,key:f,ref:c,props:i,_owner:u.current}}t.jsx=f,t.jsxs=f},85893:(e,t,r)=>{"use strict";e.exports=r(75251)},1642:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=r(85893),s=i(r(8156)),f=u(r(94184)),c=u(r(98649)),l=u(r(90164));r(30351);const d=(0,s.forwardRef)((({className:e,id:t,activeTabId:r=0,children:n},o)=>{const i=(0,s.useRef)(null),u=(0,c.default)({refs:[o,i]}),[d,p]=(0,s.useState)(r),[y,v]=(0,s.useState)(r),_=(0,l.default)(r);(0,s.useEffect)((()=>{r!==_&&r!==y&&(p(y),v(r))}),[r,_,y,p,v]);const b=(0,s.useCallback)((e=>{p(y),v(e)}),[p,y,v]);return(0,a.jsx)("div",Object.assign({ref:u,className:(0,f.default)("tabs-context--wrapper",e),id:t},{children:s.default.Children.map(n,(e=>{if(e.type.isTabList)return s.default.cloneElement(e,{activeTabId:y,onTabChange:b});if(e.type.isTabPanels){const t=d<y?"ltr":"rtl";return s.default.cloneElement(e,{activeTabId:y,animationDirection:t})}return e}))}))}));t.default=d},98649:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(8156);t.default=function({refs:e=[]}){return(0,n.useMemo)((()=>e.every((e=>null===e))?null:t=>{e.forEach((e=>{e&&function(e,t){if(null===e)return;if("function"==typeof e)return void e(t);try{e.current=t}catch(r){throw console.error(r),new Error(`Cannot assign value '${t}' to ref '${e}'`)}}(e,t)}))}),[e])}},90164:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(8156);t.default=function(e){const t=(0,n.useRef)(void 0);return(0,n.useLayoutEffect)((()=>{t.current=e})),t.current}},41921:(e,t,r)=>{"use strict";r(42487)},8156:t=>{"use strict";t.exports=e}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return t[e].call(i.exports,i,i.exports,n),i.exports}return n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(41921),n(1642)})()));
//# sourceMappingURL=TabsContext.js.map