{"version":3,"sources":["webpack:///./js/components/init-typeahead.js"],"names":["$element","getBloodhoundSource","source","settings","hint","highlight","minLength","dataset","displayKey","name","ttAdapter","templates","suggestion","Handlebars","compile","typeahead","on","onSelect","$event","url","window","location","href","valueKey","Bloodhound","initialize","identify","datum","id","sorter","a","b","score","datumTokenizer","tokenizers","obj","nonword","queryTokenizer","prefetch","ttl","transform","items","map","item","then","$","length","initialise"],"mappings":"qMAgBA,WAA0BA,GAA1B,0GAEuBC,EAAoB,SAF3C,OAEQC,EAFR,OAKQC,EAAW,CACfC,MAAM,EACNC,WAAW,EACXC,UAAW,GAIPC,EAAU,CACdC,WAAY,QACZC,KAAM,cACNP,OAAQA,EAAOQ,YACfC,UAAW,CAETC,WAAYC,IAAWC,QAErB,kHAMNd,EAASe,UAAUZ,EAAUI,GAASS,GAAG,mBAAoBC,GA1B/D,gD,8UA8BA,SAASA,EAASC,EAAQN,GACnBA,EAAWO,MAIhBC,OAAOC,SAASC,KAAOV,EAAWO,KAIpC,SAASlB,EAAoBsB,GAE3B,IAAMrB,EAAS,IAAIsB,IAAW,CAE5BC,YAAY,EAGZC,SAAU,SAAAC,GAAA,OAASA,EAAMC,IAGzBC,OAAQ,SAACC,EAAGC,GACV,OAAID,EAAEE,MAAQD,EAAEC,OACN,EAENF,EAAEE,MAAQD,EAAEC,MACP,EAEF,GAITC,eAAgBT,IAAWU,WAAWC,IAAIC,QAAQb,GAClDc,eAAgBb,IAAWU,WAAWE,QAGtCE,SAAU,CACRnB,IAAK,uBACLoB,IAAK,KACLC,UAAW,SAAAC,GAAA,OAAWA,EAAaA,EAAMC,KAAI,SAAAC,GAAA,OAAQA,EAAK/B,cAA5B,OAKlC,OAAOV,EAAOuB,aAAamB,MAAK,kBAAM1C,KAnFxC2C,IAAEA,EAADA,yBAAC,uGACM7C,EAAW6C,IAAE,kBAELC,OAHd,iEAOMC,EAAW/C,GAPjB,2C","file":"typeahead-be17a4cb865f40882a01.js","sourcesContent":["import $ from 'jquery';\r\nimport Handlebars from 'handlebars/dist/handlebars';\r\nimport Bloodhound from 'corejs-typeahead/dist/bloodhound';\r\nimport 'corejs-typeahead/dist/typeahead.jquery';\r\n\r\n$(async () => {\r\n const $element = $('.js-typeahead');\r\n\r\n if (!$element.length) {\r\n return;\r\n }\r\n\r\n await initialise($element);\r\n});\r\n\r\n/** Initialise typeahead. */\r\nasync function initialise($element) {\r\n // Get Bloodhound source.\r\n const source = await getBloodhoundSource('value');\r\n\r\n // Initialise settings.\r\n const settings = {\r\n hint: true,\r\n highlight: true,\r\n minLength: 3,\r\n };\r\n\r\n // Initialise dataset.\r\n const dataset = {\r\n displayKey: 'value',\r\n name: 'main-search',\r\n source: source.ttAdapter(),\r\n templates: {\r\n // eslint-disable-next-line max-len\r\n suggestion: Handlebars.compile(\r\n // eslint-disable-next-line max-len\r\n '