{"version":3,"sources":["webpack:///./scripts/components/toolbox/movers.js","webpack:///./scripts/components/toolbox/sortableKeyboard.js"],"names":["toolboxMove","left","$el","insertBefore","prevAll","first","focus","right","insertAfter","nextAll","toggle","window","innerWidth","parents","find","tooltip","$","popover","length","children","append","hasClass","setupCustomSortableHandlers","$toolbox","isCustomising","$btnAddRemoves","keypressStatus","attr","bind","ev","which","this","on","parent","err"],"mappings":"6FAAA,+DACO,IAAMA,EAAc,CACvBC,KADuB,SAClBC,GACDA,EAAIC,aAAaD,EAAIE,QAAQ,MAAMC,SACnCH,EAAII,SAERC,MALuB,SAKjBL,GACFA,EAAIM,YAAYN,EAAIO,QAAQ,MAAMJ,SAClCH,EAAII,SAERI,OATuB,SAShBR,GAECS,OAAOC,WAAa,KACpBV,EAAIW,QAAQ,YAAYC,KAAK,2BAA2BC,QAAQ,QAEhEC,EAAE,SAASC,QAAQ,QAGnBf,EAAIW,QAAQ,0BAA0BK,OAAS,GAC/ChB,EAAIW,QAAQ,YAAYM,SAAS,MAAMC,OAAOlB,GAE1CS,OAAOC,WAAa,MACpBV,EAAII,UAGRJ,EAAIW,QAAQ,YAAYC,KAAK,0BAA0BM,OAAOlB,GAC1DA,EAAIW,QAAQ,YAAYQ,SAAS,iBAAmBV,OAAOC,WAAa,MACxEV,EAAII,Y,oQCzBb,SAASgB,EAA4BC,GAK3C,IAAI,MAgBMC,EAAT,WACC,OAAOD,EAASF,SAAS,iBAVpBI,EAAiBF,EAAST,KAAK,mBAEjCY,GAAc,OARD,IASJ,GADK,IAPH,IASJ,GAFO,IANG,IASJ,GAHC,IALI,IASJ,GAJA,GAYlBH,EAAST,KAAK,MAAMa,KAAK,WAAY,GAAGC,KAAK,WAAW,SAAUC,GAC7DL,MACCK,EAAGC,SAASJ,IACfA,EAAeG,EAAGC,QAAS,GAExBJ,EAzBW,KAyBiBA,EAxBnB,KAwB6CA,EAvBvC,KAwBlB1B,cAAYC,KAAKe,EAAEe,OAEhBL,EA5BW,KA4BiBA,EA3BnB,KA2B6CA,EAzBtC,KA0BnB1B,cAAYO,MAAMS,EAAEe,OAzBL,KA2BZF,EAAGC,OA1BQ,KA0BeD,EAAGC,OAChC9B,cAAYU,OAAOM,EAAEe,WAIrBH,KAAK,SAAS,SAASC,GACrBA,EAAGC,SAASJ,IACfA,EAAeG,EAAGC,QAAS,MAI7BL,EAAeO,GAAG,SAAQ,SAASH,GAC9BL,KACHxB,cAAYU,OAAOM,EAAEe,MAAME,OAAO,UAIrC,MAAOC,O","file":"11.0c8033cdc4d2ee96514a.js","sourcesContent":["//Moves\nexport const toolboxMove = {\n left($el){\n $el.insertBefore($el.prevAll('li').first());\n $el.focus();\n },\n right($el){\n $el.insertAfter($el.nextAll('li').first());\n $el.focus();\n },\n toggle($el){\n //Clean up any popovers and tooltips first\n if (window.innerWidth > 1200) {\n $el.parents('.toolbox').find('[data-toggle=\"tooltip\"]').tooltip('hide');\n } else {\n $('.info').popover('hide'); \n }\n\n if ($el.parents('.toolbox__remaining ul').length > 0) {\n $el.parents('.toolbox').children('ul').append($el);\n \n if (window.innerWidth > 1200) {\n $el.focus();\n }\n } else { \n $el.parents('.toolbox').find('.toolbox__remaining ul').append($el);\n if ($el.parents('.toolbox').hasClass('-customising') && window.innerWidth > 1200) {\n $el.focus();\n }\n }\n }\n}","// Init sortable and handle keyboard events\nimport {toolboxMove} from './movers';\nexport function setupCustomSortableHandlers($toolbox) {\n\n\t//ui-sortable-disabled to track if we can sort\n\t//Handle 'trash' and 'plus' icons here too\n\n\ttry {\n\t\tconst shiftKey = 16;\n\t\tconst altKey = 18;\n\t\tconst leftArrowKey = 37;\n\t\tconst rightArrowKey = 39;\n\t\tconst deleteKey = 46;\n\t\tconst enterKey = 13;\n\t\tconst $btnAddRemoves = $toolbox.find('.btn-add-remove');\n \n\t\tvar keypressStatus = {\n\t\t\t[shiftKey]: false,\n\t\t\t[altKey]: false,\n\t\t\t[leftArrowKey]: false,\n\t\t\t[rightArrowKey]: false\n\t\t};\n\n\t\tfunction isCustomising(){\n\t\t\treturn $toolbox.hasClass('-customising');\n\t\t}\n\n\t\t//Set up events\n\t\t$toolbox.find('li').attr('tabindex', 0).bind('keydown', function (ev) {\n\t\t\tif (isCustomising()) {\n\t\t\t\tif (ev.which in keypressStatus) {\n\t\t\t\t\tkeypressStatus[ev.which] = true;\n\t\t\t\t}\n\t\t\t\tif (keypressStatus[shiftKey] && keypressStatus[altKey] && keypressStatus[leftArrowKey]) {\n\t\t\t\t\ttoolboxMove.left($(this));\n\t\t\t\t}\n\t\t\t\tif (keypressStatus[shiftKey] && keypressStatus[altKey] && keypressStatus[rightArrowKey]) {\n\t\t\t\t\ttoolboxMove.right($(this));\n\t\t\t\t}\n\t\t\t\tif (ev.which === deleteKey || ev.which === enterKey) {\n\t\t\t\t\ttoolboxMove.toggle($(this));\n\t\t\t\t}\n\t\t\t}\n\n\t\t}).bind('keyup', function(ev) {\n\t\t\tif (ev.which in keypressStatus) {\n\t\t\t\tkeypressStatus[ev.which] = false;\n\t\t\t}\n\t\t});\n\n\t\t$btnAddRemoves.on('click',function(ev){\n\t\t\tif (isCustomising()) {\n\t\t\t\ttoolboxMove.toggle($(this).parent('li'));\n\t\t\t}\n\t\t});\n\t}\n\tcatch (err) {\n\t\tconsole.warn('There was a problem setting up keyboard navigation: ' + err);\n\t}\n\t\n}"],"sourceRoot":""}