!function(a,b){"function"==typeofdefine&&define.amd?define([],b):"object"==typeofexports?module.exports=b():a.computeLayout=b()}(this,function(){vara=function(){functiona(b){if(b.layout&&!b.isDirty||(b.layout={width:void0,height:void0,top:0,left:0,right:0,bottom:0}),b.style||(b.style={}),b.children||(b.children=[]),b.style.measure&&b.children&&b.children.length)thrownewError("Using custom measure function is supported only for leaf nodes.");returnb.children.forEach(a),b}functionb(a){returnvoid0===a}functionc(a){returna===Q||a===R}functiond(a){returna===S||a===T}functione(a,b){if(void0!==a.style.marginStart&&c(b))returna.style.marginStart;vard=null;switch(b){case"row":d=a.style.marginLeft;break;case"row-reverse":d=a.style.marginRight;break;case"column":d=a.style.marginTop;break;case"column-reverse":d=a.style.marginBottom}returnvoid0!==d?d:void0!==a.style.margin?a.style.margin:0}functionf(a,b){if(void0!==a.style.marginEnd&&c(b))returna.style.marginEnd;vard=null;switch(b){case"row":d=a.style.marginRight;break;case"row-reverse":d=a.style.marginLeft;break;case"column":d=a.style.marginBottom;break;case"column-reverse":d=a.style.marginTop}returnnull!=d?d:void0!==a.style.margin?a.style.margin:0}functiong(a,b){if(void0!==a.style.paddingStart&&a.style.paddingStart>=0&&c(b))returna.style.paddingStart;vard=null;switch(b){case"row":d=a.style.paddingLeft;break;case"row-reverse":d=a.style.paddingRight;break;case"column":d=a.style.paddingTop;break;case"column-reverse":d=a.style.paddingBottom}returnnull!=d&&d>=0?d:void0!==a.style.padding&&a.style.padding>=0?a.style.padding:0}functionh(a,b){if(void0!==a.style.paddingEnd&&a.style.paddingEnd>=0&&c(b))returna.style.paddingEnd;vard=null;switch(b){case"row":d=a.style.paddingRight;break;case"row-reverse":d=a.style.paddingLeft;break;case"column":d=a.style.paddingBottom;break;case"column-reverse":d=a.style.paddingTop}returnnull!=d&&d>=0?d:void0!==a.style.padding&&a.style.padding>=0?a.style.padding:0}functioni(a,b){if(void0!==a.style.borderStartWidth&&a.style.borderStartWidth>=0&&c(b))returna.style.borderStartWidth;vard=null;switch(b){case"row":d=a.style.borderLeftWidth;break;case"row-reverse":d=a.style.borderRightWidth;break;case"column":d=a.style.borderTopWidth;break;case"column-reverse":d=a.style.borderBottomWidth}returnnull!=d&&d>=0?d:void0!==a.style.borderWidth&&a.style.borderWidth>=0?a.style.borderWidth:0}functionj(a,b){if(void0!==a.style.borderEndWidth&&a.style.borderEndWidth>=0&&c(b))returna.style.borderEndWidth;vard=null;switch(b){case"row":d=a.style.borderRightWidth;break;case"row-reverse":d=a.style.borderLeftWidth;break;case"column":d=a.style.borderBottomWidth;break;case"column-reverse":d=a.style.borderTopWidth}returnnull!=d&&d>=0?d:void0!==a.style.borderWidth&&a.style.borderWidth>=0?a.style.borderWidth:0}functionk(a,b){returng(a,b)+i(a,b)}functionl(a,b){returnh(a,b)+j(a,b)}functionm(a,b){returni(a,b)+j(a,b)}functionn(a,b){returne(a,b)+f(a,b)}functiono(a,b){returnk(a,b)+l(a,b)}functionp(a){returna.style.justifyContent?a.style.justifyContent:"flex-start"}functionq(a){returna.style.alignContent?a.style.alignContent:"flex-start"}functionr(a,b){returnb.style.alignSelf?b.style.alignSelf:a.style.alignItems?a.style.alignItems:"stretch"}functions(a,b){if(b===P){if(a===Q)returnR;if(a===R)returnQ}returna}functiont(a,b){varc;returnc=a.style.direction?a.style.direction:N,c===N&&(c=void0===b?O:b),c}functionu(a){returna.style.flexDirection?a.style.flexDirection:S}functionv(a,b){returnd(a)?s(Q,b):S}functionw(a){returna.style.position?a.style.position:"relative"}functionx(a){returnw(a)===ba&&a.style.flex>0}functiony(a){return"wrap"===a.style.flexWrap}functionz(a,b){returna.layout[ga[b]]+n(a,b)}functionA(a,b){returnvoid0!==a.style[ga[b]]&&a.style[ga[b]]>=0}functionB(a,b){returnvoid0!==a.layout[ga[b]]&&a.layout[ga[b]]>=0}functionC(a,b){returnvoid0!==a.style[b]}functionD(a){returnvoid0!==a.style.measure}functionE(a,b){returnvoid0!==a.style[b]?a.style[b]:0}functionF(a,b,c){vard={row:a.style.minWidth,"r