@formkit/pro 0.127.24-next.443d99 → 0.127.24-next.4ea49a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +3 -3
- package/index.mjs +3 -3
- package/package.json +2 -2
package/index.cjs
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
/* #__PURE__ */o.localize("remove"),
|
|
27
27
|
/* #__PURE__ */o.localize("open"),
|
|
28
28
|
/* #__PURE__ */o.localize("close"),o.options,
|
|
29
|
-
/* #__PURE__ */bt.bind(null,ir,pr,Sr),to]},Ir=/* #__PURE__ */K("dp"),{outer:Dr,wrapper:Ar,inner:Cr,icon:Tr,label:Er,prefix:Or,suffix:Mr,help:Vr,messages:Fr,message:Pr}=/* #__PURE__ */W(Ir),Br=Ir("input",()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",id:"$id",onKeydown:"$handlers.inputKeydown",value:"$inputText",onInput:"$handlers.dateInput",onClick:"$pickerOnly && $handlers.open",onBlur:"$handlers._blur",onFocus:"$handlers.focus",readonly:"$pickerOnly || $expanded",disabled:"$disabled"}})),Hr=Ir("panelWrapper",()=>({$el:"div",if:"$expanded",attrs:{id:'$id + "_popover"',role:"dialog",onBlur:"$handlers._blurOut()",tabindex:"-1",popover:"$popover","aria-modal":"true","aria-label":"Choose date","data-panel":"$panel",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"',width:'$popoverCoordinates.width + "px"'}}}})),Rr=Ir("next",()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}})),Nr=Ir("nextLabel","span"),Kr=Ir("prev",()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}})),Wr=Ir("prevLabel","span"),qr=Ir("calendar",()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}})),zr=Ir("calendarWeeks",()=>({$el:"tbody"})),Ur=Ir("calendarHeader",()=>({$el:"thead"})),Yr=Ir("weekDays",()=>({$el:"tr"})),jr=Ir("weekDay",()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}})),Zr=Ir("week",()=>({$el:"tr",for:["week","weekIndex","$month.weeks"]})),Gr=Ir("dayCell",()=>({$el:"td",for:["day","dayIndex","$week"],attrs:{key:"$day",onClick:"$handlers.setDate($day)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($day)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(day)",tabindex:'$fns.sameDay($day) && "0" || "-1"',"data-is-extra":"$fns.notInMonth($month.monthDay, $day)","data-disabled":"$fns.isDisabled($day)","aria-selected":"$selectedWeek === $weekIndex && $selectedDay === $dayIndex","aria-label":'$fns.format($day, "long")'}})),Xr=Ir("day","div"),Jr=Ir("openButton",()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"div",role:"button",onClick:"$handlers.open",onKeydown:"$handlers.openKeydown",tabIndex:'$pickerOnly && "-1" || "0"',"data-disabled":"$disabled","aria-disabled":"$disabled","aria-label":'$value && ($ui.changeDate.value + ", " + $inputText) || $ui.chooseDate.value',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}})),Qr=Ir("years",()=>({if:'$panel === "year"',$el:"ul",attrs:{id:'$id + "_years"'}})),es=Ir("year",()=>({for:["year","yearIndex","$years"],$el:"li",attrs:{key:'$: "year" + $fns.format($year, "YYYY")',onClick:"$handlers.setDate($year)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($year)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(year)",tabindex:'$fns.sameYear($year) && "0" || "-1"',"aria-selected":"$selectedYear === $yearIndex","data-disabled":"$fns.isDisabledYear($year)","aria-label":"$fns.format($year, $yearFormat)"}})),ts=Ir("months",()=>({if:'$panel === "month"',$el:"ul"})),os=Ir("month",()=>({$el:"li",for:["month","index","$months"],attrs:{key:"$month",onClick:"$handlers.setDate($month)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($month)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(month)",tabindex:'$fns.sameMonth($month) && "0" || "-1"',"aria-selected":"$selectedMonth === $index","data-disabled":"$fns.isDisabledMonth($month)"}})),ns=Ir("panelHeader",()=>({$el:"header",attrs:{"aria-live":"polite"}})),rs=Ir("yearsHeader",()=>({$el:"div",if:'$panel === "year"'})),ss=Ir("monthsHeader",()=>({$el:"div",if:'$panel === "month"'})),as=Ir("daysHeader",()=>({$el:"div",if:'$panel === "day"'})),ls=Ir("timeHeader",()=>({$el:"div",if:'$panel === "time"'})),is=Ir("yearButton",()=>({$el:"button",attrs:{type:"button",id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"})),ps=Ir("monthButton",()=>({$el:"button",attrs:{type:"button",id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"})),ds=Ir("dayButton",()=>({$el:"button",attrs:{type:"button",id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"})),cs=Ir("removeSelection",()=>({$el:"button",if:"$clearable && $_value",attrs:{id:'$id + "_remove_selection"',type:"button",onClick:"$handlers.clear","aria-controls":"$id"}})),us=Ir("time",()=>({$el:"div",if:'$panel === "time"'})),fs=Ir("timeInput",()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown",spellcheck:"false",onBlur:"$handlers._blurOut(time)"}})),vs=Ir("panelClose",()=>({$el:"button",if:"$showPanelClose && ($inline === undefined || $inline === false)",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:-1,"aria-label":"$ui.close.value"}})),{overlayPlaceholder:hs,overlayLiteral:ms,overlayChar:gs,overlayEnum:$s,overlay:bs,overlayParts:ys,overlayInner:xs}=/* #__PURE__ */q(Ir),ws=Ir("panel","div"),_s=/* #__PURE__ */new WeakMap,ks=/* #__PURE__ */new WeakMap,Ss=new WeakSet,Ls=/* #__PURE__ */new WeakMap,Is=/* #__PURE__ */new WeakMap,Ds=new WeakSet,As=/* #__PURE__ */new WeakMap,Cs=/[\uD800-\uDBFF]/,Ts=/* #__PURE__ */new WeakMap,Es=/* #__PURE__ */new WeakMap,Os=/* #__PURE__ */new WeakMap,Ms=/* #__PURE__ */new WeakMap,Vs=/* #__PURE__ */new WeakMap,Fs=new WeakSet,Ps=/* #__PURE__ */new WeakMap,Bs=/* #__PURE__ */new WeakMap,Hs=/* #__PURE__ */new WeakMap,Rs=/* #__PURE__ */new WeakMap;let Ns=!1;const Ks=()=>{Ns=!0,setTimeout(()=>{Ns=!1},500)},Ws={"#":{type:"char",pattern:/\d/,token:"#",placeholder:"_",selectDirection:"right"},a:{type:"char",pattern:/[a-zA-Z]/,token:"a",placeholder:"_",selectDirection:"left"},h:{type:"char",pattern:/[0-9a-fA-F]/,token:"h",placeholder:"_",selectDirection:"left"},"*":{type:"char",pattern:/./,token:"*",placeholder:"_",selectDirection:"left"}},qs=/* #__PURE__ */new WeakMap,zs="undefined"!=typeof window;let Us=!1,Ys=!1;function js(){zs&&!Ys&&(Ys=!0,document.addEventListener("selectionchange",()=>{const e=ke();if(!(e instanceof HTMLInputElement))return;if(Rs.has(e))return function(e){const t=Rs.get(e);if(t){const[o,n]=t,[r,s]=Ea(e),a=s.indexOf(o);if(-1===a)return void Rs.delete(e);const l=r[a],i=[l[0]+n[0],l[1],"none"];aa(la(e),i)||fa(e,i)}}(e);if("select"!==As.get(e))return;const t=la(e);if(!aa(t,qs.get(e))){if(qs.set(e,t),Ss.has(e))return Ss.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:la(e)}))}}))}function Zs(e,t,o){var n;if(js(),_s.has(e))return;_s.set(e,[]),t.reverse&&Fs.add(e),t.prefix&&Ps.set(e,t.prefix),t.suffix&&Bs.set(e,t.suffix),ea(e,t.pattern,t.partOverrides,t.explicitParts);const r=Is.get(e),s=null==r?void 0:r.some(e=>na(e)),a=null==r?void 0:r.some(e=>function(e){return!!e&&("group"===e.type&&Array.isArray(e.parts))}(e));if(s&&a)throw new Error("Cannot use enums and groups in the same mask.");const l=s?"select":null!==(n=t.mode)&&void 0!==n?n:"shift";if(a&&"select"===l)throw new Error("Cannot use groups in select mode.");(t.placeholder||"select"===l)&&Ds.add(e),As.set(e,l),t.onChange&&Ms.set(e,t.onChange);let i=!1;e.addEventListener("beforeinput",o=>{if(Us)return;if("insertLineBreak"===o.inputType)return;if(o.inputType.startsWith("history"))return function(e,t){e.addEventListener("input",o=>{var n;o.preventDefault(),o.stopImmediatePropagation();const r=_s.get(e);if(null==r?void 0:r.length){const o=(null!==(n=ks.get(e))&&void 0!==n?n:r.length-1)+(t.endsWith("Undo")?-1:1),s=r[o];if(!s)return;va(e,s),e.setSelectionRange(...s.selectionAfter),ks.set(e,o),Ms.has(e)&&Ms.get(e)(s,e)}},{once:!0})}(e,o.inputType);o.preventDefault(),i=!0;const n=(r=o.inputType).startsWith("insert")?"insert":!!r.startsWith("delete")&&("deleteContentForward"===r?"deleteContentForward":"deleteContentBackward");var r;const s=la(e),a=e.value;n&&ia(e,{type:n,selectionBefore:s,data:o.data,valueBefore:a,suffix:t.suffix,prefix:t.prefix})}),e.addEventListener("input",t=>{i=!1,"data"in t||!i&&o&&(o.input(e.value,!1),o.props._maskValue=e.value)}),"select"===l&&e.addEventListener("keydown",t=>{switch(t.key){case"ArrowRight":return t.preventDefault(),Pa(e);case"ArrowLeft":return t.preventDefault(),Pa(e,-1);case"ArrowUp":return void(Ba(e,1)&&t.preventDefault());case"ArrowDown":return void(Ba(e,-1)&&t.preventDefault());case"Tab":return Ns?void t.preventDefault():void(Pa(e,t.shiftKey?-1:1)&&t.preventDefault())}}),e.addEventListener("focus",()=>function(e){var t;const o=Ds.has(e),n=As.get(e);if(o){let o=null,r=null,s=!1;const a="shift"===n?0:1,l=e.value;ka(e,{type:"insert",data:l,selectionBefore:[0,0,"none"],valueBefore:l},"shift"===n?"":l,(e,t)=>(null===o&&"char"===t.type&&(o=e.pos-a),(oa(t)||na(t))&&e.value.endsWith(t.placeholder)?(r=e.pos-a,!1):("char"===t.type&&(s=!0),!0)));const i=null!==(t=null!=r?r:s?l.length:o)&&void 0!==t?t:null;if(null!==i){let t=[i,i,"none"];if("select"===As.get(e)){const[o]=Ea(e),n=Ra(e,t);void 0!==n&&n in o&&(t=o[n])}return function(e,t,o=50){Ts.set(e,da(e,t));const n=async()=>{if(!zs||ke()!==e)return;"select"===As.get(e)&&(await new Promise(e=>setTimeout(e,10)),function(e){let t=la(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=ca(e,t);const[o]=Ea(e),n=Ra(e,t),r=t[0];void 0!==n&&o.some(e=>r>=e[0]&&r<e[1])&&Ts.set(e,da(e,o[n]))}(e));const t=Ts.get(e);t&&e.setSelectionRange(...t)};n(),document.addEventListener("selectionchange",n),setTimeout(()=>{document.removeEventListener("selectionchange",n),Ts.delete(e)},o)}(e,t)}}}(e)),e.addEventListener("selection",t=>function(e,t){if(Ts.get(e))return;za(e),t=ca(e,t);const[o]=Ea(e),n=Ra(e,t),r=void 0!==n&&da(e,o[n]);r&&!aa(t,r)&&fa(e,r,!0)}(e,t.detail)),ia(e,{type:"insert",selectionBefore:[0,0,"forward"],data:e.value,valueBefore:"",suffix:t.suffix,prefix:t.prefix})}function Gs(e){var t,o;if(Rs.has(e))return;const n=null!==(t=_s.get(e))&&void 0!==t?t:[],r=n[null!==(o=ks.get(e))&&void 0!==o?o:n.length-1];if(r){const t=r.selectionAfter,[o,n]=Ea(e,r.valueAfter),s=Ra(e,t,[o,n]);if(void 0!==s&&s in o){const r=n[s],a=o[s],l=[t[0]-a[0],t[1]-a[0],"none"];Rs.set(e,[r,l])}}}function Xs(e){Rs.delete(e)}function Js(e,t,o){const n="string"==typeof e||!_s.has(e),r="string"==typeof e?Qs(e):e;if(n)t.prefix&&Ps.set(r,t.prefix),t.suffix&&Bs.set(r,t.suffix),r.value=pa(r,r.value),Zs(r,t,o);else{const e=Na(r),o=r.value;r.value="",ia(r,{type:"insert",selectionBefore:[0,e?e.valueAfter.length:0,"none"],valueBefore:e?e.valueAfter:"",data:o,suffix:t.suffix,prefix:t.prefix})}return r.value}function Qs(e){return{value:e,selectionStart:0,selectionEnd:0,scrollWidth:0,clientWidth:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function ea(e,t,o,n,r){r=e&&Fs.has(e)||r;const s=(null!=n?n:function(e){const t=Object.values(Ws);if(!e)return t;const o={...e},n=[];for(const r of t)if(!sa(r)){if("token"in r&&r.token in e){const t={...r,...e[r.token]};ta(t)&&n.push(t),delete o[r.token];continue}n.push(r)}const r=Object.values(o);for(const e of r)ta(e)?n.push(e):console.warn(`Invalid ${e.type} token`,e);return n}(o)).sort((e,t)=>{const o="token"in e?e.token.length:-1,n="token"in t?t.token.length:-1;return o===n?0:o>n?-1:1});let a=[];[t,a]=function(e,t,o,n){let r,s=0,a="",l="",i="";const p=[];for(;a=ha(e);)a===t&&r!==n?(s++,s>1&&(i+=a)):a===o&&s&&r!==n?(s--,0===s?(l+=`{$${p.length}}`,p.push(i),i=""):i+=a):s?i+=a:r!==n||a!==t&&a!==o?l+=a:l=`${l.substring(0,l.length-1)}${a}`,r=a,e=e.substring(a.length);return[l,p]}(t,"{","}","\\");const l=a.length;t=s.reduce((e,t,o)=>"token"in t?e.replaceAll(`\\${t.token}`,"{“!”}").replaceAll(t.token,`{$${l+o}}`).replaceAll("{“!”}",t.token):e,t);const i=function(e,t,o){return e.reduce((e,n)=>{const[r,s]=function(e){const[t,...o]=e.split("|"),n=o.reduce((e,t)=>{const[o,n=!0]=t.split(":");return Object.assign(e,{[o]:n})},{});return[t,n]}(n);let a=ea(null,r,void 0,t,o);a=a.map(e=>{const t={...e};if("char"===t.type&&s.placeholder)t.placeholder=s.placeholder;else if("enum"===t.type)throw new Error("Groups cannot contain enums.");return t});const l={type:"group",parts:a,...s};return e.push(l),e},[])}(a,s,r).concat(s),p=/\{\$\d+\}/g,d=t.match(p),c=t.split(p).reduce((e,t,o)=>{if(t&&(t=t.replaceAll("\\",""),e.push({type:"literal",value:r?[...t].reverse().join(""):t})),d&&d[o]){const t=d[o],n=Number(t.substring(2,t.length-1));!isNaN(n)&&i[n]&&e.push(i[n])}return e},[]);return r&&c.reverse(),e&&Is.set(e,c),c}function ta(e){return!!e&&(sa(e)||oa(e)||na(e))}function oa(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&ra(e))}function na(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&ra(e))}function ra(e){return!!e&&("placeholder"in e&&"token"in e)}function sa(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function aa(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function la(e){var t,o;return[null!==(t=e.selectionStart)&&void 0!==t?t:e.value.length,null!==(o=e.selectionEnd)&&void 0!==o?o:e.value.length,"none"]}function ia(e,t){var o;Fs.has(e)&&qa(t);let n=!1;switch(Vs.set(e,"playing"),t.type){case"insert":n=function(e,t){let o=ua(t);const n=t.selectionBefore,r=function(e,t){var o,n,r;if("select"===As.get(e)){const[s,a]=Ea(e),l=s.findIndex(e=>aa(e,t.selectionBefore)),i=null!==(o=a[l])&&void 0!==o?o:null;if(oa(i)){const e=t.selectionBefore,o=e[1]-e[0],s=t.valueBefore.substring(e[0],e[1]),a="left"===i.selectDirection,l=wa(s,i),p=a?0:function(e,t,o){if(!e)return 0;let n="";for(;e.length;){const o=ha(e);e=e.substring(o.length),t.pattern.test(o)&&(n+=o)}return Math.min(Math.max(n.length,1),o)}(t.data,i,o);if(l.length>=o)return a||(t.insertPos=e[1]-p),(null!==(n=i.selectFill)&&void 0!==n?n:i.placeholder).repeat(o);const d=(null!==(r=i.selectFill)&&void 0!==r?r:i.placeholder).repeat(o-l.length-(a?0:p));return t.insertPos=a?e[0]+l.length:e[1]-p,"left"===i.selectDirection?`${l}${d}`:`${d}${l}${i.placeholder}`}if(na(i)){const e=t.selectionBefore;return t.valueBefore.substring(e[0],e[1])}}return""}(e,t);o=`${o.substring(0,n[0])}${r}${o.substring(n[1])}`;const s=ka(e,t,o);return Ls.set(e,s.endPos),{...t,valueAfter:s.value,selectionAfter:_a(e,s),unmasked:s.unmasked,complete:s.complete,meta:s.meta}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":n=function(e,t){const o=ua(t),n=t.selectionBefore,r=Fs.has(e);let s=n[0],a=n[1];s===a&&("deleteContentBackward"!==t.type||r?a+=ma(o,s):s-=ma(o,s,"backward"));const l=As.get(e);let i="";if("select"===l){const[o,n]=Ea(e),r=Ra(e,[s,a,"none"]);if(void 0!==r){const l=n[r],p=o[r];oa(l)?i=l.placeholder.repeat(a-s):na(l)&&([i,s]=aa(p,la(e))?[l.placeholder,s]:function(e,t,o,n){const r=n.valueBefore,s=ma(r,n.selectionBefore[0],"backward"),a=Math.max(o[0],n.selectionBefore[0]-s),l=r.substring(o[0],a),i=Ma(t.values,l);let p=null==i?void 0:i.substring(l.length);i&&!p&&Va(t.values,i)&&(p=i);return[null!=p?p:t.placeholder,p?a:o[0]]}(0,l,p,t))}}const p=`${o.substring(0,s)}${i}${o.substring(a)}`,d=ka(e,t,p);return{...t,valueAfter:d.value,selectionAfter:Aa(e,d,t,s),unmasked:d.unmasked,complete:d.complete,meta:d.meta}}(e,t)}if(Fs.has(e)&&n&&qa(n),n&&function(e,t){t.prefix&&(t.valueAfter=t.prefix+t.valueAfter,t.selectionAfter=da(e,t.selectionAfter));t.suffix&&(t.valueAfter+=t.suffix)}(e,n),n&&function(e){return e.valueBefore!==e.valueAfter||e.selectionBefore[0]!==e.selectionAfter[0]||e.selectionBefore[1]!==e.selectionAfter[1]}(n)){Ms.has(e)&&Hs.set(e,()=>{Hs.delete(e),n&&Ms.get(e)(n,e)}),Vs.set(e,"beforeCallback");let t=null!==(o=_s.get(e))&&void 0!==o?o:[];const r=ks.get(e);r&&(t=t.slice(0,r),ks.delete(e)),t.push(n),_s.set(e,t),zs&&ke()===e&&"function"==typeof document.execCommand&&!Us?(fa(e,[0,e.value.length,"forward"],!0),Us=!0,document.execCommand("insertText",void 0,n.valueAfter),Us=!1):va(e,n),zs&&ke()===e&&fa(e,n.selectionAfter);const s=Hs.get(e);s&&s(),za(e)}Vs.set(e,"complete")}function pa(e,t){var o,n;const r=null!==(o=Ps.get(e))&&void 0!==o?o:"",s=null!==(n=Bs.get(e))&&void 0!==n?n:"";return r&&t.startsWith(r)&&(t=t.substring(r.length)),s&&t.endsWith(s)&&(t=t.substring(0,t.length-s.length)),t}function da(e,t){const o=Ps.get(e),n=[...t];return o&&(n[0]+=o.length,n[1]+=o.length),n}function ca(e,t){const o=Ps.get(e),n=[...t];return o&&(n[0]-=o.length,n[1]-=o.length),n}function ua(e){let t=e.valueBefore;const o=e.selectionBefore;if(e.suffix&&t.endsWith(e.suffix)&&(t=t.substring(0,t.length-e.suffix.length),e.valueBefore=t,o[0]>=t.length&&(o[0]=t.length),o[1]>=t.length&&(o[1]=t.length)),e.prefix&&t.startsWith(e.prefix)){const n=e.prefix.length;t=t.substring(n),e.valueBefore=t,o[0]=Math.max(o[0]-n,0),o[1]=Math.max(o[1]-n,0)}return t}function fa(e,t,o=!1){o&&(Ss.add(e),setTimeout(()=>Ss.delete(e),5)),Ts.get(e)&&Ts.set(e,t),e.setSelectionRange(...t)}function va(e,t,o="After"){if(e.value=t[`value${o}`],zs){const o=new InputEvent("input",{inputType:"insert"===t.type?"insertText":t.type,data:t.data});e.dispatchEvent(o)}}function ha(e){if(null==e)return"";const t=Cs.test(e.charAt(0))&&Cs.test(e.charAt(1))?2:1;return e.substring(0,t)}function ma(e,t,o="forward"){if("backward"===o)return 0===t?0:1===t?1:Cs.test(e.charAt(t))&&Cs.test(e.charAt(t-1))?2:1;const n=e.length-t;return 0===n?0:1===n?1:ha(e.substring(t)).length}function ga(e,t){const o=ha(e.data),n=o.length;if(e.value+=o,e.pos+=n,"string"==typeof e.data&&(e.data=e.data.substring(n),e.data.length||(e.endPos=e.pos)),t)return t.substring(n)}function $a(e){const t=ha(e.buffer),o=t.length;e.value+=t,e.pos+=o,e.buffer=e.buffer.substring(o)}function ba(e,t){const o=ha(t),n=o.length;return e.value+=o,e.pos+=n,t.substring(n)}function ya(e,t){for(;t.buffer;){const o=ha(t.buffer);if(e.pattern.test(o)||t.placeholder&&e.placeholder===o)return void("replace"!==t.mode&&"select"!==t.mode||(t.buffer=t.buffer.substring(o.length)));t.buffer=t.buffer.substring(o.length)}}function xa(e,t){const o=e.values.concat([e.placeholder]).map(e=>e.toLowerCase()).sort((e,t)=>e.length>t.length?-1:1);for(;t.buffer;){const e=t.buffer.toLowerCase(),n=o.find(t=>e.startsWith(t));if(n){const e=t.buffer.substring(0,n.length);return t.buffer=t.buffer.substring(n.length),e}t.buffer=t.buffer.substring(ma(t.buffer,0))}return null}function wa(e,t){let o=e.replaceAll(t.placeholder,"");const n="left"===t.selectDirection;if(t.selectFill){const e=new RegExp(`${n?"":"^"}${r=t.selectFill,r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}+${n?"$":""}`);o=o.replace(e,"")}var r;return o}function _a(e,t){let o=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return o;const n=la(e);o=[n[0],t.endPos,"none"];const[r,s]=Ea(e,t.value),a=Ra(e,o,[r,s]);if(void 0===a)return o;if(!(a in r)||!(a in s))return o;const l=r[a],i=s[a],p=t.value.slice(l[0],l[1]);if(oa(i)&&wa(p,i).length===p.length&&a<r.length-1)return Ks(),r[a+1];if(na(i)&&t.insertPos>=l[0]&&t.insertPos<=l[1]){if(t.cycle)return l;const o=function(e,t,o){if(null===e.originalData)return 0;const n=e.insertPos>=t?e.value.substring(t,e.insertPos):"",r=`${n}${e.originalData}`,s=Ma(o.values,r);if(s)return Ta(r,s).length-n.length;return 0}(t,l[0],i);if(t.insertPos+o===l[1])return Va(i.values,p)?[l[1],l[1],"forward"]:(Ks(),r[a+1]?r[a+1]:r[a]);const s=[t.insertPos+o,l[1],"none"];return aa(s,n)||(Ss.add(e),setTimeout(()=>Ss.delete(e),5)),s}return l}function ka(e,t,o,n){var r,s;const a=null!==(r=Is.get(e))&&void 0!==r?r:[],l={pos:0,insertPos:null!==(s=t.insertPos)&&void 0!==s?s:t.selectionBefore[0],range:t.selectionBefore,chars:0,placeholder:Ds.has(e),buffer:o,data:t.data,originalData:t.data,value:"",mode:As.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:Ea(e),unmasked:"",complete:!0,cycle:t.cycle,meta:[]};return Sa(a,l,void 0,n),l}function Sa(e,t,o,n){var r,s;const a={...t};(null==o?void 0:o.placeholder)&&(t.placeholder=!0);const l=(null==o?void 0:o.repeat)&&"literal"===(null===(r=o.nextPart)||void 0===r?void 0:r.type)?o.nextPart.value:null;let i=0;const p=e.reduce((e,t)=>e+("char"===t.type?1:0),0),d=t.chars;for(const o of e){const r=e[i+1];switch(o.type){case"literal":Ia(o,t,e.at(-1)===o);break;case"char":Da(o,t,l);break;case"enum":La(o,t);break;case"group":const a={repeat:null!==(s=o.repeat)&&void 0!==s&&s,nextPart:r,repeats:0,placeholder:!!o.placeholder};Sa(o.parts,t,a,n)}if(n){if(!1===n(t,o))break}const a=sa(r)&&i+2===e.length&&d!==t.chars;if(!(t.buffer||t.data||t.placeholder||a))break;i++}if(t.chars<p&&(t.complete=!1),o){const r=t.chars-d,s=r===p,i=!(!t.data||l&&t.data.startsWith(l)&&t.insertPos<=t.pos),c=!(t.buffer&&l&&t.buffer.startsWith(l)&&t.insertPos>=t.pos+l.length)&&(t.buffer||i);if(o.repeat&&c&&s)return o.repeats++,Sa(e,t,o,n);if(!s){t.complete=!1;const o=e.reverse().find(e=>"literal"===e.type);e.reverse(),sa(o)&&t.value.endsWith(o.value)&&(t.value=t.value.substring(0,t.value.length-o.value.length),t.pos=t.value.length)}p>1&&r<p&&0!==r&&t.insertPos<=t.pos?t.data="":o.repeat&&!s&&o.repeats&&Object.assign(t,a)}t.placeholder=a.placeholder}function La(e,t){const[o,n]=t.rangeParts,r=o[n.indexOf(e)];if(r&&(t.insertPos<=t.pos||t.insertPos>=r[0]&&t.insertPos<=r[1])&&t.data){const o=t.buffer.substring(0,t.insertPos-t.pos),n=`${o}${t.data}`,r=Ma(e.values.concat([e.placeholder]),n);if(r){const s=Ta(n,r);return t.data=t.data.substring(s.length),t.value+=r,r!==e.placeholder?t.unmasked+=r:t.complete=!1,t.meta.push({type:r!==e.placeholder?"enum":"placeholder",value:r}),o?t.buffer=t.buffer.substring(o.length):xa(e,t),t.endPos=t.pos+s.length,void(t.pos=t.value.length)}t.data=""}if(t.buffer){const o=xa(e,t);if(o)return t.value+=o,o!==e.placeholder?t.unmasked+=o:t.complete=!1,t.meta.push({type:o!==e.placeholder?"enum":"placeholder",value:o}),void(t.pos=t.value.length)}t.complete=!1,t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder}),t.pos=t.value.length}function Ia(e,t,o){let n=e.value;if(""===t.data&&!t.buffer&&!t.placeholder&&!o)return;let r=!1;for(;n;){const e=t.insertPos<=t.pos?ha(t.data):"",s=ha(n);if(e===s)n=ga(t,n),t.meta.push({type:"literal",value:s}),r=!0;else if(!r||t.data||null===t.data||t.placeholder||o)n=ba(t,n),t.meta.push({type:"literal",value:s});else if(r&&!t.data)break;t.buffer.startsWith(s)&&(t.buffer=t.buffer.substring(s.length))}null===t.data&&!t.buffer&&t.insertPos<=t.pos&&!t.placeholder&&(t.value=t.value.substring(0,t.value.length-e.value.length),t.pos=t.endPos=t.value.length)}function Da(e,t,o){var n;let r=!0;if(t.insertPos<=t.pos)for(;null===(n=t.data)||void 0===n?void 0:n.length;){const n=ha(t.data);if(e.pattern.test(n))return ga(t),t.meta.push({type:"char",value:n}),t.chars++,t.unmasked+=n,void ya(e,t);if("string"==typeof t.data){if(o&&t.data.startsWith(o)){r=!1;break}t.data=t.data.substring(n.length)}}for(;r&&t.buffer;){const n=ha(t.buffer);if(e.pattern.test(n))return t.chars++,t.unmasked+=n,$a(t),void t.meta.push({type:"char",value:n});if(t.placeholder&&n===e.placeholder)return $a(t),void t.meta.push({type:"placeholder",value:n});if("string"==typeof t.buffer){if(o&&t.buffer.startsWith(o)){t.buffer=t.buffer.substring(o.length);break}t.buffer=t.buffer.substring(n.length)}}t.placeholder?(t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder})):t.endPos=t.pos}function Aa(e,t,o,n){const r=[n,n,"none"];if("select"===t.mode){const s=Ea(e),a=Ra(e,r,s),[l,i]=Ea(e,t.value),p=void 0!==a&&Ca(o.valueBefore,s[0][a],s[1][a]);if(void 0!==a&&a in l){if(p){const e=l.slice(a).every((e,o)=>Ca(t.value,e,i[a+o]));return e&&l[a-1]?l[a-1]:l[a]}return[n,l[a][1],"none"]}}return r}function Ca(e,t,o){if(sa(o))return!1;if(oa(o)){let n=t[0];for(;n<t[1];){const t=ha(e.substring(n));if(t!==o.placeholder)return!1;n+=t.length}}return!na(o)||e.substring(t[0],t[1])===o.placeholder}function Ta(e,t){let o="";do{const n=ha(e).toLowerCase(),r=ha(t).toLowerCase();if(n!==r)break;o+=n,e=e.substring(n.length),t=t.substring(r.length)}while(e.length&&t.length);return o}function Ea(e,t){const o=Is.get(e);if(!o)return[[],[]];if(Es.has(e))return Es.get(e);const n=null!=t?t:pa(e,e.value),r=[],s=[];let a=null,l=null,i=0,p=!0;for(const e of o)if(sa(e))a=e,null!==l&&(r.push([l,i,"none"]),l=null),i+=e.value.length;else{if(oa(a)&&oa(e)&&e.token===a.token)i++;else if(oa(e))null===l?(l=i,s.push(e)):(r.push([l,i,"none"]),l=i,s.push(e)),i++;else if(na(e)){l&&r.push([l,i,"none"]),Fa(e)||(p=!1);const t=Oa(n,e,i);l=null,r.push([i,i+t,"none"]),s.push(e),i+=t}a=e}null!==l&&r.push([l,i,"none"]);const d=[[...r],[...s]];return p&&!t&&Es.set(e,d),d}function Oa(e,t,o){if(Fa(t))return t.values[0].length;const n=e.slice(o),r=Ma(t.values.concat([t.placeholder]),n);return r?r.length:0}function Ma(e,t,o=null,n){var r;if(0===t.length)return o;if(!n){const o=e.find(e=>e.toLowerCase()===t.toLowerCase());if(o)return o}const s=ha(t.toLowerCase()),a=`${null!=n?n:""}${s}`,l=e.filter(e=>e.toLowerCase().startsWith(a)),i=l.find(e=>e.toLowerCase()===a);return i&&(o=i),0===l.length?o:1===l.length?l[0]:(l.length>1&&(o=l[0]),null!==(r=Ma(l,t.substring(s.length),o,a))&&void 0!==r?r:l[0])}function Va(e,t){return t=t.toLowerCase(),e.some(e=>(e=e.toLowerCase()).startsWith(t.toLocaleLowerCase())&&e!==t)}function Fa(e){if(!Os.has(e)&&Array.isArray(e.values)&&e.values.length>0){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;Os.set(e,e.values.every(e=>e.length===t))}return Os.get(e)}function Pa(e,t=1){const[o]=Ea(e),n=Ra(e,ca(e,la(e)));return void 0!==n&&void 0!==o[n+t]&&(e.setSelectionRange(...da(e,o[n+t])),!0)}function Ba(e,t=1){const[o,n]=Ea(e),r=Ra(e,la(e));if(void 0!==r&&r in n){const s=n[r];if(na(s)){const n=o[r],a=e.value.slice(n[0],n[1]);let l=null,i=s.values.indexOf(a);const p=s.values.length-1;if(-1!==i){const e=i+t;i=e<0?p:e>p?0:e,l=s.values[i]}else a===s.placeholder&&(l=t>0?s.values[0]:s.values[p]);if(null!==l){const t={selectionBefore:n,insertPos:n[0],type:"insert",data:l,valueBefore:e.value,cycle:!0};return setTimeout(()=>ia(e,t),0),!0}}}return!1}function Ha(e,t){if(!e.length)return-1;if(1===e.length)return e[0];const o=e.length/2,n=Number.isInteger(o)?o:Math.floor(o),r=Math.abs(t-e[n-1])<Math.abs(t-e[n])?[0,n]:[n];return Ha(e.slice(...r),t)}function Ra(e,t,o){const[n]=null!=o?o:Ea(e),r=n.findIndex(e=>e[0]!==e[1]&&(!!aa(e,t)||t[1]>e[0]&&t[1]<e[1]));if(-1!==r)return r;const[s,a]=n.reduce((e,t,o)=>(e[0].add(t[0]),e[0].add(t[1]),e[1][t[0]]=o,e[1][t[1]]=o,e),[new Set,{}]),l=Ha([...s],0===t[0]&&t[1]===e.value.length?0:t[1]);return l in a?a[l]:void 0}function Na(e){var t,o;const n=null!==(t=_s.get(e))&&void 0!==t?t:[];return n[null!==(o=ks.get(e))&&void 0!==o?o:n.length-1]}function Ka(e,t=!1){const o=Na(e);return o&&(o.complete||t)?Fs.has(e)?[...o.unmasked].reverse().join(""):o.unmasked:t?"":null}function Wa(e){var t;const o=Na(e);return null!==(t=null==o?void 0:o.meta)&&void 0!==t?t:null}function qa(e){const t=e=>[...e].reverse().join(""),o=(e,t)=>[t-e[1],t-e[0],e[2]];e.data&&(e.data=t(e.data)),e.valueBefore=t(e.valueBefore),"valueAfter"in e&&(e.valueAfter=t(e.valueAfter)),"selectionAfter"in e&&(e.selectionAfter=o(e.selectionBefore,e.valueAfter.length)),e.selectionBefore=o(e.selectionBefore,e.valueBefore.length)}function za(e){if(e.scrollWidth>e.clientWidth&&null!==e.selectionStart&&null!==e.selectionEnd){const t=e.selectionStart/e.value.length,o=e.selectionEnd/e.value.length;e.scrollLeft=o>.9?e.scrollWidth:t*e.scrollWidth-20,e.dispatchEvent(new CustomEvent("input-scroll",{bubbles:!1,detail:e.scrollLeft}))}}const Ua="undefined"!=typeof window,Ya=new WeakSet,ja=new WeakSet,Za=new WeakSet,Ga=new WeakMap,Xa=new WeakMap,Ja=new WeakSet,Qa=new WeakSet;function el(e){e.props.selectedMonth=e.props.selectedYear=e.props.selectedDay=e.props.selectedWeek=void 0}function tl(e){var t,o,n;e.props.selectedMonth=e.props.months.findIndex(t=>rl(t,e.props.activeDate)),e.props.selectedYear=e.props.years.findIndex(t=>nl(t,e.props.activeDate));for(let s=0;s<(null===(t=e.props.calendar[0])||void 0===t?void 0:t.weeks.length);s++)for(let t=0;t<(null===(o=e.props.calendar[0])||void 0===o?void 0:o.weeks[s].length);t++){const o=null===(n=e.props.calendar[0])||void 0===n?void 0:n.weeks[s][t];if(r.sameDay(o,e.props.activeDate)){e.props.selectedWeek=s,e.props.selectedDay=t;break}}}function ol(e){return"timeZoneName"!==e.partName}function nl(e,t){return t instanceof Date&&e.getFullYear()===t.getFullYear()}function rl(e,t){return t instanceof Date&&e.getMonth()===t.getMonth()}function sl(e){e.props.skipBuildCalendar||el(e),e.props.selectedIndex=e.props.calendar=_(e.props.showMonths,e=>e).map(t=>function(e,t){const o=[],n=r.date(t);n.setDate(1);let s=r.weekStart(n,e.props.weekStart);s.setHours(n.getHours(),n.getMinutes(),n.getSeconds());const a=r.weekEnd(r.monthEnd(t),e.props.weekStart);let l=[];do{l.push(s),7===l.length&&(o.push(l),l=[]),s=r.addDay(s)}while(s.getTime()<=a.getTime());return{monthDay:n,weeks:o}}(e,r.addMonth(e.props.renderedDate,t))),e.props.years=function(e){const t=Number(r.format(e.props.renderedDate,"YYYY")),o=t-t%10;return e.props.decade=`${o} - ${o+9}`,_(10,n=>r.addYear(e.props.renderedDate,o+n-t))}(e),e.props.months=function(e){const t=r.date(e.props.renderedDate);return t.setMonth(0),_(12,e=>r.addMonth(t,e))}(e),e.props.skipBuildCalendar?e.props.skipBuildCalendar=!1:e.value&&tl(e)}function al(e,t){var o;t.target&&t.target instanceof Element&&(t.target.closest(`#${e.props.id}_popover`)||!(null===(o=e.props.__root)||void 0===o?void 0:o.contains(t.target)))||(e.props.expanded=!1)}function ll(e,t){if(!t)return e.props.inputText="",new Date;const o=t instanceof Date?t:r.parse(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(o,e.props.format,e.props.locale,!1,ol),o}function il(t){return Array.isArray(t.props.sequence)?e.clone(t.props.sequence):["day"]}function pl(e,t,o=!0){var n,s;if(e._value===t)return;if(null==t)return e.input(t,o);e.props.offset=e.props.timezone?r.offset(t,e.props.timezone):"+0000";const a=r.applyOffset(t,null!==(n=(s=e.props).offset)&&void 0!==n?n:s.offset="+0000");e.input(r.format(a,e.props.valueFormat,e.props.valueLocale,!1),o)}function dl(e,t){var o;const n=["prev_button","month_button","day_button","year_button","next_button"].find(t=>{var o;return null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${t}`)}),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${n}`);r instanceof HTMLElement&&(t.preventDefault(),r.focus())}function cl(e,t){let o="";if(!(t instanceof HTMLInputElement)||e.props.pickerOnly)return;Ga.set(e,t);const n=t=>{e.props.expanded&&t.target instanceof HTMLElement&&t.target.closest(`#${e.props.id}_popover`)?Qa.add(e):Qa.delete(e)},s=e.props.__root;s&&(s.addEventListener("click",n),De(e,()=>s.removeEventListener("click",n))),e.on("prop:inputText",({payload:e})=>{e!==t.value&&("beforeCallback"===Vs.get(t)&&(o=t.value),Gs(t),t.selectionStart=0,t.selectionEnd=t.value.length,function(e,t){var o,n;if(!_s.has(e))return;const r=null!==(o=Ps.get(e))&&void 0!==o?o:"",s=null!==(n=Bs.get(e))&&void 0!==n?n:"";ia(e,{type:"insert",selectionBefore:la(e),data:t,valueBefore:e.value,suffix:s,prefix:r})}(t,e),t.value=e,setTimeout(()=>Xs(t),10))});const[a,l]=function(e){const t=e.props.locale,o=["full","long","medium","short"].includes(e.props.format)||"object"==typeof e.props.format,n=r.parts(e.props.format,t),s=r.formatStr(e.props.format,t,!0,ol);return[s,n.reduce((n,s)=>{if("literal"===s.partName)return n;let a=r.range(s.token,t,o);if("YYYY"===s.token&&e.props.minDate&&e.props.maxDate){const t=e.props.minDate.getFullYear();a=_(e.props.maxDate.getFullYear()-t+1,e=>String(t+e))}const l={type:"enum",token:s.token,values:a,placeholder:"A"===s.token?"A/P":s.token,selectDirection:"left"};return n.push(l),s.token.startsWith("D")&&Xa.set(e,a),n},[])]}(e);Zs(t,{pattern:a,explicitParts:l,onChange:({valueAfter:n})=>{if(ul(e),Ya.has(e))return Ya.delete(e);o&&o===n?o="":(Gs(t),e.props.inputText=n,setTimeout(()=>Xs(t),10))}},e)}function ul(e){var t,o;if(e.props.overlay){const n=Ga.get(e);!n||!(null===(t=e.props.attrs)||void 0===t?void 0:t.placeholder)||e._value||Ka(n,!0)||e.props._isFocused||e.props.activeDate&&e.props.expanded?n&&(e.props._isPlaceholder=!1,e.props._overlayParts=_e(Wa(n))):(e.props._isPlaceholder=!0,e.props._overlayParts=[{type:"placeholder",value:null===(o=e.props.attrs)||void 0===o?void 0:o.placeholder}])}}function fl(e,t){return!t||(!(!e.props.minDate||!r.isBefore(t,e.props.minDate))||(!(!e.props.maxDate||!r.isAfter(t,e.props.maxDate))||void 0))}function vl(e){return"function"==typeof e.props.validationLabel?e.props.validationLabel(e):e.props.validationLabel||e.props.label||e.props.name||String(e.name)}const hl="undefined"!=typeof window,ml=new WeakMap;function gl(e,t){var o,n;if(t instanceof HTMLInputElement&&!ml.get(e)&&hl){const r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_overlay`),s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_overlay_inner`);if(r&&t&&s){ml.set(e,r);const o=getComputedStyle(t).color;t.style.color="transparent",t.style.caretColor=o;const n=new ResizeObserver(()=>{var o;const n=getComputedStyle(t),r=t.getBoundingClientRect(),s=null===(o=t.parentElement)||void 0===o?void 0:o.getBoundingClientRect();e.props._overlayStyles={...e.props._overlayStyles,width:n.width,height:n.height,boxSizing:n.boxSizing,padding:n.padding,margin:n.margin,fontSize:n.fontSize,lineHeight:n.lineHeight,top:r.top-((null==s?void 0:s.top)||r.top)+"px",left:r.left-((null==s?void 0:s.left)||r.left)+"px"}});n.observe(t);const a=e=>{s.scrollLeft=e.detail};t.addEventListener("input-scroll",a),e.on("destroyed",()=>{t.removeEventListener("input-scroll",a),n.disconnect()})}}}function $l(t){t.addProps(["_overlayStyles","_overlayParts","_overlayInnerStyles","_isPlaceholder"]),t.props._overlayStyles={position:"absolute",top:"0",left:"0",pointerEvents:t.props._isPlaceholder?"auto":"none"},t.props._overlayInnerStyles={overflow:"hidden",whiteSpace:"nowrap",paddingRight:"20px"},t.on("created",()=>{t.props.overlay=e.undefine(t.props.overlay),t.props.pickerOnly=e.undefine(t.props.pickerOnly),t.props.overlay=t.props.pickerOnly?void 0:t.props.overlay,t.props.overlay&&e.whenAvailable(`${t.props.id}`,gl.bind(null,t),t.props.__root)}),t.on("prop:_isPlaceholder",()=>{t.props._overlayStyles={...t.props._overlayStyles,pointerEvents:t.props._isPlaceholder?"auto":"none"}})}const bl={schema:/* #__PURE__ */Dr(/* #__PURE__ */Ar(/* #__PURE__ */Er("$label"),/* #__PURE__ */Cr(/* #__PURE__ */Tr("prefix"),/* #__PURE__ */Or(),/* #__PURE__ */bs(/* #__PURE__ */xs(/* #__PURE__ */ys(/* #__PURE__ */hs("$part.value"),/* #__PURE__ */ms("$part.value"),/* #__PURE__ */gs("$part.value"),/* #__PURE__ */$s("$part.value")))),/* #__PURE__ */Br(),/* #__PURE__ */Hr(/* #__PURE__ */ns(/* #__PURE__ */Kr(/* #__PURE__ */Wr("$ui.prev.value"),/* #__PURE__ */Tr("prev")),/* #__PURE__ */rs("$decade"),/* #__PURE__ */ss(/* #__PURE__ */is()),/* #__PURE__ */as(/* #__PURE__ */ps(),/* #__PURE__ */is()),/* #__PURE__ */ls(/* #__PURE__ */ps(),/* #__PURE__ */ds(),/* #__PURE__ */is()),/* #__PURE__ */Rr(/* #__PURE__ */Nr("$ui.next.value"),/* #__PURE__ */Tr("next")),/* #__PURE__ */vs(/* #__PURE__ */Tr("close"))),/* #__PURE__ */ws(/* #__PURE__ */Qr(/* #__PURE__ */es("$fns.format($year, $yearFormat)")),/* #__PURE__ */ts(/* #__PURE__ */os("$fns.format($month, $monthFormat)")),/* #__PURE__ */qr(/* #__PURE__ */Ur(/* #__PURE__ */Yr(/* #__PURE__ */jr("$fns.format($day, $weekdayFormat)"))),/* #__PURE__ */zr(/* #__PURE__ */Zr(/* #__PURE__ */Gr(/* #__PURE__ */Xr("$fns.format($day, $dateFormat)"))))),/* #__PURE__ */us(/* #__PURE__ */fs()))),/* #__PURE__ */cs(/* #__PURE__ */Tr("clear")),/* #__PURE__ */Jr(/* #__PURE__ */Tr("calendar")),/* #__PURE__ */Mr(),/* #__PURE__ */Tr("suffix"))),/* #__PURE__ */Vr("$help"),/* #__PURE__ */Fr(/* #__PURE__ */Pr("$message.value"))),type:"input",family:"text",props:["dateFormat","dayButtonFormat","format","monthButtonFormat","monthFormat","overlay","pickerOnly","showMonths","showPagination","weekStart","weekdayFormat","yearFormat","years"],features:[$l,function(o){var n,s,a,l,i,p,d,c,u,f,v,h,m,g,$,b,y,x,w,k,S,L;o.addProps(["_isDisabled","_isFocused","activeDate","calendar","clearable","disabled","decade","disabledDays","expanded","inputText","localTime","maxDate","maxScan","minDate","months","offset","paginatedPanels","panel","pickerOnly","renderedDate","sequence","timezone","valueFormat","valueLocale","showPanelClose","selectedDay","selectedWeek","selectedMonth","selectedYear"]),o.hook.prop((e,t)=>("expanded"===e.prop&&o.props.disabled&&(e.value=!1),"weekStart"===e.prop&&(e.value=Number(e.value||0)),"showMonths"===e.prop&&(e.value=Number(e.value||1)),"maxScan"===e.prop&&(e.value=Number(e.value||7)),"timezone"===e.prop&&("string"==typeof o._value||o._value instanceof Date)&&(o.props.offset=r.offset(o._value,e.value)),t(e))),o.props._isFocused=!1,o.props._isPlaceholder=!1,null!==(n=(h=o.props).valueFormat)&&void 0!==n||(h.valueFormat="ISO8601"),null!==(s=(m=o.props).weekdayFormat)&&void 0!==s||(m.weekdayFormat="d"),null!==(a=(g=o.props).monthFormat)&&void 0!==a||(g.monthFormat="MMM"),null!==(l=($=o.props).monthButtonFormat)&&void 0!==l||($.monthButtonFormat="MMMM"),null!==(i=(b=o.props).dayButtonFormat)&&void 0!==i||(b.dayButtonFormat="D"),null!==(p=(y=o.props).dateFormat)&&void 0!==p||(y.dateFormat="D"),null!==(d=(x=o.props).yearFormat)&&void 0!==d||(x.yearFormat="YYYY"),null!==(c=(w=o.props).paginatedPanels)&&void 0!==c||(w.paginatedPanels=["day","year"]),null!==(u=(k=o.props).valueLocale)&&void 0!==u||(k.valueLocale=o.props.locale),null!==(f=(S=o.props).format)&&void 0!==f||(S.format="long"),o.props.panels=il(o),o.props.pickerOnly=e.undefine(o.props.pickerOnly),"disabled"in o.props&&(o.props.disabled=e.undefine(o.props.disabled)),"clearable"in o.props&&(o.props.clearable=e.undefine(o.props.clearable)),null!==(v=(L=o.props).maxScan)&&void 0!==v||(L.maxScan=7),o.props._isDisabled="function"==typeof o.props.disabledDays?o.props.disabledDays.bind(null,o):fl.bind(null,o),o.props.calendar=[],o.props.inputText="",o.props.showMonths=o.props.showMonths||1,"function"==typeof o.props.format?(o.props.formatDate=o.props.format,o.props.format=null):o.props.formatDate=r.format,sl(o),o.on("mounted",()=>{e.whenAvailable(`${o.props.id}`,cl.bind(null,o),o.props.__root)}),o.on("created",()=>{if(function(e){const t=e._value;let o=new Date;if(t instanceof Date)o=r.date(t);else if("string"==typeof t)try{const n=r.parse(t,e.props.valueFormat,e.props.valueLocale);o=r.date(n)}catch{console.warn(`Date (${t}) does not match format (${r.formatStr(e.props.valueFormat,e.props.valueLocale)})`),o=void 0}else t||(o=void 0);if(e.props.offset=e.props.timezone?r.offset(o||new Date,e.props.timezone):"+0000",e.props.minDate){const t="string"==typeof e.props.minDate?r.parse(e.props.minDate):e.props.minDate;e.props.minDate=r.removeOffset(t,e.props.offset)}if(e.props.maxDate){const t="string"==typeof e.props.maxDate?r.parse(e.props.maxDate):e.props.maxDate;e.props.maxDate=r.removeOffset(t,e.props.offset)}o=o&&r.removeOffset(o,e.props.offset),o&&pl(e,o,!1);let n=o||new Date;e.props.minDate&&n<e.props.minDate?n=e.props.minDate:e.props.maxDate&&n>e.props.maxDate&&(n=e.props.maxDate),e.props.renderedDate=n,e.props.activeDate=n,e.props.localTime=o&&r.format(o,"HH:mm")||"12:00"}(o),o.context){const e={};let t;o.context.fns.format=(t,n)=>{if(e[n]&&e[n][t.toString()])return e[n][t.toString()];const s=r.format(t,n,o.props.locale||"en",!1,ol);return e[n]?e[n][t.toString()]=s:e[n]={[t.toString()]:s},s},o.context.fns.isDisabled=o.props._isDisabled,o.context.fns.isDisabledMonth=e=>!r.nearestDay(e,e=>!o.props._isDisabled(e),"month"),o.context.fns.isDisabledYear=e=>!r.nearestDay(e,e=>!o.props._isDisabled(e),"year"),o.context.handlers._blur=e=>{var t,n;o.props._isFocused=!1,"function"==typeof(null===(t=o.context)||void 0===t?void 0:t.handlers.blur)&&(null===(n=o.context)||void 0===n||n.handlers.blur(e))},o.context.handlers.closePanel=()=>{o.props.expanded=!1},o.context.handlers._blurOut=e=>t=>{var n;t.preventDefault(),o.props.keydown?o.props.keydown=!1:e&&e!==o.props.panel||o.props.pickerOnly&&t.relatedTarget instanceof Element&&(t.relatedTarget===document.getElementById(`${o.props.id}_inner`)||t.relatedTarget.closest(`#${o.props.id}_inner`))||t.relatedTarget&&t.relatedTarget instanceof Element&&(t.relatedTarget.closest(`#${o.props.id}_popover`)||!(null===(n=o.props.__root)||void 0===n?void 0:n.contains(t.relatedTarget))||t.relatedTarget.id===`${o.props.id}_popover`)||(o.props.expanded=!1)},o.context.handlers.overlayClick=()=>{const e=Ga.get(o);e&&(e.focus(),o.props._isPlaceholder=!1)},o.context.handlers.focus=()=>{o.props.pickerOnly||(o.props._isFocused=!0,o.props.pickerOnly&&!ja.has(o)&&(Za.add(o),o.props.expanded=!0,setTimeout(()=>Za.delete(o),200)))},o.context.handlers.clear=()=>{var e,t;pl(o,void 0,!0),ll(o,void 0);const n=null===(t=null===(e=o.props)||void 0===e?void 0:e.__root)||void 0===t?void 0:t.getElementById(`${o.props.id}`);n instanceof HTMLInputElement&&(n.focus(),setTimeout(()=>{n.setSelectionRange(0,0)},50))},o.context.handlers.dateInput=e=>{var t;if(Ja.has(o))return Ja.delete(o);if(e.target instanceof HTMLInputElement&&!o.props.expanded)try{let n=r.parse({date:e.target.value,format:o.props.format,locale:o.props.locale,partFilter:ol});if(function(e){return r.parts(e.props.format,e.props.locale).some(e=>"weekday"===e.partName)}(o)&&o.props.activeDate instanceof Date&&o.props.activeDate.getTime()===n.getTime()&&!Rs.get(e.target)&&r.format(n,o.props.format,o.props.locale,!1,ol)!==e.target.value){const s=r.range("dddd",o.props.locale),a=r.parts(o.props.format,o.props.locale),l=null===(t=r.parseParts(e.target.value,a).find(e=>"dddd"===e.token))||void 0===t?void 0:t.value,i=r.format(n,"dddd",o.props.locale);if(l&&s.includes(l)&&i!==l){let e=s.indexOf(l)-s.indexOf(i);e=e<-1?7+e:e,n=r.addDay(n,e),Ya.add(o)}}pl(o,n)}catch(e){pl(o,void 0)}},o.context.handlers.open=()=>{o.props.expanded=!0},o.context.handlers.next=()=>{switch(o.props.panel){case"year":return void(o.props.renderedDate=r.addYear(o.props.renderedDate,10));case"day":return void(o.props.renderedDate=r.addMonth(o.props.renderedDate,1))}},o.context.handlers.prev=()=>{switch(o.props.panel){case"year":return void(o.props.renderedDate=r.addYear(o.props.renderedDate,-10));case"day":return void(o.props.renderedDate=r.addMonth(o.props.renderedDate,-1))}},o.context.handlers.setDate=e=>()=>{"month"!==o.props.panel&&"year"!==o.props.panel||!o.props.activeDate||(e=o.props.activeDate),o.emit("dateSelected",e)},o.context.handlers.localTime=e=>{const t=e.target;if(!t.value)return;const[n,r]=t.value.split(":");o.props.localTime=t.value,o.props.activeDate.setHours(n,r),ll(o,o.props.activeDate)},o.context.handlers.keyDown=e=>{switch(o.props.keydown=!0,o.props.panel){case"day":return o.emit("calendarKeydown",e);case"year":return o.emit("yearKeydown",e);case"month":return o.emit("monthKeydown",e);case"time":return o.emit("timeKeydown",e);default:return}},o.context.handlers.inputKeydown=e=>{o.emit("keydown",e)},o.context.handlers.openKeydown=e=>{"Enter"!==e.key&&"Space"!==e.key||(o.props.expanded=!0)},o.context.handlers.mouseEnter=e=>n=>{if(clearTimeout(t),n.target instanceof HTMLElement&&"-1"===n.target.getAttribute("tabindex")&&"true"!==n.target.getAttribute("data-is-extra"))if("month"===o.props.panel||"year"===o.props.panel){const t=r.nearestDay(e,()=>!0,o.props.panel);t&&(o.props.activeDate=t)}else o.props.activeDate=e},o.context.handlers.mouseLeave=()=>{clearTimeout(t),t=setTimeout(()=>{},100)},o.context.handlers.jumpTo=e=>()=>{o.props.panels.unshift(o.props.panel),o.props.panel=e},o.context.fns.sameDay=e=>function(e,t){return t instanceof Date&&r.sameDay(e,t)}(e,o.props.activeDate),o.context.fns.sameMonth=e=>rl(e,o.props.activeDate),o.context.fns.sameYear=e=>nl(e,o.props.activeDate),o.context.fns.notInMonth=(e,t)=>{const o=r.dayStart(t).getTime();return o<r.monthStart(e).getTime()||o>r.monthEnd(e).getTime()||void 0}}});const I=al.bind(null,o);De(o,()=>{document.removeEventListener("click",I)}),o.on("prop:panel",({payload:e})=>{o.props.showPagination=o.props.paginatedPanels.includes(e)}),o.on("dateSelected",({payload:e})=>{var t,n;Array.isArray(o.props.panels)&&o.props.panels.length?o.props.panel=o.props.panels.shift():(o.props.expanded=!1,null===(n=null===(t=o.props.__root)||void 0===t?void 0:t.getElementById(`${o.props.id}`))||void 0===n||n.focus()),e&&o.props._isDisabled(e)||pl(o,e)}),o.on("input",({payload:e})=>{if(void 0===e&&!o.props._isFocused)return void ll(o,void 0);const t=new Date,n=e?ll(o,r.removeOffset("string"==typeof e?r.parse(e,o.props.valueFormat,o.props.valueLocale):e,o.props.offset)):t;o.props.activeDate=!e&&o.props.activeDate?o.props.activeDate:n,o.props.renderedDate=!e&&o.props.renderedDate?o.props.renderedDate:n,o.props.localTime=r.format(n,"HH:mm"),function(e){const t=Xa.get(e);if(e._value&&t){const o=r.monthDays(e.props.activeDate);if(t.length>o)t.splice(o,t.length-o);else if(t.length<o)for(let e=t.length+1;e<=o;e++)t.push(String(e))}}(o)}),o.on("prop:renderedDate",sl.bind(null,o)),o.on("prop:expanded",({payload:t})=>{if(t){if(Qa.delete(o),o.props.panels=il(o),o.props.panel=o.props.panels.shift(),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?o.props.showPanelClose=!0:o.props.showPanelClose=!1,"day"===o.props.panel){const e=o.props.activeDate;o.props.activeDate=r.nearestDay(o.props.activeDate,e=>!o.props._isDisabled(e),"month")||e}sl(o),e.whenAvailable(`${o.props.id}_popover`,e=>{const t=e.querySelector('[tabindex="0"]');t&&setTimeout(()=>{t.focus(),function(e,t){const o=Ae(e,e=>{for(const t of e)"attributes"===t.type&&t.target instanceof HTMLElement&&"0"===t.target.getAttribute("tabindex")?t.target.focus():t.addedNodes.length&&t.addedNodes.forEach(e=>{var t;if(e instanceof HTMLElement&&"0"===e.getAttribute("tabindex"))e.focus();else if(e instanceof HTMLElement&&e.querySelector('[tabindex="0"]')){const t=e.querySelector('[tabindex="0"]');t instanceof HTMLElement&&t.focus()}else e instanceof HTMLElement&&e.querySelector('input[type="time"]')&&(null===(t=e.querySelector('input[type="time"]'))||void 0===t||t.focus())})});o.observe(t,{attributes:!0,attributeFilter:["tabindex"],childList:!0,subtree:!0});const n=e.on("prop:expanded",({payload:t})=>{t||(e.off(n),o.disconnect())})}(o,e)},0)},o.props.__root),Ua&&setTimeout(()=>{document.addEventListener("click",I)},10)}else{if(o.props.activeDate=o.props.renderedDate,"time"===o.props.panel)o.emit("dateSelected",o.props.activeDate);else if(o._value){Ja.add(o);const e="string"==typeof o._value?r.parse(o._value,o.props.valueFormat,o.props.valueLocale):o._value;ll(o,r.removeOffset(e,o.props.offset))}else ll(o,void 0);Ua&&(ja.add(o),document.removeEventListener("click",I),setTimeout(()=>ja.delete(o),50))}}),o.on("prop:activeDate",({payload:e})=>{if(Array.isArray(o.props.calendar)&&o.props.calendar.length)if("day"===o.props.panel){const t=o.props.calendar,n=r.monthStart(o.props.renderedDate),s=r.monthEnd(r.addMonth(o.props.renderedDate,t.length-1));e.getTime()<n.getTime()?o.props.renderedDate=r.addMonth(o.props.renderedDate,-1):e.getTime()>s.getTime()&&(o.props.renderedDate=r.addMonth(o.props.renderedDate))}else if("year"===o.props.panel){const t=o.props.years,n=t[0].getFullYear(),s=t[t.length-1].getFullYear(),a=o.props.activeDate.getFullYear();a>s?o.props.renderedDate=r.addYear(o.props.renderedDate,10):a<n?o.props.renderedDate=r.addYear(o.props.renderedDate,-10):(o.props.skipBuildCalendar=!0,o.props.renderedDate=e)}o.props.expanded&&ll(o,o.props.activeDate)}),o.on("keydown",({payload:e})=>{switch(e.key){case"ArrowDown":case"ArrowUp":case" ":e.preventDefault(),o.props.pickerOnly&&(o.props.expanded=!0);break;case"Enter":case"Return":o.props.expanded||(o.props.expanded=!0);break;case"Escape":o.props.expanded=!1}}),o.on("calendarKeydown",({payload:e})=>{e.preventDefault();let t=null,n=0;switch(e.key){case"ArrowRight":n=1;break;case"ArrowLeft":n=-1;break;case"ArrowDown":n=7;break;case"ArrowUp":n=-7;break;case"Return":case"Enter":o.emit("dateSelected",o.props.activeDate);break;case"Tab":e.shiftKey||dl(o,e);break;case"Escape":o.props.expanded=!1}if(n&&(e.preventDefault(),t=r.addDay(o.props.activeDate,n)),t&&!o.props._isDisabled(t))o.props.activeDate=t;else if(t&&o.props._isDisabled(t)){const e=n>0?1:-1;_(Number(o.props.maxScan),t=>e*t).some(e=>{const n=r.addDay(t,e);return!o.props._isDisabled(n)&&(o.props.activeDate=n,!0)})}}),o.on("yearKeydown",({payload:e})=>{let t=0;switch(e.key){case"ArrowDown":t=5;break;case"ArrowRight":t=1;break;case"ArrowUp":t=-5;break;case"ArrowLeft":t=-1;break;case"Tab":e.shiftKey||dl(o,e);break;case"Return":case"Enter":o.emit("dateSelected",o.props.activeDate);break;case"Escape":o.props.expanded=!1}const n=o.props.activeDate.getFullYear()+t-o.props.renderedDate.getFullYear();o.props.activeDate=r.addYear(o.props.renderedDate,n)}),o.on("monthKeydown",({payload:e})=>{let t=0;switch(e.key){case"ArrowDown":t=3;break;case"ArrowRight":t=1;break;case"ArrowLeft":t=-1;break;case"ArrowUp":t=-3;break;case"Tab":e.shiftKey||dl(o,e);break;case"Return":case"Enter":o.emit("dateSelected",o.props.activeDate);break;case"Escape":o.props.expanded=!1}t&&e.preventDefault();let n=(o.props.activeDate.getMonth()+t)%12;n=n<0?12+n:n;const s=n-o.props.renderedDate.getMonth();let a=r.addMonth(o.props.renderedDate,s);if(o.props._isDisabled(a)){const e=r.nearestDay(a,e=>!o.props._isDisabled(e),"month");e&&(a=e)}o.props.activeDate=a}),o.on("timeKeydown",({payload:e})=>{switch(e.key){case"Return":case"Enter":e.preventDefault(),o.emit("dateSelected",o.props.activeDate)}}),o.on("prop:_isFocused",()=>{Ga.get(o)&&ul(o)}),o.on("commit",({payload:e})=>{if(e?tl(o):el(o),o.props.activeDate&&o.props._isDisabled(o.props.activeDate)){const e=t.createMessage({blocking:!0,key:"rule_invalidDate",meta:{messageKey:"invalidDate",removeImmediately:!1,localize:!0,i18nArgs:[{node:o,name:vl(o),args:[]}]},type:"validation",value:"The selected date is invalid."});o.store.set(e)}else o.store.remove("rule_invalidDate")})},to,
|
|
29
|
+
/* #__PURE__ */bt.bind(null,ir,pr,Sr),to]},Ir=/* #__PURE__ */K("dp"),{outer:Dr,wrapper:Ar,inner:Cr,icon:Tr,label:Er,prefix:Or,suffix:Mr,help:Vr,messages:Fr,message:Pr}=/* #__PURE__ */W(Ir),Br=Ir("input",()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",id:"$id",onKeydown:"$handlers.inputKeydown",value:"$inputText",onInput:"$handlers.dateInput",onClick:"$pickerOnly && $handlers.open",onBlur:"$handlers._blur",onFocus:"$handlers.focus",readonly:"$pickerOnly || $expanded",disabled:"$disabled"}})),Hr=Ir("panelWrapper",()=>({$el:"div",if:"$expanded",attrs:{id:'$id + "_popover"',role:"dialog",onBlur:"$handlers._blurOut()",tabindex:"-1",popover:"$popover","aria-modal":"true","aria-label":"Choose date","data-panel":"$panel",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"',width:'$popoverCoordinates.width + "px"'}}}})),Rr=Ir("next",()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}})),Nr=Ir("nextLabel","span"),Kr=Ir("prev",()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}})),Wr=Ir("prevLabel","span"),qr=Ir("calendar",()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}})),zr=Ir("calendarWeeks",()=>({$el:"tbody"})),Ur=Ir("calendarHeader",()=>({$el:"thead"})),Yr=Ir("weekDays",()=>({$el:"tr"})),jr=Ir("weekDay",()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}})),Zr=Ir("week",()=>({$el:"tr",for:["week","weekIndex","$month.weeks"]})),Gr=Ir("dayCell",()=>({$el:"td",for:["day","dayIndex","$week"],attrs:{key:"$day",onClick:"$handlers.setDate($day)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($day)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(day)",tabindex:'$fns.sameDay($day) && "0" || "-1"',"data-is-extra":"$fns.notInMonth($month.monthDay, $day)","data-disabled":"$fns.isDisabled($day)","aria-selected":"$selectedWeek === $weekIndex && $selectedDay === $dayIndex","aria-label":'$fns.format($day, "long")'}})),Xr=Ir("day","div"),Jr=Ir("openButton",()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"div",role:"button",onClick:"$handlers.open",onKeydown:"$handlers.openKeydown",tabIndex:'$pickerOnly && "-1" || "0"',"data-disabled":"$disabled","aria-disabled":"$disabled","aria-label":'$value && ($ui.changeDate.value + ", " + $inputText) || $ui.chooseDate.value',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}})),Qr=Ir("years",()=>({if:'$panel === "year"',$el:"ul",attrs:{id:'$id + "_years"'}})),es=Ir("year",()=>({for:["year","yearIndex","$years"],$el:"li",attrs:{key:'$: "year" + $fns.format($year, "YYYY")',onClick:"$handlers.setDate($year)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($year)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(year)",tabindex:'$fns.sameYear($year) && "0" || "-1"',"aria-selected":"$selectedYear === $yearIndex","data-disabled":"$fns.isDisabledYear($year)","aria-label":"$fns.format($year, $yearFormat)"}})),ts=Ir("months",()=>({if:'$panel === "month"',$el:"ul"})),os=Ir("month",()=>({$el:"li",for:["month","index","$months"],attrs:{key:"$month",onClick:"$handlers.setDate($month)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($month)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(month)",tabindex:'$fns.sameMonth($month) && "0" || "-1"',"aria-selected":"$selectedMonth === $index","data-disabled":"$fns.isDisabledMonth($month)"}})),ns=Ir("panelHeader",()=>({$el:"header",attrs:{"aria-live":"polite"}})),rs=Ir("yearsHeader",()=>({$el:"div",if:'$panel === "year"'})),ss=Ir("monthsHeader",()=>({$el:"div",if:'$panel === "month"'})),as=Ir("daysHeader",()=>({$el:"div",if:'$panel === "day"'})),ls=Ir("timeHeader",()=>({$el:"div",if:'$panel === "time"'})),is=Ir("yearButton",()=>({$el:"button",attrs:{type:"button",id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"})),ps=Ir("monthButton",()=>({$el:"button",attrs:{type:"button",id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"})),ds=Ir("dayButton",()=>({$el:"button",attrs:{type:"button",id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"})),cs=Ir("removeSelection",()=>({$el:"button",if:"$clearable && $_value",attrs:{id:'$id + "_remove_selection"',type:"button",onClick:"$handlers.clear","aria-controls":"$id"}})),us=Ir("time",()=>({$el:"div",if:'$panel === "time"'})),fs=Ir("timeInput",()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown",spellcheck:"false",onBlur:"$handlers._blurOut(time)"}})),vs=Ir("panelClose",()=>({$el:"button",if:"$showPanelClose && ($inline === undefined || $inline === false)",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:-1,"aria-label":"$ui.close.value"}})),{overlayPlaceholder:hs,overlayLiteral:ms,overlayChar:gs,overlayEnum:$s,overlay:bs,overlayParts:ys,overlayInner:xs}=/* #__PURE__ */q(Ir),ws=Ir("panel","div"),_s=/* #__PURE__ */new WeakMap,ks=/* #__PURE__ */new WeakMap,Ss=new WeakSet,Ls=/* #__PURE__ */new WeakMap,Is=/* #__PURE__ */new WeakMap,Ds=new WeakSet,As=/* #__PURE__ */new WeakMap,Cs=/[\uD800-\uDBFF]/,Ts=/* #__PURE__ */new WeakMap,Es=/* #__PURE__ */new WeakMap,Os=/* #__PURE__ */new WeakMap,Ms=/* #__PURE__ */new WeakMap,Vs=/* #__PURE__ */new WeakMap,Fs=new WeakSet,Ps=/* #__PURE__ */new WeakMap,Bs=/* #__PURE__ */new WeakMap,Hs=/* #__PURE__ */new WeakMap,Rs=/* #__PURE__ */new WeakMap;let Ns=!1;const Ks=()=>{Ns=!0,setTimeout(()=>{Ns=!1},500)},Ws={"#":{type:"char",pattern:/\d/,token:"#",placeholder:"_",selectDirection:"right"},a:{type:"char",pattern:/[a-zA-Z]/,token:"a",placeholder:"_",selectDirection:"left"},h:{type:"char",pattern:/[0-9a-fA-F]/,token:"h",placeholder:"_",selectDirection:"left"},"*":{type:"char",pattern:/./,token:"*",placeholder:"_",selectDirection:"left"}},qs=/* #__PURE__ */new WeakMap,zs="undefined"!=typeof window;let Us=!1,Ys=!1;function js(){zs&&!Ys&&(Ys=!0,document.addEventListener("selectionchange",()=>{const e=ke();if(!(e instanceof HTMLInputElement))return;if(Rs.has(e))return function(e){const t=Rs.get(e);if(t){const[o,n]=t,[r,s]=Ea(e),a=s.indexOf(o);if(-1===a)return void Rs.delete(e);const l=r[a],i=[l[0]+n[0],l[1],"none"];aa(la(e),i)||fa(e,i)}}(e);if("select"!==As.get(e))return;const t=la(e);if(!aa(t,qs.get(e))){if(qs.set(e,t),Ss.has(e))return Ss.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:la(e)}))}}))}function Zs(e,t,o){var n;if(js(),_s.has(e))return;_s.set(e,[]),t.reverse&&Fs.add(e),t.prefix&&Ps.set(e,t.prefix),t.suffix&&Bs.set(e,t.suffix),ea(e,t.pattern,t.partOverrides,t.explicitParts);const r=Is.get(e),s=null==r?void 0:r.some(e=>na(e)),a=null==r?void 0:r.some(e=>function(e){return!!e&&("group"===e.type&&Array.isArray(e.parts))}(e));if(s&&a)throw new Error("Cannot use enums and groups in the same mask.");const l=s?"select":null!==(n=t.mode)&&void 0!==n?n:"shift";if(a&&"select"===l)throw new Error("Cannot use groups in select mode.");(t.placeholder||"select"===l)&&Ds.add(e),As.set(e,l),t.onChange&&Ms.set(e,t.onChange);let i=!1;e.addEventListener("beforeinput",o=>{if(Us)return;if("insertLineBreak"===o.inputType)return;if(o.inputType.startsWith("history"))return function(e,t){e.addEventListener("input",o=>{var n;o.preventDefault(),o.stopImmediatePropagation();const r=_s.get(e);if(null==r?void 0:r.length){const o=(null!==(n=ks.get(e))&&void 0!==n?n:r.length-1)+(t.endsWith("Undo")?-1:1),s=r[o];if(!s)return;va(e,s),e.setSelectionRange(...s.selectionAfter),ks.set(e,o),Ms.has(e)&&Ms.get(e)(s,e)}},{once:!0})}(e,o.inputType);o.preventDefault(),i=!0;const n=(r=o.inputType).startsWith("insert")?"insert":!!r.startsWith("delete")&&("deleteContentForward"===r?"deleteContentForward":"deleteContentBackward");var r;const s=la(e),a=e.value;n&&ia(e,{type:n,selectionBefore:s,data:o.data,valueBefore:a,suffix:t.suffix,prefix:t.prefix})}),e.addEventListener("input",t=>{i=!1,"data"in t||!i&&o&&(o.input(e.value,!1),o.props._maskValue=e.value)}),"select"===l&&e.addEventListener("keydown",t=>{switch(t.key){case"ArrowRight":return t.preventDefault(),Pa(e);case"ArrowLeft":return t.preventDefault(),Pa(e,-1);case"ArrowUp":return void(Ba(e,1)&&t.preventDefault());case"ArrowDown":return void(Ba(e,-1)&&t.preventDefault());case"Tab":return Ns?void t.preventDefault():void(Pa(e,t.shiftKey?-1:1)&&t.preventDefault())}}),e.addEventListener("focus",()=>function(e){var t;const o=Ds.has(e),n=As.get(e);if(o){let o=null,r=null,s=!1;const a="shift"===n?0:1,l=e.value;ka(e,{type:"insert",data:l,selectionBefore:[0,0,"none"],valueBefore:l},"shift"===n?"":l,(e,t)=>(null===o&&"char"===t.type&&(o=e.pos-a),(oa(t)||na(t))&&e.value.endsWith(t.placeholder)?(r=e.pos-a,!1):("char"===t.type&&(s=!0),!0)));const i=null!==(t=null!=r?r:s?l.length:o)&&void 0!==t?t:null;if(null!==i){let t=[i,i,"none"];if("select"===As.get(e)){const[o]=Ea(e),n=Ra(e,t);void 0!==n&&n in o&&(t=o[n])}return function(e,t,o=50){Ts.set(e,da(e,t));const n=async()=>{if(!zs||ke()!==e)return;"select"===As.get(e)&&(await new Promise(e=>setTimeout(e,10)),function(e){let t=la(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=ca(e,t);const[o]=Ea(e),n=Ra(e,t),r=t[0];void 0!==n&&o.some(e=>r>=e[0]&&r<e[1])&&Ts.set(e,da(e,o[n]))}(e));const t=Ts.get(e);t&&e.setSelectionRange(...t)};n(),document.addEventListener("selectionchange",n),setTimeout(()=>{document.removeEventListener("selectionchange",n),Ts.delete(e)},o)}(e,t)}}}(e)),e.addEventListener("selection",t=>function(e,t){if(Ts.get(e))return;za(e),t=ca(e,t);const[o]=Ea(e),n=Ra(e,t),r=void 0!==n&&da(e,o[n]);r&&!aa(t,r)&&fa(e,r,!0)}(e,t.detail)),ia(e,{type:"insert",selectionBefore:[0,0,"forward"],data:e.value,valueBefore:"",suffix:t.suffix,prefix:t.prefix})}function Gs(e){var t,o;if(Rs.has(e))return;const n=null!==(t=_s.get(e))&&void 0!==t?t:[],r=n[null!==(o=ks.get(e))&&void 0!==o?o:n.length-1];if(r){const t=r.selectionAfter,[o,n]=Ea(e,r.valueAfter),s=Ra(e,t,[o,n]);if(void 0!==s&&s in o){const r=n[s],a=o[s],l=[t[0]-a[0],t[1]-a[0],"none"];Rs.set(e,[r,l])}}}function Xs(e){Rs.delete(e)}function Js(e,t,o){const n="string"==typeof e||!_s.has(e),r="string"==typeof e?Qs(e):e;if(n)t.prefix&&Ps.set(r,t.prefix),t.suffix&&Bs.set(r,t.suffix),r.value=pa(r,r.value),Zs(r,t,o);else{const e=Na(r),o=r.value;r.value="",ia(r,{type:"insert",selectionBefore:[0,e?e.valueAfter.length:0,"none"],valueBefore:e?e.valueAfter:"",data:o,suffix:t.suffix,prefix:t.prefix})}return r.value}function Qs(e){return{value:e,selectionStart:0,selectionEnd:0,scrollWidth:0,clientWidth:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function ea(e,t,o,n,r){r=e&&Fs.has(e)||r;const s=(null!=n?n:function(e){const t=Object.values(Ws);if(!e)return t;const o={...e},n=[];for(const r of t)if(!sa(r)){if("token"in r&&r.token in e){const t={...r,...e[r.token]};ta(t)&&n.push(t),delete o[r.token];continue}n.push(r)}const r=Object.values(o);for(const e of r)ta(e)?n.push(e):console.warn(`Invalid ${e.type} token`,e);return n}(o)).sort((e,t)=>{const o="token"in e?e.token.length:-1,n="token"in t?t.token.length:-1;return o===n?0:o>n?-1:1});let a=[];[t,a]=function(e,t,o,n){let r,s=0,a="",l="",i="";const p=[];for(;a=ha(e);)a===t&&r!==n?(s++,s>1&&(i+=a)):a===o&&s&&r!==n?(s--,0===s?(l+=`{$${p.length}}`,p.push(i),i=""):i+=a):s?i+=a:r!==n||a!==t&&a!==o?l+=a:l=`${l.substring(0,l.length-1)}${a}`,r=a,e=e.substring(a.length);return[l,p]}(t,"{","}","\\");const l=a.length;t=s.reduce((e,t,o)=>"token"in t?e.replaceAll(`\\${t.token}`,"{“!”}").replaceAll(t.token,`{$${l+o}}`).replaceAll("{“!”}",t.token):e,t);const i=function(e,t,o){return e.reduce((e,n)=>{const[r,s]=function(e){const[t,...o]=e.split("|"),n=o.reduce((e,t)=>{const[o,n=!0]=t.split(":");return Object.assign(e,{[o]:n})},{});return[t,n]}(n);let a=ea(null,r,void 0,t,o);a=a.map(e=>{const t={...e};if("char"===t.type&&s.placeholder)t.placeholder=s.placeholder;else if("enum"===t.type)throw new Error("Groups cannot contain enums.");return t});const l={type:"group",parts:a,...s};return e.push(l),e},[])}(a,s,r).concat(s),p=/\{\$\d+\}/g,d=t.match(p),c=t.split(p).reduce((e,t,o)=>{if(t&&(t=t.replaceAll("\\",""),e.push({type:"literal",value:r?[...t].reverse().join(""):t})),d&&d[o]){const t=d[o],n=Number(t.substring(2,t.length-1));!isNaN(n)&&i[n]&&e.push(i[n])}return e},[]);return r&&c.reverse(),e&&Is.set(e,c),c}function ta(e){return!!e&&(sa(e)||oa(e)||na(e))}function oa(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&ra(e))}function na(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&ra(e))}function ra(e){return!!e&&("placeholder"in e&&"token"in e)}function sa(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function aa(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function la(e){var t,o;return[null!==(t=e.selectionStart)&&void 0!==t?t:e.value.length,null!==(o=e.selectionEnd)&&void 0!==o?o:e.value.length,"none"]}function ia(e,t){var o;Fs.has(e)&&qa(t);let n=!1;switch(Vs.set(e,"playing"),t.type){case"insert":n=function(e,t){let o=ua(t);const n=t.selectionBefore,r=function(e,t){var o,n,r;if("select"===As.get(e)){const[s,a]=Ea(e),l=s.findIndex(e=>aa(e,t.selectionBefore)),i=null!==(o=a[l])&&void 0!==o?o:null;if(oa(i)){const e=t.selectionBefore,o=e[1]-e[0],s=t.valueBefore.substring(e[0],e[1]),a="left"===i.selectDirection,l=wa(s,i),p=a?0:function(e,t,o){if(!e)return 0;let n="";for(;e.length;){const o=ha(e);e=e.substring(o.length),t.pattern.test(o)&&(n+=o)}return Math.min(Math.max(n.length,1),o)}(t.data,i,o);if(l.length>=o)return a||(t.insertPos=e[1]-p),(null!==(n=i.selectFill)&&void 0!==n?n:i.placeholder).repeat(o);const d=(null!==(r=i.selectFill)&&void 0!==r?r:i.placeholder).repeat(o-l.length-(a?0:p));return t.insertPos=a?e[0]+l.length:e[1]-p,"left"===i.selectDirection?`${l}${d}`:`${d}${l}${i.placeholder}`}if(na(i)){const e=t.selectionBefore;return t.valueBefore.substring(e[0],e[1])}}return""}(e,t);o=`${o.substring(0,n[0])}${r}${o.substring(n[1])}`;const s=ka(e,t,o);return Ls.set(e,s.endPos),{...t,valueAfter:s.value,selectionAfter:_a(e,s),unmasked:s.unmasked,complete:s.complete,meta:s.meta}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":n=function(e,t){const o=ua(t),n=t.selectionBefore,r=Fs.has(e);let s=n[0],a=n[1];s===a&&("deleteContentBackward"!==t.type||r?a+=ma(o,s):s-=ma(o,s,"backward"));const l=As.get(e);let i="";if("select"===l){const[o,n]=Ea(e),r=Ra(e,[s,a,"none"]);if(void 0!==r){const l=n[r],p=o[r];oa(l)?i=l.placeholder.repeat(a-s):na(l)&&([i,s]=aa(p,la(e))?[l.placeholder,s]:function(e,t,o,n){const r=n.valueBefore,s=ma(r,n.selectionBefore[0],"backward"),a=Math.max(o[0],n.selectionBefore[0]-s),l=r.substring(o[0],a),i=Ma(t.values,l);let p=null==i?void 0:i.substring(l.length);i&&!p&&Va(t.values,i)&&(p=i);return[null!=p?p:t.placeholder,p?a:o[0]]}(0,l,p,t))}}const p=`${o.substring(0,s)}${i}${o.substring(a)}`,d=ka(e,t,p);return{...t,valueAfter:d.value,selectionAfter:Aa(e,d,t,s),unmasked:d.unmasked,complete:d.complete,meta:d.meta}}(e,t)}if(Fs.has(e)&&n&&qa(n),n&&function(e,t){t.prefix&&(t.valueAfter=t.prefix+t.valueAfter,t.selectionAfter=da(e,t.selectionAfter));t.suffix&&(t.valueAfter+=t.suffix)}(e,n),n&&function(e){return e.valueBefore!==e.valueAfter||e.selectionBefore[0]!==e.selectionAfter[0]||e.selectionBefore[1]!==e.selectionAfter[1]}(n)){Ms.has(e)&&Hs.set(e,()=>{Hs.delete(e),n&&Ms.get(e)(n,e)}),Vs.set(e,"beforeCallback");let t=null!==(o=_s.get(e))&&void 0!==o?o:[];const r=ks.get(e);r&&(t=t.slice(0,r),ks.delete(e)),t.push(n),_s.set(e,t),zs&&ke()===e&&"function"==typeof document.execCommand&&!Us?(fa(e,[0,e.value.length,"forward"],!0),Us=!0,document.execCommand("insertText",void 0,n.valueAfter),Us=!1):va(e,n),zs&&ke()===e&&fa(e,n.selectionAfter);const s=Hs.get(e);s&&s(),za(e)}Vs.set(e,"complete")}function pa(e,t){var o,n;const r=null!==(o=Ps.get(e))&&void 0!==o?o:"",s=null!==(n=Bs.get(e))&&void 0!==n?n:"";return r&&t.startsWith(r)&&(t=t.substring(r.length)),s&&t.endsWith(s)&&(t=t.substring(0,t.length-s.length)),t}function da(e,t){const o=Ps.get(e),n=[...t];return o&&(n[0]+=o.length,n[1]+=o.length),n}function ca(e,t){const o=Ps.get(e),n=[...t];return o&&(n[0]-=o.length,n[1]-=o.length),n}function ua(e){let t=e.valueBefore;const o=e.selectionBefore;if(e.suffix&&t.endsWith(e.suffix)&&(t=t.substring(0,t.length-e.suffix.length),e.valueBefore=t,o[0]>=t.length&&(o[0]=t.length),o[1]>=t.length&&(o[1]=t.length)),e.prefix&&t.startsWith(e.prefix)){const n=e.prefix.length;t=t.substring(n),e.valueBefore=t,o[0]=Math.max(o[0]-n,0),o[1]=Math.max(o[1]-n,0)}return t}function fa(e,t,o=!1){o&&(Ss.add(e),setTimeout(()=>Ss.delete(e),5)),Ts.get(e)&&Ts.set(e,t),e.setSelectionRange(...t)}function va(e,t,o="After"){if(e.value=t[`value${o}`],zs){const o=new InputEvent("input",{inputType:"insert"===t.type?"insertText":t.type,data:t.data});e.dispatchEvent(o)}}function ha(e){if(null==e)return"";const t=Cs.test(e.charAt(0))&&Cs.test(e.charAt(1))?2:1;return e.substring(0,t)}function ma(e,t,o="forward"){if("backward"===o)return 0===t?0:1===t?1:Cs.test(e.charAt(t))&&Cs.test(e.charAt(t-1))?2:1;const n=e.length-t;return 0===n?0:1===n?1:ha(e.substring(t)).length}function ga(e,t){const o=ha(e.data),n=o.length;if(e.value+=o,e.pos+=n,"string"==typeof e.data&&(e.data=e.data.substring(n),e.data.length||(e.endPos=e.pos)),t)return t.substring(n)}function $a(e){const t=ha(e.buffer),o=t.length;e.value+=t,e.pos+=o,e.buffer=e.buffer.substring(o)}function ba(e,t){const o=ha(t),n=o.length;return e.value+=o,e.pos+=n,t.substring(n)}function ya(e,t){for(;t.buffer;){const o=ha(t.buffer);if(e.pattern.test(o)||t.placeholder&&e.placeholder===o)return void("replace"!==t.mode&&"select"!==t.mode||(t.buffer=t.buffer.substring(o.length)));t.buffer=t.buffer.substring(o.length)}}function xa(e,t){const o=e.values.concat([e.placeholder]).map(e=>e.toLowerCase()).sort((e,t)=>e.length>t.length?-1:1);for(;t.buffer;){const e=t.buffer.toLowerCase(),n=o.find(t=>e.startsWith(t));if(n){const e=t.buffer.substring(0,n.length);return t.buffer=t.buffer.substring(n.length),e}t.buffer=t.buffer.substring(ma(t.buffer,0))}return null}function wa(e,t){let o=e.replaceAll(t.placeholder,"");const n="left"===t.selectDirection;if(t.selectFill){const e=new RegExp(`${n?"":"^"}${r=t.selectFill,r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}+${n?"$":""}`);o=o.replace(e,"")}var r;return o}function _a(e,t){let o=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return o;const n=la(e);o=[n[0],t.endPos,"none"];const[r,s]=Ea(e,t.value),a=Ra(e,o,[r,s]);if(void 0===a)return o;if(!(a in r)||!(a in s))return o;const l=r[a],i=s[a],p=t.value.slice(l[0],l[1]);if(oa(i)&&wa(p,i).length===p.length&&a<r.length-1)return Ks(),r[a+1];if(na(i)&&t.insertPos>=l[0]&&t.insertPos<=l[1]){if(t.cycle)return l;const o=function(e,t,o){if(null===e.originalData)return 0;const n=e.insertPos>=t?e.value.substring(t,e.insertPos):"",r=`${n}${e.originalData}`,s=Ma(o.values,r);if(s)return Ta(r,s).length-n.length;return 0}(t,l[0],i);if(t.insertPos+o===l[1])return Va(i.values,p)?[l[1],l[1],"forward"]:(Ks(),r[a+1]?r[a+1]:r[a]);const s=[t.insertPos+o,l[1],"none"];return aa(s,n)||(Ss.add(e),setTimeout(()=>Ss.delete(e),5)),s}return l}function ka(e,t,o,n){var r,s;const a=null!==(r=Is.get(e))&&void 0!==r?r:[],l={pos:0,insertPos:null!==(s=t.insertPos)&&void 0!==s?s:t.selectionBefore[0],range:t.selectionBefore,chars:0,placeholder:Ds.has(e),buffer:o,data:t.data,originalData:t.data,value:"",mode:As.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:Ea(e),unmasked:"",complete:!0,cycle:t.cycle,meta:[]};return Sa(a,l,void 0,n),l}function Sa(e,t,o,n){var r,s;const a={...t};(null==o?void 0:o.placeholder)&&(t.placeholder=!0);const l=(null==o?void 0:o.repeat)&&"literal"===(null===(r=o.nextPart)||void 0===r?void 0:r.type)?o.nextPart.value:null;let i=0;const p=e.reduce((e,t)=>e+("char"===t.type?1:0),0),d=t.chars;for(const o of e){const r=e[i+1];switch(o.type){case"literal":Ia(o,t,e.at(-1)===o);break;case"char":Da(o,t,l);break;case"enum":La(o,t);break;case"group":const a={repeat:null!==(s=o.repeat)&&void 0!==s&&s,nextPart:r,repeats:0,placeholder:!!o.placeholder};Sa(o.parts,t,a,n)}if(n){if(!1===n(t,o))break}const a=sa(r)&&i+2===e.length&&d!==t.chars;if(!(t.buffer||t.data||t.placeholder||a))break;i++}if(t.chars<p&&(t.complete=!1),o){const r=t.chars-d,s=r===p,i=!(!t.data||l&&t.data.startsWith(l)&&t.insertPos<=t.pos),c=!(t.buffer&&l&&t.buffer.startsWith(l)&&t.insertPos>=t.pos+l.length)&&(t.buffer||i);if(o.repeat&&c&&s)return o.repeats++,Sa(e,t,o,n);if(!s){t.complete=!1;const o=e.reverse().find(e=>"literal"===e.type);e.reverse(),sa(o)&&t.value.endsWith(o.value)&&(t.value=t.value.substring(0,t.value.length-o.value.length),t.pos=t.value.length)}p>1&&r<p&&0!==r&&t.insertPos<=t.pos?t.data="":o.repeat&&!s&&o.repeats&&Object.assign(t,a)}t.placeholder=a.placeholder}function La(e,t){const[o,n]=t.rangeParts,r=o[n.indexOf(e)];if(r&&(t.insertPos<=t.pos||t.insertPos>=r[0]&&t.insertPos<=r[1])&&t.data){const o=t.buffer.substring(0,t.insertPos-t.pos),n=`${o}${t.data}`,r=Ma(e.values.concat([e.placeholder]),n);if(r){const s=Ta(n,r);return t.data=t.data.substring(s.length),t.value+=r,r!==e.placeholder?t.unmasked+=r:t.complete=!1,t.meta.push({type:r!==e.placeholder?"enum":"placeholder",value:r}),o?t.buffer=t.buffer.substring(o.length):xa(e,t),t.endPos=t.pos+s.length,void(t.pos=t.value.length)}t.data=""}if(t.buffer){const o=xa(e,t);if(o)return t.value+=o,o!==e.placeholder?t.unmasked+=o:t.complete=!1,t.meta.push({type:o!==e.placeholder?"enum":"placeholder",value:o}),void(t.pos=t.value.length)}t.complete=!1,t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder}),t.pos=t.value.length}function Ia(e,t,o){let n=e.value;if(""===t.data&&!t.buffer&&!t.placeholder&&!o)return;let r=!1;for(;n;){const e=t.insertPos<=t.pos?ha(t.data):"",s=ha(n);if(e===s)n=ga(t,n),t.meta.push({type:"literal",value:s}),r=!0;else if(!r||t.data||null===t.data||t.placeholder||o)n=ba(t,n),t.meta.push({type:"literal",value:s});else if(r&&!t.data)break;t.buffer.startsWith(s)&&(t.buffer=t.buffer.substring(s.length))}null===t.data&&!t.buffer&&t.insertPos<=t.pos&&!t.placeholder&&(t.value=t.value.substring(0,t.value.length-e.value.length),t.pos=t.endPos=t.value.length)}function Da(e,t,o){var n;let r=!0;if(t.insertPos<=t.pos)for(;null===(n=t.data)||void 0===n?void 0:n.length;){const n=ha(t.data);if(e.pattern.test(n))return ga(t),t.meta.push({type:"char",value:n}),t.chars++,t.unmasked+=n,void ya(e,t);if("string"==typeof t.data){if(o&&t.data.startsWith(o)){r=!1;break}t.data=t.data.substring(n.length)}}for(;r&&t.buffer;){const n=ha(t.buffer);if(e.pattern.test(n))return t.chars++,t.unmasked+=n,$a(t),void t.meta.push({type:"char",value:n});if(t.placeholder&&n===e.placeholder)return $a(t),void t.meta.push({type:"placeholder",value:n});if("string"==typeof t.buffer){if(o&&t.buffer.startsWith(o)){t.buffer=t.buffer.substring(o.length);break}t.buffer=t.buffer.substring(n.length)}}t.placeholder?(t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder})):t.endPos=t.pos}function Aa(e,t,o,n){const r=[n,n,"none"];if("select"===t.mode){const s=Ea(e),a=Ra(e,r,s),[l,i]=Ea(e,t.value),p=void 0!==a&&Ca(o.valueBefore,s[0][a],s[1][a]);if(void 0!==a&&a in l){if(p){const e=l.slice(a).every((e,o)=>Ca(t.value,e,i[a+o]));return e&&l[a-1]?l[a-1]:l[a]}return[n,l[a][1],"none"]}}return r}function Ca(e,t,o){if(sa(o))return!1;if(oa(o)){let n=t[0];for(;n<t[1];){const t=ha(e.substring(n));if(t!==o.placeholder)return!1;n+=t.length}}return!na(o)||e.substring(t[0],t[1])===o.placeholder}function Ta(e,t){let o="";do{const n=ha(e).toLowerCase(),r=ha(t).toLowerCase();if(n!==r)break;o+=n,e=e.substring(n.length),t=t.substring(r.length)}while(e.length&&t.length);return o}function Ea(e,t){const o=Is.get(e);if(!o)return[[],[]];if(Es.has(e))return Es.get(e);const n=null!=t?t:pa(e,e.value),r=[],s=[];let a=null,l=null,i=0,p=!0;for(const e of o)if(sa(e))a=e,null!==l&&(r.push([l,i,"none"]),l=null),i+=e.value.length;else{if(oa(a)&&oa(e)&&e.token===a.token)i++;else if(oa(e))null===l?(l=i,s.push(e)):(r.push([l,i,"none"]),l=i,s.push(e)),i++;else if(na(e)){l&&r.push([l,i,"none"]),Fa(e)||(p=!1);const t=Oa(n,e,i);l=null,r.push([i,i+t,"none"]),s.push(e),i+=t}a=e}null!==l&&r.push([l,i,"none"]);const d=[[...r],[...s]];return p&&!t&&Es.set(e,d),d}function Oa(e,t,o){if(Fa(t))return t.values[0].length;const n=e.slice(o),r=Ma(t.values.concat([t.placeholder]),n);return r?r.length:0}function Ma(e,t,o=null,n){var r;if(0===t.length)return o;if(!n){const o=e.find(e=>e.toLowerCase()===t.toLowerCase());if(o)return o}const s=ha(t.toLowerCase()),a=`${null!=n?n:""}${s}`,l=e.filter(e=>e.toLowerCase().startsWith(a)),i=l.find(e=>e.toLowerCase()===a);return i&&(o=i),0===l.length?o:1===l.length?l[0]:(l.length>1&&(o=l[0]),null!==(r=Ma(l,t.substring(s.length),o,a))&&void 0!==r?r:l[0])}function Va(e,t){return t=t.toLowerCase(),e.some(e=>(e=e.toLowerCase()).startsWith(t.toLocaleLowerCase())&&e!==t)}function Fa(e){if(!Os.has(e)&&Array.isArray(e.values)&&e.values.length>0){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;Os.set(e,e.values.every(e=>e.length===t))}return Os.get(e)}function Pa(e,t=1){const[o]=Ea(e),n=Ra(e,ca(e,la(e)));return void 0!==n&&void 0!==o[n+t]&&(e.setSelectionRange(...da(e,o[n+t])),!0)}function Ba(e,t=1){const[o,n]=Ea(e),r=Ra(e,la(e));if(void 0!==r&&r in n){const s=n[r];if(na(s)){const n=o[r],a=e.value.slice(n[0],n[1]);let l=null,i=s.values.indexOf(a);const p=s.values.length-1;if(-1!==i){const e=i+t;i=e<0?p:e>p?0:e,l=s.values[i]}else a===s.placeholder&&(l=t>0?s.values[0]:s.values[p]);if(null!==l){const t={selectionBefore:n,insertPos:n[0],type:"insert",data:l,valueBefore:e.value,cycle:!0};return setTimeout(()=>ia(e,t),0),!0}}}return!1}function Ha(e,t){if(!e.length)return-1;if(1===e.length)return e[0];const o=e.length/2,n=Number.isInteger(o)?o:Math.floor(o),r=Math.abs(t-e[n-1])<Math.abs(t-e[n])?[0,n]:[n];return Ha(e.slice(...r),t)}function Ra(e,t,o){const[n]=null!=o?o:Ea(e),r=n.findIndex(e=>e[0]!==e[1]&&(!!aa(e,t)||t[1]>e[0]&&t[1]<e[1]));if(-1!==r)return r;const[s,a]=n.reduce((e,t,o)=>(e[0].add(t[0]),e[0].add(t[1]),e[1][t[0]]=o,e[1][t[1]]=o,e),[new Set,{}]),l=Ha([...s],0===t[0]&&t[1]===e.value.length?0:t[1]);return l in a?a[l]:void 0}function Na(e){var t,o;const n=null!==(t=_s.get(e))&&void 0!==t?t:[];return n[null!==(o=ks.get(e))&&void 0!==o?o:n.length-1]}function Ka(e,t=!1){const o=Na(e);return o&&(o.complete||t)?Fs.has(e)?[...o.unmasked].reverse().join(""):o.unmasked:t?"":null}function Wa(e){var t;const o=Na(e);return null!==(t=null==o?void 0:o.meta)&&void 0!==t?t:null}function qa(e){const t=e=>[...e].reverse().join(""),o=(e,t)=>[t-e[1],t-e[0],e[2]];e.data&&(e.data=t(e.data)),e.valueBefore=t(e.valueBefore),"valueAfter"in e&&(e.valueAfter=t(e.valueAfter)),"selectionAfter"in e&&(e.selectionAfter=o(e.selectionBefore,e.valueAfter.length)),e.selectionBefore=o(e.selectionBefore,e.valueBefore.length)}function za(e){if(e.scrollWidth>e.clientWidth&&null!==e.selectionStart&&null!==e.selectionEnd){const t=e.selectionStart/e.value.length,o=e.selectionEnd/e.value.length;e.scrollLeft=o>.9?e.scrollWidth:t*e.scrollWidth-20,e.dispatchEvent(new CustomEvent("input-scroll",{bubbles:!1,detail:e.scrollLeft}))}}const Ua="undefined"!=typeof window,Ya=new WeakSet,ja=new WeakSet,Za=new WeakSet,Ga=new WeakMap,Xa=new WeakMap,Ja=new WeakSet,Qa=new WeakSet;function el(e){e.props.selectedMonth=e.props.selectedYear=e.props.selectedDay=e.props.selectedWeek=void 0}function tl(e){var t,o,n;e.props.selectedMonth=e.props.months.findIndex(t=>rl(t,e.props.activeDate)),e.props.selectedYear=e.props.years.findIndex(t=>nl(t,e.props.activeDate));for(let s=0;s<(null===(t=e.props.calendar[0])||void 0===t?void 0:t.weeks.length);s++)for(let t=0;t<(null===(o=e.props.calendar[0])||void 0===o?void 0:o.weeks[s].length);t++){const o=null===(n=e.props.calendar[0])||void 0===n?void 0:n.weeks[s][t];if(r.sameDay(o,e.props.activeDate)){e.props.selectedWeek=s,e.props.selectedDay=t;break}}}function ol(e){return"timeZoneName"!==e.partName}function nl(e,t){return t instanceof Date&&e.getFullYear()===t.getFullYear()}function rl(e,t){return t instanceof Date&&e.getMonth()===t.getMonth()}function sl(e){e.props.skipBuildCalendar||el(e),e.props.selectedIndex=e.props.calendar=_(e.props.showMonths,e=>e).map(t=>function(e,t){const o=[],n=r.date(t);n.setDate(1);let s=r.weekStart(n,e.props.weekStart);s.setHours(n.getHours(),n.getMinutes(),n.getSeconds());const a=r.weekEnd(r.monthEnd(t),e.props.weekStart);let l=[];do{l.push(s),7===l.length&&(o.push(l),l=[]),s=r.addDay(s)}while(s.getTime()<=a.getTime());return{monthDay:n,weeks:o}}(e,r.addMonth(e.props.renderedDate,t))),e.props.years=function(e){const t=Number(r.format(e.props.renderedDate,"YYYY")),o=t-t%10;return e.props.decade=`${o} - ${o+9}`,_(10,n=>r.addYear(e.props.renderedDate,o+n-t))}(e),e.props.months=function(e){const t=r.date(e.props.renderedDate);return t.setMonth(0),_(12,e=>r.addMonth(t,e))}(e),e.props.skipBuildCalendar?e.props.skipBuildCalendar=!1:e.value&&tl(e)}function al(e,t){var o;t.target&&t.target instanceof Element&&(t.target.closest(`#${e.props.id}_popover`)||!(null===(o=e.props.__root)||void 0===o?void 0:o.contains(t.target)))||(e.props.expanded=!1)}function ll(e,t){if(!t)return e.props.inputText="",new Date;const o=t instanceof Date?t:r.parse(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(o,e.props.format,e.props.locale,!1,ol),o}function il(t){return Array.isArray(t.props.sequence)?e.clone(t.props.sequence):["day"]}function pl(e,t,o=!0){var n,s;if(e._value===t)return;if(null==t)return e.input(t,o);e.props.offset=e.props.timezone?r.offset(t,e.props.timezone):"+0000";const a=r.applyOffset(t,null!==(n=(s=e.props).offset)&&void 0!==n?n:s.offset="+0000");e.input(r.format(a,e.props.valueFormat,e.props.valueLocale,!1),o)}function dl(e,t){var o;const n=["prev_button","month_button","day_button","year_button","next_button"].find(t=>{var o;return null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${t}`)}),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${n}`);r instanceof HTMLElement&&(t.preventDefault(),r.focus())}function cl(e,t){let o="";if(!(t instanceof HTMLInputElement)||e.props.pickerOnly)return;Ga.set(e,t);const n=t=>{e.props.expanded&&t.target instanceof HTMLElement&&t.target.closest(`#${e.props.id}_popover`)?Qa.add(e):Qa.delete(e)},s=e.props.__root;s&&(s.addEventListener("click",n),De(e,()=>s.removeEventListener("click",n))),e.on("prop:inputText",({payload:e})=>{e!==t.value&&("beforeCallback"===Vs.get(t)&&(o=t.value),Gs(t),t.selectionStart=0,t.selectionEnd=t.value.length,function(e,t){var o,n;if(!_s.has(e))return;const r=null!==(o=Ps.get(e))&&void 0!==o?o:"",s=null!==(n=Bs.get(e))&&void 0!==n?n:"";ia(e,{type:"insert",selectionBefore:la(e),data:t,valueBefore:e.value,suffix:s,prefix:r})}(t,e),t.value=e,setTimeout(()=>Xs(t),10))});const[a,l]=function(e){const t=e.props.locale,o=["full","long","medium","short"].includes(e.props.format)||"object"==typeof e.props.format,n=r.parts(e.props.format,t),s=r.formatStr(e.props.format,t,!0,ol);return[s,n.reduce((n,s)=>{if("literal"===s.partName)return n;let a=r.range(s.token,t,o);if("YYYY"===s.token&&e.props.minDate&&e.props.maxDate){const t=e.props.minDate.getFullYear();a=_(e.props.maxDate.getFullYear()-t+1,e=>String(t+e))}const l={type:"enum",token:s.token,values:a,placeholder:"A"===s.token?"A/P":s.token,selectDirection:"left"};return n.push(l),s.token.startsWith("D")&&Xa.set(e,a),n},[])]}(e);Zs(t,{pattern:a,explicitParts:l,onChange:({valueAfter:n})=>{if(ul(e),Ya.has(e))return Ya.delete(e);o&&o===n?o="":(Gs(t),e.props.inputText=n,setTimeout(()=>Xs(t),10))}},e)}function ul(e){var t,o;if(e.props.overlay){const n=Ga.get(e);!n||!(null===(t=e.props.attrs)||void 0===t?void 0:t.placeholder)||e._value||Ka(n,!0)||e.props._isFocused||e.props.activeDate&&e.props.expanded?n&&(e.props._isPlaceholder=!1,e.props._overlayParts=_e(Wa(n))):(e.props._isPlaceholder=!0,e.props._overlayParts=[{type:"placeholder",value:null===(o=e.props.attrs)||void 0===o?void 0:o.placeholder}])}}function fl(e,t){return!t||(!(!e.props.minDate||!r.isBefore(t,e.props.minDate))||(!(!e.props.maxDate||!r.isAfter(t,e.props.maxDate))||void 0))}function vl(e){return"function"==typeof e.props.validationLabel?e.props.validationLabel(e):e.props.validationLabel||e.props.label||e.props.name||String(e.name)}const hl="undefined"!=typeof window,ml=new WeakMap;function gl(e,t){var o,n;if(t instanceof HTMLInputElement&&!ml.get(e)&&hl){const r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_overlay`),s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_overlay_inner`);if(r&&t&&s){ml.set(e,r);const o=getComputedStyle(t).color;t.style.color="transparent",t.style.caretColor=o;const n=new ResizeObserver(()=>{var o;const n=getComputedStyle(t),r=t.getBoundingClientRect(),s=null===(o=t.parentElement)||void 0===o?void 0:o.getBoundingClientRect();e.props._overlayStyles={...e.props._overlayStyles,width:n.width,height:n.height,boxSizing:n.boxSizing,padding:n.padding,margin:n.margin,fontSize:n.fontSize,lineHeight:n.lineHeight,top:r.top-((null==s?void 0:s.top)||r.top)+"px",left:r.left-((null==s?void 0:s.left)||r.left)+"px"}});n.observe(t);const a=e=>{s.scrollLeft=e.detail};t.addEventListener("input-scroll",a),e.on("destroyed",()=>{t.removeEventListener("input-scroll",a),n.disconnect()})}}}function $l(t){t.addProps(["_overlayStyles","_overlayParts","_overlayInnerStyles","_isPlaceholder"]),t.props._overlayParts=[],t.props._overlayStyles={position:"absolute",top:"0",left:"0",pointerEvents:t.props._isPlaceholder?"auto":"none"},t.props._overlayInnerStyles={overflow:"hidden",whiteSpace:"nowrap",paddingRight:"20px"},t.on("created",()=>{t.props.overlay=e.undefine(t.props.overlay),t.props.pickerOnly=e.undefine(t.props.pickerOnly),t.props.overlay=t.props.pickerOnly?void 0:t.props.overlay,t.props.overlay&&e.whenAvailable(`${t.props.id}`,gl.bind(null,t),t.props.__root)}),t.on("prop:_isPlaceholder",()=>{t.props._overlayStyles={...t.props._overlayStyles,pointerEvents:t.props._isPlaceholder?"auto":"none"}})}const bl={schema:/* #__PURE__ */Dr(/* #__PURE__ */Ar(/* #__PURE__ */Er("$label"),/* #__PURE__ */Cr(/* #__PURE__ */Tr("prefix"),/* #__PURE__ */Or(),/* #__PURE__ */bs(/* #__PURE__ */xs(/* #__PURE__ */ys(/* #__PURE__ */hs("$part.value"),/* #__PURE__ */ms("$part.value"),/* #__PURE__ */gs("$part.value"),/* #__PURE__ */$s("$part.value")))),/* #__PURE__ */Br(),/* #__PURE__ */Hr(/* #__PURE__ */ns(/* #__PURE__ */Kr(/* #__PURE__ */Wr("$ui.prev.value"),/* #__PURE__ */Tr("prev")),/* #__PURE__ */rs("$decade"),/* #__PURE__ */ss(/* #__PURE__ */is()),/* #__PURE__ */as(/* #__PURE__ */ps(),/* #__PURE__ */is()),/* #__PURE__ */ls(/* #__PURE__ */ps(),/* #__PURE__ */ds(),/* #__PURE__ */is()),/* #__PURE__ */Rr(/* #__PURE__ */Nr("$ui.next.value"),/* #__PURE__ */Tr("next")),/* #__PURE__ */vs(/* #__PURE__ */Tr("close"))),/* #__PURE__ */ws(/* #__PURE__ */Qr(/* #__PURE__ */es("$fns.format($year, $yearFormat)")),/* #__PURE__ */ts(/* #__PURE__ */os("$fns.format($month, $monthFormat)")),/* #__PURE__ */qr(/* #__PURE__ */Ur(/* #__PURE__ */Yr(/* #__PURE__ */jr("$fns.format($day, $weekdayFormat)"))),/* #__PURE__ */zr(/* #__PURE__ */Zr(/* #__PURE__ */Gr(/* #__PURE__ */Xr("$fns.format($day, $dateFormat)"))))),/* #__PURE__ */us(/* #__PURE__ */fs()))),/* #__PURE__ */cs(/* #__PURE__ */Tr("clear")),/* #__PURE__ */Jr(/* #__PURE__ */Tr("calendar")),/* #__PURE__ */Mr(),/* #__PURE__ */Tr("suffix"))),/* #__PURE__ */Vr("$help"),/* #__PURE__ */Fr(/* #__PURE__ */Pr("$message.value"))),type:"input",family:"text",props:["dateFormat","dayButtonFormat","format","monthButtonFormat","monthFormat","overlay","pickerOnly","showMonths","showPagination","weekStart","weekdayFormat","yearFormat","years"],features:[$l,function(o){var n,s,a,l,i,p,d,c,u,f,v,h,m,g,$,b,y,x,w,k,S,L;o.addProps(["_isDisabled","_isFocused","activeDate","calendar","clearable","disabled","decade","disabledDays","expanded","inputText","localTime","maxDate","maxScan","minDate","months","offset","paginatedPanels","panel","pickerOnly","renderedDate","sequence","timezone","valueFormat","valueLocale","showPanelClose","selectedDay","selectedWeek","selectedMonth","selectedYear"]),o.hook.prop((e,t)=>("expanded"===e.prop&&o.props.disabled&&(e.value=!1),"weekStart"===e.prop&&(e.value=Number(e.value||0)),"showMonths"===e.prop&&(e.value=Number(e.value||1)),"maxScan"===e.prop&&(e.value=Number(e.value||7)),"timezone"===e.prop&&("string"==typeof o._value||o._value instanceof Date)&&(o.props.offset=r.offset(o._value,e.value)),t(e))),o.props._isFocused=!1,o.props._isPlaceholder=!1,null!==(n=(h=o.props).valueFormat)&&void 0!==n||(h.valueFormat="ISO8601"),null!==(s=(m=o.props).weekdayFormat)&&void 0!==s||(m.weekdayFormat="d"),null!==(a=(g=o.props).monthFormat)&&void 0!==a||(g.monthFormat="MMM"),null!==(l=($=o.props).monthButtonFormat)&&void 0!==l||($.monthButtonFormat="MMMM"),null!==(i=(b=o.props).dayButtonFormat)&&void 0!==i||(b.dayButtonFormat="D"),null!==(p=(y=o.props).dateFormat)&&void 0!==p||(y.dateFormat="D"),null!==(d=(x=o.props).yearFormat)&&void 0!==d||(x.yearFormat="YYYY"),null!==(c=(w=o.props).paginatedPanels)&&void 0!==c||(w.paginatedPanels=["day","year"]),null!==(u=(k=o.props).valueLocale)&&void 0!==u||(k.valueLocale=o.props.locale),null!==(f=(S=o.props).format)&&void 0!==f||(S.format="long"),o.props.panels=il(o),o.props.pickerOnly=e.undefine(o.props.pickerOnly),"disabled"in o.props&&(o.props.disabled=e.undefine(o.props.disabled)),"clearable"in o.props&&(o.props.clearable=e.undefine(o.props.clearable)),null!==(v=(L=o.props).maxScan)&&void 0!==v||(L.maxScan=7),o.props._isDisabled="function"==typeof o.props.disabledDays?o.props.disabledDays.bind(null,o):fl.bind(null,o),o.props.calendar=[],o.props.inputText="",o.props.showMonths=o.props.showMonths||1,"function"==typeof o.props.format?(o.props.formatDate=o.props.format,o.props.format=null):o.props.formatDate=r.format,sl(o),o.on("mounted",()=>{e.whenAvailable(`${o.props.id}`,cl.bind(null,o),o.props.__root)}),o.on("created",()=>{if(function(e){const t=e._value;let o=new Date;if(t instanceof Date)o=r.date(t);else if("string"==typeof t)try{const n=r.parse(t,e.props.valueFormat,e.props.valueLocale);o=r.date(n)}catch{console.warn(`Date (${t}) does not match format (${r.formatStr(e.props.valueFormat,e.props.valueLocale)})`),o=void 0}else t||(o=void 0);if(e.props.offset=e.props.timezone?r.offset(o||new Date,e.props.timezone):"+0000",e.props.minDate){const t="string"==typeof e.props.minDate?r.parse(e.props.minDate):e.props.minDate;e.props.minDate=r.removeOffset(t,e.props.offset)}if(e.props.maxDate){const t="string"==typeof e.props.maxDate?r.parse(e.props.maxDate):e.props.maxDate;e.props.maxDate=r.removeOffset(t,e.props.offset)}o=o&&r.removeOffset(o,e.props.offset),o&&pl(e,o,!1);let n=o||new Date;e.props.minDate&&n<e.props.minDate?n=e.props.minDate:e.props.maxDate&&n>e.props.maxDate&&(n=e.props.maxDate),e.props.renderedDate=n,e.props.activeDate=n,e.props.localTime=o&&r.format(o,"HH:mm")||"12:00"}(o),o.context){const e={};let t;o.context.fns.format=(t,n)=>{if(e[n]&&e[n][t.toString()])return e[n][t.toString()];const s=r.format(t,n,o.props.locale||"en",!1,ol);return e[n]?e[n][t.toString()]=s:e[n]={[t.toString()]:s},s},o.context.fns.isDisabled=o.props._isDisabled,o.context.fns.isDisabledMonth=e=>!r.nearestDay(e,e=>!o.props._isDisabled(e),"month"),o.context.fns.isDisabledYear=e=>!r.nearestDay(e,e=>!o.props._isDisabled(e),"year"),o.context.handlers._blur=e=>{var t,n;o.props._isFocused=!1,"function"==typeof(null===(t=o.context)||void 0===t?void 0:t.handlers.blur)&&(null===(n=o.context)||void 0===n||n.handlers.blur(e))},o.context.handlers.closePanel=()=>{o.props.expanded=!1},o.context.handlers._blurOut=e=>t=>{var n;t.preventDefault(),o.props.keydown?o.props.keydown=!1:e&&e!==o.props.panel||o.props.pickerOnly&&t.relatedTarget instanceof Element&&(t.relatedTarget===document.getElementById(`${o.props.id}_inner`)||t.relatedTarget.closest(`#${o.props.id}_inner`))||t.relatedTarget&&t.relatedTarget instanceof Element&&(t.relatedTarget.closest(`#${o.props.id}_popover`)||!(null===(n=o.props.__root)||void 0===n?void 0:n.contains(t.relatedTarget))||t.relatedTarget.id===`${o.props.id}_popover`)||(o.props.expanded=!1)},o.context.handlers.overlayClick=()=>{const e=Ga.get(o);e&&(e.focus(),o.props._isPlaceholder=!1)},o.context.handlers.focus=()=>{o.props.pickerOnly||(o.props._isFocused=!0,o.props.pickerOnly&&!ja.has(o)&&(Za.add(o),o.props.expanded=!0,setTimeout(()=>Za.delete(o),200)))},o.context.handlers.clear=()=>{var e,t;pl(o,void 0,!0),ll(o,void 0);const n=null===(t=null===(e=o.props)||void 0===e?void 0:e.__root)||void 0===t?void 0:t.getElementById(`${o.props.id}`);n instanceof HTMLInputElement&&(n.focus(),setTimeout(()=>{n.setSelectionRange(0,0)},50))},o.context.handlers.dateInput=e=>{var t;if(Ja.has(o))return Ja.delete(o);if(e.target instanceof HTMLInputElement&&!o.props.expanded)try{let n=r.parse({date:e.target.value,format:o.props.format,locale:o.props.locale,partFilter:ol});if(function(e){return r.parts(e.props.format,e.props.locale).some(e=>"weekday"===e.partName)}(o)&&o.props.activeDate instanceof Date&&o.props.activeDate.getTime()===n.getTime()&&!Rs.get(e.target)&&r.format(n,o.props.format,o.props.locale,!1,ol)!==e.target.value){const s=r.range("dddd",o.props.locale),a=r.parts(o.props.format,o.props.locale),l=null===(t=r.parseParts(e.target.value,a).find(e=>"dddd"===e.token))||void 0===t?void 0:t.value,i=r.format(n,"dddd",o.props.locale);if(l&&s.includes(l)&&i!==l){let e=s.indexOf(l)-s.indexOf(i);e=e<-1?7+e:e,n=r.addDay(n,e),Ya.add(o)}}pl(o,n)}catch(e){pl(o,void 0)}},o.context.handlers.open=()=>{o.props.expanded=!0},o.context.handlers.next=()=>{switch(o.props.panel){case"year":return void(o.props.renderedDate=r.addYear(o.props.renderedDate,10));case"day":return void(o.props.renderedDate=r.addMonth(o.props.renderedDate,1))}},o.context.handlers.prev=()=>{switch(o.props.panel){case"year":return void(o.props.renderedDate=r.addYear(o.props.renderedDate,-10));case"day":return void(o.props.renderedDate=r.addMonth(o.props.renderedDate,-1))}},o.context.handlers.setDate=e=>()=>{"month"!==o.props.panel&&"year"!==o.props.panel||!o.props.activeDate||(e=o.props.activeDate),o.emit("dateSelected",e)},o.context.handlers.localTime=e=>{const t=e.target;if(!t.value)return;const[n,r]=t.value.split(":");o.props.localTime=t.value,o.props.activeDate.setHours(n,r),ll(o,o.props.activeDate)},o.context.handlers.keyDown=e=>{switch(o.props.keydown=!0,o.props.panel){case"day":return o.emit("calendarKeydown",e);case"year":return o.emit("yearKeydown",e);case"month":return o.emit("monthKeydown",e);case"time":return o.emit("timeKeydown",e);default:return}},o.context.handlers.inputKeydown=e=>{o.emit("keydown",e)},o.context.handlers.openKeydown=e=>{"Enter"!==e.key&&"Space"!==e.key||(o.props.expanded=!0)},o.context.handlers.mouseEnter=e=>n=>{if(clearTimeout(t),n.target instanceof HTMLElement&&"-1"===n.target.getAttribute("tabindex")&&"true"!==n.target.getAttribute("data-is-extra"))if("month"===o.props.panel||"year"===o.props.panel){const t=r.nearestDay(e,()=>!0,o.props.panel);t&&(o.props.activeDate=t)}else o.props.activeDate=e},o.context.handlers.mouseLeave=()=>{clearTimeout(t),t=setTimeout(()=>{},100)},o.context.handlers.jumpTo=e=>()=>{o.props.panels.unshift(o.props.panel),o.props.panel=e},o.context.fns.sameDay=e=>function(e,t){return t instanceof Date&&r.sameDay(e,t)}(e,o.props.activeDate),o.context.fns.sameMonth=e=>rl(e,o.props.activeDate),o.context.fns.sameYear=e=>nl(e,o.props.activeDate),o.context.fns.notInMonth=(e,t)=>{const o=r.dayStart(t).getTime();return o<r.monthStart(e).getTime()||o>r.monthEnd(e).getTime()||void 0}}});const I=al.bind(null,o);De(o,()=>{document.removeEventListener("click",I)}),o.on("prop:panel",({payload:e})=>{o.props.showPagination=o.props.paginatedPanels.includes(e)}),o.on("dateSelected",({payload:e})=>{var t,n;Array.isArray(o.props.panels)&&o.props.panels.length?o.props.panel=o.props.panels.shift():(o.props.expanded=!1,null===(n=null===(t=o.props.__root)||void 0===t?void 0:t.getElementById(`${o.props.id}`))||void 0===n||n.focus()),e&&o.props._isDisabled(e)||pl(o,e)}),o.on("input",({payload:e})=>{if(void 0===e&&!o.props._isFocused)return void ll(o,void 0);const t=new Date,n=e?ll(o,r.removeOffset("string"==typeof e?r.parse(e,o.props.valueFormat,o.props.valueLocale):e,o.props.offset)):t;o.props.activeDate=!e&&o.props.activeDate?o.props.activeDate:n,o.props.renderedDate=!e&&o.props.renderedDate?o.props.renderedDate:n,o.props.localTime=r.format(n,"HH:mm"),function(e){const t=Xa.get(e);if(e._value&&t){const o=r.monthDays(e.props.activeDate);if(t.length>o)t.splice(o,t.length-o);else if(t.length<o)for(let e=t.length+1;e<=o;e++)t.push(String(e))}}(o)}),o.on("prop:renderedDate",sl.bind(null,o)),o.on("prop:expanded",({payload:t})=>{if(t){if(Qa.delete(o),o.props.panels=il(o),o.props.panel=o.props.panels.shift(),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?o.props.showPanelClose=!0:o.props.showPanelClose=!1,"day"===o.props.panel){const e=o.props.activeDate;o.props.activeDate=r.nearestDay(o.props.activeDate,e=>!o.props._isDisabled(e),"month")||e}sl(o),e.whenAvailable(`${o.props.id}_popover`,e=>{const t=e.querySelector('[tabindex="0"]');t&&setTimeout(()=>{t.focus(),function(e,t){const o=Ae(e,e=>{for(const t of e)"attributes"===t.type&&t.target instanceof HTMLElement&&"0"===t.target.getAttribute("tabindex")?t.target.focus():t.addedNodes.length&&t.addedNodes.forEach(e=>{var t;if(e instanceof HTMLElement&&"0"===e.getAttribute("tabindex"))e.focus();else if(e instanceof HTMLElement&&e.querySelector('[tabindex="0"]')){const t=e.querySelector('[tabindex="0"]');t instanceof HTMLElement&&t.focus()}else e instanceof HTMLElement&&e.querySelector('input[type="time"]')&&(null===(t=e.querySelector('input[type="time"]'))||void 0===t||t.focus())})});o.observe(t,{attributes:!0,attributeFilter:["tabindex"],childList:!0,subtree:!0});const n=e.on("prop:expanded",({payload:t})=>{t||(e.off(n),o.disconnect())})}(o,e)},0)},o.props.__root),Ua&&setTimeout(()=>{document.addEventListener("click",I)},10)}else{if(o.props.activeDate=o.props.renderedDate,"time"===o.props.panel)o.emit("dateSelected",o.props.activeDate);else if(o._value){Ja.add(o);const e="string"==typeof o._value?r.parse(o._value,o.props.valueFormat,o.props.valueLocale):o._value;ll(o,r.removeOffset(e,o.props.offset))}else ll(o,void 0);Ua&&(ja.add(o),document.removeEventListener("click",I),setTimeout(()=>ja.delete(o),50))}}),o.on("prop:activeDate",({payload:e})=>{if(Array.isArray(o.props.calendar)&&o.props.calendar.length)if("day"===o.props.panel){const t=o.props.calendar,n=r.monthStart(o.props.renderedDate),s=r.monthEnd(r.addMonth(o.props.renderedDate,t.length-1));e.getTime()<n.getTime()?o.props.renderedDate=r.addMonth(o.props.renderedDate,-1):e.getTime()>s.getTime()&&(o.props.renderedDate=r.addMonth(o.props.renderedDate))}else if("year"===o.props.panel){const t=o.props.years,n=t[0].getFullYear(),s=t[t.length-1].getFullYear(),a=o.props.activeDate.getFullYear();a>s?o.props.renderedDate=r.addYear(o.props.renderedDate,10):a<n?o.props.renderedDate=r.addYear(o.props.renderedDate,-10):(o.props.skipBuildCalendar=!0,o.props.renderedDate=e)}o.props.expanded&&ll(o,o.props.activeDate)}),o.on("keydown",({payload:e})=>{switch(e.key){case"ArrowDown":case"ArrowUp":case" ":e.preventDefault(),o.props.pickerOnly&&(o.props.expanded=!0);break;case"Enter":case"Return":o.props.expanded||(o.props.expanded=!0);break;case"Escape":o.props.expanded=!1}}),o.on("calendarKeydown",({payload:e})=>{e.preventDefault();let t=null,n=0;switch(e.key){case"ArrowRight":n=1;break;case"ArrowLeft":n=-1;break;case"ArrowDown":n=7;break;case"ArrowUp":n=-7;break;case"Return":case"Enter":o.emit("dateSelected",o.props.activeDate);break;case"Tab":e.shiftKey||dl(o,e);break;case"Escape":o.props.expanded=!1}if(n&&(e.preventDefault(),t=r.addDay(o.props.activeDate,n)),t&&!o.props._isDisabled(t))o.props.activeDate=t;else if(t&&o.props._isDisabled(t)){const e=n>0?1:-1;_(Number(o.props.maxScan),t=>e*t).some(e=>{const n=r.addDay(t,e);return!o.props._isDisabled(n)&&(o.props.activeDate=n,!0)})}}),o.on("yearKeydown",({payload:e})=>{let t=0;switch(e.key){case"ArrowDown":t=5;break;case"ArrowRight":t=1;break;case"ArrowUp":t=-5;break;case"ArrowLeft":t=-1;break;case"Tab":e.shiftKey||dl(o,e);break;case"Return":case"Enter":o.emit("dateSelected",o.props.activeDate);break;case"Escape":o.props.expanded=!1}const n=o.props.activeDate.getFullYear()+t-o.props.renderedDate.getFullYear();o.props.activeDate=r.addYear(o.props.renderedDate,n)}),o.on("monthKeydown",({payload:e})=>{let t=0;switch(e.key){case"ArrowDown":t=3;break;case"ArrowRight":t=1;break;case"ArrowLeft":t=-1;break;case"ArrowUp":t=-3;break;case"Tab":e.shiftKey||dl(o,e);break;case"Return":case"Enter":o.emit("dateSelected",o.props.activeDate);break;case"Escape":o.props.expanded=!1}t&&e.preventDefault();let n=(o.props.activeDate.getMonth()+t)%12;n=n<0?12+n:n;const s=n-o.props.renderedDate.getMonth();let a=r.addMonth(o.props.renderedDate,s);if(o.props._isDisabled(a)){const e=r.nearestDay(a,e=>!o.props._isDisabled(e),"month");e&&(a=e)}o.props.activeDate=a}),o.on("timeKeydown",({payload:e})=>{switch(e.key){case"Return":case"Enter":e.preventDefault(),o.emit("dateSelected",o.props.activeDate)}}),o.on("prop:_isFocused",()=>{Ga.get(o)&&ul(o)}),o.on("commit",({payload:e})=>{if(e?tl(o):el(o),o.props.activeDate&&o.props._isDisabled(o.props.activeDate)){const e=t.createMessage({blocking:!0,key:"rule_invalidDate",meta:{messageKey:"invalidDate",removeImmediately:!1,localize:!0,i18nArgs:[{node:o,name:vl(o),args:[]}]},type:"validation",value:"The selected date is invalid."});o.store.set(e)}else o.store.remove("rule_invalidDate")})},to,
|
|
30
30
|
/* #__PURE__ */o.localize("next"),
|
|
31
31
|
/* #__PURE__ */o.localize("prev"),
|
|
32
32
|
/* #__PURE__ */o.localize("changeDate"),
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
/* #__PURE__ */o.localize("loadMore"),
|
|
46
46
|
/* #__PURE__ */o.localize("remove"),
|
|
47
47
|
/* #__PURE__ */o.localize("open"),
|
|
48
|
-
/* #__PURE__ */o.localize("close"),to]},Wl=/* #__PURE__ */K("mk"),{outer:ql,wrapper:zl,inner:Ul,label:Yl,prefix:jl,suffix:Zl,help:Gl,messages:Xl,message:Jl,icon:Ql}=/* #__PURE__ */W(Wl),{overlayPlaceholder:ei,overlayLiteral:ti,overlayChar:oi,overlayEnum:ni,overlay:ri,overlayParts:si,overlayInner:ai}=/* #__PURE__ */q(Wl),li=Wl("input",()=>({$el:"input",bind:"$attrs",attrs:{type:"text",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",onInput:"$handlers.DOMInput",value:"$_maskValue",placeholder:"$placeholder",id:"$id","aria-describedby":"$describedBy"}})),ii=new WeakMap,pi=new WeakMap,di=new WeakMap;function ci(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);pi.set(e,t),Zs(t,{...ii.get(e),onChange:({valueAfter:t,meta:o})=>{e.props._maskValue=t,e.input({maskValue:t}),e.props._overlayParts=_e(o)}},e)}const ui={schema:/* #__PURE__ */ql(/* #__PURE__ */zl(/* #__PURE__ */Yl("$label"),/* #__PURE__ */Ul(/* #__PURE__ */Ql("prefix"),/* #__PURE__ */jl(),/* #__PURE__ */ri(/* #__PURE__ */ai(/* #__PURE__ */si(/* #__PURE__ */ei("$part.value"),/* #__PURE__ */ti("$part.value"),/* #__PURE__ */oi("$part.value"),/* #__PURE__ */ni("$part.value")))),/* #__PURE__ */li(),/* #__PURE__ */Zl(),/* #__PURE__ */Ql("suffix"))),/* #__PURE__ */Gl("$help"),/* #__PURE__ */Xl(/* #__PURE__ */Jl("$message.value"))),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse","overlay"],family:"text",features:[$l,function(t){t.addProps(["_maskValue","_overlayParts"]),t.on("created",()=>{var o,n,r,s,a;const l=Qs("string"==typeof t._value?t._value:"");pi.set(t,l),di.set(t,l),t.props.allowIncomplete=e.undefine(t.props.allowIncomplete),t.props.overlay=e.undefine(t.props.overlay);const i=!(void 0!==t.props.showMask&&!e.undefine(t.props.showMask));t.props.unmaskValue=e.undefine(t.props.unmaskValue),t.hook.prop((t,o)=>("unmaskValue"===t.prop&&(t.value=e.undefine(t)),o(t)));const p={placeholder:i,pattern:null!==(o=t.props.mask)&&void 0!==o?o:"",mode:null!==(n=t.props.mode)&&void 0!==n?n:"shift",partOverrides:null!==(r=t.props.tokens)&&void 0!==r?r:{},prefix:null!==(s=t.props.prefix)&&void 0!==s?s:void 0,suffix:null!==(a=t.props.suffix)&&void 0!==a?a:void 0,reverse:e.undefine(t.props.reverse)};ii.set(t,p),t.hook.input((e,o)=>{const n=function(e,t){const o=pi.get(e),n="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:n?t.maskValue:"";const r=di.get(e);r.value=pa(r,t);const s=Js(r,ii.get(e)),a=Ka(r,e.props.allowIncomplete);if(t===o.value)return e.props.unmaskValue?null!=a?a:"":null===a?"":"string"==typeof t?t:"";if(""===t&&""!==o.value&&!e.props.allowIncomplete)return t;n||s===e.props._maskValue||(o.value=s,e.props._maskValue=s,e.props._overlayParts=_e(Wa(r)||[]));return null===a?"":e.props.unmaskValue?a:s}(t,e);return o(n)}),t.props._maskValue=Js(l,p,t),t.input(t.props._maskValue,!1),t.context&&(t.context.handlers.DOMInput=e=>{t.emit("dom-input-event",e)}),e.whenAvailable(`${t.props.id}`,ci.bind(null,t),t.props.__root)})}]},fi=/* #__PURE__ */K("tf"),{outer:vi,wrapper:hi,inner:mi,icon:gi,prefix:$i,suffix:bi,help:yi,messages:xi,message:wi}=/* #__PURE__ */W(fi),_i=fi("fieldset",()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}})),ki=fi("legend",()=>({if:"$label",$el:"legend"})),Si=fi("source",()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}})),Li=fi("sourceHeader",()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}})),Ii=fi("sourceHeaderLabel",()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"})),Di=fi("sourceHeaderItemCount",()=>({$el:"span",attrs:{id:'$id + "_source_header_item_count"',role:"presentation","aria-label":'$sourceOptions.length " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.sourceHeaderItemCount'}})),Ai=fi("targetHeaderLabel",()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"})),Ci=fi("targetHeaderItemCount",()=>({$el:"span",attrs:{id:'$id + "_target_header_item_count"',role:"presentation","aria-label":'$targetOptions.length + " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.targetHeaderItemCount'},children:"$targetOptions.length"})),Ti=fi("sourceControls",()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}})),Ei=fi("sourceSearch",()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}})),Oi=fi("sourceSearchInput",()=>({$el:"input",attrs:{id:'$id + "_source_search_input"',type:"text",placeholder:"$placeholder",onInput:"$handlers.onSearch",value:"$inputText",onKeydown:"$handlers.sourceSearchKeydown",disabled:"$disabled","aria-label":"Search",role:"searchbox",autocomplete:"off",class:'$classes.transferlistSearchInput + " " + $classes.sourceSearchInput',onFocus:"$handlers.sourceSearchFocus",onBlur:"$handlers.sourceSearchBlur"}})),Mi=fi("targetSearch",()=>({if:"$targetSearchable",$el:"div",attrs:{id:'$id + "_target_search"',class:'$classes.transferlistSearch + " " + $classes.targetSearch'}})),Vi=fi("targetSearchInput",()=>({$el:"input",attrs:{id:'$id + "_target_search_input"',type:"text",placeholder:"$placeholder",onInput:"$handlers.onTargetSearch",value:"$targetInputText",onKeydown:"$handlers.targetSearchKeydown",disabled:"$disabled","aria-label":"Search",role:"searchbox",autocomplete:"off",class:'$classes.transferlistSearchInput + " " + $classes.targetSearchInput',onFocus:"$handlers.targetSearchFocus",onBlur:"$handlers.targetSearchBlur"}})),Fi=fi("targetControls",()=>({$el:"div",if:"$targetSearchable",attrs:{id:'$id + "_target_controls"',class:'$classes.transferlistControls + " " + $classes.targetControls'}})),Pi=fi("sourceSearchClear",()=>({$el:"button",if:'$inputText !== ""',attrs:{id:'$id + "_source_search_clear"',type:"button",onClick:"$handlers.clearSearch","aria-label":"Clear Source Search",class:'$classes.transferlistSearchClear + " " + $classes.sourceSearchClear'}})),Bi=fi("targetSearchClear",()=>({$el:"button",if:'$targetInputText !== ""',attrs:{id:'$id + "_target_search_clear"',type:"button",onClick:"$handlers.clearTargetSearch","aria-label":"Clear Target Search",class:'$classes.transferlistSearchClear + " " + $classes.targetSearchClear'}})),Hi=fi("sourceListItems",()=>({$el:"ul",attrs:{id:'$id + "_source_list_items"',"aria-activedescendant":"$activeDescendant",onMouseenter:"$handlers.onMouseenter(true)",onMouseout:"$handlers.onMouseleave(true)",role:"listbox","aria-multiselectable":"true","aria-roledescription":"List of options to choose from.",class:'$classes.transferlistListItems + " " + $classes.sourceListItems',onKeydown:"$handlers.sourceListKeydown",tabindex:"$searchable || $sourceOptions.length === 0 && -1 || 0",onFocus:"$handlers.sourceListFocused",onBlur:"$handlers.sourceListBlurred","aria-label":"Source list"}})),Ri=fi("sourceListItem",()=>({for:["option","index","$sourceOptions"],$el:"li",attrs:{id:'$id + "_source_list_item_" + $index',"data-value":"$option.value","aria-selected":"$transferOnSelect === false && $fns.isSelected($option, $selectedSourceItems)","data-is-active":"$fns.isActive($option, $activeValue)","data-disabled":"$option.attrs.disabled",role:"option",onClick:"$handlers.listitemClick($option, true)",onTouchstartPassive:"$handlers.listitemTouchstart($option, true)",onTouchmovePassive:"$handlers.listitemTouchmove($option, true)",onTouchend:"$handlers.listitemTouchend($option, true)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.sourceListItem'}})),Ni=fi("sourceOption",()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option, $selectedSourceItems)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}})),Ki=fi("sourceLoadMore",()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_source_load_more"',key:"loadMore",onClick:"$handlers.listitemClick($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}})),Wi=fi("loadMoreInner","span"),qi=fi("target",()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}})),zi=fi("targetHeader",()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}})),Ui=fi("targetListItems",()=>({$el:"ul",attrs:{id:"$id","aria-activedescendant":"$activeDescendant",onMouseenter:"$handlers.onMouseenter(false)",onMouseout:"$handlers.onMouseleave(false)",role:"listbox",class:'$classes.transferlistListItems + " " + $classes.targetListItems',tabindex:"$targetOptions.length === 0 && -1 || 0",onKeydown:"$handlers.targetListKeydown",onFocus:"$handlers.targetListFocused",onBlur:"$handlers.targetListBlurred","aria-label":"Target list"}})),Yi=fi("targetListItem",()=>({for:["option","index","$targetOptions"],$el:"li",attrs:{id:'$id + "_target_list_item_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value","aria-selected":"$transferOnSelect === false && $fns.isSelected($option, $selectedTargetItems)","data-is-active":"$fns.isActive($option, $activeValue)",role:"option",onClick:"$handlers.listitemClick($option, false)",onTouchstartPassive:"$handlers.listitemTouchstart($option, false)",onTouchmovePassive:"$handlers.listitemTouchmove($option, false)",onTouchend:"$handlers.listitemTouchend($option, false)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.targetListItem'}})),ji=fi("targetOption",()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index + "_option"',"data-checked":"$fns.isSelected($option, $selectedTargetItems)",class:'$classes.transferlistOption + " " + $classes.targetOption'}})),Zi=fi("transferControls",()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}})),Gi=fi("transferButtonForward",()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_forward"',type:"button",disabled:"$selectedSourceItems.length === 0 || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForward","aria-label":"$ui.addSelectedValues.value",title:"$ui.addSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonForward'}})),Xi=fi("transferButtonForwardAll",()=>({$el:"button",attrs:{id:'$id + "_transfer_button_forward_all"',type:"button",disabled:"$sourceOptions.length === 0 || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForwardAll","aria-label":"$ui.addAllValues.value",title:"$ui.addAllValues.value",onFocus:"$handlers.transferForwardAllFocused",class:'$classes.transferlistButton + " " + $classes.transferButtonForwardAll'}})),Ji=fi("transferButtonBackward",()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_backward"',onClick:"$handlers.transferBackward",type:"button",disabled:"$selectedTargetItems.length === 0 || $targetOptions.length === 0 || $disabled","aria-label":"$ui.removeSelectedValues.value",title:"$ui.removeSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackward'}})),Qi=fi("transferButtonBackwardAll",()=>({$el:"button",attrs:{id:'$id + "_transfer_button_backward_all"',onClick:"$handlers.transferBackwardAll",type:"button",disabled:"$targetOptions.length === 0 || $disabled","aria-label":"$ui.removeAllValues.value",title:"$ui.removeAllValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackwardAll'}})),ep=fi("controlLabel","span"),tp=fi("sourceEmptyMessage",()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}})),op=fi("targetEmptyMessage",()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}})),np=fi("emptyMessageInner","span"),rp=Symbol(),sp=new WeakSet,ap=new WeakSet;function lp(e,t,o,n){if(!(e.props.disabled||(e.props.isSourceOption=o,e.props.isSourceOption&&Array.isArray(e.value)&&e.value.length>=e.props.max)))if(o){if(e.props.selectedSourceItems.includes(t))return e.props.selectedSourceItems=e.props.selectedSourceItems.filter(e=>e!==t),e.props.activeValue=void 0,void(e.props.activeDescendant=void 0);e.props.selectedTargetItems=[],e.props.selectedSourceItems=[...e.props.selectedSourceItems,t]}else{if(e.props.selectedTargetItems.includes(t))return void(e.props.selectedTargetItems=e.props.selectedTargetItems.filter(e=>e!==t));e.props.selectedSourceItems=[],e.props.selectedTargetItems=[...e.props.selectedTargetItems,t]}}function ip(e,t){if(e.props.sourceListOrigin=!0,e.props.maxReached)return;if(t){const o=Array.isArray(e.value)?[...e.value,t]:[t];return void e.input(o)}const o=e.props.selectedSourceItems.map(e=>Se(e));Array.isArray(e.value)?e.input([...e.value,...o]):e.input(o),e.props.selectedSourceItems=[]}function pp(t,o){if(t.props.sourceListOrigin=!1,o){const n=Array.isArray(t.value)?t.value.filter(t=>!e.eq(t,o)):[];return void t.input(n)}const n=t.props.selectedTargetItems.map(e=>Se(e));if(Array.isArray(t.value)){const e=t.value.filter(e=>!n.includes(e));t.input(e)}t.props.selectedTargetItems=[]}function dp(e){var t,o;if(e.props.activeValue===rp){const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_source_load_more`);return void(o&&o.scrollIntoView({block:"nearest",inline:"start"}))}const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);n&&n.scrollIntoView({block:"nearest",inline:"start"})}function cp(t){var o;if(Array.isArray(t.value)){const o=[];let n=[...t.props.options];t.value.forEach(r=>{const s=t.props.memoOptions.find(t=>e.eq(Se(t),r));if(s&&!s.noOptionFound){o.push(s);const a=t.props.options.findIndex(t=>e.eq(Se(t),r));-1!==a&&(n=n.filter(t=>!e.eq(Se(t),r)))}else{const t=n.find(t=>e.eq(Se(t),r));t?(o.push(t),n=n.filter(t=>!e.eq(Se(t),r))):o.push({label:String(r),value:r,noOptionFound:!0})}}),t.props.targetOptions=t.props.targetInputText?o.filter(e=>t.props.filter(e,t.props.targetInputText,t)):o,t.props.sourceOptions=n}else t.props.sourceOptions=[...t.props.options],t.props.targetOptions=[];if(t.props.skipSetActiveValue)return void(t.props.skipSetActiveValue=!1);(null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(t.props.id+"_source_list_items"))&&up(t)}function up(e){var t,o,n,r,s,a,l,i,p;if(e.props.isDragging)return;if(e.props.targetSearchActive){if((null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.activeElement)||void 0===o?void 0:o.id)===`${e.props.id}_target_search_input`){const t=e.props.targetOptions.find(e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)});return t?void(e.props.activeValue=Se(t)):void(e.props.activeValue=void 0)}return}if(e.props.sourceSearchActive){if((null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.activeElement)||void 0===r?void 0:r.id)===`${e.props.id}_source_search_input`){const t=e.props.sourceOptions.find(e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)});return t?void(e.props.activeValue=Se(t)):void(e.props.activeValue=void 0)}e.props.sourceSearchActive=!1}if(!1===e.props.transferOnSelect)return void(e.props.activeValue=void 0);const d=e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions;let c=!1;for(let t=e.props.activeIndex;t<=d.length;t++)if(!(null===(s=d.attrs)||void 0===s?void 0:s.disabled)&&d[t]){c=!0,e.props.activeValue=Se(d[t]);break}if(!c&&d.length)for(let t=e.props.activeIndex;t>=0;t--)if(!(null===(a=d.attrs)||void 0===a?void 0:a.disabled)&&d[t])return c=!0,void(e.props.activeValue=Se(d[t]));if(!c){let t;t=e.props.sourceListOrigin?null===(p=e.props.__root)||void 0===p?void 0:p.getElementById(`${e.props.id}`):e.props.searchable?null===(l=e.props.__root)||void 0===l?void 0:l.getElementById(`${e.props.id}_source_search_input`):null===(i=e.props.__root)||void 0===i?void 0:i.getElementById(`${e.props.id}_source_list_items`),t&&t.focus()}}function fp(e,t){return(t?e.props.sourceOptions:e.props.targetOptions).find(e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})}function vp(t){Array.isArray(t.value)&&t.value.forEach(async o=>{Ne(t,o,function(t,o){const n=[...t.props.options,...t.props.memoOptions];return n.find(t=>e.eq(Se(t),o))}(t,o))})}function hp(t){t.context&&(t.context.handlers.loadMore=Fe.bind(null,t),t.context.fns.getSourceItemCount=e=>!1===t.props.transferOnSelect&&e.length?e.length+"/"+t.props.sourceOptions.length:t.props.sourceOptions.length,t.context.fns.getTargetItemCount=e=>!1===t.props.transferOnSelect&&e.length?e.length+"/"+t.props.targetOptions.length:t.props.targetOptions.length,t.context.fns.isActive=(o,n)=>{if(!t.props.isDragging&&!t.props.touchStarted)return e.eq(n,Se(o))||void 0},t.context.fns.isSelected=(e,t)=>!!t&&(!!Array.isArray(t)&&t.includes(e)),t.context.fns.optionLoading=e=>t.props.optionLoaderValues.includes(Se(e)),t.context.handlers.clearSearch=()=>{!function(e){var t;e.props.sourceSearchActive=!1,e.props.inputText="",Ve(e,"",!0);const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_source_search_input`);if(!o)return;o.focus()}(t)},t.context.handlers.clearTargetSearch=()=>{!function(e){var t;e.props.targetSearchActive=!1,e.props.targetInputText="";const o=[...new Set([...e.props.options,...e.props.memoOptions])],n=[];for(const t of e.value){const e=o.find(e=>Se(e)===t);e&&n.push(e)}e.props.targetOptions=n;const r=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_target_search_input`);if(!r)return;r.focus()}(t)},t.context.handlers.sourceSearchBlur=e=>{setTimeout(()=>{var o;if(e.relatedTarget&&e.relatedTarget instanceof HTMLElement&&(e.relatedTarget.id===`${t.props.id}_source_list_items`||e.relatedTarget.id===`${t.props.id}`)){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}_source_search_input`);if(!e)return;e.focus()}else t.props.activeValue=void 0})},t.context.handlers.targetSearchBlur=e=>{setTimeout(()=>{var o;if(e.relatedTarget&&e.relatedTarget instanceof HTMLElement&&(e.relatedTarget.id===`${t.props.id}_source_list_items`||e.relatedTarget.id===`${t.props.id}`)){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}_target_search_input`);if(!e)return;e.focus()}else t.props.activeValue=void 0})},t.context.handlers.listitemClick=(e,o)=>n=>{mp(t,e,o)},t.context.handlers.transferForward=ip.bind(null,t,void 0),t.context.handlers.transferForwardAll=()=>{let e;if(t.props.maxReached)return;const o=t.props.sourceOptions.map(e=>Se(e));e=Array.isArray(t.value)?[...t.value,...o]:[...o],t.input(e),t.props.selectedSourceItems=[]},t.context.handlers.transferBackward=pp.bind(null,t,void 0),t.context.handlers.transferBackwardAll=()=>{Array.isArray(t.value)&&(t.input([]),t.props.selectedTargetItems=[])},t.context.handlers.onSearch=e=>{!function(e,t){e.props.sourceSearchActive=!0;const o=t.target;e.props.inputText=o.value,Ve(e,o.value,!0)}(t,e)},t.context.handlers.onTargetSearch=e=>{!function(e,t){e.props.targetSearchActive=!0;const o=t.target;e.props.targetInputText=o.value;const n=[...new Set([...e.props.memoOptions,...e.props.options])],r=[];for(const t of e.value){const e=n.find(e=>Se(e)===t);e&&r.push(e)}const s=[...new Map([...e.props.targetOptions,...r].map(e=>[JSON.stringify(e),e])).values()];e.props.targetOptions=s.filter(t=>e.props.filter(t,o.value,e)),0===e.props.targetOptions.length?e.props.showTargetEmptyMessage=!0:e.props.showTargetEmptyMessage=!1;up(e)}(t,e)},t.context.handlers.onMouseenter=e=>o=>{"touchstart"!==o.type&&(e?t.props.mouseOnSource=!0:t.props.mouseOnTarget=!0)},t.context.handlers.onMouseleave=e=>o=>{var n;if("touchend"===o.type)return;const r=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(e?`${t.props.id}_source_list_items`:`${t.props.id}`);r&&(r.contains(o.relatedTarget)||(t.props.trackHover=!1,t.props.activeValue=void 0,t.props.activeDescendant=void 0,t.props.activeIndex=void 0,e?t.props.mouseOnSource=!1:t.props.mouseOnTarget=!1))},t.context.handlers.listitemClick=(e,o)=>n=>{n instanceof MouseEvent&&t.props.touchStarted||mp(t,e,o)},t.context.handlers.listitemTouchstart=()=>()=>{!function(e){e.props.touchStarted=!0}(t)},t.context.handlers.listitemTouchend=(e,o)=>n=>{!function(e,t,o){if(e.props.touchMoved)return e.props.touchMoved=!1,void(e.props.touchStarted=!1);const n=Se(t);e.props.activeIndex=e.props.sourceOptions.findIndex(e=>Se(e)===n),e.props.transferOnSelect?o?ip(e,n):pp(e,n):lp(e,t,o)}(t,e,o)},t.context.handlers.listitemTouchmove=()=>e=>{!function(e){e.props.touchMoved=!0}(t)},t.context.handlers.sourceSearchFocus=e=>{gp(t,!0)},t.context.handlers.targetSearchFocus=e=>{gp(t,!1)},t.context.handlers.sourceListFocused=e=>{gp(t,!0)},t.context.handlers.targetListFocused=()=>{gp(t,!1)},t.context.handlers.sourceListBlurred=e=>{t.props.activeValue=void 0},t.context.handlers.targetListBlurred=e=>{t.props.activeValue=void 0},t.context.handlers.sourceListKeydown=e=>{$p(t,e,!0)},t.context.handlers.targetListKeydown=e=>{$p(t,e,!1)},t.context.handlers.sourceSearchKeydown=e=>{$p(t,e,!0)},t.context.handlers.targetSearchKeydown=e=>{$p(t,e,!1)})}function mp(t,o,n,r){var s;if(Se(o)===rp)return void(null===(s=t.context)||void 0===s||s.handlers.loadMore(!0));const a=Se(o);t.props.activeIndex=t.props.sourceOptions.findIndex(t=>e.eq(Se(t),a)),t.props.transferOnSelect?n?ip(t,a):pp(t,a):lp(t,o,n)}function gp(e,t){const o=fp(e,t);o&&(e.props.sourceListOrigin=t,e.props.activeValue=Se(o))}function $p(e,t,o){if("ArrowDown"===t.key||"ArrowUp"===t.key)!function(e,t,o){var n,r,s;e.preventDefault();const a=o?t.props.sourceOptions:t.props.targetOptions,l=a.reduce((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(Se(t)),e},[]);(null===(n=t.store.hasNextPage)||void 0===n?void 0:n.value)&&l.push(rp);const i=l.indexOf(t.props.activeValue);if("ArrowUp"===e.key&&0!==i)for(let e=i-1;e>=0;e--){t.props.sourceListOrigin=o,t.props.activeValue=l[i-1];break}else if("ArrowDown"===e.key&&i!==l.length-1)for(let e=i+1;e<l.length;e++)if(!(null===(s=null===(r=a[e])||void 0===r?void 0:r.attrs)||void 0===s?void 0:s.disabled)){t.props.sourceListOrigin=o,t.props.activeValue=l[e];break}dp(t)}(t,e,o);else if("ArrowRight"===t.key||"ArrowLeft"===t.key){if("ArrowLeft"===t.key&&o)return;if("ArrowRight"===t.key&&!o)return;!function(e,t,o){if(t.props.searchable)return;e.preventDefault(),function(e,t){var o,n,r;if(fp(e,!t))if(t){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);t&&t.focus()}else if(e.props.searchable){const t=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_source_search_input`);t&&t.focus()}else{const t=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_source_list_items`);t&&t.focus()}}(t,o)}(t,e,o)}else"Enter"===t.key&&function(e,t,o){var n;if(e.preventDefault(),!t.props.activeValue)return;if(t.props.activeValue===rp)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore(!0));const r=o?t.props.sourceOptions:t.props.targetOptions,s=r.findIndex(e=>Se(e)===t.props.activeValue);t.props.activeIndex=s;const a=r[s];if(!a)return;t.props.transferOnSelect?o?ip(t,Se(a)):pp(t,Se(a)):lp(t,a,o)}(t,e,o)}function bp(t){t.on("created",()=>{if("function"==typeof t.props.optionsLoader&&(t.props.skipSetActiveValue=!0,Ke(t)),hp(t),t.props.disabled&&(t.props.draggable=!1),c){e.whenAvailable(t.props.id+"_source_list_items",e=>{e instanceof HTMLElement&&function(e,t){if(!e.context)return;function o(){return e.props.sourceOptions.map(e=>Se(e))}function r(){return[]}const s={longTouch:!0,draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,group:e.props.id,root:e.props.__root||document,disabled:!e.props.draggable||e.props.maxReached,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,selectionDraggingClass:e.context.classes.selectionDragging,selectionDropZoneClass:e.context.classes.selectionDropZone,touchSelectionDraggingClass:e.context.classes.touchSelectionDragging,touchSelectionDropZoneClass:e.context.classes.touchSelectionDropZone,longTouchClass:e.context.classes.longTouch,handleTouchmove(t){e.props.selectedSourceItems=[],n.handleTouchmove(t)},draggable:e=>"option"===e.getAttribute("role")};s.plugins=[n.multiDrag({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,n.handleDragstart(t)},handleEnd(t){n.handleEnd(t),e.props.isDragging=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.activeDescendant=void 0,e.props.isDragging=!1,e.props.selectedTargetItems=[],e.props.selectedSourceItems=[]},handleTouchstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.mouseOnSource=!1,e.props.mouseOnTarget=!1,n.handleTouchstart(t)},selections:()=>e.props.selectedSourceItems.map(e=>Se(e))})],n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s}),e.on("prop:disabled",({payload:e})=>{s.disabled=e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})}),e.on("prop:draggable",({payload:e})=>{s.disabled=!e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})}),e.on("prop:maxReached",({payload:e})=>{s.disabled=e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})})}(t,e)},t.props.__root),e.whenAvailable(`${t.props.id}`,e=>{e instanceof HTMLElement&&function(e,t){if(!e.context)return;function o(){return e.props.targetOptions.map(e=>Se(e))}function r(t,o){e.props.sourceListOrigin=!0,e.input(t)}const s={longTouch:!0,root:e.props.__root,group:e.props.id,disabled:!e.props.draggable,draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,selectionDraggingClass:e.context.classes.selectionDragging,selectionDropZoneClass:e.context.classes.selectionDropZone,touchSelectionDraggingClass:e.context.classes.touchSelectionDragging,touchSelectionDropZoneClass:e.context.classes.touchSelectionDropZone,longTouchClass:e.context.classes.longTouch,draggable:e=>"option"===e.getAttribute("role"),plugins:[]};s.plugins=[n.multiDrag({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,n.handleDragstart(t)},handleEnd(t){n.handleEnd(t),e.props.selectedTargetItems=[],e.props.selectedSourceItems=[],e.props.activeValue=void 0,e.props.trackHover=!0,e.props.isDragging=!1},handleTouchstart(t){e.props.trackHover=!1,e.props.activeValue=void 0,e.props.isDragging=!0,e.props.activeDescendant=void 0,n.handleTouchstart(t)},selections:()=>e.props.selectedTargetItems.map(e=>Se(e))})],n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s}),e.on("prop:disabled",({payload:e})=>{s.disabled=e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})}),e.on("prop:draggable",({payload:e})=>{s.disabled=!e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})})}(t,e)},t.props.__root);const o=e=>{var o;if(t.props.isDragging)return;t.props.mouseX=e.clientX,t.props.mouseY=e.clientY;const n=t.props.mouseOnSource?`${t.props.id}_source_list_items`:`${t.props.id}`,r=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(n);if(r){const o=r.getBoundingClientRect();e.clientX>o.x&&e.clientX<o.x+o.width&&e.clientY>o.y&&e.clientY<o.y+o.height&&(t.props.trackHover=!0)}};document.addEventListener("mousemove",o)}})}function yp(e,t){var o;let n=null,r="",s=[];if(e.props.mouseOnSource){if(n=sp.has(e),r=`${e.props.id}_source_list_item`,s=[...e.props.sourceOptions],!s||!s.length||n)return s=[],r="",void(n=null)}else if(e.props.mouseOnTarget&&(n=ap.has(e),r=`${e.props.id}_target_list_item`,s=[...e.props.targetOptions],!s||!s.length||n))return s=[],r="",void(n=null);const a=s.reduce((t,o,n)=>{var s,a;if(null===(s=o.attrs)||void 0===s?void 0:s.disabled)return t;const l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(r+`_${n}`);return l&&t.push([l,o]),t},[]),l=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);l&&a.push([l,e.props.loadMoreOption]),e.props.mouseOnSource&&sp.add(e),e.props.mouseOnTarget&&ap.add(e),a.length&&xp(e,a,null,t)}function xp(e,t,o,n){const r=n?n.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.trackHover){if(e.props.mouseY>r.top&&e.props.mouseY<r.bottom){let n=o||0,r=o;const s=(t,n)=>{var r;const s=n[0],{y:a,height:l,x:i,width:p}=s.getBoundingClientRect();if(e.props.mouseX>i&&e.props.mouseX<i+p&&e.props.mouseY>a&&e.props.mouseY<a+l){o=t;const s=n[1];return e.props.activeValue=s&&!(null===(r=s.attrs)||void 0===r?void 0:r.disabled)?Se(s):void 0,!0}return!1};do{if(null!==n&&s(n,t[n]))break;if(null!==r&&s(r,t[r]))break;null!==n&&(n++,n>t.length-1&&(n=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==n||null!==r)}}else dp(e);e.props.mouseOnSource||e.props.mouseOnTarget?e.props.mouseOnSource&&sp.has(e)||e.props.mouseOnTarget&&ap.has(e)?requestAnimationFrame(xp.bind(null,e,t,o,n)):yp(e,n):(sp.delete(e),ap.delete(e))}const wp={schema:/* #__PURE__ */vi(/* #__PURE__ */_i(/* #__PURE__ */ki("$label"),/* #__PURE__ */yi("$help"),/* #__PURE__ */hi(/* #__PURE__ */Si(/* #__PURE__ */Li(/* #__PURE__ */Ii(),/* #__PURE__ */Di(/* #__PURE__ */z("$optionsLoadingCounter > 0",/* #__PURE__ */gi("loader"),"$fns.getSourceItemCount($selectedSourceItems)"))),/* #__PURE__ */Ti(/* #__PURE__ */Ei(/* #__PURE__ */Oi(),/* #__PURE__ */Pi(/* #__PURE__ */gi("close")))),/* #__PURE__ */Hi(/* #__PURE__ */tp(/* #__PURE__ */np("$sourceEmptyMessage")),/* #__PURE__ */Ri(/* #__PURE__ */z("$transferOnSelect !== true && $fns.isSelected($option, $selectedSourceItems)",/* #__PURE__ */gi("selected")),/* #__PURE__ */Ni("$option.label")),/* #__PURE__ */Ki(/* #__PURE__ */z("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",/* #__PURE__ */Wi(/* #__PURE__ */z("$state.loading",/* #__PURE__ */gi("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),/* #__PURE__ */Zi(/* #__PURE__ */Xi(/* #__PURE__ */ep("$ui.addAllValues.value"),/* #__PURE__ */gi("fastForward")),/* #__PURE__ */Gi(/* #__PURE__ */ep("$ui.addSelectedValues.value"),/* #__PURE__ */gi("moveRight")),/* #__PURE__ */Ji(/* #__PURE__ */ep("$ui.removeSelectedValues.value"),/* #__PURE__ */gi("moveLeft")),/* #__PURE__ */Qi(/* #__PURE__ */ep("$ui.removeAllValues.value"),/* #__PURE__ */gi("rewind"))),/* #__PURE__ */qi(/* #__PURE__ */zi(/* #__PURE__ */Ai(),/* #__PURE__ */Ci("$fns.getTargetItemCount($selectedTargetItems)")),/* #__PURE__ */Fi(/* #__PURE__ */Mi(/* #__PURE__ */Vi(),/* #__PURE__ */Bi(/* #__PURE__ */gi("close")))),/* #__PURE__ */Ui(/* #__PURE__ */op(/* #__PURE__ */z("$state.loading !== true",/* #__PURE__ */np("$targetEmptyMessage"))),/* #__PURE__ */Yi(/* #__PURE__ */z("$transferOnSelect !== true && $fns.isSelected($option, $selectedTargetItems)",/* #__PURE__ */gi("selected")),/* #__PURE__ */ji(/* #__PURE__ */z("$fns.optionLoading($option, $optionLoaderValues)","$ui.isLoading.value","$option.label")))))),/* #__PURE__ */xi(/* #__PURE__ */wi("$message.value")))),type:"input",props:[],features:[
|
|
48
|
+
/* #__PURE__ */o.localize("close"),to]},Wl=/* #__PURE__ */K("mk"),{outer:ql,wrapper:zl,inner:Ul,label:Yl,prefix:jl,suffix:Zl,help:Gl,messages:Xl,message:Jl,icon:Ql}=/* #__PURE__ */W(Wl),{overlayPlaceholder:ei,overlayLiteral:ti,overlayChar:oi,overlayEnum:ni,overlay:ri,overlayParts:si,overlayInner:ai}=/* #__PURE__ */q(Wl),li=Wl("input",()=>({$el:"input",bind:"$attrs",attrs:{type:"text",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",onInput:"$handlers.DOMInput",value:"$_maskValue",placeholder:"$placeholder",id:"$id","aria-describedby":"$describedBy"}})),ii=new WeakMap,pi=new WeakMap,di=new WeakMap;function ci(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);pi.set(e,t),Zs(t,{...ii.get(e),onChange:({valueAfter:t,meta:o})=>{e.props._maskValue=t,e.input({maskValue:t}),e.props._overlayParts=_e(o)}},e)}const ui={schema:/* #__PURE__ */ql(/* #__PURE__ */zl(/* #__PURE__ */Yl("$label"),/* #__PURE__ */Ul(/* #__PURE__ */Ql("prefix"),/* #__PURE__ */jl(),/* #__PURE__ */ri(/* #__PURE__ */ai(/* #__PURE__ */si(/* #__PURE__ */ei("$part.value"),/* #__PURE__ */ti("$part.value"),/* #__PURE__ */oi("$part.value"),/* #__PURE__ */ni("$part.value")))),/* #__PURE__ */li(),/* #__PURE__ */Zl(),/* #__PURE__ */Ql("suffix"))),/* #__PURE__ */Gl("$help"),/* #__PURE__ */Xl(/* #__PURE__ */Jl("$message.value"))),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse","overlay"],family:"text",features:[$l,function(t){t.addProps(["_maskValue","_overlayParts"]),t.on("created",()=>{var o,n,r,s,a;const l=Qs("string"==typeof t._value?t._value:"");pi.set(t,l),di.set(t,l),t.props.allowIncomplete=e.undefine(t.props.allowIncomplete),t.props.overlay=e.undefine(t.props.overlay);const i=!(void 0!==t.props.showMask&&!e.undefine(t.props.showMask));t.props.unmaskValue=e.undefine(t.props.unmaskValue),t.hook.prop((t,o)=>("unmaskValue"===t.prop&&(t.value=e.undefine(t)),o(t)));const p={placeholder:i,pattern:null!==(o=t.props.mask)&&void 0!==o?o:"",mode:null!==(n=t.props.mode)&&void 0!==n?n:"shift",partOverrides:null!==(r=t.props.tokens)&&void 0!==r?r:{},prefix:null!==(s=t.props.prefix)&&void 0!==s?s:void 0,suffix:null!==(a=t.props.suffix)&&void 0!==a?a:void 0,reverse:e.undefine(t.props.reverse)};ii.set(t,p),t.hook.input((e,o)=>{const n=function(e,t){const o=pi.get(e),n="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:n?t.maskValue:"";const r=di.get(e);r.value=pa(r,t);const s=Js(r,ii.get(e)),a=Ka(r,e.props.allowIncomplete);if(t===o.value)return e.props.unmaskValue?null!=a?a:"":null===a?"":"string"==typeof t?t:"";if(""===t&&""!==o.value&&!e.props.allowIncomplete)return o.value=s,e.props._maskValue=s,e.props._overlayParts=_e(Wa(r)||[]),t;n||s===e.props._maskValue||(o.value=s,e.props._maskValue=s,e.props._overlayParts=_e(Wa(r)||[]));return null===a?"":e.props.unmaskValue?a:s}(t,e);return o(n)}),t.props._maskValue=Js(l,p,t),t.input(t.props._maskValue,!1),t.context&&(t.context.handlers.DOMInput=e=>{t.emit("dom-input-event",e)}),e.whenAvailable(`${t.props.id}`,ci.bind(null,t),t.props.__root)})}]},fi=/* #__PURE__ */K("tf"),{outer:vi,wrapper:hi,inner:mi,icon:gi,prefix:$i,suffix:bi,help:yi,messages:xi,message:wi}=/* #__PURE__ */W(fi),_i=fi("fieldset",()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}})),ki=fi("legend",()=>({if:"$label",$el:"legend"})),Si=fi("source",()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}})),Li=fi("sourceHeader",()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}})),Ii=fi("sourceHeaderLabel",()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"})),Di=fi("sourceHeaderItemCount",()=>({$el:"span",attrs:{id:'$id + "_source_header_item_count"',role:"presentation","aria-label":'$sourceOptions.length " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.sourceHeaderItemCount'}})),Ai=fi("targetHeaderLabel",()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"})),Ci=fi("targetHeaderItemCount",()=>({$el:"span",attrs:{id:'$id + "_target_header_item_count"',role:"presentation","aria-label":'$targetOptions.length + " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.targetHeaderItemCount'},children:"$targetOptions.length"})),Ti=fi("sourceControls",()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}})),Ei=fi("sourceSearch",()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}})),Oi=fi("sourceSearchInput",()=>({$el:"input",attrs:{id:'$id + "_source_search_input"',type:"text",placeholder:"$placeholder",onInput:"$handlers.onSearch",value:"$inputText",onKeydown:"$handlers.sourceSearchKeydown",disabled:"$disabled","aria-label":"Search",role:"searchbox",autocomplete:"off",class:'$classes.transferlistSearchInput + " " + $classes.sourceSearchInput',onFocus:"$handlers.sourceSearchFocus",onBlur:"$handlers.sourceSearchBlur"}})),Mi=fi("targetSearch",()=>({if:"$targetSearchable",$el:"div",attrs:{id:'$id + "_target_search"',class:'$classes.transferlistSearch + " " + $classes.targetSearch'}})),Vi=fi("targetSearchInput",()=>({$el:"input",attrs:{id:'$id + "_target_search_input"',type:"text",placeholder:"$placeholder",onInput:"$handlers.onTargetSearch",value:"$targetInputText",onKeydown:"$handlers.targetSearchKeydown",disabled:"$disabled","aria-label":"Search",role:"searchbox",autocomplete:"off",class:'$classes.transferlistSearchInput + " " + $classes.targetSearchInput',onFocus:"$handlers.targetSearchFocus",onBlur:"$handlers.targetSearchBlur"}})),Fi=fi("targetControls",()=>({$el:"div",if:"$targetSearchable",attrs:{id:'$id + "_target_controls"',class:'$classes.transferlistControls + " " + $classes.targetControls'}})),Pi=fi("sourceSearchClear",()=>({$el:"button",if:'$inputText !== ""',attrs:{id:'$id + "_source_search_clear"',type:"button",onClick:"$handlers.clearSearch","aria-label":"Clear Source Search",class:'$classes.transferlistSearchClear + " " + $classes.sourceSearchClear'}})),Bi=fi("targetSearchClear",()=>({$el:"button",if:'$targetInputText !== ""',attrs:{id:'$id + "_target_search_clear"',type:"button",onClick:"$handlers.clearTargetSearch","aria-label":"Clear Target Search",class:'$classes.transferlistSearchClear + " " + $classes.targetSearchClear'}})),Hi=fi("sourceListItems",()=>({$el:"ul",attrs:{id:'$id + "_source_list_items"',"aria-activedescendant":"$activeDescendant",onMouseenter:"$handlers.onMouseenter(true)",onMouseout:"$handlers.onMouseleave(true)",role:"listbox","aria-multiselectable":"true","aria-roledescription":"List of options to choose from.",class:'$classes.transferlistListItems + " " + $classes.sourceListItems',onKeydown:"$handlers.sourceListKeydown",tabindex:"$searchable || $sourceOptions.length === 0 && -1 || 0",onFocus:"$handlers.sourceListFocused",onBlur:"$handlers.sourceListBlurred","aria-label":"Source list"}})),Ri=fi("sourceListItem",()=>({for:["option","index","$sourceOptions"],$el:"li",attrs:{id:'$id + "_source_list_item_" + $index',"data-value":"$option.value","aria-selected":"$transferOnSelect === false && $fns.isSelected($option, $selectedSourceItems)","data-is-active":"$fns.isActive($option, $activeValue)","data-disabled":"$option.attrs.disabled",role:"option",onClick:"$handlers.listitemClick($option, true)",onTouchstartPassive:"$handlers.listitemTouchstart($option, true)",onTouchmovePassive:"$handlers.listitemTouchmove($option, true)",onTouchend:"$handlers.listitemTouchend($option, true)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.sourceListItem'}})),Ni=fi("sourceOption",()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option, $selectedSourceItems)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}})),Ki=fi("sourceLoadMore",()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_source_load_more"',key:"loadMore",onClick:"$handlers.listitemClick($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}})),Wi=fi("loadMoreInner","span"),qi=fi("target",()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}})),zi=fi("targetHeader",()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}})),Ui=fi("targetListItems",()=>({$el:"ul",attrs:{id:"$id","aria-activedescendant":"$activeDescendant",onMouseenter:"$handlers.onMouseenter(false)",onMouseout:"$handlers.onMouseleave(false)",role:"listbox",class:'$classes.transferlistListItems + " " + $classes.targetListItems',tabindex:"$targetOptions.length === 0 && -1 || 0",onKeydown:"$handlers.targetListKeydown",onFocus:"$handlers.targetListFocused",onBlur:"$handlers.targetListBlurred","aria-label":"Target list"}})),Yi=fi("targetListItem",()=>({for:["option","index","$targetOptions"],$el:"li",attrs:{id:'$id + "_target_list_item_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value","aria-selected":"$transferOnSelect === false && $fns.isSelected($option, $selectedTargetItems)","data-is-active":"$fns.isActive($option, $activeValue)",role:"option",onClick:"$handlers.listitemClick($option, false)",onTouchstartPassive:"$handlers.listitemTouchstart($option, false)",onTouchmovePassive:"$handlers.listitemTouchmove($option, false)",onTouchend:"$handlers.listitemTouchend($option, false)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.targetListItem'}})),ji=fi("targetOption",()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index + "_option"',"data-checked":"$fns.isSelected($option, $selectedTargetItems)",class:'$classes.transferlistOption + " " + $classes.targetOption'}})),Zi=fi("transferControls",()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}})),Gi=fi("transferButtonForward",()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_forward"',type:"button",disabled:"$selectedSourceItems.length === 0 || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForward","aria-label":"$ui.addSelectedValues.value",title:"$ui.addSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonForward'}})),Xi=fi("transferButtonForwardAll",()=>({$el:"button",attrs:{id:'$id + "_transfer_button_forward_all"',type:"button",disabled:"$sourceOptions.length === 0 || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForwardAll","aria-label":"$ui.addAllValues.value",title:"$ui.addAllValues.value",onFocus:"$handlers.transferForwardAllFocused",class:'$classes.transferlistButton + " " + $classes.transferButtonForwardAll'}})),Ji=fi("transferButtonBackward",()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_backward"',onClick:"$handlers.transferBackward",type:"button",disabled:"$selectedTargetItems.length === 0 || $targetOptions.length === 0 || $disabled","aria-label":"$ui.removeSelectedValues.value",title:"$ui.removeSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackward'}})),Qi=fi("transferButtonBackwardAll",()=>({$el:"button",attrs:{id:'$id + "_transfer_button_backward_all"',onClick:"$handlers.transferBackwardAll",type:"button",disabled:"$targetOptions.length === 0 || $disabled","aria-label":"$ui.removeAllValues.value",title:"$ui.removeAllValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackwardAll'}})),ep=fi("controlLabel","span"),tp=fi("sourceEmptyMessage",()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}})),op=fi("targetEmptyMessage",()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}})),np=fi("emptyMessageInner","span"),rp=Symbol(),sp=new WeakSet,ap=new WeakSet;function lp(e,t,o,n){if(!(e.props.disabled||(e.props.isSourceOption=o,e.props.isSourceOption&&Array.isArray(e.value)&&e.value.length>=e.props.max)))if(o){if(e.props.selectedSourceItems.includes(t))return e.props.selectedSourceItems=e.props.selectedSourceItems.filter(e=>e!==t),e.props.activeValue=void 0,void(e.props.activeDescendant=void 0);e.props.selectedTargetItems=[],e.props.selectedSourceItems=[...e.props.selectedSourceItems,t]}else{if(e.props.selectedTargetItems.includes(t))return void(e.props.selectedTargetItems=e.props.selectedTargetItems.filter(e=>e!==t));e.props.selectedSourceItems=[],e.props.selectedTargetItems=[...e.props.selectedTargetItems,t]}}function ip(e,t){if(e.props.sourceListOrigin=!0,e.props.maxReached)return;if(t){const o=Array.isArray(e.value)?[...e.value,t]:[t];return void e.input(o)}const o=e.props.selectedSourceItems.map(e=>Se(e));Array.isArray(e.value)?e.input([...e.value,...o]):e.input(o),e.props.selectedSourceItems=[]}function pp(t,o){if(t.props.sourceListOrigin=!1,o){const n=Array.isArray(t.value)?t.value.filter(t=>!e.eq(t,o)):[];return void t.input(n)}const n=t.props.selectedTargetItems.map(e=>Se(e));if(Array.isArray(t.value)){const e=t.value.filter(e=>!n.includes(e));t.input(e)}t.props.selectedTargetItems=[]}function dp(e){var t,o;if(e.props.activeValue===rp){const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_source_load_more`);return void(o&&o.scrollIntoView({block:"nearest",inline:"start"}))}const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);n&&n.scrollIntoView({block:"nearest",inline:"start"})}function cp(t){var o;if(Array.isArray(t.value)){const o=[];let n=[...t.props.options];t.value.forEach(r=>{const s=t.props.memoOptions.find(t=>e.eq(Se(t),r));if(s&&!s.noOptionFound){o.push(s);const a=t.props.options.findIndex(t=>e.eq(Se(t),r));-1!==a&&(n=n.filter(t=>!e.eq(Se(t),r)))}else{const t=n.find(t=>e.eq(Se(t),r));t?(o.push(t),n=n.filter(t=>!e.eq(Se(t),r))):o.push({label:String(r),value:r,noOptionFound:!0})}}),t.props.targetOptions=t.props.targetInputText?o.filter(e=>t.props.filter(e,t.props.targetInputText,t)):o,t.props.sourceOptions=n}else t.props.sourceOptions=[...t.props.options],t.props.targetOptions=[];if(t.props.skipSetActiveValue)return void(t.props.skipSetActiveValue=!1);(null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(t.props.id+"_source_list_items"))&&up(t)}function up(e){var t,o,n,r,s,a,l,i,p;if(e.props.isDragging)return;if(e.props.targetSearchActive){if((null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.activeElement)||void 0===o?void 0:o.id)===`${e.props.id}_target_search_input`){const t=e.props.targetOptions.find(e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)});return t?void(e.props.activeValue=Se(t)):void(e.props.activeValue=void 0)}return}if(e.props.sourceSearchActive){if((null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.activeElement)||void 0===r?void 0:r.id)===`${e.props.id}_source_search_input`){const t=e.props.sourceOptions.find(e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)});return t?void(e.props.activeValue=Se(t)):void(e.props.activeValue=void 0)}e.props.sourceSearchActive=!1}if(!1===e.props.transferOnSelect)return void(e.props.activeValue=void 0);const d=e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions;let c=!1;for(let t=e.props.activeIndex;t<=d.length;t++)if(!(null===(s=d.attrs)||void 0===s?void 0:s.disabled)&&d[t]){c=!0,e.props.activeValue=Se(d[t]);break}if(!c&&d.length)for(let t=e.props.activeIndex;t>=0;t--)if(!(null===(a=d.attrs)||void 0===a?void 0:a.disabled)&&d[t])return c=!0,void(e.props.activeValue=Se(d[t]));if(!c){let t;t=e.props.sourceListOrigin?null===(p=e.props.__root)||void 0===p?void 0:p.getElementById(`${e.props.id}`):e.props.searchable?null===(l=e.props.__root)||void 0===l?void 0:l.getElementById(`${e.props.id}_source_search_input`):null===(i=e.props.__root)||void 0===i?void 0:i.getElementById(`${e.props.id}_source_list_items`),t&&t.focus()}}function fp(e,t){return(t?e.props.sourceOptions:e.props.targetOptions).find(e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})}function vp(t){Array.isArray(t.value)&&t.value.forEach(async o=>{Ne(t,o,function(t,o){const n=[...t.props.options,...t.props.memoOptions];return n.find(t=>e.eq(Se(t),o))}(t,o))})}function hp(t){t.context&&(t.context.handlers.loadMore=Fe.bind(null,t),t.context.fns.getSourceItemCount=e=>!1===t.props.transferOnSelect&&e.length?e.length+"/"+t.props.sourceOptions.length:t.props.sourceOptions.length,t.context.fns.getTargetItemCount=e=>!1===t.props.transferOnSelect&&e.length?e.length+"/"+t.props.targetOptions.length:t.props.targetOptions.length,t.context.fns.isActive=(o,n)=>{if(!t.props.isDragging&&!t.props.touchStarted)return e.eq(n,Se(o))||void 0},t.context.fns.isSelected=(e,t)=>!!t&&(!!Array.isArray(t)&&t.includes(e)),t.context.fns.optionLoading=e=>t.props.optionLoaderValues.includes(Se(e)),t.context.handlers.clearSearch=()=>{!function(e){var t;e.props.sourceSearchActive=!1,e.props.inputText="",Ve(e,"",!0);const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_source_search_input`);if(!o)return;o.focus()}(t)},t.context.handlers.clearTargetSearch=()=>{!function(e){var t;e.props.targetSearchActive=!1,e.props.targetInputText="";const o=[...new Set([...e.props.options,...e.props.memoOptions])],n=[];for(const t of e.value){const e=o.find(e=>Se(e)===t);e&&n.push(e)}e.props.targetOptions=n;const r=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_target_search_input`);if(!r)return;r.focus()}(t)},t.context.handlers.sourceSearchBlur=e=>{setTimeout(()=>{var o;if(e.relatedTarget&&e.relatedTarget instanceof HTMLElement&&(e.relatedTarget.id===`${t.props.id}_source_list_items`||e.relatedTarget.id===`${t.props.id}`)){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}_source_search_input`);if(!e)return;e.focus()}else t.props.activeValue=void 0})},t.context.handlers.targetSearchBlur=e=>{setTimeout(()=>{var o;if(e.relatedTarget&&e.relatedTarget instanceof HTMLElement&&(e.relatedTarget.id===`${t.props.id}_source_list_items`||e.relatedTarget.id===`${t.props.id}`)){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}_target_search_input`);if(!e)return;e.focus()}else t.props.activeValue=void 0})},t.context.handlers.listitemClick=(e,o)=>n=>{mp(t,e,o)},t.context.handlers.transferForward=ip.bind(null,t,void 0),t.context.handlers.transferForwardAll=()=>{let e;if(t.props.maxReached)return;const o=t.props.sourceOptions.map(e=>Se(e));e=Array.isArray(t.value)?[...t.value,...o]:[...o],t.input(e),t.props.selectedSourceItems=[]},t.context.handlers.transferBackward=pp.bind(null,t,void 0),t.context.handlers.transferBackwardAll=()=>{Array.isArray(t.value)&&(t.input([]),t.props.selectedTargetItems=[])},t.context.handlers.onSearch=e=>{!function(e,t){e.props.sourceSearchActive=!0;const o=t.target;e.props.inputText=o.value,Ve(e,o.value,!0)}(t,e)},t.context.handlers.onTargetSearch=e=>{!function(e,t){e.props.targetSearchActive=!0;const o=t.target;e.props.targetInputText=o.value;const n=[...new Set([...e.props.memoOptions,...e.props.options])],r=[];for(const t of e.value){const e=n.find(e=>Se(e)===t);e&&r.push(e)}const s=[...new Map([...e.props.targetOptions,...r].map(e=>[JSON.stringify(e),e])).values()];e.props.targetOptions=s.filter(t=>e.props.filter(t,o.value,e)),0===e.props.targetOptions.length?e.props.showTargetEmptyMessage=!0:e.props.showTargetEmptyMessage=!1;up(e)}(t,e)},t.context.handlers.onMouseenter=e=>o=>{"touchstart"!==o.type&&(e?t.props.mouseOnSource=!0:t.props.mouseOnTarget=!0)},t.context.handlers.onMouseleave=e=>o=>{var n;if("touchend"===o.type)return;const r=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(e?`${t.props.id}_source_list_items`:`${t.props.id}`);r&&(r.contains(o.relatedTarget)||(t.props.trackHover=!1,t.props.activeValue=void 0,t.props.activeDescendant=void 0,t.props.activeIndex=void 0,e?t.props.mouseOnSource=!1:t.props.mouseOnTarget=!1))},t.context.handlers.listitemClick=(e,o)=>n=>{n instanceof MouseEvent&&t.props.touchStarted||mp(t,e,o)},t.context.handlers.listitemTouchstart=()=>()=>{!function(e){e.props.touchStarted=!0}(t)},t.context.handlers.listitemTouchend=(e,o)=>n=>{!function(e,t,o){if(e.props.touchMoved)return e.props.touchMoved=!1,void(e.props.touchStarted=!1);const n=Se(t);e.props.activeIndex=e.props.sourceOptions.findIndex(e=>Se(e)===n),e.props.transferOnSelect?o?ip(e,n):pp(e,n):lp(e,t,o)}(t,e,o)},t.context.handlers.listitemTouchmove=()=>e=>{!function(e){e.props.touchMoved=!0}(t)},t.context.handlers.sourceSearchFocus=e=>{gp(t,!0)},t.context.handlers.targetSearchFocus=e=>{gp(t,!1)},t.context.handlers.sourceListFocused=e=>{gp(t,!0)},t.context.handlers.targetListFocused=()=>{gp(t,!1)},t.context.handlers.sourceListBlurred=e=>{t.props.activeValue=void 0},t.context.handlers.targetListBlurred=e=>{t.props.activeValue=void 0},t.context.handlers.sourceListKeydown=e=>{$p(t,e,!0)},t.context.handlers.targetListKeydown=e=>{$p(t,e,!1)},t.context.handlers.sourceSearchKeydown=e=>{$p(t,e,!0)},t.context.handlers.targetSearchKeydown=e=>{$p(t,e,!1)})}function mp(t,o,n,r){var s;if(Se(o)===rp)return void(null===(s=t.context)||void 0===s||s.handlers.loadMore(!0));const a=Se(o);t.props.activeIndex=t.props.sourceOptions.findIndex(t=>e.eq(Se(t),a)),t.props.transferOnSelect?n?ip(t,a):pp(t,a):lp(t,o,n)}function gp(e,t){const o=fp(e,t);o&&(e.props.sourceListOrigin=t,e.props.activeValue=Se(o))}function $p(e,t,o){if("ArrowDown"===t.key||"ArrowUp"===t.key)!function(e,t,o){var n,r,s;e.preventDefault();const a=o?t.props.sourceOptions:t.props.targetOptions,l=a.reduce((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(Se(t)),e},[]);(null===(n=t.store.hasNextPage)||void 0===n?void 0:n.value)&&l.push(rp);const i=l.indexOf(t.props.activeValue);if("ArrowUp"===e.key&&0!==i)for(let e=i-1;e>=0;e--){t.props.sourceListOrigin=o,t.props.activeValue=l[i-1];break}else if("ArrowDown"===e.key&&i!==l.length-1)for(let e=i+1;e<l.length;e++)if(!(null===(s=null===(r=a[e])||void 0===r?void 0:r.attrs)||void 0===s?void 0:s.disabled)){t.props.sourceListOrigin=o,t.props.activeValue=l[e];break}dp(t)}(t,e,o);else if("ArrowRight"===t.key||"ArrowLeft"===t.key){if("ArrowLeft"===t.key&&o)return;if("ArrowRight"===t.key&&!o)return;!function(e,t,o){if(t.props.searchable)return;e.preventDefault(),function(e,t){var o,n,r;if(fp(e,!t))if(t){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);t&&t.focus()}else if(e.props.searchable){const t=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_source_search_input`);t&&t.focus()}else{const t=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_source_list_items`);t&&t.focus()}}(t,o)}(t,e,o)}else"Enter"===t.key&&function(e,t,o){var n;if(e.preventDefault(),!t.props.activeValue)return;if(t.props.activeValue===rp)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore(!0));const r=o?t.props.sourceOptions:t.props.targetOptions,s=r.findIndex(e=>Se(e)===t.props.activeValue);t.props.activeIndex=s;const a=r[s];if(!a)return;t.props.transferOnSelect?o?ip(t,Se(a)):pp(t,Se(a)):lp(t,a,o)}(t,e,o)}function bp(t){t.on("created",()=>{if("function"==typeof t.props.optionsLoader&&(t.props.skipSetActiveValue=!0,Ke(t)),hp(t),t.props.disabled&&(t.props.draggable=!1),c){e.whenAvailable(t.props.id+"_source_list_items",e=>{e instanceof HTMLElement&&function(e,t){if(!e.context)return;function o(){return e.props.sourceOptions.map(e=>Se(e))}function r(){return[]}const s={longTouch:!0,draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,group:e.props.id,root:e.props.__root||document,disabled:!e.props.draggable||e.props.maxReached,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,selectionDraggingClass:e.context.classes.selectionDragging,selectionDropZoneClass:e.context.classes.selectionDropZone,touchSelectionDraggingClass:e.context.classes.touchSelectionDragging,touchSelectionDropZoneClass:e.context.classes.touchSelectionDropZone,longTouchClass:e.context.classes.longTouch,handleTouchmove(t){e.props.selectedSourceItems=[],n.handleTouchmove(t)},draggable:e=>"option"===e.getAttribute("role")};s.plugins=[n.multiDrag({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,n.handleDragstart(t)},handleEnd(t){n.handleEnd(t),e.props.isDragging=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.activeDescendant=void 0,e.props.isDragging=!1,e.props.selectedTargetItems=[],e.props.selectedSourceItems=[]},handleTouchstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.mouseOnSource=!1,e.props.mouseOnTarget=!1,n.handleTouchstart(t)},selections:()=>e.props.selectedSourceItems.map(e=>Se(e))})],n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s}),e.on("prop:disabled",({payload:e})=>{s.disabled=e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})}),e.on("prop:draggable",({payload:e})=>{s.disabled=!e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})}),e.on("prop:maxReached",({payload:e})=>{s.disabled=e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})})}(t,e)},t.props.__root),e.whenAvailable(`${t.props.id}`,e=>{e instanceof HTMLElement&&function(e,t){if(!e.context)return;function o(){return e.props.targetOptions.map(e=>Se(e))}function r(t,o){e.props.sourceListOrigin=!0,e.input(t)}const s={longTouch:!0,root:e.props.__root,group:e.props.id,disabled:!e.props.draggable,draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,selectionDraggingClass:e.context.classes.selectionDragging,selectionDropZoneClass:e.context.classes.selectionDropZone,touchSelectionDraggingClass:e.context.classes.touchSelectionDragging,touchSelectionDropZoneClass:e.context.classes.touchSelectionDropZone,longTouchClass:e.context.classes.longTouch,draggable:e=>"option"===e.getAttribute("role"),plugins:[]};s.plugins=[n.multiDrag({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,n.handleDragstart(t)},handleEnd(t){n.handleEnd(t),e.props.selectedTargetItems=[],e.props.selectedSourceItems=[],e.props.activeValue=void 0,e.props.trackHover=!0,e.props.isDragging=!1},handleTouchstart(t){e.props.trackHover=!1,e.props.activeValue=void 0,e.props.isDragging=!0,e.props.activeDescendant=void 0,n.handleTouchstart(t)},selections:()=>e.props.selectedTargetItems.map(e=>Se(e))})],n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s}),e.on("prop:disabled",({payload:e})=>{s.disabled=e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})}),e.on("prop:draggable",({payload:e})=>{s.disabled=!e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})})}(t,e)},t.props.__root);const o=e=>{var o;if(t.props.isDragging)return;t.props.mouseX=e.clientX,t.props.mouseY=e.clientY;const n=t.props.mouseOnSource?`${t.props.id}_source_list_items`:`${t.props.id}`,r=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(n);if(r){const o=r.getBoundingClientRect();e.clientX>o.x&&e.clientX<o.x+o.width&&e.clientY>o.y&&e.clientY<o.y+o.height&&(t.props.trackHover=!0)}};document.addEventListener("mousemove",o)}})}function yp(e,t){var o;let n=null,r="",s=[];if(e.props.mouseOnSource){if(n=sp.has(e),r=`${e.props.id}_source_list_item`,s=[...e.props.sourceOptions],!s||!s.length||n)return s=[],r="",void(n=null)}else if(e.props.mouseOnTarget&&(n=ap.has(e),r=`${e.props.id}_target_list_item`,s=[...e.props.targetOptions],!s||!s.length||n))return s=[],r="",void(n=null);const a=s.reduce((t,o,n)=>{var s,a;if(null===(s=o.attrs)||void 0===s?void 0:s.disabled)return t;const l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(r+`_${n}`);return l&&t.push([l,o]),t},[]),l=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);l&&a.push([l,e.props.loadMoreOption]),e.props.mouseOnSource&&sp.add(e),e.props.mouseOnTarget&&ap.add(e),a.length&&xp(e,a,null,t)}function xp(e,t,o,n){const r=n?n.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.trackHover){if(e.props.mouseY>r.top&&e.props.mouseY<r.bottom){let n=o||0,r=o;const s=(t,n)=>{var r;const s=n[0],{y:a,height:l,x:i,width:p}=s.getBoundingClientRect();if(e.props.mouseX>i&&e.props.mouseX<i+p&&e.props.mouseY>a&&e.props.mouseY<a+l){o=t;const s=n[1];return e.props.activeValue=s&&!(null===(r=s.attrs)||void 0===r?void 0:r.disabled)?Se(s):void 0,!0}return!1};do{if(null!==n&&s(n,t[n]))break;if(null!==r&&s(r,t[r]))break;null!==n&&(n++,n>t.length-1&&(n=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==n||null!==r)}}else dp(e);e.props.mouseOnSource||e.props.mouseOnTarget?e.props.mouseOnSource&&sp.has(e)||e.props.mouseOnTarget&&ap.has(e)?requestAnimationFrame(xp.bind(null,e,t,o,n)):yp(e,n):(sp.delete(e),ap.delete(e))}const wp={schema:/* #__PURE__ */vi(/* #__PURE__ */_i(/* #__PURE__ */ki("$label"),/* #__PURE__ */yi("$help"),/* #__PURE__ */hi(/* #__PURE__ */Si(/* #__PURE__ */Li(/* #__PURE__ */Ii(),/* #__PURE__ */Di(/* #__PURE__ */z("$optionsLoadingCounter > 0",/* #__PURE__ */gi("loader"),"$fns.getSourceItemCount($selectedSourceItems)"))),/* #__PURE__ */Ti(/* #__PURE__ */Ei(/* #__PURE__ */Oi(),/* #__PURE__ */Pi(/* #__PURE__ */gi("close")))),/* #__PURE__ */Hi(/* #__PURE__ */tp(/* #__PURE__ */np("$sourceEmptyMessage")),/* #__PURE__ */Ri(/* #__PURE__ */z("$transferOnSelect !== true && $fns.isSelected($option, $selectedSourceItems)",/* #__PURE__ */gi("selected")),/* #__PURE__ */Ni("$option.label")),/* #__PURE__ */Ki(/* #__PURE__ */z("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",/* #__PURE__ */Wi(/* #__PURE__ */z("$state.loading",/* #__PURE__ */gi("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),/* #__PURE__ */Zi(/* #__PURE__ */Xi(/* #__PURE__ */ep("$ui.addAllValues.value"),/* #__PURE__ */gi("fastForward")),/* #__PURE__ */Gi(/* #__PURE__ */ep("$ui.addSelectedValues.value"),/* #__PURE__ */gi("moveRight")),/* #__PURE__ */Ji(/* #__PURE__ */ep("$ui.removeSelectedValues.value"),/* #__PURE__ */gi("moveLeft")),/* #__PURE__ */Qi(/* #__PURE__ */ep("$ui.removeAllValues.value"),/* #__PURE__ */gi("rewind"))),/* #__PURE__ */qi(/* #__PURE__ */zi(/* #__PURE__ */Ai(),/* #__PURE__ */Ci("$fns.getTargetItemCount($selectedTargetItems)")),/* #__PURE__ */Fi(/* #__PURE__ */Mi(/* #__PURE__ */Vi(),/* #__PURE__ */Bi(/* #__PURE__ */gi("close")))),/* #__PURE__ */Ui(/* #__PURE__ */op(/* #__PURE__ */z("$state.loading !== true",/* #__PURE__ */np("$targetEmptyMessage"))),/* #__PURE__ */Yi(/* #__PURE__ */z("$transferOnSelect !== true && $fns.isSelected($option, $selectedTargetItems)",/* #__PURE__ */gi("selected")),/* #__PURE__ */ji(/* #__PURE__ */z("$fns.optionLoading($option, $optionLoaderValues)","$ui.isLoading.value","$option.label")))))),/* #__PURE__ */xi(/* #__PURE__ */wi("$message.value")))),type:"input",props:[],features:[
|
|
49
49
|
/* #__PURE__ */o.defaultIcon("moveRight","right"),
|
|
50
50
|
/* #__PURE__ */o.defaultIcon("moveLeft","left"),
|
|
51
51
|
/* #__PURE__ */o.defaultIcon("fastForward","fastForward"),
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
/* #__PURE__ */o.localize("addAllValues"),
|
|
59
59
|
/* #__PURE__ */o.localize("addSelectedValues"),
|
|
60
60
|
/* #__PURE__ */o.localize("removeSelectedValues"),
|
|
61
|
-
/* #__PURE__ */o.localize("removeAllValues"),o.options,function(t){!function(t){t.addProps(["search","options","selectedItems","activeValue","activeIndex","activeDescendant","targetOptions","sourceOptions","optionLoader","isLoadingOptions","filterOptions","inputText","hasNextPage","page","targetLoading","searchable","sourceLabel","targetLabel","transferOnSelect","disabled","placeholder","filter","showSourceEmptyMessage","showTargetEmptyMessage","sourceEmptyMessage","targetEmptyMessage","clearOnSelect","max","maxReached","debounce","sourceListActive","optionLoaderValues","optionLoadingCounter","optionsLoadingCounter","memoOptions","optionsLoaded","selectedSourceItems","selectedTargetItems","draggable","loadMore","loadMoreOption","targetSearchable","targetInputText"]),t.props.loadMoreOption={label:"Load more",value:rp},void 0===t.props.draggable?t.props.draggable=!0:"false"===t.props.draggable&&(t.props.draggable=!1),t.props.optionsLoaderValues=[],t.props.selectedSourceItems=[],t.props.selectedTargetItems=[],t.props.optionsLoaded=void 0,t.props.memoOptions=[],t.props.multiple=!0,t.props.debounce=t.props.debounce?parseInt(t.props.debounce):200,t.props.optionLoaderValues=[],t.props.optionsLoadingCounter=0,t.props.optionLoadingCounter=0,t.props.page=1,t.props.hasNextPage=We.bind(null,t),t.props.options?t.props.options=[...t.props.options]:t.props.options=[],t.props.sourceOptions=[],t.props.targetOptions=[],"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.props.searchable=e.undefine(t.props.searchable),t.props.searchable&&(t.props.inputText=""),t.props.targetSearchable=e.undefine(t.props.targetSearchable),t.props.targetSearchable&&(t.props.targetInputText=""),t.props.clearOnSelect=e.undefine(t.props.clearOnSelect),void 0===t.props.transferOnSelect?t.props.transferOnSelect=!0:"false"===t.props.transferOnSelect&&(t.props.transferOnSelect=!1),t.props.targetOptions.length&&(t.props.targetOptionValues=t.props.targetOptions.map(e=>Se(e))),t.props.initialOptions=[...t.props.options],t.props.max&&(t.props.max=parseInt(t.props.max)),t.props.sourceListOrigin=void 0,"function"!=typeof t.props.filter&&(t.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase()))}(t),function(e){e.on("commit",async({payload:t})=>{e.props.activeValue=void 0,e.props.max&&(e.props.maxReached=t.length>=e.props.max),e.props.clearOnSelect&&e.props.inputText&&(e.props.reFilter=!0,e.props.inputText=""),e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])],e.props.searchable&&e.props.reFilter&&!e.props.initialLoad?(Ve(e,e.props.inputText),e.props.reFilter=!1):e.props.initialLoad||(e.isCreated||(e.props.skipSetActiveValue=!0),cp(e)),"function"==typeof e.props.optionLoader?vp(e):e.props.initialLoad||(e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])])})}(t),bp(t),function(t){t.on("prop:options",()=>{t.props.appendingOptions&&(t.props.skipSetActiveValue=!0,t.props.appendingOptions=!1),cp(t)}),t.on("prop:memoOptions",()=>{t.props.skipSetActiveValue=!0,cp(t)}),t.on("prop:sourceOptions",()=>{0===t.props.sourceOptions.length?t.props.showSourceEmptyMessage=!0:t.props.showSourceEmptyMessage=!1,sp.delete(t)}),t.on("prop:targetOptions",()=>{0===t.props.targetOptions.length?t.props.showTargetEmptyMessage=!0:t.props.showTargetEmptyMessage=!1}),t.on("prop:activeValue",({payload:o})=>{if(t.props.isDragging)return void(t.props.activeDescendant=void 0);if(o===rp)return void(t.props.activeDescendant=`${t.props.id}_load_more`);const n=(t.props.sourceListOrigin?t.props.sourceOptions:t.props.targetOptions).findIndex(t=>e.eq(Se(t),o));n>=0&&t.props.sourceListOrigin?t.props.activeDescendant=`${t.props.id}_source_list_item_${n}`:t.props.activeDescendant=n>=0?`${t.props.id}_target_list_item_${n}`:void 0}),t.on("prop:mouseOnSource",({payload:e})=>{var o;if(e&&!0!==t.props.disabled&&!t.props.isDragging){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(t.props.id+"_source_list_items");if(!e)return;t.props.mouseOnTarget=!1,t.props.sourceListOrigin=!0,sp.delete(t),yp(t,e)}}),t.on("prop:mouseOnTarget",({payload:e})=>{var o;if(e&&!0!==t.props.disabled&&!t.props.isDragging){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}`);if(!e)return;t.props.mouseOnSource=!1,t.props.sourceListOrigin=!1,ap.delete(t),yp(t,e)}}),t.on("prop:optionsLoadingCounter",({payload:e})=>{0===e&&0===t.props.optionLoadingCounter&&t.store.set(Be)}),t.on("prop:optionLoadingCounter",({payload:e})=>{0===e&&0===t.props.optionsLoadingCounter&&(t.store.set(Be),t.props.skipSetActiveValue=!0,cp(t))})}(t)}]};const _p=/* #__PURE__ */K("sl"),{outer:kp,wrapper:Sp,inner:Lp,icon:Ip,prefix:Dp,suffix:Ap,help:Cp,messages:Tp,message:Ep}=/* #__PURE__ */W(_p),Op=_p("label",()=>({if:"$label",$el:"label",attrs:{id:"$id + '_label'"}})),Mp=_p("chart",()=>({$el:"div",if:"$chart"})),Vp=_p("chartBar",()=>({$el:"div",for:["bar","index","$chart"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$bar.at >= $_value.0 && $bar.at <= $_value.1",else:"$bar.at >= $_value.1 && $bar.at <= $_value.0"},else:"$bar.at <= $_value"},style:{left:'$bar.at / ($max - $min) * 100 + "%"',width:'$: "calc(" + (100 / $chart.length) + "% - 2px)"',height:{if:"$largestBar",then:'$bar.value / $largestBar * 100 + "%"'}}}})),Fp=_p("sliderInner",()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}})),Pp=_p("track",()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}})),Bp=_p("trackWrapper",()=>({$el:"div"})),Hp=_p("trackInner",()=>({$el:"div"})),Rp=_p("fill",()=>({$el:"div",attrs:{style:"$fillStyles"}})),Np=_p("linkedValues",()=>({$el:"div"})),Kp=_p("maxValue",()=>({$formkit:"number",bind:"$computedMaxInputAttrs",ignore:!0,number:!0,value:{if:"$isMulti",then:"$_value.1",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.maxNode",onBlur:"$handlers.inputBlur"})),Wp=_p("minValue",()=>({$formkit:"number",if:"$isMulti",bind:"$computedMinInputAttrs",ignore:!0,number:!0,value:{if:"$isMulti",then:"$_value.0",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.minNode",onBlur:"$handlers.inputBlur"})),qp=_p("marks",()=>({$el:"div",if:"$marks"})),zp=_p("mark",()=>({$el:"span",for:["step","index","$marks"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$step.at >= $_value.0 && $step.at <= $_value.1",else:"$step.at >= $_value.1 && $step.at <= $_value.0"},else:"$step.at <= $_value"},class:{if:"$step.class",then:'$: $classes.mark + " " + $step.class',else:"$classes.mark"},style:{left:'$: $fns.calculateMarkPosition($step.at) + "%"'}}})),Up=_p("markLabel",()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}})),Yp=_p("handles",()=>({$el:"ul"})),jp=_p("handleMax",()=>({$el:"li",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "max"',"data-handle":"max","data-show-tooltip":"$tooltip",class:"$: 'formkit-handle ' + $classes.handle + ' ' + $classes.handleMax",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstartPassive:"$handlers.startDrag",style:"$maxHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}})),Zp=_p("handleMin",()=>({$el:"li",if:"$isMulti",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "min"',"data-handle":"min","data-show-tooltip":"$tooltip",class:"$: $classes.handle + ' ' + $classes.handleMin",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstartPassive:"$handlers.startDrag",style:"$minHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}})),Gp=_p("handleMinInner",()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}})),Xp=_p("handleMaxInner",()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}})),Jp=_p("tooltipMax",()=>({$el:"div",if:'$tooltip === true || $tooltip === "auto"',children:{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.1, "max")',else:'$tooltipFormat($_value.0, "max")'},else:'$tooltipFormat($_value, "max")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMax"}})),Qp=_p("tooltipMin",()=>({$el:"div",if:'$isMulti && ($tooltip === true || $tooltip === "auto")',children:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.0, "min")',else:'$tooltipFormat($_value.1, "min")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMin"}})),ed={schema:/* #__PURE__ */kp(/* #__PURE__ */Sp(/* #__PURE__ */Op("$label"),/* #__PURE__ */Cp("$help"),/* #__PURE__ */Fp(/* #__PURE__ */Ip("prefix"),/* #__PURE__ */Dp(),/* #__PURE__ */Pp(/* #__PURE__ */Mp(/* #__PURE__ */Vp()),/* #__PURE__ */Bp(/* #__PURE__ */Hp(/* #__PURE__ */Rp(),/* #__PURE__ */qp(/* #__PURE__ */zp(/* #__PURE__ */Up())),/* #__PURE__ */Yp(/* #__PURE__ */Zp(/* #__PURE__ */Qp(),/* #__PURE__ */Gp()),/* #__PURE__ */jp(/* #__PURE__ */Jp(),/* #__PURE__ */Xp()))))),/* #__PURE__ */Ap(),/* #__PURE__ */Ip("suffix"),/* #__PURE__ */z("$showInput && $isMulti === false",/* #__PURE__ */Kp())),/* #__PURE__ */z("$showInput && $isMulti",/* #__PURE__ */Np(/* #__PURE__ */Wp(),/* #__PURE__ */Kp())),/* #__PURE__ */Tp(/* #__PURE__ */Ep("$message.value")))),type:"input",family:"",props:["min","max","step","showInput","tooltip","tooltipFormat","inputAttrs","maxInputAttrs","minInputAttrs","marks","markLabels","snapToMarks","chart","scalingFunction","intervals"],features:[function(t){let o,n,r;t.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]);const s={linear:{forward:e=>e,reverse:e=>e},log:{forward:(e,o=t.props.min,n=t.props.max)=>n*Math.pow(e/n,1.5),reverse:(e,o=t.props.min,n=t.props.max)=>n*Math.pow(e/n,1/1.5)}};let a=!1;function l(){const e=document.activeElement;if(e instanceof HTMLInputElement){const t=e.value;e.value="",e.value=t}}function i(e){if(!e)return;const t={disabled:e.props.disabled,min:"number"==typeof e.props.min?e.props.min:0,max:"number"==typeof e.props.max?e.props.max:void 0,step:e.props.step||1};e.props.minInputAttrs=Object.assign(e.props.minInputAttrs||{},t),e.props.maxInputAttrs=Object.assign(e.props.maxInputAttrs||{},t),e.props.inputAttrs=e.props.inputAttrs&&"object"==typeof e.props.inputAttrs?Object.assign(e.props.inputAttrs,t):t,e.props.computedMaxInputAttrs=e.props.maxInputAttrs&&"object"==typeof e.props.maxInputAttrs?Object.assign({},e.props.inputAttrs,e.props.maxInputAttrs):e.props.inputAttrs,e.props.computedMinInputAttrs=e.props.minInputAttrs&&"object"==typeof e.props.minInputAttrs?Object.assign({},e.props.inputAttrs,e.props.minInputAttrs):e.props.inputAttrs}function p(e){const{min:o,max:n,intervals:r}=t.props;if(e=Math.min(Math.max(e,0),100),!r||0===r.length){b();const r=o+e/100*(n-o);return t.props.scalingFunction.reverse(r,o,n)}const s=c(r,o,n);for(let t=0;t<s.length;t++){const{value:o,step:n,left:r,width:a,stepsInInterval:l}=s[t];if(e>=r&&e<=r+a){const t=o+(e-r)/a*l*n,s=t%n;return m(s<n/2?t-s:t+(n-s))}}return e>100?n:e<0?o:void 0}function d(e,o=t.props.min,n=t.props.max){const r=t.props.intervals;if(!r||0===r.length){b();return(t.props.scalingFunction.forward(e,o,n)-o)/(n-o)*100}const s=c(r,o,n);for(let t=0;t<s.length;t++){const{value:o,step:r,left:a,width:l,stepsInInterval:i}=s[t],p=t<s.length-1?s[t+1].value:n;if(e>=o&&e<=p){return 100*((a+(e-o)/r/i*l)/100)}}return 100}function c(e,o=t.props.min,n=t.props.max){(e=[...e]).sort((e,t)=>e.value-t.value),e[0].value!==o&&e.unshift({value:o,step:t.props.step});let r=0;for(let t=0;t<e.length;t++){const o=e[t].value,s=((t<e.length-1?e[t+1].value:n)-o)/e[t].step;r+=s}let s=0;return e.map((t,o)=>{const a=t.value,l=((o<e.length-1?e[o+1].value:n)-a)/t.step,i=s/r*100;return s+=l,{value:t.value,step:t.step,left:i,width:l/r*100,stepsInInterval:l,totalSteps:r}})}function u(){const e=parseFloat(`${t.props.min}`),o=parseFloat(`${t.props.max}`);let n,r=0;if(Array.isArray(t._value)){const e=[...t._value].sort(f);r=parseFloat(`${e[0]}`),n=parseFloat(`${e[1]}`)}else n=parseFloat(`${t._value}`);t.props.maxHandleStyles={left:`${d(n,e,o)}%`},t.props.isMulti&&Array.isArray(t._value)?(t.props.minHandleStyles={left:`${d(r,e,o)}%`},t.props.fillStyles={left:`${d(r,e,o)}%`,width:d(n,e,o)-d(r,e,o)+"%"}):t.props.fillStyles={left:"0%",width:`${d(n,e,o)}%`}}function f(e,t){return parseFloat(`${e}`)-parseFloat(`${t}`)}function v(e,n=!0){if(t.props.disabled)return;let r;if(void 0===e){if(t.props.isMulti)t.input([g(t.props.min),g(t.props.max)]);else{const e=t.props.min+(t.props.max-t.props.min)/2;t.input(g(e))}return void u()}if(t.props.isMulti&&Array.isArray(t._value)&&!Array.isArray(e)){const n="min"===t.props.lastHandleInteraction?0:1,s=[...t._value];s[n]=e;const[a,l]=s;if(a>=l){const e=null==o?void 0:o.querySelector(`[data-handle="${"min"===t.props.lastHandleInteraction?"max":"min"}"]`);null==e||e.focus()}r=g([...s].sort(f))}else Array.isArray(e)?r=g(e):(r=g(e),r=isNaN(r)?t.props.min:r);t.props.snapToMarks&&(r=$(r));const s=g(h(r));n&&t.input(s),u()}function h(e){return t.props.isMulti&&Array.isArray(e)?[h(e[0]),h(e[1])]:(e=isNaN(e)?t.props.min:e,Math.min(Math.max(parseFloat(`${e}`),t.props.min),t.props.max))}function m(e){return parseFloat(e.toFixed(t.props.decimals))}function g(e){if(t.props.snapToMarks)return e;if(!t.props.intervals)return Array.isArray(e)?e.map(e=>m(Math.round(e/t.props.step)*t.props.step)):m(Math.round(e/t.props.step)*t.props.step);const o=c(t.props.intervals);if(Array.isArray(e))return e.map(e=>{const n=o.find((n,r)=>{var s;return e>=n.value&&e<((null===(s=o[r+1])||void 0===s?void 0:s.value)||t.props.max)});if(!n)return e;return m(n.value+Math.round((e-n.value)/n.step)*n.step)});{const n=o.find((n,r)=>{var s;return e>=n.value&&e<((null===(s=o[r+1])||void 0===s?void 0:s.value)||t.props.max)});if(!n)return e;return m(n.value+Math.round((e-n.value)/n.step)*n.step)}}function $(e){if(Array.isArray(e))return e[0]=$(e[0]),e[1]=$(e[1]),e;{const o=t.props.marks,n=o.reduce((t,o)=>Math.abs(o.at-e)<Math.abs(t.at-e)?o:t,o[0]);return n.at}}function b(){if(a)return;e.undefine(t.props.scalingFunction)?"string"==typeof t.props.scalingFunction?t.props.scalingFunction=s[t.props.scalingFunction]||s.linear:"object"==typeof t.props.scalingFunction&&(t.props.scalingFunction={...s.linear,...t.props.scalingFunction}):t.props.scalingFunction=s.linear,a=!0}t.props.maxHandleStyles={left:"0%"},t.props.fillStyles={left:"0%",width:"0%"},t.props.isMulti=!1,t.props.step=1,t.props.min=0,t.props.max=100,t.props.tooltipFormat="function"==typeof t.props.tooltipFormat?t.props.tooltipFormat:(e,t)=>{if(t)return e},t.props.largestBar=0,"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.on("created",()=>{var s;b(),t.props.isMulti=Array.isArray(t.value),t.props.step=parseFloat(`${t.props.step}`),t.props.decimals=(null===(s=t.props.step.toString().split(".")[1])||void 0===s?void 0:s.length)||0,t.props.min=t.props.min?parseFloat(`${t.props.min}`):0,t.props.max=t.props.max?parseFloat(`${t.props.max}`):100;const a=e.undefine(t.props.tooltip);t.props.tooltip=void 0===t.props.tooltip?"auto":a;const m=e.undefine(t.props.marks);if(t.props.marks=!!m&&(Array.isArray(t.props.marks)?t.props.marks:function(){const{min:e,max:o,step:n}=t.props,r=[];for(let t=e;t<=o;t+=n)r.push({at:t,label:t});return r}()),t.props.markLabels=e.undefine(t.props.markLabels),t.props.snapToMarks=e.undefine(t.props.snapToMarks),t.props.showInput=e.undefine(t.props.showInput),t.props.largestBar=t.props.chart?t.props.chart.reduce((e,t)=>t.value>e?t.value:e,0):t.props.largestBar,i(t),e.whenAvailable(`track-${t.props.id}`,()=>{var e;o=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`track-${t.props.id}`),v(t.value,!1),u()},t.props.__root),t.context){let s=0,a="";const i=t.context.handlers.blur;t.context.handlers.blur=e=>{i(e),t.emit("blur")},t.context.handlers.clickTrack=e=>{if(!o)return;t.props.dragging=!1;const{left:n,width:r}=o.getBoundingClientRect(),s=(e.clientX-n)/r;if(t.props.isMulti&&Array.isArray(t.value)){const[e,o]=t.value,n=Math.abs(e-s*t.props.max)<Math.abs(o-s*t.props.max)?"min":"max",r="min"===n?0:1;t.props.lastHandleInteraction=n,t.value[r]=p(100*s),v(t._value)}else v(p(100*s))},t.context.handlers.focus=e=>{if(!o)return;const n=e.target.dataset.handle;n&&(t.props.lastHandleInteraction=n)},t.context.handlers.clickHandle=e=>{e.stopPropagation(),t.props.attrs.onClick&&t.props.attrs.onClick(e),t.props.dragging=!1,v(t._value)},t.context.handlers.startDrag=e=>{if(!o)return;t.props.dragging=!0;const n="touchstart"===e.type,r=n?"touchmove":"mousemove",s=n?"touchend":"mouseup";t.props.lastHandleInteraction=e.target.dataset.handle||t.props.lastHandleInteraction,document.addEventListener(r,x,{passive:!1}),document.addEventListener(s,()=>{t.context&&(t.props.dragging=!1,document.removeEventListener(r,x),n&&e.target instanceof HTMLElement&&e.target.blur())})},t.context.handlers.keydown=e=>{if(["1","2","3","4","5","6","7","8","9","0",".","-"].includes(e.key)){e.preventDefault(),clearTimeout(s),a+=e.key;const t="-"===a?-1:1;s=window.setTimeout(()=>{"-"!==a?(v(parseFloat(a)*t),a=""):a=""},350)}if(["ArrowLeft","ArrowDown","ArrowRight","ArrowUp","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const o="min"===t.props.lastHandleInteraction?0:1,n=Array.isArray(t._value)?t._value[o]:t._value,r=function(e,o){if(!t.props.intervals)return t.props.step;const n=c(t.props.intervals);if(e>=t.props.max)return n[n.length-1].step;let r=n.find((o,r)=>{var s;return e>=o.value&&e<((null===(s=n[r+1])||void 0===s?void 0:s.value)||t.props.max)});if(!r)return t.props.step;if(-1===o){e-r.step<r.value&&(r=n[n.indexOf(r)-1]||r)}return r.step}(n,["ArrowLeft","ArrowDown","PageDown"].includes(e.key)?-1:1);if(t.props.marks&&t.props.snapToMarks){const o=$(n),r=t.props.marks.find(e=>e.at===o),s=t.props.marks.indexOf(r),a=["ArrowLeft","ArrowDown"].includes(e.key)?-1:1,l=Math.min(Math.max(0,s+a),t.props.marks.length-1);return void v(t.props.marks[l].at)}if(e.metaKey)return void("ArrowLeft"===e.key||"ArrowDown"===e.key?v(t.props.min):v(t.props.max));if("Home"===e.key)return void v(t.props.min);if("End"===e.key)return void v(t.props.max);if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key)){v(n+(e.shiftKey?10*r:r)*(["ArrowLeft","ArrowDown"].includes(e.key)?-1:1))}"PageUp"===e.key?v(n+10*r):"PageDown"===e.key&&v(n-10*r)}},t.context.handlers.maxNode=o=>{r=o,o.hook.commit((n,r)=>{if(e.eq(o.value,n))return r(n);if(`${o.value}`.includes(".")&&!`${n}`.includes(".")&&l(),t.props.isMulti&&Array.isArray(t.value)){v([t.value[0],n])}else v(n);return r(h(n))})},t.context.handlers.minNode=o=>{n=o,o.hook.commit((n,r)=>{if(e.eq(o.value,n))return r(n);if(`${o.value}`.includes(".")&&!`${n}`.includes(".")&&l(),t.props.isMulti&&Array.isArray(t.value)){v([n,t.value[1]])}else v(n);return r(h(n))})},t.context.handlers.inputBlur=()=>{if(t.props.isMulti&&Array.isArray(t._value)){v([...t._value].sort(f))}},t.context.fns.calculateMarkPosition=e=>d(e,t.props.min,t.props.max)}let y;function x(e){var n;if(!o||!t.props.dragging)return;e.preventDefault();const r=e.clientX||(null===(n=e.touches)||void 0===n?void 0:n.length)&&e.touches[0].clientX,{left:s,width:a}=o.getBoundingClientRect(),l=g(p((r-s)/a*100));y!==l&&(y=l,v(l))}v(t.value)}),t.on("input",({payload:e})=>{Array.isArray(t.value)&&Array.isArray(e)?t.value[0]===e[0]&&t.value[1]===e[1]||v(e,!1):t.value!==e&&v(e,!1),function(){if(t.props.isMulti&&Array.isArray(t._value)){const[e,o]=[...t._value];n&&n.input(m(e)),r&&r.input(m(o))}else r&&r.input(t._value)}()}),t.on("prop:max",()=>{t.props.max=t.props.max?parseFloat(`${t.props.max}`):100,v(t.value),i(t)}),t.on("prop:min",()=>{t.props.min=t.props.min?parseFloat(`${t.props.min}`):0,v(t.value),i(t)})}]},td=/* #__PURE__ */K("cp"),{outer:od,wrapper:nd,inner:rd,label:sd,prefix:ad,suffix:ld,help:id,messages:pd,message:dd,icon:cd}=/* #__PURE__ */W(td),ud=td("swatchPreview",()=>({$el:"div",attrs:{id:"$id",class:"$classes.swatchPreview",tabindex:{if:"$disabled",then:-1,else:0},onClick:"$handlers.inputPreviewClick",onFocusout:"$handlers.inputPreviewFocusout",onKeydown:"$handlers.inputPreviewKeydown",role:"button","aria-valuetext":'$: "Current color: " + $value'}})),fd=td("valueString",()=>({$el:"span",attrs:{class:"$classes.valueString"},children:{if:'$format === "hex"',then:"$hex",else:{if:'$format === "rgba"',then:"$rgbaString",else:{if:'$format === "hsla"',then:"$hslaString",else:""}}}})),vd=td("panel",()=>({$el:"div",attrs:{id:'$: $id + "_popover"',class:"$classes.panel",onKeydown:"$handlers.panelKeydown","aria-role":{if:"$layout === popover",then:"dialog"},"aria-modal":{if:"$layout === popover",then:"true"},"aria-label":"$label",popover:"$popover",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"'},else:{position:{if:"$inline === undefined || $inline === false",then:"absolute"}}}}})),hd=td("panelClose",()=>({$el:"button",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:{if:"$showPanelClose",then:-1,else:0},onKeydown:"$handlers.panelCloseKeydown","aria-label":"$ui.close.value"}})),md=td("controlGroup",()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}})),gd=td("LS",()=>({$el:"div",attrs:{class:"$classes.LS"}})),$d=td("canvasLS",()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}})),bd=td("controlLS",()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},class:'$classes.control + " " + $classes.controlLS',onKeydown:"$handlers.lsKeydown",style:{left:'$controlLSPosition.x + "%"',top:'$controlLSPosition.y + "%"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuetext":'$: "Lightness: " + $hslaPercent.l + "%, Saturation: " + $hslaPercent.s + "%"'}})),yd=td("hue",()=>({$el:"div",attrs:{class:"$classes.hue"}})),xd=td("canvasHue",()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}})),wd=td("controlHue",()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.hueControlKeydown",class:'$classes.control + " " + $classes.controlHue',style:{left:'$: "min(max(" + (($hsla.h / 360) * 100) + "%, 3px), calc(100% - 3px))"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, 100%, 50%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$h"}})),_d=td("alpha",()=>({$el:"div",attrs:{class:"$classes.alpha",style:{opacity:{if:"$alpha",then:"1",else:"0.5"},cursor:{if:"$alpha",then:"",else:"not-allowed"},filter:{if:"$alpha",then:"",else:"grayscale(1)"}}}})),kd=td("canvasAlpha",()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true",style:{pointerEvents:{if:"$alpha",then:"auto",else:"none"}}}})),Sd=td("controlAlpha",()=>({$el:"div",attrs:{tabindex:{if:"$disabled || $alpha === undefined",then:-1,else:0},onKeydown:"$handlers.alphaControlKeydown",class:'$classes.control + " " + $classes.controlAlpha',style:{left:'$: "min(max(" + ($hsla.a * 100) + "%, 3px), calc(100% - 3px))"',backgroundImage:'$: "linear-gradient(to right, hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + "), hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + ")), linear-gradient(to right, white, white)"',pointerEvents:{if:"$alpha",then:"auto",else:"none"}},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$hsla.a"}})),Ld=td("preview",()=>({$el:"div",attrs:{class:"$classes.preview"}})),Id=td("canvasPreview",()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}})),Dd=td("canvasSwatchPreview",()=>({$el:"div",attrs:{class:"$classes.canvasSwatchPreviewWrapper"},children:[{$el:"canvas",attrs:{id:'$: "canvas-swatch-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasSwatchPreview',width:33,height:33,"aria-hidden":"true"}}]})),Ad=td("eyeDropper",()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}})),Cd=td("formatField",()=>({$el:"div",attrs:{class:"$classes.formatField"}})),Td=td("colorInputGroup",()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}})),Ed=td("hexField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hexFieldGroup'},children:[{$el:"input",attrs:{onInput:"$handlers.hexInput",onKeydown:"$handlers.hexKeydown",onFocus:"$handlers.hexFocus",onBlur:"$handlers.hexBlur",id:'$: "hex-" + $id',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",class:'$classes.colorField + " " + $classes.hexField',value:"$hex",autocomplete:"off"}},{$el:"label",children:"HEX",attrs:{for:'$: "hex-" + $id',class:"$classes.fieldLabel"}}]})),Od=td("rField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.rFieldGroup'},children:[{$el:"input",attrs:{id:'$: "r-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.rField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.r",autocomplete:"off"}},{$el:"label",children:"R",attrs:{for:'$: "r-" + $id',class:"$classes.fieldLabel"}}]})),Md=td("gField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.gFieldGroup'},children:[{$el:"input",attrs:{id:'$: "g-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.gField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.g",autocomplete:"off"}},{$el:"label",children:"G",attrs:{for:'$: "g-" + $id',class:"$classes.fieldLabel"}}]})),Vd=td("bField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.bFieldGroup'},children:[{$el:"input",attrs:{id:'$: "b-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.bField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.b",autocomplete:"off"}},{$el:"label",children:"B",attrs:{for:'$: "b-" + $id',class:"$classes.fieldLabel"}}]})),Fd=td("aField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.aFieldGroup'},children:[{$el:"input",attrs:{id:'$: "a-" + $id',onInput:'$handlers.rangeLimitInput("alpha", 0, 1)',onKeydown:'$handlers.rangeLimitKeydown("alpha", 0, 1, 0.01)',type:"text",class:'$classes.colorField + " " + $classes.aField',value:"$rgba.a",tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled || $alpha === undefined",autocomplete:"off",style:{opacity:{if:"$alpha",then:"1",else:"0.33"},cursor:{if:"$alpha",then:void 0,else:"not-allowed"}},"aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$rgba.a"}},{$el:"label",children:"A",attrs:{for:'$: "a-" + $id',class:"$classes.fieldLabel",style:{opacity:{if:"$alpha",then:"1",else:"0.33"}}}}]})),Pd=td("hField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hFieldGroup'},children:[{$el:"input",attrs:{id:'$: "h-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 360)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 360, 1)',type:"text",class:'$classes.colorField + " " + $classes.hField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.h",autocomplete:"off","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$hsla.h"}},{$el:"label",children:"H",attrs:{for:'$: "h-" + $id',class:"$classes.fieldLabel"}}]})),Bd=td("sField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.sFieldGroup'},children:[{$el:"input",attrs:{id:'$: "s-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.sField',tabindex:{if:"$disabled",then:-1,else:0},value:"$hslaPercent.s",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.s"}},{$el:"label",children:"S",attrs:{for:'$: "s-" + $id',class:"$classes.fieldLabel"}}]})),Hd=td("lField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.lFieldGroup'},children:[{$el:"input",attrs:{id:'$: "l-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.lField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.l",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.l"}},{$el:"label",children:"L",attrs:{for:'$: "l-" + $id',class:"$classes.fieldLabel"}}]})),Rd=td("formatSwitcher",()=>({$el:"div",attrs:{class:"$classes.formatSwitcher",onClick:"$handlers.toggleFormat",tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.formatSwitcherKeydown",role:"button","aria-label":"$ui.next.value"}})),Nd=td("swatches",()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}})),Kd=td("swatch",()=>({$el:"div",for:["swatch","index","$options"],if:"$swatch",attrs:{if:"$swatch.group",then:{class:"$classes.swatchGroup"},else:{class:"$classes.swatch",title:"$swatch.label"}},children:{if:"$swatch.group",then:[{$el:"span",attrs:{class:"$classes.swatchGroupLabel"},children:"$swatch.group"},{$el:"div",for:["groupSwatch","swatchIndex","$swatch.options"],attrs:{class:"$classes.swatch",title:"$groupSwatch.label"},children:[{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($groupSwatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$groupSwatch.label + "-" + $groupSwatch.value',"data-color":"$fns.anyToHsvaString($groupSwatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($groupSwatch.value, 2)","data-group":"$index","data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}]}],else:{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($swatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$swatch.label + "-" + $swatch.value',"data-color":"$fns.anyToHsvaString($swatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($swatch.value, 2)","data-group":0,"data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}}})),Wd=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,qd=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i;function zd(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function Ud(e){const[t,o,n,r]=function(e){e=e.replace("#",""),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e.slice(0,2),16),o=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),r=e.length>=8?parseInt(e.slice(6,8),16)/255:1;return function(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p,d=0;const c=(l+i)/2;if(l===i)d=p=0;else{const e=l-i;switch(p=c>.5?e/(2-l-i):e/(l+i),l){case r:d=(s-a)/e+(s<a?6:0);break;case s:d=(a-r)/e+2;break;case a:d=(r-s)/e+4}d*=60}return[d,255*p,255*c,n]}(t,o,n,r)}(e);return[...jd(t,o,n,r)]}function Yd(e,t,o,n=1){const r=t/100,s=o/100,a=(2-r)*s/2;return 0!==a&&(1===a||(t=a<.5?r*s/(2*a):r*s/(2-2*a))),[e,zd(255*t,2),zd(255*a,2),n]}function jd(e,t,o,n=1){const r=zd(t/255,4),s=zd(o/255,4);if(1===s)return[e,0,100,n];const a=zd(s+r*Math.min(s,1-s),4);let l=t/2.55;return 0!==a&&(l=1!==s&&0!==s?2*(a-s)/a*100:t/2.55),[e,zd(l,2),zd(100*a,2),n]}function Zd(e,t,o,n=1){const r=o/100,s=r*(t/100),a=s*(1-Math.abs(e/60%2-1)),l=r-s;let i=0,p=0,d=0;return[i,p,d]=e<60?[s,a,0]:e<120?[a,s,0]:e<180?[0,s,a]:e<240?[0,a,s]:e<300?[a,0,s]:[s,0,a],i=Math.round(255*(i+l)),p=Math.round(255*(p+l)),d=Math.round(255*(d+l)),[Math.min(Math.max(i,0),255),Math.min(Math.max(p,0),255),Math.min(Math.max(d,0),255),n]}function Gd(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p=0;const d=l,c=l-i,u=0===l?0:c/l;if(l!==i){switch(l){case r:p=(s-a)/c+(s<a?6:0);break;case s:p=(a-r)/c+2;break;case a:p=(r-s)/c+4}p/=6}return[360*p,100*u,100*d,n]}function Xd(e,t,o,n=1){const[r,s,a,l]=Zd(e,t,o,n);return function(e,t,o,n=1){const r=e=>Math.round(e).toString(16).padStart(2,"0").toUpperCase(),s=function(e){return Math.round(255*e).toString(16).padStart(2,"0").toUpperCase()}(n);return"#"+r(e)+r(t)+r(o)+`${"FF"===s?"":s}`}(r,s,a,l)}function Jd(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function Qd(e){if(e){if(Jd(e))return Ud(e);if(e.startsWith("rgb")){const t=e.match(Wd);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return Gd(o(t[1]),o(t[2]),o(t[3]),t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1)}if(e.startsWith("hsl")){const t=e.match(qd);if(!t)return[0,0,0,1];const o=Number(t[1].replace("deg","").trim()),n=Number(t[2].slice(0,-1))/100,r=Number(t[3].slice(0,-1))/100,s=t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1;return jd(o,zd(255*n,2),zd(255*r,2),s)}}}function ec(e){const[t,o,n,r]=e.split("-").map(e=>Number(e));return[t,o,n,r]}function tc(e,t=150,o=!0){let n=null,r=!0;return(...s)=>{const a=()=>{e(...s),n=null};o&&r&&(r=!1,a()),n||(n=setTimeout(a,t))}}function oc(e){return!1!==e&&"false"!==e}function nc(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}const rc={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"};const sc={schema:/* #__PURE__ */od(/* #__PURE__ */nd(/* #__PURE__ */sd("$label"),/* #__PURE__ */z("$inline && $help",/* #__PURE__ */id("$help")),/* #__PURE__ */rd(/* #__PURE__ */z("($inline === undefined || $inline === false) && $prefixIcon !== undefined",/* #__PURE__ */cd("prefix","label")),/* #__PURE__ */z("$inline === undefined || $inline === false",/* #__PURE__ */ad()),/* #__PURE__ */z("$inline === undefined || $inline === false",/* #__PURE__ */ud(/* #__PURE__ */Dd(),/* #__PURE__ */z("$showValue",/* #__PURE__ */fd()))),/* #__PURE__ */z("$inline || $expanded)",/* #__PURE__ */vd(/* #__PURE__ */z("$showPanelClose && ($inline === undefined || $inline === false)",/* #__PURE__ */hd(/* #__PURE__ */cd("close"))),/* #__PURE__ */z("$panelControls",/* #__PURE__ */md(/* #__PURE__ */gd(/* #__PURE__ */$d(),/* #__PURE__ */bd()),/* #__PURE__ */Ld(/* #__PURE__ */Id()),/* #__PURE__ */yd(/* #__PURE__ */xd(),/* #__PURE__ */wd()),/* #__PURE__ */_d(/* #__PURE__ */kd(),/* #__PURE__ */Sd()),/* #__PURE__ */z("$eyeDropper && $hasNativeEyeDropper",/* #__PURE__ */Ad(/* #__PURE__ */cd("eyeDropper"))))),/* #__PURE__ */z("$panelFormat",/* #__PURE__ */Cd(/* #__PURE__ */Td(/* #__PURE__ */z('$panelActiveFormat === "hex"',/* #__PURE__ */Ed()),/* #__PURE__ */z('$panelActiveFormat === "rgba"',/* #__PURE__ */Od()),/* #__PURE__ */z('$panelActiveFormat === "rgba"',/* #__PURE__ */Md()),/* #__PURE__ */z('$panelActiveFormat === "rgba"',/* #__PURE__ */Vd()),/* #__PURE__ */z('$panelActiveFormat === "hsla"',/* #__PURE__ */Pd()),/* #__PURE__ */z('$panelActiveFormat === "hsla"',/* #__PURE__ */Bd()),/* #__PURE__ */z('$panelActiveFormat === "hsla"',/* #__PURE__ */Hd()),/* #__PURE__ */z('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',/* #__PURE__ */Fd())),/* #__PURE__ */Rd(/* #__PURE__ */cd("switch")))),/* #__PURE__ */z("$options",/* #__PURE__ */Nd(/* #__PURE__ */Kd())))),/* #__PURE__ */z("$inline === undefined || $inline === false",/* #__PURE__ */ld()),/* #__PURE__ */z("($inline === undefined || $inline === false) && $suffixIcon !== undefined",/* #__PURE__ */cd("suffix"))),/* #__PURE__ */z("$: ($inline === undefined || $inline === false) && $help",/* #__PURE__ */id("$help"))),/* #__PURE__ */pd(/* #__PURE__ */dd("$message.value"))),type:"input",family:"text",props:["disbaled","format","valueFormat","alpha","panelControls","panelFormat","eyeDropper","inline","options","showValue","closeOnSelect","allowPaste"],features:[function(t){let o,n=null,r=null,s=null,a=null,l=null,i=null,p=null,d=0;const c=["hex","rgba","hsla"],u=tc(function(){if(!r)return;const e=r.getContext("2d");if(!e)return;const{width:o,height:n}=r,s=t.props.h||0;e.fillStyle=`hsl(${s}, 100%, 50%)`,e.fillRect(0,0,o,n);const a=e.createLinearGradient(0,0,o,0);a.addColorStop(0,"rgba(255, 255, 255, 1)"),a.addColorStop(1,"rgba(255, 255, 255, 0)"),e.fillStyle=a,e.fillRect(0,0,o,n);const l=e.createLinearGradient(0,0,0,n);l.addColorStop(0,"rgba(0,0,0,0)"),l.addColorStop(1,"rgba(0,0,0,1)"),e.fillStyle=l,e.fillRect(0,0,o,n)},2),f=tc(function(){if(!a)return;const e=a.getContext("2d");if(!e)return;const o=Math.round(a.width),n=Math.round(a.height);e.clearRect(0,0,o,n),V(a,n/2);const r=t.props.rgba.r||0,s=t.props.rgba.g||0,l=t.props.rgba.b||0,i=e.createLinearGradient(0,0,o,0);i.addColorStop(0,`rgba(${r}, ${s}, ${l}, 0)`),i.addColorStop(1,`rgba(${r}, ${s}, ${l}, 1)`),e.fillStyle=i,e.fillRect(0,0,o,n)},2),v=tc(D,2),h=tc(A,2),m=tc(B,2),g=tc(F,10,!1);function $(e){var o,r;if(!t.context||!t.props.allowPaste||t.props.disabled)return;const s=null===(o=t.props.__root)||void 0===o?void 0:o.activeElement;if(n&&n.contains(s)){const o=null===(r=e.clipboardData)||void 0===r?void 0:r.getData("text");if(!o)return;if("INPUT"===s.tagName&&!Jd(o)&&!Wd.test(o)&&!qd.test(o))return;(Jd(o)||o.startsWith("hsl")||o.startsWith("rgb"))&&(t.props.hexInputFocused&&(t.props.hexInputFocused=!1,setTimeout(()=>{t.props.hexInputFocused=!0},10)),e.preventDefault(),b(o))}}function b(e){var o;if(!e)return;const n=Qd(e);if(n){const[o,r,s,a]=n;"undefined"!==e&&("number"!=typeof o||isNaN(o)||"number"!=typeof r||isNaN(r)||"number"!=typeof s||isNaN(s)||"number"!=typeof a||isNaN(a)||zd(o,2)===t.props.h&&zd(r,2)===t.props.s&&zd(s,2)===t.props.v&&zd(a,2)===t.props.a)||(t.props.alpha&&(t.props.a=zd(a,2)),B(o,r,s))}else{const n=null===(o=t.props.options)||void 0===o?void 0:o.find(t=>{var o;return(null===(o=t.label)||void 0===o?void 0:o.toLowerCase())===e.toLowerCase()});if(n&&n.value){const e=Qd(n.value);if(e){const[o,n,r,s]=e;t.props.alpha&&(t.props.a=zd(s,2)),B(o,n,r)}else B(t.props.h,t.props.s,t.props.v)}else B(t.props.h,t.props.s,t.props.v)}}function y(e){if(!t.context||!p)return;const o=p[e];o&&(t.props.focusedSwatch=o.dataset.color)}function x(e,t){new ResizeObserver(()=>{const o=e.getBoundingClientRect();e.width=Math.round(o.width),e.height=Math.round(o.height),t(e)}).observe(e)}function w(){t.context&&t.props.eyeDropper&&(t.context.hasNativeEyeDropper=!("undefined"==typeof window||!window.EyeDropper),e.whenAvailable(`eye-dropper-${t.props.id}`,()=>{var e;const o=new window.EyeDropper,n=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`eye-dropper-${t.props.id}`);null==n||n.addEventListener("click",async()=>{const e=await o.open();if(!e.sRGBHex)return;const[n,r,s]=Ud(e.sRGBHex);t.props.alpha&&(t.props.a=1),B(n,r,s)})},t.props.__root))}function _(){k("canvas-ls",e=>{r=e},u,E),k("canvas-hue",e=>{s=e},I,O),k("canvas-alpha",e=>{a=e},f,M),S(`canvas-preview-${t.props.id}`,e=>{l=e,D()},v),S(`canvas-swatch-preview-${t.props.id}`,e=>{i=e,A()},h),L()}function k(e,n,r,s){let a=!1;const l=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",d),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",c)},i=e=>{1===e.buttons&&o&&s(e)},p=e=>{o&&s(e)},d=()=>{o=void 0,l()},c=()=>{o=void 0,l()};S(`${e}-${t.props.id}`,t=>{const l=t.nextElementSibling;n(t),r(),function(e,t){const o=o=>{e&&(o.preventDefault(),t(o))};null==e||e.addEventListener("mousedown",o),null==e||e.addEventListener("touchstart",o)}(t,s),a||function(e,t){a=!0,e.addEventListener("blur",()=>{e.removeAttribute("data-prevent-focus-style")}),t.addEventListener("touchend",()=>{e.removeAttribute("data-prevent-focus-style"),e.blur()}),e.addEventListener("keydown",t=>{["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)&&e.removeAttribute("data-prevent-focus-style")})}(l,t),t.addEventListener("mousedown",t=>{l.focus(),l.setAttribute("data-prevent-focus-style","true"),o=rc[e],s(t),document.addEventListener("mousemove",i),document.addEventListener("mouseup",d)}),t.addEventListener("touchstart",()=>{l.setAttribute("data-prevent-focus-style","true"),l.focus(),o=rc[e],document.addEventListener("touchmove",p),document.addEventListener("touchend",c)})},r)}function S(o,n,r){e.whenAvailable(o,()=>{var e;const s=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(o);s&&(n(s),r&&x(s,r))},t.props.__root)}function L(){e.whenAvailable(`swatches-${t.props.id}`,()=>{var e,o,n;p=Array.from((null===(e=t.props.__root)||void 0===e?void 0:e.querySelectorAll(`#swatches-${t.props.id} canvas`))||[]),p.forEach(e=>{x(e,C)}),t.props.focusedSwatch=null===(n=null===(o=p[0])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.color,F()},t.props.__root)}function I(){if(!s)return;const e=s.getContext("2d");if(!e)return;const t=s.width,o=s.height;for(let n=0;n<t;n++){const r=Math.floor(n/t*360);e.fillStyle=`hsl(${r}, 100%, 50%)`,e.fillRect(n,0,1,o)}}function D(){if(!l)return;const e=l.getContext("2d");if(!e)return;V(l,l.width/3);const{r:o,g:n,b:r,a:s}=t.props.rgba;e.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,e.fillRect(0,0,l.width,l.height)}function A(){if(!i)return;const e=i.getContext("2d");if(!e)return;V(i,i.height/2);const{r:o,g:n,b:r,a:s}=t.props.rgba;e.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,e.fillRect(0,0,i.width,i.height)}function C(e){if(!e)return;const t=e.getContext("2d");if(!t)return;V(e,e.width/2);const o=e.dataset.colorPrecise;if(!o)return;const[n,r,s,a]=ec(o),[l,i,p,d]=Yd(n,r,s,a);t.fillStyle=`hsla(${l}, ${i/255*100}%, ${p/255*100}%, ${d})`,t.fillRect(0,0,Math.round(e.width),Math.round(e.height))}function T(e,t,n){let r=null;const s=e=>{null!==r&&cancelAnimationFrame(r),r=requestAnimationFrame(()=>{if(!t)return;const o=t.getBoundingClientRect();let r,s;"touches"in e?(r=e.touches[0].clientX-o.left,s=e.touches[0].clientY-o.top):(r=e.clientX-o.left,s=e.clientY-o.top),r=Math.min(Math.max(r,0),o.width),s=Math.min(Math.max(s,0),o.height),n(r,s)})};s(e);const a=e=>{e.preventDefault(),s(e)},l=e=>{e.preventDefault(),s(e)},i=()=>{o=void 0,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)},p=()=>{o=void 0,document.removeEventListener("touchmove",l),document.removeEventListener("touchend",p)};"touches"in e?(document.addEventListener("touchmove",l),document.addEventListener("touchend",p)):(document.addEventListener("mousemove",a),document.addEventListener("mouseup",i))}function E(e){T(e,r,(e,o)=>{const n=e/r.width*100,s=100-o/r.height*100;m(t.props.hue,n,s)})}function O(e){T(e,s,(e,o)=>{if(!s)return;const n=s.width,r=Math.floor(e/n*360);t.props.h=r,m(t.props.h,t.props.s,t.props.v)})}function M(e){t.props.alpha&&T(e,a,(e,o)=>{const n=e/a.width*100/100;t.props.a=n,m(t.props.hue,t.props.s,t.props.v)})}function V(e,t){const o=e.getContext("2d");if(!o)return;const n=Math.ceil(e.height/t),r=Math.ceil(e.width/t);for(let e=0;e<n;e++)for(let n=0;n<r;n++)o.fillStyle=(e+n)%2==1?"#FFFFFF":"#CCCCCC",o.fillRect(n*t,e*t,t,t)}function F(){var e,o;if(!t.context||!t.props.options||!p)return;const{h:n,s:r,v:s,a:a}=t.props,l=function(e,t,o,n=1){const r=0===o?0:t;return`${zd(0===o||100===o&&0===t?0:e,0)}-${zd(r,0)}-${zd(o,0)}-${zd(n,2)}`}(n,r,s,a);let i=!1,d=!1;p.forEach(e=>{const t=e.dataset.color;if(!t)return;const[o,n,r,c]=t.split("-");"0"===r&&0===s&&c===`${a}`&&(d=!0);const u=e.parentElement;d||t===l?(u.dataset.active="true",e.ariaSelected="true",d=!1,!i&&p&&(y(p.indexOf(e)),i=!0)):(delete u.dataset.active,e.ariaSelected="false")}),i||(t.props.focusedSwatch=null===(o=null===(e=p[0])||void 0===e?void 0:e.dataset)||void 0===o?void 0:o.color)}function P(e){e=e.replace("#",""),t.props.hexInputFocused||3!==e.length||(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),e=`#${e=e.toUpperCase()}`,t.props.hex=e.slice(0,9)}function B(e,o,r,s=!1){t.props.h=void 0===e||isNaN(e)?t.props.h:zd(Math.max(Math.min(e,360),0),2),t.props.s=void 0===o||isNaN(o)?t.props.s:zd(Math.max(Math.min(o,100),0),2),t.props.v=void 0===r||isNaN(r)?t.props.v:zd(Math.max(Math.min(r,100),0),2);const{h:a,s:l,v:i,a:p}=t.props,[d,c,u]=Yd(a,l,i),[f,v,h]=Zd(a,l,i),m=t.props.hexInputFocused?t.props.hex:Xd(a,l,i,p),$=zd(p,2);t.props.hsla={h:a,s:c,l:u,a:$},t.props.hslaPercent={h:zd(a,0),s:100===i&&0===l?0:zd(0===i?c/255:Math.max(Math.min(c/255*100,100),0),0),l:zd(Math.max(Math.min(t.props.hsla.l/255*100,100),0),0),a:$},t.props.hslaString=`hsla(${t.props.hslaPercent.h}, ${t.props.hslaPercent.s}%, ${t.props.hslaPercent.l}%, ${$})`,t.props.hslaStringPrecise=`hsla(${a}, ${zd(0===i?c/255:c/255*100,2)}%, ${zd(u/255*100,2)}%, ${$})`,t.props.rgba={r:f,g:v,b:h,a:$},t.props.rgbaString=`rgba(${f}, ${v}, ${h}, ${$})`,P(m),setTimeout(()=>{var e;H(),function(){const e=t.props.s,o=100-t.props.v;t.props.controlLSPosition={x:e,y:o}}(),g(),n||"undefined"==typeof window||(n=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"]`))},0);const b=t.props.valueFormat?t.props.valueFormat:t.props.format;s||("hex"===b?t.input(t.props.hex):"rgba"===b?t.input(t.props.rgbaString):"hsla"===b&&t.input(t.props.hslaStringPrecise))}function H(){u(),f(),v(),h()}t.addProps(["expanded","h","s","v","a","hsla","hslaPercent","hslaString","hslaStringPrecise","rgba","rgbaString","hex","controlLSPosition","panelActiveFormat","hexInputFocused","hasNativeEyeDropper","focusedSwatch","swatchIsUsingKeyboardNav","showPanelClose"]),t.props.h=t.props.h||void 0,t.props.s=t.props.s||void 0,t.props.v=t.props.v||void 0,t.props.a=t.props.a||1,t.props.controlLSPosition=t.props.controlLSPosition||{x:0,y:0},t.props.switchIcon=t.props.switchIcon||'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M34.2 179.7L154.4 66.2c1.4-1.3 3.5-2.2 5.6-2.2s4.2 .8 5.6 2.2L285.8 179.7c1.4 1.3 2.2 3.2 2.2 5.2c0 3.9-3.2 7.1-7.1 7.1H39.1c-3.9 0-7.1-3.2-7.1-7.1c0-2 .8-3.8 2.2-5.2zm-22-23.3C4.4 163.8 0 174.1 0 184.9C0 206.5 17.5 224 39.1 224H280.9c21.6 0 39.1-17.5 39.1-39.1c0-10.8-4.4-21.1-12.3-28.4L187.6 42.9C180.1 35.9 170.2 32 160 32s-20.1 3.9-27.6 10.9L12.3 156.4zm22 175.9c-1.4-1.3-2.2-3.2-2.2-5.2c0-3.9 3.2-7.1 7.1-7.1H280.9c3.9 0 7.1 3.2 7.1 7.1c0 2-.8 3.8-2.2 5.2L165.6 445.8c-1.4 1.3-3.5 2.2-5.6 2.2s-4.2-.8-5.6-2.2L34.2 332.3zm-22 23.3L132.4 469.1c7.4 7 17.4 10.9 27.6 10.9s20.1-3.9 27.6-10.9L307.7 355.6c7.8-7.4 12.3-17.7 12.3-28.5c0-21.6-17.5-39.1-39.1-39.1H39.1C17.5 288 0 305.5 0 327.1c0 10.8 4.4 21.1 12.3 28.5z"/></svg>',t.props.hexInputFocused=!1,t.props.swatchIsUsingKeyboardNav=!1,t.on("destroying",()=>{t.context&&"undefined"!=typeof document&&document.removeEventListener("paste",$)}),t.on("created",()=>{var o,r;t.context&&("undefined"!=typeof window&&document.addEventListener("paste",$),t.props.expanded=!1,t.props.panelActiveFormat=t.props.format||c[0],t.props.panelControls=oc(t.props.panelControls),t.props.eyeDropper=oc(t.props.eyeDropper),t.props.panelFormat=oc(t.props.panelFormat),t.props.showValue=oc(t.props.showValue),t.props.allowPaste=oc(t.props.allowPaste),t.props.inline=e.undefine(t.props.inline),t.props.disabled=e.undefine(t.props.disabled),t.props.format=t.props.format||"hex",t.props.alpha=e.undefine(null===(r=null===(o=t.props)||void 0===o?void 0:o.alpha)||void 0===r||r),t.props.valueFormat=t.props.valueFormat||t.props.format,t.props.closeOnSelect=e.undefine(t.props.closeOnSelect),t.props.focusedSwatch=void 0,void 0===t.value||""===t.value||null===t.value?(t.props.rgba={r:0,g:0,b:0},B(0,0,0,!0)):b(`${t.value}`),t.on("input",({payload:e})=>{n&&void 0!==t.props.__root&&!n.contains(t.props.__root.activeElement)&&b(e)}),setTimeout(()=>{w()},5),_(),t.on("prop:expanded",()=>{var e;if(t.props.expanded)w(),_(),L(),document.addEventListener("keydown",o),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?t.props.showPanelClose=!0:t.props.showPanelClose=!1,setTimeout(()=>{var e;const o=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`);o&&o.focus()},0);else{document.removeEventListener("keydown",o);(null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"] *[tabindex="0"]`)).focus()}function o(e){"Escape"===e.key&&(e.preventDefault(),t.props.expanded=!1)}}),t.context.fns.anyToHsvaString=(e,t)=>{const o=Qd(e);if(!o)return"0-0-0-1";let[n,r,s,a]=o;return 0===t&&(n=0===s||100===s&&0===r?0:n),`${zd(n,t)}-${zd(r,t)}-${zd(s,t)}-${zd(a,2)}`},t.context.handlers.inputPreviewClick=e=>{t.props.expanded=!t.props.expanded},t.context.handlers.inputPreviewFocusout=e=>{var o,n,r;const s=null===(o=t.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${t.props.id}"] .formkit-inner`),a=e.relatedTarget;if(s.contains(a)){function l(e){var o,n;s.contains(e.target)||(t.props.expanded=!1,null===(o=t.props.__root)||void 0===o||o.removeEventListener("mousedown",l),null===(n=t.props.__root)||void 0===n||n.removeEventListener("touchstart",l))}null===(n=t.props.__root)||void 0===n||n.addEventListener("mousedown",l),null===(r=t.props.__root)||void 0===r||r.addEventListener("touchstart",l)}else t.props.expanded=!1},t.context.handlers.inputPreviewKeydown=e=>{"Escape"===e.key&&(e.preventDefault(),t.props.expanded=!1),"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.props.expanded=!t.props.expanded)},t.context.handlers.closePanel=()=>{t.props.expanded=!1},t.context.handlers.panelCloseKeydown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.props.expanded=!1)},t.context.handlers.toggleFormat=(e=1)=>{e="number"==typeof e?e:1;const o=(c.indexOf(t.props.panelActiveFormat)+e+c.length)%c.length;t.props.panelActiveFormat=c[o]},t.context.handlers.panelKeydown=e=>{var o,n,r;if("Tab"===e.key&&t.props.expanded){e.preventDefault();const s=Array.from((null===(o=t.props.__root)||void 0===o?void 0:o.querySelectorAll(`[data-id="${t.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`))||[]).filter(nc),a=s.indexOf((null===(n=t.props.__root)||void 0===n?void 0:n.activeElement)?null===(r=t.props.__root)||void 0===r?void 0:r.activeElement:t.props.__root);let l;l=e.shiftKey?(a-1+s.length)%s.length:(a+1)%s.length,s[l].focus()}},t.context.handlers.lsKeydown=e=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r}=t.props,s=e.shiftKey?10:1;switch(e.key){case"ArrowLeft":B(o,n-s,r);break;case"ArrowRight":B(o,n+s,r);break;case"ArrowUp":B(o,n,r+s);break;case"ArrowDown":B(o,n,r-s);break;case"PageUp":B(o,n,r+10);break;case"PageDown":B(o,n,r-10);break;case"Home":B(o,n-10,r);break;case"End":B(o,n+10,r)}H()}},t.context.handlers.hueControlKeydown=e=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r}=t.props,s=e.shiftKey?10:1;switch(e.key){case"ArrowLeft":case"ArrowDown":B(o-s,n,r);break;case"ArrowRight":case"ArrowUp":B(o+s,n,r);break;case"PageUp":B(o+10,n,r);break;case"PageDown":B(o-10,n,r);break;case"Home":B(0,n,r);break;case"End":B(360,n,r)}H()}},t.context.handlers.alphaControlKeydown=e=>{if(t.props.alpha&&["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r,a:s}=t.props,a=e.shiftKey?.1:.01;switch(e.key){case"ArrowLeft":case"ArrowDown":t.props.a=zd(Math.min(Math.max(s-a,0),1),2);break;case"ArrowRight":case"ArrowUp":t.props.a=zd(Math.min(Math.max(s+a,0),1),2);break;case"PageUp":t.props.a=zd(Math.min(Math.max(s+.1,0),1),2);break;case"PageDown":t.props.a=zd(Math.min(Math.max(s-.1,0),1),2);break;case"Home":t.props.a=0;break;case"End":t.props.a=1}B(o,n,r)}},t.context.handlers.eyeDropperKeydown=e=>{var o;if("Enter"===e.key||" "===e.key){e.preventDefault();const n=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`eye-dropper-${t.props.id}`);null==n||n.click()}},t.context.handlers.formatSwitcherKeydown=e=>{t.context&&("Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),t.context.handlers.toggleFormat()),"ArrowUp"===e.key&&(e.preventDefault(),t.context.handlers.toggleFormat(-1)))},t.context.handlers.hexInput=e=>{const o=e.target,n=o.value.startsWith("#")?9:8,r=o.value.slice(0,n);if(o.value=t.props.alpha?r:r.slice(0,7),Jd(r)){const[e,o,n,s]=Ud(r);t.props.alpha&&(t.props.a=s),P(r),B(e,o,n)}},t.context.handlers.hexKeydown=e=>{const o=e.target,n=o.value;let r="";if(!Jd(n))return;const s=n.startsWith("#")?n.slice(1):n,a=8===s.length,l=a?s.substring(0,6):s,i=a?s.substring(6,8):"",p=e.shiftKey?10:1,d=16777215;let c;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key))switch(e.preventDefault(),e.key){case"ArrowUp":c=(parseInt(l,16)+p)%16777216;break;case"ArrowDown":c=(parseInt(l,16)-p+d+1)%16777216;break;case"PageUp":c=(parseInt(l,16)+10)%16777216;break;case"PageDown":c=(parseInt(l,16)-10+d+1)%16777216;break;case"Home":c=0;break;case"End":c=d}void 0!==c&&(r=c.toString(16).padStart(6,"0").toUpperCase()),r&&(o.value=a?`#${r}${i}`:`#${r}`),t.context&&t.context.handlers.hexInput(e)},t.context.handlers.hexFocus=()=>{t.context&&(t.props.hexInputFocused=!0)},t.context.handlers.hexBlur=e=>{if(!t.context)return;t.props.hexInputFocused=!1;const o=e.target.value;Jd(o)&&P(o)},t.context.handlers.rangeLimitInput=(e,o,n,r)=>s=>{const a=r||s;if(!a||!t.context)return;const l=a.target;if(l.value.endsWith("."))return;const i=Math.max(Math.min(Number(l.value),n),o);l.value=`${i}`;const p=l.id;if("hsla"===e){switch(p){case`h-${t.props.id}`:t.props.h=i;break;case`s-${t.props.id}`:t.props.hslaPercent.s=i;break;case`l-${t.props.id}`:t.props.hslaPercent.l=i}const[e,o,n]=jd(t.props.h,2.55*t.props.hslaPercent.s,2.55*t.props.hslaPercent.l);B(e,o,n)}else if("rgba"===e){switch(p){case`r-${t.props.id}`:t.props.rgba.r=i;break;case`g-${t.props.id}`:t.props.rgba.g=i;break;case`b-${t.props.id}`:t.props.rgba.b=i}const[e,o,n]=Gd(t.props.rgba.r,t.props.rgba.g,t.props.rgba.b);B(e,o,n)}else"alpha"==e&&t.props.alpha&&(t.props.a=i,B())},t.context.handlers.rangeLimitKeydown=(e,o,n,r)=>s=>{if(!t.context)return;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End","Backspace","Tab","Enter"].includes(s.key)||s.metaKey||!/[a-zA-Z!@#$%^&*()_+={}\[\]:;"'<,>?\/|\\`~]/g.test(s.key)){if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(s.key)){const a=s.target,l=Number(a.value),i=s.shiftKey?10*r:r;switch(s.key){case"ArrowUp":s.preventDefault(),a.value=`${Math.min(l+i,n)}`;break;case"ArrowDown":s.preventDefault(),a.value=`${Math.max(l-i,o)}`;break;case"PageUp":s.preventDefault(),a.value=`${Math.min(l+10*r,n)}`;break;case"PageDown":s.preventDefault(),a.value=`${Math.max(l-10*r,o)}`;break;case"Home":s.preventDefault(),a.value=`${o}`;break;case"End":s.preventDefault(),a.value=`${n}`}t.context.handlers.rangeLimitInput(e,o,n,s)()}}else s.preventDefault()},t.context.handlers.swatchClick=e=>{const o=e.target;if(o.dataset.colorPrecise){const[e,n,r,s]=ec(o.dataset.colorPrecise);t.props.alpha&&(t.props.a=s),B(e,n,r),t.props.closeOnSelect&&(t.props.expanded=!1)}t.context&&"keydown"!==e.type&&t.context.handlers.swatchKeydown(e)},t.context.handlers.swatchKeydown=e=>{var o,n,r,s;if(!t.context||!p||!p.length)return;const a=p.indexOf(e.currentTarget);let l=null;const i=function(e){var t;if(!e.length)return 0;const o=null===(t=e[0].parentElement)||void 0===t?void 0:t.parentElement;if(!o)return 0;const n=o.getBoundingClientRect().width,r=e[0].parentElement;if(!r)return 0;const s=r.getBoundingClientRect(),a=window.getComputedStyle(r),l=parseFloat(a.marginLeft)+parseFloat(a.marginRight),i=s.width+l;return Math.floor(n/i)}(p),c=p.length;let u=0,f=c,v=!1;const h=p[a].dataset.group;if(void 0!==h){const e=p.filter(e=>e.dataset.group===h);u=p.indexOf(e[0]),f=p.indexOf(e[e.length-1])}const m=(a-u)%i;if(!e.key||"Tab"===e.key)return e.key||(t.props.swatchIsUsingKeyboardNav=!1,d=m,y(a)),"Tab"===e.key&&(t.props.swatchIsUsingKeyboardNav=!1),void p.forEach(e=>{delete e.parentElement.dataset.focused});if("Enter"===e.key||" "===e.key)return e.preventDefault(),d=m,t.context.handlers.swatchClick(e),void y(a);switch("ArrowUp"!==e.key&&"ArrowDown"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(t.props.swatchIsUsingKeyboardNav=!0,e.preventDefault()),e.key){case"ArrowUp":l=Math.max(a-i,a-(i-(d-m))),v=!0;break;case"ArrowDown":l=Math.max(a+i,a+(i+(d-m))),v=!0;break;case"ArrowLeft":l=a-1,d=(l-u)%i;break;case"ArrowRight":l=a+1,d=(l-u)%i}if(v&&null!==l&&(l<u||l>f)){let e;e=l<u?null===(n=null===(o=p[u-1])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.group:null===(s=null===(r=p[f+1])||void 0===r?void 0:r.dataset)||void 0===s?void 0:s.group;const t=p.filter(e=>e.dataset.group===h),c=p.filter(t=>t.dataset.group===e),v=(a-u)%i,m=t.length%i||i,g=a>=u+t.length-m;if(l<u){const e=c.length%i||i;l=u-e+Math.min(Math.max(v,d),e-1)}else l>f&&(l=g?Math.min(f+Math.max(v,d)+1,p.indexOf(c[c.length-1])):Math.min(l,f))}if(null!==l&&l>=0&&l<c){y(l),p.forEach(e=>{delete e.parentElement.dataset.focused});const e=p[l],t=e.parentElement;e.focus(),t.dataset.focused="true"}})})},to,o.options,
|
|
61
|
+
/* #__PURE__ */o.localize("removeAllValues"),o.options,function(t){!function(t){t.addProps(["search","options","selectedItems","activeValue","activeIndex","activeDescendant","targetOptions","sourceOptions","optionLoader","isLoadingOptions","filterOptions","inputText","hasNextPage","page","targetLoading","searchable","sourceLabel","targetLabel","transferOnSelect","disabled","placeholder","filter","showSourceEmptyMessage","showTargetEmptyMessage","sourceEmptyMessage","targetEmptyMessage","clearOnSelect","max","maxReached","debounce","sourceListActive","optionLoaderValues","optionLoadingCounter","optionsLoadingCounter","memoOptions","optionsLoaded","selectedSourceItems","selectedTargetItems","draggable","loadMore","loadMoreOption","targetSearchable","targetInputText"]),t.props.loadMoreOption={label:"Load more",value:rp},void 0===t.props.draggable?t.props.draggable=!0:"false"===t.props.draggable&&(t.props.draggable=!1),t.props.optionsLoaderValues=[],t.props.selectedSourceItems=[],t.props.selectedTargetItems=[],t.props.optionsLoaded=void 0,t.props.memoOptions=[],t.props.multiple=!0,t.props.debounce=t.props.debounce?parseInt(t.props.debounce):200,t.props.optionLoaderValues=[],t.props.optionsLoadingCounter=0,t.props.optionLoadingCounter=0,t.props.page=1,t.props.hasNextPage=We.bind(null,t),t.props.options?t.props.options=[...t.props.options]:t.props.options=[],t.props.sourceOptions=[],t.props.targetOptions=[],"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.props.searchable=e.undefine(t.props.searchable),t.props.searchable&&(t.props.inputText=""),t.props.targetSearchable=e.undefine(t.props.targetSearchable),t.props.targetSearchable&&(t.props.targetInputText=""),t.props.clearOnSelect=e.undefine(t.props.clearOnSelect),void 0===t.props.transferOnSelect?t.props.transferOnSelect=!0:"false"===t.props.transferOnSelect&&(t.props.transferOnSelect=!1),t.props.targetOptions.length&&(t.props.targetOptionValues=t.props.targetOptions.map(e=>Se(e))),t.props.initialOptions=[...t.props.options],t.props.max&&(t.props.max=parseInt(t.props.max)),t.props.sourceListOrigin=void 0,"function"!=typeof t.props.filter&&(t.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase()))}(t),function(e){e.on("commit",async({payload:t})=>{e.props.activeValue=void 0,e.props.max&&(e.props.maxReached=t.length>=e.props.max),e.props.clearOnSelect&&e.props.inputText&&(e.props.reFilter=!0,e.props.inputText=""),e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])],e.props.searchable&&e.props.reFilter&&!e.props.initialLoad?(Ve(e,e.props.inputText),e.props.reFilter=!1):e.props.initialLoad||(e.isCreated||(e.props.skipSetActiveValue=!0),cp(e)),"function"==typeof e.props.optionLoader?vp(e):e.props.initialLoad||(e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])])})}(t),bp(t),function(t){t.on("prop:options",()=>{t.props.appendingOptions&&(t.props.skipSetActiveValue=!0,t.props.appendingOptions=!1),cp(t)}),t.on("prop:memoOptions",()=>{t.props.skipSetActiveValue=!0,cp(t)}),t.on("prop:sourceOptions",()=>{0===t.props.sourceOptions.length?t.props.showSourceEmptyMessage=!0:t.props.showSourceEmptyMessage=!1,sp.delete(t)}),t.on("prop:targetOptions",()=>{0===t.props.targetOptions.length?t.props.showTargetEmptyMessage=!0:t.props.showTargetEmptyMessage=!1}),t.on("prop:activeValue",({payload:o})=>{if(t.props.isDragging)return void(t.props.activeDescendant=void 0);if(o===rp)return void(t.props.activeDescendant=`${t.props.id}_load_more`);const n=(t.props.sourceListOrigin?t.props.sourceOptions:t.props.targetOptions).findIndex(t=>e.eq(Se(t),o));n>=0&&t.props.sourceListOrigin?t.props.activeDescendant=`${t.props.id}_source_list_item_${n}`:t.props.activeDescendant=n>=0?`${t.props.id}_target_list_item_${n}`:void 0}),t.on("prop:mouseOnSource",({payload:e})=>{var o;if(e&&!0!==t.props.disabled&&!t.props.isDragging){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(t.props.id+"_source_list_items");if(!e)return;t.props.mouseOnTarget=!1,t.props.sourceListOrigin=!0,sp.delete(t),yp(t,e)}}),t.on("prop:mouseOnTarget",({payload:e})=>{var o;if(e&&!0!==t.props.disabled&&!t.props.isDragging){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}`);if(!e)return;t.props.mouseOnSource=!1,t.props.sourceListOrigin=!1,ap.delete(t),yp(t,e)}}),t.on("prop:optionsLoadingCounter",({payload:e})=>{0===e&&0===t.props.optionLoadingCounter&&t.store.set(Be)}),t.on("prop:optionLoadingCounter",({payload:e})=>{0===e&&0===t.props.optionsLoadingCounter&&(t.store.set(Be),t.props.skipSetActiveValue=!0,cp(t))})}(t)}]};const _p=/* #__PURE__ */K("sl"),{outer:kp,wrapper:Sp,inner:Lp,icon:Ip,prefix:Dp,suffix:Ap,help:Cp,messages:Tp,message:Ep}=/* #__PURE__ */W(_p),Op=_p("label",()=>({if:"$label",$el:"label",attrs:{id:"$id + '_label'"}})),Mp=_p("chart",()=>({$el:"div",if:"$chart"})),Vp=_p("chartBar",()=>({$el:"div",for:["bar","index","$chart"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$bar.at >= $_value.0 && $bar.at <= $_value.1",else:"$bar.at >= $_value.1 && $bar.at <= $_value.0"},else:"$bar.at <= $_value"},style:{left:'$bar.at / ($max - $min) * 100 + "%"',width:'$: "calc(" + (100 / $chart.length) + "% - 2px)"',height:{if:"$largestBar",then:'$bar.value / $largestBar * 100 + "%"'}}}})),Fp=_p("sliderInner",()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}})),Pp=_p("track",()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}})),Bp=_p("trackWrapper",()=>({$el:"div"})),Hp=_p("trackInner",()=>({$el:"div"})),Rp=_p("fill",()=>({$el:"div",attrs:{style:"$fillStyles"}})),Np=_p("linkedValues",()=>({$el:"div"})),Kp=_p("maxValue",()=>({$formkit:"number",bind:"$computedMaxInputAttrs",ignore:!0,number:!0,value:{if:"$isMulti",then:"$_value.1",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.maxNode",onBlur:"$handlers.inputBlur"})),Wp=_p("minValue",()=>({$formkit:"number",if:"$isMulti",bind:"$computedMinInputAttrs",ignore:!0,number:!0,value:{if:"$isMulti",then:"$_value.0",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.minNode",onBlur:"$handlers.inputBlur"})),qp=_p("marks",()=>({$el:"div",if:"$marks"})),zp=_p("mark",()=>({$el:"span",for:["step","index","$marks"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$step.at >= $_value.0 && $step.at <= $_value.1",else:"$step.at >= $_value.1 && $step.at <= $_value.0"},else:"$step.at <= $_value"},class:{if:"$step.class",then:'$: $classes.mark + " " + $step.class',else:"$classes.mark"},style:{left:'$: $fns.calculateMarkPosition($step.at) + "%"'}}})),Up=_p("markLabel",()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}})),Yp=_p("handles",()=>({$el:"ul"})),jp=_p("handleMax",()=>({$el:"li",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "max"',"data-handle":"max","data-show-tooltip":"$tooltip",class:"$: 'formkit-handle ' + $classes.handle + ' ' + $classes.handleMax",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstartPassive:"$handlers.startDrag",style:"$maxHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}})),Zp=_p("handleMin",()=>({$el:"li",if:"$isMulti",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "min"',"data-handle":"min","data-show-tooltip":"$tooltip",class:"$: $classes.handle + ' ' + $classes.handleMin",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstartPassive:"$handlers.startDrag",style:"$minHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}})),Gp=_p("handleMinInner",()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}})),Xp=_p("handleMaxInner",()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}})),Jp=_p("tooltipMax",()=>({$el:"div",if:'$tooltip === true || $tooltip === "auto"',children:{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.1, "max")',else:'$tooltipFormat($_value.0, "max")'},else:'$tooltipFormat($_value, "max")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMax"}})),Qp=_p("tooltipMin",()=>({$el:"div",if:'$isMulti && ($tooltip === true || $tooltip === "auto")',children:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.0, "min")',else:'$tooltipFormat($_value.1, "min")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMin"}})),ed={schema:/* #__PURE__ */kp(/* #__PURE__ */Sp(/* #__PURE__ */Op("$label"),/* #__PURE__ */Cp("$help"),/* #__PURE__ */Fp(/* #__PURE__ */Ip("prefix"),/* #__PURE__ */Dp(),/* #__PURE__ */Pp(/* #__PURE__ */Mp(/* #__PURE__ */Vp()),/* #__PURE__ */Bp(/* #__PURE__ */Hp(/* #__PURE__ */Rp(),/* #__PURE__ */qp(/* #__PURE__ */zp(/* #__PURE__ */Up())),/* #__PURE__ */Yp(/* #__PURE__ */Zp(/* #__PURE__ */Qp(),/* #__PURE__ */Gp()),/* #__PURE__ */jp(/* #__PURE__ */Jp(),/* #__PURE__ */Xp()))))),/* #__PURE__ */Ap(),/* #__PURE__ */Ip("suffix"),/* #__PURE__ */z("$showInput && $isMulti === false",/* #__PURE__ */Kp())),/* #__PURE__ */z("$showInput && $isMulti",/* #__PURE__ */Np(/* #__PURE__ */Wp(),/* #__PURE__ */Kp())),/* #__PURE__ */Tp(/* #__PURE__ */Ep("$message.value")))),type:"input",family:"",props:["min","max","step","showInput","tooltip","tooltipFormat","inputAttrs","maxInputAttrs","minInputAttrs","marks","markLabels","snapToMarks","chart","scalingFunction","intervals"],features:[function(t){let o,n,r;t.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]);const s={linear:{forward:e=>e,reverse:e=>e},log:{forward:(e,o=t.props.min,n=t.props.max)=>n*Math.pow(e/n,1.5),reverse:(e,o=t.props.min,n=t.props.max)=>n*Math.pow(e/n,1/1.5)}};let a=!1;function l(){const e=document.activeElement;if(e instanceof HTMLInputElement){const t=e.value;e.value="",e.value=t}}function i(e){if(!e)return;const t={disabled:e.props.disabled,min:"number"==typeof e.props.min?e.props.min:0,max:"number"==typeof e.props.max?e.props.max:void 0,step:e.props.step||1};e.props.minInputAttrs=Object.assign(e.props.minInputAttrs||{},t),e.props.maxInputAttrs=Object.assign(e.props.maxInputAttrs||{},t),e.props.inputAttrs=e.props.inputAttrs&&"object"==typeof e.props.inputAttrs?Object.assign(e.props.inputAttrs,t):t,e.props.computedMaxInputAttrs=e.props.maxInputAttrs&&"object"==typeof e.props.maxInputAttrs?Object.assign({},e.props.inputAttrs,e.props.maxInputAttrs):e.props.inputAttrs,e.props.computedMinInputAttrs=e.props.minInputAttrs&&"object"==typeof e.props.minInputAttrs?Object.assign({},e.props.inputAttrs,e.props.minInputAttrs):e.props.inputAttrs}function p(e){const{min:o,max:n,intervals:r}=t.props;if(e=Math.min(Math.max(e,0),100),!r||0===r.length){b();const r=o+e/100*(n-o);return t.props.scalingFunction.reverse(r,o,n)}const s=c(r,o,n);for(let t=0;t<s.length;t++){const{value:o,step:n,left:r,width:a,stepsInInterval:l}=s[t];if(e>=r&&e<=r+a){const t=o+(e-r)/a*l*n,s=t%n;return m(s<n/2?t-s:t+(n-s))}}return e>100?n:e<0?o:void 0}function d(e,o=t.props.min,n=t.props.max){const r=t.props.intervals;if(!r||0===r.length){b();return(t.props.scalingFunction.forward(e,o,n)-o)/(n-o)*100}const s=c(r,o,n);for(let t=0;t<s.length;t++){const{value:o,step:r,left:a,width:l,stepsInInterval:i}=s[t],p=t<s.length-1?s[t+1].value:n;if(e>=o&&e<=p){return 100*((a+(e-o)/r/i*l)/100)}}return 100}function c(e,o=t.props.min,n=t.props.max){(e=[...e]).sort((e,t)=>e.value-t.value),e[0].value!==o&&e.unshift({value:o,step:t.props.step});let r=0;for(let t=0;t<e.length;t++){const o=e[t].value,s=((t<e.length-1?e[t+1].value:n)-o)/e[t].step;r+=s}let s=0;return e.map((t,o)=>{const a=t.value,l=((o<e.length-1?e[o+1].value:n)-a)/t.step,i=s/r*100;return s+=l,{value:t.value,step:t.step,left:i,width:l/r*100,stepsInInterval:l,totalSteps:r}})}function u(){const e=parseFloat(`${t.props.min}`),o=parseFloat(`${t.props.max}`);let n,r=0;if(Array.isArray(t._value)){const e=[...t._value].sort(f);r=parseFloat(`${e[0]}`),n=parseFloat(`${e[1]}`)}else n=parseFloat(`${t._value}`);t.props.maxHandleStyles={left:`${d(n,e,o)}%`},t.props.isMulti&&Array.isArray(t._value)?(t.props.minHandleStyles={left:`${d(r,e,o)}%`},t.props.fillStyles={left:`${d(r,e,o)}%`,width:d(n,e,o)-d(r,e,o)+"%"}):t.props.fillStyles={left:"0%",width:`${d(n,e,o)}%`}}function f(e,t){return parseFloat(`${e}`)-parseFloat(`${t}`)}function v(e,n=!0){if(t.props.disabled)return;let r;if(void 0===e){if(t.props.isMulti)t.input([g(t.props.min),g(t.props.max)]);else{const e=t.props.min+(t.props.max-t.props.min)/2;t.input(g(e))}return void u()}if(t.props.isMulti&&Array.isArray(t._value)&&!Array.isArray(e)){const n="min"===t.props.lastHandleInteraction?0:1,s=[...t._value];s[n]=e;const[a,l]=s;if(a>=l){const e=null==o?void 0:o.querySelector(`[data-handle="${"min"===t.props.lastHandleInteraction?"max":"min"}"]`);null==e||e.focus()}r=g([...s].sort(f))}else Array.isArray(e)?r=g(e):(r=g(e),r=isNaN(r)?t.props.min:r);t.props.snapToMarks&&(r=$(r));const s=g(h(r));n&&t.input(s),u()}function h(e){return t.props.isMulti&&Array.isArray(e)?[h(e[0]),h(e[1])]:(e=isNaN(e)?t.props.min:e,Math.min(Math.max(parseFloat(`${e}`),t.props.min),t.props.max))}function m(e){return parseFloat(e.toFixed(t.props.decimals))}function g(e){if(t.props.snapToMarks)return e;if(!t.props.intervals)return Array.isArray(e)?e.map(e=>m(Math.round(e/t.props.step)*t.props.step)):m(Math.round(e/t.props.step)*t.props.step);const o=c(t.props.intervals);if(Array.isArray(e))return e.map(e=>{const n=o.find((n,r)=>{var s;return e>=n.value&&e<((null===(s=o[r+1])||void 0===s?void 0:s.value)||t.props.max)});if(!n)return e;return m(n.value+Math.round((e-n.value)/n.step)*n.step)});{const n=o.find((n,r)=>{var s;return e>=n.value&&e<((null===(s=o[r+1])||void 0===s?void 0:s.value)||t.props.max)});if(!n)return e;return m(n.value+Math.round((e-n.value)/n.step)*n.step)}}function $(e){if(Array.isArray(e))return e[0]=$(e[0]),e[1]=$(e[1]),e;{const o=t.props.marks,n=o.reduce((t,o)=>Math.abs(o.at-e)<Math.abs(t.at-e)?o:t,o[0]);return n.at}}function b(){if(a)return;e.undefine(t.props.scalingFunction)?"string"==typeof t.props.scalingFunction?t.props.scalingFunction=s[t.props.scalingFunction]||s.linear:"object"==typeof t.props.scalingFunction&&(t.props.scalingFunction={...s.linear,...t.props.scalingFunction}):t.props.scalingFunction=s.linear,a=!0}t.props.maxHandleStyles={left:"0%"},t.props.fillStyles={left:"0%",width:"0%"},t.props.isMulti=!1,t.props.step=1,t.props.min=0,t.props.max=100,t.props.tooltipFormat="function"==typeof t.props.tooltipFormat?t.props.tooltipFormat:(e,t)=>{if(t)return e},t.props.largestBar=0,"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.on("created",()=>{var s;b(),t.props.isMulti=Array.isArray(t.value),t.props.step=parseFloat(`${t.props.step}`),t.props.decimals=(null===(s=t.props.step.toString().split(".")[1])||void 0===s?void 0:s.length)||0,t.props.min=t.props.min?parseFloat(`${t.props.min}`):0,t.props.max=t.props.max?parseFloat(`${t.props.max}`):100;const a=e.undefine(t.props.tooltip);t.props.tooltip=void 0===t.props.tooltip?"auto":a;const m=e.undefine(t.props.marks);if(t.props.marks=!!m&&(Array.isArray(t.props.marks)?t.props.marks:function(){const{min:e,max:o,step:n}=t.props,r=[];for(let t=e;t<=o;t+=n)r.push({at:t,label:t});return r}()),t.props.markLabels=e.undefine(t.props.markLabels),t.props.snapToMarks=e.undefine(t.props.snapToMarks),t.props.showInput=e.undefine(t.props.showInput),t.props.largestBar=t.props.chart?t.props.chart.reduce((e,t)=>t.value>e?t.value:e,0):t.props.largestBar,i(t),e.whenAvailable(`track-${t.props.id}`,()=>{var e;o=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`track-${t.props.id}`),v(t.value,!1),u()},t.props.__root),t.context){let s=0,a="";const i=t.context.handlers.blur;t.context.handlers.blur=e=>{i(e),t.emit("blur")},t.context.handlers.clickTrack=e=>{if(!o)return;t.props.dragging=!1;const{left:n,width:r}=o.getBoundingClientRect(),s=(e.clientX-n)/r;if(t.props.isMulti&&Array.isArray(t.value)){const[e,o]=t.value,n=Math.abs(e-s*t.props.max)<Math.abs(o-s*t.props.max)?"min":"max",r="min"===n?0:1;t.props.lastHandleInteraction=n,t.value[r]=p(100*s),v(t._value)}else v(p(100*s))},t.context.handlers.focus=e=>{if(!o)return;const n=e.target.dataset.handle;n&&(t.props.lastHandleInteraction=n)},t.context.handlers.clickHandle=e=>{e.stopPropagation(),t.props.attrs.onClick&&t.props.attrs.onClick(e),t.props.dragging=!1,v(t._value)},t.context.handlers.startDrag=e=>{if(!o)return;t.props.dragging=!0;const n="touchstart"===e.type,r=n?"touchmove":"mousemove",s=n?"touchend":"mouseup";t.props.lastHandleInteraction=e.target.dataset.handle||t.props.lastHandleInteraction,document.addEventListener(r,x,{passive:!1}),document.addEventListener(s,()=>{t.context&&(t.props.dragging=!1,document.removeEventListener(r,x),n&&e.target instanceof HTMLElement&&e.target.blur())})},t.context.handlers.keydown=e=>{if(["1","2","3","4","5","6","7","8","9","0",".","-"].includes(e.key)){e.preventDefault(),clearTimeout(s),a+=e.key;const t="-"===a?-1:1;s=window.setTimeout(()=>{"-"!==a?(v(parseFloat(a)*t),a=""):a=""},350)}if(["ArrowLeft","ArrowDown","ArrowRight","ArrowUp","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const o="min"===t.props.lastHandleInteraction?0:1,n=Array.isArray(t._value)?t._value[o]:t._value,r=function(e,o){if(!t.props.intervals)return t.props.step;const n=c(t.props.intervals);if(e>=t.props.max)return n[n.length-1].step;let r=n.find((o,r)=>{var s;return e>=o.value&&e<((null===(s=n[r+1])||void 0===s?void 0:s.value)||t.props.max)});if(!r)return t.props.step;if(-1===o){e-r.step<r.value&&(r=n[n.indexOf(r)-1]||r)}return r.step}(n,["ArrowLeft","ArrowDown","PageDown"].includes(e.key)?-1:1);if(t.props.marks&&t.props.snapToMarks){const o=$(n),r=t.props.marks.find(e=>e.at===o),s=t.props.marks.indexOf(r),a=["ArrowLeft","ArrowDown"].includes(e.key)?-1:1,l=Math.min(Math.max(0,s+a),t.props.marks.length-1);return void v(t.props.marks[l].at)}if(e.metaKey)return void("ArrowLeft"===e.key||"ArrowDown"===e.key?v(t.props.min):v(t.props.max));if("Home"===e.key)return void v(t.props.min);if("End"===e.key)return void v(t.props.max);if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key)){v(n+(e.shiftKey?10*r:r)*(["ArrowLeft","ArrowDown"].includes(e.key)?-1:1))}"PageUp"===e.key?v(n+10*r):"PageDown"===e.key&&v(n-10*r)}},t.context.handlers.maxNode=o=>{r=o,o.hook.commit((n,r)=>{if(e.eq(o.value,n))return r(n);if(`${o.value}`.includes(".")&&!`${n}`.includes(".")&&l(),t.props.isMulti&&Array.isArray(t._value)){v([t._value[0],n])}else v(n);return r(h(n))})},t.context.handlers.minNode=o=>{n=o,o.hook.commit((n,r)=>{if(e.eq(o.value,n))return r(n);if(`${o.value}`.includes(".")&&!`${n}`.includes(".")&&l(),t.props.isMulti&&Array.isArray(t._value)){v([n,t._value[1]])}else v(n);return r(h(n))})},t.context.handlers.inputBlur=()=>{if(t.props.isMulti&&Array.isArray(t._value)){v([...t._value].sort(f))}},t.context.fns.calculateMarkPosition=e=>d(e,t.props.min,t.props.max)}let y;function x(e){var n;if(!o||!t.props.dragging)return;e.preventDefault();const r=e.clientX||(null===(n=e.touches)||void 0===n?void 0:n.length)&&e.touches[0].clientX,{left:s,width:a}=o.getBoundingClientRect(),l=g(p((r-s)/a*100));y!==l&&(y=l,v(l))}v(t.value)}),t.on("input",({payload:e})=>{Array.isArray(t.value)&&Array.isArray(e)?t.value[0]===e[0]&&t.value[1]===e[1]||v(e,!1):t.value!==e&&v(e,!1),function(){if(t.props.isMulti&&Array.isArray(t._value)){const[e,o]=[...t._value];n&&n.input(m(e)),r&&r.input(m(o))}else r&&r.input(t._value)}()}),t.on("prop:max",()=>{t.props.max=t.props.max?parseFloat(`${t.props.max}`):100,v(t.value),i(t)}),t.on("prop:min",()=>{t.props.min=t.props.min?parseFloat(`${t.props.min}`):0,v(t.value),i(t)})}]},td=/* #__PURE__ */K("cp"),{outer:od,wrapper:nd,inner:rd,label:sd,prefix:ad,suffix:ld,help:id,messages:pd,message:dd,icon:cd}=/* #__PURE__ */W(td),ud=td("swatchPreview",()=>({$el:"div",attrs:{id:"$id",class:"$classes.swatchPreview",tabindex:{if:"$disabled",then:-1,else:0},onClick:"$handlers.inputPreviewClick",onFocusout:"$handlers.inputPreviewFocusout",onKeydown:"$handlers.inputPreviewKeydown",role:"button","aria-valuetext":'$: "Current color: " + $value'}})),fd=td("valueString",()=>({$el:"span",attrs:{class:"$classes.valueString"},children:{if:'$format === "hex"',then:"$hex",else:{if:'$format === "rgba"',then:"$rgbaString",else:{if:'$format === "hsla"',then:"$hslaString",else:""}}}})),vd=td("panel",()=>({$el:"div",attrs:{id:'$: $id + "_popover"',class:"$classes.panel",onKeydown:"$handlers.panelKeydown","aria-role":{if:"$layout === popover",then:"dialog"},"aria-modal":{if:"$layout === popover",then:"true"},"aria-label":"$label",popover:"$popover",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"'},else:{position:{if:"$inline === undefined || $inline === false",then:"absolute"}}}}})),hd=td("panelClose",()=>({$el:"button",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:{if:"$showPanelClose",then:-1,else:0},onKeydown:"$handlers.panelCloseKeydown","aria-label":"$ui.close.value"}})),md=td("controlGroup",()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}})),gd=td("LS",()=>({$el:"div",attrs:{class:"$classes.LS"}})),$d=td("canvasLS",()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}})),bd=td("controlLS",()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},class:'$classes.control + " " + $classes.controlLS',onKeydown:"$handlers.lsKeydown",style:{left:'$controlLSPosition.x + "%"',top:'$controlLSPosition.y + "%"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuetext":'$: "Lightness: " + $hslaPercent.l + "%, Saturation: " + $hslaPercent.s + "%"'}})),yd=td("hue",()=>({$el:"div",attrs:{class:"$classes.hue"}})),xd=td("canvasHue",()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}})),wd=td("controlHue",()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.hueControlKeydown",class:'$classes.control + " " + $classes.controlHue',style:{left:'$: "min(max(" + (($hsla.h / 360) * 100) + "%, 3px), calc(100% - 3px))"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, 100%, 50%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$h"}})),_d=td("alpha",()=>({$el:"div",attrs:{class:"$classes.alpha",style:{opacity:{if:"$alpha",then:"1",else:"0.5"},cursor:{if:"$alpha",then:"",else:"not-allowed"},filter:{if:"$alpha",then:"",else:"grayscale(1)"}}}})),kd=td("canvasAlpha",()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true",style:{pointerEvents:{if:"$alpha",then:"auto",else:"none"}}}})),Sd=td("controlAlpha",()=>({$el:"div",attrs:{tabindex:{if:"$disabled || $alpha === undefined",then:-1,else:0},onKeydown:"$handlers.alphaControlKeydown",class:'$classes.control + " " + $classes.controlAlpha',style:{left:'$: "min(max(" + ($hsla.a * 100) + "%, 3px), calc(100% - 3px))"',backgroundImage:'$: "linear-gradient(to right, hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + "), hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + ")), linear-gradient(to right, white, white)"',pointerEvents:{if:"$alpha",then:"auto",else:"none"}},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$hsla.a"}})),Ld=td("preview",()=>({$el:"div",attrs:{class:"$classes.preview"}})),Id=td("canvasPreview",()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}})),Dd=td("canvasSwatchPreview",()=>({$el:"div",attrs:{class:"$classes.canvasSwatchPreviewWrapper"},children:[{$el:"canvas",attrs:{id:'$: "canvas-swatch-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasSwatchPreview',width:33,height:33,"aria-hidden":"true"}}]})),Ad=td("eyeDropper",()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}})),Cd=td("formatField",()=>({$el:"div",attrs:{class:"$classes.formatField"}})),Td=td("colorInputGroup",()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}})),Ed=td("hexField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hexFieldGroup'},children:[{$el:"input",attrs:{onInput:"$handlers.hexInput",onKeydown:"$handlers.hexKeydown",onFocus:"$handlers.hexFocus",onBlur:"$handlers.hexBlur",id:'$: "hex-" + $id',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",class:'$classes.colorField + " " + $classes.hexField',value:"$hex",autocomplete:"off"}},{$el:"label",children:"HEX",attrs:{for:'$: "hex-" + $id',class:"$classes.fieldLabel"}}]})),Od=td("rField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.rFieldGroup'},children:[{$el:"input",attrs:{id:'$: "r-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.rField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.r",autocomplete:"off"}},{$el:"label",children:"R",attrs:{for:'$: "r-" + $id',class:"$classes.fieldLabel"}}]})),Md=td("gField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.gFieldGroup'},children:[{$el:"input",attrs:{id:'$: "g-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.gField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.g",autocomplete:"off"}},{$el:"label",children:"G",attrs:{for:'$: "g-" + $id',class:"$classes.fieldLabel"}}]})),Vd=td("bField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.bFieldGroup'},children:[{$el:"input",attrs:{id:'$: "b-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.bField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.b",autocomplete:"off"}},{$el:"label",children:"B",attrs:{for:'$: "b-" + $id',class:"$classes.fieldLabel"}}]})),Fd=td("aField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.aFieldGroup'},children:[{$el:"input",attrs:{id:'$: "a-" + $id',onInput:'$handlers.rangeLimitInput("alpha", 0, 1)',onKeydown:'$handlers.rangeLimitKeydown("alpha", 0, 1, 0.01)',type:"text",class:'$classes.colorField + " " + $classes.aField',value:"$rgba.a",tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled || $alpha === undefined",autocomplete:"off",style:{opacity:{if:"$alpha",then:"1",else:"0.33"},cursor:{if:"$alpha",then:void 0,else:"not-allowed"}},"aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$rgba.a"}},{$el:"label",children:"A",attrs:{for:'$: "a-" + $id',class:"$classes.fieldLabel",style:{opacity:{if:"$alpha",then:"1",else:"0.33"}}}}]})),Pd=td("hField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hFieldGroup'},children:[{$el:"input",attrs:{id:'$: "h-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 360)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 360, 1)',type:"text",class:'$classes.colorField + " " + $classes.hField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.h",autocomplete:"off","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$hsla.h"}},{$el:"label",children:"H",attrs:{for:'$: "h-" + $id',class:"$classes.fieldLabel"}}]})),Bd=td("sField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.sFieldGroup'},children:[{$el:"input",attrs:{id:'$: "s-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.sField',tabindex:{if:"$disabled",then:-1,else:0},value:"$hslaPercent.s",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.s"}},{$el:"label",children:"S",attrs:{for:'$: "s-" + $id',class:"$classes.fieldLabel"}}]})),Hd=td("lField",()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.lFieldGroup'},children:[{$el:"input",attrs:{id:'$: "l-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.lField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.l",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.l"}},{$el:"label",children:"L",attrs:{for:'$: "l-" + $id',class:"$classes.fieldLabel"}}]})),Rd=td("formatSwitcher",()=>({$el:"div",attrs:{class:"$classes.formatSwitcher",onClick:"$handlers.toggleFormat",tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.formatSwitcherKeydown",role:"button","aria-label":"$ui.next.value"}})),Nd=td("swatches",()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}})),Kd=td("swatch",()=>({$el:"div",for:["swatch","index","$options"],if:"$swatch",attrs:{if:"$swatch.group",then:{class:"$classes.swatchGroup"},else:{class:"$classes.swatch",title:"$swatch.label"}},children:{if:"$swatch.group",then:[{$el:"span",attrs:{class:"$classes.swatchGroupLabel"},children:"$swatch.group"},{$el:"div",for:["groupSwatch","swatchIndex","$swatch.options"],attrs:{class:"$classes.swatch",title:"$groupSwatch.label"},children:[{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($groupSwatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$groupSwatch.label + "-" + $groupSwatch.value',"data-color":"$fns.anyToHsvaString($groupSwatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($groupSwatch.value, 2)","data-group":"$index","data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}]}],else:{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($swatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$swatch.label + "-" + $swatch.value',"data-color":"$fns.anyToHsvaString($swatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($swatch.value, 2)","data-group":0,"data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}}})),Wd=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,qd=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i;function zd(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function Ud(e){const[t,o,n,r]=function(e){e=e.replace("#",""),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e.slice(0,2),16),o=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),r=e.length>=8?parseInt(e.slice(6,8),16)/255:1;return function(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p,d=0;const c=(l+i)/2;if(l===i)d=p=0;else{const e=l-i;switch(p=c>.5?e/(2-l-i):e/(l+i),l){case r:d=(s-a)/e+(s<a?6:0);break;case s:d=(a-r)/e+2;break;case a:d=(r-s)/e+4}d*=60}return[d,255*p,255*c,n]}(t,o,n,r)}(e);return[...jd(t,o,n,r)]}function Yd(e,t,o,n=1){const r=t/100,s=o/100,a=(2-r)*s/2;return 0!==a&&(1===a||(t=a<.5?r*s/(2*a):r*s/(2-2*a))),[e,zd(255*t,2),zd(255*a,2),n]}function jd(e,t,o,n=1){const r=zd(t/255,4),s=zd(o/255,4);if(1===s)return[e,0,100,n];const a=zd(s+r*Math.min(s,1-s),4);let l=t/2.55;return 0!==a&&(l=1!==s&&0!==s?2*(a-s)/a*100:t/2.55),[e,zd(l,2),zd(100*a,2),n]}function Zd(e,t,o,n=1){const r=o/100,s=r*(t/100),a=s*(1-Math.abs(e/60%2-1)),l=r-s;let i=0,p=0,d=0;return[i,p,d]=e<60?[s,a,0]:e<120?[a,s,0]:e<180?[0,s,a]:e<240?[0,a,s]:e<300?[a,0,s]:[s,0,a],i=Math.round(255*(i+l)),p=Math.round(255*(p+l)),d=Math.round(255*(d+l)),[Math.min(Math.max(i,0),255),Math.min(Math.max(p,0),255),Math.min(Math.max(d,0),255),n]}function Gd(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p=0;const d=l,c=l-i,u=0===l?0:c/l;if(l!==i){switch(l){case r:p=(s-a)/c+(s<a?6:0);break;case s:p=(a-r)/c+2;break;case a:p=(r-s)/c+4}p/=6}return[360*p,100*u,100*d,n]}function Xd(e,t,o,n=1){const[r,s,a,l]=Zd(e,t,o,n);return function(e,t,o,n=1){const r=e=>Math.round(e).toString(16).padStart(2,"0").toUpperCase(),s=function(e){return Math.round(255*e).toString(16).padStart(2,"0").toUpperCase()}(n);return"#"+r(e)+r(t)+r(o)+`${"FF"===s?"":s}`}(r,s,a,l)}function Jd(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function Qd(e){if(e){if(Jd(e))return Ud(e);if(e.startsWith("rgb")){const t=e.match(Wd);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return Gd(o(t[1]),o(t[2]),o(t[3]),t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1)}if(e.startsWith("hsl")){const t=e.match(qd);if(!t)return[0,0,0,1];const o=Number(t[1].replace("deg","").trim()),n=Number(t[2].slice(0,-1))/100,r=Number(t[3].slice(0,-1))/100,s=t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1;return jd(o,zd(255*n,2),zd(255*r,2),s)}}}function ec(e){const[t,o,n,r]=e.split("-").map(e=>Number(e));return[t,o,n,r]}function tc(e,t=150,o=!0){let n=null,r=!0;return(...s)=>{const a=()=>{e(...s),n=null};o&&r&&(r=!1,a()),n||(n=setTimeout(a,t))}}function oc(e){return!1!==e&&"false"!==e}function nc(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}const rc={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"};const sc={schema:/* #__PURE__ */od(/* #__PURE__ */nd(/* #__PURE__ */sd("$label"),/* #__PURE__ */z("$inline && $help",/* #__PURE__ */id("$help")),/* #__PURE__ */rd(/* #__PURE__ */z("($inline === undefined || $inline === false) && $prefixIcon !== undefined",/* #__PURE__ */cd("prefix","label")),/* #__PURE__ */z("$inline === undefined || $inline === false",/* #__PURE__ */ad()),/* #__PURE__ */z("$inline === undefined || $inline === false",/* #__PURE__ */ud(/* #__PURE__ */Dd(),/* #__PURE__ */z("$showValue",/* #__PURE__ */fd()))),/* #__PURE__ */z("$inline || $expanded)",/* #__PURE__ */vd(/* #__PURE__ */z("$showPanelClose && ($inline === undefined || $inline === false)",/* #__PURE__ */hd(/* #__PURE__ */cd("close"))),/* #__PURE__ */z("$panelControls",/* #__PURE__ */md(/* #__PURE__ */gd(/* #__PURE__ */$d(),/* #__PURE__ */bd()),/* #__PURE__ */Ld(/* #__PURE__ */Id()),/* #__PURE__ */yd(/* #__PURE__ */xd(),/* #__PURE__ */wd()),/* #__PURE__ */_d(/* #__PURE__ */kd(),/* #__PURE__ */Sd()),/* #__PURE__ */z("$eyeDropper && $hasNativeEyeDropper",/* #__PURE__ */Ad(/* #__PURE__ */cd("eyeDropper"))))),/* #__PURE__ */z("$panelFormat",/* #__PURE__ */Cd(/* #__PURE__ */Td(/* #__PURE__ */z('$panelActiveFormat === "hex"',/* #__PURE__ */Ed()),/* #__PURE__ */z('$panelActiveFormat === "rgba"',/* #__PURE__ */Od()),/* #__PURE__ */z('$panelActiveFormat === "rgba"',/* #__PURE__ */Md()),/* #__PURE__ */z('$panelActiveFormat === "rgba"',/* #__PURE__ */Vd()),/* #__PURE__ */z('$panelActiveFormat === "hsla"',/* #__PURE__ */Pd()),/* #__PURE__ */z('$panelActiveFormat === "hsla"',/* #__PURE__ */Bd()),/* #__PURE__ */z('$panelActiveFormat === "hsla"',/* #__PURE__ */Hd()),/* #__PURE__ */z('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',/* #__PURE__ */Fd())),/* #__PURE__ */Rd(/* #__PURE__ */cd("switch")))),/* #__PURE__ */z("$options",/* #__PURE__ */Nd(/* #__PURE__ */Kd())))),/* #__PURE__ */z("$inline === undefined || $inline === false",/* #__PURE__ */ld()),/* #__PURE__ */z("($inline === undefined || $inline === false) && $suffixIcon !== undefined",/* #__PURE__ */cd("suffix"))),/* #__PURE__ */z("$: ($inline === undefined || $inline === false) && $help",/* #__PURE__ */id("$help"))),/* #__PURE__ */pd(/* #__PURE__ */dd("$message.value"))),type:"input",family:"text",props:["disbaled","format","valueFormat","alpha","panelControls","panelFormat","eyeDropper","inline","options","showValue","closeOnSelect","allowPaste"],features:[function(t){let o,n=null,r=null,s=null,a=null,l=null,i=null,p=null,d=0;const c=["hex","rgba","hsla"],u=tc(function(){if(!r)return;const e=r.getContext("2d");if(!e)return;const{width:o,height:n}=r,s=t.props.h||0;e.fillStyle=`hsl(${s}, 100%, 50%)`,e.fillRect(0,0,o,n);const a=e.createLinearGradient(0,0,o,0);a.addColorStop(0,"rgba(255, 255, 255, 1)"),a.addColorStop(1,"rgba(255, 255, 255, 0)"),e.fillStyle=a,e.fillRect(0,0,o,n);const l=e.createLinearGradient(0,0,0,n);l.addColorStop(0,"rgba(0,0,0,0)"),l.addColorStop(1,"rgba(0,0,0,1)"),e.fillStyle=l,e.fillRect(0,0,o,n)},2),f=tc(function(){if(!a)return;const e=a.getContext("2d");if(!e)return;const o=Math.round(a.width),n=Math.round(a.height);e.clearRect(0,0,o,n),V(a,n/2);const r=t.props.rgba.r||0,s=t.props.rgba.g||0,l=t.props.rgba.b||0,i=e.createLinearGradient(0,0,o,0);i.addColorStop(0,`rgba(${r}, ${s}, ${l}, 0)`),i.addColorStop(1,`rgba(${r}, ${s}, ${l}, 1)`),e.fillStyle=i,e.fillRect(0,0,o,n)},2),v=tc(D,2),h=tc(A,2),m=tc(B,2),g=tc(F,10,!1);function $(e){var o,r;if(!t.context||!t.props.allowPaste||t.props.disabled)return;const s=null===(o=t.props.__root)||void 0===o?void 0:o.activeElement;if(n&&n.contains(s)){const o=null===(r=e.clipboardData)||void 0===r?void 0:r.getData("text");if(!o)return;if("INPUT"===s.tagName&&!Jd(o)&&!Wd.test(o)&&!qd.test(o))return;(Jd(o)||o.startsWith("hsl")||o.startsWith("rgb"))&&(t.props.hexInputFocused&&(t.props.hexInputFocused=!1,setTimeout(()=>{t.props.hexInputFocused=!0},10)),e.preventDefault(),b(o))}}function b(e){var o;if(!e)return;const n=Qd(e);if(n){const[o,r,s,a]=n;"undefined"!==e&&("number"!=typeof o||isNaN(o)||"number"!=typeof r||isNaN(r)||"number"!=typeof s||isNaN(s)||"number"!=typeof a||isNaN(a)||zd(o,2)===t.props.h&&zd(r,2)===t.props.s&&zd(s,2)===t.props.v&&zd(a,2)===t.props.a)||(t.props.alpha&&(t.props.a=zd(a,2)),B(o,r,s))}else{const n=null===(o=t.props.options)||void 0===o?void 0:o.find(t=>{var o;return(null===(o=t.label)||void 0===o?void 0:o.toLowerCase())===e.toLowerCase()});if(n&&n.value){const e=Qd(n.value);if(e){const[o,n,r,s]=e;t.props.alpha&&(t.props.a=zd(s,2)),B(o,n,r)}else B(t.props.h,t.props.s,t.props.v)}else B(t.props.h,t.props.s,t.props.v)}}function y(e){if(!t.context||!p)return;const o=p[e];o&&(t.props.focusedSwatch=o.dataset.color)}function x(e,t){new ResizeObserver(()=>{const o=e.getBoundingClientRect();e.width=Math.round(o.width),e.height=Math.round(o.height),t(e)}).observe(e)}function w(){t.context&&t.props.eyeDropper&&(t.context.hasNativeEyeDropper=!("undefined"==typeof window||!window.EyeDropper),e.whenAvailable(`eye-dropper-${t.props.id}`,()=>{var e;const o=new window.EyeDropper,n=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`eye-dropper-${t.props.id}`);null==n||n.addEventListener("click",async()=>{const e=await o.open();if(!e.sRGBHex)return;const[n,r,s]=Ud(e.sRGBHex);t.props.alpha&&(t.props.a=1),B(n,r,s)})},t.props.__root))}function _(){k("canvas-ls",e=>{r=e},u,E),k("canvas-hue",e=>{s=e},I,O),k("canvas-alpha",e=>{a=e},f,M),S(`canvas-preview-${t.props.id}`,e=>{l=e,D()},v),S(`canvas-swatch-preview-${t.props.id}`,e=>{i=e,A()},h),L()}function k(e,n,r,s){let a=!1;const l=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",d),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",c)},i=e=>{1===e.buttons&&o&&s(e)},p=e=>{o&&s(e)},d=()=>{o=void 0,l()},c=()=>{o=void 0,l()};S(`${e}-${t.props.id}`,t=>{const l=t.nextElementSibling;n(t),r(),function(e,t){const o=o=>{e&&(o.preventDefault(),t(o))};null==e||e.addEventListener("mousedown",o),null==e||e.addEventListener("touchstart",o)}(t,s),a||function(e,t){a=!0,e.addEventListener("blur",()=>{e.removeAttribute("data-prevent-focus-style")}),t.addEventListener("touchend",()=>{e.removeAttribute("data-prevent-focus-style"),e.blur()}),e.addEventListener("keydown",t=>{["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)&&e.removeAttribute("data-prevent-focus-style")})}(l,t),t.addEventListener("mousedown",t=>{l.focus(),l.setAttribute("data-prevent-focus-style","true"),o=rc[e],s(t),document.addEventListener("mousemove",i),document.addEventListener("mouseup",d)}),t.addEventListener("touchstart",()=>{l.setAttribute("data-prevent-focus-style","true"),l.focus(),o=rc[e],document.addEventListener("touchmove",p),document.addEventListener("touchend",c)})},r)}function S(o,n,r){e.whenAvailable(o,()=>{var e;const s=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(o);s&&(n(s),r&&x(s,r))},t.props.__root)}function L(){e.whenAvailable(`swatches-${t.props.id}`,()=>{var e,o,n;p=Array.from((null===(e=t.props.__root)||void 0===e?void 0:e.querySelectorAll(`#swatches-${t.props.id} canvas`))||[]),p.forEach(e=>{x(e,C)}),t.props.focusedSwatch=null===(n=null===(o=p[0])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.color,F()},t.props.__root)}function I(){if(!s)return;const e=s.getContext("2d");if(!e)return;const t=s.width,o=s.height;for(let n=0;n<t;n++){const r=Math.floor(n/t*360);e.fillStyle=`hsl(${r}, 100%, 50%)`,e.fillRect(n,0,1,o)}}function D(){if(!l)return;const e=l.getContext("2d");if(!e)return;V(l,l.width/3);const{r:o,g:n,b:r,a:s}=t.props.rgba;e.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,e.fillRect(0,0,l.width,l.height)}function A(){if(!i)return;const e=i.getContext("2d");if(!e)return;V(i,i.height/2);const{r:o,g:n,b:r,a:s}=t.props.rgba;e.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,e.fillRect(0,0,i.width,i.height)}function C(e){if(!e)return;const t=e.getContext("2d");if(!t)return;V(e,e.width/2);const o=e.dataset.colorPrecise;if(!o)return;const[n,r,s,a]=ec(o),[l,i,p,d]=Yd(n,r,s,a);t.fillStyle=`hsla(${l}, ${i/255*100}%, ${p/255*100}%, ${d})`,t.fillRect(0,0,Math.round(e.width),Math.round(e.height))}function T(e,t,n){let r=null;const s=e=>{null!==r&&cancelAnimationFrame(r),r=requestAnimationFrame(()=>{if(!t)return;const o=t.getBoundingClientRect();let r,s;"touches"in e?(r=e.touches[0].clientX-o.left,s=e.touches[0].clientY-o.top):(r=e.clientX-o.left,s=e.clientY-o.top),r=Math.min(Math.max(r,0),o.width),s=Math.min(Math.max(s,0),o.height),n(r,s)})};s(e);const a=e=>{e.preventDefault(),s(e)},l=e=>{e.preventDefault(),s(e)},i=()=>{o=void 0,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)},p=()=>{o=void 0,document.removeEventListener("touchmove",l),document.removeEventListener("touchend",p)};"touches"in e?(document.addEventListener("touchmove",l),document.addEventListener("touchend",p)):(document.addEventListener("mousemove",a),document.addEventListener("mouseup",i))}function E(e){T(e,r,(e,o)=>{const n=e/r.width*100,s=100-o/r.height*100;m(t.props.hue,n,s)})}function O(e){T(e,s,(e,o)=>{if(!s)return;const n=s.width,r=Math.floor(e/n*360);t.props.h=r,m(t.props.h,t.props.s,t.props.v)})}function M(e){t.props.alpha&&T(e,a,(e,o)=>{const n=e/a.width*100/100;t.props.a=n,m(t.props.hue,t.props.s,t.props.v)})}function V(e,t){const o=e.getContext("2d");if(!o)return;const n=Math.ceil(e.height/t),r=Math.ceil(e.width/t);for(let e=0;e<n;e++)for(let n=0;n<r;n++)o.fillStyle=(e+n)%2==1?"#FFFFFF":"#CCCCCC",o.fillRect(n*t,e*t,t,t)}function F(){var e,o;if(!t.context||!t.props.options||!p)return;const{h:n,s:r,v:s,a:a}=t.props,l=function(e,t,o,n=1){const r=0===o?0:t;return`${zd(0===o||100===o&&0===t?0:e,0)}-${zd(r,0)}-${zd(o,0)}-${zd(n,2)}`}(n,r,s,a);let i=!1,d=!1;p.forEach(e=>{const t=e.dataset.color;if(!t)return;const[o,n,r,c]=t.split("-");"0"===r&&0===s&&c===`${a}`&&(d=!0);const u=e.parentElement;d||t===l?(u.dataset.active="true",e.ariaSelected="true",d=!1,!i&&p&&(y(p.indexOf(e)),i=!0)):(delete u.dataset.active,e.ariaSelected="false")}),i||(t.props.focusedSwatch=null===(o=null===(e=p[0])||void 0===e?void 0:e.dataset)||void 0===o?void 0:o.color)}function P(e){e=e.replace("#",""),t.props.hexInputFocused||3!==e.length||(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),e=`#${e=e.toUpperCase()}`,t.props.hex=e.slice(0,9)}function B(e,o,r,s=!1){t.props.h=void 0===e||isNaN(e)?t.props.h:zd(Math.max(Math.min(e,360),0),2),t.props.s=void 0===o||isNaN(o)?t.props.s:zd(Math.max(Math.min(o,100),0),2),t.props.v=void 0===r||isNaN(r)?t.props.v:zd(Math.max(Math.min(r,100),0),2);const{h:a,s:l,v:i,a:p}=t.props,[d,c,u]=Yd(a,l,i),[f,v,h]=Zd(a,l,i),m=t.props.hexInputFocused?t.props.hex:Xd(a,l,i,p),$=zd(p,2);t.props.hsla={h:a,s:c,l:u,a:$},t.props.hslaPercent={h:zd(a,0),s:100===i&&0===l?0:zd(0===i?c/255:Math.max(Math.min(c/255*100,100),0),0),l:zd(Math.max(Math.min(t.props.hsla.l/255*100,100),0),0),a:$},t.props.hslaString=`hsla(${t.props.hslaPercent.h}, ${t.props.hslaPercent.s}%, ${t.props.hslaPercent.l}%, ${$})`,t.props.hslaStringPrecise=`hsla(${a}, ${zd(0===i?c/255:c/255*100,2)}%, ${zd(u/255*100,2)}%, ${$})`,t.props.rgba={r:f,g:v,b:h,a:$},t.props.rgbaString=`rgba(${f}, ${v}, ${h}, ${$})`,P(m),setTimeout(()=>{var e;H(),function(){const e=t.props.s,o=100-t.props.v;t.props.controlLSPosition={x:e,y:o}}(),g(),n||"undefined"==typeof window||(n=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"]`))},0);const b=t.props.valueFormat?t.props.valueFormat:t.props.format;s||("hex"===b?t.input(t.props.hex):"rgba"===b?t.input(t.props.rgbaString):"hsla"===b&&t.input(t.props.hslaStringPrecise))}function H(){u(),f(),v(),h()}t.addProps(["expanded","h","s","v","a","hsla","hslaPercent","hslaString","hslaStringPrecise","rgba","rgbaString","hex","controlLSPosition","panelActiveFormat","hexInputFocused","hasNativeEyeDropper","focusedSwatch","swatchIsUsingKeyboardNav","showPanelClose"]),t.props.h=t.props.h||void 0,t.props.s=t.props.s||void 0,t.props.v=t.props.v||void 0,t.props.a=t.props.a||1,t.props.controlLSPosition=t.props.controlLSPosition||{x:0,y:0},t.props.switchIcon=t.props.switchIcon||'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M34.2 179.7L154.4 66.2c1.4-1.3 3.5-2.2 5.6-2.2s4.2 .8 5.6 2.2L285.8 179.7c1.4 1.3 2.2 3.2 2.2 5.2c0 3.9-3.2 7.1-7.1 7.1H39.1c-3.9 0-7.1-3.2-7.1-7.1c0-2 .8-3.8 2.2-5.2zm-22-23.3C4.4 163.8 0 174.1 0 184.9C0 206.5 17.5 224 39.1 224H280.9c21.6 0 39.1-17.5 39.1-39.1c0-10.8-4.4-21.1-12.3-28.4L187.6 42.9C180.1 35.9 170.2 32 160 32s-20.1 3.9-27.6 10.9L12.3 156.4zm22 175.9c-1.4-1.3-2.2-3.2-2.2-5.2c0-3.9 3.2-7.1 7.1-7.1H280.9c3.9 0 7.1 3.2 7.1 7.1c0 2-.8 3.8-2.2 5.2L165.6 445.8c-1.4 1.3-3.5 2.2-5.6 2.2s-4.2-.8-5.6-2.2L34.2 332.3zm-22 23.3L132.4 469.1c7.4 7 17.4 10.9 27.6 10.9s20.1-3.9 27.6-10.9L307.7 355.6c7.8-7.4 12.3-17.7 12.3-28.5c0-21.6-17.5-39.1-39.1-39.1H39.1C17.5 288 0 305.5 0 327.1c0 10.8 4.4 21.1 12.3 28.5z"/></svg>',t.props.hexInputFocused=!1,t.props.swatchIsUsingKeyboardNav=!1,t.on("destroying",()=>{t.context&&"undefined"!=typeof document&&document.removeEventListener("paste",$)}),t.on("created",()=>{var o,r;t.context&&("undefined"!=typeof window&&document.addEventListener("paste",$),t.props.expanded=!1,t.props.panelActiveFormat=t.props.format||c[0],t.props.panelControls=oc(t.props.panelControls),t.props.eyeDropper=oc(t.props.eyeDropper),t.props.panelFormat=oc(t.props.panelFormat),t.props.showValue=oc(t.props.showValue),t.props.allowPaste=oc(t.props.allowPaste),t.props.inline=e.undefine(t.props.inline),t.props.disabled=e.undefine(t.props.disabled),t.props.format=t.props.format||"hex",t.props.alpha=e.undefine(null===(r=null===(o=t.props)||void 0===o?void 0:o.alpha)||void 0===r||r),t.props.valueFormat=t.props.valueFormat||t.props.format,t.props.closeOnSelect=e.undefine(t.props.closeOnSelect),t.props.focusedSwatch=void 0,void 0===t.value||""===t.value||null===t.value?(t.props.rgba={r:0,g:0,b:0},B(0,0,0,!0)):b(`${t.value}`),t.on("input",({payload:e})=>{n&&void 0!==t.props.__root&&!n.contains(t.props.__root.activeElement)&&b(e)}),setTimeout(()=>{w()},5),_(),t.on("prop:expanded",()=>{var e;if(t.props.expanded)w(),_(),L(),document.addEventListener("keydown",o),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?t.props.showPanelClose=!0:t.props.showPanelClose=!1,setTimeout(()=>{var e;const o=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`);o&&o.focus()},0);else{document.removeEventListener("keydown",o);(null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"] *[tabindex="0"]`)).focus()}function o(e){"Escape"===e.key&&(e.preventDefault(),t.props.expanded=!1)}}),t.context.fns.anyToHsvaString=(e,t)=>{const o=Qd(e);if(!o)return"0-0-0-1";let[n,r,s,a]=o;return 0===t&&(n=0===s||100===s&&0===r?0:n),`${zd(n,t)}-${zd(r,t)}-${zd(s,t)}-${zd(a,2)}`},t.context.handlers.inputPreviewClick=e=>{t.props.expanded=!t.props.expanded},t.context.handlers.inputPreviewFocusout=e=>{var o,n,r;const s=null===(o=t.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${t.props.id}"] .formkit-inner`),a=e.relatedTarget;if(s.contains(a)){function l(e){var o,n;s.contains(e.target)||(t.props.expanded=!1,null===(o=t.props.__root)||void 0===o||o.removeEventListener("mousedown",l),null===(n=t.props.__root)||void 0===n||n.removeEventListener("touchstart",l))}null===(n=t.props.__root)||void 0===n||n.addEventListener("mousedown",l),null===(r=t.props.__root)||void 0===r||r.addEventListener("touchstart",l)}else t.props.expanded=!1},t.context.handlers.inputPreviewKeydown=e=>{"Escape"===e.key&&(e.preventDefault(),t.props.expanded=!1),"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.props.expanded=!t.props.expanded)},t.context.handlers.closePanel=()=>{t.props.expanded=!1},t.context.handlers.panelCloseKeydown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.props.expanded=!1)},t.context.handlers.toggleFormat=(e=1)=>{e="number"==typeof e?e:1;const o=(c.indexOf(t.props.panelActiveFormat)+e+c.length)%c.length;t.props.panelActiveFormat=c[o]},t.context.handlers.panelKeydown=e=>{var o,n,r;if("Tab"===e.key&&t.props.expanded){e.preventDefault();const s=Array.from((null===(o=t.props.__root)||void 0===o?void 0:o.querySelectorAll(`[data-id="${t.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`))||[]).filter(nc),a=s.indexOf((null===(n=t.props.__root)||void 0===n?void 0:n.activeElement)?null===(r=t.props.__root)||void 0===r?void 0:r.activeElement:t.props.__root);let l;l=e.shiftKey?(a-1+s.length)%s.length:(a+1)%s.length,s[l].focus()}},t.context.handlers.lsKeydown=e=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r}=t.props,s=e.shiftKey?10:1;switch(e.key){case"ArrowLeft":B(o,n-s,r);break;case"ArrowRight":B(o,n+s,r);break;case"ArrowUp":B(o,n,r+s);break;case"ArrowDown":B(o,n,r-s);break;case"PageUp":B(o,n,r+10);break;case"PageDown":B(o,n,r-10);break;case"Home":B(o,n-10,r);break;case"End":B(o,n+10,r)}H()}},t.context.handlers.hueControlKeydown=e=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r}=t.props,s=e.shiftKey?10:1;switch(e.key){case"ArrowLeft":case"ArrowDown":B(o-s,n,r);break;case"ArrowRight":case"ArrowUp":B(o+s,n,r);break;case"PageUp":B(o+10,n,r);break;case"PageDown":B(o-10,n,r);break;case"Home":B(0,n,r);break;case"End":B(360,n,r)}H()}},t.context.handlers.alphaControlKeydown=e=>{if(t.props.alpha&&["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r,a:s}=t.props,a=e.shiftKey?.1:.01;switch(e.key){case"ArrowLeft":case"ArrowDown":t.props.a=zd(Math.min(Math.max(s-a,0),1),2);break;case"ArrowRight":case"ArrowUp":t.props.a=zd(Math.min(Math.max(s+a,0),1),2);break;case"PageUp":t.props.a=zd(Math.min(Math.max(s+.1,0),1),2);break;case"PageDown":t.props.a=zd(Math.min(Math.max(s-.1,0),1),2);break;case"Home":t.props.a=0;break;case"End":t.props.a=1}B(o,n,r)}},t.context.handlers.eyeDropperKeydown=e=>{var o;if("Enter"===e.key||" "===e.key){e.preventDefault();const n=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`eye-dropper-${t.props.id}`);null==n||n.click()}},t.context.handlers.formatSwitcherKeydown=e=>{t.context&&("Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),t.context.handlers.toggleFormat()),"ArrowUp"===e.key&&(e.preventDefault(),t.context.handlers.toggleFormat(-1)))},t.context.handlers.hexInput=e=>{const o=e.target,n=o.value.startsWith("#")?9:8,r=o.value.slice(0,n);if(o.value=t.props.alpha?r:r.slice(0,7),Jd(r)){const[e,o,n,s]=Ud(r);t.props.alpha&&(t.props.a=s),P(r),B(e,o,n)}},t.context.handlers.hexKeydown=e=>{const o=e.target,n=o.value;let r="";if(!Jd(n))return;const s=n.startsWith("#")?n.slice(1):n,a=8===s.length,l=a?s.substring(0,6):s,i=a?s.substring(6,8):"",p=e.shiftKey?10:1,d=16777215;let c;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key))switch(e.preventDefault(),e.key){case"ArrowUp":c=(parseInt(l,16)+p)%16777216;break;case"ArrowDown":c=(parseInt(l,16)-p+d+1)%16777216;break;case"PageUp":c=(parseInt(l,16)+10)%16777216;break;case"PageDown":c=(parseInt(l,16)-10+d+1)%16777216;break;case"Home":c=0;break;case"End":c=d}void 0!==c&&(r=c.toString(16).padStart(6,"0").toUpperCase()),r&&(o.value=a?`#${r}${i}`:`#${r}`),t.context&&t.context.handlers.hexInput(e)},t.context.handlers.hexFocus=()=>{t.context&&(t.props.hexInputFocused=!0)},t.context.handlers.hexBlur=e=>{if(!t.context)return;t.props.hexInputFocused=!1;const o=e.target.value;Jd(o)&&P(o)},t.context.handlers.rangeLimitInput=(e,o,n,r)=>s=>{const a=r||s;if(!a||!t.context)return;const l=a.target;if(l.value.endsWith("."))return;const i=Math.max(Math.min(Number(l.value),n),o);l.value=`${i}`;const p=l.id;if("hsla"===e){switch(p){case`h-${t.props.id}`:t.props.h=i;break;case`s-${t.props.id}`:t.props.hslaPercent.s=i;break;case`l-${t.props.id}`:t.props.hslaPercent.l=i}const[e,o,n]=jd(t.props.h,2.55*t.props.hslaPercent.s,2.55*t.props.hslaPercent.l);B(e,o,n)}else if("rgba"===e){switch(p){case`r-${t.props.id}`:t.props.rgba.r=i;break;case`g-${t.props.id}`:t.props.rgba.g=i;break;case`b-${t.props.id}`:t.props.rgba.b=i}const[e,o,n]=Gd(t.props.rgba.r,t.props.rgba.g,t.props.rgba.b);B(e,o,n)}else"alpha"==e&&t.props.alpha&&(t.props.a=i,B())},t.context.handlers.rangeLimitKeydown=(e,o,n,r)=>s=>{if(!t.context)return;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End","Backspace","Tab","Enter"].includes(s.key)||s.metaKey||!/[a-zA-Z!@#$%^&*()_+={}\[\]:;"'<,>?\/|\\`~]/g.test(s.key)){if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(s.key)){const a=s.target,l=Number(a.value),i=s.shiftKey?10*r:r;switch(s.key){case"ArrowUp":s.preventDefault(),a.value=`${Math.min(l+i,n)}`;break;case"ArrowDown":s.preventDefault(),a.value=`${Math.max(l-i,o)}`;break;case"PageUp":s.preventDefault(),a.value=`${Math.min(l+10*r,n)}`;break;case"PageDown":s.preventDefault(),a.value=`${Math.max(l-10*r,o)}`;break;case"Home":s.preventDefault(),a.value=`${o}`;break;case"End":s.preventDefault(),a.value=`${n}`}t.context.handlers.rangeLimitInput(e,o,n,s)()}}else s.preventDefault()},t.context.handlers.swatchClick=e=>{const o=e.target;if(o.dataset.colorPrecise){const[e,n,r,s]=ec(o.dataset.colorPrecise);t.props.alpha&&(t.props.a=s),B(e,n,r),t.props.closeOnSelect&&(t.props.expanded=!1)}t.context&&"keydown"!==e.type&&t.context.handlers.swatchKeydown(e)},t.context.handlers.swatchKeydown=e=>{var o,n,r,s;if(!t.context||!p||!p.length)return;const a=p.indexOf(e.currentTarget);let l=null;const i=function(e){var t;if(!e.length)return 0;const o=null===(t=e[0].parentElement)||void 0===t?void 0:t.parentElement;if(!o)return 0;const n=o.getBoundingClientRect().width,r=e[0].parentElement;if(!r)return 0;const s=r.getBoundingClientRect(),a=window.getComputedStyle(r),l=parseFloat(a.marginLeft)+parseFloat(a.marginRight),i=s.width+l;return Math.floor(n/i)}(p),c=p.length;let u=0,f=c,v=!1;const h=p[a].dataset.group;if(void 0!==h){const e=p.filter(e=>e.dataset.group===h);u=p.indexOf(e[0]),f=p.indexOf(e[e.length-1])}const m=(a-u)%i;if(!e.key||"Tab"===e.key)return e.key||(t.props.swatchIsUsingKeyboardNav=!1,d=m,y(a)),"Tab"===e.key&&(t.props.swatchIsUsingKeyboardNav=!1),void p.forEach(e=>{delete e.parentElement.dataset.focused});if("Enter"===e.key||" "===e.key)return e.preventDefault(),d=m,t.context.handlers.swatchClick(e),void y(a);switch("ArrowUp"!==e.key&&"ArrowDown"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(t.props.swatchIsUsingKeyboardNav=!0,e.preventDefault()),e.key){case"ArrowUp":l=Math.max(a-i,a-(i-(d-m))),v=!0;break;case"ArrowDown":l=Math.max(a+i,a+(i+(d-m))),v=!0;break;case"ArrowLeft":l=a-1,d=(l-u)%i;break;case"ArrowRight":l=a+1,d=(l-u)%i}if(v&&null!==l&&(l<u||l>f)){let e;e=l<u?null===(n=null===(o=p[u-1])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.group:null===(s=null===(r=p[f+1])||void 0===r?void 0:r.dataset)||void 0===s?void 0:s.group;const t=p.filter(e=>e.dataset.group===h),c=p.filter(t=>t.dataset.group===e),v=(a-u)%i,m=t.length%i||i,g=a>=u+t.length-m;if(l<u){const e=c.length%i||i;l=u-e+Math.min(Math.max(v,d),e-1)}else l>f&&(l=g?Math.min(f+Math.max(v,d)+1,p.indexOf(c[c.length-1])):Math.min(l,f))}if(null!==l&&l>=0&&l<c){y(l),p.forEach(e=>{delete e.parentElement.dataset.focused});const e=p[l],t=e.parentElement;e.focus(),t.dataset.focused="true"}})})},to,o.options,
|
|
62
62
|
/* #__PURE__ */o.defaultIcon("eyeDropper","color"),
|
|
63
63
|
/* #__PURE__ */o.defaultIcon("close","close"),
|
|
64
64
|
/* #__PURE__ */o.localize("close"),
|