{"version":3,"sources":["jsdelivr-header.js","/npm/dobble-generator@1.0.5/dist/generator.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAaA,SAAS,WACL,IAAI,EAAI,UAAU,OAAS,QAAsB,IAAjB,UAAU,GAAmB,UAAU,GAAK,EAG5E,GAAI,EAAI,EACJ,MAAM,IAAI,MAAM,qCAGpB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAG,IACnB,GAAI,EAAI,GAAM,EACV,MAAM,IAAI,MAAM,2DAgBxB,IAZA,IAAI,EAAS,GAYJ,EAAI,EAAG,GAAK,EAAG,IAAK,CACzB,EAAO,KAAK,IACZ,EAAO,GAAG,KAAK,GACf,IAAK,IAAI,EAAK,EAAG,EAAK,EAAG,IACrB,EAAO,GAAG,KAAK,EAAI,EAAI,EAAK,EAEpC,CAkDA,IAAK,IAAI,EAAK,EAAG,EAAK,EAAG,IACrB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAG,IAAK,CACxB,IAAI,EAAO,GACX,EAAO,KAAK,GACZ,EAAK,KAAK,EAAK,GACf,IAAK,IAAI,EAAM,EAAG,EAAM,EAAG,IACvB,EAAK,KAAK,EAAI,EAAI,EAAI,GAAO,EAAK,EAAM,GAAK,EAErD,CAGJ,OAAO,CACX,CAlGA,OAAO,eAAe,QAAS,aAAc,CACzC,OAAO,IAEX,QAAQ,SAAW","file":"/npm/dobble-generator@1.0.5/dist/generator.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/dobble-generator@1.0.5/dist/generator.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';\n\n/**\n * Objective have x cards with one number in common by card\n * This algo is valid only if n = prime number\n * @param  {Number} n Greater than 0 && 1 or prime number (2,3,5,7,11,13,..)\n * @return {Array} output\n */\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\nexports.generate = generate;\nfunction generate() {\n    var n = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 3;\n\n\n    if (n < 1) {\n        throw new Error('The number must be greater than 0');\n    }\n\n    for (var i = 2; i < n; i++) {\n        if (n % i === 0) {\n            throw new Error('The number must be 1 or prime number (2,3,5,7,11,13,..)');\n        }\n    }\n\n    var output = [];\n\n    /**\n     * Create first cards\n     * \n     * Example with n = 3:\n     * \n     * [ 0, 1, 2, 3 ],\n     * [ 0, 4, 5, 6 ],\n     * [ 0, 7, 8, 9 ],\n     * [ 0, 10, 11, 12 ]\n     */\n    for (var r = 0; r <= n; r++) {\n        output.push([]);\n        output[r].push(0);\n        for (var _i = 0; _i < n; _i++) {\n            output[r].push(n * r + _i + 1);\n        }\n    }\n\n    /**\n     * Create the rest of the cards\n     * \n     * Example with n = 3:\n     * \n     * x = (r * i + c) % 3;\n     * \n     * x in grid:\n     *\n     * For i = 0:\n     * [ 0, 0, 0 ],\n     * [ 1, 1, 1 ],\n     * [ 2, 2, 2 ],\n     * \n     * For i = 1:\n     * [ 0, 1, 2 ],\n     * [ 1, 2, 0 ],\n     * [ 2, 0, 1 ],\n     * \n     * For i = 2:\n     * [ 0, 2, 1 ],\n     * [ 1, 0, 2 ],\n     * [ 2, 1, 0 ],\n     * \n     * \n     * [ r + 1, 4 + (3 * i) + x, 4 + (3 * i) + x, 4 + (3 * i) + x ]\n     * Is:\n     * [ 0 + 1, 4 + 0 + 0, 4 + 3 + 0, 4 + 6 + 0],\n     * [ 0 + 1, 4 + 0 + 1, 4 + 3 + 1, 4 + 6 + 1],\n     * [ 0 + 1, 4 + 0 + 2, 4 + 3 + 2, 4 + 6 + 2],\n     * [ 0 + 2, 4 + 0 + 0, 4 + 3 + 1, 4 + 6 + 2],\n     * [ 0 + 2, 4 + 0 + 1, 4 + 3 + 2, 4 + 6 + 0],\n     * [ 0 + 2, 4 + 0 + 2, 4 + 3 + 0, 4 + 6 + 1],\n     * [ 0 + 3, 4 + 0 + 0, 4 + 3 + 2, 4 + 6 + 1],\n     * [ 0 + 3, 4 + 0 + 1, 4 + 3 + 0, 4 + 6 + 2],\n     * [ 0 + 3, 4 + 0 + 2, 4 + 3 + 1, 4 + 6 + 0]\n     *\n     * Output:\n     * [ 1, 4, 7, 10 ],\n     * [ 1, 5, 8, 11 ],\n     * [ 1, 6, 9, 12 ],\n     * [ 2, 4, 8, 12 ],\n     * [ 2, 5, 9, 10 ],\n     * [ 2, 6, 7, 11 ],\n     * [ 3, 4, 9, 11 ],\n     * [ 3, 5, 7, 12 ],\n     * [ 3, 6, 8, 10 ]\n     */\n    for (var _r = 0; _r < n; _r++) {\n        for (var c = 0; c < n; c++) {\n            var data = [];\n            output.push(data);\n            data.push(_r + 1);\n            for (var _i2 = 0; _i2 < n; _i2++) {\n                data.push(n + 1 + n * _i2 + (_r * _i2 + c) % n);\n            }\n        }\n    }\n\n    return output;\n}"]}