{"version":3,"file":"error-screen.es.mjs","sources":["../../../src/components/error-screen/error-screen.tsx"],"sourcesContent":["// Dependencies\nimport * as React from 'react';\n\n// Internals\nimport { Container, Svg, SvgContainer, Text, TextContainer, Title } from './error-screen.styles';\n\ntype ErrorScreenProps = {\n  isDevelopment?: boolean;\n};\n\nfunction RenderErrorScreen(\n  { isDevelopment = process.env.NODE_ENV === 'development' }: ErrorScreenProps,\n  ref: React.LegacyRef<HTMLDivElement>\n) {\n  if (process.env.NODE_ENV !== 'development') {\n    throw new Error('Please contact your developer to provide the required parameters to use the Web Payments SDK.');\n  }\n\n  return (\n    <Container\n      // @ts-ignore - the ref is a valid tyoe\n      ref={ref}\n    >\n      <SvgContainer>\n        <Svg height={17} viewBox=\"0 0 20 17\" width={20}>\n          <path\n            d=\"M10.874.573l8.3 14.941A1 1 0 0118.3 17H1.7a1 1 0 01-.875-1.486l8.3-14.94a1 1 0 011.75 0zM9 12v2h2v-2H9zm2-1V7H9v4h2z\"\n            fill=\"#d92b2b\"\n            fillRule=\"evenodd\"\n          />\n        </Svg>\n      </SvgContainer>\n\n      <TextContainer>\n        <Title>{isDevelopment ? 'No location ID or app ID found. Please check your configuration.' : 'Error'}</Title>\n\n        <Text>\n          {isDevelopment ? (\n            <>\n              Please provide a location ID or app ID to use the{' '}\n              <a\n                href=\"https://developer.squareup.com/docs/web-payments/overview\"\n                rel=\"noopener noreferrer\"\n                target=\"_blank\"\n              >\n                Web Payments SDK\n              </a>{' '}\n              to take payments on a web client.\n            </>\n          ) : (\n            <>An error occurred has ocurred while loading your Payment Form.</>\n          )}\n        </Text>\n      </TextContainer>\n    </Container>\n  );\n}\n\nconst ErrorScreen = React.forwardRef<HTMLDivElement, ErrorScreenProps>(RenderErrorScreen);\n\nexport default ErrorScreen;\nexport type { ErrorScreenProps };\n"],"names":["RenderErrorScreen","isDevelopment","ref","React","Container","SvgContainer","Svg","TextContainer","Title","Text","ErrorScreen","ErrorScreen$1"],"mappings":";;AAUA,SAASA,EACP,EAAE,eAAAC,IAAgB,QAAQ,IAAI,aAAa,iBAC3CC,GACA;AACI,MAAA,QAAQ,IAAI,aAAa;AACrB,UAAA,IAAI,MAAM,+FAA+F;AAI/G,SAAA,gBAAAC,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MAEC,KAAAF;AAAA,IAAA;AAAA,IAEA,gBAAAC,EAAA,cAACE,SACE,gBAAAF,EAAA,cAAAG,GAAA,EAAI,QAAQ,IAAI,SAAQ,aAAY,OAAO,GAC1C,GAAA,gBAAAH,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,GAAE;AAAA,QACF,MAAK;AAAA,QACL,UAAS;AAAA,MAAA;AAAA,IAAA,CAEb,CACF;AAAA,IAEC,gBAAAA,EAAA,cAAAI,GAAA,MACE,gBAAAJ,EAAA,cAAAK,GAAA,MAAOP,IAAgB,qEAAqE,OAAQ,GAEpG,gBAAAE,EAAA,cAAAM,GAAA,MACER,IACC,gBAAAE,EAAA,cAAAA,EAAA,UAAA,MAAE,qDACkD,KAClD,gBAAAA,EAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,KAAI;AAAA,QACJ,QAAO;AAAA,MAAA;AAAA,MACR;AAAA,IAAA,GAEI,KAAI,mCAEX,IAEE,gBAAAA,EAAA,cAAAA,EAAA,UAAA,MAAA,gEAA8D,CAEpE,CACF;AAAA,EAAA;AAGN;AAEA,MAAMO,IAAcP,EAAM,WAA6CH,CAAiB,GAExFW,IAAeD;"}