@formkit/pro 0.123.6 → 0.124.0

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 +1 @@
1
- "use strict";function e(e,o){e in Dn||(Dn[e]={timer:0,inputs:new Set});const n=Dn[e];clearTimeout(n.timer),n.inputs.add(o),n.timer=wn((()=>{kn[e]||(kn[e]=wn((()=>In.add(e)),2e3)),function(e){if(yn){window.addEventListener($n(),(o=>{const n=new URL(o.blockedURI).hostname;xn.some(((e,t)=>Ln(t)===n))&&(t(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let o=0;const n=Sn(hn),r="://",s=(new Date).getDate(),a=async()=>{const l=Array.from(Dn[e].inputs),i=l.filter((t=>!(An[e]&&An[e].has(t)))).join("");if(_n(e),i){o++;try{const a=await window[Sn(mn)](`${n}${r}${Ln((s+o)%xn.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${i}`)}`),p=await a.json();if(p[Sn(vn)])return t(e,p.schema);if(a.ok)return An[e]||(An[e]=new Set),void l.forEach((t=>An[e].add(t)))}catch(e){}o<2&&wn(a,1e4*Math.random())}};a()}}(e)}),500)}function t(e,t){In.add(e),function(e,t){Cn[e]&&Cn[e].forEach((e=>e(t)))}(e,t)}function o(t,o,n){if(e(o,n),!o)throw new Error("FormKitNoKey");return In.has(o)?null:t}function n(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}function r(e,t,n,r){return(...a)=>l=>i=>{const p=function(e,t,n,r,a,l){const i=l[n],p="function"==typeof r?r():{$el:r},d=a.map((e=>"string"==typeof e?e:e(t)(l)));let c=d.length&&p?cn.extendSchema(p,{children:d}):p;if(c=cn.extendSchema(c,i),"object"==typeof c){let a=c;if(!dn.isDOM(c)&&!dn.isComponent(c)||c.meta||(c.meta={section:n,node:r}),dn.isDOM(c)){const{$el:r,...l}=c;l.attrs?"class"in l.attrs||"if"in l.attrs||(l.attrs={class:`$classes.${n}`,...l.attrs}):l.attrs={class:`$classes.${n}`},a=s(t,n,Object.defineProperty(l,"$el",{enumerable:!1,get:o.bind(null,r,t,e)}))}else if(dn.isComponent(c)){const{$cmp:r,...l}=c;a=s(t,n,Object.defineProperty(l,"$cmp",{enumerable:!1,get:o.bind(null,r,t,e)}))}else if("$formkit"in c){c.outerClass=`$classes.${n}`;const{$formkit:r,...l}=c;a=s(t,n,Object.defineProperty(l,"$formkit",{enumerable:!1,get:o.bind(null,r,t,e)}))}return a}return s(t,n,c)}(e,l,t,n,a,i);return r&&pn.isRecord(p)&&(p.memo=e+JSON.stringify(i)),r?[p]:p}}function s(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 a(e){return(t,o,n=!1)=>r(e,t,o,n)}function l(e){return{outer:e("outer",Mn,!0),wrapper:e("wrapper","div",!1),inner:e("inner",Tn,!1),icon:Pn,label:e("label",En,!1),prefix:e("prefix",Bn,!1),suffix:e("suffix",Bn,!1),help:e("help",Vn,!1),messages:e("messages",On,!1),message:e("message",Fn,!1)}}function i(e){return{overlayPlaceholder:e("overlayPlaceholder",Hn),overlayLiteral:e("overlayLiteral",Nn),overlayChar:e("overlayChar",Rn),overlayEnum:e("overlayEnum",Kn),overlay:e("overlay",Wn),overlayParts:e("overlayParts",qn),overlayInner:e("overlayInner",Yn)}}function p(e,t,o){return n=>r=>{const s="string"==typeof t?t:t(n)(r);return o?{if:e,then:s,else:"string"==typeof o?o:o(n)(r)}:(cn.isSlotCondition(s)?Object.assign(s.else,{if:e}):cn.isSchemaObject(s)&&Object.assign(s,{if:e}),s)}}function d(e){const t=e("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_popover"',popover:{if:"$usePopover",then:"$popover",else:void 0},"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),o=e("listbox",(()=>({$el:"ul",if:"$expanded || $setForceExpanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant","aria-labelledby":'$id + "_label"'}}))),n=e("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"}}))),r=e("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"}}))),s=e("loadMoreInner","span"),a=e("emptyMessage",(()=>({$el:"li",if:"$showEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),l=e("emptyMessageInner","span"),i=e("option",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option)"}}))),d=e("listitems",(()=>({$el:null,if:"$options.length",for:["option","index","$option.options || $options"]}))),c=e("innerListitems",(()=>({$el:null,for:["option","innerIndex","$option.options"]}))),u=e("listitemGroup",(()=>({$el:"li",attrs:{"aria-label":"$option.group",role:"group",onClick:"$handlers.listitemGroupClick",tabindex:"-1"}}))),f=e("groupLabel","span"),h=e("groupList",(()=>({$el:"ul",attrs:{role:"group"}})));return()=>{return t(o(a(l("$emptyMessage")),d(p("$option.group",u(f("$option.group"),h(c((e=()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'}),v=n(p("$fns.isSelected($option)",Pn("selected")),i("$option.label")),t=>{const o=o=>{const n=v(t)(o),r="function"==typeof e?e(t):e;return pn.isObject(r)?(cn.isSlotCondition(n)&&dn.isDOM(n.else)?n.else.attrs={...n.else.attrs,...r}:dn.isDOM(n)&&(n.attrs={...n.attrs,...r}),n):n};return o._s=v._s,o})))),n(p("$fns.isSelected($option)",Pn("selected")),i("$option.label")))),r(p("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",s(p("$state.loading",Pn("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))));var e,v}}function c(e){return pn.isRecord(e)&&"value"in e&&"label"in e}function u(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 f(){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 h(e){return"__original"in e?e.__original:e.value}async function v(e,t,o=!1,n=!1){if("function"==typeof e.props.optionsLoader){e.props.search=t,clearTimeout(wr.get(e));const o=t?e.props.debounce:0;0===o?m(e,n):wr.set(e,setTimeout((()=>{e.props.page=1,m(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 m(e,t){e.props.allowAppendOptions=t,b(e)}function g(e,t){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,function(e,t){const o=cn.normalizeOptions(t);e.props.appendingOptions=!0,e.props.activeValue=h(o[0]),e.props.options=e.props.options.concat(o)}(e,t);const o=cn.normalizeOptions(t);e.props.options=o,e.props.options.length||(e.store.set(kr),e.store.set(dn.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}))),xr.set(e,e.props.searchValue)}function $(e,t,o){if(e.store.set(_r),e.props.optionLoadingCounter++,e.props.multiple&&"truncate"!==e.props.selectionAppearance){let o;o=pn.isPojo(t)?{label:"Loading...",value:String(t)}:{label:String(t),value:t},e.props.optionLoaderValues.includes(o.value)||e.props.optionLoaderValues.push(o.value),"transferlist"===e.props.type||e.props.selections.includes(o)||(e.props.selections=[...e.props.selections,o])}const n=e.props.optionLoader(t,o),r=e=>"string"==typeof e?{label:e,value:t}:c(e)?e:pn.isRecord(e)?Object.assign({label:String(t),value:t},e):{label:String(t),value:t},s=t=>{const o=e.props.memoOptions.findIndex((e=>pn.eq(h(e),h(t))));return-1===o?e.props.memoOptions=[...e.props.memoOptions,t]:e.props.memoOptions[o]=t,t};return n instanceof Promise?n.then((e=>{if("string"==typeof e||c(e))return s(r(e))})).finally((()=>{e.props.optionLoaderValues=e.props.optionLoaderValues.filter((e=>e!==t)),e.props.optionLoadingCounter--})):(e.props.optionLoaderValues=e.props.optionLoaderValues.filter((e=>e!==t)),e.props.optionLoadingCounter--,s(r(n)))}function b(e){e.store.set(_r),e.props.optionsLoadingCounter++,e.store.set(dn.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}));const t=e.props.nonceKey&&e.props[e.props.nonceKey],o=e.props.optionsLoader(e.context,Sr.get(e)),n=g.bind(null,e),r=o instanceof Promise?o.then(((...o)=>{void 0!==e.props.nonceKey&&t!==e.props[e.props.nonceKey]||n(...o)})):(n(o),e.props.optionsLoadingCounter--);if(r instanceof Promise)return r.finally((()=>{e.props.optionsLoadingCounter--}))}function y(e,t){e.props.page++,Sr.set(e,t),e.store.set(dn.createMessage({key:"hasNextPage",type:"state",value:!0,visible:!1}))}function x(e,t){if(e.props.optionRemoved=!0,t){const o=(e.props.inputStd||[]).filter((e=>!pn.eq(h(t),e)));e.input(o)}else e.input(void 0);e.props.openOnRemove&&!e.props.expanded&&e.isCreated&&(e.props.expanded=!0),setTimeout((()=>{var t;return e.emit("selectRange",[null===(t=e.props.highlightedRange)||void 0===t?void 0:t.option])}),20)}async function w(e){const t=Dr(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:yn&&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 _(e){var t,o;if(e.props.allOptions&&e.props.allOptions.length)if(null===(t=e.props.highlightedRange)||void 0===t?void 0:t.option.value)e.props.activeValue=h(e.props.highlightedRange.option);else{if(e.props.activeSelectionValue){const t=e.props.allOptions.find((t=>pn.eq(h(t),e.props.activeSelectionValue)));if(t)return void(e.props.activeValue=t.value)}if(e.props.reloadOnCommit)e.props.activeValue=h(e.props.allOptions[0]);else{if(e.props.searchValue&&!e.props.appendingOptions)e.props.activeValue=h(e.props.allOptions[0]);else if(e.props.inputStd.length>0&&!e.props.multiple||e.props.multiple&&(null===(o=e.context)||void 0===o?void 0:o.state.dirty))e.props.selections[e.props.selections.length-1]?e.props.activeValue=h(e.props.selections[e.props.selections.length-1]):e.props.activeValue=h(e.props.allOptions[0]);else{if(e.props.appendingOptions)return void(e.props.appendingOptions=!1);e.props.activeValue=h(e.props.allOptions[0])}e.props.appendingOptions&&(e.props.appendingOptions=!1)}}}function k(e){return e.reduce(((e,t)=>(t.options?e.push(...k(t.options)):e.push(t),e)),[])}function S(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(h(t)!==Lr?(e.props.option=t,e.props.maxReached&&!A(e,t)||(e.input(L(e,h(t))),A(e,t)&&e.props.closeOnSelect&&(e.props.expanded=!1))):null===(n=e.context)||void 0===n||n.handlers.loadMore(!0))}function L(e,t){if(e.props.multiple){const o=Array.isArray(e.value)?e.value:[];for(const n of o)if(pn.eq(n,t))return e.props.optionRemoved=!0,o.filter((e=>!pn.eq(e,t)));return[...o,t]}return pn.eq(t,e.value)&&e.props.deselect?void(e.props.optionRemoved=!0):t}function D(e,t){return pn.eq(e.props.activeValue,h(t))||void 0}function A(e,t){if(e.props.multiple){if(!Array.isArray(e.value))return!1;for(const o of e.value)if(pn.eq(o,h(t)))return!0;return!1}return pn.eq(e.value,h(t))}function I(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 C(e){e.props.firstCommit=!0;let t=null;e.on("commit",(()=>{if(0===e.props.inputStd.length&&e.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}(e),void(t=e.props.inputStd);if(e.props.inputStd.length&&"function"==typeof e.props.optionsLoader&&0===e.props.options.length&&"function"!=typeof e.props.optionLoader&&0===e.props.optionsLoadingCounter){e.props.optionsLoaded=!0;const t=b(e);t instanceof Promise&&t.then((()=>{w(e)}))}"function"!=typeof e.props.optionLoader||e.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}(t,e.props.inputStd)?0===e.props.optionsLoadingCounter&&w(e):(t=e.props.inputStd,async function(e){const t=Dr(e),o=e.props.inputStd.length>1?e.props.inputStd.filter((t=>!e.props.memoOptions.find((e=>pn.eq(h(e),t))))):e.props.inputStd;if(o.forEach((o=>{$(e,o,Array.isArray(t)&&t.find((e=>pn.eq(h(e),o)&&!e.noOptionFound)))})),e.props.optionLoadingCounter){const t=e.on("prop:optionLoadingCounter",(()=>{w(e),e.props.optionLoadingCounter||e.off(t)}))}else w(e)}(e))}))}function M(e){function t(e,t){"overscroll"!==e.props.behavior&&"none"===getComputedStyle(t).maxHeight&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,maxHeight:"400px"});const n=new MutationObserver((n=>{const r=n[0].target;if("overscroll"===e.props.behavior&&r.id!==`${e.props.id}_popover`)return;const s=e.props.positionListBox(t);Ar.delete(e),o(e,s);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)}));n.observe(t,{childList:!0,subtree:!0})}function o(e,t){var o;if(!e.props.expanded||!e.props.options||!e.props.options.length||Ar.has(e))return;const r=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}),[]),s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);s&&r.push([s,e.props.loadMoreOption]),Ar.add(e),r.length&&n(e,r,t)}function n(e,t,r){var s,a,l,i;const p=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_popover`);if(e.props.trackHover){const o=p?p.getBoundingClientRect():{top:0,bottom:0};if(r=null,e.props.mouseY>o.top&&e.props.mouseY<o.bottom){let o=r||0,n=r;const s=(t,o)=>{var n;const s=o[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){r=t;const s=o[1];return s&&!(null===(n=s.attrs)||void 0===n?void 0:n.disabled)?e.props.activeValue=h(s):e.props.activeValue=void 0,!0}return!1};do{if(null!==o&&s(o,t[o]))break;if(null!==n&&s(n,t[n]))break;null!==o&&(o++,o>t.length-1&&(o=null)),null!==n&&(n--,n<0&&(n=null))}while(null!==o||null!==n)}null===r&&(e.props.activeValue=void 0)}e.props.trackHover||T(e),e.props.expanded?(p&&e.props.loadOnScroll&&!(null===(a=e.store.loading)||void 0===a?void 0:a.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)),Ar.has(e)?requestAnimationFrame(n.bind(null,e,t,r)):o(e,r)):Ar.delete(e)}if(!yn)return;e.props.positionListBox=function(e,t){var o,n;let r=null;if(e.props.activeDescendant){r=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>pn.eq(e.value,h(t)))),-1===r&&(r=null);(null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant))&&T(e)}if("undefined"==typeof window)return r;const s=t.getBoundingClientRect(),a=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);if(a){const t=a.getBoundingClientRect();t.top+t.height+s.height>window.innerHeight&&t.top+t.height>s.height?(e.props.invertPopover=!0,e.props.usePopover||(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,top:"auto",bottom:"100%"})):(e.props.invertPopover=!1,e.props.usePopover||(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,bottom:"auto",top:"100%"}))}return r}.bind(null,e),e.props.styleWrapper=E.bind(null),e.on("mounted",(()=>{pn.whenAvailable(`${e.props.id}_popover`,t.bind(null,e),e.props.__root)}));const r=t=>{var o;e.props.mouseX=t.clientX,e.props.mouseY=t.clientY;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_popover`);if(n){const o=n.getBoundingClientRect();t.clientX>o.x&&t.clientX<o.x+o.width&&t.clientY>o.y&&t.clientY<o.y+o.height&&(e.props.trackHover=!0)}},s=()=>{e.props.ignoreScroll?e.props.ignoreScroll=!1:e.props.trackHover=!0};e.on("prop:trackHover",(({payload:t})=>{var o,n,r;yn&&(t?null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_popover`))||void 0===r||r.removeEventListener("scroll",s):null===(o=e.props.__root)||void 0===o||o.getElementById(`${e.props.id}_popover`))})),e.on("prop:expanded",(({payload:t})=>{e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,zIndex:t||e.props.forceExpanded?"999":"-1",pointerEvents:t?"auto":"none"},t?(document.addEventListener("mousemove",r),e.props.styleWrapper(),_(e)):document.removeEventListener("mousemove",r)})),e.on("prop:trackHover",(({payload:t})=>{var o,n;yn&&(t?null===(n=document.getElementById(`${e.props.id}_popover`))||void 0===n||n.removeEventListener("scroll",s):null===(o=document.getElementById(`${e.props.id}_popover`))||void 0===o||o.addEventListener("scroll",s))})),e.on("prop:activeValue",(({payload:t})=>{if(t===Lr)return void(e.props.activeDescendant=`${e.props.id}_load_more`);let o,n=-1;for(let r=0;r<e.props.options.length;r++){if("group"in e.props.options[r])for(let s=0;s<e.props.options[r].options.length;s++)if(pn.eq(h(e.props.options[r].options[s]),t)){n=s,o=r;break}if(pn.eq(h(e.props.options[r]),t)){n=r;break}}e.props.activeDescendant=n<0?void 0:void 0===o?`${e.props.id}_listitem_${n}`:`${e.props.id}_listitem_${o}_${n}`}))}function T(e){var t,o;if(!yn)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 E(){}function O(e){e.on("created",(()=>{if(!e.context||!yn)return;e.context.fns.isActive=D.bind(null,e),e.context.fns.isSelected=t=>A(e,t),e.context.fns.hasOptionLoaderValue=t=>{for(const o of e.props.optionLoaderValues)if(pn.eq(h(t),o))return!0;return!1},e.context.handlers.listitemGroupClick=Y,e.context.handlers.selectOption=t=>o=>q.call(null,e,t,o),e.context.handlers.loadMore=m.bind(null,e),e.context.handlers.removeSelection=t=>o=>W(e,t,o),e.context.handlers.tagTouchstart=t=>o=>W(e,t,o),e.context.handlers.selectionClick=t=>e.props.multiple?P.bind(null,e,t):B.bind(null,e),e.context.handlers.selectionBlur=()=>H.bind(null,e),e.context.fns.isActiveSelection=(e,t)=>pn.eq(e,h(t)),e.context.handlers.tagClick=t=>N.bind(null,e,t),e.context.handlers.tagFocus=t=>R.bind(null,e,t),e.context.handlers.tagBlur=()=>K.bind(null,e);const t=e.context.handlers.blur;e.context.handlers.blur=function(e,o){var n;if(o&&o.relatedTarget instanceof HTMLElement){const t=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(e.props.id+"_inner");if(t instanceof HTMLElement&&t.contains(o.relatedTarget))return}t(),function(e){if(e.props.disabled)return;e.props.expanded=!1,e.props.activeSelectionValue=void 0,e.emit("blur")}(e)}.bind(null,e),e.context.handlers.touchmove=F.bind(null,e),e.context.handlers.touchend=V.bind(null,e)}))}function F(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=Ir.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else Ir.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function V(e){Ir.delete(e)}function B(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 P(e,t,o){o.currentTarget instanceof HTMLElement&&(pn.eq(e.props.activeSelectionValue,h(t))?e.props.activeSelectionValue=void 0:(e.props.activeSelectionValue=h(t),o.currentTarget.focus()))}function H(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 N(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.justFocused?e.props.justFocused=!1:o.currentTarget instanceof HTMLElement&&(pn.eq(e.props.activeSelectionValue,h(t))?e.props.activeSelectionValue=void 0:(e.props.activeSelectionValue=h(t),o.currentTarget.focus())))}function R(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=h(t),e.props.justFocused=!0)}function K(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 W(e,t,o){o&&o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleRemoveSelection"},x(e,t))}function Y(e){e.stopPropagation()}function q(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},S(e,t))}function U(e,t,o,n){!function(e){e.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===e.props.deselect?e.props.deselect=!0:e.props.deselect=pn.undefine(e.props.deselect),e.props.option={},e.props.expanded=!1,e.props.inputStd=[],void 0===e.props.draggable?e.props.draggable=!0:"false"===e.props.draggable&&(e.props.draggable=!1),e.props.options||(dn.warn(350,{node:e,inputType:e.props.type}),e.props.options=[]),"disabled"in e.props&&(e.props.disabled=pn.undefine(e.props.disabled)),e.props.allOptions=k(e.props.options),e.props.selections=[],e.props.memoOptions=[],e.props.invertPopover=!1,e.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},e.props.decrementCount=0,e.props.page=1,e.props.loadMoreOption={label:"Load more",value:Lr},e.props.loadOptions=b,e.props.listboxStyles={},e.props.optionsLoadingCounter=0,e.props.optionLoadingCounter=0,e.props.searchable=pn.undefine(e.props.searchable),e.props.loadOnScroll=pn.undefine(e.props.loadOnScroll),e.props.multiple=pn.undefine(e.props.multiple)||!1,"taglist"===e.props.type&&(e.props.multiple=!0),e.props.openOnFocus=pn.undefine(e.props.openOnFocus),e.props.openOnRemove=void 0!==e.props.openOnRemove&&pn.undefine(e.props.openOnRemove),e.props.hasNextPage=y.bind(null,e),e.props.initialOptions=[...e.props.options],e.props.optionLoaderValues=[],e.props.loadOnCreated=pn.undefine(e.props.loadOnCreated),e.props.max&&"number"!=typeof e.props.max?e.props.max=parseInt(e.props.max):e.props.max&&!e.props.multiple&&(e.props.max=void 0),e.on("mounted",(()=>I(e))),e.on("prop:popoverCoordinates",(()=>setTimeout((()=>{I(e)}),10)))}(n),n.props.multiple?function(e){e.hook.input(((t,o)=>(e.props.highlightedRange&&!e.props.optionRemoved&&(t.splice(e.props.highlightedRange.index,1,h(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]))))}(n):function(e){e.hook.input(((t,o)=>(e.props.inputStd=void 0===t||""===t||null===t?[]:[t],o(t))))}(n),e(n),C(n),function(e){e.on("created",(()=>{e.context&&(e.props.trackHover=!0,void 0!==e.props.disabled||e.props.optionsLoader||!e.props.options||e.props.options.length||void 0!==e.props.emptyMessage||e.props.allowNewValues||0!==e.props.inputStd.length||(e.props.disabledInternally=!0),M(e),e.props.loadOnCreated&&!e.props.optionsLoaded?b(e):e.props.optionsLoaded&&(e.props.optionsLoaded=!1),e.props.forceExpanded=pn.undefine(e.props.forceExpanded),e.props.forceExpanded&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,zIndex:"999",pointerEvents:"auto"},setTimeout((()=>{e.props.setForceExpanded=!0}),100)))}))}(n),O(n),t(n),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(kr))})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&e.store.set(kr)})),e.on("prop:disabled",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:options",(({payload:t})=>{e.props.allOptions=k(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),_(e)})),e.on("prop:expanded",(({payload:o})=>{var n;if(yn)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}}(n),o(n)}function z(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 j(e,t,o){var n,r,s;if(o.preventDefault(),e.props.trackHover=!1,e.props.expanded){const o=e.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(h(t)),e}),[]);(null===(n=e.store.hasNextPage)||void 0===n?void 0:n.value)&&o.push(Lr);let a=-1;e.props.activeValue&&(a=o.findIndex((t=>pn.eq(t,e.props.activeValue)))),-1===a&&o.length?e.props.activeValue=o[0]:"ArrowDown"===t&&o.length>a+1?e.props.activeValue=o[a+1]:"ArrowUp"===t&&a>0?e.props.activeValue=o[a-1]:"ArrowUp"===t&&0===a&&(null===(s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===s||s.focus(),e.props.expanded=!1)}else e.props.expanded||"ArrowDown"!==t||(e.props.expanded=!0)}function Z(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=h(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=h(e.props.selections[0]):e.props.activeSelectionValue=void 0),e.props.expanded=!1}}function G(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 X(e,t,o,n=!0){var r,s,a,l,i,p,d;const c=o.key;if(o.altKey){const n=f(),r=e.props.selections.findIndex((e=>pn.eq(h(e),h(t)))),s=[...e.props.selections];"ArrowRight"===o.key?r<e.props.selections.length-1&&(s.splice(r,1),s.splice(r+1,0,t)):"ArrowLeft"===o.key&&r>0&&(s.splice(r,1),s.splice(r-1,0,t)),e.props.activeSelectionValue=h(t),e.input([...s.map(h)]),setTimeout((()=>{n instanceof HTMLElement&&n.focus()}),100)}else{const o=e.props.selections.findIndex((e=>pn.eq(h(e),h(t))));if(-1===o)return;const u="ArrowRight"===c?o+1:o-1;if(u>=e.props.selections.length){if(!n)return e.props.expanded=!0,e.props.activeSelectionValue=void 0,void(null===(s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}`))||void 0===s||s.focus());null===(l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}`))||void 0===l||l.focus()}else if(u<0&&0===o)null===(p=null===(i=e.props.__root)||void 0===i?void 0:i.getElementById(`${e.props.id}`))||void 0===p||p.focus();else if(u<0)return;const f=null===(d=e.props.__root)||void 0===d?void 0:d.getElementById(`${e.props.id}_tag-wrapper_${u}`);f&&f.focus(),e.props.selections[u]?e.props.activeSelectionValue=h(e.props.selections[u]):e.props.activeSelectionValue=void 0}}function J(e,t,o){var n;if(!(o.currentTarget instanceof HTMLElement))return;if(e.props.searchValue)return;const r=e.props.selections.findIndex((e=>pn.eq(h(e),h(t))));if(-1===r)return;const s=e.props.selections[r+1]?r+1:r-1,a=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_tag-wrapper_${s}`);a&&a.focus(),e.props.userAction={type:"tagDelete"},x(e,t)}function Q(e,t){var o;if(t.preventDefault(),e.props.allowNewValues&&e.props.searchValue&&e.input(L(e,e.props.searchValue)),e.props.expanded){if(e.props.activeValue===Lr)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore(!0));const t=e.props.allOptions.find((t=>pn.eq(h(t),e.props.activeValue)));if(!t)return;S(e,t)}else e.props.expanded=!0}function ee(e){e.props.expanded&&(e.props.expanded=!1)}function te(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":G(e);break;case"ArrowRight":case"ArrowLeft":X(e,t,o,!1);break;case"Delete":case"Backspace":J(e,t,o)}}function oe(e,t,o){if(e.props.disabled)return;switch(o.key){case"ArrowUp":case"ArrowDown":!function(e,t,o){var n,r,s,a;o.preventDefault();const l=o.key,i=e.props.selections.findIndex((e=>pn.eq(h(e),h(t))));if(-1===i)return;const p="ArrowDown"===l?i+1:i-1;if(p<0&&(null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`))||void 0===r||r.focus()),p<0||p>=e.props.selections.length)return;const d=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_selection_wrapper_${p}`);d&&d.focus(),e.props.activeSelectionValue=(null===(a=e.props.selections[p])||void 0===a?void 0:a.value)||void 0}(e,t,o);break;case"Enter":break;case"Tab":!function(e,t,o){var n,r,s,a;if(t){const l=e.props.selections.findIndex((e=>pn.eq(h(e),h(t))));if(-1===l)return;const i=o.shiftKey?l-1:l+1;if(i>=e.props.selections.length)return;if(i<0)return void(null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`))||void 0===r||r.focus());const p=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_selection_wrapper_${i}`);p&&p.focus(),e.props.activeSelectionValue=(null===(a=e.props.selections[i])||void 0===a?void 0:a.value)||void 0}}(e,t,o);break;case"Delete":case"Backspace":!function(e,t){var o;if(t){const n=e.props.selections.findIndex((e=>pn.eq(h(e),h(t))));if(-1===n)return;const r=e.props.selections[n+1]?n+1:n-1,s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_selection_wrapper_${r}`);s&&s.focus(),e.props.selections[r]?e.props.activeSelectionValue=h(e.props.selections[r]):e.props.activeSelectionValue=void 0}t&&1!==e.props.selections.length||(e.props.userAction={type:"selectionDelete"}),x(e,t)}(e,t)}}function ne(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":j(e,o,t);break;case"ArrowLeft":case"ArrowRight":Z(e,o);break;case"Enter":Q(e,t);break;case"Escape":ee(e);break;case"Delete":case"Backspace":z(e);break;default:e.emit("unusedKeydown",t)}}function re(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":j(e,o,t);break;case"ArrowRight":case"ArrowLeft":Z(e,o);break;case"Enter":Q(e,t);break;case"Escape":ee(e);break;case"Delete":case"Backspace":z(e)}}function se(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 ae(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 le(e){let t,o="";e.on("unusedKeydown",(({payload:n})=>{if(!n.isComposing&&1===[...n.key].length){if(!o&&" "===n.key)return void function(e,t){var o;if(t.preventDefault(),e.props.expanded){if(e.props.activeValue===Lr)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.allOptions.find((t=>pn.eq(h(t),e.props.activeValue)));if(!t)return;S(e,t)}else e.props.expanded=!0}(e,n);e.props.expanded=!0,clearTimeout(t),o+=n.key;const r=e.props.allOptions.find((e=>e.label.toLowerCase().startsWith(o.toLowerCase())));r&&(e.props.activeValue=h(r)),t=setTimeout((()=>{o=""}),400)}}))}function ie(e){pe(e),e.on("prop:selections",(()=>{e.props.skipFormatSelections=!1,pe(e)})),yn&&pn.whenAvailable(`${e.props.id}_selections`,ce.bind(null,e),e.props.__root)}function pe(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 de(e){var t,o;if(!yn||!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((()=>{pe(e)}));break}}}else e.props.lastTruncatedElText=null,e.props.lastVisibleIndex=null,pe(e)}function ce(e,t){const o=new ResizeObserver((()=>{e.props.selections&&0!==e.props.selections.length&&(e.props.skipFormatSelections?e.props.skipFormatSelections=!1:de(e))})),n=new ResizeObserver((()=>{de(e)}));o.observe(t),t.parentNode instanceof Element&&n.observe(t.parentNode)}function ue(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 fe(e,t){var o,n;let r=null;if(e.props.activeDescendant){const s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);if(!s)return r;e.props.ignoreScroll=!0;const a=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_listbox`);if(!a)return r;const l=t.getBoundingClientRect(),i=a.getBoundingClientRect(),p=parseInt(getComputedStyle(t).paddingTop),d=parseInt(getComputedStyle(t).paddingBottom),c=s.offsetTop-p,u=Math.max(c-p,0),f=Math.max(t.scrollHeight-d-c-l.height,0),v=i.height-u-f;t.scrollTop=c;const m=()=>{t.scrollTop=f>0?f<p?t.scrollHeight:p:u<d?0:c-d},g=Math.min(150,i.height);u>0&&f>0||0===u&&0===f||v>g?t.scrollTop=c:m();t.clientHeight/2<t.scrollTop&&(r=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>pn.eq(e.value,h(t))))),-1===r&&(r=null)}return r}function he(e){e.addProps(["behavior"]),e.on("created",(()=>{"overscroll"===e.props.behavior&&("function"==typeof e.props.optionsLoader&&dn.error(300,[e]),e.props.dropdownWrapperStyles=pn.clone(Cr),e.props.listboxStyles={display:"inline-block"},e.props.styleWrapper=ue.bind(null,e),e.props.positionListBox=fe.bind(null,e))})),e.on("prop:expanded",(({payload:t})=>{"overscroll"===e.props.behavior&&(t?function(){Fr=document.documentElement.scrollTop;for(const e in Mr)Or[e]=document.documentElement.style[e],document.documentElement.style[e]=Mr[e];for(const e in Tr)Er[e]=document.body.style[e],document.body.style[e]=Tr[e];document.body.scrollTop=Fr}():function(){for(const e in Mr)document.documentElement.style[e]=Or[e];for(const e in Tr)document.body.style[e]=Er[e];document.body.scrollTop=0,document.documentElement.scrollTop=Fr}())}))}function ve(e){e.addProps(["multiLine"]),e.on("created",(()=>{yn&&(e.props.multiLineHeight=void 0,pn.whenAvailable(`${e.props.id}_selections`,me.bind(null,e),e.props.__root))}))}function me(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),ge(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 ge(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 $e(e){function t(){const{x:t,y:o,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}}(n,r);e.props.popoverAncestorCoordinates={x:t,y:o,width:s,height:a},e.props.popoverCoordinates={x:t,y:o,width:s,height:0}}function o(t){t?(null==n||n.showPopover(),setTimeout((()=>{e.props.popoverCoordinates.height=(null==n?void 0:n.offsetHeight)||0}),5)):(null==n?void 0:n.matches(":popover-open"))&&(null==n||n.hidePopover(),e.props.popoverCoordinates.height=0)}if(e.addProps(["popover","popoverOffset","usePopover","popoverCoordinates","popoverAncestorCoordinates"]),e.props.popover=pn.undefine(e.props.popover)?"manual":void 0,"input"!==e.type||"overscroll"===e.props.behavior)return;let n=null,r=null,s=[],a=null;if(e.props.popoverOffset=pn.undefine(e.props.popoverOffset)?parseInt(e.props.popoverOffset):0,!e.props.popover)return;if("undefined"==typeof document||!("popover"in HTMLElement.prototype))return void 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 l=()=>{document.removeEventListener("resize",a),document.removeEventListener("scroll",a),s.forEach((e=>{e.removeEventListener("scroll",a)}))};e.on("mounted",(()=>{e.context&&(e.props.usePopover=!0,e.props.popoverCoordinates={x:0,y:0,width:0,height:0},e.props.popoverAncestorCoordinates={x:0,y:0,width:0,height:0})})),e.on("destroyed",(()=>{l()})),e.on("prop:expanded",(({payload:i})=>{var p;e.context&&(!1===i?l():pn.whenAvailable(`${null===(p=e.context)||void 0===p?void 0:p.id}_popover`,(()=>{if(!e.context)return;n=document.querySelector(`#${e.context.id}_popover[popover]`)||document.querySelector(`#${e.context.id}_popover [popover]`),r||(r=function(e){if(!e)return null;let t=e.parentElement;for(;t&&"static"===window.getComputedStyle(t).position;)t=t.parentElement;return t}(n)),t(),o(i),a=Vr((()=>{e.context&&(t(),o(i))}),10),document.addEventListener("resize",a),document.addEventListener("scroll",a),s=[];let l=null==n?void 0:n.parentElement;for(;l;)l.scrollHeight>l.clientHeight&&s.push(l),l=l.parentElement;s.forEach((e=>{e.addEventListener("scroll",a)}))})))}))}function be(e){var t,o,r,s,a,l,i,p,d,c,u,f,h,v;if(null!==(t=(p=e.props).removeControl)&&void 0!==t||(p.removeControl=!0),null!==(o=(d=e.props).upControl)&&void 0!==o||(d.upControl=!0),null!==(r=(c=e.props).downControl)&&void 0!==r||(c.downControl=!0),null!==(s=(u=e.props).insertControl)&&void 0!==s||(u.insertControl=!1),null!==(a=(f=e.props).addButton)&&void 0!==a||(f.addButton=!0),null!==(l=(h=e.props).addLabel)&&void 0!==l||(h.addLabel=!1),null!==(i=(v=e.props).addAttrs)&&void 0!==i||(v.addAttrs={}),e.props.draggable=pn.undefine(e.props.draggable),e.props.min=void 0!==e.props.min?Number(e.props.min):1,e.props.max=void 0!==e.props.max?Number(e.props.max):1/0,e.props.min>e.props.max)throw Error("Repeater: min must be less than max");if(Array.isArray(e.value))if(e.value.length<e.props.min){const t=n(e.props.min-e.value.length,(()=>({})));e.input(e.value.concat(t),!1)}else e.value.length>e.props.max&&e.input(e.value.slice(0,e.props.max),!1);else e.input(n(e.props.min,(()=>({}))),!1);e.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)}}(e,e.context.fns)}function ye(e,t){function o(){return Array.isArray(t.value)?t.value:[]}function n(e){t.input(e)}if(!t.context)return;const r={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:[un.animations({duration:100})],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>"LI"===e.tagName};un.dragAndDrop({parent:e,getValues:o,setValues:n,config:r}),t.on("prop:disabled",(({payload:t})=>{r.disabled=t,un.dragAndDrop({parent:e,getValues:o,setValues:n,config:r})})),t.on("prop:draggable",(({payload:t})=>{r.disabled=!t,un.dragAndDrop({parent:e,getValues:o,setValues:n,config:r})}))}function xe(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 we(e,t){var o;null===(o=e.context)||void 0===o||o.handlers.blur(t)}function _e(e,t){const{x:o,y:n}=Te(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 ke(e,t,o){e.props.disabled||(o.preventDefault(),e.props.hoverHighlight=!0,e.props.touchStarted=!0,1!==e.props.step?Ee(e,t,o):e.input(t+1,!1))}function Se(e,t){if(!e.props.dragStarted)return;t.preventDefault(),e.props.hoverHighlight=!1,e.props.dragStarted=!1,xe(e);const o=Es.get(e);o&&(o.abort(),Es.delete(e))}function Le(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=>Se(e,t)),{signal:n.signal}),Es.set(e,n),1===e.props.step?e.input(t+1,!1):Ee(e,t,o)}function De(e,t){if(document.activeElement===t.currentTarget)if("ArrowRight"===t.key||"ArrowDown"===t.key){e.props.arrow=1;const t=document.getElementById(e.props.id+"_0_0");null==t||t.focus(),e.input(Number(null==t?void 0:t.getAttribute("value")))}else if("ArrowLeft"===t.key||"ArrowUp"===t.key){e.props.arrow=-1;const t=document.getElementById(e.props.id+`_${e.props.max-1}_${e.props.stepsPerValue-1}`);null==t||t.focus(),e.input(Number(null==t?void 0:t.getAttribute("value")))}}function Ae(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 Ie(e,t,o){e.props.hoverHighlight&&(e.props.disabled||(1===e.props.step?(xe(e,t+1),e.props.dragStarted&&e.input(t+1,!1)):Ee(e,t,o,!!e.props.dragStarted)))}function Ce(e){xe(e)}function Me(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 Ee(e,t,o)}function Te(e){return e instanceof MouseEvent?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}}function Ee(e,t,o,n=!0){if(!(o.currentTarget instanceof HTMLElement))return;const{x:r,y:s}=Te(o),a=o.currentTarget.getBoundingClientRect();let l=function(e,t){t||(t=1);const o=1/t;return Math.ceil(e*o)/o}((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):xe(e,l):e.input(0)}function Oe(e){e.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter","hasHighlightedRange","clearOnClick","debounce"]),void 0===e.props.debounce?e.props.debounce=200:e.props.debounce=parseInt(e.props.debounce),e.props.nonceKey="searchValue",e.props.searchValue="",e.props.inputText="",e.props.filterOptions=v.bind(null,e),e.props.reloadOnCommit=pn.undefine(e.props.reloadOnCommit),void 0===e.props.alwaysLoadOnOpen?e.props.alwaysLoadOnOpen=!0:e.props.alwaysLoadOnOpen=pn.undefine(e.props.alwaysLoadOnOpen),"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),e.on("created",(()=>{e.context&&yn&&(e.context.handlers.focus=Be.bind(null,e),e.context.handlers.input=Fe.bind(null,e),e.context.handlers.focus=Be.bind(null,e),e.context.handlers.click=Ve.bind(null,e),e.context.handlers.toggleListbox=Pe.bind(null,e),e.context.handlers.toggleListboxKeydown=He.bind(null,e),e.context.handlers.keydown=re.bind(null,e),e.context.handlers.selectionKeydown=t=>o=>oe(e,t,o),e.context.handlers.searchInputTagKeydown=t=>o=>function(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":G(e);break;case"ArrowRight":case"ArrowLeft":X(e,t,o);break;case"Delete":case"Backspace":J(e,t,o)}}(e,t,o),e.on("prop:options",(({payload:t})=>{if((0===e.props.initialOptions.length&&"function"!=typeof e.props.optionsLoader||!e.props.searchValue&&t.length)&&(e.props.initialOptions=[...t]),e.props.selections&&e.props.selections.length&&t.length)for(let o=0;o<e.props.selections.length;o++){const n=e.props.selections[o],r=t.find((e=>h(e)===n.value));r&&(e.props.selections[o]=r)}})))})),e.on("prop:expanded",(({payload:t})=>{t||xr.delete(e)}))}function Fe(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&v(e,e.props.searchValue,!0)}function Ve(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 Be(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 Pe(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 He(e,t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),Pe(e))}function Ne(e){e.props.searchValue=null,e.on("commit",(()=>{e.props.searchValue=null,e.props.highlightedRange||Re(e)})),e.on("created",(()=>{if(!e.context||!_a)return;e.on("handleSearchInput",(({payload:t})=>{""===t?(e.props.searchValue=null,e.input([])):t&&0===e.props.inputStd.length?e.props.searchValue=t:t&&e.props.inputStd.length>0&&(e.props.searchValue=function(e){var t;const o=We(e);if(e.props.highlightedRange){const[t,n]=Ke(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)}(e)),!e.props.expanded&&t?e.props.expanded=!0:!t&&e.props.expanded&&(e.props.expanded=!1)})),function(e){pn.whenAvailable(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&ka.set(t,e)}),e.props.__root),_a&&!Sa&&(Sa=!0,document.addEventListener("selectionchange",(()=>{const e=f();if(e instanceof HTMLInputElement&&ka.has(e)){const t=ka.get(e);t&&function(e){clearTimeout(wa.get(e)),wa.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=We(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]=Ke(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,Re(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)}})))}(e);const o=e.context.handlers.keydown;e.context.handlers.keydown=n=>{o(n),function(e,o){var n,r,s,a;if(["ArrowRight","ArrowLeft"].includes(o.key)&&o.target instanceof HTMLInputElement&&null!==o.target.selectionEnd&&null!==o.target.selectionStart){if(0===o.target.selectionStart&&o.target.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))"ArrowLeft"===o.key?t(0):t(-1);else if(!e.props.searchValue){e.props.searchValue=null;const t=We(e),n=null===(r=t[t.length-1])||void 0===r?void 0:r.end;o.target.selectionStart<n&&(o.target.selectionStart=Math.max(0,"ArrowLeft"===o.key?o.target.selectionStart-2:o.target.selectionEnd+2))}}else if(["Delete","Backspace"].includes(o.key))e.props.highlightedRange&&!e.props.searchValue?(x(e,e.props.highlightedRange.option),0===e.props.inputStd.length&&(e.props.highlightedRange=void 0)):o.target instanceof HTMLInputElement&&(e.props.searchValue=null,t(-1,!0)&&o.preventDefault());else if(o.target instanceof HTMLInputElement&&0===o.target.selectionStart&&o.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)o.preventDefault();else if("Tab"===o.key)return;"ArrowLeft"===o.key&&t(-1,!0)&&o.preventDefault()}(e,n)};const n=e.context.handlers.focus;e.context.handlers.focus=t=>{n(e,t);const o=new Event("selectionchange");document.dispatchEvent(o)},e.on("blur",(()=>{e.props.selections.length?(e.props.inputText=e.props.selections.map((e=>e.label)).join(", "),e.props.searchValue=null):e.props.selections.length||(e.props.inputText="",e.props.searchValue="")}))})),e.on("prop:expanded",(({payload:t})=>{t||e.props.inputStd.length?t&&(e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],v(e,e.props.searchValue))):(e.props.searchValue="",e.props.inputText="")})),e.on("prop:selections",(()=>{var t;const o=[...e.props.selections].map((e=>e.label)).join(", ");let n="";if(_a&&e.isCreated){const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);if(null==o||o.focus(),f()===o&&Array.isArray(e._value)&&e._value.length){if(e.props.max&&e._value.length>=Number(e.props.max))return;n=", "}}e.props.inputText=`${o}${n}`,e.props.reloadOnCommit&&(e.props.searchValue="",v(e,e.props.searchValue))}));const t=(t,o=!1)=>{var n,r;const s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);if(!(s instanceof HTMLInputElement))return!1;const a=We(e),l=t>=0?t: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 o;e.on("selectRange",(({payload:e})=>t(...e))),e.on("prop:highlightedRange",(({payload:t})=>{e.props.hasHighlightedRange=!!t,t&&e.props.expanded&&o!==t.option&&(o=t.option,_(e))}))}function Re(e){var t;if(!_a)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 Ke(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 We(e){const t=Dr(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 Ye(e){!function(e){e.on("prop:expanded",(({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],v(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&&v(e,e.props.searchValue,!0))}))}(e)}function qe(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.searchExpand||(e.props.options=[],v(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&&v(e,e.props.searchValue,!0)}))}(e)}function Ue(e,t){var o;if(_l.has(e))return;_l.set(e,[]),t.reverse&&Vl.add(e),t.prefix&&Bl.set(e,t.prefix),t.suffix&&Pl.set(e,t.suffix),Xe(e,t.pattern,t.partOverrides,t.explicitParts);const n=Dl.get(e),r=null==n?void 0:n.some((e=>et(e))),s=null==n?void 0:n.some((e=>function(e){return!!e&&("group"===e.type&&Array.isArray(e.parts))}(e)));if(r&&s)throw new Error("Cannot use enums and groups in the same mask.");const a=r?"select":null!==(o=t.mode)&&void 0!==o?o:"shift";if(s&&"select"===a)throw new Error("Cannot use groups in select mode.");(t.placeholder||"select"===a)&&Al.add(e),Il.set(e,a),t.onChange&&Ol.set(e,t.onChange),e.addEventListener("beforeinput",(o=>{if(Ul)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=_l.get(e);if(null==r?void 0:r.length){const o=(null!==(n=kl.get(e))&&void 0!==n?n:r.length-1)+(t.endsWith("Undo")?-1:1),s=r[o];if(!s)return;ct(e,s),e.setSelectionRange(...s.selectionAfter),kl.set(e,o),Ol.has(e)&&Ol.get(e)(s,e)}}),{once:!0})}(e,o.inputType);o.preventDefault();const n=(r=o.inputType).startsWith("insert")?"insert":!!r.startsWith("delete")&&("deleteContentForward"===r?"deleteContentForward":"deleteContentBackward");var r;const s=rt(e),a=e.value;n&&st(e,{type:n,selectionBefore:s,data:o.data,valueBefore:a,suffix:t.suffix,prefix:t.prefix})})),"select"===a&&e.addEventListener("keydown",(t=>{switch(t.key){case"ArrowRight":return t.preventDefault(),Ot(e);case"ArrowLeft":return t.preventDefault(),Ot(e,-1);case"ArrowUp":return void(Ft(e,1)&&t.preventDefault());case"ArrowDown":return void(Ft(e,-1)&&t.preventDefault());case"Tab":return Rl?void t.preventDefault():void(Ot(e,t.shiftKey?-1:1)&&t.preventDefault())}})),e.addEventListener("focus",(()=>function(e){var t;const o=Al.has(e),n=Il.get(e);if(o){let o=null,r=null,s=!1;const a="shift"===n?0:1,l=e.value;xt(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),(Qe(t)||et(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"===Il.get(e)){const[o]=It(e),n=Bt(e,t);void 0!==n&&n in o&&(t=o[n])}return function(e,t,o=50){Ml.set(e,lt(e,t));const n=async()=>{if(!ql||f()!==e)return;"select"===Il.get(e)&&(await new Promise((e=>setTimeout(e,10))),function(e){let t=rt(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=it(e,t);const[o]=It(e),n=Bt(e,t),r=t[0];void 0!==n&&o.some((e=>r>=e[0]&&r<e[1]))&&Ml.set(e,lt(e,o[n]))}(e));const t=Ml.get(e);t&&e.setSelectionRange(...t)};n(),document.addEventListener("selectionchange",n),setTimeout((()=>{document.removeEventListener("selectionchange",n),Ml.delete(e)}),o)}(e,t)}}}(e))),e.addEventListener("selection",(t=>function(e,t){if(Ml.get(e))return;Kt(e),t=it(e,t);const[o]=It(e),n=Bt(e,t),r=void 0!==n&&lt(e,o[n]);r&&!nt(t,r)&&dt(e,r,!0)}(e,t.detail))),st(e,{type:"insert",selectionBefore:[0,0,"forward"],data:e.value,valueBefore:"",suffix:t.suffix,prefix:t.prefix})}function ze(e){var t,o;if(Nl.has(e))return;const n=null!==(t=_l.get(e))&&void 0!==t?t:[],r=n[null!==(o=kl.get(e))&&void 0!==o?o:n.length-1];if(r){const t=r.selectionAfter,[o,n]=It(e,r.valueAfter),s=Bt(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"];Nl.set(e,[r,l])}}}function je(e){Nl.delete(e)}function Ze(e,t){const o="string"==typeof e||!_l.has(e),n="string"==typeof e?Ge(e):e;if(o)t.prefix&&Bl.set(n,t.prefix),t.suffix&&Pl.set(n,t.suffix),n.value=at(n,n.value),Ue(n,t);else{const e=Pt(n),o=n.value;n.value="",st(n,{type:"insert",selectionBefore:[0,e?e.valueAfter.length:0,"none"],valueBefore:e?e.valueAfter:"",data:o,suffix:t.suffix,prefix:t.prefix})}return n.value}function Ge(e){return{value:e,selectionStart:0,selectionEnd:0,scrollWidth:0,clientWidth:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function Xe(e,t,o,n,r){r=e&&Vl.has(e)||r;const s=(null!=n?n:function(e){const t=Object.values(Wl);if(!e)return t;const o={...e},n=[];for(const r of t)if(!ot(r))if("token"in r&&r.token in e){const t={...r,...e[r.token]};Je(t)&&n.push(t),delete o[r.token]}else n.push(r);const r=Object.values(o);for(const e of r)Je(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=ut(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=Xe(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&&Dl.set(e,c),c}function Je(e){return!!e&&(ot(e)||Qe(e)||et(e))}function Qe(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&tt(e))}function et(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&tt(e))}function tt(e){return!!e&&("placeholder"in e&&"token"in e)}function ot(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function nt(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function rt(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 st(e,t){var o;Vl.has(e)&&Rt(t);let n=!1;switch(Fl.set(e,"playing"),t.type){case"insert":n=function(e,t){let o=pt(t);const n=t.selectionBefore,r=function(e,t){var o,n,r;if("select"===Il.get(e)){const[s,a]=It(e),l=s.findIndex((e=>nt(e,t.selectionBefore))),i=null!==(o=a[l])&&void 0!==o?o:null;if(Qe(i)){const e=t.selectionBefore,o=e[1]-e[0],s=t.valueBefore.substring(e[0],e[1]),a="left"===i.selectDirection,l=bt(s,i),p=a?0:function(e,t,o){if(!e)return 0;let n="";for(;e.length;){const o=ut(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(et(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=xt(e,t,o);return Ll.set(e,s.endPos),{...t,valueAfter:s.value,selectionAfter:yt(e,s),unmasked:s.unmasked,complete:s.complete,meta:s.meta}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":n=function(e,t){const o=pt(t),n=t.selectionBefore,r=Vl.has(e);let s=n[0],a=n[1];s===a&&("deleteContentBackward"!==t.type||r?a+=ft(o,s):s-=ft(o,s,"backward"));const l=Il.get(e);let i="";if("select"===l){const[o,n]=It(e),r=Bt(e,[s,a,"none"]);if(void 0!==r){const l=n[r],p=o[r];Qe(l)?i=l.placeholder.repeat(a-s):et(l)&&([i,s]=nt(p,rt(e))?[l.placeholder,s]:function(e,t,o,n){const r=n.valueBefore,s=ft(r,n.selectionBefore[0],"backward"),a=Math.max(o[0],n.selectionBefore[0]-s),l=r.substring(o[0],a),i=Mt(t.values,l);let p=null==i?void 0:i.substring(l.length);i&&!p&&Tt(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=xt(e,t,p);return{...t,valueAfter:d.value,selectionAfter:Lt(e,d,t,s),unmasked:d.unmasked,complete:d.complete,meta:d.meta}}(e,t)}if(Vl.has(e)&&n&&Rt(n),n&&function(e,t){t.prefix&&(t.valueAfter=t.prefix+t.valueAfter,t.selectionAfter=lt(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)){Ol.has(e)&&Hl.set(e,(()=>{Hl.delete(e),n&&Ol.get(e)(n,e)})),Fl.set(e,"beforeCallback");let t=null!==(o=_l.get(e))&&void 0!==o?o:[];const r=kl.get(e);r&&(t=t.slice(0,r),kl.delete(e)),t.push(n),_l.set(e,t),ql&&f()===e&&"function"==typeof document.execCommand&&!Ul?(dt(e,[0,e.value.length,"forward"],!0),Ul=!0,document.execCommand("insertText",void 0,n.valueAfter),Ul=!1):ct(e,n),ql&&f()===e&&dt(e,n.selectionAfter);const s=Hl.get(e);s&&s(),Kt(e)}Fl.set(e,"complete")}function at(e,t){var o,n;const r=null!==(o=Bl.get(e))&&void 0!==o?o:"",s=null!==(n=Pl.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 lt(e,t){const o=Bl.get(e),n=[...t];return o&&(n[0]+=o.length,n[1]+=o.length),n}function it(e,t){const o=Bl.get(e),n=[...t];return o&&(n[0]-=o.length,n[1]-=o.length),n}function pt(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 dt(e,t,o=!1){o&&(Sl.add(e),setTimeout((()=>Sl.delete(e)),5)),Ml.get(e)&&Ml.set(e,t),e.setSelectionRange(...t)}function ct(e,t,o="After"){if(e.value=t[`value${o}`],ql){const o=new InputEvent("input",{inputType:"insert"===t.type?"insertText":t.type,data:t.data});e.dispatchEvent(o)}}function ut(e){if(null==e)return"";const t=Cl.test(e.charAt(0))&&Cl.test(e.charAt(1))?2:1;return e.substring(0,t)}function ft(e,t,o="forward"){if("backward"===o)return 0===t?0:1===t?1:Cl.test(e.charAt(t))&&Cl.test(e.charAt(t-1))?2:1;const n=e.length-t;return 0===n?0:1===n?1:ut(e.substring(t)).length}function ht(e,t){const o=ut(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 vt(e){const t=ut(e.buffer),o=t.length;e.value+=t,e.pos+=o,e.buffer=e.buffer.substring(o)}function mt(e,t){const o=ut(t),n=o.length;return e.value+=o,e.pos+=n,t.substring(n)}function gt(e,t){for(;t.buffer;){const o=ut(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 $t(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(ft(t.buffer,0))}return null}function bt(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 yt(e,t){let o=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return o;const n=rt(e);o=[n[0],t.endPos,"none"];const[r,s]=It(e,t.value),a=Bt(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(Qe(i)&&bt(p,i).length===p.length&&a<r.length-1)return Kl(),r[a+1];if(et(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=Mt(o.values,r);if(s)return At(r,s).length-n.length;return 0}(t,l[0],i);if(t.insertPos+o===l[1])return Tt(i.values,p)?[l[1],l[1],"forward"]:(Kl(),r[a+1]?r[a+1]:r[a]);const s=[t.insertPos+o,l[1],"none"];return nt(s,n)||(Sl.add(e),setTimeout((()=>Sl.delete(e)),5)),s}return l}function xt(e,t,o,n){var r,s;const a=null!==(r=Dl.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:Al.has(e),buffer:o,data:t.data,originalData:t.data,value:"",mode:Il.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:It(e),unmasked:"",complete:!0,cycle:t.cycle,meta:[]};return wt(a,l,void 0,n),l}function wt(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":kt(o,t,e.at(-1)===o);break;case"char":St(o,t,l);break;case"enum":_t(o,t);break;case"group":const a={repeat:null!==(s=o.repeat)&&void 0!==s&&s,nextPart:r,repeats:0,placeholder:!!o.placeholder};wt(o.parts,t,a,n)}if(n){if(!1===n(t,o))break}const a=ot(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++,wt(e,t,o,n);if(!s){t.complete=!1;const o=e.reverse().find((e=>"literal"===e.type));e.reverse(),ot(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 _t(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=Mt(e.values.concat([e.placeholder]),n);if(r){const s=At(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):$t(e,t),t.endPos=t.pos+s.length,void(t.pos=t.value.length)}t.data=""}if(t.buffer){const o=$t(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 kt(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?ut(t.data):"",s=ut(n);if(e===s)n=ht(t,n),t.meta.push({type:"literal",value:s}),r=!0;else if(!r||t.data||null===t.data||t.placeholder||o)n=mt(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 St(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=ut(t.data);if(e.pattern.test(n))return ht(t),t.meta.push({type:"char",value:n}),t.chars++,t.unmasked+=n,void gt(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=ut(t.buffer);if(e.pattern.test(n))return t.chars++,t.unmasked+=n,vt(t),void t.meta.push({type:"char",value:n});if(t.placeholder&&n===e.placeholder)return vt(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 Lt(e,t,o,n){const r=[n,n,"none"];if("select"===t.mode){const s=It(e),a=Bt(e,r,s),[l,i]=It(e,t.value),p=void 0!==a&&Dt(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)=>Dt(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 Dt(e,t,o){if(ot(o))return!1;if(Qe(o)){let n=t[0];for(;n<t[1];){const t=ut(e.substring(n));if(t!==o.placeholder)return!1;n+=t.length}}return!et(o)||e.substring(t[0],t[1])===o.placeholder}function At(e,t){let o="";do{const n=ut(e).toLowerCase(),r=ut(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 It(e,t){const o=Dl.get(e);if(!o)return[[],[]];if(Tl.has(e))return Tl.get(e);const n=null!=t?t:at(e,e.value),r=[],s=[];let a=null,l=null,i=0,p=!0;for(const e of o)if(ot(e))a=e,null!==l&&(r.push([l,i,"none"]),l=null),i+=e.value.length;else{if(Qe(a)&&Qe(e)&&e.token===a.token)i++;else if(Qe(e))null===l?(l=i,s.push(e)):(r.push([l,i,"none"]),l=i,s.push(e)),i++;else if(et(e)){l&&r.push([l,i,"none"]),Et(e)||(p=!1);const t=Ct(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&&Tl.set(e,d),d}function Ct(e,t,o){if(Et(t))return t.values[0].length;const n=e.slice(o),r=Mt(t.values.concat([t.placeholder]),n);return r?r.length:0}function Mt(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=ut(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=Mt(l,t.substring(s.length),o,a))&&void 0!==r?r:l[0])}function Tt(e,t){return t=t.toLowerCase(),e.some((e=>(e=e.toLowerCase()).startsWith(t.toLocaleLowerCase())&&e!==t))}function Et(e){if(!El.has(e)&&Array.isArray(e.values)&&e.values.length>0){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;El.set(e,e.values.every((e=>e.length===t)))}return El.get(e)}function Ot(e,t=1){const[o]=It(e),n=Bt(e,it(e,rt(e)));return void 0!==n&&void 0!==o[n+t]&&(e.setSelectionRange(...lt(e,o[n+t])),!0)}function Ft(e,t=1){const[o,n]=It(e),r=Bt(e,rt(e));if(void 0!==r&&r in n){const s=n[r];if(et(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((()=>st(e,t)),0),!0}}}return!1}function Vt(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 Vt(e.slice(...r),t)}function Bt(e,t,o){const[n]=null!=o?o:It(e),r=n.findIndex((e=>e[0]!==e[1]&&(!!nt(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=Vt([...s],t[1]);return l in a?a[l]:void 0}function Pt(e){var t,o;const n=null!==(t=_l.get(e))&&void 0!==t?t:[];return n[null!==(o=kl.get(e))&&void 0!==o?o:n.length-1]}function Ht(e,t=!1){const o=Pt(e);return o&&(o.complete||t)?Vl.has(e)?[...o.unmasked].reverse().join(""):o.unmasked:t?"":null}function Nt(e){var t;const o=Pt(e);return null!==(t=null==o?void 0:o.meta)&&void 0!==t?t:null}function Rt(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 Kt(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}))}}function Wt(e){if(e||(e=new Date),e instanceof Date){const t=new Date(e);return t.setMilliseconds(0),t}if(function(e){const t=e.match(zl);if(t){const e=Number(t[2]);if(e<1||e>12)return!1;if(void 0!==typeof t[3]){const e=Number(t[3]);if(e<1||e>31)return!1}if(void 0!==typeof t[4]){const e=Number(t[4]);if(e<0||e>23)return!1}return!0}return!1}(e=e.trim()))return new Date(function(e){const t=e.match(zl);return t&&void 0===t[4]?e+"T00:00:00":e}(e));throw new Error(`Non ISO 8601 compliant date (${e}).`)}function Yt(e,t=1){const o=Wt(e);return o.setDate(o.getDate()+t),o}function qt(e){const t=Wt(e);return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),t}function Ut(e){return qt(e).getDate()}function zt(e,t=1,o=!1){const n=Wt(e),r=n.getDate();if(o||n.setDate(1),n.setMonth(n.getMonth()+t),!o){const e=Ut(n);n.setDate(e<r?e:r)}return n}function jt(e,t=1,o=!1){const n=Wt(e),r=n.getDate();if(o||n.setDate(1),n.setFullYear(n.getFullYear()+t),!o){const e=Ut(n);n.setDate(e<r?e:r)}return n}function Zt(e){return"literal"===e.type&&(e.value=e.value.normalize("NFKC")),e}function Gt(e,t,o,n=!1){function r({partName:e,partValue:t,token:n}){if("literal"===e)return t;const r=s[e];if("hour"===e&&"H"===n)return r.replace(/^0/,"");if(!("minute"!==e&&"second"!==e||"mm"!==n&&"ss"!==n||1!==r.length))return`0${r}`;if("dayPeriod"===e){const e=eo(a.getHours()<12?"am":"pm",o);return"A"===n?e.toUpperCase():e.toLowerCase()}return"timeZoneName"===e?Xt(-1*a.getTimezoneOffset()):r}const s=function(e,t,o,n=!1){function r(e,t=!1){const r=`${o}-u-hc-${t?"h12":"h23"}`;if(i.push(...new Intl.DateTimeFormat(r,e.reduce(((e,t)=>"literal"===t.partName?e:(n&&ei.includes(t.token)&&p.push(t),Object.assign(e,t.option))),{})).formatToParts(s).map(Zt)),n&&p.length)for(const e of p){let t=[];switch(e.token){case"MMMM":t=new Intl.DateTimeFormat(r,{dateStyle:"long"}).formatToParts(s).map(Zt);break;case"MMM":t=new Intl.DateTimeFormat(r,{dateStyle:"medium"}).formatToParts(s).map(Zt)}const o=t.find((t=>t.type===e.partName)),n=i.findIndex((t=>t.type===e.partName));o&&n>-1&&(i[n]=o)}}const s=Wt(e),a=t.filter((e=>e.hour12)),l=t.filter((e=>!e.hour12)),i=[],p=[];a.length&&r(a,!0);l.length&&r(l);return i.reduce(((e,t)=>(e[t.type]=t.value,e)),{})}(e,t,o,n),a=Wt(e);return t.map((e=>({...e,value:r(e)})))}function Xt(e){return`${e<0?"-":"+"}${String(Math.floor(Math.abs(e/60))).padStart(2,"0")}${String(Math.abs(e%60)).padStart(2,"0")}`}function Jt(e){if(!/^([+-])[0-3][0-9][0-6][0-9]$/.test(e))throw new Error(`Invalid offset: ${e}`);return e}function Qt(e){return["numeric","2-digit"].includes(e.partValue)}function eo(e,t){const o=oi.get(t);if(o&&o[e])return o[e];const n=new Date(jl);n.setUTCHours("am"===e?5:20);const r=new Intl.DateTimeFormat(t,{timeStyle:"full",timeZone:"UTC",hour12:!0}).formatToParts(n).map(Zt).find((e=>"dayPeriod"===e.type));if(r){const n=o||{};return oi.set(t,Object.assign(n,{[e]:r.value})),r.value}return e}function to(e,t="+0000"){const o=Wt(e),n=function(e){Jt(e);const[t,o,n,r]=e.match(/([+-])([0-3][0-9])([0-6][0-9])/),s=60*Number(n)+Number(r);return"+"===o?s:-s}(t);return new Date(o.getTime()+1e3*n*60)}function oo(e,t){const o=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZone:t,hourCycle:"h23"}).formatToParts(e).map(Zt),n={};return o.forEach((e=>{n[e.type]=e.value})),new Date(`${n.year}-${n.month}-${n.day}T${n.hour}:${n.minute}:${n.second}Z`)}function no(e,t="UTC",o="device"){o="device"===o?Intl.DateTimeFormat().resolvedOptions().timeZone:o;const n=Wt(e),r=oo(n,t);return Xt((oo(n,o).getTime()-r.getTime())/1e3/60)}function ro(e,t){function o(e,[t,o,n]){const r=Object.keys(o)[0];return{option:o,partName:r,partValue:o[r],token:t,pattern:n,hour12:e}}if(ni.includes(e)||"object"==typeof e)return function(e,t){const o={timeZone:"UTC"};"string"==typeof e?o.dateStyle=e:("date"in e&&(o.dateStyle=e.date),"time"in e&&(o.timeStyle=e.time));const n=new Intl.DateTimeFormat(t,o),r=n.formatToParts(new Date(jl)).map(Zt),s=n.formatToParts(new Date("1999-04-05T23:05:01.000Z")).map(Zt).find((e=>"hour"===e.type)),a=s&&"23"===s.value?24:12;return r.map((e=>{const o=e.type,n=function(e,t,o,n){const r=t.length,s=!isNaN(Number(t));let a;switch(e){case"year":return 2===r?ti.get("YY"):ti.get("YYYY");case"month":return s?1===r?ti.get("M"):ti.get("MM"):(a=so(o,e,t),"long"===a?ti.get("MMMM"):ti.get("MMM"));case"day":return 1===r?ti.get("D"):ti.get("DD");case"weekday":switch(a=so(o,e,t),a){case"narrow":return ti.get("d");case"short":return ti.get("ddd");default:return ti.get("dddd")}case"hour":return 12===n?1===r?ti.get("h"):ti.get("hh"):1===r?ti.get("H"):ti.get("HH");case"minute":return 1===r?ti.get("m"):ti.get("mm");case"second":return 1===r?ti.get("s"):ti.get("ss");case"dayPeriod":return/^[A-Z]+$/u.test(t)?ti.get("A"):ti.get("a");case"literal":return[t,{literal:t},new RegExp("")];case"timeZoneName":const l=t.split("-");return 2===l.length&&4===l[1].length?ti.get("ZZ"):ti.get("Z");default:return}}(e.type,e.value,t,"hour"===e.type?a:void 0);if(void 0===n)return;const r=n[1][o];return r?(n[2]||(n[2]=new RegExp(`${n[0]}`,"g")),{option:{[o]:r},partName:o,partValue:r,token:n[0],pattern:n[2],hour12:12===a}):void 0})).filter((e=>!!e))}(e,t);let n=e,r=0;const s=e=>{if(e[2]||(e[2]=new RegExp(`(.)?(${e[0]})`,"g")),e[2].test(n)){let t=0;return n=n.replace(e[2],((e,o,n)=>"\\"===o?n:`${"string"==typeof o?o:""}{!${t++?r:r++}!}`)),!!t}return!1},a=function(e){const t=e.map((e=>e.partName)),o=new Set(t);if(t.length>o.size)throw new Error("Cannot reuse format tokens.");return e}(Gl.filter(s).concat(Xl.filter(s)).map(o.bind(null,!1)).concat(Jl.filter(s).map(o.bind(null,!0)))),l=/^\{!(\d+)!\}$/;return n.split(/(\{!\d+!\})/).map((e=>{const t=e.match(l);return t?a[Number(t[1])]:{option:{literal:e},partName:"literal",partValue:e,token:e,pattern:new RegExp(""),hour12:!1}})).filter((e=>!("literal"===e.partName&&""===e.partValue)))}function so(e,t,o){if(!Zl.has(e)){const t=new Date(jl),o=[3,8,9,7,6,4,3],n=["weekday","month","dayPeriod"],r=["long","short","narrow"],s={};for(let a=0;a<12;a++){t.setMonth(0+a),a in o&&t.setDate(o[a]),t.setUTCHours(8+a);for(const o of r){const r=new Intl.DateTimeFormat(e,n.reduce(((e,t)=>Object.assign(e,{[t]:o})),{hour12:!0,timeZone:"UTC"})).formatToParts(t).map(Zt);if("long"===o||"short"===o){const n=new Intl.DateTimeFormat(e,{dateStyle:"short"===o?"medium":"long"}).formatToParts(t).map(Zt).find((e=>"month"===e.type)),s=r.findIndex((e=>"month"===e.type));s>-1&&n&&(r[s]=n)}r.forEach((e=>{if("literal"===e.type)return;const t=e.type;s[t]=Object.assign(s[t]||{},{[e.value]:o})}))}}Zl.set(e,s)}const n=Zl.get(e);return n?n[t][o]:void 0}function ao(e,t="+0000"){const o="+"===t.slice(0,1);return to(e,t.replace(o?"+":"-",o?"-":"+"))}function lo(e,t="long",o="device",n=!1,r){let s;return"object"!=typeof e||e instanceof Date||({date:e,format:t,locale:o,genitive:n,partFilter:r,tz:s}=e),"ISO8601"===t?Wt(e).toISOString():(s&&(e=ao(e,no(e,s))),o&&"device"!==o||(o=Intl.DateTimeFormat().resolvedOptions().locale),Gt(e,ro(t,o).filter(null!=r?r:()=>!0),o,n).map((e=>e.value)).join(""))}function io(e,t="en",o=!1,n=(()=>!0)){return ro(e,t).filter(n).reduce(((e,t)=>e+(o&&"literal"===t.partName?function(e){return Gl.concat(Xl).concat(Jl).sort(((e,t)=>e[0].length>t[0].length?1:-1)).reduce(((e,t)=>e.replace(t[0],`\\${t[0]}`)),e)}(t.token):t.token)),"").normalize("NFKC")}function po(e){const t=Wt(e);return t.setDate(1),t.setHours(0,0,0),t}function co(e,t,o=7){let n,r;const s=Wt(e);switch(o){case"month":r=s.getDate(),n=Ut(s)-s.getDate();break;case"week":r=s.getDay()+1,n=6-s.getDay();break;case"year":const e=function(e){const t=Wt(e);return(new Date(t.getFullYear()+1,0,0).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5}(s),t=function(e){const t=Wt(e);return Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5)}(s);r=t,n=e-t;break;default:n=r=o}for(let e=0;e<=n||e<r;e++){if(e<=n){const o=Yt(s,e);if(t(o))return o}if(e&&e<=r){const o=Yt(s,-e);if(t(o))return o}}return null}function uo(e,t="en",o=!1){const n=(e,t)=>Array(e).fill("").map(((e,o)=>`${t(o)}`));if("M"===e)return n(12,(e=>e+1));if("MM"===e)return n(12,(e=>{const t=e+1;return t<10?`0${t}`:t}));if(e.startsWith("M"))return uo("MM").map((n=>lo(`2000-${n}-05`,e,t,o)));if(e.startsWith("d"))return n(7,(e=>`0${e+2}`)).map((o=>lo(`2022-10-${o}`,e,t)));if("a"===e)return[eo("am",t).toLowerCase(),eo("pm",t).toLowerCase()];if("A"===e)return[eo("am",t).toUpperCase(),eo("pm",t).toUpperCase()];if(e.startsWith("Y")){const o=(new Date).getFullYear();return n(120,(e=>e+1)).reduce(((n,r)=>("120"!==r&&n.push(lo(`${o+Number(r)}-06-06`,e,t)),n.unshift(lo(o-Number(r)+"-06-06",e,t)),n)),[lo(`${o}-06-06`,e,t)])}return e.startsWith("D")?n(31,(t=>`${"DD"===e&&t<9?"0":""}${t+1}`)):e.startsWith("H")?n(24,(t=>`${"HH"===e&&t<10?"0":""}${t}`)):e.startsWith("h")?n(12,(t=>`${"hh"===e&&t<9?"0":""}${t+1}`)):e.startsWith("m")||e.startsWith("s")?n(60,(t=>`${e.length>1&&t<10?"0":""}${t}`)):[]}function fo(e,t="ISO8601",o="device"){let n,r=()=>!0,s="backward";if("object"==typeof e?({date:n,format:t="ISO8601",locale:o="device",dateOverflow:s="backward",partFilter:r=(()=>!0)}=e):n=e,!n)throw new Error("parse() requires a date string.");const a=()=>{throw new Error(`Date (${n}) does not match format (${io(t,o)})`)};if("ISO8601"===t)return Wt(n);const l=ni.includes(t)||"object"==typeof t,i=function(e){let t;for(const o of e){if("literal"===o.partName&&!isNaN(parseFloat(o.partValue)))throw new Error(`Numbers in format (${o.partValue}).`);if(t&&"literal"!==t.partName&&"literal"!==o.partName&&!(t.token in Ql||o.token in Ql||Qt(t)&&"a"===o.token.toLowerCase()))throw new Error(`Illegal adjacent tokens (${t.token}, ${o.token})`);t=o}return e}(ro(t,o).filter(r));if(!i.length)throw new Error("parse() requires a pattern.");let p;try{p=ho(n,i)}catch{return a()}const d=new Date,c=new Map([["YYYY",d.getFullYear()],["MM",d.getMonth()+1],["DD",d.getDate()],["HH",0],["mm",0],["ss",0]]);let u=null,f="";p.forEach((e=>{if("literal"===e.partName)return;if(e.token===e.value)return a();const t=Number(e.value);if(c.has(e.token))c.set(e.token,t);else if("YY"===e.token)c.set("YYYY",function(e){const t=(new Date).getFullYear(),o=t%100,n=Math.floor(t/100),r=Number(e);return 100*(n+(r>o+20?-1:0))+r}(e.value));else{const n=e.token;if(n.startsWith("d"))return;if("D"===n)c.set("DD",t);else if("H"===n||n.startsWith("h"))c.set("HH",t);else if("M"===n)c.set("MM",t);else if("a"===n||"A"===n)u=e.value.toLowerCase()===eo("am",o).toLowerCase();else if("Z"===n)f=Jt(e.value);else{const t=uo(n,o,l).indexOf(e.value);if(-1!==t)switch(n){case"MMM":case"MMMM":c.set("MM",t+1)}}}}));let h=c.get("HH")||0;!1===u?(h+=12===h?0:12,c.set("HH",24===h?0:h)):!0===u&&12===h&&c.set("HH",0),c.set("MM",(c.get("MM")||1)-1);let[v,m,g,$,b,y]=Array.from(c.values());const x=Ut(new Date(`${si(v)}-${ri(m+1)}-10`));if(x<g&&"throw"===s)throw new Error(`Invalid date ${si(v)}-${ri(m+1)}-${ri(g)}`);g="backward"===s?Math.min(g,x):g;const w=`${si(v)}-${ri(m+1)}-${ri(g)}T${ri($)}:${ri(b)}:${ri(y)}${f}`,_=new Date(w);return isFinite(+_)?_:a()}function ho(e,t){let o=0;let n=0;const r=[];let s;do{const[l,i]=[(a=t)[o++],a[o]];s=i;let p=1;if("literal"===l.partName)p=l.partValue.length;else if(l.token in Ql)p=Ql[l.token];else if(i)if("literal"===i.partName){if(p=e.indexOf(i.partValue,n)-n,p<0)throw new Error}else if("dayPeriod"===i.partName){for(let t=1;t<=4;t++)if(isNaN(Number(e.charAt(n+t)))){p=t;break}}else{const t=e.substring(n).search(/\d/);-1!==t&&(p=n+t)}else p=e.length;r.push({...l,value:e.substring(n,n+p)}),n+=p}while(s);var a;return r}function vo(e,t){const o=Wt(e),n=Wt(t);return o.getDate()===n.getDate()&&o.getMonth()===n.getMonth()&&o.getFullYear()===n.getFullYear()}function mo(e,t=0){const o=Wt(e);let n=t-o.getDay();return n>0&&(n-=7),o.setDate(o.getDate()+n),o.setHours(0,0,0),o}function go(e){return"timeZoneName"!==e.partName}function $o(e,t){const o=[],n=Wt(t);n.setDate(1);let r=mo(n,e.props.weekStart);r.setHours(n.getHours(),n.getMinutes(),n.getSeconds());const s=function(e,t=0){const o=mo(e,t);return o.setDate(o.getDate()+6),o.setHours(23,59,59),o}(qt(t),e.props.weekStart);let a=[];do{a.push(r),7===a.length&&(o.push(a),a=[]),r=Yt(r)}while(r.getTime()<=s.getTime());return{monthDay:n,weeks:o}}function bo(e){e.props.calendar=n(e.props.showMonths,(e=>e)).map((t=>$o(e,zt(e.props.renderedDate,t)))),e.props.years=function(e){const t=Number(lo(e.props.renderedDate,"YYYY")),o=t-t%10;return e.props.decade=`${o} - ${o+9}`,n(10,(n=>jt(e.props.renderedDate,o+n-t)))}(e),e.props.months=function(e){const t=Wt(e.props.renderedDate);return t.setMonth(0),n(12,(e=>zt(t,e)))}(e)}function yo(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 xo(e,t){if(!t)return e.props.inputText="",new Date;const o=t instanceof Date?t:fo(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(o,e.props.format,e.props.locale,!1,go),o}function wo(e){return Array.isArray(e.props.sequence)?pn.clone(e.props.sequence):["day"]}function _o(e,t,o=!0){var n,r;if(e._value===t)return;if(null==t)return e.input(t,o);e.props.offset=e.props.timezone?no(t,e.props.timezone):"+0000";const s=to(t,null!==(n=(r=e.props).offset)&&void 0!==n?n:r.offset="+0000");e.input(lo(s,e.props.valueFormat,e.props.valueLocale,!1),o)}function ko(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 So(e,t){var o;let n="";if(!(t instanceof HTMLInputElement)||e.props.pickerOnly)return;di.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`)?fi.add(e):fi.delete(e)})),e.on("prop:inputText",(({payload:e})=>{e!==t.value&&("beforeCallback"===Fl.get(t)&&(n=t.value),ze(t),t.selectionStart=0,t.selectionEnd=t.value.length,function(e,t){var o,n;if(!_l.has(e))return;const r=null!==(o=Bl.get(e))&&void 0!==o?o:"",s=null!==(n=Pl.get(e))&&void 0!==n?n:"";st(e,{type:"insert",selectionBefore:rt(e),data:t,valueBefore:e.value,suffix:s,prefix:r})}(t,e),t.value=e,setTimeout((()=>je(t)),10))}));const[r,s]=Do(e);Ue(t,{pattern:r,explicitParts:s,onChange:({valueAfter:o})=>{if(Lo(e),li.has(e))return li.delete(e);n&&n===o?n="":(ze(t),e.props.inputText=o,setTimeout((()=>je(t)),10))}})}function Lo(e){var t,o;if(e.props.overlay){const n=di.get(e);!n||!(null===(t=e.props.attrs)||void 0===t?void 0:t.placeholder)||e._value||Ht(n,!0)||e.props._isFocused||e.props.activeDate&&e.props.expanded?n&&(e.props._isPlaceholder=!1,e.props._overlayParts=u(Nt(n))):(e.props._isPlaceholder=!0,e.props._overlayParts=[{type:"placeholder",value:null===(o=e.props.attrs)||void 0===o?void 0:o.placeholder}])}}function Do(e){const t=e.props.locale,o=["full","long","medium","short"].includes(e.props.format)||"object"==typeof e.props.format,r=ro(e.props.format,t);return[io(e.props.format,t,!0,go),r.reduce(((r,s)=>{if("literal"===s.partName)return r;let a=uo(s.token,t,o);if("YYYY"===s.token&&e.props.minDate&&e.props.maxDate){const t=e.props.minDate.getFullYear();a=n(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 r.push(l),s.token.startsWith("D")&&ci.set(e,a),r}),[])]}function Ao(e,t){return!t||(!!(e.props.minDate&&t<e.props.minDate)||(!!(e.props.maxDate&&t>e.props.maxDate)||void 0))}function Io(e){return"function"==typeof e.props.validationLabel?e.props.validationLabel(e):e.props.validationLabel||e.props.label||e.props.name||String(e.name)}function Co(e,t){var o,n;if(t instanceof HTMLInputElement&&!vi.get(e)&&hi){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){vi.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 Mo(e){e.addProps(["_overlayStyles","_overlayParts","_overlayInnerStyles","_isPlaceholder"]),e.props._overlayStyles={position:"absolute",top:"0",left:"0",pointerEvents:e.props._isPlaceholder?"auto":"none"},e.props._overlayInnerStyles={overflow:"hidden",whiteSpace:"nowrap",paddingRight:"20px"},e.on("created",(()=>{e.props.overlay=pn.undefine(e.props.overlay),e.props.pickerOnly=pn.undefine(e.props.pickerOnly),e.props.overlay=e.props.pickerOnly?void 0:e.props.overlay,e.props.overlay&&pn.whenAvailable(`${e.props.id}`,Co.bind(null,e),e.props.__root)})),e.on("prop:_isPlaceholder",(()=>{e.props._overlayStyles={...e.props._overlayStyles,pointerEvents:e.props._isPlaceholder?"auto":"none"}}))}function To(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);rp.set(e,t),Ue(t,{...np.get(e),onChange:({valueAfter:t,meta:o})=>{e.props._maskValue=t,e.input({maskValue:t}),e.props._overlayParts=u(o)}})}function Eo(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 Oo(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=>h(e)));Array.isArray(e.value)?e.input([...e.value,...o]):e.input(o),e.props.selectedSourceItems=[]}function Fo(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=>h(e)));if(Array.isArray(e.value)){const t=e.value.filter((e=>!o.includes(e)));e.input(t)}e.props.selectedTargetItems=[]}function Vo(e){var t,o;if(e.props.activeValue===jp){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 Bo(e){var t;if(Array.isArray(e.value)){const t=[];let o=[...e.props.options];e.value.forEach((n=>{const r=e.props.memoOptions.find((e=>pn.eq(h(e),n)));if(r&&!r.noOptionFound){t.push(r);const s=e.props.options.findIndex((e=>pn.eq(h(e),n)));-1!==s&&(o=o.filter((e=>!pn.eq(h(e),n))))}else{const e=o.find((e=>pn.eq(h(e),n)));e?(t.push(e),o=o.filter((e=>!pn.eq(h(e),n)))):t.push({label:String(n),value:n,noOptionFound:!0})}})),e.props.targetOptions=t,e.props.sourceOptions=o}else e.props.sourceOptions=[...e.props.options],e.props.targetOptions=[];if(e.props.skipSetActiveValue)return void(e.props.skipSetActiveValue=!1);(null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+"_source_list_items"))&&function(e){var t,o,n,r,s,a,l;if(e.props.isDragging)return;if(e.props.sourceSearchActive){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}_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=h(t)):void(e.props.activeValue=void 0)}e.props.sourceSearchActive=!1}if(!1===e.props.transferOnSelect)return void(e.props.activeValue=void 0);const i=e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions;let p=!1;for(let t=e.props.activeIndex;t<=i.length;t++)if(!(null===(n=i.attrs)||void 0===n?void 0:n.disabled)&&i[t]){p=!0,e.props.activeValue=h(i[t]);break}if(!p&&i.length)for(let t=e.props.activeIndex;t>=0;t--)if(!(null===(r=i.attrs)||void 0===r?void 0:r.disabled)&&i[t])return p=!0,void(e.props.activeValue=h(i[t]));if(!p){let t;t=e.props.sourceListOrigin?null===(l=e.props.__root)||void 0===l?void 0:l.getElementById(`${e.props.id}`):e.props.searchable?null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_source_search_input`):null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_source_list_items`),t&&t.focus()}}(e)}function Po(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 Ho(e){Array.isArray(e.value)&&e.value.forEach((async t=>{$(e,t,function(e,t){const o=[...e.props.options,...e.props.memoOptions];return o.find((e=>pn.eq(h(e),t)))}(e,t))}))}function No(e){e.context&&(e.context.handlers.loadMore=m.bind(null,e),e.context.fns.getSourceItemCount=t=>!1===e.props.transferOnSelect&&t.length?t.length+"/"+e.props.sourceOptions.length:e.props.sourceOptions.length,e.context.fns.getTargetItemCount=t=>!1===e.props.transferOnSelect&&t.length?t.length+"/"+e.props.targetOptions.length:e.props.targetOptions.length,e.context.fns.isActive=(t,o)=>{if(!e.props.isDragging&&!e.props.touchStarted)return pn.eq(o,h(t))||void 0},e.context.fns.isSelected=(e,t)=>!!t&&(!!Array.isArray(t)&&t.includes(e)),e.context.fns.optionLoading=t=>e.props.optionLoaderValues.includes(h(t)),e.context.handlers.clearSearch=()=>{!function(e){var t;e.props.sourceSearchActive=!1,e.props.inputText="",v(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()}(e)},e.context.handlers.sourceSearchBlur=t=>{setTimeout((()=>{var o;if(t.relatedTarget&&t.relatedTarget instanceof HTMLElement&&(t.relatedTarget.id===`${e.props.id}_source_list_items`||t.relatedTarget.id===`${e.props.id}`)){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_source_search_input`);if(!t)return;t.focus()}else e.props.activeValue=void 0}))},e.context.handlers.listitemClick=(t,o)=>n=>{Ro(e,t,o)},e.context.handlers.transferForward=Oo.bind(null,e,void 0),e.context.handlers.transferForwardAll=()=>{let t;if(e.props.maxReached)return;const o=e.props.sourceOptions.map((e=>h(e)));t=Array.isArray(e.value)?[...e.value,...o]:[...o],e.input(t),e.props.selectedSourceItems=[]},e.context.handlers.transferBackward=Fo.bind(null,e,void 0),e.context.handlers.transferBackwardAll=()=>{Array.isArray(e.value)&&(e.input([]),e.props.selectedTargetItems=[])},e.context.handlers.onSearch=t=>{!function(e,t){e.props.sourceSearchActive=!0;const o=t.target;e.props.inputText=o.value,v(e,o.value,!0)}(e,t)},e.context.handlers.onMouseenter=t=>o=>{"touchstart"!==o.type&&(t?e.props.mouseOnSource=!0:e.props.mouseOnTarget=!0)},e.context.handlers.onMouseleave=t=>o=>{var n;if("touchend"===o.type)return;const r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(t?`${e.props.id}_source_list_items`:`${e.props.id}`);r&&(r.contains(o.relatedTarget)||(e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.activeIndex=void 0,t?e.props.mouseOnSource=!1:e.props.mouseOnTarget=!1))},e.context.handlers.listitemClick=(t,o)=>n=>{n instanceof MouseEvent&&e.props.touchStarted||Ro(e,t,o)},e.context.handlers.listitemTouchstart=()=>()=>{!function(e){e.props.touchStarted=!0}(e)},e.context.handlers.listitemTouchend=(t,o)=>n=>{!function(e,t,o,n){if(e.props.touchMoved)return e.props.touchMoved=!1,void(e.props.touchStarted=!1);const r=h(t);e.props.activeIndex=e.props.sourceOptions.findIndex((e=>h(e)===r)),e.props.transferOnSelect?o?Oo(e,r):Fo(e,r):Eo(e,t,o)}(e,t,o)},e.context.handlers.listitemTouchmove=()=>t=>{!function(e){e.props.touchMoved=!0}(e)},e.context.handlers.sourceSearchFocus=t=>{Ko(e,!0)},e.context.handlers.sourceListFocused=t=>{Ko(e,!0)},e.context.handlers.targetListFocused=()=>{Ko(e,!1)},e.context.handlers.sourceListBlurred=t=>{e.props.activeValue=void 0},e.context.handlers.targetListBlurred=t=>{e.props.activeValue=void 0},e.context.handlers.sourceListKeydown=t=>{Wo(e,t,!0)},e.context.handlers.targetListKeydown=t=>{Wo(e,t,!1)},e.context.handlers.sourceSearchKeydown=t=>{Wo(e,t,!0)})}function Ro(e,t,o,n){var r;if(h(t)===jp)return void(null===(r=e.context)||void 0===r||r.handlers.loadMore(!0));const s=h(t);e.props.activeIndex=e.props.sourceOptions.findIndex((e=>h(e)===s)),e.props.transferOnSelect?o?Oo(e,s):Fo(e,s):Eo(e,t,o)}function Ko(e,t){const o=Po(e,t);o&&(e.props.sourceListOrigin=t,e.props.activeValue=h(o))}function Wo(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(h(t)),e}),[]);(null===(n=t.store.hasNextPage)||void 0===n?void 0:n.value)&&l.push(jp);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}Vo(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(Po(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===jp)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=>h(e)===t.props.activeValue));t.props.activeIndex=s;const a=r[s];if(!a)return;t.props.transferOnSelect?o?Oo(t,h(a)):Fo(t,h(a)):Eo(t,a,o)}(t,e,o)}function Yo(e){e.on("created",(()=>{if(e.props.skipSetActiveValue=!0,"function"==typeof e.props.optionsLoader&&b(e),No(e),e.props.disabled&&(e.props.draggable=!1),yn){pn.whenAvailable(e.props.id+"_source_list_items",(t=>{t instanceof HTMLElement&&function(e,t){function o(){return e.props.sourceOptions.map((e=>h(e)))}function n(){return[]}if(!e.context)return;const r={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=[],un.handleTouchmove(t)},draggable:e=>"option"===e.getAttribute("role")};r.plugins=[un.multiDrag({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,un.handleDragstart(t)},handleEnd(t){un.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,un.handleTouchstart(t)},selections:()=>e.props.selectedSourceItems.map((e=>h(e)))})],un.dragAndDrop({parent:t,getValues:o,setValues:n,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,un.dragAndDrop({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,un.dragAndDrop({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:maxReached",(({payload:e})=>{r.disabled=e,un.dragAndDrop({parent:t,getValues:o,setValues:n,config:r})}))}(e,t)}),e.props.__root),pn.whenAvailable(`${e.props.id}`,(t=>{t instanceof HTMLElement&&function(e,t){function o(){return Array.isArray(e.value)?[...e.value]:[]}function n(t,o){e.props.sourceListOrigin=!0,e.input(t)}if(!e.context)return;const r={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:[]};r.plugins=[un.multiDrag({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,un.handleDragstart(t)},handleEnd(t){un.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,un.handleTouchstart(t)},selections:()=>e.props.selectedTargetItems.map((e=>h(e)))})],un.dragAndDrop({parent:t,getValues:o,setValues:n,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,un.dragAndDrop({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,un.dragAndDrop({parent:t,getValues:o,setValues:n,config:r})}))}(e,t)}),e.props.__root);const t=t=>{var o;if(e.props.isDragging)return;e.props.mouseX=t.clientX,e.props.mouseY=t.clientY;const n=e.props.mouseOnSource?`${e.props.id}_source_list_items`:`${e.props.id}`,r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(n);if(r){const o=r.getBoundingClientRect();t.clientX>o.x&&t.clientX<o.x+o.width&&t.clientY>o.y&&t.clientY<o.y+o.height&&(e.props.trackHover=!0)}};document.addEventListener("mousemove",t)}}))}function qo(e,t){var o;let n=null,r="",s=[];if(e.props.mouseOnSource){if(n=Zp.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=Gp.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&&Zp.add(e),e.props.mouseOnTarget&&Gp.add(e),a.length&&Uo(e,a,null,t)}function Uo(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)?h(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 Vo(e);e.props.mouseOnSource||e.props.mouseOnTarget?e.props.mouseOnSource&&Zp.has(e)||e.props.mouseOnTarget&&Gp.has(e)?requestAnimationFrame(Uo.bind(null,e,t,o,n)):qo(e,n):(Zp.delete(e),Gp.delete(e))}function zo(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function jo(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[...Go(t,o,n,r)]}function Zo(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,zo(255*t,2),zo(255*a,2),n]}function Go(e,t,o,n=1){const r=zo(t/255,4),s=zo(o/255,4);if(1===s)return[e,0,100,n];const a=zo(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,zo(l,2),zo(100*a,2),n]}function Xo(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 Jo(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 Qo(e,t,o,n=1){const[r,s,a,l]=Xo(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 en(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function tn(e){if(e){if(en(e))return jo(e);if(e.startsWith("rgb")){const t=e.match($c);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return Jo(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(bc);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 Go(o,zo(255*n,2),zo(255*r,2),s)}}}function on(e){const[t,o,n,r]=e.split("-").map((e=>Number(e)));return[t,o,n,r]}function nn(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 rn(e){return!1!==e&&"false"!==e}function sn(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}function an(e,t){return t=(null==t?void 0:t.hasOwnProperty("__original"))?null==t?void 0:t.__original:null==t?void 0:t.value,e.props.multiple?!!Array.isArray(e.value)&&e.value.filter((e=>pn.eq(e,t))).length>0:void 0!==t?pn.eq(e.value,t):(e.props._isChecked=pn.eq(e.value,e.props.onValue),e.props._isChecked)}function ln(e){function t(t){var o,n,a;const l=(`${t}`.match(/\-/g)||[]).length%2==1;t=function(t){t=function(e){return e.replace(/[\u0660-\u0669\u06f0-\u06f9]/g,(e=>(15&e.charCodeAt(0)).toString()))}(`${t}`),isNaN(t)&&(t=t.split(p.decimal).map((e=>e.replace(/[^0-9]/g,""))).join("."));if(t=t.replace(/[^0-9\.]/g,""),t.includes(".")){const o=t.split(".");0===e.props.decimals?t=o[0]:(o[1]=o[1].padEnd(i(),"0").slice(0,i()),t=o.join("."))}return t}(t);const u={};"unit"===r()&&(u.minimumFractionDigits=t.includes(".")?1:0),u.maximumFractionDigits=i(),e.props.minDecimals&&(u.minimumFractionDigits=e.props.minDecimals,t.includes(".")||(t+=".".padEnd(e.props.minDecimals,"0"))),0===u.maximumFractionDigits&&t.includes(".")&&(t=t.split(".")[0]);let f="";isNaN(t)||""===t.trim()||(t=l?`-${t}`:t,e.props.max&&!isNaN(e.props.max)&&(t=`${Math.min(t,e.props.max)}`),e.props.min&&!isNaN(e.props.min)&&(t=`${Math.max(t,e.props.min)}`),t.includes(".")?t=t.split(".")[0].padStart(1,"0")+"."+(null!==(o=t.split(".")[1])&&void 0!==o?o:"0"):u.maximumFractionDigits=null!==(n=u.minimumFractionDigits)&&void 0!==n?n:0,f=s(e.props.displayLocale,u).format(t));let h,v=t.split(".");return v=v[0]+(null!==(a=v[1])&&void 0!==a?a:"").padEnd(i(),"0"),v.length>1&&(v=v.replace(/^0+/,""),v=""!==t&&""===v?"0":v),c={number:t,integer:v,string:f},d=!0,c&&(h=c.hasOwnProperty(e.props.valueFormat)?c[e.props.valueFormat]:c.number),e.input(""===h?void 0:h).then((()=>(d=!1,Promise.resolve())))}function o(){var t,o;const n=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`#${e.props.id}_inner input`);return n&&(n.value=null!==(o=null==c?void 0:c.string)&&void 0!==o?o:""),Promise.resolve()}function n(){var t,o;const n=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`#${e.props.id}_inner input`);return null!==(o=null==n?void 0:n.value)&&void 0!==o?o:""}function r(){return e.props.currency?"currency":"unit"}function s(t,o={}){const n=r(),s=Object.assign({},{style:n,roundingMode:"trunc"},o);return s[n]=e.props[n],new Intl.NumberFormat(t,s)}function a(){var t,o,n;const r=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`#${e.props.id}_inner input`);if(r){r.dataset.placeholder||(r.dataset.placeholder=null!==(o=r.getAttribute("placeholder"))&&void 0!==o?o:"");const e=((p.unitLeft?`${p.unit} `:"")+(null!==(n=r.dataset.placeholder)&&void 0!==n?n:"")+(p.unitLeft?"":` ${p.unit}`)).trim();r.setAttribute("placeholder",e)}}function l(t){var o;const r=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`#${e.props.id}_inner input`);if(!r)return;const s=p.unit.length+p.literal.length;t=p.unitLeft?Math.max(t,s):Math.min(t,n().length-s),r.setSelectionRange(t,t)}function i(){return!1===e.props.decimals||"false"===e.props.decimals?0:isNaN(`${e.props.decimals}`)?p.fractionLength:e.props.decimals}let p=null,d=!1,c=null;e.on("input",(({payload:e})=>{d||(t(e),o())})),e.on("mounted",(()=>{a()})),e.context&&(e.context.handlers.setPlaceholder=a,e.context.handlers.init=(n=null)=>{var r;!function(){var t,o,n,r,a,l,i;const d=s(e.props.displayLocale).formatToParts(12345678.12345678);p={decimal:null===(t=d.find((e=>"decimal"==e.type)))||void 0===t?void 0:t.value,group:null===(o=d.find((e=>"group"==e.type)))||void 0===o?void 0:o.value,unit:null===(n=d.find((e=>["unit","currency"].includes(e.type))))||void 0===n?void 0:n.value,unitLeft:["unit","currency"].includes(d[0].type),literal:null!==(a=null===(r=d.find((e=>"literal"==e.type)))||void 0===r?void 0:r.value)&&void 0!==a?a:"",fractionLength:null!==(i=null===(l=d.find((e=>"fraction"==e.type)))||void 0===l?void 0:l.value.length)&&void 0!==i?i:0}}();let a=null!==(r=null!=n?n:e._value)&&void 0!==r?r:"";c?a=c.number:"integer"===e.props.valueFormat&&(a=function(e){var t;return(parseFloat(`${e}`)/Math.pow(10,null!==(t=i())&&void 0!==t?t:0)).toString().replace(".",i())}(`${null!=a?a:""}`)),t(a),o()},e.context.handlers.handleBeforeInput=o=>{var n,r,s,a,i,d,u;if(o.preventDefault(),o.stopPropagation(),o.target instanceof HTMLInputElement){const f=o.target,h=null!==(n=o.data)&&void 0!==n?n:"",v=null!==(r=o.target.value)&&void 0!==r?r:"",m=null!==(s=o.target.selectionStart)&&void 0!==s?s:0,g=null!==(a=o.target.selectionEnd)&&void 0!==a?a:0,$=v.indexOf(p.decimal);let b=(null!==(i=o.target.selectionStart)&&void 0!==i?i:0)+(o.data?0:-1),y=v,x=1;if(v.includes(p.decimal)&&h===p.decimal)return h===p.decimal&&(b=y.indexOf(p.decimal)+1),void l(b);if(!(null===e.props.min||e.props.min<0||e.props.max<0)&&"-"===h)return;if(h.match(/[a-zA-Z]/))return;"deleteContentBackward"===o.inputType&&v[m-1]===p.group?(x+=1,b-=1):"deleteContentForward"===o.inputType&&v[m]===p.group&&(x+=1,b+=1),-1!==$&&b>$&&"insertText"===o.inputType?y=function(e,t,o){return e.substring(0,t)+o+e.substring(t+o.length)}(y,b,null!==(d=o.data)&&void 0!==d?d:"0"):"insertText"===o.inputType?y=y.slice(0,m)+o.data+y.slice(g):"deleteContentForward"===o.inputType?(b+=2,y=y.slice(0,m)+y.slice(g+x)):"deleteContentBackward"===o.inputType&&(b+=1,y=y.slice(0,Math.max(m-x,0))+y.slice(g)),o.inputType.includes("delete")&&v[m-1]===p.decimal&&(y=y.slice(0,m-1)),t(y),y=null!==(u=null==c?void 0:c.string)&&void 0!==u?u:"",b=y.length-v.length+b,y.length===v.length&&(b+=o.inputType.includes("delete")?-1:1),f.setSelectionRange(0,v.length),document.execCommand("insertText",!1,y),h===p.decimal?b=y.indexOf(p.decimal)+1:v.includes(p.decimal)&&!y.includes(p.decimal)&&(b=y.length),l(Math.max(0,b))}},e.context.handlers.handleInput=e=>{e.target instanceof HTMLInputElement&&t(e.target.value)},e.context.handlers.handleKeyDown=r=>{var s;if(r.target instanceof HTMLInputElement&&("ArrowUp"===r.key||"ArrowDown"===r.key)){const a="ArrowUp"===r.key?1*e.props.step:-1*e.props.step;t(function(e,t){var o,n,r,s;let a=`${e}`.split("."),l=`${t}`.split("."),i=null!==(o=a[0])&&void 0!==o?o:"0",p=null!==(n=l[0])&&void 0!==n?n:"0",d=null!==(r=a[1])&&void 0!==r?r:"",c=null!==(s=l[1])&&void 0!==s?s:"";const 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!==(s=null==c?void 0:c.number)&&void 0!==s?s:0,a)),o(),setTimeout((()=>{l(n().length)}),1)}})}var pn=require("@formkit/utils"),dn=require("@formkit/core"),cn=require("@formkit/inputs");require("@formkit/vue");var un=require("@formkit/drag-and-drop");const fn=[988,24029,396,13078,980],hn=18806588,vn=502357,mn=16217489;let gn=189024;const $n=()=>[30548127325,27022924,34729821653783].map(Sn).join("y"),bn=/^[0-9a-f]+$/,yn="undefined"!=typeof window,xn=n(32,(e=>e)).map((()=>{gn|=0,gn=gn+1831565813|0;let e=gn^gn>>>15|gn;return e=e+e^e>>>427,((e^e>>>14)>>>0)/4294967296})),wn=yn?setTimeout:()=>0,_n=e=>{clearTimeout(kn[e])},kn={},Sn=e=>e.toString(32),Ln=e=>`${Sn(xn[e]).substring(2)}.${Sn(fn[e%(fn.length-1)])}`,Dn={},An={},In=new Set(["",null,void 0]),Cn={},Mn=()=>({$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.valid === false && $state.validationVisible || 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"}}),Tn=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),En=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),On=()=>({$el:"ul",if:"$fns.length($messages)"}),Fn=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),Vn=()=>({$el:"div",if:"$help"}),Bn=()=>({$el:null}),Pn=(e,t)=>()=>cn.icon(e,t),Hn=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),Nn=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),Rn=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),Kn=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),Wn=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),Yn=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),qn=()=>({$el:null,for:["part","$_overlayParts"]}),Un=a("dd"),{outer:zn,wrapper:jn,inner:Zn,icon:Gn,label:Xn,prefix:Jn,suffix:Qn,help:er,messages:tr,message:or}=l(Un),nr=Un("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"}}))),rr=Un("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),sr=Un("selection",(()=>({$el:"div"}))),ar=Un("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'}}}))),lr=Un("optionLoading","span"),ir=Un("option",(()=>({$el:"div"}))),pr=Un("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)',onTouchstart:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',"aria-controls":"$id"}}))),dr=Un("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),cr=Un("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),ur=Un("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),fr=Un("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 || ""'}))),hr=Un("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($activeSelectionValue, $option)"}}))),vr=Un("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"-1"}}))),mr=Un("tagLabel",(()=>({$el:"span"}))),gr=Un("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),$r=Un("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),br=Un("tagLoading","span"),yr=d(Un),xr=new WeakMap,wr=new WeakMap,_r=dn.createMessage({key:"loading",type:"state",value:!0,visible:!1}),kr=dn.createMessage({key:"loading",type:"state",value:!1,visible:!1}),Sr=new WeakMap,Lr=Symbol(),Dr=e=>{const t=(e=>{const t=[...e.props.allOptions,...e.props.initialOptions];return[...e.props.memoOptions||[],...t]})(e),o=e.props.inputStd||[],n=[];for(const e of o){let o,r=t.find((t=>pn.eq(h(t),e)));o=pn.isPojo(e)?void 0:Array.isArray(e)?e.join(", "):e,r||(r={value:e,label:o,isPlaceholder:!1,noOptionFound:!0}),n.push(r)}return n},Ar=new WeakSet,Ir=new WeakMap,Cr={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Mr={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Tr={overflow:"hidden",height:"100%"},Er={},Or={};let Fr=0;const Vr=(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))}},Br={schema:zn(jn(Xn("$label"),Zn(Gn("prefix"),Jn(),nr(p("$inputStd.length === 0 && $state.loading !== true",ar('$placeholder || "placeholder"'),p("$multiple !== true",rr(p("$state.loading && $selections.length === 0",lr("$ui.isLoading.value"),sr(ir("$option.label")))),p('$multiple && $selectionAppearance === "truncate"',dr(cr(p("$state.loading && $selections.length === 0",lr("$ui.isLoading.value"),fr()))),p('$multiple && $selectionAppearance === "tags"',gr($r(p("$state.loading && $isLoadingOption !== true && $selections.length === 0",lr("$ui.isLoading.value"),hr(vr(p("$state.loading && $optionLoaderValues.includes($option.value) || $option.label === undefined",br("$ui.isLoading.value"),mr("$option.label")),pr(Gn("close"))))))))))),p("$truncationCount && $state.loading !== true",ur("$truncationCount")),p("$state.loading",Gn("loader")),p("$inputStd.length !== 0 && $selectionRemovable",pr(Gn("close")),Gn("select"))),yr(),Qn(),Gn("suffix"))),er("$help"),tr(or("$message.value"))),type:"input",family:"dropdown",props:[],features:[cn.defaultIcon("select","select"),cn.defaultIcon("close","close"),cn.defaultIcon("selected","check"),cn.defaultIcon("loader","spinner"),cn.localize("isLoading"),cn.localize("loadMore"),cn.localize("remove"),cn.options,U.bind(null,(function(e){void 0===e.props.closeOnSelect?e.props.closeOnSelect=!e.props.multiple:e.props.closeOnSelect=pn.undefine(e.props.closeOnSelect),(e.props.multiple&&void 0===e.props.selectionAppearance||"truncate"===e.props.selectionAppearance)&&(e.props.selectionAppearance="truncate",e.props.formattedSelections=[]),e.props.multiple?e.props.selectionRemovable=!1:e.props.selectionRemovable=pn.undefine(e.props.selectionRemovable)}),(function(e){e.props.alwaysLoadOnOpen=void 0!==e.props.alwaysLoadOnOpen&&pn.undefine(e.props.alwaysLoadOnOpen),e.on("created",(()=>{e.context&&(e.context.handlers.click=se.bind(null,e),e.context.handlers.focus=ae.bind(null,e),e.context.handlers.keydown=ne.bind(null,e),e.context.handlers.selectorTagKeydownHandler=t=>te.bind(null,e,t))}))}),(function(e){if(e.on("created",(()=>{e.context&&le(e)})),e.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]}))}(e),"truncate"===e.props.selectionAppearance&&(e.props.lastVisibleIndex=null,ie(e),e.on("prop:selections",(()=>{ie(e)}))),"tags"===e.props.selectionAppearance&&ve(e),e.props.multiple&&"tags"===e.props.selectionAppearance){function t(){return Array.isArray(e.value)?e.value:[]}function o(t,o){e.input(t)}e.on("created",(()=>{e.props.disabled&&(e.props.draggable=!1),pn.whenAvailable(`${e.props.id}_selections`,(n=>{if(e.context&&n instanceof HTMLElement){const r={threshold:{horizontal:.25,vertical:0},plugins:[un.animations()],draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,disabled:!e.props.draggable,root:e.props.__root,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag")};un.dragAndDrop({parent:n,getValues:t,setValues:o,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,un.dragAndDrop({parent:n,getValues:t,setValues:o,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,un.dragAndDrop({parent:n,getValues:t,setValues:o,config:r})}))}}),e.props.__root)}))}e.on("prop:expanded",(({payload:t})=>{t&&e.props.optionsLoader&&"function"==typeof e.props.optionsLoader&&(!e.props.options.length||e.props.alwaysLoadOnOpen)&&(e.props.options=[],b(e))})),"overscroll"===e.props.behavior&&he(e)})),$e]},Pr=a("tg"),{outer:Hr,wrapper:Nr,label:Rr,prefix:Kr,suffix:Wr,help:Yr,messages:qr,message:Ur,icon:zr}=l(Pr),jr=Pr("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"}}))),Zr=Pr("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"}))),Gr=Pr("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"}))),Xr=Pr("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"}}))),Jr=Pr("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"}}}))),Qr=Pr("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),es=Pr("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),ts=Pr("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),os={schema:Hr(Nr(Gr(),Qr(Kr(),jr(),es(Xr(),ts(p("$slots.default","$slots.default",zr("thumb")))),Wr()),Jr(),Zr()),Yr("$help"),qr(Ur("$message.value"))),type:"input",props:["checked","thumbColorOff","thumbColorOn","iconColorOff","iconColorOn","valueLabelColorOff","valueLabelColorOn","offValue","offValueLabel","onValue","onValueLabel","thumbIcon","trackColorOff","trackColorOn","valueLabelDisplay","altLabelPosition"],features:[function(e){function t(e,t){t.target instanceof HTMLInputElement&&(e.input(t.target.checked?e.props.onValue:e.props.offValue),e.props.checked=t.target.checked)}e.on("created",(()=>{"disabled"in e.props&&(e.props.disabled=pn.undefine(e.props.disabled)),e.props.altLabelPosition=pn.undefine(e.props.altLabelPosition),void 0===e.props.offValue&&(e.props.offValue=!1),void 0===e.props.onValue&&(e.props.onValue=!0),e.props.checked=pn.eq(e.value,e.props.onValue),e.context&&(e.context.handlers.toggles=t.bind(null,e))})),e.on("commit",(({payload:t})=>{e.props.checked=pn.eq(t,e.props.onValue)}))}]},ns=a("rp"),{outer:rs,inner:ss,prefix:as,suffix:ls,help:is,messages:ps,message:ds,icon:cs}=l(ns),us=ns("empty",(()=>({$el:"div"}))),fs=ns("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}}))),hs=ns("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),vs=ns("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}}))),ms=ns("items",(()=>({$el:"ul",meta:{autoAnimate:!0},attrs:{role:"list",id:'$id + "_items"'}}))),gs=ns("item",(()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}}))),$s=ns("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}}))),bs=ns("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}}))),ys=ns("content","div"),xs=ns("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id"}}))),ws=ns("legend",(()=>({$el:"legend",if:"$label"}))),_s=ns("group",(()=>({$formkit:"group",index:"$index"}))),ks=ns("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),Ss=ns("remove",(()=>({$el:"li",if:"$removeControl"}))),Ls=ns("insert",(()=>({$el:"li",if:"$insertControl"}))),Ds=ns("up",(()=>({$el:"li",if:"$upControl"}))),As=ns("down",(()=>({$el:"li",if:"$downControl"}))),Is=ns("controlLabel","span"),Cs=ns("dragHandleWrapper",(()=>({if:"$draggable",$el:"div"}))),Ms=ns("dragHandle",(()=>({$el:"div",attrs:{id:'$id + "_drag_handle"'}}))),Ts={schema:rs(xs(ws("$label"),is("$help"),ss(as(),p("$value.length === 0",p("$slots.empty",us()),p("$slots.default",ms(gs(Cs(Ms(cs("dragHandle"))),ys(_s("$slots.default")),ks(Ds(bs(Is("$ui.moveUp.value"),cs("moveUp"))),Ss(vs(Is("$ui.remove.value"),cs("remove"))),Ls(fs(Is("$ui.add.value"),cs("add"))),As($s(Is("$ui.moveDown.value"),cs("moveDown")))))),ls()))),hs('$addLabel || ($ui.add.value + " " + ($label || ""))')),ps(ds("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs","draggable"],features:[function(e){e._c.sync=!0,e.on("created",be.bind(null,e)),e.on("mounted",(()=>{pn.whenAvailable(`${e.props.id}_items`,(t=>{if(t instanceof HTMLElement){ye(t,e);function o(t){for(const o of t)for(const t of Array.from(o.addedNodes))if(t instanceof HTMLElement&&t.id===`${e.props.id}_items`)return void ye(t,e)}new MutationObserver(o).observe(t.parentNode,{childList:!0})}}),e.props.__root)}))},cn.disablesChildren,cn.localize("remove"),cn.localize("add"),cn.localize("moveUp"),cn.localize("moveDown"),cn.defaultIcon("dragHandle","dragHandle"),cn.defaultIcon("remove","trash"),cn.defaultIcon("add","add"),cn.defaultIcon("moveUp","arrowUp"),cn.defaultIcon("moveDown","arrowDown")]},Es=new WeakMap,Os=a("rt"),{outer:Fs,wrapper:Vs,inner:Bs,label:Ps,prefix:Hs,suffix:Ns,help:Rs,messages:Ks,message:Ws,icon:Ys}=l(Os),qs=Os("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"}}))),Us=Os("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",onTouchstart:"$handlers.handleTouchstart($item)",onTouchmove:"$handlers.handleTouchmove"}}))),zs=Os("template",(()=>({for:["increment","stepIndex","$stepsPerValue"],$el:null}))),js=Os("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%"'}}}))),Zs=Os("itemLabelInner",(()=>({$el:"span",children:"$fns.getValue($item, $increment)"}))),Gs=Os("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",checked:"$value === $fns.getValue($item, $increment) && true",onKeydown:"$handlers.handleKeydown($fns.getValue($item, $increment))"}}))),Xs=Os("onItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item)",display:"flex",position:"relative",overflow:"hidden",top:"0",left:"0",bottom:"0"}}}))),Js=Os("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"}}}))),Qs=Os("onItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$onColor"}}}))),ea=Os("offItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$offColor"}}}))),ta={schema:Fs(Vs(Ps("$label"),Bs(Ys("prefix"),Hs(),qs(Us(zs(js(Xs(Qs(p("$slots.onItem",(()=>()=>"$slots.onItem"),p("$slots.default",(()=>()=>"$slots.default"),Ys("rating"))))),Js(ea(p("$slots.offItem",(()=>()=>"$slots.offItem"),p("$slots.default",(()=>()=>"$slots.default"),Ys("rating"))))),Zs()),Gs()))),Ns(),Ys("suffix"))),Rs("$help"),Ks(Ws("$message.value"))),type:"input",props:[],features:[function(e){function t(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`}}))}e.addProps(["max","step","stepsPerValue","itemsToPercentages","rightToLeft","onItemStyles","offItemStyles","hoverHighlight","deselect","disabled","wrapperWidth","onColor","offColor"]),!1!==e.props.hoverHighlight&&"false"!==e.props.hoverHighlight&&(e.props.hoverHighlight=!0),e.props.deselect=pn.undefine(e.props.deselect),e.props.max=Number(e.props.max)||5,e.props.min=Number(e.props.min)||0,e.props.step=Number(e.props.step)||1,e.props.numberOfSteps=e.props.max/e.props.step,e.props.lastIndex=1/e.props.step-1,e.props.itemsToPercentages={},"disabled"in e.props&&(e.props.disabled=pn.undefine(e.props.disabled)),e.props.rightToLeft?(e.props.onItemStyles=void 0,e.props.offItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%",zIndex:100}):e.props.onItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%"},e.props.stepsPerValue=1/e.props.step,e.hook.input(((t,o)=>{if(null===t||""===t||isNaN(t))return o(t);const n=Number(t),r=Number(e.props.min),s=Number(e.props.max);return n>s?o(s):e.props.min&&n<=r?o(r):o(n)})),e.on("commit",(({payload:t})=>{const o=Number(t||0);xe(e,o)})),e.on("created",(()=>{e.context&&(pn.whenAvailable(`${e.props.id}_items_wrapper`,(()=>{t(e),function(e){var o;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_items_wrapper`);if(!n)return;new ResizeObserver((()=>{t(e)})).observe(n)}(e),setTimeout((()=>t(e)),100)}),e.props.__root),e.context.fns.getPercentage=(e,t,o=!0)=>(o?e.onItems:e.offItems)[t],e.context.fns.getValue=(t,o)=>t+Number((o*e.props.step+e.props.step).toFixed(1)),e.context.fns.showLabel=(t,o)=>{const n=Number(e.value||0);return 0===n&&0===o||n&&t===n||t>n&&0===o||n>t&&o===e.props.lastIndex},e.context.handlers.handleFocus=t=>Ae.call(null,e,t),e.context.handlers.handleWrapperKeydown=t=>De.call(null,e,t),e.context.handlers.handleWrapperBlur=t=>we.call(null,e,t),e.context.handlers.handleItemClick=t=>o=>Me.call(null,e,t,o),e.context.handlers.handleMousemove=t=>o=>Ie.call(null,e,t,o),e.context.handlers.handleMouseleave=()=>Ce.call(null,e),e.context.handlers.handleDragstart=t=>o=>Le.call(null,e,t,o),e.context.handlers.handleMouseup=t=>Se.call(null,e,t),e.context.handlers.handleTouchstart=t=>o=>ke.call(null,e,t,o),e.context.handlers.handleTouchmove=t=>_e.call(null,e,t),e.context.handlers.handleKeydown=t=>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)}(e,t,o))}))},cn.defaultIcon("rating","star")]},oa=a("ac"),{outer:na,wrapper:ra,inner:sa,icon:aa,label:la,prefix:ia,suffix:pa,help:da,messages:ca,message:ua}=l(oa),fa=oa("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",onTouchmove:"$handlers.touchmove",onTouchstart:"$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"}}))),ha=oa("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"}}))),va=oa("selectionWrapper",(()=>({for:["option","index","$selections"],$el:"div",attrs:{id:'$id + "_selection_wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:'$disabled && "-1" || 1',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($activeSelectionValue, $option)"}}))),ma=oa("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),ga=oa("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),$a=oa("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"}}))),ba=oa("optionLoading","span"),ya=oa("option",(()=>({$el:"div",if:"$value !== undefined"}))),xa=d(oa),wa=new WeakMap,_a="undefined"!=typeof window,ka=new WeakMap;let Sa=!1;const La={schema:na(ra(la("$label"),sa(aa("prefix"),ia(),fa(),p("$multiple !== true && $selectionAppearance === option && $expanded === false",ga(va(ma(ya(p("$state.loading",ba("$ui.isLoading.value"),"$option.label"))),p("$state.loading && $isSingleOption !== true && $optionLoaderValues.includes($option.value)",aa("loader")),p("$selectionRemovable && $isSingleOption",$a(aa("close")))))),p("$state.loading && ($isSingleOption !== true || $selections.length === 0)",aa("loader")),p('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',$a(aa("close")),p('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',ha(aa("select")))),p("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $optionLoaderValues.length > 0)",ha(aa("select"))),xa(),pa(),aa("suffix")),p("$multiple && $selectionAppearance === option",ga(va(ma(ya(p("$state.loading && $isLoadingOption",ba("$ui.isLoading.value"),"$option.label"))),$a(aa("close")))))),da("$help"),ca(ua("$message.value"))),type:"input",family:"dropdown",props:[],features:[cn.defaultIcon("select","select"),cn.defaultIcon("close","close"),cn.defaultIcon("selected","check"),cn.defaultIcon("loader","spinner"),cn.localize("isLoading"),cn.localize("loadMore"),cn.localize("remove"),cn.localize("open"),cn.localize("close"),cn.options,U.bind(null,(function(e){"option"!==e.props.selectionAppearance||e.props.multiple||!1===e.props.selectionRemovable||"false"===e.props.selectionRemovable||(e.props.selectionRemovable=!0),e.props.multiple||(e.props.clearSearchOnOpen=pn.undefine(e.props.clearSearchOnOpen)),e.props.selectionRemovable=pn.undefine(e.props.selectionRemovable),e.props.openOnClick=pn.undefine(e.props.openOnClick),"option"!==e.props.selectionAppearance||e.props.multiple||(e.props.isSingleOption=!0),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),void 0===e.props.selectionAppearance&&(e.props.selectionAppearance="text-input"),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),e.props.closeOnSelect?e.props.resetSearchOnCommit=!1:void 0===e.props.resetSearchOnCommit&&(e.props.resetSearchOnCommit=e.props.multiple),e.props.allowNewValues=pn.undefine(e.props.allowNewValues)}),Oe,(function(e){if(e.props.multiple)if(e.props.multiple&&"option"===e.props.selectionAppearance){function t(){return Array.isArray(e.value)?e.value:[]}function o(t){e.input(t)}Ye(e),e.on("created",(()=>{e.props.disabled&&(e.props.draggable=!1),pn.whenAvailable(`${e.props.id}_selections`,(n=>{if(n instanceof HTMLElement&&e.context){const r={draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,root:e.props.__root,disabled:!e.props.draggable,plugins:[un.animations()],touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-selection")};un.dragAndDrop({parent:n,getValues:t,setValues:o,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,un.dragAndDrop({parent:n,getValues:t,setValues:o,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,un.dragAndDrop({parent:n,getValues:t,setValues:o,config:r})}))}}),e.props.__root)}))}else e.props.multiple&&"text-input"===e.props.selectionAppearance&&Ne(e);else qe(e)})),$e]},Da=a("dp"),{outer:Aa,wrapper:Ia,inner:Ca,icon:Ma,label:Ta,prefix:Ea,suffix:Oa,help:Fa,messages:Va,message:Ba}=l(Da),Pa=Da("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"}}))),Ha=Da("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"'}}}}))),Na=Da("next",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}}))),Ra=Da("nextLabel","span"),Ka=Da("prev",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}}))),Wa=Da("prevLabel","span"),Ya=Da("calendar",(()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}}))),qa=Da("calendarWeeks",(()=>({$el:"tbody"}))),Ua=Da("calendarHeader",(()=>({$el:"thead"}))),za=Da("weekDays",(()=>({$el:"tr"}))),ja=Da("weekDay",(()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}}))),Za=Da("week",(()=>({$el:"tr",for:["week","$month.weeks"]}))),Ga=Da("dayCell",(()=>({$el:"td",for:["day","$week"],attrs:{key:'$: "day" + $fns.format($day, "D")',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":"$fns.isSelected($day)","aria-label":'$fns.format($day, "long")'}}))),Xa=Da("day","div"),Ja=Da("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'}}))),Qa=Da("years",(()=>({if:'$panel === "year"',$el:"ul"}))),el=Da("year",(()=>({for:["year","$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":"$fns.isSelected($year)","data-disabled":"$fns.isDisabledYear($year)"}}))),tl=Da("months",(()=>({if:'$panel === "month"',$el:"ul"}))),ol=Da("month",(()=>({$el:"li",for:["month","$months"],attrs:{key:'$: "month" + $fns.format($month, "M")',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":"$fns.isSelected($month)","data-disabled":"$fns.isDisabledMonth($month)"}}))),nl=Da("panelHeader",(()=>({$el:"header",attrs:{"aria-live":"polite"}}))),rl=Da("yearsHeader",(()=>({$el:"div",if:'$panel === "year"'}))),sl=Da("monthsHeader",(()=>({$el:"div",if:'$panel === "month"'}))),al=Da("daysHeader",(()=>({$el:"div",if:'$panel === "day"'}))),ll=Da("timeHeader",(()=>({$el:"div",if:'$panel === "time"'}))),il=Da("yearButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"}))),pl=Da("monthButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"}))),dl=Da("dayButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"}))),cl=Da("removeSelection",(()=>({$el:"button",if:"$clearable && $_value",attrs:{id:'$id + "_remove_selection"',type:"button",onClick:"$handlers.clear","aria-controls":"$id"}}))),ul=Da("time",(()=>({$el:"div",if:'$panel === "time"'}))),fl=Da("timeInput",(()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown",spellcheck:"false",onBlur:"$handlers._blurOut(time)"}}))),hl=Da("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:vl,overlayLiteral:ml,overlayChar:gl,overlayEnum:$l,overlay:bl,overlayParts:yl,overlayInner:xl}=i(Da),wl=Da("panel","div"),_l=new WeakMap,kl=new WeakMap,Sl=new WeakSet,Ll=new WeakMap,Dl=new WeakMap,Al=new WeakSet,Il=new WeakMap,Cl=/[\uD800-\uDBFF]/,Ml=new WeakMap,Tl=new WeakMap,El=new WeakMap,Ol=new WeakMap,Fl=new WeakMap,Vl=new WeakSet,Bl=new WeakMap,Pl=new WeakMap,Hl=new WeakMap,Nl=new WeakMap;let Rl=!1;const Kl=()=>{Rl=!0,setTimeout((()=>{Rl=!1}),500)},Wl={"#":{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"}},Yl=new WeakMap,ql="undefined"!=typeof window;let Ul=!1;ql&&document.addEventListener("selectionchange",(()=>{const e=f();if(!(e instanceof HTMLInputElement))return;if(Nl.has(e))return function(e){const t=Nl.get(e);if(t){const[o,n]=t,[r,s]=It(e),a=s.indexOf(o);if(-1===a)return void Nl.delete(e);const l=r[a],i=[l[0]+n[0],l[1],"none"];nt(rt(e),i)||dt(e,i)}}(e);if("select"!==Il.get(e))return;const t=rt(e);if(!nt(t,Yl.get(e))){if(Yl.set(e,t),Sl.has(e))return Sl.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:rt(e)}))}}));var zl=/^([0-9]{4})-([0-1][0-9])(?:-([0-3][0-9]))?(?:[T ]?([0-2][0-9])(?::([0-5][0-9]))?(?::([0-5][0-9]))?)?(?:\.[0-9]+)?(Z|(?:\+|\-)[0-9]{4})?$/,jl="1999-03-04T02:05:01.000Z",Zl=new Map,Gl=[["YYYY",{year:"numeric"}],["YY",{year:"2-digit"}],["MMMM",{month:"long"}],["MMM",{month:"short"}],["MM",{month:"2-digit"}],["M",{month:"numeric"}],["DD",{day:"2-digit"}],["D",{day:"numeric"}],["dddd",{weekday:"long"}],["ddd",{weekday:"short"}],["d",{weekday:"narrow"}],["mm",{minute:"2-digit"}],["m",{minute:"numeric"}],["ss",{second:"2-digit"}],["s",{second:"numeric"}],["Z",{timeZoneName:"short"}]],Xl=[["HH",{hour:"2-digit"}],["H",{hour:"numeric"}]],Jl=[["hh",{hour:"2-digit"}],["h",{hour:"numeric"}],["a",{dayPeriod:"narrow"}],["A",{dayPeriod:"narrow"}]],Ql={DD:2,HH:2,MM:2,YY:2,YYYY:4,hh:2,mm:2,ss:2,Z:5},ei=["MMMM","MMM","dddd","ddd"],ti=new Map([...Gl,...Xl,...Jl].map((e=>[e[0],e]))),oi=new Map,ni=["full","long","medium","short"],ri=e=>String(e).padStart(2,"0"),si=e=>String(e).padStart(2,"0");const ai="undefined"!=typeof window,li=new WeakSet,ii=new WeakSet,pi=new WeakSet,di=new WeakMap,ci=new WeakMap,ui=new WeakSet,fi=new WeakSet,hi="undefined"!=typeof window,vi=new WeakMap,mi={schema:Aa(Ia(Ta("$label"),Ca(Ma("prefix"),Ea(),bl(xl(yl(vl("$part.value"),ml("$part.value"),gl("$part.value"),$l("$part.value")))),Pa(),Ha(nl(Ka(Wa("$ui.prev.value"),Ma("prev")),rl("$decade"),sl(il()),al(pl(),il()),ll(pl(),dl(),il()),Na(Ra("$ui.next.value"),Ma("next")),hl(Ma("close"))),wl(Qa(el("$fns.format($year, $yearFormat)")),tl(ol("$fns.format($month, $monthFormat)")),Ya(Ua(za(ja("$fns.format($day, $weekdayFormat)"))),qa(Za(Ga(Xa("$fns.format($day, $dateFormat)"))))),ul(fl()))),cl(Ma("clear")),Ja(Ma("calendar")),Oa(),Ma("suffix"))),Fa("$help"),Va(Ba("$message.value"))),type:"input",family:"text",props:["dateFormat","dayButtonFormat","format","monthButtonFormat","monthFormat","overlay","pickerOnly","showMonths","showPagination","weekStart","weekdayFormat","yearFormat","years"],features:[Mo,function(e){var t,o,r,s,a,l,i,p,d,c,u,f,h,v,m,g,$,b,y,x,w,_;e.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"]),e.hook.prop(((t,o)=>("expanded"===t.prop&&e.props.disabled&&(t.value=!1),"weekStart"===t.prop&&(t.value=Number(t.value||0)),"showMonths"===t.prop&&(t.value=Number(t.value||1)),"maxScan"===t.prop&&(t.value=Number(t.value||7)),"timezone"===t.prop&&("string"==typeof e._value||e._value instanceof Date)&&(e.props.offset=no(e._value,t.value)),o(t)))),e.props._isFocused=!1,e.props._isPlaceholder=!1,null!==(t=(f=e.props).valueFormat)&&void 0!==t||(f.valueFormat="ISO8601"),null!==(o=(h=e.props).weekdayFormat)&&void 0!==o||(h.weekdayFormat="d"),null!==(r=(v=e.props).monthFormat)&&void 0!==r||(v.monthFormat="MMM"),null!==(s=(m=e.props).monthButtonFormat)&&void 0!==s||(m.monthButtonFormat="MMMM"),null!==(a=(g=e.props).dayButtonFormat)&&void 0!==a||(g.dayButtonFormat="D"),null!==(l=($=e.props).dateFormat)&&void 0!==l||($.dateFormat="D"),null!==(i=(b=e.props).yearFormat)&&void 0!==i||(b.yearFormat="YYYY"),null!==(p=(y=e.props).paginatedPanels)&&void 0!==p||(y.paginatedPanels=["day","year"]),null!==(d=(x=e.props).valueLocale)&&void 0!==d||(x.valueLocale=e.props.locale),null!==(c=(w=e.props).format)&&void 0!==c||(w.format="long"),e.props.panels=wo(e),e.props.pickerOnly=pn.undefine(e.props.pickerOnly),"disabled"in e.props&&(e.props.disabled=pn.undefine(e.props.disabled)),"clearable"in e.props&&(e.props.clearable=pn.undefine(e.props.clearable)),null!==(u=(_=e.props).maxScan)&&void 0!==u||(_.maxScan=7),e.props._isDisabled="function"==typeof e.props.disabledDays?e.props.disabledDays.bind(null,e):Ao.bind(null,e),function(e){const t=e._value;let o=new Date;if(t instanceof Date)o=Wt(t);else if("string"==typeof t)try{o=Wt(fo(t,e.props.valueFormat,e.props.valueLocale))}catch{console.warn(`Date (${t}) does not match format (${io(e.props.valueFormat,e.props.valueLocale)})`),o=void 0}else t||(o=void 0);if(e.props.offset=e.props.timezone?no(o||new Date,e.props.timezone):"+0000",e.props.minDate){const t="string"==typeof e.props.minDate?fo(e.props.minDate):e.props.minDate;e.props.minDate=ao(t,e.props.offset)}if(e.props.maxDate){const t="string"==typeof e.props.maxDate?fo(e.props.maxDate):e.props.maxDate;e.props.maxDate=ao(t,e.props.offset)}o=o&&ao(o,e.props.offset),o&&_o(e,o,!1);let n=o||new Date;n=e.props.minDate>n?e.props.minDate:n,e.props.renderedDate=n,e.props.activeDate=n,e.props.localTime=o&&lo(o,"HH:mm")||"12:00"}(e),e.props.calendar=[],e.props.inputText="",e.props.showMonths=e.props.showMonths||1,"function"==typeof e.props.format?(e.props.formatDate=e.props.format,e.props.format=null):e.props.formatDate=lo,e.on("created",(()=>{if(pn.whenAvailable(`${e.props.id}`,So.bind(null,e),e.props.__root),e.context){let t;e.context.fns.format=(t,o)=>lo(t,o,e.props.locale||"en",!1,go),e.context.fns.isDisabled=e.props._isDisabled,e.context.fns.isDisabledMonth=t=>!co(t,(t=>!e.props._isDisabled(t)),"month"),e.context.fns.isDisabledYear=t=>!co(t,(t=>!e.props._isDisabled(t)),"year"),e.context.fns.isSelected=t=>{var o;const n=null===(o=e.context)||void 0===o?void 0:o.value;if(null==n)return;return vo(t,ao(n instanceof Date?n:fo(n,e.props.valueFormat,e.props.valueLocale),e.props.offset))},e.context.handlers._blur=t=>{var o,n;e.props._isFocused=!1,"function"==typeof(null===(o=e.context)||void 0===o?void 0:o.handlers.blur)&&(null===(n=e.context)||void 0===n||n.handlers.blur(t))},e.context.handlers.closePanel=()=>{e.props.expanded=!1},e.context.handlers._blurOut=t=>o=>{var n;o.preventDefault(),t&&t!==e.props.panel||e.props.pickerOnly&&o.relatedTarget instanceof Element&&(o.relatedTarget===document.getElementById(`${e.props.id}_inner`)||o.relatedTarget.closest(`#${e.props.id}_inner`))||o.relatedTarget&&o.relatedTarget instanceof Element&&(o.relatedTarget.closest(`#${e.props.id}_popover`)||!(null===(n=e.props.__root)||void 0===n?void 0:n.contains(o.relatedTarget))||o.relatedTarget.id===`${e.props.id}_popover`)||(e.props.expanded=!1)},e.context.handlers.overlayClick=()=>{const t=di.get(e);t&&(t.focus(),e.props._isPlaceholder=!1)},e.context.handlers.focus=()=>{e.props.pickerOnly||(e.props._isFocused=!0,e.props.pickerOnly&&!ii.has(e)&&(pi.add(e),e.props.expanded=!0,setTimeout((()=>pi.delete(e)),200)))},e.context.handlers.clear=()=>{var t,o;_o(e,void 0,!0),xo(e,void 0);const n=null===(o=null===(t=e.props)||void 0===t?void 0:t.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);n instanceof HTMLInputElement&&(n.focus(),setTimeout((()=>{n.setSelectionRange(0,0)}),50))},e.context.handlers.dateInput=t=>{var o;if(ui.has(e))return ui.delete(e);if(t.target instanceof HTMLInputElement&&!e.props.expanded)try{let n=fo({date:t.target.value,format:e.props.format,locale:e.props.locale,partFilter:go});if(function(e){return ro(e.props.format,e.props.locale).some((e=>"weekday"===e.partName))}(e)&&e.props.activeDate instanceof Date&&e.props.activeDate.getTime()===n.getTime()&&!Nl.get(t.target)&&lo(n,e.props.format,e.props.locale,!1,go)!==t.target.value){const r=uo("dddd",e.props.locale),s=ro(e.props.format,e.props.locale),a=null===(o=ho(t.target.value,s).find((e=>"dddd"===e.token)))||void 0===o?void 0:o.value,l=lo(n,"dddd",e.props.locale);if(a&&r.includes(a)&&l!==a){let t=r.indexOf(a)-r.indexOf(l);t=t<-1?7+t:t,n=Yt(n,t),li.add(e)}}_o(e,n)}catch(t){_o(e,void 0)}},e.context.handlers.open=()=>{e.props.expanded=!0},e.context.handlers.next=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=jt(e.props.renderedDate,10));case"day":return void(e.props.renderedDate=zt(e.props.renderedDate,1))}},e.context.handlers.prev=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=jt(e.props.renderedDate,-10));case"day":return void(e.props.renderedDate=zt(e.props.renderedDate,-1))}},e.context.handlers.setDate=t=>()=>{var o;"month"!==e.props.panel&&"year"!==e.props.panel||!e.props.activeDate||(t=e.props.activeDate),(null===(o=e.context)||void 0===o?void 0:o.fns.isDisabled(t))||e.emit("dateSelected",t)},e.context.handlers.localTime=t=>{const o=t.target;if(!o.value)return;const[n,r]=o.value.split(":");e.props.localTime=o.value,e.props.activeDate.setHours(n,r),xo(e,e.props.activeDate)},e.context.handlers.keyDown=t=>{switch(e.props.panel){case"day":return e.emit("calendarKeydown",t);case"year":return e.emit("yearKeydown",t);case"month":return e.emit("monthKeydown",t);case"time":return e.emit("timeKeydown",t);default:return}},e.context.handlers.inputKeydown=t=>{e.emit("keydown",t)},e.context.handlers.openKeydown=t=>{"Enter"!==t.key&&"Space"!==t.key||(e.props.expanded=!0)},e.context.handlers.mouseEnter=o=>n=>{clearTimeout(t),n.target instanceof HTMLElement&&"-1"===n.target.getAttribute("tabindex")&&"true"!==n.target.getAttribute("data-is-extra")&&("month"===e.props.panel||"year"===e.props.panel?e.props.activeDate=co(o,(t=>!e.props._isDisabled(t)),e.props.panel):e.props.activeDate=o)},e.context.handlers.mouseLeave=()=>{clearTimeout(t),t=setTimeout((()=>{}),100)},e.context.handlers.jumpTo=t=>()=>{e.props.panels.unshift(e.props.panel),e.props.panel=t},e.context.fns.sameDay=t=>{var o;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&vo(t,e.context.activeDate)},e.context.fns.sameMonth=t=>{var o;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&t.getMonth()===e.context.activeDate.getMonth()},e.context.fns.sameYear=t=>{var o,n;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&t.getFullYear()===(null===(n=e.context)||void 0===n?void 0:n.activeDate.getFullYear())},e.context.fns.notInMonth=(e,t)=>{const o=function(e){const t=Wt(e);return t.setHours(0,0,0),t}(t).getTime();return o<po(e).getTime()||o>qt(e).getTime()||void 0}}}));const k=yo.bind(null,e);e.on("prop:panel",(({payload:t})=>{e.props.showPagination=e.props.paginatedPanels.includes(t)})),e.on("dateSelected",(({payload:t})=>{var o,n;t&&e.props._isDisabled(t)||(Array.isArray(e.props.panels)&&e.props.panels.length?e.props.panel=e.props.panels.shift():(e.props.expanded=!1,null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus()),_o(e,t))})),e.on("input",(({payload:t})=>{if(void 0===t&&!e.props._isFocused)return void xo(e,void 0);const o=new Date,n=t?xo(e,ao("string"==typeof t?fo(t,e.props.valueFormat,e.props.valueLocale):t,e.props.offset)):o;e.props.activeDate=!t&&e.props.activeDate?e.props.activeDate:n,e.props.renderedDate=!t&&e.props.renderedDate?e.props.renderedDate:n,e.props.localTime=lo(n,"HH:mm"),function(e){const t=ci.get(e);if(e._value&&t){const o=Ut(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))}}(e)})),e.on("prop:renderedDate",bo.bind(null,e)),e.on("prop:expanded",(({payload:t})=>{if(t){if(fi.delete(e),e.props.panels=wo(e),e.props.panel=e.props.panels.shift(),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?e.props.showPanelClose=!0:e.props.showPanelClose=!1,"day"===e.props.panel){const t=e.props.activeDate;e.props.activeDate=co(e.props.activeDate,(t=>!e.props._isDisabled(t)),"month")||t}bo(e),pn.whenAvailable(`${e.props.id}_popover`,(t=>{const o=t.querySelector('[tabindex="0"]');o&&setTimeout((()=>{o.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())}))}(e,t)}),0)}),e.props.__root),ai&&setTimeout((()=>{document.addEventListener("click",k)}),10)}else{if("time"===e.props.panel)e.emit("dateSelected",e.props.activeDate);else if(e._value){ui.add(e);const t="string"==typeof e._value?fo(e._value,e.props.valueFormat,e.props.valueLocale):e._value;xo(e,ao(t,e.props.offset))}else xo(e,void 0);ai&&(ii.add(e),document.removeEventListener("click",k),setTimeout((()=>ii.delete(e)),50))}})),e.on("prop:activeDate",(({payload:t})=>{if(Array.isArray(e.props.calendar)&&e.props.calendar.length)if("day"===e.props.panel){const o=e.props.calendar,n=po(e.props.renderedDate),r=qt(zt(e.props.renderedDate,o.length-1));t.getTime()<n.getTime()?e.props.renderedDate=zt(e.props.renderedDate,-1):t.getTime()>r.getTime()&&(e.props.renderedDate=zt(e.props.renderedDate))}else if("year"===e.props.panel){const t=e.props.years,o=t[0].getFullYear(),n=t[t.length-1].getFullYear(),r=e.props.activeDate.getFullYear();r>n?e.props.renderedDate=jt(e.props.renderedDate,10):r<o&&(e.props.renderedDate=jt(e.props.renderedDate,-10))}e.props.expanded&&xo(e,e.props.activeDate)})),e.on("keydown",(({payload:t})=>{switch(t.key){case"ArrowDown":case"ArrowUp":case" ":t.preventDefault(),e.props.pickerOnly&&(e.props.expanded=!0);break;case"Enter":case"Return":e.props.expanded||(e.props.expanded=!0);break;case"Escape":e.props.expanded=!1}})),e.on("calendarKeydown",(({payload:t})=>{t.preventDefault();let o=null,r=0;switch(t.key){case"ArrowRight":r=1;break;case"ArrowLeft":r=-1;break;case"ArrowDown":r=7;break;case"ArrowUp":r=-7;break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Tab":t.shiftKey||ko(e,t);break;case"Escape":e.props.expanded=!1}if(r&&(t.preventDefault(),o=Yt(e.props.activeDate,r)),o&&!e.props._isDisabled(o))e.props.activeDate=o;else if(o&&e.props._isDisabled(o)){const t=r>0?1:-1;n(Number(e.props.maxScan),(e=>t*e)).some((t=>{const n=Yt(o,t);return!e.props._isDisabled(n)&&(e.props.activeDate=n,!0)}))}})),e.on("yearKeydown",(({payload:t})=>{let o=0;switch(t.key){case"ArrowDown":o=5;break;case"ArrowRight":o=1;break;case"ArrowUp":o=-5;break;case"ArrowLeft":o=-1;break;case"Tab":t.shiftKey||ko(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}const n=e.props.activeDate.getFullYear()+o-e.props.renderedDate.getFullYear();e.props.activeDate=jt(e.props.renderedDate,n)})),e.on("monthKeydown",(({payload:t})=>{let o=0;switch(t.key){case"ArrowDown":o=3;break;case"ArrowRight":o=1;break;case"ArrowLeft":o=-1;break;case"ArrowUp":o=-3;break;case"Tab":t.shiftKey||ko(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}o&&t.preventDefault();let n=(e.props.activeDate.getMonth()+o)%12;n=n<0?12+n:n;const r=n-e.props.renderedDate.getMonth();let s=zt(e.props.renderedDate,r);if(e.props._isDisabled(s)){const t=co(s,(t=>!e.props._isDisabled(t)),"month");t&&(s=t)}e.props.activeDate=s})),e.on("timeKeydown",(({payload:t})=>{switch(t.key){case"Return":case"Enter":t.preventDefault(),e.emit("dateSelected",e.props.activeDate)}})),e.on("prop:_isFocused",(()=>{di.get(e)&&Lo(e)})),e.on("commit",(()=>{if(e.props.activeDate&&e.props._isDisabled(e.props.activeDate)){const t=dn.createMessage({blocking:!0,key:"rule_invalidDate",meta:{messageKey:"invalidDate",removeImmediately:!1,localize:!0,i18nArgs:[{node:e,name:Io(e),args:[]}]},type:"validation",value:"The selected date is invalid."});e.store.set(t)}else e.store.remove("rule_invalidDate")}))},$e,cn.localize("next"),cn.localize("prev"),cn.localize("changeDate"),cn.localize("chooseDate"),cn.defaultIcon("close","close"),cn.defaultIcon("next","right"),cn.defaultIcon("clear","close"),cn.defaultIcon("prev","left"),cn.defaultIcon("calendar","date")]},gi=a("tl"),{outer:$i,wrapper:bi,inner:yi,icon:xi,label:wi,prefix:_i,suffix:ki,help:Si,messages:Li,message:Di}=l(gi),Ai=gi("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"}}))),Ii=gi("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'}}))),Ci=gi("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($activeSelectionValue, $option)"}}))),Mi=gi("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),Ti=gi("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)",onTouchstart:"$handlers.removeSelection && $handlers.removeSelection($option)","aria-controls":"$id"}}))),Ei=gi("tagLabel",(()=>({$el:"span"}))),Oi=gi("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite"}}))),Fi=gi("tagLoading","span"),Vi=d(gi),Bi={schema:$i(bi(wi("$label"),yi(xi("prefix"),_i(),Oi(Ci(Mi(p("$state.loading && $fns.hasOptionLoaderValue($option) || $option.label === undefined",Fi("$ui.isLoading.value"),Ei("$option.label")),Ti(xi("close")))),Ai()),p("$state.loading",xi("loader")),Ii(xi("select")),Vi(),ki(),xi("suffix"))),Si("$help"),Li(Di("$message.value"))),type:"input",family:"dropdown",props:[],features:[cn.options,U.bind(null,(function(e){e.props.multiple=!0,e.props.openOnClick=pn.undefine(e.props.openOnClick),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),e.props.closeOnSelect?e.props.resetSearchOnCommit=!1:void 0===e.props.resetSearchOnCommit&&(e.props.resetSearchOnCommit=e.props.multiple),e.props.allowNewValues=pn.undefine(e.props.allowNewValues)}),Oe,(function(e){Ye(e),ve(e),e.on("created",(()=>{function t(){return Array.isArray(e.value)?e.value:[]}function o(t){e.input(t)}e.props.disabled&&(e.props.draggable=!1),pn.whenAvailable(`${e.props.id}_selections`,(n=>{if(n instanceof HTMLElement){if(!e.context)return;const r={draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,disabled:!e.props.draggable,threshold:{horizontal:.25,vertical:0},plugins:[un.animations()],root:e.props.__root,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag"),handleEnd(t){e.props.activeSelectionValue=void 0,un.handleEnd(t)},handleDragstart(t){e.props.activeSelectionValue=void 0,un.handleDragstart(t)},handleTouchstart(t){e.props.activeSelectionValue=void 0,un.handleTouchstart(t)}};un.dragAndDrop({parent:n,getValues:t,setValues:o,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,un.dragAndDrop({parent:n,getValues:t,setValues:o,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,un.dragAndDrop({parent:n,getValues:t,setValues:o,config:r})}))}}),e.props.__root)}))})),cn.defaultIcon("select","select"),cn.defaultIcon("close","close"),cn.defaultIcon("selected","check"),cn.defaultIcon("loader","spinner"),cn.localize("isLoading"),cn.localize("loadMore"),cn.localize("remove"),cn.localize("open"),cn.localize("close"),$e]},Pi=a("mk"),{outer:Hi,wrapper:Ni,inner:Ri,label:Ki,prefix:Wi,suffix:Yi,help:qi,messages:Ui,message:zi,icon:ji}=l(Pi),{overlayPlaceholder:Zi,overlayLiteral:Gi,overlayChar:Xi,overlayEnum:Ji,overlay:Qi,overlayParts:ep,overlayInner:tp}=i(Pi),op=Pi("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"$type",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",onInput:"$handlers.DOMInput",value:"$_maskValue",placeholder:"$placeholder",id:"$id","aria-describedby":"$describedBy"}}))),np=new WeakMap,rp=new WeakMap,sp=new WeakMap,ap={schema:Hi(Ni(Ki("$label"),Ri(ji("prefix"),Wi(),Qi(tp(ep(Zi("$part.value"),Gi("$part.value"),Xi("$part.value"),Ji("$part.value")))),op(),Yi(),ji("suffix"))),qi("$help"),Ui(zi("$message.value"))),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse","overlay"],family:"text",features:[Mo,function(e){e.addProps(["_maskValue","_overlayParts"]),e.on("created",(()=>{var t,o,n,r,s;const a=Ge("string"==typeof e._value?e._value:"");rp.set(e,a),sp.set(e,a),e.props.allowIncomplete=pn.undefine(e.props.allowIncomplete),e.props.overlay=pn.undefine(e.props.overlay);const l=!(void 0!==e.props.showMask&&!pn.undefine(e.props.showMask));e.props.unmaskValue=pn.undefine(e.props.unmaskValue),e.hook.prop(((e,t)=>("unmaskValue"===e.prop&&(e.value=pn.undefine(e)),t(e))));const i={placeholder:l,pattern:null!==(t=e.props.mask)&&void 0!==t?t:"",mode:null!==(o=e.props.mode)&&void 0!==o?o:"shift",partOverrides:null!==(n=e.props.tokens)&&void 0!==n?n:{},prefix:null!==(r=e.props.prefix)&&void 0!==r?r:void 0,suffix:null!==(s=e.props.suffix)&&void 0!==s?s:void 0,reverse:pn.undefine(e.props.reverse)};np.set(e,i),e.hook.input(((t,o)=>{const n=function(e,t){const o=rp.get(e),n="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:n?t.maskValue:"";const r=sp.get(e);r.value=at(r,t);const s=Ze(r,np.get(e)),a=Ht(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=u(Nt(r)||[]));return null===a?"":e.props.unmaskValue?a:s}(e,t);return o(n)})),e.props._maskValue=Ze(a,i),e.input(e.props._maskValue,!1),e.context&&(e.context.handlers.DOMInput=t=>{e.emit("dom-input-event",t)}),pn.whenAvailable(`${e.props.id}`,To.bind(null,e),e.props.__root)}))}]},lp=a("tf"),{outer:ip,wrapper:pp,inner:dp,icon:cp,prefix:up,suffix:fp,help:hp,messages:vp,message:mp}=l(lp),gp=lp("fieldset",(()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}}))),$p=lp("legend",(()=>({if:"$label",$el:"legend"}))),bp=lp("source",(()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}}))),yp=lp("sourceHeader",(()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}}))),xp=lp("sourceHeaderLabel",(()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"}))),wp=lp("sourceHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_source_header_item_count"',role:"presentation","aria-label":'$sourceOptions.length " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.sourceHeaderItemCount'}}))),_p=lp("targetHeaderLabel",(()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"}))),kp=lp("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"}))),Sp=lp("sourceControls",(()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}}))),Lp=lp("sourceSearch",(()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}}))),Dp=lp("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"}}))),Ap=lp("sourceSearchClear",(()=>({$el:"button",if:'$inputText !== ""',attrs:{id:'$id + "_source_search_clear"',type:"button",onClick:"$handlers.clearSearch","aria-label":"Clear search",class:'$classes.transferlistSearchClear + " " + $classes.sourceSearchClear'}}))),Ip=lp("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"}}))),Cp=lp("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)",onTouchstart:"$handlers.listitemTouchstart($option, true)",onTouchmove:"$handlers.listitemTouchmove($option, true)",onTouchend:"$handlers.listitemTouchend($option, true)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.sourceListItem'}}))),Mp=lp("sourceOption",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option, $selectedSourceItems)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}}))),Tp=lp("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"}}))),Ep=lp("loadMoreInner","span"),Op=lp("target",(()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}}))),Fp=lp("targetHeader",(()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}}))),Vp=lp("targetListItems",(()=>({$el:"ul",attrs:{id:"$id","aria-activedescendant":"$activeDescendant",onMouseenter:"$handlers.onMouseenter(false)",onMouseout:"$handlers.onMouseleave(false)",class:'$classes.transferlistListItems + " " + $classes.targetListItems',tabindex:"$targetOptions.length === 0 && -1 || 0",onKeydown:"$handlers.targetListKeydown",onFocus:"$handlers.targetListFocused",onBlur:"$handlers.targetListBlurred"}}))),Bp=lp("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)",onTouchstart:"$handlers.listitemTouchstart($option, false)",onTouchmove:"$handlers.listitemTouchmove($option, false)",onTouchend:"$handlers.listitemTouchend($option, false)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.targetListItem'}}))),Pp=lp("targetOption",(()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index + "_option"',"data-checked":"$fns.isSelected($option, $selectedTargetItems)",class:'$classes.transferlistOption + " " + $classes.targetOption'}}))),Hp=lp("transferControls",(()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}}))),Np=lp("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'}}))),Rp=lp("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'}}))),Kp=lp("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'}}))),Wp=lp("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'}}))),Yp=lp("controlLabel","span"),qp=lp("sourceEmptyMessage",(()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}}))),Up=lp("targetEmptyMessage",(()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),zp=lp("emptyMessageInner","span"),jp=Symbol(),Zp=new WeakSet,Gp=new WeakSet,Xp={schema:ip(gp($p("$label"),hp("$help"),pp(bp(yp(xp(),wp(p("$optionsLoadingCounter > 0",cp("loader"),"$fns.getSourceItemCount($selectedSourceItems)"))),Sp(Lp(Dp(),Ap(cp("close")))),Ip(qp(zp("$sourceEmptyMessage")),Cp(p("$transferOnSelect !== true && $fns.isSelected($option, $selectedSourceItems)",cp("selected")),Mp("$option.label")),Tp(p("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",Ep(p("$state.loading",cp("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),Hp(Rp(Yp("$ui.addAllValues.value"),cp("fastForward")),Np(Yp("$ui.addSelectedValues.value"),cp("moveRight")),Kp(Yp("$ui.removeSelectedValues.value"),cp("moveLeft")),Wp(Yp("$ui.removeAllValues.value"),cp("rewind"))),Op(Fp(_p(),kp("$fns.getTargetItemCount($selectedTargetItems)")),Vp(Up(p("$state.loading !== true",zp("$targetEmptyMessage"))),Bp(p("$transferOnSelect !== true && $fns.isSelected($option, $selectedTargetItems)",cp("selected")),Pp(p("$fns.optionLoading($option, $optionLoaderValues)","$ui.isLoading.value","$option.label")))))),vp(mp("$message.value")))),type:"input",props:[],features:[cn.defaultIcon("moveRight","right"),cn.defaultIcon("moveLeft","left"),cn.defaultIcon("fastForward","fastForward"),cn.defaultIcon("rewind","rewind"),cn.defaultIcon("close","close"),cn.defaultIcon("loader","spinner"),cn.defaultIcon("selected","check"),cn.localize("isLoading"),cn.localize("loadMore"),cn.localize("addAllValues"),cn.localize("addSelectedValues"),cn.localize("removeSelectedValues"),cn.localize("removeAllValues"),cn.options,function(e){!function(e){e.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"]),e.props.loadMoreOption={label:"Load more",value:jp},void 0===e.props.draggable?e.props.draggable=!0:"false"===e.props.draggable&&(e.props.draggable=!1),e.props.optionsLoaderValues=[],e.props.selectedSourceItems=[],e.props.selectedTargetItems=[],e.props.optionsLoaded=void 0,e.props.memoOptions=[],e.props.multiple=!0,e.props.debounce=e.props.debounce?parseInt(e.props.debounce):200,e.props.optionLoaderValues=[],e.props.optionsLoadingCounter=0,e.props.optionLoadingCounter=0,e.props.page=1,e.props.hasNextPage=y.bind(null,e),e.props.options?e.props.options=[...e.props.options]:e.props.options=[],e.props.sourceOptions=[],e.props.targetOptions=[],"disabled"in e.props&&(e.props.disabled=pn.undefine(e.props.disabled)),e.props.searchable=pn.undefine(e.props.searchable),e.props.searchable&&(e.props.inputText=""),e.props.clearOnSelect=pn.undefine(e.props.clearOnSelect),void 0===e.props.transferOnSelect?e.props.transferOnSelect=!0:"false"===e.props.transferOnSelect&&(e.props.transferOnSelect=!1),e.props.targetOptions.length&&(e.props.targetOptionValues=e.props.targetOptions.map((e=>h(e)))),e.props.initialOptions=[...e.props.options],e.props.max&&(e.props.max=parseInt(e.props.max)),e.props.sourceListOrigin=void 0,"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase()))}(e),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?(v(e,e.props.inputText),e.props.reFilter=!1):e.props.initialLoad||(e.isCreated||(e.props.skipSetActiveValue=!0),Bo(e)),"function"==typeof e.props.optionLoader?Ho(e):e.props.initialLoad||(e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])])}))}(e),Yo(e),function(e){e.on("prop:options",(()=>{e.props.appendingOptions&&(e.props.skipSetActiveValue=!0,e.props.appendingOptions=!1),Bo(e)})),e.on("prop:memoOptions",(()=>{e.props.skipSetActiveValue=!0,Bo(e)})),e.on("prop:sourceOptions",(()=>{0===e.props.sourceOptions.length?e.props.showSourceEmptyMessage=!0:e.props.showSourceEmptyMessage=!1,Zp.delete(e)})),e.on("prop:targetOptions",(()=>{0===e.props.targetOptions.length?e.props.showTargetEmptyMessage=!0:e.props.showTargetEmptyMessage=!1})),e.on("prop:activeValue",(({payload:t})=>{if(e.props.isDragging)return void(e.props.activeDescendant=void 0);if(t===jp)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=(e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions).findIndex((e=>pn.eq(h(e),t)));o>=0&&e.props.sourceListOrigin?e.props.activeDescendant=`${e.props.id}_source_list_item_${o}`:e.props.activeDescendant=o>=0?`${e.props.id}_target_list_item_${o}`:void 0})),e.on("prop:mouseOnSource",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled&&!e.props.isDragging){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_source_list_items");if(!t)return;e.props.mouseOnTarget=!1,e.props.sourceListOrigin=!0,Zp.delete(e),qo(e,t)}})),e.on("prop:mouseOnTarget",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled&&!e.props.isDragging){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;e.props.mouseOnSource=!1,e.props.sourceListOrigin=!1,Gp.delete(e),qo(e,t)}})),e.on("prop:optionsLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionLoadingCounter&&e.store.set(kr)})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&(e.store.set(kr),e.props.skipSetActiveValue=!0,Bo(e))}))}(e)}]},Jp=a("sl"),{outer:Qp,wrapper:ed,inner:td,icon:od,label:nd,prefix:rd,suffix:sd,help:ad,messages:ld,message:id}=l(Jp),pd=Jp("chart",(()=>({$el:"div",if:"$chart"}))),dd=Jp("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 + "%"'}}}}))),cd=Jp("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),ud=Jp("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),fd=Jp("trackWrapper",(()=>({$el:"div"}))),hd=Jp("trackInner",(()=>({$el:"div"}))),vd=Jp("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),md=Jp("linkedValues",(()=>({$el:"div"}))),gd=Jp("maxValue",(()=>({$formkit:"number",bind:"$computedMaxInputAttrs",ignore:!0,value:{if:"$isMulti",then:"$_value.1",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.maxNode",onBlur:"$handlers.inputBlur"}))),$d=Jp("minValue",(()=>({$formkit:"number",if:"$isMulti",bind:"$computedMinInputAttrs",ignore:!0,value:{if:"$isMulti",then:"$_value.0",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.minNode",onBlur:"$handlers.inputBlur"}))),bd=Jp("marks",(()=>({$el:"div",if:"$marks"}))),yd=Jp("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) + "%"'}}}))),xd=Jp("markLabel",(()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}}))),wd=Jp("handles",(()=>({$el:"ul"}))),_d=Jp("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",onTouchstart:"$handlers.startDrag",style:"$maxHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),kd=Jp("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",onTouchstart:"$handlers.startDrag",style:"$minHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Sd=Jp("handleMinInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}}))),Ld=Jp("handleMaxInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}}))),Dd=Jp("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"}}))),Ad=Jp("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"}}))),Id={schema:Qp(ed(nd("$label"),ad("$help"),cd(od("prefix"),rd(),ud(pd(dd()),fd(hd(vd(),bd(yd(xd())),wd(kd(Ad(),Sd()),_d(Dd(),Ld()))))),sd(),od("suffix"),p("$showInput && $isMulti === false",gd())),p("$showInput && $isMulti",md($d(),gd())),ld(id("$message.value")))),type:"input",family:"",props:["min","max","step","showInput","tooltip","tooltipFormat","inputAttrs","maxInputAttrs","minInputAttrs","marks","markLabels","snapToMarks","chart","scalingFunction","intervals"],features:[function(e){function t(t){const{min:o,max:r,intervals:s}=e.props;if(t=Math.min(Math.max(t,0),100),!s||0===s.length){u();const n=o+t/100*(r-o);return e.props.scalingFunction.reverse(n,o,r)}const a=n(s,o,r);for(let e=0;e<a.length;e++){const{value:o,step:n,left:r,width:s,stepsInInterval:l}=a[e];if(t>=r&&t<=r+s){const e=o+(t-r)/s*l*n,a=e%n;return p(a<n/2?e-a:e+(n-a))}}return t>100?r:t<0?o:void 0}function o(t,o=e.props.min,r=e.props.max){const s=e.props.intervals;if(!s||0===s.length){u();return(e.props.scalingFunction.forward(t,o,r)-o)/(r-o)*100}const a=n(s,o,r);for(let e=0;e<a.length;e++){const{value:o,step:n,left:s,width:l,stepsInInterval:i}=a[e],p=e<a.length-1?a[e+1].value:r;if(t>=o&&t<=p){return 100*((s+(t-o)/n/i*l)/100)}}return 100}function n(t,o=e.props.min,n=e.props.max){(t=[...t]).sort(((e,t)=>e.value-t.value)),t[0].value!==o&&t.unshift({value:o,step:e.props.step});let r=0;for(let e=0;e<t.length;e++){const o=t[e].value,s=((e<t.length-1?t[e+1].value:n)-o)/t[e].step;r+=s}let s=0;return t.map(((e,o)=>{const a=e.value,l=((o<t.length-1?t[o+1].value:n)-a)/e.step,i=s/r*100;return s+=l,{value:e.value,step:e.step,left:i,width:l/r*100,stepsInInterval:l,totalSteps:r}}))}function r(){const t=parseFloat(`${e.props.min}`),n=parseFloat(`${e.props.max}`);let r,a=0;if(Array.isArray(e._value)){const t=[...e._value].sort(s);a=parseFloat(`${t[0]}`),r=parseFloat(`${t[1]}`)}else r=parseFloat(`${e._value}`);e.props.maxHandleStyles={left:`${o(r,t,n)}%`},e.props.isMulti&&Array.isArray(e._value)?(e.props.minHandleStyles={left:`${o(a,t,n)}%`},e.props.fillStyles={left:`${o(a,t,n)}%`,width:o(r,t,n)-o(a,t,n)+"%"}):e.props.fillStyles={left:"0%",width:`${o(r,t,n)}%`}}function s(e,t){return parseFloat(`${e}`)-parseFloat(`${t}`)}function a(t,o=!0){if(e.props.disabled)return;let n;if(void 0===t){if(e.props.isMulti)e.input([e.props.min,e.props.max]);else{const t=e.props.min+(e.props.max-e.props.min)/2;e.input(t)}return r(),void l()}if(e.props.isMulti&&Array.isArray(e._value)&&!Array.isArray(t)){const o="min"===e.props.lastHandleInteraction?0:1;e._value[o]=t;const[r,a]=[...e._value];if(r>=a){const t=null==f?void 0:f.querySelector(`[data-handle="${"min"===e.props.lastHandleInteraction?"max":"min"}"]`);null==t||t.focus()}n=d([...e._value].sort(s))}else Array.isArray(t)?n=d(t):(n=d(t),n=isNaN(n)?e.props.min:n);e.props.snapToMarks&&(n=c(n));const a=i(n);o&&e.input(a),r(),l()}function l(){if(e.props.isMulti&&Array.isArray(e._value)){const[t,o]=[...e._value];h&&h.input(t),v&&v.input(o)}else v&&v.input(e._value)}function i(t){return e.props.isMulti&&Array.isArray(t)?[i(t[0]),i(t[1])]:(t=isNaN(t)?e.props.min:t,Math.min(Math.max(parseFloat(`${t}`),e.props.min),e.props.max))}function p(t){return parseFloat(t.toFixed(e.props.decimals))}function d(t){if(e.props.snapToMarks)return t;if(!e.props.intervals)return Array.isArray(t)?t.map((t=>p(Math.round(t/e.props.step)*e.props.step))):p(Math.round(t/e.props.step)*e.props.step);const o=n(e.props.intervals);if(Array.isArray(t))return t.map((t=>{const n=o.find(((n,r)=>{var s;return t>=n.value&&t<((null===(s=o[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!n)return t;return p(n.value+Math.round((t-n.value)/n.step)*n.step)}));{const n=o.find(((n,r)=>{var s;return t>=n.value&&t<((null===(s=o[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!n)return t;return p(n.value+Math.round((t-n.value)/n.step)*n.step)}}function c(t){if(Array.isArray(t))return t[0]=c(t[0]),t[1]=c(t[1]),t;{const o=e.props.marks,n=o.reduce(((e,o)=>Math.abs(o.at-t)<Math.abs(e.at-t)?o:e),o[0]);return n.at}}function u(){if(g)return;pn.undefine(e.props.scalingFunction)?"string"==typeof e.props.scalingFunction?e.props.scalingFunction=m[e.props.scalingFunction]||m.linear:"object"==typeof e.props.scalingFunction&&(e.props.scalingFunction={...m.linear,...e.props.scalingFunction}):e.props.scalingFunction=m.linear,g=!0}let f,h,v;e.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]);const m={linear:{forward:e=>e,reverse:e=>e},log:{forward:(t,o=e.props.min,n=e.props.max)=>n*Math.pow(t/n,1.5),reverse:(t,o=e.props.min,n=e.props.max)=>n*Math.pow(t/n,1/1.5)}};let g=!1;e.props.maxHandleStyles={left:"0%"},e.props.fillStyles={left:"0%",width:"0%"},e.props.isMulti=!1,e.props.step=1,e.props.min=0,e.props.max=100,e.props.tooltipFormat="function"==typeof e.props.tooltipFormat?e.props.tooltipFormat:(e,t)=>{if(t)return e},e.props.largestBar=0,"disabled"in e.props&&(e.props.disabled=pn.undefine(e.props.disabled)),e.on("created",(()=>{function l(o){var n;if(!f||!e.props.dragging)return;o.preventDefault();const r=o.clientX||(null===(n=o.touches)||void 0===n?void 0:n.length)&&o.touches[0].clientX,{left:s,width:l}=f.getBoundingClientRect();a(t((r-s)/l*100))}var p;u(),e.props.isMulti=Array.isArray(e.value),e.props.step=parseFloat(`${e.props.step}`),e.props.decimals=(null===(p=e.props.step.toString().split(".")[1])||void 0===p?void 0:p.length)||0,e.props.min=parseFloat(`${e.props.min}`),e.props.max=parseFloat(`${e.props.max}`);const d=pn.undefine(e.props.tooltip);e.props.tooltip=void 0===e.props.tooltip?"auto":d;const m=pn.undefine(e.props.marks);e.props.marks=!!m&&(Array.isArray(e.props.marks)?e.props.marks:function(){const{min:t,max:o,step:n}=e.props,r=[];for(let e=t;e<=o;e+=n)r.push({at:e,label:e});return r}()),e.props.markLabels=pn.undefine(e.props.markLabels),e.props.snapToMarks=pn.undefine(e.props.snapToMarks),e.props.showInput=pn.undefine(e.props.showInput),e.props.largestBar=e.props.chart?e.props.chart.reduce(((e,t)=>t.value>e?t.value:e),0):e.props.largestBar;const g={disabled:e.props.disabled,min:e.props.min,max:e.props.max,step:e.props.step};if(e.props.inputAttrs=e.props.inputAttrs&&"object"==typeof e.props.inputAttrs?Object.assign(g,e.props.inputAttrs):g,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,pn.whenAvailable(`track-${e.props.id}`,(()=>{var t;f=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`track-${e.props.id}`),a(e.value,!1),r()}),e.props.__root),e.context){let r=0,p="";const d=e.context.handlers.blur;e.context.handlers.blur=t=>{d(t),e.emit("blur")},e.context.handlers.clickTrack=o=>{if(!f)return;e.props.dragging=!1;const{left:n,width:r}=f.getBoundingClientRect(),s=(o.clientX-n)/r;if(e.props.isMulti&&Array.isArray(e.value)){const[o,n]=e.value,r=Math.abs(o-s*e.props.max)<Math.abs(n-s*e.props.max)?"min":"max",l="min"===r?0:1;e.props.lastHandleInteraction=r,e.value[l]=t(100*s),a(e._value)}else a(t(100*s))},e.context.handlers.focus=t=>{if(!f)return;const o=t.target.dataset.handle;o&&(e.props.lastHandleInteraction=o)},e.context.handlers.clickHandle=t=>{t.stopPropagation(),e.props.attrs.onClick&&e.props.attrs.onClick(t),e.props.dragging=!1,a(e._value)},e.context.handlers.startDrag=t=>{if(!f)return;e.props.dragging=!0;const o="touchstart"===t.type,n=o?"touchmove":"mousemove",r=o?"touchend":"mouseup";e.props.lastHandleInteraction=t.target.dataset.handle||e.props.lastHandleInteraction,document.addEventListener(n,l,{passive:!1}),document.addEventListener(r,(()=>{e.context&&(e.props.dragging=!1,document.removeEventListener(n,l),o&&t.target instanceof HTMLElement&&t.target.blur())}))},e.context.handlers.keydown=t=>{if(["1","2","3","4","5","6","7","8","9","0",".","-"].includes(t.key)){t.preventDefault(),clearTimeout(r),p+=t.key;const e="-"===p?-1:1;r=window.setTimeout((()=>{"-"!==p?(a(parseFloat(p)*e),p=""):p=""}),350)}if(["ArrowLeft","ArrowDown","ArrowRight","ArrowUp","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const o="min"===e.props.lastHandleInteraction?0:1,r=Array.isArray(e._value)?e._value[o]:e._value,s=function(t,o){if(!e.props.intervals)return e.props.step;const r=n(e.props.intervals);if(t>=e.props.max)return r[r.length-1].step;let s=r.find(((o,n)=>{var s;return t>=o.value&&t<((null===(s=r[n+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!s)return e.props.step;-1===o&&t-s.step<s.value&&(s=r[r.indexOf(s)-1]||s);return s.step}(r,["ArrowLeft","ArrowDown","PageDown"].includes(t.key)?-1:1);if(e.props.marks&&e.props.snapToMarks){const o=c(r),n=e.props.marks.find((e=>e.at===o)),s=e.props.marks.indexOf(n),l=["ArrowLeft","ArrowDown"].includes(t.key)?-1:1,i=Math.min(Math.max(0,s+l),e.props.marks.length-1);return void a(e.props.marks[i].at)}if(t.metaKey)return void("ArrowLeft"===t.key||"ArrowDown"===t.key?a(e.props.min):a(e.props.max));if("Home"===t.key)return void a(e.props.min);if("End"===t.key)return void a(e.props.max);if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)){a(r+(t.shiftKey?10*s:s)*(["ArrowLeft","ArrowDown"].includes(t.key)?-1:1))}"PageUp"===t.key?a(r+10*s):"PageDown"===t.key&&a(r-10*s)}},e.context.handlers.maxNode=t=>{v=t,t.hook.commit(((o,n)=>{if(pn.eq(t.value,o))return n(o);const r=parseFloat(o);return e.props.isMulti&&Array.isArray(e.value)?(e.value[1]=r,a(e.value)):a(r),n(i(r))}))},e.context.handlers.minNode=t=>{h=t,t.hook.commit(((o,n)=>{if(pn.eq(t.value,o))return n(o);const r=parseFloat(o);return e.props.isMulti&&Array.isArray(e.value)?(e.value[0]=r,a(e.value)):a(r),n(i(r))}))},e.context.handlers.inputBlur=()=>{e.props.isMulti&&Array.isArray(e.value)&&(e.value.sort(s),h&&h.input(e.value[0]),v&&v.input(e.value[1]))},e.context.fns.calculateMarkPosition=t=>o(t,e.props.min,e.props.max)}a(e.value,!1)})),e.on("input",(({payload:t})=>{Array.isArray(e.value)&&Array.isArray(t)?e.value[0]===t[0]&&e.value[1]===t[1]||a(t,!1):e.value!==t&&a(t,!1)})),e.on("prop:max",(()=>{e.props.max=parseFloat(`${e.props.max}`),a(e.value)})),e.on("prop:min",(()=>{e.props.min=parseFloat(`${e.props.min}`),a(e.value)}))}]},Cd=a("cp"),{outer:Md,wrapper:Td,inner:Ed,label:Od,prefix:Fd,suffix:Vd,help:Bd,messages:Pd,message:Hd,icon:Nd}=l(Cd),Rd=Cd("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'}}))),Kd=Cd("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:""}}}}))),Wd=Cd("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"}}}}}))),Yd=Cd("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"}}))),qd=Cd("controlGroup",(()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}}))),Ud=Cd("LS",(()=>({$el:"div",attrs:{class:"$classes.LS"}}))),zd=Cd("canvasLS",(()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}}))),jd=Cd("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 + "%"'}}))),Zd=Cd("hue",(()=>({$el:"div",attrs:{class:"$classes.hue"}}))),Gd=Cd("canvasHue",(()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}}))),Xd=Cd("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"}}))),Jd=Cd("alpha",(()=>({$el:"div",attrs:{class:"$classes.alpha"}}))),Qd=Cd("canvasAlpha",(()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true"}}))),ec=Cd("controlAlpha",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",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)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$hsla.a"}}))),tc=Cd("preview",(()=>({$el:"div",attrs:{class:"$classes.preview"}}))),oc=Cd("canvasPreview",(()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}}))),nc=Cd("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"}}]}))),rc=Cd("eyeDropper",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}}))),sc=Cd("formatField",(()=>({$el:"div",attrs:{class:"$classes.formatField"}}))),ac=Cd("colorInputGroup",(()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}}))),lc=Cd("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"}}]}))),ic=Cd("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"}}]}))),pc=Cd("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"}}]}))),dc=Cd("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"}}]}))),cc=Cd("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",autocomplete:"off"},"aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$rgba.a"},{$el:"label",children:"A",attrs:{for:'$: "a-" + $id',class:"$classes.fieldLabel"}}]}))),uc=Cd("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"}}]}))),fc=Cd("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"}}]}))),hc=Cd("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"}}]}))),vc=Cd("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"}}))),mc=Cd("swatches",(()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}}))),gc=Cd("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"}}}}))),$c=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,bc=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i,yc={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"},xc={schema:Md(Td(Od("$label"),p("$inline && $help",Bd("$help")),Ed(p("($inline === undefined || $inline === false) && $prefixIcon !== undefined",Nd("prefix","label")),p("$inline === undefined || $inline === false",Fd()),p("$inline === undefined || $inline === false",Rd(nc(),p("$showValue",Kd()))),p("$inline || $expanded)",Wd(p("$showPanelClose && ($inline === undefined || $inline === false)",Yd(Nd("close"))),p("$panelControls",qd(Ud(zd(),jd()),tc(oc()),Zd(Gd(),Xd()),Jd(Qd(),ec()),p("$eyeDropper && $hasNativeEyeDropper",rc(Nd("eyeDropper"))))),p("$panelFormat",sc(ac(p('$panelActiveFormat === "hex"',lc()),p('$panelActiveFormat === "rgba"',ic()),p('$panelActiveFormat === "rgba"',pc()),p('$panelActiveFormat === "rgba"',dc()),p('$panelActiveFormat === "hsla"',uc()),p('$panelActiveFormat === "hsla"',fc()),p('$panelActiveFormat === "hsla"',hc()),p('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',cc())),vc(Nd("switch")))),p("$options",mc(gc())))),p("$inline === undefined || $inline === false",Vd()),p("($inline === undefined || $inline === false) && $suffixIcon !== undefined",Nd("suffix"))),p("$: ($inline === undefined || $inline === false) && $help",Bd("$help"))),Pd(Hd("$message.value"))),type:"input",family:"text",props:["disbaled","format","valueFormat","panelControls","panelFormat","eyeDropper","inline","options","showValue","closeOnSelect","allowPaste"],features:[function(e){function t(t){var n,r;if(!e.context||!e.props.allowPaste||e.props.disabled)return;const s=null===(n=e.props.__root)||void 0===n?void 0:n.activeElement;if(k&&k.contains(s)){const n=null===(r=t.clipboardData)||void 0===r?void 0:r.getData("text");if(!n)return;if("INPUT"===s.tagName&&!en(n)&&!$c.test(n)&&!bc.test(n))return;(en(n)||n.startsWith("hsl")||n.startsWith("rgb"))&&(e.props.hexInputFocused&&(e.props.hexInputFocused=!1,setTimeout((()=>{e.props.hexInputFocused=!0}),10)),t.preventDefault(),o(n))}}function o(t){var o;if(!t)return;const n=tn(t);if(n){const[o,r,s,a]=n;"undefined"!==t&&("number"!=typeof o||isNaN(o)||"number"!=typeof r||isNaN(r)||"number"!=typeof s||isNaN(s)||"number"!=typeof a||isNaN(a)||zo(o,2)===e.props.h&&zo(r,2)===e.props.s&&zo(s,2)===e.props.v&&zo(a,2)===e.props.alpha)||(e.props.alpha=zo(a,2),x(o,r,s))}else{const n=null===(o=e.props.options)||void 0===o?void 0:o.find((e=>{var o;return(null===(o=e.label)||void 0===o?void 0:o.toLowerCase())===t.toLowerCase()}));if(n&&n.value){const t=tn(n.value);if(t){const[o,n,r,s]=t;e.props.alpha=zo(s,2),x(o,n,r)}else x(e.props.h,e.props.s,e.props.v)}else x(e.props.h,e.props.s,e.props.v)}}function n(t){if(!e.context||!C)return;const o=C[t];o&&(e.props.focusedSwatch=o.dataset.color)}function r(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 s(){e.context&&e.props.eyeDropper&&(e.context.hasNativeEyeDropper=!("undefined"==typeof window||!window.EyeDropper),pn.whenAvailable(`eye-dropper-${e.props.id}`,(()=>{var t;const o=new window.EyeDropper,n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`eye-dropper-${e.props.id}`);null==n||n.addEventListener("click",(async()=>{const t=await o.open();if(!t.sRGBHex)return;const[n,r,s]=jo(t.sRGBHex);e.props.alpha=1,x(n,r,s)}))}),e.props.__root))}function a(){l("canvas-ls",(e=>{S=e}),E,v),l("canvas-hue",(e=>{L=e}),d,m),l("canvas-alpha",(e=>{D=e}),O,g),i(`canvas-preview-${e.props.id}`,(e=>{A=e,c()}),F),i(`canvas-swatch-preview-${e.props.id}`,(e=>{I=e,u()}),V),p()}function l(t,o,n,r){let s=!1;const a=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",d),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",c)},l=e=>{1===e.buttons&&_&&r(e)},p=e=>{_&&r(e)},d=()=>{_=void 0,a()},c=()=>{_=void 0,a()};i(`${t}-${e.props.id}`,(e=>{const a=e.nextElementSibling;o(e),n(),function(e,t){const o=o=>{e&&(o.preventDefault(),t(o))};null==e||e.addEventListener("mousedown",o),null==e||e.addEventListener("touchstart",o)}(e,r),s||function(e,t){s=!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")}))}(a,e),e.addEventListener("mousedown",(e=>{a.focus(),a.setAttribute("data-prevent-focus-style","true"),_=yc[t],r(e),document.addEventListener("mousemove",l),document.addEventListener("mouseup",d)})),e.addEventListener("touchstart",(()=>{a.setAttribute("data-prevent-focus-style","true"),a.focus(),_=yc[t],document.addEventListener("touchmove",p),document.addEventListener("touchend",c)}))}),n)}function i(t,o,n){pn.whenAvailable(t,(()=>{var s;const a=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(t);a&&(o(a),n&&r(a,n))}),e.props.__root)}function p(){pn.whenAvailable(`swatches-${e.props.id}`,(()=>{var t,o,n;C=Array.from((null===(t=e.props.__root)||void 0===t?void 0:t.querySelectorAll(`#swatches-${e.props.id} canvas`))||[]),C.forEach((e=>{r(e,f)})),e.props.focusedSwatch=null===(n=null===(o=C[0])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.color,b()}),e.props.__root)}function d(){if(!L)return;const e=L.getContext("2d");if(!e)return;const t=L.width,o=L.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 c(){if(!A)return;const t=A.getContext("2d");if(!t)return;$(A,A.width/3);const{r:o,g:n,b:r,a:s}=e.props.rgba;t.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,t.fillRect(0,0,A.width,A.height)}function u(){if(!I)return;const t=I.getContext("2d");if(!t)return;$(I,I.height/2);const{r:o,g:n,b:r,a:s}=e.props.rgba;t.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,t.fillRect(0,0,I.width,I.height)}function f(e){if(!e)return;const t=e.getContext("2d");if(!t)return;$(e,e.width/2);const o=e.dataset.colorPrecise;if(!o)return;const[n,r,s,a]=on(o),[l,i,p,d]=Zo(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 h(e,t,o){let n=null;const r=e=>{null!==n&&cancelAnimationFrame(n),n=requestAnimationFrame((()=>{if(!t)return;const n=t.getBoundingClientRect();let r,s;"touches"in e?(r=e.touches[0].clientX-n.left,s=e.touches[0].clientY-n.top):(r=e.clientX-n.left,s=e.clientY-n.top),r=Math.min(Math.max(r,0),n.width),s=Math.min(Math.max(s,0),n.height),o(r,s)}))};r(e);const s=e=>{e.preventDefault(),r(e)},a=e=>{e.preventDefault(),r(e)},l=()=>{_=void 0,document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",l)},i=()=>{_=void 0,document.removeEventListener("touchmove",a),document.removeEventListener("touchend",i)};"touches"in e?(document.addEventListener("touchmove",a),document.addEventListener("touchend",i)):(document.addEventListener("mousemove",s),document.addEventListener("mouseup",l))}function v(t){h(t,S,((t,o)=>{const n=t/S.width*100,r=100-o/S.height*100;B(e.props.hue,n,r)}))}function m(t){h(t,L,((t,o)=>{if(!L)return;const n=L.width,r=Math.floor(t/n*360);e.props.h=r,B(e.props.h,e.props.s,e.props.v)}))}function g(t){h(t,D,((t,o)=>{const n=t/D.width*100/100;e.props.alpha=n,B(e.props.hue,e.props.s,e.props.v)}))}function $(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 b(){var t,o;if(!e.context||!e.props.options||!C)return;const{h:r,s:s,v:a,alpha:l}=e.props,i=function(e,t,o,n=1){const r=0===o?0:t;return`${zo(0===o||100===o&&0===t?0:e,0)}-${zo(r,0)}-${zo(o,0)}-${zo(n,2)}`}(r,s,a,l);let p=!1,d=!1;C.forEach((e=>{const t=e.dataset.color;if(!t)return;const[o,r,s,c]=t.split("-");"0"===s&&0===a&&c===`${l}`&&(d=!0);const u=e.parentElement;d||t===i?(u.dataset.active="true",e.ariaSelected="true",d=!1,!p&&C&&(n(C.indexOf(e)),p=!0)):(delete u.dataset.active,e.ariaSelected="false")})),p||(e.props.focusedSwatch=null===(o=null===(t=C[0])||void 0===t?void 0:t.dataset)||void 0===o?void 0:o.color)}function y(t){t=t.replace("#",""),e.props.hexInputFocused||3!==t.length||(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),t=`#${t=t.toUpperCase()}`,e.props.hex=t.slice(0,9)}function x(t,o,n,r=!1){e.props.h=void 0===t||isNaN(t)?e.props.h:zo(Math.max(Math.min(t,360),0),2),e.props.s=void 0===o||isNaN(o)?e.props.s:zo(Math.max(Math.min(o,100),0),2),e.props.v=void 0===n||isNaN(n)?e.props.v:zo(Math.max(Math.min(n,100),0),2);const{h:s,s:a,v:l,alpha:i}=e.props,[p,d,c]=Zo(s,a,l),[u,f,h]=Xo(s,a,l),v=e.props.hexInputFocused?e.props.hex:Qo(s,a,l,i),m=zo(i,2);e.props.hsla={h:s,s:d,l:c,a:m},e.props.hslaPercent={h:zo(s,0),s:100===l&&0===a?0:zo(0===l?d/255:Math.max(Math.min(d/255*100,100),0),0),l:zo(Math.max(Math.min(e.props.hsla.l/255*100,100),0),0),a:m},e.props.hslaString=`hsla(${e.props.hslaPercent.h}, ${e.props.hslaPercent.s}%, ${e.props.hslaPercent.l}%, ${m})`,e.props.hslaStringPrecise=`hsla(${s}, ${zo(0===l?d/255:d/255*100,2)}%, ${zo(c/255*100,2)}%, ${m})`,e.props.rgba={r:u,g:f,b:h,a:m},e.props.rgbaString=`rgba(${u}, ${f}, ${h}, ${m})`,y(v),setTimeout((()=>{var t;w(),function(){const t=e.props.s,o=100-e.props.v;e.props.controlLSPosition={x:t,y:o}}(),P(),k||"undefined"==typeof window||(k=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"]`))}),0);const g=e.props.valueFormat?e.props.valueFormat:e.props.format;r||("hex"===g?e.input(e.props.hex):"rgba"===g?e.input(e.props.rgbaString):"hsla"===g&&e.input(e.props.hslaStringPrecise))}function w(){E(),O(),F(),V()}let _,k=null,S=null,L=null,D=null,A=null,I=null,C=null,M=0;const T=["hex","rgba","hsla"],E=nn((function(){if(!S)return;const t=S.getContext("2d");if(!t)return;const{width:o,height:n}=S,r=e.props.h||0;t.fillStyle=`hsl(${r}, 100%, 50%)`,t.fillRect(0,0,o,n);const s=t.createLinearGradient(0,0,o,0);s.addColorStop(0,"rgba(255, 255, 255, 1)"),s.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=s,t.fillRect(0,0,o,n);const a=t.createLinearGradient(0,0,0,n);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),t.fillStyle=a,t.fillRect(0,0,o,n)}),2),O=nn((function(){if(!D)return;const t=D.getContext("2d");if(!t)return;const o=Math.round(D.width),n=Math.round(D.height);t.clearRect(0,0,o,n),$(D,n/2);const r=e.props.rgba.r||0,s=e.props.rgba.g||0,a=e.props.rgba.b||0,l=t.createLinearGradient(0,0,o,0);l.addColorStop(0,`rgba(${r}, ${s}, ${a}, 0)`),l.addColorStop(1,`rgba(${r}, ${s}, ${a}, 1)`),t.fillStyle=l,t.fillRect(0,0,o,n)}),2),F=nn(c,2),V=nn(u,2),B=nn(x,2),P=nn(b,10,!1);e.addProps(["expanded","h","s","v","alpha","hsla","hslaPercent","hslaString","hslaStringPrecise","rgba","rgbaString","hex","controlLSPosition","panelActiveFormat","hexInputFocused","hasNativeEyeDropper","focusedSwatch","swatchIsUsingKeyboardNav","showPanelClose"]),e.props.h=e.props.h||void 0,e.props.s=e.props.s||void 0,e.props.v=e.props.v||void 0,e.props.alpha=e.props.alpha||1,e.props.controlLSPosition=e.props.controlLSPosition||{x:0,y:0},e.props.switchIcon=e.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>',e.props.hexInputFocused=!1,e.props.swatchIsUsingKeyboardNav=!1,e.on("destroying",(()=>{e.context&&"undefined"!=typeof document&&document.removeEventListener("paste",t)})),e.on("created",(()=>{e.context&&("undefined"!=typeof window&&document.addEventListener("paste",t),e.props.expanded=!1,e.props.panelActiveFormat=e.props.format||T[0],e.props.panelControls=rn(e.props.panelControls),e.props.eyeDropper=rn(e.props.eyeDropper),e.props.panelFormat=rn(e.props.panelFormat),e.props.showValue=rn(e.props.showValue),e.props.allowPaste=rn(e.props.allowPaste),e.props.inline=pn.undefine(e.props.inline),e.props.disabled=pn.undefine(e.props.disabled),e.props.format=e.props.format||"hex",e.props.valueFormat=e.props.valueFormat||e.props.format,e.props.closeOnSelect=pn.undefine(e.props.closeOnSelect),e.props.focusedSwatch=void 0,void 0===e.value||""===e.value||null===e.value?(e.props.rgba={r:0,g:0,b:0},x(0,0,0,!0)):o(`${e.value}`),e.on("input",(({payload:t})=>{k&&void 0!==e.props.__root&&!k.contains(e.props.__root.activeElement)&&o(t)})),setTimeout((()=>{s()}),5),a(),e.on("prop:expanded",(()=>{function t(t){"Escape"===t.key&&(t.preventDefault(),e.props.expanded=!1)}var o;if(e.props.expanded)s(),a(),p(),document.addEventListener("keydown",t),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?e.props.showPanelClose=!0:e.props.showPanelClose=!1,setTimeout((()=>{var t;const o=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`);o&&o.focus()}),0);else{document.removeEventListener("keydown",t);(null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${e.props.id}"] *[tabindex="0"]`)).focus()}})),e.context.fns.anyToHsvaString=(e,t)=>{const o=tn(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),`${zo(n,t)}-${zo(r,t)}-${zo(s,t)}-${zo(a,2)}`},e.context.handlers.inputPreviewClick=t=>{e.props.expanded=!e.props.expanded},e.context.handlers.inputPreviewFocusout=t=>{var o,n,r;const s=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${e.props.id}"] .formkit-inner`),a=t.relatedTarget;if(s.contains(a)){function l(t){var o,n;s.contains(t.target)||(e.props.expanded=!1,null===(o=e.props.__root)||void 0===o||o.removeEventListener("mousedown",l),null===(n=e.props.__root)||void 0===n||n.removeEventListener("touchstart",l))}null===(n=e.props.__root)||void 0===n||n.addEventListener("mousedown",l),null===(r=e.props.__root)||void 0===r||r.addEventListener("touchstart",l)}else e.props.expanded=!1},e.context.handlers.inputPreviewKeydown=t=>{"Escape"===t.key&&(t.preventDefault(),e.props.expanded=!1),"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.expanded=!e.props.expanded)},e.context.handlers.closePanel=()=>{e.props.expanded=!1},e.context.handlers.panelCloseKeydown=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.expanded=!1)},e.context.handlers.toggleFormat=(t=1)=>{t="number"==typeof t?t:1;const o=(T.indexOf(e.props.panelActiveFormat)+t+T.length)%T.length;e.props.panelActiveFormat=T[o]},e.context.handlers.panelKeydown=t=>{var o,n,r;if("Tab"===t.key&&e.props.expanded){t.preventDefault();const s=Array.from((null===(o=e.props.__root)||void 0===o?void 0:o.querySelectorAll(`[data-id="${e.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`))||[]).filter(sn),a=s.indexOf((null===(n=e.props.__root)||void 0===n?void 0:n.activeElement)?null===(r=e.props.__root)||void 0===r?void 0:r.activeElement:e.props.__root);let l;l=t.shiftKey?(a-1+s.length)%s.length:(a+1)%s.length,s[l].focus()}},e.context.handlers.lsKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r}=e.props,s=t.shiftKey?10:1;switch(t.key){case"ArrowLeft":x(o,n-s,r);break;case"ArrowRight":x(o,n+s,r);break;case"ArrowUp":x(o,n,r+s);break;case"ArrowDown":x(o,n,r-s);break;case"PageUp":x(o,n,r+10);break;case"PageDown":x(o,n,r-10);break;case"Home":x(o,n-10,r);break;case"End":x(o,n+10,r)}w()}},e.context.handlers.hueControlKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r}=e.props,s=t.shiftKey?10:1;switch(t.key){case"ArrowLeft":case"ArrowDown":x(o-s,n,r);break;case"ArrowRight":case"ArrowUp":x(o+s,n,r);break;case"PageUp":x(o+10,n,r);break;case"PageDown":x(o-10,n,r);break;case"Home":x(0,n,r);break;case"End":x(360,n,r)}w()}},e.context.handlers.alphaControlKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r,alpha:s}=e.props,a=t.shiftKey?.1:.01;switch(t.key){case"ArrowLeft":case"ArrowDown":e.props.alpha=zo(Math.min(Math.max(s-a,0),1),2);break;case"ArrowRight":case"ArrowUp":e.props.alpha=zo(Math.min(Math.max(s+a,0),1),2);break;case"PageUp":e.props.alpha=zo(Math.min(Math.max(s+.1,0),1),2);break;case"PageDown":e.props.alpha=zo(Math.min(Math.max(s-.1,0),1),2);break;case"Home":e.props.alpha=0;break;case"End":e.props.alpha=1}x(o,n,r)}},e.context.handlers.eyeDropperKeydown=t=>{var o;if("Enter"===t.key||" "===t.key){t.preventDefault();const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`eye-dropper-${e.props.id}`);null==n||n.click()}},e.context.handlers.formatSwitcherKeydown=t=>{e.context&&("Enter"!==t.key&&" "!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),e.context.handlers.toggleFormat()),"ArrowUp"===t.key&&(t.preventDefault(),e.context.handlers.toggleFormat(-1)))},e.context.handlers.hexInput=t=>{const o=t.target,n=o.value.startsWith("#")?9:8,r=o.value.slice(0,n);if(o.value=r,en(r)){const[t,o,n,s]=jo(r);e.props.alpha=s,y(r),x(t,o,n)}},e.context.handlers.hexKeydown=t=>{const o=t.target,n=o.value;let r="";if(!en(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=t.shiftKey?10:1,d=16777215;let c;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key))switch(t.preventDefault(),t.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}`),e.context&&e.context.handlers.hexInput(t)},e.context.handlers.hexFocus=()=>{e.context&&(e.props.hexInputFocused=!0)},e.context.handlers.hexBlur=t=>{if(!e.context)return;e.props.hexInputFocused=!1;const o=t.target.value;en(o)&&y(o)},e.context.handlers.rangeLimitInput=(t,o,n,r)=>s=>{const a=r||s;if(!a||!e.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"===t){switch(p){case`h-${e.props.id}`:e.props.h=i;break;case`s-${e.props.id}`:e.props.hslaPercent.s=i;break;case`l-${e.props.id}`:e.props.hslaPercent.l=i}const[t,o,n]=Go(e.props.h,2.55*e.props.hslaPercent.s,2.55*e.props.hslaPercent.l);x(t,o,n)}else if("rgba"===t){switch(p){case`r-${e.props.id}`:e.props.rgba.r=i;break;case`g-${e.props.id}`:e.props.rgba.g=i;break;case`b-${e.props.id}`:e.props.rgba.b=i}const[t,o,n]=Jo(e.props.rgba.r,e.props.rgba.g,e.props.rgba.b);x(t,o,n)}else"alpha"==t&&(e.props.alpha=i,x())},e.context.handlers.rangeLimitKeydown=(t,o,n,r)=>s=>{if(!e.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}`}e.context.handlers.rangeLimitInput(t,o,n,s)()}}else s.preventDefault()},e.context.handlers.swatchClick=t=>{const o=t.target;if(o.dataset.colorPrecise){const[t,n,r,s]=on(o.dataset.colorPrecise);e.props.alpha=s,x(t,n,r),e.props.closeOnSelect&&(e.props.expanded=!1)}e.context&&"keydown"!==t.type&&e.context.handlers.swatchKeydown(t)},e.context.handlers.swatchKeydown=t=>{var o,r,s,a;if(!e.context||!C||!C.length)return;const l=C.indexOf(t.currentTarget);let i=null;const p=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)}(C),d=C.length;let c=0,u=d,f=!1;const h=C[l].dataset.group;if(void 0!==h){const e=C.filter((e=>e.dataset.group===h));c=C.indexOf(e[0]),u=C.indexOf(e[e.length-1])}const v=(l-c)%p;if(!t.key||"Tab"===t.key)return t.key||(e.props.swatchIsUsingKeyboardNav=!1,M=v,n(l)),"Tab"===t.key&&(e.props.swatchIsUsingKeyboardNav=!1),void C.forEach((e=>{delete e.parentElement.dataset.focused}));if("Enter"===t.key||" "===t.key)return t.preventDefault(),M=v,e.context.handlers.swatchClick(t),void n(l);switch("ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(e.props.swatchIsUsingKeyboardNav=!0,t.preventDefault()),t.key){case"ArrowUp":i=Math.max(l-p,l-(p-(M-v))),f=!0;break;case"ArrowDown":i=Math.max(l+p,l+(p+(M-v))),f=!0;break;case"ArrowLeft":i=l-1,M=(i-c)%p;break;case"ArrowRight":i=l+1,M=(i-c)%p}if(f&&null!==i&&(i<c||i>u)){let e;e=i<c?null===(r=null===(o=C[c-1])||void 0===o?void 0:o.dataset)||void 0===r?void 0:r.group:null===(a=null===(s=C[u+1])||void 0===s?void 0:s.dataset)||void 0===a?void 0:a.group;const t=C.filter((e=>e.dataset.group===h)),n=C.filter((t=>t.dataset.group===e)),d=(l-c)%p,f=t.length%p||p,v=l>=c+t.length-f;if(i<c){const e=n.length%p||p;i=c-e+Math.min(Math.max(d,M),e-1)}else i>u&&(i=v?Math.min(u+Math.max(d,M)+1,C.indexOf(n[n.length-1])):Math.min(i,u))}if(null!==i&&i>=0&&i<d){n(i),C.forEach((e=>{delete e.parentElement.dataset.focused}));const e=C[i],t=e.parentElement;e.focus(),t.dataset.focused="true"}})}))},$e,cn.options,cn.defaultIcon("eyeDropper","color"),cn.defaultIcon("close","close"),cn.localize("close"),cn.localize("next")]},wc=a("tb"),{outer:_c,inner:kc,wrapper:Sc,label:Lc,prefix:Dc,suffix:Ac,help:Ic,messages:Cc,message:Mc,icon:Tc}=l(wc),Ec=wc("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"}}))),Oc=wc("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"}}))),Fc=wc("inputInner",(()=>({bind:"$attrs",$el:"span"}))),Vc=wc("options",(()=>({$el:"ul",attrs:{id:"$id","data-vertical":'$vertical && "true" || "false"',"aria-labelledby":"$id"}}))),Bc=wc("option",(()=>({$el:"li",for:["option","index","$options"],attrs:{key:"$option.value","data-index":"$index"}}))),Pc={schema:_c(p("$options",Sc(Lc("$label"),Vc(Bc(Oc(p("$fns.isChecked($option) === true",Fc("$slots.default || $slots.on || $option.onLabel || $option.label"),Fc("$slots.default || $slots.off || $option.offLabel || $option.label")))))),Sc(p("$label && ($slots.default || $slots.on || $onLabel)",Lc("$label")),Ec(Tc("prefix"),Dc(),p("$_isChecked === true",Fc("$slots.default || $slots.on || $onLabel || $label"),Fc("$slots.default || $slots.off || $offLabel || $label")),Ac(),Tc("suffix")))),Ic("$help"),Cc(Mc("$message.value"))),type:"input",family:"button",props:["options"],features:[function(e){var t,o,n,r;e.addProps(["enforced","multiple","offLabel","offValue","onLabel","onValue","vertical","_isChecked"]),e.props._isChecked=!1,e.props.enforced=pn.undefine(e.props.enforced),e.props.multiple=pn.undefine(e.props.multiple),e.props.vertical=pn.undefine(e.props.vertical),e.props.disabled=pn.undefine(e.props.disabled),null!==(t=(n=e.props).onValue)&&void 0!==t||(n.onValue=!0),null!==(o=(r=e.props).offValue)&&void 0!==o||(r.offValue=!1),e.on("created",(()=>{var t;e.props._isChecked=an(e,null),e.props.options&&e.props.multiple&&e.input(null!==(t=e.value)&&void 0!==t?t:[],!1),e.context&&(e.context.fns.isChecked=t=>an(e,t),e.context.handlers.toggleValue=t=>o=>function(e,t,o){if(o.preventDefault(),t=t?h(t):t,e.props.options)if(e.props.multiple){const o=Array.isArray(e.value)?[...e.value]:[],n=o.findIndex((e=>pn.eq(e,t)));n>-1&&(!e.props.enforced||o.length>1)?o.splice(n,1):-1===n&&o.push(t),e.input(o)}else pn.eq(e.value,t)&&!e.props.enforced?e.input(void 0):e.input(t);else e.input(pn.eq(e.value,e.props.onValue)?e.props.offValue:e.props.onValue)}(e,t,o))}))},cn.options]},Hc=a("tb"),{outer:Nc,inner:Rc,wrapper:Kc,label:Wc,prefix:Yc,suffix:qc,help:Uc,messages:zc,message:jc,icon:Zc}=l(Hc),Gc=Hc("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",type:"tel",autocomplete:"off",id:"$id",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",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"}}))),Xc={schema:Nc(Kc(Wc("$label"),Rc(Zc("prefix"),Yc(),Gc(),qc(),Zc("suffix"))),Uc("$help"),zc(jc("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,i,p,d,c,u,f,h,v,m;const g=["unit","decimals","minDecimals","displayLocale","min","max","step","valueFormat"];e.addProps(g),null!==(t=(p=e.props).displayLocale)&&void 0!==t||(p.displayLocale=e.props.locale||"en-US"),null!==(o=(d=e.props).decimals)&&void 0!==o||(d.decimals=null),null!==(n=(c=e.props).minDecimals)&&void 0!==n||(c.minDecimals=null),null!==(r=(u=e.props).min)&&void 0!==r||(u.min=null),null!==(s=(f=e.props).max)&&void 0!==s||(f.max=null),null!==(a=(h=e.props).step)&&void 0!==a||(h.step=1),null!==(l=(v=e.props).unit)&&void 0!==l||(v.unit=e.props.unit||"percent"),-1===["acre","bit","byte","celsius","centimeter","day","degree","fahrenheit","fluid-ounce","foot","gallon","gigabit","gigabyte","gram","hectare","hour","inch","kilobit","kilobyte","kilogram","kilometer","liter","megabit","megabyte","meter","microsecond","mile","mile-scandinavian","milliliter","millimeter","millisecond","minute","month","nanosecond","ounce","percent","petabyte","pound","second","stone","terabit","terabyte","week","yard","year"].indexOf(e.props.unit)&&(e.props.unit="percent"),null!==(i=(m=e.props).valueFormat)&&void 0!==i||(m.valueFormat="number"),-1===["string","number"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(ln(e),e.context.handlers.init(),g.forEach((t=>{e.on(`prop:${t}`,(()=>{var t,o;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init(),null===(o=null==e?void 0:e.context)||void 0===o||o.handlers.setPlaceholder()}))})))}))},cn.options]},Jc={schema:Nc(Kc(Wc("$label"),Rc(Zc("prefix"),Yc(),Gc(),qc(),Zc("suffix"))),Uc("$help"),zc(jc("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,i,p,d,c,u,f,h,v,m;const g=["currency","decimals","minDecimals","displayLocale","min","max","step","valueFormat"];e.addProps(g),null!==(t=(p=e.props).displayLocale)&&void 0!==t||(p.displayLocale=e.props.locale||"en-US"),null!==(o=(d=e.props).currency)&&void 0!==o||(d.currency=e.props.currency||"USD"),null!==(n=(c=e.props).decimals)&&void 0!==n||(c.decimals=null),null!==(r=(u=e.props).minDecimals)&&void 0!==r||(u.minDecimals=null),null!==(s=(f=e.props).min)&&void 0!==s||(f.min=null),null!==(a=(h=e.props).max)&&void 0!==a||(h.max=null),null!==(l=(v=e.props).step)&&void 0!==l||(v.step=1),null!==(i=(m=e.props).valueFormat)&&void 0!==i||(m.valueFormat="number"),-1===["string","number","integer"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(ln(e),e.context.handlers.init(),g.forEach((t=>{e.on(`prop:${t}`,(()=>{var t,o;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init(),null===(o=null==e?void 0:e.context)||void 0===o||o.handlers.setPlaceholder()}))})))}))},cn.options]};var Qc=Object.freeze({__proto__:null,autocomplete:La,colorpicker:xc,currency:Jc,datepicker:mi,dropdown:Br,mask:ap,rating:ta,repeater:Ts,slider:Id,taglist:Bi,toggle:os,togglebuttons:Pc,transferlist:Xp,unit:Xc});const eu="undefined"!=typeof window?setInterval:()=>0,tu=new WeakSet;exports.$if=p,exports.autocomplete=La,exports.colorpicker=xc,exports.createBaseSections=l,exports.createProPlugin=function(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(tu.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:Sn(13919),children:`${Sn(451228594)}${Sn(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){Cn[e]?Cn[e].add(t):Cn[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(!bn.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];tu.add(o),o.define({...r,schema:n(e)})}eu((()=>In.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=a,exports.currency=Jc,exports.datepicker=mi,exports.dropdown=Br,exports.inputs=Qc,exports.mask=ap,exports.rating=ta,exports.repeater=Ts,exports.slider=Id,exports.taglist=Bi,exports.toggle=os,exports.togglebuttons=Pc,exports.transferlist=Xp,exports.unit=Xc;
1
+ "use strict";function e(e,o){e in An||(An[e]={timer:0,inputs:new Set});const n=An[e];clearTimeout(n.timer),n.inputs.add(o),n.timer=_n((()=>{Sn[e]||(Sn[e]=_n((()=>Cn.add(e)),2e3)),function(e){if(xn){window.addEventListener(bn(),(o=>{const n=new URL(o.blockedURI).hostname;wn.some(((e,t)=>Dn(t)===n))&&(t(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let o=0;const n=Ln(vn),r="://",s=(new Date).getDate(),a=async()=>{const l=Array.from(An[e].inputs),i=l.filter((t=>!(In[e]&&In[e].has(t)))).join("");if(kn(e),i){o++;try{const a=await window[Ln(gn)](`${n}${r}${Dn((s+o)%wn.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${i}`)}`),p=await a.json();if(p[Ln(mn)])return t(e,p.schema);if(a.ok)return In[e]||(In[e]=new Set),void l.forEach((t=>In[e].add(t)))}catch(e){}o<2&&_n(a,1e4*Math.random())}};a()}}(e)}),500)}function t(e,t){Cn.add(e),function(e,t){Mn[e]&&Mn[e].forEach((e=>e(t)))}(e,t)}function o(t,o,n){if(e(o,n),!o)throw new Error("FormKitNoKey");return Cn.has(o)?null:t}function n(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}function r(e,t,n,r){return(...a)=>l=>i=>{const p=function(e,t,n,r,a,l){const i=l[n],p="function"==typeof r?r():{$el:r},d=a.map((e=>"string"==typeof e?e:e(t)(l)));let c=d.length&&p?un.extendSchema(p,{children:d}):p;if(c=un.extendSchema(c,i),"object"==typeof c){let a=c;if(!cn.isDOM(c)&&!cn.isComponent(c)||c.meta||(c.meta={section:n,node:r}),cn.isDOM(c)){const{$el:r,...l}=c;l.attrs?"class"in l.attrs||"if"in l.attrs||(l.attrs={class:`$classes.${n}`,...l.attrs}):l.attrs={class:`$classes.${n}`},a=s(t,n,Object.defineProperty(l,"$el",{enumerable:!1,get:o.bind(null,r,t,e)}))}else if(cn.isComponent(c)){const{$cmp:r,...l}=c;a=s(t,n,Object.defineProperty(l,"$cmp",{enumerable:!1,get:o.bind(null,r,t,e)}))}else if("$formkit"in c){c.outerClass=`$classes.${n}`;const{$formkit:r,...l}=c;a=s(t,n,Object.defineProperty(l,"$formkit",{enumerable:!1,get:o.bind(null,r,t,e)}))}return a}return s(t,n,c)}(e,l,t,n,a,i);return r&&dn.isRecord(p)&&(p.memo=e+JSON.stringify(i)),r?[p]:p}}function s(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 a(e){return(t,o,n=!1)=>r(e,t,o,n)}function l(e){return{outer:e("outer",Tn,!0),wrapper:e("wrapper","div",!1),inner:e("inner",En,!1),icon:Hn,label:e("label",On,!1),prefix:e("prefix",Pn,!1),suffix:e("suffix",Pn,!1),help:e("help",Bn,!1),messages:e("messages",Fn,!1),message:e("message",Vn,!1)}}function i(e){return{overlayPlaceholder:e("overlayPlaceholder",Nn),overlayLiteral:e("overlayLiteral",Rn),overlayChar:e("overlayChar",Kn),overlayEnum:e("overlayEnum",Wn),overlay:e("overlay",Yn),overlayParts:e("overlayParts",Un),overlayInner:e("overlayInner",qn)}}function p(e,t,o){return n=>r=>{const s="string"==typeof t?t:t(n)(r);return o?{if:e,then:s,else:"string"==typeof o?o:o(n)(r)}:(un.isSlotCondition(s)?Object.assign(s.else,{if:e}):un.isSchemaObject(s)&&Object.assign(s,{if:e}),s)}}function d(e){const t=e("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_popover"',popover:{if:"$usePopover",then:"$popover",else:void 0},"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),o=e("listbox",(()=>({$el:"ul",if:"$expanded || $setForceExpanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant","aria-labelledby":'$id + "_label"'}}))),n=e("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"}}))),r=e("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"}}))),s=e("loadMoreInner","span"),a=e("emptyMessage",(()=>({$el:"li",if:"$showEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),l=e("emptyMessageInner","span"),i=e("option",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option)"}}))),d=e("listitems",(()=>({$el:null,if:"$options.length",for:["option","index","$option.options || $options"]}))),c=e("innerListitems",(()=>({$el:null,for:["option","innerIndex","$option.options"]}))),u=e("listitemGroup",(()=>({$el:"li",attrs:{"aria-label":"$option.group",role:"group",onClick:"$handlers.listitemGroupClick",tabindex:"-1"}}))),f=e("groupLabel","span"),h=e("groupList",(()=>({$el:"ul",attrs:{role:"group"}})));return()=>{return t(o(a(l("$emptyMessage")),d(p("$option.group",u(f("$option.group"),h(c((e=()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'}),v=n(p("$fns.isSelected($option)",Hn("selected")),i("$option.label")),t=>{const o=o=>{const n=v(t)(o),r="function"==typeof e?e(t):e;return dn.isObject(r)?(un.isSlotCondition(n)&&cn.isDOM(n.else)?n.else.attrs={...n.else.attrs,...r}:cn.isDOM(n)&&(n.attrs={...n.attrs,...r}),n):n};return o._s=v._s,o})))),n(p("$fns.isSelected($option)",Hn("selected")),i("$option.label")))),r(p("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",s(p("$state.loading",Hn("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))));var e,v}}function c(e){return dn.isRecord(e)&&"value"in e&&"label"in e}function u(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 f(){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 h(e){return"__original"in e?e.__original:e.value}async function v(e,t,o=!1,n=!1){if("function"==typeof e.props.optionsLoader){e.props.search=t,clearTimeout(_r.get(e));const o=t?e.props.debounce:0;0===o?m(e,n):_r.set(e,setTimeout((()=>{e.props.page=1,m(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 m(e,t){e.props.allowAppendOptions=t,b(e)}function g(e,t){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,function(e,t){const o=un.normalizeOptions(t);e.props.appendingOptions=!0,e.props.activeValue=h(o[0]),e.props.options=e.props.options.concat(o)}(e,t);const o=un.normalizeOptions(t);e.props.options=o,e.props.options.length||(e.store.set(Sr),e.store.set(cn.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}))),wr.set(e,e.props.searchValue)}function $(e,t,o){if(e.store.set(kr),e.props.optionLoadingCounter++,e.props.multiple&&"truncate"!==e.props.selectionAppearance){let o;o=dn.isPojo(t)?{label:"Loading...",value:String(t)}:{label:String(t),value:t},e.props.optionLoaderValues.includes(o.value)||e.props.optionLoaderValues.push(o.value),"transferlist"===e.props.type||e.props.selections.includes(o)||(e.props.selections=[...e.props.selections,o])}const n=e.props.optionLoader(t,o),r=e=>"string"==typeof e?{label:e,value:t}:c(e)?e:dn.isRecord(e)?Object.assign({label:String(t),value:t},e):{label:String(t),value:t},s=t=>{const o=e.props.memoOptions.findIndex((e=>dn.eq(h(e),h(t))));return-1===o?e.props.memoOptions=[...e.props.memoOptions,t]:e.props.memoOptions[o]=t,t};return n instanceof Promise?n.then((e=>{if("string"==typeof e||c(e))return s(r(e))})).finally((()=>{e.props.optionLoaderValues=e.props.optionLoaderValues.filter((e=>e!==t)),e.props.optionLoadingCounter--})):(e.props.optionLoaderValues=e.props.optionLoaderValues.filter((e=>e!==t)),e.props.optionLoadingCounter--,s(r(n)))}function b(e){e.store.set(kr),e.props.optionsLoadingCounter++,e.store.set(cn.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}));const t=e.props.nonceKey&&e.props[e.props.nonceKey],o=e.props.optionsLoader(e.context,Lr.get(e)),n=g.bind(null,e),r=o instanceof Promise?o.then(((...o)=>{void 0!==e.props.nonceKey&&t!==e.props[e.props.nonceKey]||n(...o)})):(n(o),e.props.optionsLoadingCounter--);if(r instanceof Promise)return r.finally((()=>{e.props.optionsLoadingCounter--}))}function y(e,t){e.props.page++,Lr.set(e,t),e.store.set(cn.createMessage({key:"hasNextPage",type:"state",value:!0,visible:!1}))}function x(e,t){if(e.props.optionRemoved=!0,t){const o=(e.props.inputStd||[]).filter((e=>!dn.eq(h(t),e)));e.input(o)}else e.input(void 0);e.props.openOnRemove&&!e.props.expanded&&e.isCreated&&(e.props.expanded=!0),setTimeout((()=>{var t;return e.emit("selectRange",[null===(t=e.props.highlightedRange)||void 0===t?void 0:t.option])}),20)}async function w(e){const t=Ar(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:xn&&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 _(e){var t,o;if(e.props.allOptions&&e.props.allOptions.length)if(null===(t=e.props.highlightedRange)||void 0===t?void 0:t.option.value)e.props.activeValue=h(e.props.highlightedRange.option);else{if(e.props.activeSelectionValue){const t=e.props.allOptions.find((t=>dn.eq(h(t),e.props.activeSelectionValue)));if(t)return void(e.props.activeValue=t.value)}if(e.props.reloadOnCommit)e.props.activeValue=h(e.props.allOptions[0]);else{if(e.props.searchValue&&!e.props.appendingOptions)e.props.activeValue=h(e.props.allOptions[0]);else if(e.props.inputStd.length>0&&!e.props.multiple||e.props.multiple&&(null===(o=e.context)||void 0===o?void 0:o.state.dirty))e.props.selections[e.props.selections.length-1]?e.props.activeValue=h(e.props.selections[e.props.selections.length-1]):e.props.activeValue=h(e.props.allOptions[0]);else{if(e.props.appendingOptions)return void(e.props.appendingOptions=!1);e.props.activeValue=h(e.props.allOptions[0])}e.props.appendingOptions&&(e.props.appendingOptions=!1)}}}function k(e){return e.reduce(((e,t)=>(t.options?e.push(...k(t.options)):e.push(t),e)),[])}function S(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(h(t)!==Dr?(e.props.option=t,e.props.maxReached&&!A(e,t)||(e.input(L(e,h(t))),A(e,t)&&e.props.closeOnSelect&&(e.props.expanded=!1))):null===(n=e.context)||void 0===n||n.handlers.loadMore(!0))}function L(e,t){if(e.props.multiple){const o=Array.isArray(e.value)?e.value:[];for(const n of o)if(dn.eq(n,t))return e.props.optionRemoved=!0,o.filter((e=>!dn.eq(e,t)));return[...o,t]}return dn.eq(t,e.value)&&e.props.deselect?void(e.props.optionRemoved=!0):t}function D(e,t){return dn.eq(e.props.activeValue,h(t))||void 0}function A(e,t){if(e.props.multiple){if(!Array.isArray(e.value))return!1;for(const o of e.value)if(dn.eq(o,h(t)))return!0;return!1}return dn.eq(e.value,h(t))}function I(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 C(e){e.props.firstCommit=!0;let t=null;e.on("commit",(()=>{if(0===e.props.inputStd.length&&e.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}(e),void(t=e.props.inputStd);if(e.props.inputStd.length&&"function"==typeof e.props.optionsLoader&&0===e.props.options.length&&"function"!=typeof e.props.optionLoader&&0===e.props.optionsLoadingCounter){e.props.optionsLoaded=!0;const t=b(e);t instanceof Promise&&t.then((()=>{w(e)}))}"function"!=typeof e.props.optionLoader||e.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}(t,e.props.inputStd)?0===e.props.optionsLoadingCounter&&w(e):(t=e.props.inputStd,async function(e){const t=Ar(e),o=e.props.inputStd.length>1?e.props.inputStd.filter((t=>!e.props.memoOptions.find((e=>dn.eq(h(e),t))))):e.props.inputStd;if(o.forEach((o=>{$(e,o,Array.isArray(t)&&t.find((e=>dn.eq(h(e),o)&&!e.noOptionFound)))})),e.props.optionLoadingCounter){const t=e.on("prop:optionLoadingCounter",(()=>{w(e),e.props.optionLoadingCounter||e.off(t)}))}else w(e)}(e))}))}function M(e){function t(e,t){"overscroll"!==e.props.behavior&&"none"===getComputedStyle(t).maxHeight&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,maxHeight:"400px"});const n=new MutationObserver((n=>{const r=n[0].target;if("overscroll"===e.props.behavior&&r.id!==`${e.props.id}_popover`)return;const s=e.props.positionListBox(t);Ir.delete(e),o(e,s);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)}));n.observe(t,{childList:!0,subtree:!0})}function o(e,t){var o;if(!e.props.expanded||!e.props.options||!e.props.options.length||Ir.has(e))return;const r=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}),[]),s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);s&&r.push([s,e.props.loadMoreOption]),Ir.add(e),r.length&&n(e,r,t)}function n(e,t,r){var s,a,l,i;const p=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_popover`);if(e.props.trackHover){const o=p?p.getBoundingClientRect():{top:0,bottom:0};if(r=null,e.props.mouseY>o.top&&e.props.mouseY<o.bottom){let o=r||0,n=r;const s=(t,o)=>{var n;const s=o[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){r=t;const s=o[1];return s&&!(null===(n=s.attrs)||void 0===n?void 0:n.disabled)?e.props.activeValue=h(s):e.props.activeValue=void 0,!0}return!1};do{if(null!==o&&s(o,t[o]))break;if(null!==n&&s(n,t[n]))break;null!==o&&(o++,o>t.length-1&&(o=null)),null!==n&&(n--,n<0&&(n=null))}while(null!==o||null!==n)}null===r&&(e.props.activeValue=void 0)}e.props.trackHover||T(e),e.props.expanded?(p&&e.props.loadOnScroll&&!(null===(a=e.store.loading)||void 0===a?void 0:a.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)),Ir.has(e)?requestAnimationFrame(n.bind(null,e,t,r)):o(e,r)):Ir.delete(e)}if(!xn)return;e.props.positionListBox=function(e,t){var o,n;let r=null;if(e.props.activeDescendant){r=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>dn.eq(e.value,h(t)))),-1===r&&(r=null);(null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant))&&T(e)}if("undefined"==typeof window)return r;const s=t.getBoundingClientRect(),a=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);if(a){const t=a.getBoundingClientRect();t.top+t.height+s.height>window.innerHeight&&t.top+t.height>s.height?(e.props.invertPopover=!0,e.props.usePopover||(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,top:"auto",bottom:"100%"})):(e.props.invertPopover=!1,e.props.usePopover||(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,bottom:"auto",top:"100%"}))}return r}.bind(null,e),e.props.styleWrapper=E.bind(null),e.on("mounted",(()=>{dn.whenAvailable(`${e.props.id}_popover`,t.bind(null,e),e.props.__root)}));const r=t=>{var o;e.props.mouseX=t.clientX,e.props.mouseY=t.clientY;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_popover`);if(n){const o=n.getBoundingClientRect();t.clientX>o.x&&t.clientX<o.x+o.width&&t.clientY>o.y&&t.clientY<o.y+o.height&&(e.props.trackHover=!0)}},s=()=>{e.props.ignoreScroll?e.props.ignoreScroll=!1:e.props.trackHover=!0};e.on("prop:trackHover",(({payload:t})=>{var o,n,r;xn&&(t?null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_popover`))||void 0===r||r.removeEventListener("scroll",s):null===(o=e.props.__root)||void 0===o||o.getElementById(`${e.props.id}_popover`))})),e.on("prop:expanded",(({payload:t})=>{e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,zIndex:t||e.props.forceExpanded?"999":"-1",pointerEvents:t?"auto":"none"},t?(document.addEventListener("mousemove",r),e.props.styleWrapper(),_(e)):document.removeEventListener("mousemove",r)})),e.on("prop:trackHover",(({payload:t})=>{var o,n;xn&&(t?null===(n=document.getElementById(`${e.props.id}_popover`))||void 0===n||n.removeEventListener("scroll",s):null===(o=document.getElementById(`${e.props.id}_popover`))||void 0===o||o.addEventListener("scroll",s))})),e.on("prop:activeValue",(({payload:t})=>{if(t===Dr)return void(e.props.activeDescendant=`${e.props.id}_load_more`);let o,n=-1;for(let r=0;r<e.props.options.length;r++){if("group"in e.props.options[r])for(let s=0;s<e.props.options[r].options.length;s++)if(dn.eq(h(e.props.options[r].options[s]),t)){n=s,o=r;break}if(dn.eq(h(e.props.options[r]),t)){n=r;break}}e.props.activeDescendant=n<0?void 0:void 0===o?`${e.props.id}_listitem_${n}`:`${e.props.id}_listitem_${o}_${n}`}))}function T(e){var t,o;if(!xn)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 E(){}function O(e){e.on("created",(()=>{if(!e.context||!xn)return;e.context.fns.isActive=D.bind(null,e),e.context.fns.isSelected=t=>A(e,t),e.context.fns.hasOptionLoaderValue=t=>{for(const o of e.props.optionLoaderValues)if(dn.eq(h(t),o))return!0;return!1},e.context.handlers.listitemGroupClick=Y,e.context.handlers.selectOption=t=>o=>q.call(null,e,t,o),e.context.handlers.loadMore=m.bind(null,e),e.context.handlers.removeSelection=t=>o=>W(e,t,o),e.context.handlers.tagTouchstart=t=>o=>W(e,t,o),e.context.handlers.selectionClick=t=>e.props.multiple?P.bind(null,e,t):B.bind(null,e),e.context.handlers.selectionBlur=()=>H.bind(null,e),e.context.fns.isActiveSelection=(e,t)=>dn.eq(e,h(t)),e.context.handlers.tagClick=t=>N.bind(null,e,t),e.context.handlers.tagFocus=t=>R.bind(null,e,t),e.context.handlers.tagBlur=()=>K.bind(null,e);const t=e.context.handlers.blur;e.context.handlers.blur=function(e,o){var n;if(o&&o.relatedTarget instanceof HTMLElement){const t=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(e.props.id+"_inner");if(t instanceof HTMLElement&&t.contains(o.relatedTarget))return}t(),function(e){if(e.props.disabled)return;e.props.expanded=!1,e.props.activeSelectionValue=void 0,e.emit("blur")}(e)}.bind(null,e),e.context.handlers.touchmove=F.bind(null,e),e.context.handlers.touchend=V.bind(null,e)}))}function F(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=Cr.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else Cr.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function V(e){Cr.delete(e)}function B(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 P(e,t,o){o.currentTarget instanceof HTMLElement&&(dn.eq(e.props.activeSelectionValue,h(t))?e.props.activeSelectionValue=void 0:(e.props.activeSelectionValue=h(t),o.currentTarget.focus()))}function H(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 N(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.justFocused?e.props.justFocused=!1:o.currentTarget instanceof HTMLElement&&(dn.eq(e.props.activeSelectionValue,h(t))?e.props.activeSelectionValue=void 0:(e.props.activeSelectionValue=h(t),o.currentTarget.focus())))}function R(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=h(t),e.props.justFocused=!0)}function K(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 W(e,t,o){o&&o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleRemoveSelection"},x(e,t))}function Y(e){e.stopPropagation()}function q(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},S(e,t))}function U(e,t,o,n){!function(e){e.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===e.props.deselect?e.props.deselect=!0:e.props.deselect=dn.undefine(e.props.deselect),e.props.option={},e.props.expanded=!1,e.props.inputStd=[],void 0===e.props.draggable?e.props.draggable=!0:"false"===e.props.draggable&&(e.props.draggable=!1),e.props.options||(cn.warn(350,{node:e,inputType:e.props.type}),e.props.options=[]),"disabled"in e.props&&(e.props.disabled=dn.undefine(e.props.disabled)),e.props.allOptions=k(e.props.options),e.props.selections=[],e.props.memoOptions=[],e.props.invertPopover=!1,e.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},e.props.decrementCount=0,e.props.page=1,e.props.loadMoreOption={label:"Load more",value:Dr},e.props.loadOptions=b,e.props.listboxStyles={},e.props.optionsLoadingCounter=0,e.props.optionLoadingCounter=0,e.props.searchable=dn.undefine(e.props.searchable),e.props.loadOnScroll=dn.undefine(e.props.loadOnScroll),e.props.multiple=dn.undefine(e.props.multiple)||!1,"taglist"===e.props.type&&(e.props.multiple=!0),e.props.openOnFocus=dn.undefine(e.props.openOnFocus),e.props.openOnRemove=void 0!==e.props.openOnRemove&&dn.undefine(e.props.openOnRemove),e.props.hasNextPage=y.bind(null,e),e.props.initialOptions=[...e.props.options],e.props.optionLoaderValues=[],e.props.loadOnCreated=dn.undefine(e.props.loadOnCreated),e.props.max&&"number"!=typeof e.props.max?e.props.max=parseInt(e.props.max):e.props.max&&!e.props.multiple&&(e.props.max=void 0),e.on("mounted",(()=>I(e))),e.on("prop:popoverCoordinates",(()=>setTimeout((()=>{I(e)}),10)))}(n),n.props.multiple?function(e){e.hook.input(((t,o)=>(e.props.highlightedRange&&!e.props.optionRemoved&&(t.splice(e.props.highlightedRange.index,1,h(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]))))}(n):function(e){e.hook.input(((t,o)=>(e.props.inputStd=void 0===t||""===t||null===t?[]:[t],o(t))))}(n),e(n),C(n),function(e){e.on("created",(()=>{e.context&&(e.props.trackHover=!0,void 0!==e.props.disabled||e.props.optionsLoader||!e.props.options||e.props.options.length||void 0!==e.props.emptyMessage||e.props.allowNewValues||0!==e.props.inputStd.length||(e.props.disabledInternally=!0),M(e),e.props.loadOnCreated&&!e.props.optionsLoaded?b(e):e.props.optionsLoaded&&(e.props.optionsLoaded=!1),e.props.forceExpanded=dn.undefine(e.props.forceExpanded),e.props.forceExpanded&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,zIndex:"999",pointerEvents:"auto"},setTimeout((()=>{e.props.setForceExpanded=!0}),100)))}))}(n),O(n),t(n),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(Sr))})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&e.store.set(Sr)})),e.on("prop:disabled",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:options",(({payload:t})=>{e.props.allOptions=k(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),_(e)})),e.on("prop:expanded",(({payload:o})=>{var n;if(xn)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}}(n),o(n)}function z(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 j(e,t,o){var n,r,s;if(o.preventDefault(),e.props.trackHover=!1,e.props.expanded){const o=e.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(h(t)),e}),[]);(null===(n=e.store.hasNextPage)||void 0===n?void 0:n.value)&&o.push(Dr);let a=-1;e.props.activeValue&&(a=o.findIndex((t=>dn.eq(t,e.props.activeValue)))),-1===a&&o.length?e.props.activeValue=o[0]:"ArrowDown"===t&&o.length>a+1?e.props.activeValue=o[a+1]:"ArrowUp"===t&&a>0?e.props.activeValue=o[a-1]:"ArrowUp"===t&&0===a&&(null===(s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===s||s.focus(),e.props.expanded=!1)}else e.props.expanded||"ArrowDown"!==t||(e.props.expanded=!0)}function Z(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=h(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=h(e.props.selections[0]):e.props.activeSelectionValue=void 0),e.props.expanded=!1}}function G(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 X(e,t,o,n=!0){var r,s,a,l,i,p,d;const c=o.key;if(o.altKey){const n=f(),r=e.props.selections.findIndex((e=>dn.eq(h(e),h(t)))),s=[...e.props.selections];"ArrowRight"===o.key?r<e.props.selections.length-1&&(s.splice(r,1),s.splice(r+1,0,t)):"ArrowLeft"===o.key&&r>0&&(s.splice(r,1),s.splice(r-1,0,t)),e.props.activeSelectionValue=h(t),e.input([...s.map(h)]),setTimeout((()=>{n instanceof HTMLElement&&n.focus()}),100)}else{const o=e.props.selections.findIndex((e=>dn.eq(h(e),h(t))));if(-1===o)return;const u="ArrowRight"===c?o+1:o-1;if(u>=e.props.selections.length){if(!n)return e.props.expanded=!0,e.props.activeSelectionValue=void 0,void(null===(s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}`))||void 0===s||s.focus());null===(l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}`))||void 0===l||l.focus()}else if(u<0&&0===o)null===(p=null===(i=e.props.__root)||void 0===i?void 0:i.getElementById(`${e.props.id}`))||void 0===p||p.focus();else if(u<0)return;const f=null===(d=e.props.__root)||void 0===d?void 0:d.getElementById(`${e.props.id}_tag-wrapper_${u}`);f&&f.focus(),e.props.selections[u]?e.props.activeSelectionValue=h(e.props.selections[u]):e.props.activeSelectionValue=void 0}}function J(e,t,o){var n;if(!(o.currentTarget instanceof HTMLElement))return;if(e.props.searchValue)return;const r=e.props.selections.findIndex((e=>dn.eq(h(e),h(t))));if(-1===r)return;const s=e.props.selections[r+1]?r+1:r-1,a=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_tag-wrapper_${s}`);a&&a.focus(),e.props.userAction={type:"tagDelete"},x(e,t)}function Q(e,t){var o;if(t.preventDefault(),e.props.allowNewValues&&e.props.searchValue&&e.input(L(e,e.props.searchValue)),e.props.expanded){if(e.props.activeValue===Dr)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore(!0));const t=e.props.allOptions.find((t=>dn.eq(h(t),e.props.activeValue)));if(!t)return;S(e,t)}else e.props.expanded=!0}function ee(e){e.props.expanded&&(e.props.expanded=!1)}function te(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":G(e);break;case"ArrowRight":case"ArrowLeft":X(e,t,o,!1);break;case"Delete":case"Backspace":J(e,t,o)}}function oe(e,t,o){if(e.props.disabled)return;switch(o.key){case"ArrowUp":case"ArrowDown":!function(e,t,o){var n,r,s,a;o.preventDefault();const l=o.key,i=e.props.selections.findIndex((e=>dn.eq(h(e),h(t))));if(-1===i)return;const p="ArrowDown"===l?i+1:i-1;if(p<0&&(null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`))||void 0===r||r.focus()),p<0||p>=e.props.selections.length)return;const d=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_selection_wrapper_${p}`);d&&d.focus(),e.props.activeSelectionValue=(null===(a=e.props.selections[p])||void 0===a?void 0:a.value)||void 0}(e,t,o);break;case"Enter":break;case"Tab":!function(e,t,o){var n,r,s,a;if(t){const l=e.props.selections.findIndex((e=>dn.eq(h(e),h(t))));if(-1===l)return;const i=o.shiftKey?l-1:l+1;if(i>=e.props.selections.length)return;if(i<0)return void(null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`))||void 0===r||r.focus());const p=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_selection_wrapper_${i}`);p&&p.focus(),e.props.activeSelectionValue=(null===(a=e.props.selections[i])||void 0===a?void 0:a.value)||void 0}}(e,t,o);break;case"Delete":case"Backspace":!function(e,t){var o;if(t){const n=e.props.selections.findIndex((e=>dn.eq(h(e),h(t))));if(-1===n)return;const r=e.props.selections[n+1]?n+1:n-1,s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_selection_wrapper_${r}`);s&&s.focus(),e.props.selections[r]?e.props.activeSelectionValue=h(e.props.selections[r]):e.props.activeSelectionValue=void 0}t&&1!==e.props.selections.length||(e.props.userAction={type:"selectionDelete"}),x(e,t)}(e,t)}}function ne(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":j(e,o,t);break;case"ArrowLeft":case"ArrowRight":Z(e,o);break;case"Enter":Q(e,t);break;case"Escape":ee(e);break;case"Delete":case"Backspace":z(e);break;default:e.emit("unusedKeydown",t)}}function re(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":j(e,o,t);break;case"ArrowRight":case"ArrowLeft":Z(e,o);break;case"Enter":Q(e,t);break;case"Escape":ee(e);break;case"Delete":case"Backspace":z(e)}}function se(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 ae(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 le(e){let t,o="";e.on("unusedKeydown",(({payload:n})=>{if(!n.isComposing&&1===[...n.key].length){if(!o&&" "===n.key)return void function(e,t){var o;if(t.preventDefault(),e.props.expanded){if(e.props.activeValue===Dr)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.allOptions.find((t=>dn.eq(h(t),e.props.activeValue)));if(!t)return;S(e,t)}else e.props.expanded=!0}(e,n);e.props.expanded=!0,clearTimeout(t),o+=n.key;const r=e.props.allOptions.find((e=>e.label.toLowerCase().startsWith(o.toLowerCase())));r&&(e.props.activeValue=h(r)),t=setTimeout((()=>{o=""}),400)}}))}function ie(e){pe(e),e.on("prop:selections",(()=>{e.props.skipFormatSelections=!1,pe(e)})),xn&&dn.whenAvailable(`${e.props.id}_selections`,ce.bind(null,e),e.props.__root)}function pe(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 de(e){var t,o;if(!xn||!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((()=>{pe(e)}));break}}}else e.props.lastTruncatedElText=null,e.props.lastVisibleIndex=null,pe(e)}function ce(e,t){const o=new ResizeObserver((()=>{e.props.selections&&0!==e.props.selections.length&&(e.props.skipFormatSelections?e.props.skipFormatSelections=!1:de(e))})),n=new ResizeObserver((()=>{de(e)}));o.observe(t),t.parentNode instanceof Element&&n.observe(t.parentNode)}function ue(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 fe(e,t){var o,n;let r=null;if(e.props.activeDescendant){const s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);if(!s)return r;e.props.ignoreScroll=!0;const a=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_listbox`);if(!a)return r;const l=t.getBoundingClientRect(),i=a.getBoundingClientRect(),p=parseInt(getComputedStyle(t).paddingTop),d=parseInt(getComputedStyle(t).paddingBottom),c=s.offsetTop-p,u=Math.max(c-p,0),f=Math.max(t.scrollHeight-d-c-l.height,0),v=i.height-u-f;t.scrollTop=c;const m=()=>{t.scrollTop=f>0?f<p?t.scrollHeight:p:u<d?0:c-d},g=Math.min(150,i.height);u>0&&f>0||0===u&&0===f||v>g?t.scrollTop=c:m();t.clientHeight/2<t.scrollTop&&(r=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>dn.eq(e.value,h(t))))),-1===r&&(r=null)}return r}function he(e){e.addProps(["behavior"]),e.on("created",(()=>{"overscroll"===e.props.behavior&&("function"==typeof e.props.optionsLoader&&cn.error(300,[e]),e.props.dropdownWrapperStyles=dn.clone(Mr),e.props.listboxStyles={display:"inline-block"},e.props.styleWrapper=ue.bind(null,e),e.props.positionListBox=fe.bind(null,e))})),e.on("prop:expanded",(({payload:t})=>{"overscroll"===e.props.behavior&&(t?function(){Vr=document.documentElement.scrollTop;for(const e in Tr)Fr[e]=document.documentElement.style[e],document.documentElement.style[e]=Tr[e];for(const e in Er)Or[e]=document.body.style[e],document.body.style[e]=Er[e];document.body.scrollTop=Vr}():function(){for(const e in Tr)document.documentElement.style[e]=Fr[e];for(const e in Er)document.body.style[e]=Or[e];document.body.scrollTop=0,document.documentElement.scrollTop=Vr}())}))}function ve(e){e.addProps(["multiLine"]),e.on("created",(()=>{xn&&(e.props.multiLineHeight=void 0,dn.whenAvailable(`${e.props.id}_selections`,me.bind(null,e),e.props.__root))}))}function me(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),ge(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 ge(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 $e(e){function t(){const{x:t,y:o,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}}(n,r);e.props.popoverAncestorCoordinates={x:t,y:o,width:s,height:a},e.props.popoverCoordinates={x:t,y:o,width:s,height:0}}function o(t){t?(null==n||n.showPopover(),setTimeout((()=>{e.props.popoverCoordinates.height=(null==n?void 0:n.offsetHeight)||0}),5)):(null==n?void 0:n.matches(":popover-open"))&&(null==n||n.hidePopover(),e.props.popoverCoordinates.height=0)}if(e.addProps(["popover","popoverOffset","usePopover","popoverCoordinates","popoverAncestorCoordinates"]),e.props.popover=dn.undefine(e.props.popover)?"manual":void 0,"input"!==e.type||"overscroll"===e.props.behavior)return;let n=null,r=null,s=[],a=null;if(e.props.popoverOffset=dn.undefine(e.props.popoverOffset)?parseInt(e.props.popoverOffset):0,!e.props.popover)return;if("undefined"==typeof document||!("popover"in HTMLElement.prototype))return void 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 l=()=>{document.removeEventListener("resize",a),document.removeEventListener("scroll",a),s.forEach((e=>{e.removeEventListener("scroll",a)}))};e.on("mounted",(()=>{e.context&&(e.props.usePopover=!0,e.props.popoverCoordinates={x:0,y:0,width:0,height:0},e.props.popoverAncestorCoordinates={x:0,y:0,width:0,height:0})})),e.on("destroyed",(()=>{l()})),e.on("prop:expanded",(({payload:i})=>{var p;e.context&&(!1===i?l():dn.whenAvailable(`${null===(p=e.context)||void 0===p?void 0:p.id}_popover`,(()=>{if(!e.context)return;n=document.querySelector(`#${e.context.id}_popover[popover]`)||document.querySelector(`#${e.context.id}_popover [popover]`),r||(r=function(e){if(!e)return null;let t=e.parentElement;for(;t&&"static"===window.getComputedStyle(t).position;)t=t.parentElement;return t}(n)),t(),o(i),a=Br((()=>{e.context&&(t(),o(i))}),10),document.addEventListener("resize",a),document.addEventListener("scroll",a),s=[];let l=null==n?void 0:n.parentElement;for(;l;)l.scrollHeight>l.clientHeight&&s.push(l),l=l.parentElement;s.forEach((e=>{e.addEventListener("scroll",a)}))})))}))}function be(e){var t,o,r,s,a,l,i,p,d,c,u,f,h,v;if(null!==(t=(p=e.props).removeControl)&&void 0!==t||(p.removeControl=!0),null!==(o=(d=e.props).upControl)&&void 0!==o||(d.upControl=!0),null!==(r=(c=e.props).downControl)&&void 0!==r||(c.downControl=!0),null!==(s=(u=e.props).insertControl)&&void 0!==s||(u.insertControl=!1),null!==(a=(f=e.props).addButton)&&void 0!==a||(f.addButton=!0),null!==(l=(h=e.props).addLabel)&&void 0!==l||(h.addLabel=!1),null!==(i=(v=e.props).addAttrs)&&void 0!==i||(v.addAttrs={}),e.props.draggable=dn.undefine(e.props.draggable),e.props.min=void 0!==e.props.min?Number(e.props.min):1,e.props.max=void 0!==e.props.max?Number(e.props.max):1/0,e.props.min>e.props.max)throw Error("Repeater: min must be less than max");if(Array.isArray(e.value))if(e.value.length<e.props.min){const t=n(e.props.min-e.value.length,(()=>({})));e.input(e.value.concat(t),!1)}else e.value.length>e.props.max&&e.input(e.value.slice(0,e.props.max),!1);else e.input(n(e.props.min,(()=>({}))),!1);e.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)}}(e,e.context.fns)}function ye(e,t){function o(){return Array.isArray(t.value)?t.value:[]}function n(e){t.input(e)}if(!t.context)return;const r={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:[fn.animations({duration:100})],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>"LI"===e.tagName};fn.dragAndDrop({parent:e,getValues:o,setValues:n,config:r}),t.on("prop:disabled",(({payload:t})=>{r.disabled=t,fn.dragAndDrop({parent:e,getValues:o,setValues:n,config:r})})),t.on("prop:draggable",(({payload:t})=>{r.disabled=!t,fn.dragAndDrop({parent:e,getValues:o,setValues:n,config:r})}))}function xe(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 we(e,t){var o;null===(o=e.context)||void 0===o||o.handlers.blur(t)}function _e(e,t){const{x:o,y:n}=Te(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 ke(e,t,o){e.props.disabled||(o.preventDefault(),e.props.hoverHighlight=!0,e.props.touchStarted=!0,1!==e.props.step?Ee(e,t,o):e.input(t+1,!1))}function Se(e,t){if(!e.props.dragStarted)return;t.preventDefault(),e.props.hoverHighlight=!1,e.props.dragStarted=!1,xe(e);const o=Os.get(e);o&&(o.abort(),Os.delete(e))}function Le(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=>Se(e,t)),{signal:n.signal}),Os.set(e,n),1===e.props.step?e.input(t+1,!1):Ee(e,t,o)}function De(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?Oe(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?Oe(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 Ae(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 Ie(e,t,o){e.props.hoverHighlight&&(e.props.disabled||(1===e.props.step?(xe(e,t+1),e.props.dragStarted&&e.input(t+1,!1)):Ee(e,t,o,!!e.props.dragStarted)))}function Ce(e){xe(e)}function Me(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 Ee(e,t,o)}function Te(e){return e instanceof MouseEvent?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}}function Ee(e,t,o,n=!0){if(!(o.currentTarget instanceof HTMLElement))return;const{x:r,y:s}=Te(o),a=o.currentTarget.getBoundingClientRect();let l=Oe((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):xe(e,l):e.input(0)}function Oe(e,t){t||(t=1);const o=1/t;return Math.ceil(e*o)/o}function Fe(e){e.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter","hasHighlightedRange","clearOnClick","debounce"]),void 0===e.props.debounce?e.props.debounce=200:e.props.debounce=parseInt(e.props.debounce),e.props.nonceKey="searchValue",e.props.searchValue="",e.props.inputText="",e.props.filterOptions=v.bind(null,e),e.props.reloadOnCommit=dn.undefine(e.props.reloadOnCommit),void 0===e.props.alwaysLoadOnOpen?e.props.alwaysLoadOnOpen=!0:e.props.alwaysLoadOnOpen=dn.undefine(e.props.alwaysLoadOnOpen),"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),e.on("created",(()=>{e.context&&xn&&(e.context.handlers.focus=Pe.bind(null,e),e.context.handlers.input=Ve.bind(null,e),e.context.handlers.focus=Pe.bind(null,e),e.context.handlers.click=Be.bind(null,e),e.context.handlers.toggleListbox=He.bind(null,e),e.context.handlers.toggleListboxKeydown=Ne.bind(null,e),e.context.handlers.keydown=re.bind(null,e),e.context.handlers.selectionKeydown=t=>o=>oe(e,t,o),e.context.handlers.searchInputTagKeydown=t=>o=>function(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":G(e);break;case"ArrowRight":case"ArrowLeft":X(e,t,o);break;case"Delete":case"Backspace":J(e,t,o)}}(e,t,o),e.on("prop:options",(({payload:t})=>{if((0===e.props.initialOptions.length&&"function"!=typeof e.props.optionsLoader||!e.props.searchValue&&t.length)&&(e.props.initialOptions=[...t]),e.props.selections&&e.props.selections.length&&t.length)for(let o=0;o<e.props.selections.length;o++){const n=e.props.selections[o],r=t.find((e=>h(e)===n.value));r&&(e.props.selections[o]=r)}})))})),e.on("prop:expanded",(({payload:t})=>{t||wr.delete(e)}))}function Ve(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&v(e,e.props.searchValue,!0)}function Be(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 Pe(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 He(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 Ne(e,t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),He(e))}function Re(e){e.props.searchValue=null,e.on("commit",(()=>{e.props.searchValue=null,e.props.highlightedRange||Ke(e)})),e.on("created",(()=>{if(!e.context||!ka)return;e.on("handleSearchInput",(({payload:t})=>{""===t?(e.props.searchValue=null,e.input([])):t&&0===e.props.inputStd.length?e.props.searchValue=t:t&&e.props.inputStd.length>0&&(e.props.searchValue=function(e){var t;const o=Ye(e);if(e.props.highlightedRange){const[t,n]=We(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)}(e)),!e.props.expanded&&t?e.props.expanded=!0:!t&&e.props.expanded&&(e.props.expanded=!1)})),function(e){dn.whenAvailable(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&Sa.set(t,e)}),e.props.__root),ka&&!La&&(La=!0,document.addEventListener("selectionchange",(()=>{const e=f();if(e instanceof HTMLInputElement&&Sa.has(e)){const t=Sa.get(e);t&&function(e){clearTimeout(_a.get(e)),_a.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=Ye(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]=We(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,Ke(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)}})))}(e);const o=e.context.handlers.keydown;e.context.handlers.keydown=n=>{o(n),function(e,o){var n,r,s,a;if(["ArrowRight","ArrowLeft"].includes(o.key)&&o.target instanceof HTMLInputElement&&null!==o.target.selectionEnd&&null!==o.target.selectionStart){if(0===o.target.selectionStart&&o.target.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))"ArrowLeft"===o.key?t(0):t(-1);else if(!e.props.searchValue){e.props.searchValue=null;const t=Ye(e),n=null===(r=t[t.length-1])||void 0===r?void 0:r.end;o.target.selectionStart<n&&(o.target.selectionStart=Math.max(0,"ArrowLeft"===o.key?o.target.selectionStart-2:o.target.selectionEnd+2))}}else if(["Delete","Backspace"].includes(o.key))e.props.highlightedRange&&!e.props.searchValue?(x(e,e.props.highlightedRange.option),0===e.props.inputStd.length&&(e.props.highlightedRange=void 0)):o.target instanceof HTMLInputElement&&(e.props.searchValue=null,t(-1,!0)&&o.preventDefault());else if(o.target instanceof HTMLInputElement&&0===o.target.selectionStart&&o.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)o.preventDefault();else if("Tab"===o.key)return;"ArrowLeft"===o.key&&t(-1,!0)&&o.preventDefault()}(e,n)};const n=e.context.handlers.focus;e.context.handlers.focus=t=>{n(e,t);const o=new Event("selectionchange");document.dispatchEvent(o)},e.on("blur",(()=>{e.props.selections.length?(e.props.inputText=e.props.selections.map((e=>e.label)).join(", "),e.props.searchValue=null):e.props.selections.length||(e.props.inputText="",e.props.searchValue="")}))})),e.on("prop:expanded",(({payload:t})=>{t||e.props.inputStd.length?t&&(e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],v(e,e.props.searchValue))):(e.props.searchValue="",e.props.inputText="")})),e.on("prop:selections",(()=>{var t;const o=[...e.props.selections].map((e=>e.label)).join(", ");let n="";if(ka&&e.isCreated){const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);if(null==o||o.focus(),f()===o&&Array.isArray(e._value)&&e._value.length){if(e.props.max&&e._value.length>=Number(e.props.max))return;n=", "}}e.props.inputText=`${o}${n}`,e.props.reloadOnCommit&&(e.props.searchValue="",v(e,e.props.searchValue))}));const t=(t,o=!1)=>{var n,r;const s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);if(!(s instanceof HTMLInputElement))return!1;const a=Ye(e),l=t>=0?t: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 o;e.on("selectRange",(({payload:e})=>t(...e))),e.on("prop:highlightedRange",(({payload:t})=>{e.props.hasHighlightedRange=!!t,t&&e.props.expanded&&o!==t.option&&(o=t.option,_(e))}))}function Ke(e){var t;if(!ka)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 We(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 Ye(e){const t=Ar(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 qe(e){!function(e){e.on("prop:expanded",(({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],v(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&&v(e,e.props.searchValue,!0))}))}(e)}function Ue(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.searchExpand||(e.props.options=[],v(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&&v(e,e.props.searchValue,!0)}))}(e)}function ze(e,t){var o;if(kl.has(e))return;kl.set(e,[]),t.reverse&&Bl.add(e),t.prefix&&Pl.set(e,t.prefix),t.suffix&&Hl.set(e,t.suffix),Je(e,t.pattern,t.partOverrides,t.explicitParts);const n=Al.get(e),r=null==n?void 0:n.some((e=>tt(e))),s=null==n?void 0:n.some((e=>function(e){return!!e&&("group"===e.type&&Array.isArray(e.parts))}(e)));if(r&&s)throw new Error("Cannot use enums and groups in the same mask.");const a=r?"select":null!==(o=t.mode)&&void 0!==o?o:"shift";if(s&&"select"===a)throw new Error("Cannot use groups in select mode.");(t.placeholder||"select"===a)&&Il.add(e),Cl.set(e,a),t.onChange&&Fl.set(e,t.onChange),e.addEventListener("beforeinput",(o=>{if(zl)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=kl.get(e);if(null==r?void 0:r.length){const o=(null!==(n=Sl.get(e))&&void 0!==n?n:r.length-1)+(t.endsWith("Undo")?-1:1),s=r[o];if(!s)return;ut(e,s),e.setSelectionRange(...s.selectionAfter),Sl.set(e,o),Fl.has(e)&&Fl.get(e)(s,e)}}),{once:!0})}(e,o.inputType);o.preventDefault();const n=(r=o.inputType).startsWith("insert")?"insert":!!r.startsWith("delete")&&("deleteContentForward"===r?"deleteContentForward":"deleteContentBackward");var r;const s=st(e),a=e.value;n&&at(e,{type:n,selectionBefore:s,data:o.data,valueBefore:a,suffix:t.suffix,prefix:t.prefix})})),"select"===a&&e.addEventListener("keydown",(t=>{switch(t.key){case"ArrowRight":return t.preventDefault(),Ft(e);case"ArrowLeft":return t.preventDefault(),Ft(e,-1);case"ArrowUp":return void(Vt(e,1)&&t.preventDefault());case"ArrowDown":return void(Vt(e,-1)&&t.preventDefault());case"Tab":return Kl?void t.preventDefault():void(Ft(e,t.shiftKey?-1:1)&&t.preventDefault())}})),e.addEventListener("focus",(()=>function(e){var t;const o=Il.has(e),n=Cl.get(e);if(o){let o=null,r=null,s=!1;const a="shift"===n?0:1,l=e.value;wt(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),(et(t)||tt(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"===Cl.get(e)){const[o]=Ct(e),n=Pt(e,t);void 0!==n&&n in o&&(t=o[n])}return function(e,t,o=50){Tl.set(e,it(e,t));const n=async()=>{if(!Ul||f()!==e)return;"select"===Cl.get(e)&&(await new Promise((e=>setTimeout(e,10))),function(e){let t=st(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=pt(e,t);const[o]=Ct(e),n=Pt(e,t),r=t[0];void 0!==n&&o.some((e=>r>=e[0]&&r<e[1]))&&Tl.set(e,it(e,o[n]))}(e));const t=Tl.get(e);t&&e.setSelectionRange(...t)};n(),document.addEventListener("selectionchange",n),setTimeout((()=>{document.removeEventListener("selectionchange",n),Tl.delete(e)}),o)}(e,t)}}}(e))),e.addEventListener("selection",(t=>function(e,t){if(Tl.get(e))return;Wt(e),t=pt(e,t);const[o]=Ct(e),n=Pt(e,t),r=void 0!==n&&it(e,o[n]);r&&!rt(t,r)&&ct(e,r,!0)}(e,t.detail))),at(e,{type:"insert",selectionBefore:[0,0,"forward"],data:e.value,valueBefore:"",suffix:t.suffix,prefix:t.prefix})}function je(e){var t,o;if(Rl.has(e))return;const n=null!==(t=kl.get(e))&&void 0!==t?t:[],r=n[null!==(o=Sl.get(e))&&void 0!==o?o:n.length-1];if(r){const t=r.selectionAfter,[o,n]=Ct(e,r.valueAfter),s=Pt(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"];Rl.set(e,[r,l])}}}function Ze(e){Rl.delete(e)}function Ge(e,t){const o="string"==typeof e||!kl.has(e),n="string"==typeof e?Xe(e):e;if(o)t.prefix&&Pl.set(n,t.prefix),t.suffix&&Hl.set(n,t.suffix),n.value=lt(n,n.value),ze(n,t);else{const e=Ht(n),o=n.value;n.value="",at(n,{type:"insert",selectionBefore:[0,e?e.valueAfter.length:0,"none"],valueBefore:e?e.valueAfter:"",data:o,suffix:t.suffix,prefix:t.prefix})}return n.value}function Xe(e){return{value:e,selectionStart:0,selectionEnd:0,scrollWidth:0,clientWidth:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function Je(e,t,o,n,r){r=e&&Bl.has(e)||r;const s=(null!=n?n:function(e){const t=Object.values(Yl);if(!e)return t;const o={...e},n=[];for(const r of t)if(!nt(r))if("token"in r&&r.token in e){const t={...r,...e[r.token]};Qe(t)&&n.push(t),delete o[r.token]}else n.push(r);const r=Object.values(o);for(const e of r)Qe(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=ft(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=Je(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&&Al.set(e,c),c}function Qe(e){return!!e&&(nt(e)||et(e)||tt(e))}function et(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&ot(e))}function tt(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&ot(e))}function ot(e){return!!e&&("placeholder"in e&&"token"in e)}function nt(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function rt(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function st(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 at(e,t){var o;Bl.has(e)&&Kt(t);let n=!1;switch(Vl.set(e,"playing"),t.type){case"insert":n=function(e,t){let o=dt(t);const n=t.selectionBefore,r=function(e,t){var o,n,r;if("select"===Cl.get(e)){const[s,a]=Ct(e),l=s.findIndex((e=>rt(e,t.selectionBefore))),i=null!==(o=a[l])&&void 0!==o?o:null;if(et(i)){const e=t.selectionBefore,o=e[1]-e[0],s=t.valueBefore.substring(e[0],e[1]),a="left"===i.selectDirection,l=yt(s,i),p=a?0:function(e,t,o){if(!e)return 0;let n="";for(;e.length;){const o=ft(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(tt(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=wt(e,t,o);return Dl.set(e,s.endPos),{...t,valueAfter:s.value,selectionAfter:xt(e,s),unmasked:s.unmasked,complete:s.complete,meta:s.meta}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":n=function(e,t){const o=dt(t),n=t.selectionBefore,r=Bl.has(e);let s=n[0],a=n[1];s===a&&("deleteContentBackward"!==t.type||r?a+=ht(o,s):s-=ht(o,s,"backward"));const l=Cl.get(e);let i="";if("select"===l){const[o,n]=Ct(e),r=Pt(e,[s,a,"none"]);if(void 0!==r){const l=n[r],p=o[r];et(l)?i=l.placeholder.repeat(a-s):tt(l)&&([i,s]=rt(p,st(e))?[l.placeholder,s]:function(e,t,o,n){const r=n.valueBefore,s=ht(r,n.selectionBefore[0],"backward"),a=Math.max(o[0],n.selectionBefore[0]-s),l=r.substring(o[0],a),i=Tt(t.values,l);let p=null==i?void 0:i.substring(l.length);i&&!p&&Et(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=wt(e,t,p);return{...t,valueAfter:d.value,selectionAfter:Dt(e,d,t,s),unmasked:d.unmasked,complete:d.complete,meta:d.meta}}(e,t)}if(Bl.has(e)&&n&&Kt(n),n&&function(e,t){t.prefix&&(t.valueAfter=t.prefix+t.valueAfter,t.selectionAfter=it(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)){Fl.has(e)&&Nl.set(e,(()=>{Nl.delete(e),n&&Fl.get(e)(n,e)})),Vl.set(e,"beforeCallback");let t=null!==(o=kl.get(e))&&void 0!==o?o:[];const r=Sl.get(e);r&&(t=t.slice(0,r),Sl.delete(e)),t.push(n),kl.set(e,t),Ul&&f()===e&&"function"==typeof document.execCommand&&!zl?(ct(e,[0,e.value.length,"forward"],!0),zl=!0,document.execCommand("insertText",void 0,n.valueAfter),zl=!1):ut(e,n),Ul&&f()===e&&ct(e,n.selectionAfter);const s=Nl.get(e);s&&s(),Wt(e)}Vl.set(e,"complete")}function lt(e,t){var o,n;const r=null!==(o=Pl.get(e))&&void 0!==o?o:"",s=null!==(n=Hl.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 it(e,t){const o=Pl.get(e),n=[...t];return o&&(n[0]+=o.length,n[1]+=o.length),n}function pt(e,t){const o=Pl.get(e),n=[...t];return o&&(n[0]-=o.length,n[1]-=o.length),n}function dt(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 ct(e,t,o=!1){o&&(Ll.add(e),setTimeout((()=>Ll.delete(e)),5)),Tl.get(e)&&Tl.set(e,t),e.setSelectionRange(...t)}function ut(e,t,o="After"){if(e.value=t[`value${o}`],Ul){const o=new InputEvent("input",{inputType:"insert"===t.type?"insertText":t.type,data:t.data});e.dispatchEvent(o)}}function ft(e){if(null==e)return"";const t=Ml.test(e.charAt(0))&&Ml.test(e.charAt(1))?2:1;return e.substring(0,t)}function ht(e,t,o="forward"){if("backward"===o)return 0===t?0:1===t?1:Ml.test(e.charAt(t))&&Ml.test(e.charAt(t-1))?2:1;const n=e.length-t;return 0===n?0:1===n?1:ft(e.substring(t)).length}function vt(e,t){const o=ft(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 mt(e){const t=ft(e.buffer),o=t.length;e.value+=t,e.pos+=o,e.buffer=e.buffer.substring(o)}function gt(e,t){const o=ft(t),n=o.length;return e.value+=o,e.pos+=n,t.substring(n)}function $t(e,t){for(;t.buffer;){const o=ft(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 bt(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(ht(t.buffer,0))}return null}function yt(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 xt(e,t){let o=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return o;const n=st(e);o=[n[0],t.endPos,"none"];const[r,s]=Ct(e,t.value),a=Pt(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(et(i)&&yt(p,i).length===p.length&&a<r.length-1)return Wl(),r[a+1];if(tt(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=Tt(o.values,r);if(s)return It(r,s).length-n.length;return 0}(t,l[0],i);if(t.insertPos+o===l[1])return Et(i.values,p)?[l[1],l[1],"forward"]:(Wl(),r[a+1]?r[a+1]:r[a]);const s=[t.insertPos+o,l[1],"none"];return rt(s,n)||(Ll.add(e),setTimeout((()=>Ll.delete(e)),5)),s}return l}function wt(e,t,o,n){var r,s;const a=null!==(r=Al.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:Il.has(e),buffer:o,data:t.data,originalData:t.data,value:"",mode:Cl.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:Ct(e),unmasked:"",complete:!0,cycle:t.cycle,meta:[]};return _t(a,l,void 0,n),l}function _t(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":St(o,t,e.at(-1)===o);break;case"char":Lt(o,t,l);break;case"enum":kt(o,t);break;case"group":const a={repeat:null!==(s=o.repeat)&&void 0!==s&&s,nextPart:r,repeats:0,placeholder:!!o.placeholder};_t(o.parts,t,a,n)}if(n){if(!1===n(t,o))break}const a=nt(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++,_t(e,t,o,n);if(!s){t.complete=!1;const o=e.reverse().find((e=>"literal"===e.type));e.reverse(),nt(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 kt(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=Tt(e.values.concat([e.placeholder]),n);if(r){const s=It(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):bt(e,t),t.endPos=t.pos+s.length,void(t.pos=t.value.length)}t.data=""}if(t.buffer){const o=bt(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 St(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?ft(t.data):"",s=ft(n);if(e===s)n=vt(t,n),t.meta.push({type:"literal",value:s}),r=!0;else if(!r||t.data||null===t.data||t.placeholder||o)n=gt(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 Lt(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=ft(t.data);if(e.pattern.test(n))return vt(t),t.meta.push({type:"char",value:n}),t.chars++,t.unmasked+=n,void $t(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=ft(t.buffer);if(e.pattern.test(n))return t.chars++,t.unmasked+=n,mt(t),void t.meta.push({type:"char",value:n});if(t.placeholder&&n===e.placeholder)return mt(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 Dt(e,t,o,n){const r=[n,n,"none"];if("select"===t.mode){const s=Ct(e),a=Pt(e,r,s),[l,i]=Ct(e,t.value),p=void 0!==a&&At(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)=>At(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 At(e,t,o){if(nt(o))return!1;if(et(o)){let n=t[0];for(;n<t[1];){const t=ft(e.substring(n));if(t!==o.placeholder)return!1;n+=t.length}}return!tt(o)||e.substring(t[0],t[1])===o.placeholder}function It(e,t){let o="";do{const n=ft(e).toLowerCase(),r=ft(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 Ct(e,t){const o=Al.get(e);if(!o)return[[],[]];if(El.has(e))return El.get(e);const n=null!=t?t:lt(e,e.value),r=[],s=[];let a=null,l=null,i=0,p=!0;for(const e of o)if(nt(e))a=e,null!==l&&(r.push([l,i,"none"]),l=null),i+=e.value.length;else{if(et(a)&&et(e)&&e.token===a.token)i++;else if(et(e))null===l?(l=i,s.push(e)):(r.push([l,i,"none"]),l=i,s.push(e)),i++;else if(tt(e)){l&&r.push([l,i,"none"]),Ot(e)||(p=!1);const t=Mt(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&&El.set(e,d),d}function Mt(e,t,o){if(Ot(t))return t.values[0].length;const n=e.slice(o),r=Tt(t.values.concat([t.placeholder]),n);return r?r.length:0}function Tt(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=ft(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=Tt(l,t.substring(s.length),o,a))&&void 0!==r?r:l[0])}function Et(e,t){return t=t.toLowerCase(),e.some((e=>(e=e.toLowerCase()).startsWith(t.toLocaleLowerCase())&&e!==t))}function Ot(e){if(!Ol.has(e)&&Array.isArray(e.values)&&e.values.length>0){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;Ol.set(e,e.values.every((e=>e.length===t)))}return Ol.get(e)}function Ft(e,t=1){const[o]=Ct(e),n=Pt(e,pt(e,st(e)));return void 0!==n&&void 0!==o[n+t]&&(e.setSelectionRange(...it(e,o[n+t])),!0)}function Vt(e,t=1){const[o,n]=Ct(e),r=Pt(e,st(e));if(void 0!==r&&r in n){const s=n[r];if(tt(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((()=>at(e,t)),0),!0}}}return!1}function Bt(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 Bt(e.slice(...r),t)}function Pt(e,t,o){const[n]=null!=o?o:Ct(e),r=n.findIndex((e=>e[0]!==e[1]&&(!!rt(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=Bt([...s],t[1]);return l in a?a[l]:void 0}function Ht(e){var t,o;const n=null!==(t=kl.get(e))&&void 0!==t?t:[];return n[null!==(o=Sl.get(e))&&void 0!==o?o:n.length-1]}function Nt(e,t=!1){const o=Ht(e);return o&&(o.complete||t)?Bl.has(e)?[...o.unmasked].reverse().join(""):o.unmasked:t?"":null}function Rt(e){var t;const o=Ht(e);return null!==(t=null==o?void 0:o.meta)&&void 0!==t?t:null}function Kt(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 Wt(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}))}}function Yt(e){if(e||(e=new Date),e instanceof Date){const t=new Date(e);return t.setMilliseconds(0),t}if(function(e){const t=e.match(jl);if(t){const e=Number(t[2]);if(e<1||e>12)return!1;if(void 0!==typeof t[3]){const e=Number(t[3]);if(e<1||e>31)return!1}if(void 0!==typeof t[4]){const e=Number(t[4]);if(e<0||e>23)return!1}return!0}return!1}(e=e.trim()))return new Date(function(e){const t=e.match(jl);return t&&void 0===t[4]?e+"T00:00:00":e}(e));throw new Error(`Non ISO 8601 compliant date (${e}).`)}function qt(e,t=1){const o=Yt(e);return o.setDate(o.getDate()+t),o}function Ut(e){const t=Yt(e);return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),t}function zt(e){return Ut(e).getDate()}function jt(e,t=1,o=!1){const n=Yt(e),r=n.getDate();if(o||n.setDate(1),n.setMonth(n.getMonth()+t),!o){const e=zt(n);n.setDate(e<r?e:r)}return n}function Zt(e,t=1,o=!1){const n=Yt(e),r=n.getDate();if(o||n.setDate(1),n.setFullYear(n.getFullYear()+t),!o){const e=zt(n);n.setDate(e<r?e:r)}return n}function Gt(e){return"literal"===e.type&&(e.value=e.value.normalize("NFKC")),e}function Xt(e,t,o,n=!1){function r({partName:e,partValue:t,token:n}){if("literal"===e)return t;const r=s[e];if("hour"===e&&"H"===n)return r.replace(/^0/,"");if(!("minute"!==e&&"second"!==e||"mm"!==n&&"ss"!==n||1!==r.length))return`0${r}`;if("dayPeriod"===e){const e=to(a.getHours()<12?"am":"pm",o);return"A"===n?e.toUpperCase():e.toLowerCase()}return"timeZoneName"===e?Jt(-1*a.getTimezoneOffset()):r}const s=function(e,t,o,n=!1){function r(e,t=!1){const r=`${o}-u-hc-${t?"h12":"h23"}`;if(i.push(...new Intl.DateTimeFormat(r,e.reduce(((e,t)=>"literal"===t.partName?e:(n&&ti.includes(t.token)&&p.push(t),Object.assign(e,t.option))),{})).formatToParts(s).map(Gt)),n&&p.length)for(const e of p){let t=[];switch(e.token){case"MMMM":t=new Intl.DateTimeFormat(r,{dateStyle:"long"}).formatToParts(s).map(Gt);break;case"MMM":t=new Intl.DateTimeFormat(r,{dateStyle:"medium"}).formatToParts(s).map(Gt)}const o=t.find((t=>t.type===e.partName)),n=i.findIndex((t=>t.type===e.partName));o&&n>-1&&(i[n]=o)}}const s=Yt(e),a=t.filter((e=>e.hour12)),l=t.filter((e=>!e.hour12)),i=[],p=[];a.length&&r(a,!0);l.length&&r(l);return i.reduce(((e,t)=>(e[t.type]=t.value,e)),{})}(e,t,o,n),a=Yt(e);return t.map((e=>({...e,value:r(e)})))}function Jt(e){return`${e<0?"-":"+"}${String(Math.floor(Math.abs(e/60))).padStart(2,"0")}${String(Math.abs(e%60)).padStart(2,"0")}`}function Qt(e){if(!/^([+-])[0-3][0-9][0-6][0-9]$/.test(e))throw new Error(`Invalid offset: ${e}`);return e}function eo(e){return["numeric","2-digit"].includes(e.partValue)}function to(e,t){const o=ni.get(t);if(o&&o[e])return o[e];const n=new Date(Zl);n.setUTCHours("am"===e?5:20);const r=new Intl.DateTimeFormat(t,{timeStyle:"full",timeZone:"UTC",hour12:!0}).formatToParts(n).map(Gt).find((e=>"dayPeriod"===e.type));if(r){const n=o||{};return ni.set(t,Object.assign(n,{[e]:r.value})),r.value}return e}function oo(e,t="+0000"){const o=Yt(e),n=function(e){Qt(e);const[t,o,n,r]=e.match(/([+-])([0-3][0-9])([0-6][0-9])/),s=60*Number(n)+Number(r);return"+"===o?s:-s}(t);return new Date(o.getTime()+1e3*n*60)}function no(e,t){const o=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZone:t,hourCycle:"h23"}).formatToParts(e).map(Gt),n={};return o.forEach((e=>{n[e.type]=e.value})),new Date(`${n.year}-${n.month}-${n.day}T${n.hour}:${n.minute}:${n.second}Z`)}function ro(e,t="UTC",o="device"){o="device"===o?Intl.DateTimeFormat().resolvedOptions().timeZone:o;const n=Yt(e),r=no(n,t);return Jt((no(n,o).getTime()-r.getTime())/1e3/60)}function so(e,t){function o(e,[t,o,n]){const r=Object.keys(o)[0];return{option:o,partName:r,partValue:o[r],token:t,pattern:n,hour12:e}}if(ri.includes(e)||"object"==typeof e)return function(e,t){const o={timeZone:"UTC"};"string"==typeof e?o.dateStyle=e:("date"in e&&(o.dateStyle=e.date),"time"in e&&(o.timeStyle=e.time));const n=new Intl.DateTimeFormat(t,o),r=n.formatToParts(new Date(Zl)).map(Gt),s=n.formatToParts(new Date("1999-04-05T23:05:01.000Z")).map(Gt).find((e=>"hour"===e.type)),a=s&&"23"===s.value?24:12;return r.map((e=>{const o=e.type,n=function(e,t,o,n){const r=t.length,s=!isNaN(Number(t));let a;switch(e){case"year":return 2===r?oi.get("YY"):oi.get("YYYY");case"month":return s?1===r?oi.get("M"):oi.get("MM"):(a=ao(o,e,t),"long"===a?oi.get("MMMM"):oi.get("MMM"));case"day":return 1===r?oi.get("D"):oi.get("DD");case"weekday":switch(a=ao(o,e,t),a){case"narrow":return oi.get("d");case"short":return oi.get("ddd");default:return oi.get("dddd")}case"hour":return 12===n?1===r?oi.get("h"):oi.get("hh"):1===r?oi.get("H"):oi.get("HH");case"minute":return 1===r?oi.get("m"):oi.get("mm");case"second":return 1===r?oi.get("s"):oi.get("ss");case"dayPeriod":return/^[A-Z]+$/u.test(t)?oi.get("A"):oi.get("a");case"literal":return[t,{literal:t},new RegExp("")];case"timeZoneName":const l=t.split("-");return 2===l.length&&4===l[1].length?oi.get("ZZ"):oi.get("Z");default:return}}(e.type,e.value,t,"hour"===e.type?a:void 0);if(void 0===n)return;const r=n[1][o];return r?(n[2]||(n[2]=new RegExp(`${n[0]}`,"g")),{option:{[o]:r},partName:o,partValue:r,token:n[0],pattern:n[2],hour12:12===a}):void 0})).filter((e=>!!e))}(e,t);let n=e,r=0;const s=e=>{if(e[2]||(e[2]=new RegExp(`(.)?(${e[0]})`,"g")),e[2].test(n)){let t=0;return n=n.replace(e[2],((e,o,n)=>"\\"===o?n:`${"string"==typeof o?o:""}{!${t++?r:r++}!}`)),!!t}return!1},a=function(e){const t=e.map((e=>e.partName)),o=new Set(t);if(t.length>o.size)throw new Error("Cannot reuse format tokens.");return e}(Xl.filter(s).concat(Jl.filter(s)).map(o.bind(null,!1)).concat(Ql.filter(s).map(o.bind(null,!0)))),l=/^\{!(\d+)!\}$/;return n.split(/(\{!\d+!\})/).map((e=>{const t=e.match(l);return t?a[Number(t[1])]:{option:{literal:e},partName:"literal",partValue:e,token:e,pattern:new RegExp(""),hour12:!1}})).filter((e=>!("literal"===e.partName&&""===e.partValue)))}function ao(e,t,o){if(!Gl.has(e)){const t=new Date(Zl),o=[3,8,9,7,6,4,3],n=["weekday","month","dayPeriod"],r=["long","short","narrow"],s={};for(let a=0;a<12;a++){t.setMonth(0+a),a in o&&t.setDate(o[a]),t.setUTCHours(8+a);for(const o of r){const r=new Intl.DateTimeFormat(e,n.reduce(((e,t)=>Object.assign(e,{[t]:o})),{hour12:!0,timeZone:"UTC"})).formatToParts(t).map(Gt);if("long"===o||"short"===o){const n=new Intl.DateTimeFormat(e,{dateStyle:"short"===o?"medium":"long"}).formatToParts(t).map(Gt).find((e=>"month"===e.type)),s=r.findIndex((e=>"month"===e.type));s>-1&&n&&(r[s]=n)}r.forEach((e=>{if("literal"===e.type)return;const t=e.type;s[t]=Object.assign(s[t]||{},{[e.value]:o})}))}}Gl.set(e,s)}const n=Gl.get(e);return n?n[t][o]:void 0}function lo(e,t="+0000"){const o="+"===t.slice(0,1);return oo(e,t.replace(o?"+":"-",o?"-":"+"))}function io(e,t="long",o="device",n=!1,r){let s;return"object"!=typeof e||e instanceof Date||({date:e,format:t,locale:o,genitive:n,partFilter:r,tz:s}=e),"ISO8601"===t?Yt(e).toISOString():(s&&(e=lo(e,ro(e,s))),o&&"device"!==o||(o=Intl.DateTimeFormat().resolvedOptions().locale),Xt(e,so(t,o).filter(null!=r?r:()=>!0),o,n).map((e=>e.value)).join(""))}function po(e,t="en",o=!1,n=(()=>!0)){return so(e,t).filter(n).reduce(((e,t)=>e+(o&&"literal"===t.partName?function(e){return Xl.concat(Jl).concat(Ql).sort(((e,t)=>e[0].length>t[0].length?1:-1)).reduce(((e,t)=>e.replace(t[0],`\\${t[0]}`)),e)}(t.token):t.token)),"").normalize("NFKC")}function co(e){const t=Yt(e);return t.setDate(1),t.setHours(0,0,0),t}function uo(e,t,o=7){let n,r;const s=Yt(e);switch(o){case"month":r=s.getDate(),n=zt(s)-s.getDate();break;case"week":r=s.getDay()+1,n=6-s.getDay();break;case"year":const e=function(e){const t=Yt(e);return(new Date(t.getFullYear()+1,0,0).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5}(s),t=function(e){const t=Yt(e);return Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5)}(s);r=t,n=e-t;break;default:n=r=o}for(let e=0;e<=n||e<r;e++){if(e<=n){const o=qt(s,e);if(t(o))return o}if(e&&e<=r){const o=qt(s,-e);if(t(o))return o}}return null}function fo(e,t="en",o=!1){const n=(e,t)=>Array(e).fill("").map(((e,o)=>`${t(o)}`));if("M"===e)return n(12,(e=>e+1));if("MM"===e)return n(12,(e=>{const t=e+1;return t<10?`0${t}`:t}));if(e.startsWith("M"))return fo("MM").map((n=>io(`2000-${n}-05`,e,t,o)));if(e.startsWith("d"))return n(7,(e=>`0${e+2}`)).map((o=>io(`2022-10-${o}`,e,t)));if("a"===e)return[to("am",t).toLowerCase(),to("pm",t).toLowerCase()];if("A"===e)return[to("am",t).toUpperCase(),to("pm",t).toUpperCase()];if(e.startsWith("Y")){const o=(new Date).getFullYear();return n(120,(e=>e+1)).reduce(((n,r)=>("120"!==r&&n.push(io(`${o+Number(r)}-06-06`,e,t)),n.unshift(io(o-Number(r)+"-06-06",e,t)),n)),[io(`${o}-06-06`,e,t)])}return e.startsWith("D")?n(31,(t=>`${"DD"===e&&t<9?"0":""}${t+1}`)):e.startsWith("H")?n(24,(t=>`${"HH"===e&&t<10?"0":""}${t}`)):e.startsWith("h")?n(12,(t=>`${"hh"===e&&t<9?"0":""}${t+1}`)):e.startsWith("m")||e.startsWith("s")?n(60,(t=>`${e.length>1&&t<10?"0":""}${t}`)):[]}function ho(e,t="ISO8601",o="device"){let n,r=()=>!0,s="backward";if("object"==typeof e?({date:n,format:t="ISO8601",locale:o="device",dateOverflow:s="backward",partFilter:r=(()=>!0)}=e):n=e,!n)throw new Error("parse() requires a date string.");const a=()=>{throw new Error(`Date (${n}) does not match format (${po(t,o)})`)};if("ISO8601"===t)return Yt(n);const l=ri.includes(t)||"object"==typeof t,i=function(e){let t;for(const o of e){if("literal"===o.partName&&!isNaN(parseFloat(o.partValue)))throw new Error(`Numbers in format (${o.partValue}).`);if(t&&"literal"!==t.partName&&"literal"!==o.partName&&!(t.token in ei||o.token in ei||eo(t)&&"a"===o.token.toLowerCase()))throw new Error(`Illegal adjacent tokens (${t.token}, ${o.token})`);t=o}return e}(so(t,o).filter(r));if(!i.length)throw new Error("parse() requires a pattern.");let p;try{p=vo(n,i)}catch{return a()}const d=new Date,c=new Map([["YYYY",d.getFullYear()],["MM",d.getMonth()+1],["DD",d.getDate()],["HH",0],["mm",0],["ss",0]]);let u=null,f="";p.forEach((e=>{if("literal"===e.partName)return;if(e.token===e.value)return a();const t=Number(e.value);if(c.has(e.token))c.set(e.token,t);else if("YY"===e.token)c.set("YYYY",function(e){const t=(new Date).getFullYear(),o=t%100,n=Math.floor(t/100),r=Number(e);return 100*(n+(r>o+20?-1:0))+r}(e.value));else{const n=e.token;if(n.startsWith("d"))return;if("D"===n)c.set("DD",t);else if("H"===n||n.startsWith("h"))c.set("HH",t);else if("M"===n)c.set("MM",t);else if("a"===n||"A"===n)u=e.value.toLowerCase()===to("am",o).toLowerCase();else if("Z"===n)f=Qt(e.value);else{const t=fo(n,o,l).indexOf(e.value);if(-1!==t)switch(n){case"MMM":case"MMMM":c.set("MM",t+1)}}}}));let h=c.get("HH")||0;!1===u?(h+=12===h?0:12,c.set("HH",24===h?0:h)):!0===u&&12===h&&c.set("HH",0),c.set("MM",(c.get("MM")||1)-1);let[v,m,g,$,b,y]=Array.from(c.values());const x=zt(new Date(`${ai(v)}-${si(m+1)}-10`));if(x<g&&"throw"===s)throw new Error(`Invalid date ${ai(v)}-${si(m+1)}-${si(g)}`);g="backward"===s?Math.min(g,x):g;const w=`${ai(v)}-${si(m+1)}-${si(g)}T${si($)}:${si(b)}:${si(y)}${f}`,_=new Date(w);return isFinite(+_)?_:a()}function vo(e,t){let o=0;let n=0;const r=[];let s;do{const[l,i]=[(a=t)[o++],a[o]];s=i;let p=1;if("literal"===l.partName)p=l.partValue.length;else if(l.token in ei)p=ei[l.token];else if(i)if("literal"===i.partName){if(p=e.indexOf(i.partValue,n)-n,p<0)throw new Error}else if("dayPeriod"===i.partName){for(let t=1;t<=4;t++)if(isNaN(Number(e.charAt(n+t)))){p=t;break}}else{const t=e.substring(n).search(/\d/);-1!==t&&(p=n+t)}else p=e.length;r.push({...l,value:e.substring(n,n+p)}),n+=p}while(s);var a;return r}function mo(e,t){const o=Yt(e),n=Yt(t);return o.getDate()===n.getDate()&&o.getMonth()===n.getMonth()&&o.getFullYear()===n.getFullYear()}function go(e,t=0){const o=Yt(e);let n=t-o.getDay();return n>0&&(n-=7),o.setDate(o.getDate()+n),o.setHours(0,0,0),o}function $o(e){return"timeZoneName"!==e.partName}function bo(e,t){const o=[],n=Yt(t);n.setDate(1);let r=go(n,e.props.weekStart);r.setHours(n.getHours(),n.getMinutes(),n.getSeconds());const s=function(e,t=0){const o=go(e,t);return o.setDate(o.getDate()+6),o.setHours(23,59,59),o}(Ut(t),e.props.weekStart);let a=[];do{a.push(r),7===a.length&&(o.push(a),a=[]),r=qt(r)}while(r.getTime()<=s.getTime());return{monthDay:n,weeks:o}}function yo(e){e.props.calendar=n(e.props.showMonths,(e=>e)).map((t=>bo(e,jt(e.props.renderedDate,t)))),e.props.years=function(e){const t=Number(io(e.props.renderedDate,"YYYY")),o=t-t%10;return e.props.decade=`${o} - ${o+9}`,n(10,(n=>Zt(e.props.renderedDate,o+n-t)))}(e),e.props.months=function(e){const t=Yt(e.props.renderedDate);return t.setMonth(0),n(12,(e=>jt(t,e)))}(e)}function xo(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 wo(e,t){if(!t)return e.props.inputText="",new Date;const o=t instanceof Date?t:ho(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(o,e.props.format,e.props.locale,!1,$o),o}function _o(e){return Array.isArray(e.props.sequence)?dn.clone(e.props.sequence):["day"]}function ko(e,t,o=!0){var n,r;if(e._value===t)return;if(null==t)return e.input(t,o);e.props.offset=e.props.timezone?ro(t,e.props.timezone):"+0000";const s=oo(t,null!==(n=(r=e.props).offset)&&void 0!==n?n:r.offset="+0000");e.input(io(s,e.props.valueFormat,e.props.valueLocale,!1),o)}function So(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 Lo(e,t){var o;let n="";if(!(t instanceof HTMLInputElement)||e.props.pickerOnly)return;ci.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`)?hi.add(e):hi.delete(e)})),e.on("prop:inputText",(({payload:e})=>{e!==t.value&&("beforeCallback"===Vl.get(t)&&(n=t.value),je(t),t.selectionStart=0,t.selectionEnd=t.value.length,function(e,t){var o,n;if(!kl.has(e))return;const r=null!==(o=Pl.get(e))&&void 0!==o?o:"",s=null!==(n=Hl.get(e))&&void 0!==n?n:"";at(e,{type:"insert",selectionBefore:st(e),data:t,valueBefore:e.value,suffix:s,prefix:r})}(t,e),t.value=e,setTimeout((()=>Ze(t)),10))}));const[r,s]=Ao(e);ze(t,{pattern:r,explicitParts:s,onChange:({valueAfter:o})=>{if(Do(e),ii.has(e))return ii.delete(e);n&&n===o?n="":(je(t),e.props.inputText=o,setTimeout((()=>Ze(t)),10))}})}function Do(e){var t,o;if(e.props.overlay){const n=ci.get(e);!n||!(null===(t=e.props.attrs)||void 0===t?void 0:t.placeholder)||e._value||Nt(n,!0)||e.props._isFocused||e.props.activeDate&&e.props.expanded?n&&(e.props._isPlaceholder=!1,e.props._overlayParts=u(Rt(n))):(e.props._isPlaceholder=!0,e.props._overlayParts=[{type:"placeholder",value:null===(o=e.props.attrs)||void 0===o?void 0:o.placeholder}])}}function Ao(e){const t=e.props.locale,o=["full","long","medium","short"].includes(e.props.format)||"object"==typeof e.props.format,r=so(e.props.format,t);return[po(e.props.format,t,!0,$o),r.reduce(((r,s)=>{if("literal"===s.partName)return r;let a=fo(s.token,t,o);if("YYYY"===s.token&&e.props.minDate&&e.props.maxDate){const t=e.props.minDate.getFullYear();a=n(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 r.push(l),s.token.startsWith("D")&&ui.set(e,a),r}),[])]}function Io(e,t){return!t||(!!(e.props.minDate&&t<e.props.minDate)||(!!(e.props.maxDate&&t>e.props.maxDate)||void 0))}function Co(e){return"function"==typeof e.props.validationLabel?e.props.validationLabel(e):e.props.validationLabel||e.props.label||e.props.name||String(e.name)}function Mo(e,t){var o,n;if(t instanceof HTMLInputElement&&!mi.get(e)&&vi){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){mi.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 To(e){e.addProps(["_overlayStyles","_overlayParts","_overlayInnerStyles","_isPlaceholder"]),e.props._overlayStyles={position:"absolute",top:"0",left:"0",pointerEvents:e.props._isPlaceholder?"auto":"none"},e.props._overlayInnerStyles={overflow:"hidden",whiteSpace:"nowrap",paddingRight:"20px"},e.on("created",(()=>{e.props.overlay=dn.undefine(e.props.overlay),e.props.pickerOnly=dn.undefine(e.props.pickerOnly),e.props.overlay=e.props.pickerOnly?void 0:e.props.overlay,e.props.overlay&&dn.whenAvailable(`${e.props.id}`,Mo.bind(null,e),e.props.__root)})),e.on("prop:_isPlaceholder",(()=>{e.props._overlayStyles={...e.props._overlayStyles,pointerEvents:e.props._isPlaceholder?"auto":"none"}}))}function Eo(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);sp.set(e,t),ze(t,{...rp.get(e),onChange:({valueAfter:t,meta:o})=>{e.props._maskValue=t,e.input({maskValue:t}),e.props._overlayParts=u(o)}})}function Oo(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 Fo(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=>h(e)));Array.isArray(e.value)?e.input([...e.value,...o]):e.input(o),e.props.selectedSourceItems=[]}function Vo(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=>h(e)));if(Array.isArray(e.value)){const t=e.value.filter((e=>!o.includes(e)));e.input(t)}e.props.selectedTargetItems=[]}function Bo(e){var t,o;if(e.props.activeValue===Zp){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 Po(e){var t;if(Array.isArray(e.value)){const t=[];let o=[...e.props.options];e.value.forEach((n=>{const r=e.props.memoOptions.find((e=>dn.eq(h(e),n)));if(r&&!r.noOptionFound){t.push(r);const s=e.props.options.findIndex((e=>dn.eq(h(e),n)));-1!==s&&(o=o.filter((e=>!dn.eq(h(e),n))))}else{const e=o.find((e=>dn.eq(h(e),n)));e?(t.push(e),o=o.filter((e=>!dn.eq(h(e),n)))):t.push({label:String(n),value:n,noOptionFound:!0})}})),e.props.targetOptions=t,e.props.sourceOptions=o}else e.props.sourceOptions=[...e.props.options],e.props.targetOptions=[];if(e.props.skipSetActiveValue)return void(e.props.skipSetActiveValue=!1);(null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+"_source_list_items"))&&function(e){var t,o,n,r,s,a,l;if(e.props.isDragging)return;if(e.props.sourceSearchActive){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}_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=h(t)):void(e.props.activeValue=void 0)}e.props.sourceSearchActive=!1}if(!1===e.props.transferOnSelect)return void(e.props.activeValue=void 0);const i=e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions;let p=!1;for(let t=e.props.activeIndex;t<=i.length;t++)if(!(null===(n=i.attrs)||void 0===n?void 0:n.disabled)&&i[t]){p=!0,e.props.activeValue=h(i[t]);break}if(!p&&i.length)for(let t=e.props.activeIndex;t>=0;t--)if(!(null===(r=i.attrs)||void 0===r?void 0:r.disabled)&&i[t])return p=!0,void(e.props.activeValue=h(i[t]));if(!p){let t;t=e.props.sourceListOrigin?null===(l=e.props.__root)||void 0===l?void 0:l.getElementById(`${e.props.id}`):e.props.searchable?null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_source_search_input`):null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_source_list_items`),t&&t.focus()}}(e)}function Ho(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 No(e){Array.isArray(e.value)&&e.value.forEach((async t=>{$(e,t,function(e,t){const o=[...e.props.options,...e.props.memoOptions];return o.find((e=>dn.eq(h(e),t)))}(e,t))}))}function Ro(e){e.context&&(e.context.handlers.loadMore=m.bind(null,e),e.context.fns.getSourceItemCount=t=>!1===e.props.transferOnSelect&&t.length?t.length+"/"+e.props.sourceOptions.length:e.props.sourceOptions.length,e.context.fns.getTargetItemCount=t=>!1===e.props.transferOnSelect&&t.length?t.length+"/"+e.props.targetOptions.length:e.props.targetOptions.length,e.context.fns.isActive=(t,o)=>{if(!e.props.isDragging&&!e.props.touchStarted)return dn.eq(o,h(t))||void 0},e.context.fns.isSelected=(e,t)=>!!t&&(!!Array.isArray(t)&&t.includes(e)),e.context.fns.optionLoading=t=>e.props.optionLoaderValues.includes(h(t)),e.context.handlers.clearSearch=()=>{!function(e){var t;e.props.sourceSearchActive=!1,e.props.inputText="",v(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()}(e)},e.context.handlers.sourceSearchBlur=t=>{setTimeout((()=>{var o;if(t.relatedTarget&&t.relatedTarget instanceof HTMLElement&&(t.relatedTarget.id===`${e.props.id}_source_list_items`||t.relatedTarget.id===`${e.props.id}`)){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_source_search_input`);if(!t)return;t.focus()}else e.props.activeValue=void 0}))},e.context.handlers.listitemClick=(t,o)=>n=>{Ko(e,t,o)},e.context.handlers.transferForward=Fo.bind(null,e,void 0),e.context.handlers.transferForwardAll=()=>{let t;if(e.props.maxReached)return;const o=e.props.sourceOptions.map((e=>h(e)));t=Array.isArray(e.value)?[...e.value,...o]:[...o],e.input(t),e.props.selectedSourceItems=[]},e.context.handlers.transferBackward=Vo.bind(null,e,void 0),e.context.handlers.transferBackwardAll=()=>{Array.isArray(e.value)&&(e.input([]),e.props.selectedTargetItems=[])},e.context.handlers.onSearch=t=>{!function(e,t){e.props.sourceSearchActive=!0;const o=t.target;e.props.inputText=o.value,v(e,o.value,!0)}(e,t)},e.context.handlers.onMouseenter=t=>o=>{"touchstart"!==o.type&&(t?e.props.mouseOnSource=!0:e.props.mouseOnTarget=!0)},e.context.handlers.onMouseleave=t=>o=>{var n;if("touchend"===o.type)return;const r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(t?`${e.props.id}_source_list_items`:`${e.props.id}`);r&&(r.contains(o.relatedTarget)||(e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.activeIndex=void 0,t?e.props.mouseOnSource=!1:e.props.mouseOnTarget=!1))},e.context.handlers.listitemClick=(t,o)=>n=>{n instanceof MouseEvent&&e.props.touchStarted||Ko(e,t,o)},e.context.handlers.listitemTouchstart=()=>()=>{!function(e){e.props.touchStarted=!0}(e)},e.context.handlers.listitemTouchend=(t,o)=>n=>{!function(e,t,o,n){if(e.props.touchMoved)return e.props.touchMoved=!1,void(e.props.touchStarted=!1);const r=h(t);e.props.activeIndex=e.props.sourceOptions.findIndex((e=>h(e)===r)),e.props.transferOnSelect?o?Fo(e,r):Vo(e,r):Oo(e,t,o)}(e,t,o)},e.context.handlers.listitemTouchmove=()=>t=>{!function(e){e.props.touchMoved=!0}(e)},e.context.handlers.sourceSearchFocus=t=>{Wo(e,!0)},e.context.handlers.sourceListFocused=t=>{Wo(e,!0)},e.context.handlers.targetListFocused=()=>{Wo(e,!1)},e.context.handlers.sourceListBlurred=t=>{e.props.activeValue=void 0},e.context.handlers.targetListBlurred=t=>{e.props.activeValue=void 0},e.context.handlers.sourceListKeydown=t=>{Yo(e,t,!0)},e.context.handlers.targetListKeydown=t=>{Yo(e,t,!1)},e.context.handlers.sourceSearchKeydown=t=>{Yo(e,t,!0)})}function Ko(e,t,o,n){var r;if(h(t)===Zp)return void(null===(r=e.context)||void 0===r||r.handlers.loadMore(!0));const s=h(t);e.props.activeIndex=e.props.sourceOptions.findIndex((e=>h(e)===s)),e.props.transferOnSelect?o?Fo(e,s):Vo(e,s):Oo(e,t,o)}function Wo(e,t){const o=Ho(e,t);o&&(e.props.sourceListOrigin=t,e.props.activeValue=h(o))}function Yo(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(h(t)),e}),[]);(null===(n=t.store.hasNextPage)||void 0===n?void 0:n.value)&&l.push(Zp);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}Bo(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(Ho(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===Zp)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=>h(e)===t.props.activeValue));t.props.activeIndex=s;const a=r[s];if(!a)return;t.props.transferOnSelect?o?Fo(t,h(a)):Vo(t,h(a)):Oo(t,a,o)}(t,e,o)}function qo(e){e.on("created",(()=>{if(e.props.skipSetActiveValue=!0,"function"==typeof e.props.optionsLoader&&b(e),Ro(e),e.props.disabled&&(e.props.draggable=!1),xn){dn.whenAvailable(e.props.id+"_source_list_items",(t=>{t instanceof HTMLElement&&function(e,t){function o(){return e.props.sourceOptions.map((e=>h(e)))}function n(){return[]}if(!e.context)return;const r={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=[],fn.handleTouchmove(t)},draggable:e=>"option"===e.getAttribute("role")};r.plugins=[fn.multiDrag({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,fn.handleDragstart(t)},handleEnd(t){fn.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,fn.handleTouchstart(t)},selections:()=>e.props.selectedSourceItems.map((e=>h(e)))})],fn.dragAndDrop({parent:t,getValues:o,setValues:n,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,fn.dragAndDrop({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,fn.dragAndDrop({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:maxReached",(({payload:e})=>{r.disabled=e,fn.dragAndDrop({parent:t,getValues:o,setValues:n,config:r})}))}(e,t)}),e.props.__root),dn.whenAvailable(`${e.props.id}`,(t=>{t instanceof HTMLElement&&function(e,t){function o(){return Array.isArray(e.value)?[...e.value]:[]}function n(t,o){e.props.sourceListOrigin=!0,e.input(t)}if(!e.context)return;const r={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:[]};r.plugins=[fn.multiDrag({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,fn.handleDragstart(t)},handleEnd(t){fn.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,fn.handleTouchstart(t)},selections:()=>e.props.selectedTargetItems.map((e=>h(e)))})],fn.dragAndDrop({parent:t,getValues:o,setValues:n,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,fn.dragAndDrop({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,fn.dragAndDrop({parent:t,getValues:o,setValues:n,config:r})}))}(e,t)}),e.props.__root);const t=t=>{var o;if(e.props.isDragging)return;e.props.mouseX=t.clientX,e.props.mouseY=t.clientY;const n=e.props.mouseOnSource?`${e.props.id}_source_list_items`:`${e.props.id}`,r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(n);if(r){const o=r.getBoundingClientRect();t.clientX>o.x&&t.clientX<o.x+o.width&&t.clientY>o.y&&t.clientY<o.y+o.height&&(e.props.trackHover=!0)}};document.addEventListener("mousemove",t)}}))}function Uo(e,t){var o;let n=null,r="",s=[];if(e.props.mouseOnSource){if(n=Gp.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=Xp.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&&Gp.add(e),e.props.mouseOnTarget&&Xp.add(e),a.length&&zo(e,a,null,t)}function zo(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)?h(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 Bo(e);e.props.mouseOnSource||e.props.mouseOnTarget?e.props.mouseOnSource&&Gp.has(e)||e.props.mouseOnTarget&&Xp.has(e)?requestAnimationFrame(zo.bind(null,e,t,o,n)):Uo(e,n):(Gp.delete(e),Xp.delete(e))}function jo(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function Zo(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[...Xo(t,o,n,r)]}function Go(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,jo(255*t,2),jo(255*a,2),n]}function Xo(e,t,o,n=1){const r=jo(t/255,4),s=jo(o/255,4);if(1===s)return[e,0,100,n];const a=jo(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,jo(l,2),jo(100*a,2),n]}function Jo(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 Qo(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 en(e,t,o,n=1){const[r,s,a,l]=Jo(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 tn(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function on(e){if(e){if(tn(e))return Zo(e);if(e.startsWith("rgb")){const t=e.match(bc);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return Qo(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(yc);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 Xo(o,jo(255*n,2),jo(255*r,2),s)}}}function nn(e){const[t,o,n,r]=e.split("-").map((e=>Number(e)));return[t,o,n,r]}function rn(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 sn(e){return!1!==e&&"false"!==e}function an(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}function ln(e,t){return t=(null==t?void 0:t.hasOwnProperty("__original"))?null==t?void 0:t.__original:null==t?void 0:t.value,e.props.multiple?!!Array.isArray(e.value)&&e.value.filter((e=>dn.eq(e,t))).length>0:void 0!==t?dn.eq(e.value,t):(e.props._isChecked=dn.eq(e.value,e.props.onValue),e.props._isChecked)}function pn(e){function t(t){var o,n,a;const l=(`${t}`.match(/\-/g)||[]).length%2==1;t=function(t){t=function(e){return e.replace(/[\u0660-\u0669\u06f0-\u06f9]/g,(e=>(15&e.charCodeAt(0)).toString()))}(`${t}`),isNaN(t)&&(t=t.split(p.decimal).map((e=>e.replace(/[^0-9]/g,""))).join("."));if(t=t.replace(/[^0-9\.]/g,""),t.includes(".")){const o=t.split(".");0===e.props.decimals?t=o[0]:(o[1]=o[1].padEnd(i(),"0").slice(0,i()),t=o.join("."))}return t}(t);const c={};"unit"===r()&&(c.minimumFractionDigits=t.includes(".")?1:0),c.maximumFractionDigits=i(),e.props.minDecimals&&(c.minimumFractionDigits=e.props.minDecimals,t.includes(".")||(t+=".".padEnd(e.props.minDecimals,"0"))),0===c.maximumFractionDigits&&t.includes(".")&&(t=t.split(".")[0]);let u="";isNaN(t)||""===t.trim()||(t=l?`-${t}`:t,e.props.max&&!isNaN(e.props.max)&&(t=`${Math.min(t,e.props.max)}`),e.props.min&&!isNaN(e.props.min)&&(t=`${Math.max(t,e.props.min)}`),t.includes(".")?t=t.split(".")[0].padStart(1,"0")+"."+(null!==(o=t.split(".")[1])&&void 0!==o?o:"0"):c.maximumFractionDigits=null!==(n=c.minimumFractionDigits)&&void 0!==n?n:0,u=s(e.props.displayLocale,c).format(t));let f,h=t.split(".");return h=h[0]+(null!==(a=h[1])&&void 0!==a?a:"").padEnd(i(),"0"),h.length>1&&(h=h.replace(/^0+/,""),h=""!==t&&""===h?"0":h),e.props.valueStore={number:t,integer:h,string:u},d=!0,e.props.valueStore&&(f=e.props.valueStore.hasOwnProperty(e.props.valueFormat)?e.props.valueStore[e.props.valueFormat]:e.props.valueStore.number),e.input(""===f?void 0:f).then((()=>(d=!1,Promise.resolve())))}function o(){dn.whenAvailable(`${e.props.id}`,(t=>{var o,n;t instanceof HTMLInputElement&&(t.value=null!==(n=null===(o=e.props.valueStore)||void 0===o?void 0:o.string)&&void 0!==n?n:"")}),e.props.__root)}function n(){var t,o;const n=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`#${e.props.id}_inner input`);return null!==(o=null==n?void 0:n.value)&&void 0!==o?o:""}function r(){return e.props.currency?"currency":"unit"}function s(t,o={}){const n=r(),s=Object.assign({},{style:n,roundingMode:"trunc"},o);return s[n]=e.props[n],new Intl.NumberFormat(t,s)}function a(){var t,o,n;const r=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`#${e.props.id}_inner input`);if(r){r.dataset.placeholder||(r.dataset.placeholder=null!==(o=r.getAttribute("placeholder"))&&void 0!==o?o:"");const e=((p.unitLeft?`${p.unit} `:"")+(null!==(n=r.dataset.placeholder)&&void 0!==n?n:"")+(p.unitLeft?"":` ${p.unit}`)).trim();r.setAttribute("placeholder",e)}}function l(t){var o;const r=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`#${e.props.id}_inner input`);if(!r)return;const s=p.unit.length+p.literal.length;t=p.unitLeft?Math.max(t,s):Math.min(t,n().length-s),r.setSelectionRange(t,t)}function i(){return!1===e.props.decimals||"false"===e.props.decimals?0:isNaN(`${e.props.decimals}`)?p.fractionLength:e.props.decimals}let p=null,d=!1;e.props.valueStore=null,e.on("input",(({payload:e})=>{d||(t(e),o())})),e.on("mounted",(()=>{a()})),e.context&&(e.context.handlers.setPlaceholder=a,e.context.handlers.init=(n=null)=>{var r;!function(){var t,o,n,r,a,l,i;const d=s(e.props.displayLocale).formatToParts(12345678.12345678);p={decimal:null===(t=d.find((e=>"decimal"==e.type)))||void 0===t?void 0:t.value,group:null===(o=d.find((e=>"group"==e.type)))||void 0===o?void 0:o.value,unit:null===(n=d.find((e=>["unit","currency"].includes(e.type))))||void 0===n?void 0:n.value,unitLeft:["unit","currency"].includes(d[0].type),literal:null!==(a=null===(r=d.find((e=>"literal"==e.type)))||void 0===r?void 0:r.value)&&void 0!==a?a:"",fractionLength:null!==(i=null===(l=d.find((e=>"fraction"==e.type)))||void 0===l?void 0:l.value.length)&&void 0!==i?i:0}}();let a=null!==(r=null!=n?n:e._value)&&void 0!==r?r:"";e.props.valueStore?a=e.props.valueStore.number:"integer"===e.props.valueFormat&&(a=function(e){var t;return(parseFloat(`${e}`)/Math.pow(10,null!==(t=i())&&void 0!==t?t:0)).toString().replace(".",i())}(`${null!=a?a:""}`)),t(a),o()},e.context.handlers.handleBeforeInput=o=>{var n,r,s,a,i,d,c,u,f;if(o.preventDefault(),o.stopPropagation(),o.target instanceof HTMLInputElement){const h=o.target,v=null!==(n=o.data)&&void 0!==n?n:"",m=null!==(r=o.target.value)&&void 0!==r?r:"",g=null!==(s=o.target.selectionStart)&&void 0!==s?s:0,$=null!==(a=o.target.selectionEnd)&&void 0!==a?a:0,b=$-g,y=m.indexOf(p.decimal);let x=(null!==(i=o.target.selectionStart)&&void 0!==i?i:0)+(o.data?0:-1),w=m,_=1;if(m.includes(p.decimal)&&v===p.decimal)return v===p.decimal&&(x=w.indexOf(p.decimal)+1),void l(x);if(!(null===e.props.min||e.props.min<0||e.props.max<0)&&"-"===v)return;if(v.match(/[a-zA-Z]/))return;if(v===p.decimal&&(!1===e.props.decimals||"false"===e.props.decimals))return;if("deleteByCut"===o.inputType&&b>0&&(w=w.slice(0,g)+w.slice($),x=$),"insertFromPaste"===o.inputType){const e=null!==(d=o.data)&&void 0!==d?d:"";w=w.slice(0,g)+e+w.slice($)}if("deleteContentBackward"===o.inputType&&m[g-1]===p.group?(_+=1,x-=1):"deleteContentForward"===o.inputType&&m[g]===p.group&&(_+=1,x+=1),-1!==y&&x>y&&"insertText"===o.inputType?w=function(e,t,o){return e.substring(0,t)+o+e.substring(t+o.length)}(w,x,null!==(c=o.data)&&void 0!==c?c:"0"):"insertText"===o.inputType?(x=$,w=w.slice(0,g)+o.data+w.slice($)):"deleteContentForward"===o.inputType?(x+=2,w=0===b?w.slice(0,g)+w.slice($+_):w.slice(0,g)+w.slice($)):"deleteContentBackward"===o.inputType&&(x+=1,0===b?w=w.slice(0,Math.max(g-_,0))+w.slice($):b>0&&(w=w.slice(0,g)+w.slice($))),"deleteContentForward"===o.inputType&&m[g]===p.decimal){const e=w.slice(g-1);w=w.slice(0,g),e.includes(p.unit)&&(w+=" "+p.unit)}else if("deleteContentBackward"===o.inputType&&m[g-1]===p.decimal){const e=w.slice(g-1);w=w.slice(0,g-1),e.includes(p.unit)&&(w+=" "+p.unit)}t(w),w=null!==(f=null===(u=e.props.valueStore)||void 0===u?void 0:u.string)&&void 0!==f?f:"",x=w.length-m.length+x,w.length===m.length&&(x+=o.inputType.includes("delete")?-1:1),h.setSelectionRange(0,m.length),document.execCommand("insertText",!1,w),v===p.decimal?x=w.indexOf(p.decimal)+1:m.includes(p.decimal)&&!w.includes(p.decimal)&&(x=w.length),l(Math.max(0,x))}},e.context.handlers.handleInput=o=>{o.target instanceof HTMLInputElement&&(e.props.inputText=o.target.value,t(o.target.value))},e.context.handlers.handleKeyDown=r=>{var s,a;if(r.target instanceof HTMLInputElement&&("ArrowUp"===r.key||"ArrowDown"===r.key)){const i="ArrowUp"===r.key?1*e.props.step:-1*e.props.step;t(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===(s=e.props.valueStore)||void 0===s?void 0:s.number)&&void 0!==a?a:0,i)),o(),setTimeout((()=>{l(n().length)}),1)}})}var dn=require("@formkit/utils"),cn=require("@formkit/core"),un=require("@formkit/inputs");require("@formkit/vue");var fn=require("@formkit/drag-and-drop");const hn=[988,24029,396,13078,980],vn=18806588,mn=502357,gn=16217489;let $n=189024;const bn=()=>[30548127325,27022924,34729821653783].map(Ln).join("y"),yn=/^[0-9a-f]+$/,xn="undefined"!=typeof window,wn=n(32,(e=>e)).map((()=>{$n|=0,$n=$n+1831565813|0;let e=$n^$n>>>15|$n;return e=e+e^e>>>427,((e^e>>>14)>>>0)/4294967296})),_n=xn?setTimeout:()=>0,kn=e=>{clearTimeout(Sn[e])},Sn={},Ln=e=>e.toString(32),Dn=e=>`${Ln(wn[e]).substring(2)}.${Ln(hn[e%(hn.length-1)])}`,An={},In={},Cn=new Set(["",null,void 0]),Mn={},Tn=()=>({$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.valid === false && $state.validationVisible || 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"}}),En=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),On=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),Fn=()=>({$el:"ul",if:"$fns.length($messages)"}),Vn=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),Bn=()=>({$el:"div",if:"$help"}),Pn=()=>({$el:null}),Hn=(e,t)=>()=>un.icon(e,t),Nn=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),Rn=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),Kn=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),Wn=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),Yn=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),qn=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),Un=()=>({$el:null,for:["part","$_overlayParts"]}),zn=a("dd"),{outer:jn,wrapper:Zn,inner:Gn,icon:Xn,label:Jn,prefix:Qn,suffix:er,help:tr,messages:or,message:nr}=l(zn),rr=zn("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"}}))),sr=zn("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),ar=zn("selection",(()=>({$el:"div"}))),lr=zn("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'}}}))),ir=zn("optionLoading","span"),pr=zn("option",(()=>({$el:"div"}))),dr=zn("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)',onTouchstart:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',"aria-controls":"$id"}}))),cr=zn("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),ur=zn("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),fr=zn("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),hr=zn("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 || ""'}))),vr=zn("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)"}}))),mr=zn("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"-1"}}))),gr=zn("tagLabel",(()=>({$el:"span"}))),$r=zn("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),br=zn("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),yr=zn("tagLoading","span"),xr=d(zn),wr=new WeakMap,_r=new WeakMap,kr=cn.createMessage({key:"loading",type:"state",value:!0,visible:!1}),Sr=cn.createMessage({key:"loading",type:"state",value:!1,visible:!1}),Lr=new WeakMap,Dr=Symbol(),Ar=e=>{const t=(e=>{const t=[...e.props.allOptions,...e.props.initialOptions];return[...e.props.memoOptions||[],...t]})(e),o=e.props.inputStd||[],n=[];for(const e of o){let o,r=t.find((t=>dn.eq(h(t),e)));o=dn.isPojo(e)?void 0:Array.isArray(e)?e.join(", "):e,r||(r={value:e,label:o,isPlaceholder:!1,noOptionFound:!0}),n.push(r)}return n},Ir=new WeakSet,Cr=new WeakMap,Mr={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Tr={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Er={overflow:"hidden",height:"100%"},Or={},Fr={};let Vr=0;const Br=(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))}},Pr={schema:jn(Zn(Jn("$label"),Gn(Xn("prefix"),Qn(),rr(p("$inputStd.length === 0 && $state.loading !== true",lr('$placeholder || "placeholder"'),p("$multiple !== true",sr(p("$state.loading && $selections.length === 0",ir("$ui.isLoading.value"),ar(pr("$option.label")))),p('$multiple && $selectionAppearance === "truncate"',cr(ur(p("$state.loading && $selections.length === 0",ir("$ui.isLoading.value"),hr()))),p('$multiple && $selectionAppearance === "tags"',$r(br(p("$state.loading && $isLoadingOption !== true && $selections.length === 0",ir("$ui.isLoading.value"),vr(mr(p("$state.loading && $optionLoaderValues.includes($option.value) || $option.label === undefined",yr("$ui.isLoading.value"),gr("$option.label")),dr(Xn("close"))))))))))),p("$truncationCount && $state.loading !== true",fr("$truncationCount")),p("$state.loading",Xn("loader")),p("$inputStd.length !== 0 && $selectionRemovable",dr(Xn("close")),Xn("select"))),xr(),er(),Xn("suffix"))),tr("$help"),or(nr("$message.value"))),type:"input",family:"dropdown",props:[],features:[un.defaultIcon("select","select"),un.defaultIcon("close","close"),un.defaultIcon("selected","check"),un.defaultIcon("loader","spinner"),un.localize("isLoading"),un.localize("loadMore"),un.localize("remove"),un.options,U.bind(null,(function(e){void 0===e.props.closeOnSelect?e.props.closeOnSelect=!e.props.multiple:e.props.closeOnSelect=dn.undefine(e.props.closeOnSelect),(e.props.multiple&&void 0===e.props.selectionAppearance||"truncate"===e.props.selectionAppearance)&&(e.props.selectionAppearance="truncate",e.props.formattedSelections=[]),e.props.multiple?e.props.selectionRemovable=!1:e.props.selectionRemovable=dn.undefine(e.props.selectionRemovable)}),(function(e){e.props.alwaysLoadOnOpen=void 0!==e.props.alwaysLoadOnOpen&&dn.undefine(e.props.alwaysLoadOnOpen),e.on("created",(()=>{e.context&&(e.context.handlers.click=se.bind(null,e),e.context.handlers.focus=ae.bind(null,e),e.context.handlers.keydown=ne.bind(null,e),e.context.handlers.selectorTagKeydownHandler=t=>te.bind(null,e,t))}))}),(function(e){if(e.on("created",(()=>{e.context&&le(e)})),e.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]}))}(e),"truncate"===e.props.selectionAppearance&&(e.props.lastVisibleIndex=null,ie(e),e.on("prop:selections",(()=>{ie(e)}))),"tags"===e.props.selectionAppearance&&ve(e),e.props.multiple&&"tags"===e.props.selectionAppearance){function t(){return Array.isArray(e.value)?e.value:[]}function o(t,o){e.input(t)}e.on("created",(()=>{e.props.disabled&&(e.props.draggable=!1),dn.whenAvailable(`${e.props.id}_selections`,(n=>{if(e.context&&n instanceof HTMLElement){const r={threshold:{horizontal:.25,vertical:0},plugins:[fn.animations()],draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,disabled:!e.props.draggable,root:e.props.__root,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag")};fn.dragAndDrop({parent:n,getValues:t,setValues:o,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,fn.dragAndDrop({parent:n,getValues:t,setValues:o,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,fn.dragAndDrop({parent:n,getValues:t,setValues:o,config:r})}))}}),e.props.__root)}))}e.on("prop:expanded",(({payload:t})=>{t&&e.props.optionsLoader&&"function"==typeof e.props.optionsLoader&&(!e.props.options.length||e.props.alwaysLoadOnOpen)&&(e.props.options=[],b(e))})),"overscroll"===e.props.behavior&&he(e)})),$e]},Hr=a("tg"),{outer:Nr,wrapper:Rr,label:Kr,prefix:Wr,suffix:Yr,help:qr,messages:Ur,message:zr,icon:jr}=l(Hr),Zr=Hr("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"}}))),Gr=Hr("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"}))),Xr=Hr("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"}))),Jr=Hr("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"}}))),Qr=Hr("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"}}}))),es=Hr("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),ts=Hr("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),os=Hr("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),ns={schema:Nr(Rr(Xr(),es(Wr(),Zr(),ts(Jr(),os(p("$slots.default","$slots.default",jr("thumb")))),Yr()),Qr(),Gr()),qr("$help"),Ur(zr("$message.value"))),type:"input",props:["checked","thumbColorOff","thumbColorOn","iconColorOff","iconColorOn","valueLabelColorOff","valueLabelColorOn","offValue","offValueLabel","onValue","onValueLabel","thumbIcon","trackColorOff","trackColorOn","valueLabelDisplay","altLabelPosition"],features:[function(e){function t(e,t){t.target instanceof HTMLInputElement&&(e.input(t.target.checked?e.props.onValue:e.props.offValue),e.props.checked=t.target.checked)}e.on("created",(()=>{"disabled"in e.props&&(e.props.disabled=dn.undefine(e.props.disabled)),e.props.altLabelPosition=dn.undefine(e.props.altLabelPosition),void 0===e.props.offValue&&(e.props.offValue=!1),void 0===e.props.onValue&&(e.props.onValue=!0),e.props.checked=dn.eq(e.value,e.props.onValue),e.context&&(e.context.handlers.toggles=t.bind(null,e))})),e.on("commit",(({payload:t})=>{e.props.checked=dn.eq(t,e.props.onValue)}))}]},rs=a("rp"),{outer:ss,inner:as,prefix:ls,suffix:is,help:ps,messages:ds,message:cs,icon:us}=l(rs),fs=rs("empty",(()=>({$el:"div"}))),hs=rs("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}}))),vs=rs("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),ms=rs("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}}))),gs=rs("items",(()=>({$el:"ul",meta:{autoAnimate:!0},attrs:{role:"list",id:'$id + "_items"'}}))),$s=rs("item",(()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}}))),bs=rs("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}}))),ys=rs("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}}))),xs=rs("content","div"),ws=rs("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id"}}))),_s=rs("legend",(()=>({$el:"legend",if:"$label"}))),ks=rs("group",(()=>({$formkit:"group",index:"$index"}))),Ss=rs("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),Ls=rs("remove",(()=>({$el:"li",if:"$removeControl"}))),Ds=rs("insert",(()=>({$el:"li",if:"$insertControl"}))),As=rs("up",(()=>({$el:"li",if:"$upControl"}))),Is=rs("down",(()=>({$el:"li",if:"$downControl"}))),Cs=rs("controlLabel","span"),Ms=rs("dragHandleWrapper",(()=>({if:"$draggable",$el:"div"}))),Ts=rs("dragHandle",(()=>({$el:"div",attrs:{id:'$id + "_drag_handle"'}}))),Es={schema:ss(ws(_s("$label"),ps("$help"),as(ls(),p("$value.length === 0",p("$slots.empty",fs()),p("$slots.default",gs($s(Ms(Ts(us("dragHandle"))),xs(ks("$slots.default")),Ss(As(ys(Cs("$ui.moveUp.value"),us("moveUp"))),Ls(ms(Cs("$ui.remove.value"),us("remove"))),Ds(hs(Cs("$ui.add.value"),us("add"))),Is(bs(Cs("$ui.moveDown.value"),us("moveDown")))))),is()))),vs('$addLabel || ($ui.add.value + " " + ($label || ""))')),ds(cs("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs","draggable"],features:[function(e){e._c.sync=!0,e.on("created",be.bind(null,e)),e.on("mounted",(()=>{dn.whenAvailable(`${e.props.id}_items`,(t=>{if(t instanceof HTMLElement){ye(t,e);function o(t){for(const o of t)for(const t of Array.from(o.addedNodes))if(t instanceof HTMLElement&&t.id===`${e.props.id}_items`)return void ye(t,e)}new MutationObserver(o).observe(t.parentNode,{childList:!0})}}),e.props.__root)}))},un.disablesChildren,un.localize("remove"),un.localize("add"),un.localize("moveUp"),un.localize("moveDown"),un.defaultIcon("dragHandle","dragHandle"),un.defaultIcon("remove","trash"),un.defaultIcon("add","add"),un.defaultIcon("moveUp","arrowUp"),un.defaultIcon("moveDown","arrowDown")]},Os=new WeakMap,Fs=a("rt"),{outer:Vs,wrapper:Bs,inner:Ps,label:Hs,prefix:Ns,suffix:Rs,help:Ks,messages:Ws,message:Ys,icon:qs}=l(Fs),Us=Fs("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"}}))),zs=Fs("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",onTouchstart:"$handlers.handleTouchstart($item)",onTouchmove:"$handlers.handleTouchmove"}}))),js=Fs("template",(()=>({for:["increment","stepIndex","$stepsPerValue"],$el:null}))),Zs=Fs("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%"'}}}))),Gs=Fs("itemLabelInner",(()=>({$el:"span",children:"$fns.getValue($item, $increment)"}))),Xs=Fs("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))"}}))),Js=Fs("onItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item)",display:"flex",position:"relative",overflow:"hidden",top:"0",left:"0",bottom:"0"}}}))),Qs=Fs("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"}}}))),ea=Fs("onItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$onColor"}}}))),ta=Fs("offItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$offColor"}}}))),oa={schema:Vs(Bs(Hs("$label"),Ps(qs("prefix"),Ns(),Us(zs(js(Zs(Js(ea(p("$slots.onItem",(()=>()=>"$slots.onItem"),p("$slots.default",(()=>()=>"$slots.default"),qs("rating"))))),Qs(ta(p("$slots.offItem",(()=>()=>"$slots.offItem"),p("$slots.default",(()=>()=>"$slots.default"),qs("rating"))))),Gs()),Xs()))),Rs(),qs("suffix"))),Ks("$help"),Ws(Ys("$message.value"))),type:"input",props:[],features:[function(e){function t(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`}}))}e.addProps(["max","step","stepsPerValue","itemsToPercentages","rightToLeft","onItemStyles","offItemStyles","hoverHighlight","deselect","disabled","wrapperWidth","onColor","offColor"]),!1!==e.props.hoverHighlight&&"false"!==e.props.hoverHighlight&&(e.props.hoverHighlight=!0),e.props.deselect=dn.undefine(e.props.deselect),e.props.max=Number(e.props.max)||5,e.props.min=Number(e.props.min)||0,e.props.step=Number(e.props.step)||1,e.props.numberOfSteps=e.props.max/e.props.step,e.props.lastIndex=1/e.props.step-1,e.props.itemsToPercentages={},"disabled"in e.props&&(e.props.disabled=dn.undefine(e.props.disabled)),e.props.rightToLeft?(e.props.onItemStyles=void 0,e.props.offItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%",zIndex:100}):e.props.onItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%"},e.props.stepsPerValue=1/e.props.step,e.hook.input(((t,o)=>{if(null===t||""===t||isNaN(t))return o(t);const n=Number(t),r=Number(e.props.min),s=Number(e.props.max);return n>s?o(s):e.props.min&&n<=r?o(r):o(n)})),e.on("commit",(({payload:t})=>{const o=Number(t||0);xe(e,o)})),e.on("created",(()=>{e.context&&(dn.whenAvailable(`${e.props.id}_items_wrapper`,(()=>{t(e),function(e){var o;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_items_wrapper`);if(!n)return;new ResizeObserver((()=>{t(e)})).observe(n)}(e),setTimeout((()=>t(e)),100)}),e.props.__root),e.context.fns.getPercentage=(e,t,o=!0)=>(o?e.onItems:e.offItems)[t],e.context.fns.getValue=(t,o)=>t+Number((o*e.props.step+e.props.step).toFixed(1)),e.context.fns.showLabel=(t,o)=>{const n=Number(e.value||0);return 0===n&&0===o||n&&t===n||t>n&&0===o||n>t&&o===e.props.lastIndex},e.context.handlers.handleFocus=t=>Ae.call(null,e,t),e.context.handlers.handleWrapperKeydown=t=>De.call(null,e,t),e.context.handlers.handleWrapperBlur=t=>we.call(null,e,t),e.context.handlers.handleItemClick=t=>o=>Me.call(null,e,t,o),e.context.handlers.handleMousemove=t=>o=>Ie.call(null,e,t,o),e.context.handlers.handleMouseleave=()=>Ce.call(null,e),e.context.handlers.handleDragstart=t=>o=>Le.call(null,e,t,o),e.context.handlers.handleMouseup=t=>Se.call(null,e,t),e.context.handlers.handleTouchstart=t=>o=>ke.call(null,e,t,o),e.context.handlers.handleTouchmove=t=>_e.call(null,e,t),e.context.handlers.handleKeydown=t=>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)}(e,t,o))}))},un.defaultIcon("rating","star")]},na=a("ac"),{outer:ra,wrapper:sa,inner:aa,icon:la,label:ia,prefix:pa,suffix:da,help:ca,messages:ua,message:fa}=l(na),ha=na("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",onTouchmove:"$handlers.touchmove",onTouchstart:"$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"}}))),va=na("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"}}))),ma=na("selectionWrapper",(()=>({for:["option","index","$selections"],$el:"div",attrs:{id:'$id + "_selection_wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:'$disabled && "-1" || 1',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)"}}))),ga=na("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),$a=na("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),ba=na("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"}}))),ya=na("optionLoading","span"),xa=na("option",(()=>({$el:"div",if:"$value !== undefined"}))),wa=d(na),_a=new WeakMap,ka="undefined"!=typeof window,Sa=new WeakMap;let La=!1;const Da={schema:ra(sa(ia("$label"),aa(la("prefix"),pa(),ha(),p("$multiple !== true && $selectionAppearance === option && $expanded === false",$a(ma(ga(xa(p("$state.loading",ya("$ui.isLoading.value"),"$option.label"))),p("$state.loading && $isSingleOption !== true && $optionLoaderValues.includes($option.value)",la("loader")),p("$selectionRemovable && $isSingleOption",ba(la("close")))))),p("$state.loading && ($isSingleOption !== true || $selections.length === 0)",la("loader")),p('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',ba(la("close")),p('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',va(la("select")))),p("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $optionLoaderValues.length > 0)",va(la("select"))),wa(),da(),la("suffix")),p("$multiple && $selectionAppearance === option",$a(ma(ga(xa(p("$state.loading && $isLoadingOption",ya("$ui.isLoading.value"),"$option.label"))),ba(la("close")))))),ca("$help"),ua(fa("$message.value"))),type:"input",family:"dropdown",props:[],features:[un.defaultIcon("select","select"),un.defaultIcon("close","close"),un.defaultIcon("selected","check"),un.defaultIcon("loader","spinner"),un.localize("isLoading"),un.localize("loadMore"),un.localize("remove"),un.localize("open"),un.localize("close"),un.options,U.bind(null,(function(e){"option"!==e.props.selectionAppearance||e.props.multiple||!1===e.props.selectionRemovable||"false"===e.props.selectionRemovable||(e.props.selectionRemovable=!0),e.props.multiple||(e.props.clearSearchOnOpen=dn.undefine(e.props.clearSearchOnOpen)),e.props.selectionRemovable=dn.undefine(e.props.selectionRemovable),e.props.openOnClick=dn.undefine(e.props.openOnClick),"option"!==e.props.selectionAppearance||e.props.multiple||(e.props.isSingleOption=!0),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),void 0===e.props.selectionAppearance&&(e.props.selectionAppearance="text-input"),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),e.props.closeOnSelect?e.props.resetSearchOnCommit=!1:void 0===e.props.resetSearchOnCommit&&(e.props.resetSearchOnCommit=e.props.multiple),e.props.allowNewValues=dn.undefine(e.props.allowNewValues)}),Fe,(function(e){if(e.props.multiple)if(e.props.multiple&&"option"===e.props.selectionAppearance){function t(){return Array.isArray(e.value)?e.value:[]}function o(t){e.input(t)}qe(e),e.on("created",(()=>{e.props.disabled&&(e.props.draggable=!1),dn.whenAvailable(`${e.props.id}_selections`,(n=>{if(n instanceof HTMLElement&&e.context){const r={draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,root:e.props.__root,disabled:!e.props.draggable,plugins:[fn.animations()],touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-selection")};fn.dragAndDrop({parent:n,getValues:t,setValues:o,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,fn.dragAndDrop({parent:n,getValues:t,setValues:o,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,fn.dragAndDrop({parent:n,getValues:t,setValues:o,config:r})}))}}),e.props.__root)}))}else e.props.multiple&&"text-input"===e.props.selectionAppearance&&Re(e);else Ue(e)})),$e]},Aa=a("dp"),{outer:Ia,wrapper:Ca,inner:Ma,icon:Ta,label:Ea,prefix:Oa,suffix:Fa,help:Va,messages:Ba,message:Pa}=l(Aa),Ha=Aa("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"}}))),Na=Aa("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"'}}}}))),Ra=Aa("next",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}}))),Ka=Aa("nextLabel","span"),Wa=Aa("prev",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}}))),Ya=Aa("prevLabel","span"),qa=Aa("calendar",(()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}}))),Ua=Aa("calendarWeeks",(()=>({$el:"tbody"}))),za=Aa("calendarHeader",(()=>({$el:"thead"}))),ja=Aa("weekDays",(()=>({$el:"tr"}))),Za=Aa("weekDay",(()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}}))),Ga=Aa("week",(()=>({$el:"tr",for:["week","$month.weeks"]}))),Xa=Aa("dayCell",(()=>({$el:"td",for:["day","$week"],attrs:{key:'$: "day" + $fns.format($day, "D")',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":"$fns.isSelected($day)","aria-label":'$fns.format($day, "long")'}}))),Ja=Aa("day","div"),Qa=Aa("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'}}))),el=Aa("years",(()=>({if:'$panel === "year"',$el:"ul"}))),tl=Aa("year",(()=>({for:["year","$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":"$fns.isSelected($year)","data-disabled":"$fns.isDisabledYear($year)"}}))),ol=Aa("months",(()=>({if:'$panel === "month"',$el:"ul"}))),nl=Aa("month",(()=>({$el:"li",for:["month","$months"],attrs:{key:'$: "month" + $fns.format($month, "M")',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":"$fns.isSelected($month)","data-disabled":"$fns.isDisabledMonth($month)"}}))),rl=Aa("panelHeader",(()=>({$el:"header",attrs:{"aria-live":"polite"}}))),sl=Aa("yearsHeader",(()=>({$el:"div",if:'$panel === "year"'}))),al=Aa("monthsHeader",(()=>({$el:"div",if:'$panel === "month"'}))),ll=Aa("daysHeader",(()=>({$el:"div",if:'$panel === "day"'}))),il=Aa("timeHeader",(()=>({$el:"div",if:'$panel === "time"'}))),pl=Aa("yearButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"}))),dl=Aa("monthButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"}))),cl=Aa("dayButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"}))),ul=Aa("removeSelection",(()=>({$el:"button",if:"$clearable && $_value",attrs:{id:'$id + "_remove_selection"',type:"button",onClick:"$handlers.clear","aria-controls":"$id"}}))),fl=Aa("time",(()=>({$el:"div",if:'$panel === "time"'}))),hl=Aa("timeInput",(()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown",spellcheck:"false",onBlur:"$handlers._blurOut(time)"}}))),vl=Aa("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:ml,overlayLiteral:gl,overlayChar:$l,overlayEnum:bl,overlay:yl,overlayParts:xl,overlayInner:wl}=i(Aa),_l=Aa("panel","div"),kl=new WeakMap,Sl=new WeakMap,Ll=new WeakSet,Dl=new WeakMap,Al=new WeakMap,Il=new WeakSet,Cl=new WeakMap,Ml=/[\uD800-\uDBFF]/,Tl=new WeakMap,El=new WeakMap,Ol=new WeakMap,Fl=new WeakMap,Vl=new WeakMap,Bl=new WeakSet,Pl=new WeakMap,Hl=new WeakMap,Nl=new WeakMap,Rl=new WeakMap;let Kl=!1;const Wl=()=>{Kl=!0,setTimeout((()=>{Kl=!1}),500)},Yl={"#":{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"}},ql=new WeakMap,Ul="undefined"!=typeof window;let zl=!1;Ul&&document.addEventListener("selectionchange",(()=>{const e=f();if(!(e instanceof HTMLInputElement))return;if(Rl.has(e))return function(e){const t=Rl.get(e);if(t){const[o,n]=t,[r,s]=Ct(e),a=s.indexOf(o);if(-1===a)return void Rl.delete(e);const l=r[a],i=[l[0]+n[0],l[1],"none"];rt(st(e),i)||ct(e,i)}}(e);if("select"!==Cl.get(e))return;const t=st(e);if(!rt(t,ql.get(e))){if(ql.set(e,t),Ll.has(e))return Ll.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:st(e)}))}}));var jl=/^([0-9]{4})-([0-1][0-9])(?:-([0-3][0-9]))?(?:[T ]?([0-2][0-9])(?::([0-5][0-9]))?(?::([0-5][0-9]))?)?(?:\.[0-9]+)?(Z|(?:\+|\-)[0-9]{4})?$/,Zl="1999-03-04T02:05:01.000Z",Gl=new Map,Xl=[["YYYY",{year:"numeric"}],["YY",{year:"2-digit"}],["MMMM",{month:"long"}],["MMM",{month:"short"}],["MM",{month:"2-digit"}],["M",{month:"numeric"}],["DD",{day:"2-digit"}],["D",{day:"numeric"}],["dddd",{weekday:"long"}],["ddd",{weekday:"short"}],["d",{weekday:"narrow"}],["mm",{minute:"2-digit"}],["m",{minute:"numeric"}],["ss",{second:"2-digit"}],["s",{second:"numeric"}],["Z",{timeZoneName:"short"}]],Jl=[["HH",{hour:"2-digit"}],["H",{hour:"numeric"}]],Ql=[["hh",{hour:"2-digit"}],["h",{hour:"numeric"}],["a",{dayPeriod:"narrow"}],["A",{dayPeriod:"narrow"}]],ei={DD:2,HH:2,MM:2,YY:2,YYYY:4,hh:2,mm:2,ss:2,Z:5},ti=["MMMM","MMM","dddd","ddd"],oi=new Map([...Xl,...Jl,...Ql].map((e=>[e[0],e]))),ni=new Map,ri=["full","long","medium","short"],si=e=>String(e).padStart(2,"0"),ai=e=>String(e).padStart(2,"0");const li="undefined"!=typeof window,ii=new WeakSet,pi=new WeakSet,di=new WeakSet,ci=new WeakMap,ui=new WeakMap,fi=new WeakSet,hi=new WeakSet,vi="undefined"!=typeof window,mi=new WeakMap,gi={schema:Ia(Ca(Ea("$label"),Ma(Ta("prefix"),Oa(),yl(wl(xl(ml("$part.value"),gl("$part.value"),$l("$part.value"),bl("$part.value")))),Ha(),Na(rl(Wa(Ya("$ui.prev.value"),Ta("prev")),sl("$decade"),al(pl()),ll(dl(),pl()),il(dl(),cl(),pl()),Ra(Ka("$ui.next.value"),Ta("next")),vl(Ta("close"))),_l(el(tl("$fns.format($year, $yearFormat)")),ol(nl("$fns.format($month, $monthFormat)")),qa(za(ja(Za("$fns.format($day, $weekdayFormat)"))),Ua(Ga(Xa(Ja("$fns.format($day, $dateFormat)"))))),fl(hl()))),ul(Ta("clear")),Qa(Ta("calendar")),Fa(),Ta("suffix"))),Va("$help"),Ba(Pa("$message.value"))),type:"input",family:"text",props:["dateFormat","dayButtonFormat","format","monthButtonFormat","monthFormat","overlay","pickerOnly","showMonths","showPagination","weekStart","weekdayFormat","yearFormat","years"],features:[To,function(e){var t,o,r,s,a,l,i,p,d,c,u,f,h,v,m,g,$,b,y,x,w,_;e.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"]),e.hook.prop(((t,o)=>("expanded"===t.prop&&e.props.disabled&&(t.value=!1),"weekStart"===t.prop&&(t.value=Number(t.value||0)),"showMonths"===t.prop&&(t.value=Number(t.value||1)),"maxScan"===t.prop&&(t.value=Number(t.value||7)),"timezone"===t.prop&&("string"==typeof e._value||e._value instanceof Date)&&(e.props.offset=ro(e._value,t.value)),o(t)))),e.props._isFocused=!1,e.props._isPlaceholder=!1,null!==(t=(f=e.props).valueFormat)&&void 0!==t||(f.valueFormat="ISO8601"),null!==(o=(h=e.props).weekdayFormat)&&void 0!==o||(h.weekdayFormat="d"),null!==(r=(v=e.props).monthFormat)&&void 0!==r||(v.monthFormat="MMM"),null!==(s=(m=e.props).monthButtonFormat)&&void 0!==s||(m.monthButtonFormat="MMMM"),null!==(a=(g=e.props).dayButtonFormat)&&void 0!==a||(g.dayButtonFormat="D"),null!==(l=($=e.props).dateFormat)&&void 0!==l||($.dateFormat="D"),null!==(i=(b=e.props).yearFormat)&&void 0!==i||(b.yearFormat="YYYY"),null!==(p=(y=e.props).paginatedPanels)&&void 0!==p||(y.paginatedPanels=["day","year"]),null!==(d=(x=e.props).valueLocale)&&void 0!==d||(x.valueLocale=e.props.locale),null!==(c=(w=e.props).format)&&void 0!==c||(w.format="long"),e.props.panels=_o(e),e.props.pickerOnly=dn.undefine(e.props.pickerOnly),"disabled"in e.props&&(e.props.disabled=dn.undefine(e.props.disabled)),"clearable"in e.props&&(e.props.clearable=dn.undefine(e.props.clearable)),null!==(u=(_=e.props).maxScan)&&void 0!==u||(_.maxScan=7),e.props._isDisabled="function"==typeof e.props.disabledDays?e.props.disabledDays.bind(null,e):Io.bind(null,e),function(e){const t=e._value;let o=new Date;if(t instanceof Date)o=Yt(t);else if("string"==typeof t)try{o=Yt(ho(t,e.props.valueFormat,e.props.valueLocale))}catch{console.warn(`Date (${t}) does not match format (${po(e.props.valueFormat,e.props.valueLocale)})`),o=void 0}else t||(o=void 0);if(e.props.offset=e.props.timezone?ro(o||new Date,e.props.timezone):"+0000",e.props.minDate){const t="string"==typeof e.props.minDate?ho(e.props.minDate):e.props.minDate;e.props.minDate=lo(t,e.props.offset)}if(e.props.maxDate){const t="string"==typeof e.props.maxDate?ho(e.props.maxDate):e.props.maxDate;e.props.maxDate=lo(t,e.props.offset)}o=o&&lo(o,e.props.offset),o&&ko(e,o,!1);let n=o||new Date;n=e.props.minDate>n?e.props.minDate:n,e.props.renderedDate=n,e.props.activeDate=n,e.props.localTime=o&&io(o,"HH:mm")||"12:00"}(e),e.props.calendar=[],e.props.inputText="",e.props.showMonths=e.props.showMonths||1,"function"==typeof e.props.format?(e.props.formatDate=e.props.format,e.props.format=null):e.props.formatDate=io,e.on("created",(()=>{if(dn.whenAvailable(`${e.props.id}`,Lo.bind(null,e),e.props.__root),e.context){let t;e.context.fns.format=(t,o)=>io(t,o,e.props.locale||"en",!1,$o),e.context.fns.isDisabled=e.props._isDisabled,e.context.fns.isDisabledMonth=t=>!uo(t,(t=>!e.props._isDisabled(t)),"month"),e.context.fns.isDisabledYear=t=>!uo(t,(t=>!e.props._isDisabled(t)),"year"),e.context.fns.isSelected=t=>{var o;const n=null===(o=e.context)||void 0===o?void 0:o.value;if(null==n)return;return mo(t,lo(n instanceof Date?n:ho(n,e.props.valueFormat,e.props.valueLocale),e.props.offset))},e.context.handlers._blur=t=>{var o,n;e.props._isFocused=!1,"function"==typeof(null===(o=e.context)||void 0===o?void 0:o.handlers.blur)&&(null===(n=e.context)||void 0===n||n.handlers.blur(t))},e.context.handlers.closePanel=()=>{e.props.expanded=!1},e.context.handlers._blurOut=t=>o=>{var n;o.preventDefault(),t&&t!==e.props.panel||e.props.pickerOnly&&o.relatedTarget instanceof Element&&(o.relatedTarget===document.getElementById(`${e.props.id}_inner`)||o.relatedTarget.closest(`#${e.props.id}_inner`))||o.relatedTarget&&o.relatedTarget instanceof Element&&(o.relatedTarget.closest(`#${e.props.id}_popover`)||!(null===(n=e.props.__root)||void 0===n?void 0:n.contains(o.relatedTarget))||o.relatedTarget.id===`${e.props.id}_popover`)||(e.props.expanded=!1)},e.context.handlers.overlayClick=()=>{const t=ci.get(e);t&&(t.focus(),e.props._isPlaceholder=!1)},e.context.handlers.focus=()=>{e.props.pickerOnly||(e.props._isFocused=!0,e.props.pickerOnly&&!pi.has(e)&&(di.add(e),e.props.expanded=!0,setTimeout((()=>di.delete(e)),200)))},e.context.handlers.clear=()=>{var t,o;ko(e,void 0,!0),wo(e,void 0);const n=null===(o=null===(t=e.props)||void 0===t?void 0:t.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);n instanceof HTMLInputElement&&(n.focus(),setTimeout((()=>{n.setSelectionRange(0,0)}),50))},e.context.handlers.dateInput=t=>{var o;if(fi.has(e))return fi.delete(e);if(t.target instanceof HTMLInputElement&&!e.props.expanded)try{let n=ho({date:t.target.value,format:e.props.format,locale:e.props.locale,partFilter:$o});if(function(e){return so(e.props.format,e.props.locale).some((e=>"weekday"===e.partName))}(e)&&e.props.activeDate instanceof Date&&e.props.activeDate.getTime()===n.getTime()&&!Rl.get(t.target)&&io(n,e.props.format,e.props.locale,!1,$o)!==t.target.value){const r=fo("dddd",e.props.locale),s=so(e.props.format,e.props.locale),a=null===(o=vo(t.target.value,s).find((e=>"dddd"===e.token)))||void 0===o?void 0:o.value,l=io(n,"dddd",e.props.locale);if(a&&r.includes(a)&&l!==a){let t=r.indexOf(a)-r.indexOf(l);t=t<-1?7+t:t,n=qt(n,t),ii.add(e)}}ko(e,n)}catch(t){ko(e,void 0)}},e.context.handlers.open=()=>{e.props.expanded=!0},e.context.handlers.next=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=Zt(e.props.renderedDate,10));case"day":return void(e.props.renderedDate=jt(e.props.renderedDate,1))}},e.context.handlers.prev=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=Zt(e.props.renderedDate,-10));case"day":return void(e.props.renderedDate=jt(e.props.renderedDate,-1))}},e.context.handlers.setDate=t=>()=>{var o;"month"!==e.props.panel&&"year"!==e.props.panel||!e.props.activeDate||(t=e.props.activeDate),(null===(o=e.context)||void 0===o?void 0:o.fns.isDisabled(t))||e.emit("dateSelected",t)},e.context.handlers.localTime=t=>{const o=t.target;if(!o.value)return;const[n,r]=o.value.split(":");e.props.localTime=o.value,e.props.activeDate.setHours(n,r),wo(e,e.props.activeDate)},e.context.handlers.keyDown=t=>{switch(e.props.panel){case"day":return e.emit("calendarKeydown",t);case"year":return e.emit("yearKeydown",t);case"month":return e.emit("monthKeydown",t);case"time":return e.emit("timeKeydown",t);default:return}},e.context.handlers.inputKeydown=t=>{e.emit("keydown",t)},e.context.handlers.openKeydown=t=>{"Enter"!==t.key&&"Space"!==t.key||(e.props.expanded=!0)},e.context.handlers.mouseEnter=o=>n=>{clearTimeout(t),n.target instanceof HTMLElement&&"-1"===n.target.getAttribute("tabindex")&&"true"!==n.target.getAttribute("data-is-extra")&&("month"===e.props.panel||"year"===e.props.panel?e.props.activeDate=uo(o,(t=>!e.props._isDisabled(t)),e.props.panel):e.props.activeDate=o)},e.context.handlers.mouseLeave=()=>{clearTimeout(t),t=setTimeout((()=>{}),100)},e.context.handlers.jumpTo=t=>()=>{e.props.panels.unshift(e.props.panel),e.props.panel=t},e.context.fns.sameDay=t=>{var o;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&mo(t,e.context.activeDate)},e.context.fns.sameMonth=t=>{var o;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&t.getMonth()===e.context.activeDate.getMonth()},e.context.fns.sameYear=t=>{var o,n;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&t.getFullYear()===(null===(n=e.context)||void 0===n?void 0:n.activeDate.getFullYear())},e.context.fns.notInMonth=(e,t)=>{const o=function(e){const t=Yt(e);return t.setHours(0,0,0),t}(t).getTime();return o<co(e).getTime()||o>Ut(e).getTime()||void 0}}}));const k=xo.bind(null,e);e.on("prop:panel",(({payload:t})=>{e.props.showPagination=e.props.paginatedPanels.includes(t)})),e.on("dateSelected",(({payload:t})=>{var o,n;t&&e.props._isDisabled(t)||(Array.isArray(e.props.panels)&&e.props.panels.length?e.props.panel=e.props.panels.shift():(e.props.expanded=!1,null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus()),ko(e,t))})),e.on("input",(({payload:t})=>{if(void 0===t&&!e.props._isFocused)return void wo(e,void 0);const o=new Date,n=t?wo(e,lo("string"==typeof t?ho(t,e.props.valueFormat,e.props.valueLocale):t,e.props.offset)):o;e.props.activeDate=!t&&e.props.activeDate?e.props.activeDate:n,e.props.renderedDate=!t&&e.props.renderedDate?e.props.renderedDate:n,e.props.localTime=io(n,"HH:mm"),function(e){const t=ui.get(e);if(e._value&&t){const o=zt(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))}}(e)})),e.on("prop:renderedDate",yo.bind(null,e)),e.on("prop:expanded",(({payload:t})=>{if(t){if(hi.delete(e),e.props.panels=_o(e),e.props.panel=e.props.panels.shift(),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?e.props.showPanelClose=!0:e.props.showPanelClose=!1,"day"===e.props.panel){const t=e.props.activeDate;e.props.activeDate=uo(e.props.activeDate,(t=>!e.props._isDisabled(t)),"month")||t}yo(e),dn.whenAvailable(`${e.props.id}_popover`,(t=>{const o=t.querySelector('[tabindex="0"]');o&&setTimeout((()=>{o.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())}))}(e,t)}),0)}),e.props.__root),li&&setTimeout((()=>{document.addEventListener("click",k)}),10)}else{if("time"===e.props.panel)e.emit("dateSelected",e.props.activeDate);else if(e._value){fi.add(e);const t="string"==typeof e._value?ho(e._value,e.props.valueFormat,e.props.valueLocale):e._value;wo(e,lo(t,e.props.offset))}else wo(e,void 0);li&&(pi.add(e),document.removeEventListener("click",k),setTimeout((()=>pi.delete(e)),50))}})),e.on("prop:activeDate",(({payload:t})=>{if(Array.isArray(e.props.calendar)&&e.props.calendar.length)if("day"===e.props.panel){const o=e.props.calendar,n=co(e.props.renderedDate),r=Ut(jt(e.props.renderedDate,o.length-1));t.getTime()<n.getTime()?e.props.renderedDate=jt(e.props.renderedDate,-1):t.getTime()>r.getTime()&&(e.props.renderedDate=jt(e.props.renderedDate))}else if("year"===e.props.panel){const t=e.props.years,o=t[0].getFullYear(),n=t[t.length-1].getFullYear(),r=e.props.activeDate.getFullYear();r>n?e.props.renderedDate=Zt(e.props.renderedDate,10):r<o&&(e.props.renderedDate=Zt(e.props.renderedDate,-10))}e.props.expanded&&wo(e,e.props.activeDate)})),e.on("keydown",(({payload:t})=>{switch(t.key){case"ArrowDown":case"ArrowUp":case" ":t.preventDefault(),e.props.pickerOnly&&(e.props.expanded=!0);break;case"Enter":case"Return":e.props.expanded||(e.props.expanded=!0);break;case"Escape":e.props.expanded=!1}})),e.on("calendarKeydown",(({payload:t})=>{t.preventDefault();let o=null,r=0;switch(t.key){case"ArrowRight":r=1;break;case"ArrowLeft":r=-1;break;case"ArrowDown":r=7;break;case"ArrowUp":r=-7;break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Tab":t.shiftKey||So(e,t);break;case"Escape":e.props.expanded=!1}if(r&&(t.preventDefault(),o=qt(e.props.activeDate,r)),o&&!e.props._isDisabled(o))e.props.activeDate=o;else if(o&&e.props._isDisabled(o)){const t=r>0?1:-1;n(Number(e.props.maxScan),(e=>t*e)).some((t=>{const n=qt(o,t);return!e.props._isDisabled(n)&&(e.props.activeDate=n,!0)}))}})),e.on("yearKeydown",(({payload:t})=>{let o=0;switch(t.key){case"ArrowDown":o=5;break;case"ArrowRight":o=1;break;case"ArrowUp":o=-5;break;case"ArrowLeft":o=-1;break;case"Tab":t.shiftKey||So(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}const n=e.props.activeDate.getFullYear()+o-e.props.renderedDate.getFullYear();e.props.activeDate=Zt(e.props.renderedDate,n)})),e.on("monthKeydown",(({payload:t})=>{let o=0;switch(t.key){case"ArrowDown":o=3;break;case"ArrowRight":o=1;break;case"ArrowLeft":o=-1;break;case"ArrowUp":o=-3;break;case"Tab":t.shiftKey||So(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}o&&t.preventDefault();let n=(e.props.activeDate.getMonth()+o)%12;n=n<0?12+n:n;const r=n-e.props.renderedDate.getMonth();let s=jt(e.props.renderedDate,r);if(e.props._isDisabled(s)){const t=uo(s,(t=>!e.props._isDisabled(t)),"month");t&&(s=t)}e.props.activeDate=s})),e.on("timeKeydown",(({payload:t})=>{switch(t.key){case"Return":case"Enter":t.preventDefault(),e.emit("dateSelected",e.props.activeDate)}})),e.on("prop:_isFocused",(()=>{ci.get(e)&&Do(e)})),e.on("commit",(()=>{if(e.props.activeDate&&e.props._isDisabled(e.props.activeDate)){const t=cn.createMessage({blocking:!0,key:"rule_invalidDate",meta:{messageKey:"invalidDate",removeImmediately:!1,localize:!0,i18nArgs:[{node:e,name:Co(e),args:[]}]},type:"validation",value:"The selected date is invalid."});e.store.set(t)}else e.store.remove("rule_invalidDate")}))},$e,un.localize("next"),un.localize("prev"),un.localize("changeDate"),un.localize("chooseDate"),un.defaultIcon("close","close"),un.defaultIcon("next","right"),un.defaultIcon("clear","close"),un.defaultIcon("prev","left"),un.defaultIcon("calendar","date")]},$i=a("tl"),{outer:bi,wrapper:yi,inner:xi,icon:wi,label:_i,prefix:ki,suffix:Si,help:Li,messages:Di,message:Ai}=l($i),Ii=$i("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"}}))),Ci=$i("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'}}))),Mi=$i("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)"}}))),Ti=$i("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),Ei=$i("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)",onTouchstart:"$handlers.removeSelection && $handlers.removeSelection($option)","aria-controls":"$id"}}))),Oi=$i("tagLabel",(()=>({$el:"span"}))),Fi=$i("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite"}}))),Vi=$i("tagLoading","span"),Bi=d($i),Pi={schema:bi(yi(_i("$label"),xi(wi("prefix"),ki(),Fi(Mi(Ti(p("$state.loading && $fns.hasOptionLoaderValue && $fns.hasOptionLoaderValue($option) || $option.label === undefined",Vi("$ui.isLoading.value"),Oi("$option.label")),Ei(wi("close")))),Ii()),p("$state.loading",wi("loader")),Ci(wi("select")),Bi(),Si(),wi("suffix"))),Li("$help"),Di(Ai("$message.value"))),type:"input",family:"dropdown",props:[],features:[un.options,U.bind(null,(function(e){e.props.multiple=!0,e.props.openOnClick=dn.undefine(e.props.openOnClick),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),e.props.closeOnSelect?e.props.resetSearchOnCommit=!1:void 0===e.props.resetSearchOnCommit&&(e.props.resetSearchOnCommit=e.props.multiple),e.props.allowNewValues=dn.undefine(e.props.allowNewValues)}),Fe,(function(e){qe(e),ve(e),e.on("created",(()=>{function t(){return Array.isArray(e.value)?e.value:[]}function o(t){e.input(t)}e.props.disabled&&(e.props.draggable=!1),dn.whenAvailable(`${e.props.id}_selections`,(n=>{if(n instanceof HTMLElement){if(!e.context)return;const r={draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,disabled:!e.props.draggable,threshold:{horizontal:.25,vertical:0},plugins:[fn.animations()],root:e.props.__root,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag"),handleEnd(t){e.props.activeSelectionValue=void 0,fn.handleEnd(t)},handleDragstart(t){e.props.activeSelectionValue=void 0,fn.handleDragstart(t)},handleTouchstart(t){e.props.activeSelectionValue=void 0,fn.handleTouchstart(t)}};fn.dragAndDrop({parent:n,getValues:t,setValues:o,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,fn.dragAndDrop({parent:n,getValues:t,setValues:o,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,fn.dragAndDrop({parent:n,getValues:t,setValues:o,config:r})}))}}),e.props.__root)}))})),un.defaultIcon("select","select"),un.defaultIcon("close","close"),un.defaultIcon("selected","check"),un.defaultIcon("loader","spinner"),un.localize("isLoading"),un.localize("loadMore"),un.localize("remove"),un.localize("open"),un.localize("close"),$e]},Hi=a("mk"),{outer:Ni,wrapper:Ri,inner:Ki,label:Wi,prefix:Yi,suffix:qi,help:Ui,messages:zi,message:ji,icon:Zi}=l(Hi),{overlayPlaceholder:Gi,overlayLiteral:Xi,overlayChar:Ji,overlayEnum:Qi,overlay:ep,overlayParts:tp,overlayInner:op}=i(Hi),np=Hi("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"$type",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",onInput:"$handlers.DOMInput",value:"$_maskValue",placeholder:"$placeholder",id:"$id","aria-describedby":"$describedBy"}}))),rp=new WeakMap,sp=new WeakMap,ap=new WeakMap,lp={schema:Ni(Ri(Wi("$label"),Ki(Zi("prefix"),Yi(),ep(op(tp(Gi("$part.value"),Xi("$part.value"),Ji("$part.value"),Qi("$part.value")))),np(),qi(),Zi("suffix"))),Ui("$help"),zi(ji("$message.value"))),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse","overlay"],family:"text",features:[To,function(e){e.addProps(["_maskValue","_overlayParts"]),e.on("created",(()=>{var t,o,n,r,s;const a=Xe("string"==typeof e._value?e._value:"");sp.set(e,a),ap.set(e,a),e.props.allowIncomplete=dn.undefine(e.props.allowIncomplete),e.props.overlay=dn.undefine(e.props.overlay);const l=!(void 0!==e.props.showMask&&!dn.undefine(e.props.showMask));e.props.unmaskValue=dn.undefine(e.props.unmaskValue),e.hook.prop(((e,t)=>("unmaskValue"===e.prop&&(e.value=dn.undefine(e)),t(e))));const i={placeholder:l,pattern:null!==(t=e.props.mask)&&void 0!==t?t:"",mode:null!==(o=e.props.mode)&&void 0!==o?o:"shift",partOverrides:null!==(n=e.props.tokens)&&void 0!==n?n:{},prefix:null!==(r=e.props.prefix)&&void 0!==r?r:void 0,suffix:null!==(s=e.props.suffix)&&void 0!==s?s:void 0,reverse:dn.undefine(e.props.reverse)};rp.set(e,i),e.hook.input(((t,o)=>{const n=function(e,t){const o=sp.get(e),n="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:n?t.maskValue:"";const r=ap.get(e);r.value=lt(r,t);const s=Ge(r,rp.get(e)),a=Nt(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=u(Rt(r)||[]));return null===a?"":e.props.unmaskValue?a:s}(e,t);return o(n)})),e.props._maskValue=Ge(a,i),e.input(e.props._maskValue,!1),e.context&&(e.context.handlers.DOMInput=t=>{e.emit("dom-input-event",t)}),dn.whenAvailable(`${e.props.id}`,Eo.bind(null,e),e.props.__root)}))}]},ip=a("tf"),{outer:pp,wrapper:dp,inner:cp,icon:up,prefix:fp,suffix:hp,help:vp,messages:mp,message:gp}=l(ip),$p=ip("fieldset",(()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}}))),bp=ip("legend",(()=>({if:"$label",$el:"legend"}))),yp=ip("source",(()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}}))),xp=ip("sourceHeader",(()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}}))),wp=ip("sourceHeaderLabel",(()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"}))),_p=ip("sourceHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_source_header_item_count"',role:"presentation","aria-label":'$sourceOptions.length " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.sourceHeaderItemCount'}}))),kp=ip("targetHeaderLabel",(()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"}))),Sp=ip("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"}))),Lp=ip("sourceControls",(()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}}))),Dp=ip("sourceSearch",(()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}}))),Ap=ip("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"}}))),Ip=ip("sourceSearchClear",(()=>({$el:"button",if:'$inputText !== ""',attrs:{id:'$id + "_source_search_clear"',type:"button",onClick:"$handlers.clearSearch","aria-label":"Clear search",class:'$classes.transferlistSearchClear + " " + $classes.sourceSearchClear'}}))),Cp=ip("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"}}))),Mp=ip("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)",onTouchstart:"$handlers.listitemTouchstart($option, true)",onTouchmove:"$handlers.listitemTouchmove($option, true)",onTouchend:"$handlers.listitemTouchend($option, true)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.sourceListItem'}}))),Tp=ip("sourceOption",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option, $selectedSourceItems)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}}))),Ep=ip("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"}}))),Op=ip("loadMoreInner","span"),Fp=ip("target",(()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}}))),Vp=ip("targetHeader",(()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}}))),Bp=ip("targetListItems",(()=>({$el:"ul",attrs:{id:"$id","aria-activedescendant":"$activeDescendant",onMouseenter:"$handlers.onMouseenter(false)",onMouseout:"$handlers.onMouseleave(false)",class:'$classes.transferlistListItems + " " + $classes.targetListItems',tabindex:"$targetOptions.length === 0 && -1 || 0",onKeydown:"$handlers.targetListKeydown",onFocus:"$handlers.targetListFocused",onBlur:"$handlers.targetListBlurred"}}))),Pp=ip("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)",onTouchstart:"$handlers.listitemTouchstart($option, false)",onTouchmove:"$handlers.listitemTouchmove($option, false)",onTouchend:"$handlers.listitemTouchend($option, false)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.targetListItem'}}))),Hp=ip("targetOption",(()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index + "_option"',"data-checked":"$fns.isSelected($option, $selectedTargetItems)",class:'$classes.transferlistOption + " " + $classes.targetOption'}}))),Np=ip("transferControls",(()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}}))),Rp=ip("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'}}))),Kp=ip("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'}}))),Wp=ip("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'}}))),Yp=ip("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'}}))),qp=ip("controlLabel","span"),Up=ip("sourceEmptyMessage",(()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}}))),zp=ip("targetEmptyMessage",(()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),jp=ip("emptyMessageInner","span"),Zp=Symbol(),Gp=new WeakSet,Xp=new WeakSet,Jp={schema:pp($p(bp("$label"),vp("$help"),dp(yp(xp(wp(),_p(p("$optionsLoadingCounter > 0",up("loader"),"$fns.getSourceItemCount($selectedSourceItems)"))),Lp(Dp(Ap(),Ip(up("close")))),Cp(Up(jp("$sourceEmptyMessage")),Mp(p("$transferOnSelect !== true && $fns.isSelected($option, $selectedSourceItems)",up("selected")),Tp("$option.label")),Ep(p("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",Op(p("$state.loading",up("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),Np(Kp(qp("$ui.addAllValues.value"),up("fastForward")),Rp(qp("$ui.addSelectedValues.value"),up("moveRight")),Wp(qp("$ui.removeSelectedValues.value"),up("moveLeft")),Yp(qp("$ui.removeAllValues.value"),up("rewind"))),Fp(Vp(kp(),Sp("$fns.getTargetItemCount($selectedTargetItems)")),Bp(zp(p("$state.loading !== true",jp("$targetEmptyMessage"))),Pp(p("$transferOnSelect !== true && $fns.isSelected($option, $selectedTargetItems)",up("selected")),Hp(p("$fns.optionLoading($option, $optionLoaderValues)","$ui.isLoading.value","$option.label")))))),mp(gp("$message.value")))),type:"input",props:[],features:[un.defaultIcon("moveRight","right"),un.defaultIcon("moveLeft","left"),un.defaultIcon("fastForward","fastForward"),un.defaultIcon("rewind","rewind"),un.defaultIcon("close","close"),un.defaultIcon("loader","spinner"),un.defaultIcon("selected","check"),un.localize("isLoading"),un.localize("loadMore"),un.localize("addAllValues"),un.localize("addSelectedValues"),un.localize("removeSelectedValues"),un.localize("removeAllValues"),un.options,function(e){!function(e){e.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"]),e.props.loadMoreOption={label:"Load more",value:Zp},void 0===e.props.draggable?e.props.draggable=!0:"false"===e.props.draggable&&(e.props.draggable=!1),e.props.optionsLoaderValues=[],e.props.selectedSourceItems=[],e.props.selectedTargetItems=[],e.props.optionsLoaded=void 0,e.props.memoOptions=[],e.props.multiple=!0,e.props.debounce=e.props.debounce?parseInt(e.props.debounce):200,e.props.optionLoaderValues=[],e.props.optionsLoadingCounter=0,e.props.optionLoadingCounter=0,e.props.page=1,e.props.hasNextPage=y.bind(null,e),e.props.options?e.props.options=[...e.props.options]:e.props.options=[],e.props.sourceOptions=[],e.props.targetOptions=[],"disabled"in e.props&&(e.props.disabled=dn.undefine(e.props.disabled)),e.props.searchable=dn.undefine(e.props.searchable),e.props.searchable&&(e.props.inputText=""),e.props.clearOnSelect=dn.undefine(e.props.clearOnSelect),void 0===e.props.transferOnSelect?e.props.transferOnSelect=!0:"false"===e.props.transferOnSelect&&(e.props.transferOnSelect=!1),e.props.targetOptions.length&&(e.props.targetOptionValues=e.props.targetOptions.map((e=>h(e)))),e.props.initialOptions=[...e.props.options],e.props.max&&(e.props.max=parseInt(e.props.max)),e.props.sourceListOrigin=void 0,"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase()))}(e),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?(v(e,e.props.inputText),e.props.reFilter=!1):e.props.initialLoad||(e.isCreated||(e.props.skipSetActiveValue=!0),Po(e)),"function"==typeof e.props.optionLoader?No(e):e.props.initialLoad||(e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])])}))}(e),qo(e),function(e){e.on("prop:options",(()=>{e.props.appendingOptions&&(e.props.skipSetActiveValue=!0,e.props.appendingOptions=!1),Po(e)})),e.on("prop:memoOptions",(()=>{e.props.skipSetActiveValue=!0,Po(e)})),e.on("prop:sourceOptions",(()=>{0===e.props.sourceOptions.length?e.props.showSourceEmptyMessage=!0:e.props.showSourceEmptyMessage=!1,Gp.delete(e)})),e.on("prop:targetOptions",(()=>{0===e.props.targetOptions.length?e.props.showTargetEmptyMessage=!0:e.props.showTargetEmptyMessage=!1})),e.on("prop:activeValue",(({payload:t})=>{if(e.props.isDragging)return void(e.props.activeDescendant=void 0);if(t===Zp)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=(e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions).findIndex((e=>dn.eq(h(e),t)));o>=0&&e.props.sourceListOrigin?e.props.activeDescendant=`${e.props.id}_source_list_item_${o}`:e.props.activeDescendant=o>=0?`${e.props.id}_target_list_item_${o}`:void 0})),e.on("prop:mouseOnSource",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled&&!e.props.isDragging){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_source_list_items");if(!t)return;e.props.mouseOnTarget=!1,e.props.sourceListOrigin=!0,Gp.delete(e),Uo(e,t)}})),e.on("prop:mouseOnTarget",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled&&!e.props.isDragging){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;e.props.mouseOnSource=!1,e.props.sourceListOrigin=!1,Xp.delete(e),Uo(e,t)}})),e.on("prop:optionsLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionLoadingCounter&&e.store.set(Sr)})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&(e.store.set(Sr),e.props.skipSetActiveValue=!0,Po(e))}))}(e)}]},Qp=a("sl"),{outer:ed,wrapper:td,inner:od,icon:nd,label:rd,prefix:sd,suffix:ad,help:ld,messages:id,message:pd}=l(Qp),dd=Qp("chart",(()=>({$el:"div",if:"$chart"}))),cd=Qp("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 + "%"'}}}}))),ud=Qp("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),fd=Qp("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),hd=Qp("trackWrapper",(()=>({$el:"div"}))),vd=Qp("trackInner",(()=>({$el:"div"}))),md=Qp("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),gd=Qp("linkedValues",(()=>({$el:"div"}))),$d=Qp("maxValue",(()=>({$formkit:"number",bind:"$computedMaxInputAttrs",ignore:!0,value:{if:"$isMulti",then:"$_value.1",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.maxNode",onBlur:"$handlers.inputBlur"}))),bd=Qp("minValue",(()=>({$formkit:"number",if:"$isMulti",bind:"$computedMinInputAttrs",ignore:!0,value:{if:"$isMulti",then:"$_value.0",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.minNode",onBlur:"$handlers.inputBlur"}))),yd=Qp("marks",(()=>({$el:"div",if:"$marks"}))),xd=Qp("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) + "%"'}}}))),wd=Qp("markLabel",(()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}}))),_d=Qp("handles",(()=>({$el:"ul"}))),kd=Qp("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",onTouchstart:"$handlers.startDrag",style:"$maxHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Sd=Qp("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",onTouchstart:"$handlers.startDrag",style:"$minHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Ld=Qp("handleMinInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}}))),Dd=Qp("handleMaxInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}}))),Ad=Qp("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"}}))),Id=Qp("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"}}))),Cd={schema:ed(td(rd("$label"),ld("$help"),ud(nd("prefix"),sd(),fd(dd(cd()),hd(vd(md(),yd(xd(wd())),_d(Sd(Id(),Ld()),kd(Ad(),Dd()))))),ad(),nd("suffix"),p("$showInput && $isMulti === false",$d())),p("$showInput && $isMulti",gd(bd(),$d())),id(pd("$message.value")))),type:"input",family:"",props:["min","max","step","showInput","tooltip","tooltipFormat","inputAttrs","maxInputAttrs","minInputAttrs","marks","markLabels","snapToMarks","chart","scalingFunction","intervals"],features:[function(e){function t(t){const{min:o,max:r,intervals:s}=e.props;if(t=Math.min(Math.max(t,0),100),!s||0===s.length){u();const n=o+t/100*(r-o);return e.props.scalingFunction.reverse(n,o,r)}const a=n(s,o,r);for(let e=0;e<a.length;e++){const{value:o,step:n,left:r,width:s,stepsInInterval:l}=a[e];if(t>=r&&t<=r+s){const e=o+(t-r)/s*l*n,a=e%n;return p(a<n/2?e-a:e+(n-a))}}return t>100?r:t<0?o:void 0}function o(t,o=e.props.min,r=e.props.max){const s=e.props.intervals;if(!s||0===s.length){u();return(e.props.scalingFunction.forward(t,o,r)-o)/(r-o)*100}const a=n(s,o,r);for(let e=0;e<a.length;e++){const{value:o,step:n,left:s,width:l,stepsInInterval:i}=a[e],p=e<a.length-1?a[e+1].value:r;if(t>=o&&t<=p){return 100*((s+(t-o)/n/i*l)/100)}}return 100}function n(t,o=e.props.min,n=e.props.max){(t=[...t]).sort(((e,t)=>e.value-t.value)),t[0].value!==o&&t.unshift({value:o,step:e.props.step});let r=0;for(let e=0;e<t.length;e++){const o=t[e].value,s=((e<t.length-1?t[e+1].value:n)-o)/t[e].step;r+=s}let s=0;return t.map(((e,o)=>{const a=e.value,l=((o<t.length-1?t[o+1].value:n)-a)/e.step,i=s/r*100;return s+=l,{value:e.value,step:e.step,left:i,width:l/r*100,stepsInInterval:l,totalSteps:r}}))}function r(){const t=parseFloat(`${e.props.min}`),n=parseFloat(`${e.props.max}`);let r,a=0;if(Array.isArray(e._value)){const t=[...e._value].sort(s);a=parseFloat(`${t[0]}`),r=parseFloat(`${t[1]}`)}else r=parseFloat(`${e._value}`);e.props.maxHandleStyles={left:`${o(r,t,n)}%`},e.props.isMulti&&Array.isArray(e._value)?(e.props.minHandleStyles={left:`${o(a,t,n)}%`},e.props.fillStyles={left:`${o(a,t,n)}%`,width:o(r,t,n)-o(a,t,n)+"%"}):e.props.fillStyles={left:"0%",width:`${o(r,t,n)}%`}}function s(e,t){return parseFloat(`${e}`)-parseFloat(`${t}`)}function a(t,o=!0){if(e.props.disabled)return;let n;if(void 0===t){if(e.props.isMulti)e.input([e.props.min,e.props.max]);else{const t=e.props.min+(e.props.max-e.props.min)/2;e.input(t)}return r(),void l()}if(e.props.isMulti&&Array.isArray(e._value)&&!Array.isArray(t)){const o="min"===e.props.lastHandleInteraction?0:1;e._value[o]=t;const[r,a]=[...e._value];if(r>=a){const t=null==f?void 0:f.querySelector(`[data-handle="${"min"===e.props.lastHandleInteraction?"max":"min"}"]`);null==t||t.focus()}n=d([...e._value].sort(s))}else Array.isArray(t)?n=d(t):(n=d(t),n=isNaN(n)?e.props.min:n);e.props.snapToMarks&&(n=c(n));const a=i(n);o&&e.input(a),r(),l()}function l(){if(e.props.isMulti&&Array.isArray(e._value)){const[t,o]=[...e._value];h&&h.input(t),v&&v.input(o)}else v&&v.input(e._value)}function i(t){return e.props.isMulti&&Array.isArray(t)?[i(t[0]),i(t[1])]:(t=isNaN(t)?e.props.min:t,Math.min(Math.max(parseFloat(`${t}`),e.props.min),e.props.max))}function p(t){return parseFloat(t.toFixed(e.props.decimals))}function d(t){if(e.props.snapToMarks)return t;if(!e.props.intervals)return Array.isArray(t)?t.map((t=>p(Math.round(t/e.props.step)*e.props.step))):p(Math.round(t/e.props.step)*e.props.step);const o=n(e.props.intervals);if(Array.isArray(t))return t.map((t=>{const n=o.find(((n,r)=>{var s;return t>=n.value&&t<((null===(s=o[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!n)return t;return p(n.value+Math.round((t-n.value)/n.step)*n.step)}));{const n=o.find(((n,r)=>{var s;return t>=n.value&&t<((null===(s=o[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!n)return t;return p(n.value+Math.round((t-n.value)/n.step)*n.step)}}function c(t){if(Array.isArray(t))return t[0]=c(t[0]),t[1]=c(t[1]),t;{const o=e.props.marks,n=o.reduce(((e,o)=>Math.abs(o.at-t)<Math.abs(e.at-t)?o:e),o[0]);return n.at}}function u(){if(g)return;dn.undefine(e.props.scalingFunction)?"string"==typeof e.props.scalingFunction?e.props.scalingFunction=m[e.props.scalingFunction]||m.linear:"object"==typeof e.props.scalingFunction&&(e.props.scalingFunction={...m.linear,...e.props.scalingFunction}):e.props.scalingFunction=m.linear,g=!0}let f,h,v;e.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]);const m={linear:{forward:e=>e,reverse:e=>e},log:{forward:(t,o=e.props.min,n=e.props.max)=>n*Math.pow(t/n,1.5),reverse:(t,o=e.props.min,n=e.props.max)=>n*Math.pow(t/n,1/1.5)}};let g=!1;e.props.maxHandleStyles={left:"0%"},e.props.fillStyles={left:"0%",width:"0%"},e.props.isMulti=!1,e.props.step=1,e.props.min=0,e.props.max=100,e.props.tooltipFormat="function"==typeof e.props.tooltipFormat?e.props.tooltipFormat:(e,t)=>{if(t)return e},e.props.largestBar=0,"disabled"in e.props&&(e.props.disabled=dn.undefine(e.props.disabled)),e.on("created",(()=>{function l(o){var n;if(!f||!e.props.dragging)return;o.preventDefault();const r=o.clientX||(null===(n=o.touches)||void 0===n?void 0:n.length)&&o.touches[0].clientX,{left:s,width:l}=f.getBoundingClientRect();a(t((r-s)/l*100))}var p;u(),e.props.isMulti=Array.isArray(e.value),e.props.step=parseFloat(`${e.props.step}`),e.props.decimals=(null===(p=e.props.step.toString().split(".")[1])||void 0===p?void 0:p.length)||0,e.props.min=parseFloat(`${e.props.min}`),e.props.max=parseFloat(`${e.props.max}`);const d=dn.undefine(e.props.tooltip);e.props.tooltip=void 0===e.props.tooltip?"auto":d;const m=dn.undefine(e.props.marks);e.props.marks=!!m&&(Array.isArray(e.props.marks)?e.props.marks:function(){const{min:t,max:o,step:n}=e.props,r=[];for(let e=t;e<=o;e+=n)r.push({at:e,label:e});return r}()),e.props.markLabels=dn.undefine(e.props.markLabels),e.props.snapToMarks=dn.undefine(e.props.snapToMarks),e.props.showInput=dn.undefine(e.props.showInput),e.props.largestBar=e.props.chart?e.props.chart.reduce(((e,t)=>t.value>e?t.value:e),0):e.props.largestBar;const g={disabled:e.props.disabled,min:e.props.min,max:e.props.max,step:e.props.step};if(e.props.inputAttrs=e.props.inputAttrs&&"object"==typeof e.props.inputAttrs?Object.assign(g,e.props.inputAttrs):g,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,dn.whenAvailable(`track-${e.props.id}`,(()=>{var t;f=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`track-${e.props.id}`),a(e.value,!1),r()}),e.props.__root),e.context){let r=0,p="";const d=e.context.handlers.blur;e.context.handlers.blur=t=>{d(t),e.emit("blur")},e.context.handlers.clickTrack=o=>{if(!f)return;e.props.dragging=!1;const{left:n,width:r}=f.getBoundingClientRect(),s=(o.clientX-n)/r;if(e.props.isMulti&&Array.isArray(e.value)){const[o,n]=e.value,r=Math.abs(o-s*e.props.max)<Math.abs(n-s*e.props.max)?"min":"max",l="min"===r?0:1;e.props.lastHandleInteraction=r,e.value[l]=t(100*s),a(e._value)}else a(t(100*s))},e.context.handlers.focus=t=>{if(!f)return;const o=t.target.dataset.handle;o&&(e.props.lastHandleInteraction=o)},e.context.handlers.clickHandle=t=>{t.stopPropagation(),e.props.attrs.onClick&&e.props.attrs.onClick(t),e.props.dragging=!1,a(e._value)},e.context.handlers.startDrag=t=>{if(!f)return;e.props.dragging=!0;const o="touchstart"===t.type,n=o?"touchmove":"mousemove",r=o?"touchend":"mouseup";e.props.lastHandleInteraction=t.target.dataset.handle||e.props.lastHandleInteraction,document.addEventListener(n,l,{passive:!1}),document.addEventListener(r,(()=>{e.context&&(e.props.dragging=!1,document.removeEventListener(n,l),o&&t.target instanceof HTMLElement&&t.target.blur())}))},e.context.handlers.keydown=t=>{if(["1","2","3","4","5","6","7","8","9","0",".","-"].includes(t.key)){t.preventDefault(),clearTimeout(r),p+=t.key;const e="-"===p?-1:1;r=window.setTimeout((()=>{"-"!==p?(a(parseFloat(p)*e),p=""):p=""}),350)}if(["ArrowLeft","ArrowDown","ArrowRight","ArrowUp","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const o="min"===e.props.lastHandleInteraction?0:1,r=Array.isArray(e._value)?e._value[o]:e._value,s=function(t,o){if(!e.props.intervals)return e.props.step;const r=n(e.props.intervals);if(t>=e.props.max)return r[r.length-1].step;let s=r.find(((o,n)=>{var s;return t>=o.value&&t<((null===(s=r[n+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!s)return e.props.step;-1===o&&t-s.step<s.value&&(s=r[r.indexOf(s)-1]||s);return s.step}(r,["ArrowLeft","ArrowDown","PageDown"].includes(t.key)?-1:1);if(e.props.marks&&e.props.snapToMarks){const o=c(r),n=e.props.marks.find((e=>e.at===o)),s=e.props.marks.indexOf(n),l=["ArrowLeft","ArrowDown"].includes(t.key)?-1:1,i=Math.min(Math.max(0,s+l),e.props.marks.length-1);return void a(e.props.marks[i].at)}if(t.metaKey)return void("ArrowLeft"===t.key||"ArrowDown"===t.key?a(e.props.min):a(e.props.max));if("Home"===t.key)return void a(e.props.min);if("End"===t.key)return void a(e.props.max);if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)){a(r+(t.shiftKey?10*s:s)*(["ArrowLeft","ArrowDown"].includes(t.key)?-1:1))}"PageUp"===t.key?a(r+10*s):"PageDown"===t.key&&a(r-10*s)}},e.context.handlers.maxNode=t=>{v=t,t.hook.commit(((o,n)=>{if(dn.eq(t.value,o))return n(o);const r=parseFloat(o);return e.props.isMulti&&Array.isArray(e.value)?(e.value[1]=r,a(e.value)):a(r),n(i(r))}))},e.context.handlers.minNode=t=>{h=t,t.hook.commit(((o,n)=>{if(dn.eq(t.value,o))return n(o);const r=parseFloat(o);return e.props.isMulti&&Array.isArray(e.value)?(e.value[0]=r,a(e.value)):a(r),n(i(r))}))},e.context.handlers.inputBlur=()=>{e.props.isMulti&&Array.isArray(e.value)&&(e.value.sort(s),h&&h.input(e.value[0]),v&&v.input(e.value[1]))},e.context.fns.calculateMarkPosition=t=>o(t,e.props.min,e.props.max)}a(e.value,!1)})),e.on("input",(({payload:t})=>{Array.isArray(e.value)&&Array.isArray(t)?e.value[0]===t[0]&&e.value[1]===t[1]||a(t,!1):e.value!==t&&a(t,!1)})),e.on("prop:max",(()=>{e.props.max=parseFloat(`${e.props.max}`),a(e.value)})),e.on("prop:min",(()=>{e.props.min=parseFloat(`${e.props.min}`),a(e.value)}))}]},Md=a("cp"),{outer:Td,wrapper:Ed,inner:Od,label:Fd,prefix:Vd,suffix:Bd,help:Pd,messages:Hd,message:Nd,icon:Rd}=l(Md),Kd=Md("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'}}))),Wd=Md("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:""}}}}))),Yd=Md("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"}}}}}))),qd=Md("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"}}))),Ud=Md("controlGroup",(()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}}))),zd=Md("LS",(()=>({$el:"div",attrs:{class:"$classes.LS"}}))),jd=Md("canvasLS",(()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}}))),Zd=Md("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 + "%"'}}))),Gd=Md("hue",(()=>({$el:"div",attrs:{class:"$classes.hue"}}))),Xd=Md("canvasHue",(()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}}))),Jd=Md("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"}}))),Qd=Md("alpha",(()=>({$el:"div",attrs:{class:"$classes.alpha"}}))),ec=Md("canvasAlpha",(()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true"}}))),tc=Md("controlAlpha",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",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)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$hsla.a"}}))),oc=Md("preview",(()=>({$el:"div",attrs:{class:"$classes.preview"}}))),nc=Md("canvasPreview",(()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}}))),rc=Md("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"}}]}))),sc=Md("eyeDropper",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}}))),ac=Md("formatField",(()=>({$el:"div",attrs:{class:"$classes.formatField"}}))),lc=Md("colorInputGroup",(()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}}))),ic=Md("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"}}]}))),pc=Md("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"}}]}))),dc=Md("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"}}]}))),cc=Md("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"}}]}))),uc=Md("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",autocomplete:"off"},"aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$rgba.a"},{$el:"label",children:"A",attrs:{for:'$: "a-" + $id',class:"$classes.fieldLabel"}}]}))),fc=Md("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"}}]}))),hc=Md("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"}}]}))),vc=Md("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"}}]}))),mc=Md("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"}}))),gc=Md("swatches",(()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}}))),$c=Md("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"}}}}))),bc=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,yc=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i,xc={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"},wc={schema:Td(Ed(Fd("$label"),p("$inline && $help",Pd("$help")),Od(p("($inline === undefined || $inline === false) && $prefixIcon !== undefined",Rd("prefix","label")),p("$inline === undefined || $inline === false",Vd()),p("$inline === undefined || $inline === false",Kd(rc(),p("$showValue",Wd()))),p("$inline || $expanded)",Yd(p("$showPanelClose && ($inline === undefined || $inline === false)",qd(Rd("close"))),p("$panelControls",Ud(zd(jd(),Zd()),oc(nc()),Gd(Xd(),Jd()),Qd(ec(),tc()),p("$eyeDropper && $hasNativeEyeDropper",sc(Rd("eyeDropper"))))),p("$panelFormat",ac(lc(p('$panelActiveFormat === "hex"',ic()),p('$panelActiveFormat === "rgba"',pc()),p('$panelActiveFormat === "rgba"',dc()),p('$panelActiveFormat === "rgba"',cc()),p('$panelActiveFormat === "hsla"',fc()),p('$panelActiveFormat === "hsla"',hc()),p('$panelActiveFormat === "hsla"',vc()),p('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',uc())),mc(Rd("switch")))),p("$options",gc($c())))),p("$inline === undefined || $inline === false",Bd()),p("($inline === undefined || $inline === false) && $suffixIcon !== undefined",Rd("suffix"))),p("$: ($inline === undefined || $inline === false) && $help",Pd("$help"))),Hd(Nd("$message.value"))),type:"input",family:"text",props:["disbaled","format","valueFormat","panelControls","panelFormat","eyeDropper","inline","options","showValue","closeOnSelect","allowPaste"],features:[function(e){function t(t){var n,r;if(!e.context||!e.props.allowPaste||e.props.disabled)return;const s=null===(n=e.props.__root)||void 0===n?void 0:n.activeElement;if(k&&k.contains(s)){const n=null===(r=t.clipboardData)||void 0===r?void 0:r.getData("text");if(!n)return;if("INPUT"===s.tagName&&!tn(n)&&!bc.test(n)&&!yc.test(n))return;(tn(n)||n.startsWith("hsl")||n.startsWith("rgb"))&&(e.props.hexInputFocused&&(e.props.hexInputFocused=!1,setTimeout((()=>{e.props.hexInputFocused=!0}),10)),t.preventDefault(),o(n))}}function o(t){var o;if(!t)return;const n=on(t);if(n){const[o,r,s,a]=n;"undefined"!==t&&("number"!=typeof o||isNaN(o)||"number"!=typeof r||isNaN(r)||"number"!=typeof s||isNaN(s)||"number"!=typeof a||isNaN(a)||jo(o,2)===e.props.h&&jo(r,2)===e.props.s&&jo(s,2)===e.props.v&&jo(a,2)===e.props.alpha)||(e.props.alpha=jo(a,2),x(o,r,s))}else{const n=null===(o=e.props.options)||void 0===o?void 0:o.find((e=>{var o;return(null===(o=e.label)||void 0===o?void 0:o.toLowerCase())===t.toLowerCase()}));if(n&&n.value){const t=on(n.value);if(t){const[o,n,r,s]=t;e.props.alpha=jo(s,2),x(o,n,r)}else x(e.props.h,e.props.s,e.props.v)}else x(e.props.h,e.props.s,e.props.v)}}function n(t){if(!e.context||!C)return;const o=C[t];o&&(e.props.focusedSwatch=o.dataset.color)}function r(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 s(){e.context&&e.props.eyeDropper&&(e.context.hasNativeEyeDropper=!("undefined"==typeof window||!window.EyeDropper),dn.whenAvailable(`eye-dropper-${e.props.id}`,(()=>{var t;const o=new window.EyeDropper,n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`eye-dropper-${e.props.id}`);null==n||n.addEventListener("click",(async()=>{const t=await o.open();if(!t.sRGBHex)return;const[n,r,s]=Zo(t.sRGBHex);e.props.alpha=1,x(n,r,s)}))}),e.props.__root))}function a(){l("canvas-ls",(e=>{S=e}),E,v),l("canvas-hue",(e=>{L=e}),d,m),l("canvas-alpha",(e=>{D=e}),O,g),i(`canvas-preview-${e.props.id}`,(e=>{A=e,c()}),F),i(`canvas-swatch-preview-${e.props.id}`,(e=>{I=e,u()}),V),p()}function l(t,o,n,r){let s=!1;const a=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",d),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",c)},l=e=>{1===e.buttons&&_&&r(e)},p=e=>{_&&r(e)},d=()=>{_=void 0,a()},c=()=>{_=void 0,a()};i(`${t}-${e.props.id}`,(e=>{const a=e.nextElementSibling;o(e),n(),function(e,t){const o=o=>{e&&(o.preventDefault(),t(o))};null==e||e.addEventListener("mousedown",o),null==e||e.addEventListener("touchstart",o)}(e,r),s||function(e,t){s=!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")}))}(a,e),e.addEventListener("mousedown",(e=>{a.focus(),a.setAttribute("data-prevent-focus-style","true"),_=xc[t],r(e),document.addEventListener("mousemove",l),document.addEventListener("mouseup",d)})),e.addEventListener("touchstart",(()=>{a.setAttribute("data-prevent-focus-style","true"),a.focus(),_=xc[t],document.addEventListener("touchmove",p),document.addEventListener("touchend",c)}))}),n)}function i(t,o,n){dn.whenAvailable(t,(()=>{var s;const a=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(t);a&&(o(a),n&&r(a,n))}),e.props.__root)}function p(){dn.whenAvailable(`swatches-${e.props.id}`,(()=>{var t,o,n;C=Array.from((null===(t=e.props.__root)||void 0===t?void 0:t.querySelectorAll(`#swatches-${e.props.id} canvas`))||[]),C.forEach((e=>{r(e,f)})),e.props.focusedSwatch=null===(n=null===(o=C[0])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.color,b()}),e.props.__root)}function d(){if(!L)return;const e=L.getContext("2d");if(!e)return;const t=L.width,o=L.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 c(){if(!A)return;const t=A.getContext("2d");if(!t)return;$(A,A.width/3);const{r:o,g:n,b:r,a:s}=e.props.rgba;t.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,t.fillRect(0,0,A.width,A.height)}function u(){if(!I)return;const t=I.getContext("2d");if(!t)return;$(I,I.height/2);const{r:o,g:n,b:r,a:s}=e.props.rgba;t.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,t.fillRect(0,0,I.width,I.height)}function f(e){if(!e)return;const t=e.getContext("2d");if(!t)return;$(e,e.width/2);const o=e.dataset.colorPrecise;if(!o)return;const[n,r,s,a]=nn(o),[l,i,p,d]=Go(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 h(e,t,o){let n=null;const r=e=>{null!==n&&cancelAnimationFrame(n),n=requestAnimationFrame((()=>{if(!t)return;const n=t.getBoundingClientRect();let r,s;"touches"in e?(r=e.touches[0].clientX-n.left,s=e.touches[0].clientY-n.top):(r=e.clientX-n.left,s=e.clientY-n.top),r=Math.min(Math.max(r,0),n.width),s=Math.min(Math.max(s,0),n.height),o(r,s)}))};r(e);const s=e=>{e.preventDefault(),r(e)},a=e=>{e.preventDefault(),r(e)},l=()=>{_=void 0,document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",l)},i=()=>{_=void 0,document.removeEventListener("touchmove",a),document.removeEventListener("touchend",i)};"touches"in e?(document.addEventListener("touchmove",a),document.addEventListener("touchend",i)):(document.addEventListener("mousemove",s),document.addEventListener("mouseup",l))}function v(t){h(t,S,((t,o)=>{const n=t/S.width*100,r=100-o/S.height*100;B(e.props.hue,n,r)}))}function m(t){h(t,L,((t,o)=>{if(!L)return;const n=L.width,r=Math.floor(t/n*360);e.props.h=r,B(e.props.h,e.props.s,e.props.v)}))}function g(t){h(t,D,((t,o)=>{const n=t/D.width*100/100;e.props.alpha=n,B(e.props.hue,e.props.s,e.props.v)}))}function $(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 b(){var t,o;if(!e.context||!e.props.options||!C)return;const{h:r,s:s,v:a,alpha:l}=e.props,i=function(e,t,o,n=1){const r=0===o?0:t;return`${jo(0===o||100===o&&0===t?0:e,0)}-${jo(r,0)}-${jo(o,0)}-${jo(n,2)}`}(r,s,a,l);let p=!1,d=!1;C.forEach((e=>{const t=e.dataset.color;if(!t)return;const[o,r,s,c]=t.split("-");"0"===s&&0===a&&c===`${l}`&&(d=!0);const u=e.parentElement;d||t===i?(u.dataset.active="true",e.ariaSelected="true",d=!1,!p&&C&&(n(C.indexOf(e)),p=!0)):(delete u.dataset.active,e.ariaSelected="false")})),p||(e.props.focusedSwatch=null===(o=null===(t=C[0])||void 0===t?void 0:t.dataset)||void 0===o?void 0:o.color)}function y(t){t=t.replace("#",""),e.props.hexInputFocused||3!==t.length||(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),t=`#${t=t.toUpperCase()}`,e.props.hex=t.slice(0,9)}function x(t,o,n,r=!1){e.props.h=void 0===t||isNaN(t)?e.props.h:jo(Math.max(Math.min(t,360),0),2),e.props.s=void 0===o||isNaN(o)?e.props.s:jo(Math.max(Math.min(o,100),0),2),e.props.v=void 0===n||isNaN(n)?e.props.v:jo(Math.max(Math.min(n,100),0),2);const{h:s,s:a,v:l,alpha:i}=e.props,[p,d,c]=Go(s,a,l),[u,f,h]=Jo(s,a,l),v=e.props.hexInputFocused?e.props.hex:en(s,a,l,i),m=jo(i,2);e.props.hsla={h:s,s:d,l:c,a:m},e.props.hslaPercent={h:jo(s,0),s:100===l&&0===a?0:jo(0===l?d/255:Math.max(Math.min(d/255*100,100),0),0),l:jo(Math.max(Math.min(e.props.hsla.l/255*100,100),0),0),a:m},e.props.hslaString=`hsla(${e.props.hslaPercent.h}, ${e.props.hslaPercent.s}%, ${e.props.hslaPercent.l}%, ${m})`,e.props.hslaStringPrecise=`hsla(${s}, ${jo(0===l?d/255:d/255*100,2)}%, ${jo(c/255*100,2)}%, ${m})`,e.props.rgba={r:u,g:f,b:h,a:m},e.props.rgbaString=`rgba(${u}, ${f}, ${h}, ${m})`,y(v),setTimeout((()=>{var t;w(),function(){const t=e.props.s,o=100-e.props.v;e.props.controlLSPosition={x:t,y:o}}(),P(),k||"undefined"==typeof window||(k=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"]`))}),0);const g=e.props.valueFormat?e.props.valueFormat:e.props.format;r||("hex"===g?e.input(e.props.hex):"rgba"===g?e.input(e.props.rgbaString):"hsla"===g&&e.input(e.props.hslaStringPrecise))}function w(){E(),O(),F(),V()}let _,k=null,S=null,L=null,D=null,A=null,I=null,C=null,M=0;const T=["hex","rgba","hsla"],E=rn((function(){if(!S)return;const t=S.getContext("2d");if(!t)return;const{width:o,height:n}=S,r=e.props.h||0;t.fillStyle=`hsl(${r}, 100%, 50%)`,t.fillRect(0,0,o,n);const s=t.createLinearGradient(0,0,o,0);s.addColorStop(0,"rgba(255, 255, 255, 1)"),s.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=s,t.fillRect(0,0,o,n);const a=t.createLinearGradient(0,0,0,n);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),t.fillStyle=a,t.fillRect(0,0,o,n)}),2),O=rn((function(){if(!D)return;const t=D.getContext("2d");if(!t)return;const o=Math.round(D.width),n=Math.round(D.height);t.clearRect(0,0,o,n),$(D,n/2);const r=e.props.rgba.r||0,s=e.props.rgba.g||0,a=e.props.rgba.b||0,l=t.createLinearGradient(0,0,o,0);l.addColorStop(0,`rgba(${r}, ${s}, ${a}, 0)`),l.addColorStop(1,`rgba(${r}, ${s}, ${a}, 1)`),t.fillStyle=l,t.fillRect(0,0,o,n)}),2),F=rn(c,2),V=rn(u,2),B=rn(x,2),P=rn(b,10,!1);e.addProps(["expanded","h","s","v","alpha","hsla","hslaPercent","hslaString","hslaStringPrecise","rgba","rgbaString","hex","controlLSPosition","panelActiveFormat","hexInputFocused","hasNativeEyeDropper","focusedSwatch","swatchIsUsingKeyboardNav","showPanelClose"]),e.props.h=e.props.h||void 0,e.props.s=e.props.s||void 0,e.props.v=e.props.v||void 0,e.props.alpha=e.props.alpha||1,e.props.controlLSPosition=e.props.controlLSPosition||{x:0,y:0},e.props.switchIcon=e.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>',e.props.hexInputFocused=!1,e.props.swatchIsUsingKeyboardNav=!1,e.on("destroying",(()=>{e.context&&"undefined"!=typeof document&&document.removeEventListener("paste",t)})),e.on("created",(()=>{e.context&&("undefined"!=typeof window&&document.addEventListener("paste",t),e.props.expanded=!1,e.props.panelActiveFormat=e.props.format||T[0],e.props.panelControls=sn(e.props.panelControls),e.props.eyeDropper=sn(e.props.eyeDropper),e.props.panelFormat=sn(e.props.panelFormat),e.props.showValue=sn(e.props.showValue),e.props.allowPaste=sn(e.props.allowPaste),e.props.inline=dn.undefine(e.props.inline),e.props.disabled=dn.undefine(e.props.disabled),e.props.format=e.props.format||"hex",e.props.valueFormat=e.props.valueFormat||e.props.format,e.props.closeOnSelect=dn.undefine(e.props.closeOnSelect),e.props.focusedSwatch=void 0,void 0===e.value||""===e.value||null===e.value?(e.props.rgba={r:0,g:0,b:0},x(0,0,0,!0)):o(`${e.value}`),e.on("input",(({payload:t})=>{k&&void 0!==e.props.__root&&!k.contains(e.props.__root.activeElement)&&o(t)})),setTimeout((()=>{s()}),5),a(),e.on("prop:expanded",(()=>{function t(t){"Escape"===t.key&&(t.preventDefault(),e.props.expanded=!1)}var o;if(e.props.expanded)s(),a(),p(),document.addEventListener("keydown",t),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?e.props.showPanelClose=!0:e.props.showPanelClose=!1,setTimeout((()=>{var t;const o=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`);o&&o.focus()}),0);else{document.removeEventListener("keydown",t);(null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${e.props.id}"] *[tabindex="0"]`)).focus()}})),e.context.fns.anyToHsvaString=(e,t)=>{const o=on(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),`${jo(n,t)}-${jo(r,t)}-${jo(s,t)}-${jo(a,2)}`},e.context.handlers.inputPreviewClick=t=>{e.props.expanded=!e.props.expanded},e.context.handlers.inputPreviewFocusout=t=>{var o,n,r;const s=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${e.props.id}"] .formkit-inner`),a=t.relatedTarget;if(s.contains(a)){function l(t){var o,n;s.contains(t.target)||(e.props.expanded=!1,null===(o=e.props.__root)||void 0===o||o.removeEventListener("mousedown",l),null===(n=e.props.__root)||void 0===n||n.removeEventListener("touchstart",l))}null===(n=e.props.__root)||void 0===n||n.addEventListener("mousedown",l),null===(r=e.props.__root)||void 0===r||r.addEventListener("touchstart",l)}else e.props.expanded=!1},e.context.handlers.inputPreviewKeydown=t=>{"Escape"===t.key&&(t.preventDefault(),e.props.expanded=!1),"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.expanded=!e.props.expanded)},e.context.handlers.closePanel=()=>{e.props.expanded=!1},e.context.handlers.panelCloseKeydown=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.expanded=!1)},e.context.handlers.toggleFormat=(t=1)=>{t="number"==typeof t?t:1;const o=(T.indexOf(e.props.panelActiveFormat)+t+T.length)%T.length;e.props.panelActiveFormat=T[o]},e.context.handlers.panelKeydown=t=>{var o,n,r;if("Tab"===t.key&&e.props.expanded){t.preventDefault();const s=Array.from((null===(o=e.props.__root)||void 0===o?void 0:o.querySelectorAll(`[data-id="${e.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`))||[]).filter(an),a=s.indexOf((null===(n=e.props.__root)||void 0===n?void 0:n.activeElement)?null===(r=e.props.__root)||void 0===r?void 0:r.activeElement:e.props.__root);let l;l=t.shiftKey?(a-1+s.length)%s.length:(a+1)%s.length,s[l].focus()}},e.context.handlers.lsKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r}=e.props,s=t.shiftKey?10:1;switch(t.key){case"ArrowLeft":x(o,n-s,r);break;case"ArrowRight":x(o,n+s,r);break;case"ArrowUp":x(o,n,r+s);break;case"ArrowDown":x(o,n,r-s);break;case"PageUp":x(o,n,r+10);break;case"PageDown":x(o,n,r-10);break;case"Home":x(o,n-10,r);break;case"End":x(o,n+10,r)}w()}},e.context.handlers.hueControlKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r}=e.props,s=t.shiftKey?10:1;switch(t.key){case"ArrowLeft":case"ArrowDown":x(o-s,n,r);break;case"ArrowRight":case"ArrowUp":x(o+s,n,r);break;case"PageUp":x(o+10,n,r);break;case"PageDown":x(o-10,n,r);break;case"Home":x(0,n,r);break;case"End":x(360,n,r)}w()}},e.context.handlers.alphaControlKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r,alpha:s}=e.props,a=t.shiftKey?.1:.01;switch(t.key){case"ArrowLeft":case"ArrowDown":e.props.alpha=jo(Math.min(Math.max(s-a,0),1),2);break;case"ArrowRight":case"ArrowUp":e.props.alpha=jo(Math.min(Math.max(s+a,0),1),2);break;case"PageUp":e.props.alpha=jo(Math.min(Math.max(s+.1,0),1),2);break;case"PageDown":e.props.alpha=jo(Math.min(Math.max(s-.1,0),1),2);break;case"Home":e.props.alpha=0;break;case"End":e.props.alpha=1}x(o,n,r)}},e.context.handlers.eyeDropperKeydown=t=>{var o;if("Enter"===t.key||" "===t.key){t.preventDefault();const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`eye-dropper-${e.props.id}`);null==n||n.click()}},e.context.handlers.formatSwitcherKeydown=t=>{e.context&&("Enter"!==t.key&&" "!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),e.context.handlers.toggleFormat()),"ArrowUp"===t.key&&(t.preventDefault(),e.context.handlers.toggleFormat(-1)))},e.context.handlers.hexInput=t=>{const o=t.target,n=o.value.startsWith("#")?9:8,r=o.value.slice(0,n);if(o.value=r,tn(r)){const[t,o,n,s]=Zo(r);e.props.alpha=s,y(r),x(t,o,n)}},e.context.handlers.hexKeydown=t=>{const o=t.target,n=o.value;let r="";if(!tn(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=t.shiftKey?10:1,d=16777215;let c;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key))switch(t.preventDefault(),t.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}`),e.context&&e.context.handlers.hexInput(t)},e.context.handlers.hexFocus=()=>{e.context&&(e.props.hexInputFocused=!0)},e.context.handlers.hexBlur=t=>{if(!e.context)return;e.props.hexInputFocused=!1;const o=t.target.value;tn(o)&&y(o)},e.context.handlers.rangeLimitInput=(t,o,n,r)=>s=>{const a=r||s;if(!a||!e.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"===t){switch(p){case`h-${e.props.id}`:e.props.h=i;break;case`s-${e.props.id}`:e.props.hslaPercent.s=i;break;case`l-${e.props.id}`:e.props.hslaPercent.l=i}const[t,o,n]=Xo(e.props.h,2.55*e.props.hslaPercent.s,2.55*e.props.hslaPercent.l);x(t,o,n)}else if("rgba"===t){switch(p){case`r-${e.props.id}`:e.props.rgba.r=i;break;case`g-${e.props.id}`:e.props.rgba.g=i;break;case`b-${e.props.id}`:e.props.rgba.b=i}const[t,o,n]=Qo(e.props.rgba.r,e.props.rgba.g,e.props.rgba.b);x(t,o,n)}else"alpha"==t&&(e.props.alpha=i,x())},e.context.handlers.rangeLimitKeydown=(t,o,n,r)=>s=>{if(!e.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}`}e.context.handlers.rangeLimitInput(t,o,n,s)()}}else s.preventDefault()},e.context.handlers.swatchClick=t=>{const o=t.target;if(o.dataset.colorPrecise){const[t,n,r,s]=nn(o.dataset.colorPrecise);e.props.alpha=s,x(t,n,r),e.props.closeOnSelect&&(e.props.expanded=!1)}e.context&&"keydown"!==t.type&&e.context.handlers.swatchKeydown(t)},e.context.handlers.swatchKeydown=t=>{var o,r,s,a;if(!e.context||!C||!C.length)return;const l=C.indexOf(t.currentTarget);let i=null;const p=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)}(C),d=C.length;let c=0,u=d,f=!1;const h=C[l].dataset.group;if(void 0!==h){const e=C.filter((e=>e.dataset.group===h));c=C.indexOf(e[0]),u=C.indexOf(e[e.length-1])}const v=(l-c)%p;if(!t.key||"Tab"===t.key)return t.key||(e.props.swatchIsUsingKeyboardNav=!1,M=v,n(l)),"Tab"===t.key&&(e.props.swatchIsUsingKeyboardNav=!1),void C.forEach((e=>{delete e.parentElement.dataset.focused}));if("Enter"===t.key||" "===t.key)return t.preventDefault(),M=v,e.context.handlers.swatchClick(t),void n(l);switch("ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(e.props.swatchIsUsingKeyboardNav=!0,t.preventDefault()),t.key){case"ArrowUp":i=Math.max(l-p,l-(p-(M-v))),f=!0;break;case"ArrowDown":i=Math.max(l+p,l+(p+(M-v))),f=!0;break;case"ArrowLeft":i=l-1,M=(i-c)%p;break;case"ArrowRight":i=l+1,M=(i-c)%p}if(f&&null!==i&&(i<c||i>u)){let e;e=i<c?null===(r=null===(o=C[c-1])||void 0===o?void 0:o.dataset)||void 0===r?void 0:r.group:null===(a=null===(s=C[u+1])||void 0===s?void 0:s.dataset)||void 0===a?void 0:a.group;const t=C.filter((e=>e.dataset.group===h)),n=C.filter((t=>t.dataset.group===e)),d=(l-c)%p,f=t.length%p||p,v=l>=c+t.length-f;if(i<c){const e=n.length%p||p;i=c-e+Math.min(Math.max(d,M),e-1)}else i>u&&(i=v?Math.min(u+Math.max(d,M)+1,C.indexOf(n[n.length-1])):Math.min(i,u))}if(null!==i&&i>=0&&i<d){n(i),C.forEach((e=>{delete e.parentElement.dataset.focused}));const e=C[i],t=e.parentElement;e.focus(),t.dataset.focused="true"}})}))},$e,un.options,un.defaultIcon("eyeDropper","color"),un.defaultIcon("close","close"),un.localize("close"),un.localize("next")]},_c=a("tb"),{outer:kc,inner:Sc,wrapper:Lc,label:Dc,prefix:Ac,suffix:Ic,help:Cc,messages:Mc,message:Tc,icon:Ec}=l(_c),Oc=_c("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"}}))),Fc=_c("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"}}))),Vc=_c("inputInner",(()=>({bind:"$attrs",$el:"span"}))),Bc=_c("options",(()=>({$el:"ul",attrs:{id:"$id","data-vertical":'$vertical && "true" || "false"',"aria-labelledby":"$id"}}))),Pc=_c("option",(()=>({$el:"li",for:["option","index","$options"],attrs:{key:"$option.value","data-index":"$index"}}))),Hc={schema:kc(p("$options",Lc(Dc("$label"),Bc(Pc(Fc(p("$fns.isChecked($option) === true",Vc("$slots.default || $slots.on || $option.onLabel || $option.label"),Vc("$slots.default || $slots.off || $option.offLabel || $option.label")))))),Lc(p("$label && ($slots.default || $slots.on || $onLabel)",Dc("$label")),Oc(Ec("prefix"),Ac(),p("$_isChecked === true",Vc("$slots.default || $slots.on || $onLabel || $label"),Vc("$slots.default || $slots.off || $offLabel || $label")),Ic(),Ec("suffix")))),Cc("$help"),Mc(Tc("$message.value"))),type:"input",family:"button",props:["options"],features:[function(e){var t,o,n,r;e.addProps(["enforced","multiple","offLabel","offValue","onLabel","onValue","vertical","_isChecked"]),e.props._isChecked=!1,e.props.enforced=dn.undefine(e.props.enforced),e.props.multiple=dn.undefine(e.props.multiple),e.props.vertical=dn.undefine(e.props.vertical),e.props.disabled=dn.undefine(e.props.disabled),null!==(t=(n=e.props).onValue)&&void 0!==t||(n.onValue=!0),null!==(o=(r=e.props).offValue)&&void 0!==o||(r.offValue=!1),e.on("created",(()=>{var t;e.props._isChecked=ln(e,null),e.props.options&&e.props.multiple&&e.input(null!==(t=e.value)&&void 0!==t?t:[],!1),e.context&&(e.context.fns.isChecked=t=>ln(e,t),e.context.handlers.toggleValue=t=>o=>function(e,t,o){if(o.preventDefault(),t=t?h(t):t,e.props.options)if(e.props.multiple){const o=Array.isArray(e.value)?[...e.value]:[],n=o.findIndex((e=>dn.eq(e,t)));n>-1&&(!e.props.enforced||o.length>1)?o.splice(n,1):-1===n&&o.push(t),e.input(o)}else dn.eq(e.value,t)&&!e.props.enforced?e.input(void 0):e.input(t);else e.input(dn.eq(e.value,e.props.onValue)?e.props.offValue:e.props.onValue)}(e,t,o))}))},un.options]},Nc=a("ut"),{outer:Rc,inner:Kc,wrapper:Wc,label:Yc,prefix:qc,suffix:Uc,help:zc,messages:jc,message:Zc,icon:Gc}=l(Nc),Xc=Nc("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",type:"tel",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",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"}}))),Jc={schema:Rc(Wc(Yc("$label"),Kc(Gc("prefix"),qc(),Xc(),Uc(),Gc("suffix"))),zc("$help"),jc(Zc("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,i,p,d,c,u,f,h,v,m;const g=["unit","decimals","minDecimals","displayLocale","min","max","step","valueFormat"];e.addProps(g),null!==(t=(p=e.props).displayLocale)&&void 0!==t||(p.displayLocale=e.props.locale||"en-US"),null!==(o=(d=e.props).decimals)&&void 0!==o||(d.decimals=null),null!==(n=(c=e.props).minDecimals)&&void 0!==n||(c.minDecimals=null),null!==(r=(u=e.props).min)&&void 0!==r||(u.min=null),null!==(s=(f=e.props).max)&&void 0!==s||(f.max=null),null!==(a=(h=e.props).step)&&void 0!==a||(h.step=1),null!==(l=(v=e.props).unit)&&void 0!==l||(v.unit=e.props.unit||"percent"),-1===["acre","bit","byte","celsius","centimeter","day","degree","fahrenheit","fluid-ounce","foot","gallon","gigabit","gigabyte","gram","hectare","hour","inch","kilobit","kilobyte","kilogram","kilometer","liter","megabit","megabyte","meter","microsecond","mile","mile-scandinavian","milliliter","millimeter","millisecond","minute","month","nanosecond","ounce","percent","petabyte","pound","second","stone","terabit","terabyte","week","yard","year"].indexOf(e.props.unit)&&(e.props.unit="percent"),null!==(i=(m=e.props).valueFormat)&&void 0!==i||(m.valueFormat="number"),-1===["string","number"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(pn(e),e.context.handlers.init(),g.forEach((t=>{e.on(`prop:${t}`,(()=>{var t,o;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init(),null===(o=null==e?void 0:e.context)||void 0===o||o.handlers.setPlaceholder()}))})))}))},un.options]},Qc=a("cr"),{outer:eu,inner:tu,wrapper:ou,label:nu,prefix:ru,suffix:su,help:au,messages:lu,message:iu,icon:pu}=l(Qc),du=Qc("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",type:"tel",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",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"}}))),cu={schema:eu(ou(nu("$label"),tu(pu("prefix"),ru(),du(),su(),pu("suffix"))),au("$help"),lu(iu("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,i,p,d,c,u,f,h,v,m;const g=["currency","decimals","minDecimals","displayLocale","min","max","step","valueFormat"];e.addProps(g),e.addProps(["inputText"]),null!==(t=(p=e.props).displayLocale)&&void 0!==t||(p.displayLocale=e.props.locale||"en-US"),null!==(o=(d=e.props).currency)&&void 0!==o||(d.currency=e.props.currency||"USD"),null!==(n=(c=e.props).decimals)&&void 0!==n||(c.decimals=null),null!==(r=(u=e.props).minDecimals)&&void 0!==r||(u.minDecimals=null),null!==(s=(f=e.props).min)&&void 0!==s||(f.min=null),null!==(a=(h=e.props).max)&&void 0!==a||(h.max=null),null!==(l=(v=e.props).step)&&void 0!==l||(v.step=1),null!==(i=(m=e.props).valueFormat)&&void 0!==i||(m.valueFormat="number"),-1===["string","number","integer"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(pn(e),e.context.handlers.init(),g.forEach((t=>{e.on(`prop:${t}`,(()=>{var t,o;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.setPlaceholder(),null===(o=null==e?void 0:e.context)||void 0===o||o.handlers.init()}))})))}))}]};var uu=Object.freeze({__proto__:null,autocomplete:Da,colorpicker:wc,currency:cu,datepicker:gi,dropdown:Pr,mask:lp,rating:oa,repeater:Es,slider:Cd,taglist:Pi,toggle:ns,togglebuttons:Hc,transferlist:Jp,unit:Jc});const fu="undefined"!=typeof window?setInterval:()=>0,hu=new WeakSet;exports.$if=p,exports.autocomplete=Da,exports.colorpicker=wc,exports.createBaseSections=l,exports.createProPlugin=function(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(hu.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:Ln(13919),children:`${Ln(451228594)}${Ln(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){Mn[e]?Mn[e].add(t):Mn[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(!yn.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];hu.add(o),o.define({...r,schema:n(e)})}fu((()=>Cn.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=a,exports.currency=cu,exports.datepicker=gi,exports.dropdown=Pr,exports.inputs=uu,exports.mask=lp,exports.rating=oa,exports.repeater=Es,exports.slider=Cd,exports.taglist=Pi,exports.toggle=ns,exports.togglebuttons=Hc,exports.transferlist=Jp,exports.unit=Jc;