"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("styled-components"),i=require("./utils.js"),e=require("../../utils/index.js");function s(o){return o&&o.__esModule?o:{default:o}}var r=s(t);const c=r.default.div.withConfig({shouldForwardProp:e.convertToTransientProps(["noMargin"])})`
  position: relative;
  width: ${o=>o.width?o.width:"100%"};
  font-family: ${o=>o.theme.font.familyPrimary};
  margin: ${o=>o.noMargin?e.getSpacing("s00"):e.getSpacing("s02","s00")};
`,d=r.default.div.withConfig({shouldForwardProp:e.convertToTransientProps(["hasLabel"])})`
  display: flex;
  justify-content: ${o=>o.hasLabel?"space-between":"flex-end"};
  align-items: center;
  ${e.getFontSize("size14")};
  color: ${o=>o.disabled?e.getColorAlias("contentDisabled"):e.getColorAlias("contentSubdued")};
`,g=r.default.label.withConfig({shouldForwardProp:e.convertToTransientProps(["hasLabel","hasError","hasFocus"])})`
  font-weight: ${o=>o.theme.font.weightBold};
  ${e.getFontSize("size14")};
  margin-bottom: ${e.getSpacing("s01")};
  padding-right: ${e.getSpacing("s02")};
  color: ${o=>o.disabled?e.getColorAlias("contentDisabled"):e.getColorAlias("contentDefault")};
`,p=r.default.span``,h=r.default.div.withConfig({shouldForwardProp:e.convertToTransientProps(["hasError","hasPrefix","hasSuffix"])})`
  border: 1px solid ${e.getColorAlias("borderDefault")};
  border-color: ${o=>i.getBorderColor(o.disabled,o.hasError)};
  background: ${o=>o.disabled?e.getColorAlias("disabled01"):e.getColorAlias("containerDefault")};
  border-radius: ${o=>o.theme.radius.roundedC};
  display: flex;
  align-items: center;
  padding-left: ${o=>o.hasPrefix?"16px":"0"};
  padding-right: ${o=>o.hasSuffix?"16px":"0"};

  &:hover {
    background: ${o=>o.disabled?e.getColorAlias("disabled01"):e.getDarkenColor("hover02","containerDefault")};
    cursor: ${o=>o.disabled?"not-allowed":"auto"};
  }

  &:focus,
  &:focus-within,
  &:focus-visible {
    background: ${e.getColorAlias("containerDefault")};
    ${o=>!o.hasError&&t.css`
        box-shadow: 0 0 0 2px ${e.getColorAlias("focusOuter")};
      `};
  }
`,u=r.default.div.withConfig({shouldForwardProp:e.convertToTransientProps(["noMargin"])})`
  ${e.getFontSize("size14")};
  color: ${e.getColorAlias("contentSubdued")};
  margin-top: ${o=>e.getSpacing(o.noMargin?"s00":"s01")};

  svg {
    margin-right: ${e.getSpacing("s02")};
  }
`,f=r.default.span`
  margin: 0;
`,b=r.default.div`
  display: flex;
  align-items: center;
  color: ${e.getColorAlias("contentError")};
  margin: ${e.getSpacing("s01","s00","s03")};
  ${e.getFontSize("size14")};
  font-weight: ${o=>o.theme.font.weightRegular};
  svg {
    fill: ${e.getColorAlias("contentError")};
    height: 20px;
    margin-right: 8px;
  }
`,n=r.default.div`
  display: flex;
  flex-flow: row;
  align-items: flex-start;

  input,
  label {
    cursor: pointer;
  }
`,$=r.default.input.withConfig({shouldForwardProp:e.convertToTransientProps(["hasError"])})`
  --outline-color: transparent;
  --check-radio-bg-color: transparent;
  --border-color: ${({hasError:o})=>o?e.getColorAlias("supportError"):e.getColorAlias("interactiveForm")};

  &[type='radio'],
  &[type='checkbox'] {
    transition: all 0.2s linear;
    margin: 0;
    appearance: none;
    background-color: var(--check-radio-bg-color);
    border: 1px solid var(--border-color);
    outline: 2px solid var(--outline-color);
    outline-offset: 1px;
    background-repeat: no-repeat;
  }

  &[type='radio'] {
    width: 22px;
    height: 22px;
    min-width: 22px;
    max-height: 22px;
    border-radius: 50%;
    background-position: center;
    background-size: ${e.getSpacing("s04")};

    &:checked {
      background-image: ${({disabled:o})=>`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23${i.getCheckRadioIconColor(o)}'/%3e%3c/svg%3e")`};
    }
  }

  &[type='checkbox'] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    max-height: 20px;
    border-radius: 2px;

    &:checked {
      background-image: ${({disabled:o})=>`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23${i.getCheckRadioIconColor(o)}' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e")`};
    }

    &:indeterminate {
      background-image: ${({disabled:o})=>`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23${i.getCheckRadioIconColor(o)}' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e")`};
    }
  }

  &:hover {
    --check-radio-bg-color: ${e.getDarkenColor("hover01","containerSubtle")};
  }

  &:checked,
  &[type='checkbox']:indeterminate {
    ${({hasError:o})=>o?t.css`
            --check-radio-bg-color: ${e.getColorAlias("supportError")};
            --border-color: ${e.getColorAlias("supportError")};
          `:t.css`
            --check-radio-bg-color: ${e.getColorAlias("interactiveBrand")};
            --border-color: ${e.getColorAlias("interactiveBrand")};
          `}
  }

  &:checked:hover {
    ${({hasError:o})=>o?t.css`
            --check-radio-bg-color: ${e.getDarkenColor("hover01","supportError")};
          `:t.css`
            --check-radio-bg-color: ${e.getDarkenColor("hover01","interactiveBrand")};
          `}
  }

  &:disabled,
  &:checked:hover:disabled,
  &[type='checkbox']:indeterminate:disabled {
    --check-radio-bg-color: ${e.getColorAlias("disabled01")};
    --border-color: ${e.getColorAlias("disabled01")};
  }

  &:active {
    --check-radio-bg-color: ${e.getDarkenColor("active01","containerSubtle")};
    --border-color: ${e.getDarkenColor("active01","containerSubtle")};
  }

  &:checked:active,
  &[type='checkbox']:checked:indeterminate:active {
    --check-radio-bg-color: ${e.getDarkenColor("active01","interactiveBrand")};
    --border-color: ${e.getDarkenColor("active01","interactiveBrand")};
  }

  &:focus,
  &:focus-visible,
  &:focus-within {
    --outline-color: ${e.getColorAlias("focusOuter")};
  }
`,C=r.default.div`
  display: flex;
  flex-flow: column;
`,k=r.default.label`
  ${e.getFontSize("size16")};
  margin-left: ${e.getSpacing("s02")};
  color: ${e.getColorAlias("contentDefault")};
`,l=r.default.span`
  ${e.getFontSize("size14")};
  color: ${e.getColorAlias("contentDefault")};
  display: flex;
  align-items: center;
  margin-top: ${e.getSpacing("s02")};
`,v=r.default(l)`
  color: ${e.getColorAlias("contentError")};

  svg {
    width: 17px;
    height: 17px;
    margin-right: ${e.getSpacing("s02")};
    fill: ${e.getColorAlias("contentError")};
  }
`,x=r.default.div`
  display: flex;
  flex-flow: ${({orientation:o})=>o};

  & ${n} {
    &:not(:last-child) {
      ${({orientation:o})=>o==="row"?t.css`
              margin-right: ${e.getSpacing("s05")};
            `:t.css`
              margin-bottom: ${e.getSpacing("s03")};
            `}
    }
  }
`,m=r.default.label`
  ${e.getFontSize("size14")};
  color: ${e.getColorAlias("contentDefault")};
  font-weight: 700;
  margin-bottom: ${e.getSpacing("s03")};
`;exports.AssistMessage=f;exports.Border=h;exports.CheckRadioErrorArea=v;exports.CheckRadioGroupLabel=m;exports.CheckRadioGroupWrapper=x;exports.CheckRadioHintArea=l;exports.CheckRadioInput=$;exports.CheckRadioInputGroupWrapper=C;exports.CheckRadioLabel=k;exports.CheckRadioWrapper=n;exports.ErrorMessage=b;exports.Label=g;exports.LabelWrapper=d;exports.SupportingText=u;exports.Text=p;exports.Wrapper=c;
