{"ast":null,"code":"import React from 'react';\nimport Animated from \"react-native-web/dist/exports/Animated\";\nimport Platform from \"react-native-web/dist/exports/Platform\";\nimport StyleSheet from \"react-native-web/dist/exports/StyleSheet\";\nimport useWindowDimensions from \"react-native-web/dist/exports/useWindowDimensions\";\nimport View from \"react-native-web/dist/exports/View\";\nimport AnimatedText from \"../../Typography/AnimatedText\";\nimport { getConstants } from \"../helpers\";\nconst InputLabel = props => {\n  const {\n    labeled,\n    wiggle,\n    error,\n    focused,\n    opacity,\n    labelLayoutWidth,\n    labelLayoutHeight,\n    labelBackground,\n    label,\n    labelError,\n    onLayoutAnimatedText,\n    onLabelTextLayout,\n    hasActiveOutline,\n    activeColor,\n    placeholderStyle,\n    baseLabelTranslateX,\n    baseLabelTranslateY,\n    font,\n    fontSize,\n    lineHeight,\n    fontWeight,\n    placeholderOpacity,\n    wiggleOffsetX,\n    labelScale,\n    topPosition,\n    paddingLeft,\n    paddingRight,\n    backgroundColor,\n    roundness,\n    placeholderColor,\n    errorColor,\n    labelTranslationXOffset,\n    maxFontSizeMultiplier,\n    testID,\n    isV3,\n    inputContainerLayout,\n    scaledLabel\n  } = props;\n  const {\n    INPUT_PADDING_HORIZONTAL\n  } = getConstants(isV3);\n  const {\n    width\n  } = useWindowDimensions();\n  const isWeb = Platform.OS === 'web';\n  const paddingOffset = paddingLeft && paddingRight ? {\n    paddingLeft,\n    paddingRight\n  } : {};\n  const labelTranslationX = {\n    transform: [{\n      translateX: labeled.interpolate({\n        inputRange: [0, 1],\n        outputRange: [baseLabelTranslateX, labelTranslationXOffset || 0]\n      })\n    }]\n  };\n  const labelStyle = Object.assign({}, font, {\n    fontSize,\n    lineHeight,\n    fontWeight,\n    opacity: labeled.interpolate({\n      inputRange: [0, 1],\n      outputRange: [hasActiveOutline ? 1 : 0, 0]\n    }),\n    transform: [{\n      translateX: wiggle ? error.interpolate({\n        inputRange: [0, 0.5, 1],\n        outputRange: [0, wiggleOffsetX, 0]\n      }) : 0\n    }, {\n      translateY: baseLabelTranslateY !== 0 ? labeled.interpolate({\n        inputRange: [0, 1],\n        outputRange: [baseLabelTranslateY, 0]\n      }) : 0\n    }, {\n      scale: labelScale !== 0 ? labeled.interpolate({\n        inputRange: [0, 1],\n        outputRange: [labelScale, 1]\n      }) : labeled\n    }]\n  });\n  const labelWidth = (inputContainerLayout.width + INPUT_PADDING_HORIZONTAL / 2) / (scaledLabel ? labelScale : 1);\n  const commonStyles = [placeholderStyle, {\n    top: topPosition\n  }, {\n    maxWidth: labelWidth\n  }, labelStyle, paddingOffset || {}];\n  const textColor = labelError && errorColor ? errorColor : placeholderColor;\n  return (React.createElement(View, {\n      pointerEvents: \"none\",\n      style: [StyleSheet.absoluteFill, styles.overflow, styles.labelContainer]\n    }, React.createElement(Animated.View, {\n      pointerEvents: \"none\",\n      style: [StyleSheet.absoluteFill, !isWeb && {\n        width\n      }, {\n        opacity\n      }, labelTranslationX]\n    }, React.createElement(View, {\n      style: {\n        width: labelWidth\n      }\n    }, labelBackground === null || labelBackground === void 0 ? void 0 : labelBackground({\n      labeled,\n      labelLayoutWidth,\n      labelLayoutHeight,\n      labelStyle,\n      placeholderStyle,\n      baseLabelTranslateX,\n      topPosition,\n      label,\n      backgroundColor,\n      roundness,\n      maxFontSizeMultiplier: maxFontSizeMultiplier,\n      testID\n    }), React.createElement(AnimatedText, {\n      variant: \"bodySmall\",\n      onLayout: onLayoutAnimatedText,\n      onTextLayout: onLabelTextLayout,\n      style: [commonStyles, {\n        color: activeColor\n      }],\n      numberOfLines: 1,\n      maxFontSizeMultiplier: maxFontSizeMultiplier,\n      testID: `${testID}-label-active`\n    }, label), React.createElement(AnimatedText, {\n      variant: focused ? 'bodyLarge' : 'bodySmall',\n      style: [commonStyles, {\n        color: textColor,\n        opacity: placeholderOpacity\n      }],\n      numberOfLines: 1,\n      maxFontSizeMultiplier: maxFontSizeMultiplier,\n      testID: `${testID}-label-inactive`\n    }, label))))\n  );\n};\nconst styles = StyleSheet.create({\n  overflow: {\n    overflow: 'hidden'\n  },\n  labelContainer: {\n    zIndex: 3\n  }\n});\nexport default React.memo(InputLabel);","map":{"version":3,"names":["React","Animated","Platform","StyleSheet","useWindowDimensions","View","AnimatedText","getConstants","InputLabel","props","labeled","wiggle","error","focused","opacity","labelLayoutWidth","labelLayoutHeight","labelBackground","label","labelError","onLayoutAnimatedText","onLabelTextLayout","hasActiveOutline","activeColor","placeholderStyle","baseLabelTranslateX","baseLabelTranslateY","font","fontSize","lineHeight","fontWeight","placeholderOpacity","wiggleOffsetX","labelScale","topPosition","paddingLeft","paddingRight","backgroundColor","roundness","placeholderColor","errorColor","labelTranslationXOffset","maxFontSizeMultiplier","testID","isV3","inputContainerLayout","scaledLabel","INPUT_PADDING_HORIZONTAL","width","isWeb","OS","paddingOffset","labelTranslationX","transform","translateX","interpolate","inputRange","outputRange","labelStyle","Object","assign","translateY","scale","labelWidth","commonStyles","top","maxWidth","textColor","createElement","pointerEvents","style","absoluteFill","styles","overflow","labelContainer","variant","onLayout","onTextLayout","color","numberOfLines","create","zIndex","memo"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-paper/src/components/TextInput/Label/InputLabel.tsx"],"sourcesContent":["import React from 'react';\nimport {\n  Animated,\n  ColorValue,\n  Platform,\n  StyleSheet,\n  useWindowDimensions,\n  View,\n} from 'react-native';\n\nimport AnimatedText from '../../Typography/AnimatedText';\nimport { getConstants } from '../helpers';\nimport type { InputLabelProps } from '../types';\n\nconst InputLabel = (props: InputLabelProps) => {\n  const {\n    labeled,\n    wiggle,\n    error,\n    focused,\n    opacity,\n    labelLayoutWidth,\n    labelLayoutHeight,\n    labelBackground,\n    label,\n    labelError,\n    onLayoutAnimatedText,\n    onLabelTextLayout,\n    hasActiveOutline,\n    activeColor,\n    placeholderStyle,\n    baseLabelTranslateX,\n    baseLabelTranslateY,\n    font,\n    fontSize,\n    lineHeight,\n    fontWeight,\n    placeholderOpacity,\n    wiggleOffsetX,\n    labelScale,\n    topPosition,\n    paddingLeft,\n    paddingRight,\n    backgroundColor,\n    roundness,\n    placeholderColor,\n    errorColor,\n    labelTranslationXOffset,\n    maxFontSizeMultiplier,\n    testID,\n    isV3,\n    inputContainerLayout,\n    scaledLabel,\n  } = props;\n\n  const { INPUT_PADDING_HORIZONTAL } = getConstants(isV3);\n  const { width } = useWindowDimensions();\n\n  const isWeb = Platform.OS === 'web';\n\n  const paddingOffset =\n    paddingLeft && paddingRight ? { paddingLeft, paddingRight } : {};\n\n  const labelTranslationX = {\n    transform: [\n      {\n        // Offset label scale since RN doesn't support transform origin\n        translateX: labeled.interpolate({\n          inputRange: [0, 1],\n          outputRange: [baseLabelTranslateX, labelTranslationXOffset || 0],\n        }),\n      },\n    ],\n  };\n\n  const labelStyle = {\n    ...font,\n    fontSize,\n    lineHeight,\n    fontWeight,\n    opacity: labeled.interpolate({\n      inputRange: [0, 1],\n      outputRange: [hasActiveOutline ? 1 : 0, 0],\n    }),\n    transform: [\n      {\n        // Wiggle the label when there's an error\n        translateX: wiggle\n          ? error.interpolate({\n              inputRange: [0, 0.5, 1],\n              outputRange: [0, wiggleOffsetX, 0],\n            })\n          : 0,\n      },\n      {\n        // Move label to top\n        translateY:\n          baseLabelTranslateY !== 0\n            ? labeled.interpolate({\n                inputRange: [0, 1],\n                outputRange: [baseLabelTranslateY, 0],\n              })\n            : 0,\n      },\n      {\n        // Make label smaller\n        scale:\n          labelScale !== 0\n            ? labeled.interpolate({\n                inputRange: [0, 1],\n                outputRange: [labelScale, 1],\n              })\n            : labeled,\n      },\n    ],\n  };\n\n  const labelWidth =\n    (inputContainerLayout.width + INPUT_PADDING_HORIZONTAL / 2) /\n    (scaledLabel ? labelScale : 1);\n\n  const commonStyles = [\n    placeholderStyle,\n    {\n      top: topPosition,\n    },\n    {\n      maxWidth: labelWidth,\n    },\n    labelStyle,\n    paddingOffset || {},\n  ];\n\n  const textColor = (\n    labelError && errorColor ? errorColor : placeholderColor\n  ) as ColorValue;\n\n  return (\n    // Position colored placeholder and gray placeholder on top of each other and crossfade them\n    // This gives the effect of animating the color, but allows us to use native driver\n    <View\n      pointerEvents=\"none\"\n      style={[StyleSheet.absoluteFill, styles.overflow, styles.labelContainer]}\n    >\n      <Animated.View\n        pointerEvents=\"none\"\n        style={[\n          StyleSheet.absoluteFill,\n          !isWeb && { width },\n          { opacity },\n          labelTranslationX,\n        ]}\n      >\n        <View\n          style={{\n            width: labelWidth,\n          }}\n        >\n          {labelBackground?.({\n            labeled,\n            labelLayoutWidth,\n            labelLayoutHeight,\n            labelStyle,\n            placeholderStyle,\n            baseLabelTranslateX,\n            topPosition,\n            label,\n            backgroundColor,\n            roundness,\n            maxFontSizeMultiplier: maxFontSizeMultiplier,\n            testID,\n          })}\n          <AnimatedText\n            variant=\"bodySmall\"\n            onLayout={onLayoutAnimatedText}\n            onTextLayout={onLabelTextLayout}\n            style={[\n              commonStyles,\n              {\n                color: activeColor,\n              },\n            ]}\n            numberOfLines={1}\n            maxFontSizeMultiplier={maxFontSizeMultiplier}\n            testID={`${testID}-label-active`}\n          >\n            {label}\n          </AnimatedText>\n          <AnimatedText\n            variant={focused ? 'bodyLarge' : 'bodySmall'}\n            style={[\n              commonStyles,\n              {\n                color: textColor,\n                opacity: placeholderOpacity,\n              },\n            ]}\n            numberOfLines={1}\n            maxFontSizeMultiplier={maxFontSizeMultiplier}\n            testID={`${testID}-label-inactive`}\n          >\n            {label}\n          </AnimatedText>\n        </View>\n      </Animated.View>\n    </View>\n  );\n};\n\nconst styles = StyleSheet.create({\n  overflow: {\n    overflow: 'hidden',\n  },\n  labelContainer: {\n    zIndex: 3,\n  },\n});\n\nexport default React.memo(InputLabel);\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAAA,OAAAC,QAAA;AAAA,OAAAC,QAAA;AAAA,OAAAC,UAAA;AAAA,OAAAC,mBAAA;AAAA,OAAAC,IAAA;AAUzB,OAAOC,YAAY;AACnB,SAASC,YAAY;AAGrB,MAAMC,UAAU,GAA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,qBAAqB,EAAEA,qBAAsB;MAC7CC,MAAM,EAAE,GAAGA,MAAM;IAAkB,GAElCzB,KACW,CACV,CACO,CACX;EAAA;AAEV,CAAC;AAED,MAAMsD,MAAM,GAAGrE,UAAU,CAAC6E,MAAM,CAAC;EAC/BP,QAAQ,EAAE;IACRA,QAAQ,EAAE;EACZ,CAAC;EACDC,cAAc,EAAE;IACdO,MAAM,EAAE;EACV;AACF,CAAC,CAAC;AAEF,eAAejF,KAAK,CAACkF,IAAI,CAAC1E,UAAU,CAAC","ignoreList":[]},"metadata":{"hasCjsExports":false},"sourceType":"module","externalDependencies":[]}