{"version":3,"sources":["jsdelivr-header.js","/npm/pc-nrfjprog-js@1.7.6/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,AC8BA,MAAM,KAAO,QAAQ,QACf,SAAW,QAAQ,WAAR,CAAoB,kBAE/B,SAAW,IAAI,SAAS,SAMxB,WAAa,QAAQ,IAAI,sBACzB,cAAgB,KAAK,KAAK,UAAW,YAE3C,OAAO,KAAK,UAAU,SAAQ,IACd,yBAAR,GACA,SAAS,qBAAqB,YAAc,eAC5C,SAAS,mBAAkB,IACnB,GAEA,SAAS,qBAAqB,QAAQ,MAC1C,KAEW,aAAR,IACP,SAAS,GAAO,SAAS,GAC7B,IAGJ,OAAO,QAAU","file":"/npm/pc-nrfjprog-js@1.7.6/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/pc-nrfjprog-js@1.7.6/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","/* Copyright (c) 2015 - 2019, Nordic Semiconductor ASA\n *\n * All rights reserved.\n *\n * Use in source and binary forms, redistribution in binary form only, with\n * or without modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions in binary form, except as embedded into a Nordic\n *    Semiconductor ASA integrated circuit in a product or a software update for\n *    such product, must reproduce the above copyright notice, this list of\n *    conditions and the following disclaimer in the documentation and/or other\n *    materials provided with the distribution.\n *\n * 2. Neither the name of Nordic Semiconductor ASA nor the names of its\n *    contributors may be used to endorse or promote products derived from this\n *    software without specific prior written permission.\n *\n * 3. This software, with or without modification, must only be used with a Nordic\n *    Semiconductor ASA integrated circuit.\n *\n * 4. Any software provided in binary form under this license must not be reverse\n *    engineered, decompiled, modified and/or disassembled.\n *\n * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA \"AS IS\" AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nconst path = require('path');\nconst nRFjprog = require('bindings')('pc-nrfjprog-js');\n\nconst instance = new nRFjprog.nRFjprog();\n\n// When this module is bundled with nRFConnect application the location of\n// nRFjprog libraries depend on the target platform, therefore we give the\n// possibility to nRFConnect to set the expected location via environment\n// variable. If not set, the path is expected to be under this module:\nconst envLibPath = process.env.NRFJPROG_LIBRARY_PATH;\nconst moduleLibPath = path.join(__dirname, 'nrfjprog');\n\nObject.keys(nRFjprog).forEach(key => {\n    if (key === 'setLibrarySearchPath') {\n        nRFjprog.setLibrarySearchPath(envLibPath || moduleLibPath);\n        instance.getLibraryVersion(err => {\n            if (err) {\n                // obsolete fallback, only works in some cases\n                nRFjprog.setLibrarySearchPath(process.cwd());\n            }\n        });\n    } else if (key !== 'nRFjprog') {\n        instance[key] = nRFjprog[key];\n    }\n});\n\nmodule.exports = instance;\n"]}