{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./cartridges/app_custom_neuhaus_webshop/cartridge/client/default/js/duets.js","webpack:///./cartridges/app_custom_neuhaus_webshop/cartridge/client/default/js/thirdParty/duets.js","webpack:///./cartridges/app_custom_neuhaus_webshop/cartridge/client/default/js/thirdParty/duetsHelper.js"],"names":[],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFa;;AAEb;AACA,IAAI,mBAAO,CAAC,mHAAoB;AAChC,CAAC;;;;;;;;;;;;;ACJY;;AAEb;AACA;AACA;AACA,0BAA0B,+LAA+L;AACzN,2BAA2B,oOAAoO;AAC/P,6BAA6B,uMAAuM;AACpO,kCAAkC,yMAAyM;AAC3O,8BAA8B,qOAAqO;AACnQ,8BAA8B,uOAAuO;;AAErQ;AACA,yBAAyB,2KAA2K;AACpM,0BAA0B,gNAAgN;AAC1O,4BAA4B,mLAAmL;AAC/M,iCAAiC,qLAAqL;AACtN,6BAA6B,iNAAiN;AAC9O,6BAA6B,mNAAmN;;AAEhP;AACA,4BAA4B,qLAAqL;AACjN,6BAA6B,0NAA0N;AACvP,+BAA+B,6LAA6L;AAC5N,oCAAoC,+LAA+L;AACnO,gCAAgC,2NAA2N;AAC3P,gCAAgC,4NAA4N;;AAE5P;AACA,yBAAyB,2KAA2K;AACpM,0BAA0B,6KAA6K;AACvM,4BAA4B,mLAAmL;AAC/M,iCAAiC,qLAAqL;AACtN,6BAA6B,iNAAiN;AAC9O,6BAA6B,mNAAmN;;AAEhP;AACA,uBAAuB,gLAAgL;AACvM,wBAAwB,qNAAqN;AAC7O,0BAA0B,wLAAwL;AAClN,+BAA+B,0LAA0L;AACzN,2BAA2B,sNAAsN;AACjP,2BAA2B,yNAAyN;;AAEpP;AACA,0BAA0B,wLAAwL;AAClN,2BAA2B,6NAA6N;AACxP,6BAA6B,gMAAgM;AAC7N,kCAAkC,kMAAkM;AACpO,8BAA8B,8NAA8N;AAC5P,8BAA8B,gOAAgO;AAC9P;;AAEA;AACA;AACA,SAAS,yDAAyD;AAClE,SAAS,uDAAuD;AAChE,SAAS,mDAAmD;AAC5D,SAAS,6DAA6D;AACtE,SAAS,yDAAyD;AAClE,SAAS;AACT;;AAEA;AACA;AACA,SAAS,6GAA6G;AACtH,SAAS,4GAA4G;AACrH,SAAS,mGAAmG;AAC5G,SAAS,gGAAgG;AACzG,SAAS,yGAAyG;AAClH,SAAS;AACT;;AAEA,IAAI,mBAAO,CAAC,oHAAe;AAC3B;;AAEA;AACA;AACA;;;;;;;;;;;;;AC9Ea;;AAEb;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,yDAAyD,UAAU,EAAE;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iCAAiC,eAAe,EAAE;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET,yDAAyD,UAAU,EAAE;AACrE;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iCAAiC,eAAe,EAAE;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;;AAGT;AACA;AACA;;AAEA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wEAAwE,4CAA4C;AACpH,wEAAwE,2CAA2C;AACnH;AACA;AACA,yFAAyF,aAAa;AACtG,KAAK;AACL,sFAAsF,aAAa;AACnG;AACA;AACA,oDAAoD,2BAA2B;AAC/E,wDAAwD,aAAa;;AAErE;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;;AAET;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA,SAAS;;;AAGT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA","file":"default/js/duets.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./cartridges/app_custom_neuhaus_webshop/cartridge/client/default/js/duets.js\");\n","'use strict';\n\n$(document).ready(function () {\n require('./thirdParty/duets').init();\n});\n","'use strict';\n\nconst init = () => {\n var results = {\n // VANILLA\n \"VANILLA+PECAN\": { \"image\": \"VANILLA+PECAN.png\", \"title\": \"VANILLA + PECAN\", \"description\": \"A praliné of pecan nuts covered with white chocolate atop a base of white chocolate with vanilla from Madagascar.\" },\n \"VANILLA+ALMOND\": { \"image\": \"VANILLA+ALMOND.png\", \"title\": \"VANILLA + ALMOND\", \"description\": \"An almond praliné with pieces of Montélimar (France) nougat covered with milk chocolate atop a base of white chocolate with vanilla from Madagascar.\" },\n \"VANILLA+HAZELNUT\": { \"image\": \"VANILLA+HAZELNUT.png\", \"title\": \"VANILLA + HAZELNUT\", \"description\": \"A crunchy hazelnut praliné covered with dark chocolate atop a base of white chocolate with vanilla from Madagascar.\" },\n \"VANILLA+SALTEDCARAMEL\": { \"image\": \"VANILLA+SALTEDCARAMEL.png\", \"title\": \"VANILLA + SALTED CARAMEL\", \"description\": \"A caramel ganache covered with dark chocolate atop a base of white chocolate with vanilla from Madagascar.\" },\n \"VANILLA+VENEZUELA\": { \"image\": \"VANILLA+VENEZUELA.png\", \"title\": \"VANILLA + VENEZUELA\", \"description\": \"A ganache of milk chocolate from Venezuela (45% cocoa) covered with milk chocolate atop a base of white chocolate with vanilla from Madagascar.\" },\n \"VANILLA+COSTARICA\": { \"image\": \"VANILLA+COSTARICA.png\", \"title\": \"VANILLA + COSTA RICA\", \"description\": \"A ganache of dark chocolate from Costa Rica (64% cocoa) covered with dark chocolate atop a base of white chocolate with vanilla from Madagascar.\" },\n\n // GINGER\n \"GINGER+PECAN\": { \"image\": \"GINGER+PECAN.png\", \"title\": \"GINGER + PECAN\", \"description\": \"A praliné of pecan nuts covered with white chocolate atop a base of milk chocolate with ginger.\" },\n \"GINGER+ALMOND\": { \"image\": \"GINGER+ALMOND.png\", \"title\": \"GINGER + ALMOND\", \"description\": \"An almond praliné with pieces of Montélimar (France) nougat covered with milk chocolate atop a base of milk chocolate with ginger.\" },\n \"GINGER+HAZELNUT\": { \"image\": \"GINGER+HAZELNUT.png\", \"title\": \"GINGER + HAZELNUT\", \"description\": \"A crunchy hazelnut praliné covered with dark chocolate atop a base of milk chocolate with ginger.\" },\n \"GINGER+SALTEDCARAMEL\": { \"image\": \"GINGER+SALTEDCARAMEL.png\", \"title\": \"GINGER + SALTED CARAMEL\", \"description\": \"A caramel ganache covered with dark chocolate atop a base of milk chocolate with ginger.\" },\n \"GINGER+VENEZUELA\": { \"image\": \"GINGER+VENEZUELA.png\", \"title\": \"GINGER + VENEZUELA\", \"description\": \"A ganache of milk chocolate from Venezuela (45% cocoa) covered with milk chocolate atop a base of milk chocolate with ginger.\" },\n \"GINGER+COSTARICA\": { \"image\": \"GINGER+COSTARICA.png\", \"title\": \"GINGER + COSTA RICA\", \"description\": \"A ganache of dark chocolate from Costa Rica (64% cocoa) covered with dark chocolate atop a base of milk chocolate with ginger.\" },\n\n // RASPBERRY\n \"RASPBERRY+PECAN\": { \"image\": \"RASPBERRY+PECAN.png\", \"title\": \"RASPBERRY + PECAN\", \"description\": \"A praliné of pecan nuts covered with white chocolate atop a base of white chocolate with raspberry.\" },\n \"RASPBERRY+ALMOND\": { \"image\": \"RASPBERRY+ALMOND.png\", \"title\": \"RASPBERRY + ALMOND\", \"description\": \"An almond praliné with pieces of Montélimar (France) nougat covered with milk chocolate atop a base of white chocolate with raspberry.\" },\n \"RASPBERRY+HAZELNUT\": { \"image\": \"RASPBERRY+HAZELNUT.png\", \"title\": \"RASPBERRY + HAZELNUT\", \"description\": \"A crunchy hazelnut praliné covered with dark chocolate atop a base of white chocolate with raspberry.\" },\n \"RASPBERRY+SALTEDCARAMEL\": { \"image\": \"RASPBERRY+SALTEDCARAMEL.png\", \"title\": \"RASPBERRY + SALTED CARAMEL\", \"description\": \"A caramel ganache covered with dark chocolate atop a base of white chocolate with raspberry.\" },\n \"RASPBERRY+VENEZUELA\": { \"image\": \"RASPBERRY+VENEZUELA.png\", \"title\": \"RASPBERRY + VENEZUELA\", \"description\": \"A ganache of milk chocolate from Venezuela (45% cocoa) covered with milk chocolate atop a base of white chocolate with raspberry.\" },\n \"RASPBERRY+COSTARICA\": { \"image\": \"RASPBERRY+COSTARICA.png\", \"title\": \"RASPBERRY + COSTA RICA\", \"description\": \"A ganache of dark chocolate from Costa Rica (64% cocoa) covered with dark chocolate atop a base of white chocolate with raspberry\" },\n\n // COFFEE\n \"COFFEE+PECAN\": { \"image\": \"COFFEE+PECAN.png\", \"title\": \"COFFEE + PECAN\", \"description\": \"A praliné of pecan nuts covered with white chocolate atop a base of dark chocolate with coffee.\" },\n \"COFFEE+ALMOND\": { \"image\": \"COFFEE+ALMOND.png\", \"title\": \"COFFEE + ALMOND\", \"description\": \"A praliné of pecan nuts covered with white chocolate atop a base of dark chocolate with coffee.\" },\n \"COFFEE+HAZELNUT\": { \"image\": \"COFFEE+HAZELNUT.png\", \"title\": \"COFFEE + HAZELNUT\", \"description\": \"A crunchy hazelnut praliné covered with dark chocolate atop a base of dark chocolate with coffee.\" },\n \"COFFEE+SALTEDCARAMEL\": { \"image\": \"COFFEE+SALTEDCARAMEL.png\", \"title\": \"COFFEE + SALTED CARAMEL\", \"description\": \"A caramel ganache covered with dark chocolate atop a base of dark chocolate with coffee.\" },\n \"COFFEE+VENEZUELA\": { \"image\": \"COFFEE+VENEZUELA.png\", \"title\": \"COFFEE + VENEZUELA\", \"description\": \"A ganache of milk chocolate from Venezuela (45% cocoa) covered with milk chocolate atop a base of dark chocolate with coffee.\" },\n \"COFFEE+COSTARICA\": { \"image\": \"COFFEE+COSTARICA.png\", \"title\": \"COFFEE + COSTA RICA\", \"description\": \"A ganache of dark chocolate from Costa Rica (64% cocoa) covered with dark chocolate atop a base of dark chocolate with coffee.\" },\n\n // LIME\n \"LIME+PECAN\": { \"image\": \"LIME+PECAN.png\", \"title\": \"LIME + PECAN\", \"description\": \"A praliné of pecan nuts covered with white chocolate atop a base of white chocolate with lime and lemon.\" },\n \"LIME+ALMOND\": { \"image\": \"LIME+ALMOND.png\", \"title\": \"LIME + ALMOND\", \"description\": \"An almond praliné with pieces of Montélimar (France) nougat covered with milk chocolate atop a base of white chocolate with lime and lemon.\" },\n \"LIME+HAZELNUT\": { \"image\": \"LIME+HAZELNUT.png\", \"title\": \"LIME + HAZELNUT\", \"description\": \"A crunchy hazelnut praliné covered with dark chocolate atop a base of white chocolate with lime and lemon.\" },\n \"LIME+SALTEDCARAMEL\": { \"image\": \"LIME+SALTEDCARAMEL.png\", \"title\": \"LIME + SALTED CARAMEL\", \"description\": \"A caramel ganache covered with dark chocolate atop a base of white chocolate with lime and lemon.\" },\n \"LIME+VENEZUELA\": { \"image\": \"LIME+VENEZUELA.png\", \"title\": \"LIME + VENEZUELA\", \"description\": \"A ganache of milk chocolate from Venezuela (45% cocoa) covered with milk chocolate atop a base of white chocolate with lime and lemon.\" },\n \"LIME+COSTARICA\": { \"image\": \"LIME+COSTARICA.png\", \"title\": \"LIME + COSTA RICA\", \"description\": \"A ganache of dark chocolate from Costa Rica (64% cocoa) covered with dark chocolate atop a base of white chocolate with lime and lemon. \" },\n\n // CARAMEL\n \"CARAMEL+PECAN\": { \"image\": \"CARAMEL+PECAN.png\", \"title\": \"CARAMEL + PECAN\", \"description\": \"A praliné of pecan nuts covered with white chocolate atop a base of white and milk chocolate with caramel.\" },\n \"CARAMEL+ALMOND\": { \"image\": \"CARAMEL+ALMOND.png\", \"title\": \"CARAMEL + ALMOND\", \"description\": \"An almond praliné with pieces of Montélimar (France) nougat covered with milk chocolate atop a base of white and milk chocolate with caramel.\" },\n \"CARAMEL+HAZELNUT\": { \"image\": \"CARAMEL+HAZELNUT.png\", \"title\": \"CARAMEL + HAZELNUT\", \"description\": \"A crunchy hazelnut praliné covered with dark chocolate atop a base of white and milk chocolate with caramel.\" },\n \"CARAMEL+SALTEDCARAMEL\": { \"image\": \"CARAMEL+SALTEDCARAMEL.png\", \"title\": \"CARAMEL + SALTED CARAMEL\", \"description\": \"A caramel ganache covered with dark chocolate atop a base of white and milk chocolate with caramel.\" },\n \"CARAMEL+VENEZUELA\": { \"image\": \"CARAMEL+VENEZUELA.png\", \"title\": \"CARAMEL + VENEZUELA\", \"description\": \"A ganache of milk chocolate from Venezuela (45% cocoa) covered with milk chocolate atop a base of white and milk chocolate with caramel.\" },\n \"CARAMEL+COSTARICA\": { \"image\": \"CARAMEL+COSTARICA.png\", \"title\": \"CARAMEL + COSTA RICA\", \"description\": \"A ganache of dark chocolate from Costa Rica (64% cocoa) covered with dark chocolate atop a base of white and milk chocolate with caramel.\" },\n };\n\n // outer circle data\n var data = [\n { \"label\": \"vanilla\", \"value\": 1, \"image\": \"vanilla.png\" },\n { \"label\": \"ginger\", \"value\": 2, \"image\": \"ginger.png\" },\n { \"label\": \"lime\", \"value\": 3, \"image\": \"lime.png\" },\n { \"label\": \"raspberry\", \"value\": 4, \"image\": \"raspberry.png\" },\n { \"label\": \"caramel\", \"value\": 5, \"image\": \"caramel.png\" },\n { \"label\": \"coffee\", \"value\": 6, \"image\": \"coffee.png\" }\n ];\n\n // inner circle data\n var data_inner = [\n { \"title\": \"ganache\", \"title_bold\": \"costa rica\", \"value\": 1, \"image\": \"costarica.png\", \"label\": \"costarica\" },\n { \"title\": \"ganache\", \"title_bold\": \"venezuela\", \"value\": 2, \"image\": \"venezuela.png\", \"label\": \"venezuela\" },\n { \"title\": \"praline\", \"title_bold\": \"almond\", \"value\": 3, \"image\": \"almond.png\", \"label\": \"almond\" },\n { \"title\": \"praline\", \"title_bold\": \"pecan\", \"value\": 4, \"image\": \"pecan.png\", \"label\": \"pecan\" },\n { \"title\": \"praline\", \"title_bold\": \"hazelnut\", \"value\": 5, \"image\": \"hazelnut.png\", \"label\": \"hazelnut\" },\n { \"title\": \"ganache\", \"title_bold\": \"salted caramel\", \"value\": 6, \"image\": \"saltedcaramel.png\", \"label\": \"saltedcaramel\" }\n ];\n\n require('./duetsHelper').init(results, data, data_inner, false);\n}\n\nmodule.exports = {\n init: init\n}\n","'use strict';\n\nvar results, isFr, data, data_inner, audioStr, imgStr, audioPath, imgPath, chartWidth, padding, w, h, r, rotation, oldrotation, rotation2, oldrotation2, picked, picked2, totalDuration, svg, container, vis, vis_inner, pie, arc, arcs, arcs_inner;\n\nfunction initialize() {\n // get the image path\n audioStr = $('#chart').data('audio-url');\n imgStr = $('#chart').data('img-url');\n\n audioPath = audioStr.substring(0, audioStr.lastIndexOf('/')+1);\n imgPath = imgStr.substring(0, imgStr.lastIndexOf('/')+1);\n\n // get the container width set the width and height of the SVG circle\n chartWidth = $(\"#chart\").width();\n\n // essential veriables\n padding = { top: 0, right: 0, bottom: 0, left: 0 };\n w = chartWidth - padding.left - padding.right;\n h = chartWidth - padding.top - padding.bottom;\n r = Math.min(w, h) / 2;\n rotation = 30;\n oldrotation = 30;\n rotation2 = 30;\n oldrotation2 = 30;\n picked = 100000;\n picked2 = 100000;\n totalDuration = 5000;\n\n svg = d3.select('#chart')\n .append(\"svg\")\n .data([data])\n .attr(\"width\", w + padding.left + padding.right)\n .attr(\"height\", h + padding.top + padding.bottom);\n container = svg.append(\"g\")\n .attr(\"class\", \"chartholder\")\n .attr(\"transform\", \"translate(\" + (w / 2 + padding.left) + \",\" + (h / 2 + padding.top) + \")\");\n vis = container.append(\"g\").attr(\"class\", \"main_circle\");\n\n vis_inner = container\n .append(\"g\").attr(\"class\", \"inner_circle\")\n\n // set the initial position\n vis.transition()\n .duration(0)\n .attrTween(\"transform\", rotTween);\n\n vis_inner.transition()\n .duration(0)\n .attrTween(\"transform\", rotTween_inner);\n\n pie = d3.layout.pie().sort(null).value(function (d) { return 1; });\n // declare an arc generator function\n arc = d3.svg.arc().outerRadius(r);\n // select paths, use arc generator to draw\n arcs = vis.selectAll(\"g.slice\")\n .data(pie)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"slice\");\n\n // arc item\n arcs.append(\"path\")\n .attr(\"fill\", \"#FFFAEF\")\n .attr(\"d\", function (d) { return arc(d); });\n\n // add the text and image to outer circle\n arcs.append(\"g\").attr(\"transform\", function (d) {\n d.innerRadius = 0;\n d.outerRadius = r;\n d.angle = (d.startAngle + d.endAngle) / 2;\n return \"rotate(\" + (d.angle * 180 / Math.PI - 90) + \")translate(\" + (d.outerRadius - 15) + \")\";\n }).append(\"text\")\n .attr(\"text-anchor\", \"end\")\n .attr(\"class\", \"inner_text outer\")\n .text(function (d, i) {\n return data[i].title;\n })\n\n // add image\n arcs.append(\"g\").attr(\"transform\", function (d) {\n d.innerRadius = 0;\n d.outerRadius = r;\n d.angle = (d.startAngle + d.endAngle) / 2;\n return \"rotate(\" + (d.angle * 180 / Math.PI - 90) + \")translate(\" + (d.outerRadius - 15) + \")\";\n }).append(\"image\")\n .attr({\n class: \"outer_circle_img\",\n 'xlink:href': function (d, i) {\n return imgPath + data[i].image;\n }\n })\n\n pie = d3.layout.pie().sort(null).value(function (d) { return 1; });\n // declare an arc generator function\n arc = d3.svg.arc().outerRadius(r / 1.45);\n\n arcs_inner = vis_inner.selectAll(\"g.slice\")\n .data(pie)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"slice\");\n\n // add item to inner cirlce\n arcs_inner.append(\"path\")\n .attr(\"fill\", \"#FFFAEF\")\n .attr(\"d\", function (d) { return arc(d); });\n\n // add the text\n arcs_inner.append(\"g\").attr(\"transform\", function (d) {\n d.innerRadius = 0;\n d.outerRadius = r / 1.45;\n d.angle = (d.startAngle + d.endAngle) / 2;\n return \"rotate(\" + (d.angle * 180 / Math.PI - 90) + \")translate(\" + (d.outerRadius - 40) + \")\";\n }).append(\"text\")\n .attr(\"text-anchor\", \"end\")\n .attr(\"class\", \"inner_text\")\n .text(function (d, i) {\n return data_inner[i].title;\n })\n\n // add the bold text\n arcs_inner.append(\"g\").attr(\"transform\", function (d) {\n d.innerRadius = 0;\n d.outerRadius = r / 1.45;\n d.angle = (d.startAngle + d.endAngle) / 2;\n return \"rotate(\" + (d.angle * 180 / Math.PI - 90) + \")translate(\" + (d.outerRadius - 20) + \")\";\n }).append(\"text\")\n .attr(\"text-anchor\", \"end\")\n .attr(\"class\", \"inner_text font-weight-bold\")\n .text(function (d, i) {\n return data_inner[i].title_bold;\n })\n\n // add image\n arcs_inner.append(\"g\").attr(\"transform\", function (d) {\n d.innerRadius = 0;\n d.outerRadius = r / 1.45;\n d.angle = (d.startAngle + d.endAngle) / 2;\n return \"rotate(\" + (d.angle * 180 / Math.PI - 90) + \")translate(\" + (d.outerRadius - 40) + \")\";\n }).append(\"image\")\n .attr({\n class: \"outer_circle_img\",\n 'xlink:href': function (d, i) {\n return imgPath + data_inner[i].image;\n }\n })\n}\n\nfunction spin(d) {\n\n $(\".spin_button\").addClass(\"disabled\");\n\n var ps = 360 / 6,\n rng = Math.floor((Math.random() * 1440) + 1800);\n\n rotation = (Math.round(rng / ps) * ps);\n\n picked = Math.round(6 - (rotation % 360) / ps) + 2;\n picked = picked >= 6 ? (picked % 6) : picked;\n\n rotation += 0 + Math.round(ps / 2);\n vis.transition()\n .duration(totalDuration)\n .attrTween(\"transform\", rotTween)\n .each(\"end\", function () {\n oldrotation = rotation;\n });\n\n\n // 6 are the circle items\n var ps2 = 360 / 6,\n rng2 = Math.floor((Math.random() * 1440) + 1800);\n\n rotation2 = (Math.round(rng2 / ps2) * ps2);\n\n picked2 = Math.round((rotation2 % 360) / ps2);\n picked2 = picked2 >= 6 ? (picked2 % 6) : picked2;\n\n\n rotation2 -= 150;\n vis_inner.transition()\n .duration(totalDuration)\n .attrTween(\"transform\", rotTween_inner)\n .each(\"end\", function () {\n oldrotation2 = rotation2;\n });\n\n // run show_result function to create and show the results\n show_result(data[picked].label.toLocaleUpperCase() + \"+\" + data_inner[picked2].label.toLocaleUpperCase());\n\n setTimeout(function () {\n $(\".spin_button\").removeClass(\"disabled\")\n }, totalDuration);\n}\n\n// rotate animation to selected angle\nfunction rotTween(to) {\n var i = d3.interpolate(oldrotation % 360, rotation);\n return function (t) {\n return \"rotate(\" + i(t) + \")\";\n };\n}\n\n// rotate animation to selected angle\nfunction rotTween_inner(to) {\n var i = d3.interpolate(oldrotation2 % 360, rotation2);\n return function (t) {\n return \"rotate(-\" + i(t) + \")\";\n };\n}\n\nfunction show_result(id) {\n // fetch top images\n var topImages = id.toLowerCase().split(\"+\");\n // top images\n $(\".top_image_1\").attr(\"src\", imgPath + topImages[1] + \".png\").css({ right: \"-100px\", opacity: 0, top: \"100px\" });\n $(\".top_image_2\").attr(\"src\", imgPath + topImages[0] + \".png\").css({ left: \"-100px\", opacity: 0, top: \"100px\" });\n // main stats image\n if (isFr) {\n $(\".result_stats\").attr(\"src\", imgPath + \"results_fr/\" + results[id].image).css({ opacity: 0 });\n } else {\n $(\".result_stats\").attr(\"src\", imgPath + \"results/\" + results[id].image).css({ opacity: 0 });\n }\n // title and text\n $(\".result_title\").text(results[id].title).css({ opacity: 0, top: \"100px\" });\n $(\".result_dec\").text(results[id].description).css({ opacity: 0 });\n\n const audio3 = new Audio(audioPath + \"SpinningWheel.mp3\");\n audio3.play();\n\n const audio2 = new Audio(audioPath + \"WheelClick.mp3\");\n audio2.play();\n\n // show result box\n setTimeout(function () {\n\n const audio = new Audio(audioPath + \"WinFanfare.mp3\");\n audio.play();\n\n setTimeout(function () {\n const audio2 = new Audio(audioPath + \"WheelResult.mp3\");\n audio2.play();\n }, 1000);\n\n setTimeout(function () {\n const audio2 = new Audio(audioPath + \"SpinAgain.mp3\");\n audio2.play();\n }, 5000);\n\n $(\"#result\").addClass(\"show\");\n $(\".top_image_1\").animate({\n opacity: 1\n }, 1000).animate({\n right: '0px',\n }, 2000).animate({\n top: 0\n }, 1500);\n\n setTimeout(function () {\n $(\".top_image_1\").addClass(\"boxShadowNone\");\n }, 3500)\n\n $(\".top_image_2\").animate({\n opacity: 1\n }, 1000).animate({\n left: '0px'\n }, 2000).animate({\n top: 0\n }, 1500);\n\n $(\".result_title\").animate({\n opacity: 0\n }, 2500).animate({\n opacity: 1\n }, 500).animate({\n top: 0\n }, 1500);\n\n $(\".result_dec, .result_stats\").animate({\n opacity: 0\n }, 4500).animate({\n opacity: 1\n }, 500);\n\n\n }, (totalDuration + 200));\n}\n\n// spin again button click\n$(\".result_spin\").click(function () {\n $(\"#result\").removeClass(\"show\");\n $(\".top_image_1\").removeClass(\"boxShadowNone\");\n // setTimeout(function () {\n // spin();\n // }, 200);\n const audio = new Audio(audioPath + \"SpinAgain.mp3\");\n audio.play();\n})\n\nconst init = (resultsData, outerData, innerData, bool) => {\n results = resultsData;\n data = outerData;\n data_inner = innerData;\n isFr = bool;\n\n $('.spin_button').on('click', spin);\n\n initialize();\n}\n\nmodule.exports = {\n init: init\n}\n"],"sourceRoot":""}