{"version":3,"file":"index_common.js","sourceRoot":"","sources":["../../src/connect/index_common.ts"],"names":[],"mappings":";;AAcA,8BAMC;AAlBD,gFAAgF;AAChF,0EAA0E;AAC1E,gFAAgF;AAChF,2CAA2C;AAC3C,EAAE;AACF,4EAA4E;AAC5E,gFAAgF;AAChF,kCAAkC;AAClC,EAAE;AACF,+EAA+E;AAC/E,0CAA0C;AAE1C,SAAgB,SAAS;IACvB,IAAI,MAAM,GAAuB,EAAS,CAAA;IAC1C,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QAChF,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;IACxC,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { FigmaConnectClient } from '../client/figma_client'\n\n// `client/external`'s dependency chain ends up including code which is not safe\n// in a browser context, e.g. `child_process`. This would mean that if you\n// co-locate your Code Connect with React components, your app will be broken in\n// a browser, because of this import chain.\n//\n// To get around this, we only import `client/external` if you are in a Node\n// context – it is only used for the icon script, so none of the code which runs\n// in the browser should touch it.\n//\n// Note that you may still see messages from the JS bundler about Node modules,\n// but these won't be included at runtime.\n\nexport function getClient() {\n let client: FigmaConnectClient = {} as any\n if (typeof process !== 'undefined' && process.versions && process.versions.node) {\n client = require('../client/external')\n }\n return client\n}\n"]}