@formkit/pro 0.127.19 → 0.127.20
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/autocomplete/autocomplete.ts +1 -1
- package/autocomplete/index.mjs +1 -1
- package/dropdown/dropdown.ts +1 -1
- package/index.cjs +2 -2
- package/index.mjs +7 -7
- package/package.json +1 -1
package/autocomplete/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$if as e,$attrs as i,createSectionFactory as t,createBaseSections as o}from"../index.mjs";import{icon as n}from"@formkit/inputs";const a=(e,i)=>()=>n(e,i);function l(t){const o=t("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_popover"',popover:{if:"$usePopover",then:"$popover",else:void 0},"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),n=t("listbox",(()=>({$el:"ul",if:"$expanded || $setForceExpanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant","aria-labelledby":'$id + "_label"'}}))),l=t("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"}}))),d=t("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=t("loadMoreInner","span"),$=t("emptyMessage",(()=>({$el:"li",if:"$showEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),r=t("emptyMessageInner","span"),p=t("option",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option)"}}))),u=t("listitems",(()=>({$el:null,if:"$options.length",for:["option","index","$option.options || $options"]}))),c=t("innerListitems",(()=>({$el:null,for:["option","innerIndex","$option.options"]}))),v=t("listitemGroup",(()=>({$el:"li",attrs:{"aria-label":"$option.group",role:"group",onClick:"$handlers.listitemGroupClick",tabindex:"-1"}}))),b=t("groupLabel","span"),m=t("groupList",(()=>({$el:"ul",attrs:{role:"group"}})));return()=>o(n($(r("$emptyMessage")),u(e("$option.group",v(b("$option.group"),m(c(i((()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'})),l(e("$fns.isSelected($option)",a("selected")),p("$option.label")))))),l(e("$fns.isSelected($option)",a("selected")),p("$option.label")))),d(e("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",s(e("$state.loading",a("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))))}const d=/* #__PURE__ */t("ac"),{outer:s,wrapper:$,inner:r,icon:p,label:u,prefix:c,suffix:v,help:b,messages:m,message:h}=/* #__PURE__ */o(d),f=d("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",onFocus:"$handlers.focus",value:"$inputText || undefined",name:"$node.name",placeholder:"$state.loading && $ui.isLoading.value || $placeholder || undefined",tabindex:'$disabled && "-1" || 0',role:"combobox",autocomplete:'$attrs.autocomplete || "off"',autocapitalize:"none",readonly:"$attrs.readonly || $state.loading || $multiple && $max && $value && $value.length >= $max && $hasHighlightedRange !== true || undefined","data-selection-appearance":"$selectionAppearance",disabled:"$disabled || $disabledInternally || undefined",onTouchmovePassive:"$handlers.touchmove",onTouchstartPassive:"$handlers.touchmove",onTouchend:"$handlers.touchend","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined","aria-required":"$state.required || undefined"}}))),x=d("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"}}))),g=d("selectionWrapper",(()=>({for:["option","index","$selections"],$el:"div",attrs:{id:'$id + "_selection_wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:'$disabled && "-1" || 0',onKeydown:"$handlers.selectionKeydown && $handlers.selectionKeydown($multiple && $option || undefined)",onClick:"$handlers.selectionClick && $handlers.selectionClick($multiple && $option || undefined)",onFocus:"$handlers.selectionFocus && $handlers.selectionFocus($multiple && $option || undefined)",onBlur:"$handlers.selectionBlur && $handlers.selectionBlur($multiple && $option || undefined)","data-is-selection":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),y=d("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),_=d("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),k=d("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"}}))),S=d("optionLoading","span"),w=d("option",(()=>({$el:"div",if:"$value !== undefined"}))),C=/* #__PURE__ */l(d);export{d as createSection,b as help,p as icon,r as inner,f as input,u as label,C as listbox,x as listboxButton,h as message,m as messages,w as option,S as optionLoading,s as outer,c as prefix,k as removeSelection,y as selection,g as selectionWrapper,_ as selections,v as suffix,$ as wrapper};
|
|
1
|
+
import{$if as e,$attrs as i,createSectionFactory as t,createBaseSections as o}from"../index.mjs";import{icon as n}from"@formkit/inputs";const a=(e,i)=>()=>n(e,i);function l(t){const o=t("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_popover"',popover:{if:"$usePopover",then:"$popover",else:void 0},"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),n=t("listbox",(()=>({$el:"ul",if:"$expanded || $setForceExpanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant","aria-labelledby":'$id + "_label"'}}))),l=t("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"}}))),d=t("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=t("loadMoreInner","span"),$=t("emptyMessage",(()=>({$el:"li",if:"$showEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),r=t("emptyMessageInner","span"),p=t("option",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option)"}}))),u=t("listitems",(()=>({$el:null,if:"$options.length",for:["option","index","$option.options || $options"]}))),c=t("innerListitems",(()=>({$el:null,for:["option","innerIndex","$option.options"]}))),v=t("listitemGroup",(()=>({$el:"li",attrs:{"aria-label":"$option.group",role:"group",onClick:"$handlers.listitemGroupClick",tabindex:"-1"}}))),b=t("groupLabel","span"),m=t("groupList",(()=>({$el:"ul",attrs:{role:"group"}})));return()=>o(n($(r("$emptyMessage")),u(e("$option.group",v(b("$option.group"),m(c(i((()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'})),l(e("$fns.isSelected($option)",a("selected")),p("$option.label")))))),l(e("$fns.isSelected($option)",a("selected")),p("$option.label")))),d(e("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",s(e("$state.loading",a("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))))}const d=/* #__PURE__ */t("ac"),{outer:s,wrapper:$,inner:r,icon:p,label:u,prefix:c,suffix:v,help:b,messages:m,message:h}=/* #__PURE__ */o(d),f=d("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:"$state.loading !== true && $inputText || undefined",name:"$node.name",placeholder:"$state.loading && $ui.isLoading.value || $placeholder || undefined",tabindex:'$disabled && "-1" || 0',role:"combobox",autocomplete:'$attrs.autocomplete || "off"',autocapitalize:"none",readonly:"$attrs.readonly || $state.loading || $multiple && $max && $value && $value.length >= $max && $hasHighlightedRange !== true || undefined","data-selection-appearance":"$selectionAppearance",disabled:"$disabled || $disabledInternally || undefined",onTouchmovePassive:"$handlers.touchmove",onTouchstartPassive:"$handlers.touchmove",onTouchend:"$handlers.touchend","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined","aria-required":"$state.required || undefined"}}))),x=d("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"}}))),g=d("selectionWrapper",(()=>({for:["option","index","$selections"],$el:"div",attrs:{id:'$id + "_selection_wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:'$disabled && "-1" || 0',onKeydown:"$handlers.selectionKeydown && $handlers.selectionKeydown($multiple && $option || undefined)",onClick:"$handlers.selectionClick && $handlers.selectionClick($multiple && $option || undefined)",onFocus:"$handlers.selectionFocus && $handlers.selectionFocus($multiple && $option || undefined)",onBlur:"$handlers.selectionBlur && $handlers.selectionBlur($multiple && $option || undefined)","data-is-selection":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),y=d("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),_=d("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),k=d("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"}}))),S=d("optionLoading","span"),w=d("option",(()=>({$el:"div",if:"$value !== undefined"}))),C=/* #__PURE__ */l(d);export{d as createSection,b as help,p as icon,r as inner,f as input,u as label,C as listbox,x as listboxButton,h as message,m as messages,w as option,S as optionLoading,s as outer,c as prefix,k as removeSelection,y as selection,g as selectionWrapper,_ as selections,v as suffix,$ as wrapper};
|
package/dropdown/dropdown.ts
CHANGED
|
@@ -85,7 +85,7 @@ export const dropdown: FormKitProInput = {
|
|
|
85
85
|
tagWrapper(
|
|
86
86
|
tag(
|
|
87
87
|
$if(
|
|
88
|
-
'$state.loading && $
|
|
88
|
+
'$state.loading && $fns.hasOptionLoaderValue($option) || $option.label === undefined',
|
|
89
89
|
tagLoading('$ui.isLoading.value'),
|
|
90
90
|
tagLabel('$option.label')
|
|
91
91
|
),
|
package/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e=require("@formkit/utils"),t=require("@formkit/core"),o=require("@formkit/inputs");require("@formkit/vue");var n=require("@formkit/drag-and-drop"),r=require("@formkit/tempo");const s=[988,24029,396,13078,980],a=18806588,l=502357,i=16217489;let p=189024;const d=/^[0-9a-f]+$/,c="undefined"!=typeof window,u=_(32,(e=>e)).map((()=>{p|=0,p=p+1831565813|0;let e=p^p>>>15|p;return e=e+e^e>>>427,((e^e>>>14)>>>0)/4294967296})),f=c?setTimeout:()=>0,v={},h=e=>e.toString(32),m=e=>`${h(u[e]).substring(2)}.${h(s[e%(s.length-1)])}`;const g={},$={},b=new Set(["",null,void 0]);function y(e,t){e in g||(g[e]={timer:0,inputs:new Set});const o=g[e];clearTimeout(o.timer),o.inputs.add(t),o.timer=f((()=>{v[e]||(v[e]=f((()=>b.add(e)),2e3)),function(e){if(c){window.addEventListener([30548127325,27022924,34729821653783].map(h).join("y"),(t=>{if("report"===t.disposition)return;const o=new URL(t.blockedURI).hostname;u.some(((e,t)=>m(t)===o))&&(x(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let t=0;const o=h(a),n="://",r=(new Date).getDate(),s=async()=>{const a=Array.from(g[e].inputs),p=a.filter((t=>!($[e]&&$[e].has(t)))).join("");if((e=>{clearTimeout(v[e])})(e),p){t++;try{const s=await window[h(i)](`${o}${n}${m((r+t)%u.length)}/${function(e){const t=Math.round(9*Math.random());let o="";for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r>=48&&r<=57?r=48+(r+t)%58%48:r>=97&&r<=122&&(r=97+(r+t)%123%97),o+=String.fromCharCode(r)}return`${t}${o}`}(`${e.substring(3)}x${p}`)}`),d=await s.json();if(d[h(l)])return x(e,d.schema);if(s.ok)return $[e]||($[e]=new Set),void a.forEach((t=>$[e].add(t)))}catch(e){}t<2&&f(s,1e4*Math.random())}};s()}}(e)}),500)}function x(e,t){b.add(e),function(e,t){k[e]&&k[e].forEach((e=>e(t)))}(e,t)}function w(e,t,o){if(y(t,o),!t)throw new Error("FormKitNoKey");return b.has(t)?null:e}function _(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}const k={};const S=()=>({$el:"div",attrs:{key:"$id","data-type":"$type","data-family":"$family","data-multiple":"$attrs.multiple || $multiple || undefined","data-disabled":"$disabled || $disabledInternally || undefined","data-empty":"$state.empty || undefined","data-complete":"$state.complete || undefined","data-invalid":"$state.invalid || undefined","data-errors":"$state.errors || undefined","data-submitted":"$state.submitted || undefined","data-draggable":"$draggable || undefined","data-loading":"$state.loading || undefined","data-overscroll":'$behavior === "overscroll" && true || undefined',"data-id":"$id","data-inline":"$inline || undefined","data-is-max":"$max && $value && $value.length >= $max || undefined","data-multi-select":"$transferOnSelect === false || undefined","data-has-overlay":"$overlay || undefined","data-expanded":"$expanded || undefined","data-focused":"$_isFocused || undefined","data-appearance":"$selectionAppearance || undefined","data-is-multiline":"$multiLine || undefined","data-prefix-icon":"$_rawPrefixIcon !== undefined || undefined","data-suffix-icon":"$_rawSuffixIcon !== undefined || undefined","data-prefix-icon-click":"$onPrefixIconClick !== undefined || undefined","data-suffix-icon-click":"$onSuffixIconClick !== undefined || undefined"}}),L=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),I=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),D=()=>({$el:"ul",if:"$defaultMessagePlacement && $fns.length($messages)"}),A=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),C=()=>({$el:"div",if:"$help",attrs:{id:'$: "help-" + $id'}}),T=()=>({$el:null}),E=(e,t)=>()=>o.icon(e,t),O=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),M=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),V=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),F=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),P=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),B=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),H=()=>({$el:null,for:["part","$_overlayParts"]});function R(n,r,s,a){return(...l)=>i=>p=>{const d=function(e,n,r,s,a,l){const i=l[r],p="function"==typeof s?s():{$el:s},d=a.map((e=>"string"==typeof e?e:e(n)(l)));let c=d.length&&p?o.extendSchema(p,{children:d}):p;if(c=o.extendSchema(c,i),"object"==typeof c){let o=c;if((t.isDOM(c)||t.isComponent(c))&&(c.meta={...c.meta||{},section:r,node:s}),t.isDOM(c)){const{$el:t,...s}=c;s.attrs?"class"in s.attrs||"if"in s.attrs||(s.attrs={class:`$classes.${r}`,...s.attrs}):s.attrs={class:`$classes.${r}`},o=N(n,r,Object.defineProperty(s,"$el",{enumerable:!1,get:w.bind(null,t,n,e)}))}else if(t.isComponent(c)){const{$cmp:t,...s}=c;o=N(n,r,Object.defineProperty(s,"$cmp",{enumerable:!1,get:w.bind(null,t,n,e)}))}else if("$formkit"in c){c.outerClass=`$classes.${r}`;const{$formkit:t,...s}=c;o=N(n,r,Object.defineProperty(s,"$formkit",{enumerable:!1,get:w.bind(null,t,n,e)}))}return o}return N(n,r,c)}(n,i,r,s,l,p);return a&&e.isRecord(d)&&(d.memo=n+JSON.stringify(p)),a?[d]:d}}function N(e,t,o){const n=o=>e?o||`$slots.${t}`:null;return Object.defineProperties({},{if:{enumerable:!1,get:n},then:{enumerable:!1,get:n},else:{enumerable:!1,get:n.bind(null,o)}})}function K(e){return(t,o,n=!1)=>R(e,t,o,n)}function W(e){return{outer:e("outer",S,!0),wrapper:e("wrapper","div",!1),inner:e("inner",L,!1),icon:E,label:e("label",I,!1),prefix:e("prefix",T,!1),suffix:e("suffix",T,!1),help:e("help",C,!1),messages:e("messages",D,!1),message:e("message",A,!1)}}function q(e){return{overlayPlaceholder:e("overlayPlaceholder",O),overlayLiteral:e("overlayLiteral",M),overlayChar:e("overlayChar",V),overlayEnum:e("overlayEnum",F),overlay:e("overlay",P),overlayParts:e("overlayParts",H),overlayInner:e("overlayInner",B)}}function U(e,t,n){return r=>s=>{const a="string"==typeof t?t:t(r)(s);return n?{if:e,then:a,else:"string"==typeof n?n:n(r)(s)}:(o.isSlotCondition(a)?Object.assign(a.else,{if:e}):o.isSchemaObject(a)&&Object.assign(a,{if:e}),a)}}function z(n){const r=n("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_popover"',popover:{if:"$usePopover",then:"$popover",else:void 0},"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),s=n("listbox",(()=>({$el:"ul",if:"$expanded || $setForceExpanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant","aria-labelledby":'$id + "_label"'}}))),a=n("listitem",(()=>({$el:"li",bind:"$option.attrs",attrs:{id:'$id + "_listitem_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value",key:"$option.value",onClick:"$handlers.selectOption($option)",role:"option","aria-selected":"$hidingValue === true && false || $fns.isSelected($option)","data-is-active":"$fns.isActive($option)",tabindex:"-1"}}))),l=n("loadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_load_more"',key:"loadMore",role:"option",onClick:"$handlers.selectOption($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}}))),i=n("loadMoreInner","span"),p=n("emptyMessage",(()=>({$el:"li",if:"$showEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),d=n("emptyMessageInner","span"),c=n("option",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option)"}}))),u=n("listitems",(()=>({$el:null,if:"$options.length",for:["option","index","$option.options || $options"]}))),f=n("innerListitems",(()=>({$el:null,for:["option","innerIndex","$option.options"]}))),v=n("listitemGroup",(()=>({$el:"li",attrs:{"aria-label":"$option.group",role:"group",onClick:"$handlers.listitemGroupClick",tabindex:"-1"}}))),h=n("groupLabel","span"),m=n("groupList",(()=>({$el:"ul",attrs:{role:"group"}})));return()=>{return r(s(p(d("$emptyMessage")),u(U("$option.group",v(h("$option.group"),m(f((n=()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'}),g=a(U("$fns.isSelected($option)",E("selected")),c("$option.label")),r=>{const s=s=>{const a=g(r)(s),l="function"==typeof n?n(r):n;return e.isObject(l)?(o.isSlotCondition(a)&&t.isDOM(a.else)?a.else.attrs={...a.else.attrs,...l}:t.isDOM(a)&&(a.attrs={...a.attrs,...l}),a):a};return s._s=g._s,s})))),a(U("$fns.isSelected($option)",E("selected")),c("$option.label")))),l(U("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",i(U("$state.loading",E("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))));var n,g}}const Y=/* #__PURE__ */K("dd"),{outer:j,wrapper:Z,inner:G,icon:X,label:J,prefix:Q,suffix:ee,help:te,messages:oe,message:ne}=/* #__PURE__ */W(Y),re=Y("selector",(()=>({$el:"button",bind:"$attrs",attrs:{id:"$id",type:"button",onClick:"$handlers.click",onBlur:"$handlers.blur",onFocus:"$handlers.focus",onKeydown:"$handlers.keydown",tabindex:"0",name:"$node.name",disabled:"$disabled || $disabledInternally || undefined","aria-haspopup":"listbox","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy"}}))),se=Y("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),ae=Y("selection",(()=>({$el:"div"}))),le=Y("placeholder",(()=>({$el:"div",attrs:{key:"placeholder","data-is-placeholder":"true","aria-hidden":'$placeholder === undefined && "true" || undefined',style:{opacity:'$placeholder === undefined && "0" || undefined',"pointer-events":'$placeholder === undefined && "none" || undefined'}}}))),ie=Y("optionLoading","span"),pe=Y("option",(()=>({$el:"div"}))),de=Y("removeSelection",(()=>({$el:"div",attrs:{id:'$selectionAppearance === "tags" && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"-1",type:"button",key:"$value","aria-label":"$ui.remove.value",onClick:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',onTouchstartPassive:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',"aria-controls":"$id"}}))),ce=Y("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),ue=Y("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),fe=Y("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),ve=Y("selectionsItem",(()=>({$el:"div",for:["selectionLabel","index","$formattedSelections"],attrs:{id:'$id + "_selections_item_" + $index',"data-check":"$selectionLabel",key:"$selectionLabel","aria-hidden":'$lastVisibleIndex && $index > $lastVisibleIndex && "true" || undefined',style:{visibility:'$lastVisibleIndex && $index > $lastVisibleIndex && "hidden" || undefined'}},children:'$selectionLabel || ""'}))),he=Y("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.tagClick && $handlers.tagClick($option)",onKeydown:"$handlers.selectorTagKeydownHandler($option)",onFocus:"$handlers.tagFocus && $handlers.tagFocus($option)",onBlur:"$handlers.tagBlur && $handlers.tagBlur($option)","data-is-tag":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),me=Y("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"-1"}}))),ge=Y("tagLabel",(()=>({$el:"span"}))),$e=Y("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),be=Y("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),ye=Y("tagLoading","span"),xe=/* #__PURE__ */z(Y);function we(t){return e.isRecord(t)&&"value"in t&&"label"in t}function _e(e){return e?e.reduce(((e,t)=>{var o;return(null===(o=e.at(-1))||void 0===o?void 0:o.type)===t.type?e.at(-1).value+=t.value:e.push({type:t.type,value:t.value}),e}),[]):[]}function ke(){var e,t,o;const n=(null===(e=document.activeElement)||void 0===e?void 0:e.tagName.toLowerCase())||"";if(customElements.get(n)){const e=null===(o=null===(t=document.activeElement)||void 0===t?void 0:t.shadowRoot)||void 0===o?void 0:o.activeElement;if(e)return e}return document.activeElement}function Se(e){return"__original"in e?e.__original:e.value}const Le=new WeakMap,Ie=new WeakMap;async function De(e,t,o=!1,n=!1){if("function"==typeof e.props.optionsLoader){e.props.search=t,clearTimeout(Ie.get(e));const o=t?e.props.debounce:0;0===o?Ae(e,n):Ie.set(e,setTimeout((()=>{e.props.page=1,Ae(e,n)}),o))}else if(Array.isArray(e.props.options)){const o=JSON.parse(JSON.stringify(e.props.initialOptions));e.props.options=[...o.filter((o=>{if("options"in o){const n=o.options=[...o.options].filter((o=>e.props.filter(o,null!=t?t:"",e)));return n.length>0&&{...o,options:n}}return e.props.filter(o,null!=t?t:"",e)}))]}}function Ae(e,t){e.props.allowAppendOptions=t,Ve(e)}const Ce=/* #__PURE__ */t.createMessage({key:"loading",type:"state",value:!0,visible:!1}),Te=/* #__PURE__ */t.createMessage({key:"loading",type:"state",value:!1,visible:!1});function Ee(e,n){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,function(e,t){const n=o.normalizeOptions(t);e.props.appendingOptions=!0,e.props.activeValue=Se(n[0]),e.props.options=e.props.options.concat(n)}(e,n);const r=o.normalizeOptions(n);e.props.options=r,e.props.options.length||(e.store.set(Te),e.store.set(t.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}))),Le.set(e,e.props.searchValue)}const Oe=new WeakMap;function Me(t,o,n){if(t.store.set(Ce),t.props.optionLoadingCounter++,t.props.multiple&&"truncate"!==t.props.selectionAppearance){let n;n=e.isPojo(o)?{label:"Loading...",value:String(o)}:{label:String(o),value:o},t.props.optionLoaderValues.includes(n.value)||t.props.optionLoaderValues.push(n.value),"transferlist"===t.props.type||t.props.selections.includes(n)||(t.props.selections=[...t.props.selections,n])}const r=t.props.optionLoader(o,n),s=t=>"string"==typeof t?{label:t,value:o}:we(t)?t:e.isRecord(t)?Object.assign({label:String(o),value:o},t):{label:String(o),value:o},a=o=>{const n=t.props.memoOptions.findIndex((t=>e.eq(Se(t),Se(o))));return-1===n?t.props.memoOptions=[...t.props.memoOptions,o]:t.props.memoOptions[n]=o,o};return r instanceof Promise?r.then((e=>{if("string"==typeof e||we(e))return a(s(e))})).finally((()=>{t.props.optionLoaderValues=t.props.optionLoaderValues.filter((e=>e!==o)),t.props.optionLoadingCounter--})):(t.props.optionLoaderValues=t.props.optionLoaderValues.filter((e=>e!==o)),t.props.optionLoadingCounter--,a(s(r)))}function Ve(e){e.store.set(Ce),e.props.optionsLoadingCounter++,e.store.set(t.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}));const o=e.props.nonceKey&&e.props[e.props.nonceKey],n=e.props.optionsLoader(e.context,Oe.get(e)),r=Ee.bind(null,e),s=n instanceof Promise?n.then(((...t)=>{void 0!==e.props.nonceKey&&o!==e.props[e.props.nonceKey]||r(...t)})):(r(n),e.props.optionsLoadingCounter--);if(s instanceof Promise)return s.finally((()=>{e.props.optionsLoadingCounter--}))}function Fe(e,o){e.props.page++,Oe.set(e,o),e.store.set(t.createMessage({key:"hasNextPage",type:"state",value:!0,visible:!1}))}const Pe=Symbol(),Be=t=>{const o=(e=>{const t=[...e.props.allOptions,...e.props.initialOptions];return[...e.props.memoOptions||[],...t]})(t),n=t.props.inputStd||[],r=[];for(const t of n){let n,s=o.find((o=>e.eq(Se(o),t)));n=e.isPojo(t)?void 0:Array.isArray(t)?t.join(", "):t,s||(s={value:t,label:n,isPlaceholder:!1,noOptionFound:!0}),r.push(s)}return r};function He(t,o){if(t.props.optionRemoved=!0,o){const n=(t.props.inputStd||[]).filter((t=>!e.eq(Se(o),t)));t.input(n)}else t.input(void 0);t.props.openOnRemove&&!t.props.expanded&&t.isCreated&&(t.props.expanded=!0),setTimeout((()=>{var e;return t.emit("selectRange",[null===(e=t.props.highlightedRange)||void 0===e?void 0:e.option])}),20)}async function Re(e){const t=Be(e);e.props.resetSearchOnCommit&&"function"===e.props.optionsLoader&&(e.props.searchValue=""),e.props.selections=[...t];const o=[...t,...e.props.memoOptions];e.props.memoOptions=[...new Set(o)],function(e){var t,o;e.props.firstCommit?e.props.firstCommit=!1:c&&e.isCreated&&(e.props.optionRemoved?e.props.optionRemoved=!1:(e.props.expanded&&e.props.closeOnSelect&&(e.props.expanded=!1),e.props.userAction&&(e.props.openOnFocus&&(e.props.skipOpen=!0),"tagDelete"!==e.props.userAction.type&&(null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.userAction=void 0)))}(e)}function Ne(t){var o,n;if(t.props.allOptions&&t.props.allOptions.length)if(null===(o=t.props.highlightedRange)||void 0===o?void 0:o.option.value)t.props.activeValue=Se(t.props.highlightedRange.option);else{if(t.props.activeSelectionValue){const o=t.props.allOptions.find((o=>e.eq(Se(o),t.props.activeSelectionValue)));if(o)return void(t.props.activeValue=o.value)}if(t.props.reloadOnCommit)t.props.activeValue=Se(t.props.allOptions[0]);else{if(t.props.searchValue&&!t.props.appendingOptions)t.props.activeValue=Se(t.props.allOptions[0]);else if(t.props.inputStd.length>0&&!t.props.multiple||t.props.multiple&&(null===(n=t.context)||void 0===n?void 0:n.state.dirty))t.props.selections[t.props.selections.length-1]?t.props.activeValue=Se(t.props.selections[t.props.selections.length-1]):t.props.activeValue=Se(t.props.allOptions[0]);else{if(t.props.appendingOptions)return void(t.props.appendingOptions=!1);t.props.activeValue=Se(function(e){return e.props.allOptions.find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}))}(t))}t.props.appendingOptions&&(t.props.appendingOptions=!1)}}}function Ke(e){return e.reduce(((e,t)=>(t.options?e.push(...Ke(t.options)):e.push(t),e)),[])}function We(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(Se(t)!==Pe?(e.props.option=t,e.props.maxReached&&!ze(e,t)||(e.input(qe(e,Se(t))),ze(e,t)&&e.props.closeOnSelect&&(e.props.expanded=!1))):null===(n=e.context)||void 0===n||n.handlers.loadMore(!0))}function qe(t,o){if(t.props.multiple){const n=Array.isArray(t.value)?t.value:[];for(const r of n)if(e.eq(r,o))return t.props.optionRemoved=!0,n.filter((t=>!e.eq(t,o)));return[...n,o]}return e.eq(o,t.value)&&t.props.deselect?void(t.props.optionRemoved=!0):o}function Ue(t,o){return e.eq(t.props.activeValue,Se(o))||void 0}function ze(t,o){if(t.props.multiple){if(!Array.isArray(t.value))return!1;for(const n of t.value)if(e.eq(n,Se(o)))return!0;return!1}return e.eq(t.value,Se(o))}function Ye(e){var t,o;if(!e.props.usePopover||"overscroll"===e.props.behavior)return;const n=e.props.invertPopover?e.props.popoverCoordinates.y-e.props.popoverCoordinates.height-e.props.popoverOffset-e.props.popoverAncestorCoordinates.height:e.props.popoverCoordinates.y+e.props.popoverOffset;e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,minWidth:0,width:"100%",maxWidth:(null===(o=null===(t=e.props)||void 0===t?void 0:t.popoverAncestorCoordinates)||void 0===o?void 0:o.width)+"px",top:n+"px",bottom:"unset",left:e.props.popoverCoordinates.x+"px",margin:0,padding:0}}function je(t){t.props.firstCommit=!0;let o=null;t.on("commit",(()=>{if(0===t.props.inputStd.length&&t.isCreated)return function(e){var t,o;e.props.selections=[],e.props.userAction&&(e.props.userAction=void 0,e.props.openOnFocus&&(e.props.skipOpen=!0),null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.optionRemoved=!1}(t),void(o=t.props.inputStd);if(t.props.inputStd.length&&"function"==typeof t.props.optionsLoader&&0===t.props.options.length&&"function"!=typeof t.props.optionLoader&&0===t.props.optionsLoadingCounter){t.props.optionsLoaded=!0;const e=Ve(t);e instanceof Promise&&e.then((()=>{Re(t)}))}"function"!=typeof t.props.optionLoader||t.props.optionRemoved||function(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let o=0;o<e.length;++o)if(e[o]!==t[o])return!1;return!0}(o,t.props.inputStd)?0===t.props.optionsLoadingCounter&&Re(t):(o=t.props.inputStd,async function(t){const o=Be(t),n=t.props.inputStd.length>1?t.props.inputStd.filter((o=>!t.props.memoOptions.find((t=>e.eq(Se(t),o))))):t.props.inputStd;if(n.forEach((n=>{Me(t,n,Array.isArray(o)&&o.find((t=>e.eq(Se(t),n)&&!t.noOptionFound)))})),t.props.optionLoadingCounter){const e=t.on("prop:optionLoadingCounter",(()=>{Re(t),t.props.optionLoadingCounter||t.off(e)}))}else Re(t)}(t))}))}const Ze=new WeakSet;function Ge(t){if(!c)return;t.props.positionListBox=function(t,o){var n,r;let s=null;if(t.props.activeDescendant){s=t.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((o=>e.eq(t.value,Se(o)))),-1===s&&(s=null);(null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(t.props.activeDescendant))&&Xe(t)}if("undefined"==typeof window)return s;const a=o.getBoundingClientRect(),l=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}`);if(l){const e=l.getBoundingClientRect();e.top+e.height+a.height>window.innerHeight&&e.top+e.height>a.height?(t.props.invertPopover=!0,t.props.usePopover||(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,top:"auto",bottom:"100%"})):t.props.usePopover||(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,bottom:"auto",top:"100%"})}return s}.bind(null,t),t.props.styleWrapper=Je.bind(null),t.on("mounted",(()=>{e.whenAvailable(`${t.props.id}_popover`,r.bind(null,t),t.props.__root)}));const o=e=>{var o;t.props.mouseX=e.clientX,t.props.mouseY=e.clientY;const n=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}_popover`);if(n){const o=n.getBoundingClientRect();e.clientX>o.x&&e.clientX<o.x+o.width&&e.clientY>o.y&&e.clientY<o.y+o.height&&(t.props.trackHover=!0)}},n=()=>{t.props.ignoreScroll?t.props.ignoreScroll=!1:t.props.trackHover=!0};function r(e,t){"overscroll"!==e.props.behavior&&"none"===getComputedStyle(t).maxHeight&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,maxHeight:"400px"});const o=new MutationObserver((o=>{const n=o[0].target;if("overscroll"===e.props.behavior&&n.id!==`${e.props.id}_popover`)return;const r=e.props.positionListBox(t);Ze.delete(e),s(e,r);let a,l=null;const i=new ResizeObserver((()=>{clearTimeout(a),a=setTimeout((()=>{e.props.styleWrapper(),e.props.positionListBox(t),l||(l=e.on("prop:expanded",(()=>{i.disconnect(),e.off(l)})))}))}));i.observe(t)}));o.observe(t,{childList:!0,subtree:!0})}function s(e,t){var o;if(!e.props.expanded||!e.props.options||!e.props.options.length||Ze.has(e))return;const n=e.props.options.reduce(((t,o,n)=>{var r,s,a;if(null===(r=o.attrs)||void 0===r?void 0:r.disabled)return t;if("group"in o&&(null===(s=o.options)||void 0===s?void 0:s.length))return o.options.forEach(((o,r)=>{var s;const a=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_listitem_${n}_${r}`);a&&t.push([a,o])})),t;const l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_listitem_${n}`);return l&&t.push([l,o]),t}),[]),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);r&&n.push([r,e.props.loadMoreOption]),Ze.add(e),n.length&&a(e,n,t)}function a(e,t,o){var n,r,l,i;const p=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_popover`);if(e.props.trackHover){const n=p?p.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.mouseY>n.top&&e.props.mouseY<n.bottom){let n=o||0,r=o;const s=(t,n)=>{var r;const s=n[0],{y:a,height:l,x:i,width:p}=s.getBoundingClientRect();if(e.props.mouseX>i&&e.props.mouseX<i+p&&e.props.mouseY>a&&e.props.mouseY<a+l){o=t;const s=n[1];return s&&!(null===(r=s.attrs)||void 0===r?void 0:r.disabled)?e.props.activeValue=Se(s):e.props.activeValue=void 0,!0}return!1};do{if(null!==n&&s(n,t[n]))break;if(null!==r&&s(r,t[r]))break;null!==n&&(n++,n>t.length-1&&(n=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==n||null!==r)}null===o&&(e.props.activeValue=void 0)}e.props.trackHover||Xe(e),e.props.expanded?(p&&e.props.loadOnScroll&&!(null===(r=e.store.loading)||void 0===r?void 0:r.value)&&(null===(l=e.store.hasNextPage)||void 0===l?void 0:l.value)&&p.scrollTop+p.offsetHeight>p.scrollHeight-200&&(null===(i=e.context)||void 0===i||i.handlers.loadMore(!0)),Ze.has(e)?requestAnimationFrame(a.bind(null,e,t,o)):s(e,o)):Ze.delete(e)}t.on("prop:trackHover",(({payload:e})=>{var o,r,s;c&&(e?null===(s=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}_popover`))||void 0===s||s.removeEventListener("scroll",n):null===(o=t.props.__root)||void 0===o||o.getElementById(`${t.props.id}_popover`))})),t.on("prop:expanded",(({payload:e})=>{t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,zIndex:e||t.props.forceExpanded?"999":"-1",pointerEvents:e?"auto":"none"},e?(document.addEventListener("mousemove",o),t.props.styleWrapper(),Ne(t)):document.removeEventListener("mousemove",o)})),t.on("prop:trackHover",(({payload:e})=>{var o,r;c&&(e?null===(r=document.getElementById(`${t.props.id}_popover`))||void 0===r||r.removeEventListener("scroll",n):null===(o=document.getElementById(`${t.props.id}_popover`))||void 0===o||o.addEventListener("scroll",n))})),t.on("prop:activeValue",(({payload:o})=>{if(o===Pe)return void(t.props.activeDescendant=`${t.props.id}_load_more`);let n,r=-1;for(let s=0;s<t.props.options.length;s++){if("group"in t.props.options[s])for(let a=0;a<t.props.options[s].options.length;a++)if(e.eq(Se(t.props.options[s].options[a]),o)){r=a,n=s;break}if(e.eq(Se(t.props.options[s]),o)){r=s;break}}t.props.activeDescendant=r<0?void 0:void 0===n?`${t.props.id}_listitem_${r}`:`${t.props.id}_listitem_${n}_${r}`}))}function Xe(e){var t,o;if(!c)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_popover`),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);if(!n||!r)return;const{y:s,height:a}=r.getBoundingClientRect(),{y:l,height:i}=n.getBoundingClientRect();s<l?(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop):s+a>l+i&&(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop+a-i)}function Je(){}const Qe=new WeakMap;function et(t){t.on("created",(()=>{if(!t.context||!c)return;t.context.fns.isActive=Ue.bind(null,t),t.context.fns.isSelected=e=>ze(t,e),t.context.fns.hasOptionLoaderValue=o=>{for(const n of t.props.optionLoaderValues)if(e.eq(Se(o),n))return!0;return!1},t.context.handlers.listitemGroupClick=dt,t.context.handlers.selectOption=e=>o=>ct.call(null,t,e,o),t.context.handlers.loadMore=Ae.bind(null,t),t.context.handlers.removeSelection=e=>o=>pt(t,e,o),t.context.handlers.tagTouchstart=e=>o=>pt(t,e,o),t.context.handlers.selectionClick=e=>t.props.multiple?rt.bind(null,t,e):nt.bind(null,t),t.context.handlers.selectionBlur=()=>st.bind(null,t),t.context.fns.isActiveSelection=(t,o)=>e.eq(t,Se(o)),t.context.handlers.tagClick=e=>at.bind(null,t,e),t.context.handlers.tagFocus=e=>lt.bind(null,t,e),t.context.handlers.tagBlur=()=>it.bind(null,t);const o=t.context.handlers.blur;t.context.handlers.blur=function(e,t){var n;if(t&&t.relatedTarget instanceof HTMLElement){const o=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(e.props.id+"_inner");if(o instanceof HTMLElement&&o.contains(t.relatedTarget))return}o(),function(e){if(e.props.disabled)return;e.props.expanded=!1,e.props.activeSelectionValue=void 0,e.emit("blur")}(e)}.bind(null,t),t.context.handlers.touchmove=tt.bind(null,t),t.context.handlers.touchend=ot.bind(null,t)}))}function tt(e,t){var o;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(n instanceof HTMLInputElement){const o=Qe.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else Qe.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function ot(e){Qe.delete(e)}function nt(e,t){e.props.disabled||((!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0),t.currentTarget instanceof HTMLElement&&t.currentTarget.focus())}function rt(t,o,n){n.currentTarget instanceof HTMLElement&&(e.eq(t.props.activeSelectionValue,Se(o))?t.props.activeSelectionValue=void 0:(t.props.activeSelectionValue=Se(o),n.currentTarget.focus()))}function st(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function at(t,o,n){n.stopPropagation(),t.props.disabled||(t.props.justFocused?t.props.justFocused=!1:n.currentTarget instanceof HTMLElement&&(e.eq(t.props.activeSelectionValue,Se(o))?t.props.activeSelectionValue=void 0:(t.props.activeSelectionValue=Se(o),n.currentTarget.focus())))}function lt(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=Se(t),e.props.justFocused=!0)}function it(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function pt(e,t,o){o&&o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleRemoveSelection"},He(e,t))}function dt(e){e.stopPropagation()}function ct(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},We(e,t))}function ut(o,n,r,s){!function(o){o.addProps(["options","expanded","placeholder","multiple","selections","activeValue","activeDescendant","forceExpanded","optionLoader","showEmptyMessage","emptyMessage","option","listboxStyles","invertPopover","dropdownWrapperStyles","optionsLoader","loadMoreOption","hasNextPage","page","behavior","selectionRemovable","openOnRemove","clearOnClick","openOnClick","hideOnOpen","closeOnSelect","openOnFocus","selectionAppearance","optionsAppearance","filter","inputText","formattedSelections","lastVisibleIndex","optionLoaderValues","disabledInternally","isLoadingOption","isLoadingOptions","thereIsAnOptionSelected","formattedSelections","activeSelections","allowNewValues","inputStd","isSingleOption","max","disableDragAndDrop","clearSearchOnOpen","firstSelectionLabel","memoOptions","loadOnCreated","alwaysLoadOnOpen","showFormattedSelections","truncationCount","reloadOnCommit","activeSelectionValue","setForceExpanded","option","loadOnScroll","optionsLoadingCounter","optionLoadingCounter","draggable","deselect"]),void 0===o.props.deselect?o.props.deselect=!0:o.props.deselect=e.undefine(o.props.deselect),o.props.option={},o.props.expanded=!1,o.props.inputStd=[],void 0===o.props.draggable?o.props.draggable=!0:"false"===o.props.draggable&&(o.props.draggable=!1),o.props.options||(t.warn(350,{node:o,inputType:o.props.type}),o.props.options=[]),"disabled"in o.props&&(o.props.disabled=e.undefine(o.props.disabled)),o.props.allOptions=Ke(o.props.options),o.props.selections=[],o.props.memoOptions=[],o.props.invertPopover=!1,o.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},o.props.decrementCount=0,o.props.page=1,o.props.loadMoreOption={label:"Load more",value:Pe},o.props.loadOptions=Ve,o.props.listboxStyles={},o.props.optionsLoadingCounter=0,o.props.optionLoadingCounter=0,o.props.searchable=e.undefine(o.props.searchable),o.props.loadOnScroll=e.undefine(o.props.loadOnScroll),o.props.multiple=e.undefine(o.props.multiple)||!1,"taglist"===o.props.type&&(o.props.multiple=!0),o.props.openOnFocus=e.undefine(o.props.openOnFocus),o.props.openOnRemove=void 0!==o.props.openOnRemove&&e.undefine(o.props.openOnRemove),o.props.hasNextPage=Fe.bind(null,o),o.props.initialOptions=[...o.props.options],o.props.optionLoaderValues=[],o.props.loadOnCreated=e.undefine(o.props.loadOnCreated),o.props.max&&"number"!=typeof o.props.max?o.props.max=parseInt(o.props.max):o.props.max&&!o.props.multiple&&(o.props.max=void 0),o.on("mounted",(()=>Ye(o))),o.on("prop:popoverCoordinates",(()=>setTimeout((()=>{Ye(o)}),10)))}(s),s.props.multiple?function(e){e.hook.input(((t,o)=>(e.props.highlightedRange&&!e.props.optionRemoved&&(t.splice(e.props.highlightedRange.index,1,Se(e.props.option)),t=t.filter((e=>void 0!==e))),e.props.inputStd=t&&Array.isArray(t)?[...new Set(t)]:[],o(void 0===t?void 0:[...e.props.inputStd]))))}(s):function(e){e.hook.input(((t,o)=>(e.props.inputStd=void 0===t||""===t||null===t?[]:[t],o(t))))}(s),o(s),je(s),function(t){t.on("created",(()=>{t.context&&(t.props.trackHover=!0,void 0!==t.props.disabled||t.props.optionsLoader||!t.props.options||t.props.options.length||void 0!==t.props.emptyMessage||t.props.allowNewValues||0!==t.props.inputStd.length||(t.props.disabledInternally=!0),Ge(t),t.props.loadOnCreated&&!t.props.optionsLoaded&&t.props.optionsLoader?Ve(t):t.props.optionsLoaded&&(t.props.optionsLoaded=!1),t.props.forceExpanded=e.undefine(t.props.forceExpanded),t.props.forceExpanded&&(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,zIndex:"999",pointerEvents:"auto"},setTimeout((()=>{t.props.setForceExpanded=!0}),100)))}))}(s),et(s),n(s),function(e){e.on("prop:selections",(({payload:t})=>{e.props.max&&(e.props.maxReached=t.length>=e.props.max)})),e.on("prop:maxReached",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:optionsLoadingCounter",(({payload:t})=>{0===t&&(e.props.emptyMessage&&(e.props.showEmptyMessage=!e.props.options.length),0===e.props.optionLoadingCounter&&e.store.set(Te))})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&e.store.set(Te)})),e.on("prop:disabled",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:options",(({payload:t})=>{e.props.allOptions=Ke(e.props.options),e.props.emptyMessage&&"function"!=typeof e.props.optionsLoader&&(e.props.showEmptyMessage=!t.length),t.length?e.props.disabledInternally=!1:t.length||e.props.optionsLoader||void 0!==e.props.emptyMessage||e.props.allowNewValues||0!==e.props.inputStd.length||e.props.searchValue||(e.props.disabledInternally=!0),Ne(e)})),e.on("prop:expanded",(({payload:o})=>{var n;if(c)if(e.props.alwaysLoadOnOpen&&(e.props.page=1),o){if(e.props.trackHover=!1,e.props.options&&!e.props.options.length&&"function"!=typeof e.props.optionsLoader&&e.props.emptyMessage&&(e.props.showEmptyMessage=!0),setTimeout((()=>document.addEventListener("click",t)),10),"text-input"===e.props.selectionAppearance&&e.props.multiple)return;const o=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);o instanceof HTMLInputElement&&(o.focus(),e.props.searchExpand||(o.value="",o.value=e.props.inputText))}else document.removeEventListener("click",t),e.props.trackHover=!1,e.props.showEmptyMessage=!1}));const t=()=>{e.props.activeSelectionValue=void 0,e.props.expanded=!1}}(s),r(s)}function ft(t){void 0===t.props.closeOnSelect?t.props.closeOnSelect=!t.props.multiple:t.props.closeOnSelect=e.undefine(t.props.closeOnSelect),(t.props.multiple&&void 0===t.props.selectionAppearance||"truncate"===t.props.selectionAppearance)&&(t.props.selectionAppearance="truncate",t.props.formattedSelections=[]),t.props.multiple?t.props.selectionRemovable=!1:t.props.selectionRemovable=e.undefine(t.props.selectionRemovable)}function vt(e){var t,o;e.props.searchValue||null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===o||o.focus()}function ht(t,o,n){var r,s,a;if(n.preventDefault(),t.props.trackHover=!1,t.props.expanded){const n=t.props.allOptions.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(Se(t)),e}),[]);(null===(r=t.store.hasNextPage)||void 0===r?void 0:r.value)&&n.push(Pe);let l=-1;t.props.activeValue&&(l=n.findIndex((o=>e.eq(o,t.props.activeValue)))),-1===l&&n.length?t.props.activeValue=n[0]:"ArrowDown"===o&&n.length>l+1?t.props.activeValue=n[l+1]:"ArrowUp"===o&&l>0?t.props.activeValue=n[l-1]:"ArrowUp"===o&&0===l&&(null===(a=null===(s=t.props.__root)||void 0===s?void 0:s.getElementById(`${t.props.id}_tag-wrapper_${t.props.selections.length-1}`))||void 0===a||a.focus(),t.props.expanded=!1)}else t.props.expanded||"ArrowDown"!==o||(t.props.expanded=!0)}function mt(e,t){var o,n,r;if(("taglist"===e.props.type||"tags"===e.props.selectionAppearance)&&e.props.inputStd.length&&!e.props.inputText){if("ArrowLeft"===t)return e.props.selections.length&&(null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===n||n.focus(),e.props.selections[e.props.selections.length-1]?e.props.activeSelectionValue=Se(e.props.selections[e.props.selections.length-1]):e.props.activeSelectionValue=void 0),void(e.props.expanded=!1);"ArrowRight"===t&&(null===(r=document.getElementById(`${e.props.id}_tag-wrapper_0`))||void 0===r||r.focus(),e.props.selections[0]?e.props.activeSelectionValue=Se(e.props.selections[0]):e.props.activeSelectionValue=void 0),e.props.expanded=!1}}function gt(e){var t,o;e.props.expanded=!0,null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()}function $t(t,o,n,r=!0){var s,a,l,i,p,d,c;const u=n.key;if(n.altKey){const r=ke(),s=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o)))),a=[...t.props.selections];"ArrowRight"===n.key?s<t.props.selections.length-1&&(a.splice(s,1),a.splice(s+1,0,o)):"ArrowLeft"===n.key&&s>0&&(a.splice(s,1),a.splice(s-1,0,o)),t.props.activeSelectionValue=Se(o),t.input([...a.map(Se)]),setTimeout((()=>{r instanceof HTMLElement&&r.focus()}),100)}else{const n=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===n)return;const f="ArrowRight"===u?n+1:n-1;if(f>=t.props.selections.length){if(!r)return t.props.expanded=!0,t.props.activeSelectionValue=void 0,void(null===(a=null===(s=t.props.__root)||void 0===s?void 0:s.getElementById(`${t.props.id}`))||void 0===a||a.focus());null===(i=null===(l=t.props.__root)||void 0===l?void 0:l.getElementById(`${t.props.id}`))||void 0===i||i.focus()}else if(f<0&&0===n)null===(d=null===(p=t.props.__root)||void 0===p?void 0:p.getElementById(`${t.props.id}`))||void 0===d||d.focus();else if(f<0)return;const v=null===(c=t.props.__root)||void 0===c?void 0:c.getElementById(`${t.props.id}_tag-wrapper_${f}`);v&&v.focus(),t.props.selections[f]?t.props.activeSelectionValue=Se(t.props.selections[f]):t.props.activeSelectionValue=void 0}}function bt(t,o,n){var r;if(!(n.currentTarget instanceof HTMLElement))return;if(t.props.searchValue)return;const s=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===s)return;const a=t.props.selections[s+1]?s+1:s-1,l=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}_tag-wrapper_${a}`);l&&l.focus(),t.props.userAction={type:"tagDelete"},He(t,o)}function yt(t,o){var n;if(o.preventDefault(),t.props.allowNewValues&&t.props.searchValue&&t.input(qe(t,t.props.searchValue)),t.props.expanded){if(t.props.activeValue===Pe)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore(!0));const o=t.props.allOptions.find((o=>e.eq(Se(o),t.props.activeValue)));if(!o)return;We(t,o)}else t.props.expanded=!0}function xt(e){e.props.expanded&&(e.props.expanded=!1)}function wt(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":gt(e);break;case"ArrowRight":case"ArrowLeft":$t(e,t,o,!1);break;case"Delete":case"Backspace":bt(e,t,o)}}function _t(t,o,n){if(t.props.disabled)return;switch(n.key){case"ArrowUp":case"ArrowDown":!function(t,o,n){var r,s,a,l;n.preventDefault();const i=n.key,p=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===p)return;const d="ArrowDown"===i?p+1:p-1;if(d<0&&(null===(s=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}`))||void 0===s||s.focus()),d<0||d>=t.props.selections.length)return;const c=null===(a=t.props.__root)||void 0===a?void 0:a.getElementById(`${t.props.id}_selection_wrapper_${d}`);c&&c.focus(),t.props.activeSelectionValue=(null===(l=t.props.selections[d])||void 0===l?void 0:l.value)||void 0}(t,o,n);break;case"Enter":break;case"Tab":!function(t,o,n){var r,s,a,l;if(o){const i=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===i)return;const p=n.shiftKey?i-1:i+1;if(p>=t.props.selections.length)return;if(p<0)return void(null===(s=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}`))||void 0===s||s.focus());const d=null===(a=t.props.__root)||void 0===a?void 0:a.getElementById(`${t.props.id}_selection_wrapper_${p}`);d&&d.focus(),t.props.activeSelectionValue=(null===(l=t.props.selections[p])||void 0===l?void 0:l.value)||void 0}}(t,o,n);break;case"Delete":case"Backspace":!function(t,o){var n;if(o){const r=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===r)return;const s=t.props.selections[r+1]?r+1:r-1,a=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(`${t.props.id}_selection_wrapper_${s}`);a&&a.focus(),t.props.selections[s]?t.props.activeSelectionValue=Se(t.props.selections[s]):t.props.activeSelectionValue=void 0}o&&1!==t.props.selections.length||(t.props.userAction={type:"selectionDelete"}),He(t,o)}(t,o)}}function kt(e,t){if(e.props.disabled)return;if(!(t.currentTarget instanceof HTMLElement)||e.props.id!==t.currentTarget.id)return;const o=t.key;switch(o){case"Tab":!function(e){e.props.expanded&&(e.props.expanded=!1)}(e);break;case"ArrowUp":case"ArrowDown":ht(e,o,t);break;case"ArrowLeft":case"ArrowRight":mt(e,o);break;case"Enter":yt(e,t);break;case"Escape":xt(e);break;case"Delete":case"Backspace":vt(e);break;default:e.emit("unusedKeydown",t)}}function St(e,t){if(e.props.disabled)return;if(!(t.currentTarget instanceof HTMLElement)||e.props.id!==t.currentTarget.id)return;const o=t.key;switch(o){case"Tab":!function(e,t){var o,n,r;e.props.expanded=!1,e.props.multiple&&e.props.selections.length&&"autocomplete"===e.props.type&&"option"===e.props.selectionAppearance&&(t.preventDefault(),null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_selection_wrapper_0`))||void 0===n||n.focus(),e.props.activeSelectionValue=(null===(r=e.props.selections[0])||void 0===r?void 0:r.value)||void 0)}(e,t);break;case"ArrowUp":case"ArrowDown":ht(e,o,t);break;case"ArrowRight":case"ArrowLeft":mt(e,o);break;case"Enter":yt(e,t);break;case"Escape":xt(e);break;case"Delete":case"Backspace":vt(e)}}function Lt(t){t.props.alwaysLoadOnOpen=void 0!==t.props.alwaysLoadOnOpen&&e.undefine(t.props.alwaysLoadOnOpen),t.on("created",(()=>{t.context&&(t.context.handlers.click=It.bind(null,t),t.context.handlers.focus=Dt.bind(null,t),t.context.handlers.keydown=kt.bind(null,t),t.context.handlers.selectorTagKeydownHandler=e=>wt.bind(null,t,e))}))}function It(e,t){var o;if(t.stopPropagation(),0===t.detail)return;if(e.props.disabled)return;e.props.attrs.onClick&&e.props.attrs.onClick(t);const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);e.props.justOpened?e.props.justOpened=!1:e.props.expanded?e.props.expanded=!1:(n&&"mouse"!==t.pointerType?(e.props.mouseX=-1,e.props.mouseY=-1):(e.props.mouseX=t.clientX,e.props.mouseY=t.clientY),e.props.expanded=!0,null==n||n.focus())}function Dt(e){e.props.disabled||(e.props.attrs.onFocus&&e.props.attrs.onFocus(),e.props.skipOpen?e.props.skipOpen=!1:e.props.openOnFocus&&(e.props.justOpened=!0,e.props.expanded=!0))}function At(t){let o,n="";t.on("unusedKeydown",(({payload:r})=>{if(!r.isComposing&&1===[...r.key].length){if(!n&&" "===r.key)return void function(t,o){var n;if(o.preventDefault(),t.props.expanded){if(t.props.activeValue===Pe)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore());const o=t.props.allOptions.find((o=>e.eq(Se(o),t.props.activeValue)));if(!o)return;We(t,o)}else t.props.expanded=!0}(t,r);t.props.expanded=!0,clearTimeout(o),n+=r.key;const s=t.props.allOptions.find((e=>e.label.toLowerCase().startsWith(n.toLowerCase())));s&&(t.props.activeValue=Se(s)),o=setTimeout((()=>{n=""}),400)}}))}function Ct(t){Tt(t),t.on("prop:selections",(()=>{t.props.skipFormatSelections=!1,Tt(t)})),c&&e.whenAvailable(`${t.props.id}_selections`,Ot.bind(null,t),t.props.__root)}function Tt(e){e.isCreated&&(e.props.selections.length&&e.props.lastVisibleIndex&&e.props.selections.length-e.props.lastVisibleIndex>1?e.props.truncationCount="+ "+(e.props.selections.length-e.props.lastVisibleIndex-1).toString():e.props.truncationCount=void 0,e.props.formattedSelections=e.props.selections.map(((t,o)=>e.props.lastVisibleIndex&&o===e.props.lastVisibleIndex&&0!==o?e.props.lastTruncatedElText&&o===e.props.selections.length-1?e.props.lastTruncatedElText:o===e.props.selections.length-1?t.label:t.label+"...":o===e.props.selections.length-1?t.label:t.label+", ")))}function Et(e){var t,o;if(!c||!e.context)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_selections`);if(!(n instanceof HTMLElement))return;const r=n.parentNode;if(!(r instanceof HTMLElement))return;let s=n.getBoundingClientRect().width;const a=.98*r.getBoundingClientRect().width,l=Array.prototype.slice.call(n.children),i=[...e.props.selections];if(s>a){const t=[];let n=0;for(let e=0;e<i.length;e++)t.push([i[e],l[e]]);for(let r=t.length-1;r>=0;r--){const l=t[r];if(!(l[1]instanceof HTMLElement))return;n+=l[1].getBoundingClientRect().width+parseFloat(window.getComputedStyle(l[1]).marginRight)+parseFloat(window.getComputedStyle(l[1]).marginLeft);const i=s-n;if(a>i){const t=l[0].label;e.props.skipFormatSelections=!0,l[1].textContent=t;let n=!1;for(let s=t.length;s>=0;s--){if(e.props.skipFormatSelections=!0,l[1].textContent=t.slice(0,s).trim()+"...",i+l[1].getBoundingClientRect().width<a){if(s<4){e.props.lastVisibleIndex=r-1,e.props.lastTruncatedElText=null;break}if(e.props.lastVisibleIndex=r,e.props.lastTruncatedElText&&l[1].textContent.slice(0,4)===e.props.lastTruncatedElText.slice(0,4))break;e.props.lastTruncatedElText=null===(o=l[1])||void 0===o?void 0:o.textContent;break}0===s&&(n=!0)}l[1].textContent=e.props.lastTruncatedElText&&!n&&0!==r?e.props.lastTruncatedElText:t,null===e.props.lastVisibleIndex&&(e.props.lastVisibleIndex=0===r?0:r-1,e.props.lastTruncatedElText=null),setTimeout((()=>{Tt(e)}));break}}}else e.props.lastTruncatedElText=null,e.props.lastVisibleIndex=null,Tt(e)}function Ot(e,t){const o=new ResizeObserver((()=>{e.props.selections&&0!==e.props.selections.length&&(e.props.skipFormatSelections?e.props.skipFormatSelections=!1:Et(e))})),n=new ResizeObserver((()=>{Et(e)}));o.observe(t),t.parentNode instanceof Element&&n.observe(t.parentNode)}const Mt={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Vt={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Ft={overflow:"hidden",height:"100%"},Pt={},Bt={};let Ht=0;function Rt(e){var t,o;if("undefined"==typeof window)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_popover`),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!r||!n)return;const s=n.style.paddingTop,a=n.style.paddingBottom,l=n.style.paddingLeft;n.style.paddingTop="0",n.style.paddingBottom="0",n.style.paddingLeft="0";const i=r.getBoundingClientRect(),p=n.getBoundingClientRect(),d=Math.round(i.top-p.top)+"px",c=Math.round(i.left-p.left-5)+"px",u=Math.max(Math.round(Math.min(p.height-p.top,window.innerHeight)-(i.top+i.height)),0)+"px";n.style.paddingTop=s,n.style.paddingBottom=a,n.style.paddingLeft=l,e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,paddingTop:d,paddingLeft:c,paddingBottom:u},e.props.listboxStyles={...e.props.listboxStyles,minWidth:"overscroll"===e.props.behavior?`min(${i.width+"px"}, calc(100vw - 4em))`:i.width+"px",maxWidth:"calc(100vw - 4em)"}}function Nt(t,o){var n,r;let s=null;if(t.props.activeDescendant){const a=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(t.props.activeDescendant);if(!a)return s;t.props.ignoreScroll=!0;const l=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}_listbox`);if(!l)return s;const i=o.getBoundingClientRect(),p=l.getBoundingClientRect(),d=parseInt(getComputedStyle(o).paddingTop),c=parseInt(getComputedStyle(o).paddingBottom),u=a.offsetTop-d,f=Math.max(u-d,0),v=Math.max(o.scrollHeight-c-u-i.height,0),h=p.height-f-v;o.scrollTop=u;const m=()=>{o.scrollTop=v>0?v<d?o.scrollHeight:d:f<c?0:u-c},g=Math.min(150,p.height);f>0&&v>0||0===f&&0===v||h>g?o.scrollTop=u:m();o.clientHeight/2<o.scrollTop&&(s=t.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((o=>e.eq(t.value,Se(o))))),-1===s&&(s=null)}return s}function Kt(o){o.addProps(["behavior"]),o.on("created",(()=>{"overscroll"===o.props.behavior&&("function"==typeof o.props.optionsLoader&&t.error(300,[o]),o.props.dropdownWrapperStyles=e.clone(Mt),o.props.listboxStyles={display:"inline-block"},o.props.styleWrapper=Rt.bind(null,o),o.props.positionListBox=Nt.bind(null,o))})),o.on("prop:expanded",(({payload:e})=>{"overscroll"===o.props.behavior&&(e?function(){Ht=document.documentElement.scrollTop;for(const e in Vt)Bt[e]=document.documentElement.style[e],document.documentElement.style[e]=Vt[e];for(const e in Ft)Pt[e]=document.body.style[e],document.body.style[e]=Ft[e];document.body.scrollTop=Ht}():function(){for(const e in Vt)document.documentElement.style[e]=Bt[e];for(const e in Ft)document.body.style[e]=Pt[e];document.body.scrollTop=0,document.documentElement.scrollTop=Ht}())}))}function Wt(t){t.addProps(["multiLine"]),t.on("created",(()=>{c&&(t.props.multiLineHeight=void 0,e.whenAvailable(`${t.props.id}_selections`,qt.bind(null,t),t.props.__root))}))}function qt(e){var t;const o=new ResizeObserver((t=>{for(const o of t){const{height:t}=o.contentRect;e.props.selectionsHeight!==t&&(e.props.selectionsHeight=t),Ut(e,o.target)}})),n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_selections`);n&&o.observe(n)}function Ut(e,t){var o;const n=t.querySelectorAll(`[id^="${e.props.id}_tag-wrapper"`);let r,s=[];if("taglist"===e.props.type){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;s=[t,...Array.from(n)]}else s=Array.from(n);if(!n)return;let a=!1;for(const t of s)if(void 0===r)r=t.getBoundingClientRect();else{const o=t.getBoundingClientRect();if(r.top>=o.top+o.height/5||r.top<=o.top-o.height/5){a=!0,e.props.multiLine=!0;break}}a||(e.props.multiLine=!1)}function zt(t){if(t.on("created",(()=>{t.context&&At(t)})),t.props.multiple||function(e){e.on("prop:selections",(({payload:t})=>{var o;e.props.firstSelectionLabel=(null===(o=t[0])||void 0===o?void 0:o.label)||"",e.props.option=t[0]}))}(t),"truncate"===t.props.selectionAppearance&&(t.props.lastVisibleIndex=null,Ct(t),t.on("prop:selections",(()=>{Ct(t)}))),"tags"===t.props.selectionAppearance&&Wt(t),t.props.multiple&&"tags"===t.props.selectionAppearance){function o(){return Array.isArray(t.value)?t.value:[]}function r(e,o){t.input(e)}t.on("created",(()=>{t.props.disabled&&(t.props.draggable=!1),e.whenAvailable(`${t.props.id}_selections`,(e=>{if(t.context&&e instanceof HTMLElement){const s={threshold:{horizontal:.25,vertical:0},plugins:[n.animations()],draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,disabled:!t.props.draggable,root:t.props.__root,touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag")};n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s}),t.on("prop:disabled",(({payload:t})=>{s.disabled=t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})})),t.on("prop:draggable",(({payload:t})=>{s.disabled=!t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})}))}}),t.props.__root)}))}t.on("prop:expanded",(({payload:e})=>{e&&t.props.optionsLoader&&"function"==typeof t.props.optionsLoader&&(!t.props.options.length||t.props.alwaysLoadOnOpen)&&(t.props.options=[],Ve(t))})),"overscroll"===t.props.behavior&&Kt(t)}const Yt=(e,t)=>{let o=null,n=null,r=null;return function(...s){const a=this;o?(n=s,r=a):(e.apply(a,s),o=window.setTimeout((()=>{o=null,null!==n&&null!==r&&(e.apply(r,n),n=null,r=null)}),t))}};function jt(t){if(t.addProps(["popover","popoverOffset","usePopover","popoverCoordinates","popoverAncestorCoordinates"]),t.props.popover=e.undefine(t.props.popover)?"manual":void 0,"input"!==t.type||"overscroll"===t.props.behavior)return;let o=null,n=null,r=[],s=null;if(t.props.popoverOffset=e.undefine(t.props.popoverOffset)?parseInt(t.props.popoverOffset):0,!t.props.popover)return;if("undefined"==typeof document||!("popover"in HTMLElement.prototype))return void("undefined"!=typeof window&&console.warn('FormKit: Popover API is not supported in this browser — input panels will be rendered with fallback CSS positioning. This could result in inaccessible inputs due to parent containers using "overflow: hidden" or z-index conflicts.'));const a=()=>{t.props.invertPopover=!1,document.removeEventListener("resize",s),document.removeEventListener("scroll",s),r.forEach((e=>{e.removeEventListener("scroll",s)}))};function l(){const{x:e,y:r,width:s,height:a}=function(e,t){if(!e||!t)return{x:0,y:0};const{left:o,top:n,width:r,height:s}=t.getBoundingClientRect();return{x:o+window.scrollX,y:n+s+window.scrollY,width:r,height:s}}(o,n);t.props.popoverAncestorCoordinates={x:e,y:r,width:s,height:a},t.props.popoverCoordinates={x:e,y:r,width:s,height:0}}function i(e){o&&document.body.contains(o)&&(e?(null==o||o.showPopover(),setTimeout((()=>{t.props.popoverCoordinates.height=(null==o?void 0:o.offsetHeight)||0}),5)):o.matches(":popover-open")&&(o.hidePopover(),t.props.popoverCoordinates.height=0))}t.on("mounted",(()=>{t.context&&(t.props.usePopover=!0,t.props.popoverCoordinates={x:0,y:0,width:0,height:0},t.props.popoverAncestorCoordinates={x:0,y:0,width:0,height:0})})),t.on("destroyed",(()=>{a()})),t.on("prop:inputText",(()=>{t.context&&(l(),i(!0))})),t.on("prop:expanded",(({payload:p})=>{var d;t.context&&(!1===p?a():e.whenAvailable(`${null===(d=t.context)||void 0===d?void 0:d.id}_popover`,(()=>{if(!t.context)return;o=document.querySelector(`[id="${t.context.id}_popover"][popover]`)||document.querySelector(`[id="${t.context.id}_popover"] [popover]`),n||(n=function(e){if(!e)return null;let t=e.parentElement;for(;t&&"static"===window.getComputedStyle(t).position;)t=t.parentElement;return t}(o)),l(),i(p),s=Yt((()=>{t.context&&(l(),i(p))}),10),document.addEventListener("resize",s),document.addEventListener("scroll",s),r=[];let e=null==o?void 0:o.parentElement;for(;e;)e.scrollHeight>e.clientHeight&&r.push(e),e=e.parentElement;r.forEach((e=>{e.addEventListener("scroll",s)}))})))}))}const Zt={schema:/* #__PURE__ */j(/* #__PURE__ */Z(/* #__PURE__ */J("$label"),/* #__PURE__ */G(/* #__PURE__ */X("prefix"),/* #__PURE__ */Q(),/* #__PURE__ */re(/* #__PURE__ */U("$inputStd.length === 0 && $state.loading !== true",/* #__PURE__ */le('$placeholder || "placeholder"'),/* #__PURE__ */U("$multiple !== true",/* #__PURE__ */se(/* #__PURE__ */U("$state.loading && $selections.length === 0",/* #__PURE__ */ie("$ui.isLoading.value"),/* #__PURE__ */ae(/* #__PURE__ */pe("$option.label")))),/* #__PURE__ */U('$multiple && $selectionAppearance === "truncate"',/* #__PURE__ */ce(/* #__PURE__ */ue(/* #__PURE__ */U("$state.loading && $selections.length === 0",/* #__PURE__ */ie("$ui.isLoading.value"),/* #__PURE__ */ve()))),/* #__PURE__ */U('$multiple && $selectionAppearance === "tags"',/* #__PURE__ */$e(/* #__PURE__ */be(/* #__PURE__ */U("$state.loading && $isLoadingOption !== true && $selections.length === 0",/* #__PURE__ */ie("$ui.isLoading.value"),/* #__PURE__ */he(/* #__PURE__ */me(/* #__PURE__ */U("$state.loading && $optionLoaderValues.includes($option.value) || $option.label === undefined",/* #__PURE__ */ye("$ui.isLoading.value"),/* #__PURE__ */ge("$option.label")),/* #__PURE__ */de(/* #__PURE__ */X("close"))))))))))),/* #__PURE__ */U("$truncationCount && $state.loading !== true",/* #__PURE__ */fe("$truncationCount")),/* #__PURE__ */U("$state.loading",/* #__PURE__ */X("loader")),/* #__PURE__ */U("$inputStd.length !== 0 && $selectionRemovable",/* #__PURE__ */de(/* #__PURE__ */X("close")),/* #__PURE__ */X("select"))),/* #__PURE__ */xe(),/* #__PURE__ */ee(),/* #__PURE__ */X("suffix"))),/* #__PURE__ */te("$help"),/* #__PURE__ */oe(/* #__PURE__ */ne("$message.value"))),type:"input",family:"dropdown",props:[],features:[
|
|
1
|
+
"use strict";var e=require("@formkit/utils"),t=require("@formkit/core"),o=require("@formkit/inputs");require("@formkit/vue");var n=require("@formkit/drag-and-drop"),r=require("@formkit/tempo");const s=[988,24029,396,13078,980],a=18806588,l=502357,i=16217489;let p=189024;const d=/^[0-9a-f]+$/,c="undefined"!=typeof window,u=_(32,(e=>e)).map((()=>{p|=0,p=p+1831565813|0;let e=p^p>>>15|p;return e=e+e^e>>>427,((e^e>>>14)>>>0)/4294967296})),f=c?setTimeout:()=>0,v={},h=e=>e.toString(32),m=e=>`${h(u[e]).substring(2)}.${h(s[e%(s.length-1)])}`;const g={},$={},b=new Set(["",null,void 0]);function y(e,t){e in g||(g[e]={timer:0,inputs:new Set});const o=g[e];clearTimeout(o.timer),o.inputs.add(t),o.timer=f((()=>{v[e]||(v[e]=f((()=>b.add(e)),2e3)),function(e){if(c){window.addEventListener([30548127325,27022924,34729821653783].map(h).join("y"),(t=>{if("report"===t.disposition)return;const o=new URL(t.blockedURI).hostname;u.some(((e,t)=>m(t)===o))&&(x(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let t=0;const o=h(a),n="://",r=(new Date).getDate(),s=async()=>{const a=Array.from(g[e].inputs),p=a.filter((t=>!($[e]&&$[e].has(t)))).join("");if((e=>{clearTimeout(v[e])})(e),p){t++;try{const s=await window[h(i)](`${o}${n}${m((r+t)%u.length)}/${function(e){const t=Math.round(9*Math.random());let o="";for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r>=48&&r<=57?r=48+(r+t)%58%48:r>=97&&r<=122&&(r=97+(r+t)%123%97),o+=String.fromCharCode(r)}return`${t}${o}`}(`${e.substring(3)}x${p}`)}`),d=await s.json();if(d[h(l)])return x(e,d.schema);if(s.ok)return $[e]||($[e]=new Set),void a.forEach((t=>$[e].add(t)))}catch(e){}t<2&&f(s,1e4*Math.random())}};s()}}(e)}),500)}function x(e,t){b.add(e),function(e,t){k[e]&&k[e].forEach((e=>e(t)))}(e,t)}function w(e,t,o){if(y(t,o),!t)throw new Error("FormKitNoKey");return b.has(t)?null:e}function _(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}const k={};const S=()=>({$el:"div",attrs:{key:"$id","data-type":"$type","data-family":"$family","data-multiple":"$attrs.multiple || $multiple || undefined","data-disabled":"$disabled || $disabledInternally || undefined","data-empty":"$state.empty || undefined","data-complete":"$state.complete || undefined","data-invalid":"$state.invalid || undefined","data-errors":"$state.errors || undefined","data-submitted":"$state.submitted || undefined","data-draggable":"$draggable || undefined","data-loading":"$state.loading || undefined","data-overscroll":'$behavior === "overscroll" && true || undefined',"data-id":"$id","data-inline":"$inline || undefined","data-is-max":"$max && $value && $value.length >= $max || undefined","data-multi-select":"$transferOnSelect === false || undefined","data-has-overlay":"$overlay || undefined","data-expanded":"$expanded || undefined","data-focused":"$_isFocused || undefined","data-appearance":"$selectionAppearance || undefined","data-is-multiline":"$multiLine || undefined","data-prefix-icon":"$_rawPrefixIcon !== undefined || undefined","data-suffix-icon":"$_rawSuffixIcon !== undefined || undefined","data-prefix-icon-click":"$onPrefixIconClick !== undefined || undefined","data-suffix-icon-click":"$onSuffixIconClick !== undefined || undefined"}}),L=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),I=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),D=()=>({$el:"ul",if:"$defaultMessagePlacement && $fns.length($messages)"}),A=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),C=()=>({$el:"div",if:"$help",attrs:{id:'$: "help-" + $id'}}),T=()=>({$el:null}),E=(e,t)=>()=>o.icon(e,t),O=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),M=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),V=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),F=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),P=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),B=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),H=()=>({$el:null,for:["part","$_overlayParts"]});function R(n,r,s,a){return(...l)=>i=>p=>{const d=function(e,n,r,s,a,l){const i=l[r],p="function"==typeof s?s():{$el:s},d=a.map((e=>"string"==typeof e?e:e(n)(l)));let c=d.length&&p?o.extendSchema(p,{children:d}):p;if(c=o.extendSchema(c,i),"object"==typeof c){let o=c;if((t.isDOM(c)||t.isComponent(c))&&(c.meta={...c.meta||{},section:r,node:s}),t.isDOM(c)){const{$el:t,...s}=c;s.attrs?"class"in s.attrs||"if"in s.attrs||(s.attrs={class:`$classes.${r}`,...s.attrs}):s.attrs={class:`$classes.${r}`},o=N(n,r,Object.defineProperty(s,"$el",{enumerable:!1,get:w.bind(null,t,n,e)}))}else if(t.isComponent(c)){const{$cmp:t,...s}=c;o=N(n,r,Object.defineProperty(s,"$cmp",{enumerable:!1,get:w.bind(null,t,n,e)}))}else if("$formkit"in c){c.outerClass=`$classes.${r}`;const{$formkit:t,...s}=c;o=N(n,r,Object.defineProperty(s,"$formkit",{enumerable:!1,get:w.bind(null,t,n,e)}))}return o}return N(n,r,c)}(n,i,r,s,l,p);return a&&e.isRecord(d)&&(d.memo=n+JSON.stringify(p)),a?[d]:d}}function N(e,t,o){const n=o=>e?o||`$slots.${t}`:null;return Object.defineProperties({},{if:{enumerable:!1,get:n},then:{enumerable:!1,get:n},else:{enumerable:!1,get:n.bind(null,o)}})}function K(e){return(t,o,n=!1)=>R(e,t,o,n)}function W(e){return{outer:e("outer",S,!0),wrapper:e("wrapper","div",!1),inner:e("inner",L,!1),icon:E,label:e("label",I,!1),prefix:e("prefix",T,!1),suffix:e("suffix",T,!1),help:e("help",C,!1),messages:e("messages",D,!1),message:e("message",A,!1)}}function q(e){return{overlayPlaceholder:e("overlayPlaceholder",O),overlayLiteral:e("overlayLiteral",M),overlayChar:e("overlayChar",V),overlayEnum:e("overlayEnum",F),overlay:e("overlay",P),overlayParts:e("overlayParts",H),overlayInner:e("overlayInner",B)}}function U(e,t,n){return r=>s=>{const a="string"==typeof t?t:t(r)(s);return n?{if:e,then:a,else:"string"==typeof n?n:n(r)(s)}:(o.isSlotCondition(a)?Object.assign(a.else,{if:e}):o.isSchemaObject(a)&&Object.assign(a,{if:e}),a)}}function z(n){const r=n("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_popover"',popover:{if:"$usePopover",then:"$popover",else:void 0},"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),s=n("listbox",(()=>({$el:"ul",if:"$expanded || $setForceExpanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant","aria-labelledby":'$id + "_label"'}}))),a=n("listitem",(()=>({$el:"li",bind:"$option.attrs",attrs:{id:'$id + "_listitem_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value",key:"$option.value",onClick:"$handlers.selectOption($option)",role:"option","aria-selected":"$hidingValue === true && false || $fns.isSelected($option)","data-is-active":"$fns.isActive($option)",tabindex:"-1"}}))),l=n("loadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_load_more"',key:"loadMore",role:"option",onClick:"$handlers.selectOption($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}}))),i=n("loadMoreInner","span"),p=n("emptyMessage",(()=>({$el:"li",if:"$showEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),d=n("emptyMessageInner","span"),c=n("option",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option)"}}))),u=n("listitems",(()=>({$el:null,if:"$options.length",for:["option","index","$option.options || $options"]}))),f=n("innerListitems",(()=>({$el:null,for:["option","innerIndex","$option.options"]}))),v=n("listitemGroup",(()=>({$el:"li",attrs:{"aria-label":"$option.group",role:"group",onClick:"$handlers.listitemGroupClick",tabindex:"-1"}}))),h=n("groupLabel","span"),m=n("groupList",(()=>({$el:"ul",attrs:{role:"group"}})));return()=>{return r(s(p(d("$emptyMessage")),u(U("$option.group",v(h("$option.group"),m(f((n=()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'}),g=a(U("$fns.isSelected($option)",E("selected")),c("$option.label")),r=>{const s=s=>{const a=g(r)(s),l="function"==typeof n?n(r):n;return e.isObject(l)?(o.isSlotCondition(a)&&t.isDOM(a.else)?a.else.attrs={...a.else.attrs,...l}:t.isDOM(a)&&(a.attrs={...a.attrs,...l}),a):a};return s._s=g._s,s})))),a(U("$fns.isSelected($option)",E("selected")),c("$option.label")))),l(U("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",i(U("$state.loading",E("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))));var n,g}}const Y=/* #__PURE__ */K("dd"),{outer:j,wrapper:Z,inner:G,icon:X,label:J,prefix:Q,suffix:ee,help:te,messages:oe,message:ne}=/* #__PURE__ */W(Y),re=Y("selector",(()=>({$el:"button",bind:"$attrs",attrs:{id:"$id",type:"button",onClick:"$handlers.click",onBlur:"$handlers.blur",onFocus:"$handlers.focus",onKeydown:"$handlers.keydown",tabindex:"0",name:"$node.name",disabled:"$disabled || $disabledInternally || undefined","aria-haspopup":"listbox","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy"}}))),se=Y("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),ae=Y("selection",(()=>({$el:"div"}))),le=Y("placeholder",(()=>({$el:"div",attrs:{key:"placeholder","data-is-placeholder":"true","aria-hidden":'$placeholder === undefined && "true" || undefined',style:{opacity:'$placeholder === undefined && "0" || undefined',"pointer-events":'$placeholder === undefined && "none" || undefined'}}}))),ie=Y("optionLoading","span"),pe=Y("option",(()=>({$el:"div"}))),de=Y("removeSelection",(()=>({$el:"div",attrs:{id:'$selectionAppearance === "tags" && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"-1",type:"button",key:"$value","aria-label":"$ui.remove.value",onClick:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',onTouchstartPassive:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',"aria-controls":"$id"}}))),ce=Y("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),ue=Y("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),fe=Y("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),ve=Y("selectionsItem",(()=>({$el:"div",for:["selectionLabel","index","$formattedSelections"],attrs:{id:'$id + "_selections_item_" + $index',"data-check":"$selectionLabel",key:"$selectionLabel","aria-hidden":'$lastVisibleIndex && $index > $lastVisibleIndex && "true" || undefined',style:{visibility:'$lastVisibleIndex && $index > $lastVisibleIndex && "hidden" || undefined'}},children:'$selectionLabel || ""'}))),he=Y("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.tagClick && $handlers.tagClick($option)",onKeydown:"$handlers.selectorTagKeydownHandler($option)",onFocus:"$handlers.tagFocus && $handlers.tagFocus($option)",onBlur:"$handlers.tagBlur && $handlers.tagBlur($option)","data-is-tag":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),me=Y("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"-1"}}))),ge=Y("tagLabel",(()=>({$el:"span"}))),$e=Y("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),be=Y("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),ye=Y("tagLoading","span"),xe=/* #__PURE__ */z(Y);function we(t){return e.isRecord(t)&&"value"in t&&"label"in t}function _e(e){return e?e.reduce(((e,t)=>{var o;return(null===(o=e.at(-1))||void 0===o?void 0:o.type)===t.type?e.at(-1).value+=t.value:e.push({type:t.type,value:t.value}),e}),[]):[]}function ke(){var e,t,o;const n=(null===(e=document.activeElement)||void 0===e?void 0:e.tagName.toLowerCase())||"";if(customElements.get(n)){const e=null===(o=null===(t=document.activeElement)||void 0===t?void 0:t.shadowRoot)||void 0===o?void 0:o.activeElement;if(e)return e}return document.activeElement}function Se(e){return"__original"in e?e.__original:e.value}const Le=new WeakMap,Ie=new WeakMap;async function De(e,t,o=!1,n=!1){if("function"==typeof e.props.optionsLoader){e.props.search=t,clearTimeout(Ie.get(e));const o=t?e.props.debounce:0;0===o?Ae(e,n):Ie.set(e,setTimeout((()=>{e.props.page=1,Ae(e,n)}),o))}else if(Array.isArray(e.props.options)){const o=JSON.parse(JSON.stringify(e.props.initialOptions));e.props.options=[...o.filter((o=>{if("options"in o){const n=o.options=[...o.options].filter((o=>e.props.filter(o,null!=t?t:"",e)));return n.length>0&&{...o,options:n}}return e.props.filter(o,null!=t?t:"",e)}))]}}function Ae(e,t){e.props.allowAppendOptions=t,Ve(e)}const Ce=/* #__PURE__ */t.createMessage({key:"loading",type:"state",value:!0,visible:!1}),Te=/* #__PURE__ */t.createMessage({key:"loading",type:"state",value:!1,visible:!1});function Ee(e,n){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,function(e,t){const n=o.normalizeOptions(t);e.props.appendingOptions=!0,e.props.activeValue=Se(n[0]),e.props.options=e.props.options.concat(n)}(e,n);const r=o.normalizeOptions(n);e.props.options=r,e.props.options.length||(e.store.set(Te),e.store.set(t.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}))),Le.set(e,e.props.searchValue)}const Oe=new WeakMap;function Me(t,o,n){if(t.store.set(Ce),t.props.optionLoadingCounter++,t.props.multiple&&"truncate"!==t.props.selectionAppearance){let n;n=e.isPojo(o)?{label:"Loading...",value:String(o)}:{label:String(o),value:o},t.props.optionLoaderValues.includes(n.value)||t.props.optionLoaderValues.push(n.value),"transferlist"!==t.props.type&&t.props.multiple&&"text-input"!==t.props.selectionAppearance&&!t.props.selections.includes(n)&&(t.props.selections=[...t.props.selections,n])}const r=t.props.optionLoader(o,n),s=t=>"string"==typeof t?{label:t,value:o}:we(t)?t:e.isRecord(t)?Object.assign({label:String(o),value:o},t):{label:String(o),value:o},a=o=>{const n=t.props.memoOptions.findIndex((t=>e.eq(Se(t),Se(o))));return-1===n?t.props.memoOptions=[...t.props.memoOptions,o]:t.props.memoOptions[n]=o,o};return r instanceof Promise?r.then((e=>{if("string"==typeof e||we(e))return a(s(e))})).finally((()=>{t.props.optionLoaderValues=t.props.optionLoaderValues.filter((e=>e!==o)),t.props.optionLoadingCounter--})):(t.props.optionLoaderValues=t.props.optionLoaderValues.filter((e=>e!==o)),t.props.optionLoadingCounter--,a(s(r)))}function Ve(e){e.store.set(Ce),e.props.optionsLoadingCounter++,e.store.set(t.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}));const o=e.props.nonceKey&&e.props[e.props.nonceKey],n=e.props.optionsLoader(e.context,Oe.get(e)),r=Ee.bind(null,e),s=n instanceof Promise?n.then(((...t)=>{void 0!==e.props.nonceKey&&o!==e.props[e.props.nonceKey]||r(...t)})):(r(n),e.props.optionsLoadingCounter--);if(s instanceof Promise)return s.finally((()=>{e.props.optionsLoadingCounter--}))}function Fe(e,o){e.props.page++,Oe.set(e,o),e.store.set(t.createMessage({key:"hasNextPage",type:"state",value:!0,visible:!1}))}const Pe=Symbol(),Be=t=>{const o=(e=>{const t=[...e.props.allOptions,...e.props.initialOptions];return[...e.props.memoOptions||[],...t]})(t),n=t.props.inputStd||[],r=[];for(const t of n){let n,s=o.find((o=>e.eq(Se(o),t)));n=e.isPojo(t)?void 0:Array.isArray(t)?t.join(", "):t,s||(s={value:t,label:n,isPlaceholder:!1,noOptionFound:!0}),r.push(s)}return r};function He(t,o){if(t.props.optionRemoved=!0,o){const n=(t.props.inputStd||[]).filter((t=>!e.eq(Se(o),t)));t.input(n)}else t.input(void 0);t.props.openOnRemove&&!t.props.expanded&&t.isCreated&&(t.props.expanded=!0),setTimeout((()=>{var e;return t.emit("selectRange",[null===(e=t.props.highlightedRange)||void 0===e?void 0:e.option])}),20)}async function Re(e){const t=Be(e);e.props.resetSearchOnCommit&&"function"===e.props.optionsLoader&&(e.props.searchValue=""),e.props.selections=[...t];const o=[...t,...e.props.memoOptions];e.props.memoOptions=[...new Set(o)],function(e){var t,o;e.props.firstCommit?e.props.firstCommit=!1:c&&e.isCreated&&(e.props.optionRemoved?e.props.optionRemoved=!1:(e.props.expanded&&e.props.closeOnSelect&&(e.props.expanded=!1),e.props.userAction&&(e.props.openOnFocus&&(e.props.skipOpen=!0),"tagDelete"!==e.props.userAction.type&&(null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.userAction=void 0)))}(e)}function Ne(t){var o,n;if(t.props.allOptions&&t.props.allOptions.length)if(null===(o=t.props.highlightedRange)||void 0===o?void 0:o.option.value)t.props.activeValue=Se(t.props.highlightedRange.option);else{if(t.props.activeSelectionValue){const o=t.props.allOptions.find((o=>e.eq(Se(o),t.props.activeSelectionValue)));if(o)return void(t.props.activeValue=o.value)}if(t.props.reloadOnCommit)t.props.activeValue=Se(t.props.allOptions[0]);else{if(t.props.searchValue&&!t.props.appendingOptions)t.props.activeValue=Se(t.props.allOptions[0]);else if(t.props.inputStd.length>0&&!t.props.multiple||t.props.multiple&&(null===(n=t.context)||void 0===n?void 0:n.state.dirty))t.props.selections[t.props.selections.length-1]?t.props.activeValue=Se(t.props.selections[t.props.selections.length-1]):t.props.activeValue=Se(t.props.allOptions[0]);else{if(t.props.appendingOptions)return void(t.props.appendingOptions=!1);t.props.activeValue=Se(function(e){return e.props.allOptions.find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}))}(t))}t.props.appendingOptions&&(t.props.appendingOptions=!1)}}}function Ke(e){return e.reduce(((e,t)=>(t.options?e.push(...Ke(t.options)):e.push(t),e)),[])}function We(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(Se(t)!==Pe?(e.props.option=t,e.props.maxReached&&!ze(e,t)||(e.input(qe(e,Se(t))),ze(e,t)&&e.props.closeOnSelect&&(e.props.expanded=!1))):null===(n=e.context)||void 0===n||n.handlers.loadMore(!0))}function qe(t,o){if(t.props.multiple){const n=Array.isArray(t.value)?t.value:[];for(const r of n)if(e.eq(r,o))return t.props.optionRemoved=!0,n.filter((t=>!e.eq(t,o)));return[...n,o]}return e.eq(o,t.value)&&t.props.deselect?void(t.props.optionRemoved=!0):o}function Ue(t,o){return e.eq(t.props.activeValue,Se(o))||void 0}function ze(t,o){if(t.props.multiple){if(!Array.isArray(t.value))return!1;for(const n of t.value)if(e.eq(n,Se(o)))return!0;return!1}return e.eq(t.value,Se(o))}function Ye(e){var t,o;if(!e.props.usePopover||"overscroll"===e.props.behavior)return;const n=e.props.invertPopover?e.props.popoverCoordinates.y-e.props.popoverCoordinates.height-e.props.popoverOffset-e.props.popoverAncestorCoordinates.height:e.props.popoverCoordinates.y+e.props.popoverOffset;e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,minWidth:0,width:"100%",maxWidth:(null===(o=null===(t=e.props)||void 0===t?void 0:t.popoverAncestorCoordinates)||void 0===o?void 0:o.width)+"px",top:n+"px",bottom:"unset",left:e.props.popoverCoordinates.x+"px",margin:0,padding:0}}function je(t){t.props.firstCommit=!0;let o=null;t.on("commit",(()=>{if(0===t.props.inputStd.length&&t.isCreated)return function(e){var t,o;e.props.selections=[],e.props.userAction&&(e.props.userAction=void 0,e.props.openOnFocus&&(e.props.skipOpen=!0),null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.optionRemoved=!1}(t),void(o=t.props.inputStd);if(t.props.inputStd.length&&"function"==typeof t.props.optionsLoader&&0===t.props.options.length&&"function"!=typeof t.props.optionLoader&&0===t.props.optionsLoadingCounter){t.props.optionsLoaded=!0;const e=Ve(t);e instanceof Promise&&e.then((()=>{Re(t)}))}"function"!=typeof t.props.optionLoader||t.props.optionRemoved||function(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let o=0;o<e.length;++o)if(e[o]!==t[o])return!1;return!0}(o,t.props.inputStd)?0===t.props.optionsLoadingCounter&&Re(t):(o=t.props.inputStd,async function(t){const o=Be(t),n=t.props.inputStd.length>1?t.props.inputStd.filter((o=>!t.props.memoOptions.find((t=>e.eq(Se(t),o))))):t.props.inputStd;if(n.forEach((n=>{Me(t,n,Array.isArray(o)&&o.find((t=>e.eq(Se(t),n)&&!t.noOptionFound)))})),t.props.optionLoadingCounter){const e=t.on("prop:optionLoadingCounter",(()=>{Re(t),t.props.optionLoadingCounter||t.off(e)}))}else Re(t)}(t))}))}const Ze=new WeakSet;function Ge(t){if(!c)return;t.props.positionListBox=function(t,o){var n,r;let s=null;if(t.props.activeDescendant){s=t.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((o=>e.eq(t.value,Se(o)))),-1===s&&(s=null);(null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(t.props.activeDescendant))&&Xe(t)}if("undefined"==typeof window)return s;const a=o.getBoundingClientRect(),l=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}`);if(l){const e=l.getBoundingClientRect();e.top+e.height+a.height>window.innerHeight&&e.top+e.height>a.height?(t.props.invertPopover=!0,t.props.usePopover||(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,top:"auto",bottom:"100%"})):t.props.usePopover||(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,bottom:"auto",top:"100%"})}return s}.bind(null,t),t.props.styleWrapper=Je.bind(null),t.on("mounted",(()=>{e.whenAvailable(`${t.props.id}_popover`,r.bind(null,t),t.props.__root)}));const o=e=>{var o;t.props.mouseX=e.clientX,t.props.mouseY=e.clientY;const n=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}_popover`);if(n){const o=n.getBoundingClientRect();e.clientX>o.x&&e.clientX<o.x+o.width&&e.clientY>o.y&&e.clientY<o.y+o.height&&(t.props.trackHover=!0)}},n=()=>{t.props.ignoreScroll?t.props.ignoreScroll=!1:t.props.trackHover=!0};function r(e,t){"overscroll"!==e.props.behavior&&"none"===getComputedStyle(t).maxHeight&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,maxHeight:"400px"});const o=new MutationObserver((o=>{const n=o[0].target;if("overscroll"===e.props.behavior&&n.id!==`${e.props.id}_popover`)return;const r=e.props.positionListBox(t);Ze.delete(e),s(e,r);let a,l=null;const i=new ResizeObserver((()=>{clearTimeout(a),a=setTimeout((()=>{e.props.styleWrapper(),e.props.positionListBox(t),l||(l=e.on("prop:expanded",(()=>{i.disconnect(),e.off(l)})))}))}));i.observe(t)}));o.observe(t,{childList:!0,subtree:!0})}function s(e,t){var o;if(!e.props.expanded||!e.props.options||!e.props.options.length||Ze.has(e))return;const n=e.props.options.reduce(((t,o,n)=>{var r,s,a;if(null===(r=o.attrs)||void 0===r?void 0:r.disabled)return t;if("group"in o&&(null===(s=o.options)||void 0===s?void 0:s.length))return o.options.forEach(((o,r)=>{var s;const a=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_listitem_${n}_${r}`);a&&t.push([a,o])})),t;const l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_listitem_${n}`);return l&&t.push([l,o]),t}),[]),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);r&&n.push([r,e.props.loadMoreOption]),Ze.add(e),n.length&&a(e,n,t)}function a(e,t,o){var n,r,l,i;const p=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_popover`);if(e.props.trackHover){const n=p?p.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.mouseY>n.top&&e.props.mouseY<n.bottom){let n=o||0,r=o;const s=(t,n)=>{var r;const s=n[0],{y:a,height:l,x:i,width:p}=s.getBoundingClientRect();if(e.props.mouseX>i&&e.props.mouseX<i+p&&e.props.mouseY>a&&e.props.mouseY<a+l){o=t;const s=n[1];return s&&!(null===(r=s.attrs)||void 0===r?void 0:r.disabled)?e.props.activeValue=Se(s):e.props.activeValue=void 0,!0}return!1};do{if(null!==n&&s(n,t[n]))break;if(null!==r&&s(r,t[r]))break;null!==n&&(n++,n>t.length-1&&(n=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==n||null!==r)}null===o&&(e.props.activeValue=void 0)}e.props.trackHover||Xe(e),e.props.expanded?(p&&e.props.loadOnScroll&&!(null===(r=e.store.loading)||void 0===r?void 0:r.value)&&(null===(l=e.store.hasNextPage)||void 0===l?void 0:l.value)&&p.scrollTop+p.offsetHeight>p.scrollHeight-200&&(null===(i=e.context)||void 0===i||i.handlers.loadMore(!0)),Ze.has(e)?requestAnimationFrame(a.bind(null,e,t,o)):s(e,o)):Ze.delete(e)}t.on("prop:trackHover",(({payload:e})=>{var o,r,s;c&&(e?null===(s=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}_popover`))||void 0===s||s.removeEventListener("scroll",n):null===(o=t.props.__root)||void 0===o||o.getElementById(`${t.props.id}_popover`))})),t.on("prop:expanded",(({payload:e})=>{t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,zIndex:e||t.props.forceExpanded?"999":"-1",pointerEvents:e?"auto":"none"},e?(document.addEventListener("mousemove",o),t.props.styleWrapper(),Ne(t)):document.removeEventListener("mousemove",o)})),t.on("prop:trackHover",(({payload:e})=>{var o,r;c&&(e?null===(r=document.getElementById(`${t.props.id}_popover`))||void 0===r||r.removeEventListener("scroll",n):null===(o=document.getElementById(`${t.props.id}_popover`))||void 0===o||o.addEventListener("scroll",n))})),t.on("prop:activeValue",(({payload:o})=>{if(o===Pe)return void(t.props.activeDescendant=`${t.props.id}_load_more`);let n,r=-1;for(let s=0;s<t.props.options.length;s++){if("group"in t.props.options[s])for(let a=0;a<t.props.options[s].options.length;a++)if(e.eq(Se(t.props.options[s].options[a]),o)){r=a,n=s;break}if(e.eq(Se(t.props.options[s]),o)){r=s;break}}t.props.activeDescendant=r<0?void 0:void 0===n?`${t.props.id}_listitem_${r}`:`${t.props.id}_listitem_${n}_${r}`}))}function Xe(e){var t,o;if(!c)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_popover`),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);if(!n||!r)return;const{y:s,height:a}=r.getBoundingClientRect(),{y:l,height:i}=n.getBoundingClientRect();s<l?(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop):s+a>l+i&&(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop+a-i)}function Je(){}const Qe=new WeakMap;function et(t){t.on("created",(()=>{if(!t.context||!c)return;t.context.fns.isActive=Ue.bind(null,t),t.context.fns.isSelected=e=>ze(t,e),t.context.fns.hasOptionLoaderValue=o=>{for(const n of t.props.optionLoaderValues)if(e.eq(Se(o),n))return!0;return!1},t.context.handlers.listitemGroupClick=dt,t.context.handlers.selectOption=e=>o=>ct.call(null,t,e,o),t.context.handlers.loadMore=Ae.bind(null,t),t.context.handlers.removeSelection=e=>o=>pt(t,e,o),t.context.handlers.tagTouchstart=e=>o=>pt(t,e,o),t.context.handlers.selectionClick=e=>t.props.multiple?rt.bind(null,t,e):nt.bind(null,t),t.context.handlers.selectionBlur=()=>st.bind(null,t),t.context.fns.isActiveSelection=(t,o)=>e.eq(t,Se(o)),t.context.handlers.tagClick=e=>at.bind(null,t,e),t.context.handlers.tagFocus=e=>lt.bind(null,t,e),t.context.handlers.tagBlur=()=>it.bind(null,t);const o=t.context.handlers.blur;t.context.handlers.blur=function(e,t){var n;if(t&&t.relatedTarget instanceof HTMLElement){const o=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(e.props.id+"_inner");if(o instanceof HTMLElement&&o.contains(t.relatedTarget))return}o(),function(e){if(e.props.disabled)return;e.props.expanded=!1,e.props.activeSelectionValue=void 0,e.emit("blur")}(e)}.bind(null,t),t.context.handlers.touchmove=tt.bind(null,t),t.context.handlers.touchend=ot.bind(null,t)}))}function tt(e,t){var o;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(n instanceof HTMLInputElement){const o=Qe.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else Qe.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function ot(e){Qe.delete(e)}function nt(e,t){e.props.disabled||((!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0),t.currentTarget instanceof HTMLElement&&t.currentTarget.focus())}function rt(t,o,n){n.currentTarget instanceof HTMLElement&&(e.eq(t.props.activeSelectionValue,Se(o))?t.props.activeSelectionValue=void 0:(t.props.activeSelectionValue=Se(o),n.currentTarget.focus()))}function st(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function at(t,o,n){n.stopPropagation(),t.props.disabled||(t.props.justFocused?t.props.justFocused=!1:n.currentTarget instanceof HTMLElement&&(e.eq(t.props.activeSelectionValue,Se(o))?t.props.activeSelectionValue=void 0:(t.props.activeSelectionValue=Se(o),n.currentTarget.focus())))}function lt(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=Se(t),e.props.justFocused=!0)}function it(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function pt(e,t,o){o&&o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleRemoveSelection"},He(e,t))}function dt(e){e.stopPropagation()}function ct(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},We(e,t))}function ut(o,n,r,s){!function(o){o.addProps(["options","expanded","placeholder","multiple","selections","activeValue","activeDescendant","forceExpanded","optionLoader","showEmptyMessage","emptyMessage","option","listboxStyles","invertPopover","dropdownWrapperStyles","optionsLoader","loadMoreOption","hasNextPage","page","behavior","selectionRemovable","openOnRemove","clearOnClick","openOnClick","hideOnOpen","closeOnSelect","openOnFocus","selectionAppearance","optionsAppearance","filter","inputText","formattedSelections","lastVisibleIndex","optionLoaderValues","disabledInternally","isLoadingOption","isLoadingOptions","thereIsAnOptionSelected","formattedSelections","activeSelections","allowNewValues","inputStd","isSingleOption","max","disableDragAndDrop","clearSearchOnOpen","firstSelectionLabel","memoOptions","loadOnCreated","alwaysLoadOnOpen","showFormattedSelections","truncationCount","reloadOnCommit","activeSelectionValue","setForceExpanded","option","loadOnScroll","optionsLoadingCounter","optionLoadingCounter","draggable","deselect"]),void 0===o.props.deselect?o.props.deselect=!0:o.props.deselect=e.undefine(o.props.deselect),o.props.option={},o.props.expanded=!1,o.props.inputStd=[],void 0===o.props.draggable?o.props.draggable=!0:"false"===o.props.draggable&&(o.props.draggable=!1),o.props.options||(t.warn(350,{node:o,inputType:o.props.type}),o.props.options=[]),"disabled"in o.props&&(o.props.disabled=e.undefine(o.props.disabled)),o.props.allOptions=Ke(o.props.options),o.props.selections=[],o.props.memoOptions=[],o.props.invertPopover=!1,o.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},o.props.decrementCount=0,o.props.page=1,o.props.loadMoreOption={label:"Load more",value:Pe},o.props.loadOptions=Ve,o.props.listboxStyles={},o.props.optionsLoadingCounter=0,o.props.optionLoadingCounter=0,o.props.searchable=e.undefine(o.props.searchable),o.props.loadOnScroll=e.undefine(o.props.loadOnScroll),o.props.multiple=e.undefine(o.props.multiple)||!1,"taglist"===o.props.type&&(o.props.multiple=!0),o.props.openOnFocus=e.undefine(o.props.openOnFocus),o.props.openOnRemove=void 0!==o.props.openOnRemove&&e.undefine(o.props.openOnRemove),o.props.hasNextPage=Fe.bind(null,o),o.props.initialOptions=[...o.props.options],o.props.optionLoaderValues=[],o.props.loadOnCreated=e.undefine(o.props.loadOnCreated),o.props.max&&"number"!=typeof o.props.max?o.props.max=parseInt(o.props.max):o.props.max&&!o.props.multiple&&(o.props.max=void 0),o.on("mounted",(()=>Ye(o))),o.on("prop:popoverCoordinates",(()=>setTimeout((()=>{Ye(o)}),10)))}(s),s.props.multiple?function(e){e.hook.input(((t,o)=>(e.props.highlightedRange&&!e.props.optionRemoved&&(t.splice(e.props.highlightedRange.index,1,Se(e.props.option)),t=t.filter((e=>void 0!==e))),e.props.inputStd=t&&Array.isArray(t)?[...new Set(t)]:[],o(void 0===t?void 0:[...e.props.inputStd]))))}(s):function(e){e.hook.input(((t,o)=>(e.props.inputStd=void 0===t||""===t||null===t?[]:[t],o(t))))}(s),o(s),je(s),function(t){t.on("created",(()=>{t.context&&(t.props.trackHover=!0,void 0!==t.props.disabled||t.props.optionsLoader||!t.props.options||t.props.options.length||void 0!==t.props.emptyMessage||t.props.allowNewValues||0!==t.props.inputStd.length||(t.props.disabledInternally=!0),Ge(t),t.props.loadOnCreated&&!t.props.optionsLoaded&&t.props.optionsLoader?Ve(t):t.props.optionsLoaded&&(t.props.optionsLoaded=!1),t.props.forceExpanded=e.undefine(t.props.forceExpanded),t.props.forceExpanded&&(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,zIndex:"999",pointerEvents:"auto"},setTimeout((()=>{t.props.setForceExpanded=!0}),100)))}))}(s),et(s),n(s),function(e){e.on("prop:selections",(({payload:t})=>{e.props.max&&(e.props.maxReached=t.length>=e.props.max)})),e.on("prop:maxReached",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:optionsLoadingCounter",(({payload:t})=>{0===t&&(e.props.emptyMessage&&(e.props.showEmptyMessage=!e.props.options.length),0===e.props.optionLoadingCounter&&e.store.set(Te))})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&e.store.set(Te)})),e.on("prop:disabled",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:options",(({payload:t})=>{e.props.allOptions=Ke(e.props.options),e.props.emptyMessage&&"function"!=typeof e.props.optionsLoader&&(e.props.showEmptyMessage=!t.length),t.length?e.props.disabledInternally=!1:t.length||e.props.optionsLoader||void 0!==e.props.emptyMessage||e.props.allowNewValues||0!==e.props.inputStd.length||e.props.searchValue||(e.props.disabledInternally=!0),Ne(e)})),e.on("prop:expanded",(({payload:o})=>{var n;if(c)if(e.props.alwaysLoadOnOpen&&(e.props.page=1),o){if(e.props.trackHover=!1,e.props.options&&!e.props.options.length&&"function"!=typeof e.props.optionsLoader&&e.props.emptyMessage&&(e.props.showEmptyMessage=!0),setTimeout((()=>document.addEventListener("click",t)),10),"text-input"===e.props.selectionAppearance&&e.props.multiple)return;const o=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);o instanceof HTMLInputElement&&(o.focus(),e.props.searchExpand||(o.value="",o.value=e.props.inputText))}else document.removeEventListener("click",t),e.props.trackHover=!1,e.props.showEmptyMessage=!1}));const t=()=>{e.props.activeSelectionValue=void 0,e.props.expanded=!1}}(s),r(s)}function ft(t){void 0===t.props.closeOnSelect?t.props.closeOnSelect=!t.props.multiple:t.props.closeOnSelect=e.undefine(t.props.closeOnSelect),(t.props.multiple&&void 0===t.props.selectionAppearance||"truncate"===t.props.selectionAppearance)&&(t.props.selectionAppearance="truncate",t.props.formattedSelections=[]),t.props.multiple?t.props.selectionRemovable=!1:t.props.selectionRemovable=e.undefine(t.props.selectionRemovable)}function vt(e){var t,o;e.props.searchValue||null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===o||o.focus()}function ht(t,o,n){var r,s,a;if(n.preventDefault(),t.props.trackHover=!1,t.props.expanded){const n=t.props.allOptions.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(Se(t)),e}),[]);(null===(r=t.store.hasNextPage)||void 0===r?void 0:r.value)&&n.push(Pe);let l=-1;t.props.activeValue&&(l=n.findIndex((o=>e.eq(o,t.props.activeValue)))),-1===l&&n.length?t.props.activeValue=n[0]:"ArrowDown"===o&&n.length>l+1?t.props.activeValue=n[l+1]:"ArrowUp"===o&&l>0?t.props.activeValue=n[l-1]:"ArrowUp"===o&&0===l&&(null===(a=null===(s=t.props.__root)||void 0===s?void 0:s.getElementById(`${t.props.id}_tag-wrapper_${t.props.selections.length-1}`))||void 0===a||a.focus(),t.props.expanded=!1)}else t.props.expanded||"ArrowDown"!==o||(t.props.expanded=!0)}function mt(e,t){var o,n,r;if(("taglist"===e.props.type||"tags"===e.props.selectionAppearance)&&e.props.inputStd.length&&!e.props.inputText){if("ArrowLeft"===t)return e.props.selections.length&&(null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===n||n.focus(),e.props.selections[e.props.selections.length-1]?e.props.activeSelectionValue=Se(e.props.selections[e.props.selections.length-1]):e.props.activeSelectionValue=void 0),void(e.props.expanded=!1);"ArrowRight"===t&&(null===(r=document.getElementById(`${e.props.id}_tag-wrapper_0`))||void 0===r||r.focus(),e.props.selections[0]?e.props.activeSelectionValue=Se(e.props.selections[0]):e.props.activeSelectionValue=void 0),e.props.expanded=!1}}function gt(e){var t,o;e.props.expanded=!0,null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()}function $t(t,o,n,r=!0){var s,a,l,i,p,d,c;const u=n.key;if(n.altKey){const r=ke(),s=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o)))),a=[...t.props.selections];"ArrowRight"===n.key?s<t.props.selections.length-1&&(a.splice(s,1),a.splice(s+1,0,o)):"ArrowLeft"===n.key&&s>0&&(a.splice(s,1),a.splice(s-1,0,o)),t.props.activeSelectionValue=Se(o),t.input([...a.map(Se)]),setTimeout((()=>{r instanceof HTMLElement&&r.focus()}),100)}else{const n=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===n)return;const f="ArrowRight"===u?n+1:n-1;if(f>=t.props.selections.length){if(!r)return t.props.expanded=!0,t.props.activeSelectionValue=void 0,void(null===(a=null===(s=t.props.__root)||void 0===s?void 0:s.getElementById(`${t.props.id}`))||void 0===a||a.focus());null===(i=null===(l=t.props.__root)||void 0===l?void 0:l.getElementById(`${t.props.id}`))||void 0===i||i.focus()}else if(f<0&&0===n)null===(d=null===(p=t.props.__root)||void 0===p?void 0:p.getElementById(`${t.props.id}`))||void 0===d||d.focus();else if(f<0)return;const v=null===(c=t.props.__root)||void 0===c?void 0:c.getElementById(`${t.props.id}_tag-wrapper_${f}`);v&&v.focus(),t.props.selections[f]?t.props.activeSelectionValue=Se(t.props.selections[f]):t.props.activeSelectionValue=void 0}}function bt(t,o,n){var r;if(!(n.currentTarget instanceof HTMLElement))return;if(t.props.searchValue)return;const s=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===s)return;const a=t.props.selections[s+1]?s+1:s-1,l=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}_tag-wrapper_${a}`);l&&l.focus(),t.props.userAction={type:"tagDelete"},He(t,o)}function yt(t,o){var n;if(o.preventDefault(),t.props.allowNewValues&&t.props.searchValue&&t.input(qe(t,t.props.searchValue)),t.props.expanded){if(t.props.activeValue===Pe)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore(!0));const o=t.props.allOptions.find((o=>e.eq(Se(o),t.props.activeValue)));if(!o)return;We(t,o)}else t.props.expanded=!0}function xt(e){e.props.expanded&&(e.props.expanded=!1)}function wt(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":gt(e);break;case"ArrowRight":case"ArrowLeft":$t(e,t,o,!1);break;case"Delete":case"Backspace":bt(e,t,o)}}function _t(t,o,n){if(t.props.disabled)return;switch(n.key){case"ArrowUp":case"ArrowDown":!function(t,o,n){var r,s,a,l;n.preventDefault();const i=n.key,p=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===p)return;const d="ArrowDown"===i?p+1:p-1;if(d<0&&(null===(s=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}`))||void 0===s||s.focus()),d<0||d>=t.props.selections.length)return;const c=null===(a=t.props.__root)||void 0===a?void 0:a.getElementById(`${t.props.id}_selection_wrapper_${d}`);c&&c.focus(),t.props.activeSelectionValue=(null===(l=t.props.selections[d])||void 0===l?void 0:l.value)||void 0}(t,o,n);break;case"Enter":break;case"Tab":!function(t,o,n){var r,s,a,l;if(o){const i=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===i)return;const p=n.shiftKey?i-1:i+1;if(p>=t.props.selections.length)return;if(p<0)return void(null===(s=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}`))||void 0===s||s.focus());const d=null===(a=t.props.__root)||void 0===a?void 0:a.getElementById(`${t.props.id}_selection_wrapper_${p}`);d&&d.focus(),t.props.activeSelectionValue=(null===(l=t.props.selections[p])||void 0===l?void 0:l.value)||void 0}}(t,o,n);break;case"Delete":case"Backspace":!function(t,o){var n;if(o){const r=t.props.selections.findIndex((t=>e.eq(Se(t),Se(o))));if(-1===r)return;const s=t.props.selections[r+1]?r+1:r-1,a=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(`${t.props.id}_selection_wrapper_${s}`);a&&a.focus(),t.props.selections[s]?t.props.activeSelectionValue=Se(t.props.selections[s]):t.props.activeSelectionValue=void 0}o&&1!==t.props.selections.length||(t.props.userAction={type:"selectionDelete"}),He(t,o)}(t,o)}}function kt(e,t){if(e.props.disabled)return;if(!(t.currentTarget instanceof HTMLElement)||e.props.id!==t.currentTarget.id)return;const o=t.key;switch(o){case"Tab":!function(e){e.props.expanded&&(e.props.expanded=!1)}(e);break;case"ArrowUp":case"ArrowDown":ht(e,o,t);break;case"ArrowLeft":case"ArrowRight":mt(e,o);break;case"Enter":yt(e,t);break;case"Escape":xt(e);break;case"Delete":case"Backspace":vt(e);break;default:e.emit("unusedKeydown",t)}}function St(e,t){if(e.props.disabled)return;if(!(t.currentTarget instanceof HTMLElement)||e.props.id!==t.currentTarget.id)return;const o=t.key;switch(o){case"Tab":!function(e,t){var o,n,r;e.props.expanded=!1,e.props.multiple&&e.props.selections.length&&"autocomplete"===e.props.type&&"option"===e.props.selectionAppearance&&(t.preventDefault(),null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_selection_wrapper_0`))||void 0===n||n.focus(),e.props.activeSelectionValue=(null===(r=e.props.selections[0])||void 0===r?void 0:r.value)||void 0)}(e,t);break;case"ArrowUp":case"ArrowDown":ht(e,o,t);break;case"ArrowRight":case"ArrowLeft":mt(e,o);break;case"Enter":yt(e,t);break;case"Escape":xt(e);break;case"Delete":case"Backspace":vt(e)}}function Lt(t){t.props.alwaysLoadOnOpen=void 0!==t.props.alwaysLoadOnOpen&&e.undefine(t.props.alwaysLoadOnOpen),t.on("created",(()=>{t.context&&(t.context.handlers.click=It.bind(null,t),t.context.handlers.focus=Dt.bind(null,t),t.context.handlers.keydown=kt.bind(null,t),t.context.handlers.selectorTagKeydownHandler=e=>wt.bind(null,t,e))}))}function It(e,t){var o;if(t.stopPropagation(),0===t.detail)return;if(e.props.disabled)return;e.props.attrs.onClick&&e.props.attrs.onClick(t);const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);e.props.justOpened?e.props.justOpened=!1:e.props.expanded?e.props.expanded=!1:(n&&"mouse"!==t.pointerType?(e.props.mouseX=-1,e.props.mouseY=-1):(e.props.mouseX=t.clientX,e.props.mouseY=t.clientY),e.props.expanded=!0,null==n||n.focus())}function Dt(e){e.props.disabled||(e.props.attrs.onFocus&&e.props.attrs.onFocus(),e.props.skipOpen?e.props.skipOpen=!1:e.props.openOnFocus&&(e.props.justOpened=!0,e.props.expanded=!0))}function At(t){let o,n="";t.on("unusedKeydown",(({payload:r})=>{if(!r.isComposing&&1===[...r.key].length){if(!n&&" "===r.key)return void function(t,o){var n;if(o.preventDefault(),t.props.expanded){if(t.props.activeValue===Pe)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore());const o=t.props.allOptions.find((o=>e.eq(Se(o),t.props.activeValue)));if(!o)return;We(t,o)}else t.props.expanded=!0}(t,r);t.props.expanded=!0,clearTimeout(o),n+=r.key;const s=t.props.allOptions.find((e=>e.label.toLowerCase().startsWith(n.toLowerCase())));s&&(t.props.activeValue=Se(s)),o=setTimeout((()=>{n=""}),400)}}))}function Ct(t){Tt(t),t.on("prop:selections",(()=>{t.props.skipFormatSelections=!1,Tt(t)})),c&&e.whenAvailable(`${t.props.id}_selections`,Ot.bind(null,t),t.props.__root)}function Tt(e){e.isCreated&&(e.props.selections.length&&e.props.lastVisibleIndex&&e.props.selections.length-e.props.lastVisibleIndex>1?e.props.truncationCount="+ "+(e.props.selections.length-e.props.lastVisibleIndex-1).toString():e.props.truncationCount=void 0,e.props.formattedSelections=e.props.selections.map(((t,o)=>e.props.lastVisibleIndex&&o===e.props.lastVisibleIndex&&0!==o?e.props.lastTruncatedElText&&o===e.props.selections.length-1?e.props.lastTruncatedElText:o===e.props.selections.length-1?t.label:t.label+"...":o===e.props.selections.length-1?t.label:t.label+", ")))}function Et(e){var t,o;if(!c||!e.context)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_selections`);if(!(n instanceof HTMLElement))return;const r=n.parentNode;if(!(r instanceof HTMLElement))return;let s=n.getBoundingClientRect().width;const a=.98*r.getBoundingClientRect().width,l=Array.prototype.slice.call(n.children),i=[...e.props.selections];if(s>a){const t=[];let n=0;for(let e=0;e<i.length;e++)t.push([i[e],l[e]]);for(let r=t.length-1;r>=0;r--){const l=t[r];if(!(l[1]instanceof HTMLElement))return;n+=l[1].getBoundingClientRect().width+parseFloat(window.getComputedStyle(l[1]).marginRight)+parseFloat(window.getComputedStyle(l[1]).marginLeft);const i=s-n;if(a>i){const t=l[0].label;e.props.skipFormatSelections=!0,l[1].textContent=t;let n=!1;for(let s=t.length;s>=0;s--){if(e.props.skipFormatSelections=!0,l[1].textContent=t.slice(0,s).trim()+"...",i+l[1].getBoundingClientRect().width<a){if(s<4){e.props.lastVisibleIndex=r-1,e.props.lastTruncatedElText=null;break}if(e.props.lastVisibleIndex=r,e.props.lastTruncatedElText&&l[1].textContent.slice(0,4)===e.props.lastTruncatedElText.slice(0,4))break;e.props.lastTruncatedElText=null===(o=l[1])||void 0===o?void 0:o.textContent;break}0===s&&(n=!0)}l[1].textContent=e.props.lastTruncatedElText&&!n&&0!==r?e.props.lastTruncatedElText:t,null===e.props.lastVisibleIndex&&(e.props.lastVisibleIndex=0===r?0:r-1,e.props.lastTruncatedElText=null),setTimeout((()=>{Tt(e)}));break}}}else e.props.lastTruncatedElText=null,e.props.lastVisibleIndex=null,Tt(e)}function Ot(e,t){const o=new ResizeObserver((()=>{e.props.selections&&0!==e.props.selections.length&&(e.props.skipFormatSelections?e.props.skipFormatSelections=!1:Et(e))})),n=new ResizeObserver((()=>{Et(e)}));o.observe(t),t.parentNode instanceof Element&&n.observe(t.parentNode)}const Mt={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Vt={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Ft={overflow:"hidden",height:"100%"},Pt={},Bt={};let Ht=0;function Rt(e){var t,o;if("undefined"==typeof window)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_popover`),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!r||!n)return;const s=n.style.paddingTop,a=n.style.paddingBottom,l=n.style.paddingLeft;n.style.paddingTop="0",n.style.paddingBottom="0",n.style.paddingLeft="0";const i=r.getBoundingClientRect(),p=n.getBoundingClientRect(),d=Math.round(i.top-p.top)+"px",c=Math.round(i.left-p.left-5)+"px",u=Math.max(Math.round(Math.min(p.height-p.top,window.innerHeight)-(i.top+i.height)),0)+"px";n.style.paddingTop=s,n.style.paddingBottom=a,n.style.paddingLeft=l,e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,paddingTop:d,paddingLeft:c,paddingBottom:u},e.props.listboxStyles={...e.props.listboxStyles,minWidth:"overscroll"===e.props.behavior?`min(${i.width+"px"}, calc(100vw - 4em))`:i.width+"px",maxWidth:"calc(100vw - 4em)"}}function Nt(t,o){var n,r;let s=null;if(t.props.activeDescendant){const a=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(t.props.activeDescendant);if(!a)return s;t.props.ignoreScroll=!0;const l=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}_listbox`);if(!l)return s;const i=o.getBoundingClientRect(),p=l.getBoundingClientRect(),d=parseInt(getComputedStyle(o).paddingTop),c=parseInt(getComputedStyle(o).paddingBottom),u=a.offsetTop-d,f=Math.max(u-d,0),v=Math.max(o.scrollHeight-c-u-i.height,0),h=p.height-f-v;o.scrollTop=u;const m=()=>{o.scrollTop=v>0?v<d?o.scrollHeight:d:f<c?0:u-c},g=Math.min(150,p.height);f>0&&v>0||0===f&&0===v||h>g?o.scrollTop=u:m();o.clientHeight/2<o.scrollTop&&(s=t.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((o=>e.eq(t.value,Se(o))))),-1===s&&(s=null)}return s}function Kt(o){o.addProps(["behavior"]),o.on("created",(()=>{"overscroll"===o.props.behavior&&("function"==typeof o.props.optionsLoader&&t.error(300,[o]),o.props.dropdownWrapperStyles=e.clone(Mt),o.props.listboxStyles={display:"inline-block"},o.props.styleWrapper=Rt.bind(null,o),o.props.positionListBox=Nt.bind(null,o))})),o.on("prop:expanded",(({payload:e})=>{"overscroll"===o.props.behavior&&(e?function(){Ht=document.documentElement.scrollTop;for(const e in Vt)Bt[e]=document.documentElement.style[e],document.documentElement.style[e]=Vt[e];for(const e in Ft)Pt[e]=document.body.style[e],document.body.style[e]=Ft[e];document.body.scrollTop=Ht}():function(){for(const e in Vt)document.documentElement.style[e]=Bt[e];for(const e in Ft)document.body.style[e]=Pt[e];document.body.scrollTop=0,document.documentElement.scrollTop=Ht}())}))}function Wt(t){t.addProps(["multiLine"]),t.on("created",(()=>{c&&(t.props.multiLineHeight=void 0,e.whenAvailable(`${t.props.id}_selections`,qt.bind(null,t),t.props.__root))}))}function qt(e){var t;const o=new ResizeObserver((t=>{for(const o of t){const{height:t}=o.contentRect;e.props.selectionsHeight!==t&&(e.props.selectionsHeight=t),Ut(e,o.target)}})),n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_selections`);n&&o.observe(n)}function Ut(e,t){var o;const n=t.querySelectorAll(`[id^="${e.props.id}_tag-wrapper"`);let r,s=[];if("taglist"===e.props.type){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;s=[t,...Array.from(n)]}else s=Array.from(n);if(!n)return;let a=!1;for(const t of s)if(void 0===r)r=t.getBoundingClientRect();else{const o=t.getBoundingClientRect();if(r.top>=o.top+o.height/5||r.top<=o.top-o.height/5){a=!0,e.props.multiLine=!0;break}}a||(e.props.multiLine=!1)}function zt(t){if(t.on("created",(()=>{t.context&&At(t)})),t.props.multiple||function(e){e.on("prop:selections",(({payload:t})=>{var o;e.props.firstSelectionLabel=(null===(o=t[0])||void 0===o?void 0:o.label)||"",e.props.option=t[0]}))}(t),"truncate"===t.props.selectionAppearance&&(t.props.lastVisibleIndex=null,Ct(t),t.on("prop:selections",(()=>{Ct(t)}))),"tags"===t.props.selectionAppearance&&Wt(t),t.props.multiple&&"tags"===t.props.selectionAppearance){function o(){return Array.isArray(t.value)?t.value:[]}function r(e,o){t.input(e)}t.on("created",(()=>{t.props.disabled&&(t.props.draggable=!1),e.whenAvailable(`${t.props.id}_selections`,(e=>{if(t.context&&e instanceof HTMLElement){const s={threshold:{horizontal:.25,vertical:0},plugins:[n.animations()],draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,disabled:!t.props.draggable,root:t.props.__root,touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag")};n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s}),t.on("prop:disabled",(({payload:t})=>{s.disabled=t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})})),t.on("prop:draggable",(({payload:t})=>{s.disabled=!t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})}))}}),t.props.__root)}))}t.on("prop:expanded",(({payload:e})=>{e&&t.props.optionsLoader&&"function"==typeof t.props.optionsLoader&&(!t.props.options.length||t.props.alwaysLoadOnOpen)&&(t.props.options=[],Ve(t))})),"overscroll"===t.props.behavior&&Kt(t)}const Yt=(e,t)=>{let o=null,n=null,r=null;return function(...s){const a=this;o?(n=s,r=a):(e.apply(a,s),o=window.setTimeout((()=>{o=null,null!==n&&null!==r&&(e.apply(r,n),n=null,r=null)}),t))}};function jt(t){if(t.addProps(["popover","popoverOffset","usePopover","popoverCoordinates","popoverAncestorCoordinates"]),t.props.popover=e.undefine(t.props.popover)?"manual":void 0,"input"!==t.type||"overscroll"===t.props.behavior)return;let o=null,n=null,r=[],s=null;if(t.props.popoverOffset=e.undefine(t.props.popoverOffset)?parseInt(t.props.popoverOffset):0,!t.props.popover)return;if("undefined"==typeof document||!("popover"in HTMLElement.prototype))return void("undefined"!=typeof window&&console.warn('FormKit: Popover API is not supported in this browser — input panels will be rendered with fallback CSS positioning. This could result in inaccessible inputs due to parent containers using "overflow: hidden" or z-index conflicts.'));const a=()=>{t.props.invertPopover=!1,document.removeEventListener("resize",s),document.removeEventListener("scroll",s),r.forEach((e=>{e.removeEventListener("scroll",s)}))};function l(){const{x:e,y:r,width:s,height:a}=function(e,t){if(!e||!t)return{x:0,y:0};const{left:o,top:n,width:r,height:s}=t.getBoundingClientRect();return{x:o+window.scrollX,y:n+s+window.scrollY,width:r,height:s}}(o,n);t.props.popoverAncestorCoordinates={x:e,y:r,width:s,height:a},t.props.popoverCoordinates={x:e,y:r,width:s,height:0}}function i(e){o&&document.body.contains(o)&&(e?(null==o||o.showPopover(),setTimeout((()=>{t.props.popoverCoordinates.height=(null==o?void 0:o.offsetHeight)||0}),5)):o.matches(":popover-open")&&(o.hidePopover(),t.props.popoverCoordinates.height=0))}t.on("mounted",(()=>{t.context&&(t.props.usePopover=!0,t.props.popoverCoordinates={x:0,y:0,width:0,height:0},t.props.popoverAncestorCoordinates={x:0,y:0,width:0,height:0})})),t.on("destroyed",(()=>{a()})),t.on("prop:inputText",(()=>{t.context&&(l(),i(!0))})),t.on("prop:expanded",(({payload:p})=>{var d;t.context&&(!1===p?a():e.whenAvailable(`${null===(d=t.context)||void 0===d?void 0:d.id}_popover`,(()=>{if(!t.context)return;o=document.querySelector(`[id="${t.context.id}_popover"][popover]`)||document.querySelector(`[id="${t.context.id}_popover"] [popover]`),n||(n=function(e){if(!e)return null;let t=e.parentElement;for(;t&&"static"===window.getComputedStyle(t).position;)t=t.parentElement;return t}(o)),l(),i(p),s=Yt((()=>{t.context&&(l(),i(p))}),10),document.addEventListener("resize",s),document.addEventListener("scroll",s),r=[];let e=null==o?void 0:o.parentElement;for(;e;)e.scrollHeight>e.clientHeight&&r.push(e),e=e.parentElement;r.forEach((e=>{e.addEventListener("scroll",s)}))})))}))}const Zt={schema:/* #__PURE__ */j(/* #__PURE__ */Z(/* #__PURE__ */J("$label"),/* #__PURE__ */G(/* #__PURE__ */X("prefix"),/* #__PURE__ */Q(),/* #__PURE__ */re(/* #__PURE__ */U("$inputStd.length === 0 && $state.loading !== true",/* #__PURE__ */le('$placeholder || "placeholder"'),/* #__PURE__ */U("$multiple !== true",/* #__PURE__ */se(/* #__PURE__ */U("$state.loading && $selections.length === 0",/* #__PURE__ */ie("$ui.isLoading.value"),/* #__PURE__ */ae(/* #__PURE__ */pe("$option.label")))),/* #__PURE__ */U('$multiple && $selectionAppearance === "truncate"',/* #__PURE__ */ce(/* #__PURE__ */ue(/* #__PURE__ */U("$state.loading && $selections.length === 0",/* #__PURE__ */ie("$ui.isLoading.value"),/* #__PURE__ */ve()))),/* #__PURE__ */U('$multiple && $selectionAppearance === "tags"',/* #__PURE__ */$e(/* #__PURE__ */be(/* #__PURE__ */U("$state.loading && $isLoadingOption !== true && $selections.length === 0",/* #__PURE__ */ie("$ui.isLoading.value"),/* #__PURE__ */he(/* #__PURE__ */me(/* #__PURE__ */U("$state.loading && $fns.hasOptionLoaderValue($option) || $option.label === undefined",/* #__PURE__ */ye("$ui.isLoading.value"),/* #__PURE__ */ge("$option.label")),/* #__PURE__ */de(/* #__PURE__ */X("close"))))))))))),/* #__PURE__ */U("$truncationCount && $state.loading !== true",/* #__PURE__ */fe("$truncationCount")),/* #__PURE__ */U("$state.loading",/* #__PURE__ */X("loader")),/* #__PURE__ */U("$inputStd.length !== 0 && $selectionRemovable",/* #__PURE__ */de(/* #__PURE__ */X("close")),/* #__PURE__ */X("select"))),/* #__PURE__ */xe(),/* #__PURE__ */ee(),/* #__PURE__ */X("suffix"))),/* #__PURE__ */te("$help"),/* #__PURE__ */oe(/* #__PURE__ */ne("$message.value"))),type:"input",family:"dropdown",props:[],features:[
|
|
2
2
|
/* #__PURE__ */o.defaultIcon("select","select"),
|
|
3
3
|
/* #__PURE__ */o.defaultIcon("close","close"),
|
|
4
4
|
/* #__PURE__ */o.defaultIcon("selected","check"),
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
/* #__PURE__ */o.defaultIcon("remove","trash"),
|
|
17
17
|
/* #__PURE__ */o.defaultIcon("add","add"),
|
|
18
18
|
/* #__PURE__ */o.defaultIcon("moveUp","arrowUp"),
|
|
19
|
-
/* #__PURE__ */o.defaultIcon("moveDown","arrowDown")]},Zo=new WeakMap;function Go(e,t){const o={onItems:[],offItems:[]},n=t||Number(e.value||0);for(let t=0;t<e.props.max;t++)if(t<n&&t+1>=n){const r=e.props.rightToLeft?100-100*(n-t):100*(n-t);o.onItems.push(r+"%"),o.offItems.push(100-r+"%")}else t<n?(o.offItems.push("0%"),o.onItems.push("100%")):t>=n&&(o.offItems.push("100%"),o.onItems.push("0%"));e.props.itemsToPercentages=o}function Xo(e,t){var o;null===(o=e.context)||void 0===o||o.handlers.blur(t)}function Jo(e,t){const{x:o,y:n}=ln(t);let r=document.elementFromPoint(o,n);const s=Array.from(document.querySelectorAll(`#${e.props.id}_items_wrapper > .formkit-ratingItem`));let a=!0;for(;r&&a;){if(s.includes(r)){a=!1;break}r=r.parentNode}if(!a){const t=s.indexOf(r);if(1===e.props.step)return void e.input(t+1,!1)}}function Qo(e,t,o){e.props.disabled||(o.preventDefault(),e.props.hoverHighlight=!0,e.props.touchStarted=!0,1!==e.props.step?pn(e,t,o):e.input(t+1,!1))}function en(e,t){if(!e.props.dragStarted)return;t.preventDefault(),e.props.hoverHighlight=!1,e.props.dragStarted=!1,Go(e);const o=Zo.get(e);o&&(o.abort(),Zo.delete(e))}function tn(e,t,o){if(e.props.hoverHighlight||e.props.disabled)return;o.preventDefault(),e.props.hoverHighlight=!0,e.props.dragStarted=!0;const n=new AbortController;document.addEventListener("mouseup",(t=>en(e,t)),{signal:n.signal}),Zo.set(e,n),1===e.props.step?e.input(t+1,!1):pn(e,t,o)}function on(e,t){var o,n;if(document.activeElement===t.currentTarget)if("ArrowRight"===t.key||"ArrowDown"===t.key){e.props.arrow=1;const t=e.value?dn(e.value+1*e.props.step,e.props.step):e.props.min+1*e.props.step,n=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(e.value?`#${e.props.id}_inner input[value="${t}"]`:"#"+(e.props.id+"_0_0"));e.props.preventFocus=!0,n&&n instanceof HTMLInputElement&&n.focus(),e.props.preventFocus=!1,e.input(Number(t))}else if("ArrowLeft"===t.key||"ArrowUp"===t.key){e.props.arrow=-1;const t=e.value?dn(e.value-1*e.props.step,e.props.step):e.props.max,o=null===(n=e.props.__root)||void 0===n?void 0:n.querySelector(`#${e.props.id}_inner input[value="${t}"]`);e.props.preventFocus=!0,o&&o instanceof HTMLInputElement&&o.focus(),e.props.preventFocus=!0,e.input(Number(t)),e.props.preventFocus=!1}}function nn(e,t){if(!e.props.preventFocus)if(e.props.preventFocus=!0,setTimeout((()=>{e.props.preventFocus=!1}),50),t.relatedTarget instanceof HTMLElement&&t.relatedTarget.id===e.props.id+"_items_wrapper")e.props.arrow>0?setTimeout((()=>{var t,o;null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+"_0_0"))||void 0===o||o.focus()})):e.props.arrow<0&&setTimeout((()=>{var t,o;null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+`_${e.props.max-1}_${e.props.stepsPerValue-1}`))||void 0===o||o.focus()}));else if(t.target instanceof HTMLInputElement){if(Number(t.target.value)===e.props.step&&e.value===e.props.max||Number(t.target.value)===e.props.max&&e.value===e.props.step){const t=document.getElementById(e.props.id+"_items_wrapper");return null==t||t.focus(),void e.input(0)}e.input(Number(t.target.value))}}function rn(e,t,o){e.props.hoverHighlight&&(e.props.disabled||(1===e.props.step?(Go(e,t+1),e.props.dragStarted&&e.input(t+1,!1)):pn(e,t,o,!!e.props.dragStarted)))}function sn(e){Go(e)}function an(e,t,o){if(!e.props.disabled&&"touchstart"!==o.type&&(o.preventDefault(),(0!==o.clientX||0!==o.clientY)&&o.currentTarget instanceof HTMLElement))return 1===e.props.step?e.props.deselect&&Number(e.value)===t+1?void e.input(0):void e.input(t+1):void pn(e,t,o)}function ln(e){return e instanceof MouseEvent?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}}function pn(e,t,o,n=!0){if(!(o.currentTarget instanceof HTMLElement))return;const{x:r,y:s}=ln(o),a=o.currentTarget.getBoundingClientRect();let l=dn((r-a.x)/a.width+t,e.props.step);l=l>e.props.min?l:e.props.min,l=l<e.props.max?l:e.props.max,!e.props.deselect||l!==Number(e.value)||e.props.dragStarted?n?e.input(l,!1):Go(e,l):e.input(0)}function dn(e,t){t||(t=1);const o=1/t;return Math.ceil(e*o)/o}const cn=/* #__PURE__ */K("rt"),{outer:un,wrapper:fn,inner:vn,label:hn,prefix:mn,suffix:gn,help:$n,messages:bn,message:yn,icon:xn}=/* #__PURE__ */W(cn),wn=cn("itemsWrapper",(()=>({$el:"span",attrs:{style:{"flex-direction":'$rightToLeft && "row-reverse" || undefined'},tabindex:"$value !== undefined && $value !== 0 && '-1' || '0'",id:"$id + _items_wrapper",onKeydown:"$handlers.handleWrapperKeydown","data-disabled":"$disabled",onBlur:"$handlers.handleWrapperBlur",onMouseleave:"$hoverHighlight && $handlers.handleMouseleave"}}))),_n=cn("ratingItem",(()=>({for:["item","index","$max"],$el:"span",attrs:{id:'$id + "_item_" + $index',onClick:"$handlers.handleItemClick($item)",draggable:"$hoverHighlight !== true && && $disabled !== true && true",onMousemove:"$handlers.handleMousemove($item)",onDragstart:"$handlers.handleDragstart($item)",onDragend:"$handlers.handleDragend",onTouchstartPassive:"$handlers.handleTouchstart($item)",onTouchmovePassive:"$handlers.handleTouchmove"}}))),kn=cn("template",(()=>({for:["increment","stepIndex","$stepsPerValue"],$el:null}))),Sn=cn("itemLabel",(()=>({$el:"label",attrs:{id:'$id + "_label_" + $index + "_" + $stepIndex',for:'$id + "_" + $index + "_" + $stepIndex',"data-checked":'$value === $fns.getValue($item, $increment) && "true" || "false"',style:{width:'$fns.showLabel($fns.getValue($item, $increment), $stepIndex, $item) && "100%" || "0%"'}}}))),Ln=cn("itemLabelInner",(()=>({$el:"span",children:"$fns.getValue($item, $increment)"}))),In=cn("input",(()=>({$el:"input",attrs:{type:"radio",value:"$fns.getValue($item, $increment)",id:'$id + "_" + $index + "_" + $stepIndex',onFocus:"$handlers.handleFocus",tabindex:'$value === $fns.getValue($item, $increment) && "0" || "-1"',disabled:"$disabled",name:"$id","data-value":"$fns.getValue($item, $increment)",checked:"$value === $fns.getValue($item, $increment) && true",onKeydown:"$handlers.handleKeydown($fns.getValue($item, $increment))"}}))),Dn=cn("onItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item)",display:"flex",position:"relative",overflow:"hidden",top:"0",left:"0",bottom:"0"}}}))),An=cn("offItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item, false)",display:"flex","flex-direction":"row-reverse",position:"absolute",zIndex:"$offItemStyles && 100",overflow:"hidden",top:"0",right:"0"}}}))),Cn=cn("onItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$onColor"}}}))),Tn=cn("offItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$offColor"}}}))),En=()=>U("$slots.onItem",(()=>()=>"$slots.onItem"),U("$slots.default",(()=>()=>"$slots.default"),xn("rating"))),On=()=>U("$slots.offItem",(()=>()=>"$slots.offItem"),U("$slots.default",(()=>()=>"$slots.default"),xn("rating"))),Mn={schema:/* #__PURE__ */un(/* #__PURE__ */fn(/* #__PURE__ */hn("$label"),/* #__PURE__ */vn(/* #__PURE__ */xn("prefix"),/* #__PURE__ */mn(),/* #__PURE__ */wn(/* #__PURE__ */_n(/* #__PURE__ */kn(/* #__PURE__ */Sn(/* #__PURE__ */Dn(/* #__PURE__ */Cn(/* #__PURE__ */En())),/* #__PURE__ */An(/* #__PURE__ */Tn(/* #__PURE__ */On())),/* #__PURE__ */Ln()),/* #__PURE__ */In()))),/* #__PURE__ */gn(),/* #__PURE__ */xn("suffix"))),/* #__PURE__ */$n("$help"),/* #__PURE__ */bn(/* #__PURE__ */yn("$message.value"))),type:"input",props:[],features:[function(t){function o(e){setTimeout((()=>{const t=Array.from(document.querySelectorAll(`#${e.props.id}_items_wrapper > .formkit-ratingItem`));for(let e=0;e<t.length;e++){const o=t[e].querySelectorAll(".formkit-onItemWrapper"),n=t[e].querySelectorAll(".formkit-offItemWrapper");for(let n=0;n<o.length;n++)o[n].style.flex=`0 0 ${t[e].getBoundingClientRect().width}px`;for(let o=0;o<n.length;o++)n[o].style.flex=`0 0 ${t[e].getBoundingClientRect().width}px`}}))}t.addProps(["max","step","stepsPerValue","itemsToPercentages","rightToLeft","onItemStyles","offItemStyles","hoverHighlight","deselect","disabled","wrapperWidth","onColor","offColor"]),!1!==t.props.hoverHighlight&&"false"!==t.props.hoverHighlight&&(t.props.hoverHighlight=!0),t.props.deselect=e.undefine(t.props.deselect),t.props.max=Number(t.props.max)||5,t.props.min=Number(t.props.min)||0,t.props.step=Number(t.props.step)||1,t.props.numberOfSteps=t.props.max/t.props.step,t.props.lastIndex=1/t.props.step-1,t.props.itemsToPercentages={},"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.props.rightToLeft?(t.props.onItemStyles=void 0,t.props.offItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%",zIndex:100}):t.props.onItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%"},t.props.stepsPerValue=1/t.props.step,t.hook.input(((e,o)=>{if(null===e||""===e||isNaN(e))return o(e);const n=Number(e),r=Number(t.props.min),s=Number(t.props.max);return n>s?o(s):t.props.min&&n<=r?o(r):o(n)})),t.on("commit",(({payload:e})=>{const o=Number(e||0);Go(t,o)})),t.on("created",(()=>{t.context&&(e.whenAvailable(`${t.props.id}_items_wrapper`,(()=>{o(t),function(e){var t;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_items_wrapper`);if(!n)return;new ResizeObserver((()=>{o(e)})).observe(n)}(t),setTimeout((()=>o(t)),100)}),t.props.__root),t.context.fns.getPercentage=(e,t,o=!0)=>(o?e.onItems:e.offItems)[t],t.context.fns.getValue=(e,o)=>e+Number((o*t.props.step+t.props.step).toFixed(1)),t.context.fns.showLabel=(e,o)=>{const n=Number(t.value||0);return 0===n&&0===o||n&&e===n||e>n&&0===o||n>e&&o===t.props.lastIndex},t.context.handlers.handleFocus=e=>nn.call(null,t,e),t.context.handlers.handleWrapperKeydown=e=>on.call(null,t,e),t.context.handlers.handleWrapperBlur=e=>Xo.call(null,t,e),t.context.handlers.handleItemClick=e=>o=>an.call(null,t,e,o),t.context.handlers.handleMousemove=e=>o=>rn.call(null,t,e,o),t.context.handlers.handleMouseleave=()=>sn.call(null,t),t.context.handlers.handleDragstart=e=>o=>tn.call(null,t,e,o),t.context.handlers.handleMouseup=e=>en.call(null,t,e),t.context.handlers.handleTouchstart=e=>o=>Qo.call(null,t,e,o),t.context.handlers.handleTouchmove=e=>Jo.call(null,t,e),t.context.handlers.handleKeydown=e=>o=>function(e,t,o){const n=Number(e.value);e.props.deselect&&" "===o.key&&n===t?e.input(0):" "===o.key&&e.input(t)}(t,e,o))}))},/* #__PURE__ */o.defaultIcon("rating","star")]},Vn=/* #__PURE__ */K("ac"),{outer:Fn,wrapper:Pn,inner:Bn,icon:Hn,label:Rn,prefix:Nn,suffix:Kn,help:Wn,messages:qn,message:Un}=/* #__PURE__ */W(Vn),zn=Vn("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",onFocus:"$handlers.focus",value:"$inputText || undefined",name:"$node.name",placeholder:"$state.loading && $ui.isLoading.value || $placeholder || undefined",tabindex:'$disabled && "-1" || 0',role:"combobox",autocomplete:'$attrs.autocomplete || "off"',autocapitalize:"none",readonly:"$attrs.readonly || $state.loading || $multiple && $max && $value && $value.length >= $max && $hasHighlightedRange !== true || undefined","data-selection-appearance":"$selectionAppearance",disabled:"$disabled || $disabledInternally || undefined",onTouchmovePassive:"$handlers.touchmove",onTouchstartPassive:"$handlers.touchmove",onTouchend:"$handlers.touchend","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined","aria-required":"$state.required || undefined"}}))),Yn=Vn("listboxButton",(()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',role:"button","aria-label":"$expanded && $ui.close.value || $ui.open.value",onClick:"$handlers.toggleListbox",onKeydown:"$handlers.toggleListboxKeydown",tabindex:'$disabled && "-1" || 0',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-disabled":"$disabled || $state.loading || undefined","data-disabled":"$disabled || $disabledInternally || undefined"}}))),jn=Vn("selectionWrapper",(()=>({for:["option","index","$selections"],$el:"div",attrs:{id:'$id + "_selection_wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:'$disabled && "-1" || 0',onKeydown:"$handlers.selectionKeydown && $handlers.selectionKeydown($multiple && $option || undefined)",onClick:"$handlers.selectionClick && $handlers.selectionClick($multiple && $option || undefined)",onFocus:"$handlers.selectionFocus && $handlers.selectionFocus($multiple && $option || undefined)",onBlur:"$handlers.selectionBlur && $handlers.selectionBlur($multiple && $option || undefined)","data-is-selection":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),Zn=Vn("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),Gn=Vn("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),Xn=Vn("removeSelection",(()=>({$el:"button",attrs:{id:'$selectionAppearance === "option" && $multiple && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"0",title:"$ui.remove.value",type:"button","aria-label":"$ui.remove.value",onClick:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)",onTouchend:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)","aria-controls":"$id"}}))),Jn=Vn("optionLoading","span"),Qn=Vn("option",(()=>({$el:"div",if:"$value !== undefined"}))),er=/* #__PURE__ */z(Vn);function tr(t){"option"!==t.props.selectionAppearance||t.props.multiple||!1===t.props.selectionRemovable||"false"===t.props.selectionRemovable||(t.props.selectionRemovable=!0),t.props.multiple||(t.props.clearSearchOnOpen=e.undefine(t.props.clearSearchOnOpen)),t.props.selectionRemovable=e.undefine(t.props.selectionRemovable),t.props.openOnClick=e.undefine(t.props.openOnClick),"option"!==t.props.selectionAppearance||t.props.multiple||(t.props.isSingleOption=!0),void 0===t.props.closeOnSelect&&(t.props.closeOnSelect=!0),void 0===t.props.selectionAppearance&&(t.props.selectionAppearance="text-input"),void 0===t.props.closeOnSelect&&(t.props.closeOnSelect=!0),t.props.closeOnSelect?t.props.resetSearchOnCommit=!1:void 0===t.props.resetSearchOnCommit&&(t.props.resetSearchOnCommit=t.props.multiple),t.props.allowNewValues=e.undefine(t.props.allowNewValues)}function or(t){t.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter","hasHighlightedRange","clearOnClick","debounce"]),void 0===t.props.debounce?t.props.debounce=200:t.props.debounce=parseInt(t.props.debounce),t.props.nonceKey="searchValue",t.props.searchValue="",t.props.inputText="",t.props.filterOptions=De.bind(null,t),t.props.reloadOnCommit=e.undefine(t.props.reloadOnCommit),void 0===t.props.alwaysLoadOnOpen?t.props.alwaysLoadOnOpen=!0:t.props.alwaysLoadOnOpen=e.undefine(t.props.alwaysLoadOnOpen),"function"!=typeof t.props.filter&&(t.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),t.on("created",(()=>{t.context&&c&&(t.context.handlers.focus=sr.bind(null,t),t.context.handlers.input=nr.bind(null,t),t.context.handlers.focus=sr.bind(null,t),t.context.handlers.click=rr.bind(null,t),t.context.handlers.toggleListbox=ar.bind(null,t),t.context.handlers.toggleListboxKeydown=lr.bind(null,t),t.context.handlers.keydown=St.bind(null,t),t.context.handlers.selectionKeydown=e=>o=>_t(t,e,o),t.context.handlers.searchInputTagKeydown=e=>o=>function(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":gt(e);break;case"ArrowRight":case"ArrowLeft":$t(e,t,o);break;case"Delete":case"Backspace":bt(e,t,o)}}(t,e,o),t.on("prop:options",(({payload:e})=>{if((0===t.props.initialOptions.length&&"function"!=typeof t.props.optionsLoader||!t.props.searchValue&&e.length)&&(t.props.initialOptions=[...e]),t.props.selections&&t.props.selections.length&&e.length)for(let o=0;o<t.props.selections.length;o++){const n=t.props.selections[o],r=e.find((e=>Se(e)===n.value));r&&(t.props.selections[o]=r)}})))})),t.on("prop:expanded",(({payload:e})=>{e||Le.delete(t)}))}function nr(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&De(e,e.props.searchValue,!0)}function rr(e,t){t.stopPropagation(),e.props.disabled||e.props.disabledInternally||(e.props.attrs.onClick&&e.props.attrs.onClick(t),(!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0))}function sr(e){e.props.disabled||e.props.disabledInternally||(e.props.attrs.onFocus&&e.props.attrs.onFocus(),e.props.activeSelectionValue=void 0,e.props.skipOpen?e.props.skipOpen=!1:e.props.openOnFocus&&(e.props.expanded=!0))}function ar(e){var t,o,n;e.props.disabled||e.props.disabledInternally||(null===(t=e.context)||void 0===t?void 0:t.state.loading)||(e.props.expanded=!e.props.expanded,e.props.openOnFocus||null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus())}function lr(e,t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),ar(e))}const ir=new WeakMap,pr="undefined"!=typeof window,dr=new WeakMap;let cr=!1;function ur(t){t.props.searchValue=null,t.on("commit",(()=>{t.props.searchValue=null,t.props.highlightedRange||fr(t)})),t.on("created",(()=>{if(!t.context||!pr)return;t.on("handleSearchInput",(({payload:e})=>{""===e?(t.props.searchValue=null,t.input([])):e&&0===t.props.inputStd.length?t.props.searchValue=e:e&&t.props.inputStd.length>0&&(t.props.searchValue=function(e){var t;const o=hr(e);if(e.props.highlightedRange){const[t,n]=vr(e,o);return e.props.inputText.slice(t,n)}return e.props.inputText.slice((null===(t=o[o.length-1])||void 0===t?void 0:t.end)+2)}(t)),!t.props.expanded&&e?t.props.expanded=!0:!e&&t.props.expanded&&(t.props.expanded=!1)})),function(t){e.whenAvailable(`${t.props.id}`,(e=>{e instanceof HTMLInputElement&&dr.set(e,t)}),t.props.__root),pr&&!cr&&(cr=!0,document.addEventListener("selectionchange",(()=>{const e=ke();if(e instanceof HTMLInputElement&&dr.has(e)){const t=dr.get(e);t&&function(e){clearTimeout(ir.get(e)),ir.set(e,setTimeout((()=>{var t,o,n,r;const s=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);if(s instanceof HTMLInputElement){const t=hr(e),a=t.findIndex((e=>null!==s.selectionStart?s.selectionStart>=e.start&&s.selectionStart<=e.end:null!==s.selectionEnd&&(s.selectionEnd>=e.start&&s.selectionEnd<=e.end))),l=null===(o=t[t.length-1])||void 0===o?void 0:o.end;if(0===s.selectionStart&&s.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))return;if("string"==typeof e.props.searchValue&&e.props.highlightedRange){if(t.length){const o=e.props.highlightedRange,[n,r]=vr(e,t);if(null!==s.selectionEnd&&(s.selectionEnd<n||s.selectionEnd>r)){const t=o.end-o.start-(r-n),a=s.selectionEnd;e.props.inputText=e.props.option.label,e.props.highlightedRange=void 0,e.props.searchValue=null,s.value=e.props.inputText,s.selectionStart=s.selectionEnd=a+(a>n?t:0)}}}else if(a>=0&&null!==s.selectionStart&&(l!==(null===(r=e.props.inputText)||void 0===r?void 0:r.length)||s.selectionStart<l)){const o=t[a],n=e.props.inputText.substr(0,l),r=o.start+(o.index>0?1:0),i=o.end+(t.length-1>o.index?-1:0);n!==e.props.inputText&&(e.props.inputText=n,s.value=n),e.props.highlightedRange=o,s.selectionStart=r,s.selectionEnd=i}else e.props.highlightedRange=void 0,fr(e);if(null!==s.selectionStart&&s.selectionStart>=l&&", "!==e.props.inputText.substring(l,l+2)){let t=e.props.inputText.substring(0,l);t=e.props.multiple&&e.props.max&&Array.isArray(e.props.inputStd)&&e.props.inputStd.length>=e.props.max?t:`${t},`,e.props.inputText=`${t} ${e.props.inputText.substring(l).replace(/^[,\s]{1,2}/,"")}`}}}),5))}(t)}})))}(t);const n=t.context.handlers.keydown;t.context.handlers.keydown=e=>{n(e),function(e,t){var n,r,s,a;if(["ArrowRight","ArrowLeft"].includes(t.key)&&t.target instanceof HTMLInputElement&&null!==t.target.selectionEnd&&null!==t.target.selectionStart){if(0===t.target.selectionStart&&t.target.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))"ArrowLeft"===t.key?o(0):o(-1);else if(!e.props.searchValue){e.props.searchValue=null;const o=hr(e),n=null===(r=o[o.length-1])||void 0===r?void 0:r.end;t.target.selectionStart<n&&(t.target.selectionStart=Math.max(0,"ArrowLeft"===t.key?t.target.selectionStart-2:t.target.selectionEnd+2))}}else if(["Delete","Backspace"].includes(t.key))e.props.highlightedRange&&!e.props.searchValue?(He(e,e.props.highlightedRange.option),0===e.props.inputStd.length&&(e.props.highlightedRange=void 0)):t.target instanceof HTMLInputElement&&(e.props.searchValue=null,o(-1,!0)&&t.preventDefault());else if(t.target instanceof HTMLInputElement&&0===t.target.selectionStart&&t.target.selectionEnd===(null===(s=e.props.inputText)||void 0===s?void 0:s.length)&&(null===(a=e.props.inputText)||void 0===a?void 0:a.length)&&0===e.props.selections.length)t.preventDefault();else if("Tab"===t.key)return;"ArrowLeft"===t.key&&o(-1,!0)&&t.preventDefault()}(t,e)};const r=t.context.handlers.focus;t.context.handlers.focus=e=>{r(t,e);const o=new Event("selectionchange");document.dispatchEvent(o)},t.on("blur",(()=>{t.props.selections.length?(t.props.inputText=t.props.selections.map((e=>e.label)).join(", "),t.props.searchValue=null):t.props.selections.length||(t.props.inputText="",t.props.searchValue="")}))})),t.on("prop:expanded",(({payload:e})=>{e||t.props.inputStd.length?e&&(t.props.options.length&&!t.props.alwaysLoadOnOpen||(t.props.options=[],De(t,t.props.searchValue))):(t.props.searchValue="",t.props.inputText="")})),t.on("prop:selections",(()=>{var e;const o=[...t.props.selections].map((e=>e.label)).join(", ");let n="";if(pr&&t.isCreated){const o=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`${t.props.id}`);if(ke()===o&&Array.isArray(t._value)&&t._value.length){if(t.props.max&&t._value.length>=Number(t.props.max))return;n=", "}}t.props.inputText=`${o}${n}`,t.props.reloadOnCommit&&(t.props.searchValue="",De(t,t.props.searchValue))}));const o=(e,o=!1)=>{var n,r;const s=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(`${t.props.id}`);if(!(s instanceof HTMLInputElement))return!1;const a=hr(t),l=e>=0?e:a.length-1;if(void 0===a[l])return!1;const i=null===(r=a[l])||void 0===r?void 0:r.end;return null!==s.selectionStart&&(!o||s.selectionStart>=i&&s.selectionStart<=i+2)&&(s.selectionStart=a[l].start+(l>0?1:0),s.selectionEnd=a[l].end+(l<a.length-1?-1:0),!0)};let n;t.on("selectRange",(({payload:e})=>o(...e))),t.on("prop:highlightedRange",(({payload:e})=>{t.props.hasHighlightedRange=!!e,e&&t.props.expanded&&n!==e.option&&(n=e.option,Ne(t))}))}function fr(e){var t;if(!pr)return;const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);o&&o.scrollTo({left:o.scrollWidth,behavior:"smooth"})}function vr(e,t){var o;const n=e.props.highlightedRange,r=n.index,s=n.start+(r?1:0),a=t.length-1>r?t[t.length-1].end-t[r+1].start:0;return[s,(null===(o=e.props.inputText)||void 0===o?void 0:o.length)-a+(t.length-1>n.index?-1:0)]}function hr(e){const t=Be(e);return Array.isArray(t)&&t.length?t.reduce(((e,o,n)=>{var r;const s=(null===(r=e[n-1])||void 0===r?void 0:r.end)||0;let a=0;return t.length-1!==n&&a++,0!==n&&a++,e.push({option:o,index:n,start:s,end:s+o.label.length+a}),e}),[]):[]}function mr(e){!function(e){e.on("prop:expanded",(({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],De(e,e.props.searchValue,!0))):(e.props.searchValue="",e.props.inputText="")}))}(e),function(e){e.on("handleSearchInput",(({payload:t})=>{t&&!e.props.expanded?(e.props.searchExpand=!0,e.props.expanded=!0):!t&&e.props.expanded&&(e.props.expanded=!1),e.props.searchValue=e.props.inputText}))}(e),function(e){e.on("prop:selections",(()=>{e.isCreated&&(e.props.inputText="",e.props.searchValue="",e.props.optionRemoved||e.props.reloadOnCommit&&De(e,e.props.searchValue,!0))}))}(e)}function gr(e){!function(e){function t(e){0===e.props.inputStd.length?(e.props.inputText="",e.props.searchValue=""):(e.props.inputText=e.props.selections[0].label,e.props.searchValue=e.props.selections[0].label)}function o(e){e.props.clearSearchOnOpen&&!e.props.searchExpand&&(e.props.inputText="",e.props.searchValue=""),e.props.searchValue=e.props.inputText,e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],De(e,e.props.searchValue,!0)),e.props.searchExpand&&(e.props.searchExpand=!1)}e.on("prop:expanded",(({payload:n})=>{n?o(e):t(e)}))}(e),function(e){e.on("handleSearchInput",(({payload:t})=>{""===t?(0===e.props.inputStd.length&&(e.props.expanded=!1),e.input(void 0)):t&&!e.props.expanded&&(e.props.searchExpand=!0,e.props.expanded=!0),e.props.searchValue=e.props.inputText}))}(e),function(e){e.on("prop:selections",(({payload:t})=>{e.props.inputText=t.length?t[0].label:"",e.props.searchValue=t.length?t[0].label:"",e.isCreated&&e.props.expanded&&0===t.length&&De(e,e.props.searchValue,!0)}))}(e)}function $r(t){if(t.props.multiple)if(t.props.multiple&&"option"===t.props.selectionAppearance){function o(){return Array.isArray(t.value)?t.value:[]}function r(e){t.input(e)}mr(t),t.on("created",(()=>{t.props.disabled&&(t.props.draggable=!1),e.whenAvailable(`${t.props.id}_selections`,(e=>{if(e instanceof HTMLElement&&t.context){const s={draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,root:t.props.__root,disabled:!t.props.draggable,plugins:[n.animations()],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-selection")};n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s}),t.on("prop:disabled",(({payload:t})=>{s.disabled=t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})})),t.on("prop:draggable",(({payload:t})=>{s.disabled=!t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})}))}}),t.props.__root)}))}else t.props.multiple&&"text-input"===t.props.selectionAppearance&&ur(t);else gr(t)}const br={schema:/* #__PURE__ */Fn(/* #__PURE__ */Pn(/* #__PURE__ */Rn("$label"),/* #__PURE__ */Bn(/* #__PURE__ */Hn("prefix"),/* #__PURE__ */Nn(),/* #__PURE__ */zn(),/* #__PURE__ */U("$multiple !== true && $selectionAppearance === option && $expanded === false",/* #__PURE__ */Gn(/* #__PURE__ */jn(/* #__PURE__ */Zn(/* #__PURE__ */Qn(/* #__PURE__ */U("$state.loading",/* #__PURE__ */Jn("$ui.isLoading.value"),"$option.label"))),/* #__PURE__ */U("$state.loading && $isSingleOption !== true && $optionLoaderValues.includes($option.value)",/* #__PURE__ */Hn("loader")),/* #__PURE__ */U("$selectionRemovable && $isSingleOption",/* #__PURE__ */Xn(/* #__PURE__ */Hn("close")))))),/* #__PURE__ */U("$state.loading && ($isSingleOption !== true || $selections.length === 0)",/* #__PURE__ */Hn("loader")),/* #__PURE__ */U('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',/* #__PURE__ */Xn(/* #__PURE__ */Hn("close")),/* #__PURE__ */U('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',/* #__PURE__ */Yn(/* #__PURE__ */Hn("select")))),/* #__PURE__ */U("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $optionLoaderValues.length > 0)",/* #__PURE__ */Yn(/* #__PURE__ */Hn("select"))),/* #__PURE__ */er(),/* #__PURE__ */Kn(),/* #__PURE__ */Hn("suffix")),/* #__PURE__ */U("$multiple && $selectionAppearance === option",/* #__PURE__ */Gn(/* #__PURE__ */jn(/* #__PURE__ */Zn(/* #__PURE__ */Qn(/* #__PURE__ */U("$state.loading && $isLoadingOption",/* #__PURE__ */Jn("$ui.isLoading.value"),"$option.label"))),/* #__PURE__ */Xn(/* #__PURE__ */Hn("close")))))),/* #__PURE__ */Wn("$help"),/* #__PURE__ */qn(/* #__PURE__ */Un("$message.value"))),type:"input",family:"dropdown",props:[],features:[
|
|
19
|
+
/* #__PURE__ */o.defaultIcon("moveDown","arrowDown")]},Zo=new WeakMap;function Go(e,t){const o={onItems:[],offItems:[]},n=t||Number(e.value||0);for(let t=0;t<e.props.max;t++)if(t<n&&t+1>=n){const r=e.props.rightToLeft?100-100*(n-t):100*(n-t);o.onItems.push(r+"%"),o.offItems.push(100-r+"%")}else t<n?(o.offItems.push("0%"),o.onItems.push("100%")):t>=n&&(o.offItems.push("100%"),o.onItems.push("0%"));e.props.itemsToPercentages=o}function Xo(e,t){var o;null===(o=e.context)||void 0===o||o.handlers.blur(t)}function Jo(e,t){const{x:o,y:n}=ln(t);let r=document.elementFromPoint(o,n);const s=Array.from(document.querySelectorAll(`#${e.props.id}_items_wrapper > .formkit-ratingItem`));let a=!0;for(;r&&a;){if(s.includes(r)){a=!1;break}r=r.parentNode}if(!a){const t=s.indexOf(r);if(1===e.props.step)return void e.input(t+1,!1)}}function Qo(e,t,o){e.props.disabled||(o.preventDefault(),e.props.hoverHighlight=!0,e.props.touchStarted=!0,1!==e.props.step?pn(e,t,o):e.input(t+1,!1))}function en(e,t){if(!e.props.dragStarted)return;t.preventDefault(),e.props.hoverHighlight=!1,e.props.dragStarted=!1,Go(e);const o=Zo.get(e);o&&(o.abort(),Zo.delete(e))}function tn(e,t,o){if(e.props.hoverHighlight||e.props.disabled)return;o.preventDefault(),e.props.hoverHighlight=!0,e.props.dragStarted=!0;const n=new AbortController;document.addEventListener("mouseup",(t=>en(e,t)),{signal:n.signal}),Zo.set(e,n),1===e.props.step?e.input(t+1,!1):pn(e,t,o)}function on(e,t){var o,n;if(document.activeElement===t.currentTarget)if("ArrowRight"===t.key||"ArrowDown"===t.key){e.props.arrow=1;const t=e.value?dn(e.value+1*e.props.step,e.props.step):e.props.min+1*e.props.step,n=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(e.value?`#${e.props.id}_inner input[value="${t}"]`:"#"+(e.props.id+"_0_0"));e.props.preventFocus=!0,n&&n instanceof HTMLInputElement&&n.focus(),e.props.preventFocus=!1,e.input(Number(t))}else if("ArrowLeft"===t.key||"ArrowUp"===t.key){e.props.arrow=-1;const t=e.value?dn(e.value-1*e.props.step,e.props.step):e.props.max,o=null===(n=e.props.__root)||void 0===n?void 0:n.querySelector(`#${e.props.id}_inner input[value="${t}"]`);e.props.preventFocus=!0,o&&o instanceof HTMLInputElement&&o.focus(),e.props.preventFocus=!0,e.input(Number(t)),e.props.preventFocus=!1}}function nn(e,t){if(!e.props.preventFocus)if(e.props.preventFocus=!0,setTimeout((()=>{e.props.preventFocus=!1}),50),t.relatedTarget instanceof HTMLElement&&t.relatedTarget.id===e.props.id+"_items_wrapper")e.props.arrow>0?setTimeout((()=>{var t,o;null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+"_0_0"))||void 0===o||o.focus()})):e.props.arrow<0&&setTimeout((()=>{var t,o;null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+`_${e.props.max-1}_${e.props.stepsPerValue-1}`))||void 0===o||o.focus()}));else if(t.target instanceof HTMLInputElement){if(Number(t.target.value)===e.props.step&&e.value===e.props.max||Number(t.target.value)===e.props.max&&e.value===e.props.step){const t=document.getElementById(e.props.id+"_items_wrapper");return null==t||t.focus(),void e.input(0)}e.input(Number(t.target.value))}}function rn(e,t,o){e.props.hoverHighlight&&(e.props.disabled||(1===e.props.step?(Go(e,t+1),e.props.dragStarted&&e.input(t+1,!1)):pn(e,t,o,!!e.props.dragStarted)))}function sn(e){Go(e)}function an(e,t,o){if(!e.props.disabled&&"touchstart"!==o.type&&(o.preventDefault(),(0!==o.clientX||0!==o.clientY)&&o.currentTarget instanceof HTMLElement))return 1===e.props.step?e.props.deselect&&Number(e.value)===t+1?void e.input(0):void e.input(t+1):void pn(e,t,o)}function ln(e){return e instanceof MouseEvent?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}}function pn(e,t,o,n=!0){if(!(o.currentTarget instanceof HTMLElement))return;const{x:r,y:s}=ln(o),a=o.currentTarget.getBoundingClientRect();let l=dn((r-a.x)/a.width+t,e.props.step);l=l>e.props.min?l:e.props.min,l=l<e.props.max?l:e.props.max,!e.props.deselect||l!==Number(e.value)||e.props.dragStarted?n?e.input(l,!1):Go(e,l):e.input(0)}function dn(e,t){t||(t=1);const o=1/t;return Math.ceil(e*o)/o}const cn=/* #__PURE__ */K("rt"),{outer:un,wrapper:fn,inner:vn,label:hn,prefix:mn,suffix:gn,help:$n,messages:bn,message:yn,icon:xn}=/* #__PURE__ */W(cn),wn=cn("itemsWrapper",(()=>({$el:"span",attrs:{style:{"flex-direction":'$rightToLeft && "row-reverse" || undefined'},tabindex:"$value !== undefined && $value !== 0 && '-1' || '0'",id:"$id + _items_wrapper",onKeydown:"$handlers.handleWrapperKeydown","data-disabled":"$disabled",onBlur:"$handlers.handleWrapperBlur",onMouseleave:"$hoverHighlight && $handlers.handleMouseleave"}}))),_n=cn("ratingItem",(()=>({for:["item","index","$max"],$el:"span",attrs:{id:'$id + "_item_" + $index',onClick:"$handlers.handleItemClick($item)",draggable:"$hoverHighlight !== true && && $disabled !== true && true",onMousemove:"$handlers.handleMousemove($item)",onDragstart:"$handlers.handleDragstart($item)",onDragend:"$handlers.handleDragend",onTouchstartPassive:"$handlers.handleTouchstart($item)",onTouchmovePassive:"$handlers.handleTouchmove"}}))),kn=cn("template",(()=>({for:["increment","stepIndex","$stepsPerValue"],$el:null}))),Sn=cn("itemLabel",(()=>({$el:"label",attrs:{id:'$id + "_label_" + $index + "_" + $stepIndex',for:'$id + "_" + $index + "_" + $stepIndex',"data-checked":'$value === $fns.getValue($item, $increment) && "true" || "false"',style:{width:'$fns.showLabel($fns.getValue($item, $increment), $stepIndex, $item) && "100%" || "0%"'}}}))),Ln=cn("itemLabelInner",(()=>({$el:"span",children:"$fns.getValue($item, $increment)"}))),In=cn("input",(()=>({$el:"input",attrs:{type:"radio",value:"$fns.getValue($item, $increment)",id:'$id + "_" + $index + "_" + $stepIndex',onFocus:"$handlers.handleFocus",tabindex:'$value === $fns.getValue($item, $increment) && "0" || "-1"',disabled:"$disabled",name:"$id","data-value":"$fns.getValue($item, $increment)",checked:"$value === $fns.getValue($item, $increment) && true",onKeydown:"$handlers.handleKeydown($fns.getValue($item, $increment))"}}))),Dn=cn("onItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item)",display:"flex",position:"relative",overflow:"hidden",top:"0",left:"0",bottom:"0"}}}))),An=cn("offItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item, false)",display:"flex","flex-direction":"row-reverse",position:"absolute",zIndex:"$offItemStyles && 100",overflow:"hidden",top:"0",right:"0"}}}))),Cn=cn("onItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$onColor"}}}))),Tn=cn("offItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$offColor"}}}))),En=()=>U("$slots.onItem",(()=>()=>"$slots.onItem"),U("$slots.default",(()=>()=>"$slots.default"),xn("rating"))),On=()=>U("$slots.offItem",(()=>()=>"$slots.offItem"),U("$slots.default",(()=>()=>"$slots.default"),xn("rating"))),Mn={schema:/* #__PURE__ */un(/* #__PURE__ */fn(/* #__PURE__ */hn("$label"),/* #__PURE__ */vn(/* #__PURE__ */xn("prefix"),/* #__PURE__ */mn(),/* #__PURE__ */wn(/* #__PURE__ */_n(/* #__PURE__ */kn(/* #__PURE__ */Sn(/* #__PURE__ */Dn(/* #__PURE__ */Cn(/* #__PURE__ */En())),/* #__PURE__ */An(/* #__PURE__ */Tn(/* #__PURE__ */On())),/* #__PURE__ */Ln()),/* #__PURE__ */In()))),/* #__PURE__ */gn(),/* #__PURE__ */xn("suffix"))),/* #__PURE__ */$n("$help"),/* #__PURE__ */bn(/* #__PURE__ */yn("$message.value"))),type:"input",props:[],features:[function(t){function o(e){setTimeout((()=>{const t=Array.from(document.querySelectorAll(`#${e.props.id}_items_wrapper > .formkit-ratingItem`));for(let e=0;e<t.length;e++){const o=t[e].querySelectorAll(".formkit-onItemWrapper"),n=t[e].querySelectorAll(".formkit-offItemWrapper");for(let n=0;n<o.length;n++)o[n].style.flex=`0 0 ${t[e].getBoundingClientRect().width}px`;for(let o=0;o<n.length;o++)n[o].style.flex=`0 0 ${t[e].getBoundingClientRect().width}px`}}))}t.addProps(["max","step","stepsPerValue","itemsToPercentages","rightToLeft","onItemStyles","offItemStyles","hoverHighlight","deselect","disabled","wrapperWidth","onColor","offColor"]),!1!==t.props.hoverHighlight&&"false"!==t.props.hoverHighlight&&(t.props.hoverHighlight=!0),t.props.deselect=e.undefine(t.props.deselect),t.props.max=Number(t.props.max)||5,t.props.min=Number(t.props.min)||0,t.props.step=Number(t.props.step)||1,t.props.numberOfSteps=t.props.max/t.props.step,t.props.lastIndex=1/t.props.step-1,t.props.itemsToPercentages={},"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.props.rightToLeft?(t.props.onItemStyles=void 0,t.props.offItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%",zIndex:100}):t.props.onItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%"},t.props.stepsPerValue=1/t.props.step,t.hook.input(((e,o)=>{if(null===e||""===e||isNaN(e))return o(e);const n=Number(e),r=Number(t.props.min),s=Number(t.props.max);return n>s?o(s):t.props.min&&n<=r?o(r):o(n)})),t.on("commit",(({payload:e})=>{const o=Number(e||0);Go(t,o)})),t.on("created",(()=>{t.context&&(e.whenAvailable(`${t.props.id}_items_wrapper`,(()=>{o(t),function(e){var t;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_items_wrapper`);if(!n)return;new ResizeObserver((()=>{o(e)})).observe(n)}(t),setTimeout((()=>o(t)),100)}),t.props.__root),t.context.fns.getPercentage=(e,t,o=!0)=>(o?e.onItems:e.offItems)[t],t.context.fns.getValue=(e,o)=>e+Number((o*t.props.step+t.props.step).toFixed(1)),t.context.fns.showLabel=(e,o)=>{const n=Number(t.value||0);return 0===n&&0===o||n&&e===n||e>n&&0===o||n>e&&o===t.props.lastIndex},t.context.handlers.handleFocus=e=>nn.call(null,t,e),t.context.handlers.handleWrapperKeydown=e=>on.call(null,t,e),t.context.handlers.handleWrapperBlur=e=>Xo.call(null,t,e),t.context.handlers.handleItemClick=e=>o=>an.call(null,t,e,o),t.context.handlers.handleMousemove=e=>o=>rn.call(null,t,e,o),t.context.handlers.handleMouseleave=()=>sn.call(null,t),t.context.handlers.handleDragstart=e=>o=>tn.call(null,t,e,o),t.context.handlers.handleMouseup=e=>en.call(null,t,e),t.context.handlers.handleTouchstart=e=>o=>Qo.call(null,t,e,o),t.context.handlers.handleTouchmove=e=>Jo.call(null,t,e),t.context.handlers.handleKeydown=e=>o=>function(e,t,o){const n=Number(e.value);e.props.deselect&&" "===o.key&&n===t?e.input(0):" "===o.key&&e.input(t)}(t,e,o))}))},/* #__PURE__ */o.defaultIcon("rating","star")]},Vn=/* #__PURE__ */K("ac"),{outer:Fn,wrapper:Pn,inner:Bn,icon:Hn,label:Rn,prefix:Nn,suffix:Kn,help:Wn,messages:qn,message:Un}=/* #__PURE__ */W(Vn),zn=Vn("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",onFocus:"$handlers.focus",value:"$state.loading !== true && $inputText || undefined",name:"$node.name",placeholder:"$state.loading && $ui.isLoading.value || $placeholder || undefined",tabindex:'$disabled && "-1" || 0',role:"combobox",autocomplete:'$attrs.autocomplete || "off"',autocapitalize:"none",readonly:"$attrs.readonly || $state.loading || $multiple && $max && $value && $value.length >= $max && $hasHighlightedRange !== true || undefined","data-selection-appearance":"$selectionAppearance",disabled:"$disabled || $disabledInternally || undefined",onTouchmovePassive:"$handlers.touchmove",onTouchstartPassive:"$handlers.touchmove",onTouchend:"$handlers.touchend","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined","aria-required":"$state.required || undefined"}}))),Yn=Vn("listboxButton",(()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',role:"button","aria-label":"$expanded && $ui.close.value || $ui.open.value",onClick:"$handlers.toggleListbox",onKeydown:"$handlers.toggleListboxKeydown",tabindex:'$disabled && "-1" || 0',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-disabled":"$disabled || $state.loading || undefined","data-disabled":"$disabled || $disabledInternally || undefined"}}))),jn=Vn("selectionWrapper",(()=>({for:["option","index","$selections"],$el:"div",attrs:{id:'$id + "_selection_wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:'$disabled && "-1" || 0',onKeydown:"$handlers.selectionKeydown && $handlers.selectionKeydown($multiple && $option || undefined)",onClick:"$handlers.selectionClick && $handlers.selectionClick($multiple && $option || undefined)",onFocus:"$handlers.selectionFocus && $handlers.selectionFocus($multiple && $option || undefined)",onBlur:"$handlers.selectionBlur && $handlers.selectionBlur($multiple && $option || undefined)","data-is-selection":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),Zn=Vn("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),Gn=Vn("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),Xn=Vn("removeSelection",(()=>({$el:"button",attrs:{id:'$selectionAppearance === "option" && $multiple && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"0",title:"$ui.remove.value",type:"button","aria-label":"$ui.remove.value",onClick:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)",onTouchend:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)","aria-controls":"$id"}}))),Jn=Vn("optionLoading","span"),Qn=Vn("option",(()=>({$el:"div",if:"$value !== undefined"}))),er=/* #__PURE__ */z(Vn);function tr(t){"option"!==t.props.selectionAppearance||t.props.multiple||!1===t.props.selectionRemovable||"false"===t.props.selectionRemovable||(t.props.selectionRemovable=!0),t.props.multiple||(t.props.clearSearchOnOpen=e.undefine(t.props.clearSearchOnOpen)),t.props.selectionRemovable=e.undefine(t.props.selectionRemovable),t.props.openOnClick=e.undefine(t.props.openOnClick),"option"!==t.props.selectionAppearance||t.props.multiple||(t.props.isSingleOption=!0),void 0===t.props.closeOnSelect&&(t.props.closeOnSelect=!0),void 0===t.props.selectionAppearance&&(t.props.selectionAppearance="text-input"),void 0===t.props.closeOnSelect&&(t.props.closeOnSelect=!0),t.props.closeOnSelect?t.props.resetSearchOnCommit=!1:void 0===t.props.resetSearchOnCommit&&(t.props.resetSearchOnCommit=t.props.multiple),t.props.allowNewValues=e.undefine(t.props.allowNewValues)}function or(t){t.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter","hasHighlightedRange","clearOnClick","debounce"]),void 0===t.props.debounce?t.props.debounce=200:t.props.debounce=parseInt(t.props.debounce),t.props.nonceKey="searchValue",t.props.searchValue="",t.props.inputText="",t.props.filterOptions=De.bind(null,t),t.props.reloadOnCommit=e.undefine(t.props.reloadOnCommit),void 0===t.props.alwaysLoadOnOpen?t.props.alwaysLoadOnOpen=!0:t.props.alwaysLoadOnOpen=e.undefine(t.props.alwaysLoadOnOpen),"function"!=typeof t.props.filter&&(t.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),t.on("created",(()=>{t.context&&c&&(t.context.handlers.focus=sr.bind(null,t),t.context.handlers.input=nr.bind(null,t),t.context.handlers.focus=sr.bind(null,t),t.context.handlers.click=rr.bind(null,t),t.context.handlers.toggleListbox=ar.bind(null,t),t.context.handlers.toggleListboxKeydown=lr.bind(null,t),t.context.handlers.keydown=St.bind(null,t),t.context.handlers.selectionKeydown=e=>o=>_t(t,e,o),t.context.handlers.searchInputTagKeydown=e=>o=>function(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":gt(e);break;case"ArrowRight":case"ArrowLeft":$t(e,t,o);break;case"Delete":case"Backspace":bt(e,t,o)}}(t,e,o),t.on("prop:options",(({payload:e})=>{if((0===t.props.initialOptions.length&&"function"!=typeof t.props.optionsLoader||!t.props.searchValue&&e.length)&&(t.props.initialOptions=[...e]),t.props.selections&&t.props.selections.length&&e.length)for(let o=0;o<t.props.selections.length;o++){const n=t.props.selections[o],r=e.find((e=>Se(e)===n.value));r&&(t.props.selections[o]=r)}})))})),t.on("prop:expanded",(({payload:e})=>{e||Le.delete(t)}))}function nr(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&De(e,e.props.searchValue,!0)}function rr(e,t){t.stopPropagation(),e.props.disabled||e.props.disabledInternally||(e.props.attrs.onClick&&e.props.attrs.onClick(t),(!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0))}function sr(e){e.props.disabled||e.props.disabledInternally||(e.props.attrs.onFocus&&e.props.attrs.onFocus(),e.props.activeSelectionValue=void 0,e.props.skipOpen?e.props.skipOpen=!1:e.props.openOnFocus&&(e.props.expanded=!0))}function ar(e){var t,o,n;e.props.disabled||e.props.disabledInternally||(null===(t=e.context)||void 0===t?void 0:t.state.loading)||(e.props.expanded=!e.props.expanded,e.props.openOnFocus||null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus())}function lr(e,t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),ar(e))}const ir=new WeakMap,pr="undefined"!=typeof window,dr=new WeakMap;let cr=!1;function ur(t){t.props.searchValue=null,t.on("commit",(()=>{t.props.searchValue=null,t.props.highlightedRange||fr(t)})),t.on("created",(()=>{if(!t.context||!pr)return;t.on("handleSearchInput",(({payload:e})=>{""===e?(t.props.searchValue=null,t.input([])):e&&0===t.props.inputStd.length?t.props.searchValue=e:e&&t.props.inputStd.length>0&&(t.props.searchValue=function(e){var t;const o=hr(e);if(e.props.highlightedRange){const[t,n]=vr(e,o);return e.props.inputText.slice(t,n)}return e.props.inputText.slice((null===(t=o[o.length-1])||void 0===t?void 0:t.end)+2)}(t)),!t.props.expanded&&e?t.props.expanded=!0:!e&&t.props.expanded&&(t.props.expanded=!1)})),function(t){e.whenAvailable(`${t.props.id}`,(e=>{e instanceof HTMLInputElement&&dr.set(e,t)}),t.props.__root),pr&&!cr&&(cr=!0,document.addEventListener("selectionchange",(()=>{const e=ke();if(e instanceof HTMLInputElement&&dr.has(e)){const t=dr.get(e);t&&function(e){clearTimeout(ir.get(e)),ir.set(e,setTimeout((()=>{var t,o,n,r;const s=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);if(s instanceof HTMLInputElement){const t=hr(e),a=t.findIndex((e=>null!==s.selectionStart?s.selectionStart>=e.start&&s.selectionStart<=e.end:null!==s.selectionEnd&&(s.selectionEnd>=e.start&&s.selectionEnd<=e.end))),l=null===(o=t[t.length-1])||void 0===o?void 0:o.end;if(0===s.selectionStart&&s.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))return;if("string"==typeof e.props.searchValue&&e.props.highlightedRange){if(t.length){const o=e.props.highlightedRange,[n,r]=vr(e,t);if(null!==s.selectionEnd&&(s.selectionEnd<n||s.selectionEnd>r)){const t=o.end-o.start-(r-n),a=s.selectionEnd;e.props.inputText=e.props.option.label,e.props.highlightedRange=void 0,e.props.searchValue=null,s.value=e.props.inputText,s.selectionStart=s.selectionEnd=a+(a>n?t:0)}}}else if(a>=0&&null!==s.selectionStart&&(l!==(null===(r=e.props.inputText)||void 0===r?void 0:r.length)||s.selectionStart<l)){const o=t[a],n=e.props.inputText.substr(0,l),r=o.start+(o.index>0?1:0),i=o.end+(t.length-1>o.index?-1:0);n!==e.props.inputText&&(e.props.inputText=n,s.value=n),e.props.highlightedRange=o,s.selectionStart=r,s.selectionEnd=i}else e.props.highlightedRange=void 0,fr(e);if(null!==s.selectionStart&&s.selectionStart>=l&&", "!==e.props.inputText.substring(l,l+2)){let t=e.props.inputText.substring(0,l);t=e.props.multiple&&e.props.max&&Array.isArray(e.props.inputStd)&&e.props.inputStd.length>=e.props.max?t:`${t},`,e.props.inputText=`${t} ${e.props.inputText.substring(l).replace(/^[,\s]{1,2}/,"")}`}}}),5))}(t)}})))}(t);const n=t.context.handlers.keydown;t.context.handlers.keydown=e=>{n(e),function(e,t){var n,r,s,a;if(["ArrowRight","ArrowLeft"].includes(t.key)&&t.target instanceof HTMLInputElement&&null!==t.target.selectionEnd&&null!==t.target.selectionStart){if(0===t.target.selectionStart&&t.target.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))"ArrowLeft"===t.key?o(0):o(-1);else if(!e.props.searchValue){e.props.searchValue=null;const o=hr(e),n=null===(r=o[o.length-1])||void 0===r?void 0:r.end;t.target.selectionStart<n&&(t.target.selectionStart=Math.max(0,"ArrowLeft"===t.key?t.target.selectionStart-2:t.target.selectionEnd+2))}}else if(["Delete","Backspace"].includes(t.key))e.props.highlightedRange&&!e.props.searchValue?(He(e,e.props.highlightedRange.option),0===e.props.inputStd.length&&(e.props.highlightedRange=void 0)):t.target instanceof HTMLInputElement&&(e.props.searchValue=null,o(-1,!0)&&t.preventDefault());else if(t.target instanceof HTMLInputElement&&0===t.target.selectionStart&&t.target.selectionEnd===(null===(s=e.props.inputText)||void 0===s?void 0:s.length)&&(null===(a=e.props.inputText)||void 0===a?void 0:a.length)&&0===e.props.selections.length)t.preventDefault();else if("Tab"===t.key)return;"ArrowLeft"===t.key&&o(-1,!0)&&t.preventDefault()}(t,e)};const r=t.context.handlers.focus;t.context.handlers.focus=e=>{r(t,e);const o=new Event("selectionchange");document.dispatchEvent(o)},t.on("blur",(()=>{t.props.selections.length?(t.props.inputText=t.props.selections.map((e=>e.label)).join(", "),t.props.searchValue=null):t.props.selections.length||(t.props.inputText="",t.props.searchValue="")}))})),t.on("prop:expanded",(({payload:e})=>{e||t.props.inputStd.length?e&&(t.props.options.length&&!t.props.alwaysLoadOnOpen||(t.props.options=[],De(t,t.props.searchValue))):(t.props.searchValue="",t.props.inputText="")})),t.on("prop:selections",(()=>{var e;const o=[...t.props.selections].map((e=>e.label)).join(", ");let n="";if(pr&&t.isCreated){const o=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`${t.props.id}`);if(ke()===o&&Array.isArray(t._value)&&t._value.length){if(t.props.max&&t._value.length>=Number(t.props.max))return;n=", "}}t.props.inputText=`${o}${n}`,t.props.reloadOnCommit&&(t.props.searchValue="",De(t,t.props.searchValue))}));const o=(e,o=!1)=>{var n,r;const s=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(`${t.props.id}`);if(!(s instanceof HTMLInputElement))return!1;const a=hr(t),l=e>=0?e:a.length-1;if(void 0===a[l])return!1;const i=null===(r=a[l])||void 0===r?void 0:r.end;return null!==s.selectionStart&&(!o||s.selectionStart>=i&&s.selectionStart<=i+2)&&(s.selectionStart=a[l].start+(l>0?1:0),s.selectionEnd=a[l].end+(l<a.length-1?-1:0),!0)};let n;t.on("selectRange",(({payload:e})=>o(...e))),t.on("prop:highlightedRange",(({payload:e})=>{t.props.hasHighlightedRange=!!e,e&&t.props.expanded&&n!==e.option&&(n=e.option,Ne(t))}))}function fr(e){var t;if(!pr)return;const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);o&&o.scrollTo({left:o.scrollWidth,behavior:"smooth"})}function vr(e,t){var o;const n=e.props.highlightedRange,r=n.index,s=n.start+(r?1:0),a=t.length-1>r?t[t.length-1].end-t[r+1].start:0;return[s,(null===(o=e.props.inputText)||void 0===o?void 0:o.length)-a+(t.length-1>n.index?-1:0)]}function hr(e){const t=Be(e);return Array.isArray(t)&&t.length?t.reduce(((e,o,n)=>{var r;const s=(null===(r=e[n-1])||void 0===r?void 0:r.end)||0;let a=0;return t.length-1!==n&&a++,0!==n&&a++,e.push({option:o,index:n,start:s,end:s+o.label.length+a}),e}),[]):[]}function mr(e){!function(e){e.on("prop:expanded",(({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],De(e,e.props.searchValue,!0))):(e.props.searchValue="",e.props.inputText="")}))}(e),function(e){e.on("handleSearchInput",(({payload:t})=>{t&&!e.props.expanded?(e.props.searchExpand=!0,e.props.expanded=!0):!t&&e.props.expanded&&(e.props.expanded=!1),e.props.searchValue=e.props.inputText}))}(e),function(e){e.on("prop:selections",(()=>{e.isCreated&&(e.props.inputText="",e.props.searchValue="",e.props.optionRemoved||e.props.reloadOnCommit&&De(e,e.props.searchValue,!0))}))}(e)}function gr(e){!function(e){function t(e){0===e.props.inputStd.length?(e.props.inputText="",e.props.searchValue=""):(e.props.inputText=e.props.selections[0].label,e.props.searchValue=e.props.selections[0].label)}function o(e){e.props.clearSearchOnOpen&&!e.props.searchExpand&&(e.props.inputText="",e.props.searchValue=""),e.props.searchValue=e.props.inputText,e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],De(e,e.props.searchValue,!0)),e.props.searchExpand&&(e.props.searchExpand=!1)}e.on("prop:expanded",(({payload:n})=>{n?o(e):t(e)}))}(e),function(e){e.on("handleSearchInput",(({payload:t})=>{""===t?(0===e.props.inputStd.length&&(e.props.expanded=!1),e.input(void 0)):t&&!e.props.expanded&&(e.props.searchExpand=!0,e.props.expanded=!0),e.props.searchValue=e.props.inputText}))}(e),function(e){e.on("prop:selections",(({payload:t})=>{e.props.inputText=t.length?t[0].label:"",e.props.searchValue=t.length?t[0].label:"",e.isCreated&&e.props.expanded&&0===t.length&&De(e,e.props.searchValue,!0)}))}(e)}function $r(t){if(t.props.multiple)if(t.props.multiple&&"option"===t.props.selectionAppearance){function o(){return Array.isArray(t.value)?t.value:[]}function r(e){t.input(e)}mr(t),t.on("created",(()=>{t.props.disabled&&(t.props.draggable=!1),e.whenAvailable(`${t.props.id}_selections`,(e=>{if(e instanceof HTMLElement&&t.context){const s={draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,root:t.props.__root,disabled:!t.props.draggable,plugins:[n.animations()],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-selection")};n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s}),t.on("prop:disabled",(({payload:t})=>{s.disabled=t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})})),t.on("prop:draggable",(({payload:t})=>{s.disabled=!t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})}))}}),t.props.__root)}))}else t.props.multiple&&"text-input"===t.props.selectionAppearance&&ur(t);else gr(t)}const br={schema:/* #__PURE__ */Fn(/* #__PURE__ */Pn(/* #__PURE__ */Rn("$label"),/* #__PURE__ */Bn(/* #__PURE__ */Hn("prefix"),/* #__PURE__ */Nn(),/* #__PURE__ */zn(),/* #__PURE__ */U("$multiple !== true && $selectionAppearance === option && $expanded === false",/* #__PURE__ */Gn(/* #__PURE__ */jn(/* #__PURE__ */Zn(/* #__PURE__ */Qn(/* #__PURE__ */U("$state.loading",/* #__PURE__ */Jn("$ui.isLoading.value"),"$option.label"))),/* #__PURE__ */U("$state.loading && $isSingleOption !== true && $optionLoaderValues.includes($option.value)",/* #__PURE__ */Hn("loader")),/* #__PURE__ */U("$selectionRemovable && $isSingleOption",/* #__PURE__ */Xn(/* #__PURE__ */Hn("close")))))),/* #__PURE__ */U("$state.loading && ($isSingleOption !== true || $selections.length === 0)",/* #__PURE__ */Hn("loader")),/* #__PURE__ */U('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',/* #__PURE__ */Xn(/* #__PURE__ */Hn("close")),/* #__PURE__ */U('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',/* #__PURE__ */Yn(/* #__PURE__ */Hn("select")))),/* #__PURE__ */U("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $optionLoaderValues.length > 0)",/* #__PURE__ */Yn(/* #__PURE__ */Hn("select"))),/* #__PURE__ */er(),/* #__PURE__ */Kn(),/* #__PURE__ */Hn("suffix")),/* #__PURE__ */U("$multiple && $selectionAppearance === option",/* #__PURE__ */Gn(/* #__PURE__ */jn(/* #__PURE__ */Zn(/* #__PURE__ */Qn(/* #__PURE__ */U("$state.loading && $fns.hasOptionLoaderValue($option)",/* #__PURE__ */Jn("$ui.isLoading.value"),"$option.label"))),/* #__PURE__ */Xn(/* #__PURE__ */Hn("close")))))),/* #__PURE__ */Wn("$help"),/* #__PURE__ */qn(/* #__PURE__ */Un("$message.value"))),type:"input",family:"dropdown",props:[],features:[
|
|
20
20
|
/* #__PURE__ */o.defaultIcon("select","select"),
|
|
21
21
|
/* #__PURE__ */o.defaultIcon("close","close"),
|
|
22
22
|
/* #__PURE__ */o.defaultIcon("selected","check"),
|