@formkit/pro 0.127.10 → 0.127.11

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.
Files changed (3) hide show
  1. package/index.cjs +1 -1
  2. package/index.mjs +1 -1
  3. package/package.json +1 -1
package/index.cjs CHANGED
@@ -62,4 +62,4 @@
62
62
  /* #__PURE__ */o.defaultIcon("eyeDropper","color"),
63
63
  /* #__PURE__ */o.defaultIcon("close","close"),
64
64
  /* #__PURE__ */o.localize("close"),
65
- /* #__PURE__ */o.localize("next")]},Qd=/* #__PURE__ */K("tb"),{outer:ec,inner:tc,wrapper:oc,prefix:nc,suffix:rc,help:sc,messages:ac,message:lc,icon:ic}=/* #__PURE__ */W(Qd),pc=Qd("label",(()=>({if:"$label",$el:"label",attrs:{id:"$id + '_label'"}}))),dc=Qd("singleToggle",(()=>({bind:"$attrs",$el:"button",attrs:{id:"$id",type:"button","aria-label":"$label","aria-pressed":"$fns.isChecked($onValue, $value)",onClick:"$handlers.toggleValue()",disabled:"$disabled",class:"$classes.input",onBlur:"$handlers.blur"}}))),cc=Qd("multiToggle",(()=>({bind:"$attrs",$el:"button",attrs:{type:"button",id:"$id+'_'+$index","aria-label":"$label","aria-pressed":"$fns.isChecked($option, $value)",onClick:"$handlers.toggleValue($option)",class:"$classes.input",title:"$option.help",disabled:"$disabled || $option.disabled",onBlur:"$handlers.blur"}}))),uc=Qd("inputInner",(()=>({bind:"$attrs",$el:"span"}))),fc=Qd("options",(()=>({$el:"ul",attrs:{id:"$id","data-vertical":'$vertical && "true" || "false"',"aria-labelledby":"$id"}}))),vc=Qd("option",(()=>({$el:"li",for:["option","index","$options"],attrs:{key:"$option.value","data-index":"$index"}})));function hc(t,o){return o=(null==o?void 0:o.hasOwnProperty("__original"))?null==o?void 0:o.__original:null==o?void 0:o.value,t.props.multiple?!!Array.isArray(t.value)&&t.value.filter((t=>e.eq(t,o))).length>0:void 0!==o?e.eq(t.value,o):(t.props._isChecked=e.eq(t.value,t.props.onValue),t.props._isChecked)}const mc={schema:/* #__PURE__ */ec(/* #__PURE__ */U("$options",/* #__PURE__ */oc(/* #__PURE__ */pc("$label"),/* #__PURE__ */fc(/* #__PURE__ */vc(/* #__PURE__ */cc(/* #__PURE__ */U("$fns.isChecked($option) === true",/* #__PURE__ */uc("$slots.default || $slots.on || $option.onLabel || $option.label"),/* #__PURE__ */uc("$slots.default || $slots.off || $option.offLabel || $option.label")))))),/* #__PURE__ */oc(/* #__PURE__ */U("$label && ($slots.default || $slots.on || $onLabel)",/* #__PURE__ */pc("$label")),/* #__PURE__ */dc(/* #__PURE__ */ic("prefix"),/* #__PURE__ */nc(),/* #__PURE__ */U("$_isChecked === true",/* #__PURE__ */uc("$slots.default || $slots.on || $onLabel || $label"),/* #__PURE__ */uc("$slots.default || $slots.off || $offLabel || $label")),/* #__PURE__ */rc(),/* #__PURE__ */ic("suffix")))),/* #__PURE__ */sc("$help"),/* #__PURE__ */ac(/* #__PURE__ */lc("$message.value"))),type:"input",family:"button",props:["options"],features:[function(t){var o,n,r,s;t.addProps(["enforced","multiple","offLabel","offValue","onLabel","onValue","vertical","_isChecked"]),t.props._isChecked=!1,t.props.enforced=e.undefine(t.props.enforced),t.props.multiple=e.undefine(t.props.multiple),t.props.vertical=e.undefine(t.props.vertical),t.props.disabled=e.undefine(t.props.disabled),null!==(o=(r=t.props).onValue)&&void 0!==o||(r.onValue=!0),null!==(n=(s=t.props).offValue)&&void 0!==n||(s.offValue=!1),t.on("created",(()=>{var o;t.props._isChecked=hc(t,null),t.props.options&&t.props.multiple&&t.input(null!==(o=t.value)&&void 0!==o?o:[],!1),t.context&&(t.context.fns.isChecked=e=>hc(t,e),t.context.handlers.toggleValue=o=>n=>function(t,o,n){if(n.preventDefault(),o=o?Se(o):o,t.props.options)if(t.props.multiple){const n=Array.isArray(t.value)?[...t.value]:[],r=n.findIndex((t=>e.eq(t,o)));r>-1&&(!t.props.enforced||n.length>1)?n.splice(r,1):-1===r&&n.push(o),t.input(n)}else e.eq(t.value,o)&&!t.props.enforced?t.input(void 0):t.input(o);else t.input(e.eq(t.value,t.props.onValue)?t.props.offValue:t.props.onValue)}(t,o,n))}))},o.options]},gc=/* #__PURE__ */K("ut"),{outer:$c,inner:bc,wrapper:yc,label:xc,prefix:wc,suffix:_c,help:kc,messages:Sc,message:Lc,icon:Ac}=/* #__PURE__ */W(gc),Ic=gc("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onBlur:"$handlers.unitBlur",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",inputmode:"decimal",placeholder:"$placeholder || $unitParts.unit",disabled:"$disabled","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto"}}))),Dc={meter:{kilometer:.001,meter:1,centimeter:100,millimeter:1e3,mile:621371e-9,yard:1.09361,foot:3.28084,inch:39.3701,"mile-scandinavian":1e-4},kilometer:{kilometer:1,meter:1e3,centimeter:1e5,millimeter:1e6,mile:.621371,yard:1093.61,foot:3280.84,inch:39370.1,"mile-scandinavian":10},centimeter:{kilometer:1e-5,meter:.01,centimeter:1,millimeter:10,mile:62137e-10,yard:.0109361,foot:.0328084,inch:.393701,"mile-scandinavian":1e-6},millimeter:{kilometer:1e-6,meter:.001,centimeter:.1,millimeter:1,mile:6.21371e-7,yard:.00109361,foot:.00328084,inch:.0393701,"mile-scandinavian":1e-7},mile:{kilometer:1.60934,meter:1609.34,centimeter:160934,millimeter:1609340,mile:1,yard:1760,foot:5280,inch:63360,"mile-scandinavian":.160934},yard:{kilometer:9144e-7,meter:.9144,centimeter:91.44,millimeter:914.4,mile:568182e-9,yard:1,foot:3,inch:36,"mile-scandinavian":9144e-8},foot:{kilometer:3048e-7,meter:.3048,centimeter:30.48,millimeter:304.8,mile:189394e-9,yard:.333333,foot:1,inch:12,"mile-scandinavian":3048e-8},inch:{kilometer:254e-7,meter:.0254,centimeter:2.54,millimeter:25.4,mile:15783e-9,yard:.0277778,foot:.0833333,inch:1,"mile-scandinavian":254e-8},"mile-scandinavian":{kilometer:10,meter:1e4,centimeter:1e6,millimeter:1e7,mile:6.21371,yard:10936.1,foot:32808.4,inch:393701,"mile-scandinavian":1}},Cc={celsius:{celsius:e=>e,fahrenheit:e=>1.8*e+32},fahrenheit:{celsius:e=>5/9*(e-32),fahrenheit:e=>e}},Tc={acre:{acre:1,hectare:.404686},hectare:{acre:2.47105,hectare:1}},Ec={gram:{gram:1,kilogram:.001,ounce:.035274,pound:.00220462},kilogram:{gram:1e3,kilogram:1,ounce:35.274,pound:2.20462},ounce:{gram:28.3495,kilogram:.0283495,ounce:1,pound:.0625},pound:{gram:453.592,kilogram:.453592,ounce:16,pound:1},stone:{gram:6350.29,kilogram:6.35029,ounce:224,pound:14,stone:1}},Oc={liter:{liter:1,milliliter:1e3,gallon:.264172,"fluid-ounce":33.814},milliliter:{liter:.001,milliliter:1,gallon:264172e-9,"fluid-ounce":.033814},gallon:{liter:3.78541,milliliter:3785.41,gallon:1,"fluid-ounce":128},"fluid-ounce":{liter:.0295735,milliliter:29.5735,gallon:.0078125,"fluid-ounce":1}},Mc={day:{day:1,hour:24,microsecond:864e8,millisecond:864e5,minute:1440,month:.0328767,nanosecond:864e14,second:86400,week:.142857,year:.00273973},hour:{day:.0416667,hour:1,microsecond:36e8,millisecond:36e5,minute:60,month:.00136986,nanosecond:36e11,second:3600,week:.00595238,year:114155e-9},microsecond:{day:115741e-19,hour:277778e-18,microsecond:1,millisecond:.001,minute:1.66667e-8,month:380517e-24,nanosecond:1e3,second:1e-6,week:165344e-20,year:3171e-20},millisecond:{day:1.15741e-8,hour:2.77778e-7,microsecond:1e3,millisecond:1,minute:166667e-10,month:380517e-19,nanosecond:1e6,second:.001,week:165344e-16,year:3171e-16},minute:{day:694444e-9,hour:.0166667,microsecond:6e7,millisecond:6e4,minute:1,month:228311e-10,nanosecond:6e10,second:60,week:992063e-10,year:190132e-11},month:{day:30.4368,hour:730.484,microsecond:2628e12,millisecond:2628e9,minute:43800,month:1,nanosecond:2628e15,second:2628e6,week:4.34524,year:.0833333},nanosecond:{day:1.15741e-20,hour:277778e-24,microsecond:.001,millisecond:1e-6,minute:166667e-19,month:380517e-28,nanosecond:1,second:1e-9,week:165344e-26,year:3171e-26},second:{day:115741e-10,hour:277778e-9,microsecond:1e6,millisecond:1e3,minute:.0166667,month:380517e-16,nanosecond:1e9,second:1,week:1.65344e-8,year:3.171e-10},week:{day:7,hour:168,microsecond:6048e11,millisecond:6048e8,minute:10080,month:.230137,nanosecond:6048e14,second:604800,week:1,year:.0191781},year:{day:365,hour:8760,microsecond:3154e13,millisecond:3154e10,minute:525600,month:12,nanosecond:3154e16,second:3154e4,week:52.1429,year:1}},Vc={bit:{bit:1,byte:.125,kilobit:.001,kilobyte:125e-6,megabit:1e-6,megabyte:125e-9,gigabit:1e-9,gigabyte:1.25e-10,terabit:1e-12,terabyte:125e-15,petabyte:125e-18},byte:{bit:8,byte:1,kilobit:.008,kilobyte:.001,megabit:8e-6,megabyte:1e-6,gigabit:8e-9,gigabyte:1e-9,terabit:8e-12,terabyte:1e-12,petabyte:1e-15},kilobit:{bit:1e3,byte:125,kilobit:1,kilobyte:.125,megabit:.001,megabyte:125e-6,gigabit:1e-6,gigabyte:125e-9,terabit:1e-9,terabyte:1.25e-10,petabyte:125e-15},kilobyte:{bit:8e3,byte:1e3,kilobit:8,kilobyte:1,megabit:.008,megabyte:.001,gigabit:8e-6,gigabyte:1e-6,terabit:8e-9,terabyte:1e-9,petabyte:1e-12},megabit:{bit:1e6,byte:125e3,kilobit:1e3,kilobyte:125,megabit:1,megabyte:.125,gigabit:.001,gigabyte:125e-6,terabit:1e-6,terabyte:125e-9,petabyte:1.25e-10},megabyte:{bit:8e6,byte:1e6,kilobit:8e3,kilobyte:1e3,megabit:8,megabyte:1,gigabit:.008,gigabyte:.001,terabit:8e-6,terabyte:1e-6,petabyte:1e-9},gigabit:{bit:1e9,byte:125e6,kilobit:1e6,kilobyte:125e3,megabit:1e3,megabyte:125,gigabit:1,gigabyte:.125,terabit:.001,terabyte:125e-6,petabyte:125e-9},gigabyte:{bit:8e9,byte:1e9,kilobit:8e6,kilobyte:1e6,megabit:8e3,megabyte:1e3,gigabit:8,gigabyte:1,terabit:.008,terabyte:.001,petabyte:1e-6},terabit:{bit:1e12,byte:125e9,kilobit:1e9,kilobyte:125e6,megabit:1e6,megabyte:125e3,gigabit:1e3,gigabyte:125,terabit:1,terabyte:.125,petabyte:125e-6},terabyte:{bit:8e12,byte:1e12,kilobit:8e9,kilobyte:1e9,megabit:8e6,megabyte:1e6,gigabit:8e3,gigabyte:1e3,terabit:8,terabyte:1,petabyte:.001},petabyte:{bit:1e15,byte:125e12,kilobit:1e12,kilobyte:125e9,megabit:1e9,megabyte:125e6,gigabit:1e6,gigabyte:125e3,terabit:1e3,terabyte:125,petabyte:1}};function Fc(t){let o=!1;function n(e){var n,r,s;const i=(`${e}`.match(/\-/g)||[]).length%2==1;e=function(e){e=function(e){return e.replace(/[\u0660-\u0669\u06f0-\u06f9]/g,(e=>(15&e.charCodeAt(0)).toString()))}(`${e}`),isNaN(e)&&(e=e.split(t.props.unitParts.decimal).map((e=>e.replace(/[^0-9]/g,""))).join("."));if(e=e.replace(/[^0-9\.]/g,""),e.includes(".")){const o=e.split(".");0===t.props.decimals?e=o[0]:"currency"===t.props.type&&(o[1]=o[1].padEnd(p(),"0").slice(0,p()),e=o.join("."))}return e}(e);const d={};"unit"!==a()&&"decimal"!==a()||(d.minimumFractionDigits=e.includes(".")?1:0),d.maximumFractionDigits="currency"===t.props.type?p():t.props.decimals,t.props.minDecimals&&(d.minimumFractionDigits=t.props.minDecimals,e&&!e.includes(".")&&(e+=".".padEnd(t.props.minDecimals+1,"0"))),0===d.maximumFractionDigits&&e.includes(".")&&(e=e.split(".")[0]);let c="";if(!isNaN(e)&&""!==e.trim()&&(e=i?`-${e}`:e,t.props.max&&!isNaN(t.props.max)&&(e=Number(e)>t.props.max?`${t.props.max}`:e),t.props.min&&!isNaN(t.props.min)&&(e=Number(e)<t.props.min?`${t.props.min}`:e),e.includes(".")&&"currency"===t.props.type?e=e.split(".")[0].padStart(1,"0")+"."+(null!==(n=e.split(".")[1])&&void 0!==n?n:"0"):"currency"===t.props.type&&(d.maximumFractionDigits=null!==(r=d.minimumFractionDigits)&&void 0!==r?r:0),c=l(t.props.displayLocale,d).format(e),"unit"===t.props.type&&"."===e[e.length-1])){const o=c.lastIndexOf(t.props.unitParts.decimal);c=c.slice(0,o+1)+c.slice(o+2),e=e.slice(0,-1)}let u,f=e.split(".");"currency"===t.props.type&&(f=f[0]+(null!==(s=f[1])&&void 0!==s?s:"").padEnd(p(),"0"),f.length>1&&(f=f.replace(/^0+/,""),f=""!==e&&""===f?"0":f)),t.props.valueStore={number:e,integer:f,string:c},o=!0,t.props.valueStore&&(u=t.props.valueStore.hasOwnProperty(t.props.valueFormat)?t.props.valueStore[t.props.valueFormat]:t.props.valueStore.number),t.input(""===u?void 0:u).then((()=>(o=!1,Promise.resolve())))}function r(){e.whenAvailable(`${t.props.id}`,(e=>{var o,n;e instanceof HTMLInputElement&&(e.value=null!==(n=null===(o=t.props.valueStore)||void 0===o?void 0:o.string)&&void 0!==n?n:"")}),t.props.__root)}function s(){var e,o;const n=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`#${t.props.id}_inner input`);return null!==(o=null==n?void 0:n.value)&&void 0!==o?o:""}function a(){return t.props.currency?"currency":t.props.unit?"unit":"decimal"}function l(e,o={}){const n=a(),r=Object.assign({},{style:n,roundingMode:"trunc"},o);return"unit"===t.props.type&&(r.unitDisplay=t.props.unitDisplay),"currency"===t.props.type&&(r.currencyDisplay=t.props.currencyDisplay),r[n]=t.props[n],new Intl.NumberFormat(e,r)}function i(e,o){var n,r,a,l,i;const p=null===(n=t.props.__root)||void 0===n?void 0:n.querySelector(`#${t.props.id}_inner input`);if(!p)return;const d=(null!==(a=null===(r=t.props.unitParts.unit)||void 0===r?void 0:r.length)&&void 0!==a?a:0)+(null!==(i=null===(l=t.props.unitParts.literal)||void 0===l?void 0:l.length)&&void 0!==i?i:0);t.props.unitParts.unitLeft?e=Math.max(e,d):(e=Math.min(e,s().length-d),"insertText"===o&&0===e&&(e=1)),p.setSelectionRange(e,e)}function p(){return void 0!==t.props.decimals?t.props.decimals:void 0!==t.props.minDecimals&&t.props.minDecimals>t.props.unitParts.fractionLength?t.props.minDecimals:t.props.unitParts.fractionLength}t.props.valueStore=null,t.on("input",(({payload:e})=>{o||(n(e),r())})),t.context&&(t.context.handlers.init=(e=null)=>{var o;t.props.skipInit?t.props.skipInit=!1:function(){var e,o,n,r,s,a,i;t.props.skipInit=!0;const p=l(t.props.displayLocale).formatToParts(12345678.12345678);t.props.unitParts={decimal:null===(e=p.find((e=>"decimal"==e.type)))||void 0===e?void 0:e.value,group:null===(o=p.find((e=>"group"==e.type)))||void 0===o?void 0:o.value,unit:null===(n=p.find((e=>["unit","currency"].includes(e.type))))||void 0===n?void 0:n.value,unitLeft:["unit","currency"].includes(p[0].type),literal:null!==(s=null===(r=p.find((e=>"literal"==e.type)))||void 0===r?void 0:r.value)&&void 0!==s?s:"",fractionLength:null!==(i=null===(a=p.find((e=>"fraction"==e.type)))||void 0===a?void 0:a.value.length)&&void 0!==i?i:0}}();let s=null!==(o=null!=e?e:t._value)&&void 0!==o?o:"";t.props.valueStore?s=t.props.valueStore.number:"integer"===t.props.valueFormat&&(s=function(e){var t;return(parseFloat(`${e}`)/Math.pow(10,null!==(t=p())&&void 0!==t?t:0)).toString().replace(".",p())}(`${null!=s?s:""}`)),"unit"===t.props.type&&t.props.valueUnit&&t.props.unit&&t.props.valueUnit!==t.props.unit&&t.hook.input(((e,o)=>{const n=function(e,t,o){if(Dc[e]&&Dc[e][o])return t*Dc[e][o];if(Cc[e]&&Cc[e][o])return Cc[e][o](t);if(Tc[e]&&Tc[e][o])return t*Tc[e][o];if(Ec[e]&&Ec[e][o])return t*Ec[e][o];if(Oc[e]&&Oc[e][o])return t*Oc[e][o];if(Mc[e]&&Mc[e][o])return t*Mc[e][o];if(Vc[e]&&Vc[e][o])return t*Vc[e][o];throw new Error("Conversion not supported")}(t.props.unit,e,t.props.valueUnit);return isNaN(n)?o(e):o(+n.toFixed(Number(t.props.valueDecimals)||2))})),n(s),r()},t.context.handlers.handleBeforeInput=e=>{var o,r,s,a,l,p,d,c,u;if(!t.props.inExecCommand&&"insertLineBreak"!==e.inputType&&(e.preventDefault(),e.stopPropagation(),e.target instanceof HTMLInputElement)){const f=e.target,v=null!==(o=e.data)&&void 0!==o?o:"",h=null!==(r=e.target.value)&&void 0!==r?r:"",m=null!==(s=e.target.selectionStart)&&void 0!==s?s:0,g=null!==(a=e.target.selectionEnd)&&void 0!==a?a:0,$=g-m,b=h.indexOf(t.props.unitParts.decimal);let y=(null!==(l=e.target.selectionStart)&&void 0!==l?l:0)+(e.data?0:-1),x=h,w=1;if(h.includes(t.props.unitParts.decimal)&&v===t.props.unitParts.decimal)return v===t.props.unitParts.decimal&&(y=x.indexOf(t.props.unitParts.decimal)+1),void i(y);if(!(null===t.props.min||t.props.min<0||t.props.max<0)&&"-"===v)return;if(v.match(/[a-zA-Z]/))return;if(v===t.props.unitParts.decimal&&0===t.props.decimals)return;if("deleteByCut"===e.inputType&&$>0&&(x=x.slice(0,m)+x.slice(g),y=g),"insertFromPaste"===e.inputType){const t=null!==(p=e.data)&&void 0!==p?p:"";x=x.slice(0,m)+t+x.slice(g)}if("deleteContentBackward"===e.inputType&&h[m-1]===t.props.unitParts.group?(w+=1,y-=1):"deleteContentForward"===e.inputType&&h[m]===t.props.unitParts.group&&(w+=1,y+=1),-1!==b&&y>b&&"insertText"===e.inputType?x=function(e,t,o){return e.substring(0,t)+o+e.substring(t+o.length)}(x,y,null!==(d=e.data)&&void 0!==d?d:"0"):"insertText"===e.inputType?(y=g,x=x.slice(0,m)+e.data+x.slice(g)):"deleteContentForward"===e.inputType?(y+=2,x=0===$?x.slice(0,m)+x.slice(g+w):x.slice(0,m)+x.slice(g)):"deleteContentBackward"===e.inputType&&(y+=1,0===$?x=x.slice(0,Math.max(m-w,0))+x.slice(g):$>0&&(x=x.slice(0,m)+x.slice(g))),"deleteContentForward"===e.inputType&&h[m]===t.props.unitParts.decimal){const e=x.slice(m-1);x=x.slice(0,m),e.includes(t.props.unitParts.unit)&&(x+=" "+t.props.unitParts.unit)}else if("deleteContentBackward"===e.inputType&&h[m-1]===t.props.unitParts.decimal){const e=x.slice(m-1);x=x.slice(0,m-1),e.includes(t.props.unitParts.unit)&&(x+=" "+t.props.unitParts.unit)}if(n(x),x=(null===(c=t.props.valueStore)||void 0===c?void 0:c.string)||(null===(u=t.props.valueStore)||void 0===u?void 0:u.number)||"",y=x.length-h.length+y,x.length===h.length&&y>b&&(y+=e.inputType.includes("delete")?-1:1),f.setSelectionRange(0,h.length),t.props.inExecCommand=!0,document.execCommand("insertText",void 0,x),t.props.inExecCommand=!1,v===t.props.unitParts.decimal?y=x.indexOf(t.props.unitParts.decimal)+1:h.includes(t.props.unitParts.decimal)&&!x.includes(t.props.unitParts.decimal)&&(y=x.length),"insertText"===e.inputType&&t.props.minDecimals&&(!t.value||0===m&&g===h.length||-1===b&&t.props.minDecimals&&h)){let e=0;e=t.props.unitParts.unit?t.props.unitParts.unit.length+1:0,y-=t.props.minDecimals,t.props.unitParts.unitLeft?y-=e-1:y-=e+1}i(Math.max(0,y),e.inputType)}},t.context.handlers.handleInput=e=>{t.emit("dom-input-event",e),e.target instanceof HTMLInputElement&&(t.props.inputText=e.target.value,n(e.target.value))},t.context.handlers.handleKeyDown=e=>{var o,a;if(e.target instanceof HTMLInputElement&&("ArrowUp"===e.key||"ArrowDown"===e.key)){const l="ArrowUp"===e.key?1*t.props.step:-1*t.props.step;n(function(e,t){var o,n,r,s;const a=`${e}`.split("."),l=`${t}`.split(".");let i=null!==(o=a[0])&&void 0!==o?o:"0",p=null!==(n=l[0])&&void 0!==n?n:"0";const d=null!==(r=a[1])&&void 0!==r?r:"",c=null!==(s=l[1])&&void 0!==s?s:"",u=Math.max(d.length,c.length);u>0&&(i+=d.padEnd(u,"0"),p+=c.padEnd(u,"0"));const f=BigInt(BigInt(i)+BigInt(p)).toString();return u>0?f.slice(0,-1*u)+"."+f.slice(-1*u):f}(null!==(a=null===(o=t.props.valueStore)||void 0===o?void 0:o.number)&&void 0!==a?a:0,l)),r(),setTimeout((()=>{i(s().length)}),1)}})}const Pc={schema:/* #__PURE__ */$c(/* #__PURE__ */yc(/* #__PURE__ */xc("$label"),/* #__PURE__ */bc(/* #__PURE__ */Ac("prefix"),/* #__PURE__ */wc(),/* #__PURE__ */Ic(),/* #__PURE__ */_c(),/* #__PURE__ */Ac("suffix"))),/* #__PURE__ */kc("$help"),/* #__PURE__ */Sc(/* #__PURE__ */Lc("$message.value"))),type:"input",family:"text",features:[function(e){var t,o,n,r,s,a;const l=["unit","decimals","minDecimals","displayLocale","min","max","step","valueFormat","unitDisplay","placeholder","unitParts","valueUnit","valueDecimals"];e.addProps(l),null!==(t=(r=e.props).displayLocale)&&void 0!==t||(r.displayLocale=e.props.locale||"en-US"),e.props.unitDisplay=e.props.unitDisplay||"short","false"===e.props.decimals||!1===e.props.decimals?e.props.decimals=0:void 0!==e.props.decimals?e.props.decimals=Number(e.props.decimals):e.props.decimals=2,e.props.minDecimals=void 0!==e.props.minDecimals?Number(e.props.minDecimals):void 0,void 0!==e.props.min&&(e.props.min=Number(e.props.min)),void 0!==e.props.max&&(e.props.max=Number(e.props.max)),null!==(o=(s=e.props).step)&&void 0!==o||(s.step=1),null!==(n=(a=e.props).valueFormat)&&void 0!==n||(a.valueFormat="number"),-1===["string","number"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(e.context.handlers.unitBlur=t=>{if(!(t.target instanceof HTMLInputElement))return;let o=t.target.value;(function(e){e=e.trim();const t=/\d+\,\s*%?$/;return/\d+\.\s*%?$/.test(e)||t.test(e)})(o)&&(o=o.replace(e.props.unitParts.decimal,""),t.target.value=o)},Fc(e),e.context.handlers.init(),l.forEach((t=>{e.on(`prop:${t}`,(()=>{var t;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init()}))})))}))}]},Bc=/* #__PURE__ */K("cr"),{outer:Hc,inner:Rc,wrapper:Nc,label:Kc,prefix:Wc,suffix:qc,help:Uc,messages:zc,message:Yc,icon:jc}=/* #__PURE__ */W(Bc),Zc=Bc("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",disabled:"$disabled",placeholder:"$placeholder || $unitParts.unit",inputmode:"decimal","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto"}})));const Gc={schema:/* #__PURE__ */Hc(/* #__PURE__ */Nc(/* #__PURE__ */Kc("$label"),/* #__PURE__ */Rc(/* #__PURE__ */jc("prefix"),/* #__PURE__ */Wc(),/* #__PURE__ */Zc(),/* #__PURE__ */qc(),/* #__PURE__ */jc("suffix"))),/* #__PURE__ */Uc("$help"),/* #__PURE__ */zc(/* #__PURE__ */Yc("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,i;const p=["currency","decimals","maxDecimals","minDecimals","displayLocale","min","max","step","valueFormat","currencyDisplay","placeholder","unitParts"];e.addProps(p),e.addProps(["inputText"]),null!==(t=(s=e.props).displayLocale)&&void 0!==t||(s.displayLocale=e.props.locale||"en-US"),null!==(o=(a=e.props).currency)&&void 0!==o||(a.currency=e.props.currency||"USD"),"false"===e.props.decimals||!1===e.props.decimals?e.props.decimals=0:void 0!==e.props.decimals&&(e.props.decimals=Number(e.props.decimals)),e.props.minDecimals=void 0!==e.props.minDecimals?Number(e.props.minDecimals):void 0,void 0!==e.props.min&&(e.props.min=Number(e.props.min)),void 0!==e.props.max&&(e.props.max=Number(e.props.max)),null!==(n=(l=e.props).step)&&void 0!==n||(l.step=1),null!==(r=(i=e.props).valueFormat)&&void 0!==r||(i.valueFormat="number"),-1===["string","number","integer"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(Fc(e),e.context.handlers.init(),p.forEach((t=>{e.on(`prop:${t}`,(()=>{var t;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init()}))})))}))}]};var Xc=/*#__PURE__*/Object.freeze({__proto__:null,autocomplete:br,colorpicker:Jd,currency:Gc,datepicker:ul,dropdown:Zt,mask:si,rating:Mn,repeater:jo,slider:Yp,taglist:Vl,toggle:mo,togglebuttons:mc,transferlist:hp,unit:Pc});const Jc="undefined"!=typeof window?setInterval:()=>0,Qc=new WeakSet;exports.$if=U,exports.autocomplete=br,exports.colorpicker=Jd,exports.createBaseSections=W,exports.createProPlugin=function(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(Qc.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:h(13919),children:`${h(451228594)}${h(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){k[e]?k[e].add(t):k[e]=new Set([t])}(e,o)}}return function(e){const t=()=>{throw new Error(`InvalidFormKitKey ${e}`)};if(!/^fk-/i.test(e))return t();const o=e.substring(3);if(!d.test(o))return t();const n=parseInt(o,16).toString(),r=Number(n[0])<6?Number(n[0]):6,s=n.substring(r,r+(n.length-6)),a=n.substring(0,r)+n.substring(r+s.length),l=a.slice(0,2),i=`${a[a.length-1]}${a[0]}`;Number(s)!==Math.floor(Number(a)*Number(l)/Number(i))&&t()}(o),n.library=o=>{if(o.props.type in t){const{schema:n,...r}=t[o.props.type];Qc.add(o),o.define({...r,schema:n(e)})}Jc((()=>b.has(e)&&o.emit(952679114..toString(32))),4e3)},n}catch(r){throw r instanceof Error&&function(e){if("FormKitNoKey"===e.message)throw new Error("A FormKit API key is required, please visit https://formkit.com/pro")}(r),r}},exports.createSectionFactory=K,exports.currency=Gc,exports.datepicker=ul,exports.dropdown=Zt,exports.inputs=Xc,exports.mask=si,exports.rating=Mn,exports.repeater=jo,exports.slider=Yp,exports.taglist=Vl,exports.toggle=mo,exports.togglebuttons=mc,exports.transferlist=hp,exports.unit=Pc;
65
+ /* #__PURE__ */o.localize("next")]},Qd=/* #__PURE__ */K("tb"),{outer:ec,inner:tc,wrapper:oc,prefix:nc,suffix:rc,help:sc,messages:ac,message:lc,icon:ic}=/* #__PURE__ */W(Qd),pc=Qd("label",(()=>({if:"$label",$el:"label",attrs:{id:"$id + '_label'"}}))),dc=Qd("singleToggle",(()=>({bind:"$attrs",$el:"button",attrs:{id:"$id",type:"button","aria-label":"$label","aria-pressed":"$fns.isChecked($onValue, $value)",onClick:"$handlers.toggleValue()",disabled:"$disabled",class:"$classes.input",onBlur:"$handlers.blur"}}))),cc=Qd("multiToggle",(()=>({bind:"$attrs",$el:"button",attrs:{type:"button",id:"$id+'_'+$index","aria-label":"$label","aria-pressed":"$fns.isChecked($option, $value)",onClick:"$handlers.toggleValue($option)",class:"$classes.input",title:"$option.help",disabled:"$disabled || $option.disabled",onBlur:"$handlers.blur"}}))),uc=Qd("inputInner",(()=>({bind:"$attrs",$el:"span"}))),fc=Qd("options",(()=>({$el:"ul",attrs:{id:"$id","data-vertical":'$vertical && "true" || "false"',"aria-labelledby":"$id"}}))),vc=Qd("option",(()=>({$el:"li",for:["option","index","$options"],attrs:{key:"$option.value","data-index":"$index"}})));function hc(t,o){return o=(null==o?void 0:o.hasOwnProperty("__original"))?null==o?void 0:o.__original:null==o?void 0:o.value,t.props.multiple?!!Array.isArray(t.value)&&t.value.filter((t=>e.eq(t,o))).length>0:void 0!==o?e.eq(t.value,o):(t.props._isChecked=e.eq(t.value,t.props.onValue),t.props._isChecked)}const mc={schema:/* #__PURE__ */ec(/* #__PURE__ */U("$options",/* #__PURE__ */oc(/* #__PURE__ */pc("$label"),/* #__PURE__ */fc(/* #__PURE__ */vc(/* #__PURE__ */cc(/* #__PURE__ */U("$fns.isChecked($option) === true",/* #__PURE__ */uc("$slots.default || $slots.on || $option.onLabel || $option.label"),/* #__PURE__ */uc("$slots.default || $slots.off || $option.offLabel || $option.label")))))),/* #__PURE__ */oc(/* #__PURE__ */U("$label && ($slots.default || $slots.on || $onLabel)",/* #__PURE__ */pc("$label")),/* #__PURE__ */dc(/* #__PURE__ */ic("prefix"),/* #__PURE__ */nc(),/* #__PURE__ */U("$_isChecked === true",/* #__PURE__ */uc("$slots.default || $slots.on || $onLabel || $label"),/* #__PURE__ */uc("$slots.default || $slots.off || $offLabel || $label")),/* #__PURE__ */rc(),/* #__PURE__ */ic("suffix")))),/* #__PURE__ */sc("$help"),/* #__PURE__ */ac(/* #__PURE__ */lc("$message.value"))),type:"input",family:"button",props:["options"],features:[function(t){var o,n,r,s;t.addProps(["enforced","multiple","offLabel","offValue","disabled","onLabel","onValue","vertical","_isChecked"]),t.props._isChecked=!1,t.props.enforced=e.undefine(t.props.enforced),t.props.multiple=e.undefine(t.props.multiple),t.props.vertical=e.undefine(t.props.vertical),"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),null!==(o=(r=t.props).onValue)&&void 0!==o||(r.onValue=!0),null!==(n=(s=t.props).offValue)&&void 0!==n||(s.offValue=!1),t.on("created",(()=>{var o;t.props._isChecked=hc(t,null),t.props.options&&t.props.multiple&&t.input(null!==(o=t.value)&&void 0!==o?o:[],!1),t.context&&(t.context.fns.isChecked=e=>hc(t,e),t.context.handlers.toggleValue=o=>n=>function(t,o,n){if(n.preventDefault(),o=o?Se(o):o,t.props.options)if(t.props.multiple){const n=Array.isArray(t.value)?[...t.value]:[],r=n.findIndex((t=>e.eq(t,o)));r>-1&&(!t.props.enforced||n.length>1)?n.splice(r,1):-1===r&&n.push(o),t.input(n)}else e.eq(t.value,o)&&!t.props.enforced?t.input(void 0):t.input(o);else t.input(e.eq(t.value,t.props.onValue)?t.props.offValue:t.props.onValue)}(t,o,n))}))},o.options]},gc=/* #__PURE__ */K("ut"),{outer:$c,inner:bc,wrapper:yc,label:xc,prefix:wc,suffix:_c,help:kc,messages:Sc,message:Lc,icon:Ac}=/* #__PURE__ */W(gc),Ic=gc("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onBlur:"$handlers.unitBlur",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",inputmode:"decimal",placeholder:"$placeholder || $unitParts.unit",disabled:"$disabled","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto"}}))),Dc={meter:{kilometer:.001,meter:1,centimeter:100,millimeter:1e3,mile:621371e-9,yard:1.09361,foot:3.28084,inch:39.3701,"mile-scandinavian":1e-4},kilometer:{kilometer:1,meter:1e3,centimeter:1e5,millimeter:1e6,mile:.621371,yard:1093.61,foot:3280.84,inch:39370.1,"mile-scandinavian":10},centimeter:{kilometer:1e-5,meter:.01,centimeter:1,millimeter:10,mile:62137e-10,yard:.0109361,foot:.0328084,inch:.393701,"mile-scandinavian":1e-6},millimeter:{kilometer:1e-6,meter:.001,centimeter:.1,millimeter:1,mile:6.21371e-7,yard:.00109361,foot:.00328084,inch:.0393701,"mile-scandinavian":1e-7},mile:{kilometer:1.60934,meter:1609.34,centimeter:160934,millimeter:1609340,mile:1,yard:1760,foot:5280,inch:63360,"mile-scandinavian":.160934},yard:{kilometer:9144e-7,meter:.9144,centimeter:91.44,millimeter:914.4,mile:568182e-9,yard:1,foot:3,inch:36,"mile-scandinavian":9144e-8},foot:{kilometer:3048e-7,meter:.3048,centimeter:30.48,millimeter:304.8,mile:189394e-9,yard:.333333,foot:1,inch:12,"mile-scandinavian":3048e-8},inch:{kilometer:254e-7,meter:.0254,centimeter:2.54,millimeter:25.4,mile:15783e-9,yard:.0277778,foot:.0833333,inch:1,"mile-scandinavian":254e-8},"mile-scandinavian":{kilometer:10,meter:1e4,centimeter:1e6,millimeter:1e7,mile:6.21371,yard:10936.1,foot:32808.4,inch:393701,"mile-scandinavian":1}},Cc={celsius:{celsius:e=>e,fahrenheit:e=>1.8*e+32},fahrenheit:{celsius:e=>5/9*(e-32),fahrenheit:e=>e}},Tc={acre:{acre:1,hectare:.404686},hectare:{acre:2.47105,hectare:1}},Ec={gram:{gram:1,kilogram:.001,ounce:.035274,pound:.00220462},kilogram:{gram:1e3,kilogram:1,ounce:35.274,pound:2.20462},ounce:{gram:28.3495,kilogram:.0283495,ounce:1,pound:.0625},pound:{gram:453.592,kilogram:.453592,ounce:16,pound:1},stone:{gram:6350.29,kilogram:6.35029,ounce:224,pound:14,stone:1}},Oc={liter:{liter:1,milliliter:1e3,gallon:.264172,"fluid-ounce":33.814},milliliter:{liter:.001,milliliter:1,gallon:264172e-9,"fluid-ounce":.033814},gallon:{liter:3.78541,milliliter:3785.41,gallon:1,"fluid-ounce":128},"fluid-ounce":{liter:.0295735,milliliter:29.5735,gallon:.0078125,"fluid-ounce":1}},Mc={day:{day:1,hour:24,microsecond:864e8,millisecond:864e5,minute:1440,month:.0328767,nanosecond:864e14,second:86400,week:.142857,year:.00273973},hour:{day:.0416667,hour:1,microsecond:36e8,millisecond:36e5,minute:60,month:.00136986,nanosecond:36e11,second:3600,week:.00595238,year:114155e-9},microsecond:{day:115741e-19,hour:277778e-18,microsecond:1,millisecond:.001,minute:1.66667e-8,month:380517e-24,nanosecond:1e3,second:1e-6,week:165344e-20,year:3171e-20},millisecond:{day:1.15741e-8,hour:2.77778e-7,microsecond:1e3,millisecond:1,minute:166667e-10,month:380517e-19,nanosecond:1e6,second:.001,week:165344e-16,year:3171e-16},minute:{day:694444e-9,hour:.0166667,microsecond:6e7,millisecond:6e4,minute:1,month:228311e-10,nanosecond:6e10,second:60,week:992063e-10,year:190132e-11},month:{day:30.4368,hour:730.484,microsecond:2628e12,millisecond:2628e9,minute:43800,month:1,nanosecond:2628e15,second:2628e6,week:4.34524,year:.0833333},nanosecond:{day:1.15741e-20,hour:277778e-24,microsecond:.001,millisecond:1e-6,minute:166667e-19,month:380517e-28,nanosecond:1,second:1e-9,week:165344e-26,year:3171e-26},second:{day:115741e-10,hour:277778e-9,microsecond:1e6,millisecond:1e3,minute:.0166667,month:380517e-16,nanosecond:1e9,second:1,week:1.65344e-8,year:3.171e-10},week:{day:7,hour:168,microsecond:6048e11,millisecond:6048e8,minute:10080,month:.230137,nanosecond:6048e14,second:604800,week:1,year:.0191781},year:{day:365,hour:8760,microsecond:3154e13,millisecond:3154e10,minute:525600,month:12,nanosecond:3154e16,second:3154e4,week:52.1429,year:1}},Vc={bit:{bit:1,byte:.125,kilobit:.001,kilobyte:125e-6,megabit:1e-6,megabyte:125e-9,gigabit:1e-9,gigabyte:1.25e-10,terabit:1e-12,terabyte:125e-15,petabyte:125e-18},byte:{bit:8,byte:1,kilobit:.008,kilobyte:.001,megabit:8e-6,megabyte:1e-6,gigabit:8e-9,gigabyte:1e-9,terabit:8e-12,terabyte:1e-12,petabyte:1e-15},kilobit:{bit:1e3,byte:125,kilobit:1,kilobyte:.125,megabit:.001,megabyte:125e-6,gigabit:1e-6,gigabyte:125e-9,terabit:1e-9,terabyte:1.25e-10,petabyte:125e-15},kilobyte:{bit:8e3,byte:1e3,kilobit:8,kilobyte:1,megabit:.008,megabyte:.001,gigabit:8e-6,gigabyte:1e-6,terabit:8e-9,terabyte:1e-9,petabyte:1e-12},megabit:{bit:1e6,byte:125e3,kilobit:1e3,kilobyte:125,megabit:1,megabyte:.125,gigabit:.001,gigabyte:125e-6,terabit:1e-6,terabyte:125e-9,petabyte:1.25e-10},megabyte:{bit:8e6,byte:1e6,kilobit:8e3,kilobyte:1e3,megabit:8,megabyte:1,gigabit:.008,gigabyte:.001,terabit:8e-6,terabyte:1e-6,petabyte:1e-9},gigabit:{bit:1e9,byte:125e6,kilobit:1e6,kilobyte:125e3,megabit:1e3,megabyte:125,gigabit:1,gigabyte:.125,terabit:.001,terabyte:125e-6,petabyte:125e-9},gigabyte:{bit:8e9,byte:1e9,kilobit:8e6,kilobyte:1e6,megabit:8e3,megabyte:1e3,gigabit:8,gigabyte:1,terabit:.008,terabyte:.001,petabyte:1e-6},terabit:{bit:1e12,byte:125e9,kilobit:1e9,kilobyte:125e6,megabit:1e6,megabyte:125e3,gigabit:1e3,gigabyte:125,terabit:1,terabyte:.125,petabyte:125e-6},terabyte:{bit:8e12,byte:1e12,kilobit:8e9,kilobyte:1e9,megabit:8e6,megabyte:1e6,gigabit:8e3,gigabyte:1e3,terabit:8,terabyte:1,petabyte:.001},petabyte:{bit:1e15,byte:125e12,kilobit:1e12,kilobyte:125e9,megabit:1e9,megabyte:125e6,gigabit:1e6,gigabyte:125e3,terabit:1e3,terabyte:125,petabyte:1}};function Fc(t){let o=!1;function n(e){var n,r,s;const i=(`${e}`.match(/\-/g)||[]).length%2==1;e=function(e){e=function(e){return e.replace(/[\u0660-\u0669\u06f0-\u06f9]/g,(e=>(15&e.charCodeAt(0)).toString()))}(`${e}`),isNaN(e)&&(e=e.split(t.props.unitParts.decimal).map((e=>e.replace(/[^0-9]/g,""))).join("."));if(e=e.replace(/[^0-9\.]/g,""),e.includes(".")){const o=e.split(".");0===t.props.decimals?e=o[0]:"currency"===t.props.type&&(o[1]=o[1].padEnd(p(),"0").slice(0,p()),e=o.join("."))}return e}(e);const d={};"unit"!==a()&&"decimal"!==a()||(d.minimumFractionDigits=e.includes(".")?1:0),d.maximumFractionDigits="currency"===t.props.type?p():t.props.decimals,t.props.minDecimals&&(d.minimumFractionDigits=t.props.minDecimals,e&&!e.includes(".")&&(e+=".".padEnd(t.props.minDecimals+1,"0"))),0===d.maximumFractionDigits&&e.includes(".")&&(e=e.split(".")[0]);let c="";if(!isNaN(e)&&""!==e.trim()&&(e=i?`-${e}`:e,t.props.max&&!isNaN(t.props.max)&&(e=Number(e)>t.props.max?`${t.props.max}`:e),t.props.min&&!isNaN(t.props.min)&&(e=Number(e)<t.props.min?`${t.props.min}`:e),e.includes(".")&&"currency"===t.props.type?e=e.split(".")[0].padStart(1,"0")+"."+(null!==(n=e.split(".")[1])&&void 0!==n?n:"0"):"currency"===t.props.type&&(d.maximumFractionDigits=null!==(r=d.minimumFractionDigits)&&void 0!==r?r:0),c=l(t.props.displayLocale,d).format(e),"unit"===t.props.type&&"."===e[e.length-1])){const o=c.lastIndexOf(t.props.unitParts.decimal);c=c.slice(0,o+1)+c.slice(o+2),e=e.slice(0,-1)}let u,f=e.split(".");"currency"===t.props.type&&(f=f[0]+(null!==(s=f[1])&&void 0!==s?s:"").padEnd(p(),"0"),f.length>1&&(f=f.replace(/^0+/,""),f=""!==e&&""===f?"0":f)),t.props.valueStore={number:e,integer:f,string:c},o=!0,t.props.valueStore&&(u=t.props.valueStore.hasOwnProperty(t.props.valueFormat)?t.props.valueStore[t.props.valueFormat]:t.props.valueStore.number),t.input(""===u?void 0:u).then((()=>(o=!1,Promise.resolve())))}function r(){e.whenAvailable(`${t.props.id}`,(e=>{var o,n;e instanceof HTMLInputElement&&(e.value=null!==(n=null===(o=t.props.valueStore)||void 0===o?void 0:o.string)&&void 0!==n?n:"")}),t.props.__root)}function s(){var e,o;const n=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`#${t.props.id}_inner input`);return null!==(o=null==n?void 0:n.value)&&void 0!==o?o:""}function a(){return t.props.currency?"currency":t.props.unit?"unit":"decimal"}function l(e,o={}){const n=a(),r=Object.assign({},{style:n,roundingMode:"trunc"},o);return"unit"===t.props.type&&(r.unitDisplay=t.props.unitDisplay),"currency"===t.props.type&&(r.currencyDisplay=t.props.currencyDisplay),r[n]=t.props[n],new Intl.NumberFormat(e,r)}function i(e,o){var n,r,a,l,i;const p=null===(n=t.props.__root)||void 0===n?void 0:n.querySelector(`#${t.props.id}_inner input`);if(!p)return;const d=(null!==(a=null===(r=t.props.unitParts.unit)||void 0===r?void 0:r.length)&&void 0!==a?a:0)+(null!==(i=null===(l=t.props.unitParts.literal)||void 0===l?void 0:l.length)&&void 0!==i?i:0);t.props.unitParts.unitLeft?e=Math.max(e,d):(e=Math.min(e,s().length-d),"insertText"===o&&0===e&&(e=1)),p.setSelectionRange(e,e)}function p(){return void 0!==t.props.decimals?t.props.decimals:void 0!==t.props.minDecimals&&t.props.minDecimals>t.props.unitParts.fractionLength?t.props.minDecimals:t.props.unitParts.fractionLength}t.props.valueStore=null,t.on("input",(({payload:e})=>{o||(n(e),r())})),t.context&&(t.context.handlers.init=(e=null)=>{var o;t.props.skipInit?t.props.skipInit=!1:function(){var e,o,n,r,s,a,i;t.props.skipInit=!0;const p=l(t.props.displayLocale).formatToParts(12345678.12345678);t.props.unitParts={decimal:null===(e=p.find((e=>"decimal"==e.type)))||void 0===e?void 0:e.value,group:null===(o=p.find((e=>"group"==e.type)))||void 0===o?void 0:o.value,unit:null===(n=p.find((e=>["unit","currency"].includes(e.type))))||void 0===n?void 0:n.value,unitLeft:["unit","currency"].includes(p[0].type),literal:null!==(s=null===(r=p.find((e=>"literal"==e.type)))||void 0===r?void 0:r.value)&&void 0!==s?s:"",fractionLength:null!==(i=null===(a=p.find((e=>"fraction"==e.type)))||void 0===a?void 0:a.value.length)&&void 0!==i?i:0}}();let s=null!==(o=null!=e?e:t._value)&&void 0!==o?o:"";t.props.valueStore?s=t.props.valueStore.number:"integer"===t.props.valueFormat&&(s=function(e){var t;return(parseFloat(`${e}`)/Math.pow(10,null!==(t=p())&&void 0!==t?t:0)).toString().replace(".",p())}(`${null!=s?s:""}`)),"unit"===t.props.type&&t.props.valueUnit&&t.props.unit&&t.props.valueUnit!==t.props.unit&&t.hook.input(((e,o)=>{const n=function(e,t,o){if(Dc[e]&&Dc[e][o])return t*Dc[e][o];if(Cc[e]&&Cc[e][o])return Cc[e][o](t);if(Tc[e]&&Tc[e][o])return t*Tc[e][o];if(Ec[e]&&Ec[e][o])return t*Ec[e][o];if(Oc[e]&&Oc[e][o])return t*Oc[e][o];if(Mc[e]&&Mc[e][o])return t*Mc[e][o];if(Vc[e]&&Vc[e][o])return t*Vc[e][o];throw new Error("Conversion not supported")}(t.props.unit,e,t.props.valueUnit);return isNaN(n)?o(e):o(+n.toFixed(Number(t.props.valueDecimals)||2))})),n(s),r()},t.context.handlers.handleBeforeInput=e=>{var o,r,s,a,l,p,d,c,u;if(!t.props.inExecCommand&&"insertLineBreak"!==e.inputType&&(e.preventDefault(),e.stopPropagation(),e.target instanceof HTMLInputElement)){const f=e.target,v=null!==(o=e.data)&&void 0!==o?o:"",h=null!==(r=e.target.value)&&void 0!==r?r:"",m=null!==(s=e.target.selectionStart)&&void 0!==s?s:0,g=null!==(a=e.target.selectionEnd)&&void 0!==a?a:0,$=g-m,b=h.indexOf(t.props.unitParts.decimal);let y=(null!==(l=e.target.selectionStart)&&void 0!==l?l:0)+(e.data?0:-1),x=h,w=1;if(h.includes(t.props.unitParts.decimal)&&v===t.props.unitParts.decimal)return v===t.props.unitParts.decimal&&(y=x.indexOf(t.props.unitParts.decimal)+1),void i(y);if(!(null===t.props.min||t.props.min<0||t.props.max<0)&&"-"===v)return;if(v.match(/[a-zA-Z]/))return;if(v===t.props.unitParts.decimal&&0===t.props.decimals)return;if("deleteByCut"===e.inputType&&$>0&&(x=x.slice(0,m)+x.slice(g),y=g),"insertFromPaste"===e.inputType){const t=null!==(p=e.data)&&void 0!==p?p:"";x=x.slice(0,m)+t+x.slice(g)}if("deleteContentBackward"===e.inputType&&h[m-1]===t.props.unitParts.group?(w+=1,y-=1):"deleteContentForward"===e.inputType&&h[m]===t.props.unitParts.group&&(w+=1,y+=1),-1!==b&&y>b&&"insertText"===e.inputType?x=function(e,t,o){return e.substring(0,t)+o+e.substring(t+o.length)}(x,y,null!==(d=e.data)&&void 0!==d?d:"0"):"insertText"===e.inputType?(y=g,x=x.slice(0,m)+e.data+x.slice(g)):"deleteContentForward"===e.inputType?(y+=2,x=0===$?x.slice(0,m)+x.slice(g+w):x.slice(0,m)+x.slice(g)):"deleteContentBackward"===e.inputType&&(y+=1,0===$?x=x.slice(0,Math.max(m-w,0))+x.slice(g):$>0&&(x=x.slice(0,m)+x.slice(g))),"deleteContentForward"===e.inputType&&h[m]===t.props.unitParts.decimal){const e=x.slice(m-1);x=x.slice(0,m),e.includes(t.props.unitParts.unit)&&(x+=" "+t.props.unitParts.unit)}else if("deleteContentBackward"===e.inputType&&h[m-1]===t.props.unitParts.decimal){const e=x.slice(m-1);x=x.slice(0,m-1),e.includes(t.props.unitParts.unit)&&(x+=" "+t.props.unitParts.unit)}if(n(x),x=(null===(c=t.props.valueStore)||void 0===c?void 0:c.string)||(null===(u=t.props.valueStore)||void 0===u?void 0:u.number)||"",y=x.length-h.length+y,x.length===h.length&&y>b&&(y+=e.inputType.includes("delete")?-1:1),f.setSelectionRange(0,h.length),t.props.inExecCommand=!0,document.execCommand("insertText",void 0,x),t.props.inExecCommand=!1,v===t.props.unitParts.decimal?y=x.indexOf(t.props.unitParts.decimal)+1:h.includes(t.props.unitParts.decimal)&&!x.includes(t.props.unitParts.decimal)&&(y=x.length),"insertText"===e.inputType&&t.props.minDecimals&&(!t.value||0===m&&g===h.length||-1===b&&t.props.minDecimals&&h)){let e=0;e=t.props.unitParts.unit?t.props.unitParts.unit.length+1:0,y-=t.props.minDecimals,t.props.unitParts.unitLeft?y-=e-1:y-=e+1}i(Math.max(0,y),e.inputType)}},t.context.handlers.handleInput=e=>{t.emit("dom-input-event",e),e.target instanceof HTMLInputElement&&(t.props.inputText=e.target.value,n(e.target.value))},t.context.handlers.handleKeyDown=e=>{var o,a;if(e.target instanceof HTMLInputElement&&("ArrowUp"===e.key||"ArrowDown"===e.key)){const l="ArrowUp"===e.key?1*t.props.step:-1*t.props.step;n(function(e,t){var o,n,r,s;const a=`${e}`.split("."),l=`${t}`.split(".");let i=null!==(o=a[0])&&void 0!==o?o:"0",p=null!==(n=l[0])&&void 0!==n?n:"0";const d=null!==(r=a[1])&&void 0!==r?r:"",c=null!==(s=l[1])&&void 0!==s?s:"",u=Math.max(d.length,c.length);u>0&&(i+=d.padEnd(u,"0"),p+=c.padEnd(u,"0"));const f=BigInt(BigInt(i)+BigInt(p)).toString();return u>0?f.slice(0,-1*u)+"."+f.slice(-1*u):f}(null!==(a=null===(o=t.props.valueStore)||void 0===o?void 0:o.number)&&void 0!==a?a:0,l)),r(),setTimeout((()=>{i(s().length)}),1)}})}const Pc={schema:/* #__PURE__ */$c(/* #__PURE__ */yc(/* #__PURE__ */xc("$label"),/* #__PURE__ */bc(/* #__PURE__ */Ac("prefix"),/* #__PURE__ */wc(),/* #__PURE__ */Ic(),/* #__PURE__ */_c(),/* #__PURE__ */Ac("suffix"))),/* #__PURE__ */kc("$help"),/* #__PURE__ */Sc(/* #__PURE__ */Lc("$message.value"))),type:"input",family:"text",features:[function(e){var t,o,n,r,s,a;const l=["unit","decimals","minDecimals","displayLocale","min","max","step","valueFormat","unitDisplay","placeholder","unitParts","valueUnit","valueDecimals"];e.addProps(l),null!==(t=(r=e.props).displayLocale)&&void 0!==t||(r.displayLocale=e.props.locale||"en-US"),e.props.unitDisplay=e.props.unitDisplay||"short","false"===e.props.decimals||!1===e.props.decimals?e.props.decimals=0:void 0!==e.props.decimals?e.props.decimals=Number(e.props.decimals):e.props.decimals=2,e.props.minDecimals=void 0!==e.props.minDecimals?Number(e.props.minDecimals):void 0,void 0!==e.props.min&&(e.props.min=Number(e.props.min)),void 0!==e.props.max&&(e.props.max=Number(e.props.max)),null!==(o=(s=e.props).step)&&void 0!==o||(s.step=1),null!==(n=(a=e.props).valueFormat)&&void 0!==n||(a.valueFormat="number"),-1===["string","number"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(e.context.handlers.unitBlur=t=>{if(!(t.target instanceof HTMLInputElement))return;let o=t.target.value;(function(e){e=e.trim();const t=/\d+\,\s*%?$/;return/\d+\.\s*%?$/.test(e)||t.test(e)})(o)&&(o=o.replace(e.props.unitParts.decimal,""),t.target.value=o)},Fc(e),e.context.handlers.init(),l.forEach((t=>{e.on(`prop:${t}`,(()=>{var t;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init()}))})))}))}]},Bc=/* #__PURE__ */K("cr"),{outer:Hc,inner:Rc,wrapper:Nc,label:Kc,prefix:Wc,suffix:qc,help:Uc,messages:zc,message:Yc,icon:jc}=/* #__PURE__ */W(Bc),Zc=Bc("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",disabled:"$disabled",placeholder:"$placeholder || $unitParts.unit",inputmode:"decimal","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto"}})));const Gc={schema:/* #__PURE__ */Hc(/* #__PURE__ */Nc(/* #__PURE__ */Kc("$label"),/* #__PURE__ */Rc(/* #__PURE__ */jc("prefix"),/* #__PURE__ */Wc(),/* #__PURE__ */Zc(),/* #__PURE__ */qc(),/* #__PURE__ */jc("suffix"))),/* #__PURE__ */Uc("$help"),/* #__PURE__ */zc(/* #__PURE__ */Yc("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,i;const p=["currency","decimals","maxDecimals","minDecimals","displayLocale","min","max","step","valueFormat","currencyDisplay","placeholder","unitParts"];e.addProps(p),e.addProps(["inputText"]),null!==(t=(s=e.props).displayLocale)&&void 0!==t||(s.displayLocale=e.props.locale||"en-US"),null!==(o=(a=e.props).currency)&&void 0!==o||(a.currency=e.props.currency||"USD"),"false"===e.props.decimals||!1===e.props.decimals?e.props.decimals=0:void 0!==e.props.decimals&&(e.props.decimals=Number(e.props.decimals)),e.props.minDecimals=void 0!==e.props.minDecimals?Number(e.props.minDecimals):void 0,void 0!==e.props.min&&(e.props.min=Number(e.props.min)),void 0!==e.props.max&&(e.props.max=Number(e.props.max)),null!==(n=(l=e.props).step)&&void 0!==n||(l.step=1),null!==(r=(i=e.props).valueFormat)&&void 0!==r||(i.valueFormat="number"),-1===["string","number","integer"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(Fc(e),e.context.handlers.init(),p.forEach((t=>{e.on(`prop:${t}`,(()=>{var t;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init()}))})))}))}]};var Xc=/*#__PURE__*/Object.freeze({__proto__:null,autocomplete:br,colorpicker:Jd,currency:Gc,datepicker:ul,dropdown:Zt,mask:si,rating:Mn,repeater:jo,slider:Yp,taglist:Vl,toggle:mo,togglebuttons:mc,transferlist:hp,unit:Pc});const Jc="undefined"!=typeof window?setInterval:()=>0,Qc=new WeakSet;exports.$if=U,exports.autocomplete=br,exports.colorpicker=Jd,exports.createBaseSections=W,exports.createProPlugin=function(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(Qc.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:h(13919),children:`${h(451228594)}${h(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){k[e]?k[e].add(t):k[e]=new Set([t])}(e,o)}}return function(e){const t=()=>{throw new Error(`InvalidFormKitKey ${e}`)};if(!/^fk-/i.test(e))return t();const o=e.substring(3);if(!d.test(o))return t();const n=parseInt(o,16).toString(),r=Number(n[0])<6?Number(n[0]):6,s=n.substring(r,r+(n.length-6)),a=n.substring(0,r)+n.substring(r+s.length),l=a.slice(0,2),i=`${a[a.length-1]}${a[0]}`;Number(s)!==Math.floor(Number(a)*Number(l)/Number(i))&&t()}(o),n.library=o=>{if(o.props.type in t){const{schema:n,...r}=t[o.props.type];Qc.add(o),o.define({...r,schema:n(e)})}Jc((()=>b.has(e)&&o.emit(952679114..toString(32))),4e3)},n}catch(r){throw r instanceof Error&&function(e){if("FormKitNoKey"===e.message)throw new Error("A FormKit API key is required, please visit https://formkit.com/pro")}(r),r}},exports.createSectionFactory=K,exports.currency=Gc,exports.datepicker=ul,exports.dropdown=Zt,exports.inputs=Xc,exports.mask=si,exports.rating=Mn,exports.repeater=jo,exports.slider=Yp,exports.taglist=Vl,exports.toggle=mo,exports.togglebuttons=mc,exports.transferlist=hp,exports.unit=Pc;
package/index.mjs CHANGED
@@ -62,4 +62,4 @@ import{isRecord as e,isObject as t,isPojo as o,eq as n,undefine as r,whenAvailab
62
62
  /* #__PURE__ */g("eyeDropper","color"),
63
63
  /* #__PURE__ */g("close","close"),
64
64
  /* #__PURE__ */$("close"),
65
- /* #__PURE__ */$("next")]},jc=/* #__PURE__ */Me("tb"),{outer:zc,inner:Zc,wrapper:Gc,prefix:qc,suffix:Xc,help:Jc,messages:Qc,message:eu,icon:tu}=/* #__PURE__ */Ve(jc),ou=jc("label",(()=>({if:"$label",$el:"label",attrs:{id:"$id + '_label'"}}))),nu=jc("singleToggle",(()=>({bind:"$attrs",$el:"button",attrs:{id:"$id",type:"button","aria-label":"$label","aria-pressed":"$fns.isChecked($onValue, $value)",onClick:"$handlers.toggleValue()",disabled:"$disabled",class:"$classes.input",onBlur:"$handlers.blur"}}))),ru=jc("multiToggle",(()=>({bind:"$attrs",$el:"button",attrs:{type:"button",id:"$id+'_'+$index","aria-label":"$label","aria-pressed":"$fns.isChecked($option, $value)",onClick:"$handlers.toggleValue($option)",class:"$classes.input",title:"$option.help",disabled:"$disabled || $option.disabled",onBlur:"$handlers.blur"}}))),su=jc("inputInner",(()=>({bind:"$attrs",$el:"span"}))),au=jc("options",(()=>({$el:"ul",attrs:{id:"$id","data-vertical":'$vertical && "true" || "false"',"aria-labelledby":"$id"}}))),lu=jc("option",(()=>({$el:"li",for:["option","index","$options"],attrs:{key:"$option.value","data-index":"$index"}})));function iu(e,t){return t=(null==t?void 0:t.hasOwnProperty("__original"))?null==t?void 0:t.__original:null==t?void 0:t.value,e.props.multiple?!!Array.isArray(e.value)&&e.value.filter((e=>n(e,t))).length>0:void 0!==t?n(e.value,t):(e.props._isChecked=n(e.value,e.props.onValue),e.props._isChecked)}const pu={schema:/* #__PURE__ */zc(/* #__PURE__ */Be("$options",/* #__PURE__ */Gc(/* #__PURE__ */ou("$label"),/* #__PURE__ */au(/* #__PURE__ */lu(/* #__PURE__ */ru(/* #__PURE__ */Be("$fns.isChecked($option) === true",/* #__PURE__ */su("$slots.default || $slots.on || $option.onLabel || $option.label"),/* #__PURE__ */su("$slots.default || $slots.off || $option.offLabel || $option.label")))))),/* #__PURE__ */Gc(/* #__PURE__ */Be("$label && ($slots.default || $slots.on || $onLabel)",/* #__PURE__ */ou("$label")),/* #__PURE__ */nu(/* #__PURE__ */tu("prefix"),/* #__PURE__ */qc(),/* #__PURE__ */Be("$_isChecked === true",/* #__PURE__ */su("$slots.default || $slots.on || $onLabel || $label"),/* #__PURE__ */su("$slots.default || $slots.off || $offLabel || $label")),/* #__PURE__ */Xc(),/* #__PURE__ */tu("suffix")))),/* #__PURE__ */Jc("$help"),/* #__PURE__ */Qc(/* #__PURE__ */eu("$message.value"))),type:"input",family:"button",props:["options"],features:[function(e){var t,o,s,a;e.addProps(["enforced","multiple","offLabel","offValue","onLabel","onValue","vertical","_isChecked"]),e.props._isChecked=!1,e.props.enforced=r(e.props.enforced),e.props.multiple=r(e.props.multiple),e.props.vertical=r(e.props.vertical),e.props.disabled=r(e.props.disabled),null!==(t=(s=e.props).onValue)&&void 0!==t||(s.onValue=!0),null!==(o=(a=e.props).offValue)&&void 0!==o||(a.offValue=!1),e.on("created",(()=>{var t;e.props._isChecked=iu(e,null),e.props.options&&e.props.multiple&&e.input(null!==(t=e.value)&&void 0!==t?t:[],!1),e.context&&(e.context.fns.isChecked=t=>iu(e,t),e.context.handlers.toggleValue=t=>o=>function(e,t,o){if(o.preventDefault(),t=t?gt(t):t,e.props.options)if(e.props.multiple){const o=Array.isArray(e.value)?[...e.value]:[],r=o.findIndex((e=>n(e,t)));r>-1&&(!e.props.enforced||o.length>1)?o.splice(r,1):-1===r&&o.push(t),e.input(o)}else n(e.value,t)&&!e.props.enforced?e.input(void 0):e.input(t);else e.input(n(e.value,e.props.onValue)?e.props.offValue:e.props.onValue)}(e,t,o))}))},b]},du=/* #__PURE__ */Me("ut"),{outer:cu,inner:uu,wrapper:fu,label:vu,prefix:hu,suffix:mu,help:gu,messages:$u,message:bu,icon:yu}=/* #__PURE__ */Ve(du),xu=du("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onBlur:"$handlers.unitBlur",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",inputmode:"decimal",placeholder:"$placeholder || $unitParts.unit",disabled:"$disabled","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto"}}))),wu={meter:{kilometer:.001,meter:1,centimeter:100,millimeter:1e3,mile:621371e-9,yard:1.09361,foot:3.28084,inch:39.3701,"mile-scandinavian":1e-4},kilometer:{kilometer:1,meter:1e3,centimeter:1e5,millimeter:1e6,mile:.621371,yard:1093.61,foot:3280.84,inch:39370.1,"mile-scandinavian":10},centimeter:{kilometer:1e-5,meter:.01,centimeter:1,millimeter:10,mile:62137e-10,yard:.0109361,foot:.0328084,inch:.393701,"mile-scandinavian":1e-6},millimeter:{kilometer:1e-6,meter:.001,centimeter:.1,millimeter:1,mile:6.21371e-7,yard:.00109361,foot:.00328084,inch:.0393701,"mile-scandinavian":1e-7},mile:{kilometer:1.60934,meter:1609.34,centimeter:160934,millimeter:1609340,mile:1,yard:1760,foot:5280,inch:63360,"mile-scandinavian":.160934},yard:{kilometer:9144e-7,meter:.9144,centimeter:91.44,millimeter:914.4,mile:568182e-9,yard:1,foot:3,inch:36,"mile-scandinavian":9144e-8},foot:{kilometer:3048e-7,meter:.3048,centimeter:30.48,millimeter:304.8,mile:189394e-9,yard:.333333,foot:1,inch:12,"mile-scandinavian":3048e-8},inch:{kilometer:254e-7,meter:.0254,centimeter:2.54,millimeter:25.4,mile:15783e-9,yard:.0277778,foot:.0833333,inch:1,"mile-scandinavian":254e-8},"mile-scandinavian":{kilometer:10,meter:1e4,centimeter:1e6,millimeter:1e7,mile:6.21371,yard:10936.1,foot:32808.4,inch:393701,"mile-scandinavian":1}},_u={celsius:{celsius:e=>e,fahrenheit:e=>1.8*e+32},fahrenheit:{celsius:e=>5/9*(e-32),fahrenheit:e=>e}},ku={acre:{acre:1,hectare:.404686},hectare:{acre:2.47105,hectare:1}},Su={gram:{gram:1,kilogram:.001,ounce:.035274,pound:.00220462},kilogram:{gram:1e3,kilogram:1,ounce:35.274,pound:2.20462},ounce:{gram:28.3495,kilogram:.0283495,ounce:1,pound:.0625},pound:{gram:453.592,kilogram:.453592,ounce:16,pound:1},stone:{gram:6350.29,kilogram:6.35029,ounce:224,pound:14,stone:1}},Lu={liter:{liter:1,milliliter:1e3,gallon:.264172,"fluid-ounce":33.814},milliliter:{liter:.001,milliliter:1,gallon:264172e-9,"fluid-ounce":.033814},gallon:{liter:3.78541,milliliter:3785.41,gallon:1,"fluid-ounce":128},"fluid-ounce":{liter:.0295735,milliliter:29.5735,gallon:.0078125,"fluid-ounce":1}},Iu={day:{day:1,hour:24,microsecond:864e8,millisecond:864e5,minute:1440,month:.0328767,nanosecond:864e14,second:86400,week:.142857,year:.00273973},hour:{day:.0416667,hour:1,microsecond:36e8,millisecond:36e5,minute:60,month:.00136986,nanosecond:36e11,second:3600,week:.00595238,year:114155e-9},microsecond:{day:115741e-19,hour:277778e-18,microsecond:1,millisecond:.001,minute:1.66667e-8,month:380517e-24,nanosecond:1e3,second:1e-6,week:165344e-20,year:3171e-20},millisecond:{day:1.15741e-8,hour:2.77778e-7,microsecond:1e3,millisecond:1,minute:166667e-10,month:380517e-19,nanosecond:1e6,second:.001,week:165344e-16,year:3171e-16},minute:{day:694444e-9,hour:.0166667,microsecond:6e7,millisecond:6e4,minute:1,month:228311e-10,nanosecond:6e10,second:60,week:992063e-10,year:190132e-11},month:{day:30.4368,hour:730.484,microsecond:2628e12,millisecond:2628e9,minute:43800,month:1,nanosecond:2628e15,second:2628e6,week:4.34524,year:.0833333},nanosecond:{day:1.15741e-20,hour:277778e-24,microsecond:.001,millisecond:1e-6,minute:166667e-19,month:380517e-28,nanosecond:1,second:1e-9,week:165344e-26,year:3171e-26},second:{day:115741e-10,hour:277778e-9,microsecond:1e6,millisecond:1e3,minute:.0166667,month:380517e-16,nanosecond:1e9,second:1,week:1.65344e-8,year:3.171e-10},week:{day:7,hour:168,microsecond:6048e11,millisecond:6048e8,minute:10080,month:.230137,nanosecond:6048e14,second:604800,week:1,year:.0191781},year:{day:365,hour:8760,microsecond:3154e13,millisecond:3154e10,minute:525600,month:12,nanosecond:3154e16,second:3154e4,week:52.1429,year:1}},Du={bit:{bit:1,byte:.125,kilobit:.001,kilobyte:125e-6,megabit:1e-6,megabyte:125e-9,gigabit:1e-9,gigabyte:1.25e-10,terabit:1e-12,terabyte:125e-15,petabyte:125e-18},byte:{bit:8,byte:1,kilobit:.008,kilobyte:.001,megabit:8e-6,megabyte:1e-6,gigabit:8e-9,gigabyte:1e-9,terabit:8e-12,terabyte:1e-12,petabyte:1e-15},kilobit:{bit:1e3,byte:125,kilobit:1,kilobyte:.125,megabit:.001,megabyte:125e-6,gigabit:1e-6,gigabyte:125e-9,terabit:1e-9,terabyte:1.25e-10,petabyte:125e-15},kilobyte:{bit:8e3,byte:1e3,kilobit:8,kilobyte:1,megabit:.008,megabyte:.001,gigabit:8e-6,gigabyte:1e-6,terabit:8e-9,terabyte:1e-9,petabyte:1e-12},megabit:{bit:1e6,byte:125e3,kilobit:1e3,kilobyte:125,megabit:1,megabyte:.125,gigabit:.001,gigabyte:125e-6,terabit:1e-6,terabyte:125e-9,petabyte:1.25e-10},megabyte:{bit:8e6,byte:1e6,kilobit:8e3,kilobyte:1e3,megabit:8,megabyte:1,gigabit:.008,gigabyte:.001,terabit:8e-6,terabyte:1e-6,petabyte:1e-9},gigabit:{bit:1e9,byte:125e6,kilobit:1e6,kilobyte:125e3,megabit:1e3,megabyte:125,gigabit:1,gigabyte:.125,terabit:.001,terabyte:125e-6,petabyte:125e-9},gigabyte:{bit:8e9,byte:1e9,kilobit:8e6,kilobyte:1e6,megabit:8e3,megabyte:1e3,gigabit:8,gigabyte:1,terabit:.008,terabyte:.001,petabyte:1e-6},terabit:{bit:1e12,byte:125e9,kilobit:1e9,kilobyte:125e6,megabit:1e6,megabyte:125e3,gigabit:1e3,gigabyte:125,terabit:1,terabyte:.125,petabyte:125e-6},terabyte:{bit:8e12,byte:1e12,kilobit:8e9,kilobyte:1e9,megabit:8e6,megabyte:1e6,gigabit:8e3,gigabyte:1e3,terabit:8,terabyte:1,petabyte:.001},petabyte:{bit:1e15,byte:125e12,kilobit:1e12,kilobyte:125e9,megabit:1e9,megabyte:125e6,gigabit:1e6,gigabyte:125e3,terabit:1e3,terabyte:125,petabyte:1}};function Au(e){let t=!1;function o(o){var n,r,s;const i=(`${o}`.match(/\-/g)||[]).length%2==1;o=function(t){t=function(e){return e.replace(/[\u0660-\u0669\u06f0-\u06f9]/g,(e=>(15&e.charCodeAt(0)).toString()))}(`${t}`),isNaN(t)&&(t=t.split(e.props.unitParts.decimal).map((e=>e.replace(/[^0-9]/g,""))).join("."));if(t=t.replace(/[^0-9\.]/g,""),t.includes(".")){const o=t.split(".");0===e.props.decimals?t=o[0]:"currency"===e.props.type&&(o[1]=o[1].padEnd(p(),"0").slice(0,p()),t=o.join("."))}return t}(o);const d={};"unit"!==a()&&"decimal"!==a()||(d.minimumFractionDigits=o.includes(".")?1:0),d.maximumFractionDigits="currency"===e.props.type?p():e.props.decimals,e.props.minDecimals&&(d.minimumFractionDigits=e.props.minDecimals,o&&!o.includes(".")&&(o+=".".padEnd(e.props.minDecimals+1,"0"))),0===d.maximumFractionDigits&&o.includes(".")&&(o=o.split(".")[0]);let c="";if(!isNaN(o)&&""!==o.trim()&&(o=i?`-${o}`:o,e.props.max&&!isNaN(e.props.max)&&(o=Number(o)>e.props.max?`${e.props.max}`:o),e.props.min&&!isNaN(e.props.min)&&(o=Number(o)<e.props.min?`${e.props.min}`:o),o.includes(".")&&"currency"===e.props.type?o=o.split(".")[0].padStart(1,"0")+"."+(null!==(n=o.split(".")[1])&&void 0!==n?n:"0"):"currency"===e.props.type&&(d.maximumFractionDigits=null!==(r=d.minimumFractionDigits)&&void 0!==r?r:0),c=l(e.props.displayLocale,d).format(o),"unit"===e.props.type&&"."===o[o.length-1])){const t=c.lastIndexOf(e.props.unitParts.decimal);c=c.slice(0,t+1)+c.slice(t+2),o=o.slice(0,-1)}let u,f=o.split(".");"currency"===e.props.type&&(f=f[0]+(null!==(s=f[1])&&void 0!==s?s:"").padEnd(p(),"0"),f.length>1&&(f=f.replace(/^0+/,""),f=""!==o&&""===f?"0":f)),e.props.valueStore={number:o,integer:f,string:c},t=!0,e.props.valueStore&&(u=e.props.valueStore.hasOwnProperty(e.props.valueFormat)?e.props.valueStore[e.props.valueFormat]:e.props.valueStore.number),e.input(""===u?void 0:u).then((()=>(t=!1,Promise.resolve())))}function n(){s(`${e.props.id}`,(t=>{var o,n;t instanceof HTMLInputElement&&(t.value=null!==(n=null===(o=e.props.valueStore)||void 0===o?void 0:o.string)&&void 0!==n?n:"")}),e.props.__root)}function r(){var t,o;const n=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`#${e.props.id}_inner input`);return null!==(o=null==n?void 0:n.value)&&void 0!==o?o:""}function a(){return e.props.currency?"currency":e.props.unit?"unit":"decimal"}function l(t,o={}){const n=a(),r=Object.assign({},{style:n,roundingMode:"trunc"},o);return"unit"===e.props.type&&(r.unitDisplay=e.props.unitDisplay),"currency"===e.props.type&&(r.currencyDisplay=e.props.currencyDisplay),r[n]=e.props[n],new Intl.NumberFormat(t,r)}function i(t,o){var n,s,a,l,i;const p=null===(n=e.props.__root)||void 0===n?void 0:n.querySelector(`#${e.props.id}_inner input`);if(!p)return;const d=(null!==(a=null===(s=e.props.unitParts.unit)||void 0===s?void 0:s.length)&&void 0!==a?a:0)+(null!==(i=null===(l=e.props.unitParts.literal)||void 0===l?void 0:l.length)&&void 0!==i?i:0);e.props.unitParts.unitLeft?t=Math.max(t,d):(t=Math.min(t,r().length-d),"insertText"===o&&0===t&&(t=1)),p.setSelectionRange(t,t)}function p(){return void 0!==e.props.decimals?e.props.decimals:void 0!==e.props.minDecimals&&e.props.minDecimals>e.props.unitParts.fractionLength?e.props.minDecimals:e.props.unitParts.fractionLength}e.props.valueStore=null,e.on("input",(({payload:e})=>{t||(o(e),n())})),e.context&&(e.context.handlers.init=(t=null)=>{var r;e.props.skipInit?e.props.skipInit=!1:function(){var t,o,n,r,s,a,i;e.props.skipInit=!0;const p=l(e.props.displayLocale).formatToParts(12345678.12345678);e.props.unitParts={decimal:null===(t=p.find((e=>"decimal"==e.type)))||void 0===t?void 0:t.value,group:null===(o=p.find((e=>"group"==e.type)))||void 0===o?void 0:o.value,unit:null===(n=p.find((e=>["unit","currency"].includes(e.type))))||void 0===n?void 0:n.value,unitLeft:["unit","currency"].includes(p[0].type),literal:null!==(s=null===(r=p.find((e=>"literal"==e.type)))||void 0===r?void 0:r.value)&&void 0!==s?s:"",fractionLength:null!==(i=null===(a=p.find((e=>"fraction"==e.type)))||void 0===a?void 0:a.value.length)&&void 0!==i?i:0}}();let s=null!==(r=null!=t?t:e._value)&&void 0!==r?r:"";e.props.valueStore?s=e.props.valueStore.number:"integer"===e.props.valueFormat&&(s=function(e){var t;return(parseFloat(`${e}`)/Math.pow(10,null!==(t=p())&&void 0!==t?t:0)).toString().replace(".",p())}(`${null!=s?s:""}`)),"unit"===e.props.type&&e.props.valueUnit&&e.props.unit&&e.props.valueUnit!==e.props.unit&&e.hook.input(((t,o)=>{const n=function(e,t,o){if(wu[e]&&wu[e][o])return t*wu[e][o];if(_u[e]&&_u[e][o])return _u[e][o](t);if(ku[e]&&ku[e][o])return t*ku[e][o];if(Su[e]&&Su[e][o])return t*Su[e][o];if(Lu[e]&&Lu[e][o])return t*Lu[e][o];if(Iu[e]&&Iu[e][o])return t*Iu[e][o];if(Du[e]&&Du[e][o])return t*Du[e][o];throw new Error("Conversion not supported")}(e.props.unit,t,e.props.valueUnit);return isNaN(n)?o(t):o(+n.toFixed(Number(e.props.valueDecimals)||2))})),o(s),n()},e.context.handlers.handleBeforeInput=t=>{var n,r,s,a,l,p,d,c,u;if(!e.props.inExecCommand&&"insertLineBreak"!==t.inputType&&(t.preventDefault(),t.stopPropagation(),t.target instanceof HTMLInputElement)){const f=t.target,v=null!==(n=t.data)&&void 0!==n?n:"",h=null!==(r=t.target.value)&&void 0!==r?r:"",m=null!==(s=t.target.selectionStart)&&void 0!==s?s:0,g=null!==(a=t.target.selectionEnd)&&void 0!==a?a:0,$=g-m,b=h.indexOf(e.props.unitParts.decimal);let y=(null!==(l=t.target.selectionStart)&&void 0!==l?l:0)+(t.data?0:-1),x=h,w=1;if(h.includes(e.props.unitParts.decimal)&&v===e.props.unitParts.decimal)return v===e.props.unitParts.decimal&&(y=x.indexOf(e.props.unitParts.decimal)+1),void i(y);if(!(null===e.props.min||e.props.min<0||e.props.max<0)&&"-"===v)return;if(v.match(/[a-zA-Z]/))return;if(v===e.props.unitParts.decimal&&0===e.props.decimals)return;if("deleteByCut"===t.inputType&&$>0&&(x=x.slice(0,m)+x.slice(g),y=g),"insertFromPaste"===t.inputType){const e=null!==(p=t.data)&&void 0!==p?p:"";x=x.slice(0,m)+e+x.slice(g)}if("deleteContentBackward"===t.inputType&&h[m-1]===e.props.unitParts.group?(w+=1,y-=1):"deleteContentForward"===t.inputType&&h[m]===e.props.unitParts.group&&(w+=1,y+=1),-1!==b&&y>b&&"insertText"===t.inputType?x=function(e,t,o){return e.substring(0,t)+o+e.substring(t+o.length)}(x,y,null!==(d=t.data)&&void 0!==d?d:"0"):"insertText"===t.inputType?(y=g,x=x.slice(0,m)+t.data+x.slice(g)):"deleteContentForward"===t.inputType?(y+=2,x=0===$?x.slice(0,m)+x.slice(g+w):x.slice(0,m)+x.slice(g)):"deleteContentBackward"===t.inputType&&(y+=1,0===$?x=x.slice(0,Math.max(m-w,0))+x.slice(g):$>0&&(x=x.slice(0,m)+x.slice(g))),"deleteContentForward"===t.inputType&&h[m]===e.props.unitParts.decimal){const t=x.slice(m-1);x=x.slice(0,m),t.includes(e.props.unitParts.unit)&&(x+=" "+e.props.unitParts.unit)}else if("deleteContentBackward"===t.inputType&&h[m-1]===e.props.unitParts.decimal){const t=x.slice(m-1);x=x.slice(0,m-1),t.includes(e.props.unitParts.unit)&&(x+=" "+e.props.unitParts.unit)}if(o(x),x=(null===(c=e.props.valueStore)||void 0===c?void 0:c.string)||(null===(u=e.props.valueStore)||void 0===u?void 0:u.number)||"",y=x.length-h.length+y,x.length===h.length&&y>b&&(y+=t.inputType.includes("delete")?-1:1),f.setSelectionRange(0,h.length),e.props.inExecCommand=!0,document.execCommand("insertText",void 0,x),e.props.inExecCommand=!1,v===e.props.unitParts.decimal?y=x.indexOf(e.props.unitParts.decimal)+1:h.includes(e.props.unitParts.decimal)&&!x.includes(e.props.unitParts.decimal)&&(y=x.length),"insertText"===t.inputType&&e.props.minDecimals&&(!e.value||0===m&&g===h.length||-1===b&&e.props.minDecimals&&h)){let t=0;t=e.props.unitParts.unit?e.props.unitParts.unit.length+1:0,y-=e.props.minDecimals,e.props.unitParts.unitLeft?y-=t-1:y-=t+1}i(Math.max(0,y),t.inputType)}},e.context.handlers.handleInput=t=>{e.emit("dom-input-event",t),t.target instanceof HTMLInputElement&&(e.props.inputText=t.target.value,o(t.target.value))},e.context.handlers.handleKeyDown=t=>{var s,a;if(t.target instanceof HTMLInputElement&&("ArrowUp"===t.key||"ArrowDown"===t.key)){const l="ArrowUp"===t.key?1*e.props.step:-1*e.props.step;o(function(e,t){var o,n,r,s;const a=`${e}`.split("."),l=`${t}`.split(".");let i=null!==(o=a[0])&&void 0!==o?o:"0",p=null!==(n=l[0])&&void 0!==n?n:"0";const d=null!==(r=a[1])&&void 0!==r?r:"",c=null!==(s=l[1])&&void 0!==s?s:"",u=Math.max(d.length,c.length);u>0&&(i+=d.padEnd(u,"0"),p+=c.padEnd(u,"0"));const f=BigInt(BigInt(i)+BigInt(p)).toString();return u>0?f.slice(0,-1*u)+"."+f.slice(-1*u):f}(null!==(a=null===(s=e.props.valueStore)||void 0===s?void 0:s.number)&&void 0!==a?a:0,l)),n(),setTimeout((()=>{i(r().length)}),1)}})}const Cu={schema:/* #__PURE__ */cu(/* #__PURE__ */fu(/* #__PURE__ */vu("$label"),/* #__PURE__ */uu(/* #__PURE__ */yu("prefix"),/* #__PURE__ */hu(),/* #__PURE__ */xu(),/* #__PURE__ */mu(),/* #__PURE__ */yu("suffix"))),/* #__PURE__ */gu("$help"),/* #__PURE__ */$u(/* #__PURE__ */bu("$message.value"))),type:"input",family:"text",features:[function(e){var t,o,n,r,s,a;const l=["unit","decimals","minDecimals","displayLocale","min","max","step","valueFormat","unitDisplay","placeholder","unitParts","valueUnit","valueDecimals"];e.addProps(l),null!==(t=(r=e.props).displayLocale)&&void 0!==t||(r.displayLocale=e.props.locale||"en-US"),e.props.unitDisplay=e.props.unitDisplay||"short","false"===e.props.decimals||!1===e.props.decimals?e.props.decimals=0:void 0!==e.props.decimals?e.props.decimals=Number(e.props.decimals):e.props.decimals=2,e.props.minDecimals=void 0!==e.props.minDecimals?Number(e.props.minDecimals):void 0,void 0!==e.props.min&&(e.props.min=Number(e.props.min)),void 0!==e.props.max&&(e.props.max=Number(e.props.max)),null!==(o=(s=e.props).step)&&void 0!==o||(s.step=1),null!==(n=(a=e.props).valueFormat)&&void 0!==n||(a.valueFormat="number"),-1===["string","number"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(e.context.handlers.unitBlur=t=>{if(!(t.target instanceof HTMLInputElement))return;let o=t.target.value;(function(e){e=e.trim();const t=/\d+\,\s*%?$/;return/\d+\.\s*%?$/.test(e)||t.test(e)})(o)&&(o=o.replace(e.props.unitParts.decimal,""),t.target.value=o)},Au(e),e.context.handlers.init(),l.forEach((t=>{e.on(`prop:${t}`,(()=>{var t;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init()}))})))}))}]},Tu=/* #__PURE__ */Me("cr"),{outer:Eu,inner:Ou,wrapper:Mu,label:Vu,prefix:Fu,suffix:Bu,help:Pu,messages:Hu,message:Ru,icon:Nu}=/* #__PURE__ */Ve(Tu),Ku=Tu("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",disabled:"$disabled",placeholder:"$placeholder || $unitParts.unit",inputmode:"decimal","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto"}})));const Wu={schema:/* #__PURE__ */Eu(/* #__PURE__ */Mu(/* #__PURE__ */Vu("$label"),/* #__PURE__ */Ou(/* #__PURE__ */Nu("prefix"),/* #__PURE__ */Fu(),/* #__PURE__ */Ku(),/* #__PURE__ */Bu(),/* #__PURE__ */Nu("suffix"))),/* #__PURE__ */Pu("$help"),/* #__PURE__ */Hu(/* #__PURE__ */Ru("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,i;const p=["currency","decimals","maxDecimals","minDecimals","displayLocale","min","max","step","valueFormat","currencyDisplay","placeholder","unitParts"];e.addProps(p),e.addProps(["inputText"]),null!==(t=(s=e.props).displayLocale)&&void 0!==t||(s.displayLocale=e.props.locale||"en-US"),null!==(o=(a=e.props).currency)&&void 0!==o||(a.currency=e.props.currency||"USD"),"false"===e.props.decimals||!1===e.props.decimals?e.props.decimals=0:void 0!==e.props.decimals&&(e.props.decimals=Number(e.props.decimals)),e.props.minDecimals=void 0!==e.props.minDecimals?Number(e.props.minDecimals):void 0,void 0!==e.props.min&&(e.props.min=Number(e.props.min)),void 0!==e.props.max&&(e.props.max=Number(e.props.max)),null!==(n=(l=e.props).step)&&void 0!==n||(l.step=1),null!==(r=(i=e.props).valueFormat)&&void 0!==r||(i.valueFormat="number"),-1===["string","number","integer"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(Au(e),e.context.handlers.init(),p.forEach((t=>{e.on(`prop:${t}`,(()=>{var t;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init()}))})))}))}]};var Uu=/*#__PURE__*/Object.freeze({__proto__:null,autocomplete:cs,colorpicker:Yc,currency:Wu,datepicker:si,dropdown:Ko,mask:Ji,rating:Lr,repeater:Nn,slider:Rd,taglist:Di,toggle:pn,togglebuttons:pu,transferlist:id,unit:Cu});const Yu="undefined"!=typeof window?setInterval:()=>0,ju=new WeakSet;function zu(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(ju.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:le(13919),children:`${le(451228594)}${le(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){me[e]?me[e].add(t):me[e]=new Set([t])}(e,o)}}return function(e){const t=()=>{throw new Error(`InvalidFormKitKey ${e}`)};if(!/^fk-/i.test(e))return t();const o=e.substring(3);if(!oe.test(o))return t();const n=parseInt(o,16).toString(),r=Number(n[0])<6?Number(n[0]):6,s=n.substring(r,r+(n.length-6)),a=n.substring(0,r)+n.substring(r+s.length),l=a.slice(0,2),i=`${a[a.length-1]}${a[0]}`;Number(s)!==Math.floor(Number(a)*Number(l)/Number(i))&&t()}(o),n.library=o=>{if(o.props.type in t){const{schema:n,...r}=t[o.props.type];ju.add(o),o.define({...r,schema:n(e)})}Yu((()=>ce.has(e)&&o.emit(952679114..toString(32))),4e3)},n}catch(r){throw r instanceof Error&&function(e){if("FormKitNoKey"===e.message)throw new Error("A FormKit API key is required, please visit https://formkit.com/pro")}(r),r}}export{Be as $if,cs as autocomplete,Yc as colorpicker,Ve as createBaseSections,zu as createProPlugin,Me as createSectionFactory,Wu as currency,si as datepicker,Ko as dropdown,Uu as inputs,Ji as mask,Lr as rating,Nn as repeater,Rd as slider,Di as taglist,pn as toggle,pu as togglebuttons,id as transferlist,Cu as unit};
65
+ /* #__PURE__ */$("next")]},jc=/* #__PURE__ */Me("tb"),{outer:zc,inner:Zc,wrapper:Gc,prefix:qc,suffix:Xc,help:Jc,messages:Qc,message:eu,icon:tu}=/* #__PURE__ */Ve(jc),ou=jc("label",(()=>({if:"$label",$el:"label",attrs:{id:"$id + '_label'"}}))),nu=jc("singleToggle",(()=>({bind:"$attrs",$el:"button",attrs:{id:"$id",type:"button","aria-label":"$label","aria-pressed":"$fns.isChecked($onValue, $value)",onClick:"$handlers.toggleValue()",disabled:"$disabled",class:"$classes.input",onBlur:"$handlers.blur"}}))),ru=jc("multiToggle",(()=>({bind:"$attrs",$el:"button",attrs:{type:"button",id:"$id+'_'+$index","aria-label":"$label","aria-pressed":"$fns.isChecked($option, $value)",onClick:"$handlers.toggleValue($option)",class:"$classes.input",title:"$option.help",disabled:"$disabled || $option.disabled",onBlur:"$handlers.blur"}}))),su=jc("inputInner",(()=>({bind:"$attrs",$el:"span"}))),au=jc("options",(()=>({$el:"ul",attrs:{id:"$id","data-vertical":'$vertical && "true" || "false"',"aria-labelledby":"$id"}}))),lu=jc("option",(()=>({$el:"li",for:["option","index","$options"],attrs:{key:"$option.value","data-index":"$index"}})));function iu(e,t){return t=(null==t?void 0:t.hasOwnProperty("__original"))?null==t?void 0:t.__original:null==t?void 0:t.value,e.props.multiple?!!Array.isArray(e.value)&&e.value.filter((e=>n(e,t))).length>0:void 0!==t?n(e.value,t):(e.props._isChecked=n(e.value,e.props.onValue),e.props._isChecked)}const pu={schema:/* #__PURE__ */zc(/* #__PURE__ */Be("$options",/* #__PURE__ */Gc(/* #__PURE__ */ou("$label"),/* #__PURE__ */au(/* #__PURE__ */lu(/* #__PURE__ */ru(/* #__PURE__ */Be("$fns.isChecked($option) === true",/* #__PURE__ */su("$slots.default || $slots.on || $option.onLabel || $option.label"),/* #__PURE__ */su("$slots.default || $slots.off || $option.offLabel || $option.label")))))),/* #__PURE__ */Gc(/* #__PURE__ */Be("$label && ($slots.default || $slots.on || $onLabel)",/* #__PURE__ */ou("$label")),/* #__PURE__ */nu(/* #__PURE__ */tu("prefix"),/* #__PURE__ */qc(),/* #__PURE__ */Be("$_isChecked === true",/* #__PURE__ */su("$slots.default || $slots.on || $onLabel || $label"),/* #__PURE__ */su("$slots.default || $slots.off || $offLabel || $label")),/* #__PURE__ */Xc(),/* #__PURE__ */tu("suffix")))),/* #__PURE__ */Jc("$help"),/* #__PURE__ */Qc(/* #__PURE__ */eu("$message.value"))),type:"input",family:"button",props:["options"],features:[function(e){var t,o,s,a;e.addProps(["enforced","multiple","offLabel","offValue","disabled","onLabel","onValue","vertical","_isChecked"]),e.props._isChecked=!1,e.props.enforced=r(e.props.enforced),e.props.multiple=r(e.props.multiple),e.props.vertical=r(e.props.vertical),"disabled"in e.props&&(e.props.disabled=r(e.props.disabled)),null!==(t=(s=e.props).onValue)&&void 0!==t||(s.onValue=!0),null!==(o=(a=e.props).offValue)&&void 0!==o||(a.offValue=!1),e.on("created",(()=>{var t;e.props._isChecked=iu(e,null),e.props.options&&e.props.multiple&&e.input(null!==(t=e.value)&&void 0!==t?t:[],!1),e.context&&(e.context.fns.isChecked=t=>iu(e,t),e.context.handlers.toggleValue=t=>o=>function(e,t,o){if(o.preventDefault(),t=t?gt(t):t,e.props.options)if(e.props.multiple){const o=Array.isArray(e.value)?[...e.value]:[],r=o.findIndex((e=>n(e,t)));r>-1&&(!e.props.enforced||o.length>1)?o.splice(r,1):-1===r&&o.push(t),e.input(o)}else n(e.value,t)&&!e.props.enforced?e.input(void 0):e.input(t);else e.input(n(e.value,e.props.onValue)?e.props.offValue:e.props.onValue)}(e,t,o))}))},b]},du=/* #__PURE__ */Me("ut"),{outer:cu,inner:uu,wrapper:fu,label:vu,prefix:hu,suffix:mu,help:gu,messages:$u,message:bu,icon:yu}=/* #__PURE__ */Ve(du),xu=du("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onBlur:"$handlers.unitBlur",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",inputmode:"decimal",placeholder:"$placeholder || $unitParts.unit",disabled:"$disabled","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto"}}))),wu={meter:{kilometer:.001,meter:1,centimeter:100,millimeter:1e3,mile:621371e-9,yard:1.09361,foot:3.28084,inch:39.3701,"mile-scandinavian":1e-4},kilometer:{kilometer:1,meter:1e3,centimeter:1e5,millimeter:1e6,mile:.621371,yard:1093.61,foot:3280.84,inch:39370.1,"mile-scandinavian":10},centimeter:{kilometer:1e-5,meter:.01,centimeter:1,millimeter:10,mile:62137e-10,yard:.0109361,foot:.0328084,inch:.393701,"mile-scandinavian":1e-6},millimeter:{kilometer:1e-6,meter:.001,centimeter:.1,millimeter:1,mile:6.21371e-7,yard:.00109361,foot:.00328084,inch:.0393701,"mile-scandinavian":1e-7},mile:{kilometer:1.60934,meter:1609.34,centimeter:160934,millimeter:1609340,mile:1,yard:1760,foot:5280,inch:63360,"mile-scandinavian":.160934},yard:{kilometer:9144e-7,meter:.9144,centimeter:91.44,millimeter:914.4,mile:568182e-9,yard:1,foot:3,inch:36,"mile-scandinavian":9144e-8},foot:{kilometer:3048e-7,meter:.3048,centimeter:30.48,millimeter:304.8,mile:189394e-9,yard:.333333,foot:1,inch:12,"mile-scandinavian":3048e-8},inch:{kilometer:254e-7,meter:.0254,centimeter:2.54,millimeter:25.4,mile:15783e-9,yard:.0277778,foot:.0833333,inch:1,"mile-scandinavian":254e-8},"mile-scandinavian":{kilometer:10,meter:1e4,centimeter:1e6,millimeter:1e7,mile:6.21371,yard:10936.1,foot:32808.4,inch:393701,"mile-scandinavian":1}},_u={celsius:{celsius:e=>e,fahrenheit:e=>1.8*e+32},fahrenheit:{celsius:e=>5/9*(e-32),fahrenheit:e=>e}},ku={acre:{acre:1,hectare:.404686},hectare:{acre:2.47105,hectare:1}},Su={gram:{gram:1,kilogram:.001,ounce:.035274,pound:.00220462},kilogram:{gram:1e3,kilogram:1,ounce:35.274,pound:2.20462},ounce:{gram:28.3495,kilogram:.0283495,ounce:1,pound:.0625},pound:{gram:453.592,kilogram:.453592,ounce:16,pound:1},stone:{gram:6350.29,kilogram:6.35029,ounce:224,pound:14,stone:1}},Lu={liter:{liter:1,milliliter:1e3,gallon:.264172,"fluid-ounce":33.814},milliliter:{liter:.001,milliliter:1,gallon:264172e-9,"fluid-ounce":.033814},gallon:{liter:3.78541,milliliter:3785.41,gallon:1,"fluid-ounce":128},"fluid-ounce":{liter:.0295735,milliliter:29.5735,gallon:.0078125,"fluid-ounce":1}},Iu={day:{day:1,hour:24,microsecond:864e8,millisecond:864e5,minute:1440,month:.0328767,nanosecond:864e14,second:86400,week:.142857,year:.00273973},hour:{day:.0416667,hour:1,microsecond:36e8,millisecond:36e5,minute:60,month:.00136986,nanosecond:36e11,second:3600,week:.00595238,year:114155e-9},microsecond:{day:115741e-19,hour:277778e-18,microsecond:1,millisecond:.001,minute:1.66667e-8,month:380517e-24,nanosecond:1e3,second:1e-6,week:165344e-20,year:3171e-20},millisecond:{day:1.15741e-8,hour:2.77778e-7,microsecond:1e3,millisecond:1,minute:166667e-10,month:380517e-19,nanosecond:1e6,second:.001,week:165344e-16,year:3171e-16},minute:{day:694444e-9,hour:.0166667,microsecond:6e7,millisecond:6e4,minute:1,month:228311e-10,nanosecond:6e10,second:60,week:992063e-10,year:190132e-11},month:{day:30.4368,hour:730.484,microsecond:2628e12,millisecond:2628e9,minute:43800,month:1,nanosecond:2628e15,second:2628e6,week:4.34524,year:.0833333},nanosecond:{day:1.15741e-20,hour:277778e-24,microsecond:.001,millisecond:1e-6,minute:166667e-19,month:380517e-28,nanosecond:1,second:1e-9,week:165344e-26,year:3171e-26},second:{day:115741e-10,hour:277778e-9,microsecond:1e6,millisecond:1e3,minute:.0166667,month:380517e-16,nanosecond:1e9,second:1,week:1.65344e-8,year:3.171e-10},week:{day:7,hour:168,microsecond:6048e11,millisecond:6048e8,minute:10080,month:.230137,nanosecond:6048e14,second:604800,week:1,year:.0191781},year:{day:365,hour:8760,microsecond:3154e13,millisecond:3154e10,minute:525600,month:12,nanosecond:3154e16,second:3154e4,week:52.1429,year:1}},Du={bit:{bit:1,byte:.125,kilobit:.001,kilobyte:125e-6,megabit:1e-6,megabyte:125e-9,gigabit:1e-9,gigabyte:1.25e-10,terabit:1e-12,terabyte:125e-15,petabyte:125e-18},byte:{bit:8,byte:1,kilobit:.008,kilobyte:.001,megabit:8e-6,megabyte:1e-6,gigabit:8e-9,gigabyte:1e-9,terabit:8e-12,terabyte:1e-12,petabyte:1e-15},kilobit:{bit:1e3,byte:125,kilobit:1,kilobyte:.125,megabit:.001,megabyte:125e-6,gigabit:1e-6,gigabyte:125e-9,terabit:1e-9,terabyte:1.25e-10,petabyte:125e-15},kilobyte:{bit:8e3,byte:1e3,kilobit:8,kilobyte:1,megabit:.008,megabyte:.001,gigabit:8e-6,gigabyte:1e-6,terabit:8e-9,terabyte:1e-9,petabyte:1e-12},megabit:{bit:1e6,byte:125e3,kilobit:1e3,kilobyte:125,megabit:1,megabyte:.125,gigabit:.001,gigabyte:125e-6,terabit:1e-6,terabyte:125e-9,petabyte:1.25e-10},megabyte:{bit:8e6,byte:1e6,kilobit:8e3,kilobyte:1e3,megabit:8,megabyte:1,gigabit:.008,gigabyte:.001,terabit:8e-6,terabyte:1e-6,petabyte:1e-9},gigabit:{bit:1e9,byte:125e6,kilobit:1e6,kilobyte:125e3,megabit:1e3,megabyte:125,gigabit:1,gigabyte:.125,terabit:.001,terabyte:125e-6,petabyte:125e-9},gigabyte:{bit:8e9,byte:1e9,kilobit:8e6,kilobyte:1e6,megabit:8e3,megabyte:1e3,gigabit:8,gigabyte:1,terabit:.008,terabyte:.001,petabyte:1e-6},terabit:{bit:1e12,byte:125e9,kilobit:1e9,kilobyte:125e6,megabit:1e6,megabyte:125e3,gigabit:1e3,gigabyte:125,terabit:1,terabyte:.125,petabyte:125e-6},terabyte:{bit:8e12,byte:1e12,kilobit:8e9,kilobyte:1e9,megabit:8e6,megabyte:1e6,gigabit:8e3,gigabyte:1e3,terabit:8,terabyte:1,petabyte:.001},petabyte:{bit:1e15,byte:125e12,kilobit:1e12,kilobyte:125e9,megabit:1e9,megabyte:125e6,gigabit:1e6,gigabyte:125e3,terabit:1e3,terabyte:125,petabyte:1}};function Au(e){let t=!1;function o(o){var n,r,s;const i=(`${o}`.match(/\-/g)||[]).length%2==1;o=function(t){t=function(e){return e.replace(/[\u0660-\u0669\u06f0-\u06f9]/g,(e=>(15&e.charCodeAt(0)).toString()))}(`${t}`),isNaN(t)&&(t=t.split(e.props.unitParts.decimal).map((e=>e.replace(/[^0-9]/g,""))).join("."));if(t=t.replace(/[^0-9\.]/g,""),t.includes(".")){const o=t.split(".");0===e.props.decimals?t=o[0]:"currency"===e.props.type&&(o[1]=o[1].padEnd(p(),"0").slice(0,p()),t=o.join("."))}return t}(o);const d={};"unit"!==a()&&"decimal"!==a()||(d.minimumFractionDigits=o.includes(".")?1:0),d.maximumFractionDigits="currency"===e.props.type?p():e.props.decimals,e.props.minDecimals&&(d.minimumFractionDigits=e.props.minDecimals,o&&!o.includes(".")&&(o+=".".padEnd(e.props.minDecimals+1,"0"))),0===d.maximumFractionDigits&&o.includes(".")&&(o=o.split(".")[0]);let c="";if(!isNaN(o)&&""!==o.trim()&&(o=i?`-${o}`:o,e.props.max&&!isNaN(e.props.max)&&(o=Number(o)>e.props.max?`${e.props.max}`:o),e.props.min&&!isNaN(e.props.min)&&(o=Number(o)<e.props.min?`${e.props.min}`:o),o.includes(".")&&"currency"===e.props.type?o=o.split(".")[0].padStart(1,"0")+"."+(null!==(n=o.split(".")[1])&&void 0!==n?n:"0"):"currency"===e.props.type&&(d.maximumFractionDigits=null!==(r=d.minimumFractionDigits)&&void 0!==r?r:0),c=l(e.props.displayLocale,d).format(o),"unit"===e.props.type&&"."===o[o.length-1])){const t=c.lastIndexOf(e.props.unitParts.decimal);c=c.slice(0,t+1)+c.slice(t+2),o=o.slice(0,-1)}let u,f=o.split(".");"currency"===e.props.type&&(f=f[0]+(null!==(s=f[1])&&void 0!==s?s:"").padEnd(p(),"0"),f.length>1&&(f=f.replace(/^0+/,""),f=""!==o&&""===f?"0":f)),e.props.valueStore={number:o,integer:f,string:c},t=!0,e.props.valueStore&&(u=e.props.valueStore.hasOwnProperty(e.props.valueFormat)?e.props.valueStore[e.props.valueFormat]:e.props.valueStore.number),e.input(""===u?void 0:u).then((()=>(t=!1,Promise.resolve())))}function n(){s(`${e.props.id}`,(t=>{var o,n;t instanceof HTMLInputElement&&(t.value=null!==(n=null===(o=e.props.valueStore)||void 0===o?void 0:o.string)&&void 0!==n?n:"")}),e.props.__root)}function r(){var t,o;const n=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`#${e.props.id}_inner input`);return null!==(o=null==n?void 0:n.value)&&void 0!==o?o:""}function a(){return e.props.currency?"currency":e.props.unit?"unit":"decimal"}function l(t,o={}){const n=a(),r=Object.assign({},{style:n,roundingMode:"trunc"},o);return"unit"===e.props.type&&(r.unitDisplay=e.props.unitDisplay),"currency"===e.props.type&&(r.currencyDisplay=e.props.currencyDisplay),r[n]=e.props[n],new Intl.NumberFormat(t,r)}function i(t,o){var n,s,a,l,i;const p=null===(n=e.props.__root)||void 0===n?void 0:n.querySelector(`#${e.props.id}_inner input`);if(!p)return;const d=(null!==(a=null===(s=e.props.unitParts.unit)||void 0===s?void 0:s.length)&&void 0!==a?a:0)+(null!==(i=null===(l=e.props.unitParts.literal)||void 0===l?void 0:l.length)&&void 0!==i?i:0);e.props.unitParts.unitLeft?t=Math.max(t,d):(t=Math.min(t,r().length-d),"insertText"===o&&0===t&&(t=1)),p.setSelectionRange(t,t)}function p(){return void 0!==e.props.decimals?e.props.decimals:void 0!==e.props.minDecimals&&e.props.minDecimals>e.props.unitParts.fractionLength?e.props.minDecimals:e.props.unitParts.fractionLength}e.props.valueStore=null,e.on("input",(({payload:e})=>{t||(o(e),n())})),e.context&&(e.context.handlers.init=(t=null)=>{var r;e.props.skipInit?e.props.skipInit=!1:function(){var t,o,n,r,s,a,i;e.props.skipInit=!0;const p=l(e.props.displayLocale).formatToParts(12345678.12345678);e.props.unitParts={decimal:null===(t=p.find((e=>"decimal"==e.type)))||void 0===t?void 0:t.value,group:null===(o=p.find((e=>"group"==e.type)))||void 0===o?void 0:o.value,unit:null===(n=p.find((e=>["unit","currency"].includes(e.type))))||void 0===n?void 0:n.value,unitLeft:["unit","currency"].includes(p[0].type),literal:null!==(s=null===(r=p.find((e=>"literal"==e.type)))||void 0===r?void 0:r.value)&&void 0!==s?s:"",fractionLength:null!==(i=null===(a=p.find((e=>"fraction"==e.type)))||void 0===a?void 0:a.value.length)&&void 0!==i?i:0}}();let s=null!==(r=null!=t?t:e._value)&&void 0!==r?r:"";e.props.valueStore?s=e.props.valueStore.number:"integer"===e.props.valueFormat&&(s=function(e){var t;return(parseFloat(`${e}`)/Math.pow(10,null!==(t=p())&&void 0!==t?t:0)).toString().replace(".",p())}(`${null!=s?s:""}`)),"unit"===e.props.type&&e.props.valueUnit&&e.props.unit&&e.props.valueUnit!==e.props.unit&&e.hook.input(((t,o)=>{const n=function(e,t,o){if(wu[e]&&wu[e][o])return t*wu[e][o];if(_u[e]&&_u[e][o])return _u[e][o](t);if(ku[e]&&ku[e][o])return t*ku[e][o];if(Su[e]&&Su[e][o])return t*Su[e][o];if(Lu[e]&&Lu[e][o])return t*Lu[e][o];if(Iu[e]&&Iu[e][o])return t*Iu[e][o];if(Du[e]&&Du[e][o])return t*Du[e][o];throw new Error("Conversion not supported")}(e.props.unit,t,e.props.valueUnit);return isNaN(n)?o(t):o(+n.toFixed(Number(e.props.valueDecimals)||2))})),o(s),n()},e.context.handlers.handleBeforeInput=t=>{var n,r,s,a,l,p,d,c,u;if(!e.props.inExecCommand&&"insertLineBreak"!==t.inputType&&(t.preventDefault(),t.stopPropagation(),t.target instanceof HTMLInputElement)){const f=t.target,v=null!==(n=t.data)&&void 0!==n?n:"",h=null!==(r=t.target.value)&&void 0!==r?r:"",m=null!==(s=t.target.selectionStart)&&void 0!==s?s:0,g=null!==(a=t.target.selectionEnd)&&void 0!==a?a:0,$=g-m,b=h.indexOf(e.props.unitParts.decimal);let y=(null!==(l=t.target.selectionStart)&&void 0!==l?l:0)+(t.data?0:-1),x=h,w=1;if(h.includes(e.props.unitParts.decimal)&&v===e.props.unitParts.decimal)return v===e.props.unitParts.decimal&&(y=x.indexOf(e.props.unitParts.decimal)+1),void i(y);if(!(null===e.props.min||e.props.min<0||e.props.max<0)&&"-"===v)return;if(v.match(/[a-zA-Z]/))return;if(v===e.props.unitParts.decimal&&0===e.props.decimals)return;if("deleteByCut"===t.inputType&&$>0&&(x=x.slice(0,m)+x.slice(g),y=g),"insertFromPaste"===t.inputType){const e=null!==(p=t.data)&&void 0!==p?p:"";x=x.slice(0,m)+e+x.slice(g)}if("deleteContentBackward"===t.inputType&&h[m-1]===e.props.unitParts.group?(w+=1,y-=1):"deleteContentForward"===t.inputType&&h[m]===e.props.unitParts.group&&(w+=1,y+=1),-1!==b&&y>b&&"insertText"===t.inputType?x=function(e,t,o){return e.substring(0,t)+o+e.substring(t+o.length)}(x,y,null!==(d=t.data)&&void 0!==d?d:"0"):"insertText"===t.inputType?(y=g,x=x.slice(0,m)+t.data+x.slice(g)):"deleteContentForward"===t.inputType?(y+=2,x=0===$?x.slice(0,m)+x.slice(g+w):x.slice(0,m)+x.slice(g)):"deleteContentBackward"===t.inputType&&(y+=1,0===$?x=x.slice(0,Math.max(m-w,0))+x.slice(g):$>0&&(x=x.slice(0,m)+x.slice(g))),"deleteContentForward"===t.inputType&&h[m]===e.props.unitParts.decimal){const t=x.slice(m-1);x=x.slice(0,m),t.includes(e.props.unitParts.unit)&&(x+=" "+e.props.unitParts.unit)}else if("deleteContentBackward"===t.inputType&&h[m-1]===e.props.unitParts.decimal){const t=x.slice(m-1);x=x.slice(0,m-1),t.includes(e.props.unitParts.unit)&&(x+=" "+e.props.unitParts.unit)}if(o(x),x=(null===(c=e.props.valueStore)||void 0===c?void 0:c.string)||(null===(u=e.props.valueStore)||void 0===u?void 0:u.number)||"",y=x.length-h.length+y,x.length===h.length&&y>b&&(y+=t.inputType.includes("delete")?-1:1),f.setSelectionRange(0,h.length),e.props.inExecCommand=!0,document.execCommand("insertText",void 0,x),e.props.inExecCommand=!1,v===e.props.unitParts.decimal?y=x.indexOf(e.props.unitParts.decimal)+1:h.includes(e.props.unitParts.decimal)&&!x.includes(e.props.unitParts.decimal)&&(y=x.length),"insertText"===t.inputType&&e.props.minDecimals&&(!e.value||0===m&&g===h.length||-1===b&&e.props.minDecimals&&h)){let t=0;t=e.props.unitParts.unit?e.props.unitParts.unit.length+1:0,y-=e.props.minDecimals,e.props.unitParts.unitLeft?y-=t-1:y-=t+1}i(Math.max(0,y),t.inputType)}},e.context.handlers.handleInput=t=>{e.emit("dom-input-event",t),t.target instanceof HTMLInputElement&&(e.props.inputText=t.target.value,o(t.target.value))},e.context.handlers.handleKeyDown=t=>{var s,a;if(t.target instanceof HTMLInputElement&&("ArrowUp"===t.key||"ArrowDown"===t.key)){const l="ArrowUp"===t.key?1*e.props.step:-1*e.props.step;o(function(e,t){var o,n,r,s;const a=`${e}`.split("."),l=`${t}`.split(".");let i=null!==(o=a[0])&&void 0!==o?o:"0",p=null!==(n=l[0])&&void 0!==n?n:"0";const d=null!==(r=a[1])&&void 0!==r?r:"",c=null!==(s=l[1])&&void 0!==s?s:"",u=Math.max(d.length,c.length);u>0&&(i+=d.padEnd(u,"0"),p+=c.padEnd(u,"0"));const f=BigInt(BigInt(i)+BigInt(p)).toString();return u>0?f.slice(0,-1*u)+"."+f.slice(-1*u):f}(null!==(a=null===(s=e.props.valueStore)||void 0===s?void 0:s.number)&&void 0!==a?a:0,l)),n(),setTimeout((()=>{i(r().length)}),1)}})}const Cu={schema:/* #__PURE__ */cu(/* #__PURE__ */fu(/* #__PURE__ */vu("$label"),/* #__PURE__ */uu(/* #__PURE__ */yu("prefix"),/* #__PURE__ */hu(),/* #__PURE__ */xu(),/* #__PURE__ */mu(),/* #__PURE__ */yu("suffix"))),/* #__PURE__ */gu("$help"),/* #__PURE__ */$u(/* #__PURE__ */bu("$message.value"))),type:"input",family:"text",features:[function(e){var t,o,n,r,s,a;const l=["unit","decimals","minDecimals","displayLocale","min","max","step","valueFormat","unitDisplay","placeholder","unitParts","valueUnit","valueDecimals"];e.addProps(l),null!==(t=(r=e.props).displayLocale)&&void 0!==t||(r.displayLocale=e.props.locale||"en-US"),e.props.unitDisplay=e.props.unitDisplay||"short","false"===e.props.decimals||!1===e.props.decimals?e.props.decimals=0:void 0!==e.props.decimals?e.props.decimals=Number(e.props.decimals):e.props.decimals=2,e.props.minDecimals=void 0!==e.props.minDecimals?Number(e.props.minDecimals):void 0,void 0!==e.props.min&&(e.props.min=Number(e.props.min)),void 0!==e.props.max&&(e.props.max=Number(e.props.max)),null!==(o=(s=e.props).step)&&void 0!==o||(s.step=1),null!==(n=(a=e.props).valueFormat)&&void 0!==n||(a.valueFormat="number"),-1===["string","number"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(e.context.handlers.unitBlur=t=>{if(!(t.target instanceof HTMLInputElement))return;let o=t.target.value;(function(e){e=e.trim();const t=/\d+\,\s*%?$/;return/\d+\.\s*%?$/.test(e)||t.test(e)})(o)&&(o=o.replace(e.props.unitParts.decimal,""),t.target.value=o)},Au(e),e.context.handlers.init(),l.forEach((t=>{e.on(`prop:${t}`,(()=>{var t;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init()}))})))}))}]},Tu=/* #__PURE__ */Me("cr"),{outer:Eu,inner:Ou,wrapper:Mu,label:Vu,prefix:Fu,suffix:Bu,help:Pu,messages:Hu,message:Ru,icon:Nu}=/* #__PURE__ */Ve(Tu),Ku=Tu("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",disabled:"$disabled",placeholder:"$placeholder || $unitParts.unit",inputmode:"decimal","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto"}})));const Wu={schema:/* #__PURE__ */Eu(/* #__PURE__ */Mu(/* #__PURE__ */Vu("$label"),/* #__PURE__ */Ou(/* #__PURE__ */Nu("prefix"),/* #__PURE__ */Fu(),/* #__PURE__ */Ku(),/* #__PURE__ */Bu(),/* #__PURE__ */Nu("suffix"))),/* #__PURE__ */Pu("$help"),/* #__PURE__ */Hu(/* #__PURE__ */Ru("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,i;const p=["currency","decimals","maxDecimals","minDecimals","displayLocale","min","max","step","valueFormat","currencyDisplay","placeholder","unitParts"];e.addProps(p),e.addProps(["inputText"]),null!==(t=(s=e.props).displayLocale)&&void 0!==t||(s.displayLocale=e.props.locale||"en-US"),null!==(o=(a=e.props).currency)&&void 0!==o||(a.currency=e.props.currency||"USD"),"false"===e.props.decimals||!1===e.props.decimals?e.props.decimals=0:void 0!==e.props.decimals&&(e.props.decimals=Number(e.props.decimals)),e.props.minDecimals=void 0!==e.props.minDecimals?Number(e.props.minDecimals):void 0,void 0!==e.props.min&&(e.props.min=Number(e.props.min)),void 0!==e.props.max&&(e.props.max=Number(e.props.max)),null!==(n=(l=e.props).step)&&void 0!==n||(l.step=1),null!==(r=(i=e.props).valueFormat)&&void 0!==r||(i.valueFormat="number"),-1===["string","number","integer"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(Au(e),e.context.handlers.init(),p.forEach((t=>{e.on(`prop:${t}`,(()=>{var t;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init()}))})))}))}]};var Uu=/*#__PURE__*/Object.freeze({__proto__:null,autocomplete:cs,colorpicker:Yc,currency:Wu,datepicker:si,dropdown:Ko,mask:Ji,rating:Lr,repeater:Nn,slider:Rd,taglist:Di,toggle:pn,togglebuttons:pu,transferlist:id,unit:Cu});const Yu="undefined"!=typeof window?setInterval:()=>0,ju=new WeakSet;function zu(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(ju.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:le(13919),children:`${le(451228594)}${le(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){me[e]?me[e].add(t):me[e]=new Set([t])}(e,o)}}return function(e){const t=()=>{throw new Error(`InvalidFormKitKey ${e}`)};if(!/^fk-/i.test(e))return t();const o=e.substring(3);if(!oe.test(o))return t();const n=parseInt(o,16).toString(),r=Number(n[0])<6?Number(n[0]):6,s=n.substring(r,r+(n.length-6)),a=n.substring(0,r)+n.substring(r+s.length),l=a.slice(0,2),i=`${a[a.length-1]}${a[0]}`;Number(s)!==Math.floor(Number(a)*Number(l)/Number(i))&&t()}(o),n.library=o=>{if(o.props.type in t){const{schema:n,...r}=t[o.props.type];ju.add(o),o.define({...r,schema:n(e)})}Yu((()=>ce.has(e)&&o.emit(952679114..toString(32))),4e3)},n}catch(r){throw r instanceof Error&&function(e){if("FormKitNoKey"===e.message)throw new Error("A FormKit API key is required, please visit https://formkit.com/pro")}(r),r}}export{Be as $if,cs as autocomplete,Yc as colorpicker,Ve as createBaseSections,zu as createProPlugin,Me as createSectionFactory,Wu as currency,si as datepicker,Ko as dropdown,Uu as inputs,Ji as mask,Lr as rating,Nn as repeater,Rd as slider,Di as taglist,pn as toggle,pu as togglebuttons,id as transferlist,Cu as unit};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formkit/pro",
3
- "version": "0.127.10",
3
+ "version": "0.127.11",
4
4
  "description": "FormKit Pro — Form inputs and tools for high quality forms.",
5
5
  "main": "index.cjs",
6
6
  "module": "index.mjs",