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K,MAAM,KACX,QAAS,MAAM,2BAGF,MAAM,eAMnB,aAAe,cAAc,SAAS,KAAO,MAAM,UAEnD,WAAO,CAAK,GAGV,OAFA,EAAO,GAAQ,CAAC,GACX,UAAW,EACT,KAAK,GAAM,MAAM,GAAY,EAAQ,IAC9C,CAEA,mBAAO,CAAa,GAGlB,OAFA,EAAO,GAAQ,CAAC,GACX,UAAW,EACT,KAAK,EACd,CAEA,eAAO,CAAS,GACd,OAAO,GA5FwB,6BA4FjB,EAAI,IACpB","file":"/npm/@foqum/react-native-document-picker@0.0.1/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@foqum/react-native-document-picker@0.0.1/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\nimport {Platform, NativeModules} from 'react-native';\nconst RNDocumentPicker = Platform.OS === 'web'\n                       ? require('./web')\n                       : NativeModules.RNDocumentPicker;\n\nif ( !RNDocumentPicker ) {\n  // Use a timeout to ensure the warning is displayed in the YellowBox\n  setTimeout(() => {\n    console.warn('RNDocumentPicker: Native module is not available, make sure you have finished the installation process and rebuilt your app');\n  }, 0);\n} else if ( !RNDocumentPicker.pick && RNDocumentPicker.show ) {\n  // Use a timeout to ensure the warning is displayed in the YellowBox\n  setTimeout(() => {\n    console.warn('RNDocumentPicker: Native module is obsolete, you may not have rebuilt your app after upgrading the library');\n  }, 0);\n}\n\nconst E_DOCUMENT_PICKER_CANCELED = 'DOCUMENT_PICKER_CANCELED';\n\nfunction pick(opts) {\n  if ( 'filetype' in opts ) {\n    throw new TypeError('A `filetype` option was passed to DocumentPicker.pick, the correct option is `type`');\n  }\n  if ( 'types' in opts ) {\n    throw new TypeError('A `types` option was passed to DocumentPicker.pick, the correct option is `type`');\n  }\n\n  if ( !('type' in opts) ) {\n    opts.type = DocumentPicker.types.allFiles;\n  }\n\n  opts.type = Array.isArray(opts.type) ? opts.type : [opts.type]\n\n  if ( opts.type.some((type) => type === undefined) ) {\n    throw new TypeError('Unexpected undefined type option, did you try using a DocumentPicker.types.* that does not exist?');\n  }\n\n  if ( Array.isArray(opts.type) && opts.type.length < 1 ) {\n    throw new TypeError('`type` option should not be an empty array, at least one type must be passed if the `type` option is not omitted');\n  }\n\n  opts.type.forEach((type) => {\n    if ( typeof type !== 'string' ) {\n      throw new TypeError('Invalid type option, expected a string not: ' + type);\n    }\n  });\n\n  if ( opts.type.length > 1 && Platform.OS === 'android' && Platform.Version < 19 ) {\n    console.warn(`RNDocumentPicker: Android API level ${Platform.Version} does not support multiple types, falling back to */*`);\n  }\n\n  return RNDocumentPicker.pick(opts);\n}\n\n\nconst Types = {\n  mimeTypes: {\n    'allFiles': '*/*',\n    'images': 'image/*',\n    'video': 'video/mp4,video/x-m4v,video/*',\n    'plainText': 'text/plain',\n    'audio': 'audio/*',\n    'pdf': 'application/pdf',\n  },\n  utis: {\n    'allFiles': 'public.content',\n    'images': 'public.image',\n    'video': 'public.video',\n    'plainText': 'public.plain-text',\n    'audio': 'public.audio',\n    'pdf': 'com.adobe.pdf',\n  },\n  extensions: {\n    'allFiles': '*',\n    'images': '.png .jpg .jpeg',\n    'video': '.avi .mpeg .ogv .webm .3gp .3g2 .mp4',\n    'plainText': '.txt',\n    'audio': '.adts .adt .aac .aif .aifc .aiff .au .snd .mid .midi .rmi .mp3 .mp2 .m3u .m4a .wav .wma .wax .asf .3g2 .3gp .m4b .mp4',\n    'pdf': '.pdf',\n  }\n};\n\nconst PlatformTypes = {\n  android: Types.mimeTypes,\n  ios: Types.utis,\n  windows: Types.extensions\n};\n\nexport default class DocumentPicker {\n  /**\n   * Android requires mime types, iOS is a bit more complicated:\n   *\n   * @see https://developer.apple.com/library/ios/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html\n   */\n  static types = PlatformTypes[Platform.OS] || Types.mimeTypes\n\n  static pick(opts) {\n    opts = opts || {};\n    opts.multiple = false;\n    return pick(opts).then((results) => results[0]);\n  }\n\n  static pickMultiple(opts) {\n    opts = opts || {};\n    opts.multiple = true;\n    return pick(opts);\n  }\n\n  static isCancel(err) {\n    return err && err.code === E_DOCUMENT_PICKER_CANCELED;\n  }\n}\n"]}