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,CAC3DV,UAAW,yCACXS,UAAW,iBACXE,MAAO,GACPC,UAAU,EACVC,cAAe,IACfC,OAAQ,CAAC,aAEb,M,oEAAChD,CAAA,CA1Fe,C,SAASiD,SA6F3B,W","sources":["webpack://cornell-engineering/./static/js/components/algolia/people-search.js"],"sourcesContent":["import { searchBox, refinementList } from 'instantsearch.js/es/widgets';\n\nimport { createDropdown } from './vendor/dropdown';\nimport GlobalSearch from './global-search';\n\n/**\n * PeopleSearch\n */\nclass PeopleSearch extends GlobalSearch {\n  constructor(rootEl) {\n    super(rootEl);\n\n    // Pre-filter parameters\n    this.department = this.rootEl.dataset['department'];\n    this.departmentFilter = this.department ? `departments.name:\"${this.department}\"` : '';\n    this.preFilter = this.departmentFilter;\n    this.resultsLabel = {\n      singular: 'person',\n      plural: 'people',\n    };\n\n    this.searchParams.filters = this.preFilter;\n  }\n\n  /**\n   * Initialize the search\n   *\n   * @override GlobalSearch\n   */\n  init() {\n    this.configureWidgets();\n    this.configurePeopleWidgets();\n    this.setWidgets();\n    this.setPeopleWidgets();\n    this.addWidgets();\n    this.search.start();\n  }\n\n  /**\n   * Configure people-specific widgets\n   */\n  configurePeopleWidgets() {\n    this.configureRoleRefinementDropdown();\n    this.configureResearchAreasRefinementDropdown();\n  }\n\n  /**\n   * Set people-specific widgets\n   */\n  setPeopleWidgets() {\n    this.widgets.push(this.roleRefinementDropdown, this.researchAreasRefinementDropdown);\n  }\n\n  /**\n   * Configure the search box\n   *\n   * @override GlobalSearch\n   */\n  configureSearchBox() {\n    this.searchBox = searchBox({\n      container: '.js-people-search-input',\n      placeholder: 'Search by name, research topic, ...',\n      showSubmit: false,\n    });\n  }\n\n  /**\n   * Configure the role refinement dropdown\n   */\n  configureRoleRefinementDropdown() {\n    const roleDropdown = createDropdown(refinementList, {\n      cssClasses: { root: 'ais-Dropdown-roles' },\n      buttonText: 'All Roles',\n    });\n\n    this.roleRefinementDropdown = roleDropdown({\n      container: '.js-people-search-roles-input',\n      attribute: 'role',\n    });\n  }\n\n  /**\n   * Configure the research areas refinement dropdown\n   */\n  configureResearchAreasRefinementDropdown() {\n    const researchAreasDropdown = createDropdown(refinementList, {\n      cssClasses: { root: 'ais-Dropdown-research-areas' },\n      buttonText: 'All Research Areas',\n    });\n\n    this.researchAreasRefinementDropdown = researchAreasDropdown({\n      container: '.js-people-search-research-areas-input',\n      attribute: 'research_areas',\n      limit: 10,\n      showMore: true,\n      showMoreLimit: 100,\n      sortBy: ['name:asc'],\n    });\n  }\n}\n\nexport default PeopleSearch;\n"],"names":["PeopleSearch","_GlobalSearch","rootEl","_this","_classCallCheck","_callSuper","department","dataset","departmentFilter","concat","preFilter","resultsLabel","singular","plural","searchParams","filters","_inherits","key","value","this","configureWidgets","configurePeopleWidgets","setWidgets","setPeopleWidgets","addWidgets","search","start","configureRoleRefinementDropdown","configureResearchAreasRefinementDropdown","widgets","push","roleRefinementDropdown","researchAreasRefinementDropdown","searchBox","container","placeholder","showSubmit","roleDropdown","createDropdown","refinementList","cssClasses","root","buttonText","attribute","researchAreasDropdown","limit","showMore","showMoreLimit","sortBy","GlobalSearch"],"sourceRoot":""}