{"version":3,"sources":["https://lively-kernel.org/lively4/BP2019RH1/src/internal/individuals-as-points/venn/theme-group.js"],"names":["GroupHull","THEME_GROUP_COLOR_TRANSPARENCY","ThemeGroup","constructor","uuid","name","themes","color","individuals","groupHull","length","contains","individual","forEach","theme","L3","includes","addIndividual","push","resetIndividuals","fillHullWithIndividuals","setIndividualsToInclude","getGroupHull","getColor","setColor","setThemes","setName"],"mappings":";;;;;;AAAOA,e;;AAEEC,oC,kBAAAA,8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEM,YAAMC,UAAN,CAAiB;AAC9BC,oBAAYC,IAAZ,EAAkBC,IAAlB,EAAwBC,MAAxB,EAAgCC,KAAhC,EAAuC;AACrC,eAAKH,IAAL,GAAYA,IAAZ;AACA,eAAKC,IAAL,GAAYA,IAAZ;AACA,eAAKC,MAAL,GAAcA,MAAd;AACA,eAAKE,WAAL,GAAmB,EAAnB;AACA,eAAKC,SAAL,GAAiB,IAAIT,SAAJ,EAAjB;AACA,eAAKO,KAAL,GAAaA,QAAQN,8BAArB;;AAEA,cAAI,CAACI,IAAD,IAASC,OAAOI,MAAP,IAAiB,CAA9B,EAAiC;AAC/B,iBAAKL,IAAL,GAAYC,OAAO,CAAP,CAAZ;AACD;AACF;;AAED;AACA;AACA;;AAEAK,iBAASC,UAAT,EAAqB;AACnB,cAAID,WAAW,KAAf;AACA,eAAKL,MAAL,CAAYO,OAAZ,CAAoBC,SAAS;AAC3B,gBAAGF,WAAWN,MAAX,CAAkBS,EAAlB,CAAqBC,QAArB,CAA8BF,KAA9B,CAAH,EAAyC;AACvCH,yBAAW,IAAX;AACD;AACF,WAJD;;AAMA,iBAAO,KAAKL,MAAL,CAAYI,MAAZ,GAAqBC,QAArB,GAAgC,IAAvC;AACD;;AAEDM,sBAAcL,UAAd,EAA0B;AACxB,eAAKJ,WAAL,CAAiBU,IAAjB,CAAsBN,UAAtB;AACD;;AAEDO,2BAAmB;AACjB,eAAKX,WAAL,GAAmB,EAAnB;AACD;;AAEDY,kCAA0B;AACxB,eAAKX,SAAL,CAAeY,uBAAf,CAAuC,KAAKb;AAC5C;AADA;AAED;;AAEDc,uBAAe;AACb,iBAAO,KAAKb,SAAZ;AACD;;AAEDc,mBAAW;AACT,iBAAO,KAAKhB,KAAZ;AACD;;AAEDiB,iBAASjB,KAAT,EAAgB;AACd,eAAKA,KAAL,GAAaA,QAAQN,8BAArB;AACD;;AAEDwB,kBAAUnB,MAAV,EAAkB;AAChB,eAAKA,MAAL,GAAcA,MAAd;AACD;;AAEDoB,gBAAQrB,IAAR,EAAc;AACZ,eAAKA,IAAL,GAAYA,IAAZ;AACD;AA5D6B;;yBAAXH,U","file":"theme-group.js","sourcesContent":["import GroupHull from './group-hull.js'\n\nimport { THEME_GROUP_COLOR_TRANSPARENCY } from './venn-diagram.js'\n\nexport default class ThemeGroup {\n  constructor(uuid, name, themes, color) {\n    this.uuid = uuid\n    this.name = name\n    this.themes = themes\n    this.individuals = []\n    this.groupHull = new GroupHull()\n    this.color = color + THEME_GROUP_COLOR_TRANSPARENCY\n    \n    if (!name && themes.length == 1) {\n      this.name = themes[0]\n    }\n  }\n  \n  // ------------------------------------------\n  // Public Methods\n  // ------------------------------------------\n  \n  contains(individual) {\n    let contains = false\n    this.themes.forEach(theme => {\n      if(individual.themes.L3.includes(theme)) {\n        contains = true\n      }\n    })\n    \n    return this.themes.length ? contains : true\n  }\n  \n  addIndividual(individual) {\n    this.individuals.push(individual)\n  }\n  \n  resetIndividuals() {\n    this.individuals = []\n  }\n  \n  fillHullWithIndividuals() {\n    this.groupHull.setIndividualsToInclude(this.individuals)\n    // this.groupHull.setCenter(this.center)\n  }\n  \n  getGroupHull() {\n    return this.groupHull;\n  }\n  \n  getColor() {\n    return this.color\n  }\n  \n  setColor(color) {\n    this.color = color + THEME_GROUP_COLOR_TRANSPARENCY\n  }\n  \n  setThemes(themes) {\n    this.themes = themes\n  }\n  \n  setName(name) {\n    this.name = name\n  }\n}"]}