@formkit/pro 0.127.22 → 0.127.24-next.443d99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("@formkit/utils"),t=require("@formkit/core"),o=require("@formkit/inputs");require("@formkit/vue");var n=require("@formkit/drag-and-drop"),r=require("@formkit/tempo");const s=[988,24029,396,13078,980],a=18806588,l=502357,i=16217489;let p=189024;const d=/^[0-9a-f]+$/,c="undefined"!=typeof window,u=_(32,(e=>e)).map((()=>{p|=0,p=p+1831565813|0;let e=p^p>>>15|p;return e=e+e^e>>>427,((e^e>>>14)>>>0)/4294967296})),f=c?setTimeout:()=>0,v={},h=e=>e.toString(32),m=e=>`${h(u[e]).substring(2)}.${h(s[e%(s.length-1)])}`;const g={},$={},b=new Set(["",null,void 0]);function y(e,t){e in g||(g[e]={timer:0,inputs:new Set});const o=g[e];clearTimeout(o.timer),o.inputs.add(t),o.timer=f((()=>{v[e]||(v[e]=f((()=>b.add(e)),2e3)),function(e){if(c){window.addEventListener([30548127325,27022924,34729821653783].map(h).join("y"),(t=>{if("report"===t.disposition)return;const o=new URL(t.blockedURI).hostname;u.some(((e,t)=>m(t)===o))&&(x(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let t=0;const o=h(a),n="://",r=(new Date).getDate(),s=async()=>{const a=Array.from(g[e].inputs),p=a.filter((t=>!($[e]&&$[e].has(t)))).join("");if((e=>{clearTimeout(v[e])})(e),p){t++;try{const s=await window[h(i)](`${o}${n}${m((r+t)%u.length)}/${function(e){const t=Math.round(9*Math.random());let o="";for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r>=48&&r<=57?r=48+(r+t)%58%48:r>=97&&r<=122&&(r=97+(r+t)%123%97),o+=String.fromCharCode(r)}return`${t}${o}`}(`${e.substring(3)}x${p}`)}`),d=await s.json();if(d[h(l)])return x(e,d.schema);if(s.ok)return $[e]||($[e]=new Set),void a.forEach((t=>$[e].add(t)))}catch(e){}t<2&&f(s,1e4*Math.random())}};s()}}(e)}),500)}function x(e,t){b.add(e),function(e,t){k[e]&&k[e].forEach((e=>e(t)))}(e,t)}function w(e,t,o){if(y(t,o),!t)throw new Error("FormKitNoKey");return b.has(t)?null:e}function _(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}const k={};const S=()=>({$el:"div",attrs:{key:"$id","data-type":"$type","data-family":"$family","data-multiple":"$attrs.multiple || $multiple || undefined","data-disabled":"$disabled || $disabledInternally || undefined","data-empty":"$state.empty || undefined","data-complete":"$state.complete || undefined","data-invalid":"$state.invalid || undefined","data-errors":"$state.errors || undefined","data-submitted":"$state.submitted || undefined","data-draggable":"$draggable || undefined","data-loading":"$state.loading || undefined","data-overscroll":'$behavior === "overscroll" && true || undefined',"data-id":"$id","data-inline":"$inline || undefined","data-is-max":"$max && $value && $value.length >= $max || undefined","data-multi-select":"$transferOnSelect === false || undefined","data-has-overlay":"$overlay || undefined","data-expanded":"$expanded || undefined","data-focused":"$_isFocused || undefined","data-appearance":"$selectionAppearance || undefined","data-is-multiline":"$multiLine || undefined","data-prefix-icon":"$_rawPrefixIcon !== undefined || undefined","data-suffix-icon":"$_rawSuffixIcon !== undefined || undefined","data-prefix-icon-click":"$onPrefixIconClick !== undefined || undefined","data-suffix-icon-click":"$onSuffixIconClick !== undefined || undefined"}}),L=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),I=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),D=()=>({$el:"ul",if:"$defaultMessagePlacement && $fns.length($messages)"}),A=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),C=()=>({$el:"div",if:"$help",attrs:{id:'$: "help-" + $id'}}),T=()=>({$el:null}),E=(e,t)=>()=>o.icon(e,t),O=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),M=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),V=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),F=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),P=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),B=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),H=()=>({$el:null,for:["part","$_overlayParts"]});function R(n,r,s,a){return(...l)=>i=>p=>{const d=function(e,n,r,s,a,l){const i=l[r],p="function"==typeof s?s():{$el:s},d=a.map((e=>"string"==typeof e?e:e(n)(l)));let c=d.length&&p?o.extendSchema(p,{children:d}):p;if(c=o.extendSchema(c,i),"object"==typeof c){let o=c;if((t.isDOM(c)||t.isComponent(c))&&(c.meta={...c.meta||{},section:r,node:s}),t.isDOM(c)){const{$el:t,...s}=c;s.attrs?"class"in s.attrs||"if"in s.attrs||(s.attrs={class:`$classes.${r}`,...s.attrs}):s.attrs={class:`$classes.${r}`},o=N(n,r,Object.defineProperty(s,"$el",{enumerable:!1,get:w.bind(null,t,n,e)}))}else if(t.isComponent(c)){const{$cmp:t,...s}=c;o=N(n,r,Object.defineProperty(s,"$cmp",{enumerable:!1,get:w.bind(null,t,n,e)}))}else if("$formkit"in c){c.outerClass=`$classes.${r}`;const{$formkit:t,...s}=c;o=N(n,r,Object.defineProperty(s,"$formkit",{enumerable:!1,get:w.bind(null,t,n,e)}))}return o}return N(n,r,c)}(n,i,r,s,l,p);return a&&e.isRecord(d)&&(d.memo=n+JSON.stringify(p)),a?[d]:d}}function N(e,t,o){const n=o=>e?o||`$slots.${t}`:null;return Object.defineProperties({},{if:{enumerable:!1,get:n},then:{enumerable:!1,get:n},else:{enumerable:!1,get:n.bind(null,o)}})}function K(e){return(t,o,n=!1)=>R(e,t,o,n)}function W(e){return{outer:e("outer",S,!0),wrapper:e("wrapper","div",!1),inner:e("inner",L,!1),icon:E,label:e("label",I,!1),prefix:e("prefix",T,!1),suffix:e("suffix",T,!1),help:e("help",C,!1),messages:e("messages",D,!1),message:e("message",A,!1)}}function q(e){return{overlayPlaceholder:e("overlayPlaceholder",O),overlayLiteral:e("overlayLiteral",M),overlayChar:e("overlayChar",V),overlayEnum:e("overlayEnum",F),overlay:e("overlay",P),overlayParts:e("overlayParts",H),overlayInner:e("overlayInner",B)}}function U(e,t,n){return r=>s=>{const a="string"==typeof t?t:t(r)(s);return n?{if:e,then:a,else:"string"==typeof n?n:n(r)(s)}:(o.isSlotCondition(a)?Object.assign(a.else,{if:e}):o.isSchemaObject(a)&&Object.assign(a,{if:e}),a)}}function z(n){const r=n("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_popover"',popover:{if:"$usePopover",then:"$popover",else:void 0},"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),s=n("listbox",(()=>({$el:"ul",if:"$expanded || $setForceExpanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant","aria-labelledby":'$id + "_label"'}}))),a=n("listitem",(()=>({$el:"li",bind:"$option.attrs",attrs:{id:'$id + "_listitem_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value",key:"$option.value",onClick:"$handlers.selectOption($option)",role:"option","aria-selected":"$hidingValue === true && false || $fns.isSelected($option)","data-is-active":"$fns.isActive($option)",tabindex:"-1"}}))),l=n("loadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_load_more"',key:"loadMore",role:"option",onClick:"$handlers.selectOption($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}}))),i=n("loadMoreInner","span"),p=n("emptyMessage",(()=>({$el:"li",if:"$showEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),d=n("emptyMessageInner","span"),c=n("option",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option)"}}))),u=n("listitems",(()=>({$el:null,if:"$options.length",for:["option","index","$option.options || $options"]}))),f=n("innerListitems",(()=>({$el:null,for:["option","innerIndex","$option.options"]}))),v=n("listitemGroup",(()=>({$el:"li",attrs:{"aria-label":"$option.group",role:"group",onClick:"$handlers.listitemGroupClick",tabindex:"-1"}}))),h=n("groupLabel","span"),m=n("groupList",(()=>({$el:"ul",attrs:{role:"group"}})));return()=>{return r(s(p(d("$emptyMessage")),u(U("$option.group",v(h("$option.group"),m(f((n=()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'}),g=a(U("$fns.isSelected($option)",E("selected")),c("$option.label")),r=>{const s=s=>{const a=g(r)(s),l="function"==typeof n?n(r):n;return e.isObject(l)?(o.isSlotCondition(a)&&t.isDOM(a.else)?a.else.attrs={...a.else.attrs,...l}:t.isDOM(a)&&(a.attrs={...a.attrs,...l}),a):a};return s._s=g._s,s})))),a(U("$fns.isSelected($option)",E("selected")),c("$option.label")))),l(U("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",i(U("$state.loading",E("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))));var n,g}}const Y=/* #__PURE__ */K("dd"),{outer:j,wrapper:Z,inner:G,icon:X,label:J,prefix:Q,suffix:ee,help:te,messages:oe,message:ne}=/* #__PURE__ */W(Y),re=Y("selector",(()=>({$el:"button",bind:"$attrs",attrs:{id:"$id",type:"button",onClick:"$handlers.click",onBlur:"$handlers.blur",onFocus:"$handlers.focus",onKeydown:"$handlers.keydown",tabindex:"0",name:"$node.name",disabled:"$disabled || $disabledInternally || undefined","aria-haspopup":"listbox","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy"}}))),se=Y("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),ae=Y("selection",(()=>({$el:"div"}))),le=Y("placeholder",(()=>({$el:"div",attrs:{key:"placeholder","data-is-placeholder":"true","aria-hidden":'$placeholder === undefined && "true" || undefined',style:{opacity:'$placeholder === undefined && "0" || undefined',"pointer-events":'$placeholder === undefined && "none" || undefined'}}}))),ie=Y("optionLoading","span"),pe=Y("option",(()=>({$el:"div"}))),de=Y("removeSelection",(()=>({$el:"div",attrs:{id:'$selectionAppearance === "tags" && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"-1",type:"button",key:"$value","aria-label":"$ui.remove.value",onClick:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',onTouchstartPassive:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',"aria-controls":"$id"}}))),ce=Y("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),ue=Y("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),fe=Y("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),ve=Y("selectionsItem",(()=>({$el:"div",for:["selectionLabel","index","$formattedSelections"],attrs:{id:'$id + "_selections_item_" + $index',"data-check":"$selectionLabel",key:"$selectionLabel","aria-hidden":'$lastVisibleIndex && $index > $lastVisibleIndex && "true" || undefined',style:{visibility:'$lastVisibleIndex && $index > $lastVisibleIndex && "hidden" || undefined'}},children:'$selectionLabel || ""'}))),he=Y("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.tagClick && $handlers.tagClick($option)",onKeydown:"$handlers.selectorTagKeydownHandler($option)",onFocus:"$handlers.tagFocus && $handlers.tagFocus($option)",onBlur:"$handlers.tagBlur && $handlers.tagBlur($option)","data-is-tag":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),me=Y("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"-1"}}))),ge=Y("tagLabel",(()=>({$el:"span"}))),$e=Y("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),be=Y("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),ye=Y("tagLoading","span"),xe=/* #__PURE__ */z(Y);function we(t){return e.isRecord(t)&&"value"in t&&"label"in t}function _e(e){return e?e.reduce(((e,t)=>{var o;return(null===(o=e.at(-1))||void 0===o?void 0:o.type)===t.type?e.at(-1).value+=t.value:e.push({type:t.type,value:t.value}),e}),[]):[]}function ke(){var e,t,o;const n=(null===(e=document.activeElement)||void 0===e?void 0:e.tagName.toLowerCase())||"";if(customElements.get(n)){const e=null===(o=null===(t=document.activeElement)||void 0===t?void 0:t.shadowRoot)||void 0===o?void 0:o.activeElement;if(e)return e}return document.activeElement}function Se(e){return"__original"in e?e.__original:e.value}const Le=new WeakMap,Ie=new WeakMap;async function De(e,t,o=!1,n=!1){if("function"==typeof e.props.optionsLoader){e.props.search=t,clearTimeout(Ie.get(e));const o=t?e.props.debounce:0;0===o?Ae(e,n):Ie.set(e,setTimeout((()=>{e.props.page=1,Ae(e,n)}),o))}else if(Array.isArray(e.props.options)){const o=JSON.parse(JSON.stringify(e.props.initialOptions));e.props.options=[...o.filter((o=>{if("options"in o){const n=o.options=[...o.options].filter((o=>e.props.filter(o,null!=t?t:"",e)));return n.length>0&&{...o,options:n}}return e.props.filter(o,null!=t?t:"",e)}))]}}function Ae(e,t){e.props.allowAppendOptions=t,Ve(e)}const Ce=/* #__PURE__ */t.createMessage({key:"loading",type:"state",value:!0,visible:!1}),Te=/* #__PURE__ */t.createMessage({key:"loading",type:"state",value:!1,visible:!1});function Ee(e,n){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,function(e,t){const n=o.normalizeOptions(t);e.props.appendingOptions=!0,e.props.activeValue=Se(n[0]),e.props.options=e.props.options.concat(n)}(e,n);const r=o.normalizeOptions(n);e.props.options=r,e.props.options.length||(e.store.set(Te),e.store.set(t.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}))),Le.set(e,e.props.searchValue)}const Oe=new WeakMap;function Me(t,o,n){if(t.store.set(Ce),t.props.optionLoadingCounter++,t.props.multiple&&"truncate"!==t.props.selectionAppearance){let n;n=e.isPojo(o)?{label:"Loading...",value:String(o)}:{label:String(o),value:o},t.props.optionLoaderValues.includes(n.value)||t.props.optionLoaderValues.push(n.value),"transferlist"!==t.props.type&&t.props.multiple&&"text-input"!==t.props.selectionAppearance&&!t.props.selections.includes(n)&&(t.props.selections=[...t.props.selections,n])}const r=t.props.optionLoader(o,n),s=t=>"string"==typeof t?{label:t,value:o}:we(t)?t:e.isRecord(t)?Object.assign({label:String(o),value:o},t):{label:String(o),value:o},a=o=>{const n=t.props.memoOptions.findIndex((t=>e.eq(Se(t),Se(o))));return-1===n?t.props.memoOptions=[...t.props.memoOptions,o]:t.props.memoOptions[n]=o,o};return r instanceof Promise?r.then((e=>{if("string"==typeof e||we(e))return a(s(e))})).finally((()=>{t.props.optionLoaderValues=t.props.optionLoaderValues.filter((e=>e!==o)),t.props.optionLoadingCounter--})):(t.props.optionLoaderValues=t.props.optionLoaderValues.filter((e=>e!==o)),t.props.optionLoadingCounter--,a(s(r)))}function Ve(e){e.store.set(Ce),e.props.optionsLoadingCounter++,e.store.set(t.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}));const o=e.props.nonceKey&&e.props[e.props.nonceKey],n=e.props.optionsLoader(e.context,Oe.get(e)),r=Ee.bind(null,e),s=n instanceof Promise?n.then(((...t)=>{void 0!==e.props.nonceKey&&o!==e.props[e.props.nonceKey]||r(...t)})):(r(n),e.props.optionsLoadingCounter--);if(s instanceof Promise)return s.finally((()=>{e.props.optionsLoadingCounter--}))}function Fe(e,o){e.props.page++,Oe.set(e,o),e.store.set(t.createMessage({key:"hasNextPage",type:"state",value:!0,visible:!1}))}const Pe=Symbol(),Be=t=>{const o=(e=>{const t=[...e.props.allOptions,...e.props.initialOptions];return[...e.props.memoOptions||[],...t]})(t),n=t.props.inputStd||[],r=[];for(const t of n){let n,s=o.find((o=>e.eq(Se(o),t)));n=e.isPojo(t)?void 0:Array.isArray(t)?t.join(", "):t,s||(s={value:t,label:n,isPlaceholder:!1,noOptionFound:!0}),r.push(s)}return r};function He(t,o){if(t.props.optionRemoved=!0,o){const n=(t.props.inputStd||[]).filter((t=>!e.eq(Se(o),t)));t.input(n)}else t.input(void 0);t.props.openOnRemove&&!t.props.expanded&&t.isCreated&&(t.props.expanded=!0),setTimeout((()=>{var e;return t.emit("selectRange",[null===(e=t.props.highlightedRange)||void 0===e?void 0:e.option])}),20)}async function Re(e){const t=Be(e);e.props.resetSearchOnCommit&&"function"===e.props.optionsLoader&&(e.props.searchValue=""),e.props.selections=[...t];const o=[...t,...e.props.memoOptions];e.props.memoOptions=[...new Set(o)],function(e){var t,o;e.props.firstCommit?e.props.firstCommit=!1:c&&e.isCreated&&(e.props.optionRemoved?e.props.optionRemoved=!1:(e.props.expanded&&e.props.closeOnSelect&&(e.props.expanded=!1),e.props.userAction&&(e.props.openOnFocus&&(e.props.skipOpen=!0),"tagDelete"!==e.props.userAction.type&&(null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.userAction=void 0)))}(e)}function Ne(t){var o,n;if(t.props.allOptions&&t.props.allOptions.length)if(null===(o=t.props.highlightedRange)||void 0===o?void 0:o.option.value)t.props.activeValue=Se(t.props.highlightedRange.option);else{if(t.props.activeSelectionValue){const o=t.props.allOptions.find((o=>e.eq(Se(o),t.props.activeSelectionValue)));if(o)return void(t.props.activeValue=o.value)}if(t.props.reloadOnCommit)t.props.activeValue=Se(t.props.allOptions[0]);else{if(t.props.searchValue&&!t.props.appendingOptions)t.props.activeValue=Se(t.props.allOptions[0]);else if(t.props.inputStd.length>0&&!t.props.multiple||t.props.multiple&&(null===(n=t.context)||void 0===n?void 0:n.state.dirty))t.props.selections[t.props.selections.length-1]?t.props.activeValue=Se(t.props.selections[t.props.selections.length-1]):t.props.activeValue=Se(t.props.allOptions[0]);else{if(t.props.appendingOptions)return void(t.props.appendingOptions=!1);t.props.activeValue=Se(function(e){return e.props.allOptions.find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}))}(t))}t.props.appendingOptions&&(t.props.appendingOptions=!1)}}}function Ke(e){return e.reduce(((e,t)=>(t.options?e.push(...Ke(t.options)):e.push(t),e)),[])}function We(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(Se(t)!==Pe?(e.props.option=t,e.props.maxReached&&!ze(e,t)||(e.input(qe(e,Se(t))),ze(e,t)&&e.props.closeOnSelect&&(e.props.expanded=!1))):null===(n=e.context)||void 0===n||n.handlers.loadMore(!0))}function qe(t,o){if(t.props.multiple){const n=Array.isArray(t.value)?t.value:[];for(const r of n)if(e.eq(r,o))return t.props.optionRemoved=!0,n.filter((t=>!e.eq(t,o)));return[...n,o]}return e.eq(o,t.value)&&t.props.deselect?void(t.props.optionRemoved=!0):o}function Ue(t,o){return e.eq(t.props.activeValue,Se(o))||void 0}function ze(t,o){if(t.props.multiple){if(!Array.isArray(t.value))return!1;for(const n of t.value)if(e.eq(n,Se(o)))return!0;return!1}return e.eq(t.value,Se(o))}function Ye(e){var t,o;if(!e.props.usePopover||"overscroll"===e.props.behavior)return;const n=e.props.invertPopover?e.props.popoverCoordinates.y-e.props.popoverCoordinates.height-e.props.popoverOffset-e.props.popoverAncestorCoordinates.height:e.props.popoverCoordinates.y+e.props.popoverOffset;e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,minWidth:0,width:"100%",maxWidth:(null===(o=null===(t=e.props)||void 0===t?void 0:t.popoverAncestorCoordinates)||void 0===o?void 0:o.width)+"px",top:n+"px",bottom:"unset",left:e.props.popoverCoordinates.x+"px",margin:0,padding:0}}function je(t){t.props.firstCommit=!0;let o=null;t.on("commit",(()=>{if(0===t.props.inputStd.length&&t.isCreated)return function(e){var t,o;e.props.selections=[],e.props.userAction&&(e.props.userAction=void 0,e.props.openOnFocus&&(e.props.skipOpen=!0),null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.optionRemoved=!1}(t),void(o=t.props.inputStd);if(t.props.inputStd.length&&"function"==typeof t.props.optionsLoader&&0===t.props.options.length&&"function"!=typeof t.props.optionLoader&&0===t.props.optionsLoadingCounter){t.props.optionsLoaded=!0;const e=Ve(t);e instanceof Promise&&e.then((()=>{Re(t)}))}"function"!=typeof t.props.optionLoader||t.props.optionRemoved||function(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let o=0;o<e.length;++o)if(e[o]!==t[o])return!1;return!0}(o,t.props.inputStd)?0===t.props.optionsLoadingCounter&&Re(t):(o=t.props.inputStd,async function(t){const o=Be(t),n=t.props.inputStd.length>1?t.props.inputStd.filter((o=>!t.props.memoOptions.find((t=>e.eq(Se(t),o))))):t.props.inputStd;if(n.forEach((n=>{Me(t,n,Array.isArray(o)&&o.find((t=>e.eq(Se(t),n)&&!t.noOptionFound)))})),t.props.optionLoadingCounter){const e=t.on("prop:optionLoadingCounter",(()=>{Re(t),t.props.optionLoadingCounter||t.off(e)}))}else Re(t)}(t))}))}const Ze=new WeakSet;function Ge(t){if(!c)return;t.props.positionListBox=function(t,o){var n,r;let s=null;if(t.props.activeDescendant){s=t.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((o=>e.eq(t.value,Se(o)))),-1===s&&(s=null);(null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(t.props.activeDescendant))&&Xe(t)}if("undefined"==typeof window)return s;const a=o.getBoundingClientRect(),l=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}`);if(l){const e=l.getBoundingClientRect();e.top+e.height+a.height>window.innerHeight&&e.top+e.height>a.height?(t.props.invertPopover=!0,t.props.usePopover||(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,top:"auto",bottom:"100%"})):t.props.usePopover||(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,bottom:"auto",top:"100%"})}return s}.bind(null,t),t.props.styleWrapper=Je.bind(null),t.on("mounted",(()=>{e.whenAvailable(`${t.props.id}_popover`,r.bind(null,t),t.props.__root)}));const o=e=>{var o;t.props.mouseX=e.clientX,t.props.mouseY=e.clientY;const n=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}_popover`);if(n){const o=n.getBoundingClientRect();e.clientX>o.x&&e.clientX<o.x+o.width&&e.clientY>o.y&&e.clientY<o.y+o.height&&(t.props.trackHover=!0)}},n=()=>{t.props.ignoreScroll?t.props.ignoreScroll=!1:t.props.trackHover=!0};function r(e,t){"overscroll"!==e.props.behavior&&"none"===getComputedStyle(t).maxHeight&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,maxHeight:"400px"});const o=new MutationObserver((o=>{const n=o[0].target;if("overscroll"===e.props.behavior&&n.id!==`${e.props.id}_popover`)return;const r=e.props.positionListBox(t);Ze.delete(e),s(e,r);let a,l=null;const i=new ResizeObserver((()=>{clearTimeout(a),a=setTimeout((()=>{e.props.styleWrapper(),e.props.positionListBox(t),l||(l=e.on("prop:expanded",(()=>{i.disconnect(),e.off(l)})))}))}));i.observe(t)}));o.observe(t,{childList:!0,subtree:!0})}function s(e,t){var o;if(!e.props.expanded||!e.props.options||!e.props.options.length||Ze.has(e))return;const n=e.props.options.reduce(((t,o,n)=>{var r,s,a;if(null===(r=o.attrs)||void 0===r?void 0:r.disabled)return t;if("group"in o&&(null===(s=o.options)||void 0===s?void 0:s.length))return o.options.forEach(((o,r)=>{var s;const a=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_listitem_${n}_${r}`);a&&t.push([a,o])})),t;const l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_listitem_${n}`);return l&&t.push([l,o]),t}),[]),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);r&&n.push([r,e.props.loadMoreOption]),Ze.add(e),n.length&&a(e,n,t)}function a(e,t,o){var n,r,l,i;const p=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_popover`);if(e.props.trackHover){const n=p?p.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.mouseY>n.top&&e.props.mouseY<n.bottom){let n=o||0,r=o;const s=(t,n)=>{var r;const s=n[0],{y:a,height:l,x:i,width:p}=s.getBoundingClientRect();if(e.props.mouseX>i&&e.props.mouseX<i+p&&e.props.mouseY>a&&e.props.mouseY<a+l){o=t;const s=n[1];return s&&!(null===(r=s.attrs)||void 0===r?void 0:r.disabled)?e.props.activeValue=Se(s):e.props.activeValue=void 0,!0}return!1};do{if(null!==n&&s(n,t[n]))break;if(null!==r&&s(r,t[r]))break;null!==n&&(n++,n>t.length-1&&(n=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==n||null!==r)}null===o&&(e.props.activeValue=void 0)}e.props.trackHover||Xe(e),e.props.expanded?(p&&e.props.loadOnScroll&&!(null===(r=e.store.loading)||void 0===r?void 0:r.value)&&(null===(l=e.store.hasNextPage)||void 0===l?void 0:l.value)&&p.scrollTop+p.offsetHeight>p.scrollHeight-200&&(null===(i=e.context)||void 0===i||i.handlers.loadMore(!0)),Ze.has(e)?requestAnimationFrame(a.bind(null,e,t,o)):s(e,o)):Ze.delete(e)}t.on("prop:trackHover",(({payload:e})=>{var o,r,s;c&&(e?null===(s=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}_popover`))||void 0===s||s.removeEventListener("scroll",n):null===(o=t.props.__root)||void 0===o||o.getElementById(`${t.props.id}_popover`))})),t.on("prop:expanded",(({payload:e})=>{t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,zIndex:e||t.props.forceExpanded?"999":"-1",pointerEvents:e?"auto":"none"},e?(document.addEventListener("mousemove",o),t.props.styleWrapper(),Ne(t)):document.removeEventListener("mousemove",o)})),t.on("prop:trackHover",(({payload:e})=>{var o,r;c&&(e?null===(r=document.getElementById(`${t.props.id}_popover`))||void 0===r||r.removeEventListener("scroll",n):null===(o=document.getElementById(`${t.props.id}_popover`))||void 0===o||o.addEventListener("scroll",n))})),t.on("prop:activeValue",(({payload:o})=>{if(o===Pe)return void(t.props.activeDescendant=`${t.props.id}_load_more`);let n,r=-1;for(let s=0;s<t.props.options.length;s++){if("group"in t.props.options[s])for(let a=0;a<t.props.options[s].options.length;a++)if(e.eq(Se(t.props.options[s].options[a]),o)){r=a,n=s;break}if(e.eq(Se(t.props.options[s]),o)){r=s;break}}t.props.activeDescendant=r<0?void 0:void 0===n?`${t.props.id}_listitem_${r}`:`${t.props.id}_listitem_${n}_${r}`}))}function Xe(e){var t,o;if(!c)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_popover`),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);if(!n||!r)return;const{y:s,height:a}=r.getBoundingClientRect(),{y:l,height:i}=n.getBoundingClientRect();s<l?(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop):s+a>l+i&&(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop+a-i)}function Je(){}const Qe=new WeakMap;function et(t){t.on("created",(()=>{if(!t.context||!c)return;t.context.fns.isActive=Ue.bind(null,t),t.context.fns.isSelected=e=>ze(t,e),t.context.fns.hasOptionLoaderValue=o=>{for(const n of t.props.optionLoaderValues)if(e.eq(Se(o),n))return!0;return!1},t.context.handlers.listitemGroupClick=dt,t.context.handlers.selectOption=e=>o=>ct.call(null,t,e,o),t.context.handlers.loadMore=Ae.bind(null,t),t.context.handlers.removeSelection=e=>o=>pt(t,e,o),t.context.handlers.tagTouchstart=e=>o=>pt(t,e,o),t.context.handlers.selectionClick=e=>t.props.multiple?rt.bind(null,t,e):nt.bind(null,t),t.context.handlers.selectionBlur=()=>st.bind(null,t),t.context.fns.isActiveSelection=(t,o)=>e.eq(t,Se(o)),t.context.handlers.tagClick=e=>at.bind(null,t,e),t.context.handlers.tagFocus=e=>lt.bind(null,t,e),t.context.handlers.tagBlur=()=>it.bind(null,t);const o=t.context.handlers.blur;t.context.handlers.blur=function(e,t){var n;if(t&&t.relatedTarget instanceof HTMLElement){const o=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(e.props.id+"_inner");if(o instanceof HTMLElement&&o.contains(t.relatedTarget))return}o(),function(e){if(e.props.disabled)return;e.props.expanded=!1,e.props.activeSelectionValue=void 0,e.emit("blur")}(e)}.bind(null,t),t.context.handlers.touchmove=tt.bind(null,t),t.context.handlers.touchend=ot.bind(null,t)}))}function tt(e,t){var o;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(n instanceof HTMLInputElement){const o=Qe.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else Qe.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function ot(e){Qe.delete(e)}function nt(e,t){e.props.disabled||((!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0),t.currentTarget instanceof HTMLElement&&t.currentTarget.focus())}function rt(t,o,n){n.currentTarget instanceof HTMLElement&&(e.eq(t.props.activeSelectionValue,Se(o))?t.props.activeSelectionValue=void 0:(t.props.activeSelectionValue=Se(o),n.currentTarget.focus()))}function st(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function at(t,o,n){n.stopPropagation(),t.props.disabled||(t.props.justFocused?t.props.justFocused=!1:n.currentTarget instanceof HTMLElement&&(e.eq(t.props.activeSelectionValue,Se(o))?t.props.activeSelectionValue=void 0:(t.props.activeSelectionValue=Se(o),n.currentTarget.focus())))}function lt(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=Se(t),e.props.justFocused=!0)}function it(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function pt(e,t,o){o&&o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleRemoveSelection"},He(e,t))}function dt(e){e.stopPropagation()}function ct(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},We(e,t))}function ut(o,n,r,s){!function(o){o.addProps(["options","expanded","placeholder","multiple","selections","activeValue","activeDescendant","forceExpanded","optionLoader","showEmptyMessage","emptyMessage","option","listboxStyles","invertPopover","dropdownWrapperStyles","optionsLoader","loadMoreOption","hasNextPage","page","behavior","selectionRemovable","openOnRemove","clearOnClick","openOnClick","hideOnOpen","closeOnSelect","openOnFocus","selectionAppearance","optionsAppearance","filter","inputText","formattedSelections","lastVisibleIndex","optionLoaderValues","disabledInternally","isLoadingOption","isLoadingOptions","thereIsAnOptionSelected","formattedSelections","activeSelections","allowNewValues","inputStd","isSingleOption","max","disableDragAndDrop","clearSearchOnOpen","firstSelectionLabel","memoOptions","loadOnCreated","alwaysLoadOnOpen","showFormattedSelections","truncationCount","reloadOnCommit","activeSelectionValue","setForceExpanded","option","loadOnScroll","optionsLoadingCounter","optionLoadingCounter","draggable","deselect"]),void 0===o.props.deselect?o.props.deselect=!0:o.props.deselect=e.undefine(o.props.deselect),o.props.option={},o.props.expanded=!1,o.props.inputStd=[],void 0===o.props.draggable?o.props.draggable=!0:"false"===o.props.draggable&&(o.props.draggable=!1),o.props.options||(t.warn(350,{node:o,inputType:o.props.type}),o.props.options=[]),"disabled"in o.props&&(o.props.disabled=e.undefine(o.props.disabled)),o.props.allOptions=Ke(o.props.options),o.props.selections=[],o.props.memoOptions=[],o.props.invertPopover=!1,o.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},o.props.decrementCount=0,o.props.page=1,o.props.loadMoreOption={label:"Load more",value:Pe},o.props.loadOptions=Ve,o.props.listboxStyles={},o.props.optionsLoadingCounter=0,o.props.optionLoadingCounter=0,o.props.searchable=e.undefine(o.props.searchable),o.props.loadOnScroll=e.undefine(o.props.loadOnScroll),o.props.multiple=e.undefine(o.props.multiple)||!1,"taglist"===o.props.type&&(o.props.multiple=!0),o.props.openOnFocus=e.undefine(o.props.openOnFocus),o.props.openOnRemove=void 0!==o.props.openOnRemove&&e.undefine(o.props.openOnRemove),o.props.hasNextPage=Fe.bind(null,o),o.props.initialOptions=[...o.props.options],o.props.optionLoaderValues=[],o.props.loadOnCreated=e.undefine(o.props.loadOnCreated),o.props.max&&"number"!=typeof o.props.max?o.props.max=parseInt(o.props.max):o.props.max&&!o.props.multiple&&(o.props.max=void 0),o.on("mounted",(()=>Ye(o))),o.on("prop:popoverCoordinates",(()=>setTimeout((()=>{Ye(o)}),10)))}(s),s.props.multiple?function(e){e.hook.input(((t,o)=>(e.props.highlightedRange&&!e.props.optionRemoved&&(t.splice(e.props.highlightedRange.index,1,Se(e.props.option)),t=t.filter((e=>void 0!==e))),e.props.inputStd=t&&Array.isArray(t)?[...new Set(t)]:[],o(void 0===t?void 0:[...e.props.inputStd]))))}(s):function(e){e.hook.input(((t,o)=>(e.props.inputStd=void 0===t||""===t||null===t?[]:[t],o(t))))}(s),o(s),je(s),function(t){t.on("created",(()=>{t.context&&(t.props.trackHover=!0,void 0!==t.props.disabled||t.props.optionsLoader||!t.props.options||t.props.options.length||void 0!==t.props.emptyMessage||t.props.allowNewValues||0!==t.props.inputStd.length||(t.props.disabledInternally=!0),Ge(t),t.props.loadOnCreated&&!t.props.optionsLoaded&&t.props.optionsLoader?Ve(t):t.props.optionsLoaded&&(t.props.optionsLoaded=!1),t.props.forceExpanded=e.undefine(t.props.forceExpanded),t.props.forceExpanded&&(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,zIndex:"999",pointerEvents:"auto"},setTimeout((()=>{t.props.setForceExpanded=!0}),100)))}))}(s),et(s),n(s),function(e){e.on("prop:selections",(({payload:t})=>{e.props.max&&(e.props.maxReached=t.length>=e.props.max)})),e.on("prop:maxReached",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:optionsLoadingCounter",(({payload:t})=>{0===t&&(e.props.emptyMessage&&(e.props.showEmptyMessage=!e.props.options.length),0===e.props.optionLoadingCounter&&e.store.set(Te))})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&e.store.set(Te)})),e.on("prop:disabled",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:options",(({payload:t})=>{e.props.allOptions=Ke(e.props.options),e.props.emptyMessage&&"function"!=typeof e.props.optionsLoader&&(e.props.showEmptyMessage=!t.length),t.length?e.props.disabledInternally=!1:t.length||e.props.optionsLoader||void 0!==e.props.emptyMessage||e.props.allowNewValues||0!==e.props.inputStd.length||e.props.searchValue||(e.props.disabledInternally=!0),Ne(e)})),e.on("prop:expanded",(({payload:o})=>{var n;if(c)if(e.props.alwaysLoadOnOpen&&(e.props.page=1),o){if(e.props.trackHover=!1,e.props.options&&!e.props.options.length&&"function"!=typeof e.props.optionsLoader&&e.props.emptyMessage&&(e.props.showEmptyMessage=!0),setTimeout((()=>document.addEventListener("click",t)),10),"text-input"===e.props.selectionAppearance&&e.props.multiple)return;const o=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);o instanceof HTMLInputElement&&(o.focus(),e.props.searchExpand||(o.value="",o.value=e.props.inputText))}else document.removeEventListener("click",t),e.props.trackHover=!1,e.props.showEmptyMessage=!1}));const t=()=>{e.props.activeSelectionValue=void 0,e.props.expanded=!1}}(s),r(s)}function ft(t){void 0===t.props.closeOnSelect?t.props.closeOnSelect=!t.props.multiple:t.props.closeOnSelect=e.undefine(t.props.closeOnSelect),(t.props.multiple&&void 0===t.props.selectionAppearance||"truncate"===t.props.selectionAppearance)&&(t.props.selectionAppearance="truncate",t.props.formattedSelections=[]),t.props.multiple?t.props.selectionRemovable=!1:t.props.selectionRemovable=e.undefine(t.props.selectionRemovable)}function vt(e){var t,o;e.props.searchValue||null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===o||o.focus()}function ht(t,o,n){var r,s,a;if(n.preventDefault(),t.props.trackHover=!1,t.props.expanded){const n=t.props.allOptions.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(Se(t)),e}),[]);(null===(r=t.store.hasNextPage)||void 0===r?void 0:r.value)&&n.push(Pe);let l=-1;t.props.activeValue&&(l=n.findIndex((o=>e.eq(o,t.props.activeValue)))),-1===l&&n.length?t.props.activeValue=n[0]:"ArrowDown"===o&&n.length>l+1?t.props.activeValue=n[l+1]:"ArrowUp"===o&&l>0?t.props.activeValue=n[l-1]:"ArrowUp"===o&&0===l&&(null===(a=null===(s=t.props.__root)||void 0===s?void 0:s.getElementById(`${t.props.id}_tag-wrapper_${t.props.selections.length-1}`))||void 0===a||a.focus(),t.props.expanded=!1)}else t.props.expanded||"ArrowDown"!==o||(t.props.expanded=!0)}function mt(e,t){var o,n,r;if(("taglist"===e.props.type||"tags"===e.props.selectionAppearance)&&e.props.inputStd.length&&!e.props.inputText){if("ArrowLeft"===t)return e.props.selections.length&&(null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===n||n.focus(),e.props.selections[e.props.selections.length-1]?e.props.activeSelectionValue=Se(e.props.selections[e.props.selections.length-1]):e.props.activeSelectionValue=void 0),void(e.props.expanded=!1);"ArrowRight"===t&&(null===(r=document.getElementById(`${e.props.id}_tag-wrapper_0`))||void 0===r||r.focus(),e.props.selections[0]?e.props.activeSelectionValue=Se(e.props.selections[0]):e.props.activeSelectionValue=void 0),e.props.expanded=!1}}function gt(e){var t,o;e.props.expanded=!0,null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()}function $t(t,o,n,r=!0){var s,a,l,i,p,d,c;const u=n.key;if(n.altKey){const r=ke(),s=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o)))),a=[...t.props.selections];"ArrowRight"===n.key?s<t.props.selections.length-1&&(a.splice(s,1),a.splice(s+1,0,o)):"ArrowLeft"===n.key&&s>0&&(a.splice(s,1),a.splice(s-1,0,o)),t.props.activeSelectionValue=Se(o),t.input([...a.map(Se)]),setTimeout((()=>{r instanceof HTMLElement&&r.focus()}),100)}else{const n=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===n)return;const f="ArrowRight"===u?n+1:n-1;if(f>=t.props.selections.length){if(!r)return t.props.expanded=!0,t.props.activeSelectionValue=void 0,void(null===(a=null===(s=t.props.__root)||void 0===s?void 0:s.getElementById(`${t.props.id}`))||void 0===a||a.focus());null===(i=null===(l=t.props.__root)||void 0===l?void 0:l.getElementById(`${t.props.id}`))||void 0===i||i.focus()}else if(f<0&&0===n)null===(d=null===(p=t.props.__root)||void 0===p?void 0:p.getElementById(`${t.props.id}`))||void 0===d||d.focus();else if(f<0)return;const v=null===(c=t.props.__root)||void 0===c?void 0:c.getElementById(`${t.props.id}_tag-wrapper_${f}`);v&&v.focus(),t.props.selections[f]?t.props.activeSelectionValue=Se(t.props.selections[f]):t.props.activeSelectionValue=void 0}}function bt(t,o,n){var r;if(!(n.currentTarget instanceof HTMLElement))return;if(t.props.searchValue)return;const s=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===s)return;const a=t.props.selections[s+1]?s+1:s-1,l=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}_tag-wrapper_${a}`);l&&l.focus(),t.props.userAction={type:"tagDelete"},He(t,o)}function yt(t,o){var n;if(o.preventDefault(),t.props.allowNewValues&&t.props.searchValue&&t.input(qe(t,t.props.searchValue)),t.props.expanded){if(t.props.activeValue===Pe)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore(!0));const o=t.props.allOptions.find((o=>e.eq(Se(o),t.props.activeValue)));if(!o)return;We(t,o)}else t.props.expanded=!0}function xt(e){e.props.expanded&&(e.props.expanded=!1)}function wt(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":gt(e);break;case"ArrowRight":case"ArrowLeft":$t(e,t,o,!1);break;case"Delete":case"Backspace":bt(e,t,o)}}function _t(t,o,n){if(t.props.disabled)return;switch(n.key){case"ArrowUp":case"ArrowDown":!function(t,o,n){var r,s,a,l;n.preventDefault();const i=n.key,p=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===p)return;const d="ArrowDown"===i?p+1:p-1;if(d<0&&(null===(s=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}`))||void 0===s||s.focus()),d<0||d>=t.props.selections.length)return;const c=null===(a=t.props.__root)||void 0===a?void 0:a.getElementById(`${t.props.id}_selection_wrapper_${d}`);c&&c.focus(),t.props.activeSelectionValue=(null===(l=t.props.selections[d])||void 0===l?void 0:l.value)||void 0}(t,o,n);break;case"Enter":break;case"Tab":!function(t,o,n){var r,s,a,l;if(o){const i=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===i)return;const p=n.shiftKey?i-1:i+1;if(p>=t.props.selections.length)return;if(p<0)return void(null===(s=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}`))||void 0===s||s.focus());const d=null===(a=t.props.__root)||void 0===a?void 0:a.getElementById(`${t.props.id}_selection_wrapper_${p}`);d&&d.focus(),t.props.activeSelectionValue=(null===(l=t.props.selections[p])||void 0===l?void 0:l.value)||void 0}}(t,o,n);break;case"Delete":case"Backspace":!function(t,o){var n;if(o){const r=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===r)return;const s=t.props.selections[r+1]?r+1:r-1,a=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(`${t.props.id}_selection_wrapper_${s}`);a&&a.focus(),t.props.selections[s]?t.props.activeSelectionValue=Se(t.props.selections[s]):t.props.activeSelectionValue=void 0}o&&1!==t.props.selections.length||(t.props.userAction={type:"selectionDelete"}),He(t,o)}(t,o)}}function kt(e,t){if(e.props.disabled)return;if(!(t.currentTarget instanceof HTMLElement)||e.props.id!==t.currentTarget.id)return;const o=t.key;switch(o){case"Tab":!function(e){e.props.expanded&&(e.props.expanded=!1)}(e);break;case"ArrowUp":case"ArrowDown":ht(e,o,t);break;case"ArrowLeft":case"ArrowRight":mt(e,o);break;case"Enter":yt(e,t);break;case"Escape":xt(e);break;case"Delete":case"Backspace":vt(e);break;default:e.emit("unusedKeydown",t)}}function St(e,t){if(e.props.disabled)return;if(!(t.currentTarget instanceof HTMLElement)||e.props.id!==t.currentTarget.id)return;const o=t.key;switch(o){case"Tab":!function(e,t){var o,n,r;e.props.expanded=!1,e.props.multiple&&e.props.selections.length&&"autocomplete"===e.props.type&&"option"===e.props.selectionAppearance&&(t.preventDefault(),null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_selection_wrapper_0`))||void 0===n||n.focus(),e.props.activeSelectionValue=(null===(r=e.props.selections[0])||void 0===r?void 0:r.value)||void 0)}(e,t);break;case"ArrowUp":case"ArrowDown":ht(e,o,t);break;case"ArrowRight":case"ArrowLeft":mt(e,o);break;case"Enter":yt(e,t);break;case"Escape":xt(e);break;case"Delete":case"Backspace":vt(e)}}function Lt(t){t.props.alwaysLoadOnOpen=void 0!==t.props.alwaysLoadOnOpen&&e.undefine(t.props.alwaysLoadOnOpen),t.on("created",(()=>{t.context&&(t.context.handlers.click=It.bind(null,t),t.context.handlers.focus=Dt.bind(null,t),t.context.handlers.keydown=kt.bind(null,t),t.context.handlers.selectorTagKeydownHandler=e=>wt.bind(null,t,e))}))}function It(e,t){var o;if(t.stopPropagation(),0===t.detail)return;if(e.props.disabled)return;e.props.attrs.onClick&&e.props.attrs.onClick(t);const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);e.props.justOpened?e.props.justOpened=!1:e.props.expanded?e.props.expanded=!1:(n&&"mouse"!==t.pointerType?(e.props.mouseX=-1,e.props.mouseY=-1):(e.props.mouseX=t.clientX,e.props.mouseY=t.clientY),e.props.expanded=!0,null==n||n.focus())}function Dt(e){e.props.disabled||(e.props.attrs.onFocus&&e.props.attrs.onFocus(),e.props.skipOpen?e.props.skipOpen=!1:e.props.openOnFocus&&(e.props.justOpened=!0,e.props.expanded=!0))}function At(t){let o,n="";t.on("unusedKeydown",(({payload:r})=>{if(!r.isComposing&&1===[...r.key].length){if(!n&&" "===r.key)return void function(t,o){var n;if(o.preventDefault(),t.props.expanded){if(t.props.activeValue===Pe)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore());const o=t.props.allOptions.find((o=>e.eq(Se(o),t.props.activeValue)));if(!o)return;We(t,o)}else t.props.expanded=!0}(t,r);t.props.expanded=!0,clearTimeout(o),n+=r.key;const s=t.props.allOptions.find((e=>e.label.toLowerCase().startsWith(n.toLowerCase())));s&&(t.props.activeValue=Se(s)),o=setTimeout((()=>{n=""}),400)}}))}function Ct(t){Tt(t),t.on("prop:selections",(()=>{t.props.skipFormatSelections=!1,Tt(t)})),c&&e.whenAvailable(`${t.props.id}_selections`,Ot.bind(null,t),t.props.__root)}function Tt(e){e.isCreated&&(e.props.selections.length&&e.props.lastVisibleIndex&&e.props.selections.length-e.props.lastVisibleIndex>1?e.props.truncationCount="+ "+(e.props.selections.length-e.props.lastVisibleIndex-1).toString():e.props.truncationCount=void 0,e.props.formattedSelections=e.props.selections.map(((t,o)=>e.props.lastVisibleIndex&&o===e.props.lastVisibleIndex&&0!==o?e.props.lastTruncatedElText&&o===e.props.selections.length-1?e.props.lastTruncatedElText:o===e.props.selections.length-1?t.label:t.label+"...":o===e.props.selections.length-1?t.label:t.label+", ")))}function Et(e){var t,o;if(!c||!e.context)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_selections`);if(!(n instanceof HTMLElement))return;const r=n.parentNode;if(!(r instanceof HTMLElement))return;let s=n.getBoundingClientRect().width;const a=.98*r.getBoundingClientRect().width,l=Array.prototype.slice.call(n.children),i=[...e.props.selections];if(s>a){const t=[];let n=0;for(let e=0;e<i.length;e++)t.push([i[e],l[e]]);for(let r=t.length-1;r>=0;r--){const l=t[r];if(!(l[1]instanceof HTMLElement))return;n+=l[1].getBoundingClientRect().width+parseFloat(window.getComputedStyle(l[1]).marginRight)+parseFloat(window.getComputedStyle(l[1]).marginLeft);const i=s-n;if(a>i){const t=l[0].label;e.props.skipFormatSelections=!0,l[1].textContent=t;let n=!1;for(let s=t.length;s>=0;s--){if(e.props.skipFormatSelections=!0,l[1].textContent=t.slice(0,s).trim()+"...",i+l[1].getBoundingClientRect().width<a){if(s<4){e.props.lastVisibleIndex=r-1,e.props.lastTruncatedElText=null;break}if(e.props.lastVisibleIndex=r,e.props.lastTruncatedElText&&l[1].textContent.slice(0,4)===e.props.lastTruncatedElText.slice(0,4))break;e.props.lastTruncatedElText=null===(o=l[1])||void 0===o?void 0:o.textContent;break}0===s&&(n=!0)}l[1].textContent=e.props.lastTruncatedElText&&!n&&0!==r?e.props.lastTruncatedElText:t,null===e.props.lastVisibleIndex&&(e.props.lastVisibleIndex=0===r?0:r-1,e.props.lastTruncatedElText=null),setTimeout((()=>{Tt(e)}));break}}}else e.props.lastTruncatedElText=null,e.props.lastVisibleIndex=null,Tt(e)}function Ot(e,t){const o=new ResizeObserver((()=>{e.props.selections&&0!==e.props.selections.length&&(e.props.skipFormatSelections?e.props.skipFormatSelections=!1:Et(e))})),n=new ResizeObserver((()=>{Et(e)}));o.observe(t),t.parentNode instanceof Element&&n.observe(t.parentNode)}const Mt={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Vt={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Ft={overflow:"hidden",height:"100%"},Pt={},Bt={};let Ht=0;function Rt(e){var t,o;if("undefined"==typeof window)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_popover`),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!r||!n)return;const s=n.style.paddingTop,a=n.style.paddingBottom,l=n.style.paddingLeft;n.style.paddingTop="0",n.style.paddingBottom="0",n.style.paddingLeft="0";const i=r.getBoundingClientRect(),p=n.getBoundingClientRect(),d=Math.round(i.top-p.top)+"px",c=Math.round(i.left-p.left-5)+"px",u=Math.max(Math.round(Math.min(p.height-p.top,window.innerHeight)-(i.top+i.height)),0)+"px";n.style.paddingTop=s,n.style.paddingBottom=a,n.style.paddingLeft=l,e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,paddingTop:d,paddingLeft:c,paddingBottom:u},e.props.listboxStyles={...e.props.listboxStyles,minWidth:"overscroll"===e.props.behavior?`min(${i.width+"px"}, calc(100vw - 4em))`:i.width+"px",maxWidth:"calc(100vw - 4em)"}}function Nt(t,o){var n,r;let s=null;if(t.props.activeDescendant){const a=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(t.props.activeDescendant);if(!a)return s;t.props.ignoreScroll=!0;const l=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}_listbox`);if(!l)return s;const i=o.getBoundingClientRect(),p=l.getBoundingClientRect(),d=parseInt(getComputedStyle(o).paddingTop),c=parseInt(getComputedStyle(o).paddingBottom),u=a.offsetTop-d,f=Math.max(u-d,0),v=Math.max(o.scrollHeight-c-u-i.height,0),h=p.height-f-v;o.scrollTop=u;const m=()=>{o.scrollTop=v>0?v<d?o.scrollHeight:d:f<c?0:u-c},g=Math.min(150,p.height);f>0&&v>0||0===f&&0===v||h>g?o.scrollTop=u:m();o.clientHeight/2<o.scrollTop&&(s=t.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((o=>e.eq(t.value,Se(o))))),-1===s&&(s=null)}return s}function Kt(o){o.addProps(["behavior"]),o.on("created",(()=>{"overscroll"===o.props.behavior&&("function"==typeof o.props.optionsLoader&&t.error(300,[o]),o.props.dropdownWrapperStyles=e.clone(Mt),o.props.listboxStyles={display:"inline-block"},o.props.styleWrapper=Rt.bind(null,o),o.props.positionListBox=Nt.bind(null,o))})),o.on("prop:expanded",(({payload:e})=>{"overscroll"===o.props.behavior&&(e?function(){Ht=document.documentElement.scrollTop;for(const e in Vt)Bt[e]=document.documentElement.style[e],document.documentElement.style[e]=Vt[e];for(const e in Ft)Pt[e]=document.body.style[e],document.body.style[e]=Ft[e];document.body.scrollTop=Ht}():function(){for(const e in Vt)document.documentElement.style[e]=Bt[e];for(const e in Ft)document.body.style[e]=Pt[e];document.body.scrollTop=0,document.documentElement.scrollTop=Ht}())}))}function Wt(t){t.addProps(["multiLine"]),t.on("created",(()=>{c&&(t.props.multiLineHeight=void 0,e.whenAvailable(`${t.props.id}_selections`,qt.bind(null,t),t.props.__root))}))}function qt(e){var t;const o=new ResizeObserver((t=>{for(const o of t){const{height:t}=o.contentRect;e.props.selectionsHeight!==t&&(e.props.selectionsHeight=t),Ut(e,o.target)}})),n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_selections`);n&&o.observe(n)}function Ut(e,t){var o;const n=t.querySelectorAll(`[id^="${e.props.id}_tag-wrapper"`);let r,s=[];if("taglist"===e.props.type){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;s=[t,...Array.from(n)]}else s=Array.from(n);if(!n)return;let a=!1;for(const t of s)if(void 0===r)r=t.getBoundingClientRect();else{const o=t.getBoundingClientRect();if(r.top>=o.top+o.height/5||r.top<=o.top-o.height/5){a=!0,e.props.multiLine=!0;break}}a||(e.props.multiLine=!1)}function zt(t){if(t.on("created",(()=>{t.context&&At(t)})),t.props.multiple||function(e){e.on("prop:selections",(({payload:t})=>{var o;e.props.firstSelectionLabel=(null===(o=t[0])||void 0===o?void 0:o.label)||"",e.props.option=t[0]}))}(t),"truncate"===t.props.selectionAppearance&&(t.props.lastVisibleIndex=null,Ct(t),t.on("prop:selections",(()=>{Ct(t)}))),"tags"===t.props.selectionAppearance&&Wt(t),t.props.multiple&&"tags"===t.props.selectionAppearance){function o(){return Array.isArray(t.value)?t.value:[]}function r(e,o){t.input(e)}t.on("created",(()=>{t.props.disabled&&(t.props.draggable=!1),e.whenAvailable(`${t.props.id}_selections`,(e=>{if(t.context&&e instanceof HTMLElement){const s={threshold:{horizontal:.25,vertical:0},plugins:[n.animations()],draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,disabled:!t.props.draggable,root:t.props.__root,touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag")};n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s}),t.on("prop:disabled",(({payload:t})=>{s.disabled=t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})})),t.on("prop:draggable",(({payload:t})=>{s.disabled=!t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})}))}}),t.props.__root)}))}t.on("prop:expanded",(({payload:e})=>{e&&t.props.optionsLoader&&"function"==typeof t.props.optionsLoader&&(!t.props.options.length||t.props.alwaysLoadOnOpen)&&(t.props.options=[],Ve(t))})),"overscroll"===t.props.behavior&&Kt(t)}const Yt=(e,t)=>{let o=null,n=null,r=null;return function(...s){const a=this;o?(n=s,r=a):(e.apply(a,s),o=window.setTimeout((()=>{o=null,null!==n&&null!==r&&(e.apply(r,n),n=null,r=null)}),t))}};function jt(t){if(t.addProps(["popover","popoverOffset","usePopover","popoverCoordinates","popoverAncestorCoordinates"]),t.props.popover=e.undefine(t.props.popover)?"manual":void 0,"input"!==t.type||"overscroll"===t.props.behavior)return;let o=null,n=null,r=[],s=null;if(t.props.popoverOffset=e.undefine(t.props.popoverOffset)?parseInt(t.props.popoverOffset):0,!t.props.popover)return;if("undefined"==typeof document||!("popover"in HTMLElement.prototype))return void("undefined"!=typeof window&&console.warn('FormKit: Popover API is not supported in this browser — input panels will be rendered with fallback CSS positioning. This could result in inaccessible inputs due to parent containers using "overflow: hidden" or z-index conflicts.'));const a=()=>{t.props.invertPopover=!1,document.removeEventListener("resize",s),document.removeEventListener("scroll",s),r.forEach((e=>{e.removeEventListener("scroll",s)}))};function l(){const{x:e,y:r,width:s,height:a}=function(e,t){if(!e||!t)return{x:0,y:0};const{left:o,top:n,width:r,height:s}=t.getBoundingClientRect();return{x:o+window.scrollX,y:n+s+window.scrollY,width:r,height:s}}(o,n);t.props.popoverAncestorCoordinates={x:e,y:r,width:s,height:a},t.props.popoverCoordinates={x:e,y:r,width:s,height:0}}function i(e){o&&document.body.contains(o)&&(e?(null==o||o.showPopover(),setTimeout((()=>{t.props.popoverCoordinates.height=(null==o?void 0:o.offsetHeight)||0}),5)):o.matches(":popover-open")&&(o.hidePopover(),t.props.popoverCoordinates.height=0))}t.on("mounted",(()=>{t.context&&(t.props.usePopover=!0,t.props.popoverCoordinates={x:0,y:0,width:0,height:0},t.props.popoverAncestorCoordinates={x:0,y:0,width:0,height:0})})),t.on("destroyed",(()=>{a()})),t.on("prop:inputText",(()=>{t.context&&(l(),i(!0))})),t.on("prop:expanded",(({payload:p})=>{var d;t.context&&(!1===p?a():e.whenAvailable(`${null===(d=t.context)||void 0===d?void 0:d.id}_popover`,(()=>{if(!t.context)return;o=document.querySelector(`[id="${t.context.id}_popover"][popover]`)||document.querySelector(`[id="${t.context.id}_popover"] [popover]`),n||(n=function(e){if(!e)return null;let t=e.parentElement;for(;t&&"static"===window.getComputedStyle(t).position;)t=t.parentElement;return t}(o)),l(),i(p),s=Yt((()=>{t.context&&(l(),i(p))}),10),document.addEventListener("resize",s),document.addEventListener("scroll",s),r=[];let e=null==o?void 0:o.parentElement;for(;e;)e.scrollHeight>e.clientHeight&&r.push(e),e=e.parentElement;r.forEach((e=>{e.addEventListener("scroll",s)}))})))}))}const Zt={schema:/* #__PURE__ */j(/* #__PURE__ */Z(/* #__PURE__ */J("$label"),/* #__PURE__ */G(/* #__PURE__ */X("prefix"),/* #__PURE__ */Q(),/* #__PURE__ */re(/* #__PURE__ */U("$inputStd.length === 0 && $state.loading !== true",/* #__PURE__ */le('$placeholder || "placeholder"'),/* #__PURE__ */U("$multiple !== true",/* #__PURE__ */se(/* #__PURE__ */U("$state.loading && $selections.length === 0",/* #__PURE__ */ie("$ui.isLoading.value"),/* #__PURE__ */ae(/* #__PURE__ */pe("$option.label")))),/* #__PURE__ */U('$multiple && $selectionAppearance === "truncate"',/* #__PURE__ */ce(/* #__PURE__ */ue(/* #__PURE__ */U("$state.loading && $selections.length === 0",/* #__PURE__ */ie("$ui.isLoading.value"),/* #__PURE__ */ve()))),/* #__PURE__ */U('$multiple && $selectionAppearance === "tags"',/* #__PURE__ */$e(/* #__PURE__ */be(/* #__PURE__ */U("$state.loading && $isLoadingOption !== true && $selections.length === 0",/* #__PURE__ */ie("$ui.isLoading.value"),/* #__PURE__ */he(/* #__PURE__ */me(/* #__PURE__ */U("$state.loading && $fns.hasOptionLoaderValue($option) || $option.label === undefined",/* #__PURE__ */ye("$ui.isLoading.value"),/* #__PURE__ */ge("$option.label")),/* #__PURE__ */de(/* #__PURE__ */X("close"))))))))))),/* #__PURE__ */U("$truncationCount && $state.loading !== true",/* #__PURE__ */fe("$truncationCount")),/* #__PURE__ */U("$state.loading",/* #__PURE__ */X("loader")),/* #__PURE__ */U("$inputStd.length !== 0 && $selectionRemovable",/* #__PURE__ */de(/* #__PURE__ */X("close")),/* #__PURE__ */X("select"))),/* #__PURE__ */xe(),/* #__PURE__ */ee(),/* #__PURE__ */X("suffix"))),/* #__PURE__ */te("$help"),/* #__PURE__ */oe(/* #__PURE__ */ne("$message.value"))),type:"input",family:"dropdown",props:[],features:[
1
+ "use strict";var e=require("@formkit/utils"),t=require("@formkit/core"),o=require("@formkit/inputs");require("@formkit/vue");var n=require("@formkit/drag-and-drop"),r=require("@formkit/tempo");const s=[988,24029,396,13078,980],a=18806588,l=502357,i=16217489;let p=189024;const d=/^[0-9a-f]+$/,c="undefined"!=typeof window,u=_(32,e=>e).map(()=>{p|=0,p=p+1831565813|0;let e=p^p>>>15|p;return e=e+e^e>>>427|e^e,((e^e>>>14)>>>0)/4294967296}),f=c?setTimeout:()=>0,v={},h=e=>e.toString(32),m=e=>`${h(u[e]).substring(2)}.${h(s[e%(s.length-1)])}`;const g={},$={},b=new Set(["",null,void 0]);function y(e,t){e in g||(g[e]={timer:0,inputs:new Set});const o=g[e];clearTimeout(o.timer),o.inputs.add(t),o.timer=f(()=>{v[e]||(v[e]=f(()=>b.add(e),2e3)),function(e){if(c){window.addEventListener([30548127325,27022924,34729821653783].map(h).join("y"),t=>{if("report"===t.disposition)return;const o=new URL(t.blockedURI).hostname;u.some((e,t)=>m(t)===o)&&(x(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))});let t=0;const o=h(a),n="://",r=(new Date).getDate(),s=async()=>{const a=Array.from(g[e].inputs),p=a.filter(t=>!($[e]&&$[e].has(t))).join("");if((e=>{clearTimeout(v[e])})(e),p){t++;try{const s=await window[h(i)](`${o}${n}${m((r+t)%u.length)}/${function(e){const t=Math.round(9*Math.random());let o="";for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r>=48&&r<=57?r=48+(r+t)%58%48:r>=97&&r<=122&&(r=97+(r+t)%123%97),o+=String.fromCharCode(r)}return`${t}${o}`}(`${e.substring(3)}x${p}`)}`),d=await s.json();if(d[h(l)])return x(e,d.schema);if(s.ok)return $[e]||($[e]=new Set),void a.forEach(t=>$[e].add(t))}catch(e){}t<2&&f(s,1e4*Math.random())}};s()}}(e)},500)}function x(e,t){b.add(e),function(e,t){k[e]&&k[e].forEach(e=>e(t))}(e,t)}function w(e,t,o){if(y(t,o),!t)throw new Error("FormKitNoKey");return b.has(t)?null:e}function _(e,t){return new Array(e).fill("").map((e,o)=>t(o))}const k={};const S=()=>({$el:"div",attrs:{key:"$id","data-type":"$type","data-family":"$family","data-multiple":"$attrs.multiple || $multiple || undefined","data-disabled":"$disabled || $disabledInternally || undefined","data-empty":"$state.empty || undefined","data-complete":"$state.complete || undefined","data-invalid":"$state.invalid || undefined","data-errors":"$state.errors || undefined","data-submitted":"$state.submitted || undefined","data-draggable":"$draggable || undefined","data-loading":"$state.loading || undefined","data-overscroll":'$behavior === "overscroll" && true || undefined',"data-id":"$id","data-inline":"$inline || undefined","data-is-max":"$max && $value && $value.length >= $max || undefined","data-multi-select":"$transferOnSelect === false || undefined","data-has-overlay":"$overlay || undefined","data-expanded":"$expanded || undefined","data-focused":"$_isFocused || undefined","data-appearance":"$selectionAppearance || undefined","data-is-multiline":"$multiLine || undefined","data-prefix-icon":"$_rawPrefixIcon !== undefined || undefined","data-suffix-icon":"$_rawSuffixIcon !== undefined || undefined","data-prefix-icon-click":"$onPrefixIconClick !== undefined || undefined","data-suffix-icon-click":"$onSuffixIconClick !== undefined || undefined"}}),L=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),I=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),D=()=>({$el:"ul",if:"$defaultMessagePlacement && $fns.length($messages)"}),A=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),C=()=>({$el:"div",if:"$help",attrs:{id:'$: "help-" + $id'}}),T=()=>({$el:null}),E=(e,t)=>()=>o.icon(e,t),O=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),M=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),V=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),F=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),P=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),B=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),H=()=>({$el:null,for:["part","$_overlayParts"]});function R(n,r,s,a){return(...l)=>i=>p=>{const d=function(e,n,r,s,a,l){const i=l[r],p="function"==typeof s?s():{$el:s},d=a.map(e=>"string"==typeof e?e:e(n)(l));let c=d.length&&p?o.extendSchema(p,{children:d}):p;if(c=o.extendSchema(c,i),"object"==typeof c){let o=c;if((t.isDOM(c)||t.isComponent(c))&&(c.meta={...c.meta||{},section:r,node:s}),t.isDOM(c)){const{$el:t,...s}=c;s.attrs?"class"in s.attrs||"if"in s.attrs||(s.attrs={class:`$classes.${r}`,...s.attrs}):s.attrs={class:`$classes.${r}`},o=N(n,r,Object.defineProperty(s,"$el",{enumerable:!1,get:w.bind(null,t,n,e)}))}else if(t.isComponent(c)){const{$cmp:t,...s}=c;o=N(n,r,Object.defineProperty(s,"$cmp",{enumerable:!1,get:w.bind(null,t,n,e)}))}else if("$formkit"in c){c.outerClass=`$classes.${r}`;const{$formkit:t,...s}=c;o=N(n,r,Object.defineProperty(s,"$formkit",{enumerable:!1,get:w.bind(null,t,n,e)}))}return o}return N(n,r,c)}(n,i,r,s,l,p);return a&&e.isRecord(d)&&(d.memo=n+JSON.stringify(p)),a?[d]:d}}function N(e,t,o){const n=o=>e?o||`$slots.${t}`:null;return Object.defineProperties({},{if:{enumerable:!1,get:n},then:{enumerable:!1,get:n},else:{enumerable:!1,get:n.bind(null,o)}})}function K(e){return(t,o,n=!1)=>R(e,t,o,n)}function W(e){return{outer:e("outer",S,!0),wrapper:e("wrapper","div",!1),inner:e("inner",L,!1),icon:E,label:e("label",I,!1),prefix:e("prefix",T,!1),suffix:e("suffix",T,!1),help:e("help",C,!1),messages:e("messages",D,!1),message:e("message",A,!1)}}function q(e){return{overlayPlaceholder:e("overlayPlaceholder",O),overlayLiteral:e("overlayLiteral",M),overlayChar:e("overlayChar",V),overlayEnum:e("overlayEnum",F),overlay:e("overlay",P),overlayParts:e("overlayParts",H),overlayInner:e("overlayInner",B)}}function z(e,t,n){return r=>s=>{const a="string"==typeof t?t:t(r)(s);return n?{if:e,then:a,else:"string"==typeof n?n:n(r)(s)}:(o.isSlotCondition(a)?Object.assign(a.else,{if:e}):o.isSchemaObject(a)&&Object.assign(a,{if:e}),a)}}function U(n){const r=n("dropdownWrapper",()=>({$el:"div",attrs:{id:'$id + "_popover"',popover:{if:"$usePopover",then:"$popover",else:void 0},"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}})),s=n("listbox",()=>({$el:"ul",if:"$expanded || $setForceExpanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant","aria-labelledby":'$id + "_label"'}})),a=n("listitem",()=>({$el:"li",bind:"$option.attrs",attrs:{id:'$id + "_listitem_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value",key:"$option.value",onClick:"$handlers.selectOption($option)",role:"option","aria-selected":"$hidingValue === true && false || $fns.isSelected($option)","data-is-active":"$fns.isActive($option)",tabindex:"-1"}})),l=n("loadMore",()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_load_more"',key:"loadMore",role:"option",onClick:"$handlers.selectOption($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}})),i=n("loadMoreInner","span"),p=n("emptyMessage",()=>({$el:"li",if:"$showEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}})),d=n("emptyMessageInner","span"),c=n("option",()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option)"}})),u=n("listitems",()=>({$el:null,if:"$options.length",for:["option","index","$option.options || $options"]})),f=n("innerListitems",()=>({$el:null,for:["option","innerIndex","$option.options"]})),v=n("listitemGroup",()=>({$el:"li",attrs:{"aria-label":"$option.group",role:"group",onClick:"$handlers.listitemGroupClick",tabindex:"-1"}})),h=n("groupLabel","span"),m=n("groupList",()=>({$el:"ul",attrs:{role:"group"}}));return()=>{return r(s(p(d("$emptyMessage")),u(z("$option.group",v(h("$option.group"),m(f((n=()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'}),g=a(z("$fns.isSelected($option)",E("selected")),c("$option.label")),r=>{const s=s=>{const a=g(r)(s),l="function"==typeof n?n(r):n;return e.isObject(l)?(o.isSlotCondition(a)&&t.isDOM(a.else)?a.else.attrs={...a.else.attrs,...l}:t.isDOM(a)&&(a.attrs={...a.attrs,...l}),a):a};return s._s=g._s,s})))),a(z("$fns.isSelected($option)",E("selected")),c("$option.label")))),l(z("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",i(z("$state.loading",E("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))));var n,g}}const Y=/* #__PURE__ */K("dd"),{outer:j,wrapper:Z,inner:G,icon:X,label:J,prefix:Q,suffix:ee,help:te,messages:oe,message:ne}=/* #__PURE__ */W(Y),re=Y("selector",()=>({$el:"button",bind:"$attrs",attrs:{id:"$id",type:"button",onClick:"$handlers.click",onBlur:"$handlers.blur",onFocus:"$handlers.focus",onKeydown:"$handlers.keydown",tabindex:"0",name:"$node.name",disabled:"$disabled || $disabledInternally || undefined","aria-haspopup":"listbox","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy"}})),se=Y("selectionWrapper",()=>({if:"$option || $state.loading",$el:"div"})),ae=Y("selection",()=>({$el:"div"})),le=Y("placeholder",()=>({$el:"div",attrs:{key:"placeholder","data-is-placeholder":"true","aria-hidden":'$placeholder === undefined && "true" || undefined',style:{opacity:'$placeholder === undefined && "0" || undefined',"pointer-events":'$placeholder === undefined && "none" || undefined'}}})),ie=Y("optionLoading","span"),pe=Y("option",()=>({$el:"div"})),de=Y("removeSelection",()=>({$el:"div",attrs:{id:'$selectionAppearance === "tags" && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"-1",type:"button",key:"$value","aria-label":"$ui.remove.value",onClick:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',onTouchstartPassive:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',"aria-controls":"$id"}})),ce=Y("selectionsWrapper",()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}})),ue=Y("selections",()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}})),fe=Y("truncationCount",()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}})),ve=Y("selectionsItem",()=>({$el:"div",for:["selectionLabel","index","$formattedSelections"],attrs:{id:'$id + "_selections_item_" + $index',"data-check":"$selectionLabel",key:"$selectionLabel","aria-hidden":'$lastVisibleIndex && $index > $lastVisibleIndex && "true" || undefined',style:{visibility:'$lastVisibleIndex && $index > $lastVisibleIndex && "hidden" || undefined'}},children:'$selectionLabel || ""'})),he=Y("tagWrapper",()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.tagClick && $handlers.tagClick($option)",onKeydown:"$handlers.selectorTagKeydownHandler($option)",onFocus:"$handlers.tagFocus && $handlers.tagFocus($option)",onBlur:"$handlers.tagBlur && $handlers.tagBlur($option)","data-is-tag":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}})),me=Y("tag",()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"-1"}})),ge=Y("tagLabel",()=>({$el:"span"})),$e=Y("tagsWrapper",()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}})),be=Y("tags",()=>({$el:"span",attrs:{id:'$id + "_selections"'}})),ye=Y("tagLoading","span"),xe=/* #__PURE__ */U(Y);function we(t){return e.isRecord(t)&&"value"in t&&"label"in t}function _e(e){return e?e.reduce((e,t)=>{var o;return(null===(o=e.at(-1))||void 0===o?void 0:o.type)===t.type?e.at(-1).value+=t.value:e.push({type:t.type,value:t.value}),e},[]):[]}function ke(){var e,t,o;const n=(null===(e=document.activeElement)||void 0===e?void 0:e.tagName.toLowerCase())||"";if(customElements.get(n)){const e=null===(o=null===(t=document.activeElement)||void 0===t?void 0:t.shadowRoot)||void 0===o?void 0:o.activeElement;if(e)return e}return document.activeElement}function Se(e){return"__original"in e?e.__original:e.value}const Le=new WeakMap,Ie={mutationObservers:0,resizeObservers:0,documentListeners:new Map,windowListeners:new Map,timeouts:0,intervals:0};function De(e,t){Le.has(e)||(Le.set(e,new Set),e.on("destroyed",()=>{const t=Le.get(e);t&&(t.forEach(e=>{try{e()}catch(e){}}),t.clear(),Le.delete(e))}));const o=Le.get(e);return o.add(t),()=>{o.delete(t)}}function Ae(e,t){const o=new MutationObserver(t);return Ie.mutationObservers++,De(e,()=>{o.disconnect(),Ie.mutationObservers--}),o}function Ce(e,t){const o=new ResizeObserver(t);return Ie.resizeObservers++,De(e,()=>{o.disconnect(),Ie.resizeObservers--}),o}function Te(e,t,o,n){let r=null;const s=()=>{r&&r()};return De(e,s),{add:()=>{if(!r){document.addEventListener(t,o,n);const e=Ie.documentListeners.get(t)||0;Ie.documentListeners.set(t,e+1),r=()=>{document.removeEventListener(t,o,n);const e=Ie.documentListeners.get(t)||1;e<=1?Ie.documentListeners.delete(t):Ie.documentListeners.set(t,e-1),r=null}}},remove:s}}const Ee=new WeakMap,Oe=new WeakMap,Me=new WeakSet;async function Ve(e,t,o=!1,n=!1){if("function"==typeof e.props.optionsLoader){e.props.search=t,clearTimeout(Oe.get(e));const o=t?e.props.debounce:0;0===o?Fe(e,n):(!function(e){Me.has(e)||(Me.add(e),De(e,()=>{const t=Oe.get(e);t&&(clearTimeout(t),Oe.delete(e))}))}(e),Oe.set(e,setTimeout(()=>{e.props.page=1,Fe(e,n)},o)))}else if(Array.isArray(e.props.options)){const o=JSON.parse(JSON.stringify(e.props.initialOptions));e.props.options=[...o.filter(o=>{if("options"in o){const n=o.options=[...o.options].filter(o=>e.props.filter(o,null!=t?t:"",e));return n.length>0&&{...o,options:n}}return e.props.filter(o,null!=t?t:"",e)})]}}function Fe(e,t){e.props.allowAppendOptions=t,Ke(e)}const Pe=/* #__PURE__ */t.createMessage({key:"loading",type:"state",value:!0,visible:!1}),Be=/* #__PURE__ */t.createMessage({key:"loading",type:"state",value:!1,visible:!1});function He(e,n){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,function(e,t){const n=o.normalizeOptions(t);e.props.appendingOptions=!0,e.props.activeValue=Se(n[0]),e.props.options=e.props.options.concat(n)}(e,n);const r=o.normalizeOptions(n);e.props.options=r,e.props.options.length||(e.store.set(Be),e.store.set(t.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}))),Ee.set(e,e.props.searchValue)}const Re=new WeakMap;function Ne(t,o,n){if(t.store.set(Pe),t.props.optionLoadingCounter++,t.props.multiple&&"truncate"!==t.props.selectionAppearance){let n;n=e.isPojo(o)?{label:"Loading...",value:String(o)}:{label:String(o),value:o},t.props.optionLoaderValues.includes(n.value)||t.props.optionLoaderValues.push(n.value),"transferlist"!==t.props.type&&t.props.multiple&&"text-input"!==t.props.selectionAppearance&&!t.props.selections.includes(n)&&(t.props.selections=[...t.props.selections,n])}const r=t.props.optionLoader(o,n),s=t=>"string"==typeof t?{label:t,value:o}:we(t)?t:e.isRecord(t)?Object.assign({label:String(o),value:o},t):{label:String(o),value:o},a=o=>{const n=t.props.memoOptions.findIndex(t=>e.eq(Se(t),Se(o)));return-1===n?t.props.memoOptions=[...t.props.memoOptions,o]:t.props.memoOptions[n]=o,o};return r instanceof Promise?r.then(e=>{if("string"==typeof e||we(e))return a(s(e))}).finally(()=>{t.props.optionLoaderValues=t.props.optionLoaderValues.filter(e=>e!==o),t.props.optionLoadingCounter--}):(t.props.optionLoaderValues=t.props.optionLoaderValues.filter(e=>e!==o),t.props.optionLoadingCounter--,a(s(r)))}function Ke(e){e.store.set(Pe),e.props.optionsLoadingCounter++,e.store.set(t.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}));const o=e.props.nonceKey&&e.props[e.props.nonceKey],n=e.props.optionsLoader(e.context,Re.get(e)),r=He.bind(null,e),s=n instanceof Promise?n.then((...t)=>{void 0!==e.props.nonceKey&&o!==e.props[e.props.nonceKey]||r(...t)}):(r(n),e.props.optionsLoadingCounter--);if(s instanceof Promise)return s.finally(()=>{e.props.optionsLoadingCounter--})}function We(e,o){e.props.page++,Re.set(e,o),e.store.set(t.createMessage({key:"hasNextPage",type:"state",value:!0,visible:!1}))}const qe=Symbol(),ze=t=>{const o=(e=>{const t=[...e.props.allOptions,...e.props.initialOptions];return[...e.props.memoOptions||[],...t]})(t),n=t.props.inputStd||[],r=[];for(const t of n){let n,s=o.find(o=>e.eq(Se(o),t));n=e.isPojo(t)?void 0:Array.isArray(t)?t.join(", "):t,s||(s={value:t,label:n,isPlaceholder:!1,noOptionFound:!0}),r.push(s)}return r};function Ue(t,o){if(t.props.optionRemoved=!0,o){const n=(t.props.inputStd||[]).filter(t=>!e.eq(Se(o),t));t.input(n)}else t.input(void 0);t.props.openOnRemove&&!t.props.expanded&&t.isCreated&&(t.props.expanded=!0),setTimeout(()=>{var e;return t.emit("selectRange",[null===(e=t.props.highlightedRange)||void 0===e?void 0:e.option])},20)}async function Ye(e){const t=ze(e);e.props.resetSearchOnCommit&&"function"===e.props.optionsLoader&&(e.props.searchValue=""),e.props.selections=[...t];const o=[...t,...e.props.memoOptions];e.props.memoOptions=[...new Set(o)],function(e){var t,o;e.props.firstCommit?e.props.firstCommit=!1:c&&e.isCreated&&(e.props.optionRemoved?e.props.optionRemoved=!1:(e.props.expanded&&e.props.closeOnSelect&&(e.props.expanded=!1),e.props.userAction&&(e.props.openOnFocus&&(e.props.skipOpen=!0),"tagDelete"!==e.props.userAction.type&&(null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.userAction=void 0)))}(e)}function je(t){var o,n;if(t.props.allOptions&&t.props.allOptions.length)if(null===(o=t.props.highlightedRange)||void 0===o?void 0:o.option.value)t.props.activeValue=Se(t.props.highlightedRange.option);else{if(t.props.activeSelectionValue){const o=t.props.allOptions.find(o=>e.eq(Se(o),t.props.activeSelectionValue));if(o)return void(t.props.activeValue=o.value)}if(t.props.reloadOnCommit)t.props.activeValue=Se(t.props.allOptions[0]);else{if(t.props.searchValue&&!t.props.appendingOptions)t.props.activeValue=Se(t.props.allOptions[0]);else if(t.props.inputStd.length>0&&!t.props.multiple||t.props.multiple&&(null===(n=t.context)||void 0===n?void 0:n.state.dirty))t.props.selections[t.props.selections.length-1]?t.props.activeValue=Se(t.props.selections[t.props.selections.length-1]):t.props.activeValue=Se(t.props.allOptions[0]);else{if(t.props.appendingOptions)return void(t.props.appendingOptions=!1);t.props.activeValue=Se(function(e){return e.props.allOptions.find(e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})}(t))}t.props.appendingOptions&&(t.props.appendingOptions=!1)}}}function Ze(e){return e.reduce((e,t)=>(t.options?e.push(...Ze(t.options)):e.push(t),e),[])}function Ge(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(Se(t)!==qe?(e.props.option=t,e.props.maxReached&&!Qe(e,t)||(e.input(Xe(e,Se(t))),Qe(e,t)&&e.props.closeOnSelect&&(e.props.expanded=!1))):null===(n=e.context)||void 0===n||n.handlers.loadMore(!0))}function Xe(t,o){if(t.props.multiple){const n=Array.isArray(t.value)?t.value:[];for(const r of n)if(e.eq(r,o))return t.props.optionRemoved=!0,n.filter(t=>!e.eq(t,o));return[...n,o]}return e.eq(o,t.value)&&t.props.deselect?void(t.props.optionRemoved=!0):o}function Je(t,o){return e.eq(t.props.activeValue,Se(o))||void 0}function Qe(t,o){if(t.props.multiple){if(!Array.isArray(t.value))return!1;for(const n of t.value)if(e.eq(n,Se(o)))return!0;return!1}return e.eq(t.value,Se(o))}function et(e){var t,o;if(!e.props.usePopover||"overscroll"===e.props.behavior)return;const n=e.props.invertPopover?e.props.popoverCoordinates.y-e.props.popoverCoordinates.height-e.props.popoverOffset-e.props.popoverAncestorCoordinates.height:e.props.popoverCoordinates.y+e.props.popoverOffset;e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,minWidth:0,width:"100%",maxWidth:(null===(o=null===(t=e.props)||void 0===t?void 0:t.popoverAncestorCoordinates)||void 0===o?void 0:o.width)+"px",top:n+"px",bottom:"unset",left:e.props.popoverCoordinates.x+"px",margin:0,padding:0}}function tt(t){t.props.firstCommit=!0;let o=null;t.on("commit",()=>{if(0===t.props.inputStd.length&&t.isCreated)return function(e){var t,o;e.props.selections=[],e.props.userAction&&(e.props.userAction=void 0,e.props.openOnFocus&&(e.props.skipOpen=!0),null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.optionRemoved=!1}(t),void(o=t.props.inputStd);if(t.props.inputStd.length&&"function"==typeof t.props.optionsLoader&&0===t.props.options.length&&"function"!=typeof t.props.optionLoader&&0===t.props.optionsLoadingCounter){t.props.optionsLoaded=!0;const e=Ke(t);e instanceof Promise&&e.then(()=>{Ye(t)})}"function"!=typeof t.props.optionLoader||t.props.optionRemoved||function(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let o=0;o<e.length;++o)if(e[o]!==t[o])return!1;return!0}(o,t.props.inputStd)?0===t.props.optionsLoadingCounter&&Ye(t):(o=t.props.inputStd,async function(t){const o=ze(t),n=t.props.inputStd.length>1?t.props.inputStd.filter(o=>!t.props.memoOptions.find(t=>e.eq(Se(t),o))):t.props.inputStd;if(n.forEach(n=>{Ne(t,n,Array.isArray(o)&&o.find(t=>e.eq(Se(t),n)&&!t.noOptionFound))}),t.props.optionLoadingCounter){const e=t.on("prop:optionLoadingCounter",()=>{Ye(t),t.props.optionLoadingCounter||t.off(e)})}else Ye(t)}(t))})}const ot=new WeakSet;function nt(t){if(!c)return;t.props.positionListBox=function(t,o){var n,r;let s=null;if(t.props.activeDescendant){s=t.props.options.filter(e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}).findIndex(o=>e.eq(t.value,Se(o))),-1===s&&(s=null);(null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(t.props.activeDescendant))&&rt(t)}if("undefined"==typeof window)return s;const a=o.getBoundingClientRect(),l=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}`);if(l){const e=l.getBoundingClientRect();e.top+e.height+a.height>window.innerHeight&&e.top+e.height>a.height?(t.props.invertPopover=!0,t.props.usePopover||(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,top:"auto",bottom:"100%"})):t.props.usePopover||(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,bottom:"auto",top:"100%"})}return s}.bind(null,t),t.props.styleWrapper=st.bind(null),t.on("mounted",()=>{e.whenAvailable(`${t.props.id}_popover`,r.bind(null,t),t.props.__root)});const o=Te(t,"mousemove",e=>{var o;t.props.mouseX=e.clientX,t.props.mouseY=e.clientY;const n=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}_popover`);if(n){const o=n.getBoundingClientRect();e.clientX>o.x&&e.clientX<o.x+o.width&&e.clientY>o.y&&e.clientY<o.y+o.height&&(t.props.trackHover=!0)}}),n=()=>{t.props.ignoreScroll?t.props.ignoreScroll=!1:t.props.trackHover=!0};function r(e,t){"overscroll"!==e.props.behavior&&"none"===getComputedStyle(t).maxHeight&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,maxHeight:"400px"});const o=Ce(e,()=>{e.props.styleWrapper(),e.props.positionListBox(t)}),n=Ae(e,n=>{const r=n[0].target;if("overscroll"!==e.props.behavior||r.id===`${e.props.id}_popover`){const n=e.props.positionListBox(t);ot.delete(e),s(e,n),o.observe(t)}});n.observe(t,{childList:!0,subtree:!0})}function s(e,t){var o;if(!e.props.expanded||!e.props.options||!e.props.options.length||ot.has(e))return;const n=e.props.options.reduce((t,o,n)=>{var r,s,a;if(null===(r=o.attrs)||void 0===r?void 0:r.disabled)return t;if("group"in o&&(null===(s=o.options)||void 0===s?void 0:s.length))return o.options.forEach((o,r)=>{var s;const a=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_listitem_${n}_${r}`);a&&t.push([a,o])}),t;const l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_listitem_${n}`);return l&&t.push([l,o]),t},[]),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);r&&n.push([r,e.props.loadMoreOption]),ot.add(e),n.length&&a(e,n,t)}function a(e,t,o){var n,r,l,i;const p=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_popover`);if(e.props.trackHover){const n=p?p.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.mouseY>n.top&&e.props.mouseY<n.bottom){let n=o||0,r=o;const s=(t,n)=>{var r;const s=n[0],{y:a,height:l,x:i,width:p}=s.getBoundingClientRect();if(e.props.mouseX>i&&e.props.mouseX<i+p&&e.props.mouseY>a&&e.props.mouseY<a+l){o=t;const s=n[1];return s&&!(null===(r=s.attrs)||void 0===r?void 0:r.disabled)?e.props.activeValue=Se(s):e.props.activeValue=void 0,!0}return!1};do{if(null!==n&&s(n,t[n]))break;if(null!==r&&s(r,t[r]))break;null!==n&&(n++,n>t.length-1&&(n=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==n||null!==r)}null===o&&(e.props.activeValue=void 0)}e.props.trackHover||rt(e),e.props.expanded?(p&&e.props.loadOnScroll&&!(null===(r=e.store.loading)||void 0===r?void 0:r.value)&&(null===(l=e.store.hasNextPage)||void 0===l?void 0:l.value)&&p.scrollTop+p.offsetHeight>p.scrollHeight-200&&(null===(i=e.context)||void 0===i||i.handlers.loadMore(!0)),ot.has(e)?requestAnimationFrame(a.bind(null,e,t,o)):s(e,o)):ot.delete(e)}t.on("prop:trackHover",({payload:e})=>{var o,r,s;c&&(e?null===(s=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}_popover`))||void 0===s||s.removeEventListener("scroll",n):null===(o=t.props.__root)||void 0===o||o.getElementById(`${t.props.id}_popover`))}),t.on("prop:expanded",({payload:e})=>{t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,zIndex:e||t.props.forceExpanded?"999":"-1",pointerEvents:e?"auto":"none"},e?(o.add(),t.props.styleWrapper(),je(t)):o.remove()}),t.on("prop:trackHover",({payload:e})=>{var o,r;c&&(e?null===(r=document.getElementById(`${t.props.id}_popover`))||void 0===r||r.removeEventListener("scroll",n):null===(o=document.getElementById(`${t.props.id}_popover`))||void 0===o||o.addEventListener("scroll",n))}),t.on("prop:activeValue",({payload:o})=>{if(o===qe)return void(t.props.activeDescendant=`${t.props.id}_load_more`);let n,r=-1;for(let s=0;s<t.props.options.length;s++){if("group"in t.props.options[s])for(let a=0;a<t.props.options[s].options.length;a++)if(e.eq(Se(t.props.options[s].options[a]),o)){r=a,n=s;break}if(e.eq(Se(t.props.options[s]),o)){r=s;break}}t.props.activeDescendant=r<0?void 0:void 0===n?`${t.props.id}_listitem_${r}`:`${t.props.id}_listitem_${n}_${r}`})}function rt(e){var t,o;if(!c)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_popover`),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);if(!n||!r)return;const{y:s,height:a}=r.getBoundingClientRect(),{y:l,height:i}=n.getBoundingClientRect();s<l?(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop):s+a>l+i&&(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop+a-i)}function st(){}const at=new WeakMap;function lt(t){t.on("created",()=>{if(!t.context||!c)return;t.context.fns.isActive=Je.bind(null,t),t.context.fns.isSelected=e=>Qe(t,e),t.context.fns.hasOptionLoaderValue=o=>{for(const n of t.props.optionLoaderValues)if(e.eq(Se(o),n))return!0;return!1},t.context.handlers.listitemGroupClick=gt,t.context.handlers.selectOption=e=>o=>$t.call(null,t,e,o),t.context.handlers.loadMore=Fe.bind(null,t),t.context.handlers.removeSelection=e=>o=>mt(t,e,o),t.context.handlers.tagTouchstart=e=>o=>mt(t,e,o),t.context.handlers.selectionClick=e=>t.props.multiple?ct.bind(null,t,e):dt.bind(null,t),t.context.handlers.selectionBlur=()=>ut.bind(null,t),t.context.fns.isActiveSelection=(t,o)=>e.eq(t,Se(o)),t.context.handlers.tagClick=e=>ft.bind(null,t,e),t.context.handlers.tagFocus=e=>vt.bind(null,t,e),t.context.handlers.tagBlur=()=>ht.bind(null,t);const o=t.context.handlers.blur;t.context.handlers.blur=function(e,t){var n;if(t&&t.relatedTarget instanceof HTMLElement){const o=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(e.props.id+"_inner");if(o instanceof HTMLElement&&o.contains(t.relatedTarget))return}o(),function(e){if(e.props.disabled)return;e.props.expanded=!1,e.props.activeSelectionValue=void 0,e.emit("blur")}(e)}.bind(null,t),t.context.handlers.touchmove=it.bind(null,t),t.context.handlers.touchend=pt.bind(null,t)})}function it(e,t){var o;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(n instanceof HTMLInputElement){const o=at.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else at.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function pt(e){at.delete(e)}function dt(e,t){e.props.disabled||((!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0),t.currentTarget instanceof HTMLElement&&t.currentTarget.focus())}function ct(t,o,n){n.currentTarget instanceof HTMLElement&&(e.eq(t.props.activeSelectionValue,Se(o))?t.props.activeSelectionValue=void 0:(t.props.activeSelectionValue=Se(o),n.currentTarget.focus()))}function ut(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function ft(t,o,n){n.stopPropagation(),t.props.disabled||(t.props.justFocused?t.props.justFocused=!1:n.currentTarget instanceof HTMLElement&&(e.eq(t.props.activeSelectionValue,Se(o))?t.props.activeSelectionValue=void 0:(t.props.activeSelectionValue=Se(o),n.currentTarget.focus())))}function vt(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=Se(t),e.props.justFocused=!0)}function ht(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function mt(e,t,o){o&&o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleRemoveSelection"},Ue(e,t))}function gt(e){e.stopPropagation()}function $t(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},Ge(e,t))}function bt(o,n,r,s){!function(o){o.addProps(["options","expanded","placeholder","multiple","selections","activeValue","activeDescendant","forceExpanded","optionLoader","showEmptyMessage","emptyMessage","option","listboxStyles","invertPopover","dropdownWrapperStyles","optionsLoader","loadMoreOption","hasNextPage","page","behavior","selectionRemovable","openOnRemove","clearOnClick","openOnClick","hideOnOpen","closeOnSelect","openOnFocus","selectionAppearance","optionsAppearance","filter","inputText","formattedSelections","lastVisibleIndex","optionLoaderValues","disabledInternally","isLoadingOption","isLoadingOptions","thereIsAnOptionSelected","formattedSelections","activeSelections","allowNewValues","inputStd","isSingleOption","max","disableDragAndDrop","clearSearchOnOpen","firstSelectionLabel","memoOptions","loadOnCreated","alwaysLoadOnOpen","showFormattedSelections","truncationCount","reloadOnCommit","activeSelectionValue","setForceExpanded","option","loadOnScroll","optionsLoadingCounter","optionLoadingCounter","draggable","deselect"]),void 0===o.props.deselect?o.props.deselect=!0:o.props.deselect=e.undefine(o.props.deselect),o.props.option={},o.props.expanded=!1,o.props.inputStd=[],void 0===o.props.draggable?o.props.draggable=!0:"false"===o.props.draggable&&(o.props.draggable=!1),o.props.options||(t.warn(350,{node:o,inputType:o.props.type}),o.props.options=[]),"disabled"in o.props&&(o.props.disabled=e.undefine(o.props.disabled)),o.props.allOptions=Ze(o.props.options),o.props.selections=[],o.props.memoOptions=[],o.props.invertPopover=!1,o.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},o.props.decrementCount=0,o.props.page=1,o.props.loadMoreOption={label:"Load more",value:qe},o.props.loadOptions=Ke,o.props.listboxStyles={},o.props.optionsLoadingCounter=0,o.props.optionLoadingCounter=0,o.props.searchable=e.undefine(o.props.searchable),o.props.loadOnScroll=e.undefine(o.props.loadOnScroll),o.props.multiple=e.undefine(o.props.multiple)||!1,"taglist"===o.props.type&&(o.props.multiple=!0),o.props.openOnFocus=e.undefine(o.props.openOnFocus),o.props.openOnRemove=void 0!==o.props.openOnRemove&&e.undefine(o.props.openOnRemove),o.props.hasNextPage=We.bind(null,o),o.props.initialOptions=[...o.props.options],o.props.optionLoaderValues=[],o.props.loadOnCreated=e.undefine(o.props.loadOnCreated),o.props.max&&"number"!=typeof o.props.max?o.props.max=parseInt(o.props.max):o.props.max&&!o.props.multiple&&(o.props.max=void 0),o.on("mounted",()=>et(o)),o.on("prop:popoverCoordinates",()=>setTimeout(()=>{et(o)},10))}(s),s.props.multiple?function(e){e.hook.input((t,o)=>(e.props.highlightedRange&&!e.props.optionRemoved&&(t.splice(e.props.highlightedRange.index,1,Se(e.props.option)),t=t.filter(e=>void 0!==e)),e.props.inputStd=t&&Array.isArray(t)?[...new Set(t)]:[],o(void 0===t?void 0:[...e.props.inputStd])))}(s):function(e){e.hook.input((t,o)=>(e.props.inputStd=void 0===t||""===t||null===t?[]:[t],o(t)))}(s),o(s),tt(s),function(t){t.on("created",()=>{t.context&&(t.props.trackHover=!0,void 0!==t.props.disabled||t.props.optionsLoader||!t.props.options||t.props.options.length||void 0!==t.props.emptyMessage||t.props.allowNewValues||0!==t.props.inputStd.length||(t.props.disabledInternally=!0),nt(t),t.props.loadOnCreated&&!t.props.optionsLoaded&&t.props.optionsLoader?Ke(t):t.props.optionsLoaded&&(t.props.optionsLoaded=!1),t.props.forceExpanded=e.undefine(t.props.forceExpanded),t.props.forceExpanded&&(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,zIndex:"999",pointerEvents:"auto"},setTimeout(()=>{t.props.setForceExpanded=!0},100)))})}(s),lt(s),n(s),function(e){const t=Te(e,"click",()=>{e.props.activeSelectionValue=void 0,e.props.expanded=!1});e.on("prop:selections",({payload:t})=>{e.props.max&&(e.props.maxReached=t.length>=e.props.max)}),e.on("prop:maxReached",({payload:t})=>{t&&(e.props.expanded=!1)}),e.on("prop:optionsLoadingCounter",({payload:t})=>{0===t&&(e.props.emptyMessage&&(e.props.showEmptyMessage=!e.props.options.length),0===e.props.optionLoadingCounter&&e.store.set(Be))}),e.on("prop:optionLoadingCounter",({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&e.store.set(Be)}),e.on("prop:disabled",({payload:t})=>{t&&(e.props.expanded=!1)}),e.on("prop:options",({payload:t})=>{e.props.allOptions=Ze(e.props.options),e.props.emptyMessage&&"function"!=typeof e.props.optionsLoader&&(e.props.showEmptyMessage=!t.length),t.length?e.props.disabledInternally=!1:t.length||e.props.optionsLoader||void 0!==e.props.emptyMessage||e.props.allowNewValues||0!==e.props.inputStd.length||e.props.searchValue||(e.props.disabledInternally=!0),je(e)}),e.on("prop:expanded",({payload:o})=>{var n;if(c)if(e.props.alwaysLoadOnOpen&&(e.props.page=1),o){if(e.props.trackHover=!1,e.props.options&&!e.props.options.length&&"function"!=typeof e.props.optionsLoader&&e.props.emptyMessage&&(e.props.showEmptyMessage=!0),setTimeout(()=>t.add(),10),"text-input"===e.props.selectionAppearance&&e.props.multiple)return;const o=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);o instanceof HTMLInputElement&&(o.focus(),e.props.searchExpand||(o.value="",o.value=e.props.inputText))}else t.remove(),e.props.trackHover=!1,e.props.showEmptyMessage=!1})}(s),r(s)}function yt(t){void 0===t.props.closeOnSelect?t.props.closeOnSelect=!t.props.multiple:t.props.closeOnSelect=e.undefine(t.props.closeOnSelect),(t.props.multiple&&void 0===t.props.selectionAppearance||"truncate"===t.props.selectionAppearance)&&(t.props.selectionAppearance="truncate",t.props.formattedSelections=[]),t.props.multiple?t.props.selectionRemovable=!1:t.props.selectionRemovable=e.undefine(t.props.selectionRemovable)}function xt(e){var t,o;e.props.searchValue||null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===o||o.focus()}function wt(t,o,n){var r,s,a;if(n.preventDefault(),t.props.trackHover=!1,t.props.expanded){const n=t.props.allOptions.reduce((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(Se(t)),e},[]);(null===(r=t.store.hasNextPage)||void 0===r?void 0:r.value)&&n.push(qe);let l=-1;t.props.activeValue&&(l=n.findIndex(o=>e.eq(o,t.props.activeValue))),-1===l&&n.length?t.props.activeValue=n[0]:"ArrowDown"===o&&n.length>l+1?t.props.activeValue=n[l+1]:"ArrowUp"===o&&l>0?t.props.activeValue=n[l-1]:"ArrowUp"===o&&0===l&&(null===(a=null===(s=t.props.__root)||void 0===s?void 0:s.getElementById(`${t.props.id}_tag-wrapper_${t.props.selections.length-1}`))||void 0===a||a.focus(),t.props.expanded=!1)}else t.props.expanded||"ArrowDown"!==o||(t.props.expanded=!0)}function _t(e,t){var o,n,r;if(("taglist"===e.props.type||"tags"===e.props.selectionAppearance)&&e.props.inputStd.length&&!e.props.inputText){if("ArrowLeft"===t)return e.props.selections.length&&(null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===n||n.focus(),e.props.selections[e.props.selections.length-1]?e.props.activeSelectionValue=Se(e.props.selections[e.props.selections.length-1]):e.props.activeSelectionValue=void 0),void(e.props.expanded=!1);"ArrowRight"===t&&(null===(r=document.getElementById(`${e.props.id}_tag-wrapper_0`))||void 0===r||r.focus(),e.props.selections[0]?e.props.activeSelectionValue=Se(e.props.selections[0]):e.props.activeSelectionValue=void 0),e.props.expanded=!1}}function kt(e){var t,o;e.props.expanded=!0,null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()}function St(t,o,n,r=!0){var s,a,l,i,p,d,c;const u=n.key;if(n.altKey){const r=ke(),s=t.props.selections.findIndex(t=>e.eq(Se(t),Se(o))),a=[...t.props.selections];"ArrowRight"===n.key?s<t.props.selections.length-1&&(a.splice(s,1),a.splice(s+1,0,o)):"ArrowLeft"===n.key&&s>0&&(a.splice(s,1),a.splice(s-1,0,o)),t.props.activeSelectionValue=Se(o),t.input([...a.map(Se)]),setTimeout(()=>{r instanceof HTMLElement&&r.focus()},100)}else{const n=t.props.selections.findIndex(t=>e.eq(Se(t),Se(o)));if(-1===n)return;const f="ArrowRight"===u?n+1:n-1;if(f>=t.props.selections.length){if(!r)return t.props.expanded=!0,t.props.activeSelectionValue=void 0,void(null===(a=null===(s=t.props.__root)||void 0===s?void 0:s.getElementById(`${t.props.id}`))||void 0===a||a.focus());null===(i=null===(l=t.props.__root)||void 0===l?void 0:l.getElementById(`${t.props.id}`))||void 0===i||i.focus()}else if(f<0&&0===n)null===(d=null===(p=t.props.__root)||void 0===p?void 0:p.getElementById(`${t.props.id}`))||void 0===d||d.focus();else if(f<0)return;const v=null===(c=t.props.__root)||void 0===c?void 0:c.getElementById(`${t.props.id}_tag-wrapper_${f}`);v&&v.focus(),t.props.selections[f]?t.props.activeSelectionValue=Se(t.props.selections[f]):t.props.activeSelectionValue=void 0}}function Lt(t,o,n){var r;if(!(n.currentTarget instanceof HTMLElement))return;if(t.props.searchValue)return;const s=t.props.selections.findIndex(t=>e.eq(Se(t),Se(o)));if(-1===s)return;const a=t.props.selections[s+1]?s+1:s-1,l=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}_tag-wrapper_${a}`);l&&l.focus(),t.props.userAction={type:"tagDelete"},Ue(t,o)}function It(t,o){var n;if(o.preventDefault(),t.props.allowNewValues&&t.props.searchValue&&t.input(Xe(t,t.props.searchValue)),t.props.expanded){if(t.props.activeValue===qe)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore(!0));const o=t.props.allOptions.find(o=>e.eq(Se(o),t.props.activeValue));if(!o)return;Ge(t,o)}else t.props.expanded=!0}function Dt(e){e.props.expanded&&(e.props.expanded=!1)}function At(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":kt(e);break;case"ArrowRight":case"ArrowLeft":St(e,t,o,!1);break;case"Delete":case"Backspace":Lt(e,t,o)}}function Ct(t,o,n){if(t.props.disabled)return;switch(n.key){case"ArrowUp":case"ArrowDown":!function(t,o,n){var r,s,a,l;n.preventDefault();const i=n.key,p=t.props.selections.findIndex(t=>e.eq(Se(t),Se(o)));if(-1===p)return;const d="ArrowDown"===i?p+1:p-1;if(d<0&&(null===(s=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}`))||void 0===s||s.focus()),d<0||d>=t.props.selections.length)return;const c=null===(a=t.props.__root)||void 0===a?void 0:a.getElementById(`${t.props.id}_selection_wrapper_${d}`);c&&c.focus(),t.props.activeSelectionValue=(null===(l=t.props.selections[d])||void 0===l?void 0:l.value)||void 0}(t,o,n);break;case"Enter":break;case"Tab":!function(t,o,n){var r,s,a,l;if(o){const i=t.props.selections.findIndex(t=>e.eq(Se(t),Se(o)));if(-1===i)return;const p=n.shiftKey?i-1:i+1;if(p>=t.props.selections.length)return;if(p<0)return void(null===(s=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}`))||void 0===s||s.focus());const d=null===(a=t.props.__root)||void 0===a?void 0:a.getElementById(`${t.props.id}_selection_wrapper_${p}`);d&&d.focus(),t.props.activeSelectionValue=(null===(l=t.props.selections[p])||void 0===l?void 0:l.value)||void 0}}(t,o,n);break;case"Delete":case"Backspace":!function(t,o){var n;if(o){const r=t.props.selections.findIndex(t=>e.eq(Se(t),Se(o)));if(-1===r)return;const s=t.props.selections[r+1]?r+1:r-1,a=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(`${t.props.id}_selection_wrapper_${s}`);a&&a.focus(),t.props.selections[s]?t.props.activeSelectionValue=Se(t.props.selections[s]):t.props.activeSelectionValue=void 0}o&&1!==t.props.selections.length||(t.props.userAction={type:"selectionDelete"}),Ue(t,o)}(t,o)}}function Tt(e,t){if(e.props.disabled)return;if(!(t.currentTarget instanceof HTMLElement)||e.props.id!==t.currentTarget.id)return;const o=t.key;switch(o){case"Tab":!function(e){e.props.expanded&&(e.props.expanded=!1)}(e);break;case"ArrowUp":case"ArrowDown":wt(e,o,t);break;case"ArrowLeft":case"ArrowRight":_t(e,o);break;case"Enter":It(e,t);break;case"Escape":Dt(e);break;case"Delete":case"Backspace":xt(e);break;default:e.emit("unusedKeydown",t)}}function Et(e,t){if(e.props.disabled)return;if(!(t.currentTarget instanceof HTMLElement)||e.props.id!==t.currentTarget.id)return;const o=t.key;switch(o){case"Tab":!function(e,t){var o,n,r;e.props.expanded=!1,e.props.multiple&&e.props.selections.length&&"autocomplete"===e.props.type&&"option"===e.props.selectionAppearance&&(t.preventDefault(),null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_selection_wrapper_0`))||void 0===n||n.focus(),e.props.activeSelectionValue=(null===(r=e.props.selections[0])||void 0===r?void 0:r.value)||void 0)}(e,t);break;case"ArrowUp":case"ArrowDown":wt(e,o,t);break;case"ArrowRight":case"ArrowLeft":_t(e,o);break;case"Enter":It(e,t);break;case"Escape":Dt(e);break;case"Delete":case"Backspace":xt(e)}}function Ot(t){t.props.alwaysLoadOnOpen=void 0!==t.props.alwaysLoadOnOpen&&e.undefine(t.props.alwaysLoadOnOpen),t.on("created",()=>{t.context&&(t.context.handlers.click=Mt.bind(null,t),t.context.handlers.focus=Vt.bind(null,t),t.context.handlers.keydown=Tt.bind(null,t),t.context.handlers.selectorTagKeydownHandler=e=>At.bind(null,t,e))})}function Mt(e,t){var o;if(t.stopPropagation(),0===t.detail)return;if(e.props.disabled)return;e.props.attrs.onClick&&e.props.attrs.onClick(t);const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);e.props.justOpened?e.props.justOpened=!1:e.props.expanded?e.props.expanded=!1:(n&&"mouse"!==t.pointerType?(e.props.mouseX=-1,e.props.mouseY=-1):(e.props.mouseX=t.clientX,e.props.mouseY=t.clientY),e.props.expanded=!0,null==n||n.focus())}function Vt(e){e.props.disabled||(e.props.attrs.onFocus&&e.props.attrs.onFocus(),e.props.skipOpen?e.props.skipOpen=!1:e.props.openOnFocus&&(e.props.justOpened=!0,e.props.expanded=!0))}function Ft(t){let o,n="";t.on("unusedKeydown",({payload:r})=>{if(!r.isComposing&&1===[...r.key].length){if(!n&&" "===r.key)return void function(t,o){var n;if(o.preventDefault(),t.props.expanded){if(t.props.activeValue===qe)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore());const o=t.props.allOptions.find(o=>e.eq(Se(o),t.props.activeValue));if(!o)return;Ge(t,o)}else t.props.expanded=!0}(t,r);t.props.expanded=!0,clearTimeout(o),n+=r.key;const s=t.props.allOptions.find(e=>e.label.toLowerCase().startsWith(n.toLowerCase()));s&&(t.props.activeValue=Se(s)),o=setTimeout(()=>{n=""},400)}})}function Pt(t){Bt(t),t.on("prop:selections",()=>{t.props.skipFormatSelections=!1,Bt(t)}),c&&e.whenAvailable(`${t.props.id}_selections`,Rt.bind(null,t),t.props.__root)}function Bt(e){e.isCreated&&(e.props.selections.length&&e.props.lastVisibleIndex&&e.props.selections.length-e.props.lastVisibleIndex>1?e.props.truncationCount="+ "+(e.props.selections.length-e.props.lastVisibleIndex-1).toString():e.props.truncationCount=void 0,e.props.formattedSelections=e.props.selections.map((t,o)=>e.props.lastVisibleIndex&&o===e.props.lastVisibleIndex&&0!==o?e.props.lastTruncatedElText&&o===e.props.selections.length-1?e.props.lastTruncatedElText:o===e.props.selections.length-1?t.label:t.label+"...":o===e.props.selections.length-1?t.label:t.label+", "))}function Ht(e){var t,o;if(!c||!e.context)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_selections`);if(!(n instanceof HTMLElement))return;const r=n.parentNode;if(!(r instanceof HTMLElement))return;let s=n.getBoundingClientRect().width;const a=.98*r.getBoundingClientRect().width,l=Array.prototype.slice.call(n.children),i=[...e.props.selections];if(s>a){const t=[];let n=0;for(let e=0;e<i.length;e++)t.push([i[e],l[e]]);for(let r=t.length-1;r>=0;r--){const l=t[r];if(!(l[1]instanceof HTMLElement))return;n+=l[1].getBoundingClientRect().width+parseFloat(window.getComputedStyle(l[1]).marginRight)+parseFloat(window.getComputedStyle(l[1]).marginLeft);const i=s-n;if(a>i){const t=l[0].label;e.props.skipFormatSelections=!0,l[1].textContent=t;let n=!1;for(let s=t.length;s>=0;s--){if(e.props.skipFormatSelections=!0,l[1].textContent=t.slice(0,s).trim()+"...",i+l[1].getBoundingClientRect().width<a){if(s<4){e.props.lastVisibleIndex=r-1,e.props.lastTruncatedElText=null;break}if(e.props.lastVisibleIndex=r,e.props.lastTruncatedElText&&l[1].textContent.slice(0,4)===e.props.lastTruncatedElText.slice(0,4))break;e.props.lastTruncatedElText=null===(o=l[1])||void 0===o?void 0:o.textContent;break}0===s&&(n=!0)}l[1].textContent=e.props.lastTruncatedElText&&!n&&0!==r?e.props.lastTruncatedElText:t,null===e.props.lastVisibleIndex&&(e.props.lastVisibleIndex=0===r?0:r-1,e.props.lastTruncatedElText=null),setTimeout(()=>{Bt(e)});break}}}else e.props.lastTruncatedElText=null,e.props.lastVisibleIndex=null,Bt(e)}function Rt(e,t){const o=new ResizeObserver(()=>{e.props.selections&&0!==e.props.selections.length&&(e.props.skipFormatSelections?e.props.skipFormatSelections=!1:Ht(e))}),n=new ResizeObserver(()=>{Ht(e)});o.observe(t),t.parentNode instanceof Element&&n.observe(t.parentNode)}const Nt={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Kt={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Wt={overflow:"hidden",height:"100%"},qt={},zt={};let Ut=0;function Yt(e){var t,o;if("undefined"==typeof window)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_popover`),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!r||!n)return;const s=n.style.paddingTop,a=n.style.paddingBottom,l=n.style.paddingLeft;n.style.paddingTop="0",n.style.paddingBottom="0",n.style.paddingLeft="0";const i=r.getBoundingClientRect(),p=n.getBoundingClientRect(),d=Math.round(i.top-p.top)+"px",c=Math.round(i.left-p.left-5)+"px",u=Math.max(Math.round(Math.min(p.height-p.top,window.innerHeight)-(i.top+i.height)),0)+"px";n.style.paddingTop=s,n.style.paddingBottom=a,n.style.paddingLeft=l,e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,paddingTop:d,paddingLeft:c,paddingBottom:u},e.props.listboxStyles={...e.props.listboxStyles,minWidth:"overscroll"===e.props.behavior?`min(${i.width+"px"}, calc(100vw - 4em))`:i.width+"px",maxWidth:"calc(100vw - 4em)"}}function jt(t,o){var n,r;let s=null;if(t.props.activeDescendant){const a=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(t.props.activeDescendant);if(!a)return s;t.props.ignoreScroll=!0;const l=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}_listbox`);if(!l)return s;const i=o.getBoundingClientRect(),p=l.getBoundingClientRect(),d=parseInt(getComputedStyle(o).paddingTop),c=parseInt(getComputedStyle(o).paddingBottom),u=a.offsetTop-d,f=Math.max(u-d,0),v=Math.max(o.scrollHeight-c-u-i.height,0),h=p.height-f-v;o.scrollTop=u;const m=()=>{o.scrollTop=v>0?v<d?o.scrollHeight:d:f<c?0:u-c},g=Math.min(150,p.height);f>0&&v>0||0===f&&0===v||h>g?o.scrollTop=u:m();o.clientHeight/2<o.scrollTop&&(s=t.props.options.filter(e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}).findIndex(o=>e.eq(t.value,Se(o)))),-1===s&&(s=null)}return s}function Zt(o){o.addProps(["behavior"]),o.on("created",()=>{"overscroll"===o.props.behavior&&("function"==typeof o.props.optionsLoader&&t.error(300,[o]),o.props.dropdownWrapperStyles=e.clone(Nt),o.props.listboxStyles={display:"inline-block"},o.props.styleWrapper=Yt.bind(null,o),o.props.positionListBox=jt.bind(null,o))}),o.on("prop:expanded",({payload:e})=>{"overscroll"===o.props.behavior&&(e?function(){Ut=document.documentElement.scrollTop;for(const e in Kt)zt[e]=document.documentElement.style[e],document.documentElement.style[e]=Kt[e];for(const e in Wt)qt[e]=document.body.style[e],document.body.style[e]=Wt[e];document.body.scrollTop=Ut}():function(){for(const e in Kt)document.documentElement.style[e]=zt[e];for(const e in Wt)document.body.style[e]=qt[e];document.body.scrollTop=0,document.documentElement.scrollTop=Ut}())})}function Gt(t){t.addProps(["multiLine"]),t.on("created",()=>{c&&(t.props.multiLineHeight=void 0,e.whenAvailable(`${t.props.id}_selections`,Xt.bind(null,t),t.props.__root))})}function Xt(e){var t;const o=Ce(e,t=>{for(const o of t){const{height:t}=o.contentRect;e.props.selectionsHeight!==t&&(e.props.selectionsHeight=t),Jt(e,o.target)}}),n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_selections`);n&&o.observe(n)}function Jt(e,t){var o;const n=t.querySelectorAll(`[id^="${e.props.id}_tag-wrapper"`);let r,s=[];if("taglist"===e.props.type){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;s=[t,...Array.from(n)]}else s=Array.from(n);if(!n)return;let a=!1;for(const t of s)if(void 0===r)r=t.getBoundingClientRect();else{const o=t.getBoundingClientRect();if(r.top>=o.top+o.height/5||r.top<=o.top-o.height/5){a=!0,e.props.multiLine=!0;break}}a||(e.props.multiLine=!1)}function Qt(t){if(t.on("created",()=>{t.context&&Ft(t)}),t.props.multiple||function(e){e.on("prop:selections",({payload:t})=>{var o;e.props.firstSelectionLabel=(null===(o=t[0])||void 0===o?void 0:o.label)||"",e.props.option=t[0]})}(t),"truncate"===t.props.selectionAppearance&&(t.props.lastVisibleIndex=null,Pt(t),t.on("prop:selections",()=>{Pt(t)})),"tags"===t.props.selectionAppearance&&Gt(t),t.props.multiple&&"tags"===t.props.selectionAppearance){function o(){return Array.isArray(t.value)?t.value:[]}function r(e,o){t.input(e)}t.on("created",()=>{t.props.disabled&&(t.props.draggable=!1),e.whenAvailable(`${t.props.id}_selections`,e=>{if(t.context&&e instanceof HTMLElement){const s={threshold:{horizontal:.25,vertical:0},plugins:[n.animations()],draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,disabled:!t.props.draggable,root:t.props.__root,touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag")};n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s}),t.on("prop:disabled",({payload:t})=>{s.disabled=t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})}),t.on("prop:draggable",({payload:t})=>{s.disabled=!t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})})}},t.props.__root)})}t.on("prop:expanded",({payload:e})=>{e&&t.props.optionsLoader&&"function"==typeof t.props.optionsLoader&&(!t.props.options.length||t.props.alwaysLoadOnOpen)&&(t.props.options=[],Ke(t))}),"overscroll"===t.props.behavior&&Zt(t)}const eo=(e,t)=>{let o=null,n=null,r=null;return function(...s){const a=this;o?(n=s,r=a):(e.apply(a,s),o=window.setTimeout(()=>{o=null,null!==n&&null!==r&&(e.apply(r,n),n=null,r=null)},t))}};function to(t){if(t.addProps(["popover","popoverOffset","usePopover","popoverCoordinates","popoverAncestorCoordinates"]),t.props.popover=e.undefine(t.props.popover)?"manual":void 0,"input"!==t.type||"overscroll"===t.props.behavior)return;let o=null,n=null,r=[],s=null;if(t.props.popoverOffset=e.undefine(t.props.popoverOffset)?parseInt(t.props.popoverOffset):0,!t.props.popover)return;if("undefined"==typeof document||!("popover"in HTMLElement.prototype))return void("undefined"!=typeof window&&console.warn('FormKit: Popover API is not supported in this browser — input panels will be rendered with fallback CSS positioning. This could result in inaccessible inputs due to parent containers using "overflow: hidden" or z-index conflicts.'));const a=()=>{t.props.invertPopover=!1,document.removeEventListener("resize",s),document.removeEventListener("scroll",s),r.forEach(e=>{e.removeEventListener("scroll",s)})};function l(){const{x:e,y:r,width:s,height:a}=function(e,t){if(!e||!t)return{x:0,y:0};const{left:o,top:n,width:r,height:s}=t.getBoundingClientRect();return{x:o+window.scrollX,y:n+s+window.scrollY,width:r,height:s}}(o,n);t.props.popoverAncestorCoordinates={x:e,y:r,width:s,height:a},t.props.popoverCoordinates={x:e,y:r,width:s,height:0}}function i(e){o&&document.body.contains(o)&&(e?(null==o||o.showPopover(),setTimeout(()=>{t.props.popoverCoordinates.height=(null==o?void 0:o.offsetHeight)||0},5)):o.matches(":popover-open")&&(o.hidePopover(),t.props.popoverCoordinates.height=0))}t.on("mounted",()=>{t.context&&(t.props.usePopover=!0,t.props.popoverCoordinates={x:0,y:0,width:0,height:0},t.props.popoverAncestorCoordinates={x:0,y:0,width:0,height:0})}),t.on("destroyed",()=>{a()}),t.on("prop:inputText",()=>{t.context&&(l(),i(!0))}),t.on("prop:expanded",({payload:p})=>{var d;t.context&&(!1===p?a():e.whenAvailable(`${null===(d=t.context)||void 0===d?void 0:d.id}_popover`,()=>{if(!t.context)return;o=document.querySelector(`[id="${t.context.id}_popover"][popover]`)||document.querySelector(`[id="${t.context.id}_popover"] [popover]`),n||(n=function(e){if(!e)return null;let t=e.parentElement;for(;t&&"static"===window.getComputedStyle(t).position;)t=t.parentElement;return t}(o)),l(),i(p),s=eo(()=>{t.context&&(l(),i(p))},10),document.addEventListener("resize",s),document.addEventListener("scroll",s),r=[];let e=null==o?void 0:o.parentElement;for(;e;)e.scrollHeight>e.clientHeight&&r.push(e),e=e.parentElement;r.forEach(e=>{e.addEventListener("scroll",s)})}))})}const oo={schema:/* #__PURE__ */j(/* #__PURE__ */Z(/* #__PURE__ */J("$label"),/* #__PURE__ */G(/* #__PURE__ */X("prefix"),/* #__PURE__ */Q(),/* #__PURE__ */re(/* #__PURE__ */z("$inputStd.length === 0 && $state.loading !== true",/* #__PURE__ */le('$placeholder || "placeholder"'),/* #__PURE__ */z("$multiple !== true",/* #__PURE__ */se(/* #__PURE__ */z("$state.loading && $selections.length === 0",/* #__PURE__ */ie("$ui.isLoading.value"),/* #__PURE__ */ae(/* #__PURE__ */pe("$option.label")))),/* #__PURE__ */z('$multiple && $selectionAppearance === "truncate"',/* #__PURE__ */ce(/* #__PURE__ */ue(/* #__PURE__ */z("$state.loading && $selections.length === 0",/* #__PURE__ */ie("$ui.isLoading.value"),/* #__PURE__ */ve()))),/* #__PURE__ */z('$multiple && $selectionAppearance === "tags"',/* #__PURE__ */$e(/* #__PURE__ */be(/* #__PURE__ */z("$state.loading && $isLoadingOption !== true && $selections.length === 0",/* #__PURE__ */ie("$ui.isLoading.value"),/* #__PURE__ */he(/* #__PURE__ */me(/* #__PURE__ */z("$state.loading && $fns.hasOptionLoaderValue($option) || $option.label === undefined",/* #__PURE__ */ye("$ui.isLoading.value"),/* #__PURE__ */ge("$option.label")),/* #__PURE__ */de(/* #__PURE__ */X("close"))))))))))),/* #__PURE__ */z("$truncationCount && $state.loading !== true",/* #__PURE__ */fe("$truncationCount")),/* #__PURE__ */z("$state.loading",/* #__PURE__ */X("loader")),/* #__PURE__ */z("$inputStd.length !== 0 && $selectionRemovable",/* #__PURE__ */de(/* #__PURE__ */X("close")),/* #__PURE__ */X("select"))),/* #__PURE__ */xe(),/* #__PURE__ */ee(),/* #__PURE__ */X("suffix"))),/* #__PURE__ */te("$help"),/* #__PURE__ */oe(/* #__PURE__ */ne("$message.value"))),type:"input",family:"dropdown",props:[],features:[
2
2
  /* #__PURE__ */o.defaultIcon("select","select"),
3
3
  /* #__PURE__ */o.defaultIcon("close","close"),
4
4
  /* #__PURE__ */o.defaultIcon("selected","check"),
@@ -6,8 +6,8 @@
6
6
  /* #__PURE__ */o.localize("isLoading"),
7
7
  /* #__PURE__ */o.localize("loadMore"),
8
8
  /* #__PURE__ */o.localize("remove"),o.options,
9
- /* #__PURE__ */ut.bind(null,ft,Lt,zt),jt]},Gt=/* #__PURE__ */K("tg"),{outer:Xt,wrapper:Jt,label:Qt,prefix:eo,suffix:to,help:oo,messages:no,message:ro,icon:so}=/* #__PURE__ */W(Gt),ao=Gt("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"checkbox",id:"$id",value:"$value",name:"$node.name",checked:"$checked",onInput:"$handlers.toggles",onBlur:"$handlers.blur",disabled:"$disabled"}}))),lo=Gt("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"}))),io=Gt("altLabel",(()=>({$el:"label",if:"($label && ($onValueLabel || $offValueLabel) && $valueLabelDisplay !== hidden && $valueLabelDisplay !== inner) || $altLabelPosition === true",attrs:{for:"$id","data-label-alt":"true",style:{color:{if:"$checked",then:"$valueLabelColorOn",else:"$valueLabelColorOff"}}},children:"$label"}))),po=Gt("innerLabel",(()=>({$el:"div",if:"$valueLabelDisplay === inner && ($checked && $onValueLabel || $offValueLabel)",attrs:{style:{color:{if:"$checked",then:"$valueLabelColorOn",else:"$valueLabelColorOff"}}},children:{if:"$checked",then:"$onValueLabel",else:"$offValueLabel"}}))),co=Gt("valueLabel",(()=>({$el:"label",if:"$valueLabelDisplay !== hidden && $valueLabelDisplay !== inner && (($checked === true && $onValueLabel) || ($checked === false && $offValueLabel))",attrs:{for:"$id"},children:{if:"$checked && $onValueLabel",then:"$onValueLabel",else:{if:"$offValueLabel",then:"$offValueLabel"}}}))),uo=Gt("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),fo=Gt("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),vo=Gt("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),ho=()=>vo(U("$slots.default","$slots.default",so("thumb")));const mo={schema:/* #__PURE__ */Xt(/* #__PURE__ */Jt(/* #__PURE__ */io(),/* #__PURE__ */uo(/* #__PURE__ */eo(),/* #__PURE__ */ao(),/* #__PURE__ */fo(/* #__PURE__ */po(),/* #__PURE__ */ho()),/* #__PURE__ */to()),/* #__PURE__ */co(),/* #__PURE__ */lo()),/* #__PURE__ */oo("$help"),/* #__PURE__ */no(/* #__PURE__ */ro("$message.value"))),type:"input",props:["checked","thumbColorOff","thumbColorOn","iconColorOff","iconColorOn","valueLabelColorOff","valueLabelColorOn","offValue","offValueLabel","onValue","onValueLabel","thumbIcon","trackColorOff","trackColorOn","valueLabelDisplay","altLabelPosition"],features:[function(t){function o(e,t){t.target instanceof HTMLInputElement&&(e.input(t.target.checked?e.props.onValue:e.props.offValue),e.props.checked=t.target.checked)}t.on("created",(()=>{"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.props.altLabelPosition=e.undefine(t.props.altLabelPosition),void 0===t.props.offValue&&(t.props.offValue=!1),void 0===t.props.onValue&&(t.props.onValue=!0),t.props.checked=e.eq(t.value,t.props.onValue),t.context&&(t.context.handlers.toggles=o.bind(null,t))})),t.on("commit",(({payload:o})=>{t.props.checked=e.eq(o,t.props.onValue)}))}]},go=/* #__PURE__ */K("rp"),{outer:$o,inner:bo,prefix:yo,suffix:xo,help:wo,messages:_o,message:ko,icon:So}=
10
- /* #__PURE__ */W(go),Lo=go("empty",(()=>({$el:"div"}))),Io=go("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}}))),Do=go("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),Ao=go("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}}))),Co=go("items",(()=>({$el:"ul",meta:{autoAnimate:!0},attrs:{role:"list",id:'$id + "_items"'}}))),To=go("item",(()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}}))),Eo=go("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}}))),Oo=go("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}}))),Mo=go("content","div"),Vo=go("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id"}}))),Fo=go("legend",(()=>({$el:"legend",if:"$label"}))),Po=go("group",(()=>({$formkit:"group",index:"$index"}))),Bo=go("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),Ho=go("remove",(()=>({$el:"li",if:"$removeControl"}))),Ro=go("insert",(()=>({$el:"li",if:"$insertControl"}))),No=go("up",(()=>({$el:"li",if:"$upControl"}))),Ko=go("down",(()=>({$el:"li",if:"$downControl"}))),Wo=go("controlLabel","span"),qo=go("dragHandleWrapper",(()=>({if:"$draggable",$el:"div"}))),Uo=go("dragHandle",(()=>({$el:"div",attrs:{id:'$id + "_drag_handle"'}})));function zo(t){var o,n,r,s,a,l,i,p,d,c,u,f,v,h;if(null!==(o=(p=t.props).removeControl)&&void 0!==o||(p.removeControl=!0),null!==(n=(d=t.props).upControl)&&void 0!==n||(d.upControl=!0),null!==(r=(c=t.props).downControl)&&void 0!==r||(c.downControl=!0),null!==(s=(u=t.props).insertControl)&&void 0!==s||(u.insertControl=!1),null!==(a=(f=t.props).addButton)&&void 0!==a||(f.addButton=!0),null!==(l=(v=t.props).addLabel)&&void 0!==l||(v.addLabel=!1),null!==(i=(h=t.props).addAttrs)&&void 0!==i||(h.addAttrs={}),t.props.draggable=e.undefine(t.props.draggable),t.props.min=void 0!==t.props.min?Number(t.props.min):1,t.props.max=void 0!==t.props.max?Number(t.props.max):1/0,t.props.min>t.props.max)throw Error("Repeater: min must be less than max");if(Array.isArray(t.value))if(t.value.length<t.props.min){const e=_(t.props.min-t.value.length,(()=>({})));t.input(t.value.concat(e),!1)}else t.value.length>t.props.max&&t.input(t.value.slice(0,t.props.max),!1);else t.input(_(t.props.min,(()=>({}))),!1);t.context&&function(e,t){t.createShift=(t,o)=>()=>{const n=e._value;n.splice(t+o,0,n.splice(t,1)[0]),e.input(n,!1)},t.createInsert=t=>()=>{const o=e._value;o.splice(t+1,0,{}),e.input(o,!1)},t.createAppend=()=>()=>{const t=e._value;t.push({}),e.input(t,!1)},t.createRemover=t=>()=>{const o=e._value;o.splice(t,1),e.input(o,!1)}}(t,t.context.fns)}function Yo(e,t){var o;if(!t.context)return;const r=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}_inner`),s=null==r?void 0:r.hasAttribute("data-auto-animate"),a={group:t.props.id,dragHandle:`#${t.props.id}_drag_handle`,draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,root:t.props.__root,disabled:!t.props.draggable,plugins:s?[]:[n.animations({duration:100})],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>"LI"===e.tagName};function l(){return Array.isArray(t.value)?t.value:[]}function i(e){t.input(e)}n.dragAndDrop({parent:e,getValues:l,setValues:i,config:a}),t.on("prop:disabled",(({payload:t})=>{a.disabled=t,n.dragAndDrop({parent:e,getValues:l,setValues:i,config:a})})),t.on("prop:draggable",(({payload:t})=>{a.disabled=!t,n.dragAndDrop({parent:e,getValues:l,setValues:i,config:a})}))}const jo={schema:/* #__PURE__ */$o(/* #__PURE__ */Vo(/* #__PURE__ */Fo("$label"),/* #__PURE__ */wo("$help"),/* #__PURE__ */bo(/* #__PURE__ */yo(),/* #__PURE__ */U("$value.length === 0",/* #__PURE__ */U("$slots.empty",/* #__PURE__ */Lo()),/* #__PURE__ */Co(/* #__PURE__ */To(/* #__PURE__ */qo(/* #__PURE__ */Uo(/* #__PURE__ */So("dragHandle"))),/* #__PURE__ */Mo(/* #__PURE__ */Po("$slots.default")),/* #__PURE__ */Bo(/* #__PURE__ */No(/* #__PURE__ */Oo(/* #__PURE__ */Wo("$ui.moveUp.value"),/* #__PURE__ */So("moveUp"))),/* #__PURE__ */Ho(/* #__PURE__ */Ao(/* #__PURE__ */Wo("$ui.remove.value"),/* #__PURE__ */So("remove"))),/* #__PURE__ */Ro(/* #__PURE__ */Io(/* #__PURE__ */Wo("$ui.add.value"),/* #__PURE__ */So("add"))),/* #__PURE__ */Ko(/* #__PURE__ */Eo(/* #__PURE__ */Wo("$ui.moveDown.value"),/* #__PURE__ */So("moveDown"))))),/* #__PURE__ */xo()))),/* #__PURE__ */Do('$addLabel || ($ui.add.value + " " + ($label || ""))')),/* #__PURE__ */_o(/* #__PURE__ */ko("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs","draggable"],features:[function(t){t._c.sync=!0,t.on("created",zo.bind(null,t)),t.on("mounted",(()=>{e.whenAvailable(`${t.props.id}_items`,(e=>{if(e instanceof HTMLElement){Yo(e,t);function o(e){for(const o of e)for(const e of Array.from(o.addedNodes))if(e instanceof HTMLElement&&e.id===`${t.props.id}_items`)return void Yo(e,t)}new MutationObserver(o).observe(e.parentNode,{childList:!0})}}),t.props.__root)}))},o.disablesChildren,
9
+ /* #__PURE__ */bt.bind(null,yt,Ot,Qt),to]},no=/* #__PURE__ */K("tg"),{outer:ro,wrapper:so,label:ao,prefix:lo,suffix:io,help:po,messages:co,message:uo,icon:fo}=/* #__PURE__ */W(no),vo=no("input",()=>({$el:"input",bind:"$attrs",attrs:{type:"checkbox",id:"$id",value:"$value",name:"$node.name",checked:"$checked",onInput:"$handlers.toggles",onBlur:"$handlers.blur",disabled:"$disabled"}})),ho=no("label",()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"})),mo=no("altLabel",()=>({$el:"label",if:"($label && ($onValueLabel || $offValueLabel) && $valueLabelDisplay !== hidden && $valueLabelDisplay !== inner) || $altLabelPosition === true",attrs:{for:"$id","data-label-alt":"true",style:{color:{if:"$checked",then:"$valueLabelColorOn",else:"$valueLabelColorOff"}}},children:"$label"})),go=no("innerLabel",()=>({$el:"div",if:"$valueLabelDisplay === inner && ($checked && $onValueLabel || $offValueLabel)",attrs:{style:{color:{if:"$checked",then:"$valueLabelColorOn",else:"$valueLabelColorOff"}}},children:{if:"$checked",then:"$onValueLabel",else:"$offValueLabel"}})),$o=no("valueLabel",()=>({$el:"label",if:"$valueLabelDisplay !== hidden && $valueLabelDisplay !== inner && (($checked === true && $onValueLabel) || ($checked === false && $offValueLabel))",attrs:{for:"$id"},children:{if:"$checked && $onValueLabel",then:"$onValueLabel",else:{if:"$offValueLabel",then:"$offValueLabel"}}})),bo=no("inner",()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}})),yo=no("track",()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}})),xo=no("thumb",()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}})),wo=()=>xo(z("$slots.default","$slots.default",fo("thumb")));const _o={schema:/* #__PURE__ */ro(/* #__PURE__ */so(/* #__PURE__ */mo(),/* #__PURE__ */bo(/* #__PURE__ */lo(),/* #__PURE__ */vo(),/* #__PURE__ */yo(/* #__PURE__ */go(),/* #__PURE__ */wo()),/* #__PURE__ */io()),/* #__PURE__ */$o(),/* #__PURE__ */ho()),/* #__PURE__ */po("$help"),/* #__PURE__ */co(/* #__PURE__ */uo("$message.value"))),type:"input",props:["checked","thumbColorOff","thumbColorOn","iconColorOff","iconColorOn","valueLabelColorOff","valueLabelColorOn","offValue","offValueLabel","onValue","onValueLabel","thumbIcon","trackColorOff","trackColorOn","valueLabelDisplay","altLabelPosition"],features:[function(t){function o(e,t){t.target instanceof HTMLInputElement&&(e.input(t.target.checked?e.props.onValue:e.props.offValue),e.props.checked=t.target.checked)}t.on("created",()=>{"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.props.altLabelPosition=e.undefine(t.props.altLabelPosition),void 0===t.props.offValue&&(t.props.offValue=!1),void 0===t.props.onValue&&(t.props.onValue=!0),t.props.checked=e.eq(t.value,t.props.onValue),t.context&&(t.context.handlers.toggles=o.bind(null,t))}),t.on("commit",({payload:o})=>{t.props.checked=e.eq(o,t.props.onValue)})}]},ko=/* #__PURE__ */K("rp"),{outer:So,inner:Lo,prefix:Io,suffix:Do,help:Ao,messages:Co,message:To,icon:Eo}=
10
+ /* #__PURE__ */W(ko),Oo=ko("empty",()=>({$el:"div"})),Mo=ko("insertControl",()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}})),Vo=ko("addButton",()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"})),Fo=ko("removeControl",()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}})),Po=ko("items",()=>({$el:"ul",meta:{autoAnimate:!0},attrs:{role:"list",id:'$id + "_items"'}})),Bo=ko("item",()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}})),Ho=ko("downControl",()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}})),Ro=ko("upControl",()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}})),No=ko("content","div"),Ko=ko("fieldset",()=>({$el:"fieldset",attrs:{id:"$id"}})),Wo=ko("legend",()=>({$el:"legend",if:"$label"})),qo=ko("group",()=>({$formkit:"group",index:"$index"})),zo=ko("controls",()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"})),Uo=ko("remove",()=>({$el:"li",if:"$removeControl"})),Yo=ko("insert",()=>({$el:"li",if:"$insertControl"})),jo=ko("up",()=>({$el:"li",if:"$upControl"})),Zo=ko("down",()=>({$el:"li",if:"$downControl"})),Go=ko("controlLabel","span"),Xo=ko("dragHandleWrapper",()=>({if:"$draggable",$el:"div"})),Jo=ko("dragHandle",()=>({$el:"div",attrs:{id:'$id + "_drag_handle"'}}));function Qo(t){var o,n,r,s,a,l,i,p,d,c,u,f,v,h;if(null!==(o=(p=t.props).removeControl)&&void 0!==o||(p.removeControl=!0),null!==(n=(d=t.props).upControl)&&void 0!==n||(d.upControl=!0),null!==(r=(c=t.props).downControl)&&void 0!==r||(c.downControl=!0),null!==(s=(u=t.props).insertControl)&&void 0!==s||(u.insertControl=!1),null!==(a=(f=t.props).addButton)&&void 0!==a||(f.addButton=!0),null!==(l=(v=t.props).addLabel)&&void 0!==l||(v.addLabel=!1),null!==(i=(h=t.props).addAttrs)&&void 0!==i||(h.addAttrs={}),t.props.draggable=e.undefine(t.props.draggable),t.props.min=void 0!==t.props.min?Number(t.props.min):1,t.props.max=void 0!==t.props.max?Number(t.props.max):1/0,t.props.min>t.props.max)throw Error("Repeater: min must be less than max");if(Array.isArray(t.value))if(t.value.length<t.props.min){const e=_(t.props.min-t.value.length,()=>({}));t.input(t.value.concat(e),!1)}else t.value.length>t.props.max&&t.input(t.value.slice(0,t.props.max),!1);else t.input(_(t.props.min,()=>({})),!1);t.context&&function(e,t){t.createShift=(t,o)=>()=>{const n=e._value;n.splice(t+o,0,n.splice(t,1)[0]),e.input(n,!1)},t.createInsert=t=>()=>{const o=e._value;o.splice(t+1,0,{}),e.input(o,!1)},t.createAppend=()=>()=>{const t=e._value;t.push({}),e.input(t,!1)},t.createRemover=t=>()=>{const o=e._value;o.splice(t,1),e.input(o,!1)}}(t,t.context.fns)}function en(e,t){var o;if(!t.context)return;const r=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}_inner`),s=null==r?void 0:r.hasAttribute("data-auto-animate"),a={group:t.props.id,dragHandle:`#${t.props.id}_drag_handle`,draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,root:t.props.__root,disabled:!t.props.draggable,plugins:s?[]:[n.animations({duration:100})],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>"LI"===e.tagName};function l(){return Array.isArray(t.value)?t.value:[]}function i(e){t.input(e)}n.dragAndDrop({parent:e,getValues:l,setValues:i,config:a}),t.on("prop:disabled",({payload:t})=>{a.disabled=t,n.dragAndDrop({parent:e,getValues:l,setValues:i,config:a})}),t.on("prop:draggable",({payload:t})=>{a.disabled=!t,n.dragAndDrop({parent:e,getValues:l,setValues:i,config:a})})}const tn={schema:/* #__PURE__ */So(/* #__PURE__ */Ko(/* #__PURE__ */Wo("$label"),/* #__PURE__ */Ao("$help"),/* #__PURE__ */Lo(/* #__PURE__ */Io(),/* #__PURE__ */z("$value.length === 0",/* #__PURE__ */z("$slots.empty",/* #__PURE__ */Oo()),/* #__PURE__ */Po(/* #__PURE__ */Bo(/* #__PURE__ */Xo(/* #__PURE__ */Jo(/* #__PURE__ */Eo("dragHandle"))),/* #__PURE__ */No(/* #__PURE__ */qo("$slots.default")),/* #__PURE__ */zo(/* #__PURE__ */jo(/* #__PURE__ */Ro(/* #__PURE__ */Go("$ui.moveUp.value"),/* #__PURE__ */Eo("moveUp"))),/* #__PURE__ */Uo(/* #__PURE__ */Fo(/* #__PURE__ */Go("$ui.remove.value"),/* #__PURE__ */Eo("remove"))),/* #__PURE__ */Yo(/* #__PURE__ */Mo(/* #__PURE__ */Go("$ui.add.value"),/* #__PURE__ */Eo("add"))),/* #__PURE__ */Zo(/* #__PURE__ */Ho(/* #__PURE__ */Go("$ui.moveDown.value"),/* #__PURE__ */Eo("moveDown"))))),/* #__PURE__ */Do()))),/* #__PURE__ */Vo('$addLabel || ($ui.add.value + " " + ($label || ""))')),/* #__PURE__ */Co(/* #__PURE__ */To("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs","draggable"],features:[function(t){t._c.sync=!0,t.on("created",Qo.bind(null,t)),t.on("mounted",()=>{e.whenAvailable(`${t.props.id}_items`,e=>{if(e instanceof HTMLElement){function o(e){for(const o of e)for(const e of Array.from(o.addedNodes))if(e instanceof HTMLElement&&e.id===`${t.props.id}_items`)return void en(e,t)}en(e,t);Ae(t,o).observe(e.parentNode,{childList:!0})}},t.props.__root)})},o.disablesChildren,
11
11
  /* #__PURE__ */o.localize("remove"),
12
12
  /* #__PURE__ */o.localize("add"),
13
13
  /* #__PURE__ */o.localize("moveUp"),
@@ -16,7 +16,7 @@
16
16
  /* #__PURE__ */o.defaultIcon("remove","trash"),
17
17
  /* #__PURE__ */o.defaultIcon("add","add"),
18
18
  /* #__PURE__ */o.defaultIcon("moveUp","arrowUp"),
19
- /* #__PURE__ */o.defaultIcon("moveDown","arrowDown")]},Zo=new WeakMap;function Go(e,t){const o={onItems:[],offItems:[]},n=t||Number(e.value||0);for(let t=0;t<e.props.max;t++)if(t<n&&t+1>=n){const r=e.props.rightToLeft?100-100*(n-t):100*(n-t);o.onItems.push(r+"%"),o.offItems.push(100-r+"%")}else t<n?(o.offItems.push("0%"),o.onItems.push("100%")):t>=n&&(o.offItems.push("100%"),o.onItems.push("0%"));e.props.itemsToPercentages=o}function Xo(e,t){var o;null===(o=e.context)||void 0===o||o.handlers.blur(t)}function Jo(e,t){const{x:o,y:n}=ln(t);let r=document.elementFromPoint(o,n);const s=Array.from(document.querySelectorAll(`#${e.props.id}_items_wrapper > .formkit-ratingItem`));let a=!0;for(;r&&a;){if(s.includes(r)){a=!1;break}r=r.parentNode}if(!a){const t=s.indexOf(r);if(1===e.props.step)return void e.input(t+1,!1)}}function Qo(e,t,o){e.props.disabled||(o.preventDefault(),e.props.hoverHighlight=!0,e.props.touchStarted=!0,1!==e.props.step?pn(e,t,o):e.input(t+1,!1))}function en(e,t){if(!e.props.dragStarted)return;t.preventDefault(),e.props.hoverHighlight=!1,e.props.dragStarted=!1,Go(e);const o=Zo.get(e);o&&(o.abort(),Zo.delete(e))}function tn(e,t,o){if(e.props.hoverHighlight||e.props.disabled)return;o.preventDefault(),e.props.hoverHighlight=!0,e.props.dragStarted=!0;const n=new AbortController;document.addEventListener("mouseup",(t=>en(e,t)),{signal:n.signal}),Zo.set(e,n),1===e.props.step?e.input(t+1,!1):pn(e,t,o)}function on(e,t){var o,n;if(document.activeElement===t.currentTarget)if("ArrowRight"===t.key||"ArrowDown"===t.key){e.props.arrow=1;const t=e.value?dn(e.value+1*e.props.step,e.props.step):e.props.min+1*e.props.step,n=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(e.value?`#${e.props.id}_inner input[value="${t}"]`:"#"+(e.props.id+"_0_0"));e.props.preventFocus=!0,n&&n instanceof HTMLInputElement&&n.focus(),e.props.preventFocus=!1,e.input(Number(t))}else if("ArrowLeft"===t.key||"ArrowUp"===t.key){e.props.arrow=-1;const t=e.value?dn(e.value-1*e.props.step,e.props.step):e.props.max,o=null===(n=e.props.__root)||void 0===n?void 0:n.querySelector(`#${e.props.id}_inner input[value="${t}"]`);e.props.preventFocus=!0,o&&o instanceof HTMLInputElement&&o.focus(),e.props.preventFocus=!0,e.input(Number(t)),e.props.preventFocus=!1}}function nn(e,t){if(!e.props.preventFocus)if(e.props.preventFocus=!0,setTimeout((()=>{e.props.preventFocus=!1}),50),t.relatedTarget instanceof HTMLElement&&t.relatedTarget.id===e.props.id+"_items_wrapper")e.props.arrow>0?setTimeout((()=>{var t,o;null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+"_0_0"))||void 0===o||o.focus()})):e.props.arrow<0&&setTimeout((()=>{var t,o;null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+`_${e.props.max-1}_${e.props.stepsPerValue-1}`))||void 0===o||o.focus()}));else if(t.target instanceof HTMLInputElement){if(Number(t.target.value)===e.props.step&&e.value===e.props.max||Number(t.target.value)===e.props.max&&e.value===e.props.step){const t=document.getElementById(e.props.id+"_items_wrapper");return null==t||t.focus(),void e.input(0)}e.input(Number(t.target.value))}}function rn(e,t,o){e.props.hoverHighlight&&(e.props.disabled||(1===e.props.step?(Go(e,t+1),e.props.dragStarted&&e.input(t+1,!1)):pn(e,t,o,!!e.props.dragStarted)))}function sn(e){Go(e)}function an(e,t,o){if(!e.props.disabled&&"touchstart"!==o.type&&(o.preventDefault(),(0!==o.clientX||0!==o.clientY)&&o.currentTarget instanceof HTMLElement))return 1===e.props.step?e.props.deselect&&Number(e.value)===t+1?void e.input(0):void e.input(t+1):void pn(e,t,o)}function ln(e){return e instanceof MouseEvent?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}}function pn(e,t,o,n=!0){if(!(o.currentTarget instanceof HTMLElement))return;const{x:r,y:s}=ln(o),a=o.currentTarget.getBoundingClientRect();let l=dn((r-a.x)/a.width+t,e.props.step);l=l>e.props.min?l:e.props.min,l=l<e.props.max?l:e.props.max,!e.props.deselect||l!==Number(e.value)||e.props.dragStarted?n?e.input(l,!1):Go(e,l):e.input(0)}function dn(e,t){t||(t=1);const o=1/t;return Math.ceil(e*o)/o}const cn=/* #__PURE__ */K("rt"),{outer:un,wrapper:fn,inner:vn,label:hn,prefix:mn,suffix:gn,help:$n,messages:bn,message:yn,icon:xn}=/* #__PURE__ */W(cn),wn=cn("itemsWrapper",(()=>({$el:"span",attrs:{style:{"flex-direction":'$rightToLeft && "row-reverse" || undefined'},tabindex:"$value !== undefined && $value !== 0 && '-1' || '0'",id:"$id + _items_wrapper",onKeydown:"$handlers.handleWrapperKeydown","data-disabled":"$disabled",onBlur:"$handlers.handleWrapperBlur",onMouseleave:"$hoverHighlight && $handlers.handleMouseleave"}}))),_n=cn("ratingItem",(()=>({for:["item","index","$max"],$el:"span",attrs:{id:'$id + "_item_" + $index',onClick:"$handlers.handleItemClick($item)",draggable:"$hoverHighlight !== true && && $disabled !== true && true",onMousemove:"$handlers.handleMousemove($item)",onDragstart:"$handlers.handleDragstart($item)",onDragend:"$handlers.handleDragend",onTouchstartPassive:"$handlers.handleTouchstart($item)",onTouchmovePassive:"$handlers.handleTouchmove"}}))),kn=cn("template",(()=>({for:["increment","stepIndex","$stepsPerValue"],$el:null}))),Sn=cn("itemLabel",(()=>({$el:"label",attrs:{id:'$id + "_label_" + $index + "_" + $stepIndex',for:'$id + "_" + $index + "_" + $stepIndex',"data-checked":'$value === $fns.getValue($item, $increment) && "true" || "false"',style:{width:'$fns.showLabel($fns.getValue($item, $increment), $stepIndex, $item) && "100%" || "0%"'}}}))),Ln=cn("itemLabelInner",(()=>({$el:"span",children:"$fns.getValue($item, $increment)"}))),In=cn("input",(()=>({$el:"input",attrs:{type:"radio",value:"$fns.getValue($item, $increment)",id:'$id + "_" + $index + "_" + $stepIndex',onFocus:"$handlers.handleFocus",tabindex:'$value === $fns.getValue($item, $increment) && "0" || "-1"',disabled:"$disabled",name:"$id","data-value":"$fns.getValue($item, $increment)",checked:"$value === $fns.getValue($item, $increment) && true",onKeydown:"$handlers.handleKeydown($fns.getValue($item, $increment))"}}))),Dn=cn("onItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item)",display:"flex",position:"relative",overflow:"hidden",top:"0",left:"0",bottom:"0"}}}))),An=cn("offItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item, false)",display:"flex","flex-direction":"row-reverse",position:"absolute",zIndex:"$offItemStyles && 100",overflow:"hidden",top:"0",right:"0"}}}))),Cn=cn("onItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$onColor"}}}))),Tn=cn("offItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$offColor"}}}))),En=()=>U("$slots.onItem",(()=>()=>"$slots.onItem"),U("$slots.default",(()=>()=>"$slots.default"),xn("rating"))),On=()=>U("$slots.offItem",(()=>()=>"$slots.offItem"),U("$slots.default",(()=>()=>"$slots.default"),xn("rating"))),Mn={schema:/* #__PURE__ */un(/* #__PURE__ */fn(/* #__PURE__ */hn("$label"),/* #__PURE__ */vn(/* #__PURE__ */xn("prefix"),/* #__PURE__ */mn(),/* #__PURE__ */wn(/* #__PURE__ */_n(/* #__PURE__ */kn(/* #__PURE__ */Sn(/* #__PURE__ */Dn(/* #__PURE__ */Cn(/* #__PURE__ */En())),/* #__PURE__ */An(/* #__PURE__ */Tn(/* #__PURE__ */On())),/* #__PURE__ */Ln()),/* #__PURE__ */In()))),/* #__PURE__ */gn(),/* #__PURE__ */xn("suffix"))),/* #__PURE__ */$n("$help"),/* #__PURE__ */bn(/* #__PURE__ */yn("$message.value"))),type:"input",props:[],features:[function(t){function o(e){setTimeout((()=>{const t=Array.from(document.querySelectorAll(`#${e.props.id}_items_wrapper > .formkit-ratingItem`));for(let e=0;e<t.length;e++){const o=t[e].querySelectorAll(".formkit-onItemWrapper"),n=t[e].querySelectorAll(".formkit-offItemWrapper");for(let n=0;n<o.length;n++)o[n].style.flex=`0 0 ${t[e].getBoundingClientRect().width}px`;for(let o=0;o<n.length;o++)n[o].style.flex=`0 0 ${t[e].getBoundingClientRect().width}px`}}))}t.addProps(["max","step","stepsPerValue","itemsToPercentages","rightToLeft","onItemStyles","offItemStyles","hoverHighlight","deselect","disabled","wrapperWidth","onColor","offColor"]),!1!==t.props.hoverHighlight&&"false"!==t.props.hoverHighlight&&(t.props.hoverHighlight=!0),t.props.deselect=e.undefine(t.props.deselect),t.props.max=Number(t.props.max)||5,t.props.min=Number(t.props.min)||0,t.props.step=Number(t.props.step)||1,t.props.numberOfSteps=t.props.max/t.props.step,t.props.lastIndex=1/t.props.step-1,t.props.itemsToPercentages={},"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.props.rightToLeft?(t.props.onItemStyles=void 0,t.props.offItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%",zIndex:100}):t.props.onItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%"},t.props.stepsPerValue=1/t.props.step,t.hook.input(((e,o)=>{if(null===e||""===e||isNaN(e))return o(e);const n=Number(e),r=Number(t.props.min),s=Number(t.props.max);return n>s?o(s):t.props.min&&n<=r?o(r):o(n)})),t.on("commit",(({payload:e})=>{const o=Number(e||0);Go(t,o)})),t.on("created",(()=>{t.context&&(e.whenAvailable(`${t.props.id}_items_wrapper`,(()=>{o(t),function(e){var t;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_items_wrapper`);if(!n)return;new ResizeObserver((()=>{o(e)})).observe(n)}(t),setTimeout((()=>o(t)),100)}),t.props.__root),t.context.fns.getPercentage=(e,t,o=!0)=>(o?e.onItems:e.offItems)[t],t.context.fns.getValue=(e,o)=>e+Number((o*t.props.step+t.props.step).toFixed(1)),t.context.fns.showLabel=(e,o)=>{const n=Number(t.value||0);return 0===n&&0===o||n&&e===n||e>n&&0===o||n>e&&o===t.props.lastIndex},t.context.handlers.handleFocus=e=>nn.call(null,t,e),t.context.handlers.handleWrapperKeydown=e=>on.call(null,t,e),t.context.handlers.handleWrapperBlur=e=>Xo.call(null,t,e),t.context.handlers.handleItemClick=e=>o=>an.call(null,t,e,o),t.context.handlers.handleMousemove=e=>o=>rn.call(null,t,e,o),t.context.handlers.handleMouseleave=()=>sn.call(null,t),t.context.handlers.handleDragstart=e=>o=>tn.call(null,t,e,o),t.context.handlers.handleMouseup=e=>en.call(null,t,e),t.context.handlers.handleTouchstart=e=>o=>Qo.call(null,t,e,o),t.context.handlers.handleTouchmove=e=>Jo.call(null,t,e),t.context.handlers.handleKeydown=e=>o=>function(e,t,o){const n=Number(e.value);e.props.deselect&&" "===o.key&&n===t?e.input(0):" "===o.key&&e.input(t)}(t,e,o))}))},/* #__PURE__ */o.defaultIcon("rating","star")]},Vn=/* #__PURE__ */K("ac"),{outer:Fn,wrapper:Pn,inner:Bn,icon:Hn,label:Rn,prefix:Nn,suffix:Kn,help:Wn,messages:qn,message:Un}=/* #__PURE__ */W(Vn),zn=Vn("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",onFocus:"$handlers.focus",value:"$inputText || undefined",name:"$node.name",placeholder:"$state.loading && $ui.isLoading.value || $placeholder || undefined",tabindex:'$disabled && "-1" || 0',role:"combobox",autocomplete:'$attrs.autocomplete || "off"',autocapitalize:"none",readonly:"$attrs.readonly || $state.loading || $multiple && $max && $value && $value.length >= $max && $hasHighlightedRange !== true || undefined","data-selection-appearance":"$selectionAppearance",disabled:"$disabled || $disabledInternally || undefined",onTouchmovePassive:"$handlers.touchmove",onTouchstartPassive:"$handlers.touchmove",onTouchend:"$handlers.touchend","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined","aria-required":"$state.required || undefined"}}))),Yn=Vn("listboxButton",(()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',role:"button","aria-label":"$expanded && $ui.close.value || $ui.open.value",onClick:"$handlers.toggleListbox",onKeydown:"$handlers.toggleListboxKeydown",tabindex:'$disabled && "-1" || 0',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-disabled":"$disabled || $state.loading || undefined","data-disabled":"$disabled || $disabledInternally || undefined"}}))),jn=Vn("selectionWrapper",(()=>({for:["option","index","$selections"],$el:"div",attrs:{id:'$id + "_selection_wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:'$disabled && "-1" || 0',onKeydown:"$handlers.selectionKeydown && $handlers.selectionKeydown($multiple && $option || undefined)",onClick:"$handlers.selectionClick && $handlers.selectionClick($multiple && $option || undefined)",onFocus:"$handlers.selectionFocus && $handlers.selectionFocus($multiple && $option || undefined)",onBlur:"$handlers.selectionBlur && $handlers.selectionBlur($multiple && $option || undefined)","data-is-selection":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),Zn=Vn("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),Gn=Vn("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),Xn=Vn("removeSelection",(()=>({$el:"button",attrs:{id:'$selectionAppearance === "option" && $multiple && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"0",title:"$ui.remove.value",type:"button","aria-label":"$ui.remove.value",onClick:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)",onTouchend:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)","aria-controls":"$id"}}))),Jn=Vn("optionLoading","span"),Qn=Vn("option",(()=>({$el:"div",if:"$value !== undefined"}))),er=/* #__PURE__ */z(Vn);function tr(t){"option"!==t.props.selectionAppearance||t.props.multiple||!1===t.props.selectionRemovable||"false"===t.props.selectionRemovable||(t.props.selectionRemovable=!0),t.props.multiple||(t.props.clearSearchOnOpen=e.undefine(t.props.clearSearchOnOpen)),t.props.selectionRemovable=e.undefine(t.props.selectionRemovable),t.props.openOnClick=e.undefine(t.props.openOnClick),"option"!==t.props.selectionAppearance||t.props.multiple||(t.props.isSingleOption=!0),void 0===t.props.closeOnSelect&&(t.props.closeOnSelect=!0),void 0===t.props.selectionAppearance&&(t.props.selectionAppearance="text-input"),void 0===t.props.closeOnSelect&&(t.props.closeOnSelect=!0),t.props.closeOnSelect?t.props.resetSearchOnCommit=!1:void 0===t.props.resetSearchOnCommit&&(t.props.resetSearchOnCommit=t.props.multiple),t.props.allowNewValues=e.undefine(t.props.allowNewValues)}function or(t){t.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter","hasHighlightedRange","clearOnClick","debounce"]),void 0===t.props.debounce?t.props.debounce=200:t.props.debounce=parseInt(t.props.debounce),t.props.nonceKey="searchValue",t.props.searchValue="",t.props.inputText="",t.props.filterOptions=De.bind(null,t),t.props.reloadOnCommit=e.undefine(t.props.reloadOnCommit),void 0===t.props.alwaysLoadOnOpen?t.props.alwaysLoadOnOpen=!0:t.props.alwaysLoadOnOpen=e.undefine(t.props.alwaysLoadOnOpen),"function"!=typeof t.props.filter&&(t.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),t.on("created",(()=>{t.context&&c&&(t.context.handlers.focus=sr.bind(null,t),t.context.handlers.input=nr.bind(null,t),t.context.handlers.focus=sr.bind(null,t),t.context.handlers.click=rr.bind(null,t),t.context.handlers.toggleListbox=ar.bind(null,t),t.context.handlers.toggleListboxKeydown=lr.bind(null,t),t.context.handlers.keydown=St.bind(null,t),t.context.handlers.selectionKeydown=e=>o=>_t(t,e,o),t.context.handlers.searchInputTagKeydown=e=>o=>function(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":gt(e);break;case"ArrowRight":case"ArrowLeft":$t(e,t,o);break;case"Delete":case"Backspace":bt(e,t,o)}}(t,e,o),t.on("prop:options",(({payload:e})=>{if((0===t.props.initialOptions.length&&"function"!=typeof t.props.optionsLoader||!t.props.searchValue&&e.length)&&(t.props.initialOptions=[...e]),t.props.selections&&t.props.selections.length&&e.length)for(let o=0;o<t.props.selections.length;o++){const n=t.props.selections[o],r=e.find((e=>Se(e)===n.value));r&&(t.props.selections[o]=r)}})))})),t.on("prop:expanded",(({payload:e})=>{e||Le.delete(t)}))}function nr(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&De(e,e.props.searchValue,!0)}function rr(e,t){t.stopPropagation(),e.props.disabled||e.props.disabledInternally||(e.props.attrs.onClick&&e.props.attrs.onClick(t),(!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0))}function sr(e){e.props.disabled||e.props.disabledInternally||(e.props.attrs.onFocus&&e.props.attrs.onFocus(),e.props.activeSelectionValue=void 0,e.props.skipOpen?e.props.skipOpen=!1:e.props.openOnFocus&&(e.props.expanded=!0))}function ar(e){var t,o,n;e.props.disabled||e.props.disabledInternally||(null===(t=e.context)||void 0===t?void 0:t.state.loading)||(e.props.expanded=!e.props.expanded,e.props.openOnFocus||null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus())}function lr(e,t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),ar(e))}const ir=new WeakMap,pr="undefined"!=typeof window,dr=new WeakMap;let cr=!1;function ur(t){t.props.searchValue=null,t.on("commit",(()=>{t.props.searchValue=null,t.props.highlightedRange||fr(t)})),t.on("created",(()=>{if(!t.context||!pr)return;t.on("handleSearchInput",(({payload:e})=>{""===e?(t.props.searchValue=null,t.input([])):e&&0===t.props.inputStd.length?t.props.searchValue=e:e&&t.props.inputStd.length>0&&(t.props.searchValue=function(e){var t;const o=hr(e);if(e.props.highlightedRange){const[t,n]=vr(e,o);return e.props.inputText.slice(t,n)}return e.props.inputText.slice((null===(t=o[o.length-1])||void 0===t?void 0:t.end)+2)}(t)),!t.props.expanded&&e?t.props.expanded=!0:!e&&t.props.expanded&&(t.props.expanded=!1)})),function(t){e.whenAvailable(`${t.props.id}`,(e=>{e instanceof HTMLInputElement&&dr.set(e,t)}),t.props.__root),pr&&!cr&&(cr=!0,document.addEventListener("selectionchange",(()=>{const e=ke();if(e instanceof HTMLInputElement&&dr.has(e)){const t=dr.get(e);t&&function(e){clearTimeout(ir.get(e)),ir.set(e,setTimeout((()=>{var t,o,n,r;const s=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);if(s instanceof HTMLInputElement){const t=hr(e),a=t.findIndex((e=>null!==s.selectionStart?s.selectionStart>=e.start&&s.selectionStart<=e.end:null!==s.selectionEnd&&(s.selectionEnd>=e.start&&s.selectionEnd<=e.end))),l=null===(o=t[t.length-1])||void 0===o?void 0:o.end;if(0===s.selectionStart&&s.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))return;if("string"==typeof e.props.searchValue&&e.props.highlightedRange){if(t.length){const o=e.props.highlightedRange,[n,r]=vr(e,t);if(null!==s.selectionEnd&&(s.selectionEnd<n||s.selectionEnd>r)){const t=o.end-o.start-(r-n),a=s.selectionEnd;e.props.inputText=e.props.option.label,e.props.highlightedRange=void 0,e.props.searchValue=null,s.value=e.props.inputText,s.selectionStart=s.selectionEnd=a+(a>n?t:0)}}}else if(a>=0&&null!==s.selectionStart&&(l!==(null===(r=e.props.inputText)||void 0===r?void 0:r.length)||s.selectionStart<l)){const o=t[a],n=e.props.inputText.substr(0,l),r=o.start+(o.index>0?1:0),i=o.end+(t.length-1>o.index?-1:0);n!==e.props.inputText&&(e.props.inputText=n,s.value=n),e.props.highlightedRange=o,s.selectionStart=r,s.selectionEnd=i}else e.props.highlightedRange=void 0,fr(e);if(null!==s.selectionStart&&s.selectionStart>=l&&", "!==e.props.inputText.substring(l,l+2)){let t=e.props.inputText.substring(0,l);t=e.props.multiple&&e.props.max&&Array.isArray(e.props.inputStd)&&e.props.inputStd.length>=e.props.max?t:`${t},`,e.props.inputText=`${t} ${e.props.inputText.substring(l).replace(/^[,\s]{1,2}/,"")}`}}}),5))}(t)}})))}(t);const n=t.context.handlers.keydown;t.context.handlers.keydown=e=>{n(e),function(e,t){var n,r,s,a;if(["ArrowRight","ArrowLeft"].includes(t.key)&&t.target instanceof HTMLInputElement&&null!==t.target.selectionEnd&&null!==t.target.selectionStart){if(0===t.target.selectionStart&&t.target.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))"ArrowLeft"===t.key?o(0):o(-1);else if(!e.props.searchValue){e.props.searchValue=null;const o=hr(e),n=null===(r=o[o.length-1])||void 0===r?void 0:r.end;t.target.selectionStart<n&&(t.target.selectionStart=Math.max(0,"ArrowLeft"===t.key?t.target.selectionStart-2:t.target.selectionEnd+2))}}else if(["Delete","Backspace"].includes(t.key))e.props.highlightedRange&&!e.props.searchValue?(He(e,e.props.highlightedRange.option),0===e.props.inputStd.length&&(e.props.highlightedRange=void 0)):t.target instanceof HTMLInputElement&&(e.props.searchValue=null,o(-1,!0)&&t.preventDefault());else if(t.target instanceof HTMLInputElement&&0===t.target.selectionStart&&t.target.selectionEnd===(null===(s=e.props.inputText)||void 0===s?void 0:s.length)&&(null===(a=e.props.inputText)||void 0===a?void 0:a.length)&&0===e.props.selections.length)t.preventDefault();else if("Tab"===t.key)return;"ArrowLeft"===t.key&&o(-1,!0)&&t.preventDefault()}(t,e)};const r=t.context.handlers.focus;t.context.handlers.focus=e=>{r(t,e);const o=new Event("selectionchange");document.dispatchEvent(o)},t.on("blur",(()=>{t.props.selections.length?(t.props.inputText=t.props.selections.map((e=>e.label)).join(", "),t.props.searchValue=null):t.props.selections.length||(t.props.inputText="",t.props.searchValue="")}))})),t.on("prop:expanded",(({payload:e})=>{e||t.props.inputStd.length?e&&(t.props.options.length&&!t.props.alwaysLoadOnOpen||(t.props.options=[],De(t,t.props.searchValue))):(t.props.searchValue="",t.props.inputText="")})),t.on("prop:selections",(()=>{var e;const o=[...t.props.selections].map((e=>e.label)).join(", ");let n="";if(pr&&t.isCreated){const o=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`${t.props.id}`);if(ke()===o&&Array.isArray(t._value)&&t._value.length){if(t.props.max&&t._value.length>=Number(t.props.max))return;n=", "}}t.props.inputText=`${o}${n}`,t.props.reloadOnCommit&&(t.props.searchValue="",De(t,t.props.searchValue))}));const o=(e,o=!1)=>{var n,r;const s=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(`${t.props.id}`);if(!(s instanceof HTMLInputElement))return!1;const a=hr(t),l=e>=0?e:a.length-1;if(void 0===a[l])return!1;const i=null===(r=a[l])||void 0===r?void 0:r.end;return null!==s.selectionStart&&(!o||s.selectionStart>=i&&s.selectionStart<=i+2)&&(s.selectionStart=a[l].start+(l>0?1:0),s.selectionEnd=a[l].end+(l<a.length-1?-1:0),!0)};let n;t.on("selectRange",(({payload:e})=>o(...e))),t.on("prop:highlightedRange",(({payload:e})=>{t.props.hasHighlightedRange=!!e,e&&t.props.expanded&&n!==e.option&&(n=e.option,Ne(t))}))}function fr(e){var t;if(!pr)return;const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);o&&o.scrollTo({left:o.scrollWidth,behavior:"smooth"})}function vr(e,t){var o;const n=e.props.highlightedRange,r=n.index,s=n.start+(r?1:0),a=t.length-1>r?t[t.length-1].end-t[r+1].start:0;return[s,(null===(o=e.props.inputText)||void 0===o?void 0:o.length)-a+(t.length-1>n.index?-1:0)]}function hr(e){const t=Be(e);return Array.isArray(t)&&t.length?t.reduce(((e,o,n)=>{var r;const s=(null===(r=e[n-1])||void 0===r?void 0:r.end)||0;let a=0;return t.length-1!==n&&a++,0!==n&&a++,e.push({option:o,index:n,start:s,end:s+o.label.length+a}),e}),[]):[]}function mr(e){!function(e){e.on("prop:expanded",(({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],De(e,e.props.searchValue,!0))):(e.props.searchValue="",e.props.inputText="")}))}(e),function(e){e.on("handleSearchInput",(({payload:t})=>{t&&!e.props.expanded?(e.props.searchExpand=!0,e.props.expanded=!0):!t&&e.props.expanded&&(e.props.expanded=!1),e.props.searchValue=e.props.inputText}))}(e),function(e){e.on("prop:selections",(()=>{e.isCreated&&(e.props.inputText="",e.props.searchValue="",e.props.optionRemoved||e.props.reloadOnCommit&&De(e,e.props.searchValue,!0))}))}(e)}function gr(e){!function(e){function t(e){0===e.props.inputStd.length?(e.props.inputText="",e.props.searchValue=""):(e.props.inputText=e.props.selections[0].label,e.props.searchValue=e.props.selections[0].label)}function o(e){e.props.clearSearchOnOpen&&!e.props.searchExpand&&(e.props.inputText="",e.props.searchValue=""),e.props.searchValue=e.props.inputText,e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],De(e,e.props.searchValue,!0)),e.props.searchExpand&&(e.props.searchExpand=!1)}e.on("prop:expanded",(({payload:n})=>{n?o(e):t(e)}))}(e),function(e){e.on("handleSearchInput",(({payload:t})=>{""===t?(0===e.props.inputStd.length&&(e.props.expanded=!1),e.input(void 0)):t&&!e.props.expanded&&(e.props.searchExpand=!0,e.props.expanded=!0),e.props.searchValue=e.props.inputText}))}(e),function(e){e.on("prop:selections",(({payload:t})=>{e.props.inputText=t.length?t[0].label:"",e.props.searchValue=t.length?t[0].label:"",e.isCreated&&e.props.expanded&&0===t.length&&De(e,e.props.searchValue,!0)}))}(e)}function $r(t){if(t.props.multiple)if(t.props.multiple&&"option"===t.props.selectionAppearance){function o(){return Array.isArray(t.value)?t.value:[]}function r(e){t.input(e)}mr(t),t.on("created",(()=>{t.props.disabled&&(t.props.draggable=!1),e.whenAvailable(`${t.props.id}_selections`,(e=>{if(e instanceof HTMLElement&&t.context){const s={draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,root:t.props.__root,disabled:!t.props.draggable,plugins:[n.animations()],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-selection")};n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s}),t.on("prop:disabled",(({payload:t})=>{s.disabled=t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})})),t.on("prop:draggable",(({payload:t})=>{s.disabled=!t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})}))}}),t.props.__root)}))}else t.props.multiple&&"text-input"===t.props.selectionAppearance&&ur(t);else gr(t)}const br={schema:/* #__PURE__ */Fn(/* #__PURE__ */Pn(/* #__PURE__ */Rn("$label"),/* #__PURE__ */Bn(/* #__PURE__ */Hn("prefix"),/* #__PURE__ */Nn(),/* #__PURE__ */zn(),/* #__PURE__ */U("$multiple !== true && $selectionAppearance === option && $expanded === false",/* #__PURE__ */Gn(/* #__PURE__ */jn(/* #__PURE__ */Zn(/* #__PURE__ */Qn(/* #__PURE__ */U("$state.loading",/* #__PURE__ */Jn("$ui.isLoading.value"),"$option.label"))),/* #__PURE__ */U("$state.loading && $isSingleOption !== true && $optionLoaderValues.includes($option.value)",/* #__PURE__ */Hn("loader")),/* #__PURE__ */U("$selectionRemovable && $isSingleOption",/* #__PURE__ */Xn(/* #__PURE__ */Hn("close")))))),/* #__PURE__ */U("$state.loading && ($isSingleOption !== true || $selections.length === 0)",/* #__PURE__ */Hn("loader")),/* #__PURE__ */U('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',/* #__PURE__ */Xn(/* #__PURE__ */Hn("close")),/* #__PURE__ */U('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',/* #__PURE__ */Yn(/* #__PURE__ */Hn("select")))),/* #__PURE__ */U("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $optionLoaderValues.length > 0)",/* #__PURE__ */Yn(/* #__PURE__ */Hn("select"))),/* #__PURE__ */er(),/* #__PURE__ */Kn(),/* #__PURE__ */Hn("suffix")),/* #__PURE__ */U("$multiple && $selectionAppearance === option",/* #__PURE__ */Gn(/* #__PURE__ */jn(/* #__PURE__ */Zn(/* #__PURE__ */Qn(/* #__PURE__ */U("$state.loading && $fns.hasOptionLoaderValue($option)",/* #__PURE__ */Jn("$ui.isLoading.value"),"$option.label"))),/* #__PURE__ */Xn(/* #__PURE__ */Hn("close")))))),/* #__PURE__ */Wn("$help"),/* #__PURE__ */qn(/* #__PURE__ */Un("$message.value"))),type:"input",family:"dropdown",props:[],features:[
19
+ /* #__PURE__ */o.defaultIcon("moveDown","arrowDown")]},on=new WeakMap;function nn(e,t){const o={onItems:[],offItems:[]},n=t||Number(e.value||0);for(let t=0;t<e.props.max;t++)if(t<n&&t+1>=n){const r=e.props.rightToLeft?100-100*(n-t):100*(n-t);o.onItems.push(r+"%"),o.offItems.push(100-r+"%")}else t<n?(o.offItems.push("0%"),o.onItems.push("100%")):t>=n&&(o.offItems.push("100%"),o.onItems.push("0%"));e.props.itemsToPercentages=o}function rn(e,t){var o;null===(o=e.context)||void 0===o||o.handlers.blur(t)}function sn(e,t){const{x:o,y:n}=hn(t);let r=document.elementFromPoint(o,n);const s=Array.from(document.querySelectorAll(`#${e.props.id}_items_wrapper > .formkit-ratingItem`));let a=!0;for(;r&&a;){if(s.includes(r)){a=!1;break}r=r.parentNode}if(!a){const t=s.indexOf(r);if(1===e.props.step)return void e.input(t+1,!1)}}function an(e,t,o){e.props.disabled||(o.preventDefault(),e.props.hoverHighlight=!0,e.props.touchStarted=!0,1!==e.props.step?mn(e,t,o):e.input(t+1,!1))}function ln(e,t){if(!e.props.dragStarted)return;t.preventDefault(),e.props.hoverHighlight=!1,e.props.dragStarted=!1,nn(e);const o=on.get(e);o&&(o.abort(),on.delete(e))}function pn(e,t,o){if(e.props.hoverHighlight||e.props.disabled)return;o.preventDefault(),e.props.hoverHighlight=!0,e.props.dragStarted=!0;const n=new AbortController;document.addEventListener("mouseup",t=>ln(e,t),{signal:n.signal}),on.set(e,n),1===e.props.step?e.input(t+1,!1):mn(e,t,o)}function dn(e,t){var o,n;if(document.activeElement===t.currentTarget)if("ArrowRight"===t.key||"ArrowDown"===t.key){e.props.arrow=1;const t=e.value?gn(e.value+1*e.props.step,e.props.step):e.props.min+1*e.props.step,n=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(e.value?`#${e.props.id}_inner input[value="${t}"]`:"#"+(e.props.id+"_0_0"));e.props.preventFocus=!0,n&&n instanceof HTMLInputElement&&n.focus(),e.props.preventFocus=!1,e.input(Number(t))}else if("ArrowLeft"===t.key||"ArrowUp"===t.key){e.props.arrow=-1;const t=e.value?gn(e.value-1*e.props.step,e.props.step):e.props.max,o=null===(n=e.props.__root)||void 0===n?void 0:n.querySelector(`#${e.props.id}_inner input[value="${t}"]`);e.props.preventFocus=!0,o&&o instanceof HTMLInputElement&&o.focus(),e.props.preventFocus=!0,e.input(Number(t)),e.props.preventFocus=!1}}function cn(e,t){if(!e.props.preventFocus)if(e.props.preventFocus=!0,setTimeout(()=>{e.props.preventFocus=!1},50),t.relatedTarget instanceof HTMLElement&&t.relatedTarget.id===e.props.id+"_items_wrapper")e.props.arrow>0?setTimeout(()=>{var t,o;null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+"_0_0"))||void 0===o||o.focus()}):e.props.arrow<0&&setTimeout(()=>{var t,o;null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+`_${e.props.max-1}_${e.props.stepsPerValue-1}`))||void 0===o||o.focus()});else if(t.target instanceof HTMLInputElement){if(Number(t.target.value)===e.props.step&&e.value===e.props.max||Number(t.target.value)===e.props.max&&e.value===e.props.step){const t=document.getElementById(e.props.id+"_items_wrapper");return null==t||t.focus(),void e.input(0)}e.input(Number(t.target.value))}}function un(e,t,o){e.props.hoverHighlight&&(e.props.disabled||(1===e.props.step?(nn(e,t+1),e.props.dragStarted&&e.input(t+1,!1)):mn(e,t,o,!!e.props.dragStarted)))}function fn(e){nn(e)}function vn(e,t,o){if(!e.props.disabled&&"touchstart"!==o.type&&(o.preventDefault(),(0!==o.clientX||0!==o.clientY)&&o.currentTarget instanceof HTMLElement))return 1===e.props.step?e.props.deselect&&Number(e.value)===t+1?void e.input(0):void e.input(t+1):void mn(e,t,o)}function hn(e){return e instanceof MouseEvent?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}}function mn(e,t,o,n=!0){if(!(o.currentTarget instanceof HTMLElement))return;const{x:r,y:s}=hn(o),a=o.currentTarget.getBoundingClientRect();let l=gn((r-a.x)/a.width+t,e.props.step);l=l>e.props.min?l:e.props.min,l=l<e.props.max?l:e.props.max,!e.props.deselect||l!==Number(e.value)||e.props.dragStarted?n?e.input(l,!1):nn(e,l):e.input(0)}function gn(e,t){t||(t=1);const o=1/t;return Math.ceil(e*o)/o}const $n=/* #__PURE__ */K("rt"),{outer:bn,wrapper:yn,inner:xn,label:wn,prefix:_n,suffix:kn,help:Sn,messages:Ln,message:In,icon:Dn}=/* #__PURE__ */W($n),An=$n("itemsWrapper",()=>({$el:"span",attrs:{style:{"flex-direction":'$rightToLeft && "row-reverse" || undefined'},tabindex:"$value !== undefined && $value !== 0 && '-1' || '0'",id:"$id + _items_wrapper",onKeydown:"$handlers.handleWrapperKeydown","data-disabled":"$disabled",onBlur:"$handlers.handleWrapperBlur",onMouseleave:"$hoverHighlight && $handlers.handleMouseleave"}})),Cn=$n("ratingItem",()=>({for:["item","index","$max"],$el:"span",attrs:{id:'$id + "_item_" + $index',onClick:"$handlers.handleItemClick($item)",draggable:"$hoverHighlight !== true && && $disabled !== true && true",onMousemove:"$handlers.handleMousemove($item)",onDragstart:"$handlers.handleDragstart($item)",onDragend:"$handlers.handleDragend",onTouchstartPassive:"$handlers.handleTouchstart($item)",onTouchmovePassive:"$handlers.handleTouchmove"}})),Tn=$n("template",()=>({for:["increment","stepIndex","$stepsPerValue"],$el:null})),En=$n("itemLabel",()=>({$el:"label",attrs:{id:'$id + "_label_" + $index + "_" + $stepIndex',for:'$id + "_" + $index + "_" + $stepIndex',"data-checked":'$value === $fns.getValue($item, $increment) && "true" || "false"',style:{width:'$fns.showLabel($fns.getValue($item, $increment), $stepIndex, $item) && "100%" || "0%"'}}})),On=$n("itemLabelInner",()=>({$el:"span",children:"$fns.getValue($item, $increment)"})),Mn=$n("input",()=>({$el:"input",attrs:{type:"radio",value:"$fns.getValue($item, $increment)",id:'$id + "_" + $index + "_" + $stepIndex',onFocus:"$handlers.handleFocus",tabindex:'$value === $fns.getValue($item, $increment) && "0" || "-1"',disabled:"$disabled",name:"$id","data-value":"$fns.getValue($item, $increment)",checked:"$value === $fns.getValue($item, $increment) && true",onKeydown:"$handlers.handleKeydown($fns.getValue($item, $increment))"}})),Vn=$n("onItemRow",()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item)",display:"flex",position:"relative",overflow:"hidden",top:"0",left:"0",bottom:"0"}}})),Fn=$n("offItemRow",()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item, false)",display:"flex","flex-direction":"row-reverse",position:"absolute",zIndex:"$offItemStyles && 100",overflow:"hidden",top:"0",right:"0"}}})),Pn=$n("onItemWrapper",()=>({$el:"div",attrs:{style:{color:"$onColor"}}})),Bn=$n("offItemWrapper",()=>({$el:"div",attrs:{style:{color:"$offColor"}}})),Hn=()=>z("$slots.onItem",()=>()=>"$slots.onItem",z("$slots.default",()=>()=>"$slots.default",Dn("rating"))),Rn=()=>z("$slots.offItem",()=>()=>"$slots.offItem",z("$slots.default",()=>()=>"$slots.default",Dn("rating"))),Nn={schema:/* #__PURE__ */bn(/* #__PURE__ */yn(/* #__PURE__ */wn("$label"),/* #__PURE__ */xn(/* #__PURE__ */Dn("prefix"),/* #__PURE__ */_n(),/* #__PURE__ */An(/* #__PURE__ */Cn(/* #__PURE__ */Tn(/* #__PURE__ */En(/* #__PURE__ */Vn(/* #__PURE__ */Pn(/* #__PURE__ */Hn())),/* #__PURE__ */Fn(/* #__PURE__ */Bn(/* #__PURE__ */Rn())),/* #__PURE__ */On()),/* #__PURE__ */Mn()))),/* #__PURE__ */kn(),/* #__PURE__ */Dn("suffix"))),/* #__PURE__ */Sn("$help"),/* #__PURE__ */Ln(/* #__PURE__ */In("$message.value"))),type:"input",props:[],features:[function(t){function o(e){setTimeout(()=>{const t=Array.from(document.querySelectorAll(`#${e.props.id}_items_wrapper > .formkit-ratingItem`));for(let e=0;e<t.length;e++){const o=t[e].querySelectorAll(".formkit-onItemWrapper"),n=t[e].querySelectorAll(".formkit-offItemWrapper");for(let n=0;n<o.length;n++)o[n].style.flex=`0 0 ${t[e].getBoundingClientRect().width}px`;for(let o=0;o<n.length;o++)n[o].style.flex=`0 0 ${t[e].getBoundingClientRect().width}px`}})}t.addProps(["max","step","stepsPerValue","itemsToPercentages","rightToLeft","onItemStyles","offItemStyles","hoverHighlight","deselect","disabled","wrapperWidth","onColor","offColor"]),!1!==t.props.hoverHighlight&&"false"!==t.props.hoverHighlight&&(t.props.hoverHighlight=!0),t.props.deselect=e.undefine(t.props.deselect),t.props.max=Number(t.props.max)||5,t.props.min=Number(t.props.min)||0,t.props.step=Number(t.props.step)||1,t.props.numberOfSteps=t.props.max/t.props.step,t.props.lastIndex=1/t.props.step-1,t.props.itemsToPercentages={},"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.props.rightToLeft?(t.props.onItemStyles=void 0,t.props.offItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%",zIndex:100}):t.props.onItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%"},t.props.stepsPerValue=1/t.props.step,t.hook.input((e,o)=>{if(null===e||""===e||isNaN(e))return o(e);const n=Number(e),r=Number(t.props.min),s=Number(t.props.max);return n>s?o(s):t.props.min&&n<=r?o(r):o(n)}),t.on("commit",({payload:e})=>{const o=Number(e||0);nn(t,o)}),t.on("created",()=>{t.context&&(e.whenAvailable(`${t.props.id}_items_wrapper`,()=>{o(t),function(e){var t;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_items_wrapper`);if(!n)return;new ResizeObserver(()=>{o(e)}).observe(n)}(t),setTimeout(()=>o(t),100)},t.props.__root),t.context.fns.getPercentage=(e,t,o=!0)=>(o?e.onItems:e.offItems)[t],t.context.fns.getValue=(e,o)=>e+Number((o*t.props.step+t.props.step).toFixed(1)),t.context.fns.showLabel=(e,o)=>{const n=Number(t.value||0);return 0===n&&0===o||n&&e===n||e>n&&0===o||n>e&&o===t.props.lastIndex},t.context.handlers.handleFocus=e=>cn.call(null,t,e),t.context.handlers.handleWrapperKeydown=e=>dn.call(null,t,e),t.context.handlers.handleWrapperBlur=e=>rn.call(null,t,e),t.context.handlers.handleItemClick=e=>o=>vn.call(null,t,e,o),t.context.handlers.handleMousemove=e=>o=>un.call(null,t,e,o),t.context.handlers.handleMouseleave=()=>fn.call(null,t),t.context.handlers.handleDragstart=e=>o=>pn.call(null,t,e,o),t.context.handlers.handleMouseup=e=>ln.call(null,t,e),t.context.handlers.handleTouchstart=e=>o=>an.call(null,t,e,o),t.context.handlers.handleTouchmove=e=>sn.call(null,t,e),t.context.handlers.handleKeydown=e=>o=>function(e,t,o){const n=Number(e.value);e.props.deselect&&" "===o.key&&n===t?e.input(0):" "===o.key&&e.input(t)}(t,e,o))})},/* #__PURE__ */o.defaultIcon("rating","star")]},Kn=/* #__PURE__ */K("ac"),{outer:Wn,wrapper:qn,inner:zn,icon:Un,label:Yn,prefix:jn,suffix:Zn,help:Gn,messages:Xn,message:Jn}=/* #__PURE__ */W(Kn),Qn=Kn("input",()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",onFocus:"$handlers.focus",value:"$inputText || undefined",name:"$node.name",placeholder:"$state.loading && $ui.isLoading.value || $placeholder || undefined",tabindex:'$disabled && "-1" || 0',role:"combobox",autocomplete:'$attrs.autocomplete || "off"',autocapitalize:"none",readonly:"$attrs.readonly || $state.loading || $multiple && $max && $value && $value.length >= $max && $hasHighlightedRange !== true || undefined","data-selection-appearance":"$selectionAppearance",disabled:"$disabled || $disabledInternally || undefined",onTouchmovePassive:"$handlers.touchmove",onTouchstartPassive:"$handlers.touchmove",onTouchend:"$handlers.touchend","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined","aria-required":"$state.required || undefined"}})),er=Kn("listboxButton",()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',role:"button","aria-label":"$expanded && $ui.close.value || $ui.open.value",onClick:"$handlers.toggleListbox",onKeydown:"$handlers.toggleListboxKeydown",tabindex:'$disabled && "-1" || 0',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-disabled":"$disabled || $state.loading || undefined","data-disabled":"$disabled || $disabledInternally || undefined"}})),tr=Kn("selectionWrapper",()=>({for:["option","index","$selections"],$el:"div",attrs:{id:'$id + "_selection_wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:'$disabled && "-1" || 0',onKeydown:"$handlers.selectionKeydown && $handlers.selectionKeydown($multiple && $option || undefined)",onClick:"$handlers.selectionClick && $handlers.selectionClick($multiple && $option || undefined)",onFocus:"$handlers.selectionFocus && $handlers.selectionFocus($multiple && $option || undefined)",onBlur:"$handlers.selectionBlur && $handlers.selectionBlur($multiple && $option || undefined)","data-is-selection":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}})),or=Kn("selection",()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}})),nr=Kn("selections",()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}})),rr=Kn("removeSelection",()=>({$el:"button",attrs:{id:'$selectionAppearance === "option" && $multiple && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"0",title:"$ui.remove.value",type:"button","aria-label":"$ui.remove.value",onClick:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)",onTouchend:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)","aria-controls":"$id"}})),sr=Kn("optionLoading","span"),ar=Kn("option",()=>({$el:"div",if:"$value !== undefined"})),lr=/* #__PURE__ */U(Kn);function ir(t){"option"!==t.props.selectionAppearance||t.props.multiple||!1===t.props.selectionRemovable||"false"===t.props.selectionRemovable||(t.props.selectionRemovable=!0),t.props.multiple||(t.props.clearSearchOnOpen=e.undefine(t.props.clearSearchOnOpen)),t.props.selectionRemovable=e.undefine(t.props.selectionRemovable),t.props.openOnClick=e.undefine(t.props.openOnClick),"option"!==t.props.selectionAppearance||t.props.multiple||(t.props.isSingleOption=!0),void 0===t.props.closeOnSelect&&(t.props.closeOnSelect=!0),void 0===t.props.selectionAppearance&&(t.props.selectionAppearance="text-input"),void 0===t.props.closeOnSelect&&(t.props.closeOnSelect=!0),t.props.closeOnSelect?t.props.resetSearchOnCommit=!1:void 0===t.props.resetSearchOnCommit&&(t.props.resetSearchOnCommit=t.props.multiple),t.props.allowNewValues=e.undefine(t.props.allowNewValues)}function pr(t){t.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter","hasHighlightedRange","clearOnClick","debounce"]),void 0===t.props.debounce?t.props.debounce=200:t.props.debounce=parseInt(t.props.debounce),t.props.nonceKey="searchValue",t.props.searchValue="",t.props.inputText="",t.props.filterOptions=Ve.bind(null,t),t.props.reloadOnCommit=e.undefine(t.props.reloadOnCommit),void 0===t.props.alwaysLoadOnOpen?t.props.alwaysLoadOnOpen=!0:t.props.alwaysLoadOnOpen=e.undefine(t.props.alwaysLoadOnOpen),"function"!=typeof t.props.filter&&(t.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),t.on("created",()=>{t.context&&c&&(t.context.handlers.focus=ur.bind(null,t),t.context.handlers.input=dr.bind(null,t),t.context.handlers.focus=ur.bind(null,t),t.context.handlers.click=cr.bind(null,t),t.context.handlers.toggleListbox=fr.bind(null,t),t.context.handlers.toggleListboxKeydown=vr.bind(null,t),t.context.handlers.keydown=Et.bind(null,t),t.context.handlers.selectionKeydown=e=>o=>Ct(t,e,o),t.context.handlers.searchInputTagKeydown=e=>o=>function(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":kt(e);break;case"ArrowRight":case"ArrowLeft":St(e,t,o);break;case"Delete":case"Backspace":Lt(e,t,o)}}(t,e,o),t.on("prop:options",({payload:e})=>{if((0===t.props.initialOptions.length&&"function"!=typeof t.props.optionsLoader||!t.props.searchValue&&e.length)&&(t.props.initialOptions=[...e]),t.props.selections&&t.props.selections.length&&e.length)for(let o=0;o<t.props.selections.length;o++){const n=t.props.selections[o],r=e.find(e=>Se(e)===n.value);r&&(t.props.selections[o]=r)}}))}),t.on("prop:expanded",({payload:e})=>{e||Ee.delete(t)})}function dr(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&Ve(e,e.props.searchValue,!0)}function cr(e,t){t.stopPropagation(),e.props.disabled||e.props.disabledInternally||(e.props.attrs.onClick&&e.props.attrs.onClick(t),(!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0))}function ur(e){e.props.disabled||e.props.disabledInternally||(e.props.attrs.onFocus&&e.props.attrs.onFocus(),e.props.activeSelectionValue=void 0,e.props.skipOpen?e.props.skipOpen=!1:e.props.openOnFocus&&(e.props.expanded=!0))}function fr(e){var t,o,n;e.props.disabled||e.props.disabledInternally||(null===(t=e.context)||void 0===t?void 0:t.state.loading)||(e.props.expanded=!e.props.expanded,e.props.openOnFocus||null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus())}function vr(e,t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),fr(e))}const hr=new WeakMap,mr="undefined"!=typeof window,gr=new WeakMap;let $r=!1;function br(t){t.props.searchValue=null,t.on("commit",()=>{t.props.searchValue=null,t.props.highlightedRange||yr(t)}),t.on("created",()=>{if(!t.context||!mr)return;t.on("handleSearchInput",({payload:e})=>{""===e?(t.props.searchValue=null,t.input([])):e&&0===t.props.inputStd.length?t.props.searchValue=e:e&&t.props.inputStd.length>0&&(t.props.searchValue=function(e){var t;const o=wr(e);if(e.props.highlightedRange){const[t,n]=xr(e,o);return e.props.inputText.slice(t,n)}return e.props.inputText.slice((null===(t=o[o.length-1])||void 0===t?void 0:t.end)+2)}(t)),!t.props.expanded&&e?t.props.expanded=!0:!e&&t.props.expanded&&(t.props.expanded=!1)}),function(t){e.whenAvailable(`${t.props.id}`,e=>{e instanceof HTMLInputElement&&gr.set(e,t)},t.props.__root),mr&&!$r&&($r=!0,document.addEventListener("selectionchange",()=>{const e=ke();if(e instanceof HTMLInputElement&&gr.has(e)){const t=gr.get(e);t&&function(e){clearTimeout(hr.get(e)),hr.set(e,setTimeout(()=>{var t,o,n,r;const s=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);if(s instanceof HTMLInputElement){const t=wr(e),a=t.findIndex(e=>null!==s.selectionStart?s.selectionStart>=e.start&&s.selectionStart<=e.end:null!==s.selectionEnd&&(s.selectionEnd>=e.start&&s.selectionEnd<=e.end)),l=null===(o=t[t.length-1])||void 0===o?void 0:o.end;if(0===s.selectionStart&&s.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))return;if("string"==typeof e.props.searchValue&&e.props.highlightedRange){if(t.length){const o=e.props.highlightedRange,[n,r]=xr(e,t);if(null!==s.selectionEnd&&(s.selectionEnd<n||s.selectionEnd>r)){const t=o.end-o.start-(r-n),a=s.selectionEnd;e.props.inputText=e.props.option.label,e.props.highlightedRange=void 0,e.props.searchValue=null,s.value=e.props.inputText,s.selectionStart=s.selectionEnd=a+(a>n?t:0)}}}else if(a>=0&&null!==s.selectionStart&&(l!==(null===(r=e.props.inputText)||void 0===r?void 0:r.length)||s.selectionStart<l)){const o=t[a],n=e.props.inputText.substr(0,l),r=o.start+(o.index>0?1:0),i=o.end+(t.length-1>o.index?-1:0);n!==e.props.inputText&&(e.props.inputText=n,s.value=n),e.props.highlightedRange=o,s.selectionStart=r,s.selectionEnd=i}else e.props.highlightedRange=void 0,yr(e);if(null!==s.selectionStart&&s.selectionStart>=l&&", "!==e.props.inputText.substring(l,l+2)){let t=e.props.inputText.substring(0,l);t=e.props.multiple&&e.props.max&&Array.isArray(e.props.inputStd)&&e.props.inputStd.length>=e.props.max?t:`${t},`,e.props.inputText=`${t} ${e.props.inputText.substring(l).replace(/^[,\s]{1,2}/,"")}`}}},5))}(t)}}))}(t);const n=t.context.handlers.keydown;t.context.handlers.keydown=e=>{n(e),function(e,t){var n,r,s,a;if(["ArrowRight","ArrowLeft"].includes(t.key)&&t.target instanceof HTMLInputElement&&null!==t.target.selectionEnd&&null!==t.target.selectionStart){if(0===t.target.selectionStart&&t.target.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))"ArrowLeft"===t.key?o(0):o(-1);else if(!e.props.searchValue){e.props.searchValue=null;const o=wr(e),n=null===(r=o[o.length-1])||void 0===r?void 0:r.end;t.target.selectionStart<n&&(t.target.selectionStart=Math.max(0,"ArrowLeft"===t.key?t.target.selectionStart-2:t.target.selectionEnd+2))}}else if(["Delete","Backspace"].includes(t.key))e.props.highlightedRange&&!e.props.searchValue?(Ue(e,e.props.highlightedRange.option),0===e.props.inputStd.length&&(e.props.highlightedRange=void 0)):t.target instanceof HTMLInputElement&&(e.props.searchValue=null,o(-1,!0)&&t.preventDefault());else if(t.target instanceof HTMLInputElement&&0===t.target.selectionStart&&t.target.selectionEnd===(null===(s=e.props.inputText)||void 0===s?void 0:s.length)&&(null===(a=e.props.inputText)||void 0===a?void 0:a.length)&&0===e.props.selections.length)t.preventDefault();else if("Tab"===t.key)return;"ArrowLeft"===t.key&&o(-1,!0)&&t.preventDefault()}(t,e)};const r=t.context.handlers.focus;t.context.handlers.focus=e=>{r(t,e);const o=new Event("selectionchange");document.dispatchEvent(o)},t.on("blur",()=>{t.props.selections.length?(t.props.inputText=t.props.selections.map(e=>e.label).join(", "),t.props.searchValue=null):t.props.selections.length||(t.props.inputText="",t.props.searchValue="")})}),t.on("prop:expanded",({payload:e})=>{e||t.props.inputStd.length?e&&(t.props.options.length&&!t.props.alwaysLoadOnOpen||(t.props.options=[],Ve(t,t.props.searchValue))):(t.props.searchValue="",t.props.inputText="")}),t.on("prop:selections",()=>{var e;const o=[...t.props.selections].map(e=>e.label).join(", ");let n="";if(mr&&t.isCreated){const o=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`${t.props.id}`);if(ke()===o&&Array.isArray(t._value)&&t._value.length){if(t.props.max&&t._value.length>=Number(t.props.max))return;n=", "}}t.props.inputText=`${o}${n}`,t.props.reloadOnCommit&&(t.props.searchValue="",Ve(t,t.props.searchValue))});const o=(e,o=!1)=>{var n,r;const s=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(`${t.props.id}`);if(!(s instanceof HTMLInputElement))return!1;const a=wr(t),l=e>=0?e:a.length-1;if(void 0===a[l])return!1;const i=null===(r=a[l])||void 0===r?void 0:r.end;return null!==s.selectionStart&&(!o||s.selectionStart>=i&&s.selectionStart<=i+2)&&(s.selectionStart=a[l].start+(l>0?1:0),s.selectionEnd=a[l].end+(l<a.length-1?-1:0),!0)};let n;t.on("selectRange",({payload:e})=>o(...e)),t.on("prop:highlightedRange",({payload:e})=>{t.props.hasHighlightedRange=!!e,e&&t.props.expanded&&n!==e.option&&(n=e.option,je(t))})}function yr(e){var t;if(!mr)return;const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);o&&o.scrollTo({left:o.scrollWidth,behavior:"smooth"})}function xr(e,t){var o;const n=e.props.highlightedRange,r=n.index,s=n.start+(r?1:0),a=t.length-1>r?t[t.length-1].end-t[r+1].start:0;return[s,(null===(o=e.props.inputText)||void 0===o?void 0:o.length)-a+(t.length-1>n.index?-1:0)]}function wr(e){const t=ze(e);return Array.isArray(t)&&t.length?t.reduce((e,o,n)=>{var r;const s=(null===(r=e[n-1])||void 0===r?void 0:r.end)||0;let a=0;return t.length-1!==n&&a++,0!==n&&a++,e.push({option:o,index:n,start:s,end:s+o.label.length+a}),e},[]):[]}function _r(e){!function(e){e.on("prop:expanded",({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],Ve(e,e.props.searchValue,!0))):(e.props.searchValue="",e.props.inputText="")})}(e),function(e){e.on("handleSearchInput",({payload:t})=>{t&&!e.props.expanded?(e.props.searchExpand=!0,e.props.expanded=!0):!t&&e.props.expanded&&(e.props.expanded=!1),e.props.searchValue=e.props.inputText})}(e),function(e){e.on("prop:selections",()=>{e.isCreated&&(e.props.inputText="",e.props.searchValue="",e.props.optionRemoved||e.props.reloadOnCommit&&Ve(e,e.props.searchValue,!0))})}(e)}function kr(e){!function(e){function t(e){0===e.props.inputStd.length?(e.props.inputText="",e.props.searchValue=""):(e.props.inputText=e.props.selections[0].label,e.props.searchValue=e.props.selections[0].label)}function o(e){e.props.clearSearchOnOpen&&!e.props.searchExpand&&(e.props.inputText="",e.props.searchValue=""),e.props.searchValue=e.props.inputText,e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],Ve(e,e.props.searchValue,!0)),e.props.searchExpand&&(e.props.searchExpand=!1)}e.on("prop:expanded",({payload:n})=>{n?o(e):t(e)})}(e),function(e){e.on("handleSearchInput",({payload:t})=>{""===t?(0===e.props.inputStd.length&&(e.props.expanded=!1),e.input(void 0)):t&&!e.props.expanded&&(e.props.searchExpand=!0,e.props.expanded=!0),e.props.searchValue=e.props.inputText})}(e),function(e){e.on("prop:selections",({payload:t})=>{e.props.inputText=t.length?t[0].label:"",e.props.searchValue=t.length?t[0].label:"",e.isCreated&&e.props.expanded&&0===t.length&&Ve(e,e.props.searchValue,!0)})}(e)}function Sr(t){if(t.props.multiple)if(t.props.multiple&&"option"===t.props.selectionAppearance){function o(){return Array.isArray(t.value)?t.value:[]}function r(e){t.input(e)}_r(t),t.on("created",()=>{t.props.disabled&&(t.props.draggable=!1),e.whenAvailable(`${t.props.id}_selections`,e=>{if(e instanceof HTMLElement&&t.context){const s={draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,root:t.props.__root,disabled:!t.props.draggable,plugins:[n.animations()],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-selection")};n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s}),t.on("prop:disabled",({payload:t})=>{s.disabled=t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})}),t.on("prop:draggable",({payload:t})=>{s.disabled=!t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})})}},t.props.__root)})}else t.props.multiple&&"text-input"===t.props.selectionAppearance&&br(t);else kr(t)}const Lr={schema:/* #__PURE__ */Wn(/* #__PURE__ */qn(/* #__PURE__ */Yn("$label"),/* #__PURE__ */zn(/* #__PURE__ */Un("prefix"),/* #__PURE__ */jn(),/* #__PURE__ */Qn(),/* #__PURE__ */z("$multiple !== true && $selectionAppearance === option && $expanded === false",/* #__PURE__ */nr(/* #__PURE__ */tr(/* #__PURE__ */or(/* #__PURE__ */ar(/* #__PURE__ */z("$state.loading",/* #__PURE__ */sr("$ui.isLoading.value"),"$option.label"))),/* #__PURE__ */z("$state.loading && $isSingleOption !== true && $optionLoaderValues.includes($option.value)",/* #__PURE__ */Un("loader")),/* #__PURE__ */z("$selectionRemovable && $isSingleOption",/* #__PURE__ */rr(/* #__PURE__ */Un("close")))))),/* #__PURE__ */z("$state.loading && ($isSingleOption !== true || $selections.length === 0)",/* #__PURE__ */Un("loader")),/* #__PURE__ */z('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',/* #__PURE__ */rr(/* #__PURE__ */Un("close")),/* #__PURE__ */z('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',/* #__PURE__ */er(/* #__PURE__ */Un("select")))),/* #__PURE__ */z("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $optionLoaderValues.length > 0)",/* #__PURE__ */er(/* #__PURE__ */Un("select"))),/* #__PURE__ */lr(),/* #__PURE__ */Zn(),/* #__PURE__ */Un("suffix")),/* #__PURE__ */z("$multiple && $selectionAppearance === option",/* #__PURE__ */nr(/* #__PURE__ */tr(/* #__PURE__ */or(/* #__PURE__ */ar(/* #__PURE__ */z("$state.loading && $fns.hasOptionLoaderValue($option)",/* #__PURE__ */sr("$ui.isLoading.value"),"$option.label"))),/* #__PURE__ */rr(/* #__PURE__ */Un("close")))))),/* #__PURE__ */Gn("$help"),/* #__PURE__ */Xn(/* #__PURE__ */Jn("$message.value"))),type:"input",family:"dropdown",props:[],features:[
20
20
  /* #__PURE__ */o.defaultIcon("select","select"),
21
21
  /* #__PURE__ */o.defaultIcon("close","close"),
22
22
  /* #__PURE__ */o.defaultIcon("selected","check"),
@@ -26,7 +26,7 @@
26
26
  /* #__PURE__ */o.localize("remove"),
27
27
  /* #__PURE__ */o.localize("open"),
28
28
  /* #__PURE__ */o.localize("close"),o.options,
29
- /* #__PURE__ */ut.bind(null,tr,or,$r),jt]},yr=/* #__PURE__ */K("dp"),{outer:xr,wrapper:wr,inner:_r,icon:kr,label:Sr,prefix:Lr,suffix:Ir,help:Dr,messages:Ar,message:Cr}=/* #__PURE__ */W(yr),Tr=yr("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",id:"$id",onKeydown:"$handlers.inputKeydown",value:"$inputText",onInput:"$handlers.dateInput",onClick:"$pickerOnly && $handlers.open",onBlur:"$handlers._blur",onFocus:"$handlers.focus",readonly:"$pickerOnly || $expanded",disabled:"$disabled"}}))),Er=yr("panelWrapper",(()=>({$el:"div",if:"$expanded",attrs:{id:'$id + "_popover"',role:"dialog",onBlur:"$handlers._blurOut()",tabindex:"-1",popover:"$popover","aria-modal":"true","aria-label":"Choose date","data-panel":"$panel",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"',width:'$popoverCoordinates.width + "px"'}}}}))),Or=yr("next",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}}))),Mr=yr("nextLabel","span"),Vr=yr("prev",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}}))),Fr=yr("prevLabel","span"),Pr=yr("calendar",(()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}}))),Br=yr("calendarWeeks",(()=>({$el:"tbody"}))),Hr=yr("calendarHeader",(()=>({$el:"thead"}))),Rr=yr("weekDays",(()=>({$el:"tr"}))),Nr=yr("weekDay",(()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}}))),Kr=yr("week",(()=>({$el:"tr",for:["week","weekIndex","$month.weeks"]}))),Wr=yr("dayCell",(()=>({$el:"td",for:["day","dayIndex","$week"],attrs:{key:"$day",onClick:"$handlers.setDate($day)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($day)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(day)",tabindex:'$fns.sameDay($day) && "0" || "-1"',"data-is-extra":"$fns.notInMonth($month.monthDay, $day)","data-disabled":"$fns.isDisabled($day)","aria-selected":"$selectedWeek === $weekIndex && $selectedDay === $dayIndex","aria-label":'$fns.format($day, "long")'}}))),qr=yr("day","div"),Ur=yr("openButton",(()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"div",role:"button",onClick:"$handlers.open",onKeydown:"$handlers.openKeydown",tabIndex:'$pickerOnly && "-1" || "0"',"data-disabled":"$disabled","aria-disabled":"$disabled","aria-label":'$value && ($ui.changeDate.value + ", " + $inputText) || $ui.chooseDate.value',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),zr=yr("years",(()=>({if:'$panel === "year"',$el:"ul",attrs:{id:'$id + "_years"'}}))),Yr=yr("year",(()=>({for:["year","yearIndex","$years"],$el:"li",attrs:{key:'$: "year" + $fns.format($year, "YYYY")',onClick:"$handlers.setDate($year)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($year)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(year)",tabindex:'$fns.sameYear($year) && "0" || "-1"',"aria-selected":"$selectedYear === $yearIndex","data-disabled":"$fns.isDisabledYear($year)","aria-label":"$fns.format($year, $yearFormat)"}}))),jr=yr("months",(()=>({if:'$panel === "month"',$el:"ul"}))),Zr=yr("month",(()=>({$el:"li",for:["month","index","$months"],attrs:{key:"$month",onClick:"$handlers.setDate($month)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($month)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(month)",tabindex:'$fns.sameMonth($month) && "0" || "-1"',"aria-selected":"$selectedMonth === $index","data-disabled":"$fns.isDisabledMonth($month)"}}))),Gr=yr("panelHeader",(()=>({$el:"header",attrs:{"aria-live":"polite"}}))),Xr=yr("yearsHeader",(()=>({$el:"div",if:'$panel === "year"'}))),Jr=yr("monthsHeader",(()=>({$el:"div",if:'$panel === "month"'}))),Qr=yr("daysHeader",(()=>({$el:"div",if:'$panel === "day"'}))),es=yr("timeHeader",(()=>({$el:"div",if:'$panel === "time"'}))),ts=yr("yearButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"}))),os=yr("monthButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"}))),ns=yr("dayButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"}))),rs=yr("removeSelection",(()=>({$el:"button",if:"$clearable && $_value",attrs:{id:'$id + "_remove_selection"',type:"button",onClick:"$handlers.clear","aria-controls":"$id"}}))),ss=yr("time",(()=>({$el:"div",if:'$panel === "time"'}))),as=yr("timeInput",(()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown",spellcheck:"false",onBlur:"$handlers._blurOut(time)"}}))),ls=yr("panelClose",(()=>({$el:"button",if:"$showPanelClose && ($inline === undefined || $inline === false)",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:-1,"aria-label":"$ui.close.value"}}))),{overlayPlaceholder:is,overlayLiteral:ps,overlayChar:ds,overlayEnum:cs,overlay:us,overlayParts:fs,overlayInner:vs}=/* #__PURE__ */q(yr),hs=yr("panel","div"),ms=/* #__PURE__ */new WeakMap,gs=/* #__PURE__ */new WeakMap,$s=new WeakSet,bs=/* #__PURE__ */new WeakMap,ys=/* #__PURE__ */new WeakMap,xs=new WeakSet,ws=/* #__PURE__ */new WeakMap,_s=/[\uD800-\uDBFF]/,ks=/* #__PURE__ */new WeakMap,Ss=/* #__PURE__ */new WeakMap,Ls=/* #__PURE__ */new WeakMap,Is=/* #__PURE__ */new WeakMap,Ds=/* #__PURE__ */new WeakMap,As=new WeakSet,Cs=/* #__PURE__ */new WeakMap,Ts=/* #__PURE__ */new WeakMap,Es=/* #__PURE__ */new WeakMap,Os=/* #__PURE__ */new WeakMap;let Ms=!1;const Vs=()=>{Ms=!0,setTimeout((()=>{Ms=!1}),500)},Fs={"#":{type:"char",pattern:/\d/,token:"#",placeholder:"_",selectDirection:"right"},a:{type:"char",pattern:/[a-zA-Z]/,token:"a",placeholder:"_",selectDirection:"left"},h:{type:"char",pattern:/[0-9a-fA-F]/,token:"h",placeholder:"_",selectDirection:"left"},"*":{type:"char",pattern:/./,token:"*",placeholder:"_",selectDirection:"left"}},Ps=/* #__PURE__ */new WeakMap,Bs="undefined"!=typeof window;let Hs=!1,Rs=!1;function Ns(){Bs&&!Rs&&(Rs=!0,document.addEventListener("selectionchange",(()=>{const e=ke();if(!(e instanceof HTMLInputElement))return;if(Os.has(e))return function(e){const t=Os.get(e);if(t){const[o,n]=t,[r,s]=Sa(e),a=s.indexOf(o);if(-1===a)return void Os.delete(e);const l=r[a],i=[l[0]+n[0],l[1],"none"];Qs(ea(e),i)||aa(e,i)}}(e);if("select"!==ws.get(e))return;const t=ea(e);if(!Qs(t,Ps.get(e))){if(Ps.set(e,t),$s.has(e))return $s.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:ea(e)}))}})))}function Ks(e,t,o){var n;if(Ns(),ms.has(e))return;ms.set(e,[]),t.reverse&&As.add(e),t.prefix&&Cs.set(e,t.prefix),t.suffix&&Ts.set(e,t.suffix),Ys(e,t.pattern,t.partOverrides,t.explicitParts);const r=ys.get(e),s=null==r?void 0:r.some((e=>Gs(e))),a=null==r?void 0:r.some((e=>function(e){return!!e&&("group"===e.type&&Array.isArray(e.parts))}(e)));if(s&&a)throw new Error("Cannot use enums and groups in the same mask.");const l=s?"select":null!==(n=t.mode)&&void 0!==n?n:"shift";if(a&&"select"===l)throw new Error("Cannot use groups in select mode.");(t.placeholder||"select"===l)&&xs.add(e),ws.set(e,l),t.onChange&&Is.set(e,t.onChange);let i=!1;e.addEventListener("beforeinput",(o=>{if(Hs)return;if("insertLineBreak"===o.inputType)return;if(o.inputType.startsWith("history"))return function(e,t){e.addEventListener("input",(o=>{var n;o.preventDefault(),o.stopImmediatePropagation();const r=ms.get(e);if(null==r?void 0:r.length){const o=(null!==(n=gs.get(e))&&void 0!==n?n:r.length-1)+(t.endsWith("Undo")?-1:1),s=r[o];if(!s)return;la(e,s),e.setSelectionRange(...s.selectionAfter),gs.set(e,o),Is.has(e)&&Is.get(e)(s,e)}}),{once:!0})}(e,o.inputType);o.preventDefault(),i=!0;const n=(r=o.inputType).startsWith("insert")?"insert":!!r.startsWith("delete")&&("deleteContentForward"===r?"deleteContentForward":"deleteContentBackward");var r;const s=ea(e),a=e.value;n&&ta(e,{type:n,selectionBefore:s,data:o.data,valueBefore:a,suffix:t.suffix,prefix:t.prefix})})),e.addEventListener("input",(t=>{i=!1,"data"in t||!i&&o&&(o.input(e.value,!1),o.props._maskValue=e.value)})),"select"===l&&e.addEventListener("keydown",(t=>{switch(t.key){case"ArrowRight":return t.preventDefault(),Ca(e);case"ArrowLeft":return t.preventDefault(),Ca(e,-1);case"ArrowUp":return void(Ta(e,1)&&t.preventDefault());case"ArrowDown":return void(Ta(e,-1)&&t.preventDefault());case"Tab":return Ms?void t.preventDefault():void(Ca(e,t.shiftKey?-1:1)&&t.preventDefault())}})),e.addEventListener("focus",(()=>function(e){var t;const o=xs.has(e),n=ws.get(e);if(o){let o=null,r=null,s=!1;const a="shift"===n?0:1,l=e.value;ga(e,{type:"insert",data:l,selectionBefore:[0,0,"none"],valueBefore:l},"shift"===n?"":l,((e,t)=>(null===o&&"char"===t.type&&(o=e.pos-a),(Zs(t)||Gs(t))&&e.value.endsWith(t.placeholder)?(r=e.pos-a,!1):("char"===t.type&&(s=!0),!0))));const i=null!==(t=null!=r?r:s?l.length:o)&&void 0!==t?t:null;if(null!==i){let t=[i,i,"none"];if("select"===ws.get(e)){const[o]=Sa(e),n=Oa(e,t);void 0!==n&&n in o&&(t=o[n])}return function(e,t,o=50){ks.set(e,na(e,t));const n=async()=>{if(!Bs||ke()!==e)return;"select"===ws.get(e)&&(await new Promise((e=>setTimeout(e,10))),function(e){let t=ea(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=ra(e,t);const[o]=Sa(e),n=Oa(e,t),r=t[0];void 0!==n&&o.some((e=>r>=e[0]&&r<e[1]))&&ks.set(e,na(e,o[n]))}(e));const t=ks.get(e);t&&e.setSelectionRange(...t)};n(),document.addEventListener("selectionchange",n),setTimeout((()=>{document.removeEventListener("selectionchange",n),ks.delete(e)}),o)}(e,t)}}}(e))),e.addEventListener("selection",(t=>function(e,t){if(ks.get(e))return;Ba(e),t=ra(e,t);const[o]=Sa(e),n=Oa(e,t),r=void 0!==n&&na(e,o[n]);r&&!Qs(t,r)&&aa(e,r,!0)}(e,t.detail))),ta(e,{type:"insert",selectionBefore:[0,0,"forward"],data:e.value,valueBefore:"",suffix:t.suffix,prefix:t.prefix})}function Ws(e){var t,o;if(Os.has(e))return;const n=null!==(t=ms.get(e))&&void 0!==t?t:[],r=n[null!==(o=gs.get(e))&&void 0!==o?o:n.length-1];if(r){const t=r.selectionAfter,[o,n]=Sa(e,r.valueAfter),s=Oa(e,t,[o,n]);if(void 0!==s&&s in o){const r=n[s],a=o[s],l=[t[0]-a[0],t[1]-a[0],"none"];Os.set(e,[r,l])}}}function qs(e){Os.delete(e)}function Us(e,t,o){const n="string"==typeof e||!ms.has(e),r="string"==typeof e?zs(e):e;if(n)t.prefix&&Cs.set(r,t.prefix),t.suffix&&Ts.set(r,t.suffix),r.value=oa(r,r.value),Ks(r,t,o);else{const e=Ma(r),o=r.value;r.value="",ta(r,{type:"insert",selectionBefore:[0,e?e.valueAfter.length:0,"none"],valueBefore:e?e.valueAfter:"",data:o,suffix:t.suffix,prefix:t.prefix})}return r.value}function zs(e){return{value:e,selectionStart:0,selectionEnd:0,scrollWidth:0,clientWidth:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function Ys(e,t,o,n,r){r=e&&As.has(e)||r;const s=(null!=n?n:function(e){const t=Object.values(Fs);if(!e)return t;const o={...e},n=[];for(const r of t)if(!Js(r))if("token"in r&&r.token in e){const t={...r,...e[r.token]};js(t)&&n.push(t),delete o[r.token]}else n.push(r);const r=Object.values(o);for(const e of r)js(e)?n.push(e):console.warn(`Invalid ${e.type} token`,e);return n}(o)).sort(((e,t)=>{const o="token"in e?e.token.length:-1,n="token"in t?t.token.length:-1;return o===n?0:o>n?-1:1}));let a=[];[t,a]=function(e,t,o,n){let r,s=0,a="",l="",i="";const p=[];for(;a=ia(e);)a===t&&r!==n?(s++,s>1&&(i+=a)):a===o&&s&&r!==n?(s--,0===s?(l+=`{$${p.length}}`,p.push(i),i=""):i+=a):s?i+=a:r!==n||a!==t&&a!==o?l+=a:l=`${l.substring(0,l.length-1)}${a}`,r=a,e=e.substring(a.length);return[l,p]}(t,"{","}","\\");const l=a.length;t=s.reduce(((e,t,o)=>"token"in t?e.replaceAll(`\\${t.token}`,"{“!”}").replaceAll(t.token,`{$${l+o}}`).replaceAll("{“!”}",t.token):e),t);const i=function(e,t,o){return e.reduce(((e,n)=>{const[r,s]=function(e){const[t,...o]=e.split("|"),n=o.reduce(((e,t)=>{const[o,n=!0]=t.split(":");return Object.assign(e,{[o]:n})}),{});return[t,n]}(n);let a=Ys(null,r,void 0,t,o);a=a.map((e=>{const t={...e};if("char"===t.type&&s.placeholder)t.placeholder=s.placeholder;else if("enum"===t.type)throw new Error("Groups cannot contain enums.");return t}));const l={type:"group",parts:a,...s};return e.push(l),e}),[])}(a,s,r).concat(s),p=/\{\$\d+\}/g,d=t.match(p),c=t.split(p).reduce(((e,t,o)=>{if(t&&(t=t.replaceAll("\\",""),e.push({type:"literal",value:r?[...t].reverse().join(""):t})),d&&d[o]){const t=d[o],n=Number(t.substring(2,t.length-1));!isNaN(n)&&i[n]&&e.push(i[n])}return e}),[]);return r&&c.reverse(),e&&ys.set(e,c),c}function js(e){return!!e&&(Js(e)||Zs(e)||Gs(e))}function Zs(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&Xs(e))}function Gs(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&Xs(e))}function Xs(e){return!!e&&("placeholder"in e&&"token"in e)}function Js(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function Qs(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function ea(e){var t,o;return[null!==(t=e.selectionStart)&&void 0!==t?t:e.value.length,null!==(o=e.selectionEnd)&&void 0!==o?o:e.value.length,"none"]}function ta(e,t){var o;As.has(e)&&Pa(t);let n=!1;switch(Ds.set(e,"playing"),t.type){case"insert":n=function(e,t){let o=sa(t);const n=t.selectionBefore,r=function(e,t){var o,n,r;if("select"===ws.get(e)){const[s,a]=Sa(e),l=s.findIndex((e=>Qs(e,t.selectionBefore))),i=null!==(o=a[l])&&void 0!==o?o:null;if(Zs(i)){const e=t.selectionBefore,o=e[1]-e[0],s=t.valueBefore.substring(e[0],e[1]),a="left"===i.selectDirection,l=ha(s,i),p=a?0:function(e,t,o){if(!e)return 0;let n="";for(;e.length;){const o=ia(e);e=e.substring(o.length),t.pattern.test(o)&&(n+=o)}return Math.min(Math.max(n.length,1),o)}(t.data,i,o);if(l.length>=o)return a||(t.insertPos=e[1]-p),(null!==(n=i.selectFill)&&void 0!==n?n:i.placeholder).repeat(o);const d=(null!==(r=i.selectFill)&&void 0!==r?r:i.placeholder).repeat(o-l.length-(a?0:p));return t.insertPos=a?e[0]+l.length:e[1]-p,"left"===i.selectDirection?`${l}${d}`:`${d}${l}${i.placeholder}`}if(Gs(i)){const e=t.selectionBefore;return t.valueBefore.substring(e[0],e[1])}}return""}(e,t);o=`${o.substring(0,n[0])}${r}${o.substring(n[1])}`;const s=ga(e,t,o);return bs.set(e,s.endPos),{...t,valueAfter:s.value,selectionAfter:ma(e,s),unmasked:s.unmasked,complete:s.complete,meta:s.meta}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":n=function(e,t){const o=sa(t),n=t.selectionBefore,r=As.has(e);let s=n[0],a=n[1];s===a&&("deleteContentBackward"!==t.type||r?a+=pa(o,s):s-=pa(o,s,"backward"));const l=ws.get(e);let i="";if("select"===l){const[o,n]=Sa(e),r=Oa(e,[s,a,"none"]);if(void 0!==r){const l=n[r],p=o[r];Zs(l)?i=l.placeholder.repeat(a-s):Gs(l)&&([i,s]=Qs(p,ea(e))?[l.placeholder,s]:function(e,t,o,n){const r=n.valueBefore,s=pa(r,n.selectionBefore[0],"backward"),a=Math.max(o[0],n.selectionBefore[0]-s),l=r.substring(o[0],a),i=Ia(t.values,l);let p=null==i?void 0:i.substring(l.length);i&&!p&&Da(t.values,i)&&(p=i);return[null!=p?p:t.placeholder,p?a:o[0]]}(0,l,p,t))}}const p=`${o.substring(0,s)}${i}${o.substring(a)}`,d=ga(e,t,p);return{...t,valueAfter:d.value,selectionAfter:wa(e,d,t,s),unmasked:d.unmasked,complete:d.complete,meta:d.meta}}(e,t)}if(As.has(e)&&n&&Pa(n),n&&function(e,t){t.prefix&&(t.valueAfter=t.prefix+t.valueAfter,t.selectionAfter=na(e,t.selectionAfter));t.suffix&&(t.valueAfter+=t.suffix)}(e,n),n&&function(e){return e.valueBefore!==e.valueAfter||e.selectionBefore[0]!==e.selectionAfter[0]||e.selectionBefore[1]!==e.selectionAfter[1]}(n)){Is.has(e)&&Es.set(e,(()=>{Es.delete(e),n&&Is.get(e)(n,e)})),Ds.set(e,"beforeCallback");let t=null!==(o=ms.get(e))&&void 0!==o?o:[];const r=gs.get(e);r&&(t=t.slice(0,r),gs.delete(e)),t.push(n),ms.set(e,t),Bs&&ke()===e&&"function"==typeof document.execCommand&&!Hs?(aa(e,[0,e.value.length,"forward"],!0),Hs=!0,document.execCommand("insertText",void 0,n.valueAfter),Hs=!1):la(e,n),Bs&&ke()===e&&aa(e,n.selectionAfter);const s=Es.get(e);s&&s(),Ba(e)}Ds.set(e,"complete")}function oa(e,t){var o,n;const r=null!==(o=Cs.get(e))&&void 0!==o?o:"",s=null!==(n=Ts.get(e))&&void 0!==n?n:"";return r&&t.startsWith(r)&&(t=t.substring(r.length)),s&&t.endsWith(s)&&(t=t.substring(0,t.length-s.length)),t}function na(e,t){const o=Cs.get(e),n=[...t];return o&&(n[0]+=o.length,n[1]+=o.length),n}function ra(e,t){const o=Cs.get(e),n=[...t];return o&&(n[0]-=o.length,n[1]-=o.length),n}function sa(e){let t=e.valueBefore;const o=e.selectionBefore;if(e.suffix&&t.endsWith(e.suffix)&&(t=t.substring(0,t.length-e.suffix.length),e.valueBefore=t,o[0]>=t.length&&(o[0]=t.length),o[1]>=t.length&&(o[1]=t.length)),e.prefix&&t.startsWith(e.prefix)){const n=e.prefix.length;t=t.substring(n),e.valueBefore=t,o[0]=Math.max(o[0]-n,0),o[1]=Math.max(o[1]-n,0)}return t}function aa(e,t,o=!1){o&&($s.add(e),setTimeout((()=>$s.delete(e)),5)),ks.get(e)&&ks.set(e,t),e.setSelectionRange(...t)}function la(e,t,o="After"){if(e.value=t[`value${o}`],Bs){const o=new InputEvent("input",{inputType:"insert"===t.type?"insertText":t.type,data:t.data});e.dispatchEvent(o)}}function ia(e){if(null==e)return"";const t=_s.test(e.charAt(0))&&_s.test(e.charAt(1))?2:1;return e.substring(0,t)}function pa(e,t,o="forward"){if("backward"===o)return 0===t?0:1===t?1:_s.test(e.charAt(t))&&_s.test(e.charAt(t-1))?2:1;const n=e.length-t;return 0===n?0:1===n?1:ia(e.substring(t)).length}function da(e,t){const o=ia(e.data),n=o.length;if(e.value+=o,e.pos+=n,"string"==typeof e.data&&(e.data=e.data.substring(n),e.data.length||(e.endPos=e.pos)),t)return t.substring(n)}function ca(e){const t=ia(e.buffer),o=t.length;e.value+=t,e.pos+=o,e.buffer=e.buffer.substring(o)}function ua(e,t){const o=ia(t),n=o.length;return e.value+=o,e.pos+=n,t.substring(n)}function fa(e,t){for(;t.buffer;){const o=ia(t.buffer);if(e.pattern.test(o)||t.placeholder&&e.placeholder===o)return void("replace"!==t.mode&&"select"!==t.mode||(t.buffer=t.buffer.substring(o.length)));t.buffer=t.buffer.substring(o.length)}}function va(e,t){const o=e.values.concat([e.placeholder]).map((e=>e.toLowerCase())).sort(((e,t)=>e.length>t.length?-1:1));for(;t.buffer;){const e=t.buffer.toLowerCase(),n=o.find((t=>e.startsWith(t)));if(n){const e=t.buffer.substring(0,n.length);return t.buffer=t.buffer.substring(n.length),e}t.buffer=t.buffer.substring(pa(t.buffer,0))}return null}function ha(e,t){let o=e.replaceAll(t.placeholder,"");const n="left"===t.selectDirection;if(t.selectFill){const e=new RegExp(`${n?"":"^"}${r=t.selectFill,r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}+${n?"$":""}`);o=o.replace(e,"")}var r;return o}function ma(e,t){let o=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return o;const n=ea(e);o=[n[0],t.endPos,"none"];const[r,s]=Sa(e,t.value),a=Oa(e,o,[r,s]);if(void 0===a)return o;if(!(a in r)||!(a in s))return o;const l=r[a],i=s[a],p=t.value.slice(l[0],l[1]);if(Zs(i)&&ha(p,i).length===p.length&&a<r.length-1)return Vs(),r[a+1];if(Gs(i)&&t.insertPos>=l[0]&&t.insertPos<=l[1]){if(t.cycle)return l;const o=function(e,t,o){if(null===e.originalData)return 0;const n=e.insertPos>=t?e.value.substring(t,e.insertPos):"",r=`${n}${e.originalData}`,s=Ia(o.values,r);if(s)return ka(r,s).length-n.length;return 0}(t,l[0],i);if(t.insertPos+o===l[1])return Da(i.values,p)?[l[1],l[1],"forward"]:(Vs(),r[a+1]?r[a+1]:r[a]);const s=[t.insertPos+o,l[1],"none"];return Qs(s,n)||($s.add(e),setTimeout((()=>$s.delete(e)),5)),s}return l}function ga(e,t,o,n){var r,s;const a=null!==(r=ys.get(e))&&void 0!==r?r:[],l={pos:0,insertPos:null!==(s=t.insertPos)&&void 0!==s?s:t.selectionBefore[0],range:t.selectionBefore,chars:0,placeholder:xs.has(e),buffer:o,data:t.data,originalData:t.data,value:"",mode:ws.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:Sa(e),unmasked:"",complete:!0,cycle:t.cycle,meta:[]};return $a(a,l,void 0,n),l}function $a(e,t,o,n){var r,s;const a={...t};(null==o?void 0:o.placeholder)&&(t.placeholder=!0);const l=(null==o?void 0:o.repeat)&&"literal"===(null===(r=o.nextPart)||void 0===r?void 0:r.type)?o.nextPart.value:null;let i=0;const p=e.reduce(((e,t)=>e+("char"===t.type?1:0)),0),d=t.chars;for(const o of e){const r=e[i+1];switch(o.type){case"literal":ya(o,t,e.at(-1)===o);break;case"char":xa(o,t,l);break;case"enum":ba(o,t);break;case"group":const a={repeat:null!==(s=o.repeat)&&void 0!==s&&s,nextPart:r,repeats:0,placeholder:!!o.placeholder};$a(o.parts,t,a,n)}if(n){if(!1===n(t,o))break}const a=Js(r)&&i+2===e.length&&d!==t.chars;if(!(t.buffer||t.data||t.placeholder||a))break;i++}if(t.chars<p&&(t.complete=!1),o){const r=t.chars-d,s=r===p,i=!(!t.data||l&&t.data.startsWith(l)&&t.insertPos<=t.pos),c=!(t.buffer&&l&&t.buffer.startsWith(l)&&t.insertPos>=t.pos+l.length)&&(t.buffer||i);if(o.repeat&&c&&s)return o.repeats++,$a(e,t,o,n);if(!s){t.complete=!1;const o=e.reverse().find((e=>"literal"===e.type));e.reverse(),Js(o)&&t.value.endsWith(o.value)&&(t.value=t.value.substring(0,t.value.length-o.value.length),t.pos=t.value.length)}p>1&&r<p&&0!==r&&t.insertPos<=t.pos?t.data="":o.repeat&&!s&&o.repeats&&Object.assign(t,a)}t.placeholder=a.placeholder}function ba(e,t){const[o,n]=t.rangeParts,r=o[n.indexOf(e)];if(r&&(t.insertPos<=t.pos||t.insertPos>=r[0]&&t.insertPos<=r[1])&&t.data){const o=t.buffer.substring(0,t.insertPos-t.pos),n=`${o}${t.data}`,r=Ia(e.values.concat([e.placeholder]),n);if(r){const s=ka(n,r);return t.data=t.data.substring(s.length),t.value+=r,r!==e.placeholder?t.unmasked+=r:t.complete=!1,t.meta.push({type:r!==e.placeholder?"enum":"placeholder",value:r}),o?t.buffer=t.buffer.substring(o.length):va(e,t),t.endPos=t.pos+s.length,void(t.pos=t.value.length)}t.data=""}if(t.buffer){const o=va(e,t);if(o)return t.value+=o,o!==e.placeholder?t.unmasked+=o:t.complete=!1,t.meta.push({type:o!==e.placeholder?"enum":"placeholder",value:o}),void(t.pos=t.value.length)}t.complete=!1,t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder}),t.pos=t.value.length}function ya(e,t,o){let n=e.value;if(""===t.data&&!t.buffer&&!t.placeholder&&!o)return;let r=!1;for(;n;){const e=t.insertPos<=t.pos?ia(t.data):"",s=ia(n);if(e===s)n=da(t,n),t.meta.push({type:"literal",value:s}),r=!0;else if(!r||t.data||null===t.data||t.placeholder||o)n=ua(t,n),t.meta.push({type:"literal",value:s});else if(r&&!t.data)break;t.buffer.startsWith(s)&&(t.buffer=t.buffer.substring(s.length))}null===t.data&&!t.buffer&&t.insertPos<=t.pos&&!t.placeholder&&(t.value=t.value.substring(0,t.value.length-e.value.length),t.pos=t.endPos=t.value.length)}function xa(e,t,o){var n;let r=!0;if(t.insertPos<=t.pos)for(;null===(n=t.data)||void 0===n?void 0:n.length;){const n=ia(t.data);if(e.pattern.test(n))return da(t),t.meta.push({type:"char",value:n}),t.chars++,t.unmasked+=n,void fa(e,t);if("string"==typeof t.data){if(o&&t.data.startsWith(o)){r=!1;break}t.data=t.data.substring(n.length)}}for(;r&&t.buffer;){const n=ia(t.buffer);if(e.pattern.test(n))return t.chars++,t.unmasked+=n,ca(t),void t.meta.push({type:"char",value:n});if(t.placeholder&&n===e.placeholder)return ca(t),void t.meta.push({type:"placeholder",value:n});if("string"==typeof t.buffer){if(o&&t.buffer.startsWith(o)){t.buffer=t.buffer.substring(o.length);break}t.buffer=t.buffer.substring(n.length)}}t.placeholder?(t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder})):t.endPos=t.pos}function wa(e,t,o,n){const r=[n,n,"none"];if("select"===t.mode){const s=Sa(e),a=Oa(e,r,s),[l,i]=Sa(e,t.value),p=void 0!==a&&_a(o.valueBefore,s[0][a],s[1][a]);if(void 0!==a&&a in l){if(p){const e=l.slice(a).every(((e,o)=>_a(t.value,e,i[a+o])));return e&&l[a-1]?l[a-1]:l[a]}return[n,l[a][1],"none"]}}return r}function _a(e,t,o){if(Js(o))return!1;if(Zs(o)){let n=t[0];for(;n<t[1];){const t=ia(e.substring(n));if(t!==o.placeholder)return!1;n+=t.length}}return!Gs(o)||e.substring(t[0],t[1])===o.placeholder}function ka(e,t){let o="";do{const n=ia(e).toLowerCase(),r=ia(t).toLowerCase();if(n!==r)break;o+=n,e=e.substring(n.length),t=t.substring(r.length)}while(e.length&&t.length);return o}function Sa(e,t){const o=ys.get(e);if(!o)return[[],[]];if(Ss.has(e))return Ss.get(e);const n=null!=t?t:oa(e,e.value),r=[],s=[];let a=null,l=null,i=0,p=!0;for(const e of o)if(Js(e))a=e,null!==l&&(r.push([l,i,"none"]),l=null),i+=e.value.length;else{if(Zs(a)&&Zs(e)&&e.token===a.token)i++;else if(Zs(e))null===l?(l=i,s.push(e)):(r.push([l,i,"none"]),l=i,s.push(e)),i++;else if(Gs(e)){l&&r.push([l,i,"none"]),Aa(e)||(p=!1);const t=La(n,e,i);l=null,r.push([i,i+t,"none"]),s.push(e),i+=t}a=e}null!==l&&r.push([l,i,"none"]);const d=[[...r],[...s]];return p&&!t&&Ss.set(e,d),d}function La(e,t,o){if(Aa(t))return t.values[0].length;const n=e.slice(o),r=Ia(t.values.concat([t.placeholder]),n);return r?r.length:0}function Ia(e,t,o=null,n){var r;if(0===t.length)return o;if(!n){const o=e.find((e=>e.toLowerCase()===t.toLowerCase()));if(o)return o}const s=ia(t.toLowerCase()),a=`${null!=n?n:""}${s}`,l=e.filter((e=>e.toLowerCase().startsWith(a))),i=l.find((e=>e.toLowerCase()===a));return i&&(o=i),0===l.length?o:1===l.length?l[0]:(l.length>1&&(o=l[0]),null!==(r=Ia(l,t.substring(s.length),o,a))&&void 0!==r?r:l[0])}function Da(e,t){return t=t.toLowerCase(),e.some((e=>(e=e.toLowerCase()).startsWith(t.toLocaleLowerCase())&&e!==t))}function Aa(e){if(!Ls.has(e)&&Array.isArray(e.values)&&e.values.length>0){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;Ls.set(e,e.values.every((e=>e.length===t)))}return Ls.get(e)}function Ca(e,t=1){const[o]=Sa(e),n=Oa(e,ra(e,ea(e)));return void 0!==n&&void 0!==o[n+t]&&(e.setSelectionRange(...na(e,o[n+t])),!0)}function Ta(e,t=1){const[o,n]=Sa(e),r=Oa(e,ea(e));if(void 0!==r&&r in n){const s=n[r];if(Gs(s)){const n=o[r],a=e.value.slice(n[0],n[1]);let l=null,i=s.values.indexOf(a);const p=s.values.length-1;if(-1!==i){const e=i+t;i=e<0?p:e>p?0:e,l=s.values[i]}else a===s.placeholder&&(l=t>0?s.values[0]:s.values[p]);if(null!==l){const t={selectionBefore:n,insertPos:n[0],type:"insert",data:l,valueBefore:e.value,cycle:!0};return setTimeout((()=>ta(e,t)),0),!0}}}return!1}function Ea(e,t){if(!e.length)return-1;if(1===e.length)return e[0];const o=e.length/2,n=Number.isInteger(o)?o:Math.floor(o),r=Math.abs(t-e[n-1])<Math.abs(t-e[n])?[0,n]:[n];return Ea(e.slice(...r),t)}function Oa(e,t,o){const[n]=null!=o?o:Sa(e),r=n.findIndex((e=>e[0]!==e[1]&&(!!Qs(e,t)||t[1]>e[0]&&t[1]<e[1])));if(-1!==r)return r;const[s,a]=n.reduce(((e,t,o)=>(e[0].add(t[0]),e[0].add(t[1]),e[1][t[0]]=o,e[1][t[1]]=o,e)),[new Set,{}]),l=Ea([...s],0===t[0]&&t[1]===e.value.length?0:t[1]);return l in a?a[l]:void 0}function Ma(e){var t,o;const n=null!==(t=ms.get(e))&&void 0!==t?t:[];return n[null!==(o=gs.get(e))&&void 0!==o?o:n.length-1]}function Va(e,t=!1){const o=Ma(e);return o&&(o.complete||t)?As.has(e)?[...o.unmasked].reverse().join(""):o.unmasked:t?"":null}function Fa(e){var t;const o=Ma(e);return null!==(t=null==o?void 0:o.meta)&&void 0!==t?t:null}function Pa(e){const t=e=>[...e].reverse().join(""),o=(e,t)=>[t-e[1],t-e[0],e[2]];e.data&&(e.data=t(e.data)),e.valueBefore=t(e.valueBefore),"valueAfter"in e&&(e.valueAfter=t(e.valueAfter)),"selectionAfter"in e&&(e.selectionAfter=o(e.selectionBefore,e.valueAfter.length)),e.selectionBefore=o(e.selectionBefore,e.valueBefore.length)}function Ba(e){if(e.scrollWidth>e.clientWidth&&null!==e.selectionStart&&null!==e.selectionEnd){const t=e.selectionStart/e.value.length,o=e.selectionEnd/e.value.length;e.scrollLeft=o>.9?e.scrollWidth:t*e.scrollWidth-20,e.dispatchEvent(new CustomEvent("input-scroll",{bubbles:!1,detail:e.scrollLeft}))}}const Ha="undefined"!=typeof window,Ra=new WeakSet,Na=new WeakSet,Ka=new WeakSet,Wa=new WeakMap,qa=new WeakMap,Ua=new WeakSet,za=new WeakSet;function Ya(e){e.props.selectedMonth=e.props.selectedYear=e.props.selectedDay=e.props.selectedWeek=void 0}function ja(e){var t,o,n;e.props.selectedMonth=e.props.months.findIndex((t=>Xa(t,e.props.activeDate))),e.props.selectedYear=e.props.years.findIndex((t=>Ga(t,e.props.activeDate)));for(let s=0;s<(null===(t=e.props.calendar[0])||void 0===t?void 0:t.weeks.length);s++)for(let t=0;t<(null===(o=e.props.calendar[0])||void 0===o?void 0:o.weeks[s].length);t++){const o=null===(n=e.props.calendar[0])||void 0===n?void 0:n.weeks[s][t];if(r.sameDay(o,e.props.activeDate)){e.props.selectedWeek=s,e.props.selectedDay=t;break}}}function Za(e){return"timeZoneName"!==e.partName}function Ga(e,t){return t instanceof Date&&e.getFullYear()===t.getFullYear()}function Xa(e,t){return t instanceof Date&&e.getMonth()===t.getMonth()}function Ja(e){e.props.skipBuildCalendar||Ya(e),e.props.selectedIndex=e.props.calendar=_(e.props.showMonths,(e=>e)).map((t=>function(e,t){const o=[],n=r.date(t);n.setDate(1);let s=r.weekStart(n,e.props.weekStart);s.setHours(n.getHours(),n.getMinutes(),n.getSeconds());const a=r.weekEnd(r.monthEnd(t),e.props.weekStart);let l=[];do{l.push(s),7===l.length&&(o.push(l),l=[]),s=r.addDay(s)}while(s.getTime()<=a.getTime());return{monthDay:n,weeks:o}}(e,r.addMonth(e.props.renderedDate,t)))),e.props.years=function(e){const t=Number(r.format(e.props.renderedDate,"YYYY")),o=t-t%10;return e.props.decade=`${o} - ${o+9}`,_(10,(n=>r.addYear(e.props.renderedDate,o+n-t)))}(e),e.props.months=function(e){const t=r.date(e.props.renderedDate);return t.setMonth(0),_(12,(e=>r.addMonth(t,e)))}(e),e.props.skipBuildCalendar?e.props.skipBuildCalendar=!1:e.value&&ja(e)}function Qa(e,t){var o;t.target&&t.target instanceof Element&&(t.target.closest(`#${e.props.id}_popover`)||!(null===(o=e.props.__root)||void 0===o?void 0:o.contains(t.target)))||(e.props.expanded=!1)}function el(e,t){if(!t)return e.props.inputText="",new Date;const o=t instanceof Date?t:r.parse(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(o,e.props.format,e.props.locale,!1,Za),o}function tl(t){return Array.isArray(t.props.sequence)?e.clone(t.props.sequence):["day"]}function ol(e,t,o=!0){var n,s;if(e._value===t)return;if(null==t)return e.input(t,o);e.props.offset=e.props.timezone?r.offset(t,e.props.timezone):"+0000";const a=r.applyOffset(t,null!==(n=(s=e.props).offset)&&void 0!==n?n:s.offset="+0000");e.input(r.format(a,e.props.valueFormat,e.props.valueLocale,!1),o)}function nl(e,t){var o;const n=["prev_button","month_button","day_button","year_button","next_button"].find((t=>{var o;return null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${t}`)})),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${n}`);r instanceof HTMLElement&&(t.preventDefault(),r.focus())}function rl(e,t){var o;let n="";if(!(t instanceof HTMLInputElement)||e.props.pickerOnly)return;Wa.set(e,t),null===(o=e.props.__root)||void 0===o||o.addEventListener("click",(t=>{e.props.expanded&&t.target instanceof HTMLElement&&t.target.closest(`#${e.props.id}_popover`)?za.add(e):za.delete(e)})),e.on("prop:inputText",(({payload:e})=>{e!==t.value&&("beforeCallback"===Ds.get(t)&&(n=t.value),Ws(t),t.selectionStart=0,t.selectionEnd=t.value.length,function(e,t){var o,n;if(!ms.has(e))return;const r=null!==(o=Cs.get(e))&&void 0!==o?o:"",s=null!==(n=Ts.get(e))&&void 0!==n?n:"";ta(e,{type:"insert",selectionBefore:ea(e),data:t,valueBefore:e.value,suffix:s,prefix:r})}(t,e),t.value=e,setTimeout((()=>qs(t)),10))}));const[s,a]=function(e){const t=e.props.locale,o=["full","long","medium","short"].includes(e.props.format)||"object"==typeof e.props.format,n=r.parts(e.props.format,t),s=r.formatStr(e.props.format,t,!0,Za);return[s,n.reduce(((n,s)=>{if("literal"===s.partName)return n;let a=r.range(s.token,t,o);if("YYYY"===s.token&&e.props.minDate&&e.props.maxDate){const t=e.props.minDate.getFullYear();a=_(e.props.maxDate.getFullYear()-t+1,(e=>String(t+e)))}const l={type:"enum",token:s.token,values:a,placeholder:"A"===s.token?"A/P":s.token,selectDirection:"left"};return n.push(l),s.token.startsWith("D")&&qa.set(e,a),n}),[])]}(e);Ks(t,{pattern:s,explicitParts:a,onChange:({valueAfter:o})=>{if(sl(e),Ra.has(e))return Ra.delete(e);n&&n===o?n="":(Ws(t),e.props.inputText=o,setTimeout((()=>qs(t)),10))}},e)}function sl(e){var t,o;if(e.props.overlay){const n=Wa.get(e);!n||!(null===(t=e.props.attrs)||void 0===t?void 0:t.placeholder)||e._value||Va(n,!0)||e.props._isFocused||e.props.activeDate&&e.props.expanded?n&&(e.props._isPlaceholder=!1,e.props._overlayParts=_e(Fa(n))):(e.props._isPlaceholder=!0,e.props._overlayParts=[{type:"placeholder",value:null===(o=e.props.attrs)||void 0===o?void 0:o.placeholder}])}}function al(e,t){return!t||(!(!e.props.minDate||!r.isBefore(t,e.props.minDate))||(!(!e.props.maxDate||!r.isAfter(t,e.props.maxDate))||void 0))}function ll(e){return"function"==typeof e.props.validationLabel?e.props.validationLabel(e):e.props.validationLabel||e.props.label||e.props.name||String(e.name)}const il="undefined"!=typeof window,pl=new WeakMap;function dl(e,t){var o,n;if(t instanceof HTMLInputElement&&!pl.get(e)&&il){const r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_overlay`),s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_overlay_inner`);if(r&&t&&s){pl.set(e,r);const o=getComputedStyle(t).color;t.style.color="transparent",t.style.caretColor=o;const n=new ResizeObserver((()=>{var o;const n=getComputedStyle(t),r=t.getBoundingClientRect(),s=null===(o=t.parentElement)||void 0===o?void 0:o.getBoundingClientRect();e.props._overlayStyles={...e.props._overlayStyles,width:n.width,height:n.height,boxSizing:n.boxSizing,padding:n.padding,margin:n.margin,fontSize:n.fontSize,lineHeight:n.lineHeight,top:r.top-((null==s?void 0:s.top)||r.top)+"px",left:r.left-((null==s?void 0:s.left)||r.left)+"px"}}));n.observe(t);const a=e=>{s.scrollLeft=e.detail};t.addEventListener("input-scroll",a),e.on("destroyed",(()=>{t.removeEventListener("input-scroll",a),n.disconnect()}))}}}function cl(t){t.addProps(["_overlayStyles","_overlayParts","_overlayInnerStyles","_isPlaceholder"]),t.props._overlayStyles={position:"absolute",top:"0",left:"0",pointerEvents:t.props._isPlaceholder?"auto":"none"},t.props._overlayInnerStyles={overflow:"hidden",whiteSpace:"nowrap",paddingRight:"20px"},t.on("created",(()=>{t.props.overlay=e.undefine(t.props.overlay),t.props.pickerOnly=e.undefine(t.props.pickerOnly),t.props.overlay=t.props.pickerOnly?void 0:t.props.overlay,t.props.overlay&&e.whenAvailable(`${t.props.id}`,dl.bind(null,t),t.props.__root)})),t.on("prop:_isPlaceholder",(()=>{t.props._overlayStyles={...t.props._overlayStyles,pointerEvents:t.props._isPlaceholder?"auto":"none"}}))}const ul={schema:/* #__PURE__ */xr(/* #__PURE__ */wr(/* #__PURE__ */Sr("$label"),/* #__PURE__ */_r(/* #__PURE__ */kr("prefix"),/* #__PURE__ */Lr(),/* #__PURE__ */us(/* #__PURE__ */vs(/* #__PURE__ */fs(/* #__PURE__ */is("$part.value"),/* #__PURE__ */ps("$part.value"),/* #__PURE__ */ds("$part.value"),/* #__PURE__ */cs("$part.value")))),/* #__PURE__ */Tr(),/* #__PURE__ */Er(/* #__PURE__ */Gr(/* #__PURE__ */Vr(/* #__PURE__ */Fr("$ui.prev.value"),/* #__PURE__ */kr("prev")),/* #__PURE__ */Xr("$decade"),/* #__PURE__ */Jr(/* #__PURE__ */ts()),/* #__PURE__ */Qr(/* #__PURE__ */os(),/* #__PURE__ */ts()),/* #__PURE__ */es(/* #__PURE__ */os(),/* #__PURE__ */ns(),/* #__PURE__ */ts()),/* #__PURE__ */Or(/* #__PURE__ */Mr("$ui.next.value"),/* #__PURE__ */kr("next")),/* #__PURE__ */ls(/* #__PURE__ */kr("close"))),/* #__PURE__ */hs(/* #__PURE__ */zr(/* #__PURE__ */Yr("$fns.format($year, $yearFormat)")),/* #__PURE__ */jr(/* #__PURE__ */Zr("$fns.format($month, $monthFormat)")),/* #__PURE__ */Pr(/* #__PURE__ */Hr(/* #__PURE__ */Rr(/* #__PURE__ */Nr("$fns.format($day, $weekdayFormat)"))),/* #__PURE__ */Br(/* #__PURE__ */Kr(/* #__PURE__ */Wr(/* #__PURE__ */qr("$fns.format($day, $dateFormat)"))))),/* #__PURE__ */ss(/* #__PURE__ */as()))),/* #__PURE__ */rs(/* #__PURE__ */kr("clear")),/* #__PURE__ */Ur(/* #__PURE__ */kr("calendar")),/* #__PURE__ */Ir(),/* #__PURE__ */kr("suffix"))),/* #__PURE__ */Dr("$help"),/* #__PURE__ */Ar(/* #__PURE__ */Cr("$message.value"))),type:"input",family:"text",props:["dateFormat","dayButtonFormat","format","monthButtonFormat","monthFormat","overlay","pickerOnly","showMonths","showPagination","weekStart","weekdayFormat","yearFormat","years"],features:[cl,function(o){var n,s,a,l,i,p,d,c,u,f,v,h,m,g,$,b,y,x,w,k,S,L;o.addProps(["_isDisabled","_isFocused","activeDate","calendar","clearable","disabled","decade","disabledDays","expanded","inputText","localTime","maxDate","maxScan","minDate","months","offset","paginatedPanels","panel","pickerOnly","renderedDate","sequence","timezone","valueFormat","valueLocale","showPanelClose","selectedDay","selectedWeek","selectedMonth","selectedYear"]),o.hook.prop(((e,t)=>("expanded"===e.prop&&o.props.disabled&&(e.value=!1),"weekStart"===e.prop&&(e.value=Number(e.value||0)),"showMonths"===e.prop&&(e.value=Number(e.value||1)),"maxScan"===e.prop&&(e.value=Number(e.value||7)),"timezone"===e.prop&&("string"==typeof o._value||o._value instanceof Date)&&(o.props.offset=r.offset(o._value,e.value)),t(e)))),o.props._isFocused=!1,o.props._isPlaceholder=!1,null!==(n=(h=o.props).valueFormat)&&void 0!==n||(h.valueFormat="ISO8601"),null!==(s=(m=o.props).weekdayFormat)&&void 0!==s||(m.weekdayFormat="d"),null!==(a=(g=o.props).monthFormat)&&void 0!==a||(g.monthFormat="MMM"),null!==(l=($=o.props).monthButtonFormat)&&void 0!==l||($.monthButtonFormat="MMMM"),null!==(i=(b=o.props).dayButtonFormat)&&void 0!==i||(b.dayButtonFormat="D"),null!==(p=(y=o.props).dateFormat)&&void 0!==p||(y.dateFormat="D"),null!==(d=(x=o.props).yearFormat)&&void 0!==d||(x.yearFormat="YYYY"),null!==(c=(w=o.props).paginatedPanels)&&void 0!==c||(w.paginatedPanels=["day","year"]),null!==(u=(k=o.props).valueLocale)&&void 0!==u||(k.valueLocale=o.props.locale),null!==(f=(S=o.props).format)&&void 0!==f||(S.format="long"),o.props.panels=tl(o),o.props.pickerOnly=e.undefine(o.props.pickerOnly),"disabled"in o.props&&(o.props.disabled=e.undefine(o.props.disabled)),"clearable"in o.props&&(o.props.clearable=e.undefine(o.props.clearable)),null!==(v=(L=o.props).maxScan)&&void 0!==v||(L.maxScan=7),o.props._isDisabled="function"==typeof o.props.disabledDays?o.props.disabledDays.bind(null,o):al.bind(null,o),o.props.calendar=[],o.props.inputText="",o.props.showMonths=o.props.showMonths||1,"function"==typeof o.props.format?(o.props.formatDate=o.props.format,o.props.format=null):o.props.formatDate=r.format,Ja(o),o.on("mounted",(()=>{e.whenAvailable(`${o.props.id}`,rl.bind(null,o),o.props.__root)})),o.on("created",(()=>{if(function(e){const t=e._value;let o=new Date;if(t instanceof Date)o=r.date(t);else if("string"==typeof t)try{const n=r.parse(t,e.props.valueFormat,e.props.valueLocale);o=r.date(n)}catch{console.warn(`Date (${t}) does not match format (${r.formatStr(e.props.valueFormat,e.props.valueLocale)})`),o=void 0}else t||(o=void 0);if(e.props.offset=e.props.timezone?r.offset(o||new Date,e.props.timezone):"+0000",e.props.minDate){const t="string"==typeof e.props.minDate?r.parse(e.props.minDate):e.props.minDate;e.props.minDate=r.removeOffset(t,e.props.offset)}if(e.props.maxDate){const t="string"==typeof e.props.maxDate?r.parse(e.props.maxDate):e.props.maxDate;e.props.maxDate=r.removeOffset(t,e.props.offset)}o=o&&r.removeOffset(o,e.props.offset),o&&ol(e,o,!1);let n=o||new Date;e.props.minDate&&n<e.props.minDate?n=e.props.minDate:e.props.maxDate&&n>e.props.maxDate&&(n=e.props.maxDate),e.props.renderedDate=n,e.props.activeDate=n,e.props.localTime=o&&r.format(o,"HH:mm")||"12:00"}(o),o.context){const e={};let t;o.context.fns.format=(t,n)=>{if(e[n]&&e[n][t.toString()])return e[n][t.toString()];const s=r.format(t,n,o.props.locale||"en",!1,Za);return e[n]?e[n][t.toString()]=s:e[n]={[t.toString()]:s},s},o.context.fns.isDisabled=o.props._isDisabled,o.context.fns.isDisabledMonth=e=>!r.nearestDay(e,(e=>!o.props._isDisabled(e)),"month"),o.context.fns.isDisabledYear=e=>!r.nearestDay(e,(e=>!o.props._isDisabled(e)),"year"),o.context.handlers._blur=e=>{var t,n;o.props._isFocused=!1,"function"==typeof(null===(t=o.context)||void 0===t?void 0:t.handlers.blur)&&(null===(n=o.context)||void 0===n||n.handlers.blur(e))},o.context.handlers.closePanel=()=>{o.props.expanded=!1},o.context.handlers._blurOut=e=>t=>{var n;t.preventDefault(),o.props.keydown?o.props.keydown=!1:e&&e!==o.props.panel||o.props.pickerOnly&&t.relatedTarget instanceof Element&&(t.relatedTarget===document.getElementById(`${o.props.id}_inner`)||t.relatedTarget.closest(`#${o.props.id}_inner`))||t.relatedTarget&&t.relatedTarget instanceof Element&&(t.relatedTarget.closest(`#${o.props.id}_popover`)||!(null===(n=o.props.__root)||void 0===n?void 0:n.contains(t.relatedTarget))||t.relatedTarget.id===`${o.props.id}_popover`)||(o.props.expanded=!1)},o.context.handlers.overlayClick=()=>{const e=Wa.get(o);e&&(e.focus(),o.props._isPlaceholder=!1)},o.context.handlers.focus=()=>{o.props.pickerOnly||(o.props._isFocused=!0,o.props.pickerOnly&&!Na.has(o)&&(Ka.add(o),o.props.expanded=!0,setTimeout((()=>Ka.delete(o)),200)))},o.context.handlers.clear=()=>{var e,t;ol(o,void 0,!0),el(o,void 0);const n=null===(t=null===(e=o.props)||void 0===e?void 0:e.__root)||void 0===t?void 0:t.getElementById(`${o.props.id}`);n instanceof HTMLInputElement&&(n.focus(),setTimeout((()=>{n.setSelectionRange(0,0)}),50))},o.context.handlers.dateInput=e=>{var t;if(Ua.has(o))return Ua.delete(o);if(e.target instanceof HTMLInputElement&&!o.props.expanded)try{let n=r.parse({date:e.target.value,format:o.props.format,locale:o.props.locale,partFilter:Za});if(function(e){return r.parts(e.props.format,e.props.locale).some((e=>"weekday"===e.partName))}(o)&&o.props.activeDate instanceof Date&&o.props.activeDate.getTime()===n.getTime()&&!Os.get(e.target)&&r.format(n,o.props.format,o.props.locale,!1,Za)!==e.target.value){const s=r.range("dddd",o.props.locale),a=r.parts(o.props.format,o.props.locale),l=null===(t=r.parseParts(e.target.value,a).find((e=>"dddd"===e.token)))||void 0===t?void 0:t.value,i=r.format(n,"dddd",o.props.locale);if(l&&s.includes(l)&&i!==l){let e=s.indexOf(l)-s.indexOf(i);e=e<-1?7+e:e,n=r.addDay(n,e),Ra.add(o)}}ol(o,n)}catch(e){ol(o,void 0)}},o.context.handlers.open=()=>{o.props.expanded=!0},o.context.handlers.next=()=>{switch(o.props.panel){case"year":return void(o.props.renderedDate=r.addYear(o.props.renderedDate,10));case"day":return void(o.props.renderedDate=r.addMonth(o.props.renderedDate,1))}},o.context.handlers.prev=()=>{switch(o.props.panel){case"year":return void(o.props.renderedDate=r.addYear(o.props.renderedDate,-10));case"day":return void(o.props.renderedDate=r.addMonth(o.props.renderedDate,-1))}},o.context.handlers.setDate=e=>()=>{"month"!==o.props.panel&&"year"!==o.props.panel||!o.props.activeDate||(e=o.props.activeDate),o.emit("dateSelected",e)},o.context.handlers.localTime=e=>{const t=e.target;if(!t.value)return;const[n,r]=t.value.split(":");o.props.localTime=t.value,o.props.activeDate.setHours(n,r),el(o,o.props.activeDate)},o.context.handlers.keyDown=e=>{switch(o.props.keydown=!0,o.props.panel){case"day":return o.emit("calendarKeydown",e);case"year":return o.emit("yearKeydown",e);case"month":return o.emit("monthKeydown",e);case"time":return o.emit("timeKeydown",e);default:return}},o.context.handlers.inputKeydown=e=>{o.emit("keydown",e)},o.context.handlers.openKeydown=e=>{"Enter"!==e.key&&"Space"!==e.key||(o.props.expanded=!0)},o.context.handlers.mouseEnter=e=>n=>{if(clearTimeout(t),n.target instanceof HTMLElement&&"-1"===n.target.getAttribute("tabindex")&&"true"!==n.target.getAttribute("data-is-extra"))if("month"===o.props.panel||"year"===o.props.panel){const t=r.nearestDay(e,(()=>!0),o.props.panel);t&&(o.props.activeDate=t)}else o.props.activeDate=e},o.context.handlers.mouseLeave=()=>{clearTimeout(t),t=setTimeout((()=>{}),100)},o.context.handlers.jumpTo=e=>()=>{o.props.panels.unshift(o.props.panel),o.props.panel=e},o.context.fns.sameDay=e=>function(e,t){return t instanceof Date&&r.sameDay(e,t)}(e,o.props.activeDate),o.context.fns.sameMonth=e=>Xa(e,o.props.activeDate),o.context.fns.sameYear=e=>Ga(e,o.props.activeDate),o.context.fns.notInMonth=(e,t)=>{const o=r.dayStart(t).getTime();return o<r.monthStart(e).getTime()||o>r.monthEnd(e).getTime()||void 0}}}));const I=Qa.bind(null,o);o.on("prop:panel",(({payload:e})=>{o.props.showPagination=o.props.paginatedPanels.includes(e)})),o.on("dateSelected",(({payload:e})=>{var t,n;Array.isArray(o.props.panels)&&o.props.panels.length?o.props.panel=o.props.panels.shift():(o.props.expanded=!1,null===(n=null===(t=o.props.__root)||void 0===t?void 0:t.getElementById(`${o.props.id}`))||void 0===n||n.focus()),e&&o.props._isDisabled(e)||ol(o,e)})),o.on("input",(({payload:e})=>{if(void 0===e&&!o.props._isFocused)return void el(o,void 0);const t=new Date,n=e?el(o,r.removeOffset("string"==typeof e?r.parse(e,o.props.valueFormat,o.props.valueLocale):e,o.props.offset)):t;o.props.activeDate=!e&&o.props.activeDate?o.props.activeDate:n,o.props.renderedDate=!e&&o.props.renderedDate?o.props.renderedDate:n,o.props.localTime=r.format(n,"HH:mm"),function(e){const t=qa.get(e);if(e._value&&t){const o=r.monthDays(e.props.activeDate);if(t.length>o)t.splice(o,t.length-o);else if(t.length<o)for(let e=t.length+1;e<=o;e++)t.push(String(e))}}(o)})),o.on("prop:renderedDate",Ja.bind(null,o)),o.on("prop:expanded",(({payload:t})=>{if(t){if(za.delete(o),o.props.panels=tl(o),o.props.panel=o.props.panels.shift(),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?o.props.showPanelClose=!0:o.props.showPanelClose=!1,"day"===o.props.panel){const e=o.props.activeDate;o.props.activeDate=r.nearestDay(o.props.activeDate,(e=>!o.props._isDisabled(e)),"month")||e}Ja(o),e.whenAvailable(`${o.props.id}_popover`,(e=>{const t=e.querySelector('[tabindex="0"]');t&&setTimeout((()=>{t.focus(),function(e,t){const o=new MutationObserver((e=>{for(const t of e)"attributes"===t.type&&t.target instanceof HTMLElement&&"0"===t.target.getAttribute("tabindex")?t.target.focus():t.addedNodes.length&&t.addedNodes.forEach((e=>{var t;if(e instanceof HTMLElement&&"0"===e.getAttribute("tabindex"))e.focus();else if(e instanceof HTMLElement&&e.querySelector('[tabindex="0"]')){const t=e.querySelector('[tabindex="0"]');t instanceof HTMLElement&&t.focus()}else e instanceof HTMLElement&&e.querySelector('input[type="time"]')&&(null===(t=e.querySelector('input[type="time"]'))||void 0===t||t.focus())}))}));o.observe(t,{attributes:!0,attributeFilter:["tabindex"],childList:!0,subtree:!0});const n=e.on("prop:expanded",(({payload:t})=>{t||(e.off(n),o.disconnect())}))}(o,e)}),0)}),o.props.__root),Ha&&setTimeout((()=>{document.addEventListener("click",I)}),10)}else{if(o.props.activeDate=o.props.renderedDate,"time"===o.props.panel)o.emit("dateSelected",o.props.activeDate);else if(o._value){Ua.add(o);const e="string"==typeof o._value?r.parse(o._value,o.props.valueFormat,o.props.valueLocale):o._value;el(o,r.removeOffset(e,o.props.offset))}else el(o,void 0);Ha&&(Na.add(o),document.removeEventListener("click",I),setTimeout((()=>Na.delete(o)),50))}})),o.on("prop:activeDate",(({payload:e})=>{if(Array.isArray(o.props.calendar)&&o.props.calendar.length)if("day"===o.props.panel){const t=o.props.calendar,n=r.monthStart(o.props.renderedDate),s=r.monthEnd(r.addMonth(o.props.renderedDate,t.length-1));e.getTime()<n.getTime()?o.props.renderedDate=r.addMonth(o.props.renderedDate,-1):e.getTime()>s.getTime()&&(o.props.renderedDate=r.addMonth(o.props.renderedDate))}else if("year"===o.props.panel){const t=o.props.years,n=t[0].getFullYear(),s=t[t.length-1].getFullYear(),a=o.props.activeDate.getFullYear();a>s?o.props.renderedDate=r.addYear(o.props.renderedDate,10):a<n?o.props.renderedDate=r.addYear(o.props.renderedDate,-10):(o.props.skipBuildCalendar=!0,o.props.renderedDate=e)}o.props.expanded&&el(o,o.props.activeDate)})),o.on("keydown",(({payload:e})=>{switch(e.key){case"ArrowDown":case"ArrowUp":case" ":e.preventDefault(),o.props.pickerOnly&&(o.props.expanded=!0);break;case"Enter":case"Return":o.props.expanded||(o.props.expanded=!0);break;case"Escape":o.props.expanded=!1}})),o.on("calendarKeydown",(({payload:e})=>{e.preventDefault();let t=null,n=0;switch(e.key){case"ArrowRight":n=1;break;case"ArrowLeft":n=-1;break;case"ArrowDown":n=7;break;case"ArrowUp":n=-7;break;case"Return":case"Enter":o.emit("dateSelected",o.props.activeDate);break;case"Tab":e.shiftKey||nl(o,e);break;case"Escape":o.props.expanded=!1}if(n&&(e.preventDefault(),t=r.addDay(o.props.activeDate,n)),t&&!o.props._isDisabled(t))o.props.activeDate=t;else if(t&&o.props._isDisabled(t)){const e=n>0?1:-1;_(Number(o.props.maxScan),(t=>e*t)).some((e=>{const n=r.addDay(t,e);return!o.props._isDisabled(n)&&(o.props.activeDate=n,!0)}))}})),o.on("yearKeydown",(({payload:e})=>{let t=0;switch(e.key){case"ArrowDown":t=5;break;case"ArrowRight":t=1;break;case"ArrowUp":t=-5;break;case"ArrowLeft":t=-1;break;case"Tab":e.shiftKey||nl(o,e);break;case"Return":case"Enter":o.emit("dateSelected",o.props.activeDate);break;case"Escape":o.props.expanded=!1}const n=o.props.activeDate.getFullYear()+t-o.props.renderedDate.getFullYear();o.props.activeDate=r.addYear(o.props.renderedDate,n)})),o.on("monthKeydown",(({payload:e})=>{let t=0;switch(e.key){case"ArrowDown":t=3;break;case"ArrowRight":t=1;break;case"ArrowLeft":t=-1;break;case"ArrowUp":t=-3;break;case"Tab":e.shiftKey||nl(o,e);break;case"Return":case"Enter":o.emit("dateSelected",o.props.activeDate);break;case"Escape":o.props.expanded=!1}t&&e.preventDefault();let n=(o.props.activeDate.getMonth()+t)%12;n=n<0?12+n:n;const s=n-o.props.renderedDate.getMonth();let a=r.addMonth(o.props.renderedDate,s);if(o.props._isDisabled(a)){const e=r.nearestDay(a,(e=>!o.props._isDisabled(e)),"month");e&&(a=e)}o.props.activeDate=a})),o.on("timeKeydown",(({payload:e})=>{switch(e.key){case"Return":case"Enter":e.preventDefault(),o.emit("dateSelected",o.props.activeDate)}})),o.on("prop:_isFocused",(()=>{Wa.get(o)&&sl(o)})),o.on("commit",(({payload:e})=>{if(e?ja(o):Ya(o),o.props.activeDate&&o.props._isDisabled(o.props.activeDate)){const e=t.createMessage({blocking:!0,key:"rule_invalidDate",meta:{messageKey:"invalidDate",removeImmediately:!1,localize:!0,i18nArgs:[{node:o,name:ll(o),args:[]}]},type:"validation",value:"The selected date is invalid."});o.store.set(e)}else o.store.remove("rule_invalidDate")}))},jt,
29
+ /* #__PURE__ */bt.bind(null,ir,pr,Sr),to]},Ir=/* #__PURE__ */K("dp"),{outer:Dr,wrapper:Ar,inner:Cr,icon:Tr,label:Er,prefix:Or,suffix:Mr,help:Vr,messages:Fr,message:Pr}=/* #__PURE__ */W(Ir),Br=Ir("input",()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",id:"$id",onKeydown:"$handlers.inputKeydown",value:"$inputText",onInput:"$handlers.dateInput",onClick:"$pickerOnly && $handlers.open",onBlur:"$handlers._blur",onFocus:"$handlers.focus",readonly:"$pickerOnly || $expanded",disabled:"$disabled"}})),Hr=Ir("panelWrapper",()=>({$el:"div",if:"$expanded",attrs:{id:'$id + "_popover"',role:"dialog",onBlur:"$handlers._blurOut()",tabindex:"-1",popover:"$popover","aria-modal":"true","aria-label":"Choose date","data-panel":"$panel",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"',width:'$popoverCoordinates.width + "px"'}}}})),Rr=Ir("next",()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}})),Nr=Ir("nextLabel","span"),Kr=Ir("prev",()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}})),Wr=Ir("prevLabel","span"),qr=Ir("calendar",()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}})),zr=Ir("calendarWeeks",()=>({$el:"tbody"})),Ur=Ir("calendarHeader",()=>({$el:"thead"})),Yr=Ir("weekDays",()=>({$el:"tr"})),jr=Ir("weekDay",()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}})),Zr=Ir("week",()=>({$el:"tr",for:["week","weekIndex","$month.weeks"]})),Gr=Ir("dayCell",()=>({$el:"td",for:["day","dayIndex","$week"],attrs:{key:"$day",onClick:"$handlers.setDate($day)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($day)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(day)",tabindex:'$fns.sameDay($day) && "0" || "-1"',"data-is-extra":"$fns.notInMonth($month.monthDay, $day)","data-disabled":"$fns.isDisabled($day)","aria-selected":"$selectedWeek === $weekIndex && $selectedDay === $dayIndex","aria-label":'$fns.format($day, "long")'}})),Xr=Ir("day","div"),Jr=Ir("openButton",()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"div",role:"button",onClick:"$handlers.open",onKeydown:"$handlers.openKeydown",tabIndex:'$pickerOnly && "-1" || "0"',"data-disabled":"$disabled","aria-disabled":"$disabled","aria-label":'$value && ($ui.changeDate.value + ", " + $inputText) || $ui.chooseDate.value',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}})),Qr=Ir("years",()=>({if:'$panel === "year"',$el:"ul",attrs:{id:'$id + "_years"'}})),es=Ir("year",()=>({for:["year","yearIndex","$years"],$el:"li",attrs:{key:'$: "year" + $fns.format($year, "YYYY")',onClick:"$handlers.setDate($year)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($year)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(year)",tabindex:'$fns.sameYear($year) && "0" || "-1"',"aria-selected":"$selectedYear === $yearIndex","data-disabled":"$fns.isDisabledYear($year)","aria-label":"$fns.format($year, $yearFormat)"}})),ts=Ir("months",()=>({if:'$panel === "month"',$el:"ul"})),os=Ir("month",()=>({$el:"li",for:["month","index","$months"],attrs:{key:"$month",onClick:"$handlers.setDate($month)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($month)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(month)",tabindex:'$fns.sameMonth($month) && "0" || "-1"',"aria-selected":"$selectedMonth === $index","data-disabled":"$fns.isDisabledMonth($month)"}})),ns=Ir("panelHeader",()=>({$el:"header",attrs:{"aria-live":"polite"}})),rs=Ir("yearsHeader",()=>({$el:"div",if:'$panel === "year"'})),ss=Ir("monthsHeader",()=>({$el:"div",if:'$panel === "month"'})),as=Ir("daysHeader",()=>({$el:"div",if:'$panel === "day"'})),ls=Ir("timeHeader",()=>({$el:"div",if:'$panel === "time"'})),is=Ir("yearButton",()=>({$el:"button",attrs:{type:"button",id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"})),ps=Ir("monthButton",()=>({$el:"button",attrs:{type:"button",id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"})),ds=Ir("dayButton",()=>({$el:"button",attrs:{type:"button",id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"})),cs=Ir("removeSelection",()=>({$el:"button",if:"$clearable && $_value",attrs:{id:'$id + "_remove_selection"',type:"button",onClick:"$handlers.clear","aria-controls":"$id"}})),us=Ir("time",()=>({$el:"div",if:'$panel === "time"'})),fs=Ir("timeInput",()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown",spellcheck:"false",onBlur:"$handlers._blurOut(time)"}})),vs=Ir("panelClose",()=>({$el:"button",if:"$showPanelClose && ($inline === undefined || $inline === false)",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:-1,"aria-label":"$ui.close.value"}})),{overlayPlaceholder:hs,overlayLiteral:ms,overlayChar:gs,overlayEnum:$s,overlay:bs,overlayParts:ys,overlayInner:xs}=/* #__PURE__ */q(Ir),ws=Ir("panel","div"),_s=/* #__PURE__ */new WeakMap,ks=/* #__PURE__ */new WeakMap,Ss=new WeakSet,Ls=/* #__PURE__ */new WeakMap,Is=/* #__PURE__ */new WeakMap,Ds=new WeakSet,As=/* #__PURE__ */new WeakMap,Cs=/[\uD800-\uDBFF]/,Ts=/* #__PURE__ */new WeakMap,Es=/* #__PURE__ */new WeakMap,Os=/* #__PURE__ */new WeakMap,Ms=/* #__PURE__ */new WeakMap,Vs=/* #__PURE__ */new WeakMap,Fs=new WeakSet,Ps=/* #__PURE__ */new WeakMap,Bs=/* #__PURE__ */new WeakMap,Hs=/* #__PURE__ */new WeakMap,Rs=/* #__PURE__ */new WeakMap;let Ns=!1;const Ks=()=>{Ns=!0,setTimeout(()=>{Ns=!1},500)},Ws={"#":{type:"char",pattern:/\d/,token:"#",placeholder:"_",selectDirection:"right"},a:{type:"char",pattern:/[a-zA-Z]/,token:"a",placeholder:"_",selectDirection:"left"},h:{type:"char",pattern:/[0-9a-fA-F]/,token:"h",placeholder:"_",selectDirection:"left"},"*":{type:"char",pattern:/./,token:"*",placeholder:"_",selectDirection:"left"}},qs=/* #__PURE__ */new WeakMap,zs="undefined"!=typeof window;let Us=!1,Ys=!1;function js(){zs&&!Ys&&(Ys=!0,document.addEventListener("selectionchange",()=>{const e=ke();if(!(e instanceof HTMLInputElement))return;if(Rs.has(e))return function(e){const t=Rs.get(e);if(t){const[o,n]=t,[r,s]=Ea(e),a=s.indexOf(o);if(-1===a)return void Rs.delete(e);const l=r[a],i=[l[0]+n[0],l[1],"none"];aa(la(e),i)||fa(e,i)}}(e);if("select"!==As.get(e))return;const t=la(e);if(!aa(t,qs.get(e))){if(qs.set(e,t),Ss.has(e))return Ss.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:la(e)}))}}))}function Zs(e,t,o){var n;if(js(),_s.has(e))return;_s.set(e,[]),t.reverse&&Fs.add(e),t.prefix&&Ps.set(e,t.prefix),t.suffix&&Bs.set(e,t.suffix),ea(e,t.pattern,t.partOverrides,t.explicitParts);const r=Is.get(e),s=null==r?void 0:r.some(e=>na(e)),a=null==r?void 0:r.some(e=>function(e){return!!e&&("group"===e.type&&Array.isArray(e.parts))}(e));if(s&&a)throw new Error("Cannot use enums and groups in the same mask.");const l=s?"select":null!==(n=t.mode)&&void 0!==n?n:"shift";if(a&&"select"===l)throw new Error("Cannot use groups in select mode.");(t.placeholder||"select"===l)&&Ds.add(e),As.set(e,l),t.onChange&&Ms.set(e,t.onChange);let i=!1;e.addEventListener("beforeinput",o=>{if(Us)return;if("insertLineBreak"===o.inputType)return;if(o.inputType.startsWith("history"))return function(e,t){e.addEventListener("input",o=>{var n;o.preventDefault(),o.stopImmediatePropagation();const r=_s.get(e);if(null==r?void 0:r.length){const o=(null!==(n=ks.get(e))&&void 0!==n?n:r.length-1)+(t.endsWith("Undo")?-1:1),s=r[o];if(!s)return;va(e,s),e.setSelectionRange(...s.selectionAfter),ks.set(e,o),Ms.has(e)&&Ms.get(e)(s,e)}},{once:!0})}(e,o.inputType);o.preventDefault(),i=!0;const n=(r=o.inputType).startsWith("insert")?"insert":!!r.startsWith("delete")&&("deleteContentForward"===r?"deleteContentForward":"deleteContentBackward");var r;const s=la(e),a=e.value;n&&ia(e,{type:n,selectionBefore:s,data:o.data,valueBefore:a,suffix:t.suffix,prefix:t.prefix})}),e.addEventListener("input",t=>{i=!1,"data"in t||!i&&o&&(o.input(e.value,!1),o.props._maskValue=e.value)}),"select"===l&&e.addEventListener("keydown",t=>{switch(t.key){case"ArrowRight":return t.preventDefault(),Pa(e);case"ArrowLeft":return t.preventDefault(),Pa(e,-1);case"ArrowUp":return void(Ba(e,1)&&t.preventDefault());case"ArrowDown":return void(Ba(e,-1)&&t.preventDefault());case"Tab":return Ns?void t.preventDefault():void(Pa(e,t.shiftKey?-1:1)&&t.preventDefault())}}),e.addEventListener("focus",()=>function(e){var t;const o=Ds.has(e),n=As.get(e);if(o){let o=null,r=null,s=!1;const a="shift"===n?0:1,l=e.value;ka(e,{type:"insert",data:l,selectionBefore:[0,0,"none"],valueBefore:l},"shift"===n?"":l,(e,t)=>(null===o&&"char"===t.type&&(o=e.pos-a),(oa(t)||na(t))&&e.value.endsWith(t.placeholder)?(r=e.pos-a,!1):("char"===t.type&&(s=!0),!0)));const i=null!==(t=null!=r?r:s?l.length:o)&&void 0!==t?t:null;if(null!==i){let t=[i,i,"none"];if("select"===As.get(e)){const[o]=Ea(e),n=Ra(e,t);void 0!==n&&n in o&&(t=o[n])}return function(e,t,o=50){Ts.set(e,da(e,t));const n=async()=>{if(!zs||ke()!==e)return;"select"===As.get(e)&&(await new Promise(e=>setTimeout(e,10)),function(e){let t=la(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=ca(e,t);const[o]=Ea(e),n=Ra(e,t),r=t[0];void 0!==n&&o.some(e=>r>=e[0]&&r<e[1])&&Ts.set(e,da(e,o[n]))}(e));const t=Ts.get(e);t&&e.setSelectionRange(...t)};n(),document.addEventListener("selectionchange",n),setTimeout(()=>{document.removeEventListener("selectionchange",n),Ts.delete(e)},o)}(e,t)}}}(e)),e.addEventListener("selection",t=>function(e,t){if(Ts.get(e))return;za(e),t=ca(e,t);const[o]=Ea(e),n=Ra(e,t),r=void 0!==n&&da(e,o[n]);r&&!aa(t,r)&&fa(e,r,!0)}(e,t.detail)),ia(e,{type:"insert",selectionBefore:[0,0,"forward"],data:e.value,valueBefore:"",suffix:t.suffix,prefix:t.prefix})}function Gs(e){var t,o;if(Rs.has(e))return;const n=null!==(t=_s.get(e))&&void 0!==t?t:[],r=n[null!==(o=ks.get(e))&&void 0!==o?o:n.length-1];if(r){const t=r.selectionAfter,[o,n]=Ea(e,r.valueAfter),s=Ra(e,t,[o,n]);if(void 0!==s&&s in o){const r=n[s],a=o[s],l=[t[0]-a[0],t[1]-a[0],"none"];Rs.set(e,[r,l])}}}function Xs(e){Rs.delete(e)}function Js(e,t,o){const n="string"==typeof e||!_s.has(e),r="string"==typeof e?Qs(e):e;if(n)t.prefix&&Ps.set(r,t.prefix),t.suffix&&Bs.set(r,t.suffix),r.value=pa(r,r.value),Zs(r,t,o);else{const e=Na(r),o=r.value;r.value="",ia(r,{type:"insert",selectionBefore:[0,e?e.valueAfter.length:0,"none"],valueBefore:e?e.valueAfter:"",data:o,suffix:t.suffix,prefix:t.prefix})}return r.value}function Qs(e){return{value:e,selectionStart:0,selectionEnd:0,scrollWidth:0,clientWidth:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function ea(e,t,o,n,r){r=e&&Fs.has(e)||r;const s=(null!=n?n:function(e){const t=Object.values(Ws);if(!e)return t;const o={...e},n=[];for(const r of t)if(!sa(r)){if("token"in r&&r.token in e){const t={...r,...e[r.token]};ta(t)&&n.push(t),delete o[r.token];continue}n.push(r)}const r=Object.values(o);for(const e of r)ta(e)?n.push(e):console.warn(`Invalid ${e.type} token`,e);return n}(o)).sort((e,t)=>{const o="token"in e?e.token.length:-1,n="token"in t?t.token.length:-1;return o===n?0:o>n?-1:1});let a=[];[t,a]=function(e,t,o,n){let r,s=0,a="",l="",i="";const p=[];for(;a=ha(e);)a===t&&r!==n?(s++,s>1&&(i+=a)):a===o&&s&&r!==n?(s--,0===s?(l+=`{$${p.length}}`,p.push(i),i=""):i+=a):s?i+=a:r!==n||a!==t&&a!==o?l+=a:l=`${l.substring(0,l.length-1)}${a}`,r=a,e=e.substring(a.length);return[l,p]}(t,"{","}","\\");const l=a.length;t=s.reduce((e,t,o)=>"token"in t?e.replaceAll(`\\${t.token}`,"{“!”}").replaceAll(t.token,`{$${l+o}}`).replaceAll("{“!”}",t.token):e,t);const i=function(e,t,o){return e.reduce((e,n)=>{const[r,s]=function(e){const[t,...o]=e.split("|"),n=o.reduce((e,t)=>{const[o,n=!0]=t.split(":");return Object.assign(e,{[o]:n})},{});return[t,n]}(n);let a=ea(null,r,void 0,t,o);a=a.map(e=>{const t={...e};if("char"===t.type&&s.placeholder)t.placeholder=s.placeholder;else if("enum"===t.type)throw new Error("Groups cannot contain enums.");return t});const l={type:"group",parts:a,...s};return e.push(l),e},[])}(a,s,r).concat(s),p=/\{\$\d+\}/g,d=t.match(p),c=t.split(p).reduce((e,t,o)=>{if(t&&(t=t.replaceAll("\\",""),e.push({type:"literal",value:r?[...t].reverse().join(""):t})),d&&d[o]){const t=d[o],n=Number(t.substring(2,t.length-1));!isNaN(n)&&i[n]&&e.push(i[n])}return e},[]);return r&&c.reverse(),e&&Is.set(e,c),c}function ta(e){return!!e&&(sa(e)||oa(e)||na(e))}function oa(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&ra(e))}function na(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&ra(e))}function ra(e){return!!e&&("placeholder"in e&&"token"in e)}function sa(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function aa(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function la(e){var t,o;return[null!==(t=e.selectionStart)&&void 0!==t?t:e.value.length,null!==(o=e.selectionEnd)&&void 0!==o?o:e.value.length,"none"]}function ia(e,t){var o;Fs.has(e)&&qa(t);let n=!1;switch(Vs.set(e,"playing"),t.type){case"insert":n=function(e,t){let o=ua(t);const n=t.selectionBefore,r=function(e,t){var o,n,r;if("select"===As.get(e)){const[s,a]=Ea(e),l=s.findIndex(e=>aa(e,t.selectionBefore)),i=null!==(o=a[l])&&void 0!==o?o:null;if(oa(i)){const e=t.selectionBefore,o=e[1]-e[0],s=t.valueBefore.substring(e[0],e[1]),a="left"===i.selectDirection,l=wa(s,i),p=a?0:function(e,t,o){if(!e)return 0;let n="";for(;e.length;){const o=ha(e);e=e.substring(o.length),t.pattern.test(o)&&(n+=o)}return Math.min(Math.max(n.length,1),o)}(t.data,i,o);if(l.length>=o)return a||(t.insertPos=e[1]-p),(null!==(n=i.selectFill)&&void 0!==n?n:i.placeholder).repeat(o);const d=(null!==(r=i.selectFill)&&void 0!==r?r:i.placeholder).repeat(o-l.length-(a?0:p));return t.insertPos=a?e[0]+l.length:e[1]-p,"left"===i.selectDirection?`${l}${d}`:`${d}${l}${i.placeholder}`}if(na(i)){const e=t.selectionBefore;return t.valueBefore.substring(e[0],e[1])}}return""}(e,t);o=`${o.substring(0,n[0])}${r}${o.substring(n[1])}`;const s=ka(e,t,o);return Ls.set(e,s.endPos),{...t,valueAfter:s.value,selectionAfter:_a(e,s),unmasked:s.unmasked,complete:s.complete,meta:s.meta}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":n=function(e,t){const o=ua(t),n=t.selectionBefore,r=Fs.has(e);let s=n[0],a=n[1];s===a&&("deleteContentBackward"!==t.type||r?a+=ma(o,s):s-=ma(o,s,"backward"));const l=As.get(e);let i="";if("select"===l){const[o,n]=Ea(e),r=Ra(e,[s,a,"none"]);if(void 0!==r){const l=n[r],p=o[r];oa(l)?i=l.placeholder.repeat(a-s):na(l)&&([i,s]=aa(p,la(e))?[l.placeholder,s]:function(e,t,o,n){const r=n.valueBefore,s=ma(r,n.selectionBefore[0],"backward"),a=Math.max(o[0],n.selectionBefore[0]-s),l=r.substring(o[0],a),i=Ma(t.values,l);let p=null==i?void 0:i.substring(l.length);i&&!p&&Va(t.values,i)&&(p=i);return[null!=p?p:t.placeholder,p?a:o[0]]}(0,l,p,t))}}const p=`${o.substring(0,s)}${i}${o.substring(a)}`,d=ka(e,t,p);return{...t,valueAfter:d.value,selectionAfter:Aa(e,d,t,s),unmasked:d.unmasked,complete:d.complete,meta:d.meta}}(e,t)}if(Fs.has(e)&&n&&qa(n),n&&function(e,t){t.prefix&&(t.valueAfter=t.prefix+t.valueAfter,t.selectionAfter=da(e,t.selectionAfter));t.suffix&&(t.valueAfter+=t.suffix)}(e,n),n&&function(e){return e.valueBefore!==e.valueAfter||e.selectionBefore[0]!==e.selectionAfter[0]||e.selectionBefore[1]!==e.selectionAfter[1]}(n)){Ms.has(e)&&Hs.set(e,()=>{Hs.delete(e),n&&Ms.get(e)(n,e)}),Vs.set(e,"beforeCallback");let t=null!==(o=_s.get(e))&&void 0!==o?o:[];const r=ks.get(e);r&&(t=t.slice(0,r),ks.delete(e)),t.push(n),_s.set(e,t),zs&&ke()===e&&"function"==typeof document.execCommand&&!Us?(fa(e,[0,e.value.length,"forward"],!0),Us=!0,document.execCommand("insertText",void 0,n.valueAfter),Us=!1):va(e,n),zs&&ke()===e&&fa(e,n.selectionAfter);const s=Hs.get(e);s&&s(),za(e)}Vs.set(e,"complete")}function pa(e,t){var o,n;const r=null!==(o=Ps.get(e))&&void 0!==o?o:"",s=null!==(n=Bs.get(e))&&void 0!==n?n:"";return r&&t.startsWith(r)&&(t=t.substring(r.length)),s&&t.endsWith(s)&&(t=t.substring(0,t.length-s.length)),t}function da(e,t){const o=Ps.get(e),n=[...t];return o&&(n[0]+=o.length,n[1]+=o.length),n}function ca(e,t){const o=Ps.get(e),n=[...t];return o&&(n[0]-=o.length,n[1]-=o.length),n}function ua(e){let t=e.valueBefore;const o=e.selectionBefore;if(e.suffix&&t.endsWith(e.suffix)&&(t=t.substring(0,t.length-e.suffix.length),e.valueBefore=t,o[0]>=t.length&&(o[0]=t.length),o[1]>=t.length&&(o[1]=t.length)),e.prefix&&t.startsWith(e.prefix)){const n=e.prefix.length;t=t.substring(n),e.valueBefore=t,o[0]=Math.max(o[0]-n,0),o[1]=Math.max(o[1]-n,0)}return t}function fa(e,t,o=!1){o&&(Ss.add(e),setTimeout(()=>Ss.delete(e),5)),Ts.get(e)&&Ts.set(e,t),e.setSelectionRange(...t)}function va(e,t,o="After"){if(e.value=t[`value${o}`],zs){const o=new InputEvent("input",{inputType:"insert"===t.type?"insertText":t.type,data:t.data});e.dispatchEvent(o)}}function ha(e){if(null==e)return"";const t=Cs.test(e.charAt(0))&&Cs.test(e.charAt(1))?2:1;return e.substring(0,t)}function ma(e,t,o="forward"){if("backward"===o)return 0===t?0:1===t?1:Cs.test(e.charAt(t))&&Cs.test(e.charAt(t-1))?2:1;const n=e.length-t;return 0===n?0:1===n?1:ha(e.substring(t)).length}function ga(e,t){const o=ha(e.data),n=o.length;if(e.value+=o,e.pos+=n,"string"==typeof e.data&&(e.data=e.data.substring(n),e.data.length||(e.endPos=e.pos)),t)return t.substring(n)}function $a(e){const t=ha(e.buffer),o=t.length;e.value+=t,e.pos+=o,e.buffer=e.buffer.substring(o)}function ba(e,t){const o=ha(t),n=o.length;return e.value+=o,e.pos+=n,t.substring(n)}function ya(e,t){for(;t.buffer;){const o=ha(t.buffer);if(e.pattern.test(o)||t.placeholder&&e.placeholder===o)return void("replace"!==t.mode&&"select"!==t.mode||(t.buffer=t.buffer.substring(o.length)));t.buffer=t.buffer.substring(o.length)}}function xa(e,t){const o=e.values.concat([e.placeholder]).map(e=>e.toLowerCase()).sort((e,t)=>e.length>t.length?-1:1);for(;t.buffer;){const e=t.buffer.toLowerCase(),n=o.find(t=>e.startsWith(t));if(n){const e=t.buffer.substring(0,n.length);return t.buffer=t.buffer.substring(n.length),e}t.buffer=t.buffer.substring(ma(t.buffer,0))}return null}function wa(e,t){let o=e.replaceAll(t.placeholder,"");const n="left"===t.selectDirection;if(t.selectFill){const e=new RegExp(`${n?"":"^"}${r=t.selectFill,r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}+${n?"$":""}`);o=o.replace(e,"")}var r;return o}function _a(e,t){let o=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return o;const n=la(e);o=[n[0],t.endPos,"none"];const[r,s]=Ea(e,t.value),a=Ra(e,o,[r,s]);if(void 0===a)return o;if(!(a in r)||!(a in s))return o;const l=r[a],i=s[a],p=t.value.slice(l[0],l[1]);if(oa(i)&&wa(p,i).length===p.length&&a<r.length-1)return Ks(),r[a+1];if(na(i)&&t.insertPos>=l[0]&&t.insertPos<=l[1]){if(t.cycle)return l;const o=function(e,t,o){if(null===e.originalData)return 0;const n=e.insertPos>=t?e.value.substring(t,e.insertPos):"",r=`${n}${e.originalData}`,s=Ma(o.values,r);if(s)return Ta(r,s).length-n.length;return 0}(t,l[0],i);if(t.insertPos+o===l[1])return Va(i.values,p)?[l[1],l[1],"forward"]:(Ks(),r[a+1]?r[a+1]:r[a]);const s=[t.insertPos+o,l[1],"none"];return aa(s,n)||(Ss.add(e),setTimeout(()=>Ss.delete(e),5)),s}return l}function ka(e,t,o,n){var r,s;const a=null!==(r=Is.get(e))&&void 0!==r?r:[],l={pos:0,insertPos:null!==(s=t.insertPos)&&void 0!==s?s:t.selectionBefore[0],range:t.selectionBefore,chars:0,placeholder:Ds.has(e),buffer:o,data:t.data,originalData:t.data,value:"",mode:As.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:Ea(e),unmasked:"",complete:!0,cycle:t.cycle,meta:[]};return Sa(a,l,void 0,n),l}function Sa(e,t,o,n){var r,s;const a={...t};(null==o?void 0:o.placeholder)&&(t.placeholder=!0);const l=(null==o?void 0:o.repeat)&&"literal"===(null===(r=o.nextPart)||void 0===r?void 0:r.type)?o.nextPart.value:null;let i=0;const p=e.reduce((e,t)=>e+("char"===t.type?1:0),0),d=t.chars;for(const o of e){const r=e[i+1];switch(o.type){case"literal":Ia(o,t,e.at(-1)===o);break;case"char":Da(o,t,l);break;case"enum":La(o,t);break;case"group":const a={repeat:null!==(s=o.repeat)&&void 0!==s&&s,nextPart:r,repeats:0,placeholder:!!o.placeholder};Sa(o.parts,t,a,n)}if(n){if(!1===n(t,o))break}const a=sa(r)&&i+2===e.length&&d!==t.chars;if(!(t.buffer||t.data||t.placeholder||a))break;i++}if(t.chars<p&&(t.complete=!1),o){const r=t.chars-d,s=r===p,i=!(!t.data||l&&t.data.startsWith(l)&&t.insertPos<=t.pos),c=!(t.buffer&&l&&t.buffer.startsWith(l)&&t.insertPos>=t.pos+l.length)&&(t.buffer||i);if(o.repeat&&c&&s)return o.repeats++,Sa(e,t,o,n);if(!s){t.complete=!1;const o=e.reverse().find(e=>"literal"===e.type);e.reverse(),sa(o)&&t.value.endsWith(o.value)&&(t.value=t.value.substring(0,t.value.length-o.value.length),t.pos=t.value.length)}p>1&&r<p&&0!==r&&t.insertPos<=t.pos?t.data="":o.repeat&&!s&&o.repeats&&Object.assign(t,a)}t.placeholder=a.placeholder}function La(e,t){const[o,n]=t.rangeParts,r=o[n.indexOf(e)];if(r&&(t.insertPos<=t.pos||t.insertPos>=r[0]&&t.insertPos<=r[1])&&t.data){const o=t.buffer.substring(0,t.insertPos-t.pos),n=`${o}${t.data}`,r=Ma(e.values.concat([e.placeholder]),n);if(r){const s=Ta(n,r);return t.data=t.data.substring(s.length),t.value+=r,r!==e.placeholder?t.unmasked+=r:t.complete=!1,t.meta.push({type:r!==e.placeholder?"enum":"placeholder",value:r}),o?t.buffer=t.buffer.substring(o.length):xa(e,t),t.endPos=t.pos+s.length,void(t.pos=t.value.length)}t.data=""}if(t.buffer){const o=xa(e,t);if(o)return t.value+=o,o!==e.placeholder?t.unmasked+=o:t.complete=!1,t.meta.push({type:o!==e.placeholder?"enum":"placeholder",value:o}),void(t.pos=t.value.length)}t.complete=!1,t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder}),t.pos=t.value.length}function Ia(e,t,o){let n=e.value;if(""===t.data&&!t.buffer&&!t.placeholder&&!o)return;let r=!1;for(;n;){const e=t.insertPos<=t.pos?ha(t.data):"",s=ha(n);if(e===s)n=ga(t,n),t.meta.push({type:"literal",value:s}),r=!0;else if(!r||t.data||null===t.data||t.placeholder||o)n=ba(t,n),t.meta.push({type:"literal",value:s});else if(r&&!t.data)break;t.buffer.startsWith(s)&&(t.buffer=t.buffer.substring(s.length))}null===t.data&&!t.buffer&&t.insertPos<=t.pos&&!t.placeholder&&(t.value=t.value.substring(0,t.value.length-e.value.length),t.pos=t.endPos=t.value.length)}function Da(e,t,o){var n;let r=!0;if(t.insertPos<=t.pos)for(;null===(n=t.data)||void 0===n?void 0:n.length;){const n=ha(t.data);if(e.pattern.test(n))return ga(t),t.meta.push({type:"char",value:n}),t.chars++,t.unmasked+=n,void ya(e,t);if("string"==typeof t.data){if(o&&t.data.startsWith(o)){r=!1;break}t.data=t.data.substring(n.length)}}for(;r&&t.buffer;){const n=ha(t.buffer);if(e.pattern.test(n))return t.chars++,t.unmasked+=n,$a(t),void t.meta.push({type:"char",value:n});if(t.placeholder&&n===e.placeholder)return $a(t),void t.meta.push({type:"placeholder",value:n});if("string"==typeof t.buffer){if(o&&t.buffer.startsWith(o)){t.buffer=t.buffer.substring(o.length);break}t.buffer=t.buffer.substring(n.length)}}t.placeholder?(t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder})):t.endPos=t.pos}function Aa(e,t,o,n){const r=[n,n,"none"];if("select"===t.mode){const s=Ea(e),a=Ra(e,r,s),[l,i]=Ea(e,t.value),p=void 0!==a&&Ca(o.valueBefore,s[0][a],s[1][a]);if(void 0!==a&&a in l){if(p){const e=l.slice(a).every((e,o)=>Ca(t.value,e,i[a+o]));return e&&l[a-1]?l[a-1]:l[a]}return[n,l[a][1],"none"]}}return r}function Ca(e,t,o){if(sa(o))return!1;if(oa(o)){let n=t[0];for(;n<t[1];){const t=ha(e.substring(n));if(t!==o.placeholder)return!1;n+=t.length}}return!na(o)||e.substring(t[0],t[1])===o.placeholder}function Ta(e,t){let o="";do{const n=ha(e).toLowerCase(),r=ha(t).toLowerCase();if(n!==r)break;o+=n,e=e.substring(n.length),t=t.substring(r.length)}while(e.length&&t.length);return o}function Ea(e,t){const o=Is.get(e);if(!o)return[[],[]];if(Es.has(e))return Es.get(e);const n=null!=t?t:pa(e,e.value),r=[],s=[];let a=null,l=null,i=0,p=!0;for(const e of o)if(sa(e))a=e,null!==l&&(r.push([l,i,"none"]),l=null),i+=e.value.length;else{if(oa(a)&&oa(e)&&e.token===a.token)i++;else if(oa(e))null===l?(l=i,s.push(e)):(r.push([l,i,"none"]),l=i,s.push(e)),i++;else if(na(e)){l&&r.push([l,i,"none"]),Fa(e)||(p=!1);const t=Oa(n,e,i);l=null,r.push([i,i+t,"none"]),s.push(e),i+=t}a=e}null!==l&&r.push([l,i,"none"]);const d=[[...r],[...s]];return p&&!t&&Es.set(e,d),d}function Oa(e,t,o){if(Fa(t))return t.values[0].length;const n=e.slice(o),r=Ma(t.values.concat([t.placeholder]),n);return r?r.length:0}function Ma(e,t,o=null,n){var r;if(0===t.length)return o;if(!n){const o=e.find(e=>e.toLowerCase()===t.toLowerCase());if(o)return o}const s=ha(t.toLowerCase()),a=`${null!=n?n:""}${s}`,l=e.filter(e=>e.toLowerCase().startsWith(a)),i=l.find(e=>e.toLowerCase()===a);return i&&(o=i),0===l.length?o:1===l.length?l[0]:(l.length>1&&(o=l[0]),null!==(r=Ma(l,t.substring(s.length),o,a))&&void 0!==r?r:l[0])}function Va(e,t){return t=t.toLowerCase(),e.some(e=>(e=e.toLowerCase()).startsWith(t.toLocaleLowerCase())&&e!==t)}function Fa(e){if(!Os.has(e)&&Array.isArray(e.values)&&e.values.length>0){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;Os.set(e,e.values.every(e=>e.length===t))}return Os.get(e)}function Pa(e,t=1){const[o]=Ea(e),n=Ra(e,ca(e,la(e)));return void 0!==n&&void 0!==o[n+t]&&(e.setSelectionRange(...da(e,o[n+t])),!0)}function Ba(e,t=1){const[o,n]=Ea(e),r=Ra(e,la(e));if(void 0!==r&&r in n){const s=n[r];if(na(s)){const n=o[r],a=e.value.slice(n[0],n[1]);let l=null,i=s.values.indexOf(a);const p=s.values.length-1;if(-1!==i){const e=i+t;i=e<0?p:e>p?0:e,l=s.values[i]}else a===s.placeholder&&(l=t>0?s.values[0]:s.values[p]);if(null!==l){const t={selectionBefore:n,insertPos:n[0],type:"insert",data:l,valueBefore:e.value,cycle:!0};return setTimeout(()=>ia(e,t),0),!0}}}return!1}function Ha(e,t){if(!e.length)return-1;if(1===e.length)return e[0];const o=e.length/2,n=Number.isInteger(o)?o:Math.floor(o),r=Math.abs(t-e[n-1])<Math.abs(t-e[n])?[0,n]:[n];return Ha(e.slice(...r),t)}function Ra(e,t,o){const[n]=null!=o?o:Ea(e),r=n.findIndex(e=>e[0]!==e[1]&&(!!aa(e,t)||t[1]>e[0]&&t[1]<e[1]));if(-1!==r)return r;const[s,a]=n.reduce((e,t,o)=>(e[0].add(t[0]),e[0].add(t[1]),e[1][t[0]]=o,e[1][t[1]]=o,e),[new Set,{}]),l=Ha([...s],0===t[0]&&t[1]===e.value.length?0:t[1]);return l in a?a[l]:void 0}function Na(e){var t,o;const n=null!==(t=_s.get(e))&&void 0!==t?t:[];return n[null!==(o=ks.get(e))&&void 0!==o?o:n.length-1]}function Ka(e,t=!1){const o=Na(e);return o&&(o.complete||t)?Fs.has(e)?[...o.unmasked].reverse().join(""):o.unmasked:t?"":null}function Wa(e){var t;const o=Na(e);return null!==(t=null==o?void 0:o.meta)&&void 0!==t?t:null}function qa(e){const t=e=>[...e].reverse().join(""),o=(e,t)=>[t-e[1],t-e[0],e[2]];e.data&&(e.data=t(e.data)),e.valueBefore=t(e.valueBefore),"valueAfter"in e&&(e.valueAfter=t(e.valueAfter)),"selectionAfter"in e&&(e.selectionAfter=o(e.selectionBefore,e.valueAfter.length)),e.selectionBefore=o(e.selectionBefore,e.valueBefore.length)}function za(e){if(e.scrollWidth>e.clientWidth&&null!==e.selectionStart&&null!==e.selectionEnd){const t=e.selectionStart/e.value.length,o=e.selectionEnd/e.value.length;e.scrollLeft=o>.9?e.scrollWidth:t*e.scrollWidth-20,e.dispatchEvent(new CustomEvent("input-scroll",{bubbles:!1,detail:e.scrollLeft}))}}const Ua="undefined"!=typeof window,Ya=new WeakSet,ja=new WeakSet,Za=new WeakSet,Ga=new WeakMap,Xa=new WeakMap,Ja=new WeakSet,Qa=new WeakSet;function el(e){e.props.selectedMonth=e.props.selectedYear=e.props.selectedDay=e.props.selectedWeek=void 0}function tl(e){var t,o,n;e.props.selectedMonth=e.props.months.findIndex(t=>rl(t,e.props.activeDate)),e.props.selectedYear=e.props.years.findIndex(t=>nl(t,e.props.activeDate));for(let s=0;s<(null===(t=e.props.calendar[0])||void 0===t?void 0:t.weeks.length);s++)for(let t=0;t<(null===(o=e.props.calendar[0])||void 0===o?void 0:o.weeks[s].length);t++){const o=null===(n=e.props.calendar[0])||void 0===n?void 0:n.weeks[s][t];if(r.sameDay(o,e.props.activeDate)){e.props.selectedWeek=s,e.props.selectedDay=t;break}}}function ol(e){return"timeZoneName"!==e.partName}function nl(e,t){return t instanceof Date&&e.getFullYear()===t.getFullYear()}function rl(e,t){return t instanceof Date&&e.getMonth()===t.getMonth()}function sl(e){e.props.skipBuildCalendar||el(e),e.props.selectedIndex=e.props.calendar=_(e.props.showMonths,e=>e).map(t=>function(e,t){const o=[],n=r.date(t);n.setDate(1);let s=r.weekStart(n,e.props.weekStart);s.setHours(n.getHours(),n.getMinutes(),n.getSeconds());const a=r.weekEnd(r.monthEnd(t),e.props.weekStart);let l=[];do{l.push(s),7===l.length&&(o.push(l),l=[]),s=r.addDay(s)}while(s.getTime()<=a.getTime());return{monthDay:n,weeks:o}}(e,r.addMonth(e.props.renderedDate,t))),e.props.years=function(e){const t=Number(r.format(e.props.renderedDate,"YYYY")),o=t-t%10;return e.props.decade=`${o} - ${o+9}`,_(10,n=>r.addYear(e.props.renderedDate,o+n-t))}(e),e.props.months=function(e){const t=r.date(e.props.renderedDate);return t.setMonth(0),_(12,e=>r.addMonth(t,e))}(e),e.props.skipBuildCalendar?e.props.skipBuildCalendar=!1:e.value&&tl(e)}function al(e,t){var o;t.target&&t.target instanceof Element&&(t.target.closest(`#${e.props.id}_popover`)||!(null===(o=e.props.__root)||void 0===o?void 0:o.contains(t.target)))||(e.props.expanded=!1)}function ll(e,t){if(!t)return e.props.inputText="",new Date;const o=t instanceof Date?t:r.parse(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(o,e.props.format,e.props.locale,!1,ol),o}function il(t){return Array.isArray(t.props.sequence)?e.clone(t.props.sequence):["day"]}function pl(e,t,o=!0){var n,s;if(e._value===t)return;if(null==t)return e.input(t,o);e.props.offset=e.props.timezone?r.offset(t,e.props.timezone):"+0000";const a=r.applyOffset(t,null!==(n=(s=e.props).offset)&&void 0!==n?n:s.offset="+0000");e.input(r.format(a,e.props.valueFormat,e.props.valueLocale,!1),o)}function dl(e,t){var o;const n=["prev_button","month_button","day_button","year_button","next_button"].find(t=>{var o;return null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${t}`)}),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${n}`);r instanceof HTMLElement&&(t.preventDefault(),r.focus())}function cl(e,t){let o="";if(!(t instanceof HTMLInputElement)||e.props.pickerOnly)return;Ga.set(e,t);const n=t=>{e.props.expanded&&t.target instanceof HTMLElement&&t.target.closest(`#${e.props.id}_popover`)?Qa.add(e):Qa.delete(e)},s=e.props.__root;s&&(s.addEventListener("click",n),De(e,()=>s.removeEventListener("click",n))),e.on("prop:inputText",({payload:e})=>{e!==t.value&&("beforeCallback"===Vs.get(t)&&(o=t.value),Gs(t),t.selectionStart=0,t.selectionEnd=t.value.length,function(e,t){var o,n;if(!_s.has(e))return;const r=null!==(o=Ps.get(e))&&void 0!==o?o:"",s=null!==(n=Bs.get(e))&&void 0!==n?n:"";ia(e,{type:"insert",selectionBefore:la(e),data:t,valueBefore:e.value,suffix:s,prefix:r})}(t,e),t.value=e,setTimeout(()=>Xs(t),10))});const[a,l]=function(e){const t=e.props.locale,o=["full","long","medium","short"].includes(e.props.format)||"object"==typeof e.props.format,n=r.parts(e.props.format,t),s=r.formatStr(e.props.format,t,!0,ol);return[s,n.reduce((n,s)=>{if("literal"===s.partName)return n;let a=r.range(s.token,t,o);if("YYYY"===s.token&&e.props.minDate&&e.props.maxDate){const t=e.props.minDate.getFullYear();a=_(e.props.maxDate.getFullYear()-t+1,e=>String(t+e))}const l={type:"enum",token:s.token,values:a,placeholder:"A"===s.token?"A/P":s.token,selectDirection:"left"};return n.push(l),s.token.startsWith("D")&&Xa.set(e,a),n},[])]}(e);Zs(t,{pattern:a,explicitParts:l,onChange:({valueAfter:n})=>{if(ul(e),Ya.has(e))return Ya.delete(e);o&&o===n?o="":(Gs(t),e.props.inputText=n,setTimeout(()=>Xs(t),10))}},e)}function ul(e){var t,o;if(e.props.overlay){const n=Ga.get(e);!n||!(null===(t=e.props.attrs)||void 0===t?void 0:t.placeholder)||e._value||Ka(n,!0)||e.props._isFocused||e.props.activeDate&&e.props.expanded?n&&(e.props._isPlaceholder=!1,e.props._overlayParts=_e(Wa(n))):(e.props._isPlaceholder=!0,e.props._overlayParts=[{type:"placeholder",value:null===(o=e.props.attrs)||void 0===o?void 0:o.placeholder}])}}function fl(e,t){return!t||(!(!e.props.minDate||!r.isBefore(t,e.props.minDate))||(!(!e.props.maxDate||!r.isAfter(t,e.props.maxDate))||void 0))}function vl(e){return"function"==typeof e.props.validationLabel?e.props.validationLabel(e):e.props.validationLabel||e.props.label||e.props.name||String(e.name)}const hl="undefined"!=typeof window,ml=new WeakMap;function gl(e,t){var o,n;if(t instanceof HTMLInputElement&&!ml.get(e)&&hl){const r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_overlay`),s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_overlay_inner`);if(r&&t&&s){ml.set(e,r);const o=getComputedStyle(t).color;t.style.color="transparent",t.style.caretColor=o;const n=new ResizeObserver(()=>{var o;const n=getComputedStyle(t),r=t.getBoundingClientRect(),s=null===(o=t.parentElement)||void 0===o?void 0:o.getBoundingClientRect();e.props._overlayStyles={...e.props._overlayStyles,width:n.width,height:n.height,boxSizing:n.boxSizing,padding:n.padding,margin:n.margin,fontSize:n.fontSize,lineHeight:n.lineHeight,top:r.top-((null==s?void 0:s.top)||r.top)+"px",left:r.left-((null==s?void 0:s.left)||r.left)+"px"}});n.observe(t);const a=e=>{s.scrollLeft=e.detail};t.addEventListener("input-scroll",a),e.on("destroyed",()=>{t.removeEventListener("input-scroll",a),n.disconnect()})}}}function $l(t){t.addProps(["_overlayStyles","_overlayParts","_overlayInnerStyles","_isPlaceholder"]),t.props._overlayStyles={position:"absolute",top:"0",left:"0",pointerEvents:t.props._isPlaceholder?"auto":"none"},t.props._overlayInnerStyles={overflow:"hidden",whiteSpace:"nowrap",paddingRight:"20px"},t.on("created",()=>{t.props.overlay=e.undefine(t.props.overlay),t.props.pickerOnly=e.undefine(t.props.pickerOnly),t.props.overlay=t.props.pickerOnly?void 0:t.props.overlay,t.props.overlay&&e.whenAvailable(`${t.props.id}`,gl.bind(null,t),t.props.__root)}),t.on("prop:_isPlaceholder",()=>{t.props._overlayStyles={...t.props._overlayStyles,pointerEvents:t.props._isPlaceholder?"auto":"none"}})}const bl={schema:/* #__PURE__ */Dr(/* #__PURE__ */Ar(/* #__PURE__ */Er("$label"),/* #__PURE__ */Cr(/* #__PURE__ */Tr("prefix"),/* #__PURE__ */Or(),/* #__PURE__ */bs(/* #__PURE__ */xs(/* #__PURE__ */ys(/* #__PURE__ */hs("$part.value"),/* #__PURE__ */ms("$part.value"),/* #__PURE__ */gs("$part.value"),/* #__PURE__ */$s("$part.value")))),/* #__PURE__ */Br(),/* #__PURE__ */Hr(/* #__PURE__ */ns(/* #__PURE__ */Kr(/* #__PURE__ */Wr("$ui.prev.value"),/* #__PURE__ */Tr("prev")),/* #__PURE__ */rs("$decade"),/* #__PURE__ */ss(/* #__PURE__ */is()),/* #__PURE__ */as(/* #__PURE__ */ps(),/* #__PURE__ */is()),/* #__PURE__ */ls(/* #__PURE__ */ps(),/* #__PURE__ */ds(),/* #__PURE__ */is()),/* #__PURE__ */Rr(/* #__PURE__ */Nr("$ui.next.value"),/* #__PURE__ */Tr("next")),/* #__PURE__ */vs(/* #__PURE__ */Tr("close"))),/* #__PURE__ */ws(/* #__PURE__ */Qr(/* #__PURE__ */es("$fns.format($year, $yearFormat)")),/* #__PURE__ */ts(/* #__PURE__ */os("$fns.format($month, $monthFormat)")),/* #__PURE__ */qr(/* #__PURE__ */Ur(/* #__PURE__ */Yr(/* #__PURE__ */jr("$fns.format($day, $weekdayFormat)"))),/* #__PURE__ */zr(/* #__PURE__ */Zr(/* #__PURE__ */Gr(/* #__PURE__ */Xr("$fns.format($day, $dateFormat)"))))),/* #__PURE__ */us(/* #__PURE__ */fs()))),/* #__PURE__ */cs(/* #__PURE__ */Tr("clear")),/* #__PURE__ */Jr(/* #__PURE__ */Tr("calendar")),/* #__PURE__ */Mr(),/* #__PURE__ */Tr("suffix"))),/* #__PURE__ */Vr("$help"),/* #__PURE__ */Fr(/* #__PURE__ */Pr("$message.value"))),type:"input",family:"text",props:["dateFormat","dayButtonFormat","format","monthButtonFormat","monthFormat","overlay","pickerOnly","showMonths","showPagination","weekStart","weekdayFormat","yearFormat","years"],features:[$l,function(o){var n,s,a,l,i,p,d,c,u,f,v,h,m,g,$,b,y,x,w,k,S,L;o.addProps(["_isDisabled","_isFocused","activeDate","calendar","clearable","disabled","decade","disabledDays","expanded","inputText","localTime","maxDate","maxScan","minDate","months","offset","paginatedPanels","panel","pickerOnly","renderedDate","sequence","timezone","valueFormat","valueLocale","showPanelClose","selectedDay","selectedWeek","selectedMonth","selectedYear"]),o.hook.prop((e,t)=>("expanded"===e.prop&&o.props.disabled&&(e.value=!1),"weekStart"===e.prop&&(e.value=Number(e.value||0)),"showMonths"===e.prop&&(e.value=Number(e.value||1)),"maxScan"===e.prop&&(e.value=Number(e.value||7)),"timezone"===e.prop&&("string"==typeof o._value||o._value instanceof Date)&&(o.props.offset=r.offset(o._value,e.value)),t(e))),o.props._isFocused=!1,o.props._isPlaceholder=!1,null!==(n=(h=o.props).valueFormat)&&void 0!==n||(h.valueFormat="ISO8601"),null!==(s=(m=o.props).weekdayFormat)&&void 0!==s||(m.weekdayFormat="d"),null!==(a=(g=o.props).monthFormat)&&void 0!==a||(g.monthFormat="MMM"),null!==(l=($=o.props).monthButtonFormat)&&void 0!==l||($.monthButtonFormat="MMMM"),null!==(i=(b=o.props).dayButtonFormat)&&void 0!==i||(b.dayButtonFormat="D"),null!==(p=(y=o.props).dateFormat)&&void 0!==p||(y.dateFormat="D"),null!==(d=(x=o.props).yearFormat)&&void 0!==d||(x.yearFormat="YYYY"),null!==(c=(w=o.props).paginatedPanels)&&void 0!==c||(w.paginatedPanels=["day","year"]),null!==(u=(k=o.props).valueLocale)&&void 0!==u||(k.valueLocale=o.props.locale),null!==(f=(S=o.props).format)&&void 0!==f||(S.format="long"),o.props.panels=il(o),o.props.pickerOnly=e.undefine(o.props.pickerOnly),"disabled"in o.props&&(o.props.disabled=e.undefine(o.props.disabled)),"clearable"in o.props&&(o.props.clearable=e.undefine(o.props.clearable)),null!==(v=(L=o.props).maxScan)&&void 0!==v||(L.maxScan=7),o.props._isDisabled="function"==typeof o.props.disabledDays?o.props.disabledDays.bind(null,o):fl.bind(null,o),o.props.calendar=[],o.props.inputText="",o.props.showMonths=o.props.showMonths||1,"function"==typeof o.props.format?(o.props.formatDate=o.props.format,o.props.format=null):o.props.formatDate=r.format,sl(o),o.on("mounted",()=>{e.whenAvailable(`${o.props.id}`,cl.bind(null,o),o.props.__root)}),o.on("created",()=>{if(function(e){const t=e._value;let o=new Date;if(t instanceof Date)o=r.date(t);else if("string"==typeof t)try{const n=r.parse(t,e.props.valueFormat,e.props.valueLocale);o=r.date(n)}catch{console.warn(`Date (${t}) does not match format (${r.formatStr(e.props.valueFormat,e.props.valueLocale)})`),o=void 0}else t||(o=void 0);if(e.props.offset=e.props.timezone?r.offset(o||new Date,e.props.timezone):"+0000",e.props.minDate){const t="string"==typeof e.props.minDate?r.parse(e.props.minDate):e.props.minDate;e.props.minDate=r.removeOffset(t,e.props.offset)}if(e.props.maxDate){const t="string"==typeof e.props.maxDate?r.parse(e.props.maxDate):e.props.maxDate;e.props.maxDate=r.removeOffset(t,e.props.offset)}o=o&&r.removeOffset(o,e.props.offset),o&&pl(e,o,!1);let n=o||new Date;e.props.minDate&&n<e.props.minDate?n=e.props.minDate:e.props.maxDate&&n>e.props.maxDate&&(n=e.props.maxDate),e.props.renderedDate=n,e.props.activeDate=n,e.props.localTime=o&&r.format(o,"HH:mm")||"12:00"}(o),o.context){const e={};let t;o.context.fns.format=(t,n)=>{if(e[n]&&e[n][t.toString()])return e[n][t.toString()];const s=r.format(t,n,o.props.locale||"en",!1,ol);return e[n]?e[n][t.toString()]=s:e[n]={[t.toString()]:s},s},o.context.fns.isDisabled=o.props._isDisabled,o.context.fns.isDisabledMonth=e=>!r.nearestDay(e,e=>!o.props._isDisabled(e),"month"),o.context.fns.isDisabledYear=e=>!r.nearestDay(e,e=>!o.props._isDisabled(e),"year"),o.context.handlers._blur=e=>{var t,n;o.props._isFocused=!1,"function"==typeof(null===(t=o.context)||void 0===t?void 0:t.handlers.blur)&&(null===(n=o.context)||void 0===n||n.handlers.blur(e))},o.context.handlers.closePanel=()=>{o.props.expanded=!1},o.context.handlers._blurOut=e=>t=>{var n;t.preventDefault(),o.props.keydown?o.props.keydown=!1:e&&e!==o.props.panel||o.props.pickerOnly&&t.relatedTarget instanceof Element&&(t.relatedTarget===document.getElementById(`${o.props.id}_inner`)||t.relatedTarget.closest(`#${o.props.id}_inner`))||t.relatedTarget&&t.relatedTarget instanceof Element&&(t.relatedTarget.closest(`#${o.props.id}_popover`)||!(null===(n=o.props.__root)||void 0===n?void 0:n.contains(t.relatedTarget))||t.relatedTarget.id===`${o.props.id}_popover`)||(o.props.expanded=!1)},o.context.handlers.overlayClick=()=>{const e=Ga.get(o);e&&(e.focus(),o.props._isPlaceholder=!1)},o.context.handlers.focus=()=>{o.props.pickerOnly||(o.props._isFocused=!0,o.props.pickerOnly&&!ja.has(o)&&(Za.add(o),o.props.expanded=!0,setTimeout(()=>Za.delete(o),200)))},o.context.handlers.clear=()=>{var e,t;pl(o,void 0,!0),ll(o,void 0);const n=null===(t=null===(e=o.props)||void 0===e?void 0:e.__root)||void 0===t?void 0:t.getElementById(`${o.props.id}`);n instanceof HTMLInputElement&&(n.focus(),setTimeout(()=>{n.setSelectionRange(0,0)},50))},o.context.handlers.dateInput=e=>{var t;if(Ja.has(o))return Ja.delete(o);if(e.target instanceof HTMLInputElement&&!o.props.expanded)try{let n=r.parse({date:e.target.value,format:o.props.format,locale:o.props.locale,partFilter:ol});if(function(e){return r.parts(e.props.format,e.props.locale).some(e=>"weekday"===e.partName)}(o)&&o.props.activeDate instanceof Date&&o.props.activeDate.getTime()===n.getTime()&&!Rs.get(e.target)&&r.format(n,o.props.format,o.props.locale,!1,ol)!==e.target.value){const s=r.range("dddd",o.props.locale),a=r.parts(o.props.format,o.props.locale),l=null===(t=r.parseParts(e.target.value,a).find(e=>"dddd"===e.token))||void 0===t?void 0:t.value,i=r.format(n,"dddd",o.props.locale);if(l&&s.includes(l)&&i!==l){let e=s.indexOf(l)-s.indexOf(i);e=e<-1?7+e:e,n=r.addDay(n,e),Ya.add(o)}}pl(o,n)}catch(e){pl(o,void 0)}},o.context.handlers.open=()=>{o.props.expanded=!0},o.context.handlers.next=()=>{switch(o.props.panel){case"year":return void(o.props.renderedDate=r.addYear(o.props.renderedDate,10));case"day":return void(o.props.renderedDate=r.addMonth(o.props.renderedDate,1))}},o.context.handlers.prev=()=>{switch(o.props.panel){case"year":return void(o.props.renderedDate=r.addYear(o.props.renderedDate,-10));case"day":return void(o.props.renderedDate=r.addMonth(o.props.renderedDate,-1))}},o.context.handlers.setDate=e=>()=>{"month"!==o.props.panel&&"year"!==o.props.panel||!o.props.activeDate||(e=o.props.activeDate),o.emit("dateSelected",e)},o.context.handlers.localTime=e=>{const t=e.target;if(!t.value)return;const[n,r]=t.value.split(":");o.props.localTime=t.value,o.props.activeDate.setHours(n,r),ll(o,o.props.activeDate)},o.context.handlers.keyDown=e=>{switch(o.props.keydown=!0,o.props.panel){case"day":return o.emit("calendarKeydown",e);case"year":return o.emit("yearKeydown",e);case"month":return o.emit("monthKeydown",e);case"time":return o.emit("timeKeydown",e);default:return}},o.context.handlers.inputKeydown=e=>{o.emit("keydown",e)},o.context.handlers.openKeydown=e=>{"Enter"!==e.key&&"Space"!==e.key||(o.props.expanded=!0)},o.context.handlers.mouseEnter=e=>n=>{if(clearTimeout(t),n.target instanceof HTMLElement&&"-1"===n.target.getAttribute("tabindex")&&"true"!==n.target.getAttribute("data-is-extra"))if("month"===o.props.panel||"year"===o.props.panel){const t=r.nearestDay(e,()=>!0,o.props.panel);t&&(o.props.activeDate=t)}else o.props.activeDate=e},o.context.handlers.mouseLeave=()=>{clearTimeout(t),t=setTimeout(()=>{},100)},o.context.handlers.jumpTo=e=>()=>{o.props.panels.unshift(o.props.panel),o.props.panel=e},o.context.fns.sameDay=e=>function(e,t){return t instanceof Date&&r.sameDay(e,t)}(e,o.props.activeDate),o.context.fns.sameMonth=e=>rl(e,o.props.activeDate),o.context.fns.sameYear=e=>nl(e,o.props.activeDate),o.context.fns.notInMonth=(e,t)=>{const o=r.dayStart(t).getTime();return o<r.monthStart(e).getTime()||o>r.monthEnd(e).getTime()||void 0}}});const I=al.bind(null,o);De(o,()=>{document.removeEventListener("click",I)}),o.on("prop:panel",({payload:e})=>{o.props.showPagination=o.props.paginatedPanels.includes(e)}),o.on("dateSelected",({payload:e})=>{var t,n;Array.isArray(o.props.panels)&&o.props.panels.length?o.props.panel=o.props.panels.shift():(o.props.expanded=!1,null===(n=null===(t=o.props.__root)||void 0===t?void 0:t.getElementById(`${o.props.id}`))||void 0===n||n.focus()),e&&o.props._isDisabled(e)||pl(o,e)}),o.on("input",({payload:e})=>{if(void 0===e&&!o.props._isFocused)return void ll(o,void 0);const t=new Date,n=e?ll(o,r.removeOffset("string"==typeof e?r.parse(e,o.props.valueFormat,o.props.valueLocale):e,o.props.offset)):t;o.props.activeDate=!e&&o.props.activeDate?o.props.activeDate:n,o.props.renderedDate=!e&&o.props.renderedDate?o.props.renderedDate:n,o.props.localTime=r.format(n,"HH:mm"),function(e){const t=Xa.get(e);if(e._value&&t){const o=r.monthDays(e.props.activeDate);if(t.length>o)t.splice(o,t.length-o);else if(t.length<o)for(let e=t.length+1;e<=o;e++)t.push(String(e))}}(o)}),o.on("prop:renderedDate",sl.bind(null,o)),o.on("prop:expanded",({payload:t})=>{if(t){if(Qa.delete(o),o.props.panels=il(o),o.props.panel=o.props.panels.shift(),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?o.props.showPanelClose=!0:o.props.showPanelClose=!1,"day"===o.props.panel){const e=o.props.activeDate;o.props.activeDate=r.nearestDay(o.props.activeDate,e=>!o.props._isDisabled(e),"month")||e}sl(o),e.whenAvailable(`${o.props.id}_popover`,e=>{const t=e.querySelector('[tabindex="0"]');t&&setTimeout(()=>{t.focus(),function(e,t){const o=Ae(e,e=>{for(const t of e)"attributes"===t.type&&t.target instanceof HTMLElement&&"0"===t.target.getAttribute("tabindex")?t.target.focus():t.addedNodes.length&&t.addedNodes.forEach(e=>{var t;if(e instanceof HTMLElement&&"0"===e.getAttribute("tabindex"))e.focus();else if(e instanceof HTMLElement&&e.querySelector('[tabindex="0"]')){const t=e.querySelector('[tabindex="0"]');t instanceof HTMLElement&&t.focus()}else e instanceof HTMLElement&&e.querySelector('input[type="time"]')&&(null===(t=e.querySelector('input[type="time"]'))||void 0===t||t.focus())})});o.observe(t,{attributes:!0,attributeFilter:["tabindex"],childList:!0,subtree:!0});const n=e.on("prop:expanded",({payload:t})=>{t||(e.off(n),o.disconnect())})}(o,e)},0)},o.props.__root),Ua&&setTimeout(()=>{document.addEventListener("click",I)},10)}else{if(o.props.activeDate=o.props.renderedDate,"time"===o.props.panel)o.emit("dateSelected",o.props.activeDate);else if(o._value){Ja.add(o);const e="string"==typeof o._value?r.parse(o._value,o.props.valueFormat,o.props.valueLocale):o._value;ll(o,r.removeOffset(e,o.props.offset))}else ll(o,void 0);Ua&&(ja.add(o),document.removeEventListener("click",I),setTimeout(()=>ja.delete(o),50))}}),o.on("prop:activeDate",({payload:e})=>{if(Array.isArray(o.props.calendar)&&o.props.calendar.length)if("day"===o.props.panel){const t=o.props.calendar,n=r.monthStart(o.props.renderedDate),s=r.monthEnd(r.addMonth(o.props.renderedDate,t.length-1));e.getTime()<n.getTime()?o.props.renderedDate=r.addMonth(o.props.renderedDate,-1):e.getTime()>s.getTime()&&(o.props.renderedDate=r.addMonth(o.props.renderedDate))}else if("year"===o.props.panel){const t=o.props.years,n=t[0].getFullYear(),s=t[t.length-1].getFullYear(),a=o.props.activeDate.getFullYear();a>s?o.props.renderedDate=r.addYear(o.props.renderedDate,10):a<n?o.props.renderedDate=r.addYear(o.props.renderedDate,-10):(o.props.skipBuildCalendar=!0,o.props.renderedDate=e)}o.props.expanded&&ll(o,o.props.activeDate)}),o.on("keydown",({payload:e})=>{switch(e.key){case"ArrowDown":case"ArrowUp":case" ":e.preventDefault(),o.props.pickerOnly&&(o.props.expanded=!0);break;case"Enter":case"Return":o.props.expanded||(o.props.expanded=!0);break;case"Escape":o.props.expanded=!1}}),o.on("calendarKeydown",({payload:e})=>{e.preventDefault();let t=null,n=0;switch(e.key){case"ArrowRight":n=1;break;case"ArrowLeft":n=-1;break;case"ArrowDown":n=7;break;case"ArrowUp":n=-7;break;case"Return":case"Enter":o.emit("dateSelected",o.props.activeDate);break;case"Tab":e.shiftKey||dl(o,e);break;case"Escape":o.props.expanded=!1}if(n&&(e.preventDefault(),t=r.addDay(o.props.activeDate,n)),t&&!o.props._isDisabled(t))o.props.activeDate=t;else if(t&&o.props._isDisabled(t)){const e=n>0?1:-1;_(Number(o.props.maxScan),t=>e*t).some(e=>{const n=r.addDay(t,e);return!o.props._isDisabled(n)&&(o.props.activeDate=n,!0)})}}),o.on("yearKeydown",({payload:e})=>{let t=0;switch(e.key){case"ArrowDown":t=5;break;case"ArrowRight":t=1;break;case"ArrowUp":t=-5;break;case"ArrowLeft":t=-1;break;case"Tab":e.shiftKey||dl(o,e);break;case"Return":case"Enter":o.emit("dateSelected",o.props.activeDate);break;case"Escape":o.props.expanded=!1}const n=o.props.activeDate.getFullYear()+t-o.props.renderedDate.getFullYear();o.props.activeDate=r.addYear(o.props.renderedDate,n)}),o.on("monthKeydown",({payload:e})=>{let t=0;switch(e.key){case"ArrowDown":t=3;break;case"ArrowRight":t=1;break;case"ArrowLeft":t=-1;break;case"ArrowUp":t=-3;break;case"Tab":e.shiftKey||dl(o,e);break;case"Return":case"Enter":o.emit("dateSelected",o.props.activeDate);break;case"Escape":o.props.expanded=!1}t&&e.preventDefault();let n=(o.props.activeDate.getMonth()+t)%12;n=n<0?12+n:n;const s=n-o.props.renderedDate.getMonth();let a=r.addMonth(o.props.renderedDate,s);if(o.props._isDisabled(a)){const e=r.nearestDay(a,e=>!o.props._isDisabled(e),"month");e&&(a=e)}o.props.activeDate=a}),o.on("timeKeydown",({payload:e})=>{switch(e.key){case"Return":case"Enter":e.preventDefault(),o.emit("dateSelected",o.props.activeDate)}}),o.on("prop:_isFocused",()=>{Ga.get(o)&&ul(o)}),o.on("commit",({payload:e})=>{if(e?tl(o):el(o),o.props.activeDate&&o.props._isDisabled(o.props.activeDate)){const e=t.createMessage({blocking:!0,key:"rule_invalidDate",meta:{messageKey:"invalidDate",removeImmediately:!1,localize:!0,i18nArgs:[{node:o,name:vl(o),args:[]}]},type:"validation",value:"The selected date is invalid."});o.store.set(e)}else o.store.remove("rule_invalidDate")})},to,
30
30
  /* #__PURE__ */o.localize("next"),
31
31
  /* #__PURE__ */o.localize("prev"),
32
32
  /* #__PURE__ */o.localize("changeDate"),
@@ -35,8 +35,8 @@
35
35
  /* #__PURE__ */o.defaultIcon("next","right"),
36
36
  /* #__PURE__ */o.defaultIcon("clear","close"),
37
37
  /* #__PURE__ */o.defaultIcon("prev","left"),
38
- /* #__PURE__ */o.defaultIcon("calendar","date")]},fl=/* #__PURE__ */K("tl"),{outer:vl,wrapper:hl,inner:ml,icon:gl,label:$l,prefix:bl,suffix:yl,help:xl,messages:wl,message:_l}=/* #__PURE__ */W(fl),kl=fl("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",onFocus:"$handlers.focus",value:"$inputText",name:"$node.name",tabindex:"0",placeholder:"$state.loading && $inputStd.length === 0 && $ui.isLoading.value || $placeholder || undefined",role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || undefined || $multiple && $max && $value && $value.length >= $max",disabled:"$disabled || $disabledInternally || undefined","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined","aria-required":"$state.required || undefined"}}))),Sl=fl("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1","aria-label":"$expanded && $ui.close.value || $ui.open.value",disabled:"$disabled || undefined","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),Ll=fl("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.tagClick && $handlers.tagClick($option)",onFocus:"$handlers.tagFocus && $handlers.tagFocus($option)",onBlur:"$handlers.tagBlur && $handlers.tagBlur($option)",onKeydown:"$handlers.searchInputTagKeydown && $handlers.searchInputTagKeydown($option)","data-is-tag":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),Il=fl("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),Dl=fl("removeSelection",(()=>({$el:"button",if:"$selections.length > 0",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1","aria-label":"$ui.remove.value",type:"button",onClick:"$handlers.removeSelection && $handlers.removeSelection($option)",onTouchstartPassive:"$handlers.removeSelection && $handlers.removeSelection($option)","aria-controls":"$id"}}))),Al=fl("tagLabel",(()=>({$el:"span"}))),Cl=fl("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite"}}))),Tl=fl("tagLoading","span"),El=/* #__PURE__ */z(fl);function Ol(t){t.props.multiple=!0,t.props.openOnClick=e.undefine(t.props.openOnClick),void 0===t.props.closeOnSelect&&(t.props.closeOnSelect=!0),t.props.closeOnSelect?t.props.resetSearchOnCommit=!1:void 0===t.props.resetSearchOnCommit&&(t.props.resetSearchOnCommit=t.props.multiple),t.props.allowNewValues=e.undefine(t.props.allowNewValues)}function Ml(t){mr(t),Wt(t),t.on("created",(()=>{function o(){return Array.isArray(t.value)?t.value:[]}function r(e){t.input(e)}t.props.disabled&&(t.props.draggable=!1),e.whenAvailable(`${t.props.id}_selections`,(e=>{if(e instanceof HTMLElement){if(!t.context)return;const s={draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,disabled:!t.props.draggable,threshold:{horizontal:.25,vertical:0},plugins:[n.animations()],root:t.props.__root,touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag"),handleEnd(e){t.props.activeSelectionValue=void 0,n.handleEnd(e)},handleDragstart(e){t.props.activeSelectionValue=void 0,n.handleDragstart(e)},handleTouchstart(e){t.props.activeSelectionValue=void 0,n.handleTouchstart(e)}};n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s}),t.on("prop:disabled",(({payload:t})=>{s.disabled=t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})})),t.on("prop:draggable",(({payload:t})=>{s.disabled=!t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})}))}}),t.props.__root)}))}const Vl={schema:/* #__PURE__ */vl(/* #__PURE__ */hl(/* #__PURE__ */$l("$label"),/* #__PURE__ */ml(/* #__PURE__ */gl("prefix"),/* #__PURE__ */bl(),/* #__PURE__ */Cl(/* #__PURE__ */Ll(/* #__PURE__ */Il(/* #__PURE__ */U("$state.loading && $fns.hasOptionLoaderValue && $fns.hasOptionLoaderValue($option) || $option.label === undefined",/* #__PURE__ */Tl("$ui.isLoading.value"),/* #__PURE__ */Al("$option.label")),/* #__PURE__ */Dl(/* #__PURE__ */gl("close")))),/* #__PURE__ */kl()),/* #__PURE__ */U("$state.loading",/* #__PURE__ */gl("loader")),/* #__PURE__ */Sl(/* #__PURE__ */gl("select")),/* #__PURE__ */El(),/* #__PURE__ */yl(),/* #__PURE__ */gl("suffix"))),/* #__PURE__ */xl("$help"),/* #__PURE__ */wl(/* #__PURE__ */_l("$message.value"))),type:"input",family:"dropdown",props:[],features:[o.options,
39
- /* #__PURE__ */ut.bind(null,Ol,or,Ml),
38
+ /* #__PURE__ */o.defaultIcon("calendar","date")]},yl=/* #__PURE__ */K("tl"),{outer:xl,wrapper:wl,inner:_l,icon:kl,label:Sl,prefix:Ll,suffix:Il,help:Dl,messages:Al,message:Cl}=/* #__PURE__ */W(yl),Tl=yl("input",()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",onFocus:"$handlers.focus",value:"$inputText",name:"$node.name",tabindex:"0",placeholder:"$state.loading && $inputStd.length === 0 && $ui.isLoading.value || $placeholder || undefined",role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || undefined || $multiple && $max && $value && $value.length >= $max",disabled:"$disabled || $disabledInternally || undefined","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined","aria-required":"$state.required || undefined"}})),El=yl("listboxButton",()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1","aria-label":"$expanded && $ui.close.value || $ui.open.value",disabled:"$disabled || undefined","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}})),Ol=yl("tagWrapper",()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.tagClick && $handlers.tagClick($option)",onFocus:"$handlers.tagFocus && $handlers.tagFocus($option)",onBlur:"$handlers.tagBlur && $handlers.tagBlur($option)",onKeydown:"$handlers.searchInputTagKeydown && $handlers.searchInputTagKeydown($option)","data-is-tag":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}})),Ml=yl("tag",()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}})),Vl=yl("removeSelection",()=>({$el:"button",if:"$selections.length > 0",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1","aria-label":"$ui.remove.value",type:"button",onClick:"$handlers.removeSelection && $handlers.removeSelection($option)",onTouchstartPassive:"$handlers.removeSelection && $handlers.removeSelection($option)","aria-controls":"$id"}})),Fl=yl("tagLabel",()=>({$el:"span"})),Pl=yl("tags",()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite"}})),Bl=yl("tagLoading","span"),Hl=/* #__PURE__ */U(yl);function Rl(t){t.props.multiple=!0,t.props.openOnClick=e.undefine(t.props.openOnClick),void 0===t.props.closeOnSelect&&(t.props.closeOnSelect=!0),t.props.closeOnSelect?t.props.resetSearchOnCommit=!1:void 0===t.props.resetSearchOnCommit&&(t.props.resetSearchOnCommit=t.props.multiple),t.props.allowNewValues=e.undefine(t.props.allowNewValues)}function Nl(t){_r(t),Gt(t),t.on("created",()=>{function o(){return Array.isArray(t.value)?t.value:[]}function r(e){t.input(e)}t.props.disabled&&(t.props.draggable=!1),e.whenAvailable(`${t.props.id}_selections`,e=>{if(e instanceof HTMLElement){if(!t.context)return;const s={draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,disabled:!t.props.draggable,threshold:{horizontal:.25,vertical:0},plugins:[n.animations()],root:t.props.__root,touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag"),handleEnd(e){t.props.activeSelectionValue=void 0,n.handleEnd(e)},handleDragstart(e){t.props.activeSelectionValue=void 0,n.handleDragstart(e)},handleTouchstart(e){t.props.activeSelectionValue=void 0,n.handleTouchstart(e)}};n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s}),t.on("prop:disabled",({payload:t})=>{s.disabled=t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})}),t.on("prop:draggable",({payload:t})=>{s.disabled=!t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})})}},t.props.__root)})}const Kl={schema:/* #__PURE__ */xl(/* #__PURE__ */wl(/* #__PURE__ */Sl("$label"),/* #__PURE__ */_l(/* #__PURE__ */kl("prefix"),/* #__PURE__ */Ll(),/* #__PURE__ */Pl(/* #__PURE__ */Ol(/* #__PURE__ */Ml(/* #__PURE__ */z("$state.loading && $fns.hasOptionLoaderValue && $fns.hasOptionLoaderValue($option) || $option.label === undefined",/* #__PURE__ */Bl("$ui.isLoading.value"),/* #__PURE__ */Fl("$option.label")),/* #__PURE__ */Vl(/* #__PURE__ */kl("close")))),/* #__PURE__ */Tl()),/* #__PURE__ */z("$state.loading",/* #__PURE__ */kl("loader")),/* #__PURE__ */El(/* #__PURE__ */kl("select")),/* #__PURE__ */Hl(),/* #__PURE__ */Il(),/* #__PURE__ */kl("suffix"))),/* #__PURE__ */Dl("$help"),/* #__PURE__ */Al(/* #__PURE__ */Cl("$message.value"))),type:"input",family:"dropdown",props:[],features:[o.options,
39
+ /* #__PURE__ */bt.bind(null,Rl,pr,Nl),
40
40
  /* #__PURE__ */o.defaultIcon("select","select"),
41
41
  /* #__PURE__ */o.defaultIcon("close","close"),
42
42
  /* #__PURE__ */o.defaultIcon("selected","check"),
@@ -45,7 +45,7 @@
45
45
  /* #__PURE__ */o.localize("loadMore"),
46
46
  /* #__PURE__ */o.localize("remove"),
47
47
  /* #__PURE__ */o.localize("open"),
48
- /* #__PURE__ */o.localize("close"),jt]},Fl=/* #__PURE__ */K("mk"),{outer:Pl,wrapper:Bl,inner:Hl,label:Rl,prefix:Nl,suffix:Kl,help:Wl,messages:ql,message:Ul,icon:zl}=/* #__PURE__ */W(Fl),{overlayPlaceholder:Yl,overlayLiteral:jl,overlayChar:Zl,overlayEnum:Gl,overlay:Xl,overlayParts:Jl,overlayInner:Ql}=/* #__PURE__ */q(Fl),ei=Fl("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"text",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",onInput:"$handlers.DOMInput",value:"$_maskValue",placeholder:"$placeholder",id:"$id","aria-describedby":"$describedBy"}}))),ti=new WeakMap,oi=new WeakMap,ni=new WeakMap;function ri(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);oi.set(e,t),Ks(t,{...ti.get(e),onChange:({valueAfter:t,meta:o})=>{e.props._maskValue=t,e.input({maskValue:t}),e.props._overlayParts=_e(o)}},e)}const si={schema:/* #__PURE__ */Pl(/* #__PURE__ */Bl(/* #__PURE__ */Rl("$label"),/* #__PURE__ */Hl(/* #__PURE__ */zl("prefix"),/* #__PURE__ */Nl(),/* #__PURE__ */Xl(/* #__PURE__ */Ql(/* #__PURE__ */Jl(/* #__PURE__ */Yl("$part.value"),/* #__PURE__ */jl("$part.value"),/* #__PURE__ */Zl("$part.value"),/* #__PURE__ */Gl("$part.value")))),/* #__PURE__ */ei(),/* #__PURE__ */Kl(),/* #__PURE__ */zl("suffix"))),/* #__PURE__ */Wl("$help"),/* #__PURE__ */ql(/* #__PURE__ */Ul("$message.value"))),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse","overlay"],family:"text",features:[cl,function(t){t.addProps(["_maskValue","_overlayParts"]),t.on("created",(()=>{var o,n,r,s,a;const l=zs("string"==typeof t._value?t._value:"");oi.set(t,l),ni.set(t,l),t.props.allowIncomplete=e.undefine(t.props.allowIncomplete),t.props.overlay=e.undefine(t.props.overlay);const i=!(void 0!==t.props.showMask&&!e.undefine(t.props.showMask));t.props.unmaskValue=e.undefine(t.props.unmaskValue),t.hook.prop(((t,o)=>("unmaskValue"===t.prop&&(t.value=e.undefine(t)),o(t))));const p={placeholder:i,pattern:null!==(o=t.props.mask)&&void 0!==o?o:"",mode:null!==(n=t.props.mode)&&void 0!==n?n:"shift",partOverrides:null!==(r=t.props.tokens)&&void 0!==r?r:{},prefix:null!==(s=t.props.prefix)&&void 0!==s?s:void 0,suffix:null!==(a=t.props.suffix)&&void 0!==a?a:void 0,reverse:e.undefine(t.props.reverse)};ti.set(t,p),t.hook.input(((e,o)=>{const n=function(e,t){const o=oi.get(e),n="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:n?t.maskValue:"";const r=ni.get(e);r.value=oa(r,t);const s=Us(r,ti.get(e)),a=Va(r,e.props.allowIncomplete);if(t===o.value)return e.props.unmaskValue?null!=a?a:"":null===a?"":"string"==typeof t?t:"";if(""===t&&""!==o.value&&!e.props.allowIncomplete)return t;n||s===e.props._maskValue||(o.value=s,e.props._maskValue=s,e.props._overlayParts=_e(Fa(r)||[]));return null===a?"":e.props.unmaskValue?a:s}(t,e);return o(n)})),t.props._maskValue=Us(l,p,t),t.input(t.props._maskValue,!1),t.context&&(t.context.handlers.DOMInput=e=>{t.emit("dom-input-event",e)}),e.whenAvailable(`${t.props.id}`,ri.bind(null,t),t.props.__root)}))}]},ai=/* #__PURE__ */K("tf"),{outer:li,wrapper:ii,inner:pi,icon:di,prefix:ci,suffix:ui,help:fi,messages:vi,message:hi}=/* #__PURE__ */W(ai),mi=ai("fieldset",(()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}}))),gi=ai("legend",(()=>({if:"$label",$el:"legend"}))),$i=ai("source",(()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}}))),bi=ai("sourceHeader",(()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}}))),yi=ai("sourceHeaderLabel",(()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"}))),xi=ai("sourceHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_source_header_item_count"',role:"presentation","aria-label":'$sourceOptions.length " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.sourceHeaderItemCount'}}))),wi=ai("targetHeaderLabel",(()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"}))),_i=ai("targetHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_target_header_item_count"',role:"presentation","aria-label":'$targetOptions.length + " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.targetHeaderItemCount'},children:"$targetOptions.length"}))),ki=ai("sourceControls",(()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}}))),Si=ai("sourceSearch",(()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}}))),Li=ai("sourceSearchInput",(()=>({$el:"input",attrs:{id:'$id + "_source_search_input"',type:"text",placeholder:"$placeholder",onInput:"$handlers.onSearch",value:"$inputText",onKeydown:"$handlers.sourceSearchKeydown",disabled:"$disabled","aria-label":"Search",role:"searchbox",autocomplete:"off",class:'$classes.transferlistSearchInput + " " + $classes.sourceSearchInput',onFocus:"$handlers.sourceSearchFocus",onBlur:"$handlers.sourceSearchBlur"}}))),Ii=ai("targetSearch",(()=>({if:"$targetSearchable",$el:"div",attrs:{id:'$id + "_target_search"',class:'$classes.transferlistSearch + " " + $classes.targetSearch'}}))),Di=ai("targetSearchInput",(()=>({$el:"input",attrs:{id:'$id + "_target_search_input"',type:"text",placeholder:"$placeholder",onInput:"$handlers.onTargetSearch",value:"$targetInputText",onKeydown:"$handlers.targetSearchKeydown",disabled:"$disabled","aria-label":"Search",role:"searchbox",autocomplete:"off",class:'$classes.transferlistSearchInput + " " + $classes.targetSearchInput',onFocus:"$handlers.targetSearchFocus",onBlur:"$handlers.targetSearchBlur"}}))),Ai=ai("targetControls",(()=>({$el:"div",if:"$targetSearchable",attrs:{id:'$id + "_target_controls"',class:'$classes.transferlistControls + " " + $classes.targetControls'}}))),Ci=ai("sourceSearchClear",(()=>({$el:"button",if:'$inputText !== ""',attrs:{id:'$id + "_source_search_clear"',type:"button",onClick:"$handlers.clearSearch","aria-label":"Clear Source Search",class:'$classes.transferlistSearchClear + " " + $classes.sourceSearchClear'}}))),Ti=ai("targetSearchClear",(()=>({$el:"button",if:'$targetInputText !== ""',attrs:{id:'$id + "_target_search_clear"',type:"button",onClick:"$handlers.clearTargetSearch","aria-label":"Clear Target Search",class:'$classes.transferlistSearchClear + " " + $classes.targetSearchClear'}}))),Ei=ai("sourceListItems",(()=>({$el:"ul",attrs:{id:'$id + "_source_list_items"',"aria-activedescendant":"$activeDescendant",onMouseenter:"$handlers.onMouseenter(true)",onMouseout:"$handlers.onMouseleave(true)",role:"listbox","aria-multiselectable":"true","aria-roledescription":"List of options to choose from.",class:'$classes.transferlistListItems + " " + $classes.sourceListItems',onKeydown:"$handlers.sourceListKeydown",tabindex:"$searchable || $sourceOptions.length === 0 && -1 || 0",onFocus:"$handlers.sourceListFocused",onBlur:"$handlers.sourceListBlurred","aria-label":"Source list"}}))),Oi=ai("sourceListItem",(()=>({for:["option","index","$sourceOptions"],$el:"li",attrs:{id:'$id + "_source_list_item_" + $index',"data-value":"$option.value","aria-selected":"$transferOnSelect === false && $fns.isSelected($option, $selectedSourceItems)","data-is-active":"$fns.isActive($option, $activeValue)","data-disabled":"$option.attrs.disabled",role:"option",onClick:"$handlers.listitemClick($option, true)",onTouchstartPassive:"$handlers.listitemTouchstart($option, true)",onTouchmovePassive:"$handlers.listitemTouchmove($option, true)",onTouchend:"$handlers.listitemTouchend($option, true)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.sourceListItem'}}))),Mi=ai("sourceOption",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option, $selectedSourceItems)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}}))),Vi=ai("sourceLoadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_source_load_more"',key:"loadMore",onClick:"$handlers.listitemClick($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}}))),Fi=ai("loadMoreInner","span"),Pi=ai("target",(()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}}))),Bi=ai("targetHeader",(()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}}))),Hi=ai("targetListItems",(()=>({$el:"ul",attrs:{id:"$id","aria-activedescendant":"$activeDescendant",onMouseenter:"$handlers.onMouseenter(false)",onMouseout:"$handlers.onMouseleave(false)",role:"listbox",class:'$classes.transferlistListItems + " " + $classes.targetListItems',tabindex:"$targetOptions.length === 0 && -1 || 0",onKeydown:"$handlers.targetListKeydown",onFocus:"$handlers.targetListFocused",onBlur:"$handlers.targetListBlurred","aria-label":"Target list"}}))),Ri=ai("targetListItem",(()=>({for:["option","index","$targetOptions"],$el:"li",attrs:{id:'$id + "_target_list_item_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value","aria-selected":"$transferOnSelect === false && $fns.isSelected($option, $selectedTargetItems)","data-is-active":"$fns.isActive($option, $activeValue)",role:"option",onClick:"$handlers.listitemClick($option, false)",onTouchstartPassive:"$handlers.listitemTouchstart($option, false)",onTouchmovePassive:"$handlers.listitemTouchmove($option, false)",onTouchend:"$handlers.listitemTouchend($option, false)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.targetListItem'}}))),Ni=ai("targetOption",(()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index + "_option"',"data-checked":"$fns.isSelected($option, $selectedTargetItems)",class:'$classes.transferlistOption + " " + $classes.targetOption'}}))),Ki=ai("transferControls",(()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}}))),Wi=ai("transferButtonForward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_forward"',type:"button",disabled:"$selectedSourceItems.length === 0 || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForward","aria-label":"$ui.addSelectedValues.value",title:"$ui.addSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonForward'}}))),qi=ai("transferButtonForwardAll",(()=>({$el:"button",attrs:{id:'$id + "_transfer_button_forward_all"',type:"button",disabled:"$sourceOptions.length === 0 || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForwardAll","aria-label":"$ui.addAllValues.value",title:"$ui.addAllValues.value",onFocus:"$handlers.transferForwardAllFocused",class:'$classes.transferlistButton + " " + $classes.transferButtonForwardAll'}}))),Ui=ai("transferButtonBackward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_backward"',onClick:"$handlers.transferBackward",type:"button",disabled:"$selectedTargetItems.length === 0 || $targetOptions.length === 0 || $disabled","aria-label":"$ui.removeSelectedValues.value",title:"$ui.removeSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackward'}}))),zi=ai("transferButtonBackwardAll",(()=>({$el:"button",attrs:{id:'$id + "_transfer_button_backward_all"',onClick:"$handlers.transferBackwardAll",type:"button",disabled:"$targetOptions.length === 0 || $disabled","aria-label":"$ui.removeAllValues.value",title:"$ui.removeAllValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackwardAll'}}))),Yi=ai("controlLabel","span"),ji=ai("sourceEmptyMessage",(()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}}))),Zi=ai("targetEmptyMessage",(()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),Gi=ai("emptyMessageInner","span"),Xi=Symbol(),Ji=new WeakSet,Qi=new WeakSet;function ep(e,t,o,n){if(!(e.props.disabled||(e.props.isSourceOption=o,e.props.isSourceOption&&Array.isArray(e.value)&&e.value.length>=e.props.max)))if(o){if(e.props.selectedSourceItems.includes(t))return e.props.selectedSourceItems=e.props.selectedSourceItems.filter((e=>e!==t)),e.props.activeValue=void 0,void(e.props.activeDescendant=void 0);e.props.selectedTargetItems=[],e.props.selectedSourceItems=[...e.props.selectedSourceItems,t]}else{if(e.props.selectedTargetItems.includes(t))return void(e.props.selectedTargetItems=e.props.selectedTargetItems.filter((e=>e!==t)));e.props.selectedSourceItems=[],e.props.selectedTargetItems=[...e.props.selectedTargetItems,t]}}function tp(e,t){if(e.props.sourceListOrigin=!0,e.props.maxReached)return;if(t){const o=Array.isArray(e.value)?[...e.value,t]:[t];return void e.input(o)}const o=e.props.selectedSourceItems.map((e=>Se(e)));Array.isArray(e.value)?e.input([...e.value,...o]):e.input(o),e.props.selectedSourceItems=[]}function op(e,t){if(e.props.sourceListOrigin=!1,t){const o=Array.isArray(e.value)?e.value.filter((e=>e!==t)):[];return void e.input(o)}const o=e.props.selectedTargetItems.map((e=>Se(e)));if(Array.isArray(e.value)){const t=e.value.filter((e=>!o.includes(e)));e.input(t)}e.props.selectedTargetItems=[]}function np(e){var t,o;if(e.props.activeValue===Xi){const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_source_load_more`);return void(o&&o.scrollIntoView({block:"nearest",inline:"start"}))}const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);n&&n.scrollIntoView({block:"nearest",inline:"start"})}function rp(t){var o;if(Array.isArray(t.value)){const o=[];let n=[...t.props.options];t.value.forEach((r=>{const s=t.props.memoOptions.find((t=>e.eq(Se(t),r)));if(s&&!s.noOptionFound){o.push(s);const a=t.props.options.findIndex((t=>e.eq(Se(t),r)));-1!==a&&(n=n.filter((t=>!e.eq(Se(t),r))))}else{const t=n.find((t=>e.eq(Se(t),r)));t?(o.push(t),n=n.filter((t=>!e.eq(Se(t),r)))):o.push({label:String(r),value:r,noOptionFound:!0})}})),t.props.targetOptions=t.props.targetInputText?o.filter((e=>t.props.filter(e,t.props.targetInputText,t))):o,t.props.sourceOptions=n}else t.props.sourceOptions=[...t.props.options],t.props.targetOptions=[];if(t.props.skipSetActiveValue)return void(t.props.skipSetActiveValue=!1);(null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(t.props.id+"_source_list_items"))&&sp(t)}function sp(e){var t,o,n,r,s,a,l,i,p;if(e.props.isDragging)return;if(e.props.targetSearchActive){if((null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.activeElement)||void 0===o?void 0:o.id)===`${e.props.id}_target_search_input`){const t=e.props.targetOptions.find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}));return t?void(e.props.activeValue=Se(t)):void(e.props.activeValue=void 0)}return}if(e.props.sourceSearchActive){if((null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.activeElement)||void 0===r?void 0:r.id)===`${e.props.id}_source_search_input`){const t=e.props.sourceOptions.find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}));return t?void(e.props.activeValue=Se(t)):void(e.props.activeValue=void 0)}e.props.sourceSearchActive=!1}if(!1===e.props.transferOnSelect)return void(e.props.activeValue=void 0);const d=e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions;let c=!1;for(let t=e.props.activeIndex;t<=d.length;t++)if(!(null===(s=d.attrs)||void 0===s?void 0:s.disabled)&&d[t]){c=!0,e.props.activeValue=Se(d[t]);break}if(!c&&d.length)for(let t=e.props.activeIndex;t>=0;t--)if(!(null===(a=d.attrs)||void 0===a?void 0:a.disabled)&&d[t])return c=!0,void(e.props.activeValue=Se(d[t]));if(!c){let t;t=e.props.sourceListOrigin?null===(p=e.props.__root)||void 0===p?void 0:p.getElementById(`${e.props.id}`):e.props.searchable?null===(l=e.props.__root)||void 0===l?void 0:l.getElementById(`${e.props.id}_source_search_input`):null===(i=e.props.__root)||void 0===i?void 0:i.getElementById(`${e.props.id}_source_list_items`),t&&t.focus()}}function ap(e,t){return(t?e.props.sourceOptions:e.props.targetOptions).find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}))}function lp(t){Array.isArray(t.value)&&t.value.forEach((async o=>{Me(t,o,function(t,o){const n=[...t.props.options,...t.props.memoOptions];return n.find((t=>e.eq(Se(t),o)))}(t,o))}))}function ip(t){t.context&&(t.context.handlers.loadMore=Ae.bind(null,t),t.context.fns.getSourceItemCount=e=>!1===t.props.transferOnSelect&&e.length?e.length+"/"+t.props.sourceOptions.length:t.props.sourceOptions.length,t.context.fns.getTargetItemCount=e=>!1===t.props.transferOnSelect&&e.length?e.length+"/"+t.props.targetOptions.length:t.props.targetOptions.length,t.context.fns.isActive=(o,n)=>{if(!t.props.isDragging&&!t.props.touchStarted)return e.eq(n,Se(o))||void 0},t.context.fns.isSelected=(e,t)=>!!t&&(!!Array.isArray(t)&&t.includes(e)),t.context.fns.optionLoading=e=>t.props.optionLoaderValues.includes(Se(e)),t.context.handlers.clearSearch=()=>{!function(e){var t;e.props.sourceSearchActive=!1,e.props.inputText="",De(e,"",!0);const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_source_search_input`);if(!o)return;o.focus()}(t)},t.context.handlers.clearTargetSearch=()=>{!function(e){var t;e.props.targetSearchActive=!1,e.props.targetInputText="";const o=[...new Set([...e.props.options,...e.props.memoOptions])],n=[];for(const t of e.value){const e=o.find((e=>Se(e)===t));e&&n.push(e)}e.props.targetOptions=n;const r=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_target_search_input`);if(!r)return;r.focus()}(t)},t.context.handlers.sourceSearchBlur=e=>{setTimeout((()=>{var o;if(e.relatedTarget&&e.relatedTarget instanceof HTMLElement&&(e.relatedTarget.id===`${t.props.id}_source_list_items`||e.relatedTarget.id===`${t.props.id}`)){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}_source_search_input`);if(!e)return;e.focus()}else t.props.activeValue=void 0}))},t.context.handlers.targetSearchBlur=e=>{setTimeout((()=>{var o;if(e.relatedTarget&&e.relatedTarget instanceof HTMLElement&&(e.relatedTarget.id===`${t.props.id}_source_list_items`||e.relatedTarget.id===`${t.props.id}`)){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}_target_search_input`);if(!e)return;e.focus()}else t.props.activeValue=void 0}))},t.context.handlers.listitemClick=(e,o)=>n=>{pp(t,e,o)},t.context.handlers.transferForward=tp.bind(null,t,void 0),t.context.handlers.transferForwardAll=()=>{let e;if(t.props.maxReached)return;const o=t.props.sourceOptions.map((e=>Se(e)));e=Array.isArray(t.value)?[...t.value,...o]:[...o],t.input(e),t.props.selectedSourceItems=[]},t.context.handlers.transferBackward=op.bind(null,t,void 0),t.context.handlers.transferBackwardAll=()=>{Array.isArray(t.value)&&(t.input([]),t.props.selectedTargetItems=[])},t.context.handlers.onSearch=e=>{!function(e,t){e.props.sourceSearchActive=!0;const o=t.target;e.props.inputText=o.value,De(e,o.value,!0)}(t,e)},t.context.handlers.onTargetSearch=e=>{!function(e,t){e.props.targetSearchActive=!0;const o=t.target;e.props.targetInputText=o.value;const n=[...new Set([...e.props.memoOptions,...e.props.options])],r=[];for(const t of e.value){const e=n.find((e=>Se(e)===t));e&&r.push(e)}const s=[...new Map([...e.props.targetOptions,...r].map((e=>[JSON.stringify(e),e]))).values()];e.props.targetOptions=s.filter((t=>e.props.filter(t,o.value,e))),0===e.props.targetOptions.length?e.props.showTargetEmptyMessage=!0:e.props.showTargetEmptyMessage=!1;sp(e)}(t,e)},t.context.handlers.onMouseenter=e=>o=>{"touchstart"!==o.type&&(e?t.props.mouseOnSource=!0:t.props.mouseOnTarget=!0)},t.context.handlers.onMouseleave=e=>o=>{var n;if("touchend"===o.type)return;const r=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(e?`${t.props.id}_source_list_items`:`${t.props.id}`);r&&(r.contains(o.relatedTarget)||(t.props.trackHover=!1,t.props.activeValue=void 0,t.props.activeDescendant=void 0,t.props.activeIndex=void 0,e?t.props.mouseOnSource=!1:t.props.mouseOnTarget=!1))},t.context.handlers.listitemClick=(e,o)=>n=>{n instanceof MouseEvent&&t.props.touchStarted||pp(t,e,o)},t.context.handlers.listitemTouchstart=()=>()=>{!function(e){e.props.touchStarted=!0}(t)},t.context.handlers.listitemTouchend=(e,o)=>n=>{!function(e,t,o){if(e.props.touchMoved)return e.props.touchMoved=!1,void(e.props.touchStarted=!1);const n=Se(t);e.props.activeIndex=e.props.sourceOptions.findIndex((e=>Se(e)===n)),e.props.transferOnSelect?o?tp(e,n):op(e,n):ep(e,t,o)}(t,e,o)},t.context.handlers.listitemTouchmove=()=>e=>{!function(e){e.props.touchMoved=!0}(t)},t.context.handlers.sourceSearchFocus=e=>{dp(t,!0)},t.context.handlers.targetSearchFocus=e=>{dp(t,!1)},t.context.handlers.sourceListFocused=e=>{dp(t,!0)},t.context.handlers.targetListFocused=()=>{dp(t,!1)},t.context.handlers.sourceListBlurred=e=>{t.props.activeValue=void 0},t.context.handlers.targetListBlurred=e=>{t.props.activeValue=void 0},t.context.handlers.sourceListKeydown=e=>{cp(t,e,!0)},t.context.handlers.targetListKeydown=e=>{cp(t,e,!1)},t.context.handlers.sourceSearchKeydown=e=>{cp(t,e,!0)},t.context.handlers.targetSearchKeydown=e=>{cp(t,e,!1)})}function pp(e,t,o,n){var r;if(Se(t)===Xi)return void(null===(r=e.context)||void 0===r||r.handlers.loadMore(!0));const s=Se(t);e.props.activeIndex=e.props.sourceOptions.findIndex((e=>Se(e)===s)),e.props.transferOnSelect?o?tp(e,s):op(e,s):ep(e,t,o)}function dp(e,t){const o=ap(e,t);o&&(e.props.sourceListOrigin=t,e.props.activeValue=Se(o))}function cp(e,t,o){if("ArrowDown"===t.key||"ArrowUp"===t.key)!function(e,t,o){var n,r,s;e.preventDefault();const a=o?t.props.sourceOptions:t.props.targetOptions,l=a.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(Se(t)),e}),[]);(null===(n=t.store.hasNextPage)||void 0===n?void 0:n.value)&&l.push(Xi);const i=l.indexOf(t.props.activeValue);if("ArrowUp"===e.key&&0!==i)for(let e=i-1;e>=0;e--){t.props.sourceListOrigin=o,t.props.activeValue=l[i-1];break}else if("ArrowDown"===e.key&&i!==l.length-1)for(let e=i+1;e<l.length;e++)if(!(null===(s=null===(r=a[e])||void 0===r?void 0:r.attrs)||void 0===s?void 0:s.disabled)){t.props.sourceListOrigin=o,t.props.activeValue=l[e];break}np(t)}(t,e,o);else if("ArrowRight"===t.key||"ArrowLeft"===t.key){if("ArrowLeft"===t.key&&o)return;if("ArrowRight"===t.key&&!o)return;!function(e,t,o){if(t.props.searchable)return;e.preventDefault(),function(e,t){var o,n,r;if(ap(e,!t))if(t){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);t&&t.focus()}else if(e.props.searchable){const t=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_source_search_input`);t&&t.focus()}else{const t=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_source_list_items`);t&&t.focus()}}(t,o)}(t,e,o)}else"Enter"===t.key&&function(e,t,o){var n;if(e.preventDefault(),!t.props.activeValue)return;if(t.props.activeValue===Xi)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore(!0));const r=o?t.props.sourceOptions:t.props.targetOptions,s=r.findIndex((e=>Se(e)===t.props.activeValue));t.props.activeIndex=s;const a=r[s];if(!a)return;t.props.transferOnSelect?o?tp(t,Se(a)):op(t,Se(a)):ep(t,a,o)}(t,e,o)}function up(t){t.on("created",(()=>{if("function"==typeof t.props.optionsLoader&&(t.props.skipSetActiveValue=!0,Ve(t)),ip(t),t.props.disabled&&(t.props.draggable=!1),c){e.whenAvailable(t.props.id+"_source_list_items",(e=>{e instanceof HTMLElement&&function(e,t){if(!e.context)return;function o(){return e.props.sourceOptions.map((e=>Se(e)))}function r(){return[]}const s={longTouch:!0,draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,group:e.props.id,root:e.props.__root||document,disabled:!e.props.draggable||e.props.maxReached,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,selectionDraggingClass:e.context.classes.selectionDragging,selectionDropZoneClass:e.context.classes.selectionDropZone,touchSelectionDraggingClass:e.context.classes.touchSelectionDragging,touchSelectionDropZoneClass:e.context.classes.touchSelectionDropZone,longTouchClass:e.context.classes.longTouch,handleTouchmove(t){e.props.selectedSourceItems=[],n.handleTouchmove(t)},draggable:e=>"option"===e.getAttribute("role")};s.plugins=[n.multiDrag({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,n.handleDragstart(t)},handleEnd(t){n.handleEnd(t),e.props.isDragging=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.activeDescendant=void 0,e.props.isDragging=!1,e.props.selectedTargetItems=[],e.props.selectedSourceItems=[]},handleTouchstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.mouseOnSource=!1,e.props.mouseOnTarget=!1,n.handleTouchstart(t)},selections:()=>e.props.selectedSourceItems.map((e=>Se(e)))})],n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s}),e.on("prop:disabled",(({payload:e})=>{s.disabled=e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})})),e.on("prop:draggable",(({payload:e})=>{s.disabled=!e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})})),e.on("prop:maxReached",(({payload:e})=>{s.disabled=e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})}))}(t,e)}),t.props.__root),e.whenAvailable(`${t.props.id}`,(e=>{e instanceof HTMLElement&&function(e,t){if(!e.context)return;function o(){return e.props.targetOptions.map((e=>Se(e)))}function r(t,o){e.props.sourceListOrigin=!0,e.input(t)}const s={longTouch:!0,root:e.props.__root,group:e.props.id,disabled:!e.props.draggable,draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,selectionDraggingClass:e.context.classes.selectionDragging,selectionDropZoneClass:e.context.classes.selectionDropZone,touchSelectionDraggingClass:e.context.classes.touchSelectionDragging,touchSelectionDropZoneClass:e.context.classes.touchSelectionDropZone,longTouchClass:e.context.classes.longTouch,draggable:e=>"option"===e.getAttribute("role"),plugins:[]};s.plugins=[n.multiDrag({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,n.handleDragstart(t)},handleEnd(t){n.handleEnd(t),e.props.selectedTargetItems=[],e.props.selectedSourceItems=[],e.props.activeValue=void 0,e.props.trackHover=!0,e.props.isDragging=!1},handleTouchstart(t){e.props.trackHover=!1,e.props.activeValue=void 0,e.props.isDragging=!0,e.props.activeDescendant=void 0,n.handleTouchstart(t)},selections:()=>e.props.selectedTargetItems.map((e=>Se(e)))})],n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s}),e.on("prop:disabled",(({payload:e})=>{s.disabled=e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})})),e.on("prop:draggable",(({payload:e})=>{s.disabled=!e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})}))}(t,e)}),t.props.__root);const o=e=>{var o;if(t.props.isDragging)return;t.props.mouseX=e.clientX,t.props.mouseY=e.clientY;const n=t.props.mouseOnSource?`${t.props.id}_source_list_items`:`${t.props.id}`,r=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(n);if(r){const o=r.getBoundingClientRect();e.clientX>o.x&&e.clientX<o.x+o.width&&e.clientY>o.y&&e.clientY<o.y+o.height&&(t.props.trackHover=!0)}};document.addEventListener("mousemove",o)}}))}function fp(e,t){var o;let n=null,r="",s=[];if(e.props.mouseOnSource){if(n=Ji.has(e),r=`${e.props.id}_source_list_item`,s=[...e.props.sourceOptions],!s||!s.length||n)return s=[],r="",void(n=null)}else if(e.props.mouseOnTarget&&(n=Qi.has(e),r=`${e.props.id}_target_list_item`,s=[...e.props.targetOptions],!s||!s.length||n))return s=[],r="",void(n=null);const a=s.reduce(((t,o,n)=>{var s,a;if(null===(s=o.attrs)||void 0===s?void 0:s.disabled)return t;const l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(r+`_${n}`);return l&&t.push([l,o]),t}),[]),l=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);l&&a.push([l,e.props.loadMoreOption]),e.props.mouseOnSource&&Ji.add(e),e.props.mouseOnTarget&&Qi.add(e),a.length&&vp(e,a,null,t)}function vp(e,t,o,n){const r=n?n.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.trackHover){if(e.props.mouseY>r.top&&e.props.mouseY<r.bottom){let n=o||0,r=o;const s=(t,n)=>{var r;const s=n[0],{y:a,height:l,x:i,width:p}=s.getBoundingClientRect();if(e.props.mouseX>i&&e.props.mouseX<i+p&&e.props.mouseY>a&&e.props.mouseY<a+l){o=t;const s=n[1];return e.props.activeValue=s&&!(null===(r=s.attrs)||void 0===r?void 0:r.disabled)?Se(s):void 0,!0}return!1};do{if(null!==n&&s(n,t[n]))break;if(null!==r&&s(r,t[r]))break;null!==n&&(n++,n>t.length-1&&(n=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==n||null!==r)}}else np(e);e.props.mouseOnSource||e.props.mouseOnTarget?e.props.mouseOnSource&&Ji.has(e)||e.props.mouseOnTarget&&Qi.has(e)?requestAnimationFrame(vp.bind(null,e,t,o,n)):fp(e,n):(Ji.delete(e),Qi.delete(e))}const hp={schema:/* #__PURE__ */li(/* #__PURE__ */mi(/* #__PURE__ */gi("$label"),/* #__PURE__ */fi("$help"),/* #__PURE__ */ii(/* #__PURE__ */$i(/* #__PURE__ */bi(/* #__PURE__ */yi(),/* #__PURE__ */xi(/* #__PURE__ */U("$optionsLoadingCounter > 0",/* #__PURE__ */di("loader"),"$fns.getSourceItemCount($selectedSourceItems)"))),/* #__PURE__ */ki(/* #__PURE__ */Si(/* #__PURE__ */Li(),/* #__PURE__ */Ci(/* #__PURE__ */di("close")))),/* #__PURE__ */Ei(/* #__PURE__ */ji(/* #__PURE__ */Gi("$sourceEmptyMessage")),/* #__PURE__ */Oi(/* #__PURE__ */U("$transferOnSelect !== true && $fns.isSelected($option, $selectedSourceItems)",/* #__PURE__ */di("selected")),/* #__PURE__ */Mi("$option.label")),/* #__PURE__ */Vi(/* #__PURE__ */U("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",/* #__PURE__ */Fi(/* #__PURE__ */U("$state.loading",/* #__PURE__ */di("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),/* #__PURE__ */Ki(/* #__PURE__ */qi(/* #__PURE__ */Yi("$ui.addAllValues.value"),/* #__PURE__ */di("fastForward")),/* #__PURE__ */Wi(/* #__PURE__ */Yi("$ui.addSelectedValues.value"),/* #__PURE__ */di("moveRight")),/* #__PURE__ */Ui(/* #__PURE__ */Yi("$ui.removeSelectedValues.value"),/* #__PURE__ */di("moveLeft")),/* #__PURE__ */zi(/* #__PURE__ */Yi("$ui.removeAllValues.value"),/* #__PURE__ */di("rewind"))),/* #__PURE__ */Pi(/* #__PURE__ */Bi(/* #__PURE__ */wi(),/* #__PURE__ */_i("$fns.getTargetItemCount($selectedTargetItems)")),/* #__PURE__ */Ai(/* #__PURE__ */Ii(/* #__PURE__ */Di(),/* #__PURE__ */Ti(/* #__PURE__ */di("close")))),/* #__PURE__ */Hi(/* #__PURE__ */Zi(/* #__PURE__ */U("$state.loading !== true",/* #__PURE__ */Gi("$targetEmptyMessage"))),/* #__PURE__ */Ri(/* #__PURE__ */U("$transferOnSelect !== true && $fns.isSelected($option, $selectedTargetItems)",/* #__PURE__ */di("selected")),/* #__PURE__ */Ni(/* #__PURE__ */U("$fns.optionLoading($option, $optionLoaderValues)","$ui.isLoading.value","$option.label")))))),/* #__PURE__ */vi(/* #__PURE__ */hi("$message.value")))),type:"input",props:[],features:[
48
+ /* #__PURE__ */o.localize("close"),to]},Wl=/* #__PURE__ */K("mk"),{outer:ql,wrapper:zl,inner:Ul,label:Yl,prefix:jl,suffix:Zl,help:Gl,messages:Xl,message:Jl,icon:Ql}=/* #__PURE__ */W(Wl),{overlayPlaceholder:ei,overlayLiteral:ti,overlayChar:oi,overlayEnum:ni,overlay:ri,overlayParts:si,overlayInner:ai}=/* #__PURE__ */q(Wl),li=Wl("input",()=>({$el:"input",bind:"$attrs",attrs:{type:"text",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",onInput:"$handlers.DOMInput",value:"$_maskValue",placeholder:"$placeholder",id:"$id","aria-describedby":"$describedBy"}})),ii=new WeakMap,pi=new WeakMap,di=new WeakMap;function ci(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);pi.set(e,t),Zs(t,{...ii.get(e),onChange:({valueAfter:t,meta:o})=>{e.props._maskValue=t,e.input({maskValue:t}),e.props._overlayParts=_e(o)}},e)}const ui={schema:/* #__PURE__ */ql(/* #__PURE__ */zl(/* #__PURE__ */Yl("$label"),/* #__PURE__ */Ul(/* #__PURE__ */Ql("prefix"),/* #__PURE__ */jl(),/* #__PURE__ */ri(/* #__PURE__ */ai(/* #__PURE__ */si(/* #__PURE__ */ei("$part.value"),/* #__PURE__ */ti("$part.value"),/* #__PURE__ */oi("$part.value"),/* #__PURE__ */ni("$part.value")))),/* #__PURE__ */li(),/* #__PURE__ */Zl(),/* #__PURE__ */Ql("suffix"))),/* #__PURE__ */Gl("$help"),/* #__PURE__ */Xl(/* #__PURE__ */Jl("$message.value"))),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse","overlay"],family:"text",features:[$l,function(t){t.addProps(["_maskValue","_overlayParts"]),t.on("created",()=>{var o,n,r,s,a;const l=Qs("string"==typeof t._value?t._value:"");pi.set(t,l),di.set(t,l),t.props.allowIncomplete=e.undefine(t.props.allowIncomplete),t.props.overlay=e.undefine(t.props.overlay);const i=!(void 0!==t.props.showMask&&!e.undefine(t.props.showMask));t.props.unmaskValue=e.undefine(t.props.unmaskValue),t.hook.prop((t,o)=>("unmaskValue"===t.prop&&(t.value=e.undefine(t)),o(t)));const p={placeholder:i,pattern:null!==(o=t.props.mask)&&void 0!==o?o:"",mode:null!==(n=t.props.mode)&&void 0!==n?n:"shift",partOverrides:null!==(r=t.props.tokens)&&void 0!==r?r:{},prefix:null!==(s=t.props.prefix)&&void 0!==s?s:void 0,suffix:null!==(a=t.props.suffix)&&void 0!==a?a:void 0,reverse:e.undefine(t.props.reverse)};ii.set(t,p),t.hook.input((e,o)=>{const n=function(e,t){const o=pi.get(e),n="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:n?t.maskValue:"";const r=di.get(e);r.value=pa(r,t);const s=Js(r,ii.get(e)),a=Ka(r,e.props.allowIncomplete);if(t===o.value)return e.props.unmaskValue?null!=a?a:"":null===a?"":"string"==typeof t?t:"";if(""===t&&""!==o.value&&!e.props.allowIncomplete)return t;n||s===e.props._maskValue||(o.value=s,e.props._maskValue=s,e.props._overlayParts=_e(Wa(r)||[]));return null===a?"":e.props.unmaskValue?a:s}(t,e);return o(n)}),t.props._maskValue=Js(l,p,t),t.input(t.props._maskValue,!1),t.context&&(t.context.handlers.DOMInput=e=>{t.emit("dom-input-event",e)}),e.whenAvailable(`${t.props.id}`,ci.bind(null,t),t.props.__root)})}]},fi=/* #__PURE__ */K("tf"),{outer:vi,wrapper:hi,inner:mi,icon:gi,prefix:$i,suffix:bi,help:yi,messages:xi,message:wi}=/* #__PURE__ */W(fi),_i=fi("fieldset",()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}})),ki=fi("legend",()=>({if:"$label",$el:"legend"})),Si=fi("source",()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}})),Li=fi("sourceHeader",()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}})),Ii=fi("sourceHeaderLabel",()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"})),Di=fi("sourceHeaderItemCount",()=>({$el:"span",attrs:{id:'$id + "_source_header_item_count"',role:"presentation","aria-label":'$sourceOptions.length " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.sourceHeaderItemCount'}})),Ai=fi("targetHeaderLabel",()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"})),Ci=fi("targetHeaderItemCount",()=>({$el:"span",attrs:{id:'$id + "_target_header_item_count"',role:"presentation","aria-label":'$targetOptions.length + " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.targetHeaderItemCount'},children:"$targetOptions.length"})),Ti=fi("sourceControls",()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}})),Ei=fi("sourceSearch",()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}})),Oi=fi("sourceSearchInput",()=>({$el:"input",attrs:{id:'$id + "_source_search_input"',type:"text",placeholder:"$placeholder",onInput:"$handlers.onSearch",value:"$inputText",onKeydown:"$handlers.sourceSearchKeydown",disabled:"$disabled","aria-label":"Search",role:"searchbox",autocomplete:"off",class:'$classes.transferlistSearchInput + " " + $classes.sourceSearchInput',onFocus:"$handlers.sourceSearchFocus",onBlur:"$handlers.sourceSearchBlur"}})),Mi=fi("targetSearch",()=>({if:"$targetSearchable",$el:"div",attrs:{id:'$id + "_target_search"',class:'$classes.transferlistSearch + " " + $classes.targetSearch'}})),Vi=fi("targetSearchInput",()=>({$el:"input",attrs:{id:'$id + "_target_search_input"',type:"text",placeholder:"$placeholder",onInput:"$handlers.onTargetSearch",value:"$targetInputText",onKeydown:"$handlers.targetSearchKeydown",disabled:"$disabled","aria-label":"Search",role:"searchbox",autocomplete:"off",class:'$classes.transferlistSearchInput + " " + $classes.targetSearchInput',onFocus:"$handlers.targetSearchFocus",onBlur:"$handlers.targetSearchBlur"}})),Fi=fi("targetControls",()=>({$el:"div",if:"$targetSearchable",attrs:{id:'$id + "_target_controls"',class:'$classes.transferlistControls + " " + $classes.targetControls'}})),Pi=fi("sourceSearchClear",()=>({$el:"button",if:'$inputText !== ""',attrs:{id:'$id + "_source_search_clear"',type:"button",onClick:"$handlers.clearSearch","aria-label":"Clear Source Search",class:'$classes.transferlistSearchClear + " " + $classes.sourceSearchClear'}})),Bi=fi("targetSearchClear",()=>({$el:"button",if:'$targetInputText !== ""',attrs:{id:'$id + "_target_search_clear"',type:"button",onClick:"$handlers.clearTargetSearch","aria-label":"Clear Target Search",class:'$classes.transferlistSearchClear + " " + $classes.targetSearchClear'}})),Hi=fi("sourceListItems",()=>({$el:"ul",attrs:{id:'$id + "_source_list_items"',"aria-activedescendant":"$activeDescendant",onMouseenter:"$handlers.onMouseenter(true)",onMouseout:"$handlers.onMouseleave(true)",role:"listbox","aria-multiselectable":"true","aria-roledescription":"List of options to choose from.",class:'$classes.transferlistListItems + " " + $classes.sourceListItems',onKeydown:"$handlers.sourceListKeydown",tabindex:"$searchable || $sourceOptions.length === 0 && -1 || 0",onFocus:"$handlers.sourceListFocused",onBlur:"$handlers.sourceListBlurred","aria-label":"Source list"}})),Ri=fi("sourceListItem",()=>({for:["option","index","$sourceOptions"],$el:"li",attrs:{id:'$id + "_source_list_item_" + $index',"data-value":"$option.value","aria-selected":"$transferOnSelect === false && $fns.isSelected($option, $selectedSourceItems)","data-is-active":"$fns.isActive($option, $activeValue)","data-disabled":"$option.attrs.disabled",role:"option",onClick:"$handlers.listitemClick($option, true)",onTouchstartPassive:"$handlers.listitemTouchstart($option, true)",onTouchmovePassive:"$handlers.listitemTouchmove($option, true)",onTouchend:"$handlers.listitemTouchend($option, true)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.sourceListItem'}})),Ni=fi("sourceOption",()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option, $selectedSourceItems)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}})),Ki=fi("sourceLoadMore",()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_source_load_more"',key:"loadMore",onClick:"$handlers.listitemClick($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}})),Wi=fi("loadMoreInner","span"),qi=fi("target",()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}})),zi=fi("targetHeader",()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}})),Ui=fi("targetListItems",()=>({$el:"ul",attrs:{id:"$id","aria-activedescendant":"$activeDescendant",onMouseenter:"$handlers.onMouseenter(false)",onMouseout:"$handlers.onMouseleave(false)",role:"listbox",class:'$classes.transferlistListItems + " " + $classes.targetListItems',tabindex:"$targetOptions.length === 0 && -1 || 0",onKeydown:"$handlers.targetListKeydown",onFocus:"$handlers.targetListFocused",onBlur:"$handlers.targetListBlurred","aria-label":"Target list"}})),Yi=fi("targetListItem",()=>({for:["option","index","$targetOptions"],$el:"li",attrs:{id:'$id + "_target_list_item_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value","aria-selected":"$transferOnSelect === false && $fns.isSelected($option, $selectedTargetItems)","data-is-active":"$fns.isActive($option, $activeValue)",role:"option",onClick:"$handlers.listitemClick($option, false)",onTouchstartPassive:"$handlers.listitemTouchstart($option, false)",onTouchmovePassive:"$handlers.listitemTouchmove($option, false)",onTouchend:"$handlers.listitemTouchend($option, false)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.targetListItem'}})),ji=fi("targetOption",()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index + "_option"',"data-checked":"$fns.isSelected($option, $selectedTargetItems)",class:'$classes.transferlistOption + " " + $classes.targetOption'}})),Zi=fi("transferControls",()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}})),Gi=fi("transferButtonForward",()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_forward"',type:"button",disabled:"$selectedSourceItems.length === 0 || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForward","aria-label":"$ui.addSelectedValues.value",title:"$ui.addSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonForward'}})),Xi=fi("transferButtonForwardAll",()=>({$el:"button",attrs:{id:'$id + "_transfer_button_forward_all"',type:"button",disabled:"$sourceOptions.length === 0 || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForwardAll","aria-label":"$ui.addAllValues.value",title:"$ui.addAllValues.value",onFocus:"$handlers.transferForwardAllFocused",class:'$classes.transferlistButton + " " + $classes.transferButtonForwardAll'}})),Ji=fi("transferButtonBackward",()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_backward"',onClick:"$handlers.transferBackward",type:"button",disabled:"$selectedTargetItems.length === 0 || $targetOptions.length === 0 || $disabled","aria-label":"$ui.removeSelectedValues.value",title:"$ui.removeSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackward'}})),Qi=fi("transferButtonBackwardAll",()=>({$el:"button",attrs:{id:'$id + "_transfer_button_backward_all"',onClick:"$handlers.transferBackwardAll",type:"button",disabled:"$targetOptions.length === 0 || $disabled","aria-label":"$ui.removeAllValues.value",title:"$ui.removeAllValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackwardAll'}})),ep=fi("controlLabel","span"),tp=fi("sourceEmptyMessage",()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}})),op=fi("targetEmptyMessage",()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}})),np=fi("emptyMessageInner","span"),rp=Symbol(),sp=new WeakSet,ap=new WeakSet;function lp(e,t,o,n){if(!(e.props.disabled||(e.props.isSourceOption=o,e.props.isSourceOption&&Array.isArray(e.value)&&e.value.length>=e.props.max)))if(o){if(e.props.selectedSourceItems.includes(t))return e.props.selectedSourceItems=e.props.selectedSourceItems.filter(e=>e!==t),e.props.activeValue=void 0,void(e.props.activeDescendant=void 0);e.props.selectedTargetItems=[],e.props.selectedSourceItems=[...e.props.selectedSourceItems,t]}else{if(e.props.selectedTargetItems.includes(t))return void(e.props.selectedTargetItems=e.props.selectedTargetItems.filter(e=>e!==t));e.props.selectedSourceItems=[],e.props.selectedTargetItems=[...e.props.selectedTargetItems,t]}}function ip(e,t){if(e.props.sourceListOrigin=!0,e.props.maxReached)return;if(t){const o=Array.isArray(e.value)?[...e.value,t]:[t];return void e.input(o)}const o=e.props.selectedSourceItems.map(e=>Se(e));Array.isArray(e.value)?e.input([...e.value,...o]):e.input(o),e.props.selectedSourceItems=[]}function pp(t,o){if(t.props.sourceListOrigin=!1,o){const n=Array.isArray(t.value)?t.value.filter(t=>!e.eq(t,o)):[];return void t.input(n)}const n=t.props.selectedTargetItems.map(e=>Se(e));if(Array.isArray(t.value)){const e=t.value.filter(e=>!n.includes(e));t.input(e)}t.props.selectedTargetItems=[]}function dp(e){var t,o;if(e.props.activeValue===rp){const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_source_load_more`);return void(o&&o.scrollIntoView({block:"nearest",inline:"start"}))}const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);n&&n.scrollIntoView({block:"nearest",inline:"start"})}function cp(t){var o;if(Array.isArray(t.value)){const o=[];let n=[...t.props.options];t.value.forEach(r=>{const s=t.props.memoOptions.find(t=>e.eq(Se(t),r));if(s&&!s.noOptionFound){o.push(s);const a=t.props.options.findIndex(t=>e.eq(Se(t),r));-1!==a&&(n=n.filter(t=>!e.eq(Se(t),r)))}else{const t=n.find(t=>e.eq(Se(t),r));t?(o.push(t),n=n.filter(t=>!e.eq(Se(t),r))):o.push({label:String(r),value:r,noOptionFound:!0})}}),t.props.targetOptions=t.props.targetInputText?o.filter(e=>t.props.filter(e,t.props.targetInputText,t)):o,t.props.sourceOptions=n}else t.props.sourceOptions=[...t.props.options],t.props.targetOptions=[];if(t.props.skipSetActiveValue)return void(t.props.skipSetActiveValue=!1);(null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(t.props.id+"_source_list_items"))&&up(t)}function up(e){var t,o,n,r,s,a,l,i,p;if(e.props.isDragging)return;if(e.props.targetSearchActive){if((null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.activeElement)||void 0===o?void 0:o.id)===`${e.props.id}_target_search_input`){const t=e.props.targetOptions.find(e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)});return t?void(e.props.activeValue=Se(t)):void(e.props.activeValue=void 0)}return}if(e.props.sourceSearchActive){if((null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.activeElement)||void 0===r?void 0:r.id)===`${e.props.id}_source_search_input`){const t=e.props.sourceOptions.find(e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)});return t?void(e.props.activeValue=Se(t)):void(e.props.activeValue=void 0)}e.props.sourceSearchActive=!1}if(!1===e.props.transferOnSelect)return void(e.props.activeValue=void 0);const d=e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions;let c=!1;for(let t=e.props.activeIndex;t<=d.length;t++)if(!(null===(s=d.attrs)||void 0===s?void 0:s.disabled)&&d[t]){c=!0,e.props.activeValue=Se(d[t]);break}if(!c&&d.length)for(let t=e.props.activeIndex;t>=0;t--)if(!(null===(a=d.attrs)||void 0===a?void 0:a.disabled)&&d[t])return c=!0,void(e.props.activeValue=Se(d[t]));if(!c){let t;t=e.props.sourceListOrigin?null===(p=e.props.__root)||void 0===p?void 0:p.getElementById(`${e.props.id}`):e.props.searchable?null===(l=e.props.__root)||void 0===l?void 0:l.getElementById(`${e.props.id}_source_search_input`):null===(i=e.props.__root)||void 0===i?void 0:i.getElementById(`${e.props.id}_source_list_items`),t&&t.focus()}}function fp(e,t){return(t?e.props.sourceOptions:e.props.targetOptions).find(e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})}function vp(t){Array.isArray(t.value)&&t.value.forEach(async o=>{Ne(t,o,function(t,o){const n=[...t.props.options,...t.props.memoOptions];return n.find(t=>e.eq(Se(t),o))}(t,o))})}function hp(t){t.context&&(t.context.handlers.loadMore=Fe.bind(null,t),t.context.fns.getSourceItemCount=e=>!1===t.props.transferOnSelect&&e.length?e.length+"/"+t.props.sourceOptions.length:t.props.sourceOptions.length,t.context.fns.getTargetItemCount=e=>!1===t.props.transferOnSelect&&e.length?e.length+"/"+t.props.targetOptions.length:t.props.targetOptions.length,t.context.fns.isActive=(o,n)=>{if(!t.props.isDragging&&!t.props.touchStarted)return e.eq(n,Se(o))||void 0},t.context.fns.isSelected=(e,t)=>!!t&&(!!Array.isArray(t)&&t.includes(e)),t.context.fns.optionLoading=e=>t.props.optionLoaderValues.includes(Se(e)),t.context.handlers.clearSearch=()=>{!function(e){var t;e.props.sourceSearchActive=!1,e.props.inputText="",Ve(e,"",!0);const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_source_search_input`);if(!o)return;o.focus()}(t)},t.context.handlers.clearTargetSearch=()=>{!function(e){var t;e.props.targetSearchActive=!1,e.props.targetInputText="";const o=[...new Set([...e.props.options,...e.props.memoOptions])],n=[];for(const t of e.value){const e=o.find(e=>Se(e)===t);e&&n.push(e)}e.props.targetOptions=n;const r=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_target_search_input`);if(!r)return;r.focus()}(t)},t.context.handlers.sourceSearchBlur=e=>{setTimeout(()=>{var o;if(e.relatedTarget&&e.relatedTarget instanceof HTMLElement&&(e.relatedTarget.id===`${t.props.id}_source_list_items`||e.relatedTarget.id===`${t.props.id}`)){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}_source_search_input`);if(!e)return;e.focus()}else t.props.activeValue=void 0})},t.context.handlers.targetSearchBlur=e=>{setTimeout(()=>{var o;if(e.relatedTarget&&e.relatedTarget instanceof HTMLElement&&(e.relatedTarget.id===`${t.props.id}_source_list_items`||e.relatedTarget.id===`${t.props.id}`)){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}_target_search_input`);if(!e)return;e.focus()}else t.props.activeValue=void 0})},t.context.handlers.listitemClick=(e,o)=>n=>{mp(t,e,o)},t.context.handlers.transferForward=ip.bind(null,t,void 0),t.context.handlers.transferForwardAll=()=>{let e;if(t.props.maxReached)return;const o=t.props.sourceOptions.map(e=>Se(e));e=Array.isArray(t.value)?[...t.value,...o]:[...o],t.input(e),t.props.selectedSourceItems=[]},t.context.handlers.transferBackward=pp.bind(null,t,void 0),t.context.handlers.transferBackwardAll=()=>{Array.isArray(t.value)&&(t.input([]),t.props.selectedTargetItems=[])},t.context.handlers.onSearch=e=>{!function(e,t){e.props.sourceSearchActive=!0;const o=t.target;e.props.inputText=o.value,Ve(e,o.value,!0)}(t,e)},t.context.handlers.onTargetSearch=e=>{!function(e,t){e.props.targetSearchActive=!0;const o=t.target;e.props.targetInputText=o.value;const n=[...new Set([...e.props.memoOptions,...e.props.options])],r=[];for(const t of e.value){const e=n.find(e=>Se(e)===t);e&&r.push(e)}const s=[...new Map([...e.props.targetOptions,...r].map(e=>[JSON.stringify(e),e])).values()];e.props.targetOptions=s.filter(t=>e.props.filter(t,o.value,e)),0===e.props.targetOptions.length?e.props.showTargetEmptyMessage=!0:e.props.showTargetEmptyMessage=!1;up(e)}(t,e)},t.context.handlers.onMouseenter=e=>o=>{"touchstart"!==o.type&&(e?t.props.mouseOnSource=!0:t.props.mouseOnTarget=!0)},t.context.handlers.onMouseleave=e=>o=>{var n;if("touchend"===o.type)return;const r=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(e?`${t.props.id}_source_list_items`:`${t.props.id}`);r&&(r.contains(o.relatedTarget)||(t.props.trackHover=!1,t.props.activeValue=void 0,t.props.activeDescendant=void 0,t.props.activeIndex=void 0,e?t.props.mouseOnSource=!1:t.props.mouseOnTarget=!1))},t.context.handlers.listitemClick=(e,o)=>n=>{n instanceof MouseEvent&&t.props.touchStarted||mp(t,e,o)},t.context.handlers.listitemTouchstart=()=>()=>{!function(e){e.props.touchStarted=!0}(t)},t.context.handlers.listitemTouchend=(e,o)=>n=>{!function(e,t,o){if(e.props.touchMoved)return e.props.touchMoved=!1,void(e.props.touchStarted=!1);const n=Se(t);e.props.activeIndex=e.props.sourceOptions.findIndex(e=>Se(e)===n),e.props.transferOnSelect?o?ip(e,n):pp(e,n):lp(e,t,o)}(t,e,o)},t.context.handlers.listitemTouchmove=()=>e=>{!function(e){e.props.touchMoved=!0}(t)},t.context.handlers.sourceSearchFocus=e=>{gp(t,!0)},t.context.handlers.targetSearchFocus=e=>{gp(t,!1)},t.context.handlers.sourceListFocused=e=>{gp(t,!0)},t.context.handlers.targetListFocused=()=>{gp(t,!1)},t.context.handlers.sourceListBlurred=e=>{t.props.activeValue=void 0},t.context.handlers.targetListBlurred=e=>{t.props.activeValue=void 0},t.context.handlers.sourceListKeydown=e=>{$p(t,e,!0)},t.context.handlers.targetListKeydown=e=>{$p(t,e,!1)},t.context.handlers.sourceSearchKeydown=e=>{$p(t,e,!0)},t.context.handlers.targetSearchKeydown=e=>{$p(t,e,!1)})}function mp(t,o,n,r){var s;if(Se(o)===rp)return void(null===(s=t.context)||void 0===s||s.handlers.loadMore(!0));const a=Se(o);t.props.activeIndex=t.props.sourceOptions.findIndex(t=>e.eq(Se(t),a)),t.props.transferOnSelect?n?ip(t,a):pp(t,a):lp(t,o,n)}function gp(e,t){const o=fp(e,t);o&&(e.props.sourceListOrigin=t,e.props.activeValue=Se(o))}function $p(e,t,o){if("ArrowDown"===t.key||"ArrowUp"===t.key)!function(e,t,o){var n,r,s;e.preventDefault();const a=o?t.props.sourceOptions:t.props.targetOptions,l=a.reduce((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(Se(t)),e},[]);(null===(n=t.store.hasNextPage)||void 0===n?void 0:n.value)&&l.push(rp);const i=l.indexOf(t.props.activeValue);if("ArrowUp"===e.key&&0!==i)for(let e=i-1;e>=0;e--){t.props.sourceListOrigin=o,t.props.activeValue=l[i-1];break}else if("ArrowDown"===e.key&&i!==l.length-1)for(let e=i+1;e<l.length;e++)if(!(null===(s=null===(r=a[e])||void 0===r?void 0:r.attrs)||void 0===s?void 0:s.disabled)){t.props.sourceListOrigin=o,t.props.activeValue=l[e];break}dp(t)}(t,e,o);else if("ArrowRight"===t.key||"ArrowLeft"===t.key){if("ArrowLeft"===t.key&&o)return;if("ArrowRight"===t.key&&!o)return;!function(e,t,o){if(t.props.searchable)return;e.preventDefault(),function(e,t){var o,n,r;if(fp(e,!t))if(t){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);t&&t.focus()}else if(e.props.searchable){const t=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_source_search_input`);t&&t.focus()}else{const t=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_source_list_items`);t&&t.focus()}}(t,o)}(t,e,o)}else"Enter"===t.key&&function(e,t,o){var n;if(e.preventDefault(),!t.props.activeValue)return;if(t.props.activeValue===rp)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore(!0));const r=o?t.props.sourceOptions:t.props.targetOptions,s=r.findIndex(e=>Se(e)===t.props.activeValue);t.props.activeIndex=s;const a=r[s];if(!a)return;t.props.transferOnSelect?o?ip(t,Se(a)):pp(t,Se(a)):lp(t,a,o)}(t,e,o)}function bp(t){t.on("created",()=>{if("function"==typeof t.props.optionsLoader&&(t.props.skipSetActiveValue=!0,Ke(t)),hp(t),t.props.disabled&&(t.props.draggable=!1),c){e.whenAvailable(t.props.id+"_source_list_items",e=>{e instanceof HTMLElement&&function(e,t){if(!e.context)return;function o(){return e.props.sourceOptions.map(e=>Se(e))}function r(){return[]}const s={longTouch:!0,draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,group:e.props.id,root:e.props.__root||document,disabled:!e.props.draggable||e.props.maxReached,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,selectionDraggingClass:e.context.classes.selectionDragging,selectionDropZoneClass:e.context.classes.selectionDropZone,touchSelectionDraggingClass:e.context.classes.touchSelectionDragging,touchSelectionDropZoneClass:e.context.classes.touchSelectionDropZone,longTouchClass:e.context.classes.longTouch,handleTouchmove(t){e.props.selectedSourceItems=[],n.handleTouchmove(t)},draggable:e=>"option"===e.getAttribute("role")};s.plugins=[n.multiDrag({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,n.handleDragstart(t)},handleEnd(t){n.handleEnd(t),e.props.isDragging=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.activeDescendant=void 0,e.props.isDragging=!1,e.props.selectedTargetItems=[],e.props.selectedSourceItems=[]},handleTouchstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.mouseOnSource=!1,e.props.mouseOnTarget=!1,n.handleTouchstart(t)},selections:()=>e.props.selectedSourceItems.map(e=>Se(e))})],n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s}),e.on("prop:disabled",({payload:e})=>{s.disabled=e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})}),e.on("prop:draggable",({payload:e})=>{s.disabled=!e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})}),e.on("prop:maxReached",({payload:e})=>{s.disabled=e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})})}(t,e)},t.props.__root),e.whenAvailable(`${t.props.id}`,e=>{e instanceof HTMLElement&&function(e,t){if(!e.context)return;function o(){return e.props.targetOptions.map(e=>Se(e))}function r(t,o){e.props.sourceListOrigin=!0,e.input(t)}const s={longTouch:!0,root:e.props.__root,group:e.props.id,disabled:!e.props.draggable,draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,selectionDraggingClass:e.context.classes.selectionDragging,selectionDropZoneClass:e.context.classes.selectionDropZone,touchSelectionDraggingClass:e.context.classes.touchSelectionDragging,touchSelectionDropZoneClass:e.context.classes.touchSelectionDropZone,longTouchClass:e.context.classes.longTouch,draggable:e=>"option"===e.getAttribute("role"),plugins:[]};s.plugins=[n.multiDrag({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,n.handleDragstart(t)},handleEnd(t){n.handleEnd(t),e.props.selectedTargetItems=[],e.props.selectedSourceItems=[],e.props.activeValue=void 0,e.props.trackHover=!0,e.props.isDragging=!1},handleTouchstart(t){e.props.trackHover=!1,e.props.activeValue=void 0,e.props.isDragging=!0,e.props.activeDescendant=void 0,n.handleTouchstart(t)},selections:()=>e.props.selectedTargetItems.map(e=>Se(e))})],n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s}),e.on("prop:disabled",({payload:e})=>{s.disabled=e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})}),e.on("prop:draggable",({payload:e})=>{s.disabled=!e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})})}(t,e)},t.props.__root);const o=e=>{var o;if(t.props.isDragging)return;t.props.mouseX=e.clientX,t.props.mouseY=e.clientY;const n=t.props.mouseOnSource?`${t.props.id}_source_list_items`:`${t.props.id}`,r=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(n);if(r){const o=r.getBoundingClientRect();e.clientX>o.x&&e.clientX<o.x+o.width&&e.clientY>o.y&&e.clientY<o.y+o.height&&(t.props.trackHover=!0)}};document.addEventListener("mousemove",o)}})}function yp(e,t){var o;let n=null,r="",s=[];if(e.props.mouseOnSource){if(n=sp.has(e),r=`${e.props.id}_source_list_item`,s=[...e.props.sourceOptions],!s||!s.length||n)return s=[],r="",void(n=null)}else if(e.props.mouseOnTarget&&(n=ap.has(e),r=`${e.props.id}_target_list_item`,s=[...e.props.targetOptions],!s||!s.length||n))return s=[],r="",void(n=null);const a=s.reduce((t,o,n)=>{var s,a;if(null===(s=o.attrs)||void 0===s?void 0:s.disabled)return t;const l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(r+`_${n}`);return l&&t.push([l,o]),t},[]),l=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);l&&a.push([l,e.props.loadMoreOption]),e.props.mouseOnSource&&sp.add(e),e.props.mouseOnTarget&&ap.add(e),a.length&&xp(e,a,null,t)}function xp(e,t,o,n){const r=n?n.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.trackHover){if(e.props.mouseY>r.top&&e.props.mouseY<r.bottom){let n=o||0,r=o;const s=(t,n)=>{var r;const s=n[0],{y:a,height:l,x:i,width:p}=s.getBoundingClientRect();if(e.props.mouseX>i&&e.props.mouseX<i+p&&e.props.mouseY>a&&e.props.mouseY<a+l){o=t;const s=n[1];return e.props.activeValue=s&&!(null===(r=s.attrs)||void 0===r?void 0:r.disabled)?Se(s):void 0,!0}return!1};do{if(null!==n&&s(n,t[n]))break;if(null!==r&&s(r,t[r]))break;null!==n&&(n++,n>t.length-1&&(n=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==n||null!==r)}}else dp(e);e.props.mouseOnSource||e.props.mouseOnTarget?e.props.mouseOnSource&&sp.has(e)||e.props.mouseOnTarget&&ap.has(e)?requestAnimationFrame(xp.bind(null,e,t,o,n)):yp(e,n):(sp.delete(e),ap.delete(e))}const wp={schema:/* #__PURE__ */vi(/* #__PURE__ */_i(/* #__PURE__ */ki("$label"),/* #__PURE__ */yi("$help"),/* #__PURE__ */hi(/* #__PURE__ */Si(/* #__PURE__ */Li(/* #__PURE__ */Ii(),/* #__PURE__ */Di(/* #__PURE__ */z("$optionsLoadingCounter > 0",/* #__PURE__ */gi("loader"),"$fns.getSourceItemCount($selectedSourceItems)"))),/* #__PURE__ */Ti(/* #__PURE__ */Ei(/* #__PURE__ */Oi(),/* #__PURE__ */Pi(/* #__PURE__ */gi("close")))),/* #__PURE__ */Hi(/* #__PURE__ */tp(/* #__PURE__ */np("$sourceEmptyMessage")),/* #__PURE__ */Ri(/* #__PURE__ */z("$transferOnSelect !== true && $fns.isSelected($option, $selectedSourceItems)",/* #__PURE__ */gi("selected")),/* #__PURE__ */Ni("$option.label")),/* #__PURE__ */Ki(/* #__PURE__ */z("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",/* #__PURE__ */Wi(/* #__PURE__ */z("$state.loading",/* #__PURE__ */gi("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),/* #__PURE__ */Zi(/* #__PURE__ */Xi(/* #__PURE__ */ep("$ui.addAllValues.value"),/* #__PURE__ */gi("fastForward")),/* #__PURE__ */Gi(/* #__PURE__ */ep("$ui.addSelectedValues.value"),/* #__PURE__ */gi("moveRight")),/* #__PURE__ */Ji(/* #__PURE__ */ep("$ui.removeSelectedValues.value"),/* #__PURE__ */gi("moveLeft")),/* #__PURE__ */Qi(/* #__PURE__ */ep("$ui.removeAllValues.value"),/* #__PURE__ */gi("rewind"))),/* #__PURE__ */qi(/* #__PURE__ */zi(/* #__PURE__ */Ai(),/* #__PURE__ */Ci("$fns.getTargetItemCount($selectedTargetItems)")),/* #__PURE__ */Fi(/* #__PURE__ */Mi(/* #__PURE__ */Vi(),/* #__PURE__ */Bi(/* #__PURE__ */gi("close")))),/* #__PURE__ */Ui(/* #__PURE__ */op(/* #__PURE__ */z("$state.loading !== true",/* #__PURE__ */np("$targetEmptyMessage"))),/* #__PURE__ */Yi(/* #__PURE__ */z("$transferOnSelect !== true && $fns.isSelected($option, $selectedTargetItems)",/* #__PURE__ */gi("selected")),/* #__PURE__ */ji(/* #__PURE__ */z("$fns.optionLoading($option, $optionLoaderValues)","$ui.isLoading.value","$option.label")))))),/* #__PURE__ */xi(/* #__PURE__ */wi("$message.value")))),type:"input",props:[],features:[
49
49
  /* #__PURE__ */o.defaultIcon("moveRight","right"),
50
50
  /* #__PURE__ */o.defaultIcon("moveLeft","left"),
51
51
  /* #__PURE__ */o.defaultIcon("fastForward","fastForward"),
@@ -58,8 +58,8 @@
58
58
  /* #__PURE__ */o.localize("addAllValues"),
59
59
  /* #__PURE__ */o.localize("addSelectedValues"),
60
60
  /* #__PURE__ */o.localize("removeSelectedValues"),
61
- /* #__PURE__ */o.localize("removeAllValues"),o.options,function(t){!function(t){t.addProps(["search","options","selectedItems","activeValue","activeIndex","activeDescendant","targetOptions","sourceOptions","optionLoader","isLoadingOptions","filterOptions","inputText","hasNextPage","page","targetLoading","searchable","sourceLabel","targetLabel","transferOnSelect","disabled","placeholder","filter","showSourceEmptyMessage","showTargetEmptyMessage","sourceEmptyMessage","targetEmptyMessage","clearOnSelect","max","maxReached","debounce","sourceListActive","optionLoaderValues","optionLoadingCounter","optionsLoadingCounter","memoOptions","optionsLoaded","selectedSourceItems","selectedTargetItems","draggable","loadMore","loadMoreOption","targetSearchable","targetInputText"]),t.props.loadMoreOption={label:"Load more",value:Xi},void 0===t.props.draggable?t.props.draggable=!0:"false"===t.props.draggable&&(t.props.draggable=!1),t.props.optionsLoaderValues=[],t.props.selectedSourceItems=[],t.props.selectedTargetItems=[],t.props.optionsLoaded=void 0,t.props.memoOptions=[],t.props.multiple=!0,t.props.debounce=t.props.debounce?parseInt(t.props.debounce):200,t.props.optionLoaderValues=[],t.props.optionsLoadingCounter=0,t.props.optionLoadingCounter=0,t.props.page=1,t.props.hasNextPage=Fe.bind(null,t),t.props.options?t.props.options=[...t.props.options]:t.props.options=[],t.props.sourceOptions=[],t.props.targetOptions=[],"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.props.searchable=e.undefine(t.props.searchable),t.props.searchable&&(t.props.inputText=""),t.props.targetSearchable=e.undefine(t.props.targetSearchable),t.props.targetSearchable&&(t.props.targetInputText=""),t.props.clearOnSelect=e.undefine(t.props.clearOnSelect),void 0===t.props.transferOnSelect?t.props.transferOnSelect=!0:"false"===t.props.transferOnSelect&&(t.props.transferOnSelect=!1),t.props.targetOptions.length&&(t.props.targetOptionValues=t.props.targetOptions.map((e=>Se(e)))),t.props.initialOptions=[...t.props.options],t.props.max&&(t.props.max=parseInt(t.props.max)),t.props.sourceListOrigin=void 0,"function"!=typeof t.props.filter&&(t.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase()))}(t),function(e){e.on("commit",(async({payload:t})=>{e.props.activeValue=void 0,e.props.max&&(e.props.maxReached=t.length>=e.props.max),e.props.clearOnSelect&&e.props.inputText&&(e.props.reFilter=!0,e.props.inputText=""),e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])],e.props.searchable&&e.props.reFilter&&!e.props.initialLoad?(De(e,e.props.inputText),e.props.reFilter=!1):e.props.initialLoad||(e.isCreated||(e.props.skipSetActiveValue=!0),rp(e)),"function"==typeof e.props.optionLoader?lp(e):e.props.initialLoad||(e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])])}))}(t),up(t),function(t){t.on("prop:options",(()=>{t.props.appendingOptions&&(t.props.skipSetActiveValue=!0,t.props.appendingOptions=!1),rp(t)})),t.on("prop:memoOptions",(()=>{t.props.skipSetActiveValue=!0,rp(t)})),t.on("prop:sourceOptions",(()=>{0===t.props.sourceOptions.length?t.props.showSourceEmptyMessage=!0:t.props.showSourceEmptyMessage=!1,Ji.delete(t)})),t.on("prop:targetOptions",(()=>{0===t.props.targetOptions.length?t.props.showTargetEmptyMessage=!0:t.props.showTargetEmptyMessage=!1})),t.on("prop:activeValue",(({payload:o})=>{if(t.props.isDragging)return void(t.props.activeDescendant=void 0);if(o===Xi)return void(t.props.activeDescendant=`${t.props.id}_load_more`);const n=(t.props.sourceListOrigin?t.props.sourceOptions:t.props.targetOptions).findIndex((t=>e.eq(Se(t),o)));n>=0&&t.props.sourceListOrigin?t.props.activeDescendant=`${t.props.id}_source_list_item_${n}`:t.props.activeDescendant=n>=0?`${t.props.id}_target_list_item_${n}`:void 0})),t.on("prop:mouseOnSource",(({payload:e})=>{var o;if(e&&!0!==t.props.disabled&&!t.props.isDragging){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(t.props.id+"_source_list_items");if(!e)return;t.props.mouseOnTarget=!1,t.props.sourceListOrigin=!0,Ji.delete(t),fp(t,e)}})),t.on("prop:mouseOnTarget",(({payload:e})=>{var o;if(e&&!0!==t.props.disabled&&!t.props.isDragging){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}`);if(!e)return;t.props.mouseOnSource=!1,t.props.sourceListOrigin=!1,Qi.delete(t),fp(t,e)}})),t.on("prop:optionsLoadingCounter",(({payload:e})=>{0===e&&0===t.props.optionLoadingCounter&&t.store.set(Te)})),t.on("prop:optionLoadingCounter",(({payload:e})=>{0===e&&0===t.props.optionsLoadingCounter&&(t.store.set(Te),t.props.skipSetActiveValue=!0,rp(t))}))}(t)}]};const mp=/* #__PURE__ */K("sl"),{outer:gp,wrapper:$p,inner:bp,icon:yp,prefix:xp,suffix:wp,help:_p,messages:kp,message:Sp}=/* #__PURE__ */W(mp),Lp=mp("label",(()=>({if:"$label",$el:"label",attrs:{id:"$id + '_label'"}}))),Ip=mp("chart",(()=>({$el:"div",if:"$chart"}))),Dp=mp("chartBar",(()=>({$el:"div",for:["bar","index","$chart"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$bar.at >= $_value.0 && $bar.at <= $_value.1",else:"$bar.at >= $_value.1 && $bar.at <= $_value.0"},else:"$bar.at <= $_value"},style:{left:'$bar.at / ($max - $min) * 100 + "%"',width:'$: "calc(" + (100 / $chart.length) + "% - 2px)"',height:{if:"$largestBar",then:'$bar.value / $largestBar * 100 + "%"'}}}}))),Ap=mp("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),Cp=mp("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),Tp=mp("trackWrapper",(()=>({$el:"div"}))),Ep=mp("trackInner",(()=>({$el:"div"}))),Op=mp("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),Mp=mp("linkedValues",(()=>({$el:"div"}))),Vp=mp("maxValue",(()=>({$formkit:"number",bind:"$computedMaxInputAttrs",ignore:!0,number:!0,value:{if:"$isMulti",then:"$_value.1",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.maxNode",onBlur:"$handlers.inputBlur"}))),Fp=mp("minValue",(()=>({$formkit:"number",if:"$isMulti",bind:"$computedMinInputAttrs",ignore:!0,number:!0,value:{if:"$isMulti",then:"$_value.0",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.minNode",onBlur:"$handlers.inputBlur"}))),Pp=mp("marks",(()=>({$el:"div",if:"$marks"}))),Bp=mp("mark",(()=>({$el:"span",for:["step","index","$marks"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$step.at >= $_value.0 && $step.at <= $_value.1",else:"$step.at >= $_value.1 && $step.at <= $_value.0"},else:"$step.at <= $_value"},class:{if:"$step.class",then:'$: $classes.mark + " " + $step.class',else:"$classes.mark"},style:{left:'$: $fns.calculateMarkPosition($step.at) + "%"'}}}))),Hp=mp("markLabel",(()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}}))),Rp=mp("handles",(()=>({$el:"ul"}))),Np=mp("handleMax",(()=>({$el:"li",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "max"',"data-handle":"max","data-show-tooltip":"$tooltip",class:"$: 'formkit-handle ' + $classes.handle + ' ' + $classes.handleMax",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstartPassive:"$handlers.startDrag",style:"$maxHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Kp=mp("handleMin",(()=>({$el:"li",if:"$isMulti",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "min"',"data-handle":"min","data-show-tooltip":"$tooltip",class:"$: $classes.handle + ' ' + $classes.handleMin",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstartPassive:"$handlers.startDrag",style:"$minHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Wp=mp("handleMinInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}}))),qp=mp("handleMaxInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}}))),Up=mp("tooltipMax",(()=>({$el:"div",if:'$tooltip === true || $tooltip === "auto"',children:{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.1, "max")',else:'$tooltipFormat($_value.0, "max")'},else:'$tooltipFormat($_value, "max")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMax"}}))),zp=mp("tooltipMin",(()=>({$el:"div",if:'$isMulti && ($tooltip === true || $tooltip === "auto")',children:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.0, "min")',else:'$tooltipFormat($_value.1, "min")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMin"}}))),Yp={schema:/* #__PURE__ */gp(/* #__PURE__ */$p(/* #__PURE__ */Lp("$label"),/* #__PURE__ */_p("$help"),/* #__PURE__ */Ap(/* #__PURE__ */yp("prefix"),/* #__PURE__ */xp(),/* #__PURE__ */Cp(/* #__PURE__ */Ip(/* #__PURE__ */Dp()),/* #__PURE__ */Tp(/* #__PURE__ */Ep(/* #__PURE__ */Op(),/* #__PURE__ */Pp(/* #__PURE__ */Bp(/* #__PURE__ */Hp())),/* #__PURE__ */Rp(/* #__PURE__ */Kp(/* #__PURE__ */zp(),/* #__PURE__ */Wp()),/* #__PURE__ */Np(/* #__PURE__ */Up(),/* #__PURE__ */qp()))))),/* #__PURE__ */wp(),/* #__PURE__ */yp("suffix"),/* #__PURE__ */U("$showInput && $isMulti === false",/* #__PURE__ */Vp())),/* #__PURE__ */U("$showInput && $isMulti",/* #__PURE__ */Mp(/* #__PURE__ */Fp(),/* #__PURE__ */Vp())),/* #__PURE__ */kp(/* #__PURE__ */Sp("$message.value")))),type:"input",family:"",props:["min","max","step","showInput","tooltip","tooltipFormat","inputAttrs","maxInputAttrs","minInputAttrs","marks","markLabels","snapToMarks","chart","scalingFunction","intervals"],features:[function(t){let o,n,r;t.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]);const s={linear:{forward:e=>e,reverse:e=>e},log:{forward:(e,o=t.props.min,n=t.props.max)=>n*Math.pow(e/n,1.5),reverse:(e,o=t.props.min,n=t.props.max)=>n*Math.pow(e/n,1/1.5)}};let a=!1;function l(){const e=document.activeElement;if(e instanceof HTMLInputElement){const t=e.value;e.value="",e.value=t}}function i(e){if(!e)return;const t={disabled:e.props.disabled,min:"number"==typeof e.props.min?e.props.min:0,max:"number"==typeof e.props.max?e.props.max:void 0,step:e.props.step||1};e.props.minInputAttrs=Object.assign(e.props.minInputAttrs||{},t),e.props.maxInputAttrs=Object.assign(e.props.maxInputAttrs||{},t),e.props.inputAttrs=e.props.inputAttrs&&"object"==typeof e.props.inputAttrs?Object.assign(e.props.inputAttrs,t):t,e.props.computedMaxInputAttrs=e.props.maxInputAttrs&&"object"==typeof e.props.maxInputAttrs?Object.assign({},e.props.inputAttrs,e.props.maxInputAttrs):e.props.inputAttrs,e.props.computedMinInputAttrs=e.props.minInputAttrs&&"object"==typeof e.props.minInputAttrs?Object.assign({},e.props.inputAttrs,e.props.minInputAttrs):e.props.inputAttrs}function p(e){const{min:o,max:n,intervals:r}=t.props;if(e=Math.min(Math.max(e,0),100),!r||0===r.length){b();const r=o+e/100*(n-o);return t.props.scalingFunction.reverse(r,o,n)}const s=c(r,o,n);for(let t=0;t<s.length;t++){const{value:o,step:n,left:r,width:a,stepsInInterval:l}=s[t];if(e>=r&&e<=r+a){const t=o+(e-r)/a*l*n,s=t%n;return m(s<n/2?t-s:t+(n-s))}}return e>100?n:e<0?o:void 0}function d(e,o=t.props.min,n=t.props.max){const r=t.props.intervals;if(!r||0===r.length){b();return(t.props.scalingFunction.forward(e,o,n)-o)/(n-o)*100}const s=c(r,o,n);for(let t=0;t<s.length;t++){const{value:o,step:r,left:a,width:l,stepsInInterval:i}=s[t],p=t<s.length-1?s[t+1].value:n;if(e>=o&&e<=p){return 100*((a+(e-o)/r/i*l)/100)}}return 100}function c(e,o=t.props.min,n=t.props.max){(e=[...e]).sort(((e,t)=>e.value-t.value)),e[0].value!==o&&e.unshift({value:o,step:t.props.step});let r=0;for(let t=0;t<e.length;t++){const o=e[t].value,s=((t<e.length-1?e[t+1].value:n)-o)/e[t].step;r+=s}let s=0;return e.map(((t,o)=>{const a=t.value,l=((o<e.length-1?e[o+1].value:n)-a)/t.step,i=s/r*100;return s+=l,{value:t.value,step:t.step,left:i,width:l/r*100,stepsInInterval:l,totalSteps:r}}))}function u(){const e=parseFloat(`${t.props.min}`),o=parseFloat(`${t.props.max}`);let n,r=0;if(Array.isArray(t._value)){const e=[...t._value].sort(f);r=parseFloat(`${e[0]}`),n=parseFloat(`${e[1]}`)}else n=parseFloat(`${t._value}`);t.props.maxHandleStyles={left:`${d(n,e,o)}%`},t.props.isMulti&&Array.isArray(t._value)?(t.props.minHandleStyles={left:`${d(r,e,o)}%`},t.props.fillStyles={left:`${d(r,e,o)}%`,width:d(n,e,o)-d(r,e,o)+"%"}):t.props.fillStyles={left:"0%",width:`${d(n,e,o)}%`}}function f(e,t){return parseFloat(`${e}`)-parseFloat(`${t}`)}function v(e,n=!0){if(t.props.disabled)return;let r;if(void 0===e){if(t.props.isMulti)t.input([g(t.props.min),g(t.props.max)]);else{const e=t.props.min+(t.props.max-t.props.min)/2;t.input(g(e))}return void u()}if(t.props.isMulti&&Array.isArray(t._value)&&!Array.isArray(e)){const n="min"===t.props.lastHandleInteraction?0:1;t._value[n]=e;const[s,a]=[...t._value];if(s>=a){const e=null==o?void 0:o.querySelector(`[data-handle="${"min"===t.props.lastHandleInteraction?"max":"min"}"]`);null==e||e.focus()}r=g([...t._value].sort(f))}else Array.isArray(e)?r=g(e):(r=g(e),r=isNaN(r)?t.props.min:r);t.props.snapToMarks&&(r=$(r));const s=g(h(r));n&&t.input(s),u()}function h(e){return t.props.isMulti&&Array.isArray(e)?[h(e[0]),h(e[1])]:(e=isNaN(e)?t.props.min:e,Math.min(Math.max(parseFloat(`${e}`),t.props.min),t.props.max))}function m(e){return parseFloat(e.toFixed(t.props.decimals))}function g(e){if(t.props.snapToMarks)return e;if(!t.props.intervals)return Array.isArray(e)?e.map((e=>m(Math.round(e/t.props.step)*t.props.step))):m(Math.round(e/t.props.step)*t.props.step);const o=c(t.props.intervals);if(Array.isArray(e))return e.map((e=>{const n=o.find(((n,r)=>{var s;return e>=n.value&&e<((null===(s=o[r+1])||void 0===s?void 0:s.value)||t.props.max)}));if(!n)return e;return m(n.value+Math.round((e-n.value)/n.step)*n.step)}));{const n=o.find(((n,r)=>{var s;return e>=n.value&&e<((null===(s=o[r+1])||void 0===s?void 0:s.value)||t.props.max)}));if(!n)return e;return m(n.value+Math.round((e-n.value)/n.step)*n.step)}}function $(e){if(Array.isArray(e))return e[0]=$(e[0]),e[1]=$(e[1]),e;{const o=t.props.marks,n=o.reduce(((t,o)=>Math.abs(o.at-e)<Math.abs(t.at-e)?o:t),o[0]);return n.at}}function b(){if(a)return;e.undefine(t.props.scalingFunction)?"string"==typeof t.props.scalingFunction?t.props.scalingFunction=s[t.props.scalingFunction]||s.linear:"object"==typeof t.props.scalingFunction&&(t.props.scalingFunction={...s.linear,...t.props.scalingFunction}):t.props.scalingFunction=s.linear,a=!0}t.props.maxHandleStyles={left:"0%"},t.props.fillStyles={left:"0%",width:"0%"},t.props.isMulti=!1,t.props.step=1,t.props.min=0,t.props.max=100,t.props.tooltipFormat="function"==typeof t.props.tooltipFormat?t.props.tooltipFormat:(e,t)=>{if(t)return e},t.props.largestBar=0,"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.on("created",(()=>{var s;b(),t.props.isMulti=Array.isArray(t.value),t.props.step=parseFloat(`${t.props.step}`),t.props.decimals=(null===(s=t.props.step.toString().split(".")[1])||void 0===s?void 0:s.length)||0,t.props.min=t.props.min?parseFloat(`${t.props.min}`):0,t.props.max=t.props.max?parseFloat(`${t.props.max}`):100;const a=e.undefine(t.props.tooltip);t.props.tooltip=void 0===t.props.tooltip?"auto":a;const m=e.undefine(t.props.marks);if(t.props.marks=!!m&&(Array.isArray(t.props.marks)?t.props.marks:function(){const{min:e,max:o,step:n}=t.props,r=[];for(let t=e;t<=o;t+=n)r.push({at:t,label:t});return r}()),t.props.markLabels=e.undefine(t.props.markLabels),t.props.snapToMarks=e.undefine(t.props.snapToMarks),t.props.showInput=e.undefine(t.props.showInput),t.props.largestBar=t.props.chart?t.props.chart.reduce(((e,t)=>t.value>e?t.value:e),0):t.props.largestBar,i(t),e.whenAvailable(`track-${t.props.id}`,(()=>{var e;o=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`track-${t.props.id}`),v(t.value,!1),u()}),t.props.__root),t.context){let s=0,a="";const i=t.context.handlers.blur;t.context.handlers.blur=e=>{i(e),t.emit("blur")},t.context.handlers.clickTrack=e=>{if(!o)return;t.props.dragging=!1;const{left:n,width:r}=o.getBoundingClientRect(),s=(e.clientX-n)/r;if(t.props.isMulti&&Array.isArray(t.value)){const[e,o]=t.value,n=Math.abs(e-s*t.props.max)<Math.abs(o-s*t.props.max)?"min":"max",r="min"===n?0:1;t.props.lastHandleInteraction=n,t.value[r]=p(100*s),v(t._value)}else v(p(100*s))},t.context.handlers.focus=e=>{if(!o)return;const n=e.target.dataset.handle;n&&(t.props.lastHandleInteraction=n)},t.context.handlers.clickHandle=e=>{e.stopPropagation(),t.props.attrs.onClick&&t.props.attrs.onClick(e),t.props.dragging=!1,v(t._value)},t.context.handlers.startDrag=e=>{if(!o)return;t.props.dragging=!0;const n="touchstart"===e.type,r=n?"touchmove":"mousemove",s=n?"touchend":"mouseup";t.props.lastHandleInteraction=e.target.dataset.handle||t.props.lastHandleInteraction,document.addEventListener(r,x,{passive:!1}),document.addEventListener(s,(()=>{t.context&&(t.props.dragging=!1,document.removeEventListener(r,x),n&&e.target instanceof HTMLElement&&e.target.blur())}))},t.context.handlers.keydown=e=>{if(["1","2","3","4","5","6","7","8","9","0",".","-"].includes(e.key)){e.preventDefault(),clearTimeout(s),a+=e.key;const t="-"===a?-1:1;s=window.setTimeout((()=>{"-"!==a?(v(parseFloat(a)*t),a=""):a=""}),350)}if(["ArrowLeft","ArrowDown","ArrowRight","ArrowUp","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const o="min"===t.props.lastHandleInteraction?0:1,n=Array.isArray(t._value)?t._value[o]:t._value,r=function(e,o){if(!t.props.intervals)return t.props.step;const n=c(t.props.intervals);if(e>=t.props.max)return n[n.length-1].step;let r=n.find(((o,r)=>{var s;return e>=o.value&&e<((null===(s=n[r+1])||void 0===s?void 0:s.value)||t.props.max)}));if(!r)return t.props.step;if(-1===o){e-r.step<r.value&&(r=n[n.indexOf(r)-1]||r)}return r.step}(n,["ArrowLeft","ArrowDown","PageDown"].includes(e.key)?-1:1);if(t.props.marks&&t.props.snapToMarks){const o=$(n),r=t.props.marks.find((e=>e.at===o)),s=t.props.marks.indexOf(r),a=["ArrowLeft","ArrowDown"].includes(e.key)?-1:1,l=Math.min(Math.max(0,s+a),t.props.marks.length-1);return void v(t.props.marks[l].at)}if(e.metaKey)return void("ArrowLeft"===e.key||"ArrowDown"===e.key?v(t.props.min):v(t.props.max));if("Home"===e.key)return void v(t.props.min);if("End"===e.key)return void v(t.props.max);if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key)){v(n+(e.shiftKey?10*r:r)*(["ArrowLeft","ArrowDown"].includes(e.key)?-1:1))}"PageUp"===e.key?v(n+10*r):"PageDown"===e.key&&v(n-10*r)}},t.context.handlers.maxNode=o=>{r=o,o.hook.commit(((n,r)=>{if(e.eq(o.value,n))return r(n);if(`${o.value}`.includes(".")&&!`${n}`.includes(".")&&l(),t.props.isMulti&&Array.isArray(t.value)){v([t.value[0],n])}else v(n);return r(h(n))}))},t.context.handlers.minNode=o=>{n=o,o.hook.commit(((n,r)=>{if(e.eq(o.value,n))return r(n);if(`${o.value}`.includes(".")&&!`${n}`.includes(".")&&l(),t.props.isMulti&&Array.isArray(t.value)){v([n,t.value[1]])}else v(n);return r(h(n))}))},t.context.handlers.inputBlur=()=>{if(t.props.isMulti&&Array.isArray(t._value)){v([...t._value].sort(f))}},t.context.fns.calculateMarkPosition=e=>d(e,t.props.min,t.props.max)}let y;function x(e){var n;if(!o||!t.props.dragging)return;e.preventDefault();const r=e.clientX||(null===(n=e.touches)||void 0===n?void 0:n.length)&&e.touches[0].clientX,{left:s,width:a}=o.getBoundingClientRect(),l=g(p((r-s)/a*100));y!==l&&(y=l,v(l))}v(t.value)})),t.on("input",(({payload:e})=>{Array.isArray(t.value)&&Array.isArray(e)?t.value[0]===e[0]&&t.value[1]===e[1]||v(e,!1):t.value!==e&&v(e,!1),function(){if(t.props.isMulti&&Array.isArray(t._value)){const[e,o]=[...t._value];n&&n.input(m(e)),r&&r.input(m(o))}else r&&r.input(t._value)}()})),t.on("prop:max",(()=>{t.props.max=t.props.max?parseFloat(`${t.props.max}`):100,v(t.value),i(t)})),t.on("prop:min",(()=>{t.props.min=t.props.min?parseFloat(`${t.props.min}`):0,v(t.value),i(t)}))}]},jp=/* #__PURE__ */K("cp"),{outer:Zp,wrapper:Gp,inner:Xp,label:Jp,prefix:Qp,suffix:ed,help:td,messages:od,message:nd,icon:rd}=/* #__PURE__ */W(jp),sd=jp("swatchPreview",(()=>({$el:"div",attrs:{id:"$id",class:"$classes.swatchPreview",tabindex:{if:"$disabled",then:-1,else:0},onClick:"$handlers.inputPreviewClick",onFocusout:"$handlers.inputPreviewFocusout",onKeydown:"$handlers.inputPreviewKeydown",role:"button","aria-valuetext":'$: "Current color: " + $value'}}))),ad=jp("valueString",(()=>({$el:"span",attrs:{class:"$classes.valueString"},children:{if:'$format === "hex"',then:"$hex",else:{if:'$format === "rgba"',then:"$rgbaString",else:{if:'$format === "hsla"',then:"$hslaString",else:""}}}}))),ld=jp("panel",(()=>({$el:"div",attrs:{id:'$: $id + "_popover"',class:"$classes.panel",onKeydown:"$handlers.panelKeydown","aria-role":{if:"$layout === popover",then:"dialog"},"aria-modal":{if:"$layout === popover",then:"true"},"aria-label":"$label",popover:"$popover",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"'},else:{position:{if:"$inline === undefined || $inline === false",then:"absolute"}}}}}))),id=jp("panelClose",(()=>({$el:"button",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:{if:"$showPanelClose",then:-1,else:0},onKeydown:"$handlers.panelCloseKeydown","aria-label":"$ui.close.value"}}))),pd=jp("controlGroup",(()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}}))),dd=jp("LS",(()=>({$el:"div",attrs:{class:"$classes.LS"}}))),cd=jp("canvasLS",(()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}}))),ud=jp("controlLS",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},class:'$classes.control + " " + $classes.controlLS',onKeydown:"$handlers.lsKeydown",style:{left:'$controlLSPosition.x + "%"',top:'$controlLSPosition.y + "%"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuetext":'$: "Lightness: " + $hslaPercent.l + "%, Saturation: " + $hslaPercent.s + "%"'}}))),fd=jp("hue",(()=>({$el:"div",attrs:{class:"$classes.hue"}}))),vd=jp("canvasHue",(()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}}))),hd=jp("controlHue",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.hueControlKeydown",class:'$classes.control + " " + $classes.controlHue',style:{left:'$: "min(max(" + (($hsla.h / 360) * 100) + "%, 3px), calc(100% - 3px))"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, 100%, 50%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$h"}}))),md=jp("alpha",(()=>({$el:"div",attrs:{class:"$classes.alpha",style:{opacity:{if:"$alpha",then:"1",else:"0.5"},cursor:{if:"$alpha",then:"",else:"not-allowed"},filter:{if:"$alpha",then:"",else:"grayscale(1)"}}}}))),gd=jp("canvasAlpha",(()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true",style:{pointerEvents:{if:"$alpha",then:"auto",else:"none"}}}}))),$d=jp("controlAlpha",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled || $alpha === undefined",then:-1,else:0},onKeydown:"$handlers.alphaControlKeydown",class:'$classes.control + " " + $classes.controlAlpha',style:{left:'$: "min(max(" + ($hsla.a * 100) + "%, 3px), calc(100% - 3px))"',backgroundImage:'$: "linear-gradient(to right, hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + "), hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + ")), linear-gradient(to right, white, white)"',pointerEvents:{if:"$alpha",then:"auto",else:"none"}},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$hsla.a"}}))),bd=jp("preview",(()=>({$el:"div",attrs:{class:"$classes.preview"}}))),yd=jp("canvasPreview",(()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}}))),xd=jp("canvasSwatchPreview",(()=>({$el:"div",attrs:{class:"$classes.canvasSwatchPreviewWrapper"},children:[{$el:"canvas",attrs:{id:'$: "canvas-swatch-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasSwatchPreview',width:33,height:33,"aria-hidden":"true"}}]}))),wd=jp("eyeDropper",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}}))),_d=jp("formatField",(()=>({$el:"div",attrs:{class:"$classes.formatField"}}))),kd=jp("colorInputGroup",(()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}}))),Sd=jp("hexField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hexFieldGroup'},children:[{$el:"input",attrs:{onInput:"$handlers.hexInput",onKeydown:"$handlers.hexKeydown",onFocus:"$handlers.hexFocus",onBlur:"$handlers.hexBlur",id:'$: "hex-" + $id',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",class:'$classes.colorField + " " + $classes.hexField',value:"$hex",autocomplete:"off"}},{$el:"label",children:"HEX",attrs:{for:'$: "hex-" + $id',class:"$classes.fieldLabel"}}]}))),Ld=jp("rField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.rFieldGroup'},children:[{$el:"input",attrs:{id:'$: "r-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.rField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.r",autocomplete:"off"}},{$el:"label",children:"R",attrs:{for:'$: "r-" + $id',class:"$classes.fieldLabel"}}]}))),Id=jp("gField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.gFieldGroup'},children:[{$el:"input",attrs:{id:'$: "g-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.gField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.g",autocomplete:"off"}},{$el:"label",children:"G",attrs:{for:'$: "g-" + $id',class:"$classes.fieldLabel"}}]}))),Dd=jp("bField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.bFieldGroup'},children:[{$el:"input",attrs:{id:'$: "b-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.bField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.b",autocomplete:"off"}},{$el:"label",children:"B",attrs:{for:'$: "b-" + $id',class:"$classes.fieldLabel"}}]}))),Ad=jp("aField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.aFieldGroup'},children:[{$el:"input",attrs:{id:'$: "a-" + $id',onInput:'$handlers.rangeLimitInput("alpha", 0, 1)',onKeydown:'$handlers.rangeLimitKeydown("alpha", 0, 1, 0.01)',type:"text",class:'$classes.colorField + " " + $classes.aField',value:"$rgba.a",tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled || $alpha === undefined",autocomplete:"off",style:{opacity:{if:"$alpha",then:"1",else:"0.33"},cursor:{if:"$alpha",then:void 0,else:"not-allowed"}},"aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$rgba.a"}},{$el:"label",children:"A",attrs:{for:'$: "a-" + $id',class:"$classes.fieldLabel",style:{opacity:{if:"$alpha",then:"1",else:"0.33"}}}}]}))),Cd=jp("hField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hFieldGroup'},children:[{$el:"input",attrs:{id:'$: "h-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 360)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 360, 1)',type:"text",class:'$classes.colorField + " " + $classes.hField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.h",autocomplete:"off","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$hsla.h"}},{$el:"label",children:"H",attrs:{for:'$: "h-" + $id',class:"$classes.fieldLabel"}}]}))),Td=jp("sField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.sFieldGroup'},children:[{$el:"input",attrs:{id:'$: "s-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.sField',tabindex:{if:"$disabled",then:-1,else:0},value:"$hslaPercent.s",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.s"}},{$el:"label",children:"S",attrs:{for:'$: "s-" + $id',class:"$classes.fieldLabel"}}]}))),Ed=jp("lField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.lFieldGroup'},children:[{$el:"input",attrs:{id:'$: "l-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.lField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.l",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.l"}},{$el:"label",children:"L",attrs:{for:'$: "l-" + $id',class:"$classes.fieldLabel"}}]}))),Od=jp("formatSwitcher",(()=>({$el:"div",attrs:{class:"$classes.formatSwitcher",onClick:"$handlers.toggleFormat",tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.formatSwitcherKeydown",role:"button","aria-label":"$ui.next.value"}}))),Md=jp("swatches",(()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}}))),Vd=jp("swatch",(()=>({$el:"div",for:["swatch","index","$options"],if:"$swatch",attrs:{if:"$swatch.group",then:{class:"$classes.swatchGroup"},else:{class:"$classes.swatch",title:"$swatch.label"}},children:{if:"$swatch.group",then:[{$el:"span",attrs:{class:"$classes.swatchGroupLabel"},children:"$swatch.group"},{$el:"div",for:["groupSwatch","swatchIndex","$swatch.options"],attrs:{class:"$classes.swatch",title:"$groupSwatch.label"},children:[{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($groupSwatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$groupSwatch.label + "-" + $groupSwatch.value',"data-color":"$fns.anyToHsvaString($groupSwatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($groupSwatch.value, 2)","data-group":"$index","data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}]}],else:{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($swatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$swatch.label + "-" + $swatch.value',"data-color":"$fns.anyToHsvaString($swatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($swatch.value, 2)","data-group":0,"data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}}}))),Fd=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,Pd=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i;function Bd(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function Hd(e){const[t,o,n,r]=function(e){e=e.replace("#",""),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e.slice(0,2),16),o=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),r=e.length>=8?parseInt(e.slice(6,8),16)/255:1;return function(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p,d=0;const c=(l+i)/2;if(l===i)d=p=0;else{const e=l-i;switch(p=c>.5?e/(2-l-i):e/(l+i),l){case r:d=(s-a)/e+(s<a?6:0);break;case s:d=(a-r)/e+2;break;case a:d=(r-s)/e+4}d*=60}return[d,255*p,255*c,n]}(t,o,n,r)}(e);return[...Nd(t,o,n,r)]}function Rd(e,t,o,n=1){const r=t/100,s=o/100,a=(2-r)*s/2;return 0!==a&&(1===a||(t=a<.5?r*s/(2*a):r*s/(2-2*a))),[e,Bd(255*t,2),Bd(255*a,2),n]}function Nd(e,t,o,n=1){const r=Bd(t/255,4),s=Bd(o/255,4);if(1===s)return[e,0,100,n];const a=Bd(s+r*Math.min(s,1-s),4);let l=t/2.55;return 0!==a&&(l=1!==s&&0!==s?2*(a-s)/a*100:t/2.55),[e,Bd(l,2),Bd(100*a,2),n]}function Kd(e,t,o,n=1){const r=o/100,s=r*(t/100),a=s*(1-Math.abs(e/60%2-1)),l=r-s;let i=0,p=0,d=0;return[i,p,d]=e<60?[s,a,0]:e<120?[a,s,0]:e<180?[0,s,a]:e<240?[0,a,s]:e<300?[a,0,s]:[s,0,a],i=Math.round(255*(i+l)),p=Math.round(255*(p+l)),d=Math.round(255*(d+l)),[Math.min(Math.max(i,0),255),Math.min(Math.max(p,0),255),Math.min(Math.max(d,0),255),n]}function Wd(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p=0;const d=l,c=l-i,u=0===l?0:c/l;if(l!==i){switch(l){case r:p=(s-a)/c+(s<a?6:0);break;case s:p=(a-r)/c+2;break;case a:p=(r-s)/c+4}p/=6}return[360*p,100*u,100*d,n]}function qd(e,t,o,n=1){const[r,s,a,l]=Kd(e,t,o,n);return function(e,t,o,n=1){const r=e=>Math.round(e).toString(16).padStart(2,"0").toUpperCase(),s=function(e){return Math.round(255*e).toString(16).padStart(2,"0").toUpperCase()}(n);return"#"+r(e)+r(t)+r(o)+`${"FF"===s?"":s}`}(r,s,a,l)}function Ud(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function zd(e){if(e){if(Ud(e))return Hd(e);if(e.startsWith("rgb")){const t=e.match(Fd);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return Wd(o(t[1]),o(t[2]),o(t[3]),t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1)}if(e.startsWith("hsl")){const t=e.match(Pd);if(!t)return[0,0,0,1];const o=Number(t[1].replace("deg","").trim()),n=Number(t[2].slice(0,-1))/100,r=Number(t[3].slice(0,-1))/100,s=t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1;return Nd(o,Bd(255*n,2),Bd(255*r,2),s)}}}function Yd(e){const[t,o,n,r]=e.split("-").map((e=>Number(e)));return[t,o,n,r]}function jd(e,t=150,o=!0){let n=null,r=!0;return(...s)=>{const a=()=>{e(...s),n=null};o&&r&&(r=!1,a()),n||(n=setTimeout(a,t))}}function Zd(e){return!1!==e&&"false"!==e}function Gd(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}const Xd={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"};const Jd={schema:/* #__PURE__ */Zp(/* #__PURE__ */Gp(/* #__PURE__ */Jp("$label"),/* #__PURE__ */U("$inline && $help",/* #__PURE__ */td("$help")),/* #__PURE__ */Xp(/* #__PURE__ */U("($inline === undefined || $inline === false) && $prefixIcon !== undefined",/* #__PURE__ */rd("prefix","label")),/* #__PURE__ */U("$inline === undefined || $inline === false",/* #__PURE__ */Qp()),/* #__PURE__ */U("$inline === undefined || $inline === false",/* #__PURE__ */sd(/* #__PURE__ */xd(),/* #__PURE__ */U("$showValue",/* #__PURE__ */ad()))),/* #__PURE__ */U("$inline || $expanded)",/* #__PURE__ */ld(/* #__PURE__ */U("$showPanelClose && ($inline === undefined || $inline === false)",/* #__PURE__ */id(/* #__PURE__ */rd("close"))),/* #__PURE__ */U("$panelControls",/* #__PURE__ */pd(/* #__PURE__ */dd(/* #__PURE__ */cd(),/* #__PURE__ */ud()),/* #__PURE__ */bd(/* #__PURE__ */yd()),/* #__PURE__ */fd(/* #__PURE__ */vd(),/* #__PURE__ */hd()),/* #__PURE__ */md(/* #__PURE__ */gd(),/* #__PURE__ */$d()),/* #__PURE__ */U("$eyeDropper && $hasNativeEyeDropper",/* #__PURE__ */wd(/* #__PURE__ */rd("eyeDropper"))))),/* #__PURE__ */U("$panelFormat",/* #__PURE__ */_d(/* #__PURE__ */kd(/* #__PURE__ */U('$panelActiveFormat === "hex"',/* #__PURE__ */Sd()),/* #__PURE__ */U('$panelActiveFormat === "rgba"',/* #__PURE__ */Ld()),/* #__PURE__ */U('$panelActiveFormat === "rgba"',/* #__PURE__ */Id()),/* #__PURE__ */U('$panelActiveFormat === "rgba"',/* #__PURE__ */Dd()),/* #__PURE__ */U('$panelActiveFormat === "hsla"',/* #__PURE__ */Cd()),/* #__PURE__ */U('$panelActiveFormat === "hsla"',/* #__PURE__ */Td()),/* #__PURE__ */U('$panelActiveFormat === "hsla"',/* #__PURE__ */Ed()),/* #__PURE__ */U('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',/* #__PURE__ */Ad())),/* #__PURE__ */Od(/* #__PURE__ */rd("switch")))),/* #__PURE__ */U("$options",/* #__PURE__ */Md(/* #__PURE__ */Vd())))),/* #__PURE__ */U("$inline === undefined || $inline === false",/* #__PURE__ */ed()),/* #__PURE__ */U("($inline === undefined || $inline === false) && $suffixIcon !== undefined",/* #__PURE__ */rd("suffix"))),/* #__PURE__ */U("$: ($inline === undefined || $inline === false) && $help",/* #__PURE__ */td("$help"))),/* #__PURE__ */od(/* #__PURE__ */nd("$message.value"))),type:"input",family:"text",props:["disbaled","format","valueFormat","alpha","panelControls","panelFormat","eyeDropper","inline","options","showValue","closeOnSelect","allowPaste"],features:[function(t){let o,n=null,r=null,s=null,a=null,l=null,i=null,p=null,d=0;const c=["hex","rgba","hsla"],u=jd((function(){if(!r)return;const e=r.getContext("2d");if(!e)return;const{width:o,height:n}=r,s=t.props.h||0;e.fillStyle=`hsl(${s}, 100%, 50%)`,e.fillRect(0,0,o,n);const a=e.createLinearGradient(0,0,o,0);a.addColorStop(0,"rgba(255, 255, 255, 1)"),a.addColorStop(1,"rgba(255, 255, 255, 0)"),e.fillStyle=a,e.fillRect(0,0,o,n);const l=e.createLinearGradient(0,0,0,n);l.addColorStop(0,"rgba(0,0,0,0)"),l.addColorStop(1,"rgba(0,0,0,1)"),e.fillStyle=l,e.fillRect(0,0,o,n)}),2),f=jd((function(){if(!a)return;const e=a.getContext("2d");if(!e)return;const o=Math.round(a.width),n=Math.round(a.height);e.clearRect(0,0,o,n),V(a,n/2);const r=t.props.rgba.r||0,s=t.props.rgba.g||0,l=t.props.rgba.b||0,i=e.createLinearGradient(0,0,o,0);i.addColorStop(0,`rgba(${r}, ${s}, ${l}, 0)`),i.addColorStop(1,`rgba(${r}, ${s}, ${l}, 1)`),e.fillStyle=i,e.fillRect(0,0,o,n)}),2),v=jd(D,2),h=jd(A,2),m=jd(B,2),g=jd(F,10,!1);function $(e){var o,r;if(!t.context||!t.props.allowPaste||t.props.disabled)return;const s=null===(o=t.props.__root)||void 0===o?void 0:o.activeElement;if(n&&n.contains(s)){const o=null===(r=e.clipboardData)||void 0===r?void 0:r.getData("text");if(!o)return;if("INPUT"===s.tagName&&!Ud(o)&&!Fd.test(o)&&!Pd.test(o))return;(Ud(o)||o.startsWith("hsl")||o.startsWith("rgb"))&&(t.props.hexInputFocused&&(t.props.hexInputFocused=!1,setTimeout((()=>{t.props.hexInputFocused=!0}),10)),e.preventDefault(),b(o))}}function b(e){var o;if(!e)return;const n=zd(e);if(n){const[o,r,s,a]=n;"undefined"!==e&&("number"!=typeof o||isNaN(o)||"number"!=typeof r||isNaN(r)||"number"!=typeof s||isNaN(s)||"number"!=typeof a||isNaN(a)||Bd(o,2)===t.props.h&&Bd(r,2)===t.props.s&&Bd(s,2)===t.props.v&&Bd(a,2)===t.props.a)||(t.props.alpha&&(t.props.a=Bd(a,2)),B(o,r,s))}else{const n=null===(o=t.props.options)||void 0===o?void 0:o.find((t=>{var o;return(null===(o=t.label)||void 0===o?void 0:o.toLowerCase())===e.toLowerCase()}));if(n&&n.value){const e=zd(n.value);if(e){const[o,n,r,s]=e;t.props.alpha&&(t.props.a=Bd(s,2)),B(o,n,r)}else B(t.props.h,t.props.s,t.props.v)}else B(t.props.h,t.props.s,t.props.v)}}function y(e){if(!t.context||!p)return;const o=p[e];o&&(t.props.focusedSwatch=o.dataset.color)}function x(e,t){new ResizeObserver((()=>{const o=e.getBoundingClientRect();e.width=Math.round(o.width),e.height=Math.round(o.height),t(e)})).observe(e)}function w(){t.context&&t.props.eyeDropper&&(t.context.hasNativeEyeDropper=!("undefined"==typeof window||!window.EyeDropper),e.whenAvailable(`eye-dropper-${t.props.id}`,(()=>{var e;const o=new window.EyeDropper,n=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`eye-dropper-${t.props.id}`);null==n||n.addEventListener("click",(async()=>{const e=await o.open();if(!e.sRGBHex)return;const[n,r,s]=Hd(e.sRGBHex);t.props.alpha&&(t.props.a=1),B(n,r,s)}))}),t.props.__root))}function _(){k("canvas-ls",(e=>{r=e}),u,E),k("canvas-hue",(e=>{s=e}),I,O),k("canvas-alpha",(e=>{a=e}),f,M),S(`canvas-preview-${t.props.id}`,(e=>{l=e,D()}),v),S(`canvas-swatch-preview-${t.props.id}`,(e=>{i=e,A()}),h),L()}function k(e,n,r,s){let a=!1;const l=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",d),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",c)},i=e=>{1===e.buttons&&o&&s(e)},p=e=>{o&&s(e)},d=()=>{o=void 0,l()},c=()=>{o=void 0,l()};S(`${e}-${t.props.id}`,(t=>{const l=t.nextElementSibling;n(t),r(),function(e,t){const o=o=>{e&&(o.preventDefault(),t(o))};null==e||e.addEventListener("mousedown",o),null==e||e.addEventListener("touchstart",o)}(t,s),a||function(e,t){a=!0,e.addEventListener("blur",(()=>{e.removeAttribute("data-prevent-focus-style")})),t.addEventListener("touchend",(()=>{e.removeAttribute("data-prevent-focus-style"),e.blur()})),e.addEventListener("keydown",(t=>{["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)&&e.removeAttribute("data-prevent-focus-style")}))}(l,t),t.addEventListener("mousedown",(t=>{l.focus(),l.setAttribute("data-prevent-focus-style","true"),o=Xd[e],s(t),document.addEventListener("mousemove",i),document.addEventListener("mouseup",d)})),t.addEventListener("touchstart",(()=>{l.setAttribute("data-prevent-focus-style","true"),l.focus(),o=Xd[e],document.addEventListener("touchmove",p),document.addEventListener("touchend",c)}))}),r)}function S(o,n,r){e.whenAvailable(o,(()=>{var e;const s=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(o);s&&(n(s),r&&x(s,r))}),t.props.__root)}function L(){e.whenAvailable(`swatches-${t.props.id}`,(()=>{var e,o,n;p=Array.from((null===(e=t.props.__root)||void 0===e?void 0:e.querySelectorAll(`#swatches-${t.props.id} canvas`))||[]),p.forEach((e=>{x(e,C)})),t.props.focusedSwatch=null===(n=null===(o=p[0])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.color,F()}),t.props.__root)}function I(){if(!s)return;const e=s.getContext("2d");if(!e)return;const t=s.width,o=s.height;for(let n=0;n<t;n++){const r=Math.floor(n/t*360);e.fillStyle=`hsl(${r}, 100%, 50%)`,e.fillRect(n,0,1,o)}}function D(){if(!l)return;const e=l.getContext("2d");if(!e)return;V(l,l.width/3);const{r:o,g:n,b:r,a:s}=t.props.rgba;e.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,e.fillRect(0,0,l.width,l.height)}function A(){if(!i)return;const e=i.getContext("2d");if(!e)return;V(i,i.height/2);const{r:o,g:n,b:r,a:s}=t.props.rgba;e.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,e.fillRect(0,0,i.width,i.height)}function C(e){if(!e)return;const t=e.getContext("2d");if(!t)return;V(e,e.width/2);const o=e.dataset.colorPrecise;if(!o)return;const[n,r,s,a]=Yd(o),[l,i,p,d]=Rd(n,r,s,a);t.fillStyle=`hsla(${l}, ${i/255*100}%, ${p/255*100}%, ${d})`,t.fillRect(0,0,Math.round(e.width),Math.round(e.height))}function T(e,t,n){let r=null;const s=e=>{null!==r&&cancelAnimationFrame(r),r=requestAnimationFrame((()=>{if(!t)return;const o=t.getBoundingClientRect();let r,s;"touches"in e?(r=e.touches[0].clientX-o.left,s=e.touches[0].clientY-o.top):(r=e.clientX-o.left,s=e.clientY-o.top),r=Math.min(Math.max(r,0),o.width),s=Math.min(Math.max(s,0),o.height),n(r,s)}))};s(e);const a=e=>{e.preventDefault(),s(e)},l=e=>{e.preventDefault(),s(e)},i=()=>{o=void 0,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)},p=()=>{o=void 0,document.removeEventListener("touchmove",l),document.removeEventListener("touchend",p)};"touches"in e?(document.addEventListener("touchmove",l),document.addEventListener("touchend",p)):(document.addEventListener("mousemove",a),document.addEventListener("mouseup",i))}function E(e){T(e,r,((e,o)=>{const n=e/r.width*100,s=100-o/r.height*100;m(t.props.hue,n,s)}))}function O(e){T(e,s,((e,o)=>{if(!s)return;const n=s.width,r=Math.floor(e/n*360);t.props.h=r,m(t.props.h,t.props.s,t.props.v)}))}function M(e){t.props.alpha&&T(e,a,((e,o)=>{const n=e/a.width*100/100;t.props.a=n,m(t.props.hue,t.props.s,t.props.v)}))}function V(e,t){const o=e.getContext("2d");if(!o)return;const n=Math.ceil(e.height/t),r=Math.ceil(e.width/t);for(let e=0;e<n;e++)for(let n=0;n<r;n++)o.fillStyle=(e+n)%2==1?"#FFFFFF":"#CCCCCC",o.fillRect(n*t,e*t,t,t)}function F(){var e,o;if(!t.context||!t.props.options||!p)return;const{h:n,s:r,v:s,a:a}=t.props,l=function(e,t,o,n=1){const r=0===o?0:t;return`${Bd(0===o||100===o&&0===t?0:e,0)}-${Bd(r,0)}-${Bd(o,0)}-${Bd(n,2)}`}(n,r,s,a);let i=!1,d=!1;p.forEach((e=>{const t=e.dataset.color;if(!t)return;const[o,n,r,c]=t.split("-");"0"===r&&0===s&&c===`${a}`&&(d=!0);const u=e.parentElement;d||t===l?(u.dataset.active="true",e.ariaSelected="true",d=!1,!i&&p&&(y(p.indexOf(e)),i=!0)):(delete u.dataset.active,e.ariaSelected="false")})),i||(t.props.focusedSwatch=null===(o=null===(e=p[0])||void 0===e?void 0:e.dataset)||void 0===o?void 0:o.color)}function P(e){e=e.replace("#",""),t.props.hexInputFocused||3!==e.length||(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),e=`#${e=e.toUpperCase()}`,t.props.hex=e.slice(0,9)}function B(e,o,r,s=!1){t.props.h=void 0===e||isNaN(e)?t.props.h:Bd(Math.max(Math.min(e,360),0),2),t.props.s=void 0===o||isNaN(o)?t.props.s:Bd(Math.max(Math.min(o,100),0),2),t.props.v=void 0===r||isNaN(r)?t.props.v:Bd(Math.max(Math.min(r,100),0),2);const{h:a,s:l,v:i,a:p}=t.props,[d,c,u]=Rd(a,l,i),[f,v,h]=Kd(a,l,i),m=t.props.hexInputFocused?t.props.hex:qd(a,l,i,p),$=Bd(p,2);t.props.hsla={h:a,s:c,l:u,a:$},t.props.hslaPercent={h:Bd(a,0),s:100===i&&0===l?0:Bd(0===i?c/255:Math.max(Math.min(c/255*100,100),0),0),l:Bd(Math.max(Math.min(t.props.hsla.l/255*100,100),0),0),a:$},t.props.hslaString=`hsla(${t.props.hslaPercent.h}, ${t.props.hslaPercent.s}%, ${t.props.hslaPercent.l}%, ${$})`,t.props.hslaStringPrecise=`hsla(${a}, ${Bd(0===i?c/255:c/255*100,2)}%, ${Bd(u/255*100,2)}%, ${$})`,t.props.rgba={r:f,g:v,b:h,a:$},t.props.rgbaString=`rgba(${f}, ${v}, ${h}, ${$})`,P(m),setTimeout((()=>{var e;H(),function(){const e=t.props.s,o=100-t.props.v;t.props.controlLSPosition={x:e,y:o}}(),g(),n||"undefined"==typeof window||(n=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"]`))}),0);const b=t.props.valueFormat?t.props.valueFormat:t.props.format;s||("hex"===b?t.input(t.props.hex):"rgba"===b?t.input(t.props.rgbaString):"hsla"===b&&t.input(t.props.hslaStringPrecise))}function H(){u(),f(),v(),h()}t.addProps(["expanded","h","s","v","a","hsla","hslaPercent","hslaString","hslaStringPrecise","rgba","rgbaString","hex","controlLSPosition","panelActiveFormat","hexInputFocused","hasNativeEyeDropper","focusedSwatch","swatchIsUsingKeyboardNav","showPanelClose"]),t.props.h=t.props.h||void 0,t.props.s=t.props.s||void 0,t.props.v=t.props.v||void 0,t.props.a=t.props.a||1,t.props.controlLSPosition=t.props.controlLSPosition||{x:0,y:0},t.props.switchIcon=t.props.switchIcon||'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M34.2 179.7L154.4 66.2c1.4-1.3 3.5-2.2 5.6-2.2s4.2 .8 5.6 2.2L285.8 179.7c1.4 1.3 2.2 3.2 2.2 5.2c0 3.9-3.2 7.1-7.1 7.1H39.1c-3.9 0-7.1-3.2-7.1-7.1c0-2 .8-3.8 2.2-5.2zm-22-23.3C4.4 163.8 0 174.1 0 184.9C0 206.5 17.5 224 39.1 224H280.9c21.6 0 39.1-17.5 39.1-39.1c0-10.8-4.4-21.1-12.3-28.4L187.6 42.9C180.1 35.9 170.2 32 160 32s-20.1 3.9-27.6 10.9L12.3 156.4zm22 175.9c-1.4-1.3-2.2-3.2-2.2-5.2c0-3.9 3.2-7.1 7.1-7.1H280.9c3.9 0 7.1 3.2 7.1 7.1c0 2-.8 3.8-2.2 5.2L165.6 445.8c-1.4 1.3-3.5 2.2-5.6 2.2s-4.2-.8-5.6-2.2L34.2 332.3zm-22 23.3L132.4 469.1c7.4 7 17.4 10.9 27.6 10.9s20.1-3.9 27.6-10.9L307.7 355.6c7.8-7.4 12.3-17.7 12.3-28.5c0-21.6-17.5-39.1-39.1-39.1H39.1C17.5 288 0 305.5 0 327.1c0 10.8 4.4 21.1 12.3 28.5z"/></svg>',t.props.hexInputFocused=!1,t.props.swatchIsUsingKeyboardNav=!1,t.on("destroying",(()=>{t.context&&"undefined"!=typeof document&&document.removeEventListener("paste",$)})),t.on("created",(()=>{var o,r;t.context&&("undefined"!=typeof window&&document.addEventListener("paste",$),t.props.expanded=!1,t.props.panelActiveFormat=t.props.format||c[0],t.props.panelControls=Zd(t.props.panelControls),t.props.eyeDropper=Zd(t.props.eyeDropper),t.props.panelFormat=Zd(t.props.panelFormat),t.props.showValue=Zd(t.props.showValue),t.props.allowPaste=Zd(t.props.allowPaste),t.props.inline=e.undefine(t.props.inline),t.props.disabled=e.undefine(t.props.disabled),t.props.format=t.props.format||"hex",t.props.alpha=e.undefine(null===(r=null===(o=t.props)||void 0===o?void 0:o.alpha)||void 0===r||r),t.props.valueFormat=t.props.valueFormat||t.props.format,t.props.closeOnSelect=e.undefine(t.props.closeOnSelect),t.props.focusedSwatch=void 0,void 0===t.value||""===t.value||null===t.value?(t.props.rgba={r:0,g:0,b:0},B(0,0,0,!0)):b(`${t.value}`),t.on("input",(({payload:e})=>{n&&void 0!==t.props.__root&&!n.contains(t.props.__root.activeElement)&&b(e)})),setTimeout((()=>{w()}),5),_(),t.on("prop:expanded",(()=>{var e;if(t.props.expanded)w(),_(),L(),document.addEventListener("keydown",o),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?t.props.showPanelClose=!0:t.props.showPanelClose=!1,setTimeout((()=>{var e;const o=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`);o&&o.focus()}),0);else{document.removeEventListener("keydown",o);(null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"] *[tabindex="0"]`)).focus()}function o(e){"Escape"===e.key&&(e.preventDefault(),t.props.expanded=!1)}})),t.context.fns.anyToHsvaString=(e,t)=>{const o=zd(e);if(!o)return"0-0-0-1";let[n,r,s,a]=o;return 0===t&&(n=0===s||100===s&&0===r?0:n),`${Bd(n,t)}-${Bd(r,t)}-${Bd(s,t)}-${Bd(a,2)}`},t.context.handlers.inputPreviewClick=e=>{t.props.expanded=!t.props.expanded},t.context.handlers.inputPreviewFocusout=e=>{var o,n,r;const s=null===(o=t.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${t.props.id}"] .formkit-inner`),a=e.relatedTarget;if(s.contains(a)){function l(e){var o,n;s.contains(e.target)||(t.props.expanded=!1,null===(o=t.props.__root)||void 0===o||o.removeEventListener("mousedown",l),null===(n=t.props.__root)||void 0===n||n.removeEventListener("touchstart",l))}null===(n=t.props.__root)||void 0===n||n.addEventListener("mousedown",l),null===(r=t.props.__root)||void 0===r||r.addEventListener("touchstart",l)}else t.props.expanded=!1},t.context.handlers.inputPreviewKeydown=e=>{"Escape"===e.key&&(e.preventDefault(),t.props.expanded=!1),"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.props.expanded=!t.props.expanded)},t.context.handlers.closePanel=()=>{t.props.expanded=!1},t.context.handlers.panelCloseKeydown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.props.expanded=!1)},t.context.handlers.toggleFormat=(e=1)=>{e="number"==typeof e?e:1;const o=(c.indexOf(t.props.panelActiveFormat)+e+c.length)%c.length;t.props.panelActiveFormat=c[o]},t.context.handlers.panelKeydown=e=>{var o,n,r;if("Tab"===e.key&&t.props.expanded){e.preventDefault();const s=Array.from((null===(o=t.props.__root)||void 0===o?void 0:o.querySelectorAll(`[data-id="${t.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`))||[]).filter(Gd),a=s.indexOf((null===(n=t.props.__root)||void 0===n?void 0:n.activeElement)?null===(r=t.props.__root)||void 0===r?void 0:r.activeElement:t.props.__root);let l;l=e.shiftKey?(a-1+s.length)%s.length:(a+1)%s.length,s[l].focus()}},t.context.handlers.lsKeydown=e=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r}=t.props,s=e.shiftKey?10:1;switch(e.key){case"ArrowLeft":B(o,n-s,r);break;case"ArrowRight":B(o,n+s,r);break;case"ArrowUp":B(o,n,r+s);break;case"ArrowDown":B(o,n,r-s);break;case"PageUp":B(o,n,r+10);break;case"PageDown":B(o,n,r-10);break;case"Home":B(o,n-10,r);break;case"End":B(o,n+10,r)}H()}},t.context.handlers.hueControlKeydown=e=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r}=t.props,s=e.shiftKey?10:1;switch(e.key){case"ArrowLeft":case"ArrowDown":B(o-s,n,r);break;case"ArrowRight":case"ArrowUp":B(o+s,n,r);break;case"PageUp":B(o+10,n,r);break;case"PageDown":B(o-10,n,r);break;case"Home":B(0,n,r);break;case"End":B(360,n,r)}H()}},t.context.handlers.alphaControlKeydown=e=>{if(t.props.alpha&&["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r,a:s}=t.props,a=e.shiftKey?.1:.01;switch(e.key){case"ArrowLeft":case"ArrowDown":t.props.a=Bd(Math.min(Math.max(s-a,0),1),2);break;case"ArrowRight":case"ArrowUp":t.props.a=Bd(Math.min(Math.max(s+a,0),1),2);break;case"PageUp":t.props.a=Bd(Math.min(Math.max(s+.1,0),1),2);break;case"PageDown":t.props.a=Bd(Math.min(Math.max(s-.1,0),1),2);break;case"Home":t.props.a=0;break;case"End":t.props.a=1}B(o,n,r)}},t.context.handlers.eyeDropperKeydown=e=>{var o;if("Enter"===e.key||" "===e.key){e.preventDefault();const n=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`eye-dropper-${t.props.id}`);null==n||n.click()}},t.context.handlers.formatSwitcherKeydown=e=>{t.context&&("Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),t.context.handlers.toggleFormat()),"ArrowUp"===e.key&&(e.preventDefault(),t.context.handlers.toggleFormat(-1)))},t.context.handlers.hexInput=e=>{const o=e.target,n=o.value.startsWith("#")?9:8,r=o.value.slice(0,n);if(o.value=t.props.alpha?r:r.slice(0,7),Ud(r)){const[e,o,n,s]=Hd(r);t.props.alpha&&(t.props.a=s),P(r),B(e,o,n)}},t.context.handlers.hexKeydown=e=>{const o=e.target,n=o.value;let r="";if(!Ud(n))return;const s=n.startsWith("#")?n.slice(1):n,a=8===s.length,l=a?s.substring(0,6):s,i=a?s.substring(6,8):"",p=e.shiftKey?10:1,d=16777215;let c;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key))switch(e.preventDefault(),e.key){case"ArrowUp":c=(parseInt(l,16)+p)%16777216;break;case"ArrowDown":c=(parseInt(l,16)-p+d+1)%16777216;break;case"PageUp":c=(parseInt(l,16)+10)%16777216;break;case"PageDown":c=(parseInt(l,16)-10+d+1)%16777216;break;case"Home":c=0;break;case"End":c=d}void 0!==c&&(r=c.toString(16).padStart(6,"0").toUpperCase()),r&&(o.value=a?`#${r}${i}`:`#${r}`),t.context&&t.context.handlers.hexInput(e)},t.context.handlers.hexFocus=()=>{t.context&&(t.props.hexInputFocused=!0)},t.context.handlers.hexBlur=e=>{if(!t.context)return;t.props.hexInputFocused=!1;const o=e.target.value;Ud(o)&&P(o)},t.context.handlers.rangeLimitInput=(e,o,n,r)=>s=>{const a=r||s;if(!a||!t.context)return;const l=a.target;if(l.value.endsWith("."))return;const i=Math.max(Math.min(Number(l.value),n),o);l.value=`${i}`;const p=l.id;if("hsla"===e){switch(p){case`h-${t.props.id}`:t.props.h=i;break;case`s-${t.props.id}`:t.props.hslaPercent.s=i;break;case`l-${t.props.id}`:t.props.hslaPercent.l=i}const[e,o,n]=Nd(t.props.h,2.55*t.props.hslaPercent.s,2.55*t.props.hslaPercent.l);B(e,o,n)}else if("rgba"===e){switch(p){case`r-${t.props.id}`:t.props.rgba.r=i;break;case`g-${t.props.id}`:t.props.rgba.g=i;break;case`b-${t.props.id}`:t.props.rgba.b=i}const[e,o,n]=Wd(t.props.rgba.r,t.props.rgba.g,t.props.rgba.b);B(e,o,n)}else"alpha"==e&&t.props.alpha&&(t.props.a=i,B())},t.context.handlers.rangeLimitKeydown=(e,o,n,r)=>s=>{if(!t.context)return;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End","Backspace","Tab","Enter"].includes(s.key)||s.metaKey||!/[a-zA-Z!@#$%^&*()_+={}\[\]:;"'<,>?\/|\\`~]/g.test(s.key)){if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(s.key)){const a=s.target,l=Number(a.value),i=s.shiftKey?10*r:r;switch(s.key){case"ArrowUp":s.preventDefault(),a.value=`${Math.min(l+i,n)}`;break;case"ArrowDown":s.preventDefault(),a.value=`${Math.max(l-i,o)}`;break;case"PageUp":s.preventDefault(),a.value=`${Math.min(l+10*r,n)}`;break;case"PageDown":s.preventDefault(),a.value=`${Math.max(l-10*r,o)}`;break;case"Home":s.preventDefault(),a.value=`${o}`;break;case"End":s.preventDefault(),a.value=`${n}`}t.context.handlers.rangeLimitInput(e,o,n,s)()}}else s.preventDefault()},t.context.handlers.swatchClick=e=>{const o=e.target;if(o.dataset.colorPrecise){const[e,n,r,s]=Yd(o.dataset.colorPrecise);t.props.alpha&&(t.props.a=s),B(e,n,r),t.props.closeOnSelect&&(t.props.expanded=!1)}t.context&&"keydown"!==e.type&&t.context.handlers.swatchKeydown(e)},t.context.handlers.swatchKeydown=e=>{var o,n,r,s;if(!t.context||!p||!p.length)return;const a=p.indexOf(e.currentTarget);let l=null;const i=function(e){var t;if(!e.length)return 0;const o=null===(t=e[0].parentElement)||void 0===t?void 0:t.parentElement;if(!o)return 0;const n=o.getBoundingClientRect().width,r=e[0].parentElement;if(!r)return 0;const s=r.getBoundingClientRect(),a=window.getComputedStyle(r),l=parseFloat(a.marginLeft)+parseFloat(a.marginRight),i=s.width+l;return Math.floor(n/i)}(p),c=p.length;let u=0,f=c,v=!1;const h=p[a].dataset.group;if(void 0!==h){const e=p.filter((e=>e.dataset.group===h));u=p.indexOf(e[0]),f=p.indexOf(e[e.length-1])}const m=(a-u)%i;if(!e.key||"Tab"===e.key)return e.key||(t.props.swatchIsUsingKeyboardNav=!1,d=m,y(a)),"Tab"===e.key&&(t.props.swatchIsUsingKeyboardNav=!1),void p.forEach((e=>{delete e.parentElement.dataset.focused}));if("Enter"===e.key||" "===e.key)return e.preventDefault(),d=m,t.context.handlers.swatchClick(e),void y(a);switch("ArrowUp"!==e.key&&"ArrowDown"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(t.props.swatchIsUsingKeyboardNav=!0,e.preventDefault()),e.key){case"ArrowUp":l=Math.max(a-i,a-(i-(d-m))),v=!0;break;case"ArrowDown":l=Math.max(a+i,a+(i+(d-m))),v=!0;break;case"ArrowLeft":l=a-1,d=(l-u)%i;break;case"ArrowRight":l=a+1,d=(l-u)%i}if(v&&null!==l&&(l<u||l>f)){let e;e=l<u?null===(n=null===(o=p[u-1])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.group:null===(s=null===(r=p[f+1])||void 0===r?void 0:r.dataset)||void 0===s?void 0:s.group;const t=p.filter((e=>e.dataset.group===h)),c=p.filter((t=>t.dataset.group===e)),v=(a-u)%i,m=t.length%i||i,g=a>=u+t.length-m;if(l<u){const e=c.length%i||i;l=u-e+Math.min(Math.max(v,d),e-1)}else l>f&&(l=g?Math.min(f+Math.max(v,d)+1,p.indexOf(c[c.length-1])):Math.min(l,f))}if(null!==l&&l>=0&&l<c){y(l),p.forEach((e=>{delete e.parentElement.dataset.focused}));const e=p[l],t=e.parentElement;e.focus(),t.dataset.focused="true"}})}))},jt,o.options,
61
+ /* #__PURE__ */o.localize("removeAllValues"),o.options,function(t){!function(t){t.addProps(["search","options","selectedItems","activeValue","activeIndex","activeDescendant","targetOptions","sourceOptions","optionLoader","isLoadingOptions","filterOptions","inputText","hasNextPage","page","targetLoading","searchable","sourceLabel","targetLabel","transferOnSelect","disabled","placeholder","filter","showSourceEmptyMessage","showTargetEmptyMessage","sourceEmptyMessage","targetEmptyMessage","clearOnSelect","max","maxReached","debounce","sourceListActive","optionLoaderValues","optionLoadingCounter","optionsLoadingCounter","memoOptions","optionsLoaded","selectedSourceItems","selectedTargetItems","draggable","loadMore","loadMoreOption","targetSearchable","targetInputText"]),t.props.loadMoreOption={label:"Load more",value:rp},void 0===t.props.draggable?t.props.draggable=!0:"false"===t.props.draggable&&(t.props.draggable=!1),t.props.optionsLoaderValues=[],t.props.selectedSourceItems=[],t.props.selectedTargetItems=[],t.props.optionsLoaded=void 0,t.props.memoOptions=[],t.props.multiple=!0,t.props.debounce=t.props.debounce?parseInt(t.props.debounce):200,t.props.optionLoaderValues=[],t.props.optionsLoadingCounter=0,t.props.optionLoadingCounter=0,t.props.page=1,t.props.hasNextPage=We.bind(null,t),t.props.options?t.props.options=[...t.props.options]:t.props.options=[],t.props.sourceOptions=[],t.props.targetOptions=[],"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.props.searchable=e.undefine(t.props.searchable),t.props.searchable&&(t.props.inputText=""),t.props.targetSearchable=e.undefine(t.props.targetSearchable),t.props.targetSearchable&&(t.props.targetInputText=""),t.props.clearOnSelect=e.undefine(t.props.clearOnSelect),void 0===t.props.transferOnSelect?t.props.transferOnSelect=!0:"false"===t.props.transferOnSelect&&(t.props.transferOnSelect=!1),t.props.targetOptions.length&&(t.props.targetOptionValues=t.props.targetOptions.map(e=>Se(e))),t.props.initialOptions=[...t.props.options],t.props.max&&(t.props.max=parseInt(t.props.max)),t.props.sourceListOrigin=void 0,"function"!=typeof t.props.filter&&(t.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase()))}(t),function(e){e.on("commit",async({payload:t})=>{e.props.activeValue=void 0,e.props.max&&(e.props.maxReached=t.length>=e.props.max),e.props.clearOnSelect&&e.props.inputText&&(e.props.reFilter=!0,e.props.inputText=""),e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])],e.props.searchable&&e.props.reFilter&&!e.props.initialLoad?(Ve(e,e.props.inputText),e.props.reFilter=!1):e.props.initialLoad||(e.isCreated||(e.props.skipSetActiveValue=!0),cp(e)),"function"==typeof e.props.optionLoader?vp(e):e.props.initialLoad||(e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])])})}(t),bp(t),function(t){t.on("prop:options",()=>{t.props.appendingOptions&&(t.props.skipSetActiveValue=!0,t.props.appendingOptions=!1),cp(t)}),t.on("prop:memoOptions",()=>{t.props.skipSetActiveValue=!0,cp(t)}),t.on("prop:sourceOptions",()=>{0===t.props.sourceOptions.length?t.props.showSourceEmptyMessage=!0:t.props.showSourceEmptyMessage=!1,sp.delete(t)}),t.on("prop:targetOptions",()=>{0===t.props.targetOptions.length?t.props.showTargetEmptyMessage=!0:t.props.showTargetEmptyMessage=!1}),t.on("prop:activeValue",({payload:o})=>{if(t.props.isDragging)return void(t.props.activeDescendant=void 0);if(o===rp)return void(t.props.activeDescendant=`${t.props.id}_load_more`);const n=(t.props.sourceListOrigin?t.props.sourceOptions:t.props.targetOptions).findIndex(t=>e.eq(Se(t),o));n>=0&&t.props.sourceListOrigin?t.props.activeDescendant=`${t.props.id}_source_list_item_${n}`:t.props.activeDescendant=n>=0?`${t.props.id}_target_list_item_${n}`:void 0}),t.on("prop:mouseOnSource",({payload:e})=>{var o;if(e&&!0!==t.props.disabled&&!t.props.isDragging){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(t.props.id+"_source_list_items");if(!e)return;t.props.mouseOnTarget=!1,t.props.sourceListOrigin=!0,sp.delete(t),yp(t,e)}}),t.on("prop:mouseOnTarget",({payload:e})=>{var o;if(e&&!0!==t.props.disabled&&!t.props.isDragging){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}`);if(!e)return;t.props.mouseOnSource=!1,t.props.sourceListOrigin=!1,ap.delete(t),yp(t,e)}}),t.on("prop:optionsLoadingCounter",({payload:e})=>{0===e&&0===t.props.optionLoadingCounter&&t.store.set(Be)}),t.on("prop:optionLoadingCounter",({payload:e})=>{0===e&&0===t.props.optionsLoadingCounter&&(t.store.set(Be),t.props.skipSetActiveValue=!0,cp(t))})}(t)}]};const _p=/* #__PURE__ */K("sl"),{outer:kp,wrapper:Sp,inner:Lp,icon:Ip,prefix:Dp,suffix:Ap,help:Cp,messages:Tp,message:Ep}=/* #__PURE__ */W(_p),Op=_p("label",()=>({if:"$label",$el:"label",attrs:{id:"$id + '_label'"}})),Mp=_p("chart",()=>({$el:"div",if:"$chart"})),Vp=_p("chartBar",()=>({$el:"div",for:["bar","index","$chart"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$bar.at >= $_value.0 && $bar.at <= $_value.1",else:"$bar.at >= $_value.1 && $bar.at <= $_value.0"},else:"$bar.at <= $_value"},style:{left:'$bar.at / ($max - $min) * 100 + "%"',width:'$: "calc(" + (100 / $chart.length) + "% - 2px)"',height:{if:"$largestBar",then:'$bar.value / $largestBar * 100 + "%"'}}}})),Fp=_p("sliderInner",()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}})),Pp=_p("track",()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}})),Bp=_p("trackWrapper",()=>({$el:"div"})),Hp=_p("trackInner",()=>({$el:"div"})),Rp=_p("fill",()=>({$el:"div",attrs:{style:"$fillStyles"}})),Np=_p("linkedValues",()=>({$el:"div"})),Kp=_p("maxValue",()=>({$formkit:"number",bind:"$computedMaxInputAttrs",ignore:!0,number:!0,value:{if:"$isMulti",then:"$_value.1",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.maxNode",onBlur:"$handlers.inputBlur"})),Wp=_p("minValue",()=>({$formkit:"number",if:"$isMulti",bind:"$computedMinInputAttrs",ignore:!0,number:!0,value:{if:"$isMulti",then:"$_value.0",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.minNode",onBlur:"$handlers.inputBlur"})),qp=_p("marks",()=>({$el:"div",if:"$marks"})),zp=_p("mark",()=>({$el:"span",for:["step","index","$marks"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$step.at >= $_value.0 && $step.at <= $_value.1",else:"$step.at >= $_value.1 && $step.at <= $_value.0"},else:"$step.at <= $_value"},class:{if:"$step.class",then:'$: $classes.mark + " " + $step.class',else:"$classes.mark"},style:{left:'$: $fns.calculateMarkPosition($step.at) + "%"'}}})),Up=_p("markLabel",()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}})),Yp=_p("handles",()=>({$el:"ul"})),jp=_p("handleMax",()=>({$el:"li",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "max"',"data-handle":"max","data-show-tooltip":"$tooltip",class:"$: 'formkit-handle ' + $classes.handle + ' ' + $classes.handleMax",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstartPassive:"$handlers.startDrag",style:"$maxHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}})),Zp=_p("handleMin",()=>({$el:"li",if:"$isMulti",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "min"',"data-handle":"min","data-show-tooltip":"$tooltip",class:"$: $classes.handle + ' ' + $classes.handleMin",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstartPassive:"$handlers.startDrag",style:"$minHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}})),Gp=_p("handleMinInner",()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}})),Xp=_p("handleMaxInner",()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}})),Jp=_p("tooltipMax",()=>({$el:"div",if:'$tooltip === true || $tooltip === "auto"',children:{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.1, "max")',else:'$tooltipFormat($_value.0, "max")'},else:'$tooltipFormat($_value, "max")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMax"}})),Qp=_p("tooltipMin",()=>({$el:"div",if:'$isMulti && ($tooltip === true || $tooltip === "auto")',children:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.0, "min")',else:'$tooltipFormat($_value.1, "min")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMin"}})),ed={schema:/* #__PURE__ */kp(/* #__PURE__ */Sp(/* #__PURE__ */Op("$label"),/* #__PURE__ */Cp("$help"),/* #__PURE__ */Fp(/* #__PURE__ */Ip("prefix"),/* #__PURE__ */Dp(),/* #__PURE__ */Pp(/* #__PURE__ */Mp(/* #__PURE__ */Vp()),/* #__PURE__ */Bp(/* #__PURE__ */Hp(/* #__PURE__ */Rp(),/* #__PURE__ */qp(/* #__PURE__ */zp(/* #__PURE__ */Up())),/* #__PURE__ */Yp(/* #__PURE__ */Zp(/* #__PURE__ */Qp(),/* #__PURE__ */Gp()),/* #__PURE__ */jp(/* #__PURE__ */Jp(),/* #__PURE__ */Xp()))))),/* #__PURE__ */Ap(),/* #__PURE__ */Ip("suffix"),/* #__PURE__ */z("$showInput && $isMulti === false",/* #__PURE__ */Kp())),/* #__PURE__ */z("$showInput && $isMulti",/* #__PURE__ */Np(/* #__PURE__ */Wp(),/* #__PURE__ */Kp())),/* #__PURE__ */Tp(/* #__PURE__ */Ep("$message.value")))),type:"input",family:"",props:["min","max","step","showInput","tooltip","tooltipFormat","inputAttrs","maxInputAttrs","minInputAttrs","marks","markLabels","snapToMarks","chart","scalingFunction","intervals"],features:[function(t){let o,n,r;t.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]);const s={linear:{forward:e=>e,reverse:e=>e},log:{forward:(e,o=t.props.min,n=t.props.max)=>n*Math.pow(e/n,1.5),reverse:(e,o=t.props.min,n=t.props.max)=>n*Math.pow(e/n,1/1.5)}};let a=!1;function l(){const e=document.activeElement;if(e instanceof HTMLInputElement){const t=e.value;e.value="",e.value=t}}function i(e){if(!e)return;const t={disabled:e.props.disabled,min:"number"==typeof e.props.min?e.props.min:0,max:"number"==typeof e.props.max?e.props.max:void 0,step:e.props.step||1};e.props.minInputAttrs=Object.assign(e.props.minInputAttrs||{},t),e.props.maxInputAttrs=Object.assign(e.props.maxInputAttrs||{},t),e.props.inputAttrs=e.props.inputAttrs&&"object"==typeof e.props.inputAttrs?Object.assign(e.props.inputAttrs,t):t,e.props.computedMaxInputAttrs=e.props.maxInputAttrs&&"object"==typeof e.props.maxInputAttrs?Object.assign({},e.props.inputAttrs,e.props.maxInputAttrs):e.props.inputAttrs,e.props.computedMinInputAttrs=e.props.minInputAttrs&&"object"==typeof e.props.minInputAttrs?Object.assign({},e.props.inputAttrs,e.props.minInputAttrs):e.props.inputAttrs}function p(e){const{min:o,max:n,intervals:r}=t.props;if(e=Math.min(Math.max(e,0),100),!r||0===r.length){b();const r=o+e/100*(n-o);return t.props.scalingFunction.reverse(r,o,n)}const s=c(r,o,n);for(let t=0;t<s.length;t++){const{value:o,step:n,left:r,width:a,stepsInInterval:l}=s[t];if(e>=r&&e<=r+a){const t=o+(e-r)/a*l*n,s=t%n;return m(s<n/2?t-s:t+(n-s))}}return e>100?n:e<0?o:void 0}function d(e,o=t.props.min,n=t.props.max){const r=t.props.intervals;if(!r||0===r.length){b();return(t.props.scalingFunction.forward(e,o,n)-o)/(n-o)*100}const s=c(r,o,n);for(let t=0;t<s.length;t++){const{value:o,step:r,left:a,width:l,stepsInInterval:i}=s[t],p=t<s.length-1?s[t+1].value:n;if(e>=o&&e<=p){return 100*((a+(e-o)/r/i*l)/100)}}return 100}function c(e,o=t.props.min,n=t.props.max){(e=[...e]).sort((e,t)=>e.value-t.value),e[0].value!==o&&e.unshift({value:o,step:t.props.step});let r=0;for(let t=0;t<e.length;t++){const o=e[t].value,s=((t<e.length-1?e[t+1].value:n)-o)/e[t].step;r+=s}let s=0;return e.map((t,o)=>{const a=t.value,l=((o<e.length-1?e[o+1].value:n)-a)/t.step,i=s/r*100;return s+=l,{value:t.value,step:t.step,left:i,width:l/r*100,stepsInInterval:l,totalSteps:r}})}function u(){const e=parseFloat(`${t.props.min}`),o=parseFloat(`${t.props.max}`);let n,r=0;if(Array.isArray(t._value)){const e=[...t._value].sort(f);r=parseFloat(`${e[0]}`),n=parseFloat(`${e[1]}`)}else n=parseFloat(`${t._value}`);t.props.maxHandleStyles={left:`${d(n,e,o)}%`},t.props.isMulti&&Array.isArray(t._value)?(t.props.minHandleStyles={left:`${d(r,e,o)}%`},t.props.fillStyles={left:`${d(r,e,o)}%`,width:d(n,e,o)-d(r,e,o)+"%"}):t.props.fillStyles={left:"0%",width:`${d(n,e,o)}%`}}function f(e,t){return parseFloat(`${e}`)-parseFloat(`${t}`)}function v(e,n=!0){if(t.props.disabled)return;let r;if(void 0===e){if(t.props.isMulti)t.input([g(t.props.min),g(t.props.max)]);else{const e=t.props.min+(t.props.max-t.props.min)/2;t.input(g(e))}return void u()}if(t.props.isMulti&&Array.isArray(t._value)&&!Array.isArray(e)){const n="min"===t.props.lastHandleInteraction?0:1,s=[...t._value];s[n]=e;const[a,l]=s;if(a>=l){const e=null==o?void 0:o.querySelector(`[data-handle="${"min"===t.props.lastHandleInteraction?"max":"min"}"]`);null==e||e.focus()}r=g([...s].sort(f))}else Array.isArray(e)?r=g(e):(r=g(e),r=isNaN(r)?t.props.min:r);t.props.snapToMarks&&(r=$(r));const s=g(h(r));n&&t.input(s),u()}function h(e){return t.props.isMulti&&Array.isArray(e)?[h(e[0]),h(e[1])]:(e=isNaN(e)?t.props.min:e,Math.min(Math.max(parseFloat(`${e}`),t.props.min),t.props.max))}function m(e){return parseFloat(e.toFixed(t.props.decimals))}function g(e){if(t.props.snapToMarks)return e;if(!t.props.intervals)return Array.isArray(e)?e.map(e=>m(Math.round(e/t.props.step)*t.props.step)):m(Math.round(e/t.props.step)*t.props.step);const o=c(t.props.intervals);if(Array.isArray(e))return e.map(e=>{const n=o.find((n,r)=>{var s;return e>=n.value&&e<((null===(s=o[r+1])||void 0===s?void 0:s.value)||t.props.max)});if(!n)return e;return m(n.value+Math.round((e-n.value)/n.step)*n.step)});{const n=o.find((n,r)=>{var s;return e>=n.value&&e<((null===(s=o[r+1])||void 0===s?void 0:s.value)||t.props.max)});if(!n)return e;return m(n.value+Math.round((e-n.value)/n.step)*n.step)}}function $(e){if(Array.isArray(e))return e[0]=$(e[0]),e[1]=$(e[1]),e;{const o=t.props.marks,n=o.reduce((t,o)=>Math.abs(o.at-e)<Math.abs(t.at-e)?o:t,o[0]);return n.at}}function b(){if(a)return;e.undefine(t.props.scalingFunction)?"string"==typeof t.props.scalingFunction?t.props.scalingFunction=s[t.props.scalingFunction]||s.linear:"object"==typeof t.props.scalingFunction&&(t.props.scalingFunction={...s.linear,...t.props.scalingFunction}):t.props.scalingFunction=s.linear,a=!0}t.props.maxHandleStyles={left:"0%"},t.props.fillStyles={left:"0%",width:"0%"},t.props.isMulti=!1,t.props.step=1,t.props.min=0,t.props.max=100,t.props.tooltipFormat="function"==typeof t.props.tooltipFormat?t.props.tooltipFormat:(e,t)=>{if(t)return e},t.props.largestBar=0,"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.on("created",()=>{var s;b(),t.props.isMulti=Array.isArray(t.value),t.props.step=parseFloat(`${t.props.step}`),t.props.decimals=(null===(s=t.props.step.toString().split(".")[1])||void 0===s?void 0:s.length)||0,t.props.min=t.props.min?parseFloat(`${t.props.min}`):0,t.props.max=t.props.max?parseFloat(`${t.props.max}`):100;const a=e.undefine(t.props.tooltip);t.props.tooltip=void 0===t.props.tooltip?"auto":a;const m=e.undefine(t.props.marks);if(t.props.marks=!!m&&(Array.isArray(t.props.marks)?t.props.marks:function(){const{min:e,max:o,step:n}=t.props,r=[];for(let t=e;t<=o;t+=n)r.push({at:t,label:t});return r}()),t.props.markLabels=e.undefine(t.props.markLabels),t.props.snapToMarks=e.undefine(t.props.snapToMarks),t.props.showInput=e.undefine(t.props.showInput),t.props.largestBar=t.props.chart?t.props.chart.reduce((e,t)=>t.value>e?t.value:e,0):t.props.largestBar,i(t),e.whenAvailable(`track-${t.props.id}`,()=>{var e;o=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`track-${t.props.id}`),v(t.value,!1),u()},t.props.__root),t.context){let s=0,a="";const i=t.context.handlers.blur;t.context.handlers.blur=e=>{i(e),t.emit("blur")},t.context.handlers.clickTrack=e=>{if(!o)return;t.props.dragging=!1;const{left:n,width:r}=o.getBoundingClientRect(),s=(e.clientX-n)/r;if(t.props.isMulti&&Array.isArray(t.value)){const[e,o]=t.value,n=Math.abs(e-s*t.props.max)<Math.abs(o-s*t.props.max)?"min":"max",r="min"===n?0:1;t.props.lastHandleInteraction=n,t.value[r]=p(100*s),v(t._value)}else v(p(100*s))},t.context.handlers.focus=e=>{if(!o)return;const n=e.target.dataset.handle;n&&(t.props.lastHandleInteraction=n)},t.context.handlers.clickHandle=e=>{e.stopPropagation(),t.props.attrs.onClick&&t.props.attrs.onClick(e),t.props.dragging=!1,v(t._value)},t.context.handlers.startDrag=e=>{if(!o)return;t.props.dragging=!0;const n="touchstart"===e.type,r=n?"touchmove":"mousemove",s=n?"touchend":"mouseup";t.props.lastHandleInteraction=e.target.dataset.handle||t.props.lastHandleInteraction,document.addEventListener(r,x,{passive:!1}),document.addEventListener(s,()=>{t.context&&(t.props.dragging=!1,document.removeEventListener(r,x),n&&e.target instanceof HTMLElement&&e.target.blur())})},t.context.handlers.keydown=e=>{if(["1","2","3","4","5","6","7","8","9","0",".","-"].includes(e.key)){e.preventDefault(),clearTimeout(s),a+=e.key;const t="-"===a?-1:1;s=window.setTimeout(()=>{"-"!==a?(v(parseFloat(a)*t),a=""):a=""},350)}if(["ArrowLeft","ArrowDown","ArrowRight","ArrowUp","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const o="min"===t.props.lastHandleInteraction?0:1,n=Array.isArray(t._value)?t._value[o]:t._value,r=function(e,o){if(!t.props.intervals)return t.props.step;const n=c(t.props.intervals);if(e>=t.props.max)return n[n.length-1].step;let r=n.find((o,r)=>{var s;return e>=o.value&&e<((null===(s=n[r+1])||void 0===s?void 0:s.value)||t.props.max)});if(!r)return t.props.step;if(-1===o){e-r.step<r.value&&(r=n[n.indexOf(r)-1]||r)}return r.step}(n,["ArrowLeft","ArrowDown","PageDown"].includes(e.key)?-1:1);if(t.props.marks&&t.props.snapToMarks){const o=$(n),r=t.props.marks.find(e=>e.at===o),s=t.props.marks.indexOf(r),a=["ArrowLeft","ArrowDown"].includes(e.key)?-1:1,l=Math.min(Math.max(0,s+a),t.props.marks.length-1);return void v(t.props.marks[l].at)}if(e.metaKey)return void("ArrowLeft"===e.key||"ArrowDown"===e.key?v(t.props.min):v(t.props.max));if("Home"===e.key)return void v(t.props.min);if("End"===e.key)return void v(t.props.max);if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key)){v(n+(e.shiftKey?10*r:r)*(["ArrowLeft","ArrowDown"].includes(e.key)?-1:1))}"PageUp"===e.key?v(n+10*r):"PageDown"===e.key&&v(n-10*r)}},t.context.handlers.maxNode=o=>{r=o,o.hook.commit((n,r)=>{if(e.eq(o.value,n))return r(n);if(`${o.value}`.includes(".")&&!`${n}`.includes(".")&&l(),t.props.isMulti&&Array.isArray(t.value)){v([t.value[0],n])}else v(n);return r(h(n))})},t.context.handlers.minNode=o=>{n=o,o.hook.commit((n,r)=>{if(e.eq(o.value,n))return r(n);if(`${o.value}`.includes(".")&&!`${n}`.includes(".")&&l(),t.props.isMulti&&Array.isArray(t.value)){v([n,t.value[1]])}else v(n);return r(h(n))})},t.context.handlers.inputBlur=()=>{if(t.props.isMulti&&Array.isArray(t._value)){v([...t._value].sort(f))}},t.context.fns.calculateMarkPosition=e=>d(e,t.props.min,t.props.max)}let y;function x(e){var n;if(!o||!t.props.dragging)return;e.preventDefault();const r=e.clientX||(null===(n=e.touches)||void 0===n?void 0:n.length)&&e.touches[0].clientX,{left:s,width:a}=o.getBoundingClientRect(),l=g(p((r-s)/a*100));y!==l&&(y=l,v(l))}v(t.value)}),t.on("input",({payload:e})=>{Array.isArray(t.value)&&Array.isArray(e)?t.value[0]===e[0]&&t.value[1]===e[1]||v(e,!1):t.value!==e&&v(e,!1),function(){if(t.props.isMulti&&Array.isArray(t._value)){const[e,o]=[...t._value];n&&n.input(m(e)),r&&r.input(m(o))}else r&&r.input(t._value)}()}),t.on("prop:max",()=>{t.props.max=t.props.max?parseFloat(`${t.props.max}`):100,v(t.value),i(t)}),t.on("prop:min",()=>{t.props.min=t.props.min?parseFloat(`${t.props.min}`):0,v(t.value),i(t)})}]},td=/* #__PURE__ */K("cp"),{outer:od,wrapper:nd,inner:rd,label:sd,prefix:ad,suffix:ld,help:id,messages:pd,message:dd,icon:cd}=/* #__PURE__ */W(td),ud=td("swatchPreview",()=>({$el:"div",attrs:{id:"$id",class:"$classes.swatchPreview",tabindex:{if:"$disabled",then:-1,else:0},onClick:"$handlers.inputPreviewClick",onFocusout:"$handlers.inputPreviewFocusout",onKeydown:"$handlers.inputPreviewKeydown",role:"button","aria-valuetext":'$: "Current color: " + $value'}})),fd=td("valueString",()=>({$el:"span",attrs:{class:"$classes.valueString"},children:{if:'$format === "hex"',then:"$hex",else:{if:'$format === "rgba"',then:"$rgbaString",else:{if:'$format === "hsla"',then:"$hslaString",else:""}}}})),vd=td("panel",()=>({$el:"div",attrs:{id:'$: $id + "_popover"',class:"$classes.panel",onKeydown:"$handlers.panelKeydown","aria-role":{if:"$layout === popover",then:"dialog"},"aria-modal":{if:"$layout === popover",then:"true"},"aria-label":"$label",popover:"$popover",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"'},else:{position:{if:"$inline === undefined || $inline === false",then:"absolute"}}}}})),hd=td("panelClose",()=>({$el:"button",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:{if:"$showPanelClose",then:-1,else:0},onKeydown:"$handlers.panelCloseKeydown","aria-label":"$ui.close.value"}})),md=td("controlGroup",()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}})),gd=td("LS",()=>({$el:"div",attrs:{class:"$classes.LS"}})),$d=td("canvasLS",()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}})),bd=td("controlLS",()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},class:'$classes.control + " " + $classes.controlLS',onKeydown:"$handlers.lsKeydown",style:{left:'$controlLSPosition.x + "%"',top:'$controlLSPosition.y + "%"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuetext":'$: "Lightness: " + $hslaPercent.l + "%, Saturation: " + $hslaPercent.s + "%"'}})),yd=td("hue",()=>({$el:"div",attrs:{class:"$classes.hue"}})),xd=td("canvasHue",()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}})),wd=td("controlHue",()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.hueControlKeydown",class:'$classes.control + " " + $classes.controlHue',style:{left:'$: "min(max(" + (($hsla.h / 360) * 100) + "%, 3px), calc(100% - 3px))"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, 100%, 50%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$h"}})),_d=td("alpha",()=>({$el:"div",attrs:{class:"$classes.alpha",style:{opacity:{if:"$alpha",then:"1",else:"0.5"},cursor:{if:"$alpha",then:"",else:"not-allowed"},filter:{if:"$alpha",then:"",else:"grayscale(1)"}}}})),kd=td("canvasAlpha",()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true",style:{pointerEvents:{if:"$alpha",then:"auto",else:"none"}}}})),Sd=td("controlAlpha",()=>({$el:"div",attrs:{tabindex:{if:"$disabled || $alpha === undefined",then:-1,else:0},onKeydown:"$handlers.alphaControlKeydown",class:'$classes.control + " " + $classes.controlAlpha',style:{left:'$: "min(max(" + ($hsla.a * 100) + "%, 3px), calc(100% - 3px))"',backgroundImage:'$: "linear-gradient(to right, hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + "), hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + ")), linear-gradient(to right, white, white)"',pointerEvents:{if:"$alpha",then:"auto",else:"none"}},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$hsla.a"}})),Ld=td("preview",()=>({$el:"div",attrs:{class:"$classes.preview"}})),Id=td("canvasPreview",()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}})),Dd=td("canvasSwatchPreview",()=>({$el:"div",attrs:{class:"$classes.canvasSwatchPreviewWrapper"},children:[{$el:"canvas",attrs:{id:'$: "canvas-swatch-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasSwatchPreview',width:33,height:33,"aria-hidden":"true"}}]})),Ad=td("eyeDropper",()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}})),Cd=td("formatField",()=>({$el:"div",attrs:{class:"$classes.formatField"}})),Td=td("colorInputGroup",()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}})),Ed=td("hexField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hexFieldGroup'},children:[{$el:"input",attrs:{onInput:"$handlers.hexInput",onKeydown:"$handlers.hexKeydown",onFocus:"$handlers.hexFocus",onBlur:"$handlers.hexBlur",id:'$: "hex-" + $id',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",class:'$classes.colorField + " " + $classes.hexField',value:"$hex",autocomplete:"off"}},{$el:"label",children:"HEX",attrs:{for:'$: "hex-" + $id',class:"$classes.fieldLabel"}}]})),Od=td("rField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.rFieldGroup'},children:[{$el:"input",attrs:{id:'$: "r-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.rField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.r",autocomplete:"off"}},{$el:"label",children:"R",attrs:{for:'$: "r-" + $id',class:"$classes.fieldLabel"}}]})),Md=td("gField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.gFieldGroup'},children:[{$el:"input",attrs:{id:'$: "g-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.gField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.g",autocomplete:"off"}},{$el:"label",children:"G",attrs:{for:'$: "g-" + $id',class:"$classes.fieldLabel"}}]})),Vd=td("bField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.bFieldGroup'},children:[{$el:"input",attrs:{id:'$: "b-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.bField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.b",autocomplete:"off"}},{$el:"label",children:"B",attrs:{for:'$: "b-" + $id',class:"$classes.fieldLabel"}}]})),Fd=td("aField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.aFieldGroup'},children:[{$el:"input",attrs:{id:'$: "a-" + $id',onInput:'$handlers.rangeLimitInput("alpha", 0, 1)',onKeydown:'$handlers.rangeLimitKeydown("alpha", 0, 1, 0.01)',type:"text",class:'$classes.colorField + " " + $classes.aField',value:"$rgba.a",tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled || $alpha === undefined",autocomplete:"off",style:{opacity:{if:"$alpha",then:"1",else:"0.33"},cursor:{if:"$alpha",then:void 0,else:"not-allowed"}},"aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$rgba.a"}},{$el:"label",children:"A",attrs:{for:'$: "a-" + $id',class:"$classes.fieldLabel",style:{opacity:{if:"$alpha",then:"1",else:"0.33"}}}}]})),Pd=td("hField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hFieldGroup'},children:[{$el:"input",attrs:{id:'$: "h-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 360)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 360, 1)',type:"text",class:'$classes.colorField + " " + $classes.hField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.h",autocomplete:"off","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$hsla.h"}},{$el:"label",children:"H",attrs:{for:'$: "h-" + $id',class:"$classes.fieldLabel"}}]})),Bd=td("sField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.sFieldGroup'},children:[{$el:"input",attrs:{id:'$: "s-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.sField',tabindex:{if:"$disabled",then:-1,else:0},value:"$hslaPercent.s",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.s"}},{$el:"label",children:"S",attrs:{for:'$: "s-" + $id',class:"$classes.fieldLabel"}}]})),Hd=td("lField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.lFieldGroup'},children:[{$el:"input",attrs:{id:'$: "l-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.lField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.l",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.l"}},{$el:"label",children:"L",attrs:{for:'$: "l-" + $id',class:"$classes.fieldLabel"}}]})),Rd=td("formatSwitcher",()=>({$el:"div",attrs:{class:"$classes.formatSwitcher",onClick:"$handlers.toggleFormat",tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.formatSwitcherKeydown",role:"button","aria-label":"$ui.next.value"}})),Nd=td("swatches",()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}})),Kd=td("swatch",()=>({$el:"div",for:["swatch","index","$options"],if:"$swatch",attrs:{if:"$swatch.group",then:{class:"$classes.swatchGroup"},else:{class:"$classes.swatch",title:"$swatch.label"}},children:{if:"$swatch.group",then:[{$el:"span",attrs:{class:"$classes.swatchGroupLabel"},children:"$swatch.group"},{$el:"div",for:["groupSwatch","swatchIndex","$swatch.options"],attrs:{class:"$classes.swatch",title:"$groupSwatch.label"},children:[{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($groupSwatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$groupSwatch.label + "-" + $groupSwatch.value',"data-color":"$fns.anyToHsvaString($groupSwatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($groupSwatch.value, 2)","data-group":"$index","data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}]}],else:{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($swatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$swatch.label + "-" + $swatch.value',"data-color":"$fns.anyToHsvaString($swatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($swatch.value, 2)","data-group":0,"data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}}})),Wd=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,qd=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i;function zd(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function Ud(e){const[t,o,n,r]=function(e){e=e.replace("#",""),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e.slice(0,2),16),o=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),r=e.length>=8?parseInt(e.slice(6,8),16)/255:1;return function(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p,d=0;const c=(l+i)/2;if(l===i)d=p=0;else{const e=l-i;switch(p=c>.5?e/(2-l-i):e/(l+i),l){case r:d=(s-a)/e+(s<a?6:0);break;case s:d=(a-r)/e+2;break;case a:d=(r-s)/e+4}d*=60}return[d,255*p,255*c,n]}(t,o,n,r)}(e);return[...jd(t,o,n,r)]}function Yd(e,t,o,n=1){const r=t/100,s=o/100,a=(2-r)*s/2;return 0!==a&&(1===a||(t=a<.5?r*s/(2*a):r*s/(2-2*a))),[e,zd(255*t,2),zd(255*a,2),n]}function jd(e,t,o,n=1){const r=zd(t/255,4),s=zd(o/255,4);if(1===s)return[e,0,100,n];const a=zd(s+r*Math.min(s,1-s),4);let l=t/2.55;return 0!==a&&(l=1!==s&&0!==s?2*(a-s)/a*100:t/2.55),[e,zd(l,2),zd(100*a,2),n]}function Zd(e,t,o,n=1){const r=o/100,s=r*(t/100),a=s*(1-Math.abs(e/60%2-1)),l=r-s;let i=0,p=0,d=0;return[i,p,d]=e<60?[s,a,0]:e<120?[a,s,0]:e<180?[0,s,a]:e<240?[0,a,s]:e<300?[a,0,s]:[s,0,a],i=Math.round(255*(i+l)),p=Math.round(255*(p+l)),d=Math.round(255*(d+l)),[Math.min(Math.max(i,0),255),Math.min(Math.max(p,0),255),Math.min(Math.max(d,0),255),n]}function Gd(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p=0;const d=l,c=l-i,u=0===l?0:c/l;if(l!==i){switch(l){case r:p=(s-a)/c+(s<a?6:0);break;case s:p=(a-r)/c+2;break;case a:p=(r-s)/c+4}p/=6}return[360*p,100*u,100*d,n]}function Xd(e,t,o,n=1){const[r,s,a,l]=Zd(e,t,o,n);return function(e,t,o,n=1){const r=e=>Math.round(e).toString(16).padStart(2,"0").toUpperCase(),s=function(e){return Math.round(255*e).toString(16).padStart(2,"0").toUpperCase()}(n);return"#"+r(e)+r(t)+r(o)+`${"FF"===s?"":s}`}(r,s,a,l)}function Jd(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function Qd(e){if(e){if(Jd(e))return Ud(e);if(e.startsWith("rgb")){const t=e.match(Wd);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return Gd(o(t[1]),o(t[2]),o(t[3]),t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1)}if(e.startsWith("hsl")){const t=e.match(qd);if(!t)return[0,0,0,1];const o=Number(t[1].replace("deg","").trim()),n=Number(t[2].slice(0,-1))/100,r=Number(t[3].slice(0,-1))/100,s=t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1;return jd(o,zd(255*n,2),zd(255*r,2),s)}}}function ec(e){const[t,o,n,r]=e.split("-").map(e=>Number(e));return[t,o,n,r]}function tc(e,t=150,o=!0){let n=null,r=!0;return(...s)=>{const a=()=>{e(...s),n=null};o&&r&&(r=!1,a()),n||(n=setTimeout(a,t))}}function oc(e){return!1!==e&&"false"!==e}function nc(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}const rc={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"};const sc={schema:/* #__PURE__ */od(/* #__PURE__ */nd(/* #__PURE__ */sd("$label"),/* #__PURE__ */z("$inline && $help",/* #__PURE__ */id("$help")),/* #__PURE__ */rd(/* #__PURE__ */z("($inline === undefined || $inline === false) && $prefixIcon !== undefined",/* #__PURE__ */cd("prefix","label")),/* #__PURE__ */z("$inline === undefined || $inline === false",/* #__PURE__ */ad()),/* #__PURE__ */z("$inline === undefined || $inline === false",/* #__PURE__ */ud(/* #__PURE__ */Dd(),/* #__PURE__ */z("$showValue",/* #__PURE__ */fd()))),/* #__PURE__ */z("$inline || $expanded)",/* #__PURE__ */vd(/* #__PURE__ */z("$showPanelClose && ($inline === undefined || $inline === false)",/* #__PURE__ */hd(/* #__PURE__ */cd("close"))),/* #__PURE__ */z("$panelControls",/* #__PURE__ */md(/* #__PURE__ */gd(/* #__PURE__ */$d(),/* #__PURE__ */bd()),/* #__PURE__ */Ld(/* #__PURE__ */Id()),/* #__PURE__ */yd(/* #__PURE__ */xd(),/* #__PURE__ */wd()),/* #__PURE__ */_d(/* #__PURE__ */kd(),/* #__PURE__ */Sd()),/* #__PURE__ */z("$eyeDropper && $hasNativeEyeDropper",/* #__PURE__ */Ad(/* #__PURE__ */cd("eyeDropper"))))),/* #__PURE__ */z("$panelFormat",/* #__PURE__ */Cd(/* #__PURE__ */Td(/* #__PURE__ */z('$panelActiveFormat === "hex"',/* #__PURE__ */Ed()),/* #__PURE__ */z('$panelActiveFormat === "rgba"',/* #__PURE__ */Od()),/* #__PURE__ */z('$panelActiveFormat === "rgba"',/* #__PURE__ */Md()),/* #__PURE__ */z('$panelActiveFormat === "rgba"',/* #__PURE__ */Vd()),/* #__PURE__ */z('$panelActiveFormat === "hsla"',/* #__PURE__ */Pd()),/* #__PURE__ */z('$panelActiveFormat === "hsla"',/* #__PURE__ */Bd()),/* #__PURE__ */z('$panelActiveFormat === "hsla"',/* #__PURE__ */Hd()),/* #__PURE__ */z('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',/* #__PURE__ */Fd())),/* #__PURE__ */Rd(/* #__PURE__ */cd("switch")))),/* #__PURE__ */z("$options",/* #__PURE__ */Nd(/* #__PURE__ */Kd())))),/* #__PURE__ */z("$inline === undefined || $inline === false",/* #__PURE__ */ld()),/* #__PURE__ */z("($inline === undefined || $inline === false) && $suffixIcon !== undefined",/* #__PURE__ */cd("suffix"))),/* #__PURE__ */z("$: ($inline === undefined || $inline === false) && $help",/* #__PURE__ */id("$help"))),/* #__PURE__ */pd(/* #__PURE__ */dd("$message.value"))),type:"input",family:"text",props:["disbaled","format","valueFormat","alpha","panelControls","panelFormat","eyeDropper","inline","options","showValue","closeOnSelect","allowPaste"],features:[function(t){let o,n=null,r=null,s=null,a=null,l=null,i=null,p=null,d=0;const c=["hex","rgba","hsla"],u=tc(function(){if(!r)return;const e=r.getContext("2d");if(!e)return;const{width:o,height:n}=r,s=t.props.h||0;e.fillStyle=`hsl(${s}, 100%, 50%)`,e.fillRect(0,0,o,n);const a=e.createLinearGradient(0,0,o,0);a.addColorStop(0,"rgba(255, 255, 255, 1)"),a.addColorStop(1,"rgba(255, 255, 255, 0)"),e.fillStyle=a,e.fillRect(0,0,o,n);const l=e.createLinearGradient(0,0,0,n);l.addColorStop(0,"rgba(0,0,0,0)"),l.addColorStop(1,"rgba(0,0,0,1)"),e.fillStyle=l,e.fillRect(0,0,o,n)},2),f=tc(function(){if(!a)return;const e=a.getContext("2d");if(!e)return;const o=Math.round(a.width),n=Math.round(a.height);e.clearRect(0,0,o,n),V(a,n/2);const r=t.props.rgba.r||0,s=t.props.rgba.g||0,l=t.props.rgba.b||0,i=e.createLinearGradient(0,0,o,0);i.addColorStop(0,`rgba(${r}, ${s}, ${l}, 0)`),i.addColorStop(1,`rgba(${r}, ${s}, ${l}, 1)`),e.fillStyle=i,e.fillRect(0,0,o,n)},2),v=tc(D,2),h=tc(A,2),m=tc(B,2),g=tc(F,10,!1);function $(e){var o,r;if(!t.context||!t.props.allowPaste||t.props.disabled)return;const s=null===(o=t.props.__root)||void 0===o?void 0:o.activeElement;if(n&&n.contains(s)){const o=null===(r=e.clipboardData)||void 0===r?void 0:r.getData("text");if(!o)return;if("INPUT"===s.tagName&&!Jd(o)&&!Wd.test(o)&&!qd.test(o))return;(Jd(o)||o.startsWith("hsl")||o.startsWith("rgb"))&&(t.props.hexInputFocused&&(t.props.hexInputFocused=!1,setTimeout(()=>{t.props.hexInputFocused=!0},10)),e.preventDefault(),b(o))}}function b(e){var o;if(!e)return;const n=Qd(e);if(n){const[o,r,s,a]=n;"undefined"!==e&&("number"!=typeof o||isNaN(o)||"number"!=typeof r||isNaN(r)||"number"!=typeof s||isNaN(s)||"number"!=typeof a||isNaN(a)||zd(o,2)===t.props.h&&zd(r,2)===t.props.s&&zd(s,2)===t.props.v&&zd(a,2)===t.props.a)||(t.props.alpha&&(t.props.a=zd(a,2)),B(o,r,s))}else{const n=null===(o=t.props.options)||void 0===o?void 0:o.find(t=>{var o;return(null===(o=t.label)||void 0===o?void 0:o.toLowerCase())===e.toLowerCase()});if(n&&n.value){const e=Qd(n.value);if(e){const[o,n,r,s]=e;t.props.alpha&&(t.props.a=zd(s,2)),B(o,n,r)}else B(t.props.h,t.props.s,t.props.v)}else B(t.props.h,t.props.s,t.props.v)}}function y(e){if(!t.context||!p)return;const o=p[e];o&&(t.props.focusedSwatch=o.dataset.color)}function x(e,t){new ResizeObserver(()=>{const o=e.getBoundingClientRect();e.width=Math.round(o.width),e.height=Math.round(o.height),t(e)}).observe(e)}function w(){t.context&&t.props.eyeDropper&&(t.context.hasNativeEyeDropper=!("undefined"==typeof window||!window.EyeDropper),e.whenAvailable(`eye-dropper-${t.props.id}`,()=>{var e;const o=new window.EyeDropper,n=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`eye-dropper-${t.props.id}`);null==n||n.addEventListener("click",async()=>{const e=await o.open();if(!e.sRGBHex)return;const[n,r,s]=Ud(e.sRGBHex);t.props.alpha&&(t.props.a=1),B(n,r,s)})},t.props.__root))}function _(){k("canvas-ls",e=>{r=e},u,E),k("canvas-hue",e=>{s=e},I,O),k("canvas-alpha",e=>{a=e},f,M),S(`canvas-preview-${t.props.id}`,e=>{l=e,D()},v),S(`canvas-swatch-preview-${t.props.id}`,e=>{i=e,A()},h),L()}function k(e,n,r,s){let a=!1;const l=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",d),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",c)},i=e=>{1===e.buttons&&o&&s(e)},p=e=>{o&&s(e)},d=()=>{o=void 0,l()},c=()=>{o=void 0,l()};S(`${e}-${t.props.id}`,t=>{const l=t.nextElementSibling;n(t),r(),function(e,t){const o=o=>{e&&(o.preventDefault(),t(o))};null==e||e.addEventListener("mousedown",o),null==e||e.addEventListener("touchstart",o)}(t,s),a||function(e,t){a=!0,e.addEventListener("blur",()=>{e.removeAttribute("data-prevent-focus-style")}),t.addEventListener("touchend",()=>{e.removeAttribute("data-prevent-focus-style"),e.blur()}),e.addEventListener("keydown",t=>{["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)&&e.removeAttribute("data-prevent-focus-style")})}(l,t),t.addEventListener("mousedown",t=>{l.focus(),l.setAttribute("data-prevent-focus-style","true"),o=rc[e],s(t),document.addEventListener("mousemove",i),document.addEventListener("mouseup",d)}),t.addEventListener("touchstart",()=>{l.setAttribute("data-prevent-focus-style","true"),l.focus(),o=rc[e],document.addEventListener("touchmove",p),document.addEventListener("touchend",c)})},r)}function S(o,n,r){e.whenAvailable(o,()=>{var e;const s=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(o);s&&(n(s),r&&x(s,r))},t.props.__root)}function L(){e.whenAvailable(`swatches-${t.props.id}`,()=>{var e,o,n;p=Array.from((null===(e=t.props.__root)||void 0===e?void 0:e.querySelectorAll(`#swatches-${t.props.id} canvas`))||[]),p.forEach(e=>{x(e,C)}),t.props.focusedSwatch=null===(n=null===(o=p[0])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.color,F()},t.props.__root)}function I(){if(!s)return;const e=s.getContext("2d");if(!e)return;const t=s.width,o=s.height;for(let n=0;n<t;n++){const r=Math.floor(n/t*360);e.fillStyle=`hsl(${r}, 100%, 50%)`,e.fillRect(n,0,1,o)}}function D(){if(!l)return;const e=l.getContext("2d");if(!e)return;V(l,l.width/3);const{r:o,g:n,b:r,a:s}=t.props.rgba;e.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,e.fillRect(0,0,l.width,l.height)}function A(){if(!i)return;const e=i.getContext("2d");if(!e)return;V(i,i.height/2);const{r:o,g:n,b:r,a:s}=t.props.rgba;e.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,e.fillRect(0,0,i.width,i.height)}function C(e){if(!e)return;const t=e.getContext("2d");if(!t)return;V(e,e.width/2);const o=e.dataset.colorPrecise;if(!o)return;const[n,r,s,a]=ec(o),[l,i,p,d]=Yd(n,r,s,a);t.fillStyle=`hsla(${l}, ${i/255*100}%, ${p/255*100}%, ${d})`,t.fillRect(0,0,Math.round(e.width),Math.round(e.height))}function T(e,t,n){let r=null;const s=e=>{null!==r&&cancelAnimationFrame(r),r=requestAnimationFrame(()=>{if(!t)return;const o=t.getBoundingClientRect();let r,s;"touches"in e?(r=e.touches[0].clientX-o.left,s=e.touches[0].clientY-o.top):(r=e.clientX-o.left,s=e.clientY-o.top),r=Math.min(Math.max(r,0),o.width),s=Math.min(Math.max(s,0),o.height),n(r,s)})};s(e);const a=e=>{e.preventDefault(),s(e)},l=e=>{e.preventDefault(),s(e)},i=()=>{o=void 0,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)},p=()=>{o=void 0,document.removeEventListener("touchmove",l),document.removeEventListener("touchend",p)};"touches"in e?(document.addEventListener("touchmove",l),document.addEventListener("touchend",p)):(document.addEventListener("mousemove",a),document.addEventListener("mouseup",i))}function E(e){T(e,r,(e,o)=>{const n=e/r.width*100,s=100-o/r.height*100;m(t.props.hue,n,s)})}function O(e){T(e,s,(e,o)=>{if(!s)return;const n=s.width,r=Math.floor(e/n*360);t.props.h=r,m(t.props.h,t.props.s,t.props.v)})}function M(e){t.props.alpha&&T(e,a,(e,o)=>{const n=e/a.width*100/100;t.props.a=n,m(t.props.hue,t.props.s,t.props.v)})}function V(e,t){const o=e.getContext("2d");if(!o)return;const n=Math.ceil(e.height/t),r=Math.ceil(e.width/t);for(let e=0;e<n;e++)for(let n=0;n<r;n++)o.fillStyle=(e+n)%2==1?"#FFFFFF":"#CCCCCC",o.fillRect(n*t,e*t,t,t)}function F(){var e,o;if(!t.context||!t.props.options||!p)return;const{h:n,s:r,v:s,a:a}=t.props,l=function(e,t,o,n=1){const r=0===o?0:t;return`${zd(0===o||100===o&&0===t?0:e,0)}-${zd(r,0)}-${zd(o,0)}-${zd(n,2)}`}(n,r,s,a);let i=!1,d=!1;p.forEach(e=>{const t=e.dataset.color;if(!t)return;const[o,n,r,c]=t.split("-");"0"===r&&0===s&&c===`${a}`&&(d=!0);const u=e.parentElement;d||t===l?(u.dataset.active="true",e.ariaSelected="true",d=!1,!i&&p&&(y(p.indexOf(e)),i=!0)):(delete u.dataset.active,e.ariaSelected="false")}),i||(t.props.focusedSwatch=null===(o=null===(e=p[0])||void 0===e?void 0:e.dataset)||void 0===o?void 0:o.color)}function P(e){e=e.replace("#",""),t.props.hexInputFocused||3!==e.length||(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),e=`#${e=e.toUpperCase()}`,t.props.hex=e.slice(0,9)}function B(e,o,r,s=!1){t.props.h=void 0===e||isNaN(e)?t.props.h:zd(Math.max(Math.min(e,360),0),2),t.props.s=void 0===o||isNaN(o)?t.props.s:zd(Math.max(Math.min(o,100),0),2),t.props.v=void 0===r||isNaN(r)?t.props.v:zd(Math.max(Math.min(r,100),0),2);const{h:a,s:l,v:i,a:p}=t.props,[d,c,u]=Yd(a,l,i),[f,v,h]=Zd(a,l,i),m=t.props.hexInputFocused?t.props.hex:Xd(a,l,i,p),$=zd(p,2);t.props.hsla={h:a,s:c,l:u,a:$},t.props.hslaPercent={h:zd(a,0),s:100===i&&0===l?0:zd(0===i?c/255:Math.max(Math.min(c/255*100,100),0),0),l:zd(Math.max(Math.min(t.props.hsla.l/255*100,100),0),0),a:$},t.props.hslaString=`hsla(${t.props.hslaPercent.h}, ${t.props.hslaPercent.s}%, ${t.props.hslaPercent.l}%, ${$})`,t.props.hslaStringPrecise=`hsla(${a}, ${zd(0===i?c/255:c/255*100,2)}%, ${zd(u/255*100,2)}%, ${$})`,t.props.rgba={r:f,g:v,b:h,a:$},t.props.rgbaString=`rgba(${f}, ${v}, ${h}, ${$})`,P(m),setTimeout(()=>{var e;H(),function(){const e=t.props.s,o=100-t.props.v;t.props.controlLSPosition={x:e,y:o}}(),g(),n||"undefined"==typeof window||(n=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"]`))},0);const b=t.props.valueFormat?t.props.valueFormat:t.props.format;s||("hex"===b?t.input(t.props.hex):"rgba"===b?t.input(t.props.rgbaString):"hsla"===b&&t.input(t.props.hslaStringPrecise))}function H(){u(),f(),v(),h()}t.addProps(["expanded","h","s","v","a","hsla","hslaPercent","hslaString","hslaStringPrecise","rgba","rgbaString","hex","controlLSPosition","panelActiveFormat","hexInputFocused","hasNativeEyeDropper","focusedSwatch","swatchIsUsingKeyboardNav","showPanelClose"]),t.props.h=t.props.h||void 0,t.props.s=t.props.s||void 0,t.props.v=t.props.v||void 0,t.props.a=t.props.a||1,t.props.controlLSPosition=t.props.controlLSPosition||{x:0,y:0},t.props.switchIcon=t.props.switchIcon||'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M34.2 179.7L154.4 66.2c1.4-1.3 3.5-2.2 5.6-2.2s4.2 .8 5.6 2.2L285.8 179.7c1.4 1.3 2.2 3.2 2.2 5.2c0 3.9-3.2 7.1-7.1 7.1H39.1c-3.9 0-7.1-3.2-7.1-7.1c0-2 .8-3.8 2.2-5.2zm-22-23.3C4.4 163.8 0 174.1 0 184.9C0 206.5 17.5 224 39.1 224H280.9c21.6 0 39.1-17.5 39.1-39.1c0-10.8-4.4-21.1-12.3-28.4L187.6 42.9C180.1 35.9 170.2 32 160 32s-20.1 3.9-27.6 10.9L12.3 156.4zm22 175.9c-1.4-1.3-2.2-3.2-2.2-5.2c0-3.9 3.2-7.1 7.1-7.1H280.9c3.9 0 7.1 3.2 7.1 7.1c0 2-.8 3.8-2.2 5.2L165.6 445.8c-1.4 1.3-3.5 2.2-5.6 2.2s-4.2-.8-5.6-2.2L34.2 332.3zm-22 23.3L132.4 469.1c7.4 7 17.4 10.9 27.6 10.9s20.1-3.9 27.6-10.9L307.7 355.6c7.8-7.4 12.3-17.7 12.3-28.5c0-21.6-17.5-39.1-39.1-39.1H39.1C17.5 288 0 305.5 0 327.1c0 10.8 4.4 21.1 12.3 28.5z"/></svg>',t.props.hexInputFocused=!1,t.props.swatchIsUsingKeyboardNav=!1,t.on("destroying",()=>{t.context&&"undefined"!=typeof document&&document.removeEventListener("paste",$)}),t.on("created",()=>{var o,r;t.context&&("undefined"!=typeof window&&document.addEventListener("paste",$),t.props.expanded=!1,t.props.panelActiveFormat=t.props.format||c[0],t.props.panelControls=oc(t.props.panelControls),t.props.eyeDropper=oc(t.props.eyeDropper),t.props.panelFormat=oc(t.props.panelFormat),t.props.showValue=oc(t.props.showValue),t.props.allowPaste=oc(t.props.allowPaste),t.props.inline=e.undefine(t.props.inline),t.props.disabled=e.undefine(t.props.disabled),t.props.format=t.props.format||"hex",t.props.alpha=e.undefine(null===(r=null===(o=t.props)||void 0===o?void 0:o.alpha)||void 0===r||r),t.props.valueFormat=t.props.valueFormat||t.props.format,t.props.closeOnSelect=e.undefine(t.props.closeOnSelect),t.props.focusedSwatch=void 0,void 0===t.value||""===t.value||null===t.value?(t.props.rgba={r:0,g:0,b:0},B(0,0,0,!0)):b(`${t.value}`),t.on("input",({payload:e})=>{n&&void 0!==t.props.__root&&!n.contains(t.props.__root.activeElement)&&b(e)}),setTimeout(()=>{w()},5),_(),t.on("prop:expanded",()=>{var e;if(t.props.expanded)w(),_(),L(),document.addEventListener("keydown",o),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?t.props.showPanelClose=!0:t.props.showPanelClose=!1,setTimeout(()=>{var e;const o=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`);o&&o.focus()},0);else{document.removeEventListener("keydown",o);(null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"] *[tabindex="0"]`)).focus()}function o(e){"Escape"===e.key&&(e.preventDefault(),t.props.expanded=!1)}}),t.context.fns.anyToHsvaString=(e,t)=>{const o=Qd(e);if(!o)return"0-0-0-1";let[n,r,s,a]=o;return 0===t&&(n=0===s||100===s&&0===r?0:n),`${zd(n,t)}-${zd(r,t)}-${zd(s,t)}-${zd(a,2)}`},t.context.handlers.inputPreviewClick=e=>{t.props.expanded=!t.props.expanded},t.context.handlers.inputPreviewFocusout=e=>{var o,n,r;const s=null===(o=t.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${t.props.id}"] .formkit-inner`),a=e.relatedTarget;if(s.contains(a)){function l(e){var o,n;s.contains(e.target)||(t.props.expanded=!1,null===(o=t.props.__root)||void 0===o||o.removeEventListener("mousedown",l),null===(n=t.props.__root)||void 0===n||n.removeEventListener("touchstart",l))}null===(n=t.props.__root)||void 0===n||n.addEventListener("mousedown",l),null===(r=t.props.__root)||void 0===r||r.addEventListener("touchstart",l)}else t.props.expanded=!1},t.context.handlers.inputPreviewKeydown=e=>{"Escape"===e.key&&(e.preventDefault(),t.props.expanded=!1),"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.props.expanded=!t.props.expanded)},t.context.handlers.closePanel=()=>{t.props.expanded=!1},t.context.handlers.panelCloseKeydown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.props.expanded=!1)},t.context.handlers.toggleFormat=(e=1)=>{e="number"==typeof e?e:1;const o=(c.indexOf(t.props.panelActiveFormat)+e+c.length)%c.length;t.props.panelActiveFormat=c[o]},t.context.handlers.panelKeydown=e=>{var o,n,r;if("Tab"===e.key&&t.props.expanded){e.preventDefault();const s=Array.from((null===(o=t.props.__root)||void 0===o?void 0:o.querySelectorAll(`[data-id="${t.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`))||[]).filter(nc),a=s.indexOf((null===(n=t.props.__root)||void 0===n?void 0:n.activeElement)?null===(r=t.props.__root)||void 0===r?void 0:r.activeElement:t.props.__root);let l;l=e.shiftKey?(a-1+s.length)%s.length:(a+1)%s.length,s[l].focus()}},t.context.handlers.lsKeydown=e=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r}=t.props,s=e.shiftKey?10:1;switch(e.key){case"ArrowLeft":B(o,n-s,r);break;case"ArrowRight":B(o,n+s,r);break;case"ArrowUp":B(o,n,r+s);break;case"ArrowDown":B(o,n,r-s);break;case"PageUp":B(o,n,r+10);break;case"PageDown":B(o,n,r-10);break;case"Home":B(o,n-10,r);break;case"End":B(o,n+10,r)}H()}},t.context.handlers.hueControlKeydown=e=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r}=t.props,s=e.shiftKey?10:1;switch(e.key){case"ArrowLeft":case"ArrowDown":B(o-s,n,r);break;case"ArrowRight":case"ArrowUp":B(o+s,n,r);break;case"PageUp":B(o+10,n,r);break;case"PageDown":B(o-10,n,r);break;case"Home":B(0,n,r);break;case"End":B(360,n,r)}H()}},t.context.handlers.alphaControlKeydown=e=>{if(t.props.alpha&&["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r,a:s}=t.props,a=e.shiftKey?.1:.01;switch(e.key){case"ArrowLeft":case"ArrowDown":t.props.a=zd(Math.min(Math.max(s-a,0),1),2);break;case"ArrowRight":case"ArrowUp":t.props.a=zd(Math.min(Math.max(s+a,0),1),2);break;case"PageUp":t.props.a=zd(Math.min(Math.max(s+.1,0),1),2);break;case"PageDown":t.props.a=zd(Math.min(Math.max(s-.1,0),1),2);break;case"Home":t.props.a=0;break;case"End":t.props.a=1}B(o,n,r)}},t.context.handlers.eyeDropperKeydown=e=>{var o;if("Enter"===e.key||" "===e.key){e.preventDefault();const n=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`eye-dropper-${t.props.id}`);null==n||n.click()}},t.context.handlers.formatSwitcherKeydown=e=>{t.context&&("Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),t.context.handlers.toggleFormat()),"ArrowUp"===e.key&&(e.preventDefault(),t.context.handlers.toggleFormat(-1)))},t.context.handlers.hexInput=e=>{const o=e.target,n=o.value.startsWith("#")?9:8,r=o.value.slice(0,n);if(o.value=t.props.alpha?r:r.slice(0,7),Jd(r)){const[e,o,n,s]=Ud(r);t.props.alpha&&(t.props.a=s),P(r),B(e,o,n)}},t.context.handlers.hexKeydown=e=>{const o=e.target,n=o.value;let r="";if(!Jd(n))return;const s=n.startsWith("#")?n.slice(1):n,a=8===s.length,l=a?s.substring(0,6):s,i=a?s.substring(6,8):"",p=e.shiftKey?10:1,d=16777215;let c;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key))switch(e.preventDefault(),e.key){case"ArrowUp":c=(parseInt(l,16)+p)%16777216;break;case"ArrowDown":c=(parseInt(l,16)-p+d+1)%16777216;break;case"PageUp":c=(parseInt(l,16)+10)%16777216;break;case"PageDown":c=(parseInt(l,16)-10+d+1)%16777216;break;case"Home":c=0;break;case"End":c=d}void 0!==c&&(r=c.toString(16).padStart(6,"0").toUpperCase()),r&&(o.value=a?`#${r}${i}`:`#${r}`),t.context&&t.context.handlers.hexInput(e)},t.context.handlers.hexFocus=()=>{t.context&&(t.props.hexInputFocused=!0)},t.context.handlers.hexBlur=e=>{if(!t.context)return;t.props.hexInputFocused=!1;const o=e.target.value;Jd(o)&&P(o)},t.context.handlers.rangeLimitInput=(e,o,n,r)=>s=>{const a=r||s;if(!a||!t.context)return;const l=a.target;if(l.value.endsWith("."))return;const i=Math.max(Math.min(Number(l.value),n),o);l.value=`${i}`;const p=l.id;if("hsla"===e){switch(p){case`h-${t.props.id}`:t.props.h=i;break;case`s-${t.props.id}`:t.props.hslaPercent.s=i;break;case`l-${t.props.id}`:t.props.hslaPercent.l=i}const[e,o,n]=jd(t.props.h,2.55*t.props.hslaPercent.s,2.55*t.props.hslaPercent.l);B(e,o,n)}else if("rgba"===e){switch(p){case`r-${t.props.id}`:t.props.rgba.r=i;break;case`g-${t.props.id}`:t.props.rgba.g=i;break;case`b-${t.props.id}`:t.props.rgba.b=i}const[e,o,n]=Gd(t.props.rgba.r,t.props.rgba.g,t.props.rgba.b);B(e,o,n)}else"alpha"==e&&t.props.alpha&&(t.props.a=i,B())},t.context.handlers.rangeLimitKeydown=(e,o,n,r)=>s=>{if(!t.context)return;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End","Backspace","Tab","Enter"].includes(s.key)||s.metaKey||!/[a-zA-Z!@#$%^&*()_+={}\[\]:;"'<,>?\/|\\`~]/g.test(s.key)){if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(s.key)){const a=s.target,l=Number(a.value),i=s.shiftKey?10*r:r;switch(s.key){case"ArrowUp":s.preventDefault(),a.value=`${Math.min(l+i,n)}`;break;case"ArrowDown":s.preventDefault(),a.value=`${Math.max(l-i,o)}`;break;case"PageUp":s.preventDefault(),a.value=`${Math.min(l+10*r,n)}`;break;case"PageDown":s.preventDefault(),a.value=`${Math.max(l-10*r,o)}`;break;case"Home":s.preventDefault(),a.value=`${o}`;break;case"End":s.preventDefault(),a.value=`${n}`}t.context.handlers.rangeLimitInput(e,o,n,s)()}}else s.preventDefault()},t.context.handlers.swatchClick=e=>{const o=e.target;if(o.dataset.colorPrecise){const[e,n,r,s]=ec(o.dataset.colorPrecise);t.props.alpha&&(t.props.a=s),B(e,n,r),t.props.closeOnSelect&&(t.props.expanded=!1)}t.context&&"keydown"!==e.type&&t.context.handlers.swatchKeydown(e)},t.context.handlers.swatchKeydown=e=>{var o,n,r,s;if(!t.context||!p||!p.length)return;const a=p.indexOf(e.currentTarget);let l=null;const i=function(e){var t;if(!e.length)return 0;const o=null===(t=e[0].parentElement)||void 0===t?void 0:t.parentElement;if(!o)return 0;const n=o.getBoundingClientRect().width,r=e[0].parentElement;if(!r)return 0;const s=r.getBoundingClientRect(),a=window.getComputedStyle(r),l=parseFloat(a.marginLeft)+parseFloat(a.marginRight),i=s.width+l;return Math.floor(n/i)}(p),c=p.length;let u=0,f=c,v=!1;const h=p[a].dataset.group;if(void 0!==h){const e=p.filter(e=>e.dataset.group===h);u=p.indexOf(e[0]),f=p.indexOf(e[e.length-1])}const m=(a-u)%i;if(!e.key||"Tab"===e.key)return e.key||(t.props.swatchIsUsingKeyboardNav=!1,d=m,y(a)),"Tab"===e.key&&(t.props.swatchIsUsingKeyboardNav=!1),void p.forEach(e=>{delete e.parentElement.dataset.focused});if("Enter"===e.key||" "===e.key)return e.preventDefault(),d=m,t.context.handlers.swatchClick(e),void y(a);switch("ArrowUp"!==e.key&&"ArrowDown"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(t.props.swatchIsUsingKeyboardNav=!0,e.preventDefault()),e.key){case"ArrowUp":l=Math.max(a-i,a-(i-(d-m))),v=!0;break;case"ArrowDown":l=Math.max(a+i,a+(i+(d-m))),v=!0;break;case"ArrowLeft":l=a-1,d=(l-u)%i;break;case"ArrowRight":l=a+1,d=(l-u)%i}if(v&&null!==l&&(l<u||l>f)){let e;e=l<u?null===(n=null===(o=p[u-1])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.group:null===(s=null===(r=p[f+1])||void 0===r?void 0:r.dataset)||void 0===s?void 0:s.group;const t=p.filter(e=>e.dataset.group===h),c=p.filter(t=>t.dataset.group===e),v=(a-u)%i,m=t.length%i||i,g=a>=u+t.length-m;if(l<u){const e=c.length%i||i;l=u-e+Math.min(Math.max(v,d),e-1)}else l>f&&(l=g?Math.min(f+Math.max(v,d)+1,p.indexOf(c[c.length-1])):Math.min(l,f))}if(null!==l&&l>=0&&l<c){y(l),p.forEach(e=>{delete e.parentElement.dataset.focused});const e=p[l],t=e.parentElement;e.focus(),t.dataset.focused="true"}})})},to,o.options,
62
62
  /* #__PURE__ */o.defaultIcon("eyeDropper","color"),
63
63
  /* #__PURE__ */o.defaultIcon("close","close"),
64
64
  /* #__PURE__ */o.localize("close"),
65
- /* #__PURE__ */o.localize("next")]},Qd=/* #__PURE__ */K("tb"),{outer:ec,inner:tc,wrapper:oc,prefix:nc,suffix:rc,help:sc,messages:ac,message:lc,icon:ic}=/* #__PURE__ */W(Qd),pc=Qd("label",(()=>({if:"$label",$el:"label",attrs:{id:"$id + '_label'"}}))),dc=Qd("singleToggle",(()=>({bind:"$attrs",$el:"button",attrs:{id:"$id",type:"button","aria-label":"$label","aria-pressed":"$fns.isChecked($onValue, $value)",onClick:"$handlers.toggleValue()",disabled:"$disabled",class:"$classes.input",onBlur:"$handlers.blur"}}))),cc=Qd("multiToggle",(()=>({bind:"$attrs",$el:"button",attrs:{type:"button",id:"$id+'_'+$index","aria-label":"$label","aria-pressed":"$fns.isChecked($option, $value)",onClick:"$handlers.toggleValue($option)",class:"$classes.input",title:"$option.help",disabled:"$disabled || $option.disabled",onBlur:"$handlers.blur"}}))),uc=Qd("inputInner",(()=>({bind:"$attrs",$el:"span"}))),fc=Qd("options",(()=>({$el:"ul",attrs:{id:"$id","data-vertical":'$vertical && "true" || "false"',"aria-labelledby":"$id"}}))),vc=Qd("option",(()=>({$el:"li",for:["option","index","$options"],attrs:{key:"$option.value","data-index":"$index"}})));function hc(t,o){return o=(null==o?void 0:o.hasOwnProperty("__original"))?null==o?void 0:o.__original:null==o?void 0:o.value,t.props.multiple?!!Array.isArray(t.value)&&t.value.filter((t=>e.eq(t,o))).length>0:void 0!==o?e.eq(t.value,o):(t.props._isChecked=e.eq(t.value,t.props.onValue),t.props._isChecked)}const mc={schema:/* #__PURE__ */ec(/* #__PURE__ */U("$options",/* #__PURE__ */oc(/* #__PURE__ */pc("$label"),/* #__PURE__ */fc(/* #__PURE__ */vc(/* #__PURE__ */cc(/* #__PURE__ */U("$fns.isChecked($option) === true",/* #__PURE__ */uc("$slots.default || $slots.on || $option.onLabel || $option.label"),/* #__PURE__ */uc("$slots.default || $slots.off || $option.offLabel || $option.label")))))),/* #__PURE__ */oc(/* #__PURE__ */U("$label && ($slots.default || $slots.on || $onLabel)",/* #__PURE__ */pc("$label")),/* #__PURE__ */dc(/* #__PURE__ */ic("prefix"),/* #__PURE__ */nc(),/* #__PURE__ */U("$_isChecked === true",/* #__PURE__ */uc("$slots.default || $slots.on || $onLabel || $label"),/* #__PURE__ */uc("$slots.default || $slots.off || $offLabel || $label")),/* #__PURE__ */rc(),/* #__PURE__ */ic("suffix")))),/* #__PURE__ */sc("$help"),/* #__PURE__ */ac(/* #__PURE__ */lc("$message.value"))),type:"input",family:"button",props:["options"],features:[function(t){var o,n,r,s;t.addProps(["enforced","multiple","offLabel","offValue","disabled","onLabel","onValue","vertical","_isChecked"]),t.props._isChecked=!1,t.props.enforced=e.undefine(t.props.enforced),t.props.multiple=e.undefine(t.props.multiple),t.props.vertical=e.undefine(t.props.vertical),"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),null!==(o=(r=t.props).onValue)&&void 0!==o||(r.onValue=!0),null!==(n=(s=t.props).offValue)&&void 0!==n||(s.offValue=!1),t.on("created",(()=>{var o;t.props._isChecked=hc(t,null),t.props.options&&t.props.multiple&&t.input(null!==(o=t.value)&&void 0!==o?o:[],!1),t.context&&(t.context.fns.isChecked=e=>hc(t,e),t.context.handlers.toggleValue=o=>n=>function(t,o,n){if(n.preventDefault(),o=o?Se(o):o,t.props.options)if(t.props.multiple){const n=Array.isArray(t.value)?[...t.value]:[],r=n.findIndex((t=>e.eq(t,o)));r>-1&&(!t.props.enforced||n.length>1)?n.splice(r,1):-1===r&&n.push(o),t.input(n)}else e.eq(t.value,o)&&!t.props.enforced?t.input(void 0):t.input(o);else t.input(e.eq(t.value,t.props.onValue)?t.props.offValue:t.props.onValue)}(t,o,n))}))},o.options]},gc=/* #__PURE__ */K("ut"),{outer:$c,inner:bc,wrapper:yc,label:xc,prefix:wc,suffix:_c,help:kc,messages:Sc,message:Lc,icon:Ic}=/* #__PURE__ */W(gc),Dc=gc("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onBlur:"$handlers.unitBlur",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",inputmode:"decimal",placeholder:"$placeholder || $unitParts.unit",disabled:"$disabled","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto","aria-required":"$state.required || undefined"}}))),Ac={meter:{kilometer:.001,meter:1,centimeter:100,millimeter:1e3,mile:621371e-9,yard:1.09361,foot:3.28084,inch:39.3701,"mile-scandinavian":1e-4},kilometer:{kilometer:1,meter:1e3,centimeter:1e5,millimeter:1e6,mile:.621371,yard:1093.61,foot:3280.84,inch:39370.1,"mile-scandinavian":10},centimeter:{kilometer:1e-5,meter:.01,centimeter:1,millimeter:10,mile:62137e-10,yard:.0109361,foot:.0328084,inch:.393701,"mile-scandinavian":1e-6},millimeter:{kilometer:1e-6,meter:.001,centimeter:.1,millimeter:1,mile:6.21371e-7,yard:.00109361,foot:.00328084,inch:.0393701,"mile-scandinavian":1e-7},mile:{kilometer:1.60934,meter:1609.34,centimeter:160934,millimeter:1609340,mile:1,yard:1760,foot:5280,inch:63360,"mile-scandinavian":.160934},yard:{kilometer:9144e-7,meter:.9144,centimeter:91.44,millimeter:914.4,mile:568182e-9,yard:1,foot:3,inch:36,"mile-scandinavian":9144e-8},foot:{kilometer:3048e-7,meter:.3048,centimeter:30.48,millimeter:304.8,mile:189394e-9,yard:.333333,foot:1,inch:12,"mile-scandinavian":3048e-8},inch:{kilometer:254e-7,meter:.0254,centimeter:2.54,millimeter:25.4,mile:15783e-9,yard:.0277778,foot:.0833333,inch:1,"mile-scandinavian":254e-8},"mile-scandinavian":{kilometer:10,meter:1e4,centimeter:1e6,millimeter:1e7,mile:6.21371,yard:10936.1,foot:32808.4,inch:393701,"mile-scandinavian":1}},Cc={celsius:{celsius:e=>e,fahrenheit:e=>1.8*e+32},fahrenheit:{celsius:e=>5/9*(e-32),fahrenheit:e=>e}},Tc={acre:{acre:1,hectare:.404686},hectare:{acre:2.47105,hectare:1}},Ec={gram:{gram:1,kilogram:.001,ounce:.035274,pound:.00220462},kilogram:{gram:1e3,kilogram:1,ounce:35.274,pound:2.20462},ounce:{gram:28.3495,kilogram:.0283495,ounce:1,pound:.0625},pound:{gram:453.592,kilogram:.453592,ounce:16,pound:1},stone:{gram:6350.29,kilogram:6.35029,ounce:224,pound:14,stone:1}},Oc={liter:{liter:1,milliliter:1e3,gallon:.264172,"fluid-ounce":33.814},milliliter:{liter:.001,milliliter:1,gallon:264172e-9,"fluid-ounce":.033814},gallon:{liter:3.78541,milliliter:3785.41,gallon:1,"fluid-ounce":128},"fluid-ounce":{liter:.0295735,milliliter:29.5735,gallon:.0078125,"fluid-ounce":1}},Mc={day:{day:1,hour:24,microsecond:864e8,millisecond:864e5,minute:1440,month:.0328767,nanosecond:864e14,second:86400,week:.142857,year:.00273973},hour:{day:.0416667,hour:1,microsecond:36e8,millisecond:36e5,minute:60,month:.00136986,nanosecond:36e11,second:3600,week:.00595238,year:114155e-9},microsecond:{day:115741e-19,hour:277778e-18,microsecond:1,millisecond:.001,minute:1.66667e-8,month:380517e-24,nanosecond:1e3,second:1e-6,week:165344e-20,year:3171e-20},millisecond:{day:1.15741e-8,hour:2.77778e-7,microsecond:1e3,millisecond:1,minute:166667e-10,month:380517e-19,nanosecond:1e6,second:.001,week:165344e-16,year:3171e-16},minute:{day:694444e-9,hour:.0166667,microsecond:6e7,millisecond:6e4,minute:1,month:228311e-10,nanosecond:6e10,second:60,week:992063e-10,year:190132e-11},month:{day:30.4368,hour:730.484,microsecond:2628e12,millisecond:2628e9,minute:43800,month:1,nanosecond:2628e15,second:2628e6,week:4.34524,year:.0833333},nanosecond:{day:1.15741e-20,hour:277778e-24,microsecond:.001,millisecond:1e-6,minute:166667e-19,month:380517e-28,nanosecond:1,second:1e-9,week:165344e-26,year:3171e-26},second:{day:115741e-10,hour:277778e-9,microsecond:1e6,millisecond:1e3,minute:.0166667,month:380517e-16,nanosecond:1e9,second:1,week:1.65344e-8,year:3.171e-10},week:{day:7,hour:168,microsecond:6048e11,millisecond:6048e8,minute:10080,month:.230137,nanosecond:6048e14,second:604800,week:1,year:.0191781},year:{day:365,hour:8760,microsecond:3154e13,millisecond:3154e10,minute:525600,month:12,nanosecond:3154e16,second:3154e4,week:52.1429,year:1}},Vc={bit:{bit:1,byte:.125,kilobit:.001,kilobyte:125e-6,megabit:1e-6,megabyte:125e-9,gigabit:1e-9,gigabyte:1.25e-10,terabit:1e-12,terabyte:125e-15,petabyte:125e-18},byte:{bit:8,byte:1,kilobit:.008,kilobyte:.001,megabit:8e-6,megabyte:1e-6,gigabit:8e-9,gigabyte:1e-9,terabit:8e-12,terabyte:1e-12,petabyte:1e-15},kilobit:{bit:1e3,byte:125,kilobit:1,kilobyte:.125,megabit:.001,megabyte:125e-6,gigabit:1e-6,gigabyte:125e-9,terabit:1e-9,terabyte:1.25e-10,petabyte:125e-15},kilobyte:{bit:8e3,byte:1e3,kilobit:8,kilobyte:1,megabit:.008,megabyte:.001,gigabit:8e-6,gigabyte:1e-6,terabit:8e-9,terabyte:1e-9,petabyte:1e-12},megabit:{bit:1e6,byte:125e3,kilobit:1e3,kilobyte:125,megabit:1,megabyte:.125,gigabit:.001,gigabyte:125e-6,terabit:1e-6,terabyte:125e-9,petabyte:1.25e-10},megabyte:{bit:8e6,byte:1e6,kilobit:8e3,kilobyte:1e3,megabit:8,megabyte:1,gigabit:.008,gigabyte:.001,terabit:8e-6,terabyte:1e-6,petabyte:1e-9},gigabit:{bit:1e9,byte:125e6,kilobit:1e6,kilobyte:125e3,megabit:1e3,megabyte:125,gigabit:1,gigabyte:.125,terabit:.001,terabyte:125e-6,petabyte:125e-9},gigabyte:{bit:8e9,byte:1e9,kilobit:8e6,kilobyte:1e6,megabit:8e3,megabyte:1e3,gigabit:8,gigabyte:1,terabit:.008,terabyte:.001,petabyte:1e-6},terabit:{bit:1e12,byte:125e9,kilobit:1e9,kilobyte:125e6,megabit:1e6,megabyte:125e3,gigabit:1e3,gigabyte:125,terabit:1,terabyte:.125,petabyte:125e-6},terabyte:{bit:8e12,byte:1e12,kilobit:8e9,kilobyte:1e9,megabit:8e6,megabyte:1e6,gigabit:8e3,gigabyte:1e3,terabit:8,terabyte:1,petabyte:.001},petabyte:{bit:1e15,byte:125e12,kilobit:1e12,kilobyte:125e9,megabit:1e9,megabyte:125e6,gigabit:1e6,gigabyte:125e3,terabit:1e3,terabyte:125,petabyte:1}};function Fc(t){let o=!1;function n(e){var n,r,s;const i=(`${e}`.match(/\-/g)||[]).length%2==1;e=function(e){e=function(e){return e.replace(/[\u0660-\u0669\u06f0-\u06f9]/g,(e=>(15&e.charCodeAt(0)).toString()))}(`${e}`),isNaN(e)&&(e=e.split(t.props.unitParts.decimal).map((e=>e.replace(/[^0-9]/g,""))).join("."));if(e=e.replace(/[^0-9\.]/g,""),e.includes(".")){const o=e.split(".");0===t.props.decimals?e=o[0]:"currency"===t.props.type&&(o[1]=o[1].padEnd(p(),"0").slice(0,p()),e=o.join("."))}return e}(e);const d={};"unit"!==a()&&"decimal"!==a()||(d.minimumFractionDigits=e.includes(".")?1:0),d.maximumFractionDigits="currency"===t.props.type?p():t.props.decimals,t.props.minDecimals&&(d.minimumFractionDigits=t.props.minDecimals,e&&!e.includes(".")&&(e+=".".padEnd(t.props.minDecimals+1,"0"))),0===d.maximumFractionDigits&&e.includes(".")&&(e=e.split(".")[0]);let c="";if(!isNaN(e)&&""!==e.trim()&&(e=i?`-${e}`:e,t.props.max&&!isNaN(t.props.max)&&(e=Number(e)>t.props.max?`${t.props.max}`:e),t.props.min&&!isNaN(t.props.min)&&(e=Number(e)<t.props.min?`${t.props.min}`:e),e.includes(".")&&"currency"===t.props.type?e=e.split(".")[0].padStart(1,"0")+"."+(null!==(n=e.split(".")[1])&&void 0!==n?n:"0"):"currency"===t.props.type&&(d.maximumFractionDigits=null!==(r=d.minimumFractionDigits)&&void 0!==r?r:0),c=l(t.props.displayLocale,d).format(e),"unit"===t.props.type&&"."===e[e.length-1])){const o=c.lastIndexOf(t.props.unitParts.decimal);c=c.slice(0,o+1)+c.slice(o+2),e=e.slice(0,-1)}let u,f=e.split(".");"currency"===t.props.type&&(f=f[0]+(null!==(s=f[1])&&void 0!==s?s:"").padEnd(p(),"0"),f.length>1&&(f=f.replace(/^0+/,""),f=""!==e&&""===f?"0":f)),t.props.valueStore={number:e,integer:f,string:c},o=!0,t.props.valueStore&&(u=t.props.valueStore.hasOwnProperty(t.props.valueFormat)?t.props.valueStore[t.props.valueFormat]:t.props.valueStore.number),t.input(""===u?void 0:u).then((()=>(o=!1,Promise.resolve())))}function r(){e.whenAvailable(`${t.props.id}`,(e=>{var o,n;e instanceof HTMLInputElement&&(e.value=null!==(n=null===(o=t.props.valueStore)||void 0===o?void 0:o.string)&&void 0!==n?n:"")}),t.props.__root)}function s(){var e,o;const n=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`#${t.props.id}_inner input`);return null!==(o=null==n?void 0:n.value)&&void 0!==o?o:""}function a(){return t.props.currency?"currency":t.props.unit?"unit":"decimal"}function l(e,o={}){const n=a(),r=Object.assign({},{style:n,roundingMode:"trunc"},o);return"unit"===t.props.type&&(r.unitDisplay=t.props.unitDisplay),"currency"===t.props.type&&(r.currencyDisplay=t.props.currencyDisplay),r[n]=t.props[n],new Intl.NumberFormat(e,r)}function i(e,o){var n,r,a,l,i;const p=null===(n=t.props.__root)||void 0===n?void 0:n.querySelector(`#${t.props.id}_inner input`);if(!p)return;const d=(null!==(a=null===(r=t.props.unitParts.unit)||void 0===r?void 0:r.length)&&void 0!==a?a:0)+(null!==(i=null===(l=t.props.unitParts.literal)||void 0===l?void 0:l.length)&&void 0!==i?i:0);t.props.unitParts.unitLeft?e=Math.max(e,d):(e=Math.min(e,s().length-d),"insertText"===o&&0===e&&(e=1)),p.setSelectionRange(e,e)}function p(){return void 0!==t.props.decimals?t.props.decimals:void 0!==t.props.minDecimals&&t.props.minDecimals>t.props.unitParts.fractionLength?t.props.minDecimals:t.props.unitParts.fractionLength}t.props.valueStore=null,t.on("input",(({payload:e})=>{o||(n(e),r())})),t.context&&(t.context.handlers.init=(e=null)=>{var o;t.props.skipInit?t.props.skipInit=!1:function(){var e,o,n,r,s,a,i;t.props.skipInit=!0;const p=l(t.props.displayLocale).formatToParts(12345678.12345678);t.props.unitParts={decimal:null===(e=p.find((e=>"decimal"==e.type)))||void 0===e?void 0:e.value,group:null===(o=p.find((e=>"group"==e.type)))||void 0===o?void 0:o.value,unit:null===(n=p.find((e=>["unit","currency"].includes(e.type))))||void 0===n?void 0:n.value,unitLeft:["unit","currency"].includes(p[0].type),literal:null!==(s=null===(r=p.find((e=>"literal"==e.type)))||void 0===r?void 0:r.value)&&void 0!==s?s:"",fractionLength:null!==(i=null===(a=p.find((e=>"fraction"==e.type)))||void 0===a?void 0:a.value.length)&&void 0!==i?i:0}}();let s=null!==(o=null!=e?e:t._value)&&void 0!==o?o:"";t.props.valueStore?s=t.props.valueStore.number:"integer"===t.props.valueFormat&&(s=function(e){var t;return(parseFloat(`${e}`)/Math.pow(10,null!==(t=p())&&void 0!==t?t:0)).toString().replace(".",p())}(`${null!=s?s:""}`)),"unit"===t.props.type&&t.props.valueUnit&&t.props.unit&&t.props.valueUnit!==t.props.unit&&t.hook.input(((e,o)=>{const n=function(e,t,o){if(Ac[e]&&Ac[e][o])return t*Ac[e][o];if(Cc[e]&&Cc[e][o])return Cc[e][o](t);if(Tc[e]&&Tc[e][o])return t*Tc[e][o];if(Ec[e]&&Ec[e][o])return t*Ec[e][o];if(Oc[e]&&Oc[e][o])return t*Oc[e][o];if(Mc[e]&&Mc[e][o])return t*Mc[e][o];if(Vc[e]&&Vc[e][o])return t*Vc[e][o];throw new Error("Conversion not supported")}(t.props.unit,e,t.props.valueUnit);return isNaN(n)?o(e):o(+n.toFixed(Number(t.props.valueDecimals)||2))})),n(s),r()},t.context.handlers.handleBeforeInput=e=>{var o,r,s,a,l,p,d,c,u;if(!t.props.inExecCommand&&"insertLineBreak"!==e.inputType&&(e.preventDefault(),e.stopPropagation(),e.target instanceof HTMLInputElement)){const f=e.target,v=null!==(o=e.data)&&void 0!==o?o:"",h=null!==(r=e.target.value)&&void 0!==r?r:"",m=null!==(s=e.target.selectionStart)&&void 0!==s?s:0,g=null!==(a=e.target.selectionEnd)&&void 0!==a?a:0,$=g-m,b=h.indexOf(t.props.unitParts.decimal);let y=(null!==(l=e.target.selectionStart)&&void 0!==l?l:0)+(e.data?0:-1),x=h,w=1;if(h.includes(t.props.unitParts.decimal)&&v===t.props.unitParts.decimal)return v===t.props.unitParts.decimal&&(y=x.indexOf(t.props.unitParts.decimal)+1),void i(y);if(!(null===t.props.min||t.props.min<0||t.props.max<0)&&"-"===v)return;if(v.match(/[a-zA-Z]/))return;if(v===t.props.unitParts.decimal&&0===t.props.decimals)return;if("deleteByCut"===e.inputType&&$>0&&(x=x.slice(0,m)+x.slice(g),y=g),"insertFromPaste"===e.inputType){const t=null!==(p=e.data)&&void 0!==p?p:"";x=x.slice(0,m)+t+x.slice(g)}if("deleteContentBackward"===e.inputType&&h[m-1]===t.props.unitParts.group?(w+=1,y-=1):"deleteContentForward"===e.inputType&&h[m]===t.props.unitParts.group&&(w+=1,y+=1),-1!==b&&y>b&&"insertText"===e.inputType?x=function(e,t,o){return e.substring(0,t)+o+e.substring(t+o.length)}(x,y,null!==(d=e.data)&&void 0!==d?d:"0"):"insertText"===e.inputType?(y=g,x=x.slice(0,m)+e.data+x.slice(g)):"deleteContentForward"===e.inputType?(y+=2,x=0===$?x.slice(0,m)+x.slice(g+w):x.slice(0,m)+x.slice(g)):"deleteContentBackward"===e.inputType&&(y+=1,0===$?x=x.slice(0,Math.max(m-w,0))+x.slice(g):$>0&&(x=x.slice(0,m)+x.slice(g))),"deleteContentForward"===e.inputType&&h[m]===t.props.unitParts.decimal){const e=x.slice(m-1);x=x.slice(0,m),e.includes(t.props.unitParts.unit)&&(x+=" "+t.props.unitParts.unit)}else if("deleteContentBackward"===e.inputType&&h[m-1]===t.props.unitParts.decimal){const e=x.slice(m-1);x=x.slice(0,m-1),e.includes(t.props.unitParts.unit)&&(x+=" "+t.props.unitParts.unit)}if(n(x),x=(null===(c=t.props.valueStore)||void 0===c?void 0:c.string)||(null===(u=t.props.valueStore)||void 0===u?void 0:u.number)||"",y=x.length-h.length+y,x.length===h.length&&y>b&&(y+=e.inputType.includes("delete")?-1:1),f.setSelectionRange(0,h.length),t.props.inExecCommand=!0,document.execCommand("insertText",void 0,x),t.props.inExecCommand=!1,v===t.props.unitParts.decimal?y=x.indexOf(t.props.unitParts.decimal)+1:h.includes(t.props.unitParts.decimal)&&!x.includes(t.props.unitParts.decimal)&&(y=x.length),"insertText"===e.inputType&&t.props.minDecimals&&(!t.value||0===m&&g===h.length||-1===b&&t.props.minDecimals&&h)){let e=0;e=t.props.unitParts.unit?t.props.unitParts.unit.length+1:0,y-=t.props.minDecimals,t.props.unitParts.unitLeft?y-=e-1:y-=e+1}i(Math.max(0,y),e.inputType)}},t.context.handlers.handleInput=e=>{t.emit("dom-input-event",e),e.target instanceof HTMLInputElement&&(t.props.inputText=e.target.value,n(e.target.value))},t.context.handlers.handleKeyDown=e=>{var o,a;if(e.target instanceof HTMLInputElement&&("ArrowUp"===e.key||"ArrowDown"===e.key)){const l="ArrowUp"===e.key?1*t.props.step:-1*t.props.step;n(function(e,t){var o,n,r,s;const a=`${e}`.split("."),l=`${t}`.split(".");let i=null!==(o=a[0])&&void 0!==o?o:"0",p=null!==(n=l[0])&&void 0!==n?n:"0";const d=null!==(r=a[1])&&void 0!==r?r:"",c=null!==(s=l[1])&&void 0!==s?s:"",u=Math.max(d.length,c.length);u>0&&(i+=d.padEnd(u,"0"),p+=c.padEnd(u,"0"));const f=BigInt(BigInt(i)+BigInt(p)).toString();return u>0?f.slice(0,-1*u)+"."+f.slice(-1*u):f}(null!==(a=null===(o=t.props.valueStore)||void 0===o?void 0:o.number)&&void 0!==a?a:0,l)),r(),setTimeout((()=>{i(s().length)}),1)}})}const Pc={schema:/* #__PURE__ */$c(/* #__PURE__ */yc(/* #__PURE__ */xc("$label"),/* #__PURE__ */bc(/* #__PURE__ */Ic("prefix"),/* #__PURE__ */wc(),/* #__PURE__ */Dc(),/* #__PURE__ */_c(),/* #__PURE__ */Ic("suffix"))),/* #__PURE__ */kc("$help"),/* #__PURE__ */Sc(/* #__PURE__ */Lc("$message.value"))),type:"input",family:"text",features:[function(e){var t,o,n,r,s,a;const l=["unit","decimals","minDecimals","displayLocale","min","max","step","valueFormat","unitDisplay","placeholder","unitParts","valueUnit","valueDecimals"];e.addProps(l),null!==(t=(r=e.props).displayLocale)&&void 0!==t||(r.displayLocale=e.props.locale||"en-US"),e.props.unitDisplay=e.props.unitDisplay||"short","false"===e.props.decimals||!1===e.props.decimals?e.props.decimals=0:void 0!==e.props.decimals?e.props.decimals=Number(e.props.decimals):e.props.decimals=2,e.props.minDecimals=void 0!==e.props.minDecimals?Number(e.props.minDecimals):void 0,void 0!==e.props.min&&(e.props.min=Number(e.props.min)),void 0!==e.props.max&&(e.props.max=Number(e.props.max)),null!==(o=(s=e.props).step)&&void 0!==o||(s.step=1),null!==(n=(a=e.props).valueFormat)&&void 0!==n||(a.valueFormat="number"),-1===["string","number"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(e.context.handlers.unitBlur=t=>{if(!(t.target instanceof HTMLInputElement))return;let o=t.target.value;(function(e){e=e.trim();const t=/\d+\,\s*%?$/;return/\d+\.\s*%?$/.test(e)||t.test(e)})(o)&&(o=o.replace(e.props.unitParts.decimal,""),t.target.value=o),e.context&&e.context.handlers.blur(t)},Fc(e),e.context.handlers.init(),l.forEach((t=>{e.on(`prop:${t}`,(()=>{var t;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init()}))})))}))}]},Bc=/* #__PURE__ */K("cr"),{outer:Hc,inner:Rc,wrapper:Nc,label:Kc,prefix:Wc,suffix:qc,help:Uc,messages:zc,message:Yc,icon:jc}=/* #__PURE__ */W(Bc),Zc=Bc("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onBlur:"$handlers.blur",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",disabled:"$disabled",placeholder:"$placeholder || $unitParts.unit",inputmode:"decimal","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto","aria-required":"$state.required || undefined"}})));const Gc={schema:/* #__PURE__ */Hc(/* #__PURE__ */Nc(/* #__PURE__ */Kc("$label"),/* #__PURE__ */Rc(/* #__PURE__ */jc("prefix"),/* #__PURE__ */Wc(),/* #__PURE__ */Zc(),/* #__PURE__ */qc(),/* #__PURE__ */jc("suffix"))),/* #__PURE__ */Uc("$help"),/* #__PURE__ */zc(/* #__PURE__ */Yc("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,i;const p=["currency","decimals","maxDecimals","minDecimals","displayLocale","min","max","step","valueFormat","currencyDisplay","placeholder","unitParts"];e.addProps(p),e.addProps(["inputText"]),null!==(t=(s=e.props).displayLocale)&&void 0!==t||(s.displayLocale=e.props.locale||"en-US"),null!==(o=(a=e.props).currency)&&void 0!==o||(a.currency=e.props.currency||"USD"),"false"===e.props.decimals||!1===e.props.decimals?e.props.decimals=0:void 0!==e.props.decimals&&(e.props.decimals=Number(e.props.decimals)),e.props.minDecimals=void 0!==e.props.minDecimals?Number(e.props.minDecimals):void 0,void 0!==e.props.min&&(e.props.min=Number(e.props.min)),void 0!==e.props.max&&(e.props.max=Number(e.props.max)),null!==(n=(l=e.props).step)&&void 0!==n||(l.step=1),null!==(r=(i=e.props).valueFormat)&&void 0!==r||(i.valueFormat="number"),-1===["string","number","integer"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(Fc(e),e.context.handlers.init(),p.forEach((t=>{e.on(`prop:${t}`,(()=>{var t;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init()}))})))}))}]};var Xc=/*#__PURE__*/Object.freeze({__proto__:null,autocomplete:br,colorpicker:Jd,currency:Gc,datepicker:ul,dropdown:Zt,mask:si,rating:Mn,repeater:jo,slider:Yp,taglist:Vl,toggle:mo,togglebuttons:mc,transferlist:hp,unit:Pc});const Jc="undefined"!=typeof window?setInterval:()=>0,Qc=new WeakSet;exports.$if=U,exports.autocomplete=br,exports.colorpicker=Jd,exports.createBaseSections=W,exports.createProPlugin=function(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(Qc.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:h(13919),children:`${h(451228594)}${h(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){k[e]?k[e].add(t):k[e]=new Set([t])}(e,o)}}return function(e){const t=()=>{throw new Error(`InvalidFormKitKey ${e}`)};if(!/^fk-/i.test(e))return t();const o=e.substring(3);if(!d.test(o))return t();const n=parseInt(o,16).toString(),r=Number(n[0])<6?Number(n[0]):6,s=n.substring(r,r+(n.length-6)),a=n.substring(0,r)+n.substring(r+s.length),l=a.slice(0,2),i=`${a[a.length-1]}${a[0]}`;Number(s)!==Math.floor(Number(a)*Number(l)/Number(i))&&t()}(o),n.library=o=>{if(o.props.type in t){const{schema:n,...r}=t[o.props.type];Qc.add(o),o.define({...r,schema:n(e)})}Jc((()=>b.has(e)&&o.emit(952679114..toString(32))),4e3)},n}catch(r){throw r instanceof Error&&function(e){if("FormKitNoKey"===e.message)throw new Error("A FormKit API key is required, please visit https://formkit.com/pro")}(r),r}},exports.createSectionFactory=K,exports.currency=Gc,exports.datepicker=ul,exports.dropdown=Zt,exports.inputs=Xc,exports.mask=si,exports.rating=Mn,exports.repeater=jo,exports.slider=Yp,exports.taglist=Vl,exports.toggle=mo,exports.togglebuttons=mc,exports.transferlist=hp,exports.unit=Pc;
65
+ /* #__PURE__ */o.localize("next")]},ac=/* #__PURE__ */K("tb"),{outer:lc,inner:ic,wrapper:pc,prefix:dc,suffix:cc,help:uc,messages:fc,message:vc,icon:hc}=/* #__PURE__ */W(ac),mc=ac("label",()=>({if:"$label",$el:"label",attrs:{id:"$id + '_label'"}})),gc=ac("singleToggle",()=>({bind:"$attrs",$el:"button",attrs:{id:"$id",type:"button","aria-label":"$label","aria-pressed":"$fns.isChecked($onValue, $value)",onClick:"$handlers.toggleValue()",disabled:"$disabled",class:"$classes.input",onBlur:"$handlers.blur"}})),$c=ac("multiToggle",()=>({bind:"$attrs",$el:"button",attrs:{type:"button",id:"$id+'_'+$index","aria-label":"$label","aria-pressed":"$fns.isChecked($option, $value)",onClick:"$handlers.toggleValue($option)",class:"$classes.input",title:"$option.help",disabled:"$disabled || $option.disabled",onBlur:"$handlers.blur"}})),bc=ac("inputInner",()=>({bind:"$attrs",$el:"span"})),yc=ac("options",()=>({$el:"ul",attrs:{id:"$id","data-vertical":'$vertical && "true" || "false"',"aria-labelledby":"$id"}})),xc=ac("option",()=>({$el:"li",for:["option","index","$options"],attrs:{key:"$option.value","data-index":"$index"}}));function wc(t,o){return o=(null==o?void 0:o.hasOwnProperty("__original"))?null==o?void 0:o.__original:null==o?void 0:o.value,t.props.multiple?!!Array.isArray(t.value)&&t.value.filter(t=>e.eq(t,o)).length>0:void 0!==o?e.eq(t.value,o):(t.props._isChecked=e.eq(t.value,t.props.onValue),t.props._isChecked)}const _c={schema:/* #__PURE__ */lc(/* #__PURE__ */z("$options",/* #__PURE__ */pc(/* #__PURE__ */mc("$label"),/* #__PURE__ */yc(/* #__PURE__ */xc(/* #__PURE__ */$c(/* #__PURE__ */z("$fns.isChecked($option) === true",/* #__PURE__ */bc("$slots.default || $slots.on || $option.onLabel || $option.label"),/* #__PURE__ */bc("$slots.default || $slots.off || $option.offLabel || $option.label")))))),/* #__PURE__ */pc(/* #__PURE__ */z("$label && ($slots.default || $slots.on || $onLabel)",/* #__PURE__ */mc("$label")),/* #__PURE__ */gc(/* #__PURE__ */hc("prefix"),/* #__PURE__ */dc(),/* #__PURE__ */z("$_isChecked === true",/* #__PURE__ */bc("$slots.default || $slots.on || $onLabel || $label"),/* #__PURE__ */bc("$slots.default || $slots.off || $offLabel || $label")),/* #__PURE__ */cc(),/* #__PURE__ */hc("suffix")))),/* #__PURE__ */uc("$help"),/* #__PURE__ */fc(/* #__PURE__ */vc("$message.value"))),type:"input",family:"button",props:["options"],features:[function(t){var o,n,r,s;t.addProps(["enforced","multiple","offLabel","offValue","disabled","onLabel","onValue","vertical","_isChecked"]),t.props._isChecked=!1,t.props.enforced=e.undefine(t.props.enforced),t.props.multiple=e.undefine(t.props.multiple),t.props.vertical=e.undefine(t.props.vertical),"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),null!==(o=(r=t.props).onValue)&&void 0!==o||(r.onValue=!0),null!==(n=(s=t.props).offValue)&&void 0!==n||(s.offValue=!1),t.on("created",()=>{var o;t.props._isChecked=wc(t,null),t.props.options&&t.props.multiple&&t.input(null!==(o=t.value)&&void 0!==o?o:[],!1),t.context&&(t.context.fns.isChecked=e=>wc(t,e),t.context.handlers.toggleValue=o=>n=>function(t,o,n){if(n.preventDefault(),o=o?Se(o):o,t.props.options)if(t.props.multiple){const n=Array.isArray(t.value)?[...t.value]:[],r=n.findIndex(t=>e.eq(t,o));r>-1&&(!t.props.enforced||n.length>1)?n.splice(r,1):-1===r&&n.push(o),t.input(n)}else e.eq(t.value,o)&&!t.props.enforced?t.input(void 0):t.input(o);else t.input(e.eq(t.value,t.props.onValue)?t.props.offValue:t.props.onValue)}(t,o,n))})},o.options]},kc=/* #__PURE__ */K("ut"),{outer:Sc,inner:Lc,wrapper:Ic,label:Dc,prefix:Ac,suffix:Cc,help:Tc,messages:Ec,message:Oc,icon:Mc}=/* #__PURE__ */W(kc),Vc=kc("input",()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onBlur:"$handlers.unitBlur",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",inputmode:"decimal",placeholder:"$placeholder || $unitParts.unit",disabled:"$disabled","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto","aria-required":"$state.required || undefined"}})),Fc={meter:{kilometer:.001,meter:1,centimeter:100,millimeter:1e3,mile:621371e-9,yard:1.09361,foot:3.28084,inch:39.3701,"mile-scandinavian":1e-4},kilometer:{kilometer:1,meter:1e3,centimeter:1e5,millimeter:1e6,mile:.621371,yard:1093.61,foot:3280.84,inch:39370.1,"mile-scandinavian":10},centimeter:{kilometer:1e-5,meter:.01,centimeter:1,millimeter:10,mile:62137e-10,yard:.0109361,foot:.0328084,inch:.393701,"mile-scandinavian":1e-6},millimeter:{kilometer:1e-6,meter:.001,centimeter:.1,millimeter:1,mile:6.21371e-7,yard:.00109361,foot:.00328084,inch:.0393701,"mile-scandinavian":1e-7},mile:{kilometer:1.60934,meter:1609.34,centimeter:160934,millimeter:1609340,mile:1,yard:1760,foot:5280,inch:63360,"mile-scandinavian":.160934},yard:{kilometer:9144e-7,meter:.9144,centimeter:91.44,millimeter:914.4,mile:568182e-9,yard:1,foot:3,inch:36,"mile-scandinavian":9144e-8},foot:{kilometer:3048e-7,meter:.3048,centimeter:30.48,millimeter:304.8,mile:189394e-9,yard:.333333,foot:1,inch:12,"mile-scandinavian":3048e-8},inch:{kilometer:254e-7,meter:.0254,centimeter:2.54,millimeter:25.4,mile:15783e-9,yard:.0277778,foot:.0833333,inch:1,"mile-scandinavian":254e-8},"mile-scandinavian":{kilometer:10,meter:1e4,centimeter:1e6,millimeter:1e7,mile:6.21371,yard:10936.1,foot:32808.4,inch:393701,"mile-scandinavian":1}},Pc={celsius:{celsius:e=>e,fahrenheit:e=>1.8*e+32},fahrenheit:{celsius:e=>5/9*(e-32),fahrenheit:e=>e}},Bc={acre:{acre:1,hectare:.404686},hectare:{acre:2.47105,hectare:1}},Hc={gram:{gram:1,kilogram:.001,ounce:.035274,pound:.00220462},kilogram:{gram:1e3,kilogram:1,ounce:35.274,pound:2.20462},ounce:{gram:28.3495,kilogram:.0283495,ounce:1,pound:.0625},pound:{gram:453.592,kilogram:.453592,ounce:16,pound:1},stone:{gram:6350.29,kilogram:6.35029,ounce:224,pound:14,stone:1}},Rc={liter:{liter:1,milliliter:1e3,gallon:.264172,"fluid-ounce":33.814},milliliter:{liter:.001,milliliter:1,gallon:264172e-9,"fluid-ounce":.033814},gallon:{liter:3.78541,milliliter:3785.41,gallon:1,"fluid-ounce":128},"fluid-ounce":{liter:.0295735,milliliter:29.5735,gallon:.0078125,"fluid-ounce":1}},Nc={day:{day:1,hour:24,microsecond:864e8,millisecond:864e5,minute:1440,month:.0328767,nanosecond:864e14,second:86400,week:.142857,year:.00273973},hour:{day:.0416667,hour:1,microsecond:36e8,millisecond:36e5,minute:60,month:.00136986,nanosecond:36e11,second:3600,week:.00595238,year:114155e-9},microsecond:{day:115741e-19,hour:277778e-18,microsecond:1,millisecond:.001,minute:1.66667e-8,month:380517e-24,nanosecond:1e3,second:1e-6,week:165344e-20,year:3171e-20},millisecond:{day:1.15741e-8,hour:2.77778e-7,microsecond:1e3,millisecond:1,minute:166667e-10,month:380517e-19,nanosecond:1e6,second:.001,week:165344e-16,year:3171e-16},minute:{day:694444e-9,hour:.0166667,microsecond:6e7,millisecond:6e4,minute:1,month:228311e-10,nanosecond:6e10,second:60,week:992063e-10,year:190132e-11},month:{day:30.4368,hour:730.484,microsecond:2628e12,millisecond:2628e9,minute:43800,month:1,nanosecond:2628e15,second:2628e6,week:4.34524,year:.0833333},nanosecond:{day:1.15741e-20,hour:277778e-24,microsecond:.001,millisecond:1e-6,minute:166667e-19,month:380517e-28,nanosecond:1,second:1e-9,week:165344e-26,year:3171e-26},second:{day:115741e-10,hour:277778e-9,microsecond:1e6,millisecond:1e3,minute:.0166667,month:380517e-16,nanosecond:1e9,second:1,week:1.65344e-8,year:3.171e-10},week:{day:7,hour:168,microsecond:6048e11,millisecond:6048e8,minute:10080,month:.230137,nanosecond:6048e14,second:604800,week:1,year:.0191781},year:{day:365,hour:8760,microsecond:3154e13,millisecond:3154e10,minute:525600,month:12,nanosecond:3154e16,second:3154e4,week:52.1429,year:1}},Kc={bit:{bit:1,byte:.125,kilobit:.001,kilobyte:125e-6,megabit:1e-6,megabyte:125e-9,gigabit:1e-9,gigabyte:1.25e-10,terabit:1e-12,terabyte:125e-15,petabyte:125e-18},byte:{bit:8,byte:1,kilobit:.008,kilobyte:.001,megabit:8e-6,megabyte:1e-6,gigabit:8e-9,gigabyte:1e-9,terabit:8e-12,terabyte:1e-12,petabyte:1e-15},kilobit:{bit:1e3,byte:125,kilobit:1,kilobyte:.125,megabit:.001,megabyte:125e-6,gigabit:1e-6,gigabyte:125e-9,terabit:1e-9,terabyte:1.25e-10,petabyte:125e-15},kilobyte:{bit:8e3,byte:1e3,kilobit:8,kilobyte:1,megabit:.008,megabyte:.001,gigabit:8e-6,gigabyte:1e-6,terabit:8e-9,terabyte:1e-9,petabyte:1e-12},megabit:{bit:1e6,byte:125e3,kilobit:1e3,kilobyte:125,megabit:1,megabyte:.125,gigabit:.001,gigabyte:125e-6,terabit:1e-6,terabyte:125e-9,petabyte:1.25e-10},megabyte:{bit:8e6,byte:1e6,kilobit:8e3,kilobyte:1e3,megabit:8,megabyte:1,gigabit:.008,gigabyte:.001,terabit:8e-6,terabyte:1e-6,petabyte:1e-9},gigabit:{bit:1e9,byte:125e6,kilobit:1e6,kilobyte:125e3,megabit:1e3,megabyte:125,gigabit:1,gigabyte:.125,terabit:.001,terabyte:125e-6,petabyte:125e-9},gigabyte:{bit:8e9,byte:1e9,kilobit:8e6,kilobyte:1e6,megabit:8e3,megabyte:1e3,gigabit:8,gigabyte:1,terabit:.008,terabyte:.001,petabyte:1e-6},terabit:{bit:1e12,byte:125e9,kilobit:1e9,kilobyte:125e6,megabit:1e6,megabyte:125e3,gigabit:1e3,gigabyte:125,terabit:1,terabyte:.125,petabyte:125e-6},terabyte:{bit:8e12,byte:1e12,kilobit:8e9,kilobyte:1e9,megabit:8e6,megabyte:1e6,gigabit:8e3,gigabyte:1e3,terabit:8,terabyte:1,petabyte:.001},petabyte:{bit:1e15,byte:125e12,kilobit:1e12,kilobyte:125e9,megabit:1e9,megabyte:125e6,gigabit:1e6,gigabyte:125e3,terabit:1e3,terabyte:125,petabyte:1}};function Wc(t){let o=!1;function n(e){var n,r,s;const i=(`${e}`.match(/\-/g)||[]).length%2==1;e=function(e){e=function(e){return e.replace(/[\u0660-\u0669\u06f0-\u06f9]/g,e=>(15&e.charCodeAt(0)).toString())}(`${e}`),isNaN(e)&&(e=e.split(t.props.unitParts.decimal).map(e=>e.replace(/[^0-9]/g,"")).join("."));if(e=e.replace(/[^0-9\.]/g,""),e.includes(".")){const o=e.split(".");0===t.props.decimals?e=o[0]:"currency"===t.props.type&&(o[1]=o[1].padEnd(p(),"0").slice(0,p()),e=o.join("."))}return e}(e);const d={};"unit"!==a()&&"decimal"!==a()||(d.minimumFractionDigits=e.includes(".")?1:0),d.maximumFractionDigits="currency"===t.props.type?p():t.props.decimals,t.props.minDecimals&&(d.minimumFractionDigits=t.props.minDecimals,e&&!e.includes(".")&&(e+=".".padEnd(t.props.minDecimals+1,"0"))),0===d.maximumFractionDigits&&e.includes(".")&&(e=e.split(".")[0]);let c="";if(!isNaN(e)&&""!==e.trim()&&(e=i?`-${e}`:e,t.props.max&&!isNaN(t.props.max)&&(e=Number(e)>t.props.max?`${t.props.max}`:e),t.props.min&&!isNaN(t.props.min)&&(e=Number(e)<t.props.min?`${t.props.min}`:e),e.includes(".")&&"currency"===t.props.type?e=e.split(".")[0].padStart(1,"0")+"."+(null!==(n=e.split(".")[1])&&void 0!==n?n:"0"):"currency"===t.props.type&&(d.maximumFractionDigits=null!==(r=d.minimumFractionDigits)&&void 0!==r?r:0),c=l(t.props.displayLocale,d).format(e),"unit"===t.props.type&&"."===e[e.length-1])){const o=c.lastIndexOf(t.props.unitParts.decimal);c=c.slice(0,o+1)+c.slice(o+2),e=e.slice(0,-1)}let u,f=e.split(".");"currency"===t.props.type&&(f=f[0]+(null!==(s=f[1])&&void 0!==s?s:"").padEnd(p(),"0"),f.length>1&&(f=f.replace(/^0+/,""),f=""!==e&&""===f?"0":f)),t.props.valueStore={number:e,integer:f,string:c},o=!0,t.props.valueStore&&(u=t.props.valueStore.hasOwnProperty(t.props.valueFormat)?t.props.valueStore[t.props.valueFormat]:t.props.valueStore.number),t.input(""===u?void 0:u).then(()=>(o=!1,Promise.resolve()))}function r(){e.whenAvailable(`${t.props.id}`,e=>{var o,n;e instanceof HTMLInputElement&&(e.value=null!==(n=null===(o=t.props.valueStore)||void 0===o?void 0:o.string)&&void 0!==n?n:"")},t.props.__root)}function s(){var e,o;const n=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`#${t.props.id}_inner input`);return null!==(o=null==n?void 0:n.value)&&void 0!==o?o:""}function a(){return t.props.currency?"currency":t.props.unit?"unit":"decimal"}function l(e,o={}){const n=a(),r=Object.assign({},{style:n,roundingMode:"trunc"},o);return"unit"===t.props.type&&(r.unitDisplay=t.props.unitDisplay),"currency"===t.props.type&&(r.currencyDisplay=t.props.currencyDisplay),r[n]=t.props[n],new Intl.NumberFormat(e,r)}function i(e,o){var n,r,a,l,i;const p=null===(n=t.props.__root)||void 0===n?void 0:n.querySelector(`#${t.props.id}_inner input`);if(!p)return;const d=(null!==(a=null===(r=t.props.unitParts.unit)||void 0===r?void 0:r.length)&&void 0!==a?a:0)+(null!==(i=null===(l=t.props.unitParts.literal)||void 0===l?void 0:l.length)&&void 0!==i?i:0);t.props.unitParts.unitLeft?e=Math.max(e,d):(e=Math.min(e,s().length-d),"insertText"===o&&0===e&&(e=1)),p.setSelectionRange(e,e)}function p(){return void 0!==t.props.decimals?t.props.decimals:void 0!==t.props.minDecimals&&t.props.minDecimals>t.props.unitParts.fractionLength?t.props.minDecimals:t.props.unitParts.fractionLength}t.props.valueStore=null,t.on("input",({payload:e})=>{o||(n(e),r())}),t.context&&(t.context.handlers.init=(e=null)=>{var o;t.props.skipInit?t.props.skipInit=!1:function(){var e,o,n,r,s,a,i;t.props.skipInit=!0;const p=l(t.props.displayLocale).formatToParts(12345678.12345678);t.props.unitParts={decimal:null===(e=p.find(e=>"decimal"==e.type))||void 0===e?void 0:e.value,group:null===(o=p.find(e=>"group"==e.type))||void 0===o?void 0:o.value,unit:null===(n=p.find(e=>["unit","currency"].includes(e.type)))||void 0===n?void 0:n.value,unitLeft:["unit","currency"].includes(p[0].type),literal:null!==(s=null===(r=p.find(e=>"literal"==e.type))||void 0===r?void 0:r.value)&&void 0!==s?s:"",fractionLength:null!==(i=null===(a=p.find(e=>"fraction"==e.type))||void 0===a?void 0:a.value.length)&&void 0!==i?i:0}}();let s=null!==(o=null!=e?e:t._value)&&void 0!==o?o:"";t.props.valueStore?s=t.props.valueStore.number:"integer"===t.props.valueFormat&&(s=function(e){var t;return(parseFloat(`${e}`)/Math.pow(10,null!==(t=p())&&void 0!==t?t:0)).toString().replace(".",p())}(`${null!=s?s:""}`)),"unit"===t.props.type&&t.props.valueUnit&&t.props.unit&&t.props.valueUnit!==t.props.unit&&t.hook.input((e,o)=>{const n=function(e,t,o){if(Fc[e]&&Fc[e][o])return t*Fc[e][o];if(Pc[e]&&Pc[e][o])return Pc[e][o](t);if(Bc[e]&&Bc[e][o])return t*Bc[e][o];if(Hc[e]&&Hc[e][o])return t*Hc[e][o];if(Rc[e]&&Rc[e][o])return t*Rc[e][o];if(Nc[e]&&Nc[e][o])return t*Nc[e][o];if(Kc[e]&&Kc[e][o])return t*Kc[e][o];throw new Error("Conversion not supported")}(t.props.unit,e,t.props.valueUnit);return isNaN(n)?o(e):o(+n.toFixed(Number(t.props.valueDecimals)||2))}),n(s),r()},t.context.handlers.handleBeforeInput=e=>{var o,r,s,a,l,p,d,c,u;if(!t.props.inExecCommand&&"insertLineBreak"!==e.inputType&&(e.preventDefault(),e.stopPropagation(),e.target instanceof HTMLInputElement)){const f=e.target,v=null!==(o=e.data)&&void 0!==o?o:"",h=null!==(r=e.target.value)&&void 0!==r?r:"",m=null!==(s=e.target.selectionStart)&&void 0!==s?s:0,g=null!==(a=e.target.selectionEnd)&&void 0!==a?a:0,$=g-m,b=h.indexOf(t.props.unitParts.decimal);let y=(null!==(l=e.target.selectionStart)&&void 0!==l?l:0)+(e.data?0:-1),x=h,w=1;if(h.includes(t.props.unitParts.decimal)&&v===t.props.unitParts.decimal)return v===t.props.unitParts.decimal&&(y=x.indexOf(t.props.unitParts.decimal)+1),void i(y);if(!(null===t.props.min||t.props.min<0||t.props.max<0)&&"-"===v)return;if(v.match(/[a-zA-Z]/))return;if(v===t.props.unitParts.decimal&&0===t.props.decimals)return;if("deleteByCut"===e.inputType&&$>0&&(x=x.slice(0,m)+x.slice(g),y=g),"insertFromPaste"===e.inputType){const t=null!==(p=e.data)&&void 0!==p?p:"";x=x.slice(0,m)+t+x.slice(g)}if("deleteContentBackward"===e.inputType&&h[m-1]===t.props.unitParts.group?(w+=1,y-=1):"deleteContentForward"===e.inputType&&h[m]===t.props.unitParts.group&&(w+=1,y+=1),-1!==b&&y>b&&"insertText"===e.inputType?x=function(e,t,o){return e.substring(0,t)+o+e.substring(t+o.length)}(x,y,null!==(d=e.data)&&void 0!==d?d:"0"):"insertText"===e.inputType?(y=g,x=x.slice(0,m)+e.data+x.slice(g)):"deleteContentForward"===e.inputType?(y+=2,x=0===$?x.slice(0,m)+x.slice(g+w):x.slice(0,m)+x.slice(g)):"deleteContentBackward"===e.inputType&&(y+=1,0===$?x=x.slice(0,Math.max(m-w,0))+x.slice(g):$>0&&(x=x.slice(0,m)+x.slice(g))),"deleteContentForward"===e.inputType&&h[m]===t.props.unitParts.decimal){const e=x.slice(m-1);x=x.slice(0,m),e.includes(t.props.unitParts.unit)&&(x+=" "+t.props.unitParts.unit)}else if("deleteContentBackward"===e.inputType&&h[m-1]===t.props.unitParts.decimal){const e=x.slice(m-1);x=x.slice(0,m-1),e.includes(t.props.unitParts.unit)&&(x+=" "+t.props.unitParts.unit)}if(n(x),x=(null===(c=t.props.valueStore)||void 0===c?void 0:c.string)||(null===(u=t.props.valueStore)||void 0===u?void 0:u.number)||"",y=x.length-h.length+y,x.length===h.length&&y>b&&(y+=e.inputType.includes("delete")?-1:1),f.setSelectionRange(0,h.length),t.props.inExecCommand=!0,document.execCommand("insertText",void 0,x),t.props.inExecCommand=!1,v===t.props.unitParts.decimal?y=x.indexOf(t.props.unitParts.decimal)+1:h.includes(t.props.unitParts.decimal)&&!x.includes(t.props.unitParts.decimal)&&(y=x.length),"insertText"===e.inputType&&t.props.minDecimals&&(!t.value||0===m&&g===h.length||-1===b&&t.props.minDecimals&&h)){let e=0;e=t.props.unitParts.unit?t.props.unitParts.unit.length+1:0,y-=t.props.minDecimals,t.props.unitParts.unitLeft?y-=e-1:y-=e+1}i(Math.max(0,y),e.inputType)}},t.context.handlers.handleInput=e=>{t.emit("dom-input-event",e),e.target instanceof HTMLInputElement&&(t.props.inputText=e.target.value,n(e.target.value))},t.context.handlers.handleKeyDown=e=>{var o,a;if(e.target instanceof HTMLInputElement&&("ArrowUp"===e.key||"ArrowDown"===e.key)){const l="ArrowUp"===e.key?1*t.props.step:-1*t.props.step;n(function(e,t){var o,n,r,s;const a=`${e}`.split("."),l=`${t}`.split(".");let i=null!==(o=a[0])&&void 0!==o?o:"0",p=null!==(n=l[0])&&void 0!==n?n:"0";const d=null!==(r=a[1])&&void 0!==r?r:"",c=null!==(s=l[1])&&void 0!==s?s:"",u=Math.max(d.length,c.length);u>0&&(i+=d.padEnd(u,"0"),p+=c.padEnd(u,"0"));const f=BigInt(BigInt(i)+BigInt(p)).toString();return u>0?f.slice(0,-1*u)+"."+f.slice(-1*u):f}(null!==(a=null===(o=t.props.valueStore)||void 0===o?void 0:o.number)&&void 0!==a?a:0,l)),r(),setTimeout(()=>{i(s().length)},1)}})}const qc={schema:/* #__PURE__ */Sc(/* #__PURE__ */Ic(/* #__PURE__ */Dc("$label"),/* #__PURE__ */Lc(/* #__PURE__ */Mc("prefix"),/* #__PURE__ */Ac(),/* #__PURE__ */Vc(),/* #__PURE__ */Cc(),/* #__PURE__ */Mc("suffix"))),/* #__PURE__ */Tc("$help"),/* #__PURE__ */Ec(/* #__PURE__ */Oc("$message.value"))),type:"input",family:"text",features:[function(e){var t,o,n,r,s,a;const l=["unit","decimals","minDecimals","displayLocale","min","max","step","valueFormat","unitDisplay","placeholder","unitParts","valueUnit","valueDecimals"];e.addProps(l),null!==(t=(r=e.props).displayLocale)&&void 0!==t||(r.displayLocale=e.props.locale||"en-US"),e.props.unitDisplay=e.props.unitDisplay||"short","false"===e.props.decimals||!1===e.props.decimals?e.props.decimals=0:void 0!==e.props.decimals?e.props.decimals=Number(e.props.decimals):e.props.decimals=2,e.props.minDecimals=void 0!==e.props.minDecimals?Number(e.props.minDecimals):void 0,void 0!==e.props.min&&(e.props.min=Number(e.props.min)),void 0!==e.props.max&&(e.props.max=Number(e.props.max)),null!==(o=(s=e.props).step)&&void 0!==o||(s.step=1),null!==(n=(a=e.props).valueFormat)&&void 0!==n||(a.valueFormat="number"),-1===["string","number"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",()=>{e.context&&(e.context.handlers.unitBlur=t=>{if(!(t.target instanceof HTMLInputElement))return;let o=t.target.value;(function(e){e=e.trim();const t=/\d+\,\s*%?$/;return/\d+\.\s*%?$/.test(e)||t.test(e)})(o)&&(o=o.replace(e.props.unitParts.decimal,""),t.target.value=o),e.context&&e.context.handlers.blur(t)},Wc(e),e.context.handlers.init(),l.forEach(t=>{e.on(`prop:${t}`,()=>{var t;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init()})}))})}]},zc=/* #__PURE__ */K("cr"),{outer:Uc,inner:Yc,wrapper:jc,label:Zc,prefix:Gc,suffix:Xc,help:Jc,messages:Qc,message:eu,icon:tu}=/* #__PURE__ */W(zc),ou=zc("input",()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onBlur:"$handlers.blur",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",disabled:"$disabled",placeholder:"$placeholder || $unitParts.unit",inputmode:"decimal","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto","aria-required":"$state.required || undefined"}}));const nu={schema:/* #__PURE__ */Uc(/* #__PURE__ */jc(/* #__PURE__ */Zc("$label"),/* #__PURE__ */Yc(/* #__PURE__ */tu("prefix"),/* #__PURE__ */Gc(),/* #__PURE__ */ou(),/* #__PURE__ */Xc(),/* #__PURE__ */tu("suffix"))),/* #__PURE__ */Jc("$help"),/* #__PURE__ */Qc(/* #__PURE__ */eu("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,i;const p=["currency","decimals","maxDecimals","minDecimals","displayLocale","min","max","step","valueFormat","currencyDisplay","placeholder","unitParts"];e.addProps(p),e.addProps(["inputText"]),null!==(t=(s=e.props).displayLocale)&&void 0!==t||(s.displayLocale=e.props.locale||"en-US"),null!==(o=(a=e.props).currency)&&void 0!==o||(a.currency=e.props.currency||"USD"),"false"===e.props.decimals||!1===e.props.decimals?e.props.decimals=0:void 0!==e.props.decimals&&(e.props.decimals=Number(e.props.decimals)),e.props.minDecimals=void 0!==e.props.minDecimals?Number(e.props.minDecimals):void 0,void 0!==e.props.min&&(e.props.min=Number(e.props.min)),void 0!==e.props.max&&(e.props.max=Number(e.props.max)),null!==(n=(l=e.props).step)&&void 0!==n||(l.step=1),null!==(r=(i=e.props).valueFormat)&&void 0!==r||(i.valueFormat="number"),-1===["string","number","integer"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",()=>{e.context&&(Wc(e),e.context.handlers.init(),p.forEach(t=>{e.on(`prop:${t}`,()=>{var t;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init()})}))})}]};var ru=/*#__PURE__*/Object.freeze({__proto__:null,autocomplete:Lr,colorpicker:sc,currency:nu,datepicker:bl,dropdown:oo,mask:ui,rating:Nn,repeater:tn,slider:ed,taglist:Kl,toggle:_o,togglebuttons:_c,transferlist:wp,unit:qc});const su="undefined"!=typeof window?setInterval:()=>0,au=new WeakSet;exports.$if=z,exports.autocomplete=Lr,exports.colorpicker=sc,exports.createBaseSections=W,exports.createProPlugin=function(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(au.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:h(13919),children:`${h(451228594)}${h(32863693)}`}]),t.emit("schema"),setTimeout(()=>t.destroy(),1e3)};!function(e,t){k[e]?k[e].add(t):k[e]=new Set([t])}(e,o)}}return function(e){const t=()=>{throw new Error(`InvalidFormKitKey ${e}`)};if(!/^fk-/i.test(e))return t();const o=e.substring(3);if(!d.test(o))return t();const n=parseInt(o,16).toString(),r=Number(n[0])<6?Number(n[0]):6,s=n.substring(r,r+(n.length-6)),a=n.substring(0,r)+n.substring(r+s.length),l=a.slice(0,2),i=`${a[a.length-1]}${a[0]}`;Number(s)!==Math.floor(Number(a)*Number(l)/Number(i))&&t()}(o),n.library=o=>{if(o.props.type in t){const{schema:n,...r}=t[o.props.type];au.add(o),o.define({...r,schema:n(e)})}su(()=>b.has(e)&&o.emit(952679114..toString(32)),4e3)},n}catch(r){throw r instanceof Error&&function(e){if("FormKitNoKey"===e.message)throw new Error("A FormKit API key is required, please visit https://formkit.com/pro")}(r),r}},exports.createSectionFactory=K,exports.currency=nu,exports.datepicker=bl,exports.dropdown=oo,exports.inputs=ru,exports.mask=ui,exports.rating=Nn,exports.repeater=tn,exports.slider=ed,exports.taglist=Kl,exports.toggle=_o,exports.togglebuttons=_c,exports.transferlist=wp,exports.unit=qc;