From 770e49a55d2f5ce1bb06ac87ed93ee39c09ce9f3 Mon Sep 17 00:00:00 2001 From: Randall Wilk Date: Wed, 22 Mar 2023 12:53:28 -0500 Subject: [PATCH] Build assets --- dist/form-components.js | 2 +- dist/form-components.js.map | 2 +- dist/manifest.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/form-components.js b/dist/form-components.js index aec13b8..0e7d452 100644 --- a/dist/form-components.js +++ b/dist/form-components.js @@ -1,2 +1,2 @@ -!function(factory){"function"==typeof define&&define.amd?define(factory):factory()}((function(){"use strict";function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread2(target){for(var i=1;iarr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i3&&void 0!==arguments[3]&&arguments[3],key=(Math.random()+1).toString(36).substring(7),keyFromValue=this.getKeyFromValue(value,this.__config.by);return keyFromValue&&(key=keyFromValue),isOptGroup||(this.values[key]=value,this.elsByKey[key]=el,this.orderedKeys.push(key),this.searchableText[key]=el.textContent.trim().toLowerCase(),disabled&&this.disabledKeys.push(key),this.__itemBooted(el,value,disabled,key)),key},__itemBooted:function(el,value,disabled,key){},destroyItem:function(el){var key=keyByValue(this.elsByKey,el);this.selectedKeys.includes(key)||delete this.values[key],delete this.elsByKey[key],delete this.orderedKeys[this.orderedKeys.indexOf(key)],delete this.searchableText[key],delete this.disabledKeys[key],this.reorderKeys(),this.__itemDestroyed(el,key)},__itemDestroyed:function(el,key){},resetOptions:function(){this.activeKey=null,this.reorderKeys()},reorderKeys:function(){var _this=this;this.orderedKeys.forEach((function(key){var el=_this.elsByKey[key];null!=el&&el.isConnected||_this.destroyItem(el)})),this.orderedKeys=this.orderedKeys.slice().sort((function(a,z){if(null===a||null===z)return 0;var aEl=_this.elsByKey[a],zEl=_this.elsByKey[z],position=aEl.compareDocumentPosition(zEl);return position&Node.DOCUMENT_POSITION_FOLLOWING?-1:position&Node.DOCUMENT_POSITION_PRECEDING?1:0}))},activeEl:function(){if(this.activeKey)return this.elsByKey[this.activeKey]},isActiveEl:function(el){var key=keyByValue(this.elsByKey,el);if(key)return this.activeKey===key},activateEl:function(el){var key=keyByValue(this.elsByKey,el);key&&this.activateKey(key)},selectEl:function(el){var key=keyByValue(this.elsByKey,el);key&&this.selectKey(key)},isSelectedEl:function(el){var key=keyByValue(this.elsByKey,el);if(key)return this.isSelected(key)},isDisabledEl:function(el){var key=keyByValue(this.elsByKey,el);if(key)return this.isDisabled(key)},hideEl:function(el){el.style.display="none",el.setAttribute("data-hidden","true")},showEl:function(el){el.style.display="",el.removeAttribute("data-hidden")},isHiddenEl:function(el){return"none"===el.style.display||!el.offsetParent},scrollingCount:0,activateAndScrollToKey:function(key){var _this2=this;this.scrollingCount++,this.activateKey(key);var targetEl=this.elsByKey[key];targetEl&&targetEl.scrollIntoView({block:"nearest"}),setTimeout((function(){_this2.scrollingCount--}),25)},selectedBasicValueOrValues:function(by){return this.__multiple?this.selectedBasicValues(by):this.selectedBasicValue(by)},selectedBasicValues:function(by){var _this3=this;return this.selectedKeys.map((function(i){var value=_this3.values[i];return null!=value&&value.hasOwnProperty(by)?value[by]:value}))},selectedBasicValue:function(by){var value=this.selectedKeys[0]?this.values[this.selectedKeys[0]]:null;return null!=value&&value.hasOwnProperty(by)?value[by]:value},selectedValueOrValues:function(){return this.__multiple?this.selectedValues():this.selectedValue()},selectedValues:function(){var _this4=this;return this.selectedKeys.map((function(i){return _this4.values[i]}))},selectedValue:function(){return this.selectedKeys[0]?this.values[this.selectedKeys[0]]:null},selectValue:function(value,by){var _this5=this;if(value=normalizeValue(value,this.__multiple),by=mapByToCallback(by),this.__multiple){var keys=[];return value.forEach((function(i){for(var key in _this5.values)by(_this5.values[key],i)&&(keys.includes(key)||keys.push(key))})),void this.selectExclusive(keys)}for(var key in this.values)value&&by(this.values[key],value)&&this.selectKey(key);null===value&&(this.selectedKeys=[])},getKeyFromValue:function(value,by){if(value)for(var key in by=mapByToCallback(by),this.values)if(by(this.values[key],value))return key},getKeyFromSimpleValue:function(value,by){if(value)for(var key in by=mapByToSimpleCompareCallback(by),this.values)if(by(this.values[key],value))return key},getObjectFromValue:function(value,by){if(value)for(var key in by=mapByToSimpleCompareCallback(by),this.values)if(by(this.values[key],value))return this.values[key]},toggleValue:function(value,by){if(value&&(by=mapByToCallback(by),this.__multiple))for(var key in this.values)if(by(this.values[key],value)){this.toggleSelected(key);break}},isDisabled:function(key){return this.disabledKeys.includes(key)},selectKey:function(key){this.isDisabled(key)||(this.__multiple?this.toggleSelected(key):this.selectOnly(key))},toggleSelected:function(key){if(this.selectedKeys.includes(key)){if(!this.canRemoveOptions())return;this.selectedKeys.splice(this.selectedKeys.indexOf(key),1)}else this.selectedKeys.push(key)},selectOnly:function(key){this.selectedKeys=[],this.selectedKeys.push(key)},selectExclusive:function(keys){for(var _this6=this,toAdd=_toConsumableArray(keys),i=0;i=0&&!visibleKeyFound;)targetKey=this.nonDisabledOrderedKeys[currentIndex],visibleKeyFound=!this.isHiddenEl(this.elsByKey[targetKey]),currentIndex--;return visibleKeyFound||(targetKey=null),targetKey},searchQuery:"",clearSearch:Alpine.debounce((function(){this.searchQuery=""}),350),searchKey:function(query){var foundKey;for(var key in this.clearSearch(),this.searchQuery+=query,this.searchableText){if(this.searchableText[key].startsWith(this.searchQuery)){foundKey=key;break}}if(this.nonDisabledOrderedKeys.includes(foundKey))return foundKey},searchableQuery:"",handleSearchableQuery:function(query){if(query!==this.searchableQuery)if(this.searchableQuery=query,this.__wire&&this.__wireSearch)this.__wire[this.__wireSearch](this.searchableQuery);else for(var key in this.searchableText){var content=this.searchableText[key],el=this.elsByKey[key];!this.searchableQuery||content.toLowerCase().includes(this.searchableQuery.toLowerCase())?this.showEl(el):this.hideEl(el)}},canRemoveOptions:function(){if(!this.__multiple&&1===this.selectedKeys.length)return this.__config.optional;var minSelected=this.__config.minSelected;return!!(Number.isNaN(minSelected)||minSelected<1)||this.selectedKeys.length>minSelected},activateByKeyEvent:function(e){if(this.reorderKeys(),!1!==this.__activateByKeyEvent(e)){var targetKey,hasActive=this.hasActive();switch(e.key){case"Tab":case"Backspace":case"Delete":case"Meta":break;case["ArrowDown","ArrowRight"]["vertical"===this.__orientation?0:1]:e.preventDefault(),e.stopPropagation(),targetKey=hasActive?this.nextKey():this.firstKey();break;case["ArrowUp","ArrowLeft"]["vertical"===this.__orientation?0:1]:e.preventDefault(),e.stopPropagation(),targetKey=hasActive?this.prevKey():this.lastKey();break;case"Home":case"PageUp":e.preventDefault(),e.stopPropagation(),targetKey=this.firstKey();break;case"End":case"PageDown":e.preventDefault(),e.stopPropagation(),targetKey=this.lastKey();break;default:1===e.key.length&&(targetKey=this.searchKey(e.key))}targetKey&&this.activateAndScrollToKey(targetKey)}},__activateByKeyEvent:function(e){}}},keyByValue=function(object,value){return Object.keys(object).find((function(key){return object[key]===value}))},renderHiddenInputs=function(el,name,value){var newInputs=generateInputs(name,value);newInputs.forEach((function(i){return i._x_hiddenInput=!0})),newInputs.forEach((function(i){return i._x_ignore=!0}));for(var children=el.children,oldInputs=[],i=0;i2&&void 0!==arguments[2]?arguments[2]:[];if("object"===_typeof(subject=value)&&null!==subject)for(var key in value)carry=carry.concat(generateInputs("".concat(name,"[").concat(key,"]"),value[key]));else if(null!==value&&!1!==value){var el=document.createElement("input");return el.setAttribute("type","hidden"),el.setAttribute("name",name),el.setAttribute("value",""+value),[el]}return carry},generateContext$1=function(_ref){var multiple=_ref.multiple,orientation=_ref.orientation,__wire=_ref.__wire,__wireSearch=_ref.__wireSearch,__config=_ref.__config,Alpine=_ref.Alpine;return _objectSpread2(_objectSpread2({},selectContext(Alpine)),{},{__multiple:multiple,__orientation:orientation,__wire:__wire,__wireSearch:__wireSearch,__config:__config,get isScrollingTo(){return this.scrollingCount>0},get nonDisabledOrderedKeys(){var _this=this;return this.orderedKeys.filter((function(i){return!_this.isDisabled(i)}))}})},selectPopper={__createPopper:void 0,__popper:void 0,__resetPopper:function(){this.__popper&&(this.__popper.destroy(),this.__popper=null)},__popperConfig:function(){return{placement:"bottom-start",strategy:this.__fixed?"fixed":"absolute",modifiers:[{name:"offset",options:{offset:[0,10]}},{name:"preventOverflow",options:{boundariesElement:this.$root}}]}},__initPopper:function(){this.__resetPopper(),this.__popper=this.__createPopper(this.$root,this.$refs.__options,this.__popperConfig())}};function selectData(el,Alpine,config){var _config$__value;return{__ready:!1,__value:null!==(_config$__value=config.__value)&&void 0!==_config$__value&&_config$__value,__richValue:!1,__isOpen:!1,__context:void 0,__isMultiple:!1,__isStatic:!1,__isClearable:void 0,__isDisabled:!1,__compareBy:null,__inputName:void 0,__fixed:!1,__searchable:void 0,__hasCustomSelectLabel:!1,__orientation:"vertical",__externalChanged:!1,__config:config.__config,__wireSearch:void 0,__type:"custom",init:function(){var _this=this;if(this.__createPopper=window.Popper?window.Popper.createPopper:window.createPopper,"function"!=typeof this.__createPopper)throw new TypeError("".concat(this.__type,"-select requires Popper.js (https://popper.js.org)"));this.__isMultiple=Alpine.bound(el,"data-multiple",!1),this.__isDisabled=Alpine.bound(el,"disabled",!1)||Alpine.bound(el,"readonly",!1),this.__inputName=Alpine.bound(el,"name",null),this.__compareBy=Alpine.bound(el,"by"),this.__orientation=Alpine.bound(el,"horizontal")?"horizontal":"vertical",this.__searchable=Alpine.bound(el,"searchable",!1),this.__isClearable=Alpine.bound(el,"clearable",!1),this.__wireSearch=Alpine.bound(el,"livewire-search"),this.__fixed=Alpine.bound(el,"fixed",!1);var autoFocus=Alpine.bound(el,"autofocus");this.__context=this.__generateContext(el,Alpine,config);var defaultValue=Alpine.bound(el,"default-value",null);defaultValue&&!this.__value&&(this.__value=defaultValue),queueMicrotask((function(){_this.__ready=!0,queueMicrotask((function(){var lastValueFingerprint=!1;Alpine.effect((function(){if(_this.__context.selectedKeys,!1===lastValueFingerprint||lastValueFingerprint!==JSON.stringify(_this.__value))if(_this.__externalChanged=!0,_this.__isMultiple){_this.__context.clearSelected();var _step,keys=[],_iterator=function(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function(){};return{s:F,n:function(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function(e){throw e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function(){it=it.call(o)},n:function(){var step=it.next();return normalCompletion=step.done,step},e:function(e){didErr=!0,err=e},f:function(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}(_this.__value);try{for(_iterator.s();!(_step=_iterator.n()).done;){var value=_step.value,object=_this.__context.getObjectFromValue(value,_this.__compareBy);object&&keys.push(object)}}catch(err){_iterator.e(err)}finally{_iterator.f()}_this.__context.selectValue(keys,_this.__compareBy),_this.__richValue=_this.__context.selectedValueOrValues()}else{if("object"===_typeof(_this.__value)||Array.isArray(_this.__value)||null===_this.__value)_this.__context.selectValue(_this.__value,_this.__compareBy);else{var key=_this.__context.getKeyFromSimpleValue(_this.__value,_this.__compareBy);key&&_this.__context.selectKey(key)}_this.__richValue=_this.__context.selectedValueOrValues()}else _this.__value=_this.__context.selectedBasicValueOrValues(_this.__compareBy),_this.__richValue=_this.__context.selectedValueOrValues();lastValueFingerprint=JSON.stringify(_this.__value),_this.__inputName&&renderHiddenInputs(_this.$el,_this.__inputName,_this.__value)})),_this.__searchable&&Alpine.effect((function(){var query=_this.__context.searchableQuery;_this.$refs.__options&&_this.$refs.__options.querySelectorAll('[role="presentation"]:not([data-placeholder="true"])').forEach((function(el){query?_this.__context.hideEl(el):_this.__context.showEl(el)}))})),autoFocus&&_this.$refs.__button&&_this.$refs.__button.focus({preventScroll:!0})}))})),this.$watch("__value",(function(newValue){_this.$dispatch("input",newValue)})),this.__componentBooted(el,Alpine,config)},__open:function(){var _this2=this;if(!this.__isDisabled){this.__isOpen=!0,this.__context.activateSelectedOrFirst();var callback;callback=function(){_this2.__searchable&&_this2.$refs.__search?_this2.$refs.__search.focus({preventScroll:!0}):_this2.$refs.__options.focus({preventScroll:!0}),_this2.__initPopper()},requestAnimationFrame((function(){return requestAnimationFrame(callback)}))}},__close:function(){var _this3=this;this.__isOpen=!1,this.__resetPopper(),this.$nextTick((function(){return _this3.$refs.__button.focus({preventScroll:!0})}))},__generateContext:function(el,Alpine,config){},__componentBooted:function(el,Alpine,config){}}}function clearButtonDirective(el,Alpine,type){var magic="tree"===type?"$treeSelect":"$customSelect";return{":tabindex":function(){return!(this.$data.__isDisabled||!this[magic].hasValue)&&"0"},"x-show":function(){return this[magic].shouldShowClear},"x-init":function(){"button"!==this.$el.tagName.toLowerCase()||this.$el.hasAttribute("type")||(this.$el.type="button"),"button"!==this.$el.tagName.toLowerCase&&this.$el.setAttribute("role","button")},"@click.stop.prevent":function(){this.$data.__isDisabled||(this.$data.__context.clearSelected(),this.$data.__close(),this.$data.__value=this.$data.__isMultiple?[]:null)},"@keydown.space.stop.prevent":function(){this.$data.__isDisabled||(this.$data.__context.clearSelected(),this.$data.__close(),this.$data.__value=this.$data.__isMultiple?[]:null)}}}function optionsDirective(el,Alpine){return{"x-ref":"__options",":id":function(){return this.$id("fc-".concat(this.__type,"-select-options"))},"x-init":function(){this.$data.__isStatic=Alpine.bound(this.$el,"static",!1)},"x-show":function(){return!!this.$data.__isStatic||this.$data.__isOpen},"@click.outside":function(){this.$data.__close()},"@keydown.escape.stop.prevent":function(){this.$data.__close()},tabindex:"0",role:"listbox",":aria-orientation":function(){return this.$data.__orientation},":aria-labelledby":function(){return this.$id("fc-".concat(this.__type,"-select-button"))},":aria-activedescendant":function(){return this.$data.__context.activeEl()&&this.$data.__context.activeEl().id},":aria-multiselectable":function(){return this.$data.__isMultiple?"true":"false"},"@focus":function(){this.$data.__context.activateSelectedOrFirst()},"x-trap":function(){return this.$data.__isOpen},"@keydown":function(e){this.$data.__context.activateByKeyEvent(e)},"@keydown.enter.stop.prevent":function(){this.$data.__context.selectActive(),this.$data.__isMultiple||this.$data.__close()},"@keydown.space.stop.prevent":function(){this.$data.__context.selectActive(),this.$data.__isMultiple||this.$data.__close()}}}function optionDirective(el,Alpine,type){var rootMagic="tree"===type?"$treeSelect":"$customSelect",magic="tree"===type?"$treeSelectOption":"$customSelectOption";return{":id":function(){return this.$id("fc-".concat(this.__type,"-select-option"))},":tabindex":function(){return!this.$data.__isDisabled&&"-1"},":role":function(){return this[magic].isOptGroup?"presentation":"option"},"x-init":function(){var _this4=this,initCallback=function(){var value=Alpine.bound(el,"value"),disabled=Alpine.bound(el,"disabled"),isOptGroup=Alpine.bound(el,"is-opt-group");el.__optionKey=_this4.$data.__context.initItem(el,value,disabled,isOptGroup)};this.$data.__ready?initCallback():queueMicrotask(initCallback)},":aria-selected":function(){return this[magic].isSelected},":aria-disabled":function(){return this[magic].isDisabled},"@click":function(){this.$data.__isDisabled||this[magic].isDisabled||(this[magic].isSelected||this[rootMagic].canSelectMore)&&(this.$data.__context.selectEl(el),this.$data.__isMultiple||this.$data.__close())},"@mousemove":function(){this.$data.__context.activateEl(el)},"@mouseleave":function(){this.$data.__context.deactivate()}}}function tokenDirective(el,Alpine){return{":tabindex":function(){return!this.$data.__isDisabled&&"0"},":role":function(){return"button"!==this.$el.tagName.toLowerCase()&&!this.$data.__isDisabled&&"button"},"x-init":function(){var _this6=this,initCallback=function(){el.__key=_this6.$data.__context.getKeyFromValue(el.value)};this.$data.__ready?initCallback():queueMicrotask(initCallback)},"@click.stop.prevent":function(){!this.$data.__isDisabled&&el.__key&&this.$data.__context.toggleSelected(el.__key)},"@keydown.space.stop.prevent":function(){!this.$data.__isDisabled&&el.__key&&this.$data.__context.toggleSelected(el.__key)}}}var rootMagic=function(el,Alpine,callback,stubCallback){var data=Alpine.$data(el);return"function"!=typeof stubCallback&&(stubCallback=function(){return{}}),"function"!=typeof callback&&(callback=function(){return{}}),data.__ready?_objectSpread2({get isOpen(){return data.__isOpen},get isDisabled(){return data.__isDisabled},get isSearchable(){return data.__searchable},get selected(){return data.__value},get active(){return data.__context.active},get selectedObject(){return data.__richValue},get hasValue(){return data.__isMultiple?data.__value&&data.__value.length>0:!!data.__value},get shouldShowClear(){return!data.__isDisabled&&(!1!==data.__config.optional&&(!(data.__isMultiple&&!Number.isNaN(data.__config.minSelected)&&data.__config.minSelected>0)&&(data.__isClearable&&this.hasValue)))},get canSelectMore(){return!data.__isMultiple||(!!(Number.isNaN(data.__config.maxSelected)||data.__config.maxSelected<1)||data.__config.maxSelected>data.__value.length)},get canDeselectOptions(){return!data.__isDisabled&&data.__context.canRemoveOptions()},get hasOptions(){return data.__context.searchableQuery,data.$refs.__options&&data.$refs.__options.querySelectorAll('[role="option"]:not([data-hidden])').length>0},get hasSearch(){return!!data.__context.searchableQuery}},callback(data)):_objectSpread2({isDisabled:!1,isOpen:!1,selected:null,active:null,selectedObject:null},stubCallback(data))},optionMagic=function(el,Alpine,callback,stubCallback){"function"!=typeof stubCallback&&(stubCallback=function(){return{}}),"function"!=typeof callback&&(callback=function(){return{}});var data=Alpine.$data(el),stub=_objectSpread2({isDisabled:!1,isSelected:!1,isActive:!1},stubCallback(data));if(!data.__ready)return stub;var optionEl=Alpine.findClosest(el,(function(i){return i.__optionKey}));if(!optionEl)return stub;var context=data.__context;return _objectSpread2({get isActive(){return context.isActiveEl(optionEl)},get isSelected(){return context.isSelectedEl(optionEl)},get isDisabled(){return context.isDisabledEl(optionEl)}},callback(data,context,optionEl))};function customSelect(Alpine){Alpine.data("customSelect",(function(config){return _objectSpread2(_objectSpread2(_objectSpread2({},selectPopper),selectData(config.__el,Alpine,config)),{},{__generateContext:function(el,Alpine,config){var _config$__config;return generateContext$1({multiple:this.__isMultiple,orientation:this.__orientation,__wire:config.__wire,__wireSearch:Alpine.bound(el,"livewire-search"),__config:null!==(_config$__config=config.__config)&&void 0!==_config$__config?_config$__config:{},Alpine:Alpine})}})})),Alpine.directive("custom-select",(function(el,directive,_ref){var cleanup=_ref.cleanup;switch(directive.value){case"button":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},{"x-ref":"__button",":id":function(){return this.$id("fc-".concat(this.__type,"-select-button"))},"aria-haspopup":"true","data-custom-select-button":"true",":aria-labelledby":function(){return this.$data.__hasCustomSelectLabel?this.$id("fc-".concat(this.__type,"-select-label")):this.$id("fc-label")},":aria-expanded":function(){return this.$data.__isOpen},":aria-controls":function(){return this.$data.__isOpen&&this.$id("fc-".concat(this.__type,"-select-options"))},":tabindex":function(){return this.$data.__isDisabled?"-1":"0"},"x-init":function(){"button"!==this.$el.tagName.toLowerCase()||this.$el.hasAttribute("type")||(this.$el.type="button"),"button"!==this.$el.tagName.toLowerCase()&&this.$el.setAttribute("role","button")},"@click":function(){this.$data.__open()},"@focus":function(){this.$data.__isDisabled&&this.$el.blur()},"@keydown":function(e){["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(e.key)&&(e.stopPropagation(),e.preventDefault(),this.$data.__open());var $magic="tree"===this.__type?this.$treeSelect:this.$customSelect;if("Backspace"===e.key){if(e.stopPropagation(),e.preventDefault(),this.$data.__isDisabled)return;var lastSelected=this.$data.__isMultiple?$magic.selectedObject[$magic.selectedObject.length-1]:$magic.selectedObject;lastSelected&&this.$data.__context.toggleValue(lastSelected,this.$data.__compareBy)}},"@keydown.space.stop.prevent":function(){this.$data.__open()},"@keydown.enter.stop.prevent":function(){this.$data.__open()}}))}(el,Alpine);break;case"label":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},{"x-ref":"__label",":id":function(){return this.$id("fc-".concat(this.__type,"-custom-select-label"))},"x-init":function(){this.$data.__hasCustomSelectLabel=!0},"@click":function(){this.$refs.__button.focus({preventScroll:!0})}}))}(el,Alpine);break;case"clear":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},clearButtonDirective(0,0,"custom")))}(el,Alpine);break;case"options":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},optionsDirective(0,Alpine)))}(el,Alpine);break;case"option":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},optionDirective(el,Alpine,"custom")))}(el,Alpine),cleanup((function(){var parent=el.closest("[x-data]");parent&&Alpine.$data(parent).__context.destroyItem(el)}));break;case"search":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},{"x-ref":"__search",":id":function(){return this.$id("fc-".concat(this.__type,"-select-search"))},"x-init":function(){var _this5=this,searchableQuery=this.$data.__context.searchableQuery;this.$el.value=searchableQuery,this.$data.__ready&&this.$data.__isOpen&&searchableQuery.length&&this.$nextTick((function(){if(_this5.$el.createTextRange){var range=_this5.$el.createTextRange();range.move("character",searchableQuery.length),range.select()}else _this5.$el.focus(),_this5.$el.setSelectionRange&&_this5.$el.setSelectionRange(searchableQuery.length,searchableQuery.length)}))},"@keyup.debounce.250ms":function(e){["Enter","ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Home","PageUp","End","PageDown","Tab","Meta"].includes(e.key)||this.$data.__context.handleSearchableQuery(e.target.value)},"@keydown.space.stop":function(){},"@keydown.tab.prevent.stop":function(){this.$refs.__options.focus()}}))}(el,Alpine);break;case"token":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},tokenDirective(el)))}(el,Alpine);break;default:throw new Error("Unknown custom-select directive value: ".concat(directive.value))}})),Alpine.magic("customSelect",(function(el){return rootMagic(el,Alpine)})),Alpine.magic("customSelectOption",(function(el){return optionMagic(el,Alpine,(function(data,context,optionEl){return{get isOptGroup(){return Alpine.bound(optionEl,"is-opt-group")}}}),(function(){return{isOptGroup:!1}}))}))}function datePicker(Alpine){Alpine.data("datePicker",(function(config){var _ref,_config$mode;return{__ready:!1,__value:config.value,__rawValue:null,__mode:null!==(_ref=null!==(_config$mode=config.mode)&&void 0!==_config$mode?_config$mode:config.options.mode)&&void 0!==_ref?_ref:"single",__isDisabled:!1,__flatpickr:void 0,init:function(){var _value,_this=this;if("function"!=typeof window.flatpickr)throw new Error("date-picker requires Flatpickr. See https://flatpickr.js.org");var value=this.__value;null!==(_value=value)&&void 0!==_value&&_value.hasOwnProperty("initialValue")&&(value=value.initialValue),this.__rawValue=value,queueMicrotask((function(){_this.__ready=!0,_this.__flatpickr=window.flatpickr(_this.$refs.__input,_this.__config())})),this.$watch("__value",(function(newValue){_this.__rawValue=newValue,_this.__flatpickr.setDate(newValue),_this.$dispatch("input",newValue)})),this.$watch("__isDisabled",(function(newValue){newValue?_this.__flatpickr.set("clickOpens",!1):_this.__flatpickr.set("clickOpens",config.options.clickOpens)}))},__open:function(){!this.__isDisabled&&this.__flatpickr.open()},__clear:function(){this.__isDisabled||(this.__value="single"===this.__mode?null:[])},__config:function(){var _config$config,onOpen=[function(selectedDates,dateStr,instance){instance.setDate(this.__rawValue)}.bind(this)],customConfig=null!==(_config$config=config.config)&&void 0!==_config$config?_config$config:{};if(customConfig.hasOwnProperty("onOpen")){var customOnOpen=Array.isArray(customConfig.onOpen)?customConfig.onOpen:[customConfig.onOpen];onOpen=onOpen.concat(customOnOpen),delete customConfig.onOpen}return _objectSpread2(_objectSpread2({defaultDate:this.__rawValue},config.options),{},{onOpen:onOpen,onChange:function(date,dateString){var newValue=dateString;"multiple"===this.__mode?newValue=dateString.split(", "):"range"===this.__mode&&(newValue=dateString.split(" to ")),this.__value=newValue}.bind(this)},customConfig)}}})),Alpine.directive("date-picker",(function(el,directive,_ref2){var cleanup=_ref2.cleanup;switch(directive.value){case"clear":!function(el,Alpine){Alpine.bind(el,{"x-ref":"__clear","x-init":function(){"button"!==this.$el.tagName.toLowerCase()||this.$el.hasAttribute("type")||this.$el.setAttribute("type","button")},"@click":function(){this.$data.__clear()},"x-show":function(){return this.$datePicker.hasValue&&!this.$datePicker.isDisabled}})}(el,Alpine);break;case"container":!function(el,Alpine){Alpine.bind(el,{"x-ref":"__container",role:"none","x-init":function(){var _this3=this;new MutationObserver((function(mutations){mutations.forEach((function(mutation){if("aria-invalid"===mutation.attributeName)"true"===mutation.target.getAttribute("aria-invalid")?(_this3.$refs.__input.setAttribute("aria-invalid","true"),_this3.$refs.__input.classList.add("input-error")):(_this3.$refs.__input.removeAttribute("aria-invalid"),_this3.$refs.__input.classList.remove("input-error"));else if("aria-describedby"===mutation.attributeName){var describedBy=mutation.target.getAttribute("aria-describedby");describedBy?_this3.$refs.__input.setAttribute("aria-describedby",describedBy):_this3.$refs.__input.removeAttribute("aria-describedby")}}))})).observe(this.$el,{attributes:!0})}})}(el,Alpine);break;case"input":!function(el,Alpine){Alpine.bind(el,{"x-ref":"__input",type:"text","x-init":function(){var _this2=this;this.$data.__isDisabled=this.$el.disabled||this.$el.readOnly,queueMicrotask((function(){new MutationObserver((function(mutations){mutations.forEach((function(mutation){"disabled"!==mutation.attributeName&&"readonly"!==mutation.attributeName||(_this2.$data.__isDisabled=_this2.$el.disabled||_this2.$el.readOnly)}))})).observe(_this2.$el,{attributes:!0})}))}})}(el,Alpine),cleanup((function(){var parent=el.closest("[x-data]");parent&&Alpine.$data(parent).__flatpickr.destroy()}));break;case"toggle":!function(el,Alpine){Alpine.bind(el,{"x-ref":"__toggle",":role":function(){return!this.$datePicker.isDisabled&&("button"!==this.$el.tagName.toLowerCase()&&"button")},"@click":function(){this.$datePicker.open()}})}(el,Alpine);break;default:throw new Error("Unknown date-picker directive value: ".concat(directive.value))}})),Alpine.magic("datePicker",(function(el){var data=Alpine.$data(el);return data.__ready?{get isDisabled(){return data.__isDisabled},get flatpickr(){return data.__flatpickr},get hasValue(){return"single"===data.__mode?null!==data.__value&&""!==data.__value:Array.isArray(data.__value)&&data.__value.length>0},open:function(){data.__open()}}:{isDisabled:!1,flatpickr:void 0,hasValue:!1,open:function(){}}}))}var switchToggle=function(options){return _objectSpread2(_objectSpread2({value:!1,onValue:!0,offValue:!1},options),{},{get isPressed(){return Array.isArray(this.value)?this.value.includes(this.onValue):this.value===this.onValue},toggle:function(){Array.isArray(this.value)?this.isPressed?this.value.splice(this.value.indexOf(this.onValue),1):this.value.push(this.onValue):this.value=this.isPressed?this.offValue:this.onValue,this.$dispatch("input",this.value)}})},generateContext=function(_ref){var multiple=_ref.multiple,orientation=_ref.orientation,__wire=_ref.__wire,__wireSearch=_ref.__wireSearch,__config=_ref.__config,Alpine=_ref.Alpine;return _objectSpread2(_objectSpread2({},selectContext(Alpine)),{},{__multiple:multiple,__orientation:orientation,__wire:__wire,__wireSearch:__wireSearch,__config:__config,expandableEls:{},expandedKeys:[],__itemBooted:function(el,value,disabled,key){var _this=this;queueMicrotask((function(){var _el$__children;null!==(_el$__children=el.__children)&&void 0!==_el$__children&&_el$__children.length&&(_this.expandableEls[key]=el)}))},__itemDestroyed:function(el,key){this.expandableEls[key]&&delete this.expandableEls[key],this.expandedKeys.includes(key)&&this.expandedKeys.splice(this.expandedKeys.indexOf(key),1)},isExpandedEl:function(el){var key=keyByValue(this.elsByKey,el);if(key)return this.expandedKeys.includes(key)},toggleExpandedEl:function(el){var key=keyByValue(this.elsByKey,el);key&&this.toggleExpanded(key)},toggleExpanded:function(key){this.expandedKeys.includes(key)?this.expandedKeys.splice(this.expandedKeys.indexOf(key),1):this.expandedKeys.push(key)},expandChildren:function(key){this.expandedKeys.includes(key)||this.expandedKeys.push(key)},collapseChildren:function(key){this.expandedKeys.includes(key)&&this.expandedKeys.splice(this.expandedKeys.indexOf(key),1)},__activateByKeyEvent:function(e){if(this.hasActive())switch(e.key){case["ArrowRight","ArrowDown"]["vertical"===this.__orientation?0:1]:return e.preventDefault(),e.stopPropagation(),this.expandableEls[this.activeKey]&&this.expandChildren(this.activeKey),!1;case["ArrowLeft","ArrowUp"]["vertical"===this.__orientation?0:1]:return e.preventDefault(),e.stopPropagation(),this.expandableEls[this.activeKey]&&this.collapseChildren(this.activeKey),!1}},get isScrollingTo(){return this.scrollingCount>0},get nonDisabledOrderedKeys(){var _this2=this;return this.orderedKeys.filter((function(i){return!_this2.isDisabled(i)}))}})};function treeSelect(Alpine){Alpine.data("treeSelect",(function(config){return _objectSpread2(_objectSpread2(_objectSpread2({},selectPopper),selectData(config.__el,Alpine,config)),{},{__type:"tree",__generateContext:function(el,Alpine,config){var _config$__config;return generateContext({multiple:this.__isMultiple,orientation:this.__orientation,__wire:config.__wire,__wireSearch:Alpine.bound(el,"livewire-search"),__config:null!==(_config$__config=config.__config)&&void 0!==_config$__config?_config$__config:{},Alpine:Alpine})}})})),Alpine.directive("tree-select",(function(el,directive,_ref){var cleanup=_ref.cleanup;switch(directive.value){case"button":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},{"x-ref":"__button",":id":function(){return this.$id("fc-".concat(this.__type,"-select-button"))},"aria-haspopup":"true","data-custom-select-button":"true",":aria-labelledby":function(){return this.$data.__hasCustomSelectLabel?this.$id("fc-".concat(this.__type,"-select-label")):this.$id("fc-label")},":aria-expanded":function(){return this.$data.__isOpen},":aria-controls":function(){return this.$data.__isOpen&&this.$id("fc-".concat(this.__type,"-select-options"))},":tabindex":function(){return this.$data.__isDisabled?"-1":"0"},"x-init":function(){"button"!==this.$el.tagName.toLowerCase()||this.$el.hasAttribute("type")||(this.$el.type="button"),"button"!==this.$el.tagName.toLowerCase()&&this.$el.setAttribute("role","button")},"@click":function(){this.$data.__open()},"@focus":function(){this.$data.__isDisabled&&this.$el.blur()},"@keydown":function(e){["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(e.key)&&(e.stopPropagation(),e.preventDefault(),this.$data.__open());var $magic="tree"===this.__type?this.$treeSelect:this.$customSelect;if("Backspace"===e.key){if(e.stopPropagation(),e.preventDefault(),this.$data.__isDisabled)return;var lastSelected=this.$data.__isMultiple?$magic.selectedObject[$magic.selectedObject.length-1]:$magic.selectedObject;lastSelected&&this.$data.__context.toggleValue(lastSelected,this.$data.__compareBy)}},"@keydown.space.stop.prevent":function(){this.$data.__open()},"@keydown.enter.stop.prevent":function(){this.$data.__open()}}))}(el,Alpine);break;case"label":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},{"x-ref":"__label",":id":function(){return this.$id("fc-".concat(this.__type,"-custom-select-label"))},"x-init":function(){this.$data.__hasCustomSelectLabel=!0},"@click":function(){this.$refs.__button.focus({preventScroll:!0})}}))}(el,Alpine);break;case"clear":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},clearButtonDirective(0,0,"tree")))}(el,Alpine);break;case"options":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},optionsDirective(0,Alpine)))}(el,Alpine);break;case"option":!function(el,Alpine){Alpine.bind(el,_objectSpread2(_objectSpread2({},optionDirective(el,Alpine,"tree")),{},{"data-tree-select-option":"true",":role":function(){return"option"},"x-init":function(){var _this=this,initCallback=function(){var value=Alpine.bound(el,"value"),disabled=Alpine.bound(el,"disabled");el.__level=Alpine.bound(el,"level",0),el.__optionKey=_this.$data.__context.initItem(el,value,disabled);var childrenField=_this.$data.__config.childrenField;null!=value&&value.hasOwnProperty(childrenField)&&(el.__children=value[childrenField])};this.$data.__ready?initCallback():queueMicrotask(initCallback)}}))}(el,Alpine),cleanup((function(){var parent=el.closest("[x-data]");parent&&Alpine.$data(parent).__context.destroyItem(el)}));break;case"search":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},{"x-ref":"__search",":id":function(){return this.$id("fc-".concat(this.__type,"-select-search"))},"x-init":function(){var _this5=this,searchableQuery=this.$data.__context.searchableQuery;this.$el.value=searchableQuery,this.$data.__ready&&this.$data.__isOpen&&searchableQuery.length&&this.$nextTick((function(){if(_this5.$el.createTextRange){var range=_this5.$el.createTextRange();range.move("character",searchableQuery.length),range.select()}else _this5.$el.focus(),_this5.$el.setSelectionRange&&_this5.$el.setSelectionRange(searchableQuery.length,searchableQuery.length)}))},"@keyup.debounce.250ms":function(e){["Enter","ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Home","PageUp","End","PageDown","Tab","Meta"].includes(e.key)||this.$data.__context.handleSearchableQuery(e.target.value)},"@keydown.space.stop":function(){},"@keydown.tab.prevent.stop":function(){this.$refs.__options.focus()}}))}(el,Alpine);break;case"token":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},tokenDirective(el)))}(el,Alpine);break;case"child-toggle":!function(el,Alpine){Alpine.bind(el,{"x-init":function(){"button"!==el.tagName.toLowerCase()&&el.setAttribute("role","button")},"@click.stop.prevent":function(){var optionEl=Alpine.findClosest(el,(function(i){return i.__optionKey}));optionEl&&this.$data.__context.toggleExpandedEl(optionEl)}})}(el,Alpine);break;case"children":!function(el,Alpine){Alpine.bind(el,{"data-tree-select-children":"true","x-data":function(){return{__optionEl:void 0,init:function(){try{this.__optionEl=el.parentNode.querySelector('[data-tree-select-option="true"]')}catch(e){}},get __isExpanded(){return this.__optionEl&&this.$data.__context.isExpandedEl(this.__optionEl)}}},"x-show":function(){return this.$data.__isExpanded}})}(el,Alpine);break;default:throw new Error("Unknown tree-select directive: ".concat(directive.value))}})),Alpine.magic("treeSelect",(function(el){return rootMagic(el,Alpine,(function(data){return{get hasExpandableOptions(){return Object.keys(data.__context.expandableEls).length>0}}}))})),Alpine.magic("treeSelectOption",(function(el){return optionMagic(el,Alpine,(function(data,context,optionEl){return{get hasChildren(){return optionEl.__children&&optionEl.__children.length>0},get isExpanded(){return context.isExpandedEl(optionEl)}}}),(function(){return{hasChildren:!1}}))}))}document.addEventListener("alpine:init",(function(){customSelect(Alpine),datePicker(Alpine),function(Alpine){Alpine.data("filepond",(function(_ref){var __value=_ref.__value,__this=_ref.__this,__wireModel=_ref.__wireModel,options=_ref.options,__config=_ref.__config,id=_ref.id;return{__ready:!1,__pond:null,__processingFiles:!1,__value:__value,init:function(){var _window$FilePond,_this=this;if("function"!=typeof(null===(_window$FilePond=window.FilePond)||void 0===_window$FilePond?void 0:_window$FilePond.create))throw new Error("filepond requires FilePond to be loaded. See https://pqina.nl/filepond/docs/getting-started/installation/javascript/");queueMicrotask((function(){_this.__ready=!0;var pondOptions=_objectSpread2({},options);__this&&__wireModel&&(pondOptions.server={process:function(fieldName,file,metadata,load,error,progress,abort,transfer,options){__this.upload(__wireModel,file,load,error,progress)},revert:function(filename,load){__this.removeUpload(__wireModel,filename,load)}},pondOptions.onaddfilestart=function(){return _this.__processingFiles=!0},pondOptions.onprocessfiles=function(){return _this.__processingFiles=!1}),__this&&__this.on("file-pond-clear",(function(desiredId){return _this.__clear(desiredId)})),pondOptions=_objectSpread2(_objectSpread2({},pondOptions),__config(_this,options,pondOptions)),_this.__pond=window.FilePond.create(_this.$refs.input,pondOptions)})),this.$watch("__value",(function(newValue){if(_this.__ready)if(options.allowMultiple){if(_this.__processingFiles)return;if(!newValue)return _this.__clear();var serverIds=Array.isArray(newValue)?newValue:JSON.parse(String(newValue).split("livewire-files:")[1]);_this.__pond.getFiles().forEach((function(f){serverIds.includes(f.serverId)||_this.__pond.removeFile(f.id)}))}else newValue||_this.__clear()}))},__clear:function(eventId){var instance;eventId&&eventId!==id||(instance=this.__pond,options.allowMultiple?instance.getFiles().forEach((function(file){return instance.removeFile(file.id)})):instance.removeFile())}}}))}(Alpine),function(Alpine){Alpine.data("quill",(function(_ref){var __value=_ref.__value,options=_ref.options,__config=_ref.__config,onTextChange=_ref.onTextChange,onInit=_ref.onInit;return{__ready:!1,__value:__value,__quill:void 0,init:function(){var _this=this;if("function"!=typeof window.Quill)throw new Error("quill requires Quill to be loaded. See https://quilljs.com/docs/installation/");queueMicrotask((function(){_this.__ready=!0,_this.__quill=new window.Quill(_this.$refs.quill,_this.__quillOptions()),_this.__quill.root.innerHTML=_this.__value,_this.__quill.on("text-change",(function(){"function"==typeof onTextChange&&!1===onTextChange(_this)||(_this.__value=_this.__quill.root.innerHTML,_this.$dispatch("input",_this.__value))})),options.autofocus&&_this.$nextTick((function(){_this.focus()})),"function"==typeof onInit&&onInit(_this)}))},focus:function(){this.__ready&&this.__quill.focus()},__quillOptions:function(){var config=__config(this,options),toolbarHandlers={},modules={};return config.hasOwnProperty("toolbarHandlers")&&(toolbarHandlers=config.toolbarHandlers,delete config.toolbarHandlers),config.hasOwnProperty("modules")&&(modules=config.modules,delete config.modules),_objectSpread2({theme:options.theme,readOnly:options.readOnly,placeholder:options.placeholder,modules:_objectSpread2({toolbar:{container:options.toolbar,handlers:toolbarHandlers}},modules)},config)}}}))}(Alpine),treeSelect(Alpine),Alpine.data("switchToggle",switchToggle)}));var resize=function(el){el.style.height="auto",el.style.height="".concat(el.scrollHeight,"px")},textareaResize=function(Alpine){Alpine.directive("textarea-resize",(function(el,_ref,_ref2){!function(obj){if(null==obj)throw new TypeError("Cannot destructure "+obj)}(_ref);var cleanup=_ref2.cleanup;el.style.minHeight="".concat(el.scrollHeight,"px"),resize(el);var inputHandler=function(){return resize(el)};el.addEventListener("input",inputHandler),cleanup((function(){el.removeEventListener("input",inputHandler)}))}))};document.addEventListener("alpine:init",(function(){!function(Alpine){Alpine.directive("form-group",(function(el,directive){"label"===directive.value?function(el,Alpine){Alpine.bind(el,{"@click":function(){var group=el.closest("[x-form-group]");if(group){var customSelectButton=group.querySelector('[data-custom-select-button="true"]');if(customSelectButton)customSelectButton.focus({preventScroll:!0});else{var quill=group.querySelector(".quill-wrapper");quill&&Alpine.$data(quill).focus()}}}})}(el,Alpine):function(el,Alpine){Alpine.bind(el,{"x-id":function(){return["fc-label"]}})}(el,Alpine)}))}(Alpine),Alpine.plugin(textareaResize)}))})); +!function(factory){"function"==typeof define&&define.amd?define(factory):factory()}((function(){"use strict";function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread2(target){for(var i=1;iarr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i3&&void 0!==arguments[3]&&arguments[3],key=(Math.random()+1).toString(36).substring(7),keyFromValue=this.getKeyFromValue(value,this.__config.by);return keyFromValue&&(key=keyFromValue),isOptGroup||(this.values[key]=value,this.elsByKey[key]=el,this.orderedKeys.push(key),this.searchableText[key]=el.textContent.trim().toLowerCase(),disabled&&this.disabledKeys.push(key),this.__itemBooted(el,value,disabled,key)),key},__itemBooted:function(el,value,disabled,key){},destroyItem:function(el){var key=keyByValue(this.elsByKey,el);this.selectedKeys.includes(key)||delete this.values[key],delete this.elsByKey[key],delete this.orderedKeys[this.orderedKeys.indexOf(key)],delete this.searchableText[key],delete this.disabledKeys[key],this.reorderKeys(),this.__itemDestroyed(el,key)},__itemDestroyed:function(el,key){},resetOptions:function(){this.activeKey=null,this.reorderKeys()},reorderKeys:function(){var _this=this;this.orderedKeys.forEach((function(key){var el=_this.elsByKey[key];null!=el&&el.isConnected||_this.destroyItem(el)})),this.orderedKeys=this.orderedKeys.slice().sort((function(a,z){if(null===a||null===z)return 0;var aEl=_this.elsByKey[a],zEl=_this.elsByKey[z],position=aEl.compareDocumentPosition(zEl);return position&Node.DOCUMENT_POSITION_FOLLOWING?-1:position&Node.DOCUMENT_POSITION_PRECEDING?1:0}))},activeEl:function(){if(this.activeKey)return this.elsByKey[this.activeKey]},isActiveEl:function(el){var key=keyByValue(this.elsByKey,el);if(key)return this.activeKey===key},activateEl:function(el){var key=keyByValue(this.elsByKey,el);key&&this.activateKey(key)},selectEl:function(el){var key=keyByValue(this.elsByKey,el);key&&this.selectKey(key)},isSelectedEl:function(el){var key=keyByValue(this.elsByKey,el);if(key)return this.isSelected(key)},isDisabledEl:function(el){var key=keyByValue(this.elsByKey,el);if(key)return this.isDisabled(key)},hideEl:function(el){el.style.display="none",el.setAttribute("data-hidden","true")},showEl:function(el){el.style.display="",el.removeAttribute("data-hidden")},isHiddenEl:function(el){return"none"===el.style.display||!el.offsetParent},scrollingCount:0,activateAndScrollToKey:function(key){var _this2=this;this.scrollingCount++,this.activateKey(key);var targetEl=this.elsByKey[key];targetEl&&targetEl.scrollIntoView({block:"nearest"}),setTimeout((function(){_this2.scrollingCount--}),25)},selectedBasicValueOrValues:function(by){return this.__multiple?this.selectedBasicValues(by):this.selectedBasicValue(by)},selectedBasicValues:function(by){var _this3=this;return this.selectedKeys.map((function(i){var value=_this3.values[i];return null!=value&&value.hasOwnProperty(by)?value[by]:value}))},selectedBasicValue:function(by){var value=this.selectedKeys[0]?this.values[this.selectedKeys[0]]:null;return null!=value&&value.hasOwnProperty(by)?value[by]:value},selectedValueOrValues:function(){return this.__multiple?this.selectedValues():this.selectedValue()},selectedValues:function(){var _this4=this;return this.selectedKeys.map((function(i){return _this4.values[i]}))},selectedValue:function(){return this.selectedKeys[0]?this.values[this.selectedKeys[0]]:null},selectValue:function(value,by){var _this5=this;if(value=normalizeValue(value,this.__multiple),by=mapByToCallback(by),this.__multiple){var keys=[];return value.forEach((function(i){for(var key in _this5.values)by(_this5.values[key],i)&&(keys.includes(key)||keys.push(key))})),void this.selectExclusive(keys)}for(var key in this.values)value&&by(this.values[key],value)&&this.selectKey(key);null===value&&(this.selectedKeys=[])},getKeyFromValue:function(value,by){if(value)for(var key in by=mapByToCallback(by),this.values)if(by(this.values[key],value))return key},getKeyFromSimpleValue:function(value,by){if(value)for(var key in by=mapByToSimpleCompareCallback(by),this.values)if(by(this.values[key],value))return key},getObjectFromValue:function(value,by){if(value)for(var key in by=mapByToSimpleCompareCallback(by),this.values)if(by(this.values[key],value))return this.values[key]},toggleValue:function(value,by){if(value&&(by=mapByToCallback(by),this.__multiple))for(var key in this.values)if(by(this.values[key],value)){this.toggleSelected(key);break}},isDisabled:function(key){return this.disabledKeys.includes(key)},selectKey:function(key){this.isDisabled(key)||(this.__multiple?this.toggleSelected(key):this.selectOnly(key))},toggleSelected:function(key){if(this.selectedKeys.includes(key)){if(!this.canRemoveOptions())return;this.selectedKeys.splice(this.selectedKeys.indexOf(key),1)}else this.selectedKeys.push(key)},selectOnly:function(key){this.selectedKeys=[],this.selectedKeys.push(key)},selectExclusive:function(keys){for(var _this6=this,toAdd=_toConsumableArray(keys),i=0;i=0&&!visibleKeyFound;)targetKey=this.nonDisabledOrderedKeys[currentIndex],visibleKeyFound=!this.isHiddenEl(this.elsByKey[targetKey]),currentIndex--;return visibleKeyFound||(targetKey=null),targetKey},searchQuery:"",clearSearch:Alpine.debounce((function(){this.searchQuery=""}),350),searchKey:function(query){var foundKey;for(var key in this.clearSearch(),this.searchQuery+=query,this.searchableText){if(this.searchableText[key].startsWith(this.searchQuery)){foundKey=key;break}}if(this.nonDisabledOrderedKeys.includes(foundKey))return foundKey},searchableQuery:"",handleSearchableQuery:function(query){if(query!==this.searchableQuery)if(this.searchableQuery=query,this.__wire&&this.__wireSearch)this.__wire[this.__wireSearch](this.searchableQuery);else for(var key in this.searchableText){var content=this.searchableText[key],el=this.elsByKey[key];!this.searchableQuery||content.toLowerCase().includes(this.searchableQuery.toLowerCase())?this.showEl(el):this.hideEl(el)}},canRemoveOptions:function(){if(!this.__multiple&&1===this.selectedKeys.length)return this.__config.optional;var minSelected=this.__config.minSelected;return!!(Number.isNaN(minSelected)||minSelected<1)||this.selectedKeys.length>minSelected},activateByKeyEvent:function(e){if(this.reorderKeys(),!1!==this.__activateByKeyEvent(e)){var targetKey,hasActive=this.hasActive();switch(e.key){case"Tab":case"Backspace":case"Delete":case"Meta":break;case["ArrowDown","ArrowRight"]["vertical"===this.__orientation?0:1]:e.preventDefault(),e.stopPropagation(),targetKey=hasActive?this.nextKey():this.firstKey();break;case["ArrowUp","ArrowLeft"]["vertical"===this.__orientation?0:1]:e.preventDefault(),e.stopPropagation(),targetKey=hasActive?this.prevKey():this.lastKey();break;case"Home":case"PageUp":e.preventDefault(),e.stopPropagation(),targetKey=this.firstKey();break;case"End":case"PageDown":e.preventDefault(),e.stopPropagation(),targetKey=this.lastKey();break;default:1===e.key.length&&(targetKey=this.searchKey(e.key))}targetKey&&this.activateAndScrollToKey(targetKey)}},__activateByKeyEvent:function(e){}}},keyByValue=function(object,value){return Object.keys(object).find((function(key){return object[key]===value}))},renderHiddenInputs=function(el,name,value){var newInputs=generateInputs(name,value);newInputs.forEach((function(i){return i._x_hiddenInput=!0})),newInputs.forEach((function(i){return i._x_ignore=!0}));for(var children=el.children,oldInputs=[],i=0;i2&&void 0!==arguments[2]?arguments[2]:[];if("object"===_typeof(subject=value)&&null!==subject)for(var key in value)carry=carry.concat(generateInputs("".concat(name,"[").concat(key,"]"),value[key]));else if(null!==value&&!1!==value){var el=document.createElement("input");return el.setAttribute("type","hidden"),el.setAttribute("name",name),el.setAttribute("value",""+value),[el]}return carry},generateContext$1=function(_ref){var multiple=_ref.multiple,orientation=_ref.orientation,__wire=_ref.__wire,__wireSearch=_ref.__wireSearch,__config=_ref.__config,Alpine=_ref.Alpine;return _objectSpread2(_objectSpread2({},selectContext(Alpine)),{},{__multiple:multiple,__orientation:orientation,__wire:__wire,__wireSearch:__wireSearch,__config:__config,get isScrollingTo(){return this.scrollingCount>0},get nonDisabledOrderedKeys(){var _this=this;return this.orderedKeys.filter((function(i){return!_this.isDisabled(i)}))}})},selectPopper={__createPopper:void 0,__popper:void 0,__resetPopper:function(){this.__popper&&(this.__popper.destroy(),this.__popper=null)},__popperConfig:function(){return{placement:"bottom-start",strategy:this.__fixed?"fixed":"absolute",modifiers:[{name:"offset",options:{offset:[0,10]}},{name:"preventOverflow",options:{boundariesElement:this.$root}}]}},__initPopper:function(){this.__resetPopper(),this.__popper=this.__createPopper(this.$root,this.$refs.__options,this.__popperConfig())}};function selectData(el,Alpine,config){var _config$__value;return{__ready:!1,__value:null!==(_config$__value=config.__value)&&void 0!==_config$__value&&_config$__value,__richValue:!1,__isOpen:!1,__context:void 0,__isMultiple:!1,__isStatic:!1,__isClearable:void 0,__isDisabled:!1,__compareBy:null,__inputName:void 0,__fixed:!1,__searchable:void 0,__hasCustomSelectLabel:!1,__orientation:"vertical",__externalChanged:!1,__config:config.__config,__wireSearch:void 0,__type:"custom",init:function(){var _this=this;if(this.__createPopper=window.Popper?window.Popper.createPopper:window.createPopper,"function"!=typeof this.__createPopper)throw new TypeError("".concat(this.__type,"-select requires Popper.js (https://popper.js.org)"));this.__isMultiple=Alpine.bound(el,"data-multiple",!1),this.__isDisabled=Alpine.bound(el,"disabled",!1)||Alpine.bound(el,"readonly",!1),this.__inputName=Alpine.bound(el,"name",null),this.__compareBy=Alpine.bound(el,"by"),this.__orientation=Alpine.bound(el,"horizontal")?"horizontal":"vertical",this.__searchable=Alpine.bound(el,"searchable",!1),this.__isClearable=Alpine.bound(el,"clearable",!1),this.__wireSearch=Alpine.bound(el,"livewire-search"),this.__fixed=Alpine.bound(el,"fixed",!1);var autoFocus=Alpine.bound(el,"autofocus");this.__context=this.__generateContext(el,Alpine,config);var defaultValue=Alpine.bound(el,"default-value",null);defaultValue&&!this.__value&&(this.__value=defaultValue),queueMicrotask((function(){_this.__ready=!0,queueMicrotask((function(){var lastValueFingerprint=!1;Alpine.effect((function(){if(_this.__context.selectedKeys,!1===lastValueFingerprint||lastValueFingerprint!==JSON.stringify(_this.__value))if(_this.__externalChanged=!0,_this.__isMultiple){_this.__context.clearSelected();var _step,keys=[],_iterator=function(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function(){};return{s:F,n:function(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function(e){throw e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function(){it=it.call(o)},n:function(){var step=it.next();return normalCompletion=step.done,step},e:function(e){didErr=!0,err=e},f:function(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}(_this.__value);try{for(_iterator.s();!(_step=_iterator.n()).done;){var value=_step.value,object=_this.__context.getObjectFromValue(value,_this.__compareBy);object&&keys.push(object)}}catch(err){_iterator.e(err)}finally{_iterator.f()}_this.__context.selectValue(keys,_this.__compareBy),_this.__richValue=_this.__context.selectedValueOrValues()}else{if("object"===_typeof(_this.__value)||Array.isArray(_this.__value)||null===_this.__value)_this.__context.selectValue(_this.__value,_this.__compareBy);else{var key=_this.__context.getKeyFromSimpleValue(_this.__value,_this.__compareBy);key&&_this.__context.selectKey(key)}_this.__richValue=_this.__context.selectedValueOrValues()}else _this.__value=_this.__context.selectedBasicValueOrValues(_this.__compareBy),_this.__richValue=_this.__context.selectedValueOrValues();lastValueFingerprint=JSON.stringify(_this.__value),_this.__inputName&&renderHiddenInputs(_this.$el,_this.__inputName,_this.__value)})),_this.__searchable&&Alpine.effect((function(){var query=_this.__context.searchableQuery;_this.$refs.__options&&_this.$refs.__options.querySelectorAll('[role="presentation"]:not([data-placeholder="true"])').forEach((function(el){query?_this.__context.hideEl(el):_this.__context.showEl(el)}))})),autoFocus&&_this.$refs.__button&&_this.$refs.__button.focus({preventScroll:!0})}))})),this.$watch("__value",(function(newValue){_this.$dispatch("input",newValue)})),this.__componentBooted(el,Alpine,config)},__open:function(){var _this2=this;if(!this.__isDisabled){this.__isOpen=!0,this.__context.activateSelectedOrFirst();var callback;callback=function(){_this2.__searchable&&_this2.$refs.__search?_this2.$refs.__search.focus({preventScroll:!0}):_this2.$refs.__options.focus({preventScroll:!0}),_this2.__initPopper()},requestAnimationFrame((function(){return requestAnimationFrame(callback)}))}},__close:function(){var _this3=this;this.__isOpen=!1,this.__resetPopper(),this.$nextTick((function(){return _this3.$refs.__button.focus({preventScroll:!0})}))},__generateContext:function(el,Alpine,config){},__componentBooted:function(el,Alpine,config){}}}function clearButtonDirective(el,Alpine,type){var magic="tree"===type?"$treeSelect":"$customSelect";return{":tabindex":function(){return!(this.$data.__isDisabled||!this[magic].hasValue)&&"0"},"x-show":function(){return this[magic].shouldShowClear},"x-init":function(){"button"!==this.$el.tagName.toLowerCase()||this.$el.hasAttribute("type")||(this.$el.type="button"),"button"!==this.$el.tagName.toLowerCase&&this.$el.setAttribute("role","button")},"@click.stop.prevent":function(){this.$data.__isDisabled||(this.$data.__context.clearSelected(),this.$data.__close(),this.$data.__value=this.$data.__isMultiple?[]:null)},"@keydown.space.stop.prevent":function(){this.$data.__isDisabled||(this.$data.__context.clearSelected(),this.$data.__close(),this.$data.__value=this.$data.__isMultiple?[]:null)}}}function optionsDirective(el,Alpine){return{"x-ref":"__options",":id":function(){return this.$id("fc-".concat(this.__type,"-select-options"))},"x-init":function(){this.$data.__isStatic=Alpine.bound(this.$el,"static",!1)},"x-show":function(){return!!this.$data.__isStatic||this.$data.__isOpen},"@click.outside":function(){this.$data.__close()},"@keydown.escape.stop.prevent":function(){this.$data.__close()},tabindex:"0",role:"listbox",":aria-orientation":function(){return this.$data.__orientation},":aria-labelledby":function(){return this.$id("fc-".concat(this.__type,"-select-button"))},":aria-activedescendant":function(){return this.$data.__context.activeEl()&&this.$data.__context.activeEl().id},":aria-multiselectable":function(){return this.$data.__isMultiple?"true":"false"},"@focus":function(){this.$data.__context.activateSelectedOrFirst()},"x-trap":function(){return this.$data.__isOpen},"@keydown":function(e){this.$data.__context.activateByKeyEvent(e)},"@keydown.enter.stop.prevent":function(){this.$data.__context.selectActive(),this.$data.__isMultiple||this.$data.__close()},"@keydown.space.stop.prevent":function(){this.$data.__context.selectActive(),this.$data.__isMultiple||this.$data.__close()}}}function optionDirective(el,Alpine,type){var rootMagic="tree"===type?"$treeSelect":"$customSelect",magic="tree"===type?"$treeSelectOption":"$customSelectOption";return{":id":function(){return this.$id("fc-".concat(this.__type,"-select-option"))},":tabindex":function(){return!this.$data.__isDisabled&&"-1"},":role":function(){return this[magic].isOptGroup?"presentation":"option"},"x-init":function(){var _this4=this,initCallback=function(){var value=Alpine.bound(el,"value"),disabled=Alpine.bound(el,"disabled"),isOptGroup=Alpine.bound(el,"is-opt-group");el.__optionKey=_this4.$data.__context.initItem(el,value,disabled,isOptGroup)};this.$data.__ready?initCallback():queueMicrotask(initCallback)},":aria-selected":function(){return this[magic].isSelected},":aria-disabled":function(){return this[magic].isDisabled},"@click":function(){this.$data.__isDisabled||this[magic].isDisabled||(this[magic].isSelected||this[rootMagic].canSelectMore)&&(this.$data.__context.selectEl(el),this.$data.__isMultiple||this.$data.__close())},"@mousemove":function(){this.$data.__context.activateEl(el)},"@mouseleave":function(){this.$data.__context.deactivate()}}}function tokenDirective(el,Alpine){return{":tabindex":function(){return!this.$data.__isDisabled&&"0"},":role":function(){return"button"!==this.$el.tagName.toLowerCase()&&!this.$data.__isDisabled&&"button"},"x-init":function(){var _this6=this,initCallback=function(){el.__key=_this6.$data.__context.getKeyFromValue(el.value)};this.$data.__ready?initCallback():queueMicrotask(initCallback)},"@click.stop.prevent":function(){!this.$data.__isDisabled&&el.__key&&this.$data.__context.toggleSelected(el.__key)},"@keydown.space.stop.prevent":function(){!this.$data.__isDisabled&&el.__key&&this.$data.__context.toggleSelected(el.__key)}}}var rootMagic=function(el,Alpine,callback,stubCallback){var data=Alpine.$data(el);return"function"!=typeof stubCallback&&(stubCallback=function(){return{}}),"function"!=typeof callback&&(callback=function(){return{}}),data.__ready?_objectSpread2({get isOpen(){return data.__isOpen},get isDisabled(){return data.__isDisabled},get isSearchable(){return data.__searchable},get selected(){return data.__value},get active(){return data.__context.active},get selectedObject(){return data.__richValue},get hasValue(){return data.__isMultiple?data.__value&&data.__value.length>0:!!data.__value},get shouldShowClear(){return!data.__isDisabled&&(!1!==data.__config.optional&&(!(data.__isMultiple&&!Number.isNaN(data.__config.minSelected)&&data.__config.minSelected>0)&&(data.__isClearable&&this.hasValue)))},get canSelectMore(){return!data.__isMultiple||(!!(Number.isNaN(data.__config.maxSelected)||data.__config.maxSelected<1)||data.__config.maxSelected>data.__value.length)},get canDeselectOptions(){return!data.__isDisabled&&data.__context.canRemoveOptions()},get hasOptions(){return data.__context.searchableQuery,data.$refs.__options&&data.$refs.__options.querySelectorAll('[role="option"]:not([data-hidden])').length>0},get hasSearch(){return!!data.__context.searchableQuery}},callback(data)):_objectSpread2({isDisabled:!1,isOpen:!1,selected:null,active:null,selectedObject:null},stubCallback(data))},optionMagic=function(el,Alpine,callback,stubCallback){"function"!=typeof stubCallback&&(stubCallback=function(){return{}}),"function"!=typeof callback&&(callback=function(){return{}});var data=Alpine.$data(el),stub=_objectSpread2({isDisabled:!1,isSelected:!1,isActive:!1},stubCallback(data));if(!data.__ready)return stub;var optionEl=Alpine.findClosest(el,(function(i){return i.__optionKey}));if(!optionEl)return stub;var context=data.__context;return _objectSpread2({get isActive(){return context.isActiveEl(optionEl)},get isSelected(){return context.isSelectedEl(optionEl)},get isDisabled(){return context.isDisabledEl(optionEl)}},callback(data,context,optionEl))};function customSelect(Alpine){Alpine.data("customSelect",(function(config){return _objectSpread2(_objectSpread2(_objectSpread2({},selectPopper),selectData(config.__el,Alpine,config)),{},{__generateContext:function(el,Alpine,config){var _config$__config;return generateContext$1({multiple:this.__isMultiple,orientation:this.__orientation,__wire:config.__wire,__wireSearch:Alpine.bound(el,"livewire-search"),__config:null!==(_config$__config=config.__config)&&void 0!==_config$__config?_config$__config:{},Alpine:Alpine})}})})),Alpine.directive("custom-select",(function(el,directive,_ref){var cleanup=_ref.cleanup;switch(directive.value){case"button":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},{"x-ref":"__button",":id":function(){return this.$id("fc-".concat(this.__type,"-select-button"))},"aria-haspopup":"true","data-custom-select-button":"true",":aria-labelledby":function(){return this.$data.__hasCustomSelectLabel?this.$id("fc-".concat(this.__type,"-select-label")):this.$id("fc-label")},":aria-expanded":function(){return this.$data.__isOpen},":aria-controls":function(){return this.$data.__isOpen&&this.$id("fc-".concat(this.__type,"-select-options"))},":tabindex":function(){return this.$data.__isDisabled?"-1":"0"},"x-init":function(){"button"!==this.$el.tagName.toLowerCase()||this.$el.hasAttribute("type")||(this.$el.type="button"),"button"!==this.$el.tagName.toLowerCase()&&this.$el.setAttribute("role","button")},"@click":function(){this.$data.__open()},"@focus":function(){this.$data.__isDisabled&&this.$el.blur()},"@keydown":function(e){["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(e.key)&&(e.stopPropagation(),e.preventDefault(),this.$data.__open());var $magic="tree"===this.__type?this.$treeSelect:this.$customSelect;if("Backspace"===e.key){if(e.stopPropagation(),e.preventDefault(),this.$data.__isDisabled)return;var lastSelected=this.$data.__isMultiple?$magic.selectedObject[$magic.selectedObject.length-1]:$magic.selectedObject;lastSelected&&this.$data.__context.toggleValue(lastSelected,this.$data.__compareBy)}},"@keydown.space.stop.prevent":function(){this.$data.__open()},"@keydown.enter.stop.prevent":function(){this.$data.__open()}}))}(el,Alpine);break;case"label":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},{"x-ref":"__label",":id":function(){return this.$id("fc-".concat(this.__type,"-custom-select-label"))},"x-init":function(){this.$data.__hasCustomSelectLabel=!0},"@click":function(){this.$refs.__button.focus({preventScroll:!0})}}))}(el,Alpine);break;case"clear":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},clearButtonDirective(0,0,"custom")))}(el,Alpine);break;case"options":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},optionsDirective(0,Alpine)))}(el,Alpine);break;case"option":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},optionDirective(el,Alpine,"custom")))}(el,Alpine),cleanup((function(){var parent=el.closest("[x-data]");parent&&Alpine.$data(parent).__context.destroyItem(el)}));break;case"search":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},{"x-ref":"__search",":id":function(){return this.$id("fc-".concat(this.__type,"-select-search"))},"x-init":function(){var _this5=this,searchableQuery=this.$data.__context.searchableQuery;this.$el.value=searchableQuery,this.$data.__ready&&this.$data.__isOpen&&searchableQuery.length&&this.$nextTick((function(){if(_this5.$el.createTextRange){var range=_this5.$el.createTextRange();range.move("character",searchableQuery.length),range.select()}else _this5.$el.focus(),_this5.$el.setSelectionRange&&_this5.$el.setSelectionRange(searchableQuery.length,searchableQuery.length)}))},"@keyup.debounce.250ms":function(e){["Enter","ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Home","PageUp","End","PageDown","Tab","Meta"].includes(e.key)||this.$data.__context.handleSearchableQuery(e.target.value)},"@keydown.space.stop":function(){},"@keydown.tab.prevent.stop":function(){this.$refs.__options.focus()}}))}(el,Alpine);break;case"token":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},tokenDirective(el)))}(el,Alpine);break;default:throw new Error("Unknown custom-select directive value: ".concat(directive.value))}})),Alpine.magic("customSelect",(function(el){return rootMagic(el,Alpine)})),Alpine.magic("customSelectOption",(function(el){return optionMagic(el,Alpine,(function(data,context,optionEl){return{get isOptGroup(){return Alpine.bound(optionEl,"is-opt-group")}}}),(function(){return{isOptGroup:!1}}))}))}function datePicker(Alpine){Alpine.data("datePicker",(function(config){var _ref,_config$mode;return{__ready:!1,__value:config.value,__rawValue:null,__mode:null!==(_ref=null!==(_config$mode=config.mode)&&void 0!==_config$mode?_config$mode:config.options.mode)&&void 0!==_ref?_ref:"single",__isDisabled:!1,__flatpickr:void 0,init:function(){var _value,_this=this;if("function"!=typeof window.flatpickr)throw new Error("date-picker requires Flatpickr. See https://flatpickr.js.org");var value=this.__value;null!==(_value=value)&&void 0!==_value&&_value.hasOwnProperty("initialValue")&&(value=value.initialValue),this.__rawValue=value,queueMicrotask((function(){_this.__ready=!0,_this.__flatpickr=window.flatpickr(_this.$refs.__input,_this.__config())})),this.$watch("__value",(function(newValue){_this.__rawValue=newValue,_this.__flatpickr.setDate(newValue),_this.$dispatch("input",newValue)})),this.$watch("__isDisabled",(function(newValue){newValue?_this.__flatpickr.set("clickOpens",!1):_this.__flatpickr.set("clickOpens",config.options.clickOpens)}))},__open:function(){!this.__isDisabled&&this.__flatpickr.open()},__clear:function(){this.__isDisabled||(this.__value="single"===this.__mode?null:[])},__config:function(){var _config$config,onOpen=[function(selectedDates,dateStr,instance){instance.setDate(this.__rawValue)}.bind(this)],customConfig=null!==(_config$config=config.config)&&void 0!==_config$config?_config$config:{};if(customConfig.hasOwnProperty("onOpen")){var customOnOpen=Array.isArray(customConfig.onOpen)?customConfig.onOpen:[customConfig.onOpen];onOpen=onOpen.concat(customOnOpen),delete customConfig.onOpen}return _objectSpread2(_objectSpread2({defaultDate:this.__rawValue},config.options),{},{onOpen:onOpen,onChange:function(date,dateString){var newValue=dateString;"multiple"===this.__mode?newValue=dateString.split(", "):"range"===this.__mode&&(newValue=dateString.split(" to ")),this.__value=newValue}.bind(this)},customConfig)}}})),Alpine.directive("date-picker",(function(el,directive,_ref2){var cleanup=_ref2.cleanup;switch(directive.value){case"clear":!function(el,Alpine){Alpine.bind(el,{"x-ref":"__clear","x-init":function(){"button"!==this.$el.tagName.toLowerCase()||this.$el.hasAttribute("type")||this.$el.setAttribute("type","button")},"@click":function(){this.$data.__clear()},"x-show":function(){return this.$datePicker.hasValue&&!this.$datePicker.isDisabled}})}(el,Alpine);break;case"container":!function(el,Alpine){Alpine.bind(el,{"x-ref":"__container",role:"none","x-init":function(){var _this3=this;new MutationObserver((function(mutations){mutations.forEach((function(mutation){if("aria-invalid"===mutation.attributeName)"true"===mutation.target.getAttribute("aria-invalid")?(_this3.$refs.__input.setAttribute("aria-invalid","true"),_this3.$refs.__input.classList.add("input-error")):(_this3.$refs.__input.removeAttribute("aria-invalid"),_this3.$refs.__input.classList.remove("input-error"));else if("aria-describedby"===mutation.attributeName){var describedBy=mutation.target.getAttribute("aria-describedby");describedBy?_this3.$refs.__input.setAttribute("aria-describedby",describedBy):_this3.$refs.__input.removeAttribute("aria-describedby")}}))})).observe(this.$el,{attributes:!0})}})}(el,Alpine);break;case"input":!function(el,Alpine){Alpine.bind(el,{"x-ref":"__input",type:"text","x-init":function(){var _this2=this;this.$data.__isDisabled=this.$el.disabled||this.$el.readOnly,queueMicrotask((function(){new MutationObserver((function(mutations){mutations.forEach((function(mutation){"disabled"!==mutation.attributeName&&"readonly"!==mutation.attributeName||(_this2.$data.__isDisabled=_this2.$el.disabled||_this2.$el.readOnly)}))})).observe(_this2.$el,{attributes:!0})}))}})}(el,Alpine),cleanup((function(){var parent=el.closest("[x-data]");parent&&Alpine.$data(parent).__flatpickr.destroy()}));break;case"toggle":!function(el,Alpine){Alpine.bind(el,{"x-ref":"__toggle",":role":function(){return!this.$datePicker.isDisabled&&("button"!==this.$el.tagName.toLowerCase()&&"button")},"@click":function(){this.$datePicker.open()}})}(el,Alpine);break;default:throw new Error("Unknown date-picker directive value: ".concat(directive.value))}})),Alpine.magic("datePicker",(function(el){var data=Alpine.$data(el);return data.__ready?{get isDisabled(){return data.__isDisabled},get flatpickr(){return data.__flatpickr},get hasValue(){return"single"===data.__mode?null!==data.__value&&""!==data.__value:Array.isArray(data.__value)&&data.__value.length>0},open:function(){data.__open()}}:{isDisabled:!1,flatpickr:void 0,hasValue:!1,open:function(){}}}))}var switchToggle=function(options){return _objectSpread2(_objectSpread2({value:!1,onValue:!0,offValue:!1},options),{},{get isPressed(){return Array.isArray(this.value)?this.value.includes(this.onValue):this.value===this.onValue},toggle:function(){Array.isArray(this.value)?this.isPressed?this.value.splice(this.value.indexOf(this.onValue),1):this.value.push(this.onValue):this.value=this.isPressed?this.offValue:this.onValue,this.$dispatch("input",this.value)}})},generateContext=function(_ref){var multiple=_ref.multiple,orientation=_ref.orientation,__wire=_ref.__wire,__wireSearch=_ref.__wireSearch,__config=_ref.__config,Alpine=_ref.Alpine;return _objectSpread2(_objectSpread2({},selectContext(Alpine)),{},{__multiple:multiple,__orientation:orientation,__wire:__wire,__wireSearch:__wireSearch,__config:__config,expandableEls:{},expandedKeys:[],__itemBooted:function(el,value,disabled,key){var _this=this;queueMicrotask((function(){var _el$__children;null!==(_el$__children=el.__children)&&void 0!==_el$__children&&_el$__children.length&&(_this.expandableEls[key]=el)}))},__itemDestroyed:function(el,key){this.expandableEls[key]&&delete this.expandableEls[key],this.expandedKeys.includes(key)&&this.expandedKeys.splice(this.expandedKeys.indexOf(key),1)},isExpandedEl:function(el){var key=keyByValue(this.elsByKey,el);if(key)return this.expandedKeys.includes(key)},toggleExpandedEl:function(el){var key=keyByValue(this.elsByKey,el);key&&this.toggleExpanded(key)},toggleExpanded:function(key){this.expandedKeys.includes(key)?this.expandedKeys.splice(this.expandedKeys.indexOf(key),1):this.expandedKeys.push(key)},expandChildren:function(key){this.expandedKeys.includes(key)||this.expandedKeys.push(key)},collapseChildren:function(key){this.expandedKeys.includes(key)&&this.expandedKeys.splice(this.expandedKeys.indexOf(key),1)},__activateByKeyEvent:function(e){if(this.hasActive())switch(e.key){case["ArrowRight","ArrowDown"]["vertical"===this.__orientation?0:1]:return e.preventDefault(),e.stopPropagation(),this.expandableEls[this.activeKey]&&this.expandChildren(this.activeKey),!1;case["ArrowLeft","ArrowUp"]["vertical"===this.__orientation?0:1]:return e.preventDefault(),e.stopPropagation(),this.expandableEls[this.activeKey]&&this.collapseChildren(this.activeKey),!1}},get isScrollingTo(){return this.scrollingCount>0},get nonDisabledOrderedKeys(){var _this2=this;return this.orderedKeys.filter((function(i){return!_this2.isDisabled(i)}))}})};function treeSelect(Alpine){Alpine.data("treeSelect",(function(config){return _objectSpread2(_objectSpread2(_objectSpread2({},selectPopper),selectData(config.__el,Alpine,config)),{},{__type:"tree",__generateContext:function(el,Alpine,config){var _config$__config;return generateContext({multiple:this.__isMultiple,orientation:this.__orientation,__wire:config.__wire,__wireSearch:Alpine.bound(el,"livewire-search"),__config:null!==(_config$__config=config.__config)&&void 0!==_config$__config?_config$__config:{},Alpine:Alpine})}})})),Alpine.directive("tree-select",(function(el,directive,_ref){var cleanup=_ref.cleanup;switch(directive.value){case"button":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},{"x-ref":"__button",":id":function(){return this.$id("fc-".concat(this.__type,"-select-button"))},"aria-haspopup":"true","data-custom-select-button":"true",":aria-labelledby":function(){return this.$data.__hasCustomSelectLabel?this.$id("fc-".concat(this.__type,"-select-label")):this.$id("fc-label")},":aria-expanded":function(){return this.$data.__isOpen},":aria-controls":function(){return this.$data.__isOpen&&this.$id("fc-".concat(this.__type,"-select-options"))},":tabindex":function(){return this.$data.__isDisabled?"-1":"0"},"x-init":function(){"button"!==this.$el.tagName.toLowerCase()||this.$el.hasAttribute("type")||(this.$el.type="button"),"button"!==this.$el.tagName.toLowerCase()&&this.$el.setAttribute("role","button")},"@click":function(){this.$data.__open()},"@focus":function(){this.$data.__isDisabled&&this.$el.blur()},"@keydown":function(e){["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(e.key)&&(e.stopPropagation(),e.preventDefault(),this.$data.__open());var $magic="tree"===this.__type?this.$treeSelect:this.$customSelect;if("Backspace"===e.key){if(e.stopPropagation(),e.preventDefault(),this.$data.__isDisabled)return;var lastSelected=this.$data.__isMultiple?$magic.selectedObject[$magic.selectedObject.length-1]:$magic.selectedObject;lastSelected&&this.$data.__context.toggleValue(lastSelected,this.$data.__compareBy)}},"@keydown.space.stop.prevent":function(){this.$data.__open()},"@keydown.enter.stop.prevent":function(){this.$data.__open()}}))}(el,Alpine);break;case"label":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},{"x-ref":"__label",":id":function(){return this.$id("fc-".concat(this.__type,"-custom-select-label"))},"x-init":function(){this.$data.__hasCustomSelectLabel=!0},"@click":function(){this.$refs.__button.focus({preventScroll:!0})}}))}(el,Alpine);break;case"clear":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},clearButtonDirective(0,0,"tree")))}(el,Alpine);break;case"options":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},optionsDirective(0,Alpine)))}(el,Alpine);break;case"option":!function(el,Alpine){Alpine.bind(el,_objectSpread2(_objectSpread2({},optionDirective(el,Alpine,"tree")),{},{"data-tree-select-option":"true",":role":function(){return"option"},"x-init":function(){var _this=this,initCallback=function(){var value=Alpine.bound(el,"value"),disabled=Alpine.bound(el,"disabled");el.__level=Alpine.bound(el,"level",0),el.__optionKey=_this.$data.__context.initItem(el,value,disabled);var childrenField=_this.$data.__config.childrenField;null!=value&&value.hasOwnProperty(childrenField)&&(el.__children=value[childrenField])};this.$data.__ready?initCallback():queueMicrotask(initCallback)}}))}(el,Alpine),cleanup((function(){var parent=el.closest("[x-data]");parent&&Alpine.$data(parent).__context.destroyItem(el)}));break;case"search":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},{"x-ref":"__search",":id":function(){return this.$id("fc-".concat(this.__type,"-select-search"))},"x-init":function(){var _this5=this,searchableQuery=this.$data.__context.searchableQuery;this.$el.value=searchableQuery,this.$data.__ready&&this.$data.__isOpen&&searchableQuery.length&&this.$nextTick((function(){if(_this5.$el.createTextRange){var range=_this5.$el.createTextRange();range.move("character",searchableQuery.length),range.select()}else _this5.$el.focus(),_this5.$el.setSelectionRange&&_this5.$el.setSelectionRange(searchableQuery.length,searchableQuery.length)}))},"@keyup.debounce.250ms":function(e){["Enter","ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Home","PageUp","End","PageDown","Tab","Meta"].includes(e.key)||this.$data.__context.handleSearchableQuery(e.target.value)},"@keydown.space.stop":function(){},"@keydown.tab.prevent.stop":function(){this.$refs.__options.focus()}}))}(el,Alpine);break;case"token":!function(el,Alpine){Alpine.bind(el,_objectSpread2({},tokenDirective(el)))}(el,Alpine);break;case"child-toggle":!function(el,Alpine){Alpine.bind(el,{"x-init":function(){"button"!==el.tagName.toLowerCase()&&el.setAttribute("role","button")},"@click.stop.prevent":function(){var optionEl=Alpine.findClosest(el,(function(i){return i.__optionKey}));optionEl&&this.$data.__context.toggleExpandedEl(optionEl)}})}(el,Alpine);break;case"children":!function(el,Alpine){Alpine.bind(el,{"data-tree-select-children":"true","x-data":function(){return{__optionEl:void 0,init:function(){try{this.__optionEl=el.parentNode.querySelector('[data-tree-select-option="true"]')}catch(e){}},get __isExpanded(){return this.__optionEl&&this.$data.__context.isExpandedEl(this.__optionEl)}}},"x-show":function(){return this.$data.__isExpanded}})}(el,Alpine);break;default:throw new Error("Unknown tree-select directive: ".concat(directive.value))}})),Alpine.magic("treeSelect",(function(el){return rootMagic(el,Alpine,(function(data){return{get hasExpandableOptions(){return Object.keys(data.__context.expandableEls).length>0}}}))})),Alpine.magic("treeSelectOption",(function(el){return optionMagic(el,Alpine,(function(data,context,optionEl){return{get hasChildren(){return optionEl.__children&&optionEl.__children.length>0},get isExpanded(){return context.isExpandedEl(optionEl)}}}),(function(){return{hasChildren:!1}}))}))}document.addEventListener("alpine:init",(function(){customSelect(Alpine),datePicker(Alpine),function(Alpine){Alpine.data("filepond",(function(_ref){var __value=_ref.__value,__this=_ref.__this,__wireModel=_ref.__wireModel,options=_ref.options,__config=_ref.__config,id=_ref.id;return{__ready:!1,__pond:null,__processingFiles:!1,__value:__value,init:function(){var _window$FilePond,_this=this;if("function"!=typeof(null===(_window$FilePond=window.FilePond)||void 0===_window$FilePond?void 0:_window$FilePond.create))throw new Error("filepond requires FilePond to be loaded. See https://pqina.nl/filepond/docs/getting-started/installation/javascript/");queueMicrotask((function(){_this.__ready=!0;var pondOptions=_objectSpread2({},options);__this&&__wireModel&&(pondOptions.server={process:function(fieldName,file,metadata,load,error,progress,abort,transfer,options){__this.upload(__wireModel,file,load,error,progress)},revert:function(filename,load){__this.removeUpload(__wireModel,filename,load)}},pondOptions.onaddfilestart=function(){return _this.__processingFiles=!0},pondOptions.onprocessfiles=function(){return _this.__processingFiles=!1}),__this&&__this.on("file-pond-clear",(function(desiredId){return _this.__clear(desiredId)})),pondOptions=_objectSpread2(_objectSpread2({},pondOptions),__config(_this,options,pondOptions)),_this.__pond=window.FilePond.create(_this.$refs.input,pondOptions)})),this.$watch("__value",(function(newValue){if(_this.__ready)if(options.allowMultiple){if(_this.__processingFiles)return;if(!newValue)return _this.__clear();var serverIds=Array.isArray(newValue)?newValue:JSON.parse(String(newValue).split("livewire-files:")[1]);_this.__pond.getFiles().forEach((function(f){serverIds.includes(f.serverId)||_this.__pond.removeFile(f.id)}))}else newValue||_this.__clear()}))},__clear:function(eventId){var instance;eventId&&eventId!==id||(instance=this.__pond,options.allowMultiple?instance.getFiles().forEach((function(file){return instance.removeFile(file.id)})):instance.removeFile())}}}))}(Alpine),function(Alpine){Alpine.data("quill",(function(_ref){var __value=_ref.__value,options=_ref.options,__config=_ref.__config,onTextChange=_ref.onTextChange,onInit=_ref.onInit;return{__ready:!1,__value:__value,__quill:void 0,init:function(){var _this=this;if("function"!=typeof window.Quill)throw new Error("quill requires Quill to be loaded. See https://quilljs.com/docs/installation/");queueMicrotask((function(){_this.__ready=!0,_this.__quill=new window.Quill(_this.$refs.quill,_this.__quillOptions()),_this.__quill.root.innerHTML=_this.__value,_this.__quill.on("text-change",(function(){"function"==typeof onTextChange&&!1===onTextChange(_this)||(_this.__value=_this.__quill.root.innerHTML,_this.$dispatch("input",_this.__value))})),options.autofocus&&_this.$nextTick((function(){_this.focus()})),"function"==typeof onInit&&onInit(_this)}))},focus:function(){this.__ready&&this.__quill.focus()},__quillOptions:function(){var config=__config(this,options),toolbarHandlers={},modules={};return config.hasOwnProperty("toolbarHandlers")&&(toolbarHandlers=config.toolbarHandlers,delete config.toolbarHandlers),config.hasOwnProperty("modules")&&(modules=config.modules,delete config.modules),_objectSpread2({theme:options.theme,readOnly:options.readOnly,placeholder:options.placeholder,modules:_objectSpread2({toolbar:{container:options.toolbar,handlers:toolbarHandlers}},modules)},config)}}}))}(Alpine),treeSelect(Alpine),Alpine.data("switchToggle",switchToggle)}));var resize=function(el){el.style.minHeight||(el.style.minHeight="".concat(el.scrollHeight,"px")),el.style.height="auto",el.style.height="".concat(el.scrollHeight,"px")},textareaResize=function(Alpine){Alpine.directive("textarea-resize",(function(el,_ref,_ref2){!function(obj){if(null==obj)throw new TypeError("Cannot destructure "+obj)}(_ref);var cleanup=_ref2.cleanup;(function(el){return"none"===el.style.display||!el.offsetParent})(el)||resize(el);var inputHandler=function(){return resize(el)};el.addEventListener("input",inputHandler),cleanup((function(){el.removeEventListener("input",inputHandler)}))}))};document.addEventListener("alpine:init",(function(){!function(Alpine){Alpine.directive("form-group",(function(el,directive){"label"===directive.value?function(el,Alpine){Alpine.bind(el,{"@click":function(){var group=el.closest("[x-form-group]");if(group){var customSelectButton=group.querySelector('[data-custom-select-button="true"]');if(customSelectButton)customSelectButton.focus({preventScroll:!0});else{var quill=group.querySelector(".quill-wrapper");quill&&Alpine.$data(quill).focus()}}}})}(el,Alpine):function(el,Alpine){Alpine.bind(el,{"x-id":function(){return["fc-label"]}})}(el,Alpine)}))}(Alpine),Alpine.plugin(textareaResize)}))})); //# sourceMappingURL=form-components.js.map diff --git a/dist/form-components.js.map b/dist/form-components.js.map index c3b9eac..b2309ff 100644 --- a/dist/form-components.js.map +++ b/dist/form-components.js.map @@ -1 +1 @@ -{"version":3,"file":"form-components.js","sources":["../resources/js/mixins/selectContext.js","../resources/js/util/customSelectContext.js","../resources/js/mixins/selectPopper.js","../resources/js/mixins/select.js","../resources/js/mixins/selectMagic.js","../resources/js/components/custom-select.js","../resources/js/components/date-picker.js","../resources/js/components/switch-toggle.js","../resources/js/util/treeSelectContext.js","../resources/js/components/tree-select.js","../resources/js/components/index.js","../resources/js/components/filepond.js","../resources/js/components/quill.js","../resources/js/directives/textarea-resize.js","../resources/js/directives/index.js","../resources/js/directives/form-group.js"],"sourcesContent":["export default Alpine => ({\n // Main state.\n searchableText: {},\n disabledKeys: [],\n activeKey: null,\n selectedKeys: [],\n orderedKeys: [],\n elsByKey: {},\n values: {},\n\n // These keys will be overridden by each select context implementation.\n __config: {},\n __multiple: false,\n __orientation: 'vertical',\n __wire: undefined,\n __wireSearch: undefined,\n\n /**\n * Initialization.\n */\n\n initItem(el, value, disabled, isOptGroup = false) {\n let key = (Math.random() + 1).toString(36).substring(7);\n\n // If the value is already selected, we will replace the key with the exising one.\n // This usually only happens when options are refreshed via ajax.\n const keyFromValue = this.getKeyFromValue(value, this.__config.by);\n if (keyFromValue) {\n key = keyFromValue;\n }\n\n // We don't need to track \"opt groups\".\n if (isOptGroup) {\n return key;\n }\n\n // Register value by key.\n this.values[key] = value;\n\n // Associate key with element.\n this.elsByKey[key] = el;\n\n // Register key for ordering.\n this.orderedKeys.push(key);\n\n // Register key for searching.\n this.searchableText[key] = el.textContent.trim().toLowerCase();\n\n // Store whether disabled or not.\n disabled && this.disabledKeys.push(key);\n\n this.__itemBooted(el, value, disabled, key);\n\n return key;\n },\n\n /**\n * This provides a way for each select implementation to hook into the initItem process.\n */\n __itemBooted(el, value, disabled, key) {},\n\n destroyItem(el) {\n let key = keyByValue(this.elsByKey, el);\n\n // We need to preserve this to keep the display on the button accurate.\n if (! this.selectedKeys.includes(key)) {\n delete this.values[key];\n }\n\n delete this.elsByKey[key];\n delete this.orderedKeys[this.orderedKeys.indexOf(key)];\n delete this.searchableText[key];\n delete this.disabledKeys[key];\n\n this.reorderKeys();\n\n this.__itemDestroyed(el, key);\n },\n\n /**\n * This provides a way for each select implementation to hook into the destroyItem process.\n */\n __itemDestroyed(el, key) {},\n\n resetOptions() {\n this.activeKey = null;\n\n this.reorderKeys();\n },\n\n /**\n * Handle elements.\n */\n\n reorderKeys() {\n // Filter out elements removed from the DOM.\n this.orderedKeys.forEach(key => {\n const el = this.elsByKey[key];\n\n if (el?.isConnected) {\n return;\n }\n\n this.destroyItem(el);\n });\n\n this.orderedKeys = this.orderedKeys.slice().sort((a, z) => {\n if (a === null || z === null) {\n return 0;\n }\n\n const aEl = this.elsByKey[a];\n const zEl = this.elsByKey[z];\n\n const position = aEl.compareDocumentPosition(zEl);\n\n if (position & Node.DOCUMENT_POSITION_FOLLOWING) {\n return -1;\n }\n\n if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n return 1;\n }\n\n return 0;\n });\n },\n\n activeEl() {\n if (! this.activeKey) {\n return;\n }\n\n return this.elsByKey[this.activeKey];\n },\n\n isActiveEl(el) {\n const key = keyByValue(this.elsByKey, el);\n\n if (! key) {\n return;\n }\n\n return this.activeKey === key;\n },\n\n activateEl(el) {\n const key = keyByValue(this.elsByKey, el);\n\n if (! key) {\n return;\n }\n\n this.activateKey(key);\n },\n\n selectEl(el) {\n const key = keyByValue(this.elsByKey, el);\n\n if (! key) {\n return;\n }\n\n this.selectKey(key);\n },\n\n isSelectedEl(el) {\n const key = keyByValue(this.elsByKey, el);\n\n if (! key) {\n return;\n }\n\n return this.isSelected(key);\n },\n\n isDisabledEl(el) {\n const key = keyByValue(this.elsByKey, el);\n\n if (! key) {\n return;\n }\n\n return this.isDisabled(key);\n },\n\n hideEl(el) {\n el.style.display = 'none';\n el.setAttribute('data-hidden', 'true');\n },\n\n showEl(el) {\n el.style.display = '';\n el.removeAttribute('data-hidden');\n },\n\n isHiddenEl(el) {\n if (el.style.display === 'none') {\n return true;\n }\n\n return ! el.offsetParent;\n },\n\n scrollingCount: 0,\n\n activateAndScrollToKey(key) {\n // This addresses the following problem:\n // If deactivate is hooked up to mouseleave,\n // scrolling to an element will trigger deactivation.\n // This \"isScrollingTo\" is exposed to prevent that.\n this.scrollingCount++;\n\n this.activateKey(key);\n\n const targetEl = this.elsByKey[key];\n\n targetEl && targetEl.scrollIntoView({ block: 'nearest' });\n\n setTimeout(() => {\n this.scrollingCount--;\n }, 25);\n },\n\n /**\n * Handle values.\n */\n\n selectedBasicValueOrValues(by) {\n if (this.__multiple) {\n return this.selectedBasicValues(by);\n }\n\n return this.selectedBasicValue(by);\n },\n\n selectedBasicValues(by) {\n return this.selectedKeys.map(i => {\n const value = this.values[i];\n\n if (value?.hasOwnProperty(by)) {\n return value[by];\n }\n\n return value;\n });\n },\n\n selectedBasicValue(by) {\n const value = this.selectedKeys[0]\n ? this.values[this.selectedKeys[0]]\n : null;\n\n if (value?.hasOwnProperty(by)) {\n return value[by];\n }\n\n return value;\n },\n\n selectedValueOrValues() {\n if (this.__multiple) {\n return this.selectedValues();\n }\n\n return this.selectedValue();\n },\n\n selectedValues() {\n return this.selectedKeys.map(i => this.values[i]);\n },\n\n selectedValue() {\n return this.selectedKeys[0] ? this.values[this.selectedKeys[0]] : null;\n },\n\n selectValue(value, by) {\n value = normalizeValue(value, this.__multiple);\n by = mapByToCallback(by);\n\n if (this.__multiple) {\n let keys = [];\n\n value.forEach(i => {\n for (let key in this.values) {\n if (by(this.values[key], i)) {\n if (! keys.includes(key)) {\n keys.push(key);\n }\n }\n }\n });\n\n this.selectExclusive(keys);\n\n return;\n }\n\n for (let key in this.values) {\n if (value && by(this.values[key], value)) {\n this.selectKey(key);\n }\n }\n\n // Handle edge cases where value is updated externally to null.\n if (value === null) {\n this.selectedKeys = [];\n }\n },\n\n getKeyFromValue(value, by) {\n if (! value) {\n return;\n }\n\n by = mapByToCallback(by);\n\n for (let key in this.values) {\n if (by(this.values[key], value)) {\n return key;\n }\n }\n },\n\n getKeyFromSimpleValue(value, by) {\n if (! value) {\n return;\n }\n\n by = mapByToSimpleCompareCallback(by);\n\n for (let key in this.values) {\n if (by(this.values[key], value)) {\n return key;\n }\n }\n },\n\n getObjectFromValue(value, by) {\n if (! value) {\n return;\n }\n\n by = mapByToSimpleCompareCallback(by);\n\n for (let key in this.values) {\n if (by(this.values[key], value)) {\n return this.values[key];\n }\n }\n },\n\n toggleValue(value, by) {\n if (! value) {\n return;\n }\n\n by = mapByToCallback(by);\n\n if (this.__multiple) {\n for (let key in this.values) {\n if (by(this.values[key], value)) {\n this.toggleSelected(key);\n\n break;\n }\n }\n }\n },\n\n /**\n * Handle disabled keys.\n */\n\n isDisabled(key) {\n return this.disabledKeys.includes(key);\n },\n\n /**\n * Handle selected keys.\n */\n\n selectKey(key) {\n if (this.isDisabled(key)) {\n return;\n }\n\n if (this.__multiple) {\n this.toggleSelected(key);\n } else {\n this.selectOnly(key);\n }\n },\n\n toggleSelected(key) {\n if (this.selectedKeys.includes(key)) {\n // If we have a minimum amount of options that must be selected, and we're greater than or equal\n // to that amount, we can't deselect this option.\n if (! this.canRemoveOptions()) {\n return;\n }\n\n this.selectedKeys.splice(this.selectedKeys.indexOf(key), 1);\n } else {\n this.selectedKeys.push(key);\n }\n },\n\n selectOnly(key) {\n this.selectedKeys = [];\n this.selectedKeys.push(key);\n },\n\n selectExclusive(keys) {\n // We can't just do this.selectedKeys = keys\n // because we need to preserve reactivity...\n let toAdd = [...keys];\n\n for (let i = 0; i < this.selectedKeys.length; i++) {\n if (keys.includes(this.selectedKeys[i])) {\n delete toAdd[toAdd.indexOf(this.selectedKeys[i])];\n continue;\n }\n\n if (! keys.includes(this.selectedKeys[i])) {\n delete this.selectedKeys[i];\n }\n }\n\n toAdd.forEach(i => {\n this.selectedKeys.push(i);\n });\n },\n\n clearSelected() {\n if (this.__config.optional === false) {\n return;\n }\n\n this.selectedKeys = [];\n },\n\n selectActive() {\n if (! this.activeKey) {\n return;\n }\n\n this.selectKey(this.activeKey);\n },\n\n isSelected(key) {\n return this.selectedKeys.includes(key);\n },\n\n firstSelectedKey() {\n return this.selectedKeys[0];\n },\n\n /**\n * Handle activated keys.\n */\n\n hasActive() {\n return !! this.activeKey;\n },\n\n isActiveKey(key) {\n return this.activeKey === key;\n },\n\n get active() {\n return this.hasActive() && this.values[this.activeKey];\n },\n\n activateSelectedOrFirst() {\n setTimeout(() => {\n let firstSelected = this.firstSelectedKey();\n\n if (firstSelected) {\n return this.activateAndScrollToKey(firstSelected);\n }\n\n let firstKey = this.firstKey();\n\n if (firstKey) {\n this.activateAndScrollToKey(firstKey);\n }\n }, 25);\n },\n\n activateKey(key) {\n if (this.isDisabled(key)) {\n return;\n }\n\n this.activeKey = key;\n },\n\n deactivate() {\n if (! this.activeKey) {\n return;\n }\n\n if (this.isScrollingTo) {\n return;\n }\n\n this.activeKey = null;\n },\n\n /**\n * Handle active key traversal.\n */\n\n nextKey() {\n if (! this.activeKey) {\n return;\n }\n\n let index = this.nonDisabledOrderedKeys.findIndex(i => i === this.activeKey)\n let targetKey = this.nonDisabledOrderedKeys[index + 1];\n\n if (targetKey && this.isHiddenEl(this.elsByKey[targetKey])) {\n // If the next key is hidden, we need to skip to the next visible non-disabled key.\n targetKey = this.getNextVisibleKey(index);\n }\n\n return targetKey || this.firstKey();\n },\n\n prevKey() {\n if (! this.activeKey) {\n return;\n }\n\n let index = this.nonDisabledOrderedKeys.findIndex(i => i === this.activeKey);\n let targetKey = this.nonDisabledOrderedKeys[index - 1];\n\n if (targetKey && this.isHiddenEl(this.elsByKey[targetKey])) {\n // If the previous key is hidden, we need to skip to the previous visible non-disabled key.\n targetKey = this.getPrevVisibleKey(index);\n }\n\n return targetKey || this.lastKey();\n },\n\n firstKey() {\n let targetKey = this.nonDisabledOrderedKeys[0];\n\n if (targetKey && this.isHiddenEl(this.elsByKey[targetKey])) {\n // If the first key is hidden, we need to skip to the next visible non-disabled key.\n targetKey = this.getNextVisibleKey(-1);\n }\n\n return targetKey;\n },\n\n lastKey() {\n let targetKey = this.nonDisabledOrderedKeys[this.nonDisabledOrderedKeys.length - 1];\n\n if (targetKey && this.isHiddenEl(this.elsByKey[targetKey])) {\n // If the last key is hidden, we need to skip to the previous visible non-disabled key.\n targetKey = this.getPrevVisibleKey(this.nonDisabledOrderedKeys.length);\n }\n\n return targetKey;\n },\n\n getNextVisibleKey(index) {\n let targetKey;\n let currentIndex = index + 2;\n let visibleKeyFound = false;\n\n while (currentIndex < this.nonDisabledOrderedKeys.length && ! visibleKeyFound) {\n targetKey = this.nonDisabledOrderedKeys[currentIndex];\n\n visibleKeyFound = ! this.isHiddenEl(this.elsByKey[targetKey]);\n\n currentIndex++;\n }\n\n if (! visibleKeyFound) {\n targetKey = null;\n }\n\n return targetKey;\n },\n\n getPrevVisibleKey(index) {\n let targetKey;\n let currentIndex = index - 2;\n let visibleKeyFound = false;\n\n while (currentIndex >= 0 && ! visibleKeyFound) {\n targetKey = this.nonDisabledOrderedKeys[currentIndex];\n\n visibleKeyFound = ! this.isHiddenEl(this.elsByKey[targetKey]);\n\n currentIndex--;\n }\n\n if (! visibleKeyFound) {\n targetKey = null;\n }\n\n return targetKey;\n },\n\n /**\n * Handle simple search when menu is focused.\n */\n\n searchQuery: '',\n\n clearSearch: Alpine.debounce(function () { this.searchQuery = '' }, 350),\n\n searchKey(query) {\n this.clearSearch();\n\n this.searchQuery += query;\n\n let foundKey;\n\n for (let key in this.searchableText) {\n let content = this.searchableText[key];\n\n if (content.startsWith(this.searchQuery)) {\n foundKey = key;\n break;\n }\n }\n\n if (! this.nonDisabledOrderedKeys.includes(foundKey)) {\n return;\n }\n\n return foundKey;\n },\n\n /**\n * Handle full text search from the search input.\n */\n\n searchableQuery: '',\n\n handleSearchableQuery(query) {\n if (query === this.searchableQuery) {\n return;\n }\n\n this.searchableQuery = query;\n\n if (this.__wire && this.__wireSearch) {\n this.__wire[this.__wireSearch](this.searchableQuery);\n\n return;\n }\n\n for (let key in this.searchableText) {\n const content = this.searchableText[key];\n const el = this.elsByKey[key];\n\n const match = this.searchableQuery\n ? content.toLowerCase().includes(this.searchableQuery.toLowerCase())\n : true;\n\n match\n ? this.showEl(el)\n : this.hideEl(el);\n }\n },\n\n /**\n * Other utils.\n */\n\n canRemoveOptions() {\n if (! this.__multiple && this.selectedKeys.length === 1) {\n return this.__config.optional;\n }\n\n const minSelected = this.__config.minSelected;\n\n if (Number.isNaN(minSelected) || minSelected < 1) {\n return true;\n }\n\n return this.selectedKeys.length > minSelected;\n },\n\n /**\n * Handle events.\n */\n\n activateByKeyEvent(e) {\n this.reorderKeys();\n\n if (this.__activateByKeyEvent(e) === false) {\n return;\n }\n\n let hasActive = this.hasActive();\n let targetKey;\n\n switch (e.key) {\n case 'Tab':\n case 'Backspace':\n case 'Delete':\n case 'Meta':\n break;\n case ['ArrowDown', 'ArrowRight'][this.__orientation === 'vertical' ? 0 : 1]:\n e.preventDefault();\n e.stopPropagation();\n targetKey = hasActive ? this.nextKey() : this.firstKey();\n break;\n case ['ArrowUp', 'ArrowLeft'][this.__orientation === 'vertical' ? 0 : 1]:\n e.preventDefault();\n e.stopPropagation();\n targetKey = hasActive ? this.prevKey() : this.lastKey();\n break;\n case 'Home':\n case 'PageUp':\n e.preventDefault();\n e.stopPropagation();\n targetKey = this.firstKey();\n break;\n case 'End':\n case 'PageDown':\n e.preventDefault();\n e.stopPropagation();\n targetKey = this.lastKey();\n break;\n default:\n if (e.key.length === 1) {\n targetKey = this.searchKey(e.key);\n }\n\n break;\n }\n\n if (targetKey) {\n this.activateAndScrollToKey(targetKey);\n }\n },\n\n // This is a way to allow each select implementation to add their own logic to keyboard events on the options menu.\n __activateByKeyEvent(e) {},\n});\n\nexport const keyByValue = (object, value) => Object.keys(object).find(key => object[key] === value);\n\nexport const isObjectOrArray = subject => typeof subject === 'object' && subject !== null;\n\nexport const renderHiddenInputs = (el, name, value) => {\n // Create input elements.\n let newInputs = generateInputs(name, value);\n\n // Mark them for later tracking.\n newInputs.forEach(i => i._x_hiddenInput = true);\n\n // Mark them for Alpine ignoring.\n newInputs.forEach(i => i._x_ignore = true);\n\n // Gather old elements for removal.\n let children = el.children;\n let oldInputs = [];\n\n for (let i = 0; i < children.length; i++) {\n let child = children[i];\n\n if (child._x_hiddenInput) {\n oldInputs.push(child);\n } else {\n break;\n }\n }\n\n // Remove old, and insert new ones into the DOM.\n window.Alpine.mutateDom(() => {\n oldInputs.forEach(i => i.remove());\n\n newInputs.reverse().forEach(i => el.prepend(i));\n });\n};\n\nconst mapByToCallback = by => {\n if (! by) {\n by = (a, b) => a === b;\n }\n\n if (typeof by === 'string') {\n const property = by;\n by = (a, b) => a[property] === b[property];\n }\n\n return by;\n};\n\nconst mapByToSimpleCompareCallback = by => {\n if (! by) {\n by = (a, b) => a === b;\n }\n\n if (typeof by === 'string') {\n const property = by;\n by = (a, b) => a[property] === b;\n }\n\n return by;\n};\n\nconst normalizeValue = (value, multiple) => {\n if (! value) {\n value = (multiple ? [] : null);\n }\n\n if (multiple && ! Array.isArray(value)) {\n value = [value];\n }\n\n return value;\n};\n\nconst generateInputs = (name, value, carry = []) => {\n if (isObjectOrArray(value)) {\n for (let key in value) {\n carry = carry.concat(\n generateInputs(`${name}[${key}]`, value[key])\n );\n }\n } else if (value !== null && value !== false) {\n let el = document.createElement('input');\n el.setAttribute('type', 'hidden');\n el.setAttribute('name', name);\n el.setAttribute('value', '' + value);\n\n return [el];\n }\n\n return carry;\n};\n","import selectContext from '../mixins/selectContext';\n\nexport const generateContext = ({ multiple, orientation, __wire, __wireSearch, __config, Alpine }) => {\n return {\n ...selectContext(Alpine),\n\n /**\n * Select configuration.\n */\n __multiple: multiple,\n __orientation: orientation,\n __wire,\n __wireSearch,\n __config,\n\n /**\n * Getters that don't work in the mixin for some reason...\n */\n\n get isScrollingTo() {\n return this.scrollingCount > 0;\n },\n\n get nonDisabledOrderedKeys() {\n return this.orderedKeys.filter(i => ! this.isDisabled(i));\n },\n };\n};\n","export default {\n __createPopper: undefined,\n __popper: undefined,\n\n __resetPopper() {\n if (this.__popper) {\n this.__popper.destroy();\n this.__popper = null;\n }\n },\n\n __popperConfig() {\n return {\n placement: 'bottom-start',\n strategy: this.__fixed ? 'fixed' : 'absolute',\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, 10],\n },\n },\n {\n name: 'preventOverflow',\n options: {\n boundariesElement: this.$root,\n },\n },\n ],\n };\n },\n\n __initPopper() {\n this.__resetPopper();\n this.__popper = this.__createPopper(this.$root, this.$refs.__options, this.__popperConfig());\n },\n};\n","import { renderHiddenInputs } from './selectContext';\n\nexport function selectData(el, Alpine, config) {\n return {\n __ready: false,\n __value: config.__value ?? false,\n __richValue: false,\n __isOpen: false,\n __context: undefined,\n __isMultiple: false,\n __isStatic: false,\n __isClearable: undefined,\n __isDisabled: false,\n __compareBy: null,\n __inputName: undefined,\n __fixed: false,\n __searchable: undefined,\n __hasCustomSelectLabel: false,\n __orientation: 'vertical',\n __externalChanged: false,\n __config: config.__config,\n __wireSearch: undefined,\n __type: 'custom',\n\n init() {\n this.__createPopper = window.Popper ? window.Popper.createPopper : window.createPopper;\n\n if (typeof this.__createPopper !== 'function') {\n throw new TypeError(`${this.__type}-select requires Popper.js (https://popper.js.org)`);\n }\n\n this.__isMultiple = Alpine.bound(el, 'data-multiple', false);\n this.__isDisabled = Alpine.bound(el, 'disabled', false) || Alpine.bound(el, 'readonly', false);\n this.__inputName = Alpine.bound(el, 'name', null);\n this.__compareBy = Alpine.bound(el, 'by');\n this.__orientation = Alpine.bound(el, 'horizontal') ? 'horizontal' : 'vertical';\n this.__searchable = Alpine.bound(el, 'searchable', false);\n this.__isClearable = Alpine.bound(el, 'clearable', false);\n this.__wireSearch = Alpine.bound(el, 'livewire-search');\n this.__fixed = Alpine.bound(el, 'fixed', false);\n\n const autoFocus = Alpine.bound(el, 'autofocus');\n\n this.__context = this.__generateContext(el, Alpine, config);\n\n const defaultValue = Alpine.bound(el, 'default-value', null);\n if (defaultValue && ! this.__value) {\n this.__value = defaultValue;\n }\n\n // We have to wait for the rest of the HTML to initialize in Alpine before\n // we can mark this component as \"ready\".\n queueMicrotask(() => {\n this.__ready = true;\n\n // We have to wait again after the \"ready\" processes are finished\n // to settle up currently selected values (this prevents this next bit\n // of code from running multiple times on startup).\n queueMicrotask(() => {\n // This \"fingerprint\" acts as a checksum of the last-known \"value\"\n // passed into x-model. We need to track this so that we can determine\n // from the reactive effect if it was the value that changed externally\n // or an option was selected internally.\n let lastValueFingerprint = false;\n\n Alpine.effect(() => {\n // Accessing the selected keys, so a change in it always triggers this effect.\n this.__context.selectedKeys;\n\n if (lastValueFingerprint === false || lastValueFingerprint !== JSON.stringify(this.__value)) {\n // Here we know that the value changed externally, and we can add the selection.\n this.__externalChanged = true;\n\n if (this.__isMultiple) {\n this.__context.clearSelected();\n\n const keys = [];\n\n for (let value of this.__value) {\n const object = this.__context.getObjectFromValue(value, this.__compareBy);\n object && keys.push(object);\n }\n\n this.__context.selectValue(keys, this.__compareBy);\n this.__richValue = this.__context.selectedValueOrValues();\n } else {\n if (typeof this.__value !== 'object' && ! Array.isArray(this.__value) && this.__value !== null) {\n const key = this.__context.getKeyFromSimpleValue(this.__value, this.__compareBy);\n key && this.__context.selectKey(key);\n } else {\n this.__context.selectValue(this.__value, this.__compareBy);\n }\n\n this.__richValue = this.__context.selectedValueOrValues();\n }\n } else {\n // Here we know that an option was selected, and we can change the value.\n this.__value = this.__context.selectedBasicValueOrValues(this.__compareBy);\n this.__richValue = this.__context.selectedValueOrValues();\n }\n\n // Generate the \"value\" checksum for comparison next time.\n lastValueFingerprint = JSON.stringify(this.__value);\n\n // Everytime the value changes, we need to re-render the hidden inputs\n // if a user passed the \"name\" prop.\n this.__inputName && renderHiddenInputs(this.$el, this.__inputName, this.__value);\n });\n\n // If select is searchable, we want to hide any opt groups when a query is present.\n if (this.__searchable) {\n Alpine.effect(() => {\n const query = this.__context.searchableQuery;\n\n this.$refs.__options && this.$refs.__options.querySelectorAll('[role=\"presentation\"]:not([data-placeholder=\"true\"])').forEach(el => {\n if (query) {\n this.__context.hideEl(el);\n } else {\n this.__context.showEl(el);\n }\n });\n });\n }\n\n (autoFocus && this.$refs.__button) && this.$refs.__button.focus({ preventScroll: true });\n });\n });\n\n this.$watch('__value', newValue => {\n this.$dispatch('input', newValue);\n });\n\n this.__componentBooted(el, Alpine, config);\n },\n\n __open() {\n if (this.__isDisabled) {\n return;\n }\n\n this.__isOpen = true;\n\n this.__context.activateSelectedOrFirst();\n\n // Safari needs more of a \"tick\" for focusing after x-show for some reason.\n // Probably because Alpine adds an extra tick when x-showing for @click.outside.\n let nextTick = callback => requestAnimationFrame(() => requestAnimationFrame(callback));\n\n nextTick(() => {\n if (this.__searchable && this.$refs.__search) {\n this.$refs.__search.focus({ preventScroll: true });\n } else {\n this.$refs.__options.focus({ preventScroll: true });\n }\n\n this.__initPopper();\n });\n },\n\n __close() {\n this.__isOpen = false;\n this.__resetPopper();\n\n this.$nextTick(() => this.$refs.__button.focus({ preventScroll: true }));\n },\n\n __generateContext(el, Alpine, config) {},\n\n __componentBooted(el, Alpine, config) {},\n };\n}\n\nexport function buttonDirective(el, Alpine) {\n return {\n 'x-ref': '__button',\n ':id'() { return this.$id(`fc-${this.__type}-select-button`) },\n 'aria-haspopup': 'true',\n 'data-custom-select-button': 'true',\n ':aria-labelledby'() { return this.$data.__hasCustomSelectLabel ? this.$id(`fc-${this.__type}-select-label`) : this.$id('fc-label') },\n ':aria-expanded'() { return this.$data.__isOpen },\n ':aria-controls'() { return this.$data.__isOpen && this.$id(`fc-${this.__type}-select-options`) },\n ':tabindex'() { return this.$data.__isDisabled ? '-1' : '0' },\n 'x-init'() {\n if (this.$el.tagName.toLowerCase() === 'button' && ! this.$el.hasAttribute('type')) {\n this.$el.type = 'button';\n }\n\n if (this.$el.tagName.toLowerCase() !== 'button') {\n this.$el.setAttribute('role', 'button');\n }\n },\n '@click'() { this.$data.__open() },\n '@focus'() { this.$data.__isDisabled && this.$el.blur() },\n '@keydown'(e) {\n if (['ArrowDown', 'ArrowUp', 'ArrowLeft', 'ArrowRight'].includes(e.key)) {\n e.stopPropagation();\n e.preventDefault();\n\n this.$data.__open();\n }\n\n const $magic = this.__type === 'tree' ? this.$treeSelect : this.$customSelect;\n\n if (e.key === 'Backspace') {\n e.stopPropagation();\n e.preventDefault();\n\n if (this.$data.__isDisabled) {\n return;\n }\n\n const lastSelected = this.$data.__isMultiple\n ? $magic.selectedObject[$magic.selectedObject.length - 1]\n : $magic.selectedObject;\n\n lastSelected && this.$data.__context.toggleValue(lastSelected, this.$data.__compareBy);\n }\n },\n '@keydown.space.stop.prevent'() { this.$data.__open() },\n '@keydown.enter.stop.prevent'() { this.$data.__open() },\n };\n}\n\nexport function labelDirective(el, Alpine) {\n return {\n 'x-ref': '__label',\n ':id'() { return this.$id(`fc-${this.__type}-custom-select-label`) },\n 'x-init'() {\n this.$data.__hasCustomSelectLabel = true;\n },\n '@click'() { this.$refs.__button.focus({ preventScroll: true }) },\n };\n}\n\nexport function clearButtonDirective(el, Alpine, type) {\n const magic = type === 'tree' ? '$treeSelect' : '$customSelect';\n\n return {\n ':tabindex'() { return (this.$data.__isDisabled || ! this[magic].hasValue) ? false : '0' },\n 'x-show'() { return this[magic].shouldShowClear },\n 'x-init'() {\n if (this.$el.tagName.toLowerCase() === 'button' && ! this.$el.hasAttribute('type')) {\n this.$el.type = 'button';\n }\n\n if (this.$el.tagName.toLowerCase !== 'button') {\n this.$el.setAttribute('role', 'button');\n }\n },\n '@click.stop.prevent'() {\n if (this.$data.__isDisabled) {\n return;\n }\n\n this.$data.__context.clearSelected();\n this.$data.__close();\n\n // Our value is not reacting to the changes made in context, so we'll set it manually.\n this.$data.__value = this.$data.__isMultiple ? [] : null;\n },\n '@keydown.space.stop.prevent'() {\n if (this.$data.__isDisabled) {\n return;\n }\n\n this.$data.__context.clearSelected();\n this.$data.__close();\n\n // Our value is not reacting to the changes made in context, so we'll set it manually.\n this.$data.__value = this.$data.__isMultiple ? [] : null;\n },\n };\n}\n\nexport function optionsDirective(el, Alpine) {\n return {\n 'x-ref': '__options',\n ':id'() { return this.$id(`fc-${this.__type}-select-options`) },\n 'x-init'() {\n this.$data.__isStatic = Alpine.bound(this.$el, 'static', false);\n },\n 'x-show'() { return this.$data.__isStatic ? true : this.$data.__isOpen },\n '@click.outside'() { this.$data.__close() },\n '@keydown.escape.stop.prevent'() { this.$data.__close() },\n tabindex: '0',\n role: 'listbox',\n ':aria-orientation'() {return this.$data.__orientation },\n ':aria-labelledby'() { return this.$id(`fc-${this.__type}-select-button`) },\n ':aria-activedescendant'() { return this.$data.__context.activeEl() && this.$data.__context.activeEl().id },\n ':aria-multiselectable'() { return this.$data.__isMultiple ? 'true' : 'false' },\n '@focus'() { this.$data.__context.activateSelectedOrFirst() },\n 'x-trap'() { return this.$data.__isOpen },\n '@keydown'(e) { this.$data.__context.activateByKeyEvent(e) },\n '@keydown.enter.stop.prevent'() {\n this.$data.__context.selectActive();\n\n this.$data.__isMultiple || this.$data.__close();\n },\n '@keydown.space.stop.prevent'() {\n this.$data.__context.selectActive();\n\n this.$data.__isMultiple || this.$data.__close();\n },\n };\n}\n\nexport function optionDirective(el, Alpine, type) {\n const rootMagic = type === 'tree' ? '$treeSelect' : '$customSelect';\n const magic = type === 'tree' ? '$treeSelectOption' : '$customSelectOption';\n\n return {\n ':id'() { return this.$id(`fc-${this.__type}-select-option`) },\n ':tabindex'() { return this.$data.__isDisabled ? false : '-1' },\n ':role'() { return this[magic].isOptGroup ? 'presentation' : 'option' },\n 'x-init'() {\n const initCallback = () => {\n let value = Alpine.bound(el, 'value');\n let disabled = Alpine.bound(el, 'disabled');\n let isOptGroup = Alpine.bound(el, 'is-opt-group');\n\n el.__optionKey = this.$data.__context.initItem(el, value, disabled, isOptGroup);\n };\n\n // Our $customSelectOption magic only seems to work with queueMicrotask on initial page load,\n // so if our component says it's ready, we'll just run the code to initialize the option right away.\n if (this.$data.__ready) {\n initCallback();\n } else {\n queueMicrotask(initCallback);\n }\n },\n ':aria-selected'() { return this[magic].isSelected },\n ':aria-disabled'() { return this[magic].isDisabled },\n '@click'() {\n if (this.$data.__isDisabled || this[magic].isDisabled) {\n return;\n }\n\n if (! this[magic].isSelected && ! this[rootMagic].canSelectMore) {\n return;\n }\n\n this.$data.__context.selectEl(el);\n\n this.$data.__isMultiple || this.$data.__close();\n },\n '@mousemove'() { this.$data.__context.activateEl(el) },\n '@mouseleave'() { this.$data.__context.deactivate() },\n };\n}\n\nexport function searchDirective(el, Alpine) {\n return {\n 'x-ref': '__search',\n ':id'() { return this.$id(`fc-${this.__type}-select-search`) },\n 'x-init'() {\n // When using livewire search, the directive re-evaluates even when inside a wire:ignore,\n // so we'll need to re-populate the value of the search query, so we don't lose it...\n const searchableQuery = this.$data.__context.searchableQuery;\n this.$el.value = searchableQuery;\n\n if (this.$data.__ready && this.$data.__isOpen && searchableQuery.length) {\n this.$nextTick(() => {\n if (this.$el.createTextRange) {\n let range = this.$el.createTextRange();\n range.move('character', searchableQuery.length);\n range.select();\n } else {\n // This sets the cursor position to the end of the input and prevents\n // the entire text from being highlighted. IMO this creates a better UX.\n this.$el.focus();\n this.$el.setSelectionRange && this.$el.setSelectionRange(searchableQuery.length, searchableQuery.length);\n }\n });\n }\n },\n '@keyup.debounce.250ms'(e) {\n // We don't want our keyboard nav events to trigger this.\n const keysToSkip = [\n 'Enter',\n 'ArrowDown',\n 'ArrowUp',\n 'ArrowRight',\n 'ArrowLeft',\n 'Home',\n 'PageUp',\n 'End',\n 'PageDown',\n 'Tab',\n 'Meta',\n ];\n if (keysToSkip.includes(e.key)) {\n return;\n }\n\n this.$data.__context.handleSearchableQuery(e.target.value);\n },\n // Prevent our option handler from firing when we're typing in the search box.\n '@keydown.space.stop'() {},\n '@keydown.tab.prevent.stop'() {\n // Options has x-trap on it, which prevent us from tabbing out of the search box.\n // We'll allow the user to tab to the options, which will allow selecting an option using the space key.\n this.$refs.__options.focus();\n }\n };\n}\n\nexport function tokenDirective(el, Alpine) {\n return {\n ':tabindex'() { return this.$data.__isDisabled ? false : '0' },\n ':role'() { return this.$el.tagName.toLowerCase() !== 'button' && ! this.$data.__isDisabled ? 'button' : false },\n 'x-init'() {\n const initCallback = () => {\n el.__key = this.$data.__context.getKeyFromValue(el.value);\n };\n\n if (this.$data.__ready) {\n initCallback();\n } else {\n queueMicrotask(initCallback);\n }\n },\n '@click.stop.prevent'() {\n if (this.$data.__isDisabled || ! el.__key) {\n return;\n }\n\n this.$data.__context.toggleSelected(el.__key);\n },\n '@keydown.space.stop.prevent'() {\n if (this.$data.__isDisabled || ! el.__key) {\n return;\n }\n\n this.$data.__context.toggleSelected(el.__key);\n },\n };\n}\n","export const rootMagic = (el, Alpine, callback, stubCallback) => {\n let data = Alpine.$data(el);\n\n if (typeof stubCallback !== 'function') {\n stubCallback = () => ({});\n }\n\n if (typeof callback !== 'function') {\n callback = () => ({});\n }\n\n if (! data.__ready) {\n return {\n isDisabled: false,\n isOpen: false,\n selected: null,\n active: null,\n selectedObject: null,\n ...stubCallback(data),\n };\n }\n\n return {\n get isOpen() {\n return data.__isOpen;\n },\n get isDisabled() {\n return data.__isDisabled;\n },\n get isSearchable() {\n return data.__searchable;\n },\n get selected() {\n return data.__value;\n },\n get active() {\n return data.__context.active;\n },\n get selectedObject() {\n return data.__richValue;\n },\n get hasValue() {\n if (data.__isMultiple) {\n return data.__value && data.__value.length > 0;\n }\n\n return !! data.__value;\n },\n get shouldShowClear() {\n // If the input is disabled or readonly, we can't clear.\n if (data.__isDisabled) {\n return false;\n }\n\n // If the select is not marked as optional, at least one value is required.\n if (data.__config.optional === false) {\n return false;\n }\n\n // If multi-select and minSelected is a number and at least 1, then we can't clear.\n if (data.__isMultiple && ! Number.isNaN(data.__config.minSelected) && data.__config.minSelected > 0) {\n return false;\n }\n\n return data.__isClearable && this.hasValue;\n },\n get canSelectMore() {\n if (! data.__isMultiple) {\n return true;\n }\n\n // If maxSelected is not a number or less than one, then we can select as many as we want.\n if (Number.isNaN(data.__config.maxSelected) || data.__config.maxSelected < 1) {\n return true;\n }\n\n return data.__config.maxSelected > data.__value.length;\n },\n get canDeselectOptions() {\n if (data.__isDisabled) {\n return false;\n }\n\n return data.__context.canRemoveOptions();\n },\n get hasOptions() {\n // We access searchableQuery here, so a change to it will trigger this getter to re-evaluate.\n data.__context.searchableQuery;\n\n return data.$refs.__options &&\n data.$refs.__options.querySelectorAll('[role=\"option\"]:not([data-hidden])').length > 0;\n },\n get hasSearch() {\n return !! data.__context.searchableQuery;\n },\n\n ...callback(data),\n };\n};\n\nexport const optionMagic = (el, Alpine, callback, stubCallback) => {\n if (typeof stubCallback !== 'function') {\n stubCallback = () => ({});\n }\n\n if (typeof callback !== 'function') {\n callback = () => ({});\n }\n\n let data = Alpine.$data(el);\n\n let stub = {\n isDisabled: false,\n isSelected: false,\n isActive: false,\n ...stubCallback(data),\n };\n\n if (! data.__ready) {\n return stub;\n }\n\n let optionEl = Alpine.findClosest(el, i => i.__optionKey);\n\n if (! optionEl) {\n return stub;\n }\n\n let context = data.__context;\n\n return {\n get isActive() {\n return context.isActiveEl(optionEl);\n },\n get isSelected() {\n return context.isSelectedEl(optionEl);\n },\n get isDisabled() {\n return context.isDisabledEl(optionEl);\n },\n\n ...callback(data, context, optionEl),\n };\n};\n","import { generateContext } from '../util/customSelectContext';\nimport selectPopper from '../mixins/selectPopper';\nimport {\n buttonDirective,\n clearButtonDirective,\n labelDirective,\n optionsDirective,\n optionDirective,\n searchDirective,\n selectData,\n tokenDirective,\n} from '../mixins/select';\nimport { rootMagic, optionMagic } from '../mixins/selectMagic';\n\nexport default function (Alpine) {\n Alpine.data('customSelect', config => {\n return {\n ...selectPopper,\n\n ...selectData(config.__el, Alpine, config),\n\n __generateContext(el, Alpine, config) {\n return generateContext({\n multiple: this.__isMultiple,\n orientation: this.__orientation,\n __wire: config.__wire,\n __wireSearch: Alpine.bound(el, 'livewire-search'),\n __config: config.__config ?? {},\n Alpine,\n });\n },\n }\n });\n\n Alpine.directive('custom-select', (el, directive, { cleanup }) => {\n switch (directive.value) {\n case 'button':\n handleButton(el, Alpine);\n break;\n case 'label':\n handleLabel(el, Alpine);\n break;\n case 'clear':\n handleClearButton(el, Alpine);\n break;\n case 'options':\n handleOptions(el, Alpine);\n break;\n case 'option':\n handleOption(el, Alpine);\n\n // We need to notify the context that the option has left the DOM.\n cleanup(() => {\n const parent = el.closest('[x-data]');\n\n parent && Alpine.$data(parent).__context.destroyItem(el);\n });\n\n break;\n case 'search':\n handleSearch(el, Alpine);\n break;\n case 'token':\n handleToken(el, Alpine);\n break;\n\n default:\n throw new Error(`Unknown custom-select directive value: ${directive.value}`);\n }\n });\n\n Alpine.magic('customSelect', el => {\n return rootMagic(el, Alpine);\n });\n\n Alpine.magic('customSelectOption', el => {\n return optionMagic(\n el,\n Alpine,\n (data, context, optionEl) => {\n return {\n get isOptGroup() {\n return Alpine.bound(optionEl, 'is-opt-group');\n },\n };\n },\n () => {\n return {\n isOptGroup: false,\n };\n },\n );\n });\n}\n\nfunction handleLabel(el, Alpine) {\n Alpine.bind(el, {\n ...labelDirective(el, Alpine),\n });\n}\n\nfunction handleButton(el, Alpine) {\n Alpine.bind(el, {\n ...buttonDirective(el, Alpine),\n });\n}\n\nfunction handleSearch(el, Alpine) {\n Alpine.bind(el, {\n ...searchDirective(el, Alpine),\n });\n}\n\nfunction handleOptions(el, Alpine) {\n Alpine.bind(el, {\n ...optionsDirective(el, Alpine),\n });\n}\n\nfunction handleOption(el, Alpine) {\n Alpine.bind(el, {\n ...optionDirective(el, Alpine, 'custom'),\n });\n}\n\nfunction handleToken(el, Alpine) {\n Alpine.bind(el, {\n ...tokenDirective(el, Alpine),\n });\n}\n\nfunction handleClearButton(el, Alpine) {\n Alpine.bind(el, {\n ...clearButtonDirective(el, Alpine, 'custom'),\n });\n}\n","export default function (Alpine) {\n Alpine.data('datePicker', config => ({\n __ready: false,\n __value: config.value,\n __rawValue: null,\n __mode: config.mode ?? config.options.mode ?? 'single',\n __isDisabled: false,\n __flatpickr: undefined,\n\n init() {\n if (typeof window.flatpickr !== 'function') {\n throw new Error(`date-picker requires Flatpickr. See https://flatpickr.js.org`);\n }\n\n let value = this.__value;\n if (value?.hasOwnProperty('initialValue')) {\n value = value.initialValue;\n }\n\n this.__rawValue = value;\n\n\n // We have to wait for the rest of the HTML to initialize in Alpine before\n // we can mark this component as \"ready\".\n queueMicrotask(() => {\n this.__ready = true;\n\n this.__flatpickr = window.flatpickr(this.$refs.__input, this.__config());\n });\n\n this.$watch('__value', newValue => {\n this.__rawValue = newValue;\n this.__flatpickr.setDate(newValue);\n this.$dispatch('input', newValue);\n });\n\n this.$watch('__isDisabled', newValue => {\n if (newValue) {\n this.__flatpickr.set('clickOpens', false);\n } else {\n this.__flatpickr.set('clickOpens', config.options.clickOpens);\n }\n });\n },\n\n __open() {\n ! this.__isDisabled && this.__flatpickr.open();\n },\n\n __clear() {\n if (this.__isDisabled) {\n return;\n }\n\n this.__value = this.__mode === 'single'\n ? null\n : [];\n },\n\n __config() {\n let onOpen = [\n function (selectedDates, dateStr, instance) {\n instance.setDate(this.__rawValue);\n }.bind(this),\n ];\n\n let customConfig = config.config ?? {};\n if (customConfig.hasOwnProperty('onOpen')) {\n let customOnOpen = Array.isArray(customConfig.onOpen) ? customConfig.onOpen : [customConfig.onOpen];\n\n onOpen = onOpen.concat(customOnOpen);\n\n delete customConfig.onOpen;\n }\n\n return {\n defaultDate: this.__rawValue,\n ...config.options,\n onOpen,\n onChange: function(date, dateString) {\n let newValue = dateString;\n if (this.__mode === 'multiple') {\n newValue = dateString.split(', ');\n } else if (this.__mode === 'range') {\n newValue = dateString.split(' to ');\n }\n\n this.__value = newValue;\n }.bind(this),\n ...customConfig,\n };\n },\n }));\n\n Alpine.directive('date-picker', (el, directive, { cleanup }) => {\n switch (directive.value) {\n case 'clear':\n handleClear(el, Alpine);\n break;\n case 'container':\n handleContainer(el, Alpine);\n break;\n case 'input':\n handleInput(el, Alpine);\n\n cleanup(() => {\n const parent = el.closest('[x-data]');\n\n parent && Alpine.$data(parent).__flatpickr.destroy();\n });\n\n break;\n case 'toggle':\n handleToggle(el, Alpine);\n break;\n default:\n throw new Error(`Unknown date-picker directive value: ${directive.value}`);\n }\n });\n\n Alpine.magic('datePicker', el => {\n let data = Alpine.$data(el);\n\n if (! data.__ready) {\n return {\n isDisabled: false,\n flatpickr: undefined,\n hasValue: false,\n open() {},\n };\n }\n\n return {\n get isDisabled() {\n return data.__isDisabled;\n },\n get flatpickr() {\n return data.__flatpickr;\n },\n get hasValue() {\n if (data.__mode === 'single') {\n return data.__value !== null && data.__value !== '';\n }\n\n return Array.isArray(data.__value) && data.__value.length > 0;\n },\n open() {\n data.__open();\n },\n };\n });\n}\n\nfunction handleInput(el, Alpine) {\n Alpine.bind(el, {\n 'x-ref': '__input',\n 'type': 'text',\n 'x-init'() {\n this.$data.__isDisabled = this.$el.disabled || this.$el.readOnly;\n\n queueMicrotask(() => {\n const observer = new MutationObserver(mutations => {\n mutations.forEach(mutation => {\n if (mutation.attributeName === 'disabled' || mutation.attributeName === 'readonly') {\n this.$data.__isDisabled = this.$el.disabled || this.$el.readOnly;\n }\n });\n });\n\n observer.observe(this.$el, { attributes: true });\n });\n },\n });\n}\n\n// Since we're using wire:ignore on the input, we are going to show error attributes (i.e. aria-invalid) on the container.\n// We'll watch for these changes with a mutation observer and then apply them to the input.\nfunction handleContainer(el, Alpine) {\n Alpine.bind(el, {\n 'x-ref': '__container',\n 'role': 'none',\n 'x-init'() {\n const observer = new MutationObserver(mutations => {\n mutations.forEach(mutation => {\n if (mutation.attributeName === 'aria-invalid') {\n const invalid = mutation.target.getAttribute('aria-invalid') === 'true';\n\n if (invalid) {\n this.$refs.__input.setAttribute('aria-invalid', 'true');\n this.$refs.__input.classList.add('input-error');\n } else {\n this.$refs.__input.removeAttribute('aria-invalid');\n this.$refs.__input.classList.remove('input-error');\n }\n } else if (mutation.attributeName === 'aria-describedby') {\n const describedBy = mutation.target.getAttribute('aria-describedby');\n\n if (describedBy) {\n this.$refs.__input.setAttribute('aria-describedby', describedBy);\n } else {\n this.$refs.__input.removeAttribute('aria-describedby');\n }\n }\n });\n });\n\n observer.observe(this.$el, { attributes: true });\n },\n });\n}\n\nfunction handleToggle(el, Alpine) {\n Alpine.bind(el, {\n 'x-ref': '__toggle',\n ':role'() {\n if (this.$datePicker.isDisabled) {\n return false;\n }\n\n if (this.$el.tagName.toLowerCase() === 'button') {\n return false;\n }\n\n return 'button';\n },\n '@click'() {\n this.$datePicker.open();\n },\n });\n}\n\nfunction handleClear(el, Alpine) {\n Alpine.bind(el, {\n 'x-ref': '__clear',\n 'x-init'() {\n if (this.$el.tagName.toLowerCase() === 'button' && ! this.$el.hasAttribute('type')) {\n this.$el.setAttribute('type', 'button');\n }\n },\n '@click'() {\n this.$data.__clear();\n },\n 'x-show'() { return this.$datePicker.hasValue && ! this.$datePicker.isDisabled },\n });\n}\n","export default options => ({\n value: false,\n onValue: true,\n offValue: false,\n ...options,\n\n get isPressed() {\n if (Array.isArray(this.value)) {\n return this.value.includes(this.onValue);\n }\n\n return this.value === this.onValue;\n },\n\n toggle() {\n if (Array.isArray(this.value)) {\n this.isPressed\n ? this.value.splice(this.value.indexOf(this.onValue), 1)\n : this.value.push(this.onValue);\n } else {\n this.value = this.isPressed ? this.offValue : this.onValue;\n }\n\n this.$dispatch('input', this.value);\n },\n});\n","import selectContext from '../mixins/selectContext';\nimport { keyByValue } from '../mixins/selectContext';\n\nexport const generateContext = ({ multiple, orientation, __wire, __wireSearch, __config, Alpine }) => {\n return {\n ...selectContext(Alpine),\n\n /**\n * Select configuration.\n */\n\n __multiple: multiple,\n __orientation: orientation,\n __wire,\n __wireSearch,\n __config,\n\n /**\n * Tree select specific configuration.\n */\n\n expandableEls: {},\n expandedKeys: [],\n\n __itemBooted(el, value, disabled, key) {\n // We need to wait for the option to finish initializing before we can check\n // for the presence of children.\n queueMicrotask(() => {\n if (el.__children?.length) {\n this.expandableEls[key] = el;\n }\n });\n },\n\n __itemDestroyed(el, key) {\n if (this.expandableEls[key]) {\n delete this.expandableEls[key];\n }\n\n if (this.expandedKeys.includes(key)) {\n this.expandedKeys.splice(this.expandedKeys.indexOf(key), 1);\n }\n },\n\n isExpandedEl(el) {\n const key = keyByValue(this.elsByKey, el);\n\n if (! key) {\n return;\n }\n\n return this.expandedKeys.includes(key);\n },\n\n toggleExpandedEl(el) {\n const key = keyByValue(this.elsByKey, el);\n\n if (! key) {\n return;\n }\n\n this.toggleExpanded(key);\n },\n\n toggleExpanded(key) {\n if (this.expandedKeys.includes(key)) {\n this.expandedKeys.splice(this.expandedKeys.indexOf(key), 1);\n } else {\n this.expandedKeys.push(key);\n }\n },\n\n expandChildren(key) {\n if (! this.expandedKeys.includes(key)) {\n this.expandedKeys.push(key);\n }\n },\n\n collapseChildren(key) {\n if (this.expandedKeys.includes(key)) {\n this.expandedKeys.splice(this.expandedKeys.indexOf(key), 1);\n }\n },\n\n __activateByKeyEvent(e) {\n if (! this.hasActive()) {\n return;\n }\n\n switch (e.key) {\n case ['ArrowRight', 'ArrowDown'][this.__orientation === 'vertical' ? 0 : 1]:\n e.preventDefault();\n e.stopPropagation();\n\n if (this.expandableEls[this.activeKey]) {\n this.expandChildren(this.activeKey);\n }\n\n return false;\n case ['ArrowLeft', 'ArrowUp'][this.__orientation === 'vertical' ? 0 : 1]:\n e.preventDefault();\n e.stopPropagation();\n\n if (this.expandableEls[this.activeKey]) {\n this.collapseChildren(this.activeKey);\n }\n\n return false;\n }\n },\n\n /**\n * Getters that don't work in the mixin for some reason...\n */\n\n get isScrollingTo() {\n return this.scrollingCount > 0;\n },\n\n get nonDisabledOrderedKeys() {\n return this.orderedKeys.filter(i => ! this.isDisabled(i));\n },\n };\n};\n","import { generateContext } from '../util/treeSelectContext';\nimport selectPopper from '../mixins/selectPopper';\nimport {\n buttonDirective,\n clearButtonDirective,\n labelDirective,\n optionsDirective,\n optionDirective,\n searchDirective,\n selectData,\n tokenDirective,\n} from '../mixins/select';\nimport { rootMagic, optionMagic } from '../mixins/selectMagic';\n\nexport default function (Alpine) {\n Alpine.data('treeSelect', config => {\n return {\n ...selectPopper,\n\n ...selectData(config.__el, Alpine, config),\n\n __type: 'tree',\n\n __generateContext(el, Alpine, config) {\n return generateContext({\n multiple: this.__isMultiple,\n orientation: this.__orientation,\n __wire: config.__wire,\n __wireSearch: Alpine.bound(el, 'livewire-search'),\n __config: config.__config ?? {},\n Alpine,\n });\n },\n };\n });\n\n Alpine.directive('tree-select', (el, directive, { cleanup }) => {\n switch (directive.value) {\n case 'button':\n handleButton(el, Alpine);\n break;\n case 'label':\n handleLabel(el, Alpine);\n break;\n case 'clear':\n handleClearButton(el, Alpine);\n break;\n case 'options':\n handleOptions(el, Alpine);\n break;\n case 'option':\n handleOption(el, Alpine);\n\n // We need to notify the context that the option has left the DOM.\n cleanup(() => {\n const parent = el.closest('[x-data]');\n\n parent && Alpine.$data(parent).__context.destroyItem(el);\n });\n\n break;\n case 'search':\n handleSearch(el, Alpine);\n break;\n case 'token':\n handleToken(el, Alpine);\n break;\n case 'child-toggle':\n handleChildToggle(el, Alpine);\n break;\n case 'children':\n handleChildren(el, Alpine);\n break;\n\n default:\n throw new Error(`Unknown tree-select directive: ${directive.value}`);\n }\n });\n\n Alpine.magic('treeSelect', el => {\n return rootMagic(\n el,\n Alpine,\n data => {\n return {\n get hasExpandableOptions() {\n return Object.keys(data.__context.expandableEls).length > 0;\n },\n };\n },\n );\n });\n\n Alpine.magic('treeSelectOption', el => {\n return optionMagic(\n el,\n Alpine,\n (data, context, optionEl) => {\n return {\n get hasChildren() {\n return optionEl.__children && optionEl.__children.length > 0;\n },\n get isExpanded() {\n return context.isExpandedEl(optionEl);\n },\n };\n },\n () => {\n return {\n hasChildren: false,\n };\n },\n );\n });\n}\n\nfunction handleButton(el, Alpine) {\n Alpine.bind(el, {\n ...buttonDirective(el, Alpine),\n });\n}\n\nfunction handleLabel(el, Alpine) {\n Alpine.bind(el, {\n ...labelDirective(el, Alpine),\n });\n}\n\nfunction handleClearButton(el, Alpine) {\n Alpine.bind(el, {\n ...clearButtonDirective(el, Alpine, 'tree'),\n });\n}\n\nfunction handleOptions(el, Alpine) {\n Alpine.bind(el, {\n ...optionsDirective(el, Alpine),\n });\n}\n\nfunction handleOption(el, Alpine) {\n Alpine.bind(el, {\n ...optionDirective(el, Alpine, 'tree'),\n\n 'data-tree-select-option': 'true',\n ':role'() { return 'option' },\n\n 'x-init'() {\n const initCallback = () => {\n let value = Alpine.bound(el, 'value');\n let disabled = Alpine.bound(el, 'disabled');\n\n el.__level = Alpine.bound(el, 'level', 0);\n\n el.__optionKey = this.$data.__context.initItem(el, value, disabled);\n\n const childrenField = this.$data.__config.childrenField;\n if (value?.hasOwnProperty(childrenField)) {\n el.__children = value[childrenField];\n }\n };\n\n // Our $customSelectOption magic only seems to work with queueMicrotask on initial page load,\n // so if our component says it's ready, we'll just run the code to initialize the option right away.\n if (this.$data.__ready) {\n initCallback();\n } else {\n queueMicrotask(initCallback);\n }\n },\n });\n}\n\nfunction handleSearch(el, Alpine) {\n Alpine.bind(el, {\n ...searchDirective(el, Alpine),\n });\n}\n\nfunction handleToken(el, Alpine) {\n Alpine.bind(el, {\n ...tokenDirective(el, Alpine),\n });\n}\n\nfunction handleChildToggle(el, Alpine) {\n Alpine.bind(el, {\n 'x-init'() {\n if (el.tagName.toLowerCase() !== 'button') {\n el.setAttribute('role', 'button');\n }\n },\n '@click.stop.prevent'() {\n let optionEl = Alpine.findClosest(el, i => i.__optionKey);\n\n optionEl && this.$data.__context.toggleExpandedEl(optionEl);\n },\n });\n}\n\n// We are using this directive to hide/show the children of an option because it is out of the scope\n// of where the $treeSelectOption magic will pick up on the state of the option.\nfunction handleChildren(el, Alpine) {\n Alpine.bind(el, {\n 'data-tree-select-children': 'true',\n 'x-data'() {\n return {\n __optionEl: undefined,\n init() {\n try {\n this.__optionEl = el.parentNode.querySelector('[data-tree-select-option=\"true\"]');\n } catch (e) {}\n },\n get __isExpanded() {\n return this.__optionEl && this.$data.__context.isExpandedEl(this.__optionEl);\n }\n };\n },\n 'x-show'() { return this.$data.__isExpanded },\n });\n}\n","import customSelect from './custom-select';\nimport datePicker from './date-picker';\nimport filepond from './filepond';\nimport quill from './quill';\nimport switchToggle from './switch-toggle';\nimport treeSelect from './tree-select';\n\ndocument.addEventListener('alpine:init', () => {\n customSelect(Alpine);\n datePicker(Alpine);\n filepond(Alpine);\n quill(Alpine);\n treeSelect(Alpine);\n Alpine.data('switchToggle', switchToggle);\n});\n","export default function (Alpine) {\n Alpine.data('filepond', ({ __value, __this, __wireModel, options, __config, id }) => {\n return {\n __ready: false,\n __pond: null,\n __processingFiles: false,\n __value,\n\n init() {\n if (typeof window.FilePond?.create !== 'function') {\n throw new Error(`filepond requires FilePond to be loaded. See https://pqina.nl/filepond/docs/getting-started/installation/javascript/`);\n }\n\n queueMicrotask(() => {\n this.__ready = true;\n\n let pondOptions = { ...options };\n\n if (__this && __wireModel) {\n pondOptions.server = {\n process: (fieldName, file, metadata, load, error, progress, abort, transfer, options) => {\n __this.upload(__wireModel, file, load, error, progress);\n },\n revert: (filename, load) => {\n __this.removeUpload(__wireModel, filename, load);\n },\n };\n\n // To prevent our wire:model watcher from pre-maturely removing files from\n // filepond, we need to tell our component we are still processing.\n pondOptions.onaddfilestart = () => this.__processingFiles = true;\n\n pondOptions.onprocessfiles = () => this.__processingFiles = false;\n }\n\n if (__this) {\n // Listen for livewire components to emit a file-pond-clear event.\n __this.on('file-pond-clear', (desiredId) => this.__clear(desiredId));\n }\n\n pondOptions = { ...pondOptions, ...__config(this, options, pondOptions) };\n\n this.__pond = window.FilePond.create(this.$refs.input, pondOptions);\n });\n\n this.$watch('__value', newValue => {\n if (! this.__ready) {\n return;\n }\n\n if (options.allowMultiple) {\n // If filepond is processing files, we shouldn't do anything.\n if (this.__processingFiles) {\n return;\n }\n\n // If the new value is null or undefined, we'll just remove everything from filepond.\n if (! newValue) {\n return this.__clear();\n }\n\n // Remove files from filepond that are not present in the new value.\n const serverIds = Array.isArray(newValue) ? newValue : JSON.parse(String(newValue).split('livewire-files:')[1]);\n\n this.__pond.getFiles().forEach(f => {\n if (! serverIds.includes(f.serverId)) {\n this.__pond.removeFile(f.id);\n }\n });\n\n return;\n }\n\n if (! newValue) {\n this.__clear();\n }\n });\n },\n\n __clear(eventId) {\n if (! eventId || (eventId === id)) {\n clearFilepond(this.__pond, options.allowMultiple);\n }\n },\n };\n });\n}\n\nfunction clearFilepond(instance, allowMultiple) {\n if (allowMultiple) {\n instance.getFiles().forEach(file => instance.removeFile(file.id));\n } else {\n instance.removeFile();\n }\n}\n","export default function (Alpine) {\n Alpine.data('quill', ({ __value, options, __config, onTextChange, onInit }) => {\n return {\n __ready: false,\n __value,\n __quill: undefined,\n\n init() {\n if (typeof window.Quill !== 'function') {\n throw new Error(`quill requires Quill to be loaded. See https://quilljs.com/docs/installation/`);\n }\n\n queueMicrotask(() => {\n this.__ready = true;\n\n this.__quill = new window.Quill(this.$refs.quill, this.__quillOptions());\n\n this.__quill.root.innerHTML = this.__value;\n\n this.__quill.on('text-change', () => {\n if (typeof onTextChange === 'function') {\n const result = onTextChange(this);\n\n if (result === false) {\n return;\n }\n }\n\n this.__value = this.__quill.root.innerHTML;\n\n this.$dispatch('input', this.__value);\n });\n\n if (options.autofocus) {\n this.$nextTick(() => {\n this.focus();\n });\n }\n\n if (typeof onInit === 'function') {\n onInit(this);\n }\n });\n },\n\n focus() {\n if (! this.__ready) {\n return;\n }\n\n this.__quill.focus();\n },\n\n __quillOptions() {\n let config = __config(this, options);\n let toolbarHandlers = {};\n let modules = {};\n\n if (config.hasOwnProperty('toolbarHandlers')) {\n toolbarHandlers = config.toolbarHandlers;\n delete config.toolbarHandlers;\n }\n\n if (config.hasOwnProperty('modules')) {\n modules = config.modules;\n delete config.modules;\n }\n\n return {\n theme: options.theme,\n readOnly: options.readOnly,\n placeholder: options.placeholder,\n modules: {\n toolbar: {\n container: options.toolbar,\n handlers: toolbarHandlers,\n },\n ...modules,\n },\n ...config,\n };\n },\n };\n });\n}\n","const resize = el => {\n el.style.height = 'auto';\n el.style.height = `${el.scrollHeight}px`;\n};\n\nexport default Alpine => {\n Alpine.directive('textarea-resize', (el, {}, { cleanup }) => {\n el.style.minHeight = `${el.scrollHeight}px`;\n resize(el);\n\n const inputHandler = () => resize(el);\n\n el.addEventListener('input', inputHandler);\n\n cleanup(() => {\n el.removeEventListener('input', inputHandler);\n });\n });\n};\n","import formGroup from './form-group';\nimport textareaResize from './textarea-resize';\n\ndocument.addEventListener('alpine:init', () => {\n formGroup(Alpine);\n Alpine.plugin(textareaResize);\n});\n","export default function (Alpine) {\n Alpine.directive('form-group', (el, directive) => {\n if (directive.value === 'label') {\n handleLabel(el, Alpine);\n } else {\n handleRoot(el, Alpine);\n }\n });\n}\n\nfunction handleRoot(el, Alpine) {\n Alpine.bind(el, {\n 'x-id'() { return ['fc-label'] },\n });\n}\n\nfunction handleLabel(el, Alpine) {\n Alpine.bind(el, {\n '@click'() {\n const group = el.closest('[x-form-group]');\n if (! group) {\n return;\n }\n\n // Check if there is a custom select in the form group.\n const customSelectButton = group.querySelector('[data-custom-select-button=\"true\"]');\n if (customSelectButton) {\n customSelectButton.focus({ preventScroll: true });\n\n return;\n }\n\n // Check if there is a quill editor in the form group.\n const quill = group.querySelector('.quill-wrapper');\n if (quill) {\n Alpine.$data(quill).focus();\n }\n },\n });\n}\n"],"names":["selectContext","Alpine","searchableText","disabledKeys","activeKey","selectedKeys","orderedKeys","elsByKey","values","__config","__multiple","__orientation","__wire","undefined","__wireSearch","initItem","el","value","disabled","isOptGroup","arguments","length","key","Math","random","toString","substring","keyFromValue","this","getKeyFromValue","by","push","textContent","trim","toLowerCase","__itemBooted","destroyItem","keyByValue","includes","indexOf","reorderKeys","__itemDestroyed","resetOptions","_this","forEach","isConnected","slice","sort","a","z","aEl","zEl","position","compareDocumentPosition","Node","DOCUMENT_POSITION_FOLLOWING","DOCUMENT_POSITION_PRECEDING","activeEl","isActiveEl","activateEl","activateKey","selectEl","selectKey","isSelectedEl","isSelected","isDisabledEl","isDisabled","hideEl","style","display","setAttribute","showEl","removeAttribute","isHiddenEl","offsetParent","scrollingCount","activateAndScrollToKey","_this2","targetEl","scrollIntoView","block","setTimeout","selectedBasicValueOrValues","selectedBasicValues","selectedBasicValue","_this3","map","i","hasOwnProperty","selectedValueOrValues","selectedValues","selectedValue","_this4","selectValue","_this5","normalizeValue","mapByToCallback","keys","selectExclusive","getKeyFromSimpleValue","mapByToSimpleCompareCallback","getObjectFromValue","toggleValue","toggleSelected","selectOnly","canRemoveOptions","splice","_this6","toAdd","_toConsumableArray","clearSelected","optional","selectActive","firstSelectedKey","hasActive","isActiveKey","active","activateSelectedOrFirst","_this7","firstSelected","firstKey","deactivate","isScrollingTo","nextKey","_this8","index","nonDisabledOrderedKeys","findIndex","targetKey","getNextVisibleKey","prevKey","_this9","getPrevVisibleKey","lastKey","currentIndex","visibleKeyFound","searchQuery","clearSearch","debounce","searchKey","query","foundKey","startsWith","searchableQuery","handleSearchableQuery","content","minSelected","Number","isNaN","activateByKeyEvent","e","__activateByKeyEvent","preventDefault","stopPropagation","object","Object","find","renderHiddenInputs","name","newInputs","generateInputs","_x_hiddenInput","_x_ignore","children","oldInputs","child","window","mutateDom","remove","reverse","prepend","b","property","multiple","Array","isArray","subject","carry","_typeof","concat","document","createElement","generateContext","_ref","orientation","_objectSpread","filter","selectPopper","__createPopper","__popper","__resetPopper","destroy","__popperConfig","placement","strategy","__fixed","modifiers","options","offset","boundariesElement","$root","__initPopper","$refs","__options","selectData","config","_config$__value","__ready","__value","__richValue","__isOpen","__context","__isMultiple","__isStatic","__isClearable","__isDisabled","__compareBy","__inputName","__searchable","__hasCustomSelectLabel","__externalChanged","__type","init","Popper","createPopper","TypeError","bound","autoFocus","__generateContext","defaultValue","queueMicrotask","lastValueFingerprint","effect","JSON","stringify","_step","_iterator","_createForOfIteratorHelper","s","n","done","err","f","$el","querySelectorAll","__button","focus","preventScroll","$watch","newValue","$dispatch","__componentBooted","__open","callback","__search","requestAnimationFrame","__close","$nextTick","clearButtonDirective","type","magic","$data","hasValue","shouldShowClear","tagName","hasAttribute","optionsDirective","$id","tabindex","role","id","optionDirective","rootMagic","initCallback","__optionKey","canSelectMore","tokenDirective","__key","stubCallback","data","isOpen","isSearchable","selected","selectedObject","maxSelected","canDeselectOptions","hasOptions","hasSearch","optionMagic","stub","isActive","optionEl","findClosest","context","customSelect","__el","_config$__config","directive","cleanup","bind","buttonDirective","blur","$magic","$treeSelect","$customSelect","lastSelected","handleButton","labelDirective","handleLabel","handleClearButton","handleOptions","handleOption","parent","closest","searchDirective","createTextRange","range","move","select","setSelectionRange","target","keydownSpaceStop","handleSearch","handleToken","Error","datePicker","_config$mode","__rawValue","__mode","mode","__flatpickr","_value","flatpickr","initialValue","__input","setDate","set","clickOpens","open","__clear","_config$config","onOpen","selectedDates","dateStr","instance","customConfig","customOnOpen","defaultDate","onChange","date","dateString","split","_ref2","$datePicker","handleClear","MutationObserver","mutations","mutation","attributeName","getAttribute","classList","add","describedBy","observe","attributes","handleContainer","readOnly","handleInput","handleToggle","switchToggle","onValue","offValue","isPressed","toggle","expandableEls","expandedKeys","_el$__children","__children","isExpandedEl","toggleExpandedEl","toggleExpanded","expandChildren","collapseChildren","treeSelect","__level","childrenField","handleChildToggle","__optionEl","parentNode","querySelector","__isExpanded","handleChildren","hasExpandableOptions","hasChildren","isExpanded","addEventListener","__this","__wireModel","__pond","__processingFiles","_window$FilePond","FilePond","create","pondOptions","server","process","fieldName","file","metadata","load","error","progress","abort","transfer","upload","revert","filename","removeUpload","onaddfilestart","onprocessfiles","on","desiredId","input","allowMultiple","serverIds","parse","String","getFiles","serverId","removeFile","eventId","filepond","onTextChange","onInit","__quill","Quill","quill","__quillOptions","root","innerHTML","autofocus","toolbarHandlers","modules","theme","placeholder","toolbar","container","handlers","resize","height","scrollHeight","textareaResize","_objectDestructuringEmpty","minHeight","inputHandler","removeEventListener","group","customSelectButton","handleRoot","formGroup","plugin"],"mappings":"gnFAAA,IAAAA,cAAA,SAAeC,QAAM,MAAK,CAEtBC,eAAgB,CAAE,EAClBC,aAAc,GACdC,UAAW,KACXC,aAAc,GACdC,YAAa,GACbC,SAAU,CAAE,EACZC,OAAQ,CAAE,EAGVC,SAAU,CAAE,EACZC,YAAY,EACZC,cAAe,WACfC,YAAQC,EACRC,kBAAcD,EAMdE,kBAASC,GAAIC,MAAOC,UAA8B,IAApBC,WAAUC,UAAAC,OAAA,QAAAR,IAAAO,UAAA,IAAAA,UAAA,GAChCE,KAAOC,KAAKC,SAAW,GAAGC,SAAS,IAAIC,UAAU,GAI/CC,aAAeC,KAAKC,gBAAgBZ,MAAOW,KAAKnB,SAASqB,IAM/D,OALIH,eACAL,IAAMK,cAINR,aAKJS,KAAKpB,OAAOc,KAAOL,MAGnBW,KAAKrB,SAASe,KAAON,GAGrBY,KAAKtB,YAAYyB,KAAKT,KAGtBM,KAAK1B,eAAeoB,KAAON,GAAGgB,YAAYC,OAAOC,cAGjDhB,UAAYU,KAAKzB,aAAa4B,KAAKT,KAEnCM,KAAKO,aAAanB,GAAIC,MAAOC,SAAUI,MAlB5BA,GAqBd,EAKDa,aAAY,SAACnB,GAAIC,MAAOC,SAAUI,KAAO,EAEzCc,YAAW,SAACpB,IACR,IAAIM,IAAMe,WAAWT,KAAKrB,SAAUS,IAG9BY,KAAKvB,aAAaiC,SAAShB,aACtBM,KAAKpB,OAAOc,YAGhBM,KAAKrB,SAASe,YACdM,KAAKtB,YAAYsB,KAAKtB,YAAYiC,QAAQjB,aAC1CM,KAAK1B,eAAeoB,YACpBM,KA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XA,OAAOsR,KAAK,eAAgB0F,aAChC,IGdA,IAAM+E,OAAS,SAAAhb,IACXA,GAAGoD,MAAM6X,OAAS,OAClBjb,GAAGoD,MAAM6X,OAAM,GAAA9Q,OAAMnK,GAAGkb,aAAgB,KAC5C,EAEeC,eAAA,SAAAlc,QACXA,OAAOwS,UAAU,mBAAmB,SAACzR,GAAEuK,KAAAyK,kFAAsBoG,CAAA7Q,MAAA,IAAdmH,QAAOsD,MAAPtD,QAC3C1R,GAAGoD,MAAMiY,UAAS,GAAAlR,OAAMnK,GAAGkb,aAAgB,MAC3CF,OAAOhb,IAEP,IAAMsb,aAAe,WAAH,OAASN,OAAOhb,GAAG,EAErCA,GAAG2X,iBAAiB,QAAS2D,cAE7B5J,SAAQ,WACJ1R,GAAGub,oBAAoB,QAASD,aACpC,GACJ,GACH,ECfDlR,SAASuN,iBAAiB,eAAe,YCH1B,SAAU1Y,QACrBA,OAAOwS,UAAU,cAAc,SAACzR,GAAIyR,WACR,UAApBA,UAAUxR,MActB,SAAqBD,GAAIf,QACrBA,OAAO0S,KAAK3R,GAAI,CACZ,SAAQ,WACJ,IAAMwb,MAAQxb,GAAGyS,QAAQ,kBACzB,GAAM+I,MAAN,CAKA,IAAMC,mBAAqBD,MAAMnE,cAAc,sCAC/C,GAAIoE,mBACAA,mBAAmBnN,MAAM,CAAEC,eAAe,QAD9C,CAOA,IAAM6L,MAAQoB,MAAMnE,cAAc,kBAC9B+C,OACAnb,OAAOoQ,MAAM+K,OAAO9L,OALxB,CARA,CAeJ,GAER,CApCY8D,CAAYpS,GAAIf,QAO5B,SAAoBe,GAAIf,QACpBA,OAAO0S,KAAK3R,GAAI,CACZ,OAAM,WAAK,MAAO,CAAC,WAAY,GAEvC,CATY0b,CAAW1b,GAAIf,OAEvB,GACJ,CDJI0c,CAAU1c,QACVA,OAAO2c,OAAOT,eAClB"} \ No newline at end of file +{"version":3,"file":"form-components.js","sources":["../resources/js/mixins/selectContext.js","../resources/js/util/customSelectContext.js","../resources/js/mixins/selectPopper.js","../resources/js/mixins/select.js","../resources/js/mixins/selectMagic.js","../resources/js/components/custom-select.js","../resources/js/components/date-picker.js","../resources/js/components/switch-toggle.js","../resources/js/util/treeSelectContext.js","../resources/js/components/tree-select.js","../resources/js/components/index.js","../resources/js/components/filepond.js","../resources/js/components/quill.js","../resources/js/directives/textarea-resize.js","../resources/js/directives/index.js","../resources/js/directives/form-group.js"],"sourcesContent":["export default Alpine => ({\n // Main state.\n searchableText: {},\n disabledKeys: [],\n activeKey: null,\n selectedKeys: [],\n orderedKeys: [],\n elsByKey: {},\n values: {},\n\n // These keys will be overridden by each select context implementation.\n __config: {},\n __multiple: false,\n __orientation: 'vertical',\n __wire: undefined,\n __wireSearch: undefined,\n\n /**\n * Initialization.\n */\n\n initItem(el, value, disabled, isOptGroup = false) {\n let key = (Math.random() + 1).toString(36).substring(7);\n\n // If the value is already selected, we will replace the key with the exising one.\n // This usually only happens when options are refreshed via ajax.\n const keyFromValue = this.getKeyFromValue(value, this.__config.by);\n if (keyFromValue) {\n key = keyFromValue;\n }\n\n // We don't need to track \"opt groups\".\n if (isOptGroup) {\n return key;\n }\n\n // Register value by key.\n this.values[key] = value;\n\n // Associate key with element.\n this.elsByKey[key] = el;\n\n // Register key for ordering.\n this.orderedKeys.push(key);\n\n // Register key for searching.\n this.searchableText[key] = el.textContent.trim().toLowerCase();\n\n // Store whether disabled or not.\n disabled && this.disabledKeys.push(key);\n\n this.__itemBooted(el, value, disabled, key);\n\n return key;\n },\n\n /**\n * This provides a way for each select implementation to hook into the initItem process.\n */\n __itemBooted(el, value, disabled, key) {},\n\n destroyItem(el) {\n let key = keyByValue(this.elsByKey, el);\n\n // We need to preserve this to keep the display on the button accurate.\n if (! this.selectedKeys.includes(key)) {\n delete this.values[key];\n }\n\n delete this.elsByKey[key];\n delete this.orderedKeys[this.orderedKeys.indexOf(key)];\n delete this.searchableText[key];\n delete this.disabledKeys[key];\n\n this.reorderKeys();\n\n this.__itemDestroyed(el, key);\n },\n\n /**\n * This provides a way for each select implementation to hook into the destroyItem process.\n */\n __itemDestroyed(el, key) {},\n\n resetOptions() {\n this.activeKey = null;\n\n this.reorderKeys();\n },\n\n /**\n * Handle elements.\n */\n\n reorderKeys() {\n // Filter out elements removed from the DOM.\n this.orderedKeys.forEach(key => {\n const el = this.elsByKey[key];\n\n if (el?.isConnected) {\n return;\n }\n\n this.destroyItem(el);\n });\n\n this.orderedKeys = this.orderedKeys.slice().sort((a, z) => {\n if (a === null || z === null) {\n return 0;\n }\n\n const aEl = this.elsByKey[a];\n const zEl = this.elsByKey[z];\n\n const position = aEl.compareDocumentPosition(zEl);\n\n if (position & Node.DOCUMENT_POSITION_FOLLOWING) {\n return -1;\n }\n\n if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n return 1;\n }\n\n return 0;\n });\n },\n\n activeEl() {\n if (! this.activeKey) {\n return;\n }\n\n return this.elsByKey[this.activeKey];\n },\n\n isActiveEl(el) {\n const key = keyByValue(this.elsByKey, el);\n\n if (! key) {\n return;\n }\n\n return this.activeKey === key;\n },\n\n activateEl(el) {\n const key = keyByValue(this.elsByKey, el);\n\n if (! key) {\n return;\n }\n\n this.activateKey(key);\n },\n\n selectEl(el) {\n const key = keyByValue(this.elsByKey, el);\n\n if (! key) {\n return;\n }\n\n this.selectKey(key);\n },\n\n isSelectedEl(el) {\n const key = keyByValue(this.elsByKey, el);\n\n if (! key) {\n return;\n }\n\n return this.isSelected(key);\n },\n\n isDisabledEl(el) {\n const key = keyByValue(this.elsByKey, el);\n\n if (! key) {\n return;\n }\n\n return this.isDisabled(key);\n },\n\n hideEl(el) {\n el.style.display = 'none';\n el.setAttribute('data-hidden', 'true');\n },\n\n showEl(el) {\n el.style.display = '';\n el.removeAttribute('data-hidden');\n },\n\n isHiddenEl(el) {\n if (el.style.display === 'none') {\n return true;\n }\n\n return ! el.offsetParent;\n },\n\n scrollingCount: 0,\n\n activateAndScrollToKey(key) {\n // This addresses the following problem:\n // If deactivate is hooked up to mouseleave,\n // scrolling to an element will trigger deactivation.\n // This \"isScrollingTo\" is exposed to prevent that.\n this.scrollingCount++;\n\n this.activateKey(key);\n\n const targetEl = this.elsByKey[key];\n\n targetEl && targetEl.scrollIntoView({ block: 'nearest' });\n\n setTimeout(() => {\n this.scrollingCount--;\n }, 25);\n },\n\n /**\n * Handle values.\n */\n\n selectedBasicValueOrValues(by) {\n if (this.__multiple) {\n return this.selectedBasicValues(by);\n }\n\n return this.selectedBasicValue(by);\n },\n\n selectedBasicValues(by) {\n return this.selectedKeys.map(i => {\n const value = this.values[i];\n\n if (value?.hasOwnProperty(by)) {\n return value[by];\n }\n\n return value;\n });\n },\n\n selectedBasicValue(by) {\n const value = this.selectedKeys[0]\n ? this.values[this.selectedKeys[0]]\n : null;\n\n if (value?.hasOwnProperty(by)) {\n return value[by];\n }\n\n return value;\n },\n\n selectedValueOrValues() {\n if (this.__multiple) {\n return this.selectedValues();\n }\n\n return this.selectedValue();\n },\n\n selectedValues() {\n return this.selectedKeys.map(i => this.values[i]);\n },\n\n selectedValue() {\n return this.selectedKeys[0] ? this.values[this.selectedKeys[0]] : null;\n },\n\n selectValue(value, by) {\n value = normalizeValue(value, this.__multiple);\n by = mapByToCallback(by);\n\n if (this.__multiple) {\n let keys = [];\n\n value.forEach(i => {\n for (let key in this.values) {\n if (by(this.values[key], i)) {\n if (! keys.includes(key)) {\n keys.push(key);\n }\n }\n }\n });\n\n this.selectExclusive(keys);\n\n return;\n }\n\n for (let key in this.values) {\n if (value && by(this.values[key], value)) {\n this.selectKey(key);\n }\n }\n\n // Handle edge cases where value is updated externally to null.\n if (value === null) {\n this.selectedKeys = [];\n }\n },\n\n getKeyFromValue(value, by) {\n if (! value) {\n return;\n }\n\n by = mapByToCallback(by);\n\n for (let key in this.values) {\n if (by(this.values[key], value)) {\n return key;\n }\n }\n },\n\n getKeyFromSimpleValue(value, by) {\n if (! value) {\n return;\n }\n\n by = mapByToSimpleCompareCallback(by);\n\n for (let key in this.values) {\n if (by(this.values[key], value)) {\n return key;\n }\n }\n },\n\n getObjectFromValue(value, by) {\n if (! value) {\n return;\n }\n\n by = mapByToSimpleCompareCallback(by);\n\n for (let key in this.values) {\n if (by(this.values[key], value)) {\n return this.values[key];\n }\n }\n },\n\n toggleValue(value, by) {\n if (! value) {\n return;\n }\n\n by = mapByToCallback(by);\n\n if (this.__multiple) {\n for (let key in this.values) {\n if (by(this.values[key], value)) {\n this.toggleSelected(key);\n\n break;\n }\n }\n }\n },\n\n /**\n * Handle disabled keys.\n */\n\n isDisabled(key) {\n return this.disabledKeys.includes(key);\n },\n\n /**\n * Handle selected keys.\n */\n\n selectKey(key) {\n if (this.isDisabled(key)) {\n return;\n }\n\n if (this.__multiple) {\n this.toggleSelected(key);\n } else {\n this.selectOnly(key);\n }\n },\n\n toggleSelected(key) {\n if (this.selectedKeys.includes(key)) {\n // If we have a minimum amount of options that must be selected, and we're greater than or equal\n // to that amount, we can't deselect this option.\n if (! this.canRemoveOptions()) {\n return;\n }\n\n this.selectedKeys.splice(this.selectedKeys.indexOf(key), 1);\n } else {\n this.selectedKeys.push(key);\n }\n },\n\n selectOnly(key) {\n this.selectedKeys = [];\n this.selectedKeys.push(key);\n },\n\n selectExclusive(keys) {\n // We can't just do this.selectedKeys = keys\n // because we need to preserve reactivity...\n let toAdd = [...keys];\n\n for (let i = 0; i < this.selectedKeys.length; i++) {\n if (keys.includes(this.selectedKeys[i])) {\n delete toAdd[toAdd.indexOf(this.selectedKeys[i])];\n continue;\n }\n\n if (! keys.includes(this.selectedKeys[i])) {\n delete this.selectedKeys[i];\n }\n }\n\n toAdd.forEach(i => {\n this.selectedKeys.push(i);\n });\n },\n\n clearSelected() {\n if (this.__config.optional === false) {\n return;\n }\n\n this.selectedKeys = [];\n },\n\n selectActive() {\n if (! this.activeKey) {\n return;\n }\n\n this.selectKey(this.activeKey);\n },\n\n isSelected(key) {\n return this.selectedKeys.includes(key);\n },\n\n firstSelectedKey() {\n return this.selectedKeys[0];\n },\n\n /**\n * Handle activated keys.\n */\n\n hasActive() {\n return !! this.activeKey;\n },\n\n isActiveKey(key) {\n return this.activeKey === key;\n },\n\n get active() {\n return this.hasActive() && this.values[this.activeKey];\n },\n\n activateSelectedOrFirst() {\n setTimeout(() => {\n let firstSelected = this.firstSelectedKey();\n\n if (firstSelected) {\n return this.activateAndScrollToKey(firstSelected);\n }\n\n let firstKey = this.firstKey();\n\n if (firstKey) {\n this.activateAndScrollToKey(firstKey);\n }\n }, 25);\n },\n\n activateKey(key) {\n if (this.isDisabled(key)) {\n return;\n }\n\n this.activeKey = key;\n },\n\n deactivate() {\n if (! this.activeKey) {\n return;\n }\n\n if (this.isScrollingTo) {\n return;\n }\n\n this.activeKey = null;\n },\n\n /**\n * Handle active key traversal.\n */\n\n nextKey() {\n if (! this.activeKey) {\n return;\n }\n\n let index = this.nonDisabledOrderedKeys.findIndex(i => i === this.activeKey)\n let targetKey = this.nonDisabledOrderedKeys[index + 1];\n\n if (targetKey && this.isHiddenEl(this.elsByKey[targetKey])) {\n // If the next key is hidden, we need to skip to the next visible non-disabled key.\n targetKey = this.getNextVisibleKey(index);\n }\n\n return targetKey || this.firstKey();\n },\n\n prevKey() {\n if (! this.activeKey) {\n return;\n }\n\n let index = this.nonDisabledOrderedKeys.findIndex(i => i === this.activeKey);\n let targetKey = this.nonDisabledOrderedKeys[index - 1];\n\n if (targetKey && this.isHiddenEl(this.elsByKey[targetKey])) {\n // If the previous key is hidden, we need to skip to the previous visible non-disabled key.\n targetKey = this.getPrevVisibleKey(index);\n }\n\n return targetKey || this.lastKey();\n },\n\n firstKey() {\n let targetKey = this.nonDisabledOrderedKeys[0];\n\n if (targetKey && this.isHiddenEl(this.elsByKey[targetKey])) {\n // If the first key is hidden, we need to skip to the next visible non-disabled key.\n targetKey = this.getNextVisibleKey(-1);\n }\n\n return targetKey;\n },\n\n lastKey() {\n let targetKey = this.nonDisabledOrderedKeys[this.nonDisabledOrderedKeys.length - 1];\n\n if (targetKey && this.isHiddenEl(this.elsByKey[targetKey])) {\n // If the last key is hidden, we need to skip to the previous visible non-disabled key.\n targetKey = this.getPrevVisibleKey(this.nonDisabledOrderedKeys.length);\n }\n\n return targetKey;\n },\n\n getNextVisibleKey(index) {\n let targetKey;\n let currentIndex = index + 2;\n let visibleKeyFound = false;\n\n while (currentIndex < this.nonDisabledOrderedKeys.length && ! visibleKeyFound) {\n targetKey = this.nonDisabledOrderedKeys[currentIndex];\n\n visibleKeyFound = ! this.isHiddenEl(this.elsByKey[targetKey]);\n\n currentIndex++;\n }\n\n if (! visibleKeyFound) {\n targetKey = null;\n }\n\n return targetKey;\n },\n\n getPrevVisibleKey(index) {\n let targetKey;\n let currentIndex = index - 2;\n let visibleKeyFound = false;\n\n while (currentIndex >= 0 && ! visibleKeyFound) {\n targetKey = this.nonDisabledOrderedKeys[currentIndex];\n\n visibleKeyFound = ! this.isHiddenEl(this.elsByKey[targetKey]);\n\n currentIndex--;\n }\n\n if (! visibleKeyFound) {\n targetKey = null;\n }\n\n return targetKey;\n },\n\n /**\n * Handle simple search when menu is focused.\n */\n\n searchQuery: '',\n\n clearSearch: Alpine.debounce(function () { this.searchQuery = '' }, 350),\n\n searchKey(query) {\n this.clearSearch();\n\n this.searchQuery += query;\n\n let foundKey;\n\n for (let key in this.searchableText) {\n let content = this.searchableText[key];\n\n if (content.startsWith(this.searchQuery)) {\n foundKey = key;\n break;\n }\n }\n\n if (! this.nonDisabledOrderedKeys.includes(foundKey)) {\n return;\n }\n\n return foundKey;\n },\n\n /**\n * Handle full text search from the search input.\n */\n\n searchableQuery: '',\n\n handleSearchableQuery(query) {\n if (query === this.searchableQuery) {\n return;\n }\n\n this.searchableQuery = query;\n\n if (this.__wire && this.__wireSearch) {\n this.__wire[this.__wireSearch](this.searchableQuery);\n\n return;\n }\n\n for (let key in this.searchableText) {\n const content = this.searchableText[key];\n const el = this.elsByKey[key];\n\n const match = this.searchableQuery\n ? content.toLowerCase().includes(this.searchableQuery.toLowerCase())\n : true;\n\n match\n ? this.showEl(el)\n : this.hideEl(el);\n }\n },\n\n /**\n * Other utils.\n */\n\n canRemoveOptions() {\n if (! this.__multiple && this.selectedKeys.length === 1) {\n return this.__config.optional;\n }\n\n const minSelected = this.__config.minSelected;\n\n if (Number.isNaN(minSelected) || minSelected < 1) {\n return true;\n }\n\n return this.selectedKeys.length > minSelected;\n },\n\n /**\n * Handle events.\n */\n\n activateByKeyEvent(e) {\n this.reorderKeys();\n\n if (this.__activateByKeyEvent(e) === false) {\n return;\n }\n\n let hasActive = this.hasActive();\n let targetKey;\n\n switch (e.key) {\n case 'Tab':\n case 'Backspace':\n case 'Delete':\n case 'Meta':\n break;\n case ['ArrowDown', 'ArrowRight'][this.__orientation === 'vertical' ? 0 : 1]:\n e.preventDefault();\n e.stopPropagation();\n targetKey = hasActive ? this.nextKey() : this.firstKey();\n break;\n case ['ArrowUp', 'ArrowLeft'][this.__orientation === 'vertical' ? 0 : 1]:\n e.preventDefault();\n e.stopPropagation();\n targetKey = hasActive ? this.prevKey() : this.lastKey();\n break;\n case 'Home':\n case 'PageUp':\n e.preventDefault();\n e.stopPropagation();\n targetKey = this.firstKey();\n break;\n case 'End':\n case 'PageDown':\n e.preventDefault();\n e.stopPropagation();\n targetKey = this.lastKey();\n break;\n default:\n if (e.key.length === 1) {\n targetKey = this.searchKey(e.key);\n }\n\n break;\n }\n\n if (targetKey) {\n this.activateAndScrollToKey(targetKey);\n }\n },\n\n // This is a way to allow each select implementation to add their own logic to keyboard events on the options menu.\n __activateByKeyEvent(e) {},\n});\n\nexport const keyByValue = (object, value) => Object.keys(object).find(key => object[key] === value);\n\nexport const isObjectOrArray = subject => typeof subject === 'object' && subject !== null;\n\nexport const renderHiddenInputs = (el, name, value) => {\n // Create input elements.\n let newInputs = generateInputs(name, value);\n\n // Mark them for later tracking.\n newInputs.forEach(i => i._x_hiddenInput = true);\n\n // Mark them for Alpine ignoring.\n newInputs.forEach(i => i._x_ignore = true);\n\n // Gather old elements for removal.\n let children = el.children;\n let oldInputs = [];\n\n for (let i = 0; i < children.length; i++) {\n let child = children[i];\n\n if (child._x_hiddenInput) {\n oldInputs.push(child);\n } else {\n break;\n }\n }\n\n // Remove old, and insert new ones into the DOM.\n window.Alpine.mutateDom(() => {\n oldInputs.forEach(i => i.remove());\n\n newInputs.reverse().forEach(i => el.prepend(i));\n });\n};\n\nconst mapByToCallback = by => {\n if (! by) {\n by = (a, b) => a === b;\n }\n\n if (typeof by === 'string') {\n const property = by;\n by = (a, b) => a[property] === b[property];\n }\n\n return by;\n};\n\nconst mapByToSimpleCompareCallback = by => {\n if (! by) {\n by = (a, b) => a === b;\n }\n\n if (typeof by === 'string') {\n const property = by;\n by = (a, b) => a[property] === b;\n }\n\n return by;\n};\n\nconst normalizeValue = (value, multiple) => {\n if (! value) {\n value = (multiple ? [] : null);\n }\n\n if (multiple && ! Array.isArray(value)) {\n value = [value];\n }\n\n return value;\n};\n\nconst generateInputs = (name, value, carry = []) => {\n if (isObjectOrArray(value)) {\n for (let key in value) {\n carry = carry.concat(\n generateInputs(`${name}[${key}]`, value[key])\n );\n }\n } else if (value !== null && value !== false) {\n let el = document.createElement('input');\n el.setAttribute('type', 'hidden');\n el.setAttribute('name', name);\n el.setAttribute('value', '' + value);\n\n return [el];\n }\n\n return carry;\n};\n","import selectContext from '../mixins/selectContext';\n\nexport const generateContext = ({ multiple, orientation, __wire, __wireSearch, __config, Alpine }) => {\n return {\n ...selectContext(Alpine),\n\n /**\n * Select configuration.\n */\n __multiple: multiple,\n __orientation: orientation,\n __wire,\n __wireSearch,\n __config,\n\n /**\n * Getters that don't work in the mixin for some reason...\n */\n\n get isScrollingTo() {\n return this.scrollingCount > 0;\n },\n\n get nonDisabledOrderedKeys() {\n return this.orderedKeys.filter(i => ! this.isDisabled(i));\n },\n };\n};\n","export default {\n __createPopper: undefined,\n __popper: undefined,\n\n __resetPopper() {\n if (this.__popper) {\n this.__popper.destroy();\n this.__popper = null;\n }\n },\n\n __popperConfig() {\n return {\n placement: 'bottom-start',\n strategy: this.__fixed ? 'fixed' : 'absolute',\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, 10],\n },\n },\n {\n name: 'preventOverflow',\n options: {\n boundariesElement: this.$root,\n },\n },\n ],\n };\n },\n\n __initPopper() {\n this.__resetPopper();\n this.__popper = this.__createPopper(this.$root, this.$refs.__options, this.__popperConfig());\n },\n};\n","import { renderHiddenInputs } from './selectContext';\n\nexport function selectData(el, Alpine, config) {\n return {\n __ready: false,\n __value: config.__value ?? false,\n __richValue: false,\n __isOpen: false,\n __context: undefined,\n __isMultiple: false,\n __isStatic: false,\n __isClearable: undefined,\n __isDisabled: false,\n __compareBy: null,\n __inputName: undefined,\n __fixed: false,\n __searchable: undefined,\n __hasCustomSelectLabel: false,\n __orientation: 'vertical',\n __externalChanged: false,\n __config: config.__config,\n __wireSearch: undefined,\n __type: 'custom',\n\n init() {\n this.__createPopper = window.Popper ? window.Popper.createPopper : window.createPopper;\n\n if (typeof this.__createPopper !== 'function') {\n throw new TypeError(`${this.__type}-select requires Popper.js (https://popper.js.org)`);\n }\n\n this.__isMultiple = Alpine.bound(el, 'data-multiple', false);\n this.__isDisabled = Alpine.bound(el, 'disabled', false) || Alpine.bound(el, 'readonly', false);\n this.__inputName = Alpine.bound(el, 'name', null);\n this.__compareBy = Alpine.bound(el, 'by');\n this.__orientation = Alpine.bound(el, 'horizontal') ? 'horizontal' : 'vertical';\n this.__searchable = Alpine.bound(el, 'searchable', false);\n this.__isClearable = Alpine.bound(el, 'clearable', false);\n this.__wireSearch = Alpine.bound(el, 'livewire-search');\n this.__fixed = Alpine.bound(el, 'fixed', false);\n\n const autoFocus = Alpine.bound(el, 'autofocus');\n\n this.__context = this.__generateContext(el, Alpine, config);\n\n const defaultValue = Alpine.bound(el, 'default-value', null);\n if (defaultValue && ! this.__value) {\n this.__value = defaultValue;\n }\n\n // We have to wait for the rest of the HTML to initialize in Alpine before\n // we can mark this component as \"ready\".\n queueMicrotask(() => {\n this.__ready = true;\n\n // We have to wait again after the \"ready\" processes are finished\n // to settle up currently selected values (this prevents this next bit\n // of code from running multiple times on startup).\n queueMicrotask(() => {\n // This \"fingerprint\" acts as a checksum of the last-known \"value\"\n // passed into x-model. We need to track this so that we can determine\n // from the reactive effect if it was the value that changed externally\n // or an option was selected internally.\n let lastValueFingerprint = false;\n\n Alpine.effect(() => {\n // Accessing the selected keys, so a change in it always triggers this effect.\n this.__context.selectedKeys;\n\n if (lastValueFingerprint === false || lastValueFingerprint !== JSON.stringify(this.__value)) {\n // Here we know that the value changed externally, and we can add the selection.\n this.__externalChanged = true;\n\n if (this.__isMultiple) {\n this.__context.clearSelected();\n\n const keys = [];\n\n for (let value of this.__value) {\n const object = this.__context.getObjectFromValue(value, this.__compareBy);\n object && keys.push(object);\n }\n\n this.__context.selectValue(keys, this.__compareBy);\n this.__richValue = this.__context.selectedValueOrValues();\n } else {\n if (typeof this.__value !== 'object' && ! Array.isArray(this.__value) && this.__value !== null) {\n const key = this.__context.getKeyFromSimpleValue(this.__value, this.__compareBy);\n key && this.__context.selectKey(key);\n } else {\n this.__context.selectValue(this.__value, this.__compareBy);\n }\n\n this.__richValue = this.__context.selectedValueOrValues();\n }\n } else {\n // Here we know that an option was selected, and we can change the value.\n this.__value = this.__context.selectedBasicValueOrValues(this.__compareBy);\n this.__richValue = this.__context.selectedValueOrValues();\n }\n\n // Generate the \"value\" checksum for comparison next time.\n lastValueFingerprint = JSON.stringify(this.__value);\n\n // Everytime the value changes, we need to re-render the hidden inputs\n // if a user passed the \"name\" prop.\n this.__inputName && renderHiddenInputs(this.$el, this.__inputName, this.__value);\n });\n\n // If select is searchable, we want to hide any opt groups when a query is present.\n if (this.__searchable) {\n Alpine.effect(() => {\n const query = this.__context.searchableQuery;\n\n this.$refs.__options && this.$refs.__options.querySelectorAll('[role=\"presentation\"]:not([data-placeholder=\"true\"])').forEach(el => {\n if (query) {\n this.__context.hideEl(el);\n } else {\n this.__context.showEl(el);\n }\n });\n });\n }\n\n (autoFocus && this.$refs.__button) && this.$refs.__button.focus({ preventScroll: true });\n });\n });\n\n this.$watch('__value', newValue => {\n this.$dispatch('input', newValue);\n });\n\n this.__componentBooted(el, Alpine, config);\n },\n\n __open() {\n if (this.__isDisabled) {\n return;\n }\n\n this.__isOpen = true;\n\n this.__context.activateSelectedOrFirst();\n\n // Safari needs more of a \"tick\" for focusing after x-show for some reason.\n // Probably because Alpine adds an extra tick when x-showing for @click.outside.\n let nextTick = callback => requestAnimationFrame(() => requestAnimationFrame(callback));\n\n nextTick(() => {\n if (this.__searchable && this.$refs.__search) {\n this.$refs.__search.focus({ preventScroll: true });\n } else {\n this.$refs.__options.focus({ preventScroll: true });\n }\n\n this.__initPopper();\n });\n },\n\n __close() {\n this.__isOpen = false;\n this.__resetPopper();\n\n this.$nextTick(() => this.$refs.__button.focus({ preventScroll: true }));\n },\n\n __generateContext(el, Alpine, config) {},\n\n __componentBooted(el, Alpine, config) {},\n };\n}\n\nexport function buttonDirective(el, Alpine) {\n return {\n 'x-ref': '__button',\n ':id'() { return this.$id(`fc-${this.__type}-select-button`) },\n 'aria-haspopup': 'true',\n 'data-custom-select-button': 'true',\n ':aria-labelledby'() { return this.$data.__hasCustomSelectLabel ? this.$id(`fc-${this.__type}-select-label`) : this.$id('fc-label') },\n ':aria-expanded'() { return this.$data.__isOpen },\n ':aria-controls'() { return this.$data.__isOpen && this.$id(`fc-${this.__type}-select-options`) },\n ':tabindex'() { return this.$data.__isDisabled ? '-1' : '0' },\n 'x-init'() {\n if (this.$el.tagName.toLowerCase() === 'button' && ! this.$el.hasAttribute('type')) {\n this.$el.type = 'button';\n }\n\n if (this.$el.tagName.toLowerCase() !== 'button') {\n this.$el.setAttribute('role', 'button');\n }\n },\n '@click'() { this.$data.__open() },\n '@focus'() { this.$data.__isDisabled && this.$el.blur() },\n '@keydown'(e) {\n if (['ArrowDown', 'ArrowUp', 'ArrowLeft', 'ArrowRight'].includes(e.key)) {\n e.stopPropagation();\n e.preventDefault();\n\n this.$data.__open();\n }\n\n const $magic = this.__type === 'tree' ? this.$treeSelect : this.$customSelect;\n\n if (e.key === 'Backspace') {\n e.stopPropagation();\n e.preventDefault();\n\n if (this.$data.__isDisabled) {\n return;\n }\n\n const lastSelected = this.$data.__isMultiple\n ? $magic.selectedObject[$magic.selectedObject.length - 1]\n : $magic.selectedObject;\n\n lastSelected && this.$data.__context.toggleValue(lastSelected, this.$data.__compareBy);\n }\n },\n '@keydown.space.stop.prevent'() { this.$data.__open() },\n '@keydown.enter.stop.prevent'() { this.$data.__open() },\n };\n}\n\nexport function labelDirective(el, Alpine) {\n return {\n 'x-ref': '__label',\n ':id'() { return this.$id(`fc-${this.__type}-custom-select-label`) },\n 'x-init'() {\n this.$data.__hasCustomSelectLabel = true;\n },\n '@click'() { this.$refs.__button.focus({ preventScroll: true }) },\n };\n}\n\nexport function clearButtonDirective(el, Alpine, type) {\n const magic = type === 'tree' ? '$treeSelect' : '$customSelect';\n\n return {\n ':tabindex'() { return (this.$data.__isDisabled || ! this[magic].hasValue) ? false : '0' },\n 'x-show'() { return this[magic].shouldShowClear },\n 'x-init'() {\n if (this.$el.tagName.toLowerCase() === 'button' && ! this.$el.hasAttribute('type')) {\n this.$el.type = 'button';\n }\n\n if (this.$el.tagName.toLowerCase !== 'button') {\n this.$el.setAttribute('role', 'button');\n }\n },\n '@click.stop.prevent'() {\n if (this.$data.__isDisabled) {\n return;\n }\n\n this.$data.__context.clearSelected();\n this.$data.__close();\n\n // Our value is not reacting to the changes made in context, so we'll set it manually.\n this.$data.__value = this.$data.__isMultiple ? [] : null;\n },\n '@keydown.space.stop.prevent'() {\n if (this.$data.__isDisabled) {\n return;\n }\n\n this.$data.__context.clearSelected();\n this.$data.__close();\n\n // Our value is not reacting to the changes made in context, so we'll set it manually.\n this.$data.__value = this.$data.__isMultiple ? [] : null;\n },\n };\n}\n\nexport function optionsDirective(el, Alpine) {\n return {\n 'x-ref': '__options',\n ':id'() { return this.$id(`fc-${this.__type}-select-options`) },\n 'x-init'() {\n this.$data.__isStatic = Alpine.bound(this.$el, 'static', false);\n },\n 'x-show'() { return this.$data.__isStatic ? true : this.$data.__isOpen },\n '@click.outside'() { this.$data.__close() },\n '@keydown.escape.stop.prevent'() { this.$data.__close() },\n tabindex: '0',\n role: 'listbox',\n ':aria-orientation'() {return this.$data.__orientation },\n ':aria-labelledby'() { return this.$id(`fc-${this.__type}-select-button`) },\n ':aria-activedescendant'() { return this.$data.__context.activeEl() && this.$data.__context.activeEl().id },\n ':aria-multiselectable'() { return this.$data.__isMultiple ? 'true' : 'false' },\n '@focus'() { this.$data.__context.activateSelectedOrFirst() },\n 'x-trap'() { return this.$data.__isOpen },\n '@keydown'(e) { this.$data.__context.activateByKeyEvent(e) },\n '@keydown.enter.stop.prevent'() {\n this.$data.__context.selectActive();\n\n this.$data.__isMultiple || this.$data.__close();\n },\n '@keydown.space.stop.prevent'() {\n this.$data.__context.selectActive();\n\n this.$data.__isMultiple || this.$data.__close();\n },\n };\n}\n\nexport function optionDirective(el, Alpine, type) {\n const rootMagic = type === 'tree' ? '$treeSelect' : '$customSelect';\n const magic = type === 'tree' ? '$treeSelectOption' : '$customSelectOption';\n\n return {\n ':id'() { return this.$id(`fc-${this.__type}-select-option`) },\n ':tabindex'() { return this.$data.__isDisabled ? false : '-1' },\n ':role'() { return this[magic].isOptGroup ? 'presentation' : 'option' },\n 'x-init'() {\n const initCallback = () => {\n let value = Alpine.bound(el, 'value');\n let disabled = Alpine.bound(el, 'disabled');\n let isOptGroup = Alpine.bound(el, 'is-opt-group');\n\n el.__optionKey = this.$data.__context.initItem(el, value, disabled, isOptGroup);\n };\n\n // Our $customSelectOption magic only seems to work with queueMicrotask on initial page load,\n // so if our component says it's ready, we'll just run the code to initialize the option right away.\n if (this.$data.__ready) {\n initCallback();\n } else {\n queueMicrotask(initCallback);\n }\n },\n ':aria-selected'() { return this[magic].isSelected },\n ':aria-disabled'() { return this[magic].isDisabled },\n '@click'() {\n if (this.$data.__isDisabled || this[magic].isDisabled) {\n return;\n }\n\n if (! this[magic].isSelected && ! this[rootMagic].canSelectMore) {\n return;\n }\n\n this.$data.__context.selectEl(el);\n\n this.$data.__isMultiple || this.$data.__close();\n },\n '@mousemove'() { this.$data.__context.activateEl(el) },\n '@mouseleave'() { this.$data.__context.deactivate() },\n };\n}\n\nexport function searchDirective(el, Alpine) {\n return {\n 'x-ref': '__search',\n ':id'() { return this.$id(`fc-${this.__type}-select-search`) },\n 'x-init'() {\n // When using livewire search, the directive re-evaluates even when inside a wire:ignore,\n // so we'll need to re-populate the value of the search query, so we don't lose it...\n const searchableQuery = this.$data.__context.searchableQuery;\n this.$el.value = searchableQuery;\n\n if (this.$data.__ready && this.$data.__isOpen && searchableQuery.length) {\n this.$nextTick(() => {\n if (this.$el.createTextRange) {\n let range = this.$el.createTextRange();\n range.move('character', searchableQuery.length);\n range.select();\n } else {\n // This sets the cursor position to the end of the input and prevents\n // the entire text from being highlighted. IMO this creates a better UX.\n this.$el.focus();\n this.$el.setSelectionRange && this.$el.setSelectionRange(searchableQuery.length, searchableQuery.length);\n }\n });\n }\n },\n '@keyup.debounce.250ms'(e) {\n // We don't want our keyboard nav events to trigger this.\n const keysToSkip = [\n 'Enter',\n 'ArrowDown',\n 'ArrowUp',\n 'ArrowRight',\n 'ArrowLeft',\n 'Home',\n 'PageUp',\n 'End',\n 'PageDown',\n 'Tab',\n 'Meta',\n ];\n if (keysToSkip.includes(e.key)) {\n return;\n }\n\n this.$data.__context.handleSearchableQuery(e.target.value);\n },\n // Prevent our option handler from firing when we're typing in the search box.\n '@keydown.space.stop'() {},\n '@keydown.tab.prevent.stop'() {\n // Options has x-trap on it, which prevent us from tabbing out of the search box.\n // We'll allow the user to tab to the options, which will allow selecting an option using the space key.\n this.$refs.__options.focus();\n }\n };\n}\n\nexport function tokenDirective(el, Alpine) {\n return {\n ':tabindex'() { return this.$data.__isDisabled ? false : '0' },\n ':role'() { return this.$el.tagName.toLowerCase() !== 'button' && ! this.$data.__isDisabled ? 'button' : false },\n 'x-init'() {\n const initCallback = () => {\n el.__key = this.$data.__context.getKeyFromValue(el.value);\n };\n\n if (this.$data.__ready) {\n initCallback();\n } else {\n queueMicrotask(initCallback);\n }\n },\n '@click.stop.prevent'() {\n if (this.$data.__isDisabled || ! el.__key) {\n return;\n }\n\n this.$data.__context.toggleSelected(el.__key);\n },\n '@keydown.space.stop.prevent'() {\n if (this.$data.__isDisabled || ! el.__key) {\n return;\n }\n\n this.$data.__context.toggleSelected(el.__key);\n },\n };\n}\n","export const rootMagic = (el, Alpine, callback, stubCallback) => {\n let data = Alpine.$data(el);\n\n if (typeof stubCallback !== 'function') {\n stubCallback = () => ({});\n }\n\n if (typeof callback !== 'function') {\n callback = () => ({});\n }\n\n if (! data.__ready) {\n return {\n isDisabled: false,\n isOpen: false,\n selected: null,\n active: null,\n selectedObject: null,\n ...stubCallback(data),\n };\n }\n\n return {\n get isOpen() {\n return data.__isOpen;\n },\n get isDisabled() {\n return data.__isDisabled;\n },\n get isSearchable() {\n return data.__searchable;\n },\n get selected() {\n return data.__value;\n },\n get active() {\n return data.__context.active;\n },\n get selectedObject() {\n return data.__richValue;\n },\n get hasValue() {\n if (data.__isMultiple) {\n return data.__value && data.__value.length > 0;\n }\n\n return !! data.__value;\n },\n get shouldShowClear() {\n // If the input is disabled or readonly, we can't clear.\n if (data.__isDisabled) {\n return false;\n }\n\n // If the select is not marked as optional, at least one value is required.\n if (data.__config.optional === false) {\n return false;\n }\n\n // If multi-select and minSelected is a number and at least 1, then we can't clear.\n if (data.__isMultiple && ! Number.isNaN(data.__config.minSelected) && data.__config.minSelected > 0) {\n return false;\n }\n\n return data.__isClearable && this.hasValue;\n },\n get canSelectMore() {\n if (! data.__isMultiple) {\n return true;\n }\n\n // If maxSelected is not a number or less than one, then we can select as many as we want.\n if (Number.isNaN(data.__config.maxSelected) || data.__config.maxSelected < 1) {\n return true;\n }\n\n return data.__config.maxSelected > data.__value.length;\n },\n get canDeselectOptions() {\n if (data.__isDisabled) {\n return false;\n }\n\n return data.__context.canRemoveOptions();\n },\n get hasOptions() {\n // We access searchableQuery here, so a change to it will trigger this getter to re-evaluate.\n data.__context.searchableQuery;\n\n return data.$refs.__options &&\n data.$refs.__options.querySelectorAll('[role=\"option\"]:not([data-hidden])').length > 0;\n },\n get hasSearch() {\n return !! data.__context.searchableQuery;\n },\n\n ...callback(data),\n };\n};\n\nexport const optionMagic = (el, Alpine, callback, stubCallback) => {\n if (typeof stubCallback !== 'function') {\n stubCallback = () => ({});\n }\n\n if (typeof callback !== 'function') {\n callback = () => ({});\n }\n\n let data = Alpine.$data(el);\n\n let stub = {\n isDisabled: false,\n isSelected: false,\n isActive: false,\n ...stubCallback(data),\n };\n\n if (! data.__ready) {\n return stub;\n }\n\n let optionEl = Alpine.findClosest(el, i => i.__optionKey);\n\n if (! optionEl) {\n return stub;\n }\n\n let context = data.__context;\n\n return {\n get isActive() {\n return context.isActiveEl(optionEl);\n },\n get isSelected() {\n return context.isSelectedEl(optionEl);\n },\n get isDisabled() {\n return context.isDisabledEl(optionEl);\n },\n\n ...callback(data, context, optionEl),\n };\n};\n","import { generateContext } from '../util/customSelectContext';\nimport selectPopper from '../mixins/selectPopper';\nimport {\n buttonDirective,\n clearButtonDirective,\n labelDirective,\n optionsDirective,\n optionDirective,\n searchDirective,\n selectData,\n tokenDirective,\n} from '../mixins/select';\nimport { rootMagic, optionMagic } from '../mixins/selectMagic';\n\nexport default function (Alpine) {\n Alpine.data('customSelect', config => {\n return {\n ...selectPopper,\n\n ...selectData(config.__el, Alpine, config),\n\n __generateContext(el, Alpine, config) {\n return generateContext({\n multiple: this.__isMultiple,\n orientation: this.__orientation,\n __wire: config.__wire,\n __wireSearch: Alpine.bound(el, 'livewire-search'),\n __config: config.__config ?? {},\n Alpine,\n });\n },\n }\n });\n\n Alpine.directive('custom-select', (el, directive, { cleanup }) => {\n switch (directive.value) {\n case 'button':\n handleButton(el, Alpine);\n break;\n case 'label':\n handleLabel(el, Alpine);\n break;\n case 'clear':\n handleClearButton(el, Alpine);\n break;\n case 'options':\n handleOptions(el, Alpine);\n break;\n case 'option':\n handleOption(el, Alpine);\n\n // We need to notify the context that the option has left the DOM.\n cleanup(() => {\n const parent = el.closest('[x-data]');\n\n parent && Alpine.$data(parent).__context.destroyItem(el);\n });\n\n break;\n case 'search':\n handleSearch(el, Alpine);\n break;\n case 'token':\n handleToken(el, Alpine);\n break;\n\n default:\n throw new Error(`Unknown custom-select directive value: ${directive.value}`);\n }\n });\n\n Alpine.magic('customSelect', el => {\n return rootMagic(el, Alpine);\n });\n\n Alpine.magic('customSelectOption', el => {\n return optionMagic(\n el,\n Alpine,\n (data, context, optionEl) => {\n return {\n get isOptGroup() {\n return Alpine.bound(optionEl, 'is-opt-group');\n },\n };\n },\n () => {\n return {\n isOptGroup: false,\n };\n },\n );\n });\n}\n\nfunction handleLabel(el, Alpine) {\n Alpine.bind(el, {\n ...labelDirective(el, Alpine),\n });\n}\n\nfunction handleButton(el, Alpine) {\n Alpine.bind(el, {\n ...buttonDirective(el, Alpine),\n });\n}\n\nfunction handleSearch(el, Alpine) {\n Alpine.bind(el, {\n ...searchDirective(el, Alpine),\n });\n}\n\nfunction handleOptions(el, Alpine) {\n Alpine.bind(el, {\n ...optionsDirective(el, Alpine),\n });\n}\n\nfunction handleOption(el, Alpine) {\n Alpine.bind(el, {\n ...optionDirective(el, Alpine, 'custom'),\n });\n}\n\nfunction handleToken(el, Alpine) {\n Alpine.bind(el, {\n ...tokenDirective(el, Alpine),\n });\n}\n\nfunction handleClearButton(el, Alpine) {\n Alpine.bind(el, {\n ...clearButtonDirective(el, Alpine, 'custom'),\n });\n}\n","export default function (Alpine) {\n Alpine.data('datePicker', config => ({\n __ready: false,\n __value: config.value,\n __rawValue: null,\n __mode: config.mode ?? config.options.mode ?? 'single',\n __isDisabled: false,\n __flatpickr: undefined,\n\n init() {\n if (typeof window.flatpickr !== 'function') {\n throw new Error(`date-picker requires Flatpickr. See https://flatpickr.js.org`);\n }\n\n let value = this.__value;\n if (value?.hasOwnProperty('initialValue')) {\n value = value.initialValue;\n }\n\n this.__rawValue = value;\n\n\n // We have to wait for the rest of the HTML to initialize in Alpine before\n // we can mark this component as \"ready\".\n queueMicrotask(() => {\n this.__ready = true;\n\n this.__flatpickr = window.flatpickr(this.$refs.__input, this.__config());\n });\n\n this.$watch('__value', newValue => {\n this.__rawValue = newValue;\n this.__flatpickr.setDate(newValue);\n this.$dispatch('input', newValue);\n });\n\n this.$watch('__isDisabled', newValue => {\n if (newValue) {\n this.__flatpickr.set('clickOpens', false);\n } else {\n this.__flatpickr.set('clickOpens', config.options.clickOpens);\n }\n });\n },\n\n __open() {\n ! this.__isDisabled && this.__flatpickr.open();\n },\n\n __clear() {\n if (this.__isDisabled) {\n return;\n }\n\n this.__value = this.__mode === 'single'\n ? null\n : [];\n },\n\n __config() {\n let onOpen = [\n function (selectedDates, dateStr, instance) {\n instance.setDate(this.__rawValue);\n }.bind(this),\n ];\n\n let customConfig = config.config ?? {};\n if (customConfig.hasOwnProperty('onOpen')) {\n let customOnOpen = Array.isArray(customConfig.onOpen) ? customConfig.onOpen : [customConfig.onOpen];\n\n onOpen = onOpen.concat(customOnOpen);\n\n delete customConfig.onOpen;\n }\n\n return {\n defaultDate: this.__rawValue,\n ...config.options,\n onOpen,\n onChange: function(date, dateString) {\n let newValue = dateString;\n if (this.__mode === 'multiple') {\n newValue = dateString.split(', ');\n } else if (this.__mode === 'range') {\n newValue = dateString.split(' to ');\n }\n\n this.__value = newValue;\n }.bind(this),\n ...customConfig,\n };\n },\n }));\n\n Alpine.directive('date-picker', (el, directive, { cleanup }) => {\n switch (directive.value) {\n case 'clear':\n handleClear(el, Alpine);\n break;\n case 'container':\n handleContainer(el, Alpine);\n break;\n case 'input':\n handleInput(el, Alpine);\n\n cleanup(() => {\n const parent = el.closest('[x-data]');\n\n parent && Alpine.$data(parent).__flatpickr.destroy();\n });\n\n break;\n case 'toggle':\n handleToggle(el, Alpine);\n break;\n default:\n throw new Error(`Unknown date-picker directive value: ${directive.value}`);\n }\n });\n\n Alpine.magic('datePicker', el => {\n let data = Alpine.$data(el);\n\n if (! data.__ready) {\n return {\n isDisabled: false,\n flatpickr: undefined,\n hasValue: false,\n open() {},\n };\n }\n\n return {\n get isDisabled() {\n return data.__isDisabled;\n },\n get flatpickr() {\n return data.__flatpickr;\n },\n get hasValue() {\n if (data.__mode === 'single') {\n return data.__value !== null && data.__value !== '';\n }\n\n return Array.isArray(data.__value) && data.__value.length > 0;\n },\n open() {\n data.__open();\n },\n };\n });\n}\n\nfunction handleInput(el, Alpine) {\n Alpine.bind(el, {\n 'x-ref': '__input',\n 'type': 'text',\n 'x-init'() {\n this.$data.__isDisabled = this.$el.disabled || this.$el.readOnly;\n\n queueMicrotask(() => {\n const observer = new MutationObserver(mutations => {\n mutations.forEach(mutation => {\n if (mutation.attributeName === 'disabled' || mutation.attributeName === 'readonly') {\n this.$data.__isDisabled = this.$el.disabled || this.$el.readOnly;\n }\n });\n });\n\n observer.observe(this.$el, { attributes: true });\n });\n },\n });\n}\n\n// Since we're using wire:ignore on the input, we are going to show error attributes (i.e. aria-invalid) on the container.\n// We'll watch for these changes with a mutation observer and then apply them to the input.\nfunction handleContainer(el, Alpine) {\n Alpine.bind(el, {\n 'x-ref': '__container',\n 'role': 'none',\n 'x-init'() {\n const observer = new MutationObserver(mutations => {\n mutations.forEach(mutation => {\n if (mutation.attributeName === 'aria-invalid') {\n const invalid = mutation.target.getAttribute('aria-invalid') === 'true';\n\n if (invalid) {\n this.$refs.__input.setAttribute('aria-invalid', 'true');\n this.$refs.__input.classList.add('input-error');\n } else {\n this.$refs.__input.removeAttribute('aria-invalid');\n this.$refs.__input.classList.remove('input-error');\n }\n } else if (mutation.attributeName === 'aria-describedby') {\n const describedBy = mutation.target.getAttribute('aria-describedby');\n\n if (describedBy) {\n this.$refs.__input.setAttribute('aria-describedby', describedBy);\n } else {\n this.$refs.__input.removeAttribute('aria-describedby');\n }\n }\n });\n });\n\n observer.observe(this.$el, { attributes: true });\n },\n });\n}\n\nfunction handleToggle(el, Alpine) {\n Alpine.bind(el, {\n 'x-ref': '__toggle',\n ':role'() {\n if (this.$datePicker.isDisabled) {\n return false;\n }\n\n if (this.$el.tagName.toLowerCase() === 'button') {\n return false;\n }\n\n return 'button';\n },\n '@click'() {\n this.$datePicker.open();\n },\n });\n}\n\nfunction handleClear(el, Alpine) {\n Alpine.bind(el, {\n 'x-ref': '__clear',\n 'x-init'() {\n if (this.$el.tagName.toLowerCase() === 'button' && ! this.$el.hasAttribute('type')) {\n this.$el.setAttribute('type', 'button');\n }\n },\n '@click'() {\n this.$data.__clear();\n },\n 'x-show'() { return this.$datePicker.hasValue && ! this.$datePicker.isDisabled },\n });\n}\n","export default options => ({\n value: false,\n onValue: true,\n offValue: false,\n ...options,\n\n get isPressed() {\n if (Array.isArray(this.value)) {\n return this.value.includes(this.onValue);\n }\n\n return this.value === this.onValue;\n },\n\n toggle() {\n if (Array.isArray(this.value)) {\n this.isPressed\n ? this.value.splice(this.value.indexOf(this.onValue), 1)\n : this.value.push(this.onValue);\n } else {\n this.value = this.isPressed ? this.offValue : this.onValue;\n }\n\n this.$dispatch('input', this.value);\n },\n});\n","import selectContext from '../mixins/selectContext';\nimport { keyByValue } from '../mixins/selectContext';\n\nexport const generateContext = ({ multiple, orientation, __wire, __wireSearch, __config, Alpine }) => {\n return {\n ...selectContext(Alpine),\n\n /**\n * Select configuration.\n */\n\n __multiple: multiple,\n __orientation: orientation,\n __wire,\n __wireSearch,\n __config,\n\n /**\n * Tree select specific configuration.\n */\n\n expandableEls: {},\n expandedKeys: [],\n\n __itemBooted(el, value, disabled, key) {\n // We need to wait for the option to finish initializing before we can check\n // for the presence of children.\n queueMicrotask(() => {\n if (el.__children?.length) {\n this.expandableEls[key] = el;\n }\n });\n },\n\n __itemDestroyed(el, key) {\n if (this.expandableEls[key]) {\n delete this.expandableEls[key];\n }\n\n if (this.expandedKeys.includes(key)) {\n this.expandedKeys.splice(this.expandedKeys.indexOf(key), 1);\n }\n },\n\n isExpandedEl(el) {\n const key = keyByValue(this.elsByKey, el);\n\n if (! key) {\n return;\n }\n\n return this.expandedKeys.includes(key);\n },\n\n toggleExpandedEl(el) {\n const key = keyByValue(this.elsByKey, el);\n\n if (! key) {\n return;\n }\n\n this.toggleExpanded(key);\n },\n\n toggleExpanded(key) {\n if (this.expandedKeys.includes(key)) {\n this.expandedKeys.splice(this.expandedKeys.indexOf(key), 1);\n } else {\n this.expandedKeys.push(key);\n }\n },\n\n expandChildren(key) {\n if (! this.expandedKeys.includes(key)) {\n this.expandedKeys.push(key);\n }\n },\n\n collapseChildren(key) {\n if (this.expandedKeys.includes(key)) {\n this.expandedKeys.splice(this.expandedKeys.indexOf(key), 1);\n }\n },\n\n __activateByKeyEvent(e) {\n if (! this.hasActive()) {\n return;\n }\n\n switch (e.key) {\n case ['ArrowRight', 'ArrowDown'][this.__orientation === 'vertical' ? 0 : 1]:\n e.preventDefault();\n e.stopPropagation();\n\n if (this.expandableEls[this.activeKey]) {\n this.expandChildren(this.activeKey);\n }\n\n return false;\n case ['ArrowLeft', 'ArrowUp'][this.__orientation === 'vertical' ? 0 : 1]:\n e.preventDefault();\n e.stopPropagation();\n\n if (this.expandableEls[this.activeKey]) {\n this.collapseChildren(this.activeKey);\n }\n\n return false;\n }\n },\n\n /**\n * Getters that don't work in the mixin for some reason...\n */\n\n get isScrollingTo() {\n return this.scrollingCount > 0;\n },\n\n get nonDisabledOrderedKeys() {\n return this.orderedKeys.filter(i => ! this.isDisabled(i));\n },\n };\n};\n","import { generateContext } from '../util/treeSelectContext';\nimport selectPopper from '../mixins/selectPopper';\nimport {\n buttonDirective,\n clearButtonDirective,\n labelDirective,\n optionsDirective,\n optionDirective,\n searchDirective,\n selectData,\n tokenDirective,\n} from '../mixins/select';\nimport { rootMagic, optionMagic } from '../mixins/selectMagic';\n\nexport default function (Alpine) {\n Alpine.data('treeSelect', config => {\n return {\n ...selectPopper,\n\n ...selectData(config.__el, Alpine, config),\n\n __type: 'tree',\n\n __generateContext(el, Alpine, config) {\n return generateContext({\n multiple: this.__isMultiple,\n orientation: this.__orientation,\n __wire: config.__wire,\n __wireSearch: Alpine.bound(el, 'livewire-search'),\n __config: config.__config ?? {},\n Alpine,\n });\n },\n };\n });\n\n Alpine.directive('tree-select', (el, directive, { cleanup }) => {\n switch (directive.value) {\n case 'button':\n handleButton(el, Alpine);\n break;\n case 'label':\n handleLabel(el, Alpine);\n break;\n case 'clear':\n handleClearButton(el, Alpine);\n break;\n case 'options':\n handleOptions(el, Alpine);\n break;\n case 'option':\n handleOption(el, Alpine);\n\n // We need to notify the context that the option has left the DOM.\n cleanup(() => {\n const parent = el.closest('[x-data]');\n\n parent && Alpine.$data(parent).__context.destroyItem(el);\n });\n\n break;\n case 'search':\n handleSearch(el, Alpine);\n break;\n case 'token':\n handleToken(el, Alpine);\n break;\n case 'child-toggle':\n handleChildToggle(el, Alpine);\n break;\n case 'children':\n handleChildren(el, Alpine);\n break;\n\n default:\n throw new Error(`Unknown tree-select directive: ${directive.value}`);\n }\n });\n\n Alpine.magic('treeSelect', el => {\n return rootMagic(\n el,\n Alpine,\n data => {\n return {\n get hasExpandableOptions() {\n return Object.keys(data.__context.expandableEls).length > 0;\n },\n };\n },\n );\n });\n\n Alpine.magic('treeSelectOption', el => {\n return optionMagic(\n el,\n Alpine,\n (data, context, optionEl) => {\n return {\n get hasChildren() {\n return optionEl.__children && optionEl.__children.length > 0;\n },\n get isExpanded() {\n return context.isExpandedEl(optionEl);\n },\n };\n },\n () => {\n return {\n hasChildren: false,\n };\n },\n );\n });\n}\n\nfunction handleButton(el, Alpine) {\n Alpine.bind(el, {\n ...buttonDirective(el, Alpine),\n });\n}\n\nfunction handleLabel(el, Alpine) {\n Alpine.bind(el, {\n ...labelDirective(el, Alpine),\n });\n}\n\nfunction handleClearButton(el, Alpine) {\n Alpine.bind(el, {\n ...clearButtonDirective(el, Alpine, 'tree'),\n });\n}\n\nfunction handleOptions(el, Alpine) {\n Alpine.bind(el, {\n ...optionsDirective(el, Alpine),\n });\n}\n\nfunction handleOption(el, Alpine) {\n Alpine.bind(el, {\n ...optionDirective(el, Alpine, 'tree'),\n\n 'data-tree-select-option': 'true',\n ':role'() { return 'option' },\n\n 'x-init'() {\n const initCallback = () => {\n let value = Alpine.bound(el, 'value');\n let disabled = Alpine.bound(el, 'disabled');\n\n el.__level = Alpine.bound(el, 'level', 0);\n\n el.__optionKey = this.$data.__context.initItem(el, value, disabled);\n\n const childrenField = this.$data.__config.childrenField;\n if (value?.hasOwnProperty(childrenField)) {\n el.__children = value[childrenField];\n }\n };\n\n // Our $customSelectOption magic only seems to work with queueMicrotask on initial page load,\n // so if our component says it's ready, we'll just run the code to initialize the option right away.\n if (this.$data.__ready) {\n initCallback();\n } else {\n queueMicrotask(initCallback);\n }\n },\n });\n}\n\nfunction handleSearch(el, Alpine) {\n Alpine.bind(el, {\n ...searchDirective(el, Alpine),\n });\n}\n\nfunction handleToken(el, Alpine) {\n Alpine.bind(el, {\n ...tokenDirective(el, Alpine),\n });\n}\n\nfunction handleChildToggle(el, Alpine) {\n Alpine.bind(el, {\n 'x-init'() {\n if (el.tagName.toLowerCase() !== 'button') {\n el.setAttribute('role', 'button');\n }\n },\n '@click.stop.prevent'() {\n let optionEl = Alpine.findClosest(el, i => i.__optionKey);\n\n optionEl && this.$data.__context.toggleExpandedEl(optionEl);\n },\n });\n}\n\n// We are using this directive to hide/show the children of an option because it is out of the scope\n// of where the $treeSelectOption magic will pick up on the state of the option.\nfunction handleChildren(el, Alpine) {\n Alpine.bind(el, {\n 'data-tree-select-children': 'true',\n 'x-data'() {\n return {\n __optionEl: undefined,\n init() {\n try {\n this.__optionEl = el.parentNode.querySelector('[data-tree-select-option=\"true\"]');\n } catch (e) {}\n },\n get __isExpanded() {\n return this.__optionEl && this.$data.__context.isExpandedEl(this.__optionEl);\n }\n };\n },\n 'x-show'() { return this.$data.__isExpanded },\n });\n}\n","import customSelect from './custom-select';\nimport datePicker from './date-picker';\nimport filepond from './filepond';\nimport quill from './quill';\nimport switchToggle from './switch-toggle';\nimport treeSelect from './tree-select';\n\ndocument.addEventListener('alpine:init', () => {\n customSelect(Alpine);\n datePicker(Alpine);\n filepond(Alpine);\n quill(Alpine);\n treeSelect(Alpine);\n Alpine.data('switchToggle', switchToggle);\n});\n","export default function (Alpine) {\n Alpine.data('filepond', ({ __value, __this, __wireModel, options, __config, id }) => {\n return {\n __ready: false,\n __pond: null,\n __processingFiles: false,\n __value,\n\n init() {\n if (typeof window.FilePond?.create !== 'function') {\n throw new Error(`filepond requires FilePond to be loaded. See https://pqina.nl/filepond/docs/getting-started/installation/javascript/`);\n }\n\n queueMicrotask(() => {\n this.__ready = true;\n\n let pondOptions = { ...options };\n\n if (__this && __wireModel) {\n pondOptions.server = {\n process: (fieldName, file, metadata, load, error, progress, abort, transfer, options) => {\n __this.upload(__wireModel, file, load, error, progress);\n },\n revert: (filename, load) => {\n __this.removeUpload(__wireModel, filename, load);\n },\n };\n\n // To prevent our wire:model watcher from pre-maturely removing files from\n // filepond, we need to tell our component we are still processing.\n pondOptions.onaddfilestart = () => this.__processingFiles = true;\n\n pondOptions.onprocessfiles = () => this.__processingFiles = false;\n }\n\n if (__this) {\n // Listen for livewire components to emit a file-pond-clear event.\n __this.on('file-pond-clear', (desiredId) => this.__clear(desiredId));\n }\n\n pondOptions = { ...pondOptions, ...__config(this, options, pondOptions) };\n\n this.__pond = window.FilePond.create(this.$refs.input, pondOptions);\n });\n\n this.$watch('__value', newValue => {\n if (! this.__ready) {\n return;\n }\n\n if (options.allowMultiple) {\n // If filepond is processing files, we shouldn't do anything.\n if (this.__processingFiles) {\n return;\n }\n\n // If the new value is null or undefined, we'll just remove everything from filepond.\n if (! newValue) {\n return this.__clear();\n }\n\n // Remove files from filepond that are not present in the new value.\n const serverIds = Array.isArray(newValue) ? newValue : JSON.parse(String(newValue).split('livewire-files:')[1]);\n\n this.__pond.getFiles().forEach(f => {\n if (! serverIds.includes(f.serverId)) {\n this.__pond.removeFile(f.id);\n }\n });\n\n return;\n }\n\n if (! newValue) {\n this.__clear();\n }\n });\n },\n\n __clear(eventId) {\n if (! eventId || (eventId === id)) {\n clearFilepond(this.__pond, options.allowMultiple);\n }\n },\n };\n });\n}\n\nfunction clearFilepond(instance, allowMultiple) {\n if (allowMultiple) {\n instance.getFiles().forEach(file => instance.removeFile(file.id));\n } else {\n instance.removeFile();\n }\n}\n","export default function (Alpine) {\n Alpine.data('quill', ({ __value, options, __config, onTextChange, onInit }) => {\n return {\n __ready: false,\n __value,\n __quill: undefined,\n\n init() {\n if (typeof window.Quill !== 'function') {\n throw new Error(`quill requires Quill to be loaded. See https://quilljs.com/docs/installation/`);\n }\n\n queueMicrotask(() => {\n this.__ready = true;\n\n this.__quill = new window.Quill(this.$refs.quill, this.__quillOptions());\n\n this.__quill.root.innerHTML = this.__value;\n\n this.__quill.on('text-change', () => {\n if (typeof onTextChange === 'function') {\n const result = onTextChange(this);\n\n if (result === false) {\n return;\n }\n }\n\n this.__value = this.__quill.root.innerHTML;\n\n this.$dispatch('input', this.__value);\n });\n\n if (options.autofocus) {\n this.$nextTick(() => {\n this.focus();\n });\n }\n\n if (typeof onInit === 'function') {\n onInit(this);\n }\n });\n },\n\n focus() {\n if (! this.__ready) {\n return;\n }\n\n this.__quill.focus();\n },\n\n __quillOptions() {\n let config = __config(this, options);\n let toolbarHandlers = {};\n let modules = {};\n\n if (config.hasOwnProperty('toolbarHandlers')) {\n toolbarHandlers = config.toolbarHandlers;\n delete config.toolbarHandlers;\n }\n\n if (config.hasOwnProperty('modules')) {\n modules = config.modules;\n delete config.modules;\n }\n\n return {\n theme: options.theme,\n readOnly: options.readOnly,\n placeholder: options.placeholder,\n modules: {\n toolbar: {\n container: options.toolbar,\n handlers: toolbarHandlers,\n },\n ...modules,\n },\n ...config,\n };\n },\n };\n });\n}\n","const resize = el => {\n if (! el.style.minHeight) {\n el.style.minHeight = `${el.scrollHeight}px`;\n }\n\n el.style.height = 'auto';\n el.style.height = `${el.scrollHeight}px`;\n};\n\nconst isHidden = el => {\n if (el.style.display === 'none') {\n return true;\n }\n\n return ! el.offsetParent;\n};\n\nexport default Alpine => {\n Alpine.directive('textarea-resize', (el, {}, { cleanup }) => {\n // We should not attempt to resize the textarea when it is not visible,\n // otherwise the height will be set to 0.\n if (! isHidden(el)) {\n resize(el);\n }\n\n const inputHandler = () => resize(el);\n\n el.addEventListener('input', inputHandler);\n\n cleanup(() => {\n el.removeEventListener('input', inputHandler);\n });\n });\n};\n","import formGroup from './form-group';\nimport textareaResize from './textarea-resize';\n\ndocument.addEventListener('alpine:init', () => {\n formGroup(Alpine);\n Alpine.plugin(textareaResize);\n});\n","export default function (Alpine) {\n Alpine.directive('form-group', (el, directive) => {\n if (directive.value === 'label') {\n handleLabel(el, Alpine);\n } else {\n handleRoot(el, Alpine);\n }\n });\n}\n\nfunction handleRoot(el, Alpine) {\n Alpine.bind(el, {\n 'x-id'() { return ['fc-label'] },\n });\n}\n\nfunction handleLabel(el, Alpine) {\n Alpine.bind(el, {\n '@click'() {\n const group = el.closest('[x-form-group]');\n if (! group) {\n return;\n }\n\n // Check if there is a custom select in the form group.\n const customSelectButton = group.querySelector('[data-custom-select-button=\"true\"]');\n if (customSelectButton) {\n customSelectButton.focus({ preventScroll: true });\n\n return;\n }\n\n // Check if there is a quill editor in the form group.\n const quill = group.querySelector('.quill-wrapper');\n if (quill) {\n Alpine.$data(quill).focus();\n }\n },\n });\n}\n"],"names":["selectContext","Alpine","searchableText","disabledKeys","activeKey","selectedKeys","orderedKeys","elsByKey","values","__config","__multiple","__orientation","__wire","undefined","__wireSearch","initItem","el","value","disabled","isOptGroup","arguments","length","key","Math","random","toString","substring","keyFromValue","this","getKeyFromValue","by","push","textContent","trim","toLowerCase","__itemBooted","destroyItem","keyByValue","includes","indexOf","reorderKeys","__itemDestroyed","resetOptions","_this","forEach","isConnected","slice","sort","a","z","aEl","zEl","position","compareDocumentPosition","Node","DOCUMENT_POSITION_FOLLOWING","DOCUMENT_POSITION_PRECEDING","activeEl","isActiveEl","activateEl","activateKey","selectEl","selectKey","isSelectedEl","isSelected","isDisabledEl","isDisabled","hideEl","style","display","setAttribute","showEl","removeAttribute","isHiddenEl","offsetParent","scrollingCount","activateAndScrollToKey","_this2","targetEl","scrollIntoView","block","setTimeout","selectedBasicValueOrValues","selectedBasicValues","selectedBasicValue","_this3","map","i","hasOwnProperty","selectedValueOrValues","selectedValues","selectedValue","_this4","selectValue","_this5","normalizeValue","mapByToCallback","keys","selectExclusive","getKeyFromSimpleValue","mapByToSimpleCompareCallback","getObjectFromValue","toggleValue","toggleSelected","selectOnly","canRemoveOptions","splice","_this6","toAdd","_toConsumableArray","clearSelected","optional","selectActive","firstSelectedKey","hasActive","isActiveKey","active","activateSelectedOrFirst","_this7","firstSelected","firstKey","deactivate","isScrollingTo","nextKey","_this8","index","nonDisabledOrderedKeys","findIndex","targetKey","getNextVisibleKey","prevKey","_this9","getPrevVisibleKey","lastKey","currentIndex","visibleKeyFound","searchQuery","clearSearch","debounce","searchKey","query","foundKey","startsWith","searchableQuery","handleSearchableQuery","content","minSelected","Number","isNaN","activateByKeyEvent","e","__activateByKeyEvent","preventDefault","stopPropagation","object","Object","find","renderHiddenInputs","name","newInputs","generateInputs","_x_hiddenInput","_x_ignore","children","oldInputs","child","window","mutateDom","remove","reverse","prepend","b","property","multiple","Array","isArray","subject","carry","_typeof","concat","document","createElement","generateContext","_ref","orientation","_objectSpread","filter","selectPopper","__createPopper","__popper","__resetPopper","destroy","__popperConfig","placement","strategy","__fixed","modifiers","options","offset","boundariesElement","$root","__initPopper","$refs","__options","selectData","config","_config$__value","__ready","__value","__richValue","__isOpen","__context","__isMultiple","__isStatic","__isClearable","__isDisabled","__compareBy","__inputName","__searchable","__hasCustomSelectLabel","__externalChanged","__type","init","Popper","createPopper","TypeError","bound","autoFocus","__generateContext","defaultValue","queueMicrotask","lastValueFingerprint","effect","JSON","stringify","_step","_iterator","_createForOfIteratorHelper","s","n","done","err","f","$el","querySelectorAll","__button","focus","preventScroll","$watch","newValue","$dispatch","__componentBooted","__open","callback","__search","requestAnimationFrame","__close","$nextTick","clearButtonDirective","type","magic","$data","hasValue","shouldShowClear","tagName","hasAttribute","optionsDirective","$id","tabindex","role","id","optionDirective","rootMagic","initCallback","__optionKey","canSelectMore","tokenDirective","__key","stubCallback","data","isOpen","isSearchable","selected","selectedObject","maxSelected","canDeselectOptions","hasOptions","hasSearch","optionMagic","stub","isActive","optionEl","findClosest","context","customSelect","__el","_config$__config","directive","cleanup","bind","buttonDirective","blur","$magic","$treeSelect","$customSelect","lastSelected","handleButton","labelDirective","handleLabel","handleClearButton","handleOptions","handleOption","parent","closest","searchDirective","createTextRange","range","move","select","setSelectionRange","target","keydownSpaceStop","handleSearch","handleToken","Error","datePicker","_config$mode","__rawValue","__mode","mode","__flatpickr","_value","flatpickr","initialValue","__input","setDate","set","clickOpens","open","__clear","_config$config","onOpen","selectedDates","dateStr","instance","customConfig","customOnOpen","defaultDate","onChange","date","dateString","split","_ref2","$datePicker","handleClear","MutationObserver","mutations","mutation","attributeName","getAttribute","classList","add","describedBy","observe","attributes","handleContainer","readOnly","handleInput","handleToggle","switchToggle","onValue","offValue","isPressed","toggle","expandableEls","expandedKeys","_el$__children","__children","isExpandedEl","toggleExpandedEl","toggleExpanded","expandChildren","collapseChildren","treeSelect","__level","childrenField","handleChildToggle","__optionEl","parentNode","querySelector","__isExpanded","handleChildren","hasExpandableOptions","hasChildren","isExpanded","addEventListener","__this","__wireModel","__pond","__processingFiles","_window$FilePond","FilePond","create","pondOptions","server","process","fieldName","file","metadata","load","error","progress","abort","transfer","upload","revert","filename","removeUpload","onaddfilestart","onprocessfiles","on","desiredId","input","allowMultiple","serverIds","parse","String","getFiles","serverId","removeFile","eventId","filepond","onTextChange","onInit","__quill","Quill","quill","__quillOptions","root","innerHTML","autofocus","toolbarHandlers","modules","theme","placeholder","toolbar","container","handlers","resize","minHeight","scrollHeight","height","textareaResize","_objectDestructuringEmpty","isHidden","inputHandler","removeEventListener","group","customSelectButton","handleRoot","formGroup","plugin"],"mappings":"gnFAAA,IAAAA,cAAA,SAAeC,QAAM,MAAK,CAEtBC,eAAgB,CAAE,EAClBC,aAAc,GACdC,UAAW,KACXC,aAAc,GACdC,YAAa,GACbC,SAAU,CAAE,EACZC,OAAQ,CAAE,EAGVC,SAAU,CAAE,EACZC,YAAY,EACZC,cAAe,WACfC,YAAQC,EACRC,kBAAcD,EAMdE,kBAASC,GAAIC,MAAOC,UAA8B,IAApBC,WAAUC,UAAAC,OAAA,QAAAR,IAAAO,UAAA,IAAAA,UAAA,GAChCE,KAAOC,KAAKC,SAAW,GAAGC,SAAS,IAAIC,UAAU,GAI/CC,aAAeC,KAAKC,gBAAgBZ,MAAOW,KAAKnB,SAASqB,IAM/D,OALIH,eACAL,IAAMK,cAINR,aAKJS,KAAKpB,OAAOc,KAAOL,MAGnBW,KAAKrB,SAASe,KAAON,GAGrBY,KAAKtB,YAAYyB,KAAKT,KAGtBM,KAAK1B,eAAeoB,KAAON,GAAGgB,YAAYC,OAAOC,cAGjDhB,UAAYU,KAAKzB,aAAa4B,KAAKT,KAEnCM,KAAKO,aAAanB,GAAIC,MAAOC,SAAUI,MAlB5BA,GAqBd,EAKDa,aAAY,SAACnB,GAAIC,MAAOC,SAAUI,KAAO,EAEzCc,YAAW,SAACpB,IACR,IAAIM,IAAMe,WAAWT,KAAKrB,SAAUS,IAG9BY,KAAKvB,aAAaiC,SAAShB,aACtBM,KAAKpB,OAAOc,YAGhBM,KAAKrB,SAASe,YACdM,KAAKtB,YAAYsB,KAAKtB,YAAYiC,QAAQjB,aAC1CM,KAAK1B,eAAeoB,YACpBM,KAAKzB,aAAamB,KAEzBM,KAAKY,cAELZ,KAAKa,gBAAgBzB,GAAIM,IAC5B,EAKDmB,yBAAgBzB,GAAIM,KAAO,EAE3BoB,aAAY,WACRd,KAAKxB,UAAY,KAEjBwB,KAAKY,aACR,EAMDA,YAAW,W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X,OAAS,OAClBnb,GAAGoD,MAAM+X,OAAM,GAAAhR,OAAMnK,GAAGkb,aAAgB,KAC5C,EAUeE,eAAA,SAAAnc,QACXA,OAAOwS,UAAU,mBAAmB,SAACzR,GAAEuK,KAAAyK,kFAAsBqG,CAAA9Q,MAAA,IAAdmH,QAAOsD,MAAPtD,SATlC,SAAA1R,IACb,MAAyB,SAArBA,GAAGoD,MAAMC,UAIJrD,GAAG0D,YAChB,EAMc4X,CAAStb,KACXgb,OAAOhb,IAGX,IAAMub,aAAe,WAAH,OAASP,OAAOhb,GAAG,EAErCA,GAAG2X,iBAAiB,QAAS4D,cAE7B7J,SAAQ,WACJ1R,GAAGwb,oBAAoB,QAASD,aACpC,GACJ,GACH,EC9BDnR,SAASuN,iBAAiB,eAAe,YCH1B,SAAU1Y,QACrBA,OAAOwS,UAAU,cAAc,SAACzR,GAAIyR,WACR,UAApBA,UAAUxR,MActB,SAAqBD,GAAIf,QACrBA,OAAO0S,KAAK3R,GAAI,CACZ,SAAQ,WACJ,IAAMyb,MAAQzb,GAAGyS,QAAQ,kBACzB,GAAMgJ,MAAN,CAKA,IAAMC,mBAAqBD,MAAMpE,cAAc,sCAC/C,GAAIqE,mBACAA,mBAAmBpN,MAAM,CAAEC,eAAe,QAD9C,CAOA,IAAM6L,MAAQqB,MAAMpE,cAAc,kBAC9B+C,OACAnb,OAAOoQ,MAAM+K,OAAO9L,OALxB,CARA,CAeJ,GAER,CApCY8D,CAAYpS,GAAIf,QAO5B,SAAoBe,GAAIf,QACpBA,OAAO0S,KAAK3R,GAAI,CACZ,OAAM,WAAK,MAAO,CAAC,WAAY,GAEvC,CATY2b,CAAW3b,GAAIf,OAEvB,GACJ,CDJI2c,CAAU3c,QACVA,OAAO4c,OAAOT,eAClB"} \ No newline at end of file diff --git a/dist/manifest.json b/dist/manifest.json index dabc8a7..bb17b13 100644 --- a/dist/manifest.json +++ b/dist/manifest.json @@ -1 +1 @@ -{"/form-components.js":"/form-components.js?id=b76f7a4ea5c48752ffab"} \ No newline at end of file +{"/form-components.js":"/form-components.js?id=ef6f45e2d9d18992ce4f"} \ No newline at end of file