diff --git a/amd/build/contacts.min.js b/amd/build/contacts.min.js new file mode 100644 index 0000000..0b29dad --- /dev/null +++ b/amd/build/contacts.min.js @@ -0,0 +1,3 @@ +define("block_dash/contacts",["jquery","core/str","core/modal_factory","core/modal_events","core/fragment","core/templates"],(function($,Str,Modal,ModalEvents,Fragment,Templates){return{init:function(contextID){var contactUser,groupModal=document.getElementsByClassName("contact-widget-viewgroup");Array.from(groupModal).forEach((function(element){element.addEventListener("click",(function(e){e.preventDefault();var target=e.target.closest("a");contactUser=target.getAttribute("data-userid"),Modal.create({title:Str.get_string("groups","core")}).then((function(modal){modal.show();var params={widget:"contacts",method:"load_groups",args:JSON.stringify({contactuser:contactUser})};Fragment.loadFragment("block_dash","loadwidget",contextID,params).then(((html,js)=>{modal.setBody(html),Templates.runTemplateJS(js)})),modal.getRoot().on(ModalEvents.hidden,(function(){modal.destroy()}))}))}))}))}}})); + +//# sourceMappingURL=contacts.min.js.map \ No newline at end of file diff --git a/amd/build/contacts.min.js.map b/amd/build/contacts.min.js.map new file mode 100644 index 0000000..5e9996f --- /dev/null +++ b/amd/build/contacts.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"contacts.min.js","sources":["../src/contacts.js"],"sourcesContent":["define(['jquery', 'core/str', 'core/modal_factory', 'core/modal_events', 'core/fragment', 'core/templates'],\n function($, Str, Modal, ModalEvents, Fragment, Templates) {\n\n return {\n init: function(contextID) {\n var groupModal = document.getElementsByClassName('contact-widget-viewgroup');\n var contactUser;\n Array.from(groupModal).forEach(function(element) {\n element.addEventListener('click', function(e) {\n e.preventDefault();\n var target = e.target.closest('a');\n contactUser = target.getAttribute('data-userid');\n Modal.create({\n title: Str.get_string('groups', 'core')\n }).then(function(modal) {\n modal.show();\n // modal.getRoot().on(ModalEvents.shown, function() {\n var args = JSON.stringify({contactuser: contactUser});\n var params = {widget: 'contacts', method: 'load_groups', args: args };\n Fragment.loadFragment('block_dash', 'loadwidget', contextID, params).then((html, js) => {\n modal.setBody(html);\n Templates.runTemplateJS(js);\n });\n // });\n modal.getRoot().on(ModalEvents.hidden, function() {\n modal.destroy();\n });\n });\n });\n });\n }\n };\n});"],"names":["define","$","Str","Modal","ModalEvents","Fragment","Templates","init","contextID","contactUser","groupModal","document","getElementsByClassName","Array","from","forEach","element","addEventListener","e","preventDefault","target","closest","getAttribute","create","title","get_string","then","modal","show","params","widget","method","args","JSON","stringify","contactuser","loadFragment","html","js","setBody","runTemplateJS","getRoot","on","hidden","destroy"],"mappings":"AAAAA,6BAAO,CAAC,SAAU,WAAY,qBAAsB,oBAAqB,gBAAiB,mBACtF,SAASC,EAAGC,IAAKC,MAAOC,YAAaC,SAAUC,iBAExC,CACHC,KAAM,SAASC,eAEPC,YADAC,WAAaC,SAASC,uBAAuB,4BAEjDC,MAAMC,KAAKJ,YAAYK,SAAQ,SAASC,SACpCA,QAAQC,iBAAiB,SAAS,SAASC,GACvCA,EAAEC,qBACEC,OAASF,EAAEE,OAAOC,QAAQ,KAC9BZ,YAAcW,OAAOE,aAAa,eAClCnB,MAAMoB,OAAO,CACTC,MAAOtB,IAAIuB,WAAW,SAAU,UACjCC,MAAK,SAASC,OACbA,MAAMC,WAGFC,OAAS,CAACC,OAAQ,WAAYC,OAAQ,cAAeC,KAD9CC,KAAKC,UAAU,CAACC,YAAa1B,eAExCJ,SAAS+B,aAAa,aAAc,aAAc5B,UAAWqB,QAAQH,MAAK,CAACW,KAAMC,MAC7EX,MAAMY,QAAQF,MACd/B,UAAUkC,cAAcF,OAG5BX,MAAMc,UAAUC,GAAGtC,YAAYuC,QAAQ,WACnChB,MAAMiB"} \ No newline at end of file diff --git a/amd/build/dash_instance.min.js b/amd/build/dash_instance.min.js index f68de6a..ae612e4 100644 --- a/amd/build/dash_instance.min.js +++ b/amd/build/dash_instance.min.js @@ -1,2 +1,3 @@ -define ("block_dash/dash_instance",["jquery","core/log","core/ajax","core/notification","core/modal_events","block_dash/preferences_modal","block_dash/datepicker","block_dash/select2"],function(a,b,c,d,e,f){var g=function(b,c,d,e){this.root=a(b);this.blockInstanceId=c;this.blockContextid=d;this.currentPage=0;this.blockPreferencesModal=null;this.editing=e;this.sortField=null;this.sortDirections={};this.init()};g.prototype.BLOCK_CONTENT_SELECTOR=".dash-block-content";g.prototype.FILTER_FORM_SELECTOR=".filter-form";g.prototype.init=function(){b.debug("Initializing dash instance",this);this.initDatePickers();this.initSelect2();if(this.editing){this.blockPreferencesModal=new f(this.getRoot().find(".dash-edit-preferences"),this.blockContextid,function(){this.currentPage=0;this.refresh()}.bind(this))}this.getRoot().on("change","select, input",function(c){c.preventDefault();b.debug("Submitting filter form");b.debug(c);b.debug(a(c.target).serializeArray());this.currentPage=0;this.refresh()}.bind(this));this.getBlockContentArea().on("click",".page-link",function(b){b.preventDefault();this.currentPage=a(b.target).data("page");this.refresh()}.bind(this));this.getBlockContentArea().on("click",".dash-sort",function(b){var c=a(b.target);this.sortField=c.data("sort");if(!this.sortDirections.hasOwnProperty(this.sortField)){this.sortDirections[this.sortField]="asc"}else{this.sortDirections[this.sortField]="asc"===this.sortDirections[this.sortField]?"desc":"asc"}this.refresh()}.bind(this))};g.prototype.getRoot=function(){return this.root};g.prototype.getBlockContentArea=function(){return this.getRoot().find(this.BLOCK_CONTENT_SELECTOR)};g.prototype.getFilterForm=function(){return this.getRoot().find(this.FILTER_FORM_SELECTOR)};g.prototype.getBlockContent=function(){var a=null;if(this.sortField&&this.sortDirections.hasOwnProperty(this.sortField)){a=this.sortDirections[this.sortField]}var b={methodname:"block_dash_get_block_content",args:{block_instance_id:this.blockInstanceId,filter_form_data:JSON.stringify(this.getFilterForm().serializeArray()),page:this.currentPage,sort_field:this.sortField,sort_direction:a}};return c.call([b])[0]};g.prototype.refresh=function(){this.getBlockContentArea().css("opacity",.5);this.getBlockContent().then(function(a){this.getBlockContentArea().html(a.html);this.getBlockContentArea().css("opacity",1);this.initDatePickers();this.initSelect2()}.bind(this)).catch(d.exception)};g.prototype.initDatePickers=function(){this.getRoot().find(".datepicker").datepicker2({autoclose:!0,format:"dd/mm/yyyy"})};g.prototype.initSelect2=function(){this.getRoot().find(".select2").each(function(b,c){var d=null;if(a(c).find("option[value='-1']")){d={id:"-1",text:a(c).find("option[value='-1']").text()}}a(c).select2({dropdownParent:this.getRoot(),allowClear:!0,theme:"bootstrap4",placeholder:d}).on("select2:unselecting",function(){a(this).data("unselecting",!0)}).on("select2:opening",function(b){if(a(this).data("unselecting")){a(this).removeData("unselecting");b.preventDefault()}})}.bind(this))};return g}); -//# sourceMappingURL=dash_instance.min.js.map +define("block_dash/dash_instance",["jquery","jqueryui","core/log","core/ajax","core/notification","core/modal_events","block_dash/preferences_modal","block_dash/datepicker","block_dash/select2","core/fragment","core/templates"],(function($,UI,Log,Ajax,Notification,ModalEvents,PreferencesModal,DatePicker,Select2,Fragment,Templates){var DashInstance=function(root,blockInstanceId,blockContextid,editing,istotara){this.root=$(root),this.blockInstanceId=blockInstanceId,this.blockContextid=blockContextid,this.currentPage=0,this.blockPreferencesModal=null,this.editing=editing,this.sortField=null,this.sortDirections={},this.isTotara=istotara,this.init()};return DashInstance.prototype.BLOCK_CONTENT_SELECTOR=".dash-block-content",DashInstance.prototype.FILTER_FORM_SELECTOR=".filter-form",DashInstance.prototype.init=function(){Log.debug("Initializing dash instance",this),this.initDatePickers(),this.initSelect2(),this.editing&&(this.blockPreferencesModal=new PreferencesModal(this.getRoot().find(".dash-edit-preferences"),this.blockContextid,function(){this.currentPage=0,this.refresh()}.bind(this))),this.getRoot().on("change","select, input",function(e){e.preventDefault(),Log.debug("Submitting filter form"),Log.debug(e),Log.debug($(e.target).serializeArray()),this.currentPage=0,this.refresh()}.bind(this)),this.getBlockContentArea().on("click",".page-link",function(e){e.preventDefault(),this.currentPage=$(e.target).data("page"),this.refresh()}.bind(this)),this.getBlockContentArea().on("click",".dash-sort",function(e){const $target=$(e.target);this.sortField=$target.data("sort"),this.sortDirections.hasOwnProperty(this.sortField)?this.sortDirections[this.sortField]="asc"===this.sortDirections[this.sortField]?"desc":"asc":this.sortDirections[this.sortField]="asc",this.refresh()}.bind(this)),this.isTotara&&this.setDynamicTable()},DashInstance.prototype.getRoot=function(){return this.root},DashInstance.prototype.getBlockContentArea=function(){return this.getRoot().find(this.BLOCK_CONTENT_SELECTOR)},DashInstance.prototype.getFilterForm=function(){return this.getRoot().find(this.FILTER_FORM_SELECTOR)},DashInstance.prototype.getBlockContent=function(){let sortDirection=null;this.sortField&&this.sortDirections.hasOwnProperty(this.sortField)&&(sortDirection=this.sortDirections[this.sortField]);var request={methodname:"block_dash_get_block_content",args:{block_instance_id:this.blockInstanceId,filter_form_data:JSON.stringify(this.getFilterForm().serializeArray()),page:this.currentPage,sort_field:this.sortField,sort_direction:sortDirection}};return Ajax.call([request])[0]},DashInstance.prototype.refresh=function(){this.getBlockContentArea().css("opacity",.5),this.getBlockContent().then(function(response){this.getBlockContentArea().html(response.html),this.getBlockContentArea().css("opacity",1),this.initDatePickers(),this.initSelect2()}.bind(this)).catch(Notification.exception)},DashInstance.prototype.initDatePickers=function(){this.getRoot().find(".datepicker").datepicker2({autoclose:!0,format:"dd/mm/yyyy"})},DashInstance.prototype.initSelect2=function(){this.getRoot().find(".select2").each(function(index,element){let placeholder=null;$(element).find("option[value='-1']")&&(placeholder={id:"-1",text:$(element).find("option[value='-1']").text()}),$(element).select2({dropdownParent:this.getRoot(),allowClear:!0,theme:"bootstrap4",placeholder:placeholder}).on("select2:unselecting",(function(){$(this).data("unselecting",!0)})).on("select2:opening",(function(e){$(this).data("unselecting")&&($(this).removeData("unselecting"),e.preventDefault())}))}.bind(this))},DashInstance.prototype.setDynamicTable=function(){$("body").delegate('[data-table-dynamic="true"] thead th a',"click",(function(e){e.preventDefault(),updateTable($(this))})),$("body").delegate(".modal-body .paging a","click",(function(e){e.preventDefault(),updateTable($(this))}));var updateTable=function(element){var table=element.parents(".modal-body").find("table"),href=element.attr("href"),params=new URL(href).searchParams,page=params.get("page"),sortfield=params.get("tsort");""==sortfield&&(sortfield=table.data("table-sort"));var tablehandler=table.data("table-handler"),filter=table.data("table-filter"),uniqueid=table.data("table-uniqueid"),context=table.data("table-context"),data={handler:tablehandler,filter:filter,uniqueid:uniqueid,sort:sortfield,page:page};Fragment.loadFragment("block_dash","loadtable",context,data).then(((html,js)=>{$(".modal-body").html(html),Templates.runTemplateJS(js)}))}},DashInstance})); + +//# sourceMappingURL=dash_instance.min.js.map \ No newline at end of file diff --git a/amd/build/dash_instance.min.js.map b/amd/build/dash_instance.min.js.map index 513bfe0..2c6dc93 100644 --- a/amd/build/dash_instance.min.js.map +++ b/amd/build/dash_instance.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/dash_instance.js"],"names":["define","$","Log","Ajax","Notification","ModalEvents","PreferencesModal","DashInstance","root","blockInstanceId","blockContextid","editing","currentPage","blockPreferencesModal","sortField","sortDirections","init","prototype","BLOCK_CONTENT_SELECTOR","FILTER_FORM_SELECTOR","debug","initDatePickers","initSelect2","getRoot","find","refresh","bind","on","e","preventDefault","target","serializeArray","getBlockContentArea","data","$target","hasOwnProperty","getFilterForm","getBlockContent","sortDirection","request","methodname","args","block_instance_id","filter_form_data","JSON","stringify","page","sort_field","sort_direction","call","css","then","response","html","catch","exception","datepicker2","autoclose","format","each","index","element","placeholder","id","text","select2","dropdownParent","allowClear","theme","removeData"],"mappings":"AAAAA,OAAM,4BAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,WAAvB,CAAoC,mBAApC,CAAyD,mBAAzD,CACH,8BADG,CAC6B,uBAD7B,CACsD,oBADtD,CAAD,CAEF,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAAuBC,CAAvB,CAAqCC,CAArC,CAAkDC,CAAlD,CAAoE,CAEhE,GAAIC,CAAAA,CAAY,CAAG,SAASC,CAAT,CAAeC,CAAf,CAAgCC,CAAhC,CAAgDC,CAAhD,CAAyD,CACxE,KAAKH,IAAL,CAAYP,CAAC,CAACO,CAAD,CAAb,CACA,KAAKC,eAAL,CAAuBA,CAAvB,CACA,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AC5C,KAAKC,OAAL,GAAeC,IAAf,CAAoB,UAApB,EAAgCmC,IAAhC,CAAqC,SAASC,CAAT,CAAgBC,CAAhB,CAAyB,CAC1D,GAAIC,CAAAA,CAAW,CAAG,IAAlB,CACA,GAAI7D,CAAC,CAAC4D,CAAD,CAAD,CAAWrC,IAAX,CAAgB,oBAAhB,CAAJ,CAA2C,CACvCsC,CAAW,CAAG,CACVC,EAAE,CAAE,IADM,CAEVC,IAAI,CAAE/D,CAAC,CAAC4D,CAAD,CAAD,CAAWrC,IAAX,CAAgB,oBAAhB,EAAsCwC,IAAtC,EAFI,CAIjB,CACD/D,CAAC,CAAC4D,CAAD,CAAD,CAAWI,OAAX,CAAmB,CACfC,cAAc,CAAE,KAAK3C,OAAL,EADD,CAEf4C,UAAU,GAFK,CAGfC,KAAK,CAAE,YAHQ,CAIfN,WAAW,CAAEA,CAJE,CAAnB,EAKGnC,EALH,CAKM,qBALN,CAK6B,UAAW,CACpC1B,CAAC,CAAC,IAAD,CAAD,CAAQgC,IAAR,CAAa,aAAb,IACH,CAPD,EAOGN,EAPH,CAOM,iBAPN,CAOyB,SAASC,CAAT,CAAY,CACjC,GAAI3B,CAAC,CAAC,IAAD,CAAD,CAAQgC,IAAR,CAAa,aAAb,CAAJ,CAAiC,CAC7BhC,CAAC,CAAC,IAAD,CAAD,CAAQoE,UAAR,CAAmB,aAAnB,EACAzC,CAAC,CAACC,cAAF,EACH,CACJ,CAZD,CAaH,CArBoC,CAqBnCH,IArBmC,CAqB9B,IArB8B,CAArC,CAsBH,CAvBD,CAyBA,MAAOnB,CAAAA,CACV,CAlKC,CAAN","sourcesContent":["define(['jquery', 'core/log', 'core/ajax', 'core/notification', 'core/modal_events',\n 'block_dash/preferences_modal', 'block_dash/datepicker', 'block_dash/select2'],\n function($, Log, Ajax, Notification, ModalEvents, PreferencesModal) {\n\n var DashInstance = function(root, blockInstanceId, blockContextid, editing) {\n this.root = $(root);\n this.blockInstanceId = blockInstanceId;\n this.blockContextid = blockContextid;\n this.currentPage = 0;\n this.blockPreferencesModal = null;\n this.editing = editing;\n this.sortField = null;\n this.sortDirections = {};\n\n this.init();\n };\n\n DashInstance.prototype.BLOCK_CONTENT_SELECTOR = '.dash-block-content';\n DashInstance.prototype.FILTER_FORM_SELECTOR = '.filter-form';\n\n DashInstance.prototype.init = function() {\n Log.debug('Initializing dash instance', this);\n\n this.initDatePickers();\n this.initSelect2();\n\n if (this.editing) {\n this.blockPreferencesModal = new PreferencesModal(this.getRoot().find('.dash-edit-preferences'),\n this.blockContextid, function () {\n // Preferences changed, go back to first page.\n this.currentPage = 0;\n this.refresh();\n }.bind(this));\n }\n\n this.getRoot().on('change', 'select, input', function (e) {\n e.preventDefault();\n\n Log.debug('Submitting filter form');\n Log.debug(e);\n Log.debug($(e.target).serializeArray());\n\n // Filter results, go back to first page.\n this.currentPage = 0;\n this.refresh();\n }.bind(this));\n\n this.getBlockContentArea().on('click', '.page-link', function(e) {\n e.preventDefault();\n this.currentPage = $(e.target).data('page');\n this.refresh();\n }.bind(this));\n\n this.getBlockContentArea().on('click', '.dash-sort', function(e) {\n const $target = $(e.target);\n this.sortField = $target.data('sort');\n\n // Set sorting to asc by default.\n if (!this.sortDirections.hasOwnProperty(this.sortField)) {\n this.sortDirections[this.sortField] = 'asc';\n } else {\n // Toggle sort direction on field.\n this.sortDirections[this.sortField] = this.sortDirections[this.sortField] === 'asc' ? 'desc' : 'asc';\n }\n this.refresh();\n }.bind(this));\n };\n\n /**\n * Get the root element of this dash instance.\n *\n * @method getRoot\n * @return {object} jQuery object\n */\n DashInstance.prototype.getRoot = function() {\n return this.root;\n };\n\n /**\n * Get the content element of this dash instance.\n *\n * @method getRoot\n * @return {object} jQuery object\n */\n DashInstance.prototype.getBlockContentArea = function() {\n return this.getRoot().find(this.BLOCK_CONTENT_SELECTOR);\n };\n\n /**\n * Get filter form element.\n *\n * @returns {object} jQuery object\n */\n DashInstance.prototype.getFilterForm = function() {\n return this.getRoot().find(this.FILTER_FORM_SELECTOR);\n };\n\n DashInstance.prototype.getBlockContent = function() {\n let sortDirection = null;\n if (this.sortField && this.sortDirections.hasOwnProperty(this.sortField)) {\n sortDirection = this.sortDirections[this.sortField];\n }\n\n var request = {\n methodname: 'block_dash_get_block_content',\n args: {\n block_instance_id: this.blockInstanceId,\n filter_form_data: JSON.stringify(this.getFilterForm().serializeArray()),\n page: this.currentPage,\n sort_field: this.sortField,\n sort_direction: sortDirection\n }\n };\n\n return Ajax.call([request])[0];\n };\n\n DashInstance.prototype.refresh = function() {\n this.getBlockContentArea().css('opacity', 0.5);\n this.getBlockContent()\n .then(function(response) {\n this.getBlockContentArea().html(response.html);\n this.getBlockContentArea().css('opacity', 1);\n this.initDatePickers();\n this.initSelect2();\n }.bind(this))\n .catch(Notification.exception);\n };\n\n DashInstance.prototype.initDatePickers = function() {\n this.getRoot().find('.datepicker').datepicker2({\n autoclose: true,\n format: \"dd/mm/yyyy\"\n });\n };\n\n DashInstance.prototype.initSelect2 = function() {\n this.getRoot().find('.select2').each(function(index, element) {\n let placeholder = null;\n if ($(element).find(\"option[value='-1']\")) {\n placeholder = {\n id: '-1', // the value of the option\n text: $(element).find(\"option[value='-1']\").text()\n };\n }\n $(element).select2({\n dropdownParent: this.getRoot(),\n allowClear: true,\n theme: 'bootstrap4',\n placeholder: placeholder\n }).on('select2:unselecting', function() {\n $(this).data('unselecting', true);\n }).on('select2:opening', function(e) {\n if ($(this).data('unselecting')) {\n $(this).removeData('unselecting');\n e.preventDefault();\n }\n });\n }.bind(this));\n };\n\n return DashInstance;\n });"],"file":"dash_instance.min.js"} \ No newline at end of file +{"version":3,"file":"dash_instance.min.js","sources":["../src/dash_instance.js"],"sourcesContent":["define(['jquery', 'jqueryui', 'core/log', 'core/ajax', 'core/notification', 'core/modal_events',\n 'block_dash/preferences_modal', 'block_dash/datepicker', 'block_dash/select2', 'core/fragment', 'core/templates'],\n function($, UI, Log, Ajax, Notification, ModalEvents, PreferencesModal, DatePicker, Select2, Fragment, Templates) {\n\n var DashInstance = function(root, blockInstanceId, blockContextid, editing, istotara) {\n this.root = $(root);\n this.blockInstanceId = blockInstanceId;\n this.blockContextid = blockContextid;\n this.currentPage = 0;\n this.blockPreferencesModal = null;\n this.editing = editing;\n this.sortField = null;\n this.sortDirections = {};\n this.isTotara = istotara;\n\n this.init();\n };\n\n DashInstance.prototype.BLOCK_CONTENT_SELECTOR = '.dash-block-content';\n DashInstance.prototype.FILTER_FORM_SELECTOR = '.filter-form';\n\n DashInstance.prototype.init = function() {\n Log.debug('Initializing dash instance', this);\n\n this.initDatePickers();\n this.initSelect2();\n\n if (this.editing) {\n this.blockPreferencesModal = new PreferencesModal(this.getRoot().find('.dash-edit-preferences'),\n this.blockContextid, function () {\n // Preferences changed, go back to first page.\n this.currentPage = 0;\n this.refresh();\n }.bind(this));\n }\n\n this.getRoot().on('change', 'select, input', function (e) {\n e.preventDefault();\n\n Log.debug('Submitting filter form');\n Log.debug(e);\n Log.debug($(e.target).serializeArray());\n\n // Filter results, go back to first page.\n this.currentPage = 0;\n this.refresh();\n }.bind(this));\n\n this.getBlockContentArea().on('click', '.page-link', function(e) {\n e.preventDefault();\n this.currentPage = $(e.target).data('page');\n this.refresh();\n }.bind(this));\n\n this.getBlockContentArea().on('click', '.dash-sort', function(e) {\n const $target = $(e.target);\n this.sortField = $target.data('sort');\n\n // Set sorting to asc by default.\n if (!this.sortDirections.hasOwnProperty(this.sortField)) {\n this.sortDirections[this.sortField] = 'asc';\n } else {\n // Toggle sort direction on field.\n this.sortDirections[this.sortField] = this.sortDirections[this.sortField] === 'asc' ? 'desc' : 'asc';\n }\n this.refresh();\n }.bind(this));\n\n if (this.isTotara) {\n this.setDynamicTable();\n }\n };\n\n /**\n * Get the root element of this dash instance.\n *\n * @method getRoot\n * @return {object} jQuery object\n */\n DashInstance.prototype.getRoot = function() {\n return this.root;\n };\n\n /**\n * Get the content element of this dash instance.\n *\n * @method getRoot\n * @return {object} jQuery object\n */\n DashInstance.prototype.getBlockContentArea = function() {\n return this.getRoot().find(this.BLOCK_CONTENT_SELECTOR);\n };\n\n /**\n * Get filter form element.\n *\n * @returns {object} jQuery object\n */\n DashInstance.prototype.getFilterForm = function() {\n return this.getRoot().find(this.FILTER_FORM_SELECTOR);\n };\n\n DashInstance.prototype.getBlockContent = function() {\n let sortDirection = null;\n if (this.sortField && this.sortDirections.hasOwnProperty(this.sortField)) {\n sortDirection = this.sortDirections[this.sortField];\n }\n\n var request = {\n methodname: 'block_dash_get_block_content',\n args: {\n block_instance_id: this.blockInstanceId,\n filter_form_data: JSON.stringify(this.getFilterForm().serializeArray()),\n page: this.currentPage,\n sort_field: this.sortField,\n sort_direction: sortDirection\n }\n };\n\n return Ajax.call([request])[0];\n };\n\n DashInstance.prototype.refresh = function() {\n this.getBlockContentArea().css('opacity', 0.5);\n this.getBlockContent()\n .then(function(response) {\n this.getBlockContentArea().html(response.html);\n this.getBlockContentArea().css('opacity', 1);\n this.initDatePickers();\n this.initSelect2();\n }.bind(this))\n .catch(Notification.exception);\n };\n\n DashInstance.prototype.initDatePickers = function() {\n this.getRoot().find('.datepicker').datepicker2({\n autoclose: true,\n format: \"dd/mm/yyyy\"\n });\n };\n\n DashInstance.prototype.initSelect2 = function() {\n this.getRoot().find('.select2').each(function(index, element) {\n let placeholder = null;\n if ($(element).find(\"option[value='-1']\")) {\n placeholder = {\n id: '-1', // the value of the option\n text: $(element).find(\"option[value='-1']\").text()\n };\n }\n $(element).select2({\n dropdownParent: this.getRoot(),\n allowClear: true,\n theme: 'bootstrap4',\n placeholder: placeholder\n }).on('select2:unselecting', function() {\n $(this).data('unselecting', true);\n }).on('select2:opening', function(e) {\n if ($(this).data('unselecting')) {\n $(this).removeData('unselecting');\n e.preventDefault();\n }\n });\n }.bind(this));\n };\n\n DashInstance.prototype.setDynamicTable = function() {\n\n $('body').delegate('[data-table-dynamic=\"true\"] thead th a', 'click', function(e) {\n e.preventDefault();\n updateTable($(this));\n });\n\n $('body').delegate('.modal-body .paging a', 'click', function(e) {\n e.preventDefault();\n updateTable($(this));\n });\n\n var updateTable = function(element) {\n var table = element.parents('.modal-body').find('table');\n\n var href = element.attr('href');\n var params = new URL(href).searchParams;\n var page = params.get('page');\n var sortfield = params.get('tsort');\n if (sortfield == '') {\n sortfield = table.data('table-sort');\n }\n\n var tablehandler = table.data('table-handler');\n var filter = table.data('table-filter');\n var uniqueid = table.data('table-uniqueid');\n var context = table.data('table-context');\n\n var data = {\n handler: tablehandler,\n filter: filter,\n uniqueid: uniqueid,\n sort: sortfield,\n page: page\n };\n\n Fragment.loadFragment('block_dash', 'loadtable', context, data).then((html, js) => {\n $('.modal-body').html(html);\n Templates.runTemplateJS(js);\n });\n };\n };\n\n return DashInstance;\n });"],"names":["define","$","UI","Log","Ajax","Notification","ModalEvents","PreferencesModal","DatePicker","Select2","Fragment","Templates","DashInstance","root","blockInstanceId","blockContextid","editing","istotara","currentPage","blockPreferencesModal","sortField","sortDirections","isTotara","init","prototype","BLOCK_CONTENT_SELECTOR","FILTER_FORM_SELECTOR","debug","this","initDatePickers","initSelect2","getRoot","find","refresh","bind","on","e","preventDefault","target","serializeArray","getBlockContentArea","data","$target","hasOwnProperty","setDynamicTable","getFilterForm","getBlockContent","sortDirection","request","methodname","args","block_instance_id","filter_form_data","JSON","stringify","page","sort_field","sort_direction","call","css","then","response","html","catch","exception","datepicker2","autoclose","format","each","index","element","placeholder","id","text","select2","dropdownParent","allowClear","theme","removeData","delegate","updateTable","table","parents","href","attr","params","URL","searchParams","get","sortfield","tablehandler","filter","uniqueid","context","handler","sort","loadFragment","js","runTemplateJS"],"mappings":"AAAAA,kCAAO,CAAC,SAAU,WAAY,WAAY,YAAa,oBAAqB,oBACxE,+BAAgC,wBAAyB,qBAAsB,gBAAiB,mBAChG,SAASC,EAAGC,GAAIC,IAAKC,KAAMC,aAAcC,YAAaC,iBAAkBC,WAAYC,QAASC,SAAUC,eAE/FC,aAAe,SAASC,KAAMC,gBAAiBC,eAAgBC,QAASC,eACnEJ,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E,QAAQ8E,SAAS,wBAAyB,SAAS,SAAS3C,GAC1DA,EAAEC,iBACF2C,YAAY/E,EAAE2B,cAGdoD,YAAc,SAASV,aACnBW,MAAQX,QAAQY,QAAQ,eAAelD,KAAK,SAE5CmD,KAAOb,QAAQc,KAAK,QACpBC,OAAS,IAAIC,IAAIH,MAAMI,aACvBhC,KAAO8B,OAAOG,IAAI,QAClBC,UAAYJ,OAAOG,IAAI,SACV,IAAbC,YACAA,UAAYR,MAAMxC,KAAK,mBAGvBiD,aAAeT,MAAMxC,KAAK,iBAC1BkD,OAASV,MAAMxC,KAAK,gBACpBmD,SAAWX,MAAMxC,KAAK,kBACtBoD,QAAUZ,MAAMxC,KAAK,iBAErBA,KAAO,CACPqD,QAASJ,aACTC,OAAQA,OACRC,SAAUA,SACVG,KAAMN,UACNlC,KAAMA,MAGV7C,SAASsF,aAAa,aAAc,YAAaH,QAASpD,MAAMmB,MAAK,CAACE,KAAMmC,MACxEhG,EAAE,eAAe6D,KAAKA,MACtBnD,UAAUuF,cAAcD,SAK7BrF"} \ No newline at end of file diff --git a/amd/build/datepicker.min.js b/amd/build/datepicker.min.js index f504750..3d48a02 100644 --- a/amd/build/datepicker.min.js +++ b/amd/build/datepicker.min.js @@ -1,2 +1,3 @@ -function _typeof(e){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(e){return typeof e}}else{_typeof=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}}return _typeof(e)}(function(e){if("function"==typeof define&&define.amd){define ("block_dash/datepicker",["jquery"],e)}else if("object"===("undefined"==typeof exports?"undefined":_typeof(exports))){e(require("jquery"))}else{e(jQuery)}})(function(t){function e(){return new Date(Date.UTC.apply(Date,arguments))}function a(){var t=new Date;return e(t.getFullYear(),t.getMonth(),t.getDate())}function o(e,t){return e.getUTCFullYear()===t.getUTCFullYear()&&e.getUTCMonth()===t.getUTCMonth()&&e.getUTCDate()===t.getUTCDate()}function s(e,a){return function(){if(a!==void 0){t.fn.datepicker2.deprecated(a)}return this[e].apply(this,arguments)}}function n(e){return e&&!isNaN(e.getTime())}var r=function(){var e={get:function get(e){return this.slice(e)[0]},contains:function contains(e){for(var t=e&&e.valueOf(),a=0,o=this.length;a=(e.match(/[<>]/g)||[]).length){return!0}var a=t(e);return 0r.left){this.picker.addClass("datepicker2-orient-left");g-=r.left-10}else if(g+e>s){this.picker.addClass("datepicker2-orient-right");g+=c-e}else{if(this.o.rtl){this.picker.addClass("datepicker2-orient-right")}else{this.picker.addClass("datepicker2-orient-left")}}}var h=this.o.orientation.y,m;if("auto"===h){m=-i+u-a;h=0>m?"bottom":"top"}this.picker.addClass("datepicker2-orient-"+h);if("top"===h)u-=a+parseInt(this.picker.css("padding-top"));else u+=p;if(this.o.rtl){var D=s-(g+c);this.picker.css({top:u,right:D,zIndex:l})}else{this.picker.css({top:u,left:g,zIndex:l})}return this},_allow_update:!0,update:function update(){if(!this._allow_update)return this;var e=this.dates.copy(),a=[],o=!1;if(arguments.length){t.each(arguments,t.proxy(function(e,t){if(t instanceof Date)t=this._local_to_utc(t);a.push(t)},this));o=!0}else{a=this.isInput?this.element.val():this.element.data("date")||this.inputField.val();if(a&&this.o.multidate)a=a.split(this.o.multidateSeparator);else a=[a];delete this.element.data().date}a=t.map(a,t.proxy(function(e){return y.parseDate(e,this.o.format,this.o.language,this.o.assumeNearbyYear)},this));a=t.grep(a,t.proxy(function(e){return!this.dateWithinRange(e)||!e},this),!0);this.dates.replace(a);if(this.o.updateViewDate){if(this.dates.length)this.viewDate=new Date(this.dates.get(-1));else if(this.viewDatethis.o.endDate)this.viewDate=new Date(this.o.endDate);else this.viewDate=this.o.defaultViewDate}if(o){this.setValue();this.element.change()}else if(this.dates.length){if(e+""!==this.dates+""&&o){this._trigger("changeDate");this.element.change()}}if(!this.dates.length&&e.length){this._trigger("clearDate");this.element.change()}this.fill();return this},fillDow:function fillDow(){if(this.o.showWeekDays){var e=this.o.weekStart,a="";if(this.o.calendarWeeks){a+=" "}while(e"+D[this.o.language].daysMin[e++%7]+""}a+="";this.picker.find(".datepicker2-days thead").append(a)}},fillMonths:function fillMonths(){for(var e=this._utc_to_local(this.viewDate),t="",a,o=0;12>o;o++){a=e&&e.getMonth()===o?" focused":"";t+=""+D[this.o.language].monthsShort[o]+""}this.picker.find(".datepicker2-months td").html(t)},setRange:function setRange(e){if(!e||!e.length)delete this.range;else this.range=t.map(e,function(e){return e.valueOf()});this.fill()},getClassNames:function getClassNames(e){var s=[],i=this.viewDate.getUTCFullYear(),n=this.viewDate.getUTCMonth(),d=a();if(e.getUTCFullYear()i||e.getUTCFullYear()===i&&e.getUTCMonth()>n){s.push("new")}if(this.focusDate&&e.valueOf()===this.focusDate.valueOf())s.push("focused");if(this.o.todayHighlight&&o(e,d)){s.push("today")}if(-1!==this.dates.contains(e))s.push("active");if(!this.dateWithinRange(e)){s.push("disabled")}if(this.dateIsDisabled(e)){s.push("disabled","disabled-date")}if(-1!==t.inArray(e.getUTCDay(),this.o.daysOfWeekHighlighted)){s.push("highlighted")}if(this.range){if(e>this.range[0]&&en){m.push("disabled")}if(f===u){m.push("focused")}if(d!==t.noop){y=d(new Date(f,0,1));if(y===void 0){y={}}else if("boolean"==typeof y){y={enabled:y}}else if("string"==typeof y){y={classes:y}}if(!1===y.enabled){m.push("disabled")}if(y.classes){m=m.concat(y.classes.split(/\s+/))}if(y.tooltip){D=y.tooltip}}l+=""+f+""}p.find(".datepicker2-switch").text(c+"-"+g);p.find("td").html(l)},fill:function fill(){var o=new Date(this.viewDate),s=o.getUTCFullYear(),i=o.getUTCMonth(),n=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,d=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,l=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,r=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,p=D[this.o.language].today||D.en.today||"",c=D[this.o.language].clear||D.en.clear||"",g=D[this.o.language].titleFormat||D.en.titleFormat,u=a(),h=(!0===this.o.todayBtn||"linked"===this.o.todayBtn)&&u>=this.o.startDate&&u<=this.o.endDate&&!this.weekOfDateIsDisabled(u),m,f;if(isNaN(s)||isNaN(i))return;this.picker.find(".datepicker2-days .datepicker2-switch").text(y.formatDate(o,g,this.o.language));this.picker.find("tfoot .today").text(p).css("display",h?"table-cell":"none");this.picker.find("tfoot .clear").text(c).css("display",!0===this.o.clearBtn?"table-cell":"none");this.picker.find("thead .datepicker2-title").text(this.o.title).css("display","string"==typeof this.o.title&&""!==this.o.title?"table-cell":"none");this.updateNavArrows();this.fillMonths();var v=e(s,i,0),w=v.getUTCDate();v.setUTCDate(w-(v.getUTCDay()-this.o.weekStart+7)%7);var k=new Date(v);if(100>v.getUTCFullYear()){k.setUTCFullYear(v.getUTCFullYear())}k.setUTCDate(k.getUTCDate()+42);k=k.valueOf();var _=[],C,b;while(v.valueOf()");if(this.o.calendarWeeks){var T=new Date(+v+864e5*((this.o.weekStart-C-7)%7)),M=new Date(+T+864e5*((11-T.getUTCDay())%7)),U=new Date(+(U=e(M.getUTCFullYear(),0,1))+864e5*((11-U.getUTCDay())%7)),x=(M-U)/864e5/7+1;_.push(""+x+"")}}b=this.getClassNames(v);b.push("day");var V=v.getUTCDate();if(this.o.beforeShowDay!==t.noop){f=this.o.beforeShowDay(this._utc_to_local(v));if(f===void 0)f={};else if("boolean"==typeof f)f={enabled:f};else if("string"==typeof f)f={classes:f};if(!1===f.enabled)b.push("disabled");if(f.classes)b=b.concat(f.classes.split(/\s+/));if(f.tooltip)m=f.tooltip;if(f.content)V=f.content}if(t.isFunction(t.uniqueSort)){b=t.uniqueSort(b)}else{b=t.unique(b)}_.push(""+V+"");m=null;if(C===this.o.weekEnd){_.push("")}v.setUTCDate(v.getUTCDate()+1)}this.picker.find(".datepicker2-days tbody").html(_.join(""));var F=D[this.o.language].monthsTitle||D.en.monthsTitle||"Months",S=this.picker.find(".datepicker2-months").find(".datepicker2-switch").text(2>this.o.maxViewMode?F:s).end().find("tbody span").removeClass("active");t.each(this.dates,function(e,t){if(t.getUTCFullYear()===s)S.eq(t.getUTCMonth()).addClass("active")});if(sl){S.addClass("disabled")}if(s===n){S.slice(0,d).addClass("disabled")}if(s===l){S.slice(r+1).addClass("disabled")}if(this.o.beforeShowMonth!==t.noop){var O=this;t.each(S,function(e,a){var o=new Date(s,e,1),i=O.o.beforeShowMonth(o);if(i===void 0)i={};else if("boolean"==typeof i)i={enabled:i};else if("string"==typeof i)i={classes:i};if(!1===i.enabled&&!t(a).hasClass("disabled"))t(a).addClass("disabled");if(i.classes)t(a).addClass(i.classes);if(i.tooltip)t(a).prop("title",i.tooltip)})}this._fill_yearsView(".datepicker2-years","year",10,s,n,l,this.o.beforeShowYear);this._fill_yearsView(".datepicker2-decades","decade",100,s,n,l,this.o.beforeShowDecade);this._fill_yearsView(".datepicker2-centuries","century",1e3,s,n,l,this.o.beforeShowCentury)},updateNavArrows:function updateNavArrows(){if(!this._allow_update)return;var e=new Date(this.viewDate),t=e.getUTCFullYear(),a=e.getUTCMonth(),o=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,s=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,i=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,n=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,d,l,r=1;switch(this.viewMode){case 4:r*=10;case 3:r*=10;case 2:r*=10;case 1:d=Math.floor(t/r)*r<=o;l=Math.floor(t/r)*r+r>i;break;case 0:d=t<=o&&a<=s;l=t>=i&&a>=n;break;}this.picker.find(".prev").toggleClass("disabled",d);this.picker.find(".next").toggleClass("disabled",l)},click:function click(o){o.preventDefault();o.stopPropagation();var s,i,n,d;s=t(o.target);if(s.hasClass("datepicker2-switch")&&this.viewMode!==this.o.maxViewMode){this.setViewMode(this.viewMode+1)}if(s.hasClass("today")&&!s.hasClass("day")){this.setViewMode(0);this._setDate(a(),"linked"===this.o.todayBtn?null:"view")}if(s.hasClass("clear")){this.clearDates()}if(!s.hasClass("disabled")){if(s.hasClass("month")||s.hasClass("year")||s.hasClass("decade")||s.hasClass("century")){this.viewDate.setUTCDate(1);i=1;if(1===this.viewMode){d=s.parent().find("span").index(s);n=this.viewDate.getUTCFullYear();this.viewDate.setUTCMonth(d)}else{d=0;n=+s.text();this.viewDate.setUTCFullYear(n)}this._trigger(y.viewModes[this.viewMode-1].e,this.viewDate);if(this.viewMode===this.o.minViewMode){this._setDate(e(n,d,i))}else{this.setViewMode(this.viewMode-1);this.fill()}}}if(this.picker.is(":visible")&&this._focused_from){this._focused_from.focus()}delete this._focused_from},dayCellClick:function dayCellClick(a){var e=t(a.currentTarget),o=e.data("date"),s=new Date(o);if(this.o.updateViewDate){if(s.getUTCFullYear()!==this.viewDate.getUTCFullYear()){this._trigger("changeYear",this.viewDate)}if(s.getUTCMonth()!==this.viewDate.getUTCMonth()){this._trigger("changeMonth",this.viewDate)}}this._setDate(s)},navArrowsClick:function navArrowsClick(a){var e=t(a.currentTarget),o=e.hasClass("prev")?-1:1;if(0!==this.viewMode){o*=12*y.viewModes[this.viewMode].navStep}this.viewDate=this.moveMonth(this.viewDate,o);this._trigger(y.viewModes[this.viewMode].e,this.viewDate);this.fill()},_toggle_multidate:function _toggle_multidate(e){var t=this.dates.contains(e);if(!e){this.dates.clear()}if(-1!==t){if(!0===this.o.multidate||1this.o.multidate){this.dates.remove(0)}},_setDate:function _setDate(e,t){if(!t||"date"===t)this._toggle_multidate(e&&new Date(e));if(!t&&this.o.updateViewDate||"view"===t)this.viewDate=e&&new Date(e);this.fill();this.setValue();if(!t||"view"!==t){this._trigger("changeDate")}this.inputField.trigger("change");if(this.o.autoclose&&(!t||"date"===t)){this.hide()}},moveDay:function moveDay(e,t){var a=new Date(e);a.setUTCDate(e.getUTCDate()+t);return a},moveWeek:function moveWeek(e,t){return this.moveDay(e,7*t)},moveMonth:function moveMonth(e,t){if(!n(e))return this.o.defaultViewDate;if(!t)return e;var a=new Date(e.valueOf()),o=a.getUTCDate(),s=a.getUTCMonth(),d=Math.abs(t),l,r;t=0=this.o.startDate&&e<=this.o.endDate},keydown:function keydown(t){if(!this.picker.is(":visible")){if(40===t.keyCode||27===t.keyCode){this.show();t.stopPropagation()}return}var e=!1,a,o,s=this.focusDate||this.viewDate;switch(t.keyCode){case 27:if(this.focusDate){this.focusDate=null;this.viewDate=this.dates.get(-1)||this.viewDate;this.fill()}else this.hide();t.preventDefault();t.stopPropagation();break;case 37:case 38:case 39:case 40:if(!this.o.keyboardNavigation||7===this.o.daysOfWeekDisabled.length)break;a=37===t.keyCode||38===t.keyCode?-1:1;if(0===this.viewMode){if(t.ctrlKey){o=this.moveAvailableDate(s,a,"moveYear");if(o)this._trigger("changeYear",this.viewDate)}else if(t.shiftKey){o=this.moveAvailableDate(s,a,"moveMonth");if(o)this._trigger("changeMonth",this.viewDate)}else if(37===t.keyCode||39===t.keyCode){o=this.moveAvailableDate(s,a,"moveDay")}else if(!this.weekOfDateIsDisabled(s)){o=this.moveAvailableDate(s,a,"moveWeek")}}else if(1===this.viewMode){if(38===t.keyCode||40===t.keyCode){a=4*a}o=this.moveAvailableDate(s,a,"moveMonth")}else if(2===this.viewMode){if(38===t.keyCode||40===t.keyCode){a=4*a}o=this.moveAvailableDate(s,a,"moveYear")}if(o){this.focusDate=this.viewDate=o;this.setValue();this.fill();t.preventDefault()}break;case 13:if(!this.o.forceParse)break;s=this.focusDate||this.dates.get(-1)||this.viewDate;if(this.o.keyboardNavigation){this._toggle_multidate(s);e=!0}this.focusDate=null;this.viewDate=this.dates.get(-1)||this.viewDate;this.setValue();this.fill();if(this.picker.is(":visible")){t.preventDefault();t.stopPropagation();if(this.o.autoclose)this.hide()}break;case 9:this.focusDate=null;this.viewDate=this.dates.get(-1)||this.viewDate;this.fill();this.hide();break;}if(e){if(this.dates.length)this._trigger("changeDate");else this._trigger("clearDate");this.inputField.trigger("change")}},setViewMode:function setViewMode(e){this.viewMode=e;this.picker.children("div").hide().filter(".datepicker2-"+y.viewModes[this.viewMode].clsName).show();this.updateNavArrows();this._trigger("changeViewMode",new Date(this.viewDate))}};var c=function(e,a){t.data(e,"datepicker2",this);this.element=t(e);this.inputs=t.map(a.inputs,function(e){return e.jquery?e[0]:e});delete a.inputs;this.keepEmptyValues=a.keepEmptyValues;delete a.keepEmptyValues;u.call(t(this.inputs),a).on("changeDate",t.proxy(this.dateUpdated,this));this.pickers=t.map(this.inputs,function(e){return t.data(e,"datepicker2")});this.updateDates()};c.prototype={updateDates:function updateDates(){this.dates=t.map(this.pickers,function(e){return e.getUTCDate()});this.updateRanges()},updateRanges:function updateRanges(){var e=t.map(this.dates,function(e){return e.valueOf()});t.each(this.pickers,function(t,a){a.setRange(e)})},clearDates:function clearDates(){t.each(this.pickers,function(e,t){t.clearDates()})},dateUpdated:function dateUpdated(a){if(this.updating)return;this.updating=!0;var e=t.data(a.target,"datepicker2");if(e===void 0){return}var o=e.getUTCDate(),s=this.keepEmptyValues,n=t.inArray(a.target,this.inputs),i=n-1,d=n+1,r=this.inputs.length;if(-1===n)return;t.each(this.pickers,function(t,a){if(!a.getUTCDate()&&(a===e||!s))a.setUTCDate(o)});if(othis.dates[d]){while(dthis.dates[d]){this.pickers[d++].setUTCDate(o)}}this.updateDates();delete this.updating},destroy:function destroy(){t.map(this.pickers,function(e){e.destroy()});t(this.inputs).off("changeDate",this.dateUpdated);delete this.element.data().datepicker2},remove:s("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead")};function d(e,a){var s=t(e).data(),i={},n,d=new RegExp("^"+a.toLowerCase()+"([A-Z])");a=new RegExp("^"+a.toLowerCase());function o(e,t){return t.toLowerCase()}for(var l in s){if(a.test(l)){n=l.replace(d,o);i[n]=s[l]}}return i}function l(e){var a={};if(!D[e]){e=e.split("-")[0];if(!D[e])return}var o=D[e];t.each(m,function(e,t){if(t in o)a[t]=o[t]});return a}var g=t.fn.datepicker2,u=function(e){var a=Array.apply(null,arguments);a.shift();var o;this.each(function(){var s=t(this),i=s.data("datepicker2"),n="object"===_typeof(e)&&e;if(!i){var r=d(this,"date"),g=t.extend({},h,r,n),u=l(g.language),m=t.extend({},h,u,r,n);if(s.hasClass("input-daterange")||m.inputs){t.extend(m,{inputs:m.inputs||s.find("input").toArray()});i=new c(this,m)}else{i=new p(this,m)}s.data("datepicker2",i)}if("string"==typeof e&&"function"==typeof i[e]){o=i[e].apply(i,a)}});if(o===void 0||o instanceof p||o instanceof c)return this;if(1e){e+=2e3;if(e>new Date().getFullYear()+t){e-=100}}return e}var w={},k=["yyyy","yy","M","MM","m","mm","d","dd"],_={yyyy:function yyyy(e,t){return e.setUTCFullYear(l?r(t,l):t)},m:function m(e,t){if(isNaN(e))return e;t-=1;while(0>t){t+=12}t%=12;e.setUTCMonth(t);while(e.getUTCMonth()!==t){e.setUTCDate(e.getUTCDate()-1)}return e},d:function d(e,t){return e.setUTCDate(t)}},C,b;_.yy=_.yyyy;_.M=_.MM=_.mm=_.m;_.dd=_.d;e=a();var T=o.parts.slice();if(h.length!==T.length){T=t(T).filter(function(e,a){return-1!==t.inArray(a,k)}).toArray()}function c(){var e=this.slice(0,h[v].length),t=h[v].slice(0,e.length);return e.toLowerCase()===t.toLowerCase()}if(h.length===T.length){var M;for(v=0,M=T.length;vs.d?"0":"")+s.d;s.mm=(10>s.m?"0":"")+s.m;e=[];for(var n=t.extend([],a.separators),d=0,l=a.parts.length;d<=l;d++){if(n.length)e.push(n.shift());e.push(s[a.parts[d]])}return e.join("")},headTemplate:""+h.templates.leftArrow+""+h.templates.rightArrow+"",contTemplate:"",footTemplate:""};y.template="
"+y.headTemplate+""+y.footTemplate+"
"+y.headTemplate+y.contTemplate+y.footTemplate+"
"+y.headTemplate+y.contTemplate+y.footTemplate+"
"+y.headTemplate+y.contTemplate+y.footTemplate+"
"+y.headTemplate+y.contTemplate+y.footTemplate+"
";t.fn.datepicker2.DPGlobal=y;t.fn.datepicker2.noConflict=function(){t.fn.datepicker2=g;return this};t.fn.datepicker2.version="1.9.0";t.fn.datepicker2.deprecated=function(e){var t=window.console;if(t&&t.warn){t.warn("DEPRECATED: "+e)}};t(document).on("focus.datepicker2.data-api click.datepicker2.data-api","[data-provide=\"datepicker2\"]",function(a){var e=t(this);if(e.data("datepicker2"))return;a.preventDefault();u.call(e,"show")});t(function(){u.call(t("[data-provide=\"datepicker2-inline\"]"))})}); -//# sourceMappingURL=datepicker.min.js.map +var factory;factory=function($,undefined$1){function UTCDate(){return new Date(Date.UTC.apply(Date,arguments))}function UTCToday(){var today=new Date;return UTCDate(today.getFullYear(),today.getMonth(),today.getDate())}function isUTCEquals(date1,date2){return date1.getUTCFullYear()===date2.getUTCFullYear()&&date1.getUTCMonth()===date2.getUTCMonth()&&date1.getUTCDate()===date2.getUTCDate()}function alias(method,deprecationMsg){return function(){return deprecationMsg!==undefined$1&&$.fn.datepicker2.deprecated(deprecationMsg),this[method].apply(this,arguments)}}var extras,DateArray=(extras={get:function(i){return this.slice(i)[0]},contains:function(d){for(var val=d&&d.valueOf(),i=0,l=this.length;i]/g)||[]).length<=0||$(tmp).length>0)}catch(ex){return!1}},_process_options:function(opts){this._o=$.extend({},this._o,opts);var o=this.o=$.extend({},this._o),lang=o.language;dates[lang]||(lang=lang.split("-")[0],dates[lang]||(lang=defaults.language)),o.language=lang,o.startView=this._resolveViewName(o.startView),o.minViewMode=this._resolveViewName(o.minViewMode),o.maxViewMode=this._resolveViewName(o.maxViewMode),o.startView=Math.max(this.o.minViewMode,Math.min(this.o.maxViewMode,o.startView)),!0!==o.multidate&&(o.multidate=Number(o.multidate)||!1,!1!==o.multidate&&(o.multidate=Math.max(0,o.multidate))),o.multidateSeparator=String(o.multidateSeparator),o.weekStart%=7,o.weekEnd=(o.weekStart+6)%7;var format=DPGlobal.parseFormat(o.format);o.startDate!==-1/0&&(o.startDate?o.startDate instanceof Date?o.startDate=this._local_to_utc(this._zero_time(o.startDate)):o.startDate=DPGlobal.parseDate(o.startDate,format,o.language,o.assumeNearbyYear):o.startDate=-1/0),o.endDate!==1/0&&(o.endDate?o.endDate instanceof Date?o.endDate=this._local_to_utc(this._zero_time(o.endDate)):o.endDate=DPGlobal.parseDate(o.endDate,format,o.language,o.assumeNearbyYear):o.endDate=1/0),o.daysOfWeekDisabled=this._resolveDaysOfWeek(o.daysOfWeekDisabled||[]),o.daysOfWeekHighlighted=this._resolveDaysOfWeek(o.daysOfWeekHighlighted||[]),o.datesDisabled=o.datesDisabled||[],$.isArray(o.datesDisabled)||(o.datesDisabled=o.datesDisabled.split(",")),o.datesDisabled=$.map(o.datesDisabled,(function(d){return DPGlobal.parseDate(d,format,o.language,o.assumeNearbyYear)}));var plc=String(o.orientation).toLowerCase().split(/\s+/g),_plc=o.orientation.toLowerCase();if(plc=$.grep(plc,(function(word){return/^auto|left|right|top|bottom$/.test(word)})),o.orientation={x:"auto",y:"auto"},_plc&&"auto"!==_plc)if(1===plc.length)switch(plc[0]){case"top":case"bottom":o.orientation.y=plc[0];break;case"left":case"right":o.orientation.x=plc[0]}else _plc=$.grep(plc,(function(word){return/^left|right$/.test(word)})),o.orientation.x=_plc[0]||"auto",_plc=$.grep(plc,(function(word){return/^top|bottom$/.test(word)})),o.orientation.y=_plc[0]||"auto";if(o.defaultViewDate instanceof Date||"string"==typeof o.defaultViewDate)o.defaultViewDate=DPGlobal.parseDate(o.defaultViewDate,format,o.language,o.assumeNearbyYear);else if(o.defaultViewDate){var year=o.defaultViewDate.year||(new Date).getFullYear(),month=o.defaultViewDate.month||0,day=o.defaultViewDate.day||1;o.defaultViewDate=UTCDate(year,month,day)}else o.defaultViewDate=UTCToday()},_applyEvents:function(evs){for(var el,ch,ev,i=0;iwindowWidth?(this.picker.addClass("datepicker2-orient-right"),left+=width-calendarWidth):this.o.rtl?this.picker.addClass("datepicker2-orient-right"):this.picker.addClass("datepicker2-orient-left");var yorient=this.o.orientation.y;if("auto"===yorient&&(yorient=-scrollTop+top-calendarHeight<0?"bottom":"top"),this.picker.addClass("datepicker2-orient-"+yorient),"top"===yorient?top-=calendarHeight+parseInt(this.picker.css("padding-top")):top+=height,this.o.rtl){var right=windowWidth-(left+width);this.picker.css({top:top,right:right,zIndex:zIndex})}else this.picker.css({top:top,left:left,zIndex:zIndex});return this},_allow_update:!0,update:function(){if(!this._allow_update)return this;var oldDates=this.dates.copy(),dates=[],fromArgs=!1;return arguments.length?($.each(arguments,$.proxy((function(i,date){date instanceof Date&&(date=this._local_to_utc(date)),dates.push(date)}),this)),fromArgs=!0):(dates=(dates=this.isInput?this.element.val():this.element.data("date")||this.inputField.val())&&this.o.multidate?dates.split(this.o.multidateSeparator):[dates],delete this.element.data().date),dates=$.map(dates,$.proxy((function(date){return DPGlobal.parseDate(date,this.o.format,this.o.language,this.o.assumeNearbyYear)}),this)),dates=$.grep(dates,$.proxy((function(date){return!this.dateWithinRange(date)||!date}),this),!0),this.dates.replace(dates),this.o.updateViewDate&&(this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDatethis.o.endDate?this.viewDate=new Date(this.o.endDate):this.viewDate=this.o.defaultViewDate),fromArgs?(this.setValue(),this.element.change()):this.dates.length&&String(oldDates)!==String(this.dates)&&fromArgs&&(this._trigger("changeDate"),this.element.change()),!this.dates.length&&oldDates.length&&(this._trigger("clearDate"),this.element.change()),this.fill(),this},fillDow:function(){if(this.o.showWeekDays){var dowCnt=this.o.weekStart,html="";for(this.o.calendarWeeks&&(html+=' ');dowCnt";html+="",this.picker.find(".datepicker2-days thead").append(html)}},fillMonths:function(){for(var localDate=this._utc_to_local(this.viewDate),html="",i=0;i<12;i++)html+=''+dates[this.o.language].monthsShort[i]+"";this.picker.find(".datepicker2-months td").html(html)},setRange:function(range){range&&range.length?this.range=$.map(range,(function(d){return d.valueOf()})):delete this.range,this.fill()},getClassNames:function(date){var cls=[],year=this.viewDate.getUTCFullYear(),month=this.viewDate.getUTCMonth(),today=UTCToday();return date.getUTCFullYear()year||date.getUTCFullYear()===year&&date.getUTCMonth()>month)&&cls.push("new"),this.focusDate&&date.valueOf()===this.focusDate.valueOf()&&cls.push("focused"),this.o.todayHighlight&&isUTCEquals(date,today)&&cls.push("today"),-1!==this.dates.contains(date)&&cls.push("active"),this.dateWithinRange(date)||cls.push("disabled"),this.dateIsDisabled(date)&&cls.push("disabled","disabled-date"),-1!==$.inArray(date.getUTCDay(),this.o.daysOfWeekHighlighted)&&cls.push("highlighted"),this.range&&(date>this.range[0]&&dateendYear)&&classes.push("disabled"),currVal===focusedVal&&classes.push("focused"),beforeFn!==$.noop&&((before=beforeFn(new Date(currVal,0,1)))===undefined$1?before={}:"boolean"==typeof before?before={enabled:before}:"string"==typeof before&&(before={classes:before}),!1===before.enabled&&classes.push("disabled"),before.classes&&(classes=classes.concat(before.classes.split(/\s+/))),before.tooltip&&(tooltip=before.tooltip)),html+='"+currVal+"";view.find(".datepicker2-switch").text(startVal+"-"+endVal),view.find("td").html(html)},fill:function(){var tooltip,before,d=new Date(this.viewDate),year=d.getUTCFullYear(),month=d.getUTCMonth(),startYear=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,startMonth=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,endYear=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,endMonth=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,todaytxt=dates[this.o.language].today||dates.en.today||"",cleartxt=dates[this.o.language].clear||dates.en.clear||"",titleFormat=dates[this.o.language].titleFormat||dates.en.titleFormat,todayDate=UTCToday(),titleBtnVisible=(!0===this.o.todayBtn||"linked"===this.o.todayBtn)&&todayDate>=this.o.startDate&&todayDate<=this.o.endDate&&!this.weekOfDateIsDisabled(todayDate);if(!isNaN(year)&&!isNaN(month)){this.picker.find(".datepicker2-days .datepicker2-switch").text(DPGlobal.formatDate(d,titleFormat,this.o.language)),this.picker.find("tfoot .today").text(todaytxt).css("display",titleBtnVisible?"table-cell":"none"),this.picker.find("tfoot .clear").text(cleartxt).css("display",!0===this.o.clearBtn?"table-cell":"none"),this.picker.find("thead .datepicker2-title").text(this.o.title).css("display","string"==typeof this.o.title&&""!==this.o.title?"table-cell":"none"),this.updateNavArrows(),this.fillMonths();var prevMonth=UTCDate(year,month,0),day=prevMonth.getUTCDate();prevMonth.setUTCDate(day-(prevMonth.getUTCDay()-this.o.weekStart+7)%7);var nextMonth=new Date(prevMonth);prevMonth.getUTCFullYear()<100&&nextMonth.setUTCFullYear(prevMonth.getUTCFullYear()),nextMonth.setUTCDate(nextMonth.getUTCDate()+42),nextMonth=nextMonth.valueOf();for(var weekDay,clsName,html=[];prevMonth.valueOf()"),this.o.calendarWeeks)){var ws=new Date(+prevMonth+(this.o.weekStart-weekDay-7)%7*864e5),th=new Date(Number(ws)+(11-ws.getUTCDay())%7*864e5),yth=new Date(Number(yth=UTCDate(th.getUTCFullYear(),0,1))+(11-yth.getUTCDay())%7*864e5),calWeek=(th-yth)/864e5/7+1;html.push(''+calWeek+"")}(clsName=this.getClassNames(prevMonth)).push("day");var content=prevMonth.getUTCDate();this.o.beforeShowDay!==$.noop&&((before=this.o.beforeShowDay(this._utc_to_local(prevMonth)))===undefined$1?before={}:"boolean"==typeof before?before={enabled:before}:"string"==typeof before&&(before={classes:before}),!1===before.enabled&&clsName.push("disabled"),before.classes&&(clsName=clsName.concat(before.classes.split(/\s+/))),before.tooltip&&(tooltip=before.tooltip),before.content&&(content=before.content)),clsName=$.isFunction($.uniqueSort)?$.uniqueSort(clsName):$.unique(clsName),html.push(''+content+""),tooltip=null,weekDay===this.o.weekEnd&&html.push(""),prevMonth.setUTCDate(prevMonth.getUTCDate()+1)}this.picker.find(".datepicker2-days tbody").html(html.join(""));var monthsTitle=dates[this.o.language].monthsTitle||dates.en.monthsTitle||"Months",months=this.picker.find(".datepicker2-months").find(".datepicker2-switch").text(this.o.maxViewMode<2?monthsTitle:year).end().find("tbody span").removeClass("active");if($.each(this.dates,(function(i,d){d.getUTCFullYear()===year&&months.eq(d.getUTCMonth()).addClass("active")})),(yearendYear)&&months.addClass("disabled"),year===startYear&&months.slice(0,startMonth).addClass("disabled"),year===endYear&&months.slice(endMonth+1).addClass("disabled"),this.o.beforeShowMonth!==$.noop){var that=this;$.each(months,(function(i,month){var moDate=new Date(year,i,1),before=that.o.beforeShowMonth(moDate);before===undefined$1?before={}:"boolean"==typeof before?before={enabled:before}:"string"==typeof before&&(before={classes:before}),!1!==before.enabled||$(month).hasClass("disabled")||$(month).addClass("disabled"),before.classes&&$(month).addClass(before.classes),before.tooltip&&$(month).prop("title",before.tooltip)}))}this._fill_yearsView(".datepicker2-years","year",10,year,startYear,endYear,this.o.beforeShowYear),this._fill_yearsView(".datepicker2-decades","decade",100,year,startYear,endYear,this.o.beforeShowDecade),this._fill_yearsView(".datepicker2-centuries","century",1e3,year,startYear,endYear,this.o.beforeShowCentury)}},updateNavArrows:function(){if(this._allow_update){var prevIsDisabled,nextIsDisabled,d=new Date(this.viewDate),year=d.getUTCFullYear(),month=d.getUTCMonth(),startYear=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,startMonth=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,endYear=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,endMonth=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,factor=1;switch(this.viewMode){case 4:factor*=10;case 3:factor*=10;case 2:factor*=10;case 1:prevIsDisabled=Math.floor(year/factor)*factor<=startYear,nextIsDisabled=Math.floor(year/factor)*factor+factor>endYear;break;case 0:prevIsDisabled=year<=startYear&&month<=startMonth,nextIsDisabled=year>=endYear&&month>=endMonth}this.picker.find(".prev").toggleClass("disabled",prevIsDisabled),this.picker.find(".next").toggleClass("disabled",nextIsDisabled)}},click:function(e){var target,year,month;e.preventDefault(),e.stopPropagation(),(target=$(e.target)).hasClass("datepicker2-switch")&&this.viewMode!==this.o.maxViewMode&&this.setViewMode(this.viewMode+1),target.hasClass("today")&&!target.hasClass("day")&&(this.setViewMode(0),this._setDate(UTCToday(),"linked"===this.o.todayBtn?null:"view")),target.hasClass("clear")&&this.clearDates(),target.hasClass("disabled")||(target.hasClass("month")||target.hasClass("year")||target.hasClass("decade")||target.hasClass("century"))&&(this.viewDate.setUTCDate(1),1===this.viewMode?(month=target.parent().find("span").index(target),year=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(month)):(month=0,year=Number(target.text()),this.viewDate.setUTCFullYear(year)),this._trigger(DPGlobal.viewModes[this.viewMode-1].e,this.viewDate),this.viewMode===this.o.minViewMode?this._setDate(UTCDate(year,month,1)):(this.setViewMode(this.viewMode-1),this.fill())),this.picker.is(":visible")&&this._focused_from&&this._focused_from.focus(),delete this._focused_from},dayCellClick:function(e){var timestamp=$(e.currentTarget).data("date"),date=new Date(timestamp);this.o.updateViewDate&&(date.getUTCFullYear()!==this.viewDate.getUTCFullYear()&&this._trigger("changeYear",this.viewDate),date.getUTCMonth()!==this.viewDate.getUTCMonth()&&this._trigger("changeMonth",this.viewDate)),this._setDate(date)},navArrowsClick:function(e){var dir=$(e.currentTarget).hasClass("prev")?-1:1;0!==this.viewMode&&(dir*=12*DPGlobal.viewModes[this.viewMode].navStep),this.viewDate=this.moveMonth(this.viewDate,dir),this._trigger(DPGlobal.viewModes[this.viewMode].e,this.viewDate),this.fill()},_toggle_multidate:function(date){var ix=this.dates.contains(date);if(date||this.dates.clear(),-1!==ix?(!0===this.o.multidate||this.o.multidate>1||this.o.toggleActive)&&this.dates.remove(ix):!1===this.o.multidate?(this.dates.clear(),this.dates.push(date)):this.dates.push(date),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},_setDate:function(date,which){which&&"date"!==which||this._toggle_multidate(date&&new Date(date)),(!which&&this.o.updateViewDate||"view"===which)&&(this.viewDate=date&&new Date(date)),this.fill(),this.setValue(),which&&"view"===which||this._trigger("changeDate"),this.inputField.trigger("change"),!this.o.autoclose||which&&"date"!==which||this.hide()},moveDay:function(date,dir){var newDate=new Date(date);return newDate.setUTCDate(date.getUTCDate()+dir),newDate},moveWeek:function(date,dir){return this.moveDay(date,7*dir)},moveMonth:function(date,dir){if(!(d=date)||isNaN(d.getTime()))return this.o.defaultViewDate;var d;if(!dir)return date;var new_month,test,new_date=new Date(date.valueOf()),day=new_date.getUTCDate(),month=new_date.getUTCMonth(),mag=Math.abs(dir);if(dir=dir>0?1:-1,1===mag)test=-1===dir?function(){return new_date.getUTCMonth()===month}:function(){return new_date.getUTCMonth()!==new_month},new_month=month+dir,new_date.setUTCMonth(new_month),new_month=(new_month+12)%12;else{for(var i=0;i0},dateWithinRange:function(date){return date>=this.o.startDate&&date<=this.o.endDate},keydown:function(e){if(this.picker.is(":visible")){var dir,newViewDate,dateChanged=!1,focusDate=this.focusDate||this.viewDate;switch(e.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),e.preventDefault(),e.stopPropagation();break;case 37:case 38:case 39:case 40:if(!this.o.keyboardNavigation||7===this.o.daysOfWeekDisabled.length)break;dir=37===e.keyCode||38===e.keyCode?-1:1,0===this.viewMode?e.ctrlKey?(newViewDate=this.moveAvailableDate(focusDate,dir,"moveYear"))&&this._trigger("changeYear",this.viewDate):e.shiftKey?(newViewDate=this.moveAvailableDate(focusDate,dir,"moveMonth"))&&this._trigger("changeMonth",this.viewDate):37===e.keyCode||39===e.keyCode?newViewDate=this.moveAvailableDate(focusDate,dir,"moveDay"):this.weekOfDateIsDisabled(focusDate)||(newViewDate=this.moveAvailableDate(focusDate,dir,"moveWeek")):1===this.viewMode?(38!==e.keyCode&&40!==e.keyCode||(dir*=4),newViewDate=this.moveAvailableDate(focusDate,dir,"moveMonth")):2===this.viewMode&&(38!==e.keyCode&&40!==e.keyCode||(dir*=4),newViewDate=this.moveAvailableDate(focusDate,dir,"moveYear")),newViewDate&&(this.focusDate=this.viewDate=newViewDate,this.setValue(),this.fill(),e.preventDefault());break;case 13:if(!this.o.forceParse)break;focusDate=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&&(this._toggle_multidate(focusDate),dateChanged=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(e.preventDefault(),e.stopPropagation(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}dateChanged&&(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.inputField.trigger("change"))}else 40!==e.keyCode&&27!==e.keyCode||(this.show(),e.stopPropagation())},setViewMode:function(viewMode){this.viewMode=viewMode,this.picker.children("div").hide().filter(".datepicker2-"+DPGlobal.viewModes[this.viewMode].clsName).show(),this.updateNavArrows(),this._trigger("changeViewMode",new Date(this.viewDate))}};var DateRangePicker=function(element,options){$.data(element,"datepicker2",this),this.element=$(element),this.inputs=$.map(options.inputs,(function(i){return i.jquery?i[0]:i})),delete options.inputs,this.keepEmptyValues=options.keepEmptyValues,delete options.keepEmptyValues,datepicker2Plugin.call($(this.inputs),options).on("changeDate",$.proxy(this.dateUpdated,this)),this.pickers=$.map(this.inputs,(function(i){return $.data(i,"datepicker2")})),this.updateDates()};function opts_from_el(el,prefix){var data=$(el).data(),out={},replace=new RegExp("^"+prefix.toLowerCase()+"([A-Z])");function re_lower(_,a){return a.toLowerCase()}for(var key in prefix=new RegExp("^"+prefix.toLowerCase()),data)prefix.test(key)&&(out[key.replace(replace,re_lower)]=data[key]);return out}function opts_from_locale(lang){var out={};if(dates[lang]||(lang=lang.split("-")[0],dates[lang])){var d=dates[lang];return $.each(locale_opts,(function(i,k){k in d&&(out[k]=d[k])})),out}}DateRangePicker.prototype={updateDates:function(){this.dates=$.map(this.pickers,(function(i){return i.getUTCDate()})),this.updateRanges()},updateRanges:function(){var range=$.map(this.dates,(function(d){return d.valueOf()}));$.each(this.pickers,(function(i,p){p.setRange(range)}))},clearDates:function(){$.each(this.pickers,(function(i,p){p.clearDates()}))},dateUpdated:function(e){if(!this.updating){this.updating=!0;var dp=$.data(e.target,"datepicker2");if(dp!==undefined$1){var new_date=dp.getUTCDate(),keep_empty_values=this.keepEmptyValues,i=$.inArray(e.target,this.inputs),j=i-1,k=i+1,l=this.inputs.length;if(-1!==i){if($.each(this.pickers,(function(i,p){p.getUTCDate()||p!==dp&&keep_empty_values||p.setUTCDate(new_date)})),new_date=0&&new_datethis.dates[k])for(;kthis.dates[k];)this.pickers[k++].setUTCDate(new_date);this.updateDates(),delete this.updating}}}},destroy:function(){$.map(this.pickers,(function(p){p.destroy()})),$(this.inputs).off("changeDate",this.dateUpdated),delete this.element.data().datepicker2},remove:alias("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead")};var old=$.fn.datepicker2,datepicker2Plugin=function(option){var internal_return,args=Array.apply(null,arguments);if(args.shift(),this.each((function(){var $this=$(this),data=$this.data("datepicker2"),options="object"==typeof option&&option;if(!data){var elopts=opts_from_el(this,"date"),locopts=opts_from_locale($.extend({},defaults,elopts,options).language),opts=$.extend({},defaults,locopts,elopts,options);$this.hasClass("input-daterange")||opts.inputs?($.extend(opts,{inputs:opts.inputs||$this.find("input").toArray()}),data=new DateRangePicker(this,opts)):data=new Datepicker2(this,opts),$this.data("datepicker2",data)}"string"==typeof option&&"function"==typeof data[option]&&(internal_return=data[option].apply(data,args))})),internal_return===undefined$1||internal_return instanceof Datepicker2||internal_return instanceof DateRangePicker)return this;if(this.length>1)throw new Error("Using only allowed for the collection of a single element ("+option+" function)");return internal_return};$.fn.datepicker2=datepicker2Plugin;var defaults=$.fn.datepicker2.defaults={assumeNearbyYear:!1,autoclose:!1,beforeShowDay:$.noop,beforeShowMonth:$.noop,beforeShowYear:$.noop,beforeShowDecade:$.noop,beforeShowCentury:$.noop,calendarWeeks:!1,clearBtn:!1,toggleActive:!1,daysOfWeekDisabled:[],daysOfWeekHighlighted:[],datesDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keepEmptyValues:!1,keyboardNavigation:!0,language:"en",minViewMode:0,maxViewMode:4,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-1/0,startView:0,todayBtn:!1,todayHighlight:!1,updateViewDate:!0,weekStart:0,disableTouchKeyboard:!1,enableOnReadonly:!0,showOnFocus:!0,zIndexOffset:10,container:"body",immediateUpdates:!1,title:"",templates:{leftArrow:"«",rightArrow:"»"},showWeekDays:!0},locale_opts=$.fn.datepicker2.locale_opts=["format","rtl","weekStart"];$.fn.datepicker2.Constructor=Datepicker2;var dates=$.fn.datepicker2.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM yyyy"}},DPGlobal={viewModes:[{names:["days","month"],clsName:"days",e:"changeMonth"},{names:["months","year"],clsName:"months",e:"changeYear",navStep:1},{names:["years","decade"],clsName:"years",e:"changeDecade",navStep:10},{names:["decades","century"],clsName:"decades",e:"changeCentury",navStep:100},{names:["centuries","millennium"],clsName:"centuries",e:"changeMillennium",navStep:1e3}],validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,parseFormat:function(format){if("function"==typeof format.toValue&&"function"==typeof format.toDisplay)return format;var separators=format.replace(this.validParts,"\0").split("\0"),parts=format.match(this.validParts);if(!separators||!separators.length||!parts||0===parts.length)throw new Error("Invalid date format.");return{separators:separators,parts:parts}},parseDate:function(date,format,language,assumeNearby){if(!date)return undefined$1;if(date instanceof Date)return date;if("string"==typeof format&&(format=DPGlobal.parseFormat(format)),format.toValue)return format.toValue(date,format,language);var parts,part,dir,i,fn,fn_map={d:"moveDay",m:"moveMonth",w:"moveWeek",y:"moveYear"},dateAliases={yesterday:"-1d",today:"+0d",tomorrow:"+1d"};if(date in dateAliases&&(date=dateAliases[date]),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/i.test(date)){for(parts=date.match(/([\-+]\d+)([dmwy])/gi),date=new Date,i=0;i(new Date).getFullYear()+threshold&&(year-=100),year):v);var year,threshold},m:function(d,v){if(isNaN(d))return d;for(v-=1;v<0;)v+=12;for(v%=12,d.setUTCMonth(v);d.getUTCMonth()!==v;)d.setUTCDate(d.getUTCDate()-1);return d},d:function(d,v){return d.setUTCDate(v)}};setters_map.yy=setters_map.yyyy,setters_map.M=setters_map.MM=setters_map.mm=setters_map.m,setters_map.dd=setters_map.d,date=UTCToday();var fparts=format.parts.slice();function match_part(){var m=this.slice(0,parts[i].length),p=parts[i].slice(0,m.length);return m.toLowerCase()===p.toLowerCase()}if(parts.length!==fparts.length&&(fparts=$(fparts).filter((function(i,p){return-1!==$.inArray(p,setters_order)})).toArray()),parts.length===fparts.length){var cnt,_date,s;for(i=0,cnt=fparts.length;i'+defaults.templates.leftArrow+''+defaults.templates.rightArrow+"",contTemplate:'',footTemplate:''};DPGlobal.template='
'+DPGlobal.headTemplate+""+DPGlobal.footTemplate+'
'+DPGlobal.headTemplate+DPGlobal.contTemplate+DPGlobal.footTemplate+'
'+DPGlobal.headTemplate+DPGlobal.contTemplate+DPGlobal.footTemplate+'
'+DPGlobal.headTemplate+DPGlobal.contTemplate+DPGlobal.footTemplate+'
'+DPGlobal.headTemplate+DPGlobal.contTemplate+DPGlobal.footTemplate+"
",$.fn.datepicker2.DPGlobal=DPGlobal,$.fn.datepicker2.noConflict=function(){return $.fn.datepicker2=old,this},$.fn.datepicker2.version="1.9.0",$.fn.datepicker2.deprecated=function(msg){var console=window.console;console&&console.warn&&console.warn("DEPRECATED: "+msg)},$(document).on("focus.datepicker2.data-api click.datepicker2.data-api",'[data-provide="datepicker2"]',(function(e){var $this=$(this);$this.data("datepicker2")||(e.preventDefault(),datepicker2Plugin.call($this,"show"))})),$((function(){datepicker2Plugin.call($('[data-provide="datepicker2-inline"]'))}))},"function"==typeof define&&define.amd?define("block_dash/datepicker",["jquery"],factory):"object"==typeof exports?factory(require("jquery")):factory(jQuery); + +//# sourceMappingURL=datepicker.min.js.map \ No newline at end of file diff --git a/amd/build/datepicker.min.js.map b/amd/build/datepicker.min.js.map index 2916d8a..4abbbe1 100644 --- a/amd/build/datepicker.min.js.map +++ b/amd/build/datepicker.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/datepicker.js"],"names":["factory","define","amd","exports","require","jQuery","$","UTCDate","Date","UTC","apply","arguments","UTCToday","today","getFullYear","getMonth","getDate","isUTCEquals","date1","date2","getUTCFullYear","getUTCMonth","getUTCDate","alias","method","deprecationMsg","fn","datepicker2","deprecated","isValidDate","d","isNaN","getTime","DateArray","extras","get","i","slice","contains","val","valueOf","l","length","remove","splice","replace","new_array","isArray","clear","push","copy","a","extend","Datepicker2","element","options","data","_events","_secondaryEvents","_process_options","dates","viewDate","o","defaultViewDate","focusDate","isInput","is","inputField","find","component","hasClass","isInline","picker","DPGlobal","template","_check_template","templates","leftArrow","html","rightArrow","_buildEvents","_attachEvents","addClass","appendTo","rtl","calendarWeeks","attr","startDate","_o","endDate","daysOfWeekDisabled","daysOfWeekHighlighted","datesDisabled","_allow_update","setViewMode","startView","fillDow","fillMonths","update","show","prototype","constructor","_resolveViewName","view","each","viewModes","viewMode","inArray","names","_resolveDaysOfWeek","daysOfWeek","split","map","Number","tmp","match","jDom","ex","opts","lang","language","defaults","minViewMode","maxViewMode","Math","max","min","multidate","multidateSeparator","weekStart","weekEnd","format","parseFormat","Infinity","_local_to_utc","_zero_time","parseDate","assumeNearbyYear","plc","orientation","toLowerCase","_plc","grep","word","test","x","y","year","month","day","_applyEvents","evs","el","ch","ev","on","_unapplyEvents","off","events","keyup","proxy","e","keyCode","keydown","paste","showOnFocus","focus","click","blur","_focused_from","target","immediateUpdates","date","navArrowsClick","dayCellClick","window","resize","place","document","hide","_detachEvents","_attachSecondaryEvents","_detachSecondaryEvents","_trigger","event","altdate","local_date","_utc_to_local","trigger","type","ix","formatDate","prop","enableOnReadonly","container","navigator","msMaxTouchPoints","disableTouchKeyboard","detach","forceParse","setValue","destroy","dateString","originalEvent","clipboardData","types","getData","setDate","preventDefault","utc","local","getTimezoneOffset","_zero_utc_time","getDates","getUTCDates","selected_date","clearDates","autoclose","setDates","args","setUTCDates","setUTCDate","formatted","getFormattedDate","join","getStartDate","setStartDate","updateNavArrows","getEndDate","setEndDate","setDaysOfWeekDisabled","setDaysOfWeekHighlighted","setDatesDisabled","calendarWidth","outerWidth","calendarHeight","outerHeight","windowWidth","width","scrollTop","appendOffset","offset","parentsZindex","parents","itemZIndex","css","zIndex","zIndexOffset","parent","height","left","top","removeClass","yorient","top_overflow","parseInt","right","oldDates","fromArgs","dateWithinRange","updateViewDate","change","fill","showWeekDays","dowCnt","daysMin","append","localDate","focused","monthsShort","setRange","range","getClassNames","cls","todayHighlight","dateIsDisabled","getUTCDay","_fill_yearsView","selector","cssClass","factor","startYear","endYear","beforeFn","step","startVal","floor","endVal","focusedVal","selected","classes","tooltip","before","currVal","noop","enabled","concat","text","startMonth","endMonth","todaytxt","cleartxt","titleFormat","todayDate","titleBtnVisible","todayBtn","weekOfDateIsDisabled","clearBtn","title","prevMonth","nextMonth","setUTCFullYear","weekDay","clsName","ws","th","yth","calWeek","content","beforeShowDay","isFunction","uniqueSort","unique","toString","monthsTitle","months","end","eq","beforeShowMonth","that","moDate","beforeShowYear","beforeShowDecade","beforeShowCentury","prevIsDisabled","nextIsDisabled","toggleClass","stopPropagation","_setDate","index","setUTCMonth","$target","currentTarget","timestamp","dir","navStep","moveMonth","_toggle_multidate","toggleActive","which","moveDay","newDate","moveWeek","new_date","mag","abs","new_month","moveYear","moveAvailableDate","dateChanged","newViewDate","keyboardNavigation","ctrlKey","shiftKey","children","filter","DateRangePicker","inputs","jquery","keepEmptyValues","datepicker2Plugin","call","dateUpdated","pickers","updateDates","updateRanges","p","updating","dp","keep_empty_values","j","k","opts_from_el","prefix","out","inkey","RegExp","re_lower","_","key","opts_from_locale","locale_opts","old","option","Array","shift","internal_return","$this","elopts","xopts","locopts","toArray","Error","Constructor","en","days","daysShort","validParts","nonpunctuation","toValue","toDisplay","separators","parts","assumeNearby","fn_map","m","w","dateAliases","yesterday","tomorrow","part","applyNearbyYear","threshold","parsed","setters_order","setters_map","yyyy","v","filtered","fparts","match_part","cnt","_date","s","D","DD","M","MM","yy","substring","dd","mm","seps","headTemplate","contTemplate","footTemplate","noConflict","version","msg","console","warn"],"mappings":"mSAMC,UAASA,CAAT,CAAiB,CACd,GAAsB,UAAlB,QAAOC,CAAAA,MAAP,EAAgCA,MAAM,CAACC,GAA3C,CAAgD,CAC5CD,OAAM,yBAAC,CAAC,QAAD,CAAD,CAAaD,CAAb,CACT,CAFD,IAEO,IAAuB,QAAnB,uBAAOG,CAAAA,OAAP,qBAAOA,OAAP,EAAJ,CAAiC,CACpCH,CAAO,CAACI,OAAO,CAAC,QAAD,CAAR,CACV,CAFM,IAEA,CACHJ,CAAO,CAACK,MAAD,CACV,CACJ,CARA,EAQC,SAASC,CAAT,CAAsB,CACpB,QAASC,CAAAA,CAAT,EAAkB,CACd,MAAO,IAAIC,CAAAA,IAAJ,CAASA,IAAI,CAACC,GAAL,CAASC,KAAT,CAAeF,IAAf,CAAqBG,SAArB,CAAT,CACV,CACD,QAASC,CAAAA,CAAT,EAAmB,CACf,GAAIC,CAAAA,CAAK,CAAG,GAAIL,CAAAA,IAAhB,CACA,MAAOD,CAAAA,CAAO,CAACM,CAAK,CAACC,WAAN,EAAD,CAAsBD,CAAK,CAACE,QAAN,EAAtB,CAAwCF,CAAK,CAACG,OAAN,EAAxC,CACjB,CACD,QAASC,CAAAA,CAAT,CAAqBC,CAArB,CAA4BC,CAA5B,CAAmC,CAC/B,MACID,CAAAA,CAAK,CAACE,cAAN,KAA2BD,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JyG,CAAC,CAAC+C,cAAF,GAEAkK,CAAiB,CAACC,IAAlB,CAAuB0B,CAAvB,CAA8B,MAA9B,CACH,CAVL,EAYAvY,CAAC,CAAC,UAAU,CACR4W,CAAiB,CAACC,IAAlB,CAAuB7W,CAAC,CAAC,uCAAD,CAAxB,CACH,CAFA,CAIJ,CAh/DA,CAAD","sourcesContent":["/*!\n * Datepicker2 for Bootstrap v1.9.0 (https://github.com/uxsolutions/bootstrap-datepicker2)\n *\n * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n */\n\n(function(factory){\n if (typeof define === 'function' && define.amd) {\n define(['jquery'], factory);\n } else if (typeof exports === 'object') {\n factory(require('jquery'));\n } else {\n factory(jQuery);\n }\n}(function($, undefined){\n function UTCDate(){\n return new Date(Date.UTC.apply(Date, arguments));\n }\n function UTCToday(){\n var today = new Date();\n return UTCDate(today.getFullYear(), today.getMonth(), today.getDate());\n }\n function isUTCEquals(date1, date2) {\n return (\n date1.getUTCFullYear() === date2.getUTCFullYear() &&\n date1.getUTCMonth() === date2.getUTCMonth() &&\n date1.getUTCDate() === date2.getUTCDate()\n );\n }\n function alias(method, deprecationMsg){\n return function(){\n if (deprecationMsg !== undefined) {\n $.fn.datepicker2.deprecated(deprecationMsg);\n }\n\n return this[method].apply(this, arguments);\n };\n }\n function isValidDate(d) {\n return d && !isNaN(d.getTime());\n }\n\n var DateArray = (function(){\n var extras = {\n get: function(i){\n return this.slice(i)[0];\n },\n contains: function(d){\n // Array.indexOf is not cross-browser;\n // $.inArray doesn't work with Dates\n var val = d && d.valueOf();\n for (var i=0, l=this.length; i < l; i++)\n // Use date arithmetic to allow dates with different times to match\n if (0 <= this[i].valueOf() - val && this[i].valueOf() - val < 1000*60*60*24)\n return i;\n return -1;\n },\n remove: function(i){\n this.splice(i,1);\n },\n replace: function(new_array){\n if (!new_array)\n return;\n if (!$.isArray(new_array))\n new_array = [new_array];\n this.clear();\n this.push.apply(this, new_array);\n },\n clear: function(){\n this.length = 0;\n },\n copy: function(){\n var a = new DateArray();\n a.replace(this);\n return a;\n }\n };\n\n return function(){\n var a = [];\n a.push.apply(a, arguments);\n $.extend(a, extras);\n return a;\n };\n })();\n\n\n // Picker object\n\n var Datepicker2 = function(element, options){\n $.data(element, 'datepicker2', this);\n\n this._events = [];\n this._secondaryEvents = [];\n\n this._process_options(options);\n\n this.dates = new DateArray();\n this.viewDate = this.o.defaultViewDate;\n this.focusDate = null;\n\n this.element = $(element);\n this.isInput = this.element.is('input');\n this.inputField = this.isInput ? this.element : this.element.find('input');\n this.component = this.element.hasClass('date') ? this.element.find('.add-on, .input-group-addon, .input-group-append, .input-group-prepend, .btn') : false;\n if (this.component && this.component.length === 0)\n this.component = false;\n this.isInline = !this.component && this.element.is('div');\n\n this.picker = $(DPGlobal.template);\n\n // Checking templates and inserting\n if (this._check_template(this.o.templates.leftArrow)) {\n this.picker.find('.prev').html(this.o.templates.leftArrow);\n }\n\n if (this._check_template(this.o.templates.rightArrow)) {\n this.picker.find('.next').html(this.o.templates.rightArrow);\n }\n\n this._buildEvents();\n this._attachEvents();\n\n if (this.isInline){\n this.picker.addClass('datepicker2-inline').appendTo(this.element);\n }\n else {\n this.picker.addClass('datepicker2-dropdown dropdown-menu');\n }\n\n if (this.o.rtl){\n this.picker.addClass('datepicker2-rtl');\n }\n\n if (this.o.calendarWeeks) {\n this.picker.find('.datepicker2-days .datepicker2-switch, thead .datepicker2-title, tfoot .today, tfoot .clear')\n .attr('colspan', function(i, val){\n return Number(val) + 1;\n });\n }\n\n this._process_options({\n startDate: this._o.startDate,\n endDate: this._o.endDate,\n daysOfWeekDisabled: this.o.daysOfWeekDisabled,\n daysOfWeekHighlighted: this.o.daysOfWeekHighlighted,\n datesDisabled: this.o.datesDisabled\n });\n\n this._allow_update = false;\n this.setViewMode(this.o.startView);\n this._allow_update = true;\n\n this.fillDow();\n this.fillMonths();\n\n this.update();\n\n if (this.isInline){\n this.show();\n }\n };\n\n Datepicker2.prototype = {\n constructor: Datepicker2,\n\n _resolveViewName: function(view){\n $.each(DPGlobal.viewModes, function(i, viewMode){\n if (view === i || $.inArray(view, viewMode.names) !== -1){\n view = i;\n return false;\n }\n });\n\n return view;\n },\n\n _resolveDaysOfWeek: function(daysOfWeek){\n if (!$.isArray(daysOfWeek))\n daysOfWeek = daysOfWeek.split(/[,\\s]*/);\n return $.map(daysOfWeek, Number);\n },\n\n _check_template: function(tmp){\n try {\n // If empty\n if (tmp === undefined || tmp === \"\") {\n return false;\n }\n // If no html, everything ok\n if ((tmp.match(/[<>]/g) || []).length <= 0) {\n return true;\n }\n // Checking if html is fine\n var jDom = $(tmp);\n return jDom.length > 0;\n }\n catch (ex) {\n return false;\n }\n },\n\n _process_options: function(opts){\n // Store raw options for reference\n this._o = $.extend({}, this._o, opts);\n // Processed options\n var o = this.o = $.extend({}, this._o);\n\n // Check if \"de-DE\" style date is available, if not language should\n // fallback to 2 letter code eg \"de\"\n var lang = o.language;\n if (!dates[lang]){\n lang = lang.split('-')[0];\n if (!dates[lang])\n lang = defaults.language;\n }\n o.language = lang;\n\n // Retrieve view index from any aliases\n o.startView = this._resolveViewName(o.startView);\n o.minViewMode = this._resolveViewName(o.minViewMode);\n o.maxViewMode = this._resolveViewName(o.maxViewMode);\n\n // Check view is between min and max\n o.startView = Math.max(this.o.minViewMode, Math.min(this.o.maxViewMode, o.startView));\n\n // true, false, or Number > 0\n if (o.multidate !== true){\n o.multidate = Number(o.multidate) || false;\n if (o.multidate !== false)\n o.multidate = Math.max(0, o.multidate);\n }\n o.multidateSeparator = String(o.multidateSeparator);\n\n o.weekStart %= 7;\n o.weekEnd = (o.weekStart + 6) % 7;\n\n var format = DPGlobal.parseFormat(o.format);\n if (o.startDate !== -Infinity){\n if (!!o.startDate){\n if (o.startDate instanceof Date)\n o.startDate = this._local_to_utc(this._zero_time(o.startDate));\n else\n o.startDate = DPGlobal.parseDate(o.startDate, format, o.language, o.assumeNearbyYear);\n }\n else {\n o.startDate = -Infinity;\n }\n }\n if (o.endDate !== Infinity){\n if (!!o.endDate){\n if (o.endDate instanceof Date)\n o.endDate = this._local_to_utc(this._zero_time(o.endDate));\n else\n o.endDate = DPGlobal.parseDate(o.endDate, format, o.language, o.assumeNearbyYear);\n }\n else {\n o.endDate = Infinity;\n }\n }\n\n o.daysOfWeekDisabled = this._resolveDaysOfWeek(o.daysOfWeekDisabled||[]);\n o.daysOfWeekHighlighted = this._resolveDaysOfWeek(o.daysOfWeekHighlighted||[]);\n\n o.datesDisabled = o.datesDisabled||[];\n if (!$.isArray(o.datesDisabled)) {\n o.datesDisabled = o.datesDisabled.split(',');\n }\n o.datesDisabled = $.map(o.datesDisabled, function(d){\n return DPGlobal.parseDate(d, format, o.language, o.assumeNearbyYear);\n });\n\n var plc = String(o.orientation).toLowerCase().split(/\\s+/g),\n _plc = o.orientation.toLowerCase();\n plc = $.grep(plc, function(word){\n return /^auto|left|right|top|bottom$/.test(word);\n });\n o.orientation = {x: 'auto', y: 'auto'};\n if (!_plc || _plc === 'auto')\n ; // no action\n else if (plc.length === 1){\n switch (plc[0]){\n case 'top':\n case 'bottom':\n o.orientation.y = plc[0];\n break;\n case 'left':\n case 'right':\n o.orientation.x = plc[0];\n break;\n }\n }\n else {\n _plc = $.grep(plc, function(word){\n return /^left|right$/.test(word);\n });\n o.orientation.x = _plc[0] || 'auto';\n\n _plc = $.grep(plc, function(word){\n return /^top|bottom$/.test(word);\n });\n o.orientation.y = _plc[0] || 'auto';\n }\n if (o.defaultViewDate instanceof Date || typeof o.defaultViewDate === 'string') {\n o.defaultViewDate = DPGlobal.parseDate(o.defaultViewDate, format, o.language, o.assumeNearbyYear);\n } else if (o.defaultViewDate) {\n var year = o.defaultViewDate.year || new Date().getFullYear();\n var month = o.defaultViewDate.month || 0;\n var day = o.defaultViewDate.day || 1;\n o.defaultViewDate = UTCDate(year, month, day);\n } else {\n o.defaultViewDate = UTCToday();\n }\n },\n _applyEvents: function(evs){\n for (var i=0, el, ch, ev; i < evs.length; i++){\n el = evs[i][0];\n if (evs[i].length === 2){\n ch = undefined;\n ev = evs[i][1];\n } else if (evs[i].length === 3){\n ch = evs[i][1];\n ev = evs[i][2];\n }\n el.on(ev, ch);\n }\n },\n _unapplyEvents: function(evs){\n for (var i=0, el, ev, ch; i < evs.length; i++){\n el = evs[i][0];\n if (evs[i].length === 2){\n ch = undefined;\n ev = evs[i][1];\n } else if (evs[i].length === 3){\n ch = evs[i][1];\n ev = evs[i][2];\n }\n el.off(ev, ch);\n }\n },\n _buildEvents: function(){\n var events = {\n keyup: $.proxy(function(e){\n if ($.inArray(e.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) === -1)\n this.update();\n }, this),\n keydown: $.proxy(this.keydown, this),\n paste: $.proxy(this.paste, this)\n };\n\n if (this.o.showOnFocus === true) {\n events.focus = $.proxy(this.show, this);\n }\n\n if (this.isInput) { // single input\n this._events = [\n [this.element, events]\n ];\n }\n // component: input + button\n else if (this.component && this.inputField.length) {\n this._events = [\n // For components that are not readonly, allow keyboard nav\n [this.inputField, events],\n [this.component, {\n click: $.proxy(this.show, this)\n }]\n ];\n }\n else {\n this._events = [\n [this.element, {\n click: $.proxy(this.show, this),\n keydown: $.proxy(this.keydown, this)\n }]\n ];\n }\n this._events.push(\n // Component: listen for blur on element descendants\n [this.element, '*', {\n blur: $.proxy(function(e){\n this._focused_from = e.target;\n }, this)\n }],\n // Input: listen for blur on element\n [this.element, {\n blur: $.proxy(function(e){\n this._focused_from = e.target;\n }, this)\n }]\n );\n\n if (this.o.immediateUpdates) {\n // Trigger input updates immediately on changed year/month\n this._events.push([this.element, {\n 'changeYear changeMonth': $.proxy(function(e){\n this.update(e.date);\n }, this)\n }]);\n }\n\n this._secondaryEvents = [\n [this.picker, {\n click: $.proxy(this.click, this)\n }],\n [this.picker, '.prev, .next', {\n click: $.proxy(this.navArrowsClick, this)\n }],\n [this.picker, '.day:not(.disabled)', {\n click: $.proxy(this.dayCellClick, this)\n }],\n [$(window), {\n resize: $.proxy(this.place, this)\n }],\n [$(document), {\n 'mousedown touchstart': $.proxy(function(e){\n // Clicked outside the datepicker2, hide it\n if (!(\n this.element.is(e.target) ||\n this.element.find(e.target).length ||\n this.picker.is(e.target) ||\n this.picker.find(e.target).length ||\n this.isInline\n )){\n this.hide();\n }\n }, this)\n }]\n ];\n },\n _attachEvents: function(){\n this._detachEvents();\n this._applyEvents(this._events);\n },\n _detachEvents: function(){\n this._unapplyEvents(this._events);\n },\n _attachSecondaryEvents: function(){\n this._detachSecondaryEvents();\n this._applyEvents(this._secondaryEvents);\n },\n _detachSecondaryEvents: function(){\n this._unapplyEvents(this._secondaryEvents);\n },\n _trigger: function(event, altdate){\n var date = altdate || this.dates.get(-1),\n local_date = this._utc_to_local(date);\n\n this.element.trigger({\n type: event,\n date: local_date,\n viewMode: this.viewMode,\n dates: $.map(this.dates, this._utc_to_local),\n format: $.proxy(function(ix, format){\n if (arguments.length === 0){\n ix = this.dates.length - 1;\n format = this.o.format;\n } else if (typeof ix === 'string'){\n format = ix;\n ix = this.dates.length - 1;\n }\n format = format || this.o.format;\n var date = this.dates.get(ix);\n return DPGlobal.formatDate(date, format, this.o.language);\n }, this)\n });\n },\n\n show: function(){\n if (this.inputField.is(':disabled') || (this.inputField.prop('readonly') && this.o.enableOnReadonly === false))\n return;\n if (!this.isInline)\n this.picker.appendTo(this.o.container);\n this.place();\n this.picker.show();\n this._attachSecondaryEvents();\n this._trigger('show');\n if ((window.navigator.msMaxTouchPoints || 'ontouchstart' in document) && this.o.disableTouchKeyboard) {\n $(this.element).blur();\n }\n return this;\n },\n\n hide: function(){\n if (this.isInline || !this.picker.is(':visible'))\n return this;\n this.focusDate = null;\n this.picker.hide().detach();\n this._detachSecondaryEvents();\n this.setViewMode(this.o.startView);\n\n if (this.o.forceParse && this.inputField.val())\n this.setValue();\n this._trigger('hide');\n return this;\n },\n\n destroy: function(){\n this.hide();\n this._detachEvents();\n this._detachSecondaryEvents();\n this.picker.remove();\n delete this.element.data().datepicker2;\n if (!this.isInput){\n delete this.element.data().date;\n }\n return this;\n },\n\n paste: function(e){\n var dateString;\n if (e.originalEvent.clipboardData && e.originalEvent.clipboardData.types\n && $.inArray('text/plain', e.originalEvent.clipboardData.types) !== -1) {\n dateString = e.originalEvent.clipboardData.getData('text/plain');\n } else if (window.clipboardData) {\n dateString = window.clipboardData.getData('Text');\n } else {\n return;\n }\n this.setDate(dateString);\n this.update();\n e.preventDefault();\n },\n\n _utc_to_local: function(utc){\n if (!utc) {\n return utc;\n }\n\n var local = new Date(utc.getTime() + (utc.getTimezoneOffset() * 60000));\n\n if (local.getTimezoneOffset() !== utc.getTimezoneOffset()) {\n local = new Date(utc.getTime() + (local.getTimezoneOffset() * 60000));\n }\n\n return local;\n },\n _local_to_utc: function(local){\n return local && new Date(local.getTime() - (local.getTimezoneOffset()*60000));\n },\n _zero_time: function(local){\n return local && new Date(local.getFullYear(), local.getMonth(), local.getDate());\n },\n _zero_utc_time: function(utc){\n return utc && UTCDate(utc.getUTCFullYear(), utc.getUTCMonth(), utc.getUTCDate());\n },\n\n getDates: function(){\n return $.map(this.dates, this._utc_to_local);\n },\n\n getUTCDates: function(){\n return $.map(this.dates, function(d){\n return new Date(d);\n });\n },\n\n getDate: function(){\n return this._utc_to_local(this.getUTCDate());\n },\n\n getUTCDate: function(){\n var selected_date = this.dates.get(-1);\n if (selected_date !== undefined) {\n return new Date(selected_date);\n } else {\n return null;\n }\n },\n\n clearDates: function(){\n this.inputField.val('');\n this.update();\n this._trigger('changeDate');\n\n if (this.o.autoclose) {\n this.hide();\n }\n },\n\n setDates: function(){\n var args = $.isArray(arguments[0]) ? arguments[0] : arguments;\n this.update.apply(this, args);\n this._trigger('changeDate');\n this.setValue();\n return this;\n },\n\n setUTCDates: function(){\n var args = $.isArray(arguments[0]) ? arguments[0] : arguments;\n this.setDates.apply(this, $.map(args, this._utc_to_local));\n return this;\n },\n\n setDate: alias('setDates'),\n setUTCDate: alias('setUTCDates'),\n remove: alias('destroy', 'Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead'),\n\n setValue: function(){\n var formatted = this.getFormattedDate();\n this.inputField.val(formatted);\n return this;\n },\n\n getFormattedDate: function(format){\n if (format === undefined)\n format = this.o.format;\n\n var lang = this.o.language;\n return $.map(this.dates, function(d){\n return DPGlobal.formatDate(d, format, lang);\n }).join(this.o.multidateSeparator);\n },\n\n getStartDate: function(){\n return this.o.startDate;\n },\n\n setStartDate: function(startDate){\n this._process_options({startDate: startDate});\n this.update();\n this.updateNavArrows();\n return this;\n },\n\n getEndDate: function(){\n return this.o.endDate;\n },\n\n setEndDate: function(endDate){\n this._process_options({endDate: endDate});\n this.update();\n this.updateNavArrows();\n return this;\n },\n\n setDaysOfWeekDisabled: function(daysOfWeekDisabled){\n this._process_options({daysOfWeekDisabled: daysOfWeekDisabled});\n this.update();\n return this;\n },\n\n setDaysOfWeekHighlighted: function(daysOfWeekHighlighted){\n this._process_options({daysOfWeekHighlighted: daysOfWeekHighlighted});\n this.update();\n return this;\n },\n\n setDatesDisabled: function(datesDisabled){\n this._process_options({datesDisabled: datesDisabled});\n this.update();\n return this;\n },\n\n place: function(){\n if (this.isInline)\n return this;\n var calendarWidth = this.picker.outerWidth(),\n calendarHeight = this.picker.outerHeight(),\n visualPadding = 10,\n container = $(this.o.container),\n windowWidth = container.width(),\n scrollTop = this.o.container === 'body' ? $(document).scrollTop() : container.scrollTop(),\n appendOffset = container.offset();\n\n var parentsZindex = [0];\n this.element.parents().each(function(){\n var itemZIndex = $(this).css('z-index');\n if (itemZIndex !== 'auto' && Number(itemZIndex) !== 0) parentsZindex.push(Number(itemZIndex));\n });\n var zIndex = Math.max.apply(Math, parentsZindex) + this.o.zIndexOffset;\n var offset = this.component ? this.component.parent().offset() : this.element.offset();\n var height = this.component ? this.component.outerHeight(true) : this.element.outerHeight(false);\n var width = this.component ? this.component.outerWidth(true) : this.element.outerWidth(false);\n var left = offset.left - appendOffset.left;\n var top = offset.top - appendOffset.top;\n\n if (this.o.container !== 'body') {\n top += scrollTop;\n }\n\n this.picker.removeClass(\n 'datepicker2-orient-top datepicker2-orient-bottom '+\n 'datepicker2-orient-right datepicker2-orient-left'\n );\n\n if (this.o.orientation.x !== 'auto'){\n this.picker.addClass('datepicker2-orient-' + this.o.orientation.x);\n if (this.o.orientation.x === 'right')\n left -= calendarWidth - width;\n }\n // auto x orientation is best-placement: if it crosses a window\n // edge, fudge it sideways\n else {\n if (offset.left < 0) {\n // component is outside the window on the left side. Move it into visible range\n this.picker.addClass('datepicker2-orient-left');\n left -= offset.left - visualPadding;\n } else if (left + calendarWidth > windowWidth) {\n // the calendar passes the widow right edge. Align it to component right side\n this.picker.addClass('datepicker2-orient-right');\n left += width - calendarWidth;\n } else {\n if (this.o.rtl) {\n // Default to right\n this.picker.addClass('datepicker2-orient-right');\n } else {\n // Default to left\n this.picker.addClass('datepicker2-orient-left');\n }\n }\n }\n\n // auto y orientation is best-situation: top or bottom, no fudging,\n // decision based on which shows more of the calendar\n var yorient = this.o.orientation.y,\n top_overflow;\n if (yorient === 'auto'){\n top_overflow = -scrollTop + top - calendarHeight;\n yorient = top_overflow < 0 ? 'bottom' : 'top';\n }\n\n this.picker.addClass('datepicker2-orient-' + yorient);\n if (yorient === 'top')\n top -= calendarHeight + parseInt(this.picker.css('padding-top'));\n else\n top += height;\n\n if (this.o.rtl) {\n var right = windowWidth - (left + width);\n this.picker.css({\n top: top,\n right: right,\n zIndex: zIndex\n });\n } else {\n this.picker.css({\n top: top,\n left: left,\n zIndex: zIndex\n });\n }\n return this;\n },\n\n _allow_update: true,\n update: function(){\n if (!this._allow_update)\n return this;\n\n var oldDates = this.dates.copy(),\n dates = [],\n fromArgs = false;\n if (arguments.length){\n $.each(arguments, $.proxy(function(i, date){\n if (date instanceof Date)\n date = this._local_to_utc(date);\n dates.push(date);\n }, this));\n fromArgs = true;\n } else {\n dates = this.isInput\n ? this.element.val()\n : this.element.data('date') || this.inputField.val();\n if (dates && this.o.multidate)\n dates = dates.split(this.o.multidateSeparator);\n else\n dates = [dates];\n delete this.element.data().date;\n }\n\n dates = $.map(dates, $.proxy(function(date){\n return DPGlobal.parseDate(date, this.o.format, this.o.language, this.o.assumeNearbyYear);\n }, this));\n dates = $.grep(dates, $.proxy(function(date){\n return (\n !this.dateWithinRange(date) ||\n !date\n );\n }, this), true);\n this.dates.replace(dates);\n\n if (this.o.updateViewDate) {\n if (this.dates.length)\n this.viewDate = new Date(this.dates.get(-1));\n else if (this.viewDate < this.o.startDate)\n this.viewDate = new Date(this.o.startDate);\n else if (this.viewDate > this.o.endDate)\n this.viewDate = new Date(this.o.endDate);\n else\n this.viewDate = this.o.defaultViewDate;\n }\n\n if (fromArgs){\n // setting date by clicking\n this.setValue();\n this.element.change();\n }\n else if (this.dates.length){\n // setting date by typing\n if (String(oldDates) !== String(this.dates) && fromArgs) {\n this._trigger('changeDate');\n this.element.change();\n }\n }\n if (!this.dates.length && oldDates.length) {\n this._trigger('clearDate');\n this.element.change();\n }\n\n this.fill();\n return this;\n },\n\n fillDow: function(){\n if (this.o.showWeekDays) {\n var dowCnt = this.o.weekStart,\n html = '';\n if (this.o.calendarWeeks){\n html += ' ';\n }\n while (dowCnt < this.o.weekStart + 7){\n html += '';\n }\n html += '';\n this.picker.find('.datepicker2-days thead').append(html);\n }\n },\n\n fillMonths: function(){\n var localDate = this._utc_to_local(this.viewDate);\n var html = '';\n var focused;\n for (var i = 0; i < 12; i++){\n focused = localDate && localDate.getMonth() === i ? ' focused' : '';\n html += '' + dates[this.o.language].monthsShort[i] + '';\n }\n this.picker.find('.datepicker2-months td').html(html);\n },\n\n setRange: function(range){\n if (!range || !range.length)\n delete this.range;\n else\n this.range = $.map(range, function(d){\n return d.valueOf();\n });\n this.fill();\n },\n\n getClassNames: function(date){\n var cls = [],\n year = this.viewDate.getUTCFullYear(),\n month = this.viewDate.getUTCMonth(),\n today = UTCToday();\n if (date.getUTCFullYear() < year || (date.getUTCFullYear() === year && date.getUTCMonth() < month)){\n cls.push('old');\n } else if (date.getUTCFullYear() > year || (date.getUTCFullYear() === year && date.getUTCMonth() > month)){\n cls.push('new');\n }\n if (this.focusDate && date.valueOf() === this.focusDate.valueOf())\n cls.push('focused');\n // Compare internal UTC date with UTC today, not local today\n if (this.o.todayHighlight && isUTCEquals(date, today)) {\n cls.push('today');\n }\n if (this.dates.contains(date) !== -1)\n cls.push('active');\n if (!this.dateWithinRange(date)){\n cls.push('disabled');\n }\n if (this.dateIsDisabled(date)){\n cls.push('disabled', 'disabled-date');\n }\n if ($.inArray(date.getUTCDay(), this.o.daysOfWeekHighlighted) !== -1){\n cls.push('highlighted');\n }\n\n if (this.range){\n if (date > this.range[0] && date < this.range[this.range.length-1]){\n cls.push('range');\n }\n if ($.inArray(date.valueOf(), this.range) !== -1){\n cls.push('selected');\n }\n if (date.valueOf() === this.range[0]){\n cls.push('range-start');\n }\n if (date.valueOf() === this.range[this.range.length-1]){\n cls.push('range-end');\n }\n }\n return cls;\n },\n\n _fill_yearsView: function(selector, cssClass, factor, year, startYear, endYear, beforeFn){\n var html = '';\n var step = factor / 10;\n var view = this.picker.find(selector);\n var startVal = Math.floor(year / factor) * factor;\n var endVal = startVal + step * 9;\n var focusedVal = Math.floor(this.viewDate.getFullYear() / step) * step;\n var selected = $.map(this.dates, function(d){\n return Math.floor(d.getUTCFullYear() / step) * step;\n });\n\n var classes, tooltip, before;\n for (var currVal = startVal - step; currVal <= endVal + step; currVal += step) {\n classes = [cssClass];\n tooltip = null;\n\n if (currVal === startVal - step) {\n classes.push('old');\n } else if (currVal === endVal + step) {\n classes.push('new');\n }\n if ($.inArray(currVal, selected) !== -1) {\n classes.push('active');\n }\n if (currVal < startYear || currVal > endYear) {\n classes.push('disabled');\n }\n if (currVal === focusedVal) {\n classes.push('focused');\n }\n\n if (beforeFn !== $.noop) {\n before = beforeFn(new Date(currVal, 0, 1));\n if (before === undefined) {\n before = {};\n } else if (typeof before === 'boolean') {\n before = {enabled: before};\n } else if (typeof before === 'string') {\n before = {classes: before};\n }\n if (before.enabled === false) {\n classes.push('disabled');\n }\n if (before.classes) {\n classes = classes.concat(before.classes.split(/\\s+/));\n }\n if (before.tooltip) {\n tooltip = before.tooltip;\n }\n }\n\n html += '' + currVal + '';\n }\n\n view.find('.datepicker2-switch').text(startVal + '-' + endVal);\n view.find('td').html(html);\n },\n\n fill: function(){\n var d = new Date(this.viewDate),\n year = d.getUTCFullYear(),\n month = d.getUTCMonth(),\n startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,\n startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity,\n endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity,\n endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity,\n todaytxt = dates[this.o.language].today || dates['en'].today || '',\n cleartxt = dates[this.o.language].clear || dates['en'].clear || '',\n titleFormat = dates[this.o.language].titleFormat || dates['en'].titleFormat,\n todayDate = UTCToday(),\n titleBtnVisible = (this.o.todayBtn === true || this.o.todayBtn === 'linked') && todayDate >= this.o.startDate && todayDate <= this.o.endDate && !this.weekOfDateIsDisabled(todayDate),\n tooltip,\n before;\n if (isNaN(year) || isNaN(month))\n return;\n this.picker.find('.datepicker2-days .datepicker2-switch')\n .text(DPGlobal.formatDate(d, titleFormat, this.o.language));\n this.picker.find('tfoot .today')\n .text(todaytxt)\n .css('display', titleBtnVisible ? 'table-cell' : 'none');\n this.picker.find('tfoot .clear')\n .text(cleartxt)\n .css('display', this.o.clearBtn === true ? 'table-cell' : 'none');\n this.picker.find('thead .datepicker2-title')\n .text(this.o.title)\n .css('display', typeof this.o.title === 'string' && this.o.title !== '' ? 'table-cell' : 'none');\n this.updateNavArrows();\n this.fillMonths();\n var prevMonth = UTCDate(year, month, 0),\n day = prevMonth.getUTCDate();\n prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.o.weekStart + 7)%7);\n var nextMonth = new Date(prevMonth);\n if (prevMonth.getUTCFullYear() < 100){\n nextMonth.setUTCFullYear(prevMonth.getUTCFullYear());\n }\n nextMonth.setUTCDate(nextMonth.getUTCDate() + 42);\n nextMonth = nextMonth.valueOf();\n var html = [];\n var weekDay, clsName;\n while (prevMonth.valueOf() < nextMonth){\n weekDay = prevMonth.getUTCDay();\n if (weekDay === this.o.weekStart){\n html.push('');\n if (this.o.calendarWeeks){\n // ISO 8601: First week contains first thursday.\n // ISO also states week starts on Monday, but we can be more abstract here.\n var\n // Start of current week: based on weekstart/current date\n ws = new Date(+prevMonth + (this.o.weekStart - weekDay - 7) % 7 * 864e5),\n // Thursday of this week\n th = new Date(Number(ws) + (7 + 4 - ws.getUTCDay()) % 7 * 864e5),\n // First Thursday of year, year from thursday\n yth = new Date(Number(yth = UTCDate(th.getUTCFullYear(), 0, 1)) + (7 + 4 - yth.getUTCDay()) % 7 * 864e5),\n // Calendar week: ms between thursdays, div ms per day, div 7 days\n calWeek = (th - yth) / 864e5 / 7 + 1;\n html.push(''+ calWeek +'');\n }\n }\n clsName = this.getClassNames(prevMonth);\n clsName.push('day');\n\n var content = prevMonth.getUTCDate();\n\n if (this.o.beforeShowDay !== $.noop){\n before = this.o.beforeShowDay(this._utc_to_local(prevMonth));\n if (before === undefined)\n before = {};\n else if (typeof before === 'boolean')\n before = {enabled: before};\n else if (typeof before === 'string')\n before = {classes: before};\n if (before.enabled === false)\n clsName.push('disabled');\n if (before.classes)\n clsName = clsName.concat(before.classes.split(/\\s+/));\n if (before.tooltip)\n tooltip = before.tooltip;\n if (before.content)\n content = before.content;\n }\n\n //Check if uniqueSort exists (supported by jquery >=1.12 and >=2.2)\n //Fallback to unique function for older jquery versions\n if ($.isFunction($.uniqueSort)) {\n clsName = $.uniqueSort(clsName);\n } else {\n clsName = $.unique(clsName);\n }\n\n html.push('' + content + '');\n tooltip = null;\n if (weekDay === this.o.weekEnd){\n html.push('');\n }\n prevMonth.setUTCDate(prevMonth.getUTCDate() + 1);\n }\n this.picker.find('.datepicker2-days tbody').html(html.join(''));\n\n var monthsTitle = dates[this.o.language].monthsTitle || dates['en'].monthsTitle || 'Months';\n var months = this.picker.find('.datepicker2-months')\n .find('.datepicker2-switch')\n .text(this.o.maxViewMode < 2 ? monthsTitle : year)\n .end()\n .find('tbody span').removeClass('active');\n\n $.each(this.dates, function(i, d){\n if (d.getUTCFullYear() === year)\n months.eq(d.getUTCMonth()).addClass('active');\n });\n\n if (year < startYear || year > endYear){\n months.addClass('disabled');\n }\n if (year === startYear){\n months.slice(0, startMonth).addClass('disabled');\n }\n if (year === endYear){\n months.slice(endMonth+1).addClass('disabled');\n }\n\n if (this.o.beforeShowMonth !== $.noop){\n var that = this;\n $.each(months, function(i, month){\n var moDate = new Date(year, i, 1);\n var before = that.o.beforeShowMonth(moDate);\n if (before === undefined)\n before = {};\n else if (typeof before === 'boolean')\n before = {enabled: before};\n else if (typeof before === 'string')\n before = {classes: before};\n if (before.enabled === false && !$(month).hasClass('disabled'))\n $(month).addClass('disabled');\n if (before.classes)\n $(month).addClass(before.classes);\n if (before.tooltip)\n $(month).prop('title', before.tooltip);\n });\n }\n\n // Generating decade/years picker\n this._fill_yearsView(\n '.datepicker2-years',\n 'year',\n 10,\n year,\n startYear,\n endYear,\n this.o.beforeShowYear\n );\n\n // Generating century/decades picker\n this._fill_yearsView(\n '.datepicker2-decades',\n 'decade',\n 100,\n year,\n startYear,\n endYear,\n this.o.beforeShowDecade\n );\n\n // Generating millennium/centuries picker\n this._fill_yearsView(\n '.datepicker2-centuries',\n 'century',\n 1000,\n year,\n startYear,\n endYear,\n this.o.beforeShowCentury\n );\n },\n\n updateNavArrows: function(){\n if (!this._allow_update)\n return;\n\n var d = new Date(this.viewDate),\n year = d.getUTCFullYear(),\n month = d.getUTCMonth(),\n startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,\n startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity,\n endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity,\n endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity,\n prevIsDisabled,\n nextIsDisabled,\n factor = 1;\n switch (this.viewMode){\n case 4:\n factor *= 10;\n /* falls through */\n case 3:\n factor *= 10;\n /* falls through */\n case 2:\n factor *= 10;\n /* falls through */\n case 1:\n prevIsDisabled = Math.floor(year / factor) * factor <= startYear;\n nextIsDisabled = Math.floor(year / factor) * factor + factor > endYear;\n break;\n case 0:\n prevIsDisabled = year <= startYear && month <= startMonth;\n nextIsDisabled = year >= endYear && month >= endMonth;\n break;\n }\n\n this.picker.find('.prev').toggleClass('disabled', prevIsDisabled);\n this.picker.find('.next').toggleClass('disabled', nextIsDisabled);\n },\n\n click: function(e){\n e.preventDefault();\n e.stopPropagation();\n\n var target, dir, day, year, month;\n target = $(e.target);\n\n // Clicked on the switch\n if (target.hasClass('datepicker2-switch') && this.viewMode !== this.o.maxViewMode){\n this.setViewMode(this.viewMode + 1);\n }\n\n // Clicked on today button\n if (target.hasClass('today') && !target.hasClass('day')){\n this.setViewMode(0);\n this._setDate(UTCToday(), this.o.todayBtn === 'linked' ? null : 'view');\n }\n\n // Clicked on clear button\n if (target.hasClass('clear')){\n this.clearDates();\n }\n\n if (!target.hasClass('disabled')){\n // Clicked on a month, year, decade, century\n if (target.hasClass('month')\n || target.hasClass('year')\n || target.hasClass('decade')\n || target.hasClass('century')) {\n this.viewDate.setUTCDate(1);\n\n day = 1;\n if (this.viewMode === 1){\n month = target.parent().find('span').index(target);\n year = this.viewDate.getUTCFullYear();\n this.viewDate.setUTCMonth(month);\n } else {\n month = 0;\n year = Number(target.text());\n this.viewDate.setUTCFullYear(year);\n }\n\n this._trigger(DPGlobal.viewModes[this.viewMode - 1].e, this.viewDate);\n\n if (this.viewMode === this.o.minViewMode){\n this._setDate(UTCDate(year, month, day));\n } else {\n this.setViewMode(this.viewMode - 1);\n this.fill();\n }\n }\n }\n\n if (this.picker.is(':visible') && this._focused_from){\n this._focused_from.focus();\n }\n delete this._focused_from;\n },\n\n dayCellClick: function(e){\n var $target = $(e.currentTarget);\n var timestamp = $target.data('date');\n var date = new Date(timestamp);\n\n if (this.o.updateViewDate) {\n if (date.getUTCFullYear() !== this.viewDate.getUTCFullYear()) {\n this._trigger('changeYear', this.viewDate);\n }\n\n if (date.getUTCMonth() !== this.viewDate.getUTCMonth()) {\n this._trigger('changeMonth', this.viewDate);\n }\n }\n this._setDate(date);\n },\n\n // Clicked on prev or next\n navArrowsClick: function(e){\n var $target = $(e.currentTarget);\n var dir = $target.hasClass('prev') ? -1 : 1;\n if (this.viewMode !== 0){\n dir *= DPGlobal.viewModes[this.viewMode].navStep * 12;\n }\n this.viewDate = this.moveMonth(this.viewDate, dir);\n this._trigger(DPGlobal.viewModes[this.viewMode].e, this.viewDate);\n this.fill();\n },\n\n _toggle_multidate: function(date){\n var ix = this.dates.contains(date);\n if (!date){\n this.dates.clear();\n }\n\n if (ix !== -1){\n if (this.o.multidate === true || this.o.multidate > 1 || this.o.toggleActive){\n this.dates.remove(ix);\n }\n } else if (this.o.multidate === false) {\n this.dates.clear();\n this.dates.push(date);\n }\n else {\n this.dates.push(date);\n }\n\n if (typeof this.o.multidate === 'number')\n while (this.dates.length > this.o.multidate)\n this.dates.remove(0);\n },\n\n _setDate: function(date, which){\n if (!which || which === 'date')\n this._toggle_multidate(date && new Date(date));\n if ((!which && this.o.updateViewDate) || which === 'view')\n this.viewDate = date && new Date(date);\n\n this.fill();\n this.setValue();\n if (!which || which !== 'view') {\n this._trigger('changeDate');\n }\n this.inputField.trigger('change');\n if (this.o.autoclose && (!which || which === 'date')){\n this.hide();\n }\n },\n\n moveDay: function(date, dir){\n var newDate = new Date(date);\n newDate.setUTCDate(date.getUTCDate() + dir);\n\n return newDate;\n },\n\n moveWeek: function(date, dir){\n return this.moveDay(date, dir * 7);\n },\n\n moveMonth: function(date, dir){\n if (!isValidDate(date))\n return this.o.defaultViewDate;\n if (!dir)\n return date;\n var new_date = new Date(date.valueOf()),\n day = new_date.getUTCDate(),\n month = new_date.getUTCMonth(),\n mag = Math.abs(dir),\n new_month, test;\n dir = dir > 0 ? 1 : -1;\n if (mag === 1){\n test = dir === -1\n // If going back one month, make sure month is not current month\n // (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02)\n ? function(){\n return new_date.getUTCMonth() === month;\n }\n // If going forward one month, make sure month is as expected\n // (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02)\n : function(){\n return new_date.getUTCMonth() !== new_month;\n };\n new_month = month + dir;\n new_date.setUTCMonth(new_month);\n // Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11\n new_month = (new_month + 12) % 12;\n }\n else {\n // For magnitudes >1, move one month at a time...\n for (var i=0; i < mag; i++)\n // ...which might decrease the day (eg, Jan 31 to Feb 28, etc)...\n new_date = this.moveMonth(new_date, dir);\n // ...then reset the day, keeping it in the new month\n new_month = new_date.getUTCMonth();\n new_date.setUTCDate(day);\n test = function(){\n return new_month !== new_date.getUTCMonth();\n };\n }\n // Common date-resetting loop -- if date is beyond end of month, make it\n // end of month\n while (test()){\n new_date.setUTCDate(--day);\n new_date.setUTCMonth(new_month);\n }\n return new_date;\n },\n\n moveYear: function(date, dir){\n return this.moveMonth(date, dir*12);\n },\n\n moveAvailableDate: function(date, dir, fn){\n do {\n date = this[fn](date, dir);\n\n if (!this.dateWithinRange(date))\n return false;\n\n fn = 'moveDay';\n }\n while (this.dateIsDisabled(date));\n\n return date;\n },\n\n weekOfDateIsDisabled: function(date){\n return $.inArray(date.getUTCDay(), this.o.daysOfWeekDisabled) !== -1;\n },\n\n dateIsDisabled: function(date){\n return (\n this.weekOfDateIsDisabled(date) ||\n $.grep(this.o.datesDisabled, function(d){\n return isUTCEquals(date, d);\n }).length > 0\n );\n },\n\n dateWithinRange: function(date){\n return date >= this.o.startDate && date <= this.o.endDate;\n },\n\n keydown: function(e){\n if (!this.picker.is(':visible')){\n if (e.keyCode === 40 || e.keyCode === 27) { // allow down to re-show picker\n this.show();\n e.stopPropagation();\n }\n return;\n }\n var dateChanged = false,\n dir, newViewDate,\n focusDate = this.focusDate || this.viewDate;\n switch (e.keyCode){\n case 27: // escape\n if (this.focusDate){\n this.focusDate = null;\n this.viewDate = this.dates.get(-1) || this.viewDate;\n this.fill();\n }\n else\n this.hide();\n e.preventDefault();\n e.stopPropagation();\n break;\n case 37: // left\n case 38: // up\n case 39: // right\n case 40: // down\n if (!this.o.keyboardNavigation || this.o.daysOfWeekDisabled.length === 7)\n break;\n dir = e.keyCode === 37 || e.keyCode === 38 ? -1 : 1;\n if (this.viewMode === 0) {\n if (e.ctrlKey){\n newViewDate = this.moveAvailableDate(focusDate, dir, 'moveYear');\n\n if (newViewDate)\n this._trigger('changeYear', this.viewDate);\n } else if (e.shiftKey){\n newViewDate = this.moveAvailableDate(focusDate, dir, 'moveMonth');\n\n if (newViewDate)\n this._trigger('changeMonth', this.viewDate);\n } else if (e.keyCode === 37 || e.keyCode === 39){\n newViewDate = this.moveAvailableDate(focusDate, dir, 'moveDay');\n } else if (!this.weekOfDateIsDisabled(focusDate)){\n newViewDate = this.moveAvailableDate(focusDate, dir, 'moveWeek');\n }\n } else if (this.viewMode === 1) {\n if (e.keyCode === 38 || e.keyCode === 40) {\n dir = dir * 4;\n }\n newViewDate = this.moveAvailableDate(focusDate, dir, 'moveMonth');\n } else if (this.viewMode === 2) {\n if (e.keyCode === 38 || e.keyCode === 40) {\n dir = dir * 4;\n }\n newViewDate = this.moveAvailableDate(focusDate, dir, 'moveYear');\n }\n if (newViewDate){\n this.focusDate = this.viewDate = newViewDate;\n this.setValue();\n this.fill();\n e.preventDefault();\n }\n break;\n case 13: // enter\n if (!this.o.forceParse)\n break;\n focusDate = this.focusDate || this.dates.get(-1) || this.viewDate;\n if (this.o.keyboardNavigation) {\n this._toggle_multidate(focusDate);\n dateChanged = true;\n }\n this.focusDate = null;\n this.viewDate = this.dates.get(-1) || this.viewDate;\n this.setValue();\n this.fill();\n if (this.picker.is(':visible')){\n e.preventDefault();\n e.stopPropagation();\n if (this.o.autoclose)\n this.hide();\n }\n break;\n case 9: // tab\n this.focusDate = null;\n this.viewDate = this.dates.get(-1) || this.viewDate;\n this.fill();\n this.hide();\n break;\n }\n if (dateChanged){\n if (this.dates.length)\n this._trigger('changeDate');\n else\n this._trigger('clearDate');\n this.inputField.trigger('change');\n }\n },\n\n setViewMode: function(viewMode){\n this.viewMode = viewMode;\n this.picker\n .children('div')\n .hide()\n .filter('.datepicker2-' + DPGlobal.viewModes[this.viewMode].clsName)\n .show();\n this.updateNavArrows();\n this._trigger('changeViewMode', new Date(this.viewDate));\n }\n };\n\n var DateRangePicker = function(element, options){\n $.data(element, 'datepicker2', this);\n this.element = $(element);\n this.inputs = $.map(options.inputs, function(i){\n return i.jquery ? i[0] : i;\n });\n delete options.inputs;\n\n this.keepEmptyValues = options.keepEmptyValues;\n delete options.keepEmptyValues;\n\n datepicker2Plugin.call($(this.inputs), options)\n .on('changeDate', $.proxy(this.dateUpdated, this));\n\n this.pickers = $.map(this.inputs, function(i){\n return $.data(i, 'datepicker2');\n });\n this.updateDates();\n };\n DateRangePicker.prototype = {\n updateDates: function(){\n this.dates = $.map(this.pickers, function(i){\n return i.getUTCDate();\n });\n this.updateRanges();\n },\n updateRanges: function(){\n var range = $.map(this.dates, function(d){\n return d.valueOf();\n });\n $.each(this.pickers, function(i, p){\n p.setRange(range);\n });\n },\n clearDates: function(){\n $.each(this.pickers, function(i, p){\n p.clearDates();\n });\n },\n dateUpdated: function(e){\n // `this.updating` is a workaround for preventing infinite recursion\n // between `changeDate` triggering and `setUTCDate` calling. Until\n // there is a better mechanism.\n if (this.updating)\n return;\n this.updating = true;\n\n var dp = $.data(e.target, 'datepicker2');\n\n if (dp === undefined) {\n return;\n }\n\n var new_date = dp.getUTCDate(),\n keep_empty_values = this.keepEmptyValues,\n i = $.inArray(e.target, this.inputs),\n j = i - 1,\n k = i + 1,\n l = this.inputs.length;\n if (i === -1)\n return;\n\n $.each(this.pickers, function(i, p){\n if (!p.getUTCDate() && (p === dp || !keep_empty_values))\n p.setUTCDate(new_date);\n });\n\n if (new_date < this.dates[j]){\n // Date being moved earlier/left\n while (j >= 0 && new_date < this.dates[j]){\n this.pickers[j--].setUTCDate(new_date);\n }\n } else if (new_date > this.dates[k]){\n // Date being moved later/right\n while (k < l && new_date > this.dates[k]){\n this.pickers[k++].setUTCDate(new_date);\n }\n }\n this.updateDates();\n\n delete this.updating;\n },\n destroy: function(){\n $.map(this.pickers, function(p){ p.destroy(); });\n $(this.inputs).off('changeDate', this.dateUpdated);\n delete this.element.data().datepicker2;\n },\n remove: alias('destroy', 'Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead')\n };\n\n function opts_from_el(el, prefix){\n // Derive options from element data-attrs\n var data = $(el).data(),\n out = {}, inkey,\n replace = new RegExp('^' + prefix.toLowerCase() + '([A-Z])');\n prefix = new RegExp('^' + prefix.toLowerCase());\n function re_lower(_,a){\n return a.toLowerCase();\n }\n for (var key in data)\n if (prefix.test(key)){\n inkey = key.replace(replace, re_lower);\n out[inkey] = data[key];\n }\n return out;\n }\n\n function opts_from_locale(lang){\n // Derive options from locale plugins\n var out = {};\n // Check if \"de-DE\" style date is available, if not language should\n // fallback to 2 letter code eg \"de\"\n if (!dates[lang]){\n lang = lang.split('-')[0];\n if (!dates[lang])\n return;\n }\n var d = dates[lang];\n $.each(locale_opts, function(i,k){\n if (k in d)\n out[k] = d[k];\n });\n return out;\n }\n\n var old = $.fn.datepicker2;\n var datepicker2Plugin = function(option){\n var args = Array.apply(null, arguments);\n args.shift();\n var internal_return;\n this.each(function(){\n var $this = $(this),\n data = $this.data('datepicker2'),\n options = typeof option === 'object' && option;\n if (!data){\n var elopts = opts_from_el(this, 'date'),\n // Preliminary otions\n xopts = $.extend({}, defaults, elopts, options),\n locopts = opts_from_locale(xopts.language),\n // Options priority: js args, data-attrs, locales, defaults\n opts = $.extend({}, defaults, locopts, elopts, options);\n if ($this.hasClass('input-daterange') || opts.inputs){\n $.extend(opts, {\n inputs: opts.inputs || $this.find('input').toArray()\n });\n data = new DateRangePicker(this, opts);\n }\n else {\n data = new Datepicker2(this, opts);\n }\n $this.data('datepicker2', data);\n }\n if (typeof option === 'string' && typeof data[option] === 'function'){\n internal_return = data[option].apply(data, args);\n }\n });\n\n if (\n internal_return === undefined ||\n internal_return instanceof Datepicker2 ||\n internal_return instanceof DateRangePicker\n )\n return this;\n\n if (this.length > 1)\n throw new Error('Using only allowed for the collection of a single element (' + option + ' function)');\n else\n return internal_return;\n };\n $.fn.datepicker2 = datepicker2Plugin;\n\n var defaults = $.fn.datepicker2.defaults = {\n assumeNearbyYear: false,\n autoclose: false,\n beforeShowDay: $.noop,\n beforeShowMonth: $.noop,\n beforeShowYear: $.noop,\n beforeShowDecade: $.noop,\n beforeShowCentury: $.noop,\n calendarWeeks: false,\n clearBtn: false,\n toggleActive: false,\n daysOfWeekDisabled: [],\n daysOfWeekHighlighted: [],\n datesDisabled: [],\n endDate: Infinity,\n forceParse: true,\n format: 'mm/dd/yyyy',\n keepEmptyValues: false,\n keyboardNavigation: true,\n language: 'en',\n minViewMode: 0,\n maxViewMode: 4,\n multidate: false,\n multidateSeparator: ',',\n orientation: \"auto\",\n rtl: false,\n startDate: -Infinity,\n startView: 0,\n todayBtn: false,\n todayHighlight: false,\n updateViewDate: true,\n weekStart: 0,\n disableTouchKeyboard: false,\n enableOnReadonly: true,\n showOnFocus: true,\n zIndexOffset: 10,\n container: 'body',\n immediateUpdates: false,\n title: '',\n templates: {\n leftArrow: '«',\n rightArrow: '»'\n },\n showWeekDays: true\n };\n var locale_opts = $.fn.datepicker2.locale_opts = [\n 'format',\n 'rtl',\n 'weekStart'\n ];\n $.fn.datepicker2.Constructor = Datepicker2;\n var dates = $.fn.datepicker2.dates = {\n en: {\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n daysShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n daysMin: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n monthsShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n today: \"Today\",\n clear: \"Clear\",\n titleFormat: \"MM yyyy\"\n }\n };\n\n var DPGlobal = {\n viewModes: [\n {\n names: ['days', 'month'],\n clsName: 'days',\n e: 'changeMonth'\n },\n {\n names: ['months', 'year'],\n clsName: 'months',\n e: 'changeYear',\n navStep: 1\n },\n {\n names: ['years', 'decade'],\n clsName: 'years',\n e: 'changeDecade',\n navStep: 10\n },\n {\n names: ['decades', 'century'],\n clsName: 'decades',\n e: 'changeCentury',\n navStep: 100\n },\n {\n names: ['centuries', 'millennium'],\n clsName: 'centuries',\n e: 'changeMillennium',\n navStep: 1000\n }\n ],\n validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g,\n nonpunctuation: /[^ -\\/:-@\\u5e74\\u6708\\u65e5\\[-`{-~\\t\\n\\r]+/g,\n parseFormat: function(format){\n if (typeof format.toValue === 'function' && typeof format.toDisplay === 'function')\n return format;\n // IE treats \\0 as a string end in inputs (truncating the value),\n // so it's a bad format delimiter, anyway\n var separators = format.replace(this.validParts, '\\0').split('\\0'),\n parts = format.match(this.validParts);\n if (!separators || !separators.length || !parts || parts.length === 0){\n throw new Error(\"Invalid date format.\");\n }\n return {separators: separators, parts: parts};\n },\n parseDate: function(date, format, language, assumeNearby){\n if (!date)\n return undefined;\n if (date instanceof Date)\n return date;\n if (typeof format === 'string')\n format = DPGlobal.parseFormat(format);\n if (format.toValue)\n return format.toValue(date, format, language);\n var fn_map = {\n d: 'moveDay',\n m: 'moveMonth',\n w: 'moveWeek',\n y: 'moveYear'\n },\n dateAliases = {\n yesterday: '-1d',\n today: '+0d',\n tomorrow: '+1d'\n },\n parts, part, dir, i, fn;\n if (date in dateAliases){\n date = dateAliases[date];\n }\n if (/^[\\-+]\\d+[dmwy]([\\s,]+[\\-+]\\d+[dmwy])*$/i.test(date)){\n parts = date.match(/([\\-+]\\d+)([dmwy])/gi);\n date = new Date();\n for (i=0; i < parts.length; i++){\n part = parts[i].match(/([\\-+]\\d+)([dmwy])/i);\n dir = Number(part[1]);\n fn = fn_map[part[2].toLowerCase()];\n date = Datepicker2.prototype[fn](date, dir);\n }\n return Datepicker2.prototype._zero_utc_time(date);\n }\n\n parts = date && date.match(this.nonpunctuation) || [];\n\n function applyNearbyYear(year, threshold){\n if (threshold === true)\n threshold = 10;\n\n // if year is 2 digits or less, than the user most likely is trying to get a recent century\n if (year < 100){\n year += 2000;\n // if the new year is more than threshold years in advance, use last century\n if (year > ((new Date()).getFullYear()+threshold)){\n year -= 100;\n }\n }\n\n return year;\n }\n\n var parsed = {},\n setters_order = ['yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'd', 'dd'],\n setters_map = {\n yyyy: function(d,v){\n return d.setUTCFullYear(assumeNearby ? applyNearbyYear(v, assumeNearby) : v);\n },\n m: function(d,v){\n if (isNaN(d))\n return d;\n v -= 1;\n while (v < 0) v += 12;\n v %= 12;\n d.setUTCMonth(v);\n while (d.getUTCMonth() !== v)\n d.setUTCDate(d.getUTCDate()-1);\n return d;\n },\n d: function(d,v){\n return d.setUTCDate(v);\n }\n },\n val, filtered;\n setters_map['yy'] = setters_map['yyyy'];\n setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m'];\n setters_map['dd'] = setters_map['d'];\n date = UTCToday();\n var fparts = format.parts.slice();\n // Remove noop parts\n if (parts.length !== fparts.length){\n fparts = $(fparts).filter(function(i,p){\n return $.inArray(p, setters_order) !== -1;\n }).toArray();\n }\n // Process remainder\n function match_part(){\n var m = this.slice(0, parts[i].length),\n p = parts[i].slice(0, m.length);\n return m.toLowerCase() === p.toLowerCase();\n }\n if (parts.length === fparts.length){\n var cnt;\n for (i=0, cnt = fparts.length; i < cnt; i++){\n val = parseInt(parts[i], 10);\n part = fparts[i];\n if (isNaN(val)){\n switch (part){\n case 'MM':\n filtered = $(dates[language].months).filter(match_part);\n val = $.inArray(filtered[0], dates[language].months) + 1;\n break;\n case 'M':\n filtered = $(dates[language].monthsShort).filter(match_part);\n val = $.inArray(filtered[0], dates[language].monthsShort) + 1;\n break;\n }\n }\n parsed[part] = val;\n }\n var _date, s;\n for (i=0; i < setters_order.length; i++){\n s = setters_order[i];\n if (s in parsed && !isNaN(parsed[s])){\n _date = new Date(date);\n setters_map[s](_date, parsed[s]);\n if (!isNaN(_date))\n date = _date;\n }\n }\n }\n return date;\n },\n formatDate: function(date, format, language){\n if (!date)\n return '';\n if (typeof format === 'string')\n format = DPGlobal.parseFormat(format);\n if (format.toDisplay)\n return format.toDisplay(date, format, language);\n var val = {\n d: date.getUTCDate(),\n D: dates[language].daysShort[date.getUTCDay()],\n DD: dates[language].days[date.getUTCDay()],\n m: date.getUTCMonth() + 1,\n M: dates[language].monthsShort[date.getUTCMonth()],\n MM: dates[language].months[date.getUTCMonth()],\n yy: date.getUTCFullYear().toString().substring(2),\n yyyy: date.getUTCFullYear()\n };\n val.dd = (val.d < 10 ? '0' : '') + val.d;\n val.mm = (val.m < 10 ? '0' : '') + val.m;\n date = [];\n var seps = $.extend([], format.separators);\n for (var i=0, cnt = format.parts.length; i <= cnt; i++){\n if (seps.length)\n date.push(seps.shift());\n date.push(val[format.parts[i]]);\n }\n return date.join('');\n },\n headTemplate: ''+\n ''+\n ''+\n ''+\n ''+\n ''+defaults.templates.leftArrow+''+\n ''+\n ''+defaults.templates.rightArrow+''+\n ''+\n '',\n contTemplate: '',\n footTemplate: ''+\n ''+\n ''+\n ''+\n ''+\n ''+\n ''+\n ''\n };\n DPGlobal.template = '
'+\n '
'+\n ''+\n DPGlobal.headTemplate+\n ''+\n DPGlobal.footTemplate+\n '
'+\n '
'+\n '
'+\n ''+\n DPGlobal.headTemplate+\n DPGlobal.contTemplate+\n DPGlobal.footTemplate+\n '
'+\n '
'+\n '
'+\n ''+\n DPGlobal.headTemplate+\n DPGlobal.contTemplate+\n DPGlobal.footTemplate+\n '
'+\n '
'+\n '
'+\n ''+\n DPGlobal.headTemplate+\n DPGlobal.contTemplate+\n DPGlobal.footTemplate+\n '
'+\n '
'+\n '
'+\n ''+\n DPGlobal.headTemplate+\n DPGlobal.contTemplate+\n DPGlobal.footTemplate+\n '
'+\n '
'+\n '
';\n\n $.fn.datepicker2.DPGlobal = DPGlobal;\n\n\n /* DATEPICKER NO CONFLICT\n * =================== */\n\n $.fn.datepicker2.noConflict = function(){\n $.fn.datepicker2 = old;\n return this;\n };\n\n /* DATEPICKER VERSION\n * =================== */\n $.fn.datepicker2.version = '1.9.0';\n\n $.fn.datepicker2.deprecated = function(msg){\n var console = window.console;\n if (console && console.warn) {\n console.warn('DEPRECATED: ' + msg);\n }\n };\n\n\n /* DATEPICKER DATA-API\n * ================== */\n\n $(document).on(\n 'focus.datepicker2.data-api click.datepicker2.data-api',\n '[data-provide=\"datepicker2\"]',\n function(e){\n var $this = $(this);\n if ($this.data('datepicker2'))\n return;\n e.preventDefault();\n // component click requires us to explicitly show it\n datepicker2Plugin.call($this, 'show');\n }\n );\n $(function(){\n datepicker2Plugin.call($('[data-provide=\"datepicker2-inline\"]'));\n });\n\n}));"],"file":"datepicker.min.js"} \ No newline at end of file +{"version":3,"file":"datepicker.min.js","sources":["../src/datepicker.js"],"sourcesContent":["/*!\n * Datepicker2 for Bootstrap v1.9.0 (https://github.com/uxsolutions/bootstrap-datepicker2)\n *\n * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n */\n\n(function(factory){\n if (typeof define === 'function' && define.amd) {\n define(['jquery'], factory);\n } else if (typeof exports === 'object') {\n factory(require('jquery'));\n } else {\n factory(jQuery);\n }\n}(function($, undefined){\n function UTCDate(){\n return new Date(Date.UTC.apply(Date, arguments));\n }\n function UTCToday(){\n var today = new Date();\n return UTCDate(today.getFullYear(), today.getMonth(), today.getDate());\n }\n function isUTCEquals(date1, date2) {\n return (\n date1.getUTCFullYear() === date2.getUTCFullYear() &&\n date1.getUTCMonth() === date2.getUTCMonth() &&\n date1.getUTCDate() === date2.getUTCDate()\n );\n }\n function alias(method, deprecationMsg){\n return function(){\n if (deprecationMsg !== undefined) {\n $.fn.datepicker2.deprecated(deprecationMsg);\n }\n\n return this[method].apply(this, arguments);\n };\n }\n function isValidDate(d) {\n return d && !isNaN(d.getTime());\n }\n\n var DateArray = (function(){\n var extras = {\n get: function(i){\n return this.slice(i)[0];\n },\n contains: function(d){\n // Array.indexOf is not cross-browser;\n // $.inArray doesn't work with Dates\n var val = d && d.valueOf();\n for (var i=0, l=this.length; i < l; i++)\n // Use date arithmetic to allow dates with different times to match\n if (0 <= this[i].valueOf() - val && this[i].valueOf() - val < 1000*60*60*24)\n return i;\n return -1;\n },\n remove: function(i){\n this.splice(i,1);\n },\n replace: function(new_array){\n if (!new_array)\n return;\n if (!$.isArray(new_array))\n new_array = [new_array];\n this.clear();\n this.push.apply(this, new_array);\n },\n clear: function(){\n this.length = 0;\n },\n copy: function(){\n var a = new DateArray();\n a.replace(this);\n return a;\n }\n };\n\n return function(){\n var a = [];\n a.push.apply(a, arguments);\n $.extend(a, extras);\n return a;\n };\n })();\n\n\n // Picker object\n\n var Datepicker2 = function(element, options){\n $.data(element, 'datepicker2', this);\n\n this._events = [];\n this._secondaryEvents = [];\n\n this._process_options(options);\n\n this.dates = new DateArray();\n this.viewDate = this.o.defaultViewDate;\n this.focusDate = null;\n\n this.element = $(element);\n this.isInput = this.element.is('input');\n this.inputField = this.isInput ? this.element : this.element.find('input');\n this.component = this.element.hasClass('date') ? this.element.find('.add-on, .input-group-addon, .input-group-append, .input-group-prepend, .btn') : false;\n if (this.component && this.component.length === 0)\n this.component = false;\n this.isInline = !this.component && this.element.is('div');\n\n this.picker = $(DPGlobal.template);\n\n // Checking templates and inserting\n if (this._check_template(this.o.templates.leftArrow)) {\n this.picker.find('.prev').html(this.o.templates.leftArrow);\n }\n\n if (this._check_template(this.o.templates.rightArrow)) {\n this.picker.find('.next').html(this.o.templates.rightArrow);\n }\n\n this._buildEvents();\n this._attachEvents();\n\n if (this.isInline){\n this.picker.addClass('datepicker2-inline').appendTo(this.element);\n }\n else {\n this.picker.addClass('datepicker2-dropdown dropdown-menu');\n }\n\n if (this.o.rtl){\n this.picker.addClass('datepicker2-rtl');\n }\n\n if (this.o.calendarWeeks) {\n this.picker.find('.datepicker2-days .datepicker2-switch, thead .datepicker2-title, tfoot .today, tfoot .clear')\n .attr('colspan', function(i, val){\n return Number(val) + 1;\n });\n }\n\n this._process_options({\n startDate: this._o.startDate,\n endDate: this._o.endDate,\n daysOfWeekDisabled: this.o.daysOfWeekDisabled,\n daysOfWeekHighlighted: this.o.daysOfWeekHighlighted,\n datesDisabled: this.o.datesDisabled\n });\n\n this._allow_update = false;\n this.setViewMode(this.o.startView);\n this._allow_update = true;\n\n this.fillDow();\n this.fillMonths();\n\n this.update();\n\n if (this.isInline){\n this.show();\n }\n };\n\n Datepicker2.prototype = {\n constructor: Datepicker2,\n\n _resolveViewName: function(view){\n $.each(DPGlobal.viewModes, function(i, viewMode){\n if (view === i || $.inArray(view, viewMode.names) !== -1){\n view = i;\n return false;\n }\n });\n\n return view;\n },\n\n _resolveDaysOfWeek: function(daysOfWeek){\n if (!$.isArray(daysOfWeek))\n daysOfWeek = daysOfWeek.split(/[,\\s]*/);\n return $.map(daysOfWeek, Number);\n },\n\n _check_template: function(tmp){\n try {\n // If empty\n if (tmp === undefined || tmp === \"\") {\n return false;\n }\n // If no html, everything ok\n if ((tmp.match(/[<>]/g) || []).length <= 0) {\n return true;\n }\n // Checking if html is fine\n var jDom = $(tmp);\n return jDom.length > 0;\n }\n catch (ex) {\n return false;\n }\n },\n\n _process_options: function(opts){\n // Store raw options for reference\n this._o = $.extend({}, this._o, opts);\n // Processed options\n var o = this.o = $.extend({}, this._o);\n\n // Check if \"de-DE\" style date is available, if not language should\n // fallback to 2 letter code eg \"de\"\n var lang = o.language;\n if (!dates[lang]){\n lang = lang.split('-')[0];\n if (!dates[lang])\n lang = defaults.language;\n }\n o.language = lang;\n\n // Retrieve view index from any aliases\n o.startView = this._resolveViewName(o.startView);\n o.minViewMode = this._resolveViewName(o.minViewMode);\n o.maxViewMode = this._resolveViewName(o.maxViewMode);\n\n // Check view is between min and max\n o.startView = Math.max(this.o.minViewMode, Math.min(this.o.maxViewMode, o.startView));\n\n // true, false, or Number > 0\n if (o.multidate !== true){\n o.multidate = Number(o.multidate) || false;\n if (o.multidate !== false)\n o.multidate = Math.max(0, o.multidate);\n }\n o.multidateSeparator = String(o.multidateSeparator);\n\n o.weekStart %= 7;\n o.weekEnd = (o.weekStart + 6) % 7;\n\n var format = DPGlobal.parseFormat(o.format);\n if (o.startDate !== -Infinity){\n if (!!o.startDate){\n if (o.startDate instanceof Date)\n o.startDate = this._local_to_utc(this._zero_time(o.startDate));\n else\n o.startDate = DPGlobal.parseDate(o.startDate, format, o.language, o.assumeNearbyYear);\n }\n else {\n o.startDate = -Infinity;\n }\n }\n if (o.endDate !== Infinity){\n if (!!o.endDate){\n if (o.endDate instanceof Date)\n o.endDate = this._local_to_utc(this._zero_time(o.endDate));\n else\n o.endDate = DPGlobal.parseDate(o.endDate, format, o.language, o.assumeNearbyYear);\n }\n else {\n o.endDate = Infinity;\n }\n }\n\n o.daysOfWeekDisabled = this._resolveDaysOfWeek(o.daysOfWeekDisabled||[]);\n o.daysOfWeekHighlighted = this._resolveDaysOfWeek(o.daysOfWeekHighlighted||[]);\n\n o.datesDisabled = o.datesDisabled||[];\n if (!$.isArray(o.datesDisabled)) {\n o.datesDisabled = o.datesDisabled.split(',');\n }\n o.datesDisabled = $.map(o.datesDisabled, function(d){\n return DPGlobal.parseDate(d, format, o.language, o.assumeNearbyYear);\n });\n\n var plc = String(o.orientation).toLowerCase().split(/\\s+/g),\n _plc = o.orientation.toLowerCase();\n plc = $.grep(plc, function(word){\n return /^auto|left|right|top|bottom$/.test(word);\n });\n o.orientation = {x: 'auto', y: 'auto'};\n if (!_plc || _plc === 'auto')\n ; // no action\n else if (plc.length === 1){\n switch (plc[0]){\n case 'top':\n case 'bottom':\n o.orientation.y = plc[0];\n break;\n case 'left':\n case 'right':\n o.orientation.x = plc[0];\n break;\n }\n }\n else {\n _plc = $.grep(plc, function(word){\n return /^left|right$/.test(word);\n });\n o.orientation.x = _plc[0] || 'auto';\n\n _plc = $.grep(plc, function(word){\n return /^top|bottom$/.test(word);\n });\n o.orientation.y = _plc[0] || 'auto';\n }\n if (o.defaultViewDate instanceof Date || typeof o.defaultViewDate === 'string') {\n o.defaultViewDate = DPGlobal.parseDate(o.defaultViewDate, format, o.language, o.assumeNearbyYear);\n } else if (o.defaultViewDate) {\n var year = o.defaultViewDate.year || new Date().getFullYear();\n var month = o.defaultViewDate.month || 0;\n var day = o.defaultViewDate.day || 1;\n o.defaultViewDate = UTCDate(year, month, day);\n } else {\n o.defaultViewDate = UTCToday();\n }\n },\n _applyEvents: function(evs){\n for (var i=0, el, ch, ev; i < evs.length; i++){\n el = evs[i][0];\n if (evs[i].length === 2){\n ch = undefined;\n ev = evs[i][1];\n } else if (evs[i].length === 3){\n ch = evs[i][1];\n ev = evs[i][2];\n }\n el.on(ev, ch);\n }\n },\n _unapplyEvents: function(evs){\n for (var i=0, el, ev, ch; i < evs.length; i++){\n el = evs[i][0];\n if (evs[i].length === 2){\n ch = undefined;\n ev = evs[i][1];\n } else if (evs[i].length === 3){\n ch = evs[i][1];\n ev = evs[i][2];\n }\n el.off(ev, ch);\n }\n },\n _buildEvents: function(){\n var events = {\n keyup: $.proxy(function(e){\n if ($.inArray(e.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) === -1)\n this.update();\n }, this),\n keydown: $.proxy(this.keydown, this),\n paste: $.proxy(this.paste, this)\n };\n\n if (this.o.showOnFocus === true) {\n events.focus = $.proxy(this.show, this);\n }\n\n if (this.isInput) { // single input\n this._events = [\n [this.element, events]\n ];\n }\n // component: input + button\n else if (this.component && this.inputField.length) {\n this._events = [\n // For components that are not readonly, allow keyboard nav\n [this.inputField, events],\n [this.component, {\n click: $.proxy(this.show, this)\n }]\n ];\n }\n else {\n this._events = [\n [this.element, {\n click: $.proxy(this.show, this),\n keydown: $.proxy(this.keydown, this)\n }]\n ];\n }\n this._events.push(\n // Component: listen for blur on element descendants\n [this.element, '*', {\n blur: $.proxy(function(e){\n this._focused_from = e.target;\n }, this)\n }],\n // Input: listen for blur on element\n [this.element, {\n blur: $.proxy(function(e){\n this._focused_from = e.target;\n }, this)\n }]\n );\n\n if (this.o.immediateUpdates) {\n // Trigger input updates immediately on changed year/month\n this._events.push([this.element, {\n 'changeYear changeMonth': $.proxy(function(e){\n this.update(e.date);\n }, this)\n }]);\n }\n\n this._secondaryEvents = [\n [this.picker, {\n click: $.proxy(this.click, this)\n }],\n [this.picker, '.prev, .next', {\n click: $.proxy(this.navArrowsClick, this)\n }],\n [this.picker, '.day:not(.disabled)', {\n click: $.proxy(this.dayCellClick, this)\n }],\n [$(window), {\n resize: $.proxy(this.place, this)\n }],\n [$(document), {\n 'mousedown touchstart': $.proxy(function(e){\n // Clicked outside the datepicker2, hide it\n if (!(\n this.element.is(e.target) ||\n this.element.find(e.target).length ||\n this.picker.is(e.target) ||\n this.picker.find(e.target).length ||\n this.isInline\n )){\n this.hide();\n }\n }, this)\n }]\n ];\n },\n _attachEvents: function(){\n this._detachEvents();\n this._applyEvents(this._events);\n },\n _detachEvents: function(){\n this._unapplyEvents(this._events);\n },\n _attachSecondaryEvents: function(){\n this._detachSecondaryEvents();\n this._applyEvents(this._secondaryEvents);\n },\n _detachSecondaryEvents: function(){\n this._unapplyEvents(this._secondaryEvents);\n },\n _trigger: function(event, altdate){\n var date = altdate || this.dates.get(-1),\n local_date = this._utc_to_local(date);\n\n this.element.trigger({\n type: event,\n date: local_date,\n viewMode: this.viewMode,\n dates: $.map(this.dates, this._utc_to_local),\n format: $.proxy(function(ix, format){\n if (arguments.length === 0){\n ix = this.dates.length - 1;\n format = this.o.format;\n } else if (typeof ix === 'string'){\n format = ix;\n ix = this.dates.length - 1;\n }\n format = format || this.o.format;\n var date = this.dates.get(ix);\n return DPGlobal.formatDate(date, format, this.o.language);\n }, this)\n });\n },\n\n show: function(){\n if (this.inputField.is(':disabled') || (this.inputField.prop('readonly') && this.o.enableOnReadonly === false))\n return;\n if (!this.isInline)\n this.picker.appendTo(this.o.container);\n this.place();\n this.picker.show();\n this._attachSecondaryEvents();\n this._trigger('show');\n if ((window.navigator.msMaxTouchPoints || 'ontouchstart' in document) && this.o.disableTouchKeyboard) {\n $(this.element).blur();\n }\n return this;\n },\n\n hide: function(){\n if (this.isInline || !this.picker.is(':visible'))\n return this;\n this.focusDate = null;\n this.picker.hide().detach();\n this._detachSecondaryEvents();\n this.setViewMode(this.o.startView);\n\n if (this.o.forceParse && this.inputField.val())\n this.setValue();\n this._trigger('hide');\n return this;\n },\n\n destroy: function(){\n this.hide();\n this._detachEvents();\n this._detachSecondaryEvents();\n this.picker.remove();\n delete this.element.data().datepicker2;\n if (!this.isInput){\n delete this.element.data().date;\n }\n return this;\n },\n\n paste: function(e){\n var dateString;\n if (e.originalEvent.clipboardData && e.originalEvent.clipboardData.types\n && $.inArray('text/plain', e.originalEvent.clipboardData.types) !== -1) {\n dateString = e.originalEvent.clipboardData.getData('text/plain');\n } else if (window.clipboardData) {\n dateString = window.clipboardData.getData('Text');\n } else {\n return;\n }\n this.setDate(dateString);\n this.update();\n e.preventDefault();\n },\n\n _utc_to_local: function(utc){\n if (!utc) {\n return utc;\n }\n\n var local = new Date(utc.getTime() + (utc.getTimezoneOffset() * 60000));\n\n if (local.getTimezoneOffset() !== utc.getTimezoneOffset()) {\n local = new Date(utc.getTime() + (local.getTimezoneOffset() * 60000));\n }\n\n return local;\n },\n _local_to_utc: function(local){\n return local && new Date(local.getTime() - (local.getTimezoneOffset()*60000));\n },\n _zero_time: function(local){\n return local && new Date(local.getFullYear(), local.getMonth(), local.getDate());\n },\n _zero_utc_time: function(utc){\n return utc && UTCDate(utc.getUTCFullYear(), utc.getUTCMonth(), utc.getUTCDate());\n },\n\n getDates: function(){\n return $.map(this.dates, this._utc_to_local);\n },\n\n getUTCDates: function(){\n return $.map(this.dates, function(d){\n return new Date(d);\n });\n },\n\n getDate: function(){\n return this._utc_to_local(this.getUTCDate());\n },\n\n getUTCDate: function(){\n var selected_date = this.dates.get(-1);\n if (selected_date !== undefined) {\n return new Date(selected_date);\n } else {\n return null;\n }\n },\n\n clearDates: function(){\n this.inputField.val('');\n this.update();\n this._trigger('changeDate');\n\n if (this.o.autoclose) {\n this.hide();\n }\n },\n\n setDates: function(){\n var args = $.isArray(arguments[0]) ? arguments[0] : arguments;\n this.update.apply(this, args);\n this._trigger('changeDate');\n this.setValue();\n return this;\n },\n\n setUTCDates: function(){\n var args = $.isArray(arguments[0]) ? arguments[0] : arguments;\n this.setDates.apply(this, $.map(args, this._utc_to_local));\n return this;\n },\n\n setDate: alias('setDates'),\n setUTCDate: alias('setUTCDates'),\n remove: alias('destroy', 'Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead'),\n\n setValue: function(){\n var formatted = this.getFormattedDate();\n this.inputField.val(formatted);\n return this;\n },\n\n getFormattedDate: function(format){\n if (format === undefined)\n format = this.o.format;\n\n var lang = this.o.language;\n return $.map(this.dates, function(d){\n return DPGlobal.formatDate(d, format, lang);\n }).join(this.o.multidateSeparator);\n },\n\n getStartDate: function(){\n return this.o.startDate;\n },\n\n setStartDate: function(startDate){\n this._process_options({startDate: startDate});\n this.update();\n this.updateNavArrows();\n return this;\n },\n\n getEndDate: function(){\n return this.o.endDate;\n },\n\n setEndDate: function(endDate){\n this._process_options({endDate: endDate});\n this.update();\n this.updateNavArrows();\n return this;\n },\n\n setDaysOfWeekDisabled: function(daysOfWeekDisabled){\n this._process_options({daysOfWeekDisabled: daysOfWeekDisabled});\n this.update();\n return this;\n },\n\n setDaysOfWeekHighlighted: function(daysOfWeekHighlighted){\n this._process_options({daysOfWeekHighlighted: daysOfWeekHighlighted});\n this.update();\n return this;\n },\n\n setDatesDisabled: function(datesDisabled){\n this._process_options({datesDisabled: datesDisabled});\n this.update();\n return this;\n },\n\n place: function(){\n if (this.isInline)\n return this;\n var calendarWidth = this.picker.outerWidth(),\n calendarHeight = this.picker.outerHeight(),\n visualPadding = 10,\n container = $(this.o.container),\n windowWidth = container.width(),\n scrollTop = this.o.container === 'body' ? $(document).scrollTop() : container.scrollTop(),\n appendOffset = container.offset();\n\n var parentsZindex = [0];\n this.element.parents().each(function(){\n var itemZIndex = $(this).css('z-index');\n if (itemZIndex !== 'auto' && Number(itemZIndex) !== 0) parentsZindex.push(Number(itemZIndex));\n });\n var zIndex = Math.max.apply(Math, parentsZindex) + this.o.zIndexOffset;\n var offset = this.component ? this.component.parent().offset() : this.element.offset();\n var height = this.component ? this.component.outerHeight(true) : this.element.outerHeight(false);\n var width = this.component ? this.component.outerWidth(true) : this.element.outerWidth(false);\n var left = offset.left - appendOffset.left;\n var top = offset.top - appendOffset.top;\n\n if (this.o.container !== 'body') {\n top += scrollTop;\n }\n\n this.picker.removeClass(\n 'datepicker2-orient-top datepicker2-orient-bottom '+\n 'datepicker2-orient-right datepicker2-orient-left'\n );\n\n if (this.o.orientation.x !== 'auto'){\n this.picker.addClass('datepicker2-orient-' + this.o.orientation.x);\n if (this.o.orientation.x === 'right')\n left -= calendarWidth - width;\n }\n // auto x orientation is best-placement: if it crosses a window\n // edge, fudge it sideways\n else {\n if (offset.left < 0) {\n // component is outside the window on the left side. Move it into visible range\n this.picker.addClass('datepicker2-orient-left');\n left -= offset.left - visualPadding;\n } else if (left + calendarWidth > windowWidth) {\n // the calendar passes the widow right edge. Align it to component right side\n this.picker.addClass('datepicker2-orient-right');\n left += width - calendarWidth;\n } else {\n if (this.o.rtl) {\n // Default to right\n this.picker.addClass('datepicker2-orient-right');\n } else {\n // Default to left\n this.picker.addClass('datepicker2-orient-left');\n }\n }\n }\n\n // auto y orientation is best-situation: top or bottom, no fudging,\n // decision based on which shows more of the calendar\n var yorient = this.o.orientation.y,\n top_overflow;\n if (yorient === 'auto'){\n top_overflow = -scrollTop + top - calendarHeight;\n yorient = top_overflow < 0 ? 'bottom' : 'top';\n }\n\n this.picker.addClass('datepicker2-orient-' + yorient);\n if (yorient === 'top')\n top -= calendarHeight + parseInt(this.picker.css('padding-top'));\n else\n top += height;\n\n if (this.o.rtl) {\n var right = windowWidth - (left + width);\n this.picker.css({\n top: top,\n right: right,\n zIndex: zIndex\n });\n } else {\n this.picker.css({\n top: top,\n left: left,\n zIndex: zIndex\n });\n }\n return this;\n },\n\n _allow_update: true,\n update: function(){\n if (!this._allow_update)\n return this;\n\n var oldDates = this.dates.copy(),\n dates = [],\n fromArgs = false;\n if (arguments.length){\n $.each(arguments, $.proxy(function(i, date){\n if (date instanceof Date)\n date = this._local_to_utc(date);\n dates.push(date);\n }, this));\n fromArgs = true;\n } else {\n dates = this.isInput\n ? this.element.val()\n : this.element.data('date') || this.inputField.val();\n if (dates && this.o.multidate)\n dates = dates.split(this.o.multidateSeparator);\n else\n dates = [dates];\n delete this.element.data().date;\n }\n\n dates = $.map(dates, $.proxy(function(date){\n return DPGlobal.parseDate(date, this.o.format, this.o.language, this.o.assumeNearbyYear);\n }, this));\n dates = $.grep(dates, $.proxy(function(date){\n return (\n !this.dateWithinRange(date) ||\n !date\n );\n }, this), true);\n this.dates.replace(dates);\n\n if (this.o.updateViewDate) {\n if (this.dates.length)\n this.viewDate = new Date(this.dates.get(-1));\n else if (this.viewDate < this.o.startDate)\n this.viewDate = new Date(this.o.startDate);\n else if (this.viewDate > this.o.endDate)\n this.viewDate = new Date(this.o.endDate);\n else\n this.viewDate = this.o.defaultViewDate;\n }\n\n if (fromArgs){\n // setting date by clicking\n this.setValue();\n this.element.change();\n }\n else if (this.dates.length){\n // setting date by typing\n if (String(oldDates) !== String(this.dates) && fromArgs) {\n this._trigger('changeDate');\n this.element.change();\n }\n }\n if (!this.dates.length && oldDates.length) {\n this._trigger('clearDate');\n this.element.change();\n }\n\n this.fill();\n return this;\n },\n\n fillDow: function(){\n if (this.o.showWeekDays) {\n var dowCnt = this.o.weekStart,\n html = '';\n if (this.o.calendarWeeks){\n html += ' ';\n }\n while (dowCnt < this.o.weekStart + 7){\n html += '';\n }\n html += '';\n this.picker.find('.datepicker2-days thead').append(html);\n }\n },\n\n fillMonths: function(){\n var localDate = this._utc_to_local(this.viewDate);\n var html = '';\n var focused;\n for (var i = 0; i < 12; i++){\n focused = localDate && localDate.getMonth() === i ? ' focused' : '';\n html += '' + dates[this.o.language].monthsShort[i] + '';\n }\n this.picker.find('.datepicker2-months td').html(html);\n },\n\n setRange: function(range){\n if (!range || !range.length)\n delete this.range;\n else\n this.range = $.map(range, function(d){\n return d.valueOf();\n });\n this.fill();\n },\n\n getClassNames: function(date){\n var cls = [],\n year = this.viewDate.getUTCFullYear(),\n month = this.viewDate.getUTCMonth(),\n today = UTCToday();\n if (date.getUTCFullYear() < year || (date.getUTCFullYear() === year && date.getUTCMonth() < month)){\n cls.push('old');\n } else if (date.getUTCFullYear() > year || (date.getUTCFullYear() === year && date.getUTCMonth() > month)){\n cls.push('new');\n }\n if (this.focusDate && date.valueOf() === this.focusDate.valueOf())\n cls.push('focused');\n // Compare internal UTC date with UTC today, not local today\n if (this.o.todayHighlight && isUTCEquals(date, today)) {\n cls.push('today');\n }\n if (this.dates.contains(date) !== -1)\n cls.push('active');\n if (!this.dateWithinRange(date)){\n cls.push('disabled');\n }\n if (this.dateIsDisabled(date)){\n cls.push('disabled', 'disabled-date');\n }\n if ($.inArray(date.getUTCDay(), this.o.daysOfWeekHighlighted) !== -1){\n cls.push('highlighted');\n }\n\n if (this.range){\n if (date > this.range[0] && date < this.range[this.range.length-1]){\n cls.push('range');\n }\n if ($.inArray(date.valueOf(), this.range) !== -1){\n cls.push('selected');\n }\n if (date.valueOf() === this.range[0]){\n cls.push('range-start');\n }\n if (date.valueOf() === this.range[this.range.length-1]){\n cls.push('range-end');\n }\n }\n return cls;\n },\n\n _fill_yearsView: function(selector, cssClass, factor, year, startYear, endYear, beforeFn){\n var html = '';\n var step = factor / 10;\n var view = this.picker.find(selector);\n var startVal = Math.floor(year / factor) * factor;\n var endVal = startVal + step * 9;\n var focusedVal = Math.floor(this.viewDate.getFullYear() / step) * step;\n var selected = $.map(this.dates, function(d){\n return Math.floor(d.getUTCFullYear() / step) * step;\n });\n\n var classes, tooltip, before;\n for (var currVal = startVal - step; currVal <= endVal + step; currVal += step) {\n classes = [cssClass];\n tooltip = null;\n\n if (currVal === startVal - step) {\n classes.push('old');\n } else if (currVal === endVal + step) {\n classes.push('new');\n }\n if ($.inArray(currVal, selected) !== -1) {\n classes.push('active');\n }\n if (currVal < startYear || currVal > endYear) {\n classes.push('disabled');\n }\n if (currVal === focusedVal) {\n classes.push('focused');\n }\n\n if (beforeFn !== $.noop) {\n before = beforeFn(new Date(currVal, 0, 1));\n if (before === undefined) {\n before = {};\n } else if (typeof before === 'boolean') {\n before = {enabled: before};\n } else if (typeof before === 'string') {\n before = {classes: before};\n }\n if (before.enabled === false) {\n classes.push('disabled');\n }\n if (before.classes) {\n classes = classes.concat(before.classes.split(/\\s+/));\n }\n if (before.tooltip) {\n tooltip = before.tooltip;\n }\n }\n\n html += '' + currVal + '';\n }\n\n view.find('.datepicker2-switch').text(startVal + '-' + endVal);\n view.find('td').html(html);\n },\n\n fill: function(){\n var d = new Date(this.viewDate),\n year = d.getUTCFullYear(),\n month = d.getUTCMonth(),\n startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,\n startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity,\n endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity,\n endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity,\n todaytxt = dates[this.o.language].today || dates['en'].today || '',\n cleartxt = dates[this.o.language].clear || dates['en'].clear || '',\n titleFormat = dates[this.o.language].titleFormat || dates['en'].titleFormat,\n todayDate = UTCToday(),\n titleBtnVisible = (this.o.todayBtn === true || this.o.todayBtn === 'linked') && todayDate >= this.o.startDate && todayDate <= this.o.endDate && !this.weekOfDateIsDisabled(todayDate),\n tooltip,\n before;\n if (isNaN(year) || isNaN(month))\n return;\n this.picker.find('.datepicker2-days .datepicker2-switch')\n .text(DPGlobal.formatDate(d, titleFormat, this.o.language));\n this.picker.find('tfoot .today')\n .text(todaytxt)\n .css('display', titleBtnVisible ? 'table-cell' : 'none');\n this.picker.find('tfoot .clear')\n .text(cleartxt)\n .css('display', this.o.clearBtn === true ? 'table-cell' : 'none');\n this.picker.find('thead .datepicker2-title')\n .text(this.o.title)\n .css('display', typeof this.o.title === 'string' && this.o.title !== '' ? 'table-cell' : 'none');\n this.updateNavArrows();\n this.fillMonths();\n var prevMonth = UTCDate(year, month, 0),\n day = prevMonth.getUTCDate();\n prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.o.weekStart + 7)%7);\n var nextMonth = new Date(prevMonth);\n if (prevMonth.getUTCFullYear() < 100){\n nextMonth.setUTCFullYear(prevMonth.getUTCFullYear());\n }\n nextMonth.setUTCDate(nextMonth.getUTCDate() + 42);\n nextMonth = nextMonth.valueOf();\n var html = [];\n var weekDay, clsName;\n while (prevMonth.valueOf() < nextMonth){\n weekDay = prevMonth.getUTCDay();\n if (weekDay === this.o.weekStart){\n html.push('');\n if (this.o.calendarWeeks){\n // ISO 8601: First week contains first thursday.\n // ISO also states week starts on Monday, but we can be more abstract here.\n var\n // Start of current week: based on weekstart/current date\n ws = new Date(+prevMonth + (this.o.weekStart - weekDay - 7) % 7 * 864e5),\n // Thursday of this week\n th = new Date(Number(ws) + (7 + 4 - ws.getUTCDay()) % 7 * 864e5),\n // First Thursday of year, year from thursday\n yth = new Date(Number(yth = UTCDate(th.getUTCFullYear(), 0, 1)) + (7 + 4 - yth.getUTCDay()) % 7 * 864e5),\n // Calendar week: ms between thursdays, div ms per day, div 7 days\n calWeek = (th - yth) / 864e5 / 7 + 1;\n html.push(''+ calWeek +'');\n }\n }\n clsName = this.getClassNames(prevMonth);\n clsName.push('day');\n\n var content = prevMonth.getUTCDate();\n\n if (this.o.beforeShowDay !== $.noop){\n before = this.o.beforeShowDay(this._utc_to_local(prevMonth));\n if (before === undefined)\n before = {};\n else if (typeof before === 'boolean')\n before = {enabled: before};\n else if (typeof before === 'string')\n before = {classes: before};\n if (before.enabled === false)\n clsName.push('disabled');\n if (before.classes)\n clsName = clsName.concat(before.classes.split(/\\s+/));\n if (before.tooltip)\n tooltip = before.tooltip;\n if (before.content)\n content = before.content;\n }\n\n //Check if uniqueSort exists (supported by jquery >=1.12 and >=2.2)\n //Fallback to unique function for older jquery versions\n if ($.isFunction($.uniqueSort)) {\n clsName = $.uniqueSort(clsName);\n } else {\n clsName = $.unique(clsName);\n }\n\n html.push('' + content + '');\n tooltip = null;\n if (weekDay === this.o.weekEnd){\n html.push('');\n }\n prevMonth.setUTCDate(prevMonth.getUTCDate() + 1);\n }\n this.picker.find('.datepicker2-days tbody').html(html.join(''));\n\n var monthsTitle = dates[this.o.language].monthsTitle || dates['en'].monthsTitle || 'Months';\n var months = this.picker.find('.datepicker2-months')\n .find('.datepicker2-switch')\n .text(this.o.maxViewMode < 2 ? monthsTitle : year)\n .end()\n .find('tbody span').removeClass('active');\n\n $.each(this.dates, function(i, d){\n if (d.getUTCFullYear() === year)\n months.eq(d.getUTCMonth()).addClass('active');\n });\n\n if (year < startYear || year > endYear){\n months.addClass('disabled');\n }\n if (year === startYear){\n months.slice(0, startMonth).addClass('disabled');\n }\n if (year === endYear){\n months.slice(endMonth+1).addClass('disabled');\n }\n\n if (this.o.beforeShowMonth !== $.noop){\n var that = this;\n $.each(months, function(i, month){\n var moDate = new Date(year, i, 1);\n var before = that.o.beforeShowMonth(moDate);\n if (before === undefined)\n before = {};\n else if (typeof before === 'boolean')\n before = {enabled: before};\n else if (typeof before === 'string')\n before = {classes: before};\n if (before.enabled === false && !$(month).hasClass('disabled'))\n $(month).addClass('disabled');\n if (before.classes)\n $(month).addClass(before.classes);\n if (before.tooltip)\n $(month).prop('title', before.tooltip);\n });\n }\n\n // Generating decade/years picker\n this._fill_yearsView(\n '.datepicker2-years',\n 'year',\n 10,\n year,\n startYear,\n endYear,\n this.o.beforeShowYear\n );\n\n // Generating century/decades picker\n this._fill_yearsView(\n '.datepicker2-decades',\n 'decade',\n 100,\n year,\n startYear,\n endYear,\n this.o.beforeShowDecade\n );\n\n // Generating millennium/centuries picker\n this._fill_yearsView(\n '.datepicker2-centuries',\n 'century',\n 1000,\n year,\n startYear,\n endYear,\n this.o.beforeShowCentury\n );\n },\n\n updateNavArrows: function(){\n if (!this._allow_update)\n return;\n\n var d = new Date(this.viewDate),\n year = d.getUTCFullYear(),\n month = d.getUTCMonth(),\n startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,\n startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity,\n endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity,\n endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity,\n prevIsDisabled,\n nextIsDisabled,\n factor = 1;\n switch (this.viewMode){\n case 4:\n factor *= 10;\n /* falls through */\n case 3:\n factor *= 10;\n /* falls through */\n case 2:\n factor *= 10;\n /* falls through */\n case 1:\n prevIsDisabled = Math.floor(year / factor) * factor <= startYear;\n nextIsDisabled = Math.floor(year / factor) * factor + factor > endYear;\n break;\n case 0:\n prevIsDisabled = year <= startYear && month <= startMonth;\n nextIsDisabled = year >= endYear && month >= endMonth;\n break;\n }\n\n this.picker.find('.prev').toggleClass('disabled', prevIsDisabled);\n this.picker.find('.next').toggleClass('disabled', nextIsDisabled);\n },\n\n click: function(e){\n e.preventDefault();\n e.stopPropagation();\n\n var target, dir, day, year, month;\n target = $(e.target);\n\n // Clicked on the switch\n if (target.hasClass('datepicker2-switch') && this.viewMode !== this.o.maxViewMode){\n this.setViewMode(this.viewMode + 1);\n }\n\n // Clicked on today button\n if (target.hasClass('today') && !target.hasClass('day')){\n this.setViewMode(0);\n this._setDate(UTCToday(), this.o.todayBtn === 'linked' ? null : 'view');\n }\n\n // Clicked on clear button\n if (target.hasClass('clear')){\n this.clearDates();\n }\n\n if (!target.hasClass('disabled')){\n // Clicked on a month, year, decade, century\n if (target.hasClass('month')\n || target.hasClass('year')\n || target.hasClass('decade')\n || target.hasClass('century')) {\n this.viewDate.setUTCDate(1);\n\n day = 1;\n if (this.viewMode === 1){\n month = target.parent().find('span').index(target);\n year = this.viewDate.getUTCFullYear();\n this.viewDate.setUTCMonth(month);\n } else {\n month = 0;\n year = Number(target.text());\n this.viewDate.setUTCFullYear(year);\n }\n\n this._trigger(DPGlobal.viewModes[this.viewMode - 1].e, this.viewDate);\n\n if (this.viewMode === this.o.minViewMode){\n this._setDate(UTCDate(year, month, day));\n } else {\n this.setViewMode(this.viewMode - 1);\n this.fill();\n }\n }\n }\n\n if (this.picker.is(':visible') && this._focused_from){\n this._focused_from.focus();\n }\n delete this._focused_from;\n },\n\n dayCellClick: function(e){\n var $target = $(e.currentTarget);\n var timestamp = $target.data('date');\n var date = new Date(timestamp);\n\n if (this.o.updateViewDate) {\n if (date.getUTCFullYear() !== this.viewDate.getUTCFullYear()) {\n this._trigger('changeYear', this.viewDate);\n }\n\n if (date.getUTCMonth() !== this.viewDate.getUTCMonth()) {\n this._trigger('changeMonth', this.viewDate);\n }\n }\n this._setDate(date);\n },\n\n // Clicked on prev or next\n navArrowsClick: function(e){\n var $target = $(e.currentTarget);\n var dir = $target.hasClass('prev') ? -1 : 1;\n if (this.viewMode !== 0){\n dir *= DPGlobal.viewModes[this.viewMode].navStep * 12;\n }\n this.viewDate = this.moveMonth(this.viewDate, dir);\n this._trigger(DPGlobal.viewModes[this.viewMode].e, this.viewDate);\n this.fill();\n },\n\n _toggle_multidate: function(date){\n var ix = this.dates.contains(date);\n if (!date){\n this.dates.clear();\n }\n\n if (ix !== -1){\n if (this.o.multidate === true || this.o.multidate > 1 || this.o.toggleActive){\n this.dates.remove(ix);\n }\n } else if (this.o.multidate === false) {\n this.dates.clear();\n this.dates.push(date);\n }\n else {\n this.dates.push(date);\n }\n\n if (typeof this.o.multidate === 'number')\n while (this.dates.length > this.o.multidate)\n this.dates.remove(0);\n },\n\n _setDate: function(date, which){\n if (!which || which === 'date')\n this._toggle_multidate(date && new Date(date));\n if ((!which && this.o.updateViewDate) || which === 'view')\n this.viewDate = date && new Date(date);\n\n this.fill();\n this.setValue();\n if (!which || which !== 'view') {\n this._trigger('changeDate');\n }\n this.inputField.trigger('change');\n if (this.o.autoclose && (!which || which === 'date')){\n this.hide();\n }\n },\n\n moveDay: function(date, dir){\n var newDate = new Date(date);\n newDate.setUTCDate(date.getUTCDate() + dir);\n\n return newDate;\n },\n\n moveWeek: function(date, dir){\n return this.moveDay(date, dir * 7);\n },\n\n moveMonth: function(date, dir){\n if (!isValidDate(date))\n return this.o.defaultViewDate;\n if (!dir)\n return date;\n var new_date = new Date(date.valueOf()),\n day = new_date.getUTCDate(),\n month = new_date.getUTCMonth(),\n mag = Math.abs(dir),\n new_month, test;\n dir = dir > 0 ? 1 : -1;\n if (mag === 1){\n test = dir === -1\n // If going back one month, make sure month is not current month\n // (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02)\n ? function(){\n return new_date.getUTCMonth() === month;\n }\n // If going forward one month, make sure month is as expected\n // (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02)\n : function(){\n return new_date.getUTCMonth() !== new_month;\n };\n new_month = month + dir;\n new_date.setUTCMonth(new_month);\n // Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11\n new_month = (new_month + 12) % 12;\n }\n else {\n // For magnitudes >1, move one month at a time...\n for (var i=0; i < mag; i++)\n // ...which might decrease the day (eg, Jan 31 to Feb 28, etc)...\n new_date = this.moveMonth(new_date, dir);\n // ...then reset the day, keeping it in the new month\n new_month = new_date.getUTCMonth();\n new_date.setUTCDate(day);\n test = function(){\n return new_month !== new_date.getUTCMonth();\n };\n }\n // Common date-resetting loop -- if date is beyond end of month, make it\n // end of month\n while (test()){\n new_date.setUTCDate(--day);\n new_date.setUTCMonth(new_month);\n }\n return new_date;\n },\n\n moveYear: function(date, dir){\n return this.moveMonth(date, dir*12);\n },\n\n moveAvailableDate: function(date, dir, fn){\n do {\n date = this[fn](date, dir);\n\n if (!this.dateWithinRange(date))\n return false;\n\n fn = 'moveDay';\n }\n while (this.dateIsDisabled(date));\n\n return date;\n },\n\n weekOfDateIsDisabled: function(date){\n return $.inArray(date.getUTCDay(), this.o.daysOfWeekDisabled) !== -1;\n },\n\n dateIsDisabled: function(date){\n return (\n this.weekOfDateIsDisabled(date) ||\n $.grep(this.o.datesDisabled, function(d){\n return isUTCEquals(date, d);\n }).length > 0\n );\n },\n\n dateWithinRange: function(date){\n return date >= this.o.startDate && date <= this.o.endDate;\n },\n\n keydown: function(e){\n if (!this.picker.is(':visible')){\n if (e.keyCode === 40 || e.keyCode === 27) { // allow down to re-show picker\n this.show();\n e.stopPropagation();\n }\n return;\n }\n var dateChanged = false,\n dir, newViewDate,\n focusDate = this.focusDate || this.viewDate;\n switch (e.keyCode){\n case 27: // escape\n if (this.focusDate){\n this.focusDate = null;\n this.viewDate = this.dates.get(-1) || this.viewDate;\n this.fill();\n }\n else\n this.hide();\n e.preventDefault();\n e.stopPropagation();\n break;\n case 37: // left\n case 38: // up\n case 39: // right\n case 40: // down\n if (!this.o.keyboardNavigation || this.o.daysOfWeekDisabled.length === 7)\n break;\n dir = e.keyCode === 37 || e.keyCode === 38 ? -1 : 1;\n if (this.viewMode === 0) {\n if (e.ctrlKey){\n newViewDate = this.moveAvailableDate(focusDate, dir, 'moveYear');\n\n if (newViewDate)\n this._trigger('changeYear', this.viewDate);\n } else if (e.shiftKey){\n newViewDate = this.moveAvailableDate(focusDate, dir, 'moveMonth');\n\n if (newViewDate)\n this._trigger('changeMonth', this.viewDate);\n } else if (e.keyCode === 37 || e.keyCode === 39){\n newViewDate = this.moveAvailableDate(focusDate, dir, 'moveDay');\n } else if (!this.weekOfDateIsDisabled(focusDate)){\n newViewDate = this.moveAvailableDate(focusDate, dir, 'moveWeek');\n }\n } else if (this.viewMode === 1) {\n if (e.keyCode === 38 || e.keyCode === 40) {\n dir = dir * 4;\n }\n newViewDate = this.moveAvailableDate(focusDate, dir, 'moveMonth');\n } else if (this.viewMode === 2) {\n if (e.keyCode === 38 || e.keyCode === 40) {\n dir = dir * 4;\n }\n newViewDate = this.moveAvailableDate(focusDate, dir, 'moveYear');\n }\n if (newViewDate){\n this.focusDate = this.viewDate = newViewDate;\n this.setValue();\n this.fill();\n e.preventDefault();\n }\n break;\n case 13: // enter\n if (!this.o.forceParse)\n break;\n focusDate = this.focusDate || this.dates.get(-1) || this.viewDate;\n if (this.o.keyboardNavigation) {\n this._toggle_multidate(focusDate);\n dateChanged = true;\n }\n this.focusDate = null;\n this.viewDate = this.dates.get(-1) || this.viewDate;\n this.setValue();\n this.fill();\n if (this.picker.is(':visible')){\n e.preventDefault();\n e.stopPropagation();\n if (this.o.autoclose)\n this.hide();\n }\n break;\n case 9: // tab\n this.focusDate = null;\n this.viewDate = this.dates.get(-1) || this.viewDate;\n this.fill();\n this.hide();\n break;\n }\n if (dateChanged){\n if (this.dates.length)\n this._trigger('changeDate');\n else\n this._trigger('clearDate');\n this.inputField.trigger('change');\n }\n },\n\n setViewMode: function(viewMode){\n this.viewMode = viewMode;\n this.picker\n .children('div')\n .hide()\n .filter('.datepicker2-' + DPGlobal.viewModes[this.viewMode].clsName)\n .show();\n this.updateNavArrows();\n this._trigger('changeViewMode', new Date(this.viewDate));\n }\n };\n\n var DateRangePicker = function(element, options){\n $.data(element, 'datepicker2', this);\n this.element = $(element);\n this.inputs = $.map(options.inputs, function(i){\n return i.jquery ? i[0] : i;\n });\n delete options.inputs;\n\n this.keepEmptyValues = options.keepEmptyValues;\n delete options.keepEmptyValues;\n\n datepicker2Plugin.call($(this.inputs), options)\n .on('changeDate', $.proxy(this.dateUpdated, this));\n\n this.pickers = $.map(this.inputs, function(i){\n return $.data(i, 'datepicker2');\n });\n this.updateDates();\n };\n DateRangePicker.prototype = {\n updateDates: function(){\n this.dates = $.map(this.pickers, function(i){\n return i.getUTCDate();\n });\n this.updateRanges();\n },\n updateRanges: function(){\n var range = $.map(this.dates, function(d){\n return d.valueOf();\n });\n $.each(this.pickers, function(i, p){\n p.setRange(range);\n });\n },\n clearDates: function(){\n $.each(this.pickers, function(i, p){\n p.clearDates();\n });\n },\n dateUpdated: function(e){\n // `this.updating` is a workaround for preventing infinite recursion\n // between `changeDate` triggering and `setUTCDate` calling. Until\n // there is a better mechanism.\n if (this.updating)\n return;\n this.updating = true;\n\n var dp = $.data(e.target, 'datepicker2');\n\n if (dp === undefined) {\n return;\n }\n\n var new_date = dp.getUTCDate(),\n keep_empty_values = this.keepEmptyValues,\n i = $.inArray(e.target, this.inputs),\n j = i - 1,\n k = i + 1,\n l = this.inputs.length;\n if (i === -1)\n return;\n\n $.each(this.pickers, function(i, p){\n if (!p.getUTCDate() && (p === dp || !keep_empty_values))\n p.setUTCDate(new_date);\n });\n\n if (new_date < this.dates[j]){\n // Date being moved earlier/left\n while (j >= 0 && new_date < this.dates[j]){\n this.pickers[j--].setUTCDate(new_date);\n }\n } else if (new_date > this.dates[k]){\n // Date being moved later/right\n while (k < l && new_date > this.dates[k]){\n this.pickers[k++].setUTCDate(new_date);\n }\n }\n this.updateDates();\n\n delete this.updating;\n },\n destroy: function(){\n $.map(this.pickers, function(p){ p.destroy(); });\n $(this.inputs).off('changeDate', this.dateUpdated);\n delete this.element.data().datepicker2;\n },\n remove: alias('destroy', 'Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead')\n };\n\n function opts_from_el(el, prefix){\n // Derive options from element data-attrs\n var data = $(el).data(),\n out = {}, inkey,\n replace = new RegExp('^' + prefix.toLowerCase() + '([A-Z])');\n prefix = new RegExp('^' + prefix.toLowerCase());\n function re_lower(_,a){\n return a.toLowerCase();\n }\n for (var key in data)\n if (prefix.test(key)){\n inkey = key.replace(replace, re_lower);\n out[inkey] = data[key];\n }\n return out;\n }\n\n function opts_from_locale(lang){\n // Derive options from locale plugins\n var out = {};\n // Check if \"de-DE\" style date is available, if not language should\n // fallback to 2 letter code eg \"de\"\n if (!dates[lang]){\n lang = lang.split('-')[0];\n if (!dates[lang])\n return;\n }\n var d = dates[lang];\n $.each(locale_opts, function(i,k){\n if (k in d)\n out[k] = d[k];\n });\n return out;\n }\n\n var old = $.fn.datepicker2;\n var datepicker2Plugin = function(option){\n var args = Array.apply(null, arguments);\n args.shift();\n var internal_return;\n this.each(function(){\n var $this = $(this),\n data = $this.data('datepicker2'),\n options = typeof option === 'object' && option;\n if (!data){\n var elopts = opts_from_el(this, 'date'),\n // Preliminary otions\n xopts = $.extend({}, defaults, elopts, options),\n locopts = opts_from_locale(xopts.language),\n // Options priority: js args, data-attrs, locales, defaults\n opts = $.extend({}, defaults, locopts, elopts, options);\n if ($this.hasClass('input-daterange') || opts.inputs){\n $.extend(opts, {\n inputs: opts.inputs || $this.find('input').toArray()\n });\n data = new DateRangePicker(this, opts);\n }\n else {\n data = new Datepicker2(this, opts);\n }\n $this.data('datepicker2', data);\n }\n if (typeof option === 'string' && typeof data[option] === 'function'){\n internal_return = data[option].apply(data, args);\n }\n });\n\n if (\n internal_return === undefined ||\n internal_return instanceof Datepicker2 ||\n internal_return instanceof DateRangePicker\n )\n return this;\n\n if (this.length > 1)\n throw new Error('Using only allowed for the collection of a single element (' + option + ' function)');\n else\n return internal_return;\n };\n $.fn.datepicker2 = datepicker2Plugin;\n\n var defaults = $.fn.datepicker2.defaults = {\n assumeNearbyYear: false,\n autoclose: false,\n beforeShowDay: $.noop,\n beforeShowMonth: $.noop,\n beforeShowYear: $.noop,\n beforeShowDecade: $.noop,\n beforeShowCentury: $.noop,\n calendarWeeks: false,\n clearBtn: false,\n toggleActive: false,\n daysOfWeekDisabled: [],\n daysOfWeekHighlighted: [],\n datesDisabled: [],\n endDate: Infinity,\n forceParse: true,\n format: 'mm/dd/yyyy',\n keepEmptyValues: false,\n keyboardNavigation: true,\n language: 'en',\n minViewMode: 0,\n maxViewMode: 4,\n multidate: false,\n multidateSeparator: ',',\n orientation: \"auto\",\n rtl: false,\n startDate: -Infinity,\n startView: 0,\n todayBtn: false,\n todayHighlight: false,\n updateViewDate: true,\n weekStart: 0,\n disableTouchKeyboard: false,\n enableOnReadonly: true,\n showOnFocus: true,\n zIndexOffset: 10,\n container: 'body',\n immediateUpdates: false,\n title: '',\n templates: {\n leftArrow: '«',\n rightArrow: '»'\n },\n showWeekDays: true\n };\n var locale_opts = $.fn.datepicker2.locale_opts = [\n 'format',\n 'rtl',\n 'weekStart'\n ];\n $.fn.datepicker2.Constructor = Datepicker2;\n var dates = $.fn.datepicker2.dates = {\n en: {\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n daysShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n daysMin: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n monthsShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n today: \"Today\",\n clear: \"Clear\",\n titleFormat: \"MM yyyy\"\n }\n };\n\n var DPGlobal = {\n viewModes: [\n {\n names: ['days', 'month'],\n clsName: 'days',\n e: 'changeMonth'\n },\n {\n names: ['months', 'year'],\n clsName: 'months',\n e: 'changeYear',\n navStep: 1\n },\n {\n names: ['years', 'decade'],\n clsName: 'years',\n e: 'changeDecade',\n navStep: 10\n },\n {\n names: ['decades', 'century'],\n clsName: 'decades',\n e: 'changeCentury',\n navStep: 100\n },\n {\n names: ['centuries', 'millennium'],\n clsName: 'centuries',\n e: 'changeMillennium',\n navStep: 1000\n }\n ],\n validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g,\n nonpunctuation: /[^ -\\/:-@\\u5e74\\u6708\\u65e5\\[-`{-~\\t\\n\\r]+/g,\n parseFormat: function(format){\n if (typeof format.toValue === 'function' && typeof format.toDisplay === 'function')\n return format;\n // IE treats \\0 as a string end in inputs (truncating the value),\n // so it's a bad format delimiter, anyway\n var separators = format.replace(this.validParts, '\\0').split('\\0'),\n parts = format.match(this.validParts);\n if (!separators || !separators.length || !parts || parts.length === 0){\n throw new Error(\"Invalid date format.\");\n }\n return {separators: separators, parts: parts};\n },\n parseDate: function(date, format, language, assumeNearby){\n if (!date)\n return undefined;\n if (date instanceof Date)\n return date;\n if (typeof format === 'string')\n format = DPGlobal.parseFormat(format);\n if (format.toValue)\n return format.toValue(date, format, language);\n var fn_map = {\n d: 'moveDay',\n m: 'moveMonth',\n w: 'moveWeek',\n y: 'moveYear'\n },\n dateAliases = {\n yesterday: '-1d',\n today: '+0d',\n tomorrow: '+1d'\n },\n parts, part, dir, i, fn;\n if (date in dateAliases){\n date = dateAliases[date];\n }\n if (/^[\\-+]\\d+[dmwy]([\\s,]+[\\-+]\\d+[dmwy])*$/i.test(date)){\n parts = date.match(/([\\-+]\\d+)([dmwy])/gi);\n date = new Date();\n for (i=0; i < parts.length; i++){\n part = parts[i].match(/([\\-+]\\d+)([dmwy])/i);\n dir = Number(part[1]);\n fn = fn_map[part[2].toLowerCase()];\n date = Datepicker2.prototype[fn](date, dir);\n }\n return Datepicker2.prototype._zero_utc_time(date);\n }\n\n parts = date && date.match(this.nonpunctuation) || [];\n\n function applyNearbyYear(year, threshold){\n if (threshold === true)\n threshold = 10;\n\n // if year is 2 digits or less, than the user most likely is trying to get a recent century\n if (year < 100){\n year += 2000;\n // if the new year is more than threshold years in advance, use last century\n if (year > ((new Date()).getFullYear()+threshold)){\n year -= 100;\n }\n }\n\n return year;\n }\n\n var parsed = {},\n setters_order = ['yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'd', 'dd'],\n setters_map = {\n yyyy: function(d,v){\n return d.setUTCFullYear(assumeNearby ? applyNearbyYear(v, assumeNearby) : v);\n },\n m: function(d,v){\n if (isNaN(d))\n return d;\n v -= 1;\n while (v < 0) v += 12;\n v %= 12;\n d.setUTCMonth(v);\n while (d.getUTCMonth() !== v)\n d.setUTCDate(d.getUTCDate()-1);\n return d;\n },\n d: function(d,v){\n return d.setUTCDate(v);\n }\n },\n val, filtered;\n setters_map['yy'] = setters_map['yyyy'];\n setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m'];\n setters_map['dd'] = setters_map['d'];\n date = UTCToday();\n var fparts = format.parts.slice();\n // Remove noop parts\n if (parts.length !== fparts.length){\n fparts = $(fparts).filter(function(i,p){\n return $.inArray(p, setters_order) !== -1;\n }).toArray();\n }\n // Process remainder\n function match_part(){\n var m = this.slice(0, parts[i].length),\n p = parts[i].slice(0, m.length);\n return m.toLowerCase() === p.toLowerCase();\n }\n if (parts.length === fparts.length){\n var cnt;\n for (i=0, cnt = fparts.length; i < cnt; i++){\n val = parseInt(parts[i], 10);\n part = fparts[i];\n if (isNaN(val)){\n switch (part){\n case 'MM':\n filtered = $(dates[language].months).filter(match_part);\n val = $.inArray(filtered[0], dates[language].months) + 1;\n break;\n case 'M':\n filtered = $(dates[language].monthsShort).filter(match_part);\n val = $.inArray(filtered[0], dates[language].monthsShort) + 1;\n break;\n }\n }\n parsed[part] = val;\n }\n var _date, s;\n for (i=0; i < setters_order.length; i++){\n s = setters_order[i];\n if (s in parsed && !isNaN(parsed[s])){\n _date = new Date(date);\n setters_map[s](_date, parsed[s]);\n if (!isNaN(_date))\n date = _date;\n }\n }\n }\n return date;\n },\n formatDate: function(date, format, language){\n if (!date)\n return '';\n if (typeof format === 'string')\n format = DPGlobal.parseFormat(format);\n if (format.toDisplay)\n return format.toDisplay(date, format, language);\n var val = {\n d: date.getUTCDate(),\n D: dates[language].daysShort[date.getUTCDay()],\n DD: dates[language].days[date.getUTCDay()],\n m: date.getUTCMonth() + 1,\n M: dates[language].monthsShort[date.getUTCMonth()],\n MM: dates[language].months[date.getUTCMonth()],\n yy: date.getUTCFullYear().toString().substring(2),\n yyyy: date.getUTCFullYear()\n };\n val.dd = (val.d < 10 ? '0' : '') + val.d;\n val.mm = (val.m < 10 ? '0' : '') + val.m;\n date = [];\n var seps = $.extend([], format.separators);\n for (var i=0, cnt = format.parts.length; i <= cnt; i++){\n if (seps.length)\n date.push(seps.shift());\n date.push(val[format.parts[i]]);\n }\n return date.join('');\n },\n headTemplate: ''+\n ''+\n ''+\n ''+\n ''+\n ''+defaults.templates.leftArrow+''+\n ''+\n ''+defaults.templates.rightArrow+''+\n ''+\n '',\n contTemplate: '',\n footTemplate: ''+\n ''+\n ''+\n ''+\n ''+\n ''+\n ''+\n ''\n };\n DPGlobal.template = '
'+\n '
'+\n ''+\n DPGlobal.headTemplate+\n ''+\n DPGlobal.footTemplate+\n '
'+\n '
'+\n '
'+\n ''+\n DPGlobal.headTemplate+\n DPGlobal.contTemplate+\n DPGlobal.footTemplate+\n '
'+\n '
'+\n '
'+\n ''+\n DPGlobal.headTemplate+\n DPGlobal.contTemplate+\n DPGlobal.footTemplate+\n '
'+\n '
'+\n '
'+\n ''+\n DPGlobal.headTemplate+\n DPGlobal.contTemplate+\n DPGlobal.footTemplate+\n '
'+\n '
'+\n '
'+\n ''+\n DPGlobal.headTemplate+\n DPGlobal.contTemplate+\n DPGlobal.footTemplate+\n '
'+\n '
'+\n '
';\n\n $.fn.datepicker2.DPGlobal = DPGlobal;\n\n\n /* DATEPICKER NO CONFLICT\n * =================== */\n\n $.fn.datepicker2.noConflict = function(){\n $.fn.datepicker2 = old;\n return this;\n };\n\n /* DATEPICKER VERSION\n * =================== */\n $.fn.datepicker2.version = '1.9.0';\n\n $.fn.datepicker2.deprecated = function(msg){\n var console = window.console;\n if (console && console.warn) {\n console.warn('DEPRECATED: ' + msg);\n }\n };\n\n\n /* DATEPICKER DATA-API\n * ================== */\n\n $(document).on(\n 'focus.datepicker2.data-api click.datepicker2.data-api',\n '[data-provide=\"datepicker2\"]',\n function(e){\n var $this = $(this);\n if ($this.data('datepicker2'))\n return;\n e.preventDefault();\n // component click requires us to explicitly show it\n datepicker2Plugin.call($this, 'show');\n }\n );\n $(function(){\n datepicker2Plugin.call($('[data-provide=\"datepicker2-inline\"]'));\n });\n\n}));"],"names":["factory","$","undefined","UTCDate","Date","UTC","apply","arguments","UTCToday","today","getFullYear","getMonth","getDate","isUTCEquals","date1","date2","getUTCFullYear","getUTCMonth","getUTCDate","alias","method","deprecationMsg","fn","datepicker2","deprecated","this","extras","DateArray","get","i","slice","contains","d","val","valueOf","l","length","remove","splice","replace","new_array","isArray","clear","push","copy","a","extend","Datepicker2","element","options","data","_events","_secondaryEvents","_process_options","dates","viewDate","o","defaultViewDate","focusDate","isInput","is","inputField","find","component","hasClass","isInline","picker","DPGlobal","template","_check_template","templates","leftArrow","html","rightArrow","_buildEvents","_attachEvents","addClass","appendTo","rtl","calendarWeeks","attr","Number","startDate","_o","endDate","daysOfWeekDisabled","daysOfWeekHighlighted","datesDisabled","_allow_update","setViewMode","startView","fillDow","fillMonths","update","show","prototype","constructor","_resolveViewName","view","each","viewModes","viewMode","inArray","names","_resolveDaysOfWeek","daysOfWeek","split","map","tmp","match","ex","opts","lang","language","defaults","minViewMode","maxViewMode","Math","max","min","multidate","multidateSeparator","String","weekStart","weekEnd","format","parseFormat","_local_to_utc","_zero_time","parseDate","assumeNearbyYear","Infinity","plc","orientation","toLowerCase","_plc","grep","word","test","x","y","year","month","day","_applyEvents","evs","el","ch","ev","on","_unapplyEvents","off","events","keyup","proxy","e","keyCode","keydown","paste","showOnFocus","focus","click","blur","_focused_from","target","immediateUpdates","date","navArrowsClick","dayCellClick","window","resize","place","document","hide","_detachEvents","_attachSecondaryEvents","_detachSecondaryEvents","_trigger","event","altdate","local_date","_utc_to_local","trigger","type","ix","formatDate","prop","enableOnReadonly","container","navigator","msMaxTouchPoints","disableTouchKeyboard","detach","forceParse","setValue","destroy","dateString","originalEvent","clipboardData","types","getData","setDate","preventDefault","utc","local","getTime","getTimezoneOffset","_zero_utc_time","getDates","getUTCDates","selected_date","clearDates","autoclose","setDates","args","setUTCDates","setUTCDate","formatted","getFormattedDate","join","getStartDate","setStartDate","updateNavArrows","getEndDate","setEndDate","setDaysOfWeekDisabled","setDaysOfWeekHighlighted","setDatesDisabled","calendarWidth","outerWidth","calendarHeight","outerHeight","windowWidth","width","scrollTop","appendOffset","offset","parentsZindex","parents","itemZIndex","css","zIndex","zIndexOffset","parent","height","left","top","removeClass","yorient","parseInt","right","oldDates","fromArgs","dateWithinRange","updateViewDate","change","fill","showWeekDays","dowCnt","daysMin","append","localDate","monthsShort","setRange","range","getClassNames","cls","todayHighlight","dateIsDisabled","getUTCDay","_fill_yearsView","selector","cssClass","factor","startYear","endYear","beforeFn","classes","tooltip","before","step","startVal","floor","endVal","focusedVal","selected","currVal","noop","enabled","concat","text","startMonth","endMonth","todaytxt","cleartxt","titleFormat","todayDate","titleBtnVisible","todayBtn","weekOfDateIsDisabled","isNaN","clearBtn","title","prevMonth","nextMonth","setUTCFullYear","weekDay","clsName","ws","th","yth","calWeek","content","beforeShowDay","isFunction","uniqueSort","unique","toString","monthsTitle","months","end","eq","beforeShowMonth","that","moDate","beforeShowYear","beforeShowDecade","beforeShowCentury","prevIsDisabled","nextIsDisabled","toggleClass","stopPropagation","_setDate","index","setUTCMonth","timestamp","currentTarget","dir","navStep","moveMonth","_toggle_multidate","toggleActive","which","moveDay","newDate","moveWeek","new_month","new_date","mag","abs","moveYear","moveAvailableDate","newViewDate","dateChanged","keyboardNavigation","ctrlKey","shiftKey","children","filter","DateRangePicker","inputs","jquery","keepEmptyValues","datepicker2Plugin","call","dateUpdated","pickers","updateDates","opts_from_el","prefix","out","RegExp","re_lower","_","key","opts_from_locale","locale_opts","k","updateRanges","p","updating","dp","keep_empty_values","j","old","option","internal_return","Array","shift","$this","elopts","locopts","toArray","Error","Constructor","en","days","daysShort","validParts","nonpunctuation","toValue","toDisplay","separators","parts","assumeNearby","part","fn_map","m","w","dateAliases","yesterday","tomorrow","filtered","parsed","setters_order","setters_map","yyyy","v","threshold","fparts","match_part","cnt","_date","s","D","DD","M","MM","yy","substring","dd","mm","seps","headTemplate","contTemplate","footTemplate","noConflict","version","msg","console","warn","define","amd","exports","require","jQuery"],"mappings":"AAMC,IAASA,QAAAA,QAQR,SAASC,EAAGC,sBACDC,iBACE,IAAIC,KAAKA,KAAKC,IAAIC,MAAMF,KAAMG,qBAEhCC,eACDC,MAAQ,IAAIL,YACTD,QAAQM,MAAMC,cAAeD,MAAME,WAAYF,MAAMG,oBAEvDC,YAAYC,MAAOC,cAEpBD,MAAME,mBAAqBD,MAAMC,kBACjCF,MAAMG,gBAAkBF,MAAME,eAC9BH,MAAMI,eAAiBH,MAAMG,sBAG5BC,MAAMC,OAAQC,uBACZ,kBACCA,iBAAmBnB,aACnBD,EAAEqB,GAAGC,YAAYC,WAAWH,gBAGzBI,KAAKL,QAAQd,MAAMmB,KAAMlB,gBAQhCmB,OADJC,WACID,OAAS,CACTE,IAAK,SAASC,UACHJ,KAAKK,MAAMD,GAAG,IAEzBE,SAAU,SAASC,WAGXC,IAAMD,GAAKA,EAAEE,UACRL,EAAE,EAAGM,EAAEV,KAAKW,OAAQP,EAAIM,EAAGN,IAEhC,GAAI,GAAKJ,KAAKI,GAAGK,UAAYD,KAAOR,KAAKI,GAAGK,UAAYD,IAAM,MAC1D,OAAOJ,SACP,GAEZQ,OAAQ,SAASR,QACRS,OAAOT,EAAE,IAElBU,QAAS,SAASC,WACTA,YAEAvC,EAAEwC,QAAQD,aACXA,UAAY,CAACA,iBACZE,aACAC,KAAK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KAAK,KAErBsN,aAAc,uFAKU/T,SAAS5C,UAAUC,UAL7B,yEAOU2C,SAAS5C,UAAUG,WAP7B,qBAUdyW,aAAc,gDACdC,aAAc,2GASlBhX,SAASC,SAAW,yFAGhBD,SAAS8W,aACT,kBACA9W,SAASgX,aALO,gFAUhBhX,SAAS8W,aACT9W,SAAS+W,aACT/W,SAASgX,aAZO,+EAiBhBhX,SAAS8W,aACT9W,SAAS+W,aACT/W,SAASgX,aAnBO,iFAwBhBhX,SAAS8W,aACT9W,SAAS+W,aACT/W,SAASgX,aA1BO,mFA+BhBhX,SAAS8W,aACT9W,SAAS+W,aACT/W,SAASgX,aAjCO,uBAsCpBlb,EAAEqB,GAAGC,YAAY4C,SAAWA,SAM5BlE,EAAEqB,GAAGC,YAAY6Z,WAAa,kBAC1Bnb,EAAEqB,GAAGC,YAAcyW,IACZvW,MAKXxB,EAAEqB,GAAGC,YAAY8Z,QAAU,QAE3Bpb,EAAEqB,GAAGC,YAAYC,WAAa,SAAS8Z,SAC/BC,QAAU9Q,OAAO8Q,QACjBA,SAAWA,QAAQC,MACnBD,QAAQC,KAAK,eAAiBF,MAQtCrb,EAAE2K,UAAUvB,GACR,wDACA,gCACA,SAASM,OACD0O,MAAQpY,EAAEwB,MACV4W,MAAMnV,KAAK,iBAEfyG,EAAE+C,iBAEFiK,kBAAkBC,KAAKyB,MAAO,YAGtCpY,GAAE,WACE0W,kBAAkBC,KAAK3W,EAAE,4CA5+DP,mBAAXwb,QAAyBA,OAAOC,IACvCD,+BAAO,CAAC,UAAWzb,SACO,iBAAZ2b,QACd3b,QAAQ4b,QAAQ,WAEhB5b,QAAQ6b"} \ No newline at end of file diff --git a/amd/build/group-user-selector.min.js b/amd/build/group-user-selector.min.js new file mode 100644 index 0000000..f1a31b9 --- /dev/null +++ b/amd/build/group-user-selector.min.js @@ -0,0 +1,10 @@ +/** + * Search user selector module. + * + * @module block_dash/group-user-selector + * @copyright 2017 The Open University + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +define("block_dash/group-user-selector",["jquery","core/ajax","core/templates"],(function($,Ajax,Templates){return{processResults:function(selector,results){var users=[];return $.each(results,(function(index,user){users.push({value:user.id,label:user._label})})),users},transport:function(selector,query,success,failure){var args={query:query},groupid=$(selector).data("groupid");void 0!==groupid&&""!==$("#id_searchwithin").val()?args.groupid=groupid:args.groupid=0,Ajax.call([{methodname:"block_dash_groups_get_non_members",args:args}])[0].then((function(results){var promises=[];return $.each(results,(function(index,user){promises.push(Templates.render("mod_assign/list_participant_user_summary",user))})),$.when.apply($.when,promises).then((function(){var args=arguments,i=0;$.each(results,(function(index,user){user._label=args[i++]})),success(results)}))})).fail(failure)}}})); + +//# sourceMappingURL=group-user-selector.min.js.map \ No newline at end of file diff --git a/amd/build/group-user-selector.min.js.map b/amd/build/group-user-selector.min.js.map new file mode 100644 index 0000000..4d56844 --- /dev/null +++ b/amd/build/group-user-selector.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"group-user-selector.min.js","sources":["../src/group-user-selector.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Search user selector module.\n *\n * @module block_dash/group-user-selector\n * @copyright 2017 The Open University\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {\n\n return /** @alias module:block_dash/group-user-selector */ {\n\n processResults: function(selector, results) {\n var users = [];\n $.each(results, function(index, user) {\n users.push({\n value: user.id,\n label: user._label\n });\n });\n return users;\n },\n\n transport: function(selector, query, success, failure) {\n var promise;\n\n // Search within specific course if known and if the 'search within' dropdown is set\n // to search within course or activity.\n var args = {query: query};\n\n var groupid = $(selector).data('groupid');\n if (typeof groupid !== \"undefined\" && $('#id_searchwithin').val() !== '') {\n args.groupid = groupid;\n } else {\n args.groupid = 0;\n }\n\n // Call AJAX request.\n promise = Ajax.call([{methodname: 'block_dash_groups_get_non_members', args: args}]);\n\n // When AJAX request returns, handle the results.\n promise[0].then(function(results) {\n var promises = [];\n\n // Render label with user name and picture.\n $.each(results, function(index, user) {\n promises.push(Templates.render('mod_assign/list_participant_user_summary', user));\n });\n\n // Apply the label to the results.\n return $.when.apply($.when, promises).then(function() {\n var args = arguments;\n var i = 0;\n $.each(results, function(index, user) {\n user._label = args[i++];\n });\n success(results);\n return;\n });\n\n }).fail(failure);\n }\n\n };\n\n});\n"],"names":["define","$","Ajax","Templates","processResults","selector","results","users","each","index","user","push","value","id","label","_label","transport","query","success","failure","args","groupid","data","val","call","methodname","then","promises","render","when","apply","arguments","i","fail"],"mappings":";;;;;;;AAuBAA,wCAAO,CAAC,SAAU,YAAa,mBAAmB,SAASC,EAAGC,KAAMC,iBAEL,CAEvDC,eAAgB,SAASC,SAAUC,aAC3BC,MAAQ,UACZN,EAAEO,KAAKF,SAAS,SAASG,MAAOC,MAC5BH,MAAMI,KAAK,CACPC,MAAOF,KAAKG,GACZC,MAAOJ,KAAKK,YAGbR,OAGXS,UAAW,SAASX,SAAUY,MAAOC,QAASC,aAKtCC,KAAO,CAACH,MAAOA,OAEfI,QAAUpB,EAAEI,UAAUiB,KAAK,gBACR,IAAZD,SAA2D,KAAhCpB,EAAE,oBAAoBsB,MACxDH,KAAKC,QAAUA,QAEfD,KAAKC,QAAU,EAITnB,KAAKsB,KAAK,CAAC,CAACC,WAAY,oCAAqCL,KAAMA,QAGrE,GAAGM,MAAK,SAASpB,aACjBqB,SAAW,UAGf1B,EAAEO,KAAKF,SAAS,SAASG,MAAOC,MAC5BiB,SAAShB,KAAKR,UAAUyB,OAAO,2CAA4ClB,UAIxET,EAAE4B,KAAKC,MAAM7B,EAAE4B,KAAMF,UAAUD,MAAK,eACnCN,KAAOW,UACPC,EAAI,EACR/B,EAAEO,KAAKF,SAAS,SAASG,MAAOC,MAC5BA,KAAKK,OAASK,KAAKY,QAEvBd,QAAQZ,eAIb2B,KAAKd"} \ No newline at end of file diff --git a/amd/build/groups.min.js b/amd/build/groups.min.js new file mode 100644 index 0000000..3c50f1f --- /dev/null +++ b/amd/build/groups.min.js @@ -0,0 +1,3 @@ +define("block_dash/groups",["jquery","core/str","core/modal_factory","core/modal_events","core/fragment","core/templates","core/ajax"],(function($,Str,Modal,ModalEvents,Fragment,Templates,AJAX){return{init:function(contextID){var groupModal=document.getElementsByClassName("group-widget-viewmembers");Array.from(groupModal).forEach((function(element){element.addEventListener("click",(function(e){e.preventDefault();var group=e.target.getAttribute("data-group");Modal.create({title:Str.get_string("groups","core")}).then((function(modal){modal.show();var params={widget:"groups",method:"viewmembers",args:JSON.stringify({group:group})};Fragment.loadFragment("block_dash","loadwidget",contextID,params).then(((html,js)=>{modal.setBody(html),Templates.runTemplateJS(js)})),modal.getRoot().on(ModalEvents.hidden,(function(){modal.destroy()}))}))}))}));var groupUsers=document.getElementsByClassName("add-group-users");Array.from(groupUsers).forEach((function(element){element.addEventListener("click",(function(e){e.preventDefault();var group=e.target.getAttribute("data-group");Modal.create({type:Modal.types.SAVE_CANCEL,title:Str.get_string("widget:groups:adduser","block_dash")}).then((function(modal){modal.setLarge(!0),modal.show();var params={widget:"groups",method:"addmembers",args:JSON.stringify({group:group})};Fragment.loadFragment("block_dash","loadwidget",contextID,params).then(((html,js)=>{modal.setBody(html),modal.getRoot().get(0).querySelectorAll("form").forEach((form=>{form.addEventListener("submit",(function(e){e.preventDefault();var formdata=new FormData(e.target);if(""==e.target.querySelector('[name="users[]"]').value)return!1;var formdatastr=new URLSearchParams(formdata).toString();AJAX.call([{methodname:"block_dash_groups_add_members",args:{formdata:formdatastr}}])[0].done((response=>{1==response&&window.location.reload()}))}))})),Templates.runTemplateJS(js)})),modal.getRoot().on(ModalEvents.hidden,(function(){modal.destroy()})),modal.getRoot().on(ModalEvents.save,(e=>{e.preventDefault(),modal.getRoot().get(0).querySelectorAll("form").forEach((form=>{form.querySelector("#id_submitbutton").click()}))}))}))}))}));var leaveGroupModal=document.getElementsByClassName("group-widget-leavegroup");Array.from(leaveGroupModal).forEach((function(element){element.addEventListener("click",(function(e){e.preventDefault();var target=e.target,group=target.getAttribute("data-group"),groupname=target.getAttribute("data-groupname");Modal.create({type:Modal.types.SAVE_CANCEL,title:Str.get_string("groups","core")}).then((function(modal){Str.get_string("confirm","core").then((html=>{modal.setSaveButtonText(html)})),modal.show(),Str.get_string("confirmleavegroup","block_dash",groupname).then((html=>{modal.setBody(html)})),modal.getRoot().on(ModalEvents.save,(e=>{e.preventDefault(),AJAX.call([{methodname:"block_dash_groups_leave_group",args:{groupid:group}}])[0].done((response=>{1==response&&window.location.reload()}))})),modal.getRoot().on(ModalEvents.hidden,(function(){modal.destroy()})),modal.getRoot().on(ModalEvents.destroyed,(function(){modal.remove(),modal.attachmentPoint.remove()}))}))}))}));var createGroupModal=document.getElementsByClassName("create-group");Array.from(createGroupModal).forEach((function(element){element.addEventListener("click",(function(e){e.preventDefault(),Modal.create({type:Modal.types.SAVE_CANCEL,title:Str.get_string("groups","core")}).then((function(modal){modal.show();var params={widget:"groups",method:"creategroup",args:""};Fragment.loadFragment("block_dash","loadwidget",contextID,params).then(((html,js)=>{modal.setBody(html),Templates.runTemplateJS(js),modal.getRoot().get(0).querySelectorAll("form").forEach((form=>{form.addEventListener("submit",(function(e){e.preventDefault();var formdata=new FormData(e.target);if(""==e.target.querySelector('[name="name"]').value||""==e.target.querySelector('[name="courseid"]').value)return!1;var formdatastr=new URLSearchParams(formdata).toString();AJAX.call([{methodname:"block_dash_groups_create_group",args:{formdata:formdatastr}}])[0].done((response=>{1==response&&window.location.reload()}))}))}))})),modal.getRoot().on(ModalEvents.save,(e=>{e.preventDefault(),modal.getRoot().get(0).querySelectorAll("form").forEach((form=>{form.querySelector("#id_submitbutton").click()}))})),modal.getRoot().on(ModalEvents.hidden,(function(){modal.destroy()}))}))}))}))}}})); + +//# sourceMappingURL=groups.min.js.map \ No newline at end of file diff --git a/amd/build/groups.min.js.map b/amd/build/groups.min.js.map new file mode 100644 index 0000000..1362605 --- /dev/null +++ b/amd/build/groups.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"groups.min.js","sources":["../src/groups.js"],"sourcesContent":["\ndefine(['jquery', 'core/str', 'core/modal_factory', 'core/modal_events', 'core/fragment', 'core/templates', 'core/ajax'],\nfunction($, Str, Modal, ModalEvents, Fragment, Templates, AJAX) {\n\n return {\n init: function(contextID) {\n\n var groupModal = document.getElementsByClassName('group-widget-viewmembers');\n Array.from(groupModal).forEach(function(element) {\n element.addEventListener('click', function(e) {\n e.preventDefault();\n var target = e.target;\n var group = target.getAttribute('data-group');\n Modal.create({\n title: Str.get_string('groups', 'core')\n }).then(function(modal) {\n modal.show();\n var args = JSON.stringify({group: group});\n var params = {widget: 'groups', method: 'viewmembers', args: args};\n Fragment.loadFragment('block_dash', 'loadwidget', contextID, params).then((html, js) => {\n modal.setBody(html);\n Templates.runTemplateJS(js);\n });\n modal.getRoot().on(ModalEvents.hidden, function() {\n modal.destroy();\n });\n });\n });\n });\n\n var groupUsers = document.getElementsByClassName('add-group-users');\n Array.from(groupUsers).forEach(function(element) {\n element.addEventListener('click', function(e) {\n e.preventDefault();\n var target = e.target;\n var group = target.getAttribute('data-group');\n Modal.create({\n type: Modal.types.SAVE_CANCEL,\n title: Str.get_string('widget:groups:adduser', 'block_dash'),\n }).then(function(modal) {\n modal.setLarge(true);\n modal.show();\n\n var args = JSON.stringify({group: group});\n var params = {widget: 'groups', method: 'addmembers', args: args};\n Fragment.loadFragment('block_dash', 'loadwidget', contextID, params).then((html, js) => {\n modal.setBody(html);\n\n modal.getRoot().get(0).querySelectorAll('form').forEach(form => {\n form.addEventListener('submit', function(e) {\n e.preventDefault();\n var formdata = new FormData(e.target);\n if (e.target.querySelector('[name=\"users[]\"]').value == '') {\n return false;\n }\n\n var formdatastr = new URLSearchParams(formdata).toString();\n var promises = AJAX.call([{\n methodname: 'block_dash_groups_add_members',\n args: {formdata: formdatastr}\n }]);\n\n promises[0].done((response) => {\n if (response == true) {\n window.location.reload();\n } else {\n // TODO: Error Notification.\n }\n });\n });\n });\n\n Templates.runTemplateJS(js);\n });\n\n modal.getRoot().on(ModalEvents.hidden, function() {\n modal.destroy();\n });\n\n // Apply and save method.\n modal.getRoot().on(ModalEvents.save, (e) => {\n e.preventDefault();\n modal.getRoot().get(0).querySelectorAll('form').forEach(form => {\n form.querySelector('#id_submitbutton').click();\n });\n });\n });\n });\n });\n\n // Leave group.\n var leaveGroupModal = document.getElementsByClassName('group-widget-leavegroup');\n Array.from(leaveGroupModal).forEach(function(element) {\n element.addEventListener('click', function(e) {\n e.preventDefault();\n var target = e.target;\n var group = target.getAttribute('data-group');\n var groupname = target.getAttribute('data-groupname');\n\n Modal.create({\n type: Modal.types.SAVE_CANCEL,\n title: Str.get_string('groups', 'core' ),\n }).then(function(modal) {\n Str.get_string('confirm', 'core').then((html) => {\n modal.setSaveButtonText(html);\n });\n modal.show();\n\n Str.get_string('confirmleavegroup', 'block_dash', groupname).then((html) => {\n modal.setBody(html);\n });\n\n modal.getRoot().on(ModalEvents.save, (e) => {\n e.preventDefault();\n var promises = AJAX.call([{\n methodname: 'block_dash_groups_leave_group',\n args: {groupid: group}\n }]);\n\n promises[0].done((response) => {\n if (response == true) {\n window.location.reload();\n } else {\n // TODO: Error Notification.\n }\n });\n });\n\n modal.getRoot().on(ModalEvents.hidden, function() {\n modal.destroy();\n });\n\n modal.getRoot().on(ModalEvents.destroyed, function() {\n modal.remove();\n modal.attachmentPoint.remove();\n });\n });\n });\n });\n\n // Create group.\n var createGroupModal = document.getElementsByClassName('create-group');\n Array.from(createGroupModal).forEach(function(element) {\n element.addEventListener('click', function(e) {\n e.preventDefault();\n Modal.create({\n type: Modal.types.SAVE_CANCEL,\n title: Str.get_string('groups', 'core'),\n }).then(function(modal) {\n modal.show();\n\n var args = \"\";\n var params = {widget: 'groups', method: 'creategroup', args: args};\n Fragment.loadFragment('block_dash', 'loadwidget', contextID, params).then((html, js) => {\n modal.setBody(html);\n Templates.runTemplateJS(js);\n modal.getRoot().get(0).querySelectorAll('form').forEach(form => {\n form.addEventListener('submit', function(e) {\n e.preventDefault();\n var formdata = new FormData(e.target);\n if (e.target.querySelector('[name=\"name\"]').value == \"\"\n || e.target.querySelector('[name=\"courseid\"]').value == '') {\n return false;\n }\n var formdatastr = new URLSearchParams(formdata).toString();\n var promises = AJAX.call([{\n methodname: 'block_dash_groups_create_group',\n args: {formdata: formdatastr}\n }]);\n\n promises[0].done((response) => {\n if (response == true) {\n window.location.reload();\n } else {\n // TODO: Error Notification.\n }\n });\n });\n });\n });\n\n // Apply and save method.\n modal.getRoot().on(ModalEvents.save, (e) => {\n e.preventDefault();\n modal.getRoot().get(0).querySelectorAll('form').forEach(form => {\n form.querySelector('#id_submitbutton').click();\n });\n });\n\n modal.getRoot().on(ModalEvents.hidden, function() {\n modal.destroy();\n });\n });\n });\n });\n }\n };\n});\n"],"names":["define","$","Str","Modal","ModalEvents","Fragment","Templates","AJAX","init","contextID","groupModal","document","getElementsByClassName","Array","from","forEach","element","addEventListener","e","preventDefault","group","target","getAttribute","create","title","get_string","then","modal","show","params","widget","method","args","JSON","stringify","loadFragment","html","js","setBody","runTemplateJS","getRoot","on","hidden","destroy","groupUsers","type","types","SAVE_CANCEL","setLarge","get","querySelectorAll","form","formdata","FormData","querySelector","value","formdatastr","URLSearchParams","toString","call","methodname","done","response","window","location","reload","save","click","leaveGroupModal","groupname","setSaveButtonText","groupid","destroyed","remove","attachmentPoint","createGroupModal"],"mappings":"AACAA,2BAAO,CAAC,SAAU,WAAY,qBAAsB,oBAAqB,gBAAiB,iBAAkB,cAC5G,SAASC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AM8C,SACN9C,MAAM+C,gBAAgBD,yBAOlCE,iBAAmBhE,SAASC,uBAAuB,gBACvDC,MAAMC,KAAK6D,kBAAkB5D,SAAQ,SAASC,SAC1CA,QAAQC,iBAAiB,SAAS,SAASC,GACvCA,EAAEC,iBACFhB,MAAMoB,OAAO,CACTsB,KAAM1C,MAAM2C,MAAMC,YAClBvB,MAAOtB,IAAIuB,WAAW,SAAU,UACjCC,MAAK,SAASC,OACbA,MAAMC,WAGFC,OAAS,CAACC,OAAQ,SAAUC,OAAQ,cAAeC,KAD5C,IAEX3B,SAAS8B,aAAa,aAAc,aAAc1B,UAAWoB,QAAQH,MAAK,CAACU,KAAMC,MAC7EV,MAAMW,QAAQF,MACd9B,UAAUiC,cAAcF,IACxBV,MAAMa,UAAUS,IAAI,GAAGC,iBAAiB,QAAQnC,SAAQoC,OACpDA,KAAKlC,iBAAiB,UAAU,SAASC,GACrCA,EAAEC,qBACEiC,SAAW,IAAIC,SAASnC,EAAEG,WACuB,IAAjDH,EAAEG,OAAOiC,cAAc,iBAAiBC,OACgB,IAArDrC,EAAEG,OAAOiC,cAAc,qBAAqBC,aACxC,MAEPC,YAAc,IAAIC,gBAAgBL,UAAUM,WACjCnD,KAAKoD,KAAK,CAAC,CACtBC,WAAY,iCACZ5B,KAAM,CAACoB,SAAUI,gBAGZ,GAAGK,MAAMC,WACE,GAAZA,UACAC,OAAOC,SAASC,qBAUpCtC,MAAMa,UAAUC,GAAGrC,YAAY8D,MAAOhD,IAClCA,EAAEC,iBACFQ,MAAMa,UAAUS,IAAI,GAAGC,iBAAiB,QAAQnC,SAAQoC,OACpDA,KAAKG,cAAc,oBAAoBa,cAI/CxC,MAAMa,UAAUC,GAAGrC,YAAYsC,QAAQ,WACnCf,MAAMgB"} \ No newline at end of file diff --git a/amd/build/preferences_modal.min.js b/amd/build/preferences_modal.min.js index 8832c92..4cd7429 100644 --- a/amd/build/preferences_modal.min.js +++ b/amd/build/preferences_modal.min.js @@ -1,2 +1,11 @@ -define ("block_dash/preferences_modal",["jquery","jqueryui","core/str","core/modal_factory","core/modal_events","core/fragment","core/ajax","block_dash/select2","core/notification"],function(a,b,c,d,e,f,g,h,i){var j=function(a,b,c){this.contextid=b;this.onCloseCallback=c;this.tab="";this.init(a)};j.prototype.modal=null;j.prototype.contextid=-1;j.prototype.init=function(b){var f=a(b);return c.get_string("editpreferences","block_dash").then(function(a){return d.create({type:d.types.DEFAULT,title:a,body:this.getBody()},f)}.bind(this)).then(function(b){var c=this;this.modal=b;this.modal.setLarge();this.modal.getRoot().on(e.shown,function(){this.modal.setBody(this.getBody())}.bind(this));this.modal.getRoot().on("change","#id_config_preferences_layout",this.submitFormAjax.bind(this,!1));this.modal.getRoot().on("click","[data-action=cancel]",function(){c.modal.hide()});this.modal.getRoot().on(e.save,this.submitForm.bind(this));this.modal.getRoot().on("submit","form",this.submitFormAjax.bind(this,!0));this.modal.getRoot().on(e.bodyRendered,function(){a("#fgroup_id_available_fields .form-inline > fieldset > div").sortable({items:".form-check-inline.fitem",handle:".drag-handle",axis:"y"});this.initSelect2()}.bind(this));this.modal.getRoot().on(e.hidden,function(a){window.onbeforeunload=null;if(this.onCloseCallback){this.onCloseCallback(a)}}.bind(this));this.modal.getRoot().on("click","[data-action=change-tab]",function(b){c.changeTab(a(b.target).data("tab"))});return this.modal}.bind(this))};j.prototype.changeTab=function(a){this.tab=a;this.submitFormAjax(!1)};j.prototype.getBody=function(a){if("undefined"==typeof a){a={}}var b={jsonformdata:JSON.stringify(a),tab:this.tab};return f.loadFragment("block_dash","block_preferences_form",this.contextid,b)};j.prototype.handleFormSubmissionResponse=function(a,b,c){if(c.validationerrors||!b){this.modal.setBody(this.getBody(a))}else if(b){this.modal.hide()}};j.prototype.handleFormSubmissionFailure=function(a){this.modal.setBody(this.getBody(a))};j.prototype.submitFormAjax=function(b,c){if(c){c.preventDefault()}var d=a.merge(this.modal.getRoot().find("[aria-invalid=\"true\"]"),this.modal.getRoot().find(".error"));if(d.length){d.first().focus();return}var e=this.modal.getRoot().find("form").serialize();g.call([{methodname:"block_dash_submit_preferences_form",args:{contextid:this.contextid,jsonformdata:JSON.stringify(e)},done:this.handleFormSubmissionResponse.bind(this,e,b),fail:this.handleFormSubmissionFailure.bind(this,e)}])[0].fail(i.exception)};j.prototype.getModal=function(){return this.modal};j.prototype.submitForm=function(a){a.preventDefault();this.modal.getRoot().find("form").submit()};j.prototype.initSelect2=function(){this.modal.getRoot().find(".select2-form select").each(function(b,c){var d=null;if(a(c).find("option[value='-1']")){d={id:"-1",text:a(c).find("option[value='-1']").text()}}a(c).select2({dropdownParent:a(this).parent(),allowClear:!0,theme:"bootstrap4",placeholder:d}).on("select2:unselecting",function(){a(this).data("unselecting",!0)}).on("select2:opening",function(b){if(a(this).data("unselecting")){a(this).removeData("unselecting");b.preventDefault()}})})};return j}); -//# sourceMappingURL=preferences_modal.min.js.map +/** + * Add a create new group modal to the page. + * + * @module core_group/newgroup + * @class PreferencesModal + * @copyright 2017 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +define("block_dash/preferences_modal",["jquery","core/str","core/modal_factory","core/modal_events","core/fragment","core/ajax","block_dash/select2","core/notification"],(function($,Str,ModalFactory,ModalEvents,Fragment,Ajax,Select2,Notification){var PreferencesModal=function(selector,contextid,onCloseCallback){this.contextid=contextid,this.onCloseCallback=onCloseCallback,this.tab="",this.init(selector)};return PreferencesModal.prototype.modal=null,PreferencesModal.prototype.contextid=-1,PreferencesModal.prototype.init=function(selector){var triggers=$(selector);return Str.get_string("editpreferences","block_dash").then(function(title){return ModalFactory.create({type:ModalFactory.types.DEFAULT,title:title,body:this.getBody()},triggers)}.bind(this)).then(function(modal){return this.modal=modal,this.modal.setLarge(),this.modal.getRoot().on(ModalEvents.shown,function(){this.modal.setBody(this.getBody())}.bind(this)),this.modal.getRoot().on("change","#id_config_preferences_layout",this.submitFormAjax.bind(this,!1)),this.modal.getRoot().on("click","[data-action=cancel]",(()=>{this.modal.hide()})),this.modal.getRoot().on(ModalEvents.save,this.submitForm.bind(this)),this.modal.getRoot().on("submit","form",this.submitFormAjax.bind(this,!0)),this.modal.getRoot().on(ModalEvents.bodyRendered,function(){$("#fgroup_id_available_fields .form-inline > fieldset > div").sortable({items:".form-check-inline.fitem",handle:".drag-handle",axis:"y"}),this.initSelect2()}.bind(this)),this.modal.getRoot().on(ModalEvents.hidden,function(e){window.onbeforeunload=null,this.onCloseCallback&&this.onCloseCallback(e)}.bind(this)),this.modal.getRoot().on("click","[data-action=change-tab]",(e=>{this.changeTab($(e.target).data("tab"))})),this.modal}.bind(this))},PreferencesModal.prototype.changeTab=function(tab){this.tab=tab,this.submitFormAjax(!1)},PreferencesModal.prototype.getBody=function(formdata){void 0===formdata&&(formdata={});var params={jsonformdata:JSON.stringify(formdata),tab:this.tab};return Fragment.loadFragment("block_dash","block_preferences_form",this.contextid,params)},PreferencesModal.prototype.handleFormSubmissionResponse=function(formData,closeWhenDone,response){response.validationerrors||!closeWhenDone?this.modal.setBody(this.getBody(formData)):closeWhenDone&&this.modal.hide()},PreferencesModal.prototype.handleFormSubmissionFailure=function(data){this.modal.setBody(this.getBody(data))},PreferencesModal.prototype.submitFormAjax=function(closeWhenDone,e){e&&e.preventDefault();var invalid=$.merge(this.modal.getRoot().find('[aria-invalid="true"]'),this.modal.getRoot().find(".error"));if(invalid.length)invalid.first().focus();else{var formData=this.modal.getRoot().find("form").serialize();Ajax.call([{methodname:"block_dash_submit_preferences_form",args:{contextid:this.contextid,jsonformdata:JSON.stringify(formData)},done:this.handleFormSubmissionResponse.bind(this,formData,closeWhenDone),fail:this.handleFormSubmissionFailure.bind(this,formData)}])[0].fail(Notification.exception)}},PreferencesModal.prototype.getModal=function(){return this.modal},PreferencesModal.prototype.submitForm=function(e){e.preventDefault(),this.modal.getRoot().find("form").submit()},PreferencesModal.prototype.initSelect2=function(){this.modal.getRoot().find(".select2-form select").each((function(index,element){let placeholder=null;$(element).find("option[value='-1']")&&(placeholder={id:"-1",text:$(element).find("option[value='-1']").text()}),$(element).select2({dropdownParent:$(this).parent(),allowClear:!0,theme:"bootstrap4",placeholder:placeholder}).on("select2:unselecting",(function(){$(this).data("unselecting",!0)})).on("select2:opening",(function(e){$(this).data("unselecting")&&($(this).removeData("unselecting"),e.preventDefault())}))}))},PreferencesModal})); + +//# sourceMappingURL=preferences_modal.min.js.map \ No newline at end of file diff --git a/amd/build/preferences_modal.min.js.map b/amd/build/preferences_modal.min.js.map index 607d9f5..677b5fe 100644 --- a/amd/build/preferences_modal.min.js.map +++ b/amd/build/preferences_modal.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/preferences_modal.js"],"names":["define","$","jqueryui","Str","ModalFactory","ModalEvents","Fragment","Ajax","Select2","Notification","PreferencesModal","selector","contextid","onCloseCallback","tab","init","prototype","modal","triggers","get_string","then","title","create","type","types","DEFAULT","body","getBody","bind","setLarge","getRoot","on","shown","setBody","submitFormAjax","hide","save","submitForm","bodyRendered","sortable","items","handle","axis","initSelect2","hidden","e","window","onbeforeunload","changeTab","target","data","formdata","params","jsonformdata","JSON","stringify","loadFragment","handleFormSubmissionResponse","formData","closeWhenDone","response","validationerrors","handleFormSubmissionFailure","preventDefault","invalid","merge","find","length","first","focus","serialize","call","methodname","args","done","fail","exception","getModal","submit","each","index","element","placeholder","id","text","select2","dropdownParent","parent","allowClear","theme","removeData"],"mappings":"AAQAA,OAAM,gCAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,UAAvB,CAAmC,oBAAnC,CAAyD,mBAAzD,CACC,eADD,CACkB,WADlB,CAC+B,oBAD/B,CACqD,mBADrD,CAAD,CAEF,SAASC,CAAT,CAAYC,CAAZ,CAAsBC,CAAtB,CAA2BC,CAA3B,CAAyCC,CAAzC,CAAsDC,CAAtD,CAAgEC,CAAhE,CAAsEC,CAAtE,CAA+EC,CAA/E,CAA6F,CAW7F,GAAIC,CAAAA,CAAgB,CAAG,SAASC,CAAT,CAAmBC,CAAnB,CAA8BC,CAA9B,CAA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,CAAT,CAAgBC,CAAhB,CAAyB,CAC5E,GAAIC,CAAAA,CAAW,CAAG,IAAlB,CACA,GAAIjF,CAAC,CAACgF,CAAD,CAAD,CAAWf,IAAX,CAAgB,oBAAhB,CAAJ,CAA2C,CACvCgB,CAAW,CAAG,CACVC,EAAE,CAAE,IADM,CAEVC,IAAI,CAAEnF,CAAC,CAACgF,CAAD,CAAD,CAAWf,IAAX,CAAgB,oBAAhB,EAAsCkB,IAAtC,EAFI,CAIjB,CACDnF,CAAC,CAACgF,CAAD,CAAD,CAAWI,OAAX,CAAmB,CACfC,cAAc,CAAErF,CAAC,CAAC,IAAD,CAAD,CAAQsF,MAAR,EADD,CAEfC,UAAU,GAFK,CAGfC,KAAK,CAAE,YAHQ,CAIfP,WAAW,CAAEA,CAJE,CAAnB,EAKGnD,EALH,CAKM,qBALN,CAK6B,UAAW,CACpC9B,CAAC,CAAC,IAAD,CAAD,CAAQiD,IAAR,CAAa,aAAb,IACH,CAPD,EAOGnB,EAPH,CAOM,iBAPN,CAOyB,SAASc,CAAT,CAAY,CACjC,GAAI5C,CAAC,CAAC,IAAD,CAAD,CAAQiD,IAAR,CAAa,aAAb,CAAJ,CAAiC,CAC7BjD,CAAC,CAAC,IAAD,CAAD,CAAQyF,UAAR,CAAmB,aAAnB,EACA7C,CAAC,CAACkB,cAAF,EACH,CACJ,CAZD,CAaH,CArBD,CAsBH,CAvBD,CAyBA,MAAOrD,CAAAA,CACV,CA5OK,CAAN","sourcesContent":["/**\n * Add a create new group modal to the page.\n *\n * @module core_group/newgroup\n * @class PreferencesModal\n * @copyright 2017 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'jqueryui', 'core/str', 'core/modal_factory', 'core/modal_events',\n 'core/fragment', 'core/ajax', 'block_dash/select2', 'core/notification'],\n function($, jqueryui, Str, ModalFactory, ModalEvents, Fragment, Ajax, Select2, Notification) {\n\n /**\n * Constructor\n *\n * @param {String} selector used to find triggers for the new group modal.\n * @param {int} contextid\n * @param {Function} onCloseCallback\n *\n * Each call to init gets it's own instance of this class.\n */\n var PreferencesModal = function(selector, contextid, onCloseCallback) {\n this.contextid = contextid;\n this.onCloseCallback = onCloseCallback;\n this.tab = \"\";\n this.init(selector);\n };\n\n /**\n * @var {Modal} modal\n * @private\n */\n PreferencesModal.prototype.modal = null;\n\n /**\n * @var {int} contextid\n * @private\n */\n PreferencesModal.prototype.contextid = -1;\n\n /**\n * Initialise the class.\n *\n * @param {String} selector used to find triggers for the new group modal.\n * @private\n * @return {Promise}\n */\n PreferencesModal.prototype.init = function(selector) {\n var triggers = $(selector);\n // Fetch the title string.\n return Str.get_string('editpreferences', 'block_dash').then(function(title) {\n // Create the modal.\n return ModalFactory.create({\n type: ModalFactory.types.DEFAULT,\n title: title,\n body: this.getBody()\n }, triggers);\n }.bind(this)).then(function(modal) {\n // Keep a reference to the modal.\n this.modal = modal;\n\n // Forms are big, we want a big modal.\n this.modal.setLarge();\n\n // We want to reset the form every time it is opened.\n this.modal.getRoot().on(ModalEvents.shown, function() {\n this.modal.setBody(this.getBody());\n }.bind(this));\n\n this.modal.getRoot().on('change', '#id_config_preferences_layout', this.submitFormAjax.bind(this, false));\n\n this.modal.getRoot().on('click', '[data-action=cancel]', () => {\n this.modal.hide();\n });\n\n // We catch the modal save event, and use it to submit the form inside the modal.\n // Triggering a form submission will give JS validation scripts a chance to check for errors.\n this.modal.getRoot().on(ModalEvents.save, this.submitForm.bind(this));\n // We also catch the form submit event and use it to submit the form with ajax.\n this.modal.getRoot().on('submit', 'form', this.submitFormAjax.bind(this, true));\n\n this.modal.getRoot().on(ModalEvents.bodyRendered, function() {\n $(\"#fgroup_id_available_fields .form-inline > fieldset > div\").sortable({\n items: \".form-check-inline.fitem\",\n handle: \".drag-handle\",\n axis: \"y\"\n });\n\n this.initSelect2();\n }.bind(this));\n\n this.modal.getRoot().on(ModalEvents.hidden, function(e) {\n // Prevent \"changes may be lost\" popup.\n window.onbeforeunload = null;\n if (this.onCloseCallback) {\n this.onCloseCallback(e);\n }\n }.bind(this));\n\n this.modal.getRoot().on('click', '[data-action=change-tab]', (e) => {\n this.changeTab($(e.target).data('tab'));\n });\n\n return this.modal;\n }.bind(this));\n };\n\n PreferencesModal.prototype.changeTab = function(tab) {\n this.tab = tab;\n this.submitFormAjax(false);\n };\n\n /**\n * Get modal body content.\n * @method getBody\n * @param {Object} formdata\n * @private\n * @return {Promise}\n */\n PreferencesModal.prototype.getBody = function(formdata) {\n if (typeof formdata === \"undefined\") {\n formdata = {};\n }\n\n // Get the content of the modal.\n var params = {\n jsonformdata: JSON.stringify(formdata),\n tab: this.tab\n };\n return Fragment.loadFragment('block_dash', 'block_preferences_form', this.contextid, params);\n };\n\n /**\n * Form submission handler.\n * @method handleFormSubmissionResponse\n * @param {Object} formData\n * @param {Boolean} closeWhenDone\n * @param {Object} response\n * @private\n * @return {Promise}\n */\n PreferencesModal.prototype.handleFormSubmissionResponse = function(formData, closeWhenDone, response) {\n if (response.validationerrors || !closeWhenDone) {\n this.modal.setBody(this.getBody(formData));\n } else if (closeWhenDone) {\n this.modal.hide();\n }\n };\n\n /**\n * @method handleFormSubmissionFailure\n * @param {Object} data\n * @private\n * @return {Promise}\n */\n PreferencesModal.prototype.handleFormSubmissionFailure = function(data) {\n // Oh noes! Epic fail :(\n // Ah wait - this is normal. We need to re-display the form with errors!\n this.modal.setBody(this.getBody(data));\n };\n\n /**\n * Private method\n *\n * @method submitFormAjax\n * @private\n * @param {boolean} closeWhenDone If true modal will close after successful submission.\n * @param {Event} e Form submission event.\n */\n PreferencesModal.prototype.submitFormAjax = function(closeWhenDone, e) {\n // We don't want to do a real form submission.\n if (e) {\n e.preventDefault();\n }\n\n // Now the change events have run, see if there are any \"invalid\" form fields.\n var invalid = $.merge(\n this.modal.getRoot().find('[aria-invalid=\"true\"]'),\n this.modal.getRoot().find('.error')\n );\n\n // If we found invalid fields, focus on the first one and do not submit via ajax.\n if (invalid.length) {\n invalid.first().focus();\n return;\n }\n\n // Convert all the form elements values to a serialised string.\n var formData = this.modal.getRoot().find('form').serialize();\n\n // Now we can continue...\n Ajax.call([{\n methodname: 'block_dash_submit_preferences_form',\n args: {\n contextid: this.contextid,\n jsonformdata: JSON.stringify(formData)\n },\n done: this.handleFormSubmissionResponse.bind(this, formData, closeWhenDone),\n fail: this.handleFormSubmissionFailure.bind(this, formData)\n }])[0].fail(Notification.exception);\n };\n\n PreferencesModal.prototype.getModal = function() {\n return this.modal;\n };\n\n /**\n * This triggers a form submission, so that any mform elements can do final tricks before the form submission is processed.\n *\n * @method submitForm\n * @param {Event} e Form submission event.\n * @private\n */\n PreferencesModal.prototype.submitForm = function(e) {\n e.preventDefault();\n this.modal.getRoot().find('form').submit();\n };\n\n PreferencesModal.prototype.initSelect2 = function() {\n this.modal.getRoot().find('.select2-form select').each(function(index, element) {\n let placeholder = null;\n if ($(element).find(\"option[value='-1']\")) {\n placeholder = {\n id: '-1', // the value of the option\n text: $(element).find(\"option[value='-1']\").text()\n };\n }\n $(element).select2({\n dropdownParent: $(this).parent(),\n allowClear: true,\n theme: 'bootstrap4',\n placeholder: placeholder\n }).on('select2:unselecting', function() {\n $(this).data('unselecting', true);\n }).on('select2:opening', function(e) {\n if ($(this).data('unselecting')) {\n $(this).removeData('unselecting');\n e.preventDefault();\n }\n });\n });\n };\n\n return PreferencesModal;\n});\n"],"file":"preferences_modal.min.js"} \ No newline at end of file +{"version":3,"file":"preferences_modal.min.js","sources":["../src/preferences_modal.js"],"sourcesContent":["/**\n * Add a create new group modal to the page.\n *\n * @module core_group/newgroup\n * @class PreferencesModal\n * @copyright 2017 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/str', 'core/modal_factory', 'core/modal_events',\n 'core/fragment', 'core/ajax', 'block_dash/select2', 'core/notification'],\n function($, Str, ModalFactory, ModalEvents, Fragment, Ajax, Select2, Notification) {\n\n /**\n * Constructor\n *\n * @param {String} selector used to find triggers for the new group modal.\n * @param {int} contextid\n * @param {Function} onCloseCallback\n *\n * Each call to init gets it's own instance of this class.\n */\n var PreferencesModal = function(selector, contextid, onCloseCallback) {\n this.contextid = contextid;\n this.onCloseCallback = onCloseCallback;\n this.tab = \"\";\n this.init(selector);\n };\n\n /**\n * @var {Modal} modal\n * @private\n */\n PreferencesModal.prototype.modal = null;\n\n /**\n * @var {int} contextid\n * @private\n */\n PreferencesModal.prototype.contextid = -1;\n\n /**\n * Initialise the class.\n *\n * @param {String} selector used to find triggers for the new group modal.\n * @private\n * @return {Promise}\n */\n PreferencesModal.prototype.init = function(selector) {\n var triggers = $(selector);\n // Fetch the title string.\n return Str.get_string('editpreferences', 'block_dash').then(function(title) {\n // Create the modal.\n return ModalFactory.create({\n type: ModalFactory.types.DEFAULT,\n title: title,\n body: this.getBody()\n }, triggers);\n }.bind(this)).then(function(modal) {\n // Keep a reference to the modal.\n this.modal = modal;\n\n // Forms are big, we want a big modal.\n this.modal.setLarge();\n\n // We want to reset the form every time it is opened.\n this.modal.getRoot().on(ModalEvents.shown, function() {\n this.modal.setBody(this.getBody());\n }.bind(this));\n\n this.modal.getRoot().on('change', '#id_config_preferences_layout', this.submitFormAjax.bind(this, false));\n\n this.modal.getRoot().on('click', '[data-action=cancel]', () => {\n this.modal.hide();\n });\n\n // We catch the modal save event, and use it to submit the form inside the modal.\n // Triggering a form submission will give JS validation scripts a chance to check for errors.\n this.modal.getRoot().on(ModalEvents.save, this.submitForm.bind(this));\n // We also catch the form submit event and use it to submit the form with ajax.\n this.modal.getRoot().on('submit', 'form', this.submitFormAjax.bind(this, true));\n\n this.modal.getRoot().on(ModalEvents.bodyRendered, function() {\n $(\"#fgroup_id_available_fields .form-inline > fieldset > div\").sortable({\n items: \".form-check-inline.fitem\",\n handle: \".drag-handle\",\n axis: \"y\"\n });\n\n this.initSelect2();\n }.bind(this));\n\n this.modal.getRoot().on(ModalEvents.hidden, function(e) {\n // Prevent \"changes may be lost\" popup.\n window.onbeforeunload = null;\n if (this.onCloseCallback) {\n this.onCloseCallback(e);\n }\n }.bind(this));\n\n this.modal.getRoot().on('click', '[data-action=change-tab]', (e) => {\n this.changeTab($(e.target).data('tab'));\n });\n\n return this.modal;\n }.bind(this));\n };\n\n PreferencesModal.prototype.changeTab = function(tab) {\n this.tab = tab;\n this.submitFormAjax(false);\n };\n\n /**\n * Get modal body content.\n * @method getBody\n * @param {Object} formdata\n * @private\n * @return {Promise}\n */\n PreferencesModal.prototype.getBody = function(formdata) {\n if (typeof formdata === \"undefined\") {\n formdata = {};\n }\n\n // Get the content of the modal.\n var params = {\n jsonformdata: JSON.stringify(formdata),\n tab: this.tab\n };\n return Fragment.loadFragment('block_dash', 'block_preferences_form', this.contextid, params);\n };\n\n /**\n * Form submission handler.\n * @method handleFormSubmissionResponse\n * @param {Object} formData\n * @param {Boolean} closeWhenDone\n * @param {Object} response\n * @private\n * @return {Promise}\n */\n PreferencesModal.prototype.handleFormSubmissionResponse = function(formData, closeWhenDone, response) {\n if (response.validationerrors || !closeWhenDone) {\n this.modal.setBody(this.getBody(formData));\n } else if (closeWhenDone) {\n this.modal.hide();\n }\n };\n\n /**\n * @method handleFormSubmissionFailure\n * @param {Object} data\n * @private\n * @return {Promise}\n */\n PreferencesModal.prototype.handleFormSubmissionFailure = function(data) {\n // Oh noes! Epic fail :(\n // Ah wait - this is normal. We need to re-display the form with errors!\n this.modal.setBody(this.getBody(data));\n };\n\n /**\n * Private method\n *\n * @method submitFormAjax\n * @private\n * @param {boolean} closeWhenDone If true modal will close after successful submission.\n * @param {Event} e Form submission event.\n */\n PreferencesModal.prototype.submitFormAjax = function(closeWhenDone, e) {\n // We don't want to do a real form submission.\n if (e) {\n e.preventDefault();\n }\n\n // Now the change events have run, see if there are any \"invalid\" form fields.\n var invalid = $.merge(\n this.modal.getRoot().find('[aria-invalid=\"true\"]'),\n this.modal.getRoot().find('.error')\n );\n\n // If we found invalid fields, focus on the first one and do not submit via ajax.\n if (invalid.length) {\n invalid.first().focus();\n return;\n }\n\n // Convert all the form elements values to a serialised string.\n var formData = this.modal.getRoot().find('form').serialize();\n\n // Now we can continue...\n Ajax.call([{\n methodname: 'block_dash_submit_preferences_form',\n args: {\n contextid: this.contextid,\n jsonformdata: JSON.stringify(formData)\n },\n done: this.handleFormSubmissionResponse.bind(this, formData, closeWhenDone),\n fail: this.handleFormSubmissionFailure.bind(this, formData)\n }])[0].fail(Notification.exception);\n };\n\n PreferencesModal.prototype.getModal = function() {\n return this.modal;\n };\n\n /**\n * This triggers a form submission, so that any mform elements can do final tricks before the form submission is processed.\n *\n * @method submitForm\n * @param {Event} e Form submission event.\n * @private\n */\n PreferencesModal.prototype.submitForm = function(e) {\n e.preventDefault();\n this.modal.getRoot().find('form').submit();\n };\n\n PreferencesModal.prototype.initSelect2 = function() {\n this.modal.getRoot().find('.select2-form select').each(function(index, element) {\n let placeholder = null;\n if ($(element).find(\"option[value='-1']\")) {\n placeholder = {\n id: '-1', // the value of the option\n text: $(element).find(\"option[value='-1']\").text()\n };\n }\n $(element).select2({\n dropdownParent: $(this).parent(),\n allowClear: true,\n theme: 'bootstrap4',\n placeholder: placeholder\n }).on('select2:unselecting', function() {\n $(this).data('unselecting', true);\n }).on('select2:opening', function(e) {\n if ($(this).data('unselecting')) {\n $(this).removeData('unselecting');\n e.preventDefault();\n }\n });\n });\n };\n\n return PreferencesModal;\n});\n"],"names":["define","$","Str","ModalFactory","ModalEvents","Fragment","Ajax","Select2","Notification","PreferencesModal","selector","contextid","onCloseCallback","tab","init","prototype","modal","triggers","get_string","then","title","create","type","types","DEFAULT","body","this","getBody","bind","setLarge","getRoot","on","shown","setBody","submitFormAjax","hide","save","submitForm","bodyRendered","sortable","items","handle","axis","initSelect2","hidden","e","window","onbeforeunload","changeTab","target","data","formdata","params","jsonformdata","JSON","stringify","loadFragment","handleFormSubmissionResponse","formData","closeWhenDone","response","validationerrors","handleFormSubmissionFailure","preventDefault","invalid","merge","find","length","first","focus","serialize","call","methodname","args","done","fail","exception","getModal","submit","each","index","element","placeholder","id","text","select2","dropdownParent","parent","allowClear","theme","removeData"],"mappings":";;;;;;;;AAQAA,sCAAO,CAAC,SAAU,WAAY,qBAAsB,oBAC5C,gBAAiB,YAAa,qBAAsB,sBACxD,SAASC,EAAGC,IAAKC,aAAcC,YAAaC,SAAUC,KAAMC,QAASC,kBAWjEC,iBAAmB,SAASC,SAAUC,UAAWC,sBAC5CD,UAAYA,eACZC,gBAAkBA,qBAClBC,IAAM,QACNC,KAAKJ,kBAOdD,iBAAiBM,UAAUC,MAAQ,KAMnCP,iBAAiBM,UAAUJ,WAAa,EASxCF,iBAAiBM,UAAUD,KAAO,SAASJ,cACnCO,SAAWhB,EAAES,iBAEVR,IAAIgB,WAAW,kBAAmB,cAAcC,KAAK,SAASC,cAE1DjB,aAAakB,OAAO,CACvBC,KAAMnB,aAAaoB,MAAMC,QACzBJ,MAAOA,MACPK,KAAMC,KAAKC,WACZV,WACLW,KAAKF,OAAOP,KAAK,SAASH,mBAEnBA,MAAQA,WAGRA,MAAMa,gBAGNb,MAAMc,UAAUC,GAAG3B,YAAY4B,MAAO,gBAClChB,MAAMiB,QAAQP,KAAKC,YAC1BC,KAAKF,YAEFV,MAAMc,UAAUC,GAAG,SAAU,gCAAiCL,KAAKQ,eAAeN,KAAKF,MAAM,SAE7FV,MAAMc,UAAUC,GAAG,QAAS,wBAAwB,UAChDf,MAAMmB,eAKVnB,MAAMc,UAAUC,GAAG3B,YAAYgC,KAAMV,KAAKW,WAAWT,KAAKF,YAE1DV,MAAMc,UAAUC,GAAG,SAAU,OAAQL,KAAKQ,eAAeN,KAAKF,MAAM,SAEpEV,MAAMc,UAAUC,GAAG3B,YAAYkC,aAAc,WAC9CrC,EAAE,6DAA6DsC,SAAS,CACpEC,MAAO,2BACPC,OAAQ,eACRC,KAAM,WAGLC,eACPf,KAAKF,YAEFV,MAAMc,UAAUC,GAAG3B,YAAYwC,OAAQ,SAASC,GAEjDC,OAAOC,eAAiB,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BM,UAAUsB,WAAa,SAASQ,GAC7CA,EAAEkB,sBACG/C,MAAMc,UAAUoC,KAAK,QAAQY,UAGtCrE,iBAAiBM,UAAU4B,YAAc,gBAChC3B,MAAMc,UAAUoC,KAAK,wBAAwBa,MAAK,SAASC,MAAOC,aAC/DC,YAAc,KACdjF,EAAEgF,SAASf,KAAK,wBAChBgB,YAAc,CACVC,GAAI,KACJC,KAAMnF,EAAEgF,SAASf,KAAK,sBAAsBkB,SAGpDnF,EAAEgF,SAASI,QAAQ,CACfC,eAAgBrF,EAAEyB,MAAM6D,SACxBC,YAAY,EACZC,MAAO,aACPP,YAAaA,cACdnD,GAAG,uBAAuB,WACzB9B,EAAEyB,MAAMwB,KAAK,eAAe,MAC7BnB,GAAG,mBAAmB,SAASc,GAC1B5C,EAAEyB,MAAMwB,KAAK,iBACbjD,EAAEyB,MAAMgE,WAAW,eACnB7C,EAAEkB,yBAMXtD"} \ No newline at end of file diff --git a/amd/build/select2.min.js b/amd/build/select2.min.js index b30b31c..91579ff 100644 --- a/amd/build/select2.min.js +++ b/amd/build/select2.min.js @@ -1,2 +1,8 @@ -function _typeof(e){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(e){return typeof e}}else{_typeof=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}}return _typeof(e)}(function(e){if("function"==typeof define&&define.amd){define ("block_dash/select2",["jquery"],e)}else if("object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports){module.exports=function(t,n){if(n===void 0){if("undefined"!=typeof window){n=require("jquery")}else{n=require("jquery")(t)}}e(n);return n}}else{e(jQuery)}})(function(e){var t=function(){if(e&&e.fn&&e.fn.select2&&e.fn.select2.amd){var t=e.fn.select2.amd}var t;(function(){if(!t||!t.requirejs){if(!t){t={}}else{n=t}var e,n,o;(function(t){var h,m,y,f,_={},b={},v={},w={},A=Object.prototype.hasOwnProperty,x=[].slice,D=/\.js$/;function r(e,t){return A.call(e,t)}function a(e,t){var n,o,r,a,s,l,d,p,c,u,g,h,m=t&&t.split("/"),y=v.map,f=y&&y["*"]||{};if(e){e=e.split("/");s=e.length-1;if(v.nodeIdCompat&&D.test(e[s])){e[s]=e[s].replace(D,"")}if("."===e[0].charAt(0)&&m){h=m.slice(0,m.length-1);e=h.concat(e)}for(c=0;c":">",'"':""","'":"'","/":"/"};if("string"!=typeof e){return e}return(e+"").replace(/[&<>"'\/\\]/g,function(e){return t[e]})};n.appendMany=function(t,n){if("1.7"===e.fn.jquery.substr(0,3)){var o=e();e.map(n,function(e){o=o.add(e)});n=o}t.append(n)};n.__cache={};var r=0;n.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");if(null==t){if(e.id){t=e.id;e.setAttribute("data-select2-id",t)}else{e.setAttribute("data-select2-id",++r);t=r.toString()}}return t};n.StoreData=function(e,t,o){var r=n.GetUniqueElementId(e);if(!n.__cache[r]){n.__cache[r]={}}n.__cache[r][t]=o};n.GetData=function(t,o){var r=n.GetUniqueElementId(t);if(o){if(n.__cache[r]){if(null!=n.__cache[r][o]){return n.__cache[r][o]}return e(t).data(o)}return e(t).data(o)}else{return n.__cache[r]}};n.RemoveData=function(e){var t=n.GetUniqueElementId(e);if(null!=n.__cache[t]){delete n.__cache[t]}e.removeAttribute("data-select2-id")};return n});t.define("select2/results",["jquery","./utils"],function(e,t){function n(e,t,o){this.$element=e;this.data=o;this.options=t;n.__super__.constructor.call(this)}t.Extend(n,t.Observable);n.prototype.render=function(){var t=e("
    ");if(this.options.get("multiple")){t.attr("aria-multiselectable","true")}this.$results=t;return t};n.prototype.clear=function(){this.$results.empty()};n.prototype.displayMessage=function(t){var n=this.options.get("escapeMarkup");this.clear();this.hideLoading();var o=e("
  • "),r=this.options.get("translations").get(t.message);o.append(n(r(t.args)));o[0].className+=" select2-results__message";this.$results.append(o)};n.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()};n.prototype.append=function(e){this.hideLoading();var t=[];if(null==e.results||0===e.results.length){if(0===this.$results.children().length){this.trigger("results:message",{message:"noResults"})}return}e.results=this.sort(e.results);for(var n=0;n",{class:"select2-results__options select2-results__options--nested"});m.append(p);i.append(d);i.append(m)}else{this.template(n,o)}t.StoreData(o,"data",n);return o};n.prototype.bind=function(n){var o=this,r=n.id+"-results";this.$results.attr("id",r);n.on("results:all",function(e){o.clear();o.append(e.data);if(n.isOpen()){o.setClasses();o.highlightFirstItem()}});n.on("results:append",function(e){o.append(e.data);if(n.isOpen()){o.setClasses()}});n.on("query",function(e){o.hideMessages();o.showLoading(e)});n.on("select",function(){if(!n.isOpen()){return}o.setClasses();if(o.options.get("scrollAfterSelect")){o.highlightFirstItem()}});n.on("unselect",function(){if(!n.isOpen()){return}o.setClasses();if(o.options.get("scrollAfterSelect")){o.highlightFirstItem()}});n.on("open",function(){o.$results.attr("aria-expanded","true");o.$results.attr("aria-hidden","false");o.setClasses();o.ensureHighlightVisible()});n.on("close",function(){o.$results.attr("aria-expanded","false");o.$results.attr("aria-hidden","true");o.$results.removeAttr("aria-activedescendant")});n.on("results:toggle",function(){var e=o.getHighlightedResults();if(0===e.length){return}e.trigger("mouseup")});n.on("results:select",function(){var e=o.getHighlightedResults();if(0===e.length){return}var n=t.GetData(e[0],"data");if("true"==e.attr("aria-selected")){o.trigger("close",{})}else{o.trigger("select",{data:n})}});n.on("results:previous",function(){var e=o.getHighlightedResults(),t=o.$results.find("[aria-selected]"),n=t.index(e);if(0>=n){return}var r=n-1;if(0===e.length){r=0}var a=t.eq(r);a.trigger("mouseenter");var s=o.$results.offset().top,l=a.offset().top,i=o.$results.scrollTop()+(l-s);if(0==r){o.$results.scrollTop(0)}else if(0>l-s){o.$results.scrollTop(i)}});n.on("results:next",function(){var e=o.getHighlightedResults(),t=o.$results.find("[aria-selected]"),n=t.index(e),r=n+1;if(r>=t.length){return}var a=t.eq(r);a.trigger("mouseenter");var s=o.$results.offset().top+o.$results.outerHeight(!1),l=a.offset().top+a.outerHeight(!1),i=o.$results.scrollTop()+l-s;if(0===r){o.$results.scrollTop(0)}else if(l>s){o.$results.scrollTop(i)}});n.on("results:focus",function(e){e.element.addClass("select2-results__option--highlighted")});n.on("results:message",function(e){o.displayMessage(e)});if(e.fn.mousewheel){this.$results.on("mousewheel",function(t){var e=o.$results.scrollTop(),n=o.$results.get(0).scrollHeight-e+t.deltaY,r=0=e-t.deltaY,a=0>t.deltaY&&n<=o.$results.height();if(r){o.$results.scrollTop(0);t.preventDefault();t.stopPropagation()}else if(a){o.$results.scrollTop(o.$results.get(0).scrollHeight-o.$results.height());t.preventDefault();t.stopPropagation()}})}this.$results.on("mouseup",".select2-results__option[aria-selected]",function(n){var r=e(this),a=t.GetData(this,"data");if("true"===r.attr("aria-selected")){if(o.options.get("multiple")){o.trigger("unselect",{originalEvent:n,data:a})}else{o.trigger("close",{})}return}o.trigger("select",{originalEvent:n,data:a})});this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(){var n=t.GetData(this,"data");o.getHighlightedResults().removeClass("select2-results__option--highlighted");o.trigger("results:focus",{data:n,element:e(this)})})};n.prototype.getHighlightedResults=function(){var e=this.$results.find(".select2-results__option--highlighted");return e};n.prototype.destroy=function(){this.$results.remove()};n.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0===e.length){return}var t=this.$results.find("[aria-selected]"),n=t.index(e),o=this.$results.offset().top,r=e.offset().top,a=this.$results.scrollTop()+(r-o),s=r-o;a-=2*e.outerHeight(!1);if(2>=n){this.$results.scrollTop(0)}else if(s>this.$results.outerHeight()||0>s){this.$results.scrollTop(a)}};n.prototype.template=function(t,n){var o=this.options.get("templateResult"),r=this.options.get("escapeMarkup"),a=o(t,n);if(null==a){n.style.display="none"}else if("string"==typeof a){n.innerHTML=r(a)}else{e(n).append(a)}};return n});t.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}});t.define("select2/selection/base",["jquery","../utils","../keys"],function(t,e,n){function o(e,t){this.$element=e;this.options=t;o.__super__.constructor.call(this)}e.Extend(o,e.Observable);o.prototype.render=function(){var n=t("");this._tabindex=0;if(null!=e.GetData(this.$element[0],"old-tabindex")){this._tabindex=e.GetData(this.$element[0],"old-tabindex")}else if(null!=this.$element.attr("tabindex")){this._tabindex=this.$element.attr("tabindex")}n.attr("title",this.$element.attr("title"));n.attr("tabindex",this._tabindex);n.attr("aria-disabled","false");this.$selection=n;return n};o.prototype.bind=function(e){var t=this,o=e.id+"-results";this.container=e;this.$selection.on("focus",function(e){t.trigger("focus",e)});this.$selection.on("blur",function(e){t._handleBlur(e)});this.$selection.on("keydown",function(e){t.trigger("keypress",e);if(e.which===n.SPACE){e.preventDefault()}});e.on("results:focus",function(e){t.$selection.attr("aria-activedescendant",e.data._resultId)});e.on("selection:update",function(e){t.update(e.data)});e.on("open",function(){t.$selection.attr("aria-expanded","true");t.$selection.attr("aria-owns",o);t._attachCloseHandler(e)});e.on("close",function(){t.$selection.attr("aria-expanded","false");t.$selection.removeAttr("aria-activedescendant");t.$selection.removeAttr("aria-owns");t.$selection.trigger("focus");t._detachCloseHandler(e)});e.on("enable",function(){t.$selection.attr("tabindex",t._tabindex);t.$selection.attr("aria-disabled","false")});e.on("disable",function(){t.$selection.attr("tabindex","-1");t.$selection.attr("aria-disabled","true")})};o.prototype._handleBlur=function(e){var n=this;window.setTimeout(function(){if(document.activeElement==n.$selection[0]||t.contains(n.$selection[0],document.activeElement)){return}n.trigger("blur",e)},1)};o.prototype._attachCloseHandler=function(n){t(document.body).on("mousedown.select2."+n.id,function(n){var o=t(n.target),r=o.closest(".select2"),a=t(".select2.select2-container--open");a.each(function(){if(this==r[0]){return}var t=e.GetData(this,"element");t.select2("close")})})};o.prototype._detachCloseHandler=function(e){t(document.body).off("mousedown.select2."+e.id)};o.prototype.position=function(e,t){var n=t.find(".selection");n.append(e)};o.prototype.destroy=function(){this._detachCloseHandler(this.container)};o.prototype.update=function(){throw new Error("The `update` method must be defined in child classes.")};o.prototype.isEnabled=function(){return!this.isDisabled()};o.prototype.isDisabled=function(){return this.options.get("disabled")};return o});t.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n){function o(){o.__super__.constructor.apply(this,arguments)}n.Extend(o,t);o.prototype.render=function(){var e=o.__super__.render.call(this);e.addClass("select2-selection--single");e.html("");return e};o.prototype.bind=function(e){var t=this;o.__super__.bind.apply(this,arguments);var n=e.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",n).attr("role","textbox").attr("aria-readonly","true");this.$selection.attr("aria-labelledby",n);this.$selection.on("mousedown",function(e){if(1!==e.which){return}t.trigger("toggle",{originalEvent:e})});this.$selection.on("focus",function(){});this.$selection.on("blur",function(){});e.on("focus",function(){if(!e.isOpen()){t.$selection.trigger("focus")}})};o.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty();e.removeAttr("title")};o.prototype.display=function(e,t){var n=this.options.get("templateSelection"),o=this.options.get("escapeMarkup");return o(n(e,t))};o.prototype.selectionContainer=function(){return e("")};o.prototype.update=function(e){if(0===e.length){this.clear();return}var t=e[0],n=this.$selection.find(".select2-selection__rendered"),o=this.display(t,n);n.empty().append(o);var r=t.title||t.text;if(r){n.attr("title",r)}else{n.removeAttr("title")}};return o});t.define("select2/selection/multiple",["jquery","./base","../utils"],function(e,t,n){function o(){o.__super__.constructor.apply(this,arguments)}n.Extend(o,t);o.prototype.render=function(){var e=o.__super__.render.call(this);e.addClass("select2-selection--multiple");e.html("
      ");return e};o.prototype.bind=function(){var t=this;o.__super__.bind.apply(this,arguments);this.$selection.on("click",function(e){t.trigger("toggle",{originalEvent:e})});this.$selection.on("click",".select2-selection__choice__remove",function(o){if(t.isDisabled()){return}var r=e(this),a=r.parent(),s=n.GetData(a[0],"data");t.trigger("unselect",{originalEvent:o,data:s})})};o.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty();e.removeAttr("title")};o.prototype.display=function(e,t){var n=this.options.get("templateSelection"),o=this.options.get("escapeMarkup");return o(n(e,t))};o.prototype.selectionContainer=function(){var t=e("
    • ×
    • ");return t};o.prototype.update=function(e){this.clear();if(0===e.length){return}for(var t=[],o=0;o×");n.StoreData(a[0],"data",o);this.$selection.find(".select2-selection__rendered").prepend(a)};return o});t.define("select2/selection/search",["jquery","../utils","../keys"],function(e,t,n){function o(e,t,n){e.call(this,t,n)}o.prototype.render=function(t){var n=e("");this.$searchContainer=n;this.$search=n.find("input");var o=t.call(this);this._transferTabIndex();return o};o.prototype.bind=function(e,o,r){var a=this,s=o.id+"-results";e.call(this,o,r);o.on("open",function(){a.$search.attr("aria-controls",s);a.$search.trigger("focus")});o.on("close",function(){a.$search.val("");a.$search.removeAttr("aria-controls");a.$search.removeAttr("aria-activedescendant");a.$search.trigger("focus")});o.on("enable",function(){a.$search.prop("disabled",!1);a._transferTabIndex()});o.on("disable",function(){a.$search.prop("disabled",!0)});o.on("focus",function(){a.$search.trigger("focus")});o.on("results:focus",function(e){if(e.data._resultId){a.$search.attr("aria-activedescendant",e.data._resultId)}else{a.$search.removeAttr("aria-activedescendant")}});this.$selection.on("focusin",".select2-search--inline",function(e){a.trigger("focus",e)});this.$selection.on("focusout",".select2-search--inline",function(e){a._handleBlur(e)});this.$selection.on("keydown",".select2-search--inline",function(e){e.stopPropagation();a.trigger("keypress",e);a._keyUpPrevented=e.isDefaultPrevented();var o=e.which;if(o===n.BACKSPACE&&""===a.$search.val()){var r=a.$searchContainer.prev(".select2-selection__choice");if(0=l;this.$selection.on("input.searchcheck",".select2-search--inline",function(){if(i){a.$selection.off("input.search input.searchcheck");return}a.$selection.off("keyup.search")});this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){if(i&&"input"===e.type){a.$selection.off("input.search input.searchcheck");return}var t=e.which;if(t==n.SHIFT||t==n.CTRL||t==n.ALT){return}if(t==n.TAB){return}a.handleSearch(e)})};o.prototype._transferTabIndex=function(){this.$search.attr("tabindex",this.$selection.attr("tabindex"));this.$selection.attr("tabindex","-1")};o.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)};o.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder","");e.call(this,t);this.$selection.find(".select2-selection__rendered").append(this.$searchContainer);this.resizeSearch();if(n){this.$search.trigger("focus")}};o.prototype.handleSearch=function(){this.resizeSearch();if(!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1};o.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t});this.$search.val(t.text);this.handleSearch()};o.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";if(""!==this.$search.attr("placeholder")){e=this.$selection.find(".select2-selection__rendered").width()}else{var t=this.$search.val().length+1;e=.75*t+"em"}this.$search.css("width",e)};return o});t.define("select2/selection/eventRelay",["jquery"],function(e){function t(){}t.prototype.bind=function(t,n,o){var r=this,a=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],s=["opening","closing","selecting","unselecting","clearing"];t.call(this,n,o);n.on("*",function(t,n){if(-1===e.inArray(t,a)){return}n=n||{};var o=e.Event("select2:"+t,{params:n});r.$element.trigger(o);if(-1===e.inArray(t,s)){return}n.prevented=o.isDefaultPrevented()})};return t});t.define("select2/translation",["jquery","require"],function(e,t){function n(e){this.dict=e||{}}n.prototype.all=function(){return this.dict};n.prototype.get=function(e){return this.dict[e]};n.prototype.extend=function(t){this.dict=e.extend({},t.all(),this.dict)};n._cache={};n.loadPath=function(e){if(!(e in n._cache)){var o=t(e);n._cache[e]=o}return new n(n._cache[e])};return n});t.define("select2/diacritics",[],function(){return{"Ⓐ":"A",A:"A",À:"A",Á:"A",Â:"A",Ầ:"A",Ấ:"A",Ẫ:"A",Ẩ:"A",Ã:"A",Ā:"A",Ă:"A",Ằ:"A",Ắ:"A",Ẵ:"A",Ẳ:"A",Ȧ:"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:"v",ꝡ:"vy","ⓦ":"w",w:"w",ẁ:"w",ẃ:"w",ŵ:"w",ẇ:"w",ẅ:"w",ẘ:"w",ẉ:"w",ⱳ:"w","ⓧ":"x",x:"x",ẋ:"x",ẍ:"x","ⓨ":"y",y:"y",ỳ:"y",ý:"y",ŷ:"y",ỹ:"y",ȳ:"y",ẏ:"y",ÿ:"y",ỷ:"y",ẙ:"y",ỵ:"y",ƴ:"y",ɏ:"y",ỿ:"y","ⓩ":"z",z:"z",ź:"z",ẑ:"z",ż:"z",ž:"z",ẓ:"z",ẕ:"z",ƶ:"z",ȥ:"z",ɀ:"z",ⱬ:"z",ꝣ:"z",Ά:"\u0391",Έ:"\u0395",Ή:"\u0397",Ί:"\u0399",Ϊ:"\u0399",Ό:"\u039F",Ύ:"\u03A5",Ϋ:"\u03A5",Ώ:"\u03A9",ά:"\u03B1",έ:"\u03B5",ή:"\u03B7",ί:"\u03B9",ϊ:"\u03B9",ΐ:"\u03B9",ό:"\u03BF",ύ:"\u03C5",ϋ:"\u03C5",ΰ:"\u03C5",ώ:"\u03C9",ς:"\u03C3","’":"'"}});t.define("select2/data/base",["../utils"],function(e){function t(){t.__super__.constructor.call(this)}e.Extend(t,e.Observable);t.prototype.current=function(){throw new Error("The `current` method must be defined in child classes.")};t.prototype.query=function(){throw new Error("The `query` method must be defined in child classes.")};t.prototype.bind=function(){};t.prototype.destroy=function(){};t.prototype.generateResultId=function(t,n){var o=t.id+"-result-";o+=e.generateChars(4);if(null!=n.id){o+="-"+n.id.toString()}else{o+="-"+e.generateChars(4)}return o};return t});t.define("select2/data/select",["./base","../utils","jquery"],function(e,t,n){function o(e,t){this.$element=e;this.options=t;o.__super__.constructor.call(this)}t.Extend(o,e);o.prototype.current=function(e){var t=[],o=this;this.$element.find(":selected").each(function(){var e=n(this),r=o.item(e);t.push(r)});e(t)};o.prototype.select=function(e){var t=this;e.selected=!0;if(n(e.element).is("option")){e.element.selected=!0;this.$element.trigger("input").trigger("change");return}if(this.$element.prop("multiple")){this.current(function(o){var r=[];e=[e];e.push.apply(e,o);for(var a=0,s;athis.maximumInputLength){this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}});return}e.call(this,t,n)};return e});t.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength");e.call(this,t,n)}e.prototype.bind=function(e,t,n){var o=this;e.call(this,t,n);t.on("select",function(){o._checkIfMaximumSelected()})};e.prototype.query=function(e,t,n){var o=this;this._checkIfMaximumSelected(function(){e.call(o,t,n)})};e.prototype._checkIfMaximumSelected=function(e,t){var n=this;this.current(function(e){var o=null!=e?e.length:0;if(0=n.maximumSelectionLength){n.trigger("results:message",{message:"maximumSelected",args:{maximum:n.maximumSelectionLength}});return}if(t){t()}})};return e});t.define("select2/dropdown",["jquery","./utils"],function(e,t){function n(e,t){this.$element=e;this.options=t;n.__super__.constructor.call(this)}t.Extend(n,t.Observable);n.prototype.render=function(){var t=e("");t.attr("dir",this.options.get("dir"));this.$dropdown=t;return t};n.prototype.bind=function(){};n.prototype.position=function(){};n.prototype.destroy=function(){this.$dropdown.remove()};return n});t.define("select2/dropdown/search",["jquery","../utils"],function(e){function t(){}t.prototype.render=function(t){var n=t.call(this),o=e("");this.$searchContainer=o;this.$search=o.find("input");n.prepend(o);return n};t.prototype.bind=function(t,n,o){var r=this,a=n.id+"-results";t.call(this,n,o);this.$search.on("keydown",function(e){r.trigger("keypress",e);r._keyUpPrevented=e.isDefaultPrevented()});this.$search.on("input",function(){e(this).off("keyup")});this.$search.on("keyup input",function(e){r.handleSearch(e)});n.on("open",function(){r.$search.attr("tabindex",0);r.$search.attr("aria-controls",a);r.$search.trigger("focus");window.setTimeout(function(){r.$search.trigger("focus")},0)});n.on("close",function(){r.$search.attr("tabindex",-1);r.$search.removeAttr("aria-controls");r.$search.removeAttr("aria-activedescendant");r.$search.val("");r.$search.trigger("blur")});n.on("focus",function(){if(!n.isOpen()){r.$search.trigger("focus")}});n.on("results:all",function(e){if(null==e.query.term||""===e.query.term){var t=r.showSearch(e);if(t){r.$searchContainer.removeClass("select2-search--hide")}else{r.$searchContainer.addClass("select2-search--hide")}}});n.on("results:focus",function(e){if(e.data._resultId){r.$search.attr("aria-activedescendant",e.data._resultId)}else{r.$search.removeAttr("aria-activedescendant")}})};t.prototype.handleSearch=function(){if(!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1};t.prototype.showSearch=function(){return!0};return t});t.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,o){this.placeholder=this.normalizePlaceholder(n.get("placeholder"));e.call(this,t,n,o)}e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results);e.call(this,t)};e.prototype.normalizePlaceholder=function(e,t){if("string"==typeof t){t={id:"",text:t}}return t};e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),o=t.length-1,r;0<=o;o--){r=t[o];if(this.placeholder.id===r.id){n.splice(o,1)}}return n};return e});t.define("select2/dropdown/infiniteScroll",["jquery"],function(e){function t(e,t,n,o){this.lastParams={};e.call(this,t,n,o);this.$loadingMore=this.createLoadingMore();this.loading=!1}t.prototype.append=function(e,t){this.$loadingMore.remove();this.loading=!1;e.call(this,t);if(this.showLoadingMore(t)){this.$results.append(this.$loadingMore);this.loadMoreIfNeeded()}};t.prototype.bind=function(e,t,n){var o=this;e.call(this,t,n);t.on("query",function(e){o.lastParams=e;o.loading=!0});t.on("query:append",function(e){o.lastParams=e;o.loading=!0});this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))};t.prototype.loadMoreIfNeeded=function(){var t=e.contains(document.documentElement,this.$loadingMore[0]);if(this.loading||!t){return}var n=this.$results.offset().top+this.$results.outerHeight(!1),o=this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1);if(n+50>=o){this.loadMore()}};t.prototype.loadMore=function(){this.loading=!0;var t=e.extend({},{page:1},this.lastParams);t.page++;this.trigger("query:append",t)};t.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more};t.prototype.createLoadingMore=function(){var t=e("
    • "),n=this.options.get("translations").get("loadingMore");t.html(n(this.lastParams));return t};return t});t.define("select2/dropdown/attachBody",["jquery","../utils"],function(e,t){function n(t,n,o){this.$dropdownParent=e(o.get("dropdownParent")||document.body);t.call(this,n,o)}n.prototype.bind=function(e,t,n){var o=this;e.call(this,t,n);t.on("open",function(){o._showDropdown();o._attachPositioningHandler(t);o._bindContainerResultHandlers(t)});t.on("close",function(){o._hideDropdown();o._detachPositioningHandler(t)});this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})};n.prototype.destroy=function(e){e.call(this);this.$dropdownContainer.remove()};n.prototype.position=function(e,t,n){t.attr("class",n.attr("class"));t.removeClass("select2");t.addClass("select2-container--open");t.css({position:"absolute",top:-999999});this.$container=n};n.prototype.render=function(t){var n=e(""),o=t.call(this);n.append(o);this.$dropdownContainer=n;return n};n.prototype._hideDropdown=function(){this.$dropdownContainer.detach()};n.prototype._bindContainerResultHandlers=function(e,t){if(this._containerResultsHandlersBound){return}var n=this;t.on("results:all",function(){n._positionDropdown();n._resizeDropdown()});t.on("results:append",function(){n._positionDropdown();n._resizeDropdown()});t.on("results:message",function(){n._positionDropdown();n._resizeDropdown()});t.on("select",function(){n._positionDropdown();n._resizeDropdown()});t.on("unselect",function(){n._positionDropdown();n._resizeDropdown()});this._containerResultsHandlersBound=!0};n.prototype._attachPositioningHandler=function(n,o){var r=this,a="scroll.select2."+o.id,s="resize.select2."+o.id,l="orientationchange.select2."+o.id,i=this.$container.parents().filter(t.hasScroll);i.each(function(){t.StoreData(this,"select2-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})});i.on(a,function(){var n=t.GetData(this,"select2-scroll-position");e(this).scrollTop(n.y)});e(window).on(a+" "+s+" "+l,function(){r._positionDropdown();r._resizeDropdown()})};n.prototype._detachPositioningHandler=function(n,o){var r="scroll.select2."+o.id,a="resize.select2."+o.id,s="orientationchange.select2."+o.id,l=this.$container.parents().filter(t.hasScroll);l.off(r);e(window).off(r+" "+a+" "+s)};n.prototype._positionDropdown=function(){var t=e(window),n=this.$dropdown.hasClass("select2-dropdown--above"),o=this.$dropdown.hasClass("select2-dropdown--below"),r=null,a=this.$container.offset();a.bottom=a.top+this.$container.outerHeight(!1);var s={height:this.$container.outerHeight(!1),top:a.top};s.bottom=a.top+s.height;var l={height:this.$dropdown.outerHeight(!1)},i={top:t.scrollTop(),bottom:t.scrollTop()+t.height()},d=i.topa.bottom+l.height,c={left:a.left,top:s.bottom},u=this.$dropdownParent;if("static"===u.css("position")){u=u.offsetParent()}var g={top:0,left:0};if(e.contains(document.body,u[0])||u[0].isConnected){g=u.offset()}c.top-=g.top;c.left-=g.left;if(!n&&!o){r="below"}if(!p&&d&&!n){r="above"}else if(!d&&p&&n){r="below"}if("above"==r||n&&"below"!==r){c.top=s.top-g.top-l.height}if(null!=r){this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+r);this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+r)}this.$dropdownContainer.css(c)};n.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};if(this.options.get("dropdownAutoWidth")){e.minWidth=e.width;e.position="relative";e.width="auto"}this.$dropdown.css(e)};n.prototype._showDropdown=function(){this.$dropdownContainer.appendTo(this.$dropdownParent);this._positionDropdown();this._resizeDropdown()};return n});t.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(t){for(var n=0,o=0,r;othis.minimumResultsForSearch){this.minimumResultsForSearch=1/0}e.call(this,t,n,o)}t.prototype.showSearch=function(t,n){if(e(n.data.results)r.length){return}var a=e.GetData(r[0],"data");if(null!=a.element&&a.element.selected||null==a.element&&a.selected){return}this.trigger("select",{data:a})};return t});t.define("select2/dropdown/closeOnSelect",[],function(){function e(){}e.prototype.bind=function(e,t,n){var o=this;e.call(this,t,n);t.on("select",function(e){o._selectTriggered(e)});t.on("unselect",function(e){o._selectTriggered(e)})};e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;if(n&&(n.ctrlKey||n.metaKey)){return}this.trigger("close",{originalEvent:n,originalSelect2Event:t})};return e});t.define("select2/i18n/en",[],function(){return{errorLoading:function errorLoading(){return"The results could not be loaded."},inputTooLong:function inputTooLong(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";if(1!=t){n+="s"}return n},inputTooShort:function inputTooShort(e){var t=e.minimum-e.input.length;return"Please enter "+t+" or more characters"},loadingMore:function loadingMore(){return"Loading more results\u2026"},maximumSelected:function maximumSelected(e){var t="You can only select "+e.maximum+" item";if(1!=e.maximum){t+="s"}return t},noResults:function noResults(){return"No results found"},searching:function searching(){return"Searching\u2026"},removeAllItems:function removeAllItems(){return"Remove all items"}}});t.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(e,t,n,o,r,a,s,l,i,d,p,c,u,g,h,m,y,f,_,b,v,w,A,x,D,S,C,E){function O(){this.reset()}O.prototype.apply=function(p){p=e.extend(!0,{},this.defaults,p);if(null==p.dataAdapter){if(null!=p.ajax){p.dataAdapter=h}else if(null!=p.data){p.dataAdapter=g}else{p.dataAdapter=u}if(0=o){return"auto"}return o+"px"}if("style"==t){var r=e.attr("style");if("string"!=typeof r){return null}for(var a=r.split(";"),s=0,d=a.length;s");t.attr("dir",this.options.get("dir"));this.$container=t;this.$container.addClass("select2-container--"+this.options.get("theme"));n.StoreData(t[0],"element",this.$element);return t};return r});t.define("select2/compat/utils",["jquery"],function(e){return{syncCssClasses:function(t,n,o){var r,a=[],s;r=e.trim(t.attr("class"));if(r){r=""+r;e(r.split(/\s+/)).each(function(){if(0===this.indexOf("select2-")){a.push(this)}})}r=e.trim(n.attr("class"));if(r){r=""+r;e(r.split(/\s+/)).each(function(){if(0!==this.indexOf("select2-")){s=o(this);if(null!=s){a.push(s)}}})}t.attr("class",a.join(" "))}}});t.define("select2/compat/containerCss",["jquery","./utils"],function(e,t){function n(){return null}function o(){}o.prototype.render=function(o){var r=o.call(this),a=this.options.get("containerCssClass")||"";if(e.isFunction(a)){a=a(this.$element)}var s=this.options.get("adaptContainerCssClass");s=s||n;if(-1!==a.indexOf(":all:")){a=a.replace(":all:","");var l=s;s=function(e){var t=l(e);if(null!=t){return t+" "+e}return e}}var i=this.options.get("containerCss")||{};if(e.isFunction(i)){i=i(this.$element)}t.syncCssClasses(r,this.$element,s);r.css(i);r.addClass(a);return r};return o});t.define("select2/compat/dropdownCss",["jquery","./utils"],function(e,t){function n(){return null}function o(){}o.prototype.render=function(o){var r=o.call(this),a=this.options.get("dropdownCssClass")||"";if(e.isFunction(a)){a=a(this.$element)}var s=this.options.get("adaptDropdownCssClass");s=s||n;if(-1!==a.indexOf(":all:")){a=a.replace(":all:","");var l=s;s=function(e){var t=l(e);if(null!=t){return t+" "+e}return e}}var i=this.options.get("dropdownCss")||{};if(e.isFunction(i)){i=i(this.$element)}t.syncCssClasses(r,this.$element,s);r.css(i);r.addClass(a);return r};return o});t.define("select2/compat/initSelection",["jquery"],function(e){function t(e,t,n){if(n.get("debug")&&window.console&&console.warn){console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2")}this.initSelection=n.get("initSelection");this._isInitialized=!1;e.call(this,t,n)}t.prototype.current=function(t,n){var o=this;if(this._isInitialized){t.call(this,n);return}this.initSelection.call(null,this.$element,function(t){o._isInitialized=!0;if(!e.isArray(t)){t=[t]}n(t)})};return t});t.define("select2/compat/inputData",["jquery","../utils"],function(e,t){function n(e,t,n){this._currentData=[];this._valueSeparator=n.get("valueSeparator")||",";if("hidden"===t.prop("type")){if(n.get("debug")&&console&&console.warn){console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `');this.$searchContainer=$search,this.$search=$search.find("input");var $rendered=decorated.call(this);return this._transferTabIndex(),$rendered},Search.prototype.bind=function(decorated,container,$container){var self=this,resultsId=container.id+"-results";decorated.call(this,container,$container),container.on("open",(function(){self.$search.attr("aria-controls",resultsId),self.$search.trigger("focus")})),container.on("close",(function(){self.$search.val(""),self.$search.removeAttr("aria-controls"),self.$search.removeAttr("aria-activedescendant"),self.$search.trigger("focus")})),container.on("enable",(function(){self.$search.prop("disabled",!1),self._transferTabIndex()})),container.on("disable",(function(){self.$search.prop("disabled",!0)})),container.on("focus",(function(evt){self.$search.trigger("focus")})),container.on("results:focus",(function(params){params.data._resultId?self.$search.attr("aria-activedescendant",params.data._resultId):self.$search.removeAttr("aria-activedescendant")})),this.$selection.on("focusin",".select2-search--inline",(function(evt){self.trigger("focus",evt)})),this.$selection.on("focusout",".select2-search--inline",(function(evt){self._handleBlur(evt)})),this.$selection.on("keydown",".select2-search--inline",(function(evt){if(evt.stopPropagation(),self.trigger("keypress",evt),self._keyUpPrevented=evt.isDefaultPrevented(),evt.which===KEYS.BACKSPACE&&""===self.$search.val()){var $previousChoice=self.$searchContainer.prev(".select2-selection__choice");if($previousChoice.length>0){var item=Utils.GetData($previousChoice[0],"data");self.searchRemoveChoice(item),evt.preventDefault()}}})),this.$selection.on("click",".select2-search--inline",(function(evt){self.$search.val()&&evt.stopPropagation()}));var msie=document.documentMode,disableInputEvents=msie&&msie<=11;this.$selection.on("input.searchcheck",".select2-search--inline",(function(evt){disableInputEvents?self.$selection.off("input.search input.searchcheck"):self.$selection.off("keyup.search")})),this.$selection.on("keyup.search input.search",".select2-search--inline",(function(evt){if(disableInputEvents&&"input"===evt.type)self.$selection.off("input.search input.searchcheck");else{var key=evt.which;key!=KEYS.SHIFT&&key!=KEYS.CTRL&&key!=KEYS.ALT&&key!=KEYS.TAB&&self.handleSearch(evt)}}))},Search.prototype._transferTabIndex=function(decorated){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},Search.prototype.createPlaceholder=function(decorated,placeholder){this.$search.attr("placeholder",placeholder.text)},Search.prototype.update=function(decorated,data){var searchHadFocus=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),decorated.call(this,data),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),searchHadFocus&&this.$search.trigger("focus")},Search.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var input=this.$search.val();this.trigger("query",{term:input})}this._keyUpPrevented=!1},Search.prototype.searchRemoveChoice=function(decorated,item){this.trigger("unselect",{data:item}),this.$search.val(item.text),this.handleSearch()},Search.prototype.resizeSearch=function(){this.$search.css("width","25px");var width="";width=""!==this.$search.attr("placeholder")?this.$selection.find(".select2-selection__rendered").width():.75*(this.$search.val().length+1)+"em",this.$search.css("width",width)},Search})),S2.define("select2/selection/eventRelay",["jquery"],(function($){function EventRelay(){}return EventRelay.prototype.bind=function(decorated,container,$container){var self=this,relayEvents=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],preventableEvents=["opening","closing","selecting","unselecting","clearing"];decorated.call(this,container,$container),container.on("*",(function(name,params){if(-1!==$.inArray(name,relayEvents)){params=params||{};var evt=$.Event("select2:"+name,{params:params});self.$element.trigger(evt),-1!==$.inArray(name,preventableEvents)&&(params.prevented=evt.isDefaultPrevented())}}))},EventRelay})),S2.define("select2/translation",["jquery","require"],(function($,require){function Translation(dict){this.dict=dict||{}}return Translation.prototype.all=function(){return this.dict},Translation.prototype.get=function(key){return this.dict[key]},Translation.prototype.extend=function(translation){this.dict=$.extend({},translation.all(),this.dict)},Translation._cache={},Translation.loadPath=function(path){if(!(path in Translation._cache)){var translations=require(path);Translation._cache[path]=translations}return new Translation(Translation._cache[path])},Translation})),S2.define("select2/diacritics",[],(function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}})),S2.define("select2/data/base",["../utils"],(function(Utils){function BaseAdapter($element,options){BaseAdapter.__super__.constructor.call(this)}return Utils.Extend(BaseAdapter,Utils.Observable),BaseAdapter.prototype.current=function(callback){throw new Error("The `current` method must be defined in child classes.")},BaseAdapter.prototype.query=function(params,callback){throw new Error("The `query` method must be defined in child classes.")},BaseAdapter.prototype.bind=function(container,$container){},BaseAdapter.prototype.destroy=function(){},BaseAdapter.prototype.generateResultId=function(container,data){var id=container.id+"-result-";return id+=Utils.generateChars(4),null!=data.id?id+="-"+data.id.toString():id+="-"+Utils.generateChars(4),id},BaseAdapter})),S2.define("select2/data/select",["./base","../utils","jquery"],(function(BaseAdapter,Utils,$){function SelectAdapter($element,options){this.$element=$element,this.options=options,SelectAdapter.__super__.constructor.call(this)}return Utils.Extend(SelectAdapter,BaseAdapter),SelectAdapter.prototype.current=function(callback){var data=[],self=this;this.$element.find(":selected").each((function(){var $option=$(this),option=self.item($option);data.push(option)})),callback(data)},SelectAdapter.prototype.select=function(data){var self=this;if(data.selected=!0,$(data.element).is("option"))return data.element.selected=!0,void this.$element.trigger("input").trigger("change");if(this.$element.prop("multiple"))this.current((function(currentData){var val=[];(data=[data]).push.apply(data,currentData);for(var d=0;d=0){var $existingOption=$existing.filter(onlyItem(item)),existingData=this.item($existingOption),newData=$.extend(!0,{},item,existingData),$newOption=this.option(newData);$existingOption.replaceWith($newOption)}else{var $option=this.option(item);if(item.children){var $children=this.convertToOptions(item.children);Utils.appendMany($option,$children)}$options.push($option)}}return $options},ArrayAdapter})),S2.define("select2/data/ajax",["./array","../utils","jquery"],(function(ArrayAdapter,Utils,$){function AjaxAdapter($element,options){this.ajaxOptions=this._applyDefaults(options.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),AjaxAdapter.__super__.constructor.call(this,$element,options)}return Utils.Extend(AjaxAdapter,ArrayAdapter),AjaxAdapter.prototype._applyDefaults=function(options){var defaults={data:function(params){return $.extend({},params,{q:params.term})},transport:function(params,success,failure){var $request=$.ajax(params);return $request.then(success),$request.fail(failure),$request}};return $.extend({},defaults,options,!0)},AjaxAdapter.prototype.processResults=function(results){return results},AjaxAdapter.prototype.query=function(params,callback){var self=this;null!=this._request&&($.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var options=$.extend({type:"GET"},this.ajaxOptions);function request(){var $request=options.transport(options,(function(data){var results=self.processResults(data,params);self.options.get("debug")&&window.console&&console.error&&(results&&results.results&&$.isArray(results.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),callback(results)}),(function(){(!("status"in $request)||0!==$request.status&&"0"!==$request.status)&&self.trigger("results:message",{message:"errorLoading"})}));self._request=$request}"function"==typeof options.url&&(options.url=options.url.call(this.$element,params)),"function"==typeof options.data&&(options.data=options.data.call(this.$element,params)),this.ajaxOptions.delay&&null!=params.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(request,this.ajaxOptions.delay)):request()},AjaxAdapter})),S2.define("select2/data/tags",["jquery"],(function($){function Tags(decorated,$element,options){var tags=options.get("tags"),createTag=options.get("createTag");void 0!==createTag&&(this.createTag=createTag);var insertTag=options.get("insertTag");if(void 0!==insertTag&&(this.insertTag=insertTag),decorated.call(this,$element,options),$.isArray(tags))for(var t=0;t0&¶ms.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:params.term,params:params}}):decorated.call(this,params,callback)},MaximumInputLength})),S2.define("select2/data/maximumSelectionLength",[],(function(){function MaximumSelectionLength(decorated,$e,options){this.maximumSelectionLength=options.get("maximumSelectionLength"),decorated.call(this,$e,options)}return MaximumSelectionLength.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("select",(function(){self._checkIfMaximumSelected()}))},MaximumSelectionLength.prototype.query=function(decorated,params,callback){var self=this;this._checkIfMaximumSelected((function(){decorated.call(self,params,callback)}))},MaximumSelectionLength.prototype._checkIfMaximumSelected=function(_,successCallback){var self=this;this.current((function(currentData){var count=null!=currentData?currentData.length:0;self.maximumSelectionLength>0&&count>=self.maximumSelectionLength?self.trigger("results:message",{message:"maximumSelected",args:{maximum:self.maximumSelectionLength}}):successCallback&&successCallback()}))},MaximumSelectionLength})),S2.define("select2/dropdown",["jquery","./utils"],(function($,Utils){function Dropdown($element,options){this.$element=$element,this.options=options,Dropdown.__super__.constructor.call(this)}return Utils.Extend(Dropdown,Utils.Observable),Dropdown.prototype.render=function(){var $dropdown=$('');return $dropdown.attr("dir",this.options.get("dir")),this.$dropdown=$dropdown,$dropdown},Dropdown.prototype.bind=function(){},Dropdown.prototype.position=function($dropdown,$container){},Dropdown.prototype.destroy=function(){this.$dropdown.remove()},Dropdown})),S2.define("select2/dropdown/search",["jquery","../utils"],(function($,Utils){function Search(){}return Search.prototype.render=function(decorated){var $rendered=decorated.call(this),$search=$('');return this.$searchContainer=$search,this.$search=$search.find("input"),$rendered.prepend($search),$rendered},Search.prototype.bind=function(decorated,container,$container){var self=this,resultsId=container.id+"-results";decorated.call(this,container,$container),this.$search.on("keydown",(function(evt){self.trigger("keypress",evt),self._keyUpPrevented=evt.isDefaultPrevented()})),this.$search.on("input",(function(evt){$(this).off("keyup")})),this.$search.on("keyup input",(function(evt){self.handleSearch(evt)})),container.on("open",(function(){self.$search.attr("tabindex",0),self.$search.attr("aria-controls",resultsId),self.$search.trigger("focus"),window.setTimeout((function(){self.$search.trigger("focus")}),0)})),container.on("close",(function(){self.$search.attr("tabindex",-1),self.$search.removeAttr("aria-controls"),self.$search.removeAttr("aria-activedescendant"),self.$search.val(""),self.$search.trigger("blur")})),container.on("focus",(function(){container.isOpen()||self.$search.trigger("focus")})),container.on("results:all",(function(params){null!=params.query.term&&""!==params.query.term||(self.showSearch(params)?self.$searchContainer.removeClass("select2-search--hide"):self.$searchContainer.addClass("select2-search--hide"))})),container.on("results:focus",(function(params){params.data._resultId?self.$search.attr("aria-activedescendant",params.data._resultId):self.$search.removeAttr("aria-activedescendant")}))},Search.prototype.handleSearch=function(evt){if(!this._keyUpPrevented){var input=this.$search.val();this.trigger("query",{term:input})}this._keyUpPrevented=!1},Search.prototype.showSearch=function(_,params){return!0},Search})),S2.define("select2/dropdown/hidePlaceholder",[],(function(){function HidePlaceholder(decorated,$element,options,dataAdapter){this.placeholder=this.normalizePlaceholder(options.get("placeholder")),decorated.call(this,$element,options,dataAdapter)}return HidePlaceholder.prototype.append=function(decorated,data){data.results=this.removePlaceholder(data.results),decorated.call(this,data)},HidePlaceholder.prototype.normalizePlaceholder=function(_,placeholder){return"string"==typeof placeholder&&(placeholder={id:"",text:placeholder}),placeholder},HidePlaceholder.prototype.removePlaceholder=function(_,data){for(var modifiedData=data.slice(0),d=data.length-1;d>=0;d--){var item=data[d];this.placeholder.id===item.id&&modifiedData.splice(d,1)}return modifiedData},HidePlaceholder})),S2.define("select2/dropdown/infiniteScroll",["jquery"],(function($){function InfiniteScroll(decorated,$element,options,dataAdapter){this.lastParams={},decorated.call(this,$element,options,dataAdapter),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return InfiniteScroll.prototype.append=function(decorated,data){this.$loadingMore.remove(),this.loading=!1,decorated.call(this,data),this.showLoadingMore(data)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},InfiniteScroll.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("query",(function(params){self.lastParams=params,self.loading=!0})),container.on("query:append",(function(params){self.lastParams=params,self.loading=!0})),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},InfiniteScroll.prototype.loadMoreIfNeeded=function(){var isLoadMoreVisible=$.contains(document.documentElement,this.$loadingMore[0]);!this.loading&&isLoadMoreVisible&&this.$results.offset().top+this.$results.outerHeight(!1)+50>=this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)&&this.loadMore()},InfiniteScroll.prototype.loadMore=function(){this.loading=!0;var params=$.extend({},{page:1},this.lastParams);params.page++,this.trigger("query:append",params)},InfiniteScroll.prototype.showLoadingMore=function(_,data){return data.pagination&&data.pagination.more},InfiniteScroll.prototype.createLoadingMore=function(){var $option=$('
    • '),message=this.options.get("translations").get("loadingMore");return $option.html(message(this.lastParams)),$option},InfiniteScroll})),S2.define("select2/dropdown/attachBody",["jquery","../utils"],(function($,Utils){function AttachBody(decorated,$element,options){this.$dropdownParent=$(options.get("dropdownParent")||document.body),decorated.call(this,$element,options)}return AttachBody.prototype.bind=function(decorated,container,$container){var self=this;decorated.call(this,container,$container),container.on("open",(function(){self._showDropdown(),self._attachPositioningHandler(container),self._bindContainerResultHandlers(container)})),container.on("close",(function(){self._hideDropdown(),self._detachPositioningHandler(container)})),this.$dropdownContainer.on("mousedown",(function(evt){evt.stopPropagation()}))},AttachBody.prototype.destroy=function(decorated){decorated.call(this),this.$dropdownContainer.remove()},AttachBody.prototype.position=function(decorated,$dropdown,$container){$dropdown.attr("class",$container.attr("class")),$dropdown.removeClass("select2"),$dropdown.addClass("select2-container--open"),$dropdown.css({position:"absolute",top:-999999}),this.$container=$container},AttachBody.prototype.render=function(decorated){var $container=$(""),$dropdown=decorated.call(this);return $container.append($dropdown),this.$dropdownContainer=$container,$container},AttachBody.prototype._hideDropdown=function(decorated){this.$dropdownContainer.detach()},AttachBody.prototype._bindContainerResultHandlers=function(decorated,container){if(!this._containerResultsHandlersBound){var self=this;container.on("results:all",(function(){self._positionDropdown(),self._resizeDropdown()})),container.on("results:append",(function(){self._positionDropdown(),self._resizeDropdown()})),container.on("results:message",(function(){self._positionDropdown(),self._resizeDropdown()})),container.on("select",(function(){self._positionDropdown(),self._resizeDropdown()})),container.on("unselect",(function(){self._positionDropdown(),self._resizeDropdown()})),this._containerResultsHandlersBound=!0}},AttachBody.prototype._attachPositioningHandler=function(decorated,container){var self=this,scrollEvent="scroll.select2."+container.id,resizeEvent="resize.select2."+container.id,orientationEvent="orientationchange.select2."+container.id,$watchers=this.$container.parents().filter(Utils.hasScroll);$watchers.each((function(){Utils.StoreData(this,"select2-scroll-position",{x:$(this).scrollLeft(),y:$(this).scrollTop()})})),$watchers.on(scrollEvent,(function(ev){var position=Utils.GetData(this,"select2-scroll-position");$(this).scrollTop(position.y)})),$(window).on(scrollEvent+" "+resizeEvent+" "+orientationEvent,(function(e){self._positionDropdown(),self._resizeDropdown()}))},AttachBody.prototype._detachPositioningHandler=function(decorated,container){var scrollEvent="scroll.select2."+container.id,resizeEvent="resize.select2."+container.id,orientationEvent="orientationchange.select2."+container.id;this.$container.parents().filter(Utils.hasScroll).off(scrollEvent),$(window).off(scrollEvent+" "+resizeEvent+" "+orientationEvent)},AttachBody.prototype._positionDropdown=function(){var $window=$(window),isCurrentlyAbove=this.$dropdown.hasClass("select2-dropdown--above"),isCurrentlyBelow=this.$dropdown.hasClass("select2-dropdown--below"),newDirection=null,offset=this.$container.offset();offset.bottom=offset.top+this.$container.outerHeight(!1);var container={height:this.$container.outerHeight(!1)};container.top=offset.top,container.bottom=offset.top+container.height;var dropdown_height=this.$dropdown.outerHeight(!1),viewport_top=$window.scrollTop(),viewport_bottom=$window.scrollTop()+$window.height(),enoughRoomAbove=viewport_topoffset.bottom+dropdown_height,css={left:offset.left,top:container.bottom},$offsetParent=this.$dropdownParent;"static"===$offsetParent.css("position")&&($offsetParent=$offsetParent.offsetParent());var parentOffset={top:0,left:0};($.contains(document.body,$offsetParent[0])||$offsetParent[0].isConnected)&&(parentOffset=$offsetParent.offset()),css.top-=parentOffset.top,css.left-=parentOffset.left,isCurrentlyAbove||isCurrentlyBelow||(newDirection="below"),enoughRoomBelow||!enoughRoomAbove||isCurrentlyAbove?!enoughRoomAbove&&enoughRoomBelow&&isCurrentlyAbove&&(newDirection="below"):newDirection="above",("above"==newDirection||isCurrentlyAbove&&"below"!==newDirection)&&(css.top=container.top-parentOffset.top-dropdown_height),null!=newDirection&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+newDirection),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+newDirection)),this.$dropdownContainer.css(css)},AttachBody.prototype._resizeDropdown=function(){var css={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(css.minWidth=css.width,css.position="relative",css.width="auto"),this.$dropdown.css(css)},AttachBody.prototype._showDropdown=function(decorated){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},AttachBody})),S2.define("select2/dropdown/minimumResultsForSearch",[],(function(){function countResults(data){for(var count=0,d=0;d0&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,MinimumInputLength)),options.maximumInputLength>0&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,MaximumInputLength)),options.maximumSelectionLength>0&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,MaximumSelectionLength)),options.tags&&(options.dataAdapter=Utils.Decorate(options.dataAdapter,Tags)),null==options.tokenSeparators&&null==options.tokenizer||(options.dataAdapter=Utils.Decorate(options.dataAdapter,Tokenizer)),null!=options.query){var Query=require(options.amdBase+"compat/query");options.dataAdapter=Utils.Decorate(options.dataAdapter,Query)}if(null!=options.initSelection){var InitSelection=require(options.amdBase+"compat/initSelection");options.dataAdapter=Utils.Decorate(options.dataAdapter,InitSelection)}}if(null==options.resultsAdapter&&(options.resultsAdapter=ResultsList,null!=options.ajax&&(options.resultsAdapter=Utils.Decorate(options.resultsAdapter,InfiniteScroll)),null!=options.placeholder&&(options.resultsAdapter=Utils.Decorate(options.resultsAdapter,HidePlaceholder)),options.selectOnClose&&(options.resultsAdapter=Utils.Decorate(options.resultsAdapter,SelectOnClose))),null==options.dropdownAdapter){if(options.multiple)options.dropdownAdapter=Dropdown;else{var SearchableDropdown=Utils.Decorate(Dropdown,DropdownSearch);options.dropdownAdapter=SearchableDropdown}if(0!==options.minimumResultsForSearch&&(options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,MinimumResultsForSearch)),options.closeOnSelect&&(options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,CloseOnSelect)),null!=options.dropdownCssClass||null!=options.dropdownCss||null!=options.adaptDropdownCssClass){var DropdownCSS=require(options.amdBase+"compat/dropdownCss");options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,DropdownCSS)}options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,AttachBody)}if(null==options.selectionAdapter){if(options.multiple?options.selectionAdapter=MultipleSelection:options.selectionAdapter=SingleSelection,null!=options.placeholder&&(options.selectionAdapter=Utils.Decorate(options.selectionAdapter,Placeholder)),options.allowClear&&(options.selectionAdapter=Utils.Decorate(options.selectionAdapter,AllowClear)),options.multiple&&(options.selectionAdapter=Utils.Decorate(options.selectionAdapter,SelectionSearch)),null!=options.containerCssClass||null!=options.containerCss||null!=options.adaptContainerCssClass){var ContainerCSS=require(options.amdBase+"compat/containerCss");options.selectionAdapter=Utils.Decorate(options.selectionAdapter,ContainerCSS)}options.selectionAdapter=Utils.Decorate(options.selectionAdapter,EventRelay)}options.language=this._resolveLanguage(options.language),options.language.push("en");for(var uniqueLanguages=[],l=0;l0){for(var match=$.extend(!0,{},data),c=data.children.length-1;c>=0;c--)null==matcher(params,data.children[c])&&match.children.splice(c,1);return match.children.length>0?match:matcher(params,match)}var original=stripDiacritics(data.text).toUpperCase(),term=stripDiacritics(params.term).toUpperCase();return original.indexOf(term)>-1?data:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(data){return data},templateResult:function(result){return result.text},templateSelection:function(selection){return selection.text},theme:"default",width:"resolve"}},Defaults.prototype.applyFromElement=function(options,$element){var optionLanguage=options.language,defaultLanguage=this.defaults.language,elementLanguage=$element.prop("lang"),parentLanguage=$element.closest("[lang]").prop("lang"),languages=Array.prototype.concat.call(this._resolveLanguage(elementLanguage),this._resolveLanguage(optionLanguage),this._resolveLanguage(defaultLanguage),this._resolveLanguage(parentLanguage));return options.language=languages,options},Defaults.prototype._resolveLanguage=function(language){if(!language)return[];if($.isEmptyObject(language))return[];if($.isPlainObject(language))return[language];var languages;languages=$.isArray(language)?language:[language];for(var resolvedLanguages=[],l=0;l0){var baseLanguage=languages[l].split("-")[0];resolvedLanguages.push(baseLanguage)}return resolvedLanguages},Defaults.prototype._processTranslations=function(languages,debug){for(var translations=new Translation,l=0;l-1||($.isPlainObject(this.options[key])?$.extend(this.options[key],data[key]):this.options[key]=data[key]);return this},Options.prototype.get=function(key){return this.options[key]},Options.prototype.set=function(key,val){this.options[key]=val},Options})),S2.define("select2/core",["jquery","./options","./utils","./keys"],(function($,Options,Utils,KEYS){var Select2=function($element,options){null!=Utils.GetData($element[0],"select2")&&Utils.GetData($element[0],"select2").destroy(),this.$element=$element,this.id=this._generateId($element),options=options||{},this.options=new Options(options,$element),Select2.__super__.constructor.call(this);var tabindex=$element.attr("tabindex")||0;Utils.StoreData($element[0],"old-tabindex",tabindex),$element.attr("tabindex","-1");var DataAdapter=this.options.get("dataAdapter");this.dataAdapter=new DataAdapter($element,this.options);var $container=this.render();this._placeContainer($container);var SelectionAdapter=this.options.get("selectionAdapter");this.selection=new SelectionAdapter($element,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,$container);var DropdownAdapter=this.options.get("dropdownAdapter");this.dropdown=new DropdownAdapter($element,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,$container);var ResultsAdapter=this.options.get("resultsAdapter");this.results=new ResultsAdapter($element,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var self=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current((function(initialData){self.trigger("selection:update",{data:initialData})})),$element.addClass("select2-hidden-accessible"),$element.attr("aria-hidden","true"),this._syncAttributes(),Utils.StoreData($element[0],"select2",this),$element.data("select2",this)};return Utils.Extend(Select2,Utils.Observable),Select2.prototype._generateId=function($element){return"select2-"+(null!=$element.attr("id")?$element.attr("id"):null!=$element.attr("name")?$element.attr("name")+"-"+Utils.generateChars(2):Utils.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},Select2.prototype._placeContainer=function($container){$container.insertAfter(this.$element);var width=this._resolveWidth(this.$element,this.options.get("width"));null!=width&&$container.css("width",width)},Select2.prototype._resolveWidth=function($element,method){var WIDTH=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==method){var styleWidth=this._resolveWidth($element,"style");return null!=styleWidth?styleWidth:this._resolveWidth($element,"element")}if("element"==method){var elementWidth=$element.outerWidth(!1);return elementWidth<=0?"auto":elementWidth+"px"}if("style"==method){var style=$element.attr("style");if("string"!=typeof style)return null;for(var attrs=style.split(";"),i=0,l=attrs.length;i=1)return matches[1]}return null}return"computedstyle"==method?window.getComputedStyle($element[0]).width:method},Select2.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},Select2.prototype._registerDomEvents=function(){var self=this;this.$element.on("change.select2",(function(){self.dataAdapter.current((function(data){self.trigger("selection:update",{data:data})}))})),this.$element.on("focus.select2",(function(evt){self.trigger("focus",evt)})),this._syncA=Utils.bind(this._syncAttributes,this),this._syncS=Utils.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var observer=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=observer?(this._observer=new observer((function(mutations){self._syncA(),self._syncS(null,mutations)})),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",self._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",self._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",self._syncS,!1))},Select2.prototype._registerDataEvents=function(){var self=this;this.dataAdapter.on("*",(function(name,params){self.trigger(name,params)}))},Select2.prototype._registerSelectionEvents=function(){var self=this,nonRelayEvents=["toggle","focus"];this.selection.on("toggle",(function(){self.toggleDropdown()})),this.selection.on("focus",(function(params){self.focus(params)})),this.selection.on("*",(function(name,params){-1===$.inArray(name,nonRelayEvents)&&self.trigger(name,params)}))},Select2.prototype._registerDropdownEvents=function(){var self=this;this.dropdown.on("*",(function(name,params){self.trigger(name,params)}))},Select2.prototype._registerResultsEvents=function(){var self=this;this.results.on("*",(function(name,params){self.trigger(name,params)}))},Select2.prototype._registerEvents=function(){var self=this;this.on("open",(function(){self.$container.addClass("select2-container--open")})),this.on("close",(function(){self.$container.removeClass("select2-container--open")})),this.on("enable",(function(){self.$container.removeClass("select2-container--disabled")})),this.on("disable",(function(){self.$container.addClass("select2-container--disabled")})),this.on("blur",(function(){self.$container.removeClass("select2-container--focus")})),this.on("query",(function(params){self.isOpen()||self.trigger("open",{}),this.dataAdapter.query(params,(function(data){self.trigger("results:all",{data:data,query:params})}))})),this.on("query:append",(function(params){this.dataAdapter.query(params,(function(data){self.trigger("results:append",{data:data,query:params})}))})),this.on("keypress",(function(evt){var key=evt.which;self.isOpen()?key===KEYS.ESC||key===KEYS.TAB||key===KEYS.UP&&evt.altKey?(self.close(evt),evt.preventDefault()):key===KEYS.ENTER?(self.trigger("results:select",{}),evt.preventDefault()):key===KEYS.SPACE&&evt.ctrlKey?(self.trigger("results:toggle",{}),evt.preventDefault()):key===KEYS.UP?(self.trigger("results:previous",{}),evt.preventDefault()):key===KEYS.DOWN&&(self.trigger("results:next",{}),evt.preventDefault()):(key===KEYS.ENTER||key===KEYS.SPACE||key===KEYS.DOWN&&evt.altKey)&&(self.open(),evt.preventDefault())}))},Select2.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},Select2.prototype._isChangeMutation=function(evt,mutations){var changed=!1,self=this;if(!evt||!evt.target||"OPTION"===evt.target.nodeName||"OPTGROUP"===evt.target.nodeName){if(mutations)if(mutations.addedNodes&&mutations.addedNodes.length>0)for(var n=0;n0?changed=!0:$.isArray(mutations)&&$.each(mutations,(function(evt,mutation){if(self._isChangeMutation(evt,mutation))return changed=!0,!1}));else changed=!0;return changed}},Select2.prototype._syncSubtree=function(evt,mutations){var changed=this._isChangeMutation(evt,mutations),self=this;changed&&this.dataAdapter.current((function(currentData){self.trigger("selection:update",{data:currentData})}))},Select2.prototype.trigger=function(name,args){var actualTrigger=Select2.__super__.trigger,preTriggerMap={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===args&&(args={}),name in preTriggerMap){var preTriggerName=preTriggerMap[name],preTriggerArgs={prevented:!1,name:name,args:args};if(actualTrigger.call(this,preTriggerName,preTriggerArgs),preTriggerArgs.prevented)return void(args.prevented=!0)}actualTrigger.call(this,name,args)},Select2.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},Select2.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},Select2.prototype.close=function(evt){this.isOpen()&&this.trigger("close",{originalEvent:evt})},Select2.prototype.isEnabled=function(){return!this.isDisabled()},Select2.prototype.isDisabled=function(){return this.options.get("disabled")},Select2.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},Select2.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},Select2.prototype.focus=function(data){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},Select2.prototype.enable=function(args){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=args&&0!==args.length||(args=[!0]);var disabled=!args[0];this.$element.prop("disabled",disabled)},Select2.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var data=[];return this.dataAdapter.current((function(currentData){data=currentData})),data},Select2.prototype.val=function(args){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==args||0===args.length)return this.$element.val();var newVal=args[0];$.isArray(newVal)&&(newVal=$.map(newVal,(function(obj){return obj.toString()}))),this.$element.val(newVal).trigger("input").trigger("change")},Select2.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",Utils.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),Utils.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},Select2.prototype.render=function(){var $container=$('');return $container.attr("dir",this.options.get("dir")),this.$container=$container,this.$container.addClass("select2-container--"+this.options.get("theme")),Utils.StoreData($container[0],"element",this.$element),$container},Select2})),S2.define("select2/compat/utils",["jquery"],(function($){return{syncCssClasses:function($dest,$src,adapter){var classes,adapted,replacements=[];(classes=$.trim($dest.attr("class")))&&$((classes=""+classes).split(/\s+/)).each((function(){0===this.indexOf("select2-")&&replacements.push(this)})),(classes=$.trim($src.attr("class")))&&$((classes=""+classes).split(/\s+/)).each((function(){0!==this.indexOf("select2-")&&null!=(adapted=adapter(this))&&replacements.push(adapted)})),$dest.attr("class",replacements.join(" "))}}})),S2.define("select2/compat/containerCss",["jquery","./utils"],(function($,CompatUtils){function _containerAdapter(clazz){return null}function ContainerCSS(){}return ContainerCSS.prototype.render=function(decorated){var $container=decorated.call(this),containerCssClass=this.options.get("containerCssClass")||"";$.isFunction(containerCssClass)&&(containerCssClass=containerCssClass(this.$element));var containerCssAdapter=this.options.get("adaptContainerCssClass");if(containerCssAdapter=containerCssAdapter||_containerAdapter,-1!==containerCssClass.indexOf(":all:")){containerCssClass=containerCssClass.replace(":all:","");var _cssAdapter=containerCssAdapter;containerCssAdapter=function(clazz){var adapted=_cssAdapter(clazz);return null!=adapted?adapted+" "+clazz:clazz}}var containerCss=this.options.get("containerCss")||{};return $.isFunction(containerCss)&&(containerCss=containerCss(this.$element)),CompatUtils.syncCssClasses($container,this.$element,containerCssAdapter),$container.css(containerCss),$container.addClass(containerCssClass),$container},ContainerCSS})),S2.define("select2/compat/dropdownCss",["jquery","./utils"],(function($,CompatUtils){function _dropdownAdapter(clazz){return null}function DropdownCSS(){}return DropdownCSS.prototype.render=function(decorated){var $dropdown=decorated.call(this),dropdownCssClass=this.options.get("dropdownCssClass")||"";$.isFunction(dropdownCssClass)&&(dropdownCssClass=dropdownCssClass(this.$element));var dropdownCssAdapter=this.options.get("adaptDropdownCssClass");if(dropdownCssAdapter=dropdownCssAdapter||_dropdownAdapter,-1!==dropdownCssClass.indexOf(":all:")){dropdownCssClass=dropdownCssClass.replace(":all:","");var _cssAdapter=dropdownCssAdapter;dropdownCssAdapter=function(clazz){var adapted=_cssAdapter(clazz);return null!=adapted?adapted+" "+clazz:clazz}}var dropdownCss=this.options.get("dropdownCss")||{};return $.isFunction(dropdownCss)&&(dropdownCss=dropdownCss(this.$element)),CompatUtils.syncCssClasses($dropdown,this.$element,dropdownCssAdapter),$dropdown.css(dropdownCss),$dropdown.addClass(dropdownCssClass),$dropdown},DropdownCSS})),S2.define("select2/compat/initSelection",["jquery"],(function($){function InitSelection(decorated,$element,options){options.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=options.get("initSelection"),this._isInitialized=!1,decorated.call(this,$element,options)}return InitSelection.prototype.current=function(decorated,callback){var self=this;this._isInitialized?decorated.call(this,callback):this.initSelection.call(null,this.$element,(function(data){self._isInitialized=!0,$.isArray(data)||(data=[data]),callback(data)}))},InitSelection})),S2.define("select2/compat/inputData",["jquery","../utils"],(function($,Utils){function InputData(decorated,$element,options){this._currentData=[],this._valueSeparator=options.get("valueSeparator")||",","hidden"===$element.prop("type")&&options.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `' +\n ''\n );\n\n this.$searchContainer = $search;\n this.$search = $search.find('input');\n\n var $rendered = decorated.call(this);\n\n this._transferTabIndex();\n\n return $rendered;\n };\n\n Search.prototype.bind = function (decorated, container, $container) {\n var self = this;\n\n var resultsId = container.id + '-results';\n\n decorated.call(this, container, $container);\n\n container.on('open', function () {\n self.$search.attr('aria-controls', resultsId);\n self.$search.trigger('focus');\n });\n\n container.on('close', function () {\n self.$search.val('');\n self.$search.removeAttr('aria-controls');\n self.$search.removeAttr('aria-activedescendant');\n self.$search.trigger('focus');\n });\n\n container.on('enable', function () {\n self.$search.prop('disabled', false);\n\n self._transferTabIndex();\n });\n\n container.on('disable', function () {\n self.$search.prop('disabled', true);\n });\n\n container.on('focus', function (evt) {\n self.$search.trigger('focus');\n });\n\n container.on('results:focus', function (params) {\n if (params.data._resultId) {\n self.$search.attr('aria-activedescendant', params.data._resultId);\n } else {\n self.$search.removeAttr('aria-activedescendant');\n }\n });\n\n this.$selection.on('focusin', '.select2-search--inline', function (evt) {\n self.trigger('focus', evt);\n });\n\n this.$selection.on('focusout', '.select2-search--inline', function (evt) {\n self._handleBlur(evt);\n });\n\n this.$selection.on('keydown', '.select2-search--inline', function (evt) {\n evt.stopPropagation();\n\n self.trigger('keypress', evt);\n\n self._keyUpPrevented = evt.isDefaultPrevented();\n\n var key = evt.which;\n\n if (key === KEYS.BACKSPACE && self.$search.val() === '') {\n var $previousChoice = self.$searchContainer\n .prev('.select2-selection__choice');\n\n if ($previousChoice.length > 0) {\n var item = Utils.GetData($previousChoice[0], 'data');\n\n self.searchRemoveChoice(item);\n\n evt.preventDefault();\n }\n }\n });\n\n this.$selection.on('click', '.select2-search--inline', function (evt) {\n if (self.$search.val()) {\n evt.stopPropagation();\n }\n });\n\n // Try to detect the IE version should the `documentMode` property that\n // is stored on the document. This is only implemented in IE and is\n // slightly cleaner than doing a user agent check.\n // This property is not available in Edge, but Edge also doesn't have\n // this bug.\n var msie = document.documentMode;\n var disableInputEvents = msie && msie <= 11;\n\n // Workaround for browsers which do not support the `input` event\n // This will prevent double-triggering of events for browsers which support\n // both the `keyup` and `input` events.\n this.$selection.on(\n 'input.searchcheck',\n '.select2-search--inline',\n function (evt) {\n // IE will trigger the `input` event when a placeholder is used on a\n // search box. To get around this issue, we are forced to ignore all\n // `input` events in IE and keep using `keyup`.\n if (disableInputEvents) {\n self.$selection.off('input.search input.searchcheck');\n return;\n }\n\n // Unbind the duplicated `keyup` event\n self.$selection.off('keyup.search');\n }\n );\n\n this.$selection.on(\n 'keyup.search input.search',\n '.select2-search--inline',\n function (evt) {\n // IE will trigger the `input` event when a placeholder is used on a\n // search box. To get around this issue, we are forced to ignore all\n // `input` events in IE and keep using `keyup`.\n if (disableInputEvents && evt.type === 'input') {\n self.$selection.off('input.search input.searchcheck');\n return;\n }\n\n var key = evt.which;\n\n // We can freely ignore events from modifier keys\n if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {\n return;\n }\n\n // Tabbing will be handled during the `keydown` phase\n if (key == KEYS.TAB) {\n return;\n }\n\n self.handleSearch(evt);\n }\n );\n };\n\n /**\n * This method will transfer the tabindex attribute from the rendered\n * selection to the search box. This allows for the search box to be used as\n * the primary focus instead of the selection container.\n *\n * @private\n */\n Search.prototype._transferTabIndex = function (decorated) {\n this.$search.attr('tabindex', this.$selection.attr('tabindex'));\n this.$selection.attr('tabindex', '-1');\n };\n\n Search.prototype.createPlaceholder = function (decorated, placeholder) {\n this.$search.attr('placeholder', placeholder.text);\n };\n\n Search.prototype.update = function (decorated, data) {\n var searchHadFocus = this.$search[0] == document.activeElement;\n\n this.$search.attr('placeholder', '');\n\n decorated.call(this, data);\n\n this.$selection.find('.select2-selection__rendered')\n .append(this.$searchContainer);\n\n this.resizeSearch();\n if (searchHadFocus) {\n this.$search.trigger('focus');\n }\n };\n\n Search.prototype.handleSearch = function () {\n this.resizeSearch();\n\n if (!this._keyUpPrevented) {\n var input = this.$search.val();\n\n this.trigger('query', {\n term: input\n });\n }\n\n this._keyUpPrevented = false;\n };\n\n Search.prototype.searchRemoveChoice = function (decorated, item) {\n this.trigger('unselect', {\n data: item\n });\n\n this.$search.val(item.text);\n this.handleSearch();\n };\n\n Search.prototype.resizeSearch = function () {\n this.$search.css('width', '25px');\n\n var width = '';\n\n if (this.$search.attr('placeholder') !== '') {\n width = this.$selection.find('.select2-selection__rendered').width();\n } else {\n var minimumWidth = this.$search.val().length + 1;\n\n width = (minimumWidth * 0.75) + 'em';\n }\n\n this.$search.css('width', width);\n };\n\n return Search;\n });\n\n S2.define('select2/selection/eventRelay',[\n 'jquery'\n ], function ($) {\n function EventRelay () { }\n\n EventRelay.prototype.bind = function (decorated, container, $container) {\n var self = this;\n var relayEvents = [\n 'open', 'opening',\n 'close', 'closing',\n 'select', 'selecting',\n 'unselect', 'unselecting',\n 'clear', 'clearing'\n ];\n\n var preventableEvents = [\n 'opening', 'closing', 'selecting', 'unselecting', 'clearing'\n ];\n\n decorated.call(this, container, $container);\n\n container.on('*', function (name, params) {\n // Ignore events that should not be relayed\n if ($.inArray(name, relayEvents) === -1) {\n return;\n }\n\n // The parameters should always be an object\n params = params || {};\n\n // Generate the jQuery event for the Select2 event\n var evt = $.Event('select2:' + name, {\n params: params\n });\n\n self.$element.trigger(evt);\n\n // Only handle preventable events if it was one\n if ($.inArray(name, preventableEvents) === -1) {\n return;\n }\n\n params.prevented = evt.isDefaultPrevented();\n });\n };\n\n return EventRelay;\n });\n\n S2.define('select2/translation',[\n 'jquery',\n 'require'\n ], function ($, require) {\n function Translation (dict) {\n this.dict = dict || {};\n }\n\n Translation.prototype.all = function () {\n return this.dict;\n };\n\n Translation.prototype.get = function (key) {\n return this.dict[key];\n };\n\n Translation.prototype.extend = function (translation) {\n this.dict = $.extend({}, translation.all(), this.dict);\n };\n\n // Static functions\n\n Translation._cache = {};\n\n Translation.loadPath = function (path) {\n if (!(path in Translation._cache)) {\n var translations = require(path);\n\n Translation._cache[path] = translations;\n }\n\n return new Translation(Translation._cache[path]);\n };\n\n return Translation;\n });\n\n S2.define('select2/diacritics',[\n\n ], function () {\n var diacritics = {\n '\\u24B6': 'A',\n '\\uFF21': 'A',\n '\\u00C0': 'A',\n '\\u00C1': 'A',\n '\\u00C2': 'A',\n '\\u1EA6': 'A',\n '\\u1EA4': 'A',\n '\\u1EAA': 'A',\n '\\u1EA8': 'A',\n '\\u00C3': 'A',\n '\\u0100': 'A',\n '\\u0102': 'A',\n '\\u1EB0': 'A',\n '\\u1EAE': 'A',\n '\\u1EB4': 'A',\n '\\u1EB2': 'A',\n '\\u0226': 'A',\n '\\u01E0': 'A',\n '\\u00C4': 'A',\n '\\u01DE': 'A',\n '\\u1EA2': 'A',\n '\\u00C5': 'A',\n '\\u01FA': 'A',\n '\\u01CD': 'A',\n '\\u0200': 'A',\n '\\u0202': 'A',\n '\\u1EA0': 'A',\n '\\u1EAC': 'A',\n '\\u1EB6': 'A',\n '\\u1E00': 'A',\n '\\u0104': 'A',\n '\\u023A': 'A',\n '\\u2C6F': 'A',\n '\\uA732': 'AA',\n '\\u00C6': 'AE',\n '\\u01FC': 'AE',\n '\\u01E2': 'AE',\n '\\uA734': 'AO',\n '\\uA736': 'AU',\n '\\uA738': 'AV',\n '\\uA73A': 'AV',\n '\\uA73C': 'AY',\n '\\u24B7': 'B',\n '\\uFF22': 'B',\n '\\u1E02': 'B',\n '\\u1E04': 'B',\n '\\u1E06': 'B',\n '\\u0243': 'B',\n '\\u0182': 'B',\n '\\u0181': 'B',\n '\\u24B8': 'C',\n '\\uFF23': 'C',\n '\\u0106': 'C',\n '\\u0108': 'C',\n '\\u010A': 'C',\n '\\u010C': 'C',\n '\\u00C7': 'C',\n '\\u1E08': 'C',\n '\\u0187': 'C',\n '\\u023B': 'C',\n '\\uA73E': 'C',\n '\\u24B9': 'D',\n '\\uFF24': 'D',\n '\\u1E0A': 'D',\n '\\u010E': 'D',\n '\\u1E0C': 'D',\n '\\u1E10': 'D',\n '\\u1E12': 'D',\n '\\u1E0E': 'D',\n '\\u0110': 'D',\n '\\u018B': 'D',\n '\\u018A': 'D',\n '\\u0189': 'D',\n '\\uA779': 'D',\n '\\u01F1': 'DZ',\n '\\u01C4': 'DZ',\n '\\u01F2': 'Dz',\n '\\u01C5': 'Dz',\n '\\u24BA': 'E',\n '\\uFF25': 'E',\n '\\u00C8': 'E',\n '\\u00C9': 'E',\n '\\u00CA': 'E',\n '\\u1EC0': 'E',\n '\\u1EBE': 'E',\n '\\u1EC4': 'E',\n '\\u1EC2': 'E',\n '\\u1EBC': 'E',\n '\\u0112': 'E',\n '\\u1E14': 'E',\n '\\u1E16': 'E',\n '\\u0114': 'E',\n '\\u0116': 'E',\n '\\u00CB': 'E',\n '\\u1EBA': 'E',\n '\\u011A': 'E',\n '\\u0204': 'E',\n '\\u0206': 'E',\n '\\u1EB8': 'E',\n '\\u1EC6': 'E',\n '\\u0228': 'E',\n '\\u1E1C': 'E',\n '\\u0118': 'E',\n '\\u1E18': 'E',\n '\\u1E1A': 'E',\n '\\u0190': 'E',\n '\\u018E': 'E',\n '\\u24BB': 'F',\n '\\uFF26': 'F',\n '\\u1E1E': 'F',\n '\\u0191': 'F',\n '\\uA77B': 'F',\n '\\u24BC': 'G',\n '\\uFF27': 'G',\n '\\u01F4': 'G',\n '\\u011C': 'G',\n '\\u1E20': 'G',\n '\\u011E': 'G',\n '\\u0120': 'G',\n '\\u01E6': 'G',\n '\\u0122': 'G',\n '\\u01E4': 'G',\n '\\u0193': 'G',\n '\\uA7A0': 'G',\n '\\uA77D': 'G',\n '\\uA77E': 'G',\n '\\u24BD': 'H',\n '\\uFF28': 'H',\n '\\u0124': 'H',\n '\\u1E22': 'H',\n '\\u1E26': 'H',\n '\\u021E': 'H',\n '\\u1E24': 'H',\n '\\u1E28': 'H',\n '\\u1E2A': 'H',\n '\\u0126': 'H',\n '\\u2C67': 'H',\n '\\u2C75': 'H',\n '\\uA78D': 'H',\n '\\u24BE': 'I',\n '\\uFF29': 'I',\n '\\u00CC': 'I',\n '\\u00CD': 'I',\n '\\u00CE': 'I',\n '\\u0128': 'I',\n '\\u012A': 'I',\n '\\u012C': 'I',\n '\\u0130': 'I',\n '\\u00CF': 'I',\n '\\u1E2E': 'I',\n '\\u1EC8': 'I',\n '\\u01CF': 'I',\n '\\u0208': 'I',\n '\\u020A': 'I',\n '\\u1ECA': 'I',\n '\\u012E': 'I',\n '\\u1E2C': 'I',\n '\\u0197': 'I',\n '\\u24BF': 'J',\n '\\uFF2A': 'J',\n '\\u0134': 'J',\n '\\u0248': 'J',\n '\\u24C0': 'K',\n '\\uFF2B': 'K',\n '\\u1E30': 'K',\n '\\u01E8': 'K',\n '\\u1E32': 'K',\n '\\u0136': 'K',\n '\\u1E34': 'K',\n '\\u0198': 'K',\n '\\u2C69': 'K',\n '\\uA740': 'K',\n '\\uA742': 'K',\n '\\uA744': 'K',\n '\\uA7A2': 'K',\n '\\u24C1': 'L',\n '\\uFF2C': 'L',\n '\\u013F': 'L',\n '\\u0139': 'L',\n '\\u013D': 'L',\n '\\u1E36': 'L',\n '\\u1E38': 'L',\n '\\u013B': 'L',\n '\\u1E3C': 'L',\n '\\u1E3A': 'L',\n '\\u0141': 'L',\n '\\u023D': 'L',\n '\\u2C62': 'L',\n '\\u2C60': 'L',\n '\\uA748': 'L',\n '\\uA746': 'L',\n '\\uA780': 'L',\n '\\u01C7': 'LJ',\n '\\u01C8': 'Lj',\n '\\u24C2': 'M',\n '\\uFF2D': 'M',\n '\\u1E3E': 'M',\n '\\u1E40': 'M',\n '\\u1E42': 'M',\n '\\u2C6E': 'M',\n '\\u019C': 'M',\n '\\u24C3': 'N',\n '\\uFF2E': 'N',\n '\\u01F8': 'N',\n '\\u0143': 'N',\n '\\u00D1': 'N',\n '\\u1E44': 'N',\n '\\u0147': 'N',\n '\\u1E46': 'N',\n '\\u0145': 'N',\n '\\u1E4A': 'N',\n '\\u1E48': 'N',\n '\\u0220': 'N',\n '\\u019D': 'N',\n '\\uA790': 'N',\n '\\uA7A4': 'N',\n '\\u01CA': 'NJ',\n '\\u01CB': 'Nj',\n '\\u24C4': 'O',\n '\\uFF2F': 'O',\n '\\u00D2': 'O',\n '\\u00D3': 'O',\n '\\u00D4': 'O',\n '\\u1ED2': 'O',\n '\\u1ED0': 'O',\n '\\u1ED6': 'O',\n '\\u1ED4': 'O',\n '\\u00D5': 'O',\n '\\u1E4C': 'O',\n '\\u022C': 'O',\n '\\u1E4E': 'O',\n '\\u014C': 'O',\n '\\u1E50': 'O',\n '\\u1E52': 'O',\n '\\u014E': 'O',\n '\\u022E': 'O',\n '\\u0230': 'O',\n '\\u00D6': 'O',\n '\\u022A': 'O',\n '\\u1ECE': 'O',\n '\\u0150': 'O',\n '\\u01D1': 'O',\n '\\u020C': 'O',\n '\\u020E': 'O',\n '\\u01A0': 'O',\n '\\u1EDC': 'O',\n '\\u1EDA': 'O',\n '\\u1EE0': 'O',\n '\\u1EDE': 'O',\n '\\u1EE2': 'O',\n '\\u1ECC': 'O',\n '\\u1ED8': 'O',\n '\\u01EA': 'O',\n '\\u01EC': 'O',\n '\\u00D8': 'O',\n '\\u01FE': 'O',\n '\\u0186': 'O',\n '\\u019F': 'O',\n '\\uA74A': 'O',\n '\\uA74C': 'O',\n '\\u0152': 'OE',\n '\\u01A2': 'OI',\n '\\uA74E': 'OO',\n '\\u0222': 'OU',\n '\\u24C5': 'P',\n '\\uFF30': 'P',\n '\\u1E54': 'P',\n '\\u1E56': 'P',\n '\\u01A4': 'P',\n '\\u2C63': 'P',\n '\\uA750': 'P',\n '\\uA752': 'P',\n '\\uA754': 'P',\n '\\u24C6': 'Q',\n '\\uFF31': 'Q',\n '\\uA756': 'Q',\n '\\uA758': 'Q',\n '\\u024A': 'Q',\n '\\u24C7': 'R',\n '\\uFF32': 'R',\n '\\u0154': 'R',\n '\\u1E58': 'R',\n '\\u0158': 'R',\n '\\u0210': 'R',\n '\\u0212': 'R',\n '\\u1E5A': 'R',\n '\\u1E5C': 'R',\n '\\u0156': 'R',\n '\\u1E5E': 'R',\n '\\u024C': 'R',\n '\\u2C64': 'R',\n '\\uA75A': 'R',\n '\\uA7A6': 'R',\n '\\uA782': 'R',\n '\\u24C8': 'S',\n '\\uFF33': 'S',\n '\\u1E9E': 'S',\n '\\u015A': 'S',\n '\\u1E64': 'S',\n '\\u015C': 'S',\n '\\u1E60': 'S',\n '\\u0160': 'S',\n '\\u1E66': 'S',\n '\\u1E62': 'S',\n '\\u1E68': 'S',\n '\\u0218': 'S',\n '\\u015E': 'S',\n '\\u2C7E': 'S',\n '\\uA7A8': 'S',\n '\\uA784': 'S',\n '\\u24C9': 'T',\n '\\uFF34': 'T',\n '\\u1E6A': 'T',\n '\\u0164': 'T',\n '\\u1E6C': 'T',\n '\\u021A': 'T',\n '\\u0162': 'T',\n '\\u1E70': 'T',\n '\\u1E6E': 'T',\n '\\u0166': 'T',\n '\\u01AC': 'T',\n '\\u01AE': 'T',\n '\\u023E': 'T',\n '\\uA786': 'T',\n '\\uA728': 'TZ',\n '\\u24CA': 'U',\n '\\uFF35': 'U',\n '\\u00D9': 'U',\n '\\u00DA': 'U',\n '\\u00DB': 'U',\n '\\u0168': 'U',\n '\\u1E78': 'U',\n '\\u016A': 'U',\n '\\u1E7A': 'U',\n '\\u016C': 'U',\n '\\u00DC': 'U',\n '\\u01DB': 'U',\n '\\u01D7': 'U',\n '\\u01D5': 'U',\n '\\u01D9': 'U',\n '\\u1EE6': 'U',\n '\\u016E': 'U',\n '\\u0170': 'U',\n '\\u01D3': 'U',\n '\\u0214': 'U',\n '\\u0216': 'U',\n '\\u01AF': 'U',\n '\\u1EEA': 'U',\n '\\u1EE8': 'U',\n '\\u1EEE': 'U',\n '\\u1EEC': 'U',\n '\\u1EF0': 'U',\n '\\u1EE4': 'U',\n '\\u1E72': 'U',\n '\\u0172': 'U',\n '\\u1E76': 'U',\n '\\u1E74': 'U',\n '\\u0244': 'U',\n '\\u24CB': 'V',\n '\\uFF36': 'V',\n '\\u1E7C': 'V',\n '\\u1E7E': 'V',\n '\\u01B2': 'V',\n '\\uA75E': 'V',\n '\\u0245': 'V',\n '\\uA760': 'VY',\n '\\u24CC': 'W',\n '\\uFF37': 'W',\n '\\u1E80': 'W',\n '\\u1E82': 'W',\n '\\u0174': 'W',\n '\\u1E86': 'W',\n '\\u1E84': 'W',\n '\\u1E88': 'W',\n '\\u2C72': 'W',\n '\\u24CD': 'X',\n '\\uFF38': 'X',\n '\\u1E8A': 'X',\n '\\u1E8C': 'X',\n '\\u24CE': 'Y',\n '\\uFF39': 'Y',\n '\\u1EF2': 'Y',\n '\\u00DD': 'Y',\n '\\u0176': 'Y',\n '\\u1EF8': 'Y',\n '\\u0232': 'Y',\n '\\u1E8E': 'Y',\n '\\u0178': 'Y',\n '\\u1EF6': 'Y',\n '\\u1EF4': 'Y',\n '\\u01B3': 'Y',\n '\\u024E': 'Y',\n '\\u1EFE': 'Y',\n '\\u24CF': 'Z',\n '\\uFF3A': 'Z',\n '\\u0179': 'Z',\n '\\u1E90': 'Z',\n '\\u017B': 'Z',\n '\\u017D': 'Z',\n '\\u1E92': 'Z',\n '\\u1E94': 'Z',\n '\\u01B5': 'Z',\n '\\u0224': 'Z',\n '\\u2C7F': 'Z',\n '\\u2C6B': 'Z',\n '\\uA762': 'Z',\n '\\u24D0': 'a',\n '\\uFF41': 'a',\n '\\u1E9A': 'a',\n '\\u00E0': 'a',\n '\\u00E1': 'a',\n '\\u00E2': 'a',\n '\\u1EA7': 'a',\n '\\u1EA5': 'a',\n '\\u1EAB': 'a',\n '\\u1EA9': 'a',\n '\\u00E3': 'a',\n '\\u0101': 'a',\n '\\u0103': 'a',\n '\\u1EB1': 'a',\n '\\u1EAF': 'a',\n '\\u1EB5': 'a',\n '\\u1EB3': 'a',\n '\\u0227': 'a',\n '\\u01E1': 'a',\n '\\u00E4': 'a',\n '\\u01DF': 'a',\n '\\u1EA3': 'a',\n '\\u00E5': 'a',\n '\\u01FB': 'a',\n '\\u01CE': 'a',\n '\\u0201': 'a',\n '\\u0203': 'a',\n '\\u1EA1': 'a',\n '\\u1EAD': 'a',\n '\\u1EB7': 'a',\n '\\u1E01': 'a',\n '\\u0105': 'a',\n '\\u2C65': 'a',\n '\\u0250': 'a',\n '\\uA733': 'aa',\n '\\u00E6': 'ae',\n '\\u01FD': 'ae',\n '\\u01E3': 'ae',\n '\\uA735': 'ao',\n '\\uA737': 'au',\n '\\uA739': 'av',\n '\\uA73B': 'av',\n '\\uA73D': 'ay',\n '\\u24D1': 'b',\n '\\uFF42': 'b',\n '\\u1E03': 'b',\n '\\u1E05': 'b',\n '\\u1E07': 'b',\n '\\u0180': 'b',\n '\\u0183': 'b',\n '\\u0253': 'b',\n '\\u24D2': 'c',\n '\\uFF43': 'c',\n '\\u0107': 'c',\n '\\u0109': 'c',\n '\\u010B': 'c',\n '\\u010D': 'c',\n '\\u00E7': 'c',\n '\\u1E09': 'c',\n '\\u0188': 'c',\n '\\u023C': 'c',\n '\\uA73F': 'c',\n '\\u2184': 'c',\n '\\u24D3': 'd',\n '\\uFF44': 'd',\n '\\u1E0B': 'd',\n '\\u010F': 'd',\n '\\u1E0D': 'd',\n '\\u1E11': 'd',\n '\\u1E13': 'd',\n '\\u1E0F': 'd',\n '\\u0111': 'd',\n '\\u018C': 'd',\n '\\u0256': 'd',\n '\\u0257': 'd',\n '\\uA77A': 'd',\n '\\u01F3': 'dz',\n '\\u01C6': 'dz',\n '\\u24D4': 'e',\n '\\uFF45': 'e',\n '\\u00E8': 'e',\n '\\u00E9': 'e',\n '\\u00EA': 'e',\n '\\u1EC1': 'e',\n '\\u1EBF': 'e',\n '\\u1EC5': 'e',\n '\\u1EC3': 'e',\n '\\u1EBD': 'e',\n '\\u0113': 'e',\n '\\u1E15': 'e',\n '\\u1E17': 'e',\n '\\u0115': 'e',\n '\\u0117': 'e',\n '\\u00EB': 'e',\n '\\u1EBB': 'e',\n '\\u011B': 'e',\n '\\u0205': 'e',\n '\\u0207': 'e',\n '\\u1EB9': 'e',\n '\\u1EC7': 'e',\n '\\u0229': 'e',\n '\\u1E1D': 'e',\n '\\u0119': 'e',\n '\\u1E19': 'e',\n '\\u1E1B': 'e',\n '\\u0247': 'e',\n '\\u025B': 'e',\n '\\u01DD': 'e',\n '\\u24D5': 'f',\n '\\uFF46': 'f',\n '\\u1E1F': 'f',\n '\\u0192': 'f',\n '\\uA77C': 'f',\n '\\u24D6': 'g',\n '\\uFF47': 'g',\n '\\u01F5': 'g',\n '\\u011D': 'g',\n '\\u1E21': 'g',\n '\\u011F': 'g',\n '\\u0121': 'g',\n '\\u01E7': 'g',\n '\\u0123': 'g',\n '\\u01E5': 'g',\n '\\u0260': 'g',\n '\\uA7A1': 'g',\n '\\u1D79': 'g',\n '\\uA77F': 'g',\n '\\u24D7': 'h',\n '\\uFF48': 'h',\n '\\u0125': 'h',\n '\\u1E23': 'h',\n '\\u1E27': 'h',\n '\\u021F': 'h',\n '\\u1E25': 'h',\n '\\u1E29': 'h',\n '\\u1E2B': 'h',\n '\\u1E96': 'h',\n '\\u0127': 'h',\n '\\u2C68': 'h',\n '\\u2C76': 'h',\n '\\u0265': 'h',\n '\\u0195': 'hv',\n '\\u24D8': 'i',\n '\\uFF49': 'i',\n '\\u00EC': 'i',\n '\\u00ED': 'i',\n '\\u00EE': 'i',\n '\\u0129': 'i',\n '\\u012B': 'i',\n '\\u012D': 'i',\n '\\u00EF': 'i',\n '\\u1E2F': 'i',\n '\\u1EC9': 'i',\n '\\u01D0': 'i',\n '\\u0209': 'i',\n '\\u020B': 'i',\n '\\u1ECB': 'i',\n '\\u012F': 'i',\n '\\u1E2D': 'i',\n '\\u0268': 'i',\n '\\u0131': 'i',\n '\\u24D9': 'j',\n '\\uFF4A': 'j',\n '\\u0135': 'j',\n '\\u01F0': 'j',\n '\\u0249': 'j',\n '\\u24DA': 'k',\n '\\uFF4B': 'k',\n '\\u1E31': 'k',\n '\\u01E9': 'k',\n '\\u1E33': 'k',\n '\\u0137': 'k',\n '\\u1E35': 'k',\n '\\u0199': 'k',\n '\\u2C6A': 'k',\n '\\uA741': 'k',\n '\\uA743': 'k',\n '\\uA745': 'k',\n '\\uA7A3': 'k',\n '\\u24DB': 'l',\n '\\uFF4C': 'l',\n '\\u0140': 'l',\n '\\u013A': 'l',\n '\\u013E': 'l',\n '\\u1E37': 'l',\n '\\u1E39': 'l',\n '\\u013C': 'l',\n '\\u1E3D': 'l',\n '\\u1E3B': 'l',\n '\\u017F': 'l',\n '\\u0142': 'l',\n '\\u019A': 'l',\n '\\u026B': 'l',\n '\\u2C61': 'l',\n '\\uA749': 'l',\n '\\uA781': 'l',\n '\\uA747': 'l',\n '\\u01C9': 'lj',\n '\\u24DC': 'm',\n '\\uFF4D': 'm',\n '\\u1E3F': 'm',\n '\\u1E41': 'm',\n '\\u1E43': 'm',\n '\\u0271': 'm',\n '\\u026F': 'm',\n '\\u24DD': 'n',\n '\\uFF4E': 'n',\n '\\u01F9': 'n',\n '\\u0144': 'n',\n '\\u00F1': 'n',\n '\\u1E45': 'n',\n '\\u0148': 'n',\n '\\u1E47': 'n',\n '\\u0146': 'n',\n '\\u1E4B': 'n',\n '\\u1E49': 'n',\n '\\u019E': 'n',\n '\\u0272': 'n',\n '\\u0149': 'n',\n '\\uA791': 'n',\n '\\uA7A5': 'n',\n '\\u01CC': 'nj',\n '\\u24DE': 'o',\n '\\uFF4F': 'o',\n '\\u00F2': 'o',\n '\\u00F3': 'o',\n '\\u00F4': 'o',\n '\\u1ED3': 'o',\n '\\u1ED1': 'o',\n '\\u1ED7': 'o',\n '\\u1ED5': 'o',\n '\\u00F5': 'o',\n '\\u1E4D': 'o',\n '\\u022D': 'o',\n '\\u1E4F': 'o',\n '\\u014D': 'o',\n '\\u1E51': 'o',\n '\\u1E53': 'o',\n '\\u014F': 'o',\n '\\u022F': 'o',\n '\\u0231': 'o',\n '\\u00F6': 'o',\n '\\u022B': 'o',\n '\\u1ECF': 'o',\n '\\u0151': 'o',\n '\\u01D2': 'o',\n '\\u020D': 'o',\n '\\u020F': 'o',\n '\\u01A1': 'o',\n '\\u1EDD': 'o',\n '\\u1EDB': 'o',\n '\\u1EE1': 'o',\n '\\u1EDF': 'o',\n '\\u1EE3': 'o',\n '\\u1ECD': 'o',\n '\\u1ED9': 'o',\n '\\u01EB': 'o',\n '\\u01ED': 'o',\n '\\u00F8': 'o',\n '\\u01FF': 'o',\n '\\u0254': 'o',\n '\\uA74B': 'o',\n '\\uA74D': 'o',\n '\\u0275': 'o',\n '\\u0153': 'oe',\n '\\u01A3': 'oi',\n '\\u0223': 'ou',\n '\\uA74F': 'oo',\n '\\u24DF': 'p',\n '\\uFF50': 'p',\n '\\u1E55': 'p',\n '\\u1E57': 'p',\n '\\u01A5': 'p',\n '\\u1D7D': 'p',\n '\\uA751': 'p',\n '\\uA753': 'p',\n '\\uA755': 'p',\n '\\u24E0': 'q',\n '\\uFF51': 'q',\n '\\u024B': 'q',\n '\\uA757': 'q',\n '\\uA759': 'q',\n '\\u24E1': 'r',\n '\\uFF52': 'r',\n '\\u0155': 'r',\n '\\u1E59': 'r',\n '\\u0159': 'r',\n '\\u0211': 'r',\n '\\u0213': 'r',\n '\\u1E5B': 'r',\n '\\u1E5D': 'r',\n '\\u0157': 'r',\n '\\u1E5F': 'r',\n '\\u024D': 'r',\n '\\u027D': 'r',\n '\\uA75B': 'r',\n '\\uA7A7': 'r',\n '\\uA783': 'r',\n '\\u24E2': 's',\n '\\uFF53': 's',\n '\\u00DF': 's',\n '\\u015B': 's',\n '\\u1E65': 's',\n '\\u015D': 's',\n '\\u1E61': 's',\n '\\u0161': 's',\n '\\u1E67': 's',\n '\\u1E63': 's',\n '\\u1E69': 's',\n '\\u0219': 's',\n '\\u015F': 's',\n '\\u023F': 's',\n '\\uA7A9': 's',\n '\\uA785': 's',\n '\\u1E9B': 's',\n '\\u24E3': 't',\n '\\uFF54': 't',\n '\\u1E6B': 't',\n '\\u1E97': 't',\n '\\u0165': 't',\n '\\u1E6D': 't',\n '\\u021B': 't',\n '\\u0163': 't',\n '\\u1E71': 't',\n '\\u1E6F': 't',\n '\\u0167': 't',\n '\\u01AD': 't',\n '\\u0288': 't',\n '\\u2C66': 't',\n '\\uA787': 't',\n '\\uA729': 'tz',\n '\\u24E4': 'u',\n '\\uFF55': 'u',\n '\\u00F9': 'u',\n '\\u00FA': 'u',\n '\\u00FB': 'u',\n '\\u0169': 'u',\n '\\u1E79': 'u',\n '\\u016B': 'u',\n '\\u1E7B': 'u',\n '\\u016D': 'u',\n '\\u00FC': 'u',\n '\\u01DC': 'u',\n '\\u01D8': 'u',\n '\\u01D6': 'u',\n '\\u01DA': 'u',\n '\\u1EE7': 'u',\n '\\u016F': 'u',\n '\\u0171': 'u',\n '\\u01D4': 'u',\n '\\u0215': 'u',\n '\\u0217': 'u',\n '\\u01B0': 'u',\n '\\u1EEB': 'u',\n '\\u1EE9': 'u',\n '\\u1EEF': 'u',\n '\\u1EED': 'u',\n '\\u1EF1': 'u',\n '\\u1EE5': 'u',\n '\\u1E73': 'u',\n '\\u0173': 'u',\n '\\u1E77': 'u',\n '\\u1E75': 'u',\n '\\u0289': 'u',\n '\\u24E5': 'v',\n '\\uFF56': 'v',\n '\\u1E7D': 'v',\n '\\u1E7F': 'v',\n '\\u028B': 'v',\n '\\uA75F': 'v',\n '\\u028C': 'v',\n '\\uA761': 'vy',\n '\\u24E6': 'w',\n '\\uFF57': 'w',\n '\\u1E81': 'w',\n '\\u1E83': 'w',\n '\\u0175': 'w',\n '\\u1E87': 'w',\n '\\u1E85': 'w',\n '\\u1E98': 'w',\n '\\u1E89': 'w',\n '\\u2C73': 'w',\n '\\u24E7': 'x',\n '\\uFF58': 'x',\n '\\u1E8B': 'x',\n '\\u1E8D': 'x',\n '\\u24E8': 'y',\n '\\uFF59': 'y',\n '\\u1EF3': 'y',\n '\\u00FD': 'y',\n '\\u0177': 'y',\n '\\u1EF9': 'y',\n '\\u0233': 'y',\n '\\u1E8F': 'y',\n '\\u00FF': 'y',\n '\\u1EF7': 'y',\n '\\u1E99': 'y',\n '\\u1EF5': 'y',\n '\\u01B4': 'y',\n '\\u024F': 'y',\n '\\u1EFF': 'y',\n '\\u24E9': 'z',\n '\\uFF5A': 'z',\n '\\u017A': 'z',\n '\\u1E91': 'z',\n '\\u017C': 'z',\n '\\u017E': 'z',\n '\\u1E93': 'z',\n '\\u1E95': 'z',\n '\\u01B6': 'z',\n '\\u0225': 'z',\n '\\u0240': 'z',\n '\\u2C6C': 'z',\n '\\uA763': 'z',\n '\\u0386': '\\u0391',\n '\\u0388': '\\u0395',\n '\\u0389': '\\u0397',\n '\\u038A': '\\u0399',\n '\\u03AA': '\\u0399',\n '\\u038C': '\\u039F',\n '\\u038E': '\\u03A5',\n '\\u03AB': '\\u03A5',\n '\\u038F': '\\u03A9',\n '\\u03AC': '\\u03B1',\n '\\u03AD': '\\u03B5',\n '\\u03AE': '\\u03B7',\n '\\u03AF': '\\u03B9',\n '\\u03CA': '\\u03B9',\n '\\u0390': '\\u03B9',\n '\\u03CC': '\\u03BF',\n '\\u03CD': '\\u03C5',\n '\\u03CB': '\\u03C5',\n '\\u03B0': '\\u03C5',\n '\\u03CE': '\\u03C9',\n '\\u03C2': '\\u03C3',\n '\\u2019': '\\''\n };\n\n return diacritics;\n });\n\n S2.define('select2/data/base',[\n '../utils'\n ], function (Utils) {\n function BaseAdapter ($element, options) {\n BaseAdapter.__super__.constructor.call(this);\n }\n\n Utils.Extend(BaseAdapter, Utils.Observable);\n\n BaseAdapter.prototype.current = function (callback) {\n throw new Error('The `current` method must be defined in child classes.');\n };\n\n BaseAdapter.prototype.query = function (params, callback) {\n throw new Error('The `query` method must be defined in child classes.');\n };\n\n BaseAdapter.prototype.bind = function (container, $container) {\n // Can be implemented in subclasses\n };\n\n BaseAdapter.prototype.destroy = function () {\n // Can be implemented in subclasses\n };\n\n BaseAdapter.prototype.generateResultId = function (container, data) {\n var id = container.id + '-result-';\n\n id += Utils.generateChars(4);\n\n if (data.id != null) {\n id += '-' + data.id.toString();\n } else {\n id += '-' + Utils.generateChars(4);\n }\n return id;\n };\n\n return BaseAdapter;\n });\n\n S2.define('select2/data/select',[\n './base',\n '../utils',\n 'jquery'\n ], function (BaseAdapter, Utils, $) {\n function SelectAdapter ($element, options) {\n this.$element = $element;\n this.options = options;\n\n SelectAdapter.__super__.constructor.call(this);\n }\n\n Utils.Extend(SelectAdapter, BaseAdapter);\n\n SelectAdapter.prototype.current = function (callback) {\n var data = [];\n var self = this;\n\n this.$element.find(':selected').each(function () {\n var $option = $(this);\n\n var option = self.item($option);\n\n data.push(option);\n });\n\n callback(data);\n };\n\n SelectAdapter.prototype.select = function (data) {\n var self = this;\n\n data.selected = true;\n\n // If data.element is a DOM node, use it instead\n if ($(data.element).is('option')) {\n data.element.selected = true;\n\n this.$element.trigger('input').trigger('change');\n\n return;\n }\n\n if (this.$element.prop('multiple')) {\n this.current(function (currentData) {\n var val = [];\n\n data = [data];\n data.push.apply(data, currentData);\n\n for (var d = 0; d < data.length; d++) {\n var id = data[d].id;\n\n if ($.inArray(id, val) === -1) {\n val.push(id);\n }\n }\n\n self.$element.val(val);\n self.$element.trigger('input').trigger('change');\n });\n } else {\n var val = data.id;\n\n this.$element.val(val);\n this.$element.trigger('input').trigger('change');\n }\n };\n\n SelectAdapter.prototype.unselect = function (data) {\n var self = this;\n\n if (!this.$element.prop('multiple')) {\n return;\n }\n\n data.selected = false;\n\n if ($(data.element).is('option')) {\n data.element.selected = false;\n\n this.$element.trigger('input').trigger('change');\n\n return;\n }\n\n this.current(function (currentData) {\n var val = [];\n\n for (var d = 0; d < currentData.length; d++) {\n var id = currentData[d].id;\n\n if (id !== data.id && $.inArray(id, val) === -1) {\n val.push(id);\n }\n }\n\n self.$element.val(val);\n\n self.$element.trigger('input').trigger('change');\n });\n };\n\n SelectAdapter.prototype.bind = function (container, $container) {\n var self = this;\n\n this.container = container;\n\n container.on('select', function (params) {\n self.select(params.data);\n });\n\n container.on('unselect', function (params) {\n self.unselect(params.data);\n });\n };\n\n SelectAdapter.prototype.destroy = function () {\n // Remove anything added to child elements\n this.$element.find('*').each(function () {\n // Remove any custom data set by Select2\n Utils.RemoveData(this);\n });\n };\n\n SelectAdapter.prototype.query = function (params, callback) {\n var data = [];\n var self = this;\n\n var $options = this.$element.children();\n\n $options.each(function () {\n var $option = $(this);\n\n if (!$option.is('option') && !$option.is('optgroup')) {\n return;\n }\n\n var option = self.item($option);\n\n var matches = self.matches(params, option);\n\n if (matches !== null) {\n data.push(matches);\n }\n });\n\n callback({\n results: data\n });\n };\n\n SelectAdapter.prototype.addOptions = function ($options) {\n Utils.appendMany(this.$element, $options);\n };\n\n SelectAdapter.prototype.option = function (data) {\n var option;\n\n if (data.children) {\n option = document.createElement('optgroup');\n option.label = data.text;\n } else {\n option = document.createElement('option');\n\n if (option.textContent !== undefined) {\n option.textContent = data.text;\n } else {\n option.innerText = data.text;\n }\n }\n\n if (data.id !== undefined) {\n option.value = data.id;\n }\n\n if (data.disabled) {\n option.disabled = true;\n }\n\n if (data.selected) {\n option.selected = true;\n }\n\n if (data.title) {\n option.title = data.title;\n }\n\n var $option = $(option);\n\n var normalizedData = this._normalizeItem(data);\n normalizedData.element = option;\n\n // Override the option's data with the combined data\n Utils.StoreData(option, 'data', normalizedData);\n\n return $option;\n };\n\n SelectAdapter.prototype.item = function ($option) {\n var data = {};\n\n data = Utils.GetData($option[0], 'data');\n\n if (data != null) {\n return data;\n }\n\n if ($option.is('option')) {\n data = {\n id: $option.val(),\n text: $option.text(),\n disabled: $option.prop('disabled'),\n selected: $option.prop('selected'),\n title: $option.prop('title')\n };\n } else if ($option.is('optgroup')) {\n data = {\n text: $option.prop('label'),\n children: [],\n title: $option.prop('title')\n };\n\n var $children = $option.children('option');\n var children = [];\n\n for (var c = 0; c < $children.length; c++) {\n var $child = $($children[c]);\n\n var child = this.item($child);\n\n children.push(child);\n }\n\n data.children = children;\n }\n\n data = this._normalizeItem(data);\n data.element = $option[0];\n\n Utils.StoreData($option[0], 'data', data);\n\n return data;\n };\n\n SelectAdapter.prototype._normalizeItem = function (item) {\n if (item !== Object(item)) {\n item = {\n id: item,\n text: item\n };\n }\n\n item = $.extend({}, {\n text: ''\n }, item);\n\n var defaults = {\n selected: false,\n disabled: false\n };\n\n if (item.id != null) {\n item.id = item.id.toString();\n }\n\n if (item.text != null) {\n item.text = item.text.toString();\n }\n\n if (item._resultId == null && item.id && this.container != null) {\n item._resultId = this.generateResultId(this.container, item);\n }\n\n return $.extend({}, defaults, item);\n };\n\n SelectAdapter.prototype.matches = function (params, data) {\n var matcher = this.options.get('matcher');\n\n return matcher(params, data);\n };\n\n return SelectAdapter;\n });\n\n S2.define('select2/data/array',[\n './select',\n '../utils',\n 'jquery'\n ], function (SelectAdapter, Utils, $) {\n function ArrayAdapter ($element, options) {\n this._dataToConvert = options.get('data') || [];\n\n ArrayAdapter.__super__.constructor.call(this, $element, options);\n }\n\n Utils.Extend(ArrayAdapter, SelectAdapter);\n\n ArrayAdapter.prototype.bind = function (container, $container) {\n ArrayAdapter.__super__.bind.call(this, container, $container);\n\n this.addOptions(this.convertToOptions(this._dataToConvert));\n };\n\n ArrayAdapter.prototype.select = function (data) {\n var $option = this.$element.find('option').filter(function (i, elm) {\n return elm.value == data.id.toString();\n });\n\n if ($option.length === 0) {\n $option = this.option(data);\n\n this.addOptions($option);\n }\n\n ArrayAdapter.__super__.select.call(this, data);\n };\n\n ArrayAdapter.prototype.convertToOptions = function (data) {\n var self = this;\n\n var $existing = this.$element.find('option');\n var existingIds = $existing.map(function () {\n return self.item($(this)).id;\n }).get();\n\n var $options = [];\n\n // Filter out all items except for the one passed in the argument\n function onlyItem (item) {\n return function () {\n return $(this).val() == item.id;\n };\n }\n\n for (var d = 0; d < data.length; d++) {\n var item = this._normalizeItem(data[d]);\n\n // Skip items which were pre-loaded, only merge the data\n if ($.inArray(item.id, existingIds) >= 0) {\n var $existingOption = $existing.filter(onlyItem(item));\n\n var existingData = this.item($existingOption);\n var newData = $.extend(true, {}, item, existingData);\n\n var $newOption = this.option(newData);\n\n $existingOption.replaceWith($newOption);\n\n continue;\n }\n\n var $option = this.option(item);\n\n if (item.children) {\n var $children = this.convertToOptions(item.children);\n\n Utils.appendMany($option, $children);\n }\n\n $options.push($option);\n }\n\n return $options;\n };\n\n return ArrayAdapter;\n });\n\n S2.define('select2/data/ajax',[\n './array',\n '../utils',\n 'jquery'\n ], function (ArrayAdapter, Utils, $) {\n function AjaxAdapter ($element, options) {\n this.ajaxOptions = this._applyDefaults(options.get('ajax'));\n\n if (this.ajaxOptions.processResults != null) {\n this.processResults = this.ajaxOptions.processResults;\n }\n\n AjaxAdapter.__super__.constructor.call(this, $element, options);\n }\n\n Utils.Extend(AjaxAdapter, ArrayAdapter);\n\n AjaxAdapter.prototype._applyDefaults = function (options) {\n var defaults = {\n data: function (params) {\n return $.extend({}, params, {\n q: params.term\n });\n },\n transport: function (params, success, failure) {\n var $request = $.ajax(params);\n\n $request.then(success);\n $request.fail(failure);\n\n return $request;\n }\n };\n\n return $.extend({}, defaults, options, true);\n };\n\n AjaxAdapter.prototype.processResults = function (results) {\n return results;\n };\n\n AjaxAdapter.prototype.query = function (params, callback) {\n var matches = [];\n var self = this;\n\n if (this._request != null) {\n // JSONP requests cannot always be aborted\n if ($.isFunction(this._request.abort)) {\n this._request.abort();\n }\n\n this._request = null;\n }\n\n var options = $.extend({\n type: 'GET'\n }, this.ajaxOptions);\n\n if (typeof options.url === 'function') {\n options.url = options.url.call(this.$element, params);\n }\n\n if (typeof options.data === 'function') {\n options.data = options.data.call(this.$element, params);\n }\n\n function request () {\n var $request = options.transport(options, function (data) {\n var results = self.processResults(data, params);\n\n if (self.options.get('debug') && window.console && console.error) {\n // Check to make sure that the response included a `results` key.\n if (!results || !results.results || !$.isArray(results.results)) {\n console.error(\n 'Select2: The AJAX results did not return an array in the ' +\n '`results` key of the response.'\n );\n }\n }\n\n callback(results);\n }, function () {\n // Attempt to detect if a request was aborted\n // Only works if the transport exposes a status property\n if ('status' in $request &&\n ($request.status === 0 || $request.status === '0')) {\n return;\n }\n\n self.trigger('results:message', {\n message: 'errorLoading'\n });\n });\n\n self._request = $request;\n }\n\n if (this.ajaxOptions.delay && params.term != null) {\n if (this._queryTimeout) {\n window.clearTimeout(this._queryTimeout);\n }\n\n this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);\n } else {\n request();\n }\n };\n\n return AjaxAdapter;\n });\n\n S2.define('select2/data/tags',[\n 'jquery'\n ], function ($) {\n function Tags (decorated, $element, options) {\n var tags = options.get('tags');\n\n var createTag = options.get('createTag');\n\n if (createTag !== undefined) {\n this.createTag = createTag;\n }\n\n var insertTag = options.get('insertTag');\n\n if (insertTag !== undefined) {\n this.insertTag = insertTag;\n }\n\n decorated.call(this, $element, options);\n\n if ($.isArray(tags)) {\n for (var t = 0; t < tags.length; t++) {\n var tag = tags[t];\n var item = this._normalizeItem(tag);\n\n var $option = this.option(item);\n\n this.$element.append($option);\n }\n }\n }\n\n Tags.prototype.query = function (decorated, params, callback) {\n var self = this;\n\n this._removeOldTags();\n\n if (params.term == null || params.page != null) {\n decorated.call(this, params, callback);\n return;\n }\n\n function wrapper (obj, child) {\n var data = obj.results;\n\n for (var i = 0; i < data.length; i++) {\n var option = data[i];\n\n var checkChildren = (\n option.children != null &&\n !wrapper({\n results: option.children\n }, true)\n );\n\n var optionText = (option.text || '').toUpperCase();\n var paramsTerm = (params.term || '').toUpperCase();\n\n var checkText = optionText === paramsTerm;\n\n if (checkText || checkChildren) {\n if (child) {\n return false;\n }\n\n obj.data = data;\n callback(obj);\n\n return;\n }\n }\n\n if (child) {\n return true;\n }\n\n var tag = self.createTag(params);\n\n if (tag != null) {\n var $option = self.option(tag);\n $option.attr('data-select2-tag', true);\n\n self.addOptions([$option]);\n\n self.insertTag(data, tag);\n }\n\n obj.results = data;\n\n callback(obj);\n }\n\n decorated.call(this, params, wrapper);\n };\n\n Tags.prototype.createTag = function (decorated, params) {\n var term = $.trim(params.term);\n\n if (term === '') {\n return null;\n }\n\n return {\n id: term,\n text: term\n };\n };\n\n Tags.prototype.insertTag = function (_, data, tag) {\n data.unshift(tag);\n };\n\n Tags.prototype._removeOldTags = function (_) {\n var $options = this.$element.find('option[data-select2-tag]');\n\n $options.each(function () {\n if (this.selected) {\n return;\n }\n\n $(this).remove();\n });\n };\n\n return Tags;\n });\n\n S2.define('select2/data/tokenizer',[\n 'jquery'\n ], function ($) {\n function Tokenizer (decorated, $element, options) {\n var tokenizer = options.get('tokenizer');\n\n if (tokenizer !== undefined) {\n this.tokenizer = tokenizer;\n }\n\n decorated.call(this, $element, options);\n }\n\n Tokenizer.prototype.bind = function (decorated, container, $container) {\n decorated.call(this, container, $container);\n\n this.$search = container.dropdown.$search || container.selection.$search ||\n $container.find('.select2-search__field');\n };\n\n Tokenizer.prototype.query = function (decorated, params, callback) {\n var self = this;\n\n function createAndSelect (data) {\n // Normalize the data object so we can use it for checks\n var item = self._normalizeItem(data);\n\n // Check if the data object already exists as a tag\n // Select it if it doesn't\n var $existingOptions = self.$element.find('option').filter(function () {\n return $(this).val() === item.id;\n });\n\n // If an existing option wasn't found for it, create the option\n if (!$existingOptions.length) {\n var $option = self.option(item);\n $option.attr('data-select2-tag', true);\n\n self._removeOldTags();\n self.addOptions([$option]);\n }\n\n // Select the item, now that we know there is an option for it\n select(item);\n }\n\n function select (data) {\n self.trigger('select', {\n data: data\n });\n }\n\n params.term = params.term || '';\n\n var tokenData = this.tokenizer(params, this.options, createAndSelect);\n\n if (tokenData.term !== params.term) {\n // Replace the search term if we have the search box\n if (this.$search.length) {\n this.$search.val(tokenData.term);\n this.$search.trigger('focus');\n }\n\n params.term = tokenData.term;\n }\n\n decorated.call(this, params, callback);\n };\n\n Tokenizer.prototype.tokenizer = function (_, params, options, callback) {\n var separators = options.get('tokenSeparators') || [];\n var term = params.term;\n var i = 0;\n\n var createTag = this.createTag || function (params) {\n return {\n id: params.term,\n text: params.term\n };\n };\n\n while (i < term.length) {\n var termChar = term[i];\n\n if ($.inArray(termChar, separators) === -1) {\n i++;\n\n continue;\n }\n\n var part = term.substr(0, i);\n var partParams = $.extend({}, params, {\n term: part\n });\n\n var data = createTag(partParams);\n\n if (data == null) {\n i++;\n continue;\n }\n\n callback(data);\n\n // Reset the term to not include the tokenized portion\n term = term.substr(i + 1) || '';\n i = 0;\n }\n\n return {\n term: term\n };\n };\n\n return Tokenizer;\n });\n\n S2.define('select2/data/minimumInputLength',[\n\n ], function () {\n function MinimumInputLength (decorated, $e, options) {\n this.minimumInputLength = options.get('minimumInputLength');\n\n decorated.call(this, $e, options);\n }\n\n MinimumInputLength.prototype.query = function (decorated, params, callback) {\n params.term = params.term || '';\n\n if (params.term.length < this.minimumInputLength) {\n this.trigger('results:message', {\n message: 'inputTooShort',\n args: {\n minimum: this.minimumInputLength,\n input: params.term,\n params: params\n }\n });\n\n return;\n }\n\n decorated.call(this, params, callback);\n };\n\n return MinimumInputLength;\n });\n\n S2.define('select2/data/maximumInputLength',[\n\n ], function () {\n function MaximumInputLength (decorated, $e, options) {\n this.maximumInputLength = options.get('maximumInputLength');\n\n decorated.call(this, $e, options);\n }\n\n MaximumInputLength.prototype.query = function (decorated, params, callback) {\n params.term = params.term || '';\n\n if (this.maximumInputLength > 0 &&\n params.term.length > this.maximumInputLength) {\n this.trigger('results:message', {\n message: 'inputTooLong',\n args: {\n maximum: this.maximumInputLength,\n input: params.term,\n params: params\n }\n });\n\n return;\n }\n\n decorated.call(this, params, callback);\n };\n\n return MaximumInputLength;\n });\n\n S2.define('select2/data/maximumSelectionLength',[\n\n ], function (){\n function MaximumSelectionLength (decorated, $e, options) {\n this.maximumSelectionLength = options.get('maximumSelectionLength');\n\n decorated.call(this, $e, options);\n }\n\n MaximumSelectionLength.prototype.bind =\n function (decorated, container, $container) {\n var self = this;\n\n decorated.call(this, container, $container);\n\n container.on('select', function () {\n self._checkIfMaximumSelected();\n });\n };\n\n MaximumSelectionLength.prototype.query =\n function (decorated, params, callback) {\n var self = this;\n\n this._checkIfMaximumSelected(function () {\n decorated.call(self, params, callback);\n });\n };\n\n MaximumSelectionLength.prototype._checkIfMaximumSelected =\n function (_, successCallback) {\n var self = this;\n\n this.current(function (currentData) {\n var count = currentData != null ? currentData.length : 0;\n if (self.maximumSelectionLength > 0 &&\n count >= self.maximumSelectionLength) {\n self.trigger('results:message', {\n message: 'maximumSelected',\n args: {\n maximum: self.maximumSelectionLength\n }\n });\n return;\n }\n\n if (successCallback) {\n successCallback();\n }\n });\n };\n\n return MaximumSelectionLength;\n });\n\n S2.define('select2/dropdown',[\n 'jquery',\n './utils'\n ], function ($, Utils) {\n function Dropdown ($element, options) {\n this.$element = $element;\n this.options = options;\n\n Dropdown.__super__.constructor.call(this);\n }\n\n Utils.Extend(Dropdown, Utils.Observable);\n\n Dropdown.prototype.render = function () {\n var $dropdown = $(\n '' +\n '' +\n ''\n );\n\n $dropdown.attr('dir', this.options.get('dir'));\n\n this.$dropdown = $dropdown;\n\n return $dropdown;\n };\n\n Dropdown.prototype.bind = function () {\n // Should be implemented in subclasses\n };\n\n Dropdown.prototype.position = function ($dropdown, $container) {\n // Should be implemented in subclasses\n };\n\n Dropdown.prototype.destroy = function () {\n // Remove the dropdown from the DOM\n this.$dropdown.remove();\n };\n\n return Dropdown;\n });\n\n S2.define('select2/dropdown/search',[\n 'jquery',\n '../utils'\n ], function ($, Utils) {\n function Search () { }\n\n Search.prototype.render = function (decorated) {\n var $rendered = decorated.call(this);\n\n var $search = $(\n '' +\n '' +\n ''\n );\n\n this.$searchContainer = $search;\n this.$search = $search.find('input');\n\n $rendered.prepend($search);\n\n return $rendered;\n };\n\n Search.prototype.bind = function (decorated, container, $container) {\n var self = this;\n\n var resultsId = container.id + '-results';\n\n decorated.call(this, container, $container);\n\n this.$search.on('keydown', function (evt) {\n self.trigger('keypress', evt);\n\n self._keyUpPrevented = evt.isDefaultPrevented();\n });\n\n // Workaround for browsers which do not support the `input` event\n // This will prevent double-triggering of events for browsers which support\n // both the `keyup` and `input` events.\n this.$search.on('input', function (evt) {\n // Unbind the duplicated `keyup` event\n $(this).off('keyup');\n });\n\n this.$search.on('keyup input', function (evt) {\n self.handleSearch(evt);\n });\n\n container.on('open', function () {\n self.$search.attr('tabindex', 0);\n self.$search.attr('aria-controls', resultsId);\n\n self.$search.trigger('focus');\n\n window.setTimeout(function () {\n self.$search.trigger('focus');\n }, 0);\n });\n\n container.on('close', function () {\n self.$search.attr('tabindex', -1);\n self.$search.removeAttr('aria-controls');\n self.$search.removeAttr('aria-activedescendant');\n\n self.$search.val('');\n self.$search.trigger('blur');\n });\n\n container.on('focus', function () {\n if (!container.isOpen()) {\n self.$search.trigger('focus');\n }\n });\n\n container.on('results:all', function (params) {\n if (params.query.term == null || params.query.term === '') {\n var showSearch = self.showSearch(params);\n\n if (showSearch) {\n self.$searchContainer.removeClass('select2-search--hide');\n } else {\n self.$searchContainer.addClass('select2-search--hide');\n }\n }\n });\n\n container.on('results:focus', function (params) {\n if (params.data._resultId) {\n self.$search.attr('aria-activedescendant', params.data._resultId);\n } else {\n self.$search.removeAttr('aria-activedescendant');\n }\n });\n };\n\n Search.prototype.handleSearch = function (evt) {\n if (!this._keyUpPrevented) {\n var input = this.$search.val();\n\n this.trigger('query', {\n term: input\n });\n }\n\n this._keyUpPrevented = false;\n };\n\n Search.prototype.showSearch = function (_, params) {\n return true;\n };\n\n return Search;\n });\n\n S2.define('select2/dropdown/hidePlaceholder',[\n\n ], function () {\n function HidePlaceholder (decorated, $element, options, dataAdapter) {\n this.placeholder = this.normalizePlaceholder(options.get('placeholder'));\n\n decorated.call(this, $element, options, dataAdapter);\n }\n\n HidePlaceholder.prototype.append = function (decorated, data) {\n data.results = this.removePlaceholder(data.results);\n\n decorated.call(this, data);\n };\n\n HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {\n if (typeof placeholder === 'string') {\n placeholder = {\n id: '',\n text: placeholder\n };\n }\n\n return placeholder;\n };\n\n HidePlaceholder.prototype.removePlaceholder = function (_, data) {\n var modifiedData = data.slice(0);\n\n for (var d = data.length - 1; d >= 0; d--) {\n var item = data[d];\n\n if (this.placeholder.id === item.id) {\n modifiedData.splice(d, 1);\n }\n }\n\n return modifiedData;\n };\n\n return HidePlaceholder;\n });\n\n S2.define('select2/dropdown/infiniteScroll',[\n 'jquery'\n ], function ($) {\n function InfiniteScroll (decorated, $element, options, dataAdapter) {\n this.lastParams = {};\n\n decorated.call(this, $element, options, dataAdapter);\n\n this.$loadingMore = this.createLoadingMore();\n this.loading = false;\n }\n\n InfiniteScroll.prototype.append = function (decorated, data) {\n this.$loadingMore.remove();\n this.loading = false;\n\n decorated.call(this, data);\n\n if (this.showLoadingMore(data)) {\n this.$results.append(this.$loadingMore);\n this.loadMoreIfNeeded();\n }\n };\n\n InfiniteScroll.prototype.bind = function (decorated, container, $container) {\n var self = this;\n\n decorated.call(this, container, $container);\n\n container.on('query', function (params) {\n self.lastParams = params;\n self.loading = true;\n });\n\n container.on('query:append', function (params) {\n self.lastParams = params;\n self.loading = true;\n });\n\n this.$results.on('scroll', this.loadMoreIfNeeded.bind(this));\n };\n\n InfiniteScroll.prototype.loadMoreIfNeeded = function () {\n var isLoadMoreVisible = $.contains(\n document.documentElement,\n this.$loadingMore[0]\n );\n\n if (this.loading || !isLoadMoreVisible) {\n return;\n }\n\n var currentOffset = this.$results.offset().top +\n this.$results.outerHeight(false);\n var loadingMoreOffset = this.$loadingMore.offset().top +\n this.$loadingMore.outerHeight(false);\n\n if (currentOffset + 50 >= loadingMoreOffset) {\n this.loadMore();\n }\n };\n\n InfiniteScroll.prototype.loadMore = function () {\n this.loading = true;\n\n var params = $.extend({}, {page: 1}, this.lastParams);\n\n params.page++;\n\n this.trigger('query:append', params);\n };\n\n InfiniteScroll.prototype.showLoadingMore = function (_, data) {\n return data.pagination && data.pagination.more;\n };\n\n InfiniteScroll.prototype.createLoadingMore = function () {\n var $option = $(\n '
    • '\n );\n\n var message = this.options.get('translations').get('loadingMore');\n\n $option.html(message(this.lastParams));\n\n return $option;\n };\n\n return InfiniteScroll;\n });\n\n S2.define('select2/dropdown/attachBody',[\n 'jquery',\n '../utils'\n ], function ($, Utils) {\n function AttachBody (decorated, $element, options) {\n this.$dropdownParent = $(options.get('dropdownParent') || document.body);\n\n decorated.call(this, $element, options);\n }\n\n AttachBody.prototype.bind = function (decorated, container, $container) {\n var self = this;\n\n decorated.call(this, container, $container);\n\n container.on('open', function () {\n self._showDropdown();\n self._attachPositioningHandler(container);\n\n // Must bind after the results handlers to ensure correct sizing\n self._bindContainerResultHandlers(container);\n });\n\n container.on('close', function () {\n self._hideDropdown();\n self._detachPositioningHandler(container);\n });\n\n this.$dropdownContainer.on('mousedown', function (evt) {\n evt.stopPropagation();\n });\n };\n\n AttachBody.prototype.destroy = function (decorated) {\n decorated.call(this);\n\n this.$dropdownContainer.remove();\n };\n\n AttachBody.prototype.position = function (decorated, $dropdown, $container) {\n // Clone all of the container classes\n $dropdown.attr('class', $container.attr('class'));\n\n $dropdown.removeClass('select2');\n $dropdown.addClass('select2-container--open');\n\n $dropdown.css({\n position: 'absolute',\n top: -999999\n });\n\n this.$container = $container;\n };\n\n AttachBody.prototype.render = function (decorated) {\n var $container = $('');\n\n var $dropdown = decorated.call(this);\n $container.append($dropdown);\n\n this.$dropdownContainer = $container;\n\n return $container;\n };\n\n AttachBody.prototype._hideDropdown = function (decorated) {\n this.$dropdownContainer.detach();\n };\n\n AttachBody.prototype._bindContainerResultHandlers =\n function (decorated, container) {\n\n // These should only be bound once\n if (this._containerResultsHandlersBound) {\n return;\n }\n\n var self = this;\n\n container.on('results:all', function () {\n self._positionDropdown();\n self._resizeDropdown();\n });\n\n container.on('results:append', function () {\n self._positionDropdown();\n self._resizeDropdown();\n });\n\n container.on('results:message', function () {\n self._positionDropdown();\n self._resizeDropdown();\n });\n\n container.on('select', function () {\n self._positionDropdown();\n self._resizeDropdown();\n });\n\n container.on('unselect', function () {\n self._positionDropdown();\n self._resizeDropdown();\n });\n\n this._containerResultsHandlersBound = true;\n };\n\n AttachBody.prototype._attachPositioningHandler =\n function (decorated, container) {\n var self = this;\n\n var scrollEvent = 'scroll.select2.' + container.id;\n var resizeEvent = 'resize.select2.' + container.id;\n var orientationEvent = 'orientationchange.select2.' + container.id;\n\n var $watchers = this.$container.parents().filter(Utils.hasScroll);\n $watchers.each(function () {\n Utils.StoreData(this, 'select2-scroll-position', {\n x: $(this).scrollLeft(),\n y: $(this).scrollTop()\n });\n });\n\n $watchers.on(scrollEvent, function (ev) {\n var position = Utils.GetData(this, 'select2-scroll-position');\n $(this).scrollTop(position.y);\n });\n\n $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,\n function (e) {\n self._positionDropdown();\n self._resizeDropdown();\n });\n };\n\n AttachBody.prototype._detachPositioningHandler =\n function (decorated, container) {\n var scrollEvent = 'scroll.select2.' + container.id;\n var resizeEvent = 'resize.select2.' + container.id;\n var orientationEvent = 'orientationchange.select2.' + container.id;\n\n var $watchers = this.$container.parents().filter(Utils.hasScroll);\n $watchers.off(scrollEvent);\n\n $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);\n };\n\n AttachBody.prototype._positionDropdown = function () {\n var $window = $(window);\n\n var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above');\n var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below');\n\n var newDirection = null;\n\n var offset = this.$container.offset();\n\n offset.bottom = offset.top + this.$container.outerHeight(false);\n\n var container = {\n height: this.$container.outerHeight(false)\n };\n\n container.top = offset.top;\n container.bottom = offset.top + container.height;\n\n var dropdown = {\n height: this.$dropdown.outerHeight(false)\n };\n\n var viewport = {\n top: $window.scrollTop(),\n bottom: $window.scrollTop() + $window.height()\n };\n\n var enoughRoomAbove = viewport.top < (offset.top - dropdown.height);\n var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height);\n\n var css = {\n left: offset.left,\n top: container.bottom\n };\n\n // Determine what the parent element is to use for calculating the offset\n var $offsetParent = this.$dropdownParent;\n\n // For statically positioned elements, we need to get the element\n // that is determining the offset\n if ($offsetParent.css('position') === 'static') {\n $offsetParent = $offsetParent.offsetParent();\n }\n\n var parentOffset = {\n top: 0,\n left: 0\n };\n\n if (\n $.contains(document.body, $offsetParent[0]) ||\n $offsetParent[0].isConnected\n ) {\n parentOffset = $offsetParent.offset();\n }\n\n css.top -= parentOffset.top;\n css.left -= parentOffset.left;\n\n if (!isCurrentlyAbove && !isCurrentlyBelow) {\n newDirection = 'below';\n }\n\n if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {\n newDirection = 'above';\n } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {\n newDirection = 'below';\n }\n\n if (newDirection == 'above' ||\n (isCurrentlyAbove && newDirection !== 'below')) {\n css.top = container.top - parentOffset.top - dropdown.height;\n }\n\n if (newDirection != null) {\n this.$dropdown\n .removeClass('select2-dropdown--below select2-dropdown--above')\n .addClass('select2-dropdown--' + newDirection);\n this.$container\n .removeClass('select2-container--below select2-container--above')\n .addClass('select2-container--' + newDirection);\n }\n\n this.$dropdownContainer.css(css);\n };\n\n AttachBody.prototype._resizeDropdown = function () {\n var css = {\n width: this.$container.outerWidth(false) + 'px'\n };\n\n if (this.options.get('dropdownAutoWidth')) {\n css.minWidth = css.width;\n css.position = 'relative';\n css.width = 'auto';\n }\n\n this.$dropdown.css(css);\n };\n\n AttachBody.prototype._showDropdown = function (decorated) {\n this.$dropdownContainer.appendTo(this.$dropdownParent);\n\n this._positionDropdown();\n this._resizeDropdown();\n };\n\n return AttachBody;\n });\n\n S2.define('select2/dropdown/minimumResultsForSearch',[\n\n ], function () {\n function countResults (data) {\n var count = 0;\n\n for (var d = 0; d < data.length; d++) {\n var item = data[d];\n\n if (item.children) {\n count += countResults(item.children);\n } else {\n count++;\n }\n }\n\n return count;\n }\n\n function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {\n this.minimumResultsForSearch = options.get('minimumResultsForSearch');\n\n if (this.minimumResultsForSearch < 0) {\n this.minimumResultsForSearch = Infinity;\n }\n\n decorated.call(this, $element, options, dataAdapter);\n }\n\n MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {\n if (countResults(params.data.results) < this.minimumResultsForSearch) {\n return false;\n }\n\n return decorated.call(this, params);\n };\n\n return MinimumResultsForSearch;\n });\n\n S2.define('select2/dropdown/selectOnClose',[\n '../utils'\n ], function (Utils) {\n function SelectOnClose () { }\n\n SelectOnClose.prototype.bind = function (decorated, container, $container) {\n var self = this;\n\n decorated.call(this, container, $container);\n\n container.on('close', function (params) {\n self._handleSelectOnClose(params);\n });\n };\n\n SelectOnClose.prototype._handleSelectOnClose = function (_, params) {\n if (params && params.originalSelect2Event != null) {\n var event = params.originalSelect2Event;\n\n // Don't select an item if the close event was triggered from a select or\n // unselect event\n if (event._type === 'select' || event._type === 'unselect') {\n return;\n }\n }\n\n var $highlightedResults = this.getHighlightedResults();\n\n // Only select highlighted results\n if ($highlightedResults.length < 1) {\n return;\n }\n\n var data = Utils.GetData($highlightedResults[0], 'data');\n\n // Don't re-select already selected resulte\n if (\n (data.element != null && data.element.selected) ||\n (data.element == null && data.selected)\n ) {\n return;\n }\n\n this.trigger('select', {\n data: data\n });\n };\n\n return SelectOnClose;\n });\n\n S2.define('select2/dropdown/closeOnSelect',[\n\n ], function () {\n function CloseOnSelect () { }\n\n CloseOnSelect.prototype.bind = function (decorated, container, $container) {\n var self = this;\n\n decorated.call(this, container, $container);\n\n container.on('select', function (evt) {\n self._selectTriggered(evt);\n });\n\n container.on('unselect', function (evt) {\n self._selectTriggered(evt);\n });\n };\n\n CloseOnSelect.prototype._selectTriggered = function (_, evt) {\n var originalEvent = evt.originalEvent;\n\n // Don't close if the control key is being held\n if (originalEvent && (originalEvent.ctrlKey || originalEvent.metaKey)) {\n return;\n }\n\n this.trigger('close', {\n originalEvent: originalEvent,\n originalSelect2Event: evt\n });\n };\n\n return CloseOnSelect;\n });\n\n S2.define('select2/i18n/en',[],function () {\n // English\n return {\n errorLoading: function () {\n return 'The results could not be loaded.';\n },\n inputTooLong: function (args) {\n var overChars = args.input.length - args.maximum;\n\n var message = 'Please delete ' + overChars + ' character';\n\n if (overChars != 1) {\n message += 's';\n }\n\n return message;\n },\n inputTooShort: function (args) {\n var remainingChars = args.minimum - args.input.length;\n\n var message = 'Please enter ' + remainingChars + ' or more characters';\n\n return message;\n },\n loadingMore: function () {\n return 'Loading more results…';\n },\n maximumSelected: function (args) {\n var message = 'You can only select ' + args.maximum + ' item';\n\n if (args.maximum != 1) {\n message += 's';\n }\n\n return message;\n },\n noResults: function () {\n return 'No results found';\n },\n searching: function () {\n return 'Searching…';\n },\n removeAllItems: function () {\n return 'Remove all items';\n }\n };\n });\n\n S2.define('select2/defaults',[\n 'jquery',\n 'require',\n\n './results',\n\n './selection/single',\n './selection/multiple',\n './selection/placeholder',\n './selection/allowClear',\n './selection/search',\n './selection/eventRelay',\n\n './utils',\n './translation',\n './diacritics',\n\n './data/select',\n './data/array',\n './data/ajax',\n './data/tags',\n './data/tokenizer',\n './data/minimumInputLength',\n './data/maximumInputLength',\n './data/maximumSelectionLength',\n\n './dropdown',\n './dropdown/search',\n './dropdown/hidePlaceholder',\n './dropdown/infiniteScroll',\n './dropdown/attachBody',\n './dropdown/minimumResultsForSearch',\n './dropdown/selectOnClose',\n './dropdown/closeOnSelect',\n\n './i18n/en'\n ], function ($, require,\n\n ResultsList,\n\n SingleSelection, MultipleSelection, Placeholder, AllowClear,\n SelectionSearch, EventRelay,\n\n Utils, Translation, DIACRITICS,\n\n SelectData, ArrayData, AjaxData, Tags, Tokenizer,\n MinimumInputLength, MaximumInputLength, MaximumSelectionLength,\n\n Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,\n AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect,\n\n EnglishTranslation) {\n function Defaults () {\n this.reset();\n }\n\n Defaults.prototype.apply = function (options) {\n options = $.extend(true, {}, this.defaults, options);\n\n if (options.dataAdapter == null) {\n if (options.ajax != null) {\n options.dataAdapter = AjaxData;\n } else if (options.data != null) {\n options.dataAdapter = ArrayData;\n } else {\n options.dataAdapter = SelectData;\n }\n\n if (options.minimumInputLength > 0) {\n options.dataAdapter = Utils.Decorate(\n options.dataAdapter,\n MinimumInputLength\n );\n }\n\n if (options.maximumInputLength > 0) {\n options.dataAdapter = Utils.Decorate(\n options.dataAdapter,\n MaximumInputLength\n );\n }\n\n if (options.maximumSelectionLength > 0) {\n options.dataAdapter = Utils.Decorate(\n options.dataAdapter,\n MaximumSelectionLength\n );\n }\n\n if (options.tags) {\n options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);\n }\n\n if (options.tokenSeparators != null || options.tokenizer != null) {\n options.dataAdapter = Utils.Decorate(\n options.dataAdapter,\n Tokenizer\n );\n }\n\n if (options.query != null) {\n var Query = require(options.amdBase + 'compat/query');\n\n options.dataAdapter = Utils.Decorate(\n options.dataAdapter,\n Query\n );\n }\n\n if (options.initSelection != null) {\n var InitSelection = require(options.amdBase + 'compat/initSelection');\n\n options.dataAdapter = Utils.Decorate(\n options.dataAdapter,\n InitSelection\n );\n }\n }\n\n if (options.resultsAdapter == null) {\n options.resultsAdapter = ResultsList;\n\n if (options.ajax != null) {\n options.resultsAdapter = Utils.Decorate(\n options.resultsAdapter,\n InfiniteScroll\n );\n }\n\n if (options.placeholder != null) {\n options.resultsAdapter = Utils.Decorate(\n options.resultsAdapter,\n HidePlaceholder\n );\n }\n\n if (options.selectOnClose) {\n options.resultsAdapter = Utils.Decorate(\n options.resultsAdapter,\n SelectOnClose\n );\n }\n }\n\n if (options.dropdownAdapter == null) {\n if (options.multiple) {\n options.dropdownAdapter = Dropdown;\n } else {\n var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);\n\n options.dropdownAdapter = SearchableDropdown;\n }\n\n if (options.minimumResultsForSearch !== 0) {\n options.dropdownAdapter = Utils.Decorate(\n options.dropdownAdapter,\n MinimumResultsForSearch\n );\n }\n\n if (options.closeOnSelect) {\n options.dropdownAdapter = Utils.Decorate(\n options.dropdownAdapter,\n CloseOnSelect\n );\n }\n\n if (\n options.dropdownCssClass != null ||\n options.dropdownCss != null ||\n options.adaptDropdownCssClass != null\n ) {\n var DropdownCSS = require(options.amdBase + 'compat/dropdownCss');\n\n options.dropdownAdapter = Utils.Decorate(\n options.dropdownAdapter,\n DropdownCSS\n );\n }\n\n options.dropdownAdapter = Utils.Decorate(\n options.dropdownAdapter,\n AttachBody\n );\n }\n\n if (options.selectionAdapter == null) {\n if (options.multiple) {\n options.selectionAdapter = MultipleSelection;\n } else {\n options.selectionAdapter = SingleSelection;\n }\n\n // Add the placeholder mixin if a placeholder was specified\n if (options.placeholder != null) {\n options.selectionAdapter = Utils.Decorate(\n options.selectionAdapter,\n Placeholder\n );\n }\n\n if (options.allowClear) {\n options.selectionAdapter = Utils.Decorate(\n options.selectionAdapter,\n AllowClear\n );\n }\n\n if (options.multiple) {\n options.selectionAdapter = Utils.Decorate(\n options.selectionAdapter,\n SelectionSearch\n );\n }\n\n if (\n options.containerCssClass != null ||\n options.containerCss != null ||\n options.adaptContainerCssClass != null\n ) {\n var ContainerCSS = require(options.amdBase + 'compat/containerCss');\n\n options.selectionAdapter = Utils.Decorate(\n options.selectionAdapter,\n ContainerCSS\n );\n }\n\n options.selectionAdapter = Utils.Decorate(\n options.selectionAdapter,\n EventRelay\n );\n }\n\n // If the defaults were not previously applied from an element, it is\n // possible for the language option to have not been resolved\n options.language = this._resolveLanguage(options.language);\n\n // Always fall back to English since it will always be complete\n options.language.push('en');\n\n var uniqueLanguages = [];\n\n for (var l = 0; l < options.language.length; l++) {\n var language = options.language[l];\n\n if (uniqueLanguages.indexOf(language) === -1) {\n uniqueLanguages.push(language);\n }\n }\n\n options.language = uniqueLanguages;\n\n options.translations = this._processTranslations(\n options.language,\n options.debug\n );\n\n return options;\n };\n\n Defaults.prototype.reset = function () {\n function stripDiacritics (text) {\n // Used 'uni range + named function' from http://jsperf.com/diacritics/18\n function match(a) {\n return DIACRITICS[a] || a;\n }\n\n return text.replace(/[^\\u0000-\\u007E]/g, match);\n }\n\n function matcher (params, data) {\n // Always return the object if there is nothing to compare\n if ($.trim(params.term) === '') {\n return data;\n }\n\n // Do a recursive check for options with children\n if (data.children && data.children.length > 0) {\n // Clone the data object if there are children\n // This is required as we modify the object to remove any non-matches\n var match = $.extend(true, {}, data);\n\n // Check each child of the option\n for (var c = data.children.length - 1; c >= 0; c--) {\n var child = data.children[c];\n\n var matches = matcher(params, child);\n\n // If there wasn't a match, remove the object in the array\n if (matches == null) {\n match.children.splice(c, 1);\n }\n }\n\n // If any children matched, return the new object\n if (match.children.length > 0) {\n return match;\n }\n\n // If there were no matching children, check just the plain object\n return matcher(params, match);\n }\n\n var original = stripDiacritics(data.text).toUpperCase();\n var term = stripDiacritics(params.term).toUpperCase();\n\n // Check if the text contains the term\n if (original.indexOf(term) > -1) {\n return data;\n }\n\n // If it doesn't contain the term, don't return anything\n return null;\n }\n\n this.defaults = {\n amdBase: './',\n amdLanguageBase: './i18n/',\n closeOnSelect: true,\n debug: false,\n dropdownAutoWidth: false,\n escapeMarkup: Utils.escapeMarkup,\n language: {},\n matcher: matcher,\n minimumInputLength: 0,\n maximumInputLength: 0,\n maximumSelectionLength: 0,\n minimumResultsForSearch: 0,\n selectOnClose: false,\n scrollAfterSelect: false,\n sorter: function (data) {\n return data;\n },\n templateResult: function (result) {\n return result.text;\n },\n templateSelection: function (selection) {\n return selection.text;\n },\n theme: 'default',\n width: 'resolve'\n };\n };\n\n Defaults.prototype.applyFromElement = function (options, $element) {\n var optionLanguage = options.language;\n var defaultLanguage = this.defaults.language;\n var elementLanguage = $element.prop('lang');\n var parentLanguage = $element.closest('[lang]').prop('lang');\n\n var languages = Array.prototype.concat.call(\n this._resolveLanguage(elementLanguage),\n this._resolveLanguage(optionLanguage),\n this._resolveLanguage(defaultLanguage),\n this._resolveLanguage(parentLanguage)\n );\n\n options.language = languages;\n\n return options;\n };\n\n Defaults.prototype._resolveLanguage = function (language) {\n if (!language) {\n return [];\n }\n\n if ($.isEmptyObject(language)) {\n return [];\n }\n\n if ($.isPlainObject(language)) {\n return [language];\n }\n\n var languages;\n\n if (!$.isArray(language)) {\n languages = [language];\n } else {\n languages = language;\n }\n\n var resolvedLanguages = [];\n\n for (var l = 0; l < languages.length; l++) {\n resolvedLanguages.push(languages[l]);\n\n if (typeof languages[l] === 'string' && languages[l].indexOf('-') > 0) {\n // Extract the region information if it is included\n var languageParts = languages[l].split('-');\n var baseLanguage = languageParts[0];\n\n resolvedLanguages.push(baseLanguage);\n }\n }\n\n return resolvedLanguages;\n };\n\n Defaults.prototype._processTranslations = function (languages, debug) {\n var translations = new Translation();\n\n for (var l = 0; l < languages.length; l++) {\n var languageData = new Translation();\n\n var language = languages[l];\n\n if (typeof language === 'string') {\n try {\n // Try to load it with the original name\n languageData = Translation.loadPath(language);\n } catch (e) {\n try {\n // If we couldn't load it, check if it wasn't the full path\n language = this.defaults.amdLanguageBase + language;\n languageData = Translation.loadPath(language);\n } catch (ex) {\n // The translation could not be loaded at all. Sometimes this is\n // because of a configuration problem, other times this can be\n // because of how Select2 helps load all possible translation files\n if (debug && window.console && console.warn) {\n console.warn(\n 'Select2: The language file for \"' + language + '\" could ' +\n 'not be automatically loaded. A fallback will be used instead.'\n );\n }\n }\n }\n } else if ($.isPlainObject(language)) {\n languageData = new Translation(language);\n } else {\n languageData = language;\n }\n\n translations.extend(languageData);\n }\n\n return translations;\n };\n\n Defaults.prototype.set = function (key, value) {\n var camelKey = $.camelCase(key);\n\n var data = {};\n data[camelKey] = value;\n\n var convertedData = Utils._convertData(data);\n\n $.extend(true, this.defaults, convertedData);\n };\n\n var defaults = new Defaults();\n\n return defaults;\n });\n\n S2.define('select2/options',[\n 'require',\n 'jquery',\n './defaults',\n './utils'\n ], function (require, $, Defaults, Utils) {\n function Options (options, $element) {\n this.options = options;\n\n if ($element != null) {\n this.fromElement($element);\n }\n\n if ($element != null) {\n this.options = Defaults.applyFromElement(this.options, $element);\n }\n\n this.options = Defaults.apply(this.options);\n\n if ($element && $element.is('input')) {\n var InputCompat = require(this.get('amdBase') + 'compat/inputData');\n\n this.options.dataAdapter = Utils.Decorate(\n this.options.dataAdapter,\n InputCompat\n );\n }\n }\n\n Options.prototype.fromElement = function ($e) {\n var excludedData = ['select2'];\n\n if (this.options.multiple == null) {\n this.options.multiple = $e.prop('multiple');\n }\n\n if (this.options.disabled == null) {\n this.options.disabled = $e.prop('disabled');\n }\n\n if (this.options.dir == null) {\n if ($e.prop('dir')) {\n this.options.dir = $e.prop('dir');\n } else if ($e.closest('[dir]').prop('dir')) {\n this.options.dir = $e.closest('[dir]').prop('dir');\n } else {\n this.options.dir = 'ltr';\n }\n }\n\n $e.prop('disabled', this.options.disabled);\n $e.prop('multiple', this.options.multiple);\n\n if (Utils.GetData($e[0], 'select2Tags')) {\n if (this.options.debug && window.console && console.warn) {\n console.warn(\n 'Select2: The `data-select2-tags` attribute has been changed to ' +\n 'use the `data-data` and `data-tags=\"true\"` attributes and will be ' +\n 'removed in future versions of Select2.'\n );\n }\n\n Utils.StoreData($e[0], 'data', Utils.GetData($e[0], 'select2Tags'));\n Utils.StoreData($e[0], 'tags', true);\n }\n\n if (Utils.GetData($e[0], 'ajaxUrl')) {\n if (this.options.debug && window.console && console.warn) {\n console.warn(\n 'Select2: The `data-ajax-url` attribute has been changed to ' +\n '`data-ajax--url` and support for the old attribute will be removed' +\n ' in future versions of Select2.'\n );\n }\n\n $e.attr('ajax--url', Utils.GetData($e[0], 'ajaxUrl'));\n Utils.StoreData($e[0], 'ajax-Url', Utils.GetData($e[0], 'ajaxUrl'));\n }\n\n var dataset = {};\n\n function upperCaseLetter(_, letter) {\n return letter.toUpperCase();\n }\n\n // Pre-load all of the attributes which are prefixed with `data-`\n for (var attr = 0; attr < $e[0].attributes.length; attr++) {\n var attributeName = $e[0].attributes[attr].name;\n var prefix = 'data-';\n\n if (attributeName.substr(0, prefix.length) == prefix) {\n // Get the contents of the attribute after `data-`\n var dataName = attributeName.substring(prefix.length);\n\n // Get the data contents from the consistent source\n // This is more than likely the jQuery data helper\n var dataValue = Utils.GetData($e[0], dataName);\n\n // camelCase the attribute name to match the spec\n var camelDataName = dataName.replace(/-([a-z])/g, upperCaseLetter);\n\n // Store the data attribute contents into the dataset since\n dataset[camelDataName] = dataValue;\n }\n }\n\n // Prefer the element's `dataset` attribute if it exists\n // jQuery 1.x does not correctly handle data attributes with multiple dashes\n if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {\n dataset = $.extend(true, {}, $e[0].dataset, dataset);\n }\n\n // Prefer our internal data cache if it exists\n var data = $.extend(true, {}, Utils.GetData($e[0]), dataset);\n\n data = Utils._convertData(data);\n\n for (var key in data) {\n if ($.inArray(key, excludedData) > -1) {\n continue;\n }\n\n if ($.isPlainObject(this.options[key])) {\n $.extend(this.options[key], data[key]);\n } else {\n this.options[key] = data[key];\n }\n }\n\n return this;\n };\n\n Options.prototype.get = function (key) {\n return this.options[key];\n };\n\n Options.prototype.set = function (key, val) {\n this.options[key] = val;\n };\n\n return Options;\n });\n\n S2.define('select2/core',[\n 'jquery',\n './options',\n './utils',\n './keys'\n ], function ($, Options, Utils, KEYS) {\n var Select2 = function ($element, options) {\n if (Utils.GetData($element[0], 'select2') != null) {\n Utils.GetData($element[0], 'select2').destroy();\n }\n\n this.$element = $element;\n\n this.id = this._generateId($element);\n\n options = options || {};\n\n this.options = new Options(options, $element);\n\n Select2.__super__.constructor.call(this);\n\n // Set up the tabindex\n\n var tabindex = $element.attr('tabindex') || 0;\n Utils.StoreData($element[0], 'old-tabindex', tabindex);\n $element.attr('tabindex', '-1');\n\n // Set up containers and adapters\n\n var DataAdapter = this.options.get('dataAdapter');\n this.dataAdapter = new DataAdapter($element, this.options);\n\n var $container = this.render();\n\n this._placeContainer($container);\n\n var SelectionAdapter = this.options.get('selectionAdapter');\n this.selection = new SelectionAdapter($element, this.options);\n this.$selection = this.selection.render();\n\n this.selection.position(this.$selection, $container);\n\n var DropdownAdapter = this.options.get('dropdownAdapter');\n this.dropdown = new DropdownAdapter($element, this.options);\n this.$dropdown = this.dropdown.render();\n\n this.dropdown.position(this.$dropdown, $container);\n\n var ResultsAdapter = this.options.get('resultsAdapter');\n this.results = new ResultsAdapter($element, this.options, this.dataAdapter);\n this.$results = this.results.render();\n\n this.results.position(this.$results, this.$dropdown);\n\n // Bind events\n\n var self = this;\n\n // Bind the container to all of the adapters\n this._bindAdapters();\n\n // Register any DOM event handlers\n this._registerDomEvents();\n\n // Register any internal event handlers\n this._registerDataEvents();\n this._registerSelectionEvents();\n this._registerDropdownEvents();\n this._registerResultsEvents();\n this._registerEvents();\n\n // Set the initial state\n this.dataAdapter.current(function (initialData) {\n self.trigger('selection:update', {\n data: initialData\n });\n });\n\n // Hide the original select\n $element.addClass('select2-hidden-accessible');\n $element.attr('aria-hidden', 'true');\n\n // Synchronize any monitored attributes\n this._syncAttributes();\n\n Utils.StoreData($element[0], 'select2', this);\n\n // Ensure backwards compatibility with $element.data('select2').\n $element.data('select2', this);\n };\n\n Utils.Extend(Select2, Utils.Observable);\n\n Select2.prototype._generateId = function ($element) {\n var id = '';\n\n if ($element.attr('id') != null) {\n id = $element.attr('id');\n } else if ($element.attr('name') != null) {\n id = $element.attr('name') + '-' + Utils.generateChars(2);\n } else {\n id = Utils.generateChars(4);\n }\n\n id = id.replace(/(:|\\.|\\[|\\]|,)/g, '');\n id = 'select2-' + id;\n\n return id;\n };\n\n Select2.prototype._placeContainer = function ($container) {\n $container.insertAfter(this.$element);\n\n var width = this._resolveWidth(this.$element, this.options.get('width'));\n\n if (width != null) {\n $container.css('width', width);\n }\n };\n\n Select2.prototype._resolveWidth = function ($element, method) {\n var WIDTH = /^width:(([-+]?([0-9]*\\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;\n\n if (method == 'resolve') {\n var styleWidth = this._resolveWidth($element, 'style');\n\n if (styleWidth != null) {\n return styleWidth;\n }\n\n return this._resolveWidth($element, 'element');\n }\n\n if (method == 'element') {\n var elementWidth = $element.outerWidth(false);\n\n if (elementWidth <= 0) {\n return 'auto';\n }\n\n return elementWidth + 'px';\n }\n\n if (method == 'style') {\n var style = $element.attr('style');\n\n if (typeof(style) !== 'string') {\n return null;\n }\n\n var attrs = style.split(';');\n\n for (var i = 0, l = attrs.length; i < l; i = i + 1) {\n var attr = attrs[i].replace(/\\s/g, '');\n var matches = attr.match(WIDTH);\n\n if (matches !== null && matches.length >= 1) {\n return matches[1];\n }\n }\n\n return null;\n }\n\n if (method == 'computedstyle') {\n var computedStyle = window.getComputedStyle($element[0]);\n\n return computedStyle.width;\n }\n\n return method;\n };\n\n Select2.prototype._bindAdapters = function () {\n this.dataAdapter.bind(this, this.$container);\n this.selection.bind(this, this.$container);\n\n this.dropdown.bind(this, this.$container);\n this.results.bind(this, this.$container);\n };\n\n Select2.prototype._registerDomEvents = function () {\n var self = this;\n\n this.$element.on('change.select2', function () {\n self.dataAdapter.current(function (data) {\n self.trigger('selection:update', {\n data: data\n });\n });\n });\n\n this.$element.on('focus.select2', function (evt) {\n self.trigger('focus', evt);\n });\n\n this._syncA = Utils.bind(this._syncAttributes, this);\n this._syncS = Utils.bind(this._syncSubtree, this);\n\n if (this.$element[0].attachEvent) {\n this.$element[0].attachEvent('onpropertychange', this._syncA);\n }\n\n var observer = window.MutationObserver ||\n window.WebKitMutationObserver ||\n window.MozMutationObserver\n ;\n\n if (observer != null) {\n this._observer = new observer(function (mutations) {\n self._syncA();\n self._syncS(null, mutations);\n });\n this._observer.observe(this.$element[0], {\n attributes: true,\n childList: true,\n subtree: false\n });\n } else if (this.$element[0].addEventListener) {\n this.$element[0].addEventListener(\n 'DOMAttrModified',\n self._syncA,\n false\n );\n this.$element[0].addEventListener(\n 'DOMNodeInserted',\n self._syncS,\n false\n );\n this.$element[0].addEventListener(\n 'DOMNodeRemoved',\n self._syncS,\n false\n );\n }\n };\n\n Select2.prototype._registerDataEvents = function () {\n var self = this;\n\n this.dataAdapter.on('*', function (name, params) {\n self.trigger(name, params);\n });\n };\n\n Select2.prototype._registerSelectionEvents = function () {\n var self = this;\n var nonRelayEvents = ['toggle', 'focus'];\n\n this.selection.on('toggle', function () {\n self.toggleDropdown();\n });\n\n this.selection.on('focus', function (params) {\n self.focus(params);\n });\n\n this.selection.on('*', function (name, params) {\n if ($.inArray(name, nonRelayEvents) !== -1) {\n return;\n }\n\n self.trigger(name, params);\n });\n };\n\n Select2.prototype._registerDropdownEvents = function () {\n var self = this;\n\n this.dropdown.on('*', function (name, params) {\n self.trigger(name, params);\n });\n };\n\n Select2.prototype._registerResultsEvents = function () {\n var self = this;\n\n this.results.on('*', function (name, params) {\n self.trigger(name, params);\n });\n };\n\n Select2.prototype._registerEvents = function () {\n var self = this;\n\n this.on('open', function () {\n self.$container.addClass('select2-container--open');\n });\n\n this.on('close', function () {\n self.$container.removeClass('select2-container--open');\n });\n\n this.on('enable', function () {\n self.$container.removeClass('select2-container--disabled');\n });\n\n this.on('disable', function () {\n self.$container.addClass('select2-container--disabled');\n });\n\n this.on('blur', function () {\n self.$container.removeClass('select2-container--focus');\n });\n\n this.on('query', function (params) {\n if (!self.isOpen()) {\n self.trigger('open', {});\n }\n\n this.dataAdapter.query(params, function (data) {\n self.trigger('results:all', {\n data: data,\n query: params\n });\n });\n });\n\n this.on('query:append', function (params) {\n this.dataAdapter.query(params, function (data) {\n self.trigger('results:append', {\n data: data,\n query: params\n });\n });\n });\n\n this.on('keypress', function (evt) {\n var key = evt.which;\n\n if (self.isOpen()) {\n if (key === KEYS.ESC || key === KEYS.TAB ||\n (key === KEYS.UP && evt.altKey)) {\n self.close(evt);\n\n evt.preventDefault();\n } else if (key === KEYS.ENTER) {\n self.trigger('results:select', {});\n\n evt.preventDefault();\n } else if ((key === KEYS.SPACE && evt.ctrlKey)) {\n self.trigger('results:toggle', {});\n\n evt.preventDefault();\n } else if (key === KEYS.UP) {\n self.trigger('results:previous', {});\n\n evt.preventDefault();\n } else if (key === KEYS.DOWN) {\n self.trigger('results:next', {});\n\n evt.preventDefault();\n }\n } else {\n if (key === KEYS.ENTER || key === KEYS.SPACE ||\n (key === KEYS.DOWN && evt.altKey)) {\n self.open();\n\n evt.preventDefault();\n }\n }\n });\n };\n\n Select2.prototype._syncAttributes = function () {\n this.options.set('disabled', this.$element.prop('disabled'));\n\n if (this.isDisabled()) {\n if (this.isOpen()) {\n this.close();\n }\n\n this.trigger('disable', {});\n } else {\n this.trigger('enable', {});\n }\n };\n\n Select2.prototype._isChangeMutation = function (evt, mutations) {\n var changed = false;\n var self = this;\n\n // Ignore any mutation events raised for elements that aren't options or\n // optgroups. This handles the case when the select element is destroyed\n if (\n evt && evt.target && (\n evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP'\n )\n ) {\n return;\n }\n\n if (!mutations) {\n // If mutation events aren't supported, then we can only assume that the\n // change affected the selections\n changed = true;\n } else if (mutations.addedNodes && mutations.addedNodes.length > 0) {\n for (var n = 0; n < mutations.addedNodes.length; n++) {\n var node = mutations.addedNodes[n];\n\n if (node.selected) {\n changed = true;\n }\n }\n } else if (mutations.removedNodes && mutations.removedNodes.length > 0) {\n changed = true;\n } else if ($.isArray(mutations)) {\n $.each(mutations, function(evt, mutation) {\n if (self._isChangeMutation(evt, mutation)) {\n // We've found a change mutation.\n // Let's escape from the loop and continue\n changed = true;\n return false;\n }\n });\n }\n return changed;\n };\n\n Select2.prototype._syncSubtree = function (evt, mutations) {\n var changed = this._isChangeMutation(evt, mutations);\n var self = this;\n\n // Only re-pull the data if we think there is a change\n if (changed) {\n this.dataAdapter.current(function (currentData) {\n self.trigger('selection:update', {\n data: currentData\n });\n });\n }\n };\n\n /**\n * Override the trigger method to automatically trigger pre-events when\n * there are events that can be prevented.\n */\n Select2.prototype.trigger = function (name, args) {\n var actualTrigger = Select2.__super__.trigger;\n var preTriggerMap = {\n 'open': 'opening',\n 'close': 'closing',\n 'select': 'selecting',\n 'unselect': 'unselecting',\n 'clear': 'clearing'\n };\n\n if (args === undefined) {\n args = {};\n }\n\n if (name in preTriggerMap) {\n var preTriggerName = preTriggerMap[name];\n var preTriggerArgs = {\n prevented: false,\n name: name,\n args: args\n };\n\n actualTrigger.call(this, preTriggerName, preTriggerArgs);\n\n if (preTriggerArgs.prevented) {\n args.prevented = true;\n\n return;\n }\n }\n\n actualTrigger.call(this, name, args);\n };\n\n Select2.prototype.toggleDropdown = function () {\n if (this.isDisabled()) {\n return;\n }\n\n if (this.isOpen()) {\n this.close();\n } else {\n this.open();\n }\n };\n\n Select2.prototype.open = function () {\n if (this.isOpen()) {\n return;\n }\n\n if (this.isDisabled()) {\n return;\n }\n\n this.trigger('query', {});\n };\n\n Select2.prototype.close = function (evt) {\n if (!this.isOpen()) {\n return;\n }\n\n this.trigger('close', { originalEvent : evt });\n };\n\n /**\n * Helper method to abstract the \"enabled\" (not \"disabled\") state of this\n * object.\n *\n * @return {true} if the instance is not disabled.\n * @return {false} if the instance is disabled.\n */\n Select2.prototype.isEnabled = function () {\n return !this.isDisabled();\n };\n\n /**\n * Helper method to abstract the \"disabled\" state of this object.\n *\n * @return {true} if the disabled option is true.\n * @return {false} if the disabled option is false.\n */\n Select2.prototype.isDisabled = function () {\n return this.options.get('disabled');\n };\n\n Select2.prototype.isOpen = function () {\n return this.$container.hasClass('select2-container--open');\n };\n\n Select2.prototype.hasFocus = function () {\n return this.$container.hasClass('select2-container--focus');\n };\n\n Select2.prototype.focus = function (data) {\n // No need to re-trigger focus events if we are already focused\n if (this.hasFocus()) {\n return;\n }\n\n this.$container.addClass('select2-container--focus');\n this.trigger('focus', {});\n };\n\n Select2.prototype.enable = function (args) {\n if (this.options.get('debug') && window.console && console.warn) {\n console.warn(\n 'Select2: The `select2(\"enable\")` method has been deprecated and will' +\n ' be removed in later Select2 versions. Use $element.prop(\"disabled\")' +\n ' instead.'\n );\n }\n\n if (args == null || args.length === 0) {\n args = [true];\n }\n\n var disabled = !args[0];\n\n this.$element.prop('disabled', disabled);\n };\n\n Select2.prototype.data = function () {\n if (this.options.get('debug') &&\n arguments.length > 0 && window.console && console.warn) {\n console.warn(\n 'Select2: Data can no longer be set using `select2(\"data\")`. You ' +\n 'should consider setting the value instead using `$element.val()`.'\n );\n }\n\n var data = [];\n\n this.dataAdapter.current(function (currentData) {\n data = currentData;\n });\n\n return data;\n };\n\n Select2.prototype.val = function (args) {\n if (this.options.get('debug') && window.console && console.warn) {\n console.warn(\n 'Select2: The `select2(\"val\")` method has been deprecated and will be' +\n ' removed in later Select2 versions. Use $element.val() instead.'\n );\n }\n\n if (args == null || args.length === 0) {\n return this.$element.val();\n }\n\n var newVal = args[0];\n\n if ($.isArray(newVal)) {\n newVal = $.map(newVal, function (obj) {\n return obj.toString();\n });\n }\n\n this.$element.val(newVal).trigger('input').trigger('change');\n };\n\n Select2.prototype.destroy = function () {\n this.$container.remove();\n\n if (this.$element[0].detachEvent) {\n this.$element[0].detachEvent('onpropertychange', this._syncA);\n }\n\n if (this._observer != null) {\n this._observer.disconnect();\n this._observer = null;\n } else if (this.$element[0].removeEventListener) {\n this.$element[0]\n .removeEventListener('DOMAttrModified', this._syncA, false);\n this.$element[0]\n .removeEventListener('DOMNodeInserted', this._syncS, false);\n this.$element[0]\n .removeEventListener('DOMNodeRemoved', this._syncS, false);\n }\n\n this._syncA = null;\n this._syncS = null;\n\n this.$element.off('.select2');\n this.$element.attr('tabindex',\n Utils.GetData(this.$element[0], 'old-tabindex'));\n\n this.$element.removeClass('select2-hidden-accessible');\n this.$element.attr('aria-hidden', 'false');\n Utils.RemoveData(this.$element[0]);\n this.$element.removeData('select2');\n\n this.dataAdapter.destroy();\n this.selection.destroy();\n this.dropdown.destroy();\n this.results.destroy();\n\n this.dataAdapter = null;\n this.selection = null;\n this.dropdown = null;\n this.results = null;\n };\n\n Select2.prototype.render = function () {\n var $container = $(\n '' +\n '' +\n '' +\n ''\n );\n\n $container.attr('dir', this.options.get('dir'));\n\n this.$container = $container;\n\n this.$container.addClass('select2-container--' + this.options.get('theme'));\n\n Utils.StoreData($container[0], 'element', this.$element);\n\n return $container;\n };\n\n return Select2;\n });\n\n S2.define('select2/compat/utils',[\n 'jquery'\n ], function ($) {\n function syncCssClasses ($dest, $src, adapter) {\n var classes, replacements = [], adapted;\n\n classes = $.trim($dest.attr('class'));\n\n if (classes) {\n classes = '' + classes; // for IE which returns object\n\n $(classes.split(/\\s+/)).each(function () {\n // Save all Select2 classes\n if (this.indexOf('select2-') === 0) {\n replacements.push(this);\n }\n });\n }\n\n classes = $.trim($src.attr('class'));\n\n if (classes) {\n classes = '' + classes; // for IE which returns object\n\n $(classes.split(/\\s+/)).each(function () {\n // Only adapt non-Select2 classes\n if (this.indexOf('select2-') !== 0) {\n adapted = adapter(this);\n\n if (adapted != null) {\n replacements.push(adapted);\n }\n }\n });\n }\n\n $dest.attr('class', replacements.join(' '));\n }\n\n return {\n syncCssClasses: syncCssClasses\n };\n });\n\n S2.define('select2/compat/containerCss',[\n 'jquery',\n './utils'\n ], function ($, CompatUtils) {\n // No-op CSS adapter that discards all classes by default\n function _containerAdapter (clazz) {\n return null;\n }\n\n function ContainerCSS () { }\n\n ContainerCSS.prototype.render = function (decorated) {\n var $container = decorated.call(this);\n\n var containerCssClass = this.options.get('containerCssClass') || '';\n\n if ($.isFunction(containerCssClass)) {\n containerCssClass = containerCssClass(this.$element);\n }\n\n var containerCssAdapter = this.options.get('adaptContainerCssClass');\n containerCssAdapter = containerCssAdapter || _containerAdapter;\n\n if (containerCssClass.indexOf(':all:') !== -1) {\n containerCssClass = containerCssClass.replace(':all:', '');\n\n var _cssAdapter = containerCssAdapter;\n\n containerCssAdapter = function (clazz) {\n var adapted = _cssAdapter(clazz);\n\n if (adapted != null) {\n // Append the old one along with the adapted one\n return adapted + ' ' + clazz;\n }\n\n return clazz;\n };\n }\n\n var containerCss = this.options.get('containerCss') || {};\n\n if ($.isFunction(containerCss)) {\n containerCss = containerCss(this.$element);\n }\n\n CompatUtils.syncCssClasses($container, this.$element, containerCssAdapter);\n\n $container.css(containerCss);\n $container.addClass(containerCssClass);\n\n return $container;\n };\n\n return ContainerCSS;\n });\n\n S2.define('select2/compat/dropdownCss',[\n 'jquery',\n './utils'\n ], function ($, CompatUtils) {\n // No-op CSS adapter that discards all classes by default\n function _dropdownAdapter (clazz) {\n return null;\n }\n\n function DropdownCSS () { }\n\n DropdownCSS.prototype.render = function (decorated) {\n var $dropdown = decorated.call(this);\n\n var dropdownCssClass = this.options.get('dropdownCssClass') || '';\n\n if ($.isFunction(dropdownCssClass)) {\n dropdownCssClass = dropdownCssClass(this.$element);\n }\n\n var dropdownCssAdapter = this.options.get('adaptDropdownCssClass');\n dropdownCssAdapter = dropdownCssAdapter || _dropdownAdapter;\n\n if (dropdownCssClass.indexOf(':all:') !== -1) {\n dropdownCssClass = dropdownCssClass.replace(':all:', '');\n\n var _cssAdapter = dropdownCssAdapter;\n\n dropdownCssAdapter = function (clazz) {\n var adapted = _cssAdapter(clazz);\n\n if (adapted != null) {\n // Append the old one along with the adapted one\n return adapted + ' ' + clazz;\n }\n\n return clazz;\n };\n }\n\n var dropdownCss = this.options.get('dropdownCss') || {};\n\n if ($.isFunction(dropdownCss)) {\n dropdownCss = dropdownCss(this.$element);\n }\n\n CompatUtils.syncCssClasses($dropdown, this.$element, dropdownCssAdapter);\n\n $dropdown.css(dropdownCss);\n $dropdown.addClass(dropdownCssClass);\n\n return $dropdown;\n };\n\n return DropdownCSS;\n });\n\n S2.define('select2/compat/initSelection',[\n 'jquery'\n ], function ($) {\n function InitSelection (decorated, $element, options) {\n if (options.get('debug') && window.console && console.warn) {\n console.warn(\n 'Select2: The `initSelection` option has been deprecated in favor' +\n ' of a custom data adapter that overrides the `current` method. ' +\n 'This method is now called multiple times instead of a single ' +\n 'time when the instance is initialized. Support will be removed ' +\n 'for the `initSelection` option in future versions of Select2'\n );\n }\n\n this.initSelection = options.get('initSelection');\n this._isInitialized = false;\n\n decorated.call(this, $element, options);\n }\n\n InitSelection.prototype.current = function (decorated, callback) {\n var self = this;\n\n if (this._isInitialized) {\n decorated.call(this, callback);\n\n return;\n }\n\n this.initSelection.call(null, this.$element, function (data) {\n self._isInitialized = true;\n\n if (!$.isArray(data)) {\n data = [data];\n }\n\n callback(data);\n });\n };\n\n return InitSelection;\n });\n\n S2.define('select2/compat/inputData',[\n 'jquery',\n '../utils'\n ], function ($, Utils) {\n function InputData (decorated, $element, options) {\n this._currentData = [];\n this._valueSeparator = options.get('valueSeparator') || ',';\n\n if ($element.prop('type') === 'hidden') {\n if (options.get('debug') && console && console.warn) {\n console.warn(\n 'Select2: Using a hidden input with Select2 is no longer ' +\n 'supported and may stop working in the future. It is recommended ' +\n 'to use a `' +\n ''\n );\n\n this.$searchContainer = $search;\n this.$search = $search.find('input');\n\n var $rendered = decorated.call(this);\n\n this._transferTabIndex();\n\n return $rendered;\n };\n\n Search.prototype.bind = function (decorated, container, $container) {\n var self = this;\n\n var resultsId = container.id + '-results';\n\n decorated.call(this, container, $container);\n\n container.on('open', function () {\n self.$search.attr('aria-controls', resultsId);\n self.$search.trigger('focus');\n });\n\n container.on('close', function () {\n self.$search.val('');\n self.$search.removeAttr('aria-controls');\n self.$search.removeAttr('aria-activedescendant');\n self.$search.trigger('focus');\n });\n\n container.on('enable', function () {\n self.$search.prop('disabled', false);\n\n self._transferTabIndex();\n });\n\n container.on('disable', function () {\n self.$search.prop('disabled', true);\n });\n\n container.on('focus', function (evt) {\n self.$search.trigger('focus');\n });\n\n container.on('results:focus', function (params) {\n if (params.data._resultId) {\n self.$search.attr('aria-activedescendant', params.data._resultId);\n } else {\n self.$search.removeAttr('aria-activedescendant');\n }\n });\n\n this.$selection.on('focusin', '.select2-search--inline', function (evt) {\n self.trigger('focus', evt);\n });\n\n this.$selection.on('focusout', '.select2-search--inline', function (evt) {\n self._handleBlur(evt);\n });\n\n this.$selection.on('keydown', '.select2-search--inline', function (evt) {\n evt.stopPropagation();\n\n self.trigger('keypress', evt);\n\n self._keyUpPrevented = evt.isDefaultPrevented();\n\n var key = evt.which;\n\n if (key === KEYS.BACKSPACE && self.$search.val() === '') {\n var $previousChoice = self.$searchContainer\n .prev('.select2-selection__choice');\n\n if ($previousChoice.length > 0) {\n var item = Utils.GetData($previousChoice[0], 'data');\n\n self.searchRemoveChoice(item);\n\n evt.preventDefault();\n }\n }\n });\n\n this.$selection.on('click', '.select2-search--inline', function (evt) {\n if (self.$search.val()) {\n evt.stopPropagation();\n }\n });\n\n // Try to detect the IE version should the `documentMode` property that\n // is stored on the document. This is only implemented in IE and is\n // slightly cleaner than doing a user agent check.\n // This property is not available in Edge, but Edge also doesn't have\n // this bug.\n var msie = document.documentMode;\n var disableInputEvents = msie && msie <= 11;\n\n // Workaround for browsers which do not support the `input` event\n // This will prevent double-triggering of events for browsers which support\n // both the `keyup` and `input` events.\n this.$selection.on(\n 'input.searchcheck',\n '.select2-search--inline',\n function (evt) {\n // IE will trigger the `input` event when a placeholder is used on a\n // search box. To get around this issue, we are forced to ignore all\n // `input` events in IE and keep using `keyup`.\n if (disableInputEvents) {\n self.$selection.off('input.search input.searchcheck');\n return;\n }\n\n // Unbind the duplicated `keyup` event\n self.$selection.off('keyup.search');\n }\n );\n\n this.$selection.on(\n 'keyup.search input.search',\n '.select2-search--inline',\n function (evt) {\n // IE will trigger the `input` event when a placeholder is used on a\n // search box. To get around this issue, we are forced to ignore all\n // `input` events in IE and keep using `keyup`.\n if (disableInputEvents && evt.type === 'input') {\n self.$selection.off('input.search input.searchcheck');\n return;\n }\n\n var key = evt.which;\n\n // We can freely ignore events from modifier keys\n if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {\n return;\n }\n\n // Tabbing will be handled during the `keydown` phase\n if (key == KEYS.TAB) {\n return;\n }\n\n self.handleSearch(evt);\n }\n );\n };\n\n /**\n * This method will transfer the tabindex attribute from the rendered\n * selection to the search box. This allows for the search box to be used as\n * the primary focus instead of the selection container.\n *\n * @private\n */\n Search.prototype._transferTabIndex = function (decorated) {\n this.$search.attr('tabindex', this.$selection.attr('tabindex'));\n this.$selection.attr('tabindex', '-1');\n };\n\n Search.prototype.createPlaceholder = function (decorated, placeholder) {\n this.$search.attr('placeholder', placeholder.text);\n };\n\n Search.prototype.update = function (decorated, data) {\n var searchHadFocus = this.$search[0] == document.activeElement;\n\n this.$search.attr('placeholder', '');\n\n decorated.call(this, data);\n\n this.$selection.find('.select2-selection__rendered')\n .append(this.$searchContainer);\n\n this.resizeSearch();\n if (searchHadFocus) {\n this.$search.trigger('focus');\n }\n };\n\n Search.prototype.handleSearch = function () {\n this.resizeSearch();\n\n if (!this._keyUpPrevented) {\n var input = this.$search.val();\n\n this.trigger('query', {\n term: input\n });\n }\n\n this._keyUpPrevented = false;\n };\n\n Search.prototype.searchRemoveChoice = function (decorated, item) {\n this.trigger('unselect', {\n data: item\n });\n\n this.$search.val(item.text);\n this.handleSearch();\n };\n\n Search.prototype.resizeSearch = function () {\n this.$search.css('width', '25px');\n\n var width = '';\n\n if (this.$search.attr('placeholder') !== '') {\n width = this.$selection.find('.select2-selection__rendered').width();\n } else {\n var minimumWidth = this.$search.val().length + 1;\n\n width = (minimumWidth * 0.75) + 'em';\n }\n\n this.$search.css('width', width);\n };\n\n return Search;\n });\n\n S2.define('select2/selection/eventRelay',[\n 'jquery'\n ], function ($) {\n function EventRelay () { }\n\n EventRelay.prototype.bind = function (decorated, container, $container) {\n var self = this;\n var relayEvents = [\n 'open', 'opening',\n 'close', 'closing',\n 'select', 'selecting',\n 'unselect', 'unselecting',\n 'clear', 'clearing'\n ];\n\n var preventableEvents = [\n 'opening', 'closing', 'selecting', 'unselecting', 'clearing'\n ];\n\n decorated.call(this, container, $container);\n\n container.on('*', function (name, params) {\n // Ignore events that should not be relayed\n if ($.inArray(name, relayEvents) === -1) {\n return;\n }\n\n // The parameters should always be an object\n params = params || {};\n\n // Generate the jQuery event for the Select2 event\n var evt = $.Event('select2:' + name, {\n params: params\n });\n\n self.$element.trigger(evt);\n\n // Only handle preventable events if it was one\n if ($.inArray(name, preventableEvents) === -1) {\n return;\n }\n\n params.prevented = evt.isDefaultPrevented();\n });\n };\n\n return EventRelay;\n });\n\n S2.define('select2/translation',[\n 'jquery',\n 'require'\n ], function ($, require) {\n function Translation (dict) {\n this.dict = dict || {};\n }\n\n Translation.prototype.all = function () {\n return this.dict;\n };\n\n Translation.prototype.get = function (key) {\n return this.dict[key];\n };\n\n Translation.prototype.extend = function (translation) {\n this.dict = $.extend({}, translation.all(), this.dict);\n };\n\n // Static functions\n\n Translation._cache = {};\n\n Translation.loadPath = function (path) {\n if (!(path in Translation._cache)) {\n var translations = require(path);\n\n Translation._cache[path] = translations;\n }\n\n return new Translation(Translation._cache[path]);\n };\n\n return Translation;\n });\n\n S2.define('select2/diacritics',[\n\n ], function () {\n var diacritics = {\n '\\u24B6': 'A',\n '\\uFF21': 'A',\n '\\u00C0': 'A',\n '\\u00C1': 'A',\n '\\u00C2': 'A',\n '\\u1EA6': 'A',\n '\\u1EA4': 'A',\n '\\u1EAA': 'A',\n '\\u1EA8': 'A',\n '\\u00C3': 'A',\n '\\u0100': 'A',\n '\\u0102': 'A',\n '\\u1EB0': 'A',\n '\\u1EAE': 'A',\n '\\u1EB4': 'A',\n '\\u1EB2': 'A',\n '\\u0226': 'A',\n '\\u01E0': 'A',\n '\\u00C4': 'A',\n '\\u01DE': 'A',\n '\\u1EA2': 'A',\n '\\u00C5': 'A',\n '\\u01FA': 'A',\n '\\u01CD': 'A',\n '\\u0200': 'A',\n '\\u0202': 'A',\n '\\u1EA0': 'A',\n '\\u1EAC': 'A',\n '\\u1EB6': 'A',\n '\\u1E00': 'A',\n '\\u0104': 'A',\n '\\u023A': 'A',\n '\\u2C6F': 'A',\n '\\uA732': 'AA',\n '\\u00C6': 'AE',\n '\\u01FC': 'AE',\n '\\u01E2': 'AE',\n '\\uA734': 'AO',\n '\\uA736': 'AU',\n '\\uA738': 'AV',\n '\\uA73A': 'AV',\n '\\uA73C': 'AY',\n '\\u24B7': 'B',\n '\\uFF22': 'B',\n '\\u1E02': 'B',\n '\\u1E04': 'B',\n '\\u1E06': 'B',\n '\\u0243': 'B',\n '\\u0182': 'B',\n '\\u0181': 'B',\n '\\u24B8': 'C',\n '\\uFF23': 'C',\n '\\u0106': 'C',\n '\\u0108': 'C',\n '\\u010A': 'C',\n '\\u010C': 'C',\n '\\u00C7': 'C',\n '\\u1E08': 'C',\n '\\u0187': 'C',\n '\\u023B': 'C',\n '\\uA73E': 'C',\n '\\u24B9': 'D',\n '\\uFF24': 'D',\n '\\u1E0A': 'D',\n '\\u010E': 'D',\n '\\u1E0C': 'D',\n '\\u1E10': 'D',\n '\\u1E12': 'D',\n '\\u1E0E': 'D',\n '\\u0110': 'D',\n '\\u018B': 'D',\n '\\u018A': 'D',\n '\\u0189': 'D',\n '\\uA779': 'D',\n '\\u01F1': 'DZ',\n '\\u01C4': 'DZ',\n '\\u01F2': 'Dz',\n '\\u01C5': 'Dz',\n '\\u24BA': 'E',\n '\\uFF25': 'E',\n '\\u00C8': 'E',\n '\\u00C9': 'E',\n '\\u00CA': 'E',\n '\\u1EC0': 'E',\n '\\u1EBE': 'E',\n '\\u1EC4': 'E',\n '\\u1EC2': 'E',\n '\\u1EBC': 'E',\n '\\u0112': 'E',\n '\\u1E14': 'E',\n '\\u1E16': 'E',\n '\\u0114': 'E',\n '\\u0116': 'E',\n '\\u00CB': 'E',\n '\\u1EBA': 'E',\n '\\u011A': 'E',\n '\\u0204': 'E',\n '\\u0206': 'E',\n '\\u1EB8': 'E',\n '\\u1EC6': 'E',\n '\\u0228': 'E',\n '\\u1E1C': 'E',\n '\\u0118': 'E',\n '\\u1E18': 'E',\n '\\u1E1A': 'E',\n '\\u0190': 'E',\n '\\u018E': 'E',\n '\\u24BB': 'F',\n '\\uFF26': 'F',\n '\\u1E1E': 'F',\n '\\u0191': 'F',\n '\\uA77B': 'F',\n '\\u24BC': 'G',\n '\\uFF27': 'G',\n '\\u01F4': 'G',\n '\\u011C': 'G',\n '\\u1E20': 'G',\n '\\u011E': 'G',\n '\\u0120': 'G',\n '\\u01E6': 'G',\n '\\u0122': 'G',\n '\\u01E4': 'G',\n '\\u0193': 'G',\n '\\uA7A0': 'G',\n '\\uA77D': 'G',\n '\\uA77E': 'G',\n '\\u24BD': 'H',\n '\\uFF28': 'H',\n '\\u0124': 'H',\n '\\u1E22': 'H',\n '\\u1E26': 'H',\n '\\u021E': 'H',\n '\\u1E24': 'H',\n '\\u1E28': 'H',\n '\\u1E2A': 'H',\n '\\u0126': 'H',\n '\\u2C67': 'H',\n '\\u2C75': 'H',\n '\\uA78D': 'H',\n '\\u24BE': 'I',\n '\\uFF29': 'I',\n '\\u00CC': 'I',\n '\\u00CD': 'I',\n '\\u00CE': 'I',\n '\\u0128': 'I',\n '\\u012A': 'I',\n '\\u012C': 'I',\n '\\u0130': 'I',\n '\\u00CF': 'I',\n '\\u1E2E': 'I',\n '\\u1EC8': 'I',\n '\\u01CF': 'I',\n '\\u0208': 'I',\n '\\u020A': 'I',\n '\\u1ECA': 'I',\n '\\u012E': 'I',\n '\\u1E2C': 'I',\n '\\u0197': 'I',\n '\\u24BF': 'J',\n '\\uFF2A': 'J',\n '\\u0134': 'J',\n '\\u0248': 'J',\n '\\u24C0': 'K',\n '\\uFF2B': 'K',\n '\\u1E30': 'K',\n '\\u01E8': 'K',\n '\\u1E32': 'K',\n '\\u0136': 'K',\n '\\u1E34': 'K',\n '\\u0198': 'K',\n '\\u2C69': 'K',\n '\\uA740': 'K',\n '\\uA742': 'K',\n '\\uA744': 'K',\n '\\uA7A2': 'K',\n '\\u24C1': 'L',\n '\\uFF2C': 'L',\n '\\u013F': 'L',\n '\\u0139': 'L',\n '\\u013D': 'L',\n '\\u1E36': 'L',\n '\\u1E38': 'L',\n '\\u013B': 'L',\n '\\u1E3C': 'L',\n '\\u1E3A': 'L',\n '\\u0141': 'L',\n '\\u023D': 'L',\n '\\u2C62': 'L',\n '\\u2C60': 'L',\n '\\uA748': 'L',\n '\\uA746': 'L',\n '\\uA780': 'L',\n '\\u01C7': 'LJ',\n '\\u01C8': 'Lj',\n '\\u24C2': 'M',\n '\\uFF2D': 'M',\n '\\u1E3E': 'M',\n '\\u1E40': 'M',\n '\\u1E42': 'M',\n '\\u2C6E': 'M',\n '\\u019C': 'M',\n '\\u24C3': 'N',\n '\\uFF2E': 'N',\n '\\u01F8': 'N',\n '\\u0143': 'N',\n '\\u00D1': 'N',\n '\\u1E44': 'N',\n '\\u0147': 'N',\n '\\u1E46': 'N',\n '\\u0145': 'N',\n '\\u1E4A': 'N',\n '\\u1E48': 'N',\n '\\u0220': 'N',\n '\\u019D': 'N',\n '\\uA790': 'N',\n '\\uA7A4': 'N',\n '\\u01CA': 'NJ',\n '\\u01CB': 'Nj',\n '\\u24C4': 'O',\n '\\uFF2F': 'O',\n '\\u00D2': 'O',\n '\\u00D3': 'O',\n '\\u00D4': 'O',\n '\\u1ED2': 'O',\n '\\u1ED0': 'O',\n '\\u1ED6': 'O',\n '\\u1ED4': 'O',\n '\\u00D5': 'O',\n '\\u1E4C': 'O',\n '\\u022C': 'O',\n '\\u1E4E': 'O',\n '\\u014C': 'O',\n '\\u1E50': 'O',\n '\\u1E52': 'O',\n '\\u014E': 'O',\n '\\u022E': 'O',\n '\\u0230': 'O',\n '\\u00D6': 'O',\n '\\u022A': 'O',\n '\\u1ECE': 'O',\n '\\u0150': 'O',\n '\\u01D1': 'O',\n '\\u020C': 'O',\n '\\u020E': 'O',\n '\\u01A0': 'O',\n '\\u1EDC': 'O',\n '\\u1EDA': 'O',\n '\\u1EE0': 'O',\n '\\u1EDE': 'O',\n '\\u1EE2': 'O',\n '\\u1ECC': 'O',\n '\\u1ED8': 'O',\n '\\u01EA': 'O',\n '\\u01EC': 'O',\n '\\u00D8': 'O',\n '\\u01FE': 'O',\n '\\u0186': 'O',\n '\\u019F': 'O',\n '\\uA74A': 'O',\n '\\uA74C': 'O',\n '\\u0152': 'OE',\n '\\u01A2': 'OI',\n '\\uA74E': 'OO',\n '\\u0222': 'OU',\n '\\u24C5': 'P',\n '\\uFF30': 'P',\n '\\u1E54': 'P',\n '\\u1E56': 'P',\n '\\u01A4': 'P',\n '\\u2C63': 'P',\n '\\uA750': 'P',\n '\\uA752': 'P',\n '\\uA754': 'P',\n '\\u24C6': 'Q',\n '\\uFF31': 'Q',\n '\\uA756': 'Q',\n '\\uA758': 'Q',\n '\\u024A': 'Q',\n '\\u24C7': 'R',\n '\\uFF32': 'R',\n '\\u0154': 'R',\n '\\u1E58': 'R',\n '\\u0158': 'R',\n '\\u0210': 'R',\n '\\u0212': 'R',\n '\\u1E5A': 'R',\n '\\u1E5C': 'R',\n '\\u0156': 'R',\n '\\u1E5E': 'R',\n '\\u024C': 'R',\n '\\u2C64': 'R',\n '\\uA75A': 'R',\n '\\uA7A6': 'R',\n '\\uA782': 'R',\n '\\u24C8': 'S',\n '\\uFF33': 'S',\n '\\u1E9E': 'S',\n '\\u015A': 'S',\n '\\u1E64': 'S',\n '\\u015C': 'S',\n '\\u1E60': 'S',\n '\\u0160': 'S',\n '\\u1E66': 'S',\n '\\u1E62': 'S',\n '\\u1E68': 'S',\n '\\u0218': 'S',\n '\\u015E': 'S',\n '\\u2C7E': 'S',\n '\\uA7A8': 'S',\n '\\uA784': 'S',\n '\\u24C9': 'T',\n '\\uFF34': 'T',\n '\\u1E6A': 'T',\n '\\u0164': 'T',\n '\\u1E6C': 'T',\n '\\u021A': 'T',\n '\\u0162': 'T',\n '\\u1E70': 'T',\n '\\u1E6E': 'T',\n '\\u0166': 'T',\n '\\u01AC': 'T',\n '\\u01AE': 'T',\n '\\u023E': 'T',\n '\\uA786': 'T',\n '\\uA728': 'TZ',\n '\\u24CA': 'U',\n '\\uFF35': 'U',\n '\\u00D9': 'U',\n '\\u00DA': 'U',\n '\\u00DB': 'U',\n '\\u0168': 'U',\n '\\u1E78': 'U',\n '\\u016A': 'U',\n '\\u1E7A': 'U',\n '\\u016C': 'U',\n '\\u00DC': 'U',\n '\\u01DB': 'U',\n '\\u01D7': 'U',\n '\\u01D5': 'U',\n '\\u01D9': 'U',\n '\\u1EE6': 'U',\n '\\u016E': 'U',\n '\\u0170': 'U',\n '\\u01D3': 'U',\n '\\u0214': 'U',\n '\\u0216': 'U',\n '\\u01AF': 'U',\n '\\u1EEA': 'U',\n '\\u1EE8': 'U',\n '\\u1EEE': 'U',\n '\\u1EEC': 'U',\n '\\u1EF0': 'U',\n '\\u1EE4': 'U',\n '\\u1E72': 'U',\n '\\u0172': 'U',\n '\\u1E76': 'U',\n '\\u1E74': 'U',\n '\\u0244': 'U',\n '\\u24CB': 'V',\n '\\uFF36': 'V',\n '\\u1E7C': 'V',\n '\\u1E7E': 'V',\n '\\u01B2': 'V',\n '\\uA75E': 'V',\n '\\u0245': 'V',\n '\\uA760': 'VY',\n '\\u24CC': 'W',\n '\\uFF37': 'W',\n '\\u1E80': 'W',\n '\\u1E82': 'W',\n '\\u0174': 'W',\n '\\u1E86': 'W',\n '\\u1E84': 'W',\n '\\u1E88': 'W',\n '\\u2C72': 'W',\n '\\u24CD': 'X',\n '\\uFF38': 'X',\n '\\u1E8A': 'X',\n '\\u1E8C': 'X',\n '\\u24CE': 'Y',\n '\\uFF39': 'Y',\n '\\u1EF2': 'Y',\n '\\u00DD': 'Y',\n '\\u0176': 'Y',\n '\\u1EF8': 'Y',\n '\\u0232': 'Y',\n '\\u1E8E': 'Y',\n '\\u0178': 'Y',\n '\\u1EF6': 'Y',\n '\\u1EF4': 'Y',\n '\\u01B3': 'Y',\n '\\u024E': 'Y',\n '\\u1EFE': 'Y',\n '\\u24CF': 'Z',\n '\\uFF3A': 'Z',\n '\\u0179': 'Z',\n '\\u1E90': 'Z',\n '\\u017B': 'Z',\n '\\u017D': 'Z',\n '\\u1E92': 'Z',\n '\\u1E94': 'Z',\n '\\u01B5': 'Z',\n '\\u0224': 'Z',\n '\\u2C7F': 'Z',\n '\\u2C6B': 'Z',\n '\\uA762': 'Z',\n '\\u24D0': 'a',\n '\\uFF41': 'a',\n '\\u1E9A': 'a',\n '\\u00E0': 'a',\n '\\u00E1': 'a',\n '\\u00E2': 'a',\n '\\u1EA7': 'a',\n '\\u1EA5': 'a',\n '\\u1EAB': 'a',\n '\\u1EA9': 'a',\n '\\u00E3': 'a',\n '\\u0101': 'a',\n '\\u0103': 'a',\n '\\u1EB1': 'a',\n '\\u1EAF': 'a',\n '\\u1EB5': 'a',\n '\\u1EB3': 'a',\n '\\u0227': 'a',\n '\\u01E1': 'a',\n '\\u00E4': 'a',\n '\\u01DF': 'a',\n '\\u1EA3': 'a',\n '\\u00E5': 'a',\n '\\u01FB': 'a',\n '\\u01CE': 'a',\n '\\u0201': 'a',\n '\\u0203': 'a',\n '\\u1EA1': 'a',\n '\\u1EAD': 'a',\n '\\u1EB7': 'a',\n '\\u1E01': 'a',\n '\\u0105': 'a',\n '\\u2C65': 'a',\n '\\u0250': 'a',\n '\\uA733': 'aa',\n '\\u00E6': 'ae',\n '\\u01FD': 'ae',\n '\\u01E3': 'ae',\n '\\uA735': 'ao',\n '\\uA737': 'au',\n '\\uA739': 'av',\n '\\uA73B': 'av',\n '\\uA73D': 'ay',\n '\\u24D1': 'b',\n '\\uFF42': 'b',\n '\\u1E03': 'b',\n '\\u1E05': 'b',\n '\\u1E07': 'b',\n '\\u0180': 'b',\n '\\u0183': 'b',\n '\\u0253': 'b',\n '\\u24D2': 'c',\n '\\uFF43': 'c',\n '\\u0107': 'c',\n '\\u0109': 'c',\n '\\u010B': 'c',\n '\\u010D': 'c',\n '\\u00E7': 'c',\n '\\u1E09': 'c',\n '\\u0188': 'c',\n '\\u023C': 'c',\n '\\uA73F': 'c',\n '\\u2184': 'c',\n '\\u24D3': 'd',\n '\\uFF44': 'd',\n '\\u1E0B': 'd',\n '\\u010F': 'd',\n '\\u1E0D': 'd',\n '\\u1E11': 'd',\n '\\u1E13': 'd',\n '\\u1E0F': 'd',\n '\\u0111': 'd',\n '\\u018C': 'd',\n '\\u0256': 'd',\n '\\u0257': 'd',\n '\\uA77A': 'd',\n '\\u01F3': 'dz',\n '\\u01C6': 'dz',\n '\\u24D4': 'e',\n '\\uFF45': 'e',\n '\\u00E8': 'e',\n '\\u00E9': 'e',\n '\\u00EA': 'e',\n '\\u1EC1': 'e',\n '\\u1EBF': 'e',\n '\\u1EC5': 'e',\n '\\u1EC3': 'e',\n '\\u1EBD': 'e',\n '\\u0113': 'e',\n '\\u1E15': 'e',\n '\\u1E17': 'e',\n '\\u0115': 'e',\n '\\u0117': 'e',\n '\\u00EB': 'e',\n '\\u1EBB': 'e',\n '\\u011B': 'e',\n '\\u0205': 'e',\n '\\u0207': 'e',\n '\\u1EB9': 'e',\n '\\u1EC7': 'e',\n '\\u0229': 'e',\n '\\u1E1D': 'e',\n '\\u0119': 'e',\n '\\u1E19': 'e',\n '\\u1E1B': 'e',\n '\\u0247': 'e',\n '\\u025B': 'e',\n '\\u01DD': 'e',\n '\\u24D5': 'f',\n '\\uFF46': 'f',\n '\\u1E1F': 'f',\n '\\u0192': 'f',\n '\\uA77C': 'f',\n '\\u24D6': 'g',\n '\\uFF47': 'g',\n '\\u01F5': 'g',\n '\\u011D': 'g',\n '\\u1E21': 'g',\n '\\u011F': 'g',\n '\\u0121': 'g',\n '\\u01E7': 'g',\n '\\u0123': 'g',\n '\\u01E5': 'g',\n '\\u0260': 'g',\n '\\uA7A1': 'g',\n '\\u1D79': 'g',\n '\\uA77F': 'g',\n '\\u24D7': 'h',\n '\\uFF48': 'h',\n '\\u0125': 'h',\n '\\u1E23': 'h',\n '\\u1E27': 'h',\n '\\u021F': 'h',\n '\\u1E25': 'h',\n '\\u1E29': 'h',\n '\\u1E2B': 'h',\n '\\u1E96': 'h',\n '\\u0127': 'h',\n '\\u2C68': 'h',\n '\\u2C76': 'h',\n '\\u0265': 'h',\n '\\u0195': 'hv',\n '\\u24D8': 'i',\n '\\uFF49': 'i',\n '\\u00EC': 'i',\n '\\u00ED': 'i',\n '\\u00EE': 'i',\n '\\u0129': 'i',\n '\\u012B': 'i',\n '\\u012D': 'i',\n '\\u00EF': 'i',\n '\\u1E2F': 'i',\n '\\u1EC9': 'i',\n '\\u01D0': 'i',\n '\\u0209': 'i',\n '\\u020B': 'i',\n '\\u1ECB': 'i',\n '\\u012F': 'i',\n '\\u1E2D': 'i',\n '\\u0268': 'i',\n '\\u0131': 'i',\n '\\u24D9': 'j',\n '\\uFF4A': 'j',\n '\\u0135': 'j',\n '\\u01F0': 'j',\n '\\u0249': 'j',\n '\\u24DA': 'k',\n '\\uFF4B': 'k',\n '\\u1E31': 'k',\n '\\u01E9': 'k',\n '\\u1E33': 'k',\n '\\u0137': 'k',\n '\\u1E35': 'k',\n '\\u0199': 'k',\n '\\u2C6A': 'k',\n '\\uA741': 'k',\n '\\uA743': 'k',\n '\\uA745': 'k',\n '\\uA7A3': 'k',\n '\\u24DB': 'l',\n '\\uFF4C': 'l',\n '\\u0140': 'l',\n '\\u013A': 'l',\n '\\u013E': 'l',\n '\\u1E37': 'l',\n '\\u1E39': 'l',\n '\\u013C': 'l',\n '\\u1E3D': 'l',\n '\\u1E3B': 'l',\n '\\u017F': 'l',\n '\\u0142': 'l',\n '\\u019A': 'l',\n '\\u026B': 'l',\n '\\u2C61': 'l',\n '\\uA749': 'l',\n '\\uA781': 'l',\n '\\uA747': 'l',\n '\\u01C9': 'lj',\n '\\u24DC': 'm',\n '\\uFF4D': 'm',\n '\\u1E3F': 'm',\n '\\u1E41': 'm',\n '\\u1E43': 'm',\n '\\u0271': 'm',\n '\\u026F': 'm',\n '\\u24DD': 'n',\n '\\uFF4E': 'n',\n '\\u01F9': 'n',\n '\\u0144': 'n',\n '\\u00F1': 'n',\n '\\u1E45': 'n',\n '\\u0148': 'n',\n '\\u1E47': 'n',\n '\\u0146': 'n',\n '\\u1E4B': 'n',\n '\\u1E49': 'n',\n '\\u019E': 'n',\n '\\u0272': 'n',\n '\\u0149': 'n',\n '\\uA791': 'n',\n '\\uA7A5': 'n',\n '\\u01CC': 'nj',\n '\\u24DE': 'o',\n '\\uFF4F': 'o',\n '\\u00F2': 'o',\n '\\u00F3': 'o',\n '\\u00F4': 'o',\n '\\u1ED3': 'o',\n '\\u1ED1': 'o',\n '\\u1ED7': 'o',\n '\\u1ED5': 'o',\n '\\u00F5': 'o',\n '\\u1E4D': 'o',\n '\\u022D': 'o',\n '\\u1E4F': 'o',\n '\\u014D': 'o',\n '\\u1E51': 'o',\n '\\u1E53': 'o',\n '\\u014F': 'o',\n '\\u022F': 'o',\n '\\u0231': 'o',\n '\\u00F6': 'o',\n '\\u022B': 'o',\n '\\u1ECF': 'o',\n '\\u0151': 'o',\n '\\u01D2': 'o',\n '\\u020D': 'o',\n '\\u020F': 'o',\n '\\u01A1': 'o',\n '\\u1EDD': 'o',\n '\\u1EDB': 'o',\n '\\u1EE1': 'o',\n '\\u1EDF': 'o',\n '\\u1EE3': 'o',\n '\\u1ECD': 'o',\n '\\u1ED9': 'o',\n '\\u01EB': 'o',\n '\\u01ED': 'o',\n '\\u00F8': 'o',\n '\\u01FF': 'o',\n '\\u0254': 'o',\n '\\uA74B': 'o',\n '\\uA74D': 'o',\n '\\u0275': 'o',\n '\\u0153': 'oe',\n '\\u01A3': 'oi',\n '\\u0223': 'ou',\n '\\uA74F': 'oo',\n '\\u24DF': 'p',\n '\\uFF50': 'p',\n '\\u1E55': 'p',\n '\\u1E57': 'p',\n '\\u01A5': 'p',\n '\\u1D7D': 'p',\n '\\uA751': 'p',\n '\\uA753': 'p',\n '\\uA755': 'p',\n '\\u24E0': 'q',\n '\\uFF51': 'q',\n '\\u024B': 'q',\n '\\uA757': 'q',\n '\\uA759': 'q',\n '\\u24E1': 'r',\n '\\uFF52': 'r',\n '\\u0155': 'r',\n '\\u1E59': 'r',\n '\\u0159': 'r',\n '\\u0211': 'r',\n '\\u0213': 'r',\n '\\u1E5B': 'r',\n '\\u1E5D': 'r',\n '\\u0157': 'r',\n '\\u1E5F': 'r',\n '\\u024D': 'r',\n '\\u027D': 'r',\n '\\uA75B': 'r',\n '\\uA7A7': 'r',\n '\\uA783': 'r',\n '\\u24E2': 's',\n '\\uFF53': 's',\n '\\u00DF': 's',\n '\\u015B': 's',\n '\\u1E65': 's',\n '\\u015D': 's',\n '\\u1E61': 's',\n '\\u0161': 's',\n '\\u1E67': 's',\n '\\u1E63': 's',\n '\\u1E69': 's',\n '\\u0219': 's',\n '\\u015F': 's',\n '\\u023F': 's',\n '\\uA7A9': 's',\n '\\uA785': 's',\n '\\u1E9B': 's',\n '\\u24E3': 't',\n '\\uFF54': 't',\n '\\u1E6B': 't',\n '\\u1E97': 't',\n '\\u0165': 't',\n '\\u1E6D': 't',\n '\\u021B': 't',\n '\\u0163': 't',\n '\\u1E71': 't',\n '\\u1E6F': 't',\n '\\u0167': 't',\n '\\u01AD': 't',\n '\\u0288': 't',\n '\\u2C66': 't',\n '\\uA787': 't',\n '\\uA729': 'tz',\n '\\u24E4': 'u',\n '\\uFF55': 'u',\n '\\u00F9': 'u',\n '\\u00FA': 'u',\n '\\u00FB': 'u',\n '\\u0169': 'u',\n '\\u1E79': 'u',\n '\\u016B': 'u',\n '\\u1E7B': 'u',\n '\\u016D': 'u',\n '\\u00FC': 'u',\n '\\u01DC': 'u',\n '\\u01D8': 'u',\n '\\u01D6': 'u',\n '\\u01DA': 'u',\n '\\u1EE7': 'u',\n '\\u016F': 'u',\n '\\u0171': 'u',\n '\\u01D4': 'u',\n '\\u0215': 'u',\n '\\u0217': 'u',\n '\\u01B0': 'u',\n '\\u1EEB': 'u',\n '\\u1EE9': 'u',\n '\\u1EEF': 'u',\n '\\u1EED': 'u',\n '\\u1EF1': 'u',\n '\\u1EE5': 'u',\n '\\u1E73': 'u',\n '\\u0173': 'u',\n '\\u1E77': 'u',\n '\\u1E75': 'u',\n '\\u0289': 'u',\n '\\u24E5': 'v',\n '\\uFF56': 'v',\n '\\u1E7D': 'v',\n '\\u1E7F': 'v',\n '\\u028B': 'v',\n '\\uA75F': 'v',\n '\\u028C': 'v',\n '\\uA761': 'vy',\n '\\u24E6': 'w',\n '\\uFF57': 'w',\n '\\u1E81': 'w',\n '\\u1E83': 'w',\n '\\u0175': 'w',\n '\\u1E87': 'w',\n '\\u1E85': 'w',\n '\\u1E98': 'w',\n '\\u1E89': 'w',\n '\\u2C73': 'w',\n '\\u24E7': 'x',\n '\\uFF58': 'x',\n '\\u1E8B': 'x',\n '\\u1E8D': 'x',\n '\\u24E8': 'y',\n '\\uFF59': 'y',\n '\\u1EF3': 'y',\n '\\u00FD': 'y',\n '\\u0177': 'y',\n '\\u1EF9': 'y',\n '\\u0233': 'y',\n '\\u1E8F': 'y',\n '\\u00FF': 'y',\n '\\u1EF7': 'y',\n '\\u1E99': 'y',\n '\\u1EF5': 'y',\n '\\u01B4': 'y',\n '\\u024F': 'y',\n '\\u1EFF': 'y',\n '\\u24E9': 'z',\n '\\uFF5A': 'z',\n '\\u017A': 'z',\n '\\u1E91': 'z',\n '\\u017C': 'z',\n '\\u017E': 'z',\n '\\u1E93': 'z',\n '\\u1E95': 'z',\n '\\u01B6': 'z',\n '\\u0225': 'z',\n '\\u0240': 'z',\n '\\u2C6C': 'z',\n '\\uA763': 'z',\n '\\u0386': '\\u0391',\n '\\u0388': '\\u0395',\n '\\u0389': '\\u0397',\n '\\u038A': '\\u0399',\n '\\u03AA': '\\u0399',\n '\\u038C': '\\u039F',\n '\\u038E': '\\u03A5',\n '\\u03AB': '\\u03A5',\n '\\u038F': '\\u03A9',\n '\\u03AC': '\\u03B1',\n '\\u03AD': '\\u03B5',\n '\\u03AE': '\\u03B7',\n '\\u03AF': '\\u03B9',\n '\\u03CA': '\\u03B9',\n '\\u0390': '\\u03B9',\n '\\u03CC': '\\u03BF',\n '\\u03CD': '\\u03C5',\n '\\u03CB': '\\u03C5',\n '\\u03B0': '\\u03C5',\n '\\u03CE': '\\u03C9',\n '\\u03C2': '\\u03C3',\n '\\u2019': '\\''\n };\n\n return diacritics;\n });\n\n S2.define('select2/data/base',[\n '../utils'\n ], function (Utils) {\n function BaseAdapter ($element, options) {\n BaseAdapter.__super__.constructor.call(this);\n }\n\n Utils.Extend(BaseAdapter, Utils.Observable);\n\n BaseAdapter.prototype.current = function (callback) {\n throw new Error('The `current` method must be defined in child classes.');\n };\n\n BaseAdapter.prototype.query = function (params, callback) {\n throw new Error('The `query` method must be defined in child classes.');\n };\n\n BaseAdapter.prototype.bind = function (container, $container) {\n // Can be implemented in subclasses\n };\n\n BaseAdapter.prototype.destroy = function () {\n // Can be implemented in subclasses\n };\n\n BaseAdapter.prototype.generateResultId = function (container, data) {\n var id = container.id + '-result-';\n\n id += Utils.generateChars(4);\n\n if (data.id != null) {\n id += '-' + data.id.toString();\n } else {\n id += '-' + Utils.generateChars(4);\n }\n return id;\n };\n\n return BaseAdapter;\n });\n\n S2.define('select2/data/select',[\n './base',\n '../utils',\n 'jquery'\n ], function (BaseAdapter, Utils, $) {\n function SelectAdapter ($element, options) {\n this.$element = $element;\n this.options = options;\n\n SelectAdapter.__super__.constructor.call(this);\n }\n\n Utils.Extend(SelectAdapter, BaseAdapter);\n\n SelectAdapter.prototype.current = function (callback) {\n var data = [];\n var self = this;\n\n this.$element.find(':selected').each(function () {\n var $option = $(this);\n\n var option = self.item($option);\n\n data.push(option);\n });\n\n callback(data);\n };\n\n SelectAdapter.prototype.select = function (data) {\n var self = this;\n\n data.selected = true;\n\n // If data.element is a DOM node, use it instead\n if ($(data.element).is('option')) {\n data.element.selected = true;\n\n this.$element.trigger('input').trigger('change');\n\n return;\n }\n\n if (this.$element.prop('multiple')) {\n this.current(function (currentData) {\n var val = [];\n\n data = [data];\n data.push.apply(data, currentData);\n\n for (var d = 0; d < data.length; d++) {\n var id = data[d].id;\n\n if ($.inArray(id, val) === -1) {\n val.push(id);\n }\n }\n\n self.$element.val(val);\n self.$element.trigger('input').trigger('change');\n });\n } else {\n var val = data.id;\n\n this.$element.val(val);\n this.$element.trigger('input').trigger('change');\n }\n };\n\n SelectAdapter.prototype.unselect = function (data) {\n var self = this;\n\n if (!this.$element.prop('multiple')) {\n return;\n }\n\n data.selected = false;\n\n if ($(data.element).is('option')) {\n data.element.selected = false;\n\n this.$element.trigger('input').trigger('change');\n\n return;\n }\n\n this.current(function (currentData) {\n var val = [];\n\n for (var d = 0; d < currentData.length; d++) {\n var id = currentData[d].id;\n\n if (id !== data.id && $.inArray(id, val) === -1) {\n val.push(id);\n }\n }\n\n self.$element.val(val);\n\n self.$element.trigger('input').trigger('change');\n });\n };\n\n SelectAdapter.prototype.bind = function (container, $container) {\n var self = this;\n\n this.container = container;\n\n container.on('select', function (params) {\n self.select(params.data);\n });\n\n container.on('unselect', function (params) {\n self.unselect(params.data);\n });\n };\n\n SelectAdapter.prototype.destroy = function () {\n // Remove anything added to child elements\n this.$element.find('*').each(function () {\n // Remove any custom data set by Select2\n Utils.RemoveData(this);\n });\n };\n\n SelectAdapter.prototype.query = function (params, callback) {\n var data = [];\n var self = this;\n\n var $options = this.$element.children();\n\n $options.each(function () {\n var $option = $(this);\n\n if (!$option.is('option') && !$option.is('optgroup')) {\n return;\n }\n\n var option = self.item($option);\n\n var matches = self.matches(params, option);\n\n if (matches !== null) {\n data.push(matches);\n }\n });\n\n callback({\n results: data\n });\n };\n\n SelectAdapter.prototype.addOptions = function ($options) {\n Utils.appendMany(this.$element, $options);\n };\n\n SelectAdapter.prototype.option = function (data) {\n var option;\n\n if (data.children) {\n option = document.createElement('optgroup');\n option.label = data.text;\n } else {\n option = document.createElement('option');\n\n if (option.textContent !== undefined) {\n option.textContent = data.text;\n } else {\n option.innerText = data.text;\n }\n }\n\n if (data.id !== undefined) {\n option.value = data.id;\n }\n\n if (data.disabled) {\n option.disabled = true;\n }\n\n if (data.selected) {\n option.selected = true;\n }\n\n if (data.title) {\n option.title = data.title;\n }\n\n var $option = $(option);\n\n var normalizedData = this._normalizeItem(data);\n normalizedData.element = option;\n\n // Override the option's data with the combined data\n Utils.StoreData(option, 'data', normalizedData);\n\n return $option;\n };\n\n SelectAdapter.prototype.item = function ($option) {\n var data = {};\n\n data = Utils.GetData($option[0], 'data');\n\n if (data != null) {\n return data;\n }\n\n if ($option.is('option')) {\n data = {\n id: $option.val(),\n text: $option.text(),\n disabled: $option.prop('disabled'),\n selected: $option.prop('selected'),\n title: $option.prop('title')\n };\n } else if ($option.is('optgroup')) {\n data = {\n text: $option.prop('label'),\n children: [],\n title: $option.prop('title')\n };\n\n var $children = $option.children('option');\n var children = [];\n\n for (var c = 0; c < $children.length; c++) {\n var $child = $($children[c]);\n\n var child = this.item($child);\n\n children.push(child);\n }\n\n data.children = children;\n }\n\n data = this._normalizeItem(data);\n data.element = $option[0];\n\n Utils.StoreData($option[0], 'data', data);\n\n return data;\n };\n\n SelectAdapter.prototype._normalizeItem = function (item) {\n if (item !== Object(item)) {\n item = {\n id: item,\n text: item\n };\n }\n\n item = $.extend({}, {\n text: ''\n }, item);\n\n var defaults = {\n selected: false,\n disabled: false\n };\n\n if (item.id != null) {\n item.id = item.id.toString();\n }\n\n if (item.text != null) {\n item.text = item.text.toString();\n }\n\n if (item._resultId == null && item.id && this.container != null) {\n item._resultId = this.generateResultId(this.container, item);\n }\n\n return $.extend({}, defaults, item);\n };\n\n SelectAdapter.prototype.matches = function (params, data) {\n var matcher = this.options.get('matcher');\n\n return matcher(params, data);\n };\n\n return SelectAdapter;\n });\n\n S2.define('select2/data/array',[\n './select',\n '../utils',\n 'jquery'\n ], function (SelectAdapter, Utils, $) {\n function ArrayAdapter ($element, options) {\n this._dataToConvert = options.get('data') || [];\n\n ArrayAdapter.__super__.constructor.call(this, $element, options);\n }\n\n Utils.Extend(ArrayAdapter, SelectAdapter);\n\n ArrayAdapter.prototype.bind = function (container, $container) {\n ArrayAdapter.__super__.bind.call(this, container, $container);\n\n this.addOptions(this.convertToOptions(this._dataToConvert));\n };\n\n ArrayAdapter.prototype.select = function (data) {\n var $option = this.$element.find('option').filter(function (i, elm) {\n return elm.value == data.id.toString();\n });\n\n if ($option.length === 0) {\n $option = this.option(data);\n\n this.addOptions($option);\n }\n\n ArrayAdapter.__super__.select.call(this, data);\n };\n\n ArrayAdapter.prototype.convertToOptions = function (data) {\n var self = this;\n\n var $existing = this.$element.find('option');\n var existingIds = $existing.map(function () {\n return self.item($(this)).id;\n }).get();\n\n var $options = [];\n\n // Filter out all items except for the one passed in the argument\n function onlyItem (item) {\n return function () {\n return $(this).val() == item.id;\n };\n }\n\n for (var d = 0; d < data.length; d++) {\n var item = this._normalizeItem(data[d]);\n\n // Skip items which were pre-loaded, only merge the data\n if ($.inArray(item.id, existingIds) >= 0) {\n var $existingOption = $existing.filter(onlyItem(item));\n\n var existingData = this.item($existingOption);\n var newData = $.extend(true, {}, item, existingData);\n\n var $newOption = this.option(newData);\n\n $existingOption.replaceWith($newOption);\n\n continue;\n }\n\n var $option = this.option(item);\n\n if (item.children) {\n var $children = this.convertToOptions(item.children);\n\n Utils.appendMany($option, $children);\n }\n\n $options.push($option);\n }\n\n return $options;\n };\n\n return ArrayAdapter;\n });\n\n S2.define('select2/data/ajax',[\n './array',\n '../utils',\n 'jquery'\n ], function (ArrayAdapter, Utils, $) {\n function AjaxAdapter ($element, options) {\n this.ajaxOptions = this._applyDefaults(options.get('ajax'));\n\n if (this.ajaxOptions.processResults != null) {\n this.processResults = this.ajaxOptions.processResults;\n }\n\n AjaxAdapter.__super__.constructor.call(this, $element, options);\n }\n\n Utils.Extend(AjaxAdapter, ArrayAdapter);\n\n AjaxAdapter.prototype._applyDefaults = function (options) {\n var defaults = {\n data: function (params) {\n return $.extend({}, params, {\n q: params.term\n });\n },\n transport: function (params, success, failure) {\n var $request = $.ajax(params);\n\n $request.then(success);\n $request.fail(failure);\n\n return $request;\n }\n };\n\n return $.extend({}, defaults, options, true);\n };\n\n AjaxAdapter.prototype.processResults = function (results) {\n return results;\n };\n\n AjaxAdapter.prototype.query = function (params, callback) {\n var matches = [];\n var self = this;\n\n if (this._request != null) {\n // JSONP requests cannot always be aborted\n if ($.isFunction(this._request.abort)) {\n this._request.abort();\n }\n\n this._request = null;\n }\n\n var options = $.extend({\n type: 'GET'\n }, this.ajaxOptions);\n\n if (typeof options.url === 'function') {\n options.url = options.url.call(this.$element, params);\n }\n\n if (typeof options.data === 'function') {\n options.data = options.data.call(this.$element, params);\n }\n\n function request () {\n var $request = options.transport(options, function (data) {\n var results = self.processResults(data, params);\n\n if (self.options.get('debug') && window.console && console.error) {\n // Check to make sure that the response included a `results` key.\n if (!results || !results.results || !$.isArray(results.results)) {\n console.error(\n 'Select2: The AJAX results did not return an array in the ' +\n '`results` key of the response.'\n );\n }\n }\n\n callback(results);\n }, function () {\n // Attempt to detect if a request was aborted\n // Only works if the transport exposes a status property\n if ('status' in $request &&\n ($request.status === 0 || $request.status === '0')) {\n return;\n }\n\n self.trigger('results:message', {\n message: 'errorLoading'\n });\n });\n\n self._request = $request;\n }\n\n if (this.ajaxOptions.delay && params.term != null) {\n if (this._queryTimeout) {\n window.clearTimeout(this._queryTimeout);\n }\n\n this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);\n } else {\n request();\n }\n };\n\n return AjaxAdapter;\n });\n\n S2.define('select2/data/tags',[\n 'jquery'\n ], function ($) {\n function Tags (decorated, $element, options) {\n var tags = options.get('tags');\n\n var createTag = options.get('createTag');\n\n if (createTag !== undefined) {\n this.createTag = createTag;\n }\n\n var insertTag = options.get('insertTag');\n\n if (insertTag !== undefined) {\n this.insertTag = insertTag;\n }\n\n decorated.call(this, $element, options);\n\n if ($.isArray(tags)) {\n for (var t = 0; t < tags.length; t++) {\n var tag = tags[t];\n var item = this._normalizeItem(tag);\n\n var $option = this.option(item);\n\n this.$element.append($option);\n }\n }\n }\n\n Tags.prototype.query = function (decorated, params, callback) {\n var self = this;\n\n this._removeOldTags();\n\n if (params.term == null || params.page != null) {\n decorated.call(this, params, callback);\n return;\n }\n\n function wrapper (obj, child) {\n var data = obj.results;\n\n for (var i = 0; i < data.length; i++) {\n var option = data[i];\n\n var checkChildren = (\n option.children != null &&\n !wrapper({\n results: option.children\n }, true)\n );\n\n var optionText = (option.text || '').toUpperCase();\n var paramsTerm = (params.term || '').toUpperCase();\n\n var checkText = optionText === paramsTerm;\n\n if (checkText || checkChildren) {\n if (child) {\n return false;\n }\n\n obj.data = data;\n callback(obj);\n\n return;\n }\n }\n\n if (child) {\n return true;\n }\n\n var tag = self.createTag(params);\n\n if (tag != null) {\n var $option = self.option(tag);\n $option.attr('data-select2-tag', true);\n\n self.addOptions([$option]);\n\n self.insertTag(data, tag);\n }\n\n obj.results = data;\n\n callback(obj);\n }\n\n decorated.call(this, params, wrapper);\n };\n\n Tags.prototype.createTag = function (decorated, params) {\n var term = $.trim(params.term);\n\n if (term === '') {\n return null;\n }\n\n return {\n id: term,\n text: term\n };\n };\n\n Tags.prototype.insertTag = function (_, data, tag) {\n data.unshift(tag);\n };\n\n Tags.prototype._removeOldTags = function (_) {\n var $options = this.$element.find('option[data-select2-tag]');\n\n $options.each(function () {\n if (this.selected) {\n return;\n }\n\n $(this).remove();\n });\n };\n\n return Tags;\n });\n\n S2.define('select2/data/tokenizer',[\n 'jquery'\n ], function ($) {\n function Tokenizer (decorated, $element, options) {\n var tokenizer = options.get('tokenizer');\n\n if (tokenizer !== undefined) {\n this.tokenizer = tokenizer;\n }\n\n decorated.call(this, $element, options);\n }\n\n Tokenizer.prototype.bind = function (decorated, container, $container) {\n decorated.call(this, container, $container);\n\n this.$search = container.dropdown.$search || container.selection.$search ||\n $container.find('.select2-search__field');\n };\n\n Tokenizer.prototype.query = function (decorated, params, callback) {\n var self = this;\n\n function createAndSelect (data) {\n // Normalize the data object so we can use it for checks\n var item = self._normalizeItem(data);\n\n // Check if the data object already exists as a tag\n // Select it if it doesn't\n var $existingOptions = self.$element.find('option').filter(function () {\n return $(this).val() === item.id;\n });\n\n // If an existing option wasn't found for it, create the option\n if (!$existingOptions.length) {\n var $option = self.option(item);\n $option.attr('data-select2-tag', true);\n\n self._removeOldTags();\n self.addOptions([$option]);\n }\n\n // Select the item, now that we know there is an option for it\n select(item);\n }\n\n function select (data) {\n self.trigger('select', {\n data: data\n });\n }\n\n params.term = params.term || '';\n\n var tokenData = this.tokenizer(params, this.options, createAndSelect);\n\n if (tokenData.term !== params.term) {\n // Replace the search term if we have the search box\n if (this.$search.length) {\n this.$search.val(tokenData.term);\n this.$search.trigger('focus');\n }\n\n params.term = tokenData.term;\n }\n\n decorated.call(this, params, callback);\n };\n\n Tokenizer.prototype.tokenizer = function (_, params, options, callback) {\n var separators = options.get('tokenSeparators') || [];\n var term = params.term;\n var i = 0;\n\n var createTag = this.createTag || function (params) {\n return {\n id: params.term,\n text: params.term\n };\n };\n\n while (i < term.length) {\n var termChar = term[i];\n\n if ($.inArray(termChar, separators) === -1) {\n i++;\n\n continue;\n }\n\n var part = term.substr(0, i);\n var partParams = $.extend({}, params, {\n term: part\n });\n\n var data = createTag(partParams);\n\n if (data == null) {\n i++;\n continue;\n }\n\n callback(data);\n\n // Reset the term to not include the tokenized portion\n term = term.substr(i + 1) || '';\n i = 0;\n }\n\n return {\n term: term\n };\n };\n\n return Tokenizer;\n });\n\n S2.define('select2/data/minimumInputLength',[\n\n ], function () {\n function MinimumInputLength (decorated, $e, options) {\n this.minimumInputLength = options.get('minimumInputLength');\n\n decorated.call(this, $e, options);\n }\n\n MinimumInputLength.prototype.query = function (decorated, params, callback) {\n params.term = params.term || '';\n\n if (params.term.length < this.minimumInputLength) {\n this.trigger('results:message', {\n message: 'inputTooShort',\n args: {\n minimum: this.minimumInputLength,\n input: params.term,\n params: params\n }\n });\n\n return;\n }\n\n decorated.call(this, params, callback);\n };\n\n return MinimumInputLength;\n });\n\n S2.define('select2/data/maximumInputLength',[\n\n ], function () {\n function MaximumInputLength (decorated, $e, options) {\n this.maximumInputLength = options.get('maximumInputLength');\n\n decorated.call(this, $e, options);\n }\n\n MaximumInputLength.prototype.query = function (decorated, params, callback) {\n params.term = params.term || '';\n\n if (this.maximumInputLength > 0 &&\n params.term.length > this.maximumInputLength) {\n this.trigger('results:message', {\n message: 'inputTooLong',\n args: {\n maximum: this.maximumInputLength,\n input: params.term,\n params: params\n }\n });\n\n return;\n }\n\n decorated.call(this, params, callback);\n };\n\n return MaximumInputLength;\n });\n\n S2.define('select2/data/maximumSelectionLength',[\n\n ], function (){\n function MaximumSelectionLength (decorated, $e, options) {\n this.maximumSelectionLength = options.get('maximumSelectionLength');\n\n decorated.call(this, $e, options);\n }\n\n MaximumSelectionLength.prototype.bind =\n function (decorated, container, $container) {\n var self = this;\n\n decorated.call(this, container, $container);\n\n container.on('select', function () {\n self._checkIfMaximumSelected();\n });\n };\n\n MaximumSelectionLength.prototype.query =\n function (decorated, params, callback) {\n var self = this;\n\n this._checkIfMaximumSelected(function () {\n decorated.call(self, params, callback);\n });\n };\n\n MaximumSelectionLength.prototype._checkIfMaximumSelected =\n function (_, successCallback) {\n var self = this;\n\n this.current(function (currentData) {\n var count = currentData != null ? currentData.length : 0;\n if (self.maximumSelectionLength > 0 &&\n count >= self.maximumSelectionLength) {\n self.trigger('results:message', {\n message: 'maximumSelected',\n args: {\n maximum: self.maximumSelectionLength\n }\n });\n return;\n }\n\n if (successCallback) {\n successCallback();\n }\n });\n };\n\n return MaximumSelectionLength;\n });\n\n S2.define('select2/dropdown',[\n 'jquery',\n './utils'\n ], function ($, Utils) {\n function Dropdown ($element, options) {\n this.$element = $element;\n this.options = options;\n\n Dropdown.__super__.constructor.call(this);\n }\n\n Utils.Extend(Dropdown, Utils.Observable);\n\n Dropdown.prototype.render = function () {\n var $dropdown = $(\n '' +\n '' +\n ''\n );\n\n $dropdown.attr('dir', this.options.get('dir'));\n\n this.$dropdown = $dropdown;\n\n return $dropdown;\n };\n\n Dropdown.prototype.bind = function () {\n // Should be implemented in subclasses\n };\n\n Dropdown.prototype.position = function ($dropdown, $container) {\n // Should be implemented in subclasses\n };\n\n Dropdown.prototype.destroy = function () {\n // Remove the dropdown from the DOM\n this.$dropdown.remove();\n };\n\n return Dropdown;\n });\n\n S2.define('select2/dropdown/search',[\n 'jquery',\n '../utils'\n ], function ($, Utils) {\n function Search () { }\n\n Search.prototype.render = function (decorated) {\n var $rendered = decorated.call(this);\n\n var $search = $(\n '' +\n '' +\n ''\n );\n\n this.$searchContainer = $search;\n this.$search = $search.find('input');\n\n $rendered.prepend($search);\n\n return $rendered;\n };\n\n Search.prototype.bind = function (decorated, container, $container) {\n var self = this;\n\n var resultsId = container.id + '-results';\n\n decorated.call(this, container, $container);\n\n this.$search.on('keydown', function (evt) {\n self.trigger('keypress', evt);\n\n self._keyUpPrevented = evt.isDefaultPrevented();\n });\n\n // Workaround for browsers which do not support the `input` event\n // This will prevent double-triggering of events for browsers which support\n // both the `keyup` and `input` events.\n this.$search.on('input', function (evt) {\n // Unbind the duplicated `keyup` event\n $(this).off('keyup');\n });\n\n this.$search.on('keyup input', function (evt) {\n self.handleSearch(evt);\n });\n\n container.on('open', function () {\n self.$search.attr('tabindex', 0);\n self.$search.attr('aria-controls', resultsId);\n\n self.$search.trigger('focus');\n\n window.setTimeout(function () {\n self.$search.trigger('focus');\n }, 0);\n });\n\n container.on('close', function () {\n self.$search.attr('tabindex', -1);\n self.$search.removeAttr('aria-controls');\n self.$search.removeAttr('aria-activedescendant');\n\n self.$search.val('');\n self.$search.trigger('blur');\n });\n\n container.on('focus', function () {\n if (!container.isOpen()) {\n self.$search.trigger('focus');\n }\n });\n\n container.on('results:all', function (params) {\n if (params.query.term == null || params.query.term === '') {\n var showSearch = self.showSearch(params);\n\n if (showSearch) {\n self.$searchContainer.removeClass('select2-search--hide');\n } else {\n self.$searchContainer.addClass('select2-search--hide');\n }\n }\n });\n\n container.on('results:focus', function (params) {\n if (params.data._resultId) {\n self.$search.attr('aria-activedescendant', params.data._resultId);\n } else {\n self.$search.removeAttr('aria-activedescendant');\n }\n });\n };\n\n Search.prototype.handleSearch = function (evt) {\n if (!this._keyUpPrevented) {\n var input = this.$search.val();\n\n this.trigger('query', {\n term: input\n });\n }\n\n this._keyUpPrevented = false;\n };\n\n Search.prototype.showSearch = function (_, params) {\n return true;\n };\n\n return Search;\n });\n\n S2.define('select2/dropdown/hidePlaceholder',[\n\n ], function () {\n function HidePlaceholder (decorated, $element, options, dataAdapter) {\n this.placeholder = this.normalizePlaceholder(options.get('placeholder'));\n\n decorated.call(this, $element, options, dataAdapter);\n }\n\n HidePlaceholder.prototype.append = function (decorated, data) {\n data.results = this.removePlaceholder(data.results);\n\n decorated.call(this, data);\n };\n\n HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {\n if (typeof placeholder === 'string') {\n placeholder = {\n id: '',\n text: placeholder\n };\n }\n\n return placeholder;\n };\n\n HidePlaceholder.prototype.removePlaceholder = function (_, data) {\n var modifiedData = data.slice(0);\n\n for (var d = data.length - 1; d >= 0; d--) {\n var item = data[d];\n\n if (this.placeholder.id === item.id) {\n modifiedData.splice(d, 1);\n }\n }\n\n return modifiedData;\n };\n\n return HidePlaceholder;\n });\n\n S2.define('select2/dropdown/infiniteScroll',[\n 'jquery'\n ], function ($) {\n function InfiniteScroll (decorated, $element, options, dataAdapter) {\n this.lastParams = {};\n\n decorated.call(this, $element, options, dataAdapter);\n\n this.$loadingMore = this.createLoadingMore();\n this.loading = false;\n }\n\n InfiniteScroll.prototype.append = function (decorated, data) {\n this.$loadingMore.remove();\n this.loading = false;\n\n decorated.call(this, data);\n\n if (this.showLoadingMore(data)) {\n this.$results.append(this.$loadingMore);\n this.loadMoreIfNeeded();\n }\n };\n\n InfiniteScroll.prototype.bind = function (decorated, container, $container) {\n var self = this;\n\n decorated.call(this, container, $container);\n\n container.on('query', function (params) {\n self.lastParams = params;\n self.loading = true;\n });\n\n container.on('query:append', function (params) {\n self.lastParams = params;\n self.loading = true;\n });\n\n this.$results.on('scroll', this.loadMoreIfNeeded.bind(this));\n };\n\n InfiniteScroll.prototype.loadMoreIfNeeded = function () {\n var isLoadMoreVisible = $.contains(\n document.documentElement,\n this.$loadingMore[0]\n );\n\n if (this.loading || !isLoadMoreVisible) {\n return;\n }\n\n var currentOffset = this.$results.offset().top +\n this.$results.outerHeight(false);\n var loadingMoreOffset = this.$loadingMore.offset().top +\n this.$loadingMore.outerHeight(false);\n\n if (currentOffset + 50 >= loadingMoreOffset) {\n this.loadMore();\n }\n };\n\n InfiniteScroll.prototype.loadMore = function () {\n this.loading = true;\n\n var params = $.extend({}, {page: 1}, this.lastParams);\n\n params.page++;\n\n this.trigger('query:append', params);\n };\n\n InfiniteScroll.prototype.showLoadingMore = function (_, data) {\n return data.pagination && data.pagination.more;\n };\n\n InfiniteScroll.prototype.createLoadingMore = function () {\n var $option = $(\n '
    • '\n );\n\n var message = this.options.get('translations').get('loadingMore');\n\n $option.html(message(this.lastParams));\n\n return $option;\n };\n\n return InfiniteScroll;\n });\n\n S2.define('select2/dropdown/attachBody',[\n 'jquery',\n '../utils'\n ], function ($, Utils) {\n function AttachBody (decorated, $element, options) {\n this.$dropdownParent = $(options.get('dropdownParent') || document.body);\n\n decorated.call(this, $element, options);\n }\n\n AttachBody.prototype.bind = function (decorated, container, $container) {\n var self = this;\n\n decorated.call(this, container, $container);\n\n container.on('open', function () {\n self._showDropdown();\n self._attachPositioningHandler(container);\n\n // Must bind after the results handlers to ensure correct sizing\n self._bindContainerResultHandlers(container);\n });\n\n container.on('close', function () {\n self._hideDropdown();\n self._detachPositioningHandler(container);\n });\n\n this.$dropdownContainer.on('mousedown', function (evt) {\n evt.stopPropagation();\n });\n };\n\n AttachBody.prototype.destroy = function (decorated) {\n decorated.call(this);\n\n this.$dropdownContainer.remove();\n };\n\n AttachBody.prototype.position = function (decorated, $dropdown, $container) {\n // Clone all of the container classes\n $dropdown.attr('class', $container.attr('class'));\n\n $dropdown.removeClass('select2');\n $dropdown.addClass('select2-container--open');\n\n $dropdown.css({\n position: 'absolute',\n top: -999999\n });\n\n this.$container = $container;\n };\n\n AttachBody.prototype.render = function (decorated) {\n var $container = $('');\n\n var $dropdown = decorated.call(this);\n $container.append($dropdown);\n\n this.$dropdownContainer = $container;\n\n return $container;\n };\n\n AttachBody.prototype._hideDropdown = function (decorated) {\n this.$dropdownContainer.detach();\n };\n\n AttachBody.prototype._bindContainerResultHandlers =\n function (decorated, container) {\n\n // These should only be bound once\n if (this._containerResultsHandlersBound) {\n return;\n }\n\n var self = this;\n\n container.on('results:all', function () {\n self._positionDropdown();\n self._resizeDropdown();\n });\n\n container.on('results:append', function () {\n self._positionDropdown();\n self._resizeDropdown();\n });\n\n container.on('results:message', function () {\n self._positionDropdown();\n self._resizeDropdown();\n });\n\n container.on('select', function () {\n self._positionDropdown();\n self._resizeDropdown();\n });\n\n container.on('unselect', function () {\n self._positionDropdown();\n self._resizeDropdown();\n });\n\n this._containerResultsHandlersBound = true;\n };\n\n AttachBody.prototype._attachPositioningHandler =\n function (decorated, container) {\n var self = this;\n\n var scrollEvent = 'scroll.select2.' + container.id;\n var resizeEvent = 'resize.select2.' + container.id;\n var orientationEvent = 'orientationchange.select2.' + container.id;\n\n var $watchers = this.$container.parents().filter(Utils.hasScroll);\n $watchers.each(function () {\n Utils.StoreData(this, 'select2-scroll-position', {\n x: $(this).scrollLeft(),\n y: $(this).scrollTop()\n });\n });\n\n $watchers.on(scrollEvent, function (ev) {\n var position = Utils.GetData(this, 'select2-scroll-position');\n $(this).scrollTop(position.y);\n });\n\n $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,\n function (e) {\n self._positionDropdown();\n self._resizeDropdown();\n });\n };\n\n AttachBody.prototype._detachPositioningHandler =\n function (decorated, container) {\n var scrollEvent = 'scroll.select2.' + container.id;\n var resizeEvent = 'resize.select2.' + container.id;\n var orientationEvent = 'orientationchange.select2.' + container.id;\n\n var $watchers = this.$container.parents().filter(Utils.hasScroll);\n $watchers.off(scrollEvent);\n\n $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);\n };\n\n AttachBody.prototype._positionDropdown = function () {\n var $window = $(window);\n\n var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above');\n var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below');\n\n var newDirection = null;\n\n var offset = this.$container.offset();\n\n offset.bottom = offset.top + this.$container.outerHeight(false);\n\n var container = {\n height: this.$container.outerHeight(false)\n };\n\n container.top = offset.top;\n container.bottom = offset.top + container.height;\n\n var dropdown = {\n height: this.$dropdown.outerHeight(false)\n };\n\n var viewport = {\n top: $window.scrollTop(),\n bottom: $window.scrollTop() + $window.height()\n };\n\n var enoughRoomAbove = viewport.top < (offset.top - dropdown.height);\n var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height);\n\n var css = {\n left: offset.left,\n top: container.bottom\n };\n\n // Determine what the parent element is to use for calculating the offset\n var $offsetParent = this.$dropdownParent;\n\n // For statically positioned elements, we need to get the element\n // that is determining the offset\n if ($offsetParent.css('position') === 'static') {\n $offsetParent = $offsetParent.offsetParent();\n }\n\n var parentOffset = {\n top: 0,\n left: 0\n };\n\n if (\n $.contains(document.body, $offsetParent[0]) ||\n $offsetParent[0].isConnected\n ) {\n parentOffset = $offsetParent.offset();\n }\n\n css.top -= parentOffset.top;\n css.left -= parentOffset.left;\n\n if (!isCurrentlyAbove && !isCurrentlyBelow) {\n newDirection = 'below';\n }\n\n if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {\n newDirection = 'above';\n } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {\n newDirection = 'below';\n }\n\n if (newDirection == 'above' ||\n (isCurrentlyAbove && newDirection !== 'below')) {\n css.top = container.top - parentOffset.top - dropdown.height;\n }\n\n if (newDirection != null) {\n this.$dropdown\n .removeClass('select2-dropdown--below select2-dropdown--above')\n .addClass('select2-dropdown--' + newDirection);\n this.$container\n .removeClass('select2-container--below select2-container--above')\n .addClass('select2-container--' + newDirection);\n }\n\n this.$dropdownContainer.css(css);\n };\n\n AttachBody.prototype._resizeDropdown = function () {\n var css = {\n width: this.$container.outerWidth(false) + 'px'\n };\n\n if (this.options.get('dropdownAutoWidth')) {\n css.minWidth = css.width;\n css.position = 'relative';\n css.width = 'auto';\n }\n\n this.$dropdown.css(css);\n };\n\n AttachBody.prototype._showDropdown = function (decorated) {\n this.$dropdownContainer.appendTo(this.$dropdownParent);\n\n this._positionDropdown();\n this._resizeDropdown();\n };\n\n return AttachBody;\n });\n\n S2.define('select2/dropdown/minimumResultsForSearch',[\n\n ], function () {\n function countResults (data) {\n var count = 0;\n\n for (var d = 0; d < data.length; d++) {\n var item = data[d];\n\n if (item.children) {\n count += countResults(item.children);\n } else {\n count++;\n }\n }\n\n return count;\n }\n\n function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {\n this.minimumResultsForSearch = options.get('minimumResultsForSearch');\n\n if (this.minimumResultsForSearch < 0) {\n this.minimumResultsForSearch = Infinity;\n }\n\n decorated.call(this, $element, options, dataAdapter);\n }\n\n MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {\n if (countResults(params.data.results) < this.minimumResultsForSearch) {\n return false;\n }\n\n return decorated.call(this, params);\n };\n\n return MinimumResultsForSearch;\n });\n\n S2.define('select2/dropdown/selectOnClose',[\n '../utils'\n ], function (Utils) {\n function SelectOnClose () { }\n\n SelectOnClose.prototype.bind = function (decorated, container, $container) {\n var self = this;\n\n decorated.call(this, container, $container);\n\n container.on('close', function (params) {\n self._handleSelectOnClose(params);\n });\n };\n\n SelectOnClose.prototype._handleSelectOnClose = function (_, params) {\n if (params && params.originalSelect2Event != null) {\n var event = params.originalSelect2Event;\n\n // Don't select an item if the close event was triggered from a select or\n // unselect event\n if (event._type === 'select' || event._type === 'unselect') {\n return;\n }\n }\n\n var $highlightedResults = this.getHighlightedResults();\n\n // Only select highlighted results\n if ($highlightedResults.length < 1) {\n return;\n }\n\n var data = Utils.GetData($highlightedResults[0], 'data');\n\n // Don't re-select already selected resulte\n if (\n (data.element != null && data.element.selected) ||\n (data.element == null && data.selected)\n ) {\n return;\n }\n\n this.trigger('select', {\n data: data\n });\n };\n\n return SelectOnClose;\n });\n\n S2.define('select2/dropdown/closeOnSelect',[\n\n ], function () {\n function CloseOnSelect () { }\n\n CloseOnSelect.prototype.bind = function (decorated, container, $container) {\n var self = this;\n\n decorated.call(this, container, $container);\n\n container.on('select', function (evt) {\n self._selectTriggered(evt);\n });\n\n container.on('unselect', function (evt) {\n self._selectTriggered(evt);\n });\n };\n\n CloseOnSelect.prototype._selectTriggered = function (_, evt) {\n var originalEvent = evt.originalEvent;\n\n // Don't close if the control key is being held\n if (originalEvent && (originalEvent.ctrlKey || originalEvent.metaKey)) {\n return;\n }\n\n this.trigger('close', {\n originalEvent: originalEvent,\n originalSelect2Event: evt\n });\n };\n\n return CloseOnSelect;\n });\n\n S2.define('select2/i18n/en',[],function () {\n // English\n return {\n errorLoading: function () {\n return 'The results could not be loaded.';\n },\n inputTooLong: function (args) {\n var overChars = args.input.length - args.maximum;\n\n var message = 'Please delete ' + overChars + ' character';\n\n if (overChars != 1) {\n message += 's';\n }\n\n return message;\n },\n inputTooShort: function (args) {\n var remainingChars = args.minimum - args.input.length;\n\n var message = 'Please enter ' + remainingChars + ' or more characters';\n\n return message;\n },\n loadingMore: function () {\n return 'Loading more results…';\n },\n maximumSelected: function (args) {\n var message = 'You can only select ' + args.maximum + ' item';\n\n if (args.maximum != 1) {\n message += 's';\n }\n\n return message;\n },\n noResults: function () {\n return 'No results found';\n },\n searching: function () {\n return 'Searching…';\n },\n removeAllItems: function () {\n return 'Remove all items';\n }\n };\n });\n\n S2.define('select2/defaults',[\n 'jquery',\n 'require',\n\n './results',\n\n './selection/single',\n './selection/multiple',\n './selection/placeholder',\n './selection/allowClear',\n './selection/search',\n './selection/eventRelay',\n\n './utils',\n './translation',\n './diacritics',\n\n './data/select',\n './data/array',\n './data/ajax',\n './data/tags',\n './data/tokenizer',\n './data/minimumInputLength',\n './data/maximumInputLength',\n './data/maximumSelectionLength',\n\n './dropdown',\n './dropdown/search',\n './dropdown/hidePlaceholder',\n './dropdown/infiniteScroll',\n './dropdown/attachBody',\n './dropdown/minimumResultsForSearch',\n './dropdown/selectOnClose',\n './dropdown/closeOnSelect',\n\n './i18n/en'\n ], function ($, require,\n\n ResultsList,\n\n SingleSelection, MultipleSelection, Placeholder, AllowClear,\n SelectionSearch, EventRelay,\n\n Utils, Translation, DIACRITICS,\n\n SelectData, ArrayData, AjaxData, Tags, Tokenizer,\n MinimumInputLength, MaximumInputLength, MaximumSelectionLength,\n\n Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,\n AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect,\n\n EnglishTranslation) {\n function Defaults () {\n this.reset();\n }\n\n Defaults.prototype.apply = function (options) {\n options = $.extend(true, {}, this.defaults, options);\n\n if (options.dataAdapter == null) {\n if (options.ajax != null) {\n options.dataAdapter = AjaxData;\n } else if (options.data != null) {\n options.dataAdapter = ArrayData;\n } else {\n options.dataAdapter = SelectData;\n }\n\n if (options.minimumInputLength > 0) {\n options.dataAdapter = Utils.Decorate(\n options.dataAdapter,\n MinimumInputLength\n );\n }\n\n if (options.maximumInputLength > 0) {\n options.dataAdapter = Utils.Decorate(\n options.dataAdapter,\n MaximumInputLength\n );\n }\n\n if (options.maximumSelectionLength > 0) {\n options.dataAdapter = Utils.Decorate(\n options.dataAdapter,\n MaximumSelectionLength\n );\n }\n\n if (options.tags) {\n options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);\n }\n\n if (options.tokenSeparators != null || options.tokenizer != null) {\n options.dataAdapter = Utils.Decorate(\n options.dataAdapter,\n Tokenizer\n );\n }\n\n if (options.query != null) {\n var Query = require(options.amdBase + 'compat/query');\n\n options.dataAdapter = Utils.Decorate(\n options.dataAdapter,\n Query\n );\n }\n\n if (options.initSelection != null) {\n var InitSelection = require(options.amdBase + 'compat/initSelection');\n\n options.dataAdapter = Utils.Decorate(\n options.dataAdapter,\n InitSelection\n );\n }\n }\n\n if (options.resultsAdapter == null) {\n options.resultsAdapter = ResultsList;\n\n if (options.ajax != null) {\n options.resultsAdapter = Utils.Decorate(\n options.resultsAdapter,\n InfiniteScroll\n );\n }\n\n if (options.placeholder != null) {\n options.resultsAdapter = Utils.Decorate(\n options.resultsAdapter,\n HidePlaceholder\n );\n }\n\n if (options.selectOnClose) {\n options.resultsAdapter = Utils.Decorate(\n options.resultsAdapter,\n SelectOnClose\n );\n }\n }\n\n if (options.dropdownAdapter == null) {\n if (options.multiple) {\n options.dropdownAdapter = Dropdown;\n } else {\n var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);\n\n options.dropdownAdapter = SearchableDropdown;\n }\n\n if (options.minimumResultsForSearch !== 0) {\n options.dropdownAdapter = Utils.Decorate(\n options.dropdownAdapter,\n MinimumResultsForSearch\n );\n }\n\n if (options.closeOnSelect) {\n options.dropdownAdapter = Utils.Decorate(\n options.dropdownAdapter,\n CloseOnSelect\n );\n }\n\n if (\n options.dropdownCssClass != null ||\n options.dropdownCss != null ||\n options.adaptDropdownCssClass != null\n ) {\n var DropdownCSS = require(options.amdBase + 'compat/dropdownCss');\n\n options.dropdownAdapter = Utils.Decorate(\n options.dropdownAdapter,\n DropdownCSS\n );\n }\n\n options.dropdownAdapter = Utils.Decorate(\n options.dropdownAdapter,\n AttachBody\n );\n }\n\n if (options.selectionAdapter == null) {\n if (options.multiple) {\n options.selectionAdapter = MultipleSelection;\n } else {\n options.selectionAdapter = SingleSelection;\n }\n\n // Add the placeholder mixin if a placeholder was specified\n if (options.placeholder != null) {\n options.selectionAdapter = Utils.Decorate(\n options.selectionAdapter,\n Placeholder\n );\n }\n\n if (options.allowClear) {\n options.selectionAdapter = Utils.Decorate(\n options.selectionAdapter,\n AllowClear\n );\n }\n\n if (options.multiple) {\n options.selectionAdapter = Utils.Decorate(\n options.selectionAdapter,\n SelectionSearch\n );\n }\n\n if (\n options.containerCssClass != null ||\n options.containerCss != null ||\n options.adaptContainerCssClass != null\n ) {\n var ContainerCSS = require(options.amdBase + 'compat/containerCss');\n\n options.selectionAdapter = Utils.Decorate(\n options.selectionAdapter,\n ContainerCSS\n );\n }\n\n options.selectionAdapter = Utils.Decorate(\n options.selectionAdapter,\n EventRelay\n );\n }\n\n // If the defaults were not previously applied from an element, it is\n // possible for the language option to have not been resolved\n options.language = this._resolveLanguage(options.language);\n\n // Always fall back to English since it will always be complete\n options.language.push('en');\n\n var uniqueLanguages = [];\n\n for (var l = 0; l < options.language.length; l++) {\n var language = options.language[l];\n\n if (uniqueLanguages.indexOf(language) === -1) {\n uniqueLanguages.push(language);\n }\n }\n\n options.language = uniqueLanguages;\n\n options.translations = this._processTranslations(\n options.language,\n options.debug\n );\n\n return options;\n };\n\n Defaults.prototype.reset = function () {\n function stripDiacritics (text) {\n // Used 'uni range + named function' from http://jsperf.com/diacritics/18\n function match(a) {\n return DIACRITICS[a] || a;\n }\n\n return text.replace(/[^\\u0000-\\u007E]/g, match);\n }\n\n function matcher (params, data) {\n // Always return the object if there is nothing to compare\n if ($.trim(params.term) === '') {\n return data;\n }\n\n // Do a recursive check for options with children\n if (data.children && data.children.length > 0) {\n // Clone the data object if there are children\n // This is required as we modify the object to remove any non-matches\n var match = $.extend(true, {}, data);\n\n // Check each child of the option\n for (var c = data.children.length - 1; c >= 0; c--) {\n var child = data.children[c];\n\n var matches = matcher(params, child);\n\n // If there wasn't a match, remove the object in the array\n if (matches == null) {\n match.children.splice(c, 1);\n }\n }\n\n // If any children matched, return the new object\n if (match.children.length > 0) {\n return match;\n }\n\n // If there were no matching children, check just the plain object\n return matcher(params, match);\n }\n\n var original = stripDiacritics(data.text).toUpperCase();\n var term = stripDiacritics(params.term).toUpperCase();\n\n // Check if the text contains the term\n if (original.indexOf(term) > -1) {\n return data;\n }\n\n // If it doesn't contain the term, don't return anything\n return null;\n }\n\n this.defaults = {\n amdBase: './',\n amdLanguageBase: './i18n/',\n closeOnSelect: true,\n debug: false,\n dropdownAutoWidth: false,\n escapeMarkup: Utils.escapeMarkup,\n language: {},\n matcher: matcher,\n minimumInputLength: 0,\n maximumInputLength: 0,\n maximumSelectionLength: 0,\n minimumResultsForSearch: 0,\n selectOnClose: false,\n scrollAfterSelect: false,\n sorter: function (data) {\n return data;\n },\n templateResult: function (result) {\n return result.text;\n },\n templateSelection: function (selection) {\n return selection.text;\n },\n theme: 'default',\n width: 'resolve'\n };\n };\n\n Defaults.prototype.applyFromElement = function (options, $element) {\n var optionLanguage = options.language;\n var defaultLanguage = this.defaults.language;\n var elementLanguage = $element.prop('lang');\n var parentLanguage = $element.closest('[lang]').prop('lang');\n\n var languages = Array.prototype.concat.call(\n this._resolveLanguage(elementLanguage),\n this._resolveLanguage(optionLanguage),\n this._resolveLanguage(defaultLanguage),\n this._resolveLanguage(parentLanguage)\n );\n\n options.language = languages;\n\n return options;\n };\n\n Defaults.prototype._resolveLanguage = function (language) {\n if (!language) {\n return [];\n }\n\n if ($.isEmptyObject(language)) {\n return [];\n }\n\n if ($.isPlainObject(language)) {\n return [language];\n }\n\n var languages;\n\n if (!$.isArray(language)) {\n languages = [language];\n } else {\n languages = language;\n }\n\n var resolvedLanguages = [];\n\n for (var l = 0; l < languages.length; l++) {\n resolvedLanguages.push(languages[l]);\n\n if (typeof languages[l] === 'string' && languages[l].indexOf('-') > 0) {\n // Extract the region information if it is included\n var languageParts = languages[l].split('-');\n var baseLanguage = languageParts[0];\n\n resolvedLanguages.push(baseLanguage);\n }\n }\n\n return resolvedLanguages;\n };\n\n Defaults.prototype._processTranslations = function (languages, debug) {\n var translations = new Translation();\n\n for (var l = 0; l < languages.length; l++) {\n var languageData = new Translation();\n\n var language = languages[l];\n\n if (typeof language === 'string') {\n try {\n // Try to load it with the original name\n languageData = Translation.loadPath(language);\n } catch (e) {\n try {\n // If we couldn't load it, check if it wasn't the full path\n language = this.defaults.amdLanguageBase + language;\n languageData = Translation.loadPath(language);\n } catch (ex) {\n // The translation could not be loaded at all. Sometimes this is\n // because of a configuration problem, other times this can be\n // because of how Select2 helps load all possible translation files\n if (debug && window.console && console.warn) {\n console.warn(\n 'Select2: The language file for \"' + language + '\" could ' +\n 'not be automatically loaded. A fallback will be used instead.'\n );\n }\n }\n }\n } else if ($.isPlainObject(language)) {\n languageData = new Translation(language);\n } else {\n languageData = language;\n }\n\n translations.extend(languageData);\n }\n\n return translations;\n };\n\n Defaults.prototype.set = function (key, value) {\n var camelKey = $.camelCase(key);\n\n var data = {};\n data[camelKey] = value;\n\n var convertedData = Utils._convertData(data);\n\n $.extend(true, this.defaults, convertedData);\n };\n\n var defaults = new Defaults();\n\n return defaults;\n });\n\n S2.define('select2/options',[\n 'require',\n 'jquery',\n './defaults',\n './utils'\n ], function (require, $, Defaults, Utils) {\n function Options (options, $element) {\n this.options = options;\n\n if ($element != null) {\n this.fromElement($element);\n }\n\n if ($element != null) {\n this.options = Defaults.applyFromElement(this.options, $element);\n }\n\n this.options = Defaults.apply(this.options);\n\n if ($element && $element.is('input')) {\n var InputCompat = require(this.get('amdBase') + 'compat/inputData');\n\n this.options.dataAdapter = Utils.Decorate(\n this.options.dataAdapter,\n InputCompat\n );\n }\n }\n\n Options.prototype.fromElement = function ($e) {\n var excludedData = ['select2'];\n\n if (this.options.multiple == null) {\n this.options.multiple = $e.prop('multiple');\n }\n\n if (this.options.disabled == null) {\n this.options.disabled = $e.prop('disabled');\n }\n\n if (this.options.dir == null) {\n if ($e.prop('dir')) {\n this.options.dir = $e.prop('dir');\n } else if ($e.closest('[dir]').prop('dir')) {\n this.options.dir = $e.closest('[dir]').prop('dir');\n } else {\n this.options.dir = 'ltr';\n }\n }\n\n $e.prop('disabled', this.options.disabled);\n $e.prop('multiple', this.options.multiple);\n\n if (Utils.GetData($e[0], 'select2Tags')) {\n if (this.options.debug && window.console && console.warn) {\n console.warn(\n 'Select2: The `data-select2-tags` attribute has been changed to ' +\n 'use the `data-data` and `data-tags=\"true\"` attributes and will be ' +\n 'removed in future versions of Select2.'\n );\n }\n\n Utils.StoreData($e[0], 'data', Utils.GetData($e[0], 'select2Tags'));\n Utils.StoreData($e[0], 'tags', true);\n }\n\n if (Utils.GetData($e[0], 'ajaxUrl')) {\n if (this.options.debug && window.console && console.warn) {\n console.warn(\n 'Select2: The `data-ajax-url` attribute has been changed to ' +\n '`data-ajax--url` and support for the old attribute will be removed' +\n ' in future versions of Select2.'\n );\n }\n\n $e.attr('ajax--url', Utils.GetData($e[0], 'ajaxUrl'));\n Utils.StoreData($e[0], 'ajax-Url', Utils.GetData($e[0], 'ajaxUrl'));\n }\n\n var dataset = {};\n\n function upperCaseLetter(_, letter) {\n return letter.toUpperCase();\n }\n\n // Pre-load all of the attributes which are prefixed with `data-`\n for (var attr = 0; attr < $e[0].attributes.length; attr++) {\n var attributeName = $e[0].attributes[attr].name;\n var prefix = 'data-';\n\n if (attributeName.substr(0, prefix.length) == prefix) {\n // Get the contents of the attribute after `data-`\n var dataName = attributeName.substring(prefix.length);\n\n // Get the data contents from the consistent source\n // This is more than likely the jQuery data helper\n var dataValue = Utils.GetData($e[0], dataName);\n\n // camelCase the attribute name to match the spec\n var camelDataName = dataName.replace(/-([a-z])/g, upperCaseLetter);\n\n // Store the data attribute contents into the dataset since\n dataset[camelDataName] = dataValue;\n }\n }\n\n // Prefer the element's `dataset` attribute if it exists\n // jQuery 1.x does not correctly handle data attributes with multiple dashes\n if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {\n dataset = $.extend(true, {}, $e[0].dataset, dataset);\n }\n\n // Prefer our internal data cache if it exists\n var data = $.extend(true, {}, Utils.GetData($e[0]), dataset);\n\n data = Utils._convertData(data);\n\n for (var key in data) {\n if ($.inArray(key, excludedData) > -1) {\n continue;\n }\n\n if ($.isPlainObject(this.options[key])) {\n $.extend(this.options[key], data[key]);\n } else {\n this.options[key] = data[key];\n }\n }\n\n return this;\n };\n\n Options.prototype.get = function (key) {\n return this.options[key];\n };\n\n Options.prototype.set = function (key, val) {\n this.options[key] = val;\n };\n\n return Options;\n });\n\n S2.define('select2/core',[\n 'jquery',\n './options',\n './utils',\n './keys'\n ], function ($, Options, Utils, KEYS) {\n var Select2 = function ($element, options) {\n if (Utils.GetData($element[0], 'select2') != null) {\n Utils.GetData($element[0], 'select2').destroy();\n }\n\n this.$element = $element;\n\n this.id = this._generateId($element);\n\n options = options || {};\n\n this.options = new Options(options, $element);\n\n Select2.__super__.constructor.call(this);\n\n // Set up the tabindex\n\n var tabindex = $element.attr('tabindex') || 0;\n Utils.StoreData($element[0], 'old-tabindex', tabindex);\n $element.attr('tabindex', '-1');\n\n // Set up containers and adapters\n\n var DataAdapter = this.options.get('dataAdapter');\n this.dataAdapter = new DataAdapter($element, this.options);\n\n var $container = this.render();\n\n this._placeContainer($container);\n\n var SelectionAdapter = this.options.get('selectionAdapter');\n this.selection = new SelectionAdapter($element, this.options);\n this.$selection = this.selection.render();\n\n this.selection.position(this.$selection, $container);\n\n var DropdownAdapter = this.options.get('dropdownAdapter');\n this.dropdown = new DropdownAdapter($element, this.options);\n this.$dropdown = this.dropdown.render();\n\n this.dropdown.position(this.$dropdown, $container);\n\n var ResultsAdapter = this.options.get('resultsAdapter');\n this.results = new ResultsAdapter($element, this.options, this.dataAdapter);\n this.$results = this.results.render();\n\n this.results.position(this.$results, this.$dropdown);\n\n // Bind events\n\n var self = this;\n\n // Bind the container to all of the adapters\n this._bindAdapters();\n\n // Register any DOM event handlers\n this._registerDomEvents();\n\n // Register any internal event handlers\n this._registerDataEvents();\n this._registerSelectionEvents();\n this._registerDropdownEvents();\n this._registerResultsEvents();\n this._registerEvents();\n\n // Set the initial state\n this.dataAdapter.current(function (initialData) {\n self.trigger('selection:update', {\n data: initialData\n });\n });\n\n // Hide the original select\n $element.addClass('select2-hidden-accessible');\n $element.attr('aria-hidden', 'true');\n\n // Synchronize any monitored attributes\n this._syncAttributes();\n\n Utils.StoreData($element[0], 'select2', this);\n\n // Ensure backwards compatibility with $element.data('select2').\n $element.data('select2', this);\n };\n\n Utils.Extend(Select2, Utils.Observable);\n\n Select2.prototype._generateId = function ($element) {\n var id = '';\n\n if ($element.attr('id') != null) {\n id = $element.attr('id');\n } else if ($element.attr('name') != null) {\n id = $element.attr('name') + '-' + Utils.generateChars(2);\n } else {\n id = Utils.generateChars(4);\n }\n\n id = id.replace(/(:|\\.|\\[|\\]|,)/g, '');\n id = 'select2-' + id;\n\n return id;\n };\n\n Select2.prototype._placeContainer = function ($container) {\n $container.insertAfter(this.$element);\n\n var width = this._resolveWidth(this.$element, this.options.get('width'));\n\n if (width != null) {\n $container.css('width', width);\n }\n };\n\n Select2.prototype._resolveWidth = function ($element, method) {\n var WIDTH = /^width:(([-+]?([0-9]*\\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;\n\n if (method == 'resolve') {\n var styleWidth = this._resolveWidth($element, 'style');\n\n if (styleWidth != null) {\n return styleWidth;\n }\n\n return this._resolveWidth($element, 'element');\n }\n\n if (method == 'element') {\n var elementWidth = $element.outerWidth(false);\n\n if (elementWidth <= 0) {\n return 'auto';\n }\n\n return elementWidth + 'px';\n }\n\n if (method == 'style') {\n var style = $element.attr('style');\n\n if (typeof(style) !== 'string') {\n return null;\n }\n\n var attrs = style.split(';');\n\n for (var i = 0, l = attrs.length; i < l; i = i + 1) {\n var attr = attrs[i].replace(/\\s/g, '');\n var matches = attr.match(WIDTH);\n\n if (matches !== null && matches.length >= 1) {\n return matches[1];\n }\n }\n\n return null;\n }\n\n if (method == 'computedstyle') {\n var computedStyle = window.getComputedStyle($element[0]);\n\n return computedStyle.width;\n }\n\n return method;\n };\n\n Select2.prototype._bindAdapters = function () {\n this.dataAdapter.bind(this, this.$container);\n this.selection.bind(this, this.$container);\n\n this.dropdown.bind(this, this.$container);\n this.results.bind(this, this.$container);\n };\n\n Select2.prototype._registerDomEvents = function () {\n var self = this;\n\n this.$element.on('change.select2', function () {\n self.dataAdapter.current(function (data) {\n self.trigger('selection:update', {\n data: data\n });\n });\n });\n\n this.$element.on('focus.select2', function (evt) {\n self.trigger('focus', evt);\n });\n\n this._syncA = Utils.bind(this._syncAttributes, this);\n this._syncS = Utils.bind(this._syncSubtree, this);\n\n if (this.$element[0].attachEvent) {\n this.$element[0].attachEvent('onpropertychange', this._syncA);\n }\n\n var observer = window.MutationObserver ||\n window.WebKitMutationObserver ||\n window.MozMutationObserver\n ;\n\n if (observer != null) {\n this._observer = new observer(function (mutations) {\n self._syncA();\n self._syncS(null, mutations);\n });\n this._observer.observe(this.$element[0], {\n attributes: true,\n childList: true,\n subtree: false\n });\n } else if (this.$element[0].addEventListener) {\n this.$element[0].addEventListener(\n 'DOMAttrModified',\n self._syncA,\n false\n );\n this.$element[0].addEventListener(\n 'DOMNodeInserted',\n self._syncS,\n false\n );\n this.$element[0].addEventListener(\n 'DOMNodeRemoved',\n self._syncS,\n false\n );\n }\n };\n\n Select2.prototype._registerDataEvents = function () {\n var self = this;\n\n this.dataAdapter.on('*', function (name, params) {\n self.trigger(name, params);\n });\n };\n\n Select2.prototype._registerSelectionEvents = function () {\n var self = this;\n var nonRelayEvents = ['toggle', 'focus'];\n\n this.selection.on('toggle', function () {\n self.toggleDropdown();\n });\n\n this.selection.on('focus', function (params) {\n self.focus(params);\n });\n\n this.selection.on('*', function (name, params) {\n if ($.inArray(name, nonRelayEvents) !== -1) {\n return;\n }\n\n self.trigger(name, params);\n });\n };\n\n Select2.prototype._registerDropdownEvents = function () {\n var self = this;\n\n this.dropdown.on('*', function (name, params) {\n self.trigger(name, params);\n });\n };\n\n Select2.prototype._registerResultsEvents = function () {\n var self = this;\n\n this.results.on('*', function (name, params) {\n self.trigger(name, params);\n });\n };\n\n Select2.prototype._registerEvents = function () {\n var self = this;\n\n this.on('open', function () {\n self.$container.addClass('select2-container--open');\n });\n\n this.on('close', function () {\n self.$container.removeClass('select2-container--open');\n });\n\n this.on('enable', function () {\n self.$container.removeClass('select2-container--disabled');\n });\n\n this.on('disable', function () {\n self.$container.addClass('select2-container--disabled');\n });\n\n this.on('blur', function () {\n self.$container.removeClass('select2-container--focus');\n });\n\n this.on('query', function (params) {\n if (!self.isOpen()) {\n self.trigger('open', {});\n }\n\n this.dataAdapter.query(params, function (data) {\n self.trigger('results:all', {\n data: data,\n query: params\n });\n });\n });\n\n this.on('query:append', function (params) {\n this.dataAdapter.query(params, function (data) {\n self.trigger('results:append', {\n data: data,\n query: params\n });\n });\n });\n\n this.on('keypress', function (evt) {\n var key = evt.which;\n\n if (self.isOpen()) {\n if (key === KEYS.ESC || key === KEYS.TAB ||\n (key === KEYS.UP && evt.altKey)) {\n self.close(evt);\n\n evt.preventDefault();\n } else if (key === KEYS.ENTER) {\n self.trigger('results:select', {});\n\n evt.preventDefault();\n } else if ((key === KEYS.SPACE && evt.ctrlKey)) {\n self.trigger('results:toggle', {});\n\n evt.preventDefault();\n } else if (key === KEYS.UP) {\n self.trigger('results:previous', {});\n\n evt.preventDefault();\n } else if (key === KEYS.DOWN) {\n self.trigger('results:next', {});\n\n evt.preventDefault();\n }\n } else {\n if (key === KEYS.ENTER || key === KEYS.SPACE ||\n (key === KEYS.DOWN && evt.altKey)) {\n self.open();\n\n evt.preventDefault();\n }\n }\n });\n };\n\n Select2.prototype._syncAttributes = function () {\n this.options.set('disabled', this.$element.prop('disabled'));\n\n if (this.isDisabled()) {\n if (this.isOpen()) {\n this.close();\n }\n\n this.trigger('disable', {});\n } else {\n this.trigger('enable', {});\n }\n };\n\n Select2.prototype._isChangeMutation = function (evt, mutations) {\n var changed = false;\n var self = this;\n\n // Ignore any mutation events raised for elements that aren't options or\n // optgroups. This handles the case when the select element is destroyed\n if (\n evt && evt.target && (\n evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP'\n )\n ) {\n return;\n }\n\n if (!mutations) {\n // If mutation events aren't supported, then we can only assume that the\n // change affected the selections\n changed = true;\n } else if (mutations.addedNodes && mutations.addedNodes.length > 0) {\n for (var n = 0; n < mutations.addedNodes.length; n++) {\n var node = mutations.addedNodes[n];\n\n if (node.selected) {\n changed = true;\n }\n }\n } else if (mutations.removedNodes && mutations.removedNodes.length > 0) {\n changed = true;\n } else if ($.isArray(mutations)) {\n $.each(mutations, function(evt, mutation) {\n if (self._isChangeMutation(evt, mutation)) {\n // We've found a change mutation.\n // Let's escape from the loop and continue\n changed = true;\n return false;\n }\n });\n }\n return changed;\n };\n\n Select2.prototype._syncSubtree = function (evt, mutations) {\n var changed = this._isChangeMutation(evt, mutations);\n var self = this;\n\n // Only re-pull the data if we think there is a change\n if (changed) {\n this.dataAdapter.current(function (currentData) {\n self.trigger('selection:update', {\n data: currentData\n });\n });\n }\n };\n\n /**\n * Override the trigger method to automatically trigger pre-events when\n * there are events that can be prevented.\n */\n Select2.prototype.trigger = function (name, args) {\n var actualTrigger = Select2.__super__.trigger;\n var preTriggerMap = {\n 'open': 'opening',\n 'close': 'closing',\n 'select': 'selecting',\n 'unselect': 'unselecting',\n 'clear': 'clearing'\n };\n\n if (args === undefined) {\n args = {};\n }\n\n if (name in preTriggerMap) {\n var preTriggerName = preTriggerMap[name];\n var preTriggerArgs = {\n prevented: false,\n name: name,\n args: args\n };\n\n actualTrigger.call(this, preTriggerName, preTriggerArgs);\n\n if (preTriggerArgs.prevented) {\n args.prevented = true;\n\n return;\n }\n }\n\n actualTrigger.call(this, name, args);\n };\n\n Select2.prototype.toggleDropdown = function () {\n if (this.isDisabled()) {\n return;\n }\n\n if (this.isOpen()) {\n this.close();\n } else {\n this.open();\n }\n };\n\n Select2.prototype.open = function () {\n if (this.isOpen()) {\n return;\n }\n\n if (this.isDisabled()) {\n return;\n }\n\n this.trigger('query', {});\n };\n\n Select2.prototype.close = function (evt) {\n if (!this.isOpen()) {\n return;\n }\n\n this.trigger('close', { originalEvent : evt });\n };\n\n /**\n * Helper method to abstract the \"enabled\" (not \"disabled\") state of this\n * object.\n *\n * @return {true} if the instance is not disabled.\n * @return {false} if the instance is disabled.\n */\n Select2.prototype.isEnabled = function () {\n return !this.isDisabled();\n };\n\n /**\n * Helper method to abstract the \"disabled\" state of this object.\n *\n * @return {true} if the disabled option is true.\n * @return {false} if the disabled option is false.\n */\n Select2.prototype.isDisabled = function () {\n return this.options.get('disabled');\n };\n\n Select2.prototype.isOpen = function () {\n return this.$container.hasClass('select2-container--open');\n };\n\n Select2.prototype.hasFocus = function () {\n return this.$container.hasClass('select2-container--focus');\n };\n\n Select2.prototype.focus = function (data) {\n // No need to re-trigger focus events if we are already focused\n if (this.hasFocus()) {\n return;\n }\n\n this.$container.addClass('select2-container--focus');\n this.trigger('focus', {});\n };\n\n Select2.prototype.enable = function (args) {\n if (this.options.get('debug') && window.console && console.warn) {\n console.warn(\n 'Select2: The `select2(\"enable\")` method has been deprecated and will' +\n ' be removed in later Select2 versions. Use $element.prop(\"disabled\")' +\n ' instead.'\n );\n }\n\n if (args == null || args.length === 0) {\n args = [true];\n }\n\n var disabled = !args[0];\n\n this.$element.prop('disabled', disabled);\n };\n\n Select2.prototype.data = function () {\n if (this.options.get('debug') &&\n arguments.length > 0 && window.console && console.warn) {\n console.warn(\n 'Select2: Data can no longer be set using `select2(\"data\")`. You ' +\n 'should consider setting the value instead using `$element.val()`.'\n );\n }\n\n var data = [];\n\n this.dataAdapter.current(function (currentData) {\n data = currentData;\n });\n\n return data;\n };\n\n Select2.prototype.val = function (args) {\n if (this.options.get('debug') && window.console && console.warn) {\n console.warn(\n 'Select2: The `select2(\"val\")` method has been deprecated and will be' +\n ' removed in later Select2 versions. Use $element.val() instead.'\n );\n }\n\n if (args == null || args.length === 0) {\n return this.$element.val();\n }\n\n var newVal = args[0];\n\n if ($.isArray(newVal)) {\n newVal = $.map(newVal, function (obj) {\n return obj.toString();\n });\n }\n\n this.$element.val(newVal).trigger('input').trigger('change');\n };\n\n Select2.prototype.destroy = function () {\n this.$container.remove();\n\n if (this.$element[0].detachEvent) {\n this.$element[0].detachEvent('onpropertychange', this._syncA);\n }\n\n if (this._observer != null) {\n this._observer.disconnect();\n this._observer = null;\n } else if (this.$element[0].removeEventListener) {\n this.$element[0]\n .removeEventListener('DOMAttrModified', this._syncA, false);\n this.$element[0]\n .removeEventListener('DOMNodeInserted', this._syncS, false);\n this.$element[0]\n .removeEventListener('DOMNodeRemoved', this._syncS, false);\n }\n\n this._syncA = null;\n this._syncS = null;\n\n this.$element.off('.select2');\n this.$element.attr('tabindex',\n Utils.GetData(this.$element[0], 'old-tabindex'));\n\n this.$element.removeClass('select2-hidden-accessible');\n this.$element.attr('aria-hidden', 'false');\n Utils.RemoveData(this.$element[0]);\n this.$element.removeData('select2');\n\n this.dataAdapter.destroy();\n this.selection.destroy();\n this.dropdown.destroy();\n this.results.destroy();\n\n this.dataAdapter = null;\n this.selection = null;\n this.dropdown = null;\n this.results = null;\n };\n\n Select2.prototype.render = function () {\n var $container = $(\n '' +\n '' +\n '' +\n ''\n );\n\n $container.attr('dir', this.options.get('dir'));\n\n this.$container = $container;\n\n this.$container.addClass('select2-container--' + this.options.get('theme'));\n\n Utils.StoreData($container[0], 'element', this.$element);\n\n return $container;\n };\n\n return Select2;\n });\n\n S2.define('select2/compat/utils',[\n 'jquery'\n ], function ($) {\n function syncCssClasses ($dest, $src, adapter) {\n var classes, replacements = [], adapted;\n\n classes = $.trim($dest.attr('class'));\n\n if (classes) {\n classes = '' + classes; // for IE which returns object\n\n $(classes.split(/\\s+/)).each(function () {\n // Save all Select2 classes\n if (this.indexOf('select2-') === 0) {\n replacements.push(this);\n }\n });\n }\n\n classes = $.trim($src.attr('class'));\n\n if (classes) {\n classes = '' + classes; // for IE which returns object\n\n $(classes.split(/\\s+/)).each(function () {\n // Only adapt non-Select2 classes\n if (this.indexOf('select2-') !== 0) {\n adapted = adapter(this);\n\n if (adapted != null) {\n replacements.push(adapted);\n }\n }\n });\n }\n\n $dest.attr('class', replacements.join(' '));\n }\n\n return {\n syncCssClasses: syncCssClasses\n };\n });\n\n S2.define('select2/compat/containerCss',[\n 'jquery',\n './utils'\n ], function ($, CompatUtils) {\n // No-op CSS adapter that discards all classes by default\n function _containerAdapter (clazz) {\n return null;\n }\n\n function ContainerCSS () { }\n\n ContainerCSS.prototype.render = function (decorated) {\n var $container = decorated.call(this);\n\n var containerCssClass = this.options.get('containerCssClass') || '';\n\n if ($.isFunction(containerCssClass)) {\n containerCssClass = containerCssClass(this.$element);\n }\n\n var containerCssAdapter = this.options.get('adaptContainerCssClass');\n containerCssAdapter = containerCssAdapter || _containerAdapter;\n\n if (containerCssClass.indexOf(':all:') !== -1) {\n containerCssClass = containerCssClass.replace(':all:', '');\n\n var _cssAdapter = containerCssAdapter;\n\n containerCssAdapter = function (clazz) {\n var adapted = _cssAdapter(clazz);\n\n if (adapted != null) {\n // Append the old one along with the adapted one\n return adapted + ' ' + clazz;\n }\n\n return clazz;\n };\n }\n\n var containerCss = this.options.get('containerCss') || {};\n\n if ($.isFunction(containerCss)) {\n containerCss = containerCss(this.$element);\n }\n\n CompatUtils.syncCssClasses($container, this.$element, containerCssAdapter);\n\n $container.css(containerCss);\n $container.addClass(containerCssClass);\n\n return $container;\n };\n\n return ContainerCSS;\n });\n\n S2.define('select2/compat/dropdownCss',[\n 'jquery',\n './utils'\n ], function ($, CompatUtils) {\n // No-op CSS adapter that discards all classes by default\n function _dropdownAdapter (clazz) {\n return null;\n }\n\n function DropdownCSS () { }\n\n DropdownCSS.prototype.render = function (decorated) {\n var $dropdown = decorated.call(this);\n\n var dropdownCssClass = this.options.get('dropdownCssClass') || '';\n\n if ($.isFunction(dropdownCssClass)) {\n dropdownCssClass = dropdownCssClass(this.$element);\n }\n\n var dropdownCssAdapter = this.options.get('adaptDropdownCssClass');\n dropdownCssAdapter = dropdownCssAdapter || _dropdownAdapter;\n\n if (dropdownCssClass.indexOf(':all:') !== -1) {\n dropdownCssClass = dropdownCssClass.replace(':all:', '');\n\n var _cssAdapter = dropdownCssAdapter;\n\n dropdownCssAdapter = function (clazz) {\n var adapted = _cssAdapter(clazz);\n\n if (adapted != null) {\n // Append the old one along with the adapted one\n return adapted + ' ' + clazz;\n }\n\n return clazz;\n };\n }\n\n var dropdownCss = this.options.get('dropdownCss') || {};\n\n if ($.isFunction(dropdownCss)) {\n dropdownCss = dropdownCss(this.$element);\n }\n\n CompatUtils.syncCssClasses($dropdown, this.$element, dropdownCssAdapter);\n\n $dropdown.css(dropdownCss);\n $dropdown.addClass(dropdownCssClass);\n\n return $dropdown;\n };\n\n return DropdownCSS;\n });\n\n S2.define('select2/compat/initSelection',[\n 'jquery'\n ], function ($) {\n function InitSelection (decorated, $element, options) {\n if (options.get('debug') && window.console && console.warn) {\n console.warn(\n 'Select2: The `initSelection` option has been deprecated in favor' +\n ' of a custom data adapter that overrides the `current` method. ' +\n 'This method is now called multiple times instead of a single ' +\n 'time when the instance is initialized. Support will be removed ' +\n 'for the `initSelection` option in future versions of Select2'\n );\n }\n\n this.initSelection = options.get('initSelection');\n this._isInitialized = false;\n\n decorated.call(this, $element, options);\n }\n\n InitSelection.prototype.current = function (decorated, callback) {\n var self = this;\n\n if (this._isInitialized) {\n decorated.call(this, callback);\n\n return;\n }\n\n this.initSelection.call(null, this.$element, function (data) {\n self._isInitialized = true;\n\n if (!$.isArray(data)) {\n data = [data];\n }\n\n callback(data);\n });\n };\n\n return InitSelection;\n });\n\n S2.define('select2/compat/inputData',[\n 'jquery',\n '../utils'\n ], function ($, Utils) {\n function InputData (decorated, $element, options) {\n this._currentData = [];\n this._valueSeparator = options.get('valueSeparator') || ',';\n\n if ($element.prop('type') === 'hidden') {\n if (options.get('debug') && console && console.warn) {\n console.warn(\n 'Select2: Using a hidden input with Select2 is no longer ' +\n 'supported and may stop working in the future. It is recommended ' +\n 'to use a `