@golemui/gui-react 0.12.2 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/Accordion-BU3skkjb.js +58 -0
  2. package/Alert-DpUiDxQT.js +17 -0
  3. package/Button-BYVR5EKG.js +86 -0
  4. package/CHANGELOG.md +4 -0
  5. package/{Calendar-Dxavv2c7.js → Calendar-BmMkpTcV.js} +13 -11
  6. package/Checkbox-B1Tsf-vi.js +164 -0
  7. package/Currency-D0pOQwU4.js +233 -0
  8. package/{DateInput-CdkyyAhc.js → DateInput-CqFHtc9F.js} +12 -10
  9. package/{DatePicker-TkMCndrw.js → DatePicker-BmW3TO0X.js} +18 -15
  10. package/{Dropdown-jKk4TyOa.js → Dropdown-C-_zDFCe.js} +5 -3
  11. package/Flex-Rs-RvIcq.js +20 -0
  12. package/{Grid-DREMTVQI.js → Grid-BcPUrfRL.js} +3 -2
  13. package/{List-BjMIo577.js → List-YkH8gdMh.js} +5 -3
  14. package/Markdown-DeAW4y3P.js +571 -0
  15. package/MarkdownText-BdISjAsE.js +11 -0
  16. package/Number-GsGZMR5a.js +247 -0
  17. package/Password-B8QjtpUe.js +204 -0
  18. package/RadioGroup-Cd1_Zkkz.js +197 -0
  19. package/{RangeCalendar-u2vxIhna.js → RangeCalendar-9IJoFEXw.js} +10 -8
  20. package/{RangeDateInput-CopLdb6J.js → RangeDateInput-DrVR4T_z.js} +21 -19
  21. package/{RangeDatePicker-DXpV-B_G.js → RangeDatePicker-Cq_Tt6NE.js} +38 -35
  22. package/{Renderer-B6WmwKDv.js → Renderer-CWqudTUu.js} +4 -2
  23. package/Repeater-DE-DAylQ.js +124 -0
  24. package/Select-CCCPYQW6.js +238 -0
  25. package/{Tabs-C2qqi8xO.js → Tabs-BVgVVvnu.js} +4 -3
  26. package/TextArea-BlRaVCon.js +202 -0
  27. package/TextInput-KuHLSN2X.js +169 -0
  28. package/Toggle-D-bglMPv.js +166 -0
  29. package/abstract-calendar-JfbbRwFb.js +528 -0
  30. package/calendar-BgptByan.js +95 -0
  31. package/class-map-DrTVAYz_.js +26 -0
  32. package/date-BS1lA1xg.js +786 -0
  33. package/date-input-Dux0mFJw.js +266 -0
  34. package/directive-1yd1wdny.js +555 -0
  35. package/errors-6UKoJh8Y.js +108 -0
  36. package/index.js +2705 -1171
  37. package/index.umd.cjs +878 -2
  38. package/lib/components/Accordion.d.ts +2 -2
  39. package/lib/components/Alert.d.ts +2 -2
  40. package/lib/components/Button.d.ts +2 -2
  41. package/lib/components/Calendar.d.ts +2 -2
  42. package/lib/components/Checkbox.d.ts +2 -2
  43. package/lib/components/Currency.d.ts +2 -2
  44. package/lib/components/DateInput.d.ts +2 -2
  45. package/lib/components/DatePicker.d.ts +2 -2
  46. package/lib/components/Dropdown.d.ts +2 -2
  47. package/lib/components/Flex.d.ts +2 -2
  48. package/lib/components/Form.d.ts +5 -5
  49. package/lib/components/Grid.d.ts +2 -2
  50. package/lib/components/List.d.ts +2 -2
  51. package/lib/components/Markdown.d.ts +2 -2
  52. package/lib/components/MarkdownText.d.ts +2 -2
  53. package/lib/components/Number.d.ts +2 -2
  54. package/lib/components/Password.d.ts +2 -2
  55. package/lib/components/RadioGroup.d.ts +2 -2
  56. package/lib/components/RangeCalendar.d.ts +2 -2
  57. package/lib/components/RangeDateInput.d.ts +2 -2
  58. package/lib/components/RangeDatePicker.d.ts +2 -2
  59. package/lib/components/Renderer.d.ts +2 -2
  60. package/lib/components/Repeater.d.ts +2 -2
  61. package/lib/components/Select.d.ts +2 -2
  62. package/lib/components/Tabs.d.ts +2 -2
  63. package/lib/components/TextArea.d.ts +2 -2
  64. package/lib/components/TextInput.d.ts +2 -2
  65. package/lib/components/Toggle.d.ts +2 -2
  66. package/lib/widget.loaders.d.ts +2 -2
  67. package/list-DHX7bG4r.js +282 -0
  68. package/live-BfTBpQrp.js +24 -0
  69. package/markdown-text-BUv0K0WF.js +44 -0
  70. package/one-of-DifUsEYY.js +48 -0
  71. package/package.json +6 -6
  72. package/query-h1h36oxg.js +12 -0
  73. package/range-calendar-SAyiW3EF.js +326 -0
  74. package/range-date-input-8WtB1urD.js +507 -0
  75. package/repeat-BucBfSPF.js +79 -0
  76. package/state-DI9ZsB5W.js +7 -0
  77. package/style-map-C_0XzJlx.js +29 -0
  78. package/tabs-DzSCq_98.js +13 -0
  79. package/templates-DBGyvZtc.js +75 -0
  80. package/Accordion-Btp_b0xA.js +0 -59
  81. package/Alert-CBgIsMKO.js +0 -16
  82. package/Button-DN0G-MUb.js +0 -21
  83. package/Checkbox-ViM9MktI.js +0 -30
  84. package/Currency-C4QFWO7Y.js +0 -37
  85. package/DefaultListItemRenderer-lNc9Kk7x.js +0 -18
  86. package/Flex-gD893rrB.js +0 -19
  87. package/Markdown-Ck_88HOR.js +0 -47
  88. package/MarkdownText-kJVkmihW.js +0 -9
  89. package/Number-CnQ95aLO.js +0 -35
  90. package/Password-Bg97DYW3.js +0 -36
  91. package/RadioGroup-Dldom5ja.js +0 -33
  92. package/Repeater-BYgXVfbl.js +0 -111
  93. package/Select-BLUX_W91.js +0 -55
  94. package/TextArea-cw3Q2v97.js +0 -35
  95. package/TextInput-geLoAA0c.js +0 -32
  96. package/Toggle-a7L71GwR.js +0 -30
package/index.umd.cjs CHANGED
@@ -1,3 +1,879 @@
1
- (function(re,pe){typeof exports=="object"&&typeof module<"u"?pe(exports,require("@golemui/gui-components"),require("react/jsx-runtime"),require("@golemui/gui-shared"),require("@golemui/core"),require("@golemui/react"),require("react")):typeof define=="function"&&define.amd?define(["exports","@golemui/gui-components","react/jsx-runtime","@golemui/gui-shared","@golemui/core","@golemui/react","react"],pe):(re=typeof globalThis<"u"?globalThis:re||self,pe(re["gui-react"]={},re.guiComponents,re.jsxRuntime,re.guiShared,re.core,re.React,re.react))})(this,(function(re,pe,l,Ke,ze,E,g){"use strict";function Ut(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Gt=Ut(E),Ye={button:async()=>(await Promise.resolve().then(()=>Ss)).Button,calendar:async()=>(await Promise.resolve().then(()=>Ts)).Calendar,currency:async()=>(await Promise.resolve().then(()=>Ps)).Currency,dateInput:async()=>(await Promise.resolve().then(()=>xs)).DateInput,datePicker:async()=>(await Promise.resolve().then(()=>Ns)).DatePicker,dropdown:async()=>(await Promise.resolve().then(()=>As)).Dropdown,list:async()=>(await Promise.resolve().then(()=>js)).List,password:async()=>(await Promise.resolve().then(()=>qs)).Password,textinput:async()=>(await Promise.resolve().then(()=>Ws)).TextInput,textarea:async()=>(await Promise.resolve().then(()=>Rs)).TextArea,markdown:async()=>(await Promise.resolve().then(()=>Us)).Markdown,checkbox:async()=>(await Promise.resolve().then(()=>Hs)).Checkbox,toggle:async()=>(await Promise.resolve().then(()=>Ys)).Toggle,number:async()=>(await Promise.resolve().then(()=>Qs)).NumberInput,select:async()=>(await Promise.resolve().then(()=>ti)).Select,radiogroup:async()=>(await Promise.resolve().then(()=>ri)).RadioGroup,rangeCalendar:async()=>(await Promise.resolve().then(()=>si)).RangeCalendar,rangeDateInput:async()=>(await Promise.resolve().then(()=>ai)).RangeDateInput,rangeDatePicker:async()=>(await Promise.resolve().then(()=>ui)).RangeDatePicker,repeater:async()=>(await Promise.resolve().then(()=>hi)).Repeater,flex:async()=>(await Promise.resolve().then(()=>pi)).Flex,grid:async()=>(await Promise.resolve().then(()=>bi)).Grid,tabs:async()=>(await Promise.resolve().then(()=>_i)).Tabs,accordion:async()=>(await Promise.resolve().then(()=>wi)).Accordion,alert:async()=>(await Promise.resolve().then(()=>zi)).Alert,markdownText:async()=>(await Promise.resolve().then(()=>Oi)).MarkdownText,renderer:async()=>(await Promise.resolve().then(()=>Si)).Renderer};function p(e,t,n){function o(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:r,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const u=r.prototype,d=Object.keys(u);for(let f=0;f<d.length;f++){const h=d[f];h in a||(a[h]=u[h].bind(a))}}const s=n?.Parent??Object;class i extends s{}Object.defineProperty(i,"name",{value:e});function r(a){var c;const u=n?.Parent?new i:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const d of u._zod.deferred)d();return u}return Object.defineProperty(r,"init",{value:o}),Object.defineProperty(r,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(r,"name",{value:e}),r}class me extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Xe extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Ht={};function de(e){return Ht}function Fe(e,t){return typeof t=="bigint"?t.toString():t}function je(e){return e==null}function De(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Qe=Symbol("evaluating");function L(e,t,n){let o;Object.defineProperty(e,t,{get(){if(o!==Qe)return o===void 0&&(o=Qe,o=n()),o},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Kt(...e){const t={};for(const n of e){const o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function Yt(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const et="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function tt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function qe(e){if(tt(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(tt(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function nt(e){return qe(e)?{...e}:Array.isArray(e)?[...e]:e}function Ve(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rt(e,t,n){const o=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(o._zod.parent=e),o}function P(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}const Xt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function be(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Qt(e,t){return t.map(n=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function Se(e){return typeof e=="string"?e:e?.message}function fe(e,t,n){const o={...e,path:e.path??[]};if(!e.message){const s=Se(e.inst?._zod.def?.error?.(e))??Se(t?.error?.(e))??Se(n.customError?.(e))??Se(n.localeError?.(e))??"Invalid input";o.message=s}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function We(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function $e(...e){const[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:{...t}}const ot=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Fe,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},st=p("$ZodError",ot),Ee=p("$ZodError",ot,{Parent:Error});function en(e,t=n=>n.message){const n={},o=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):o.push(t(s));return{formErrors:o,fieldErrors:n}}function tn(e,t=n=>n.message){const n={_errors:[]},o=s=>{for(const i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(r=>o({issues:r}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let r=n,a=0;for(;a<i.path.length;){const c=i.path[a];a===i.path.length-1?(r[c]=r[c]||{_errors:[]},r[c]._errors.push(t(i))):r[c]=r[c]||{_errors:[]},r=r[c],a++}}};return o(e),n}const Te=e=>(t,n,o,s)=>{const i=o?Object.assign(o,{async:!1}):{async:!1},r=t._zod.run({value:n,issues:[]},i);if(r instanceof Promise)throw new me;if(r.issues.length){const a=new(s?.Err??e)(r.issues.map(c=>fe(c,i,de())));throw et(a,s?.callee),a}return r.value},nn=Te(Ee),Ce=e=>async(t,n,o,s)=>{const i=o?Object.assign(o,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},i);if(r instanceof Promise&&(r=await r),r.issues.length){const a=new(s?.Err??e)(r.issues.map(c=>fe(c,i,de())));throw et(a,s?.callee),a}return r.value},rn=Ce(Ee),Pe=e=>(t,n,o)=>{const s=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new me;return i.issues.length?{success:!1,error:new(e??st)(i.issues.map(r=>fe(r,s,de())))}:{success:!0,data:i.value}},it=Pe(Ee),Ze=e=>async(t,n,o)=>{const s=o?Object.assign(o,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(r=>fe(r,s,de())))}:{success:!0,data:i.value}},at=Ze(Ee),on=e=>(t,n,o)=>{const s=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Te(e)(t,n,s)},sn=e=>(t,n,o)=>Te(e)(t,n,o),an=e=>async(t,n,o)=>{const s=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ce(e)(t,n,s)},cn=e=>async(t,n,o)=>Ce(e)(t,n,o),un=e=>(t,n,o)=>{const s=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Pe(e)(t,n,s)},ln=e=>(t,n,o)=>Pe(e)(t,n,o),dn=e=>async(t,n,o)=>{const s=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ze(e)(t,n,s)},fn=e=>async(t,n,o)=>Ze(e)(t,n,o),hn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ct=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,gn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,pn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,bn=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ut="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",vn=new RegExp(`^${ut}$`);function lt(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function _n(e){return new RegExp(`^${lt(e)}$`)}function yn(e){const t=lt({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${t}(?:${n.join("|")})`;return new RegExp(`^${ut}T(?:${o})$`)}const wn=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},kn=/^-?\d+$/,zn=/^-?\d+(?:\.\d+)?$/,$n=/^(?:true|false)$/i,On=/^[^A-Z]*$/,In=/^[^a-z]*$/,oe=p("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),dt={number:"number",bigint:"bigint",object:"date"},Sn=p("$ZodCheckLessThan",(e,t)=>{oe.init(e,t);const n=dt[typeof t.value];e._zod.onattach.push(o=>{const s=o._zod.bag,i=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),En=p("$ZodCheckGreaterThan",(e,t)=>{oe.init(e,t);const n=dt[typeof t.value];e._zod.onattach.push(o=>{const s=o._zod.bag,i=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Tn=p("$ZodCheckNumberFormat",(e,t)=>{oe.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),o=n?"int":"number",[s,i]=Xt[t.format];e._zod.onattach.push(r=>{const a=r._zod.bag;a.format=t.format,a.minimum=s,a.maximum=i,n&&(a.pattern=kn)}),e._zod.check=r=>{const a=r.value;if(n){if(!Number.isInteger(a)){r.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?r.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):r.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}a<s&&r.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>i&&r.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Cn=p("$ZodCheckMaxLength",(e,t)=>{var n;oe.init(e,t),(n=e._zod.def).when??(n.when=o=>{const s=o.value;return!je(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{const s=o.value;if(s.length<=t.maximum)return;const r=We(s);o.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Pn=p("$ZodCheckMinLength",(e,t)=>{var n;oe.init(e,t),(n=e._zod.def).when??(n.when=o=>{const s=o.value;return!je(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const s=o.value;if(s.length>=t.minimum)return;const r=We(s);o.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Zn=p("$ZodCheckLengthEquals",(e,t)=>{var n;oe.init(e,t),(n=e._zod.def).when??(n.when=o=>{const s=o.value;return!je(s)&&s.length!==void 0}),e._zod.onattach.push(o=>{const s=o._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=o=>{const s=o.value,i=s.length;if(i===t.length)return;const r=We(s),a=i>t.length;o.issues.push({origin:r,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),xe=p("$ZodCheckStringFormat",(e,t)=>{var n,o;oe.init(e,t),e._zod.onattach.push(s=>{const i=s._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),xn=p("$ZodCheckRegex",(e,t)=>{xe.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ln=p("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=On),xe.init(e,t)}),Nn=p("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=In),xe.init(e,t)}),Mn=p("$ZodCheckIncludes",(e,t)=>{oe.init(e,t);const n=Ve(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),An=p("$ZodCheckStartsWith",(e,t)=>{oe.init(e,t);const n=new RegExp(`^${Ve(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Fn=p("$ZodCheckEndsWith",(e,t)=>{oe.init(e,t);const n=new RegExp(`.*${Ve(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}}),jn=p("$ZodCheckOverwrite",(e,t)=>{oe.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}}),Dn={major:4,minor:3,patch:6},U=p("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Dn;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const s of o)for(const i of s._zod.onattach)i(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(r,a,c)=>{let u=be(r),d;for(const f of a){if(f._zod.def.when){if(!f._zod.def.when(r))continue}else if(u)continue;const h=r.issues.length,m=f._zod.check(r);if(m instanceof Promise&&c?.async===!1)throw new me;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,r.issues.length!==h&&(u||(u=be(r,h)))});else{if(r.issues.length===h)continue;u||(u=be(r,h))}}return d?d.then(()=>r):r},i=(r,a,c)=>{if(be(r))return r.aborted=!0,r;const u=s(a,o,c);if(u instanceof Promise){if(c.async===!1)throw new me;return u.then(d=>e._zod.parse(d,c))}return e._zod.parse(u,c)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction==="backward"){const u=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(d=>i(d,r,a)):i(u,r,a)}const c=e._zod.parse(r,a);if(c instanceof Promise){if(a.async===!1)throw new me;return c.then(u=>s(u,o,a))}return s(c,o,a)}}L(e,"~standard",()=>({validate:s=>{try{const i=it(e,s);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return at(e,s).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}))}),Be=p("$ZodString",(e,t)=>{U.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??wn(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),se=p("$ZodStringFormat",(e,t)=>{xe.init(e,t),Be.init(e,t)}),qn=p("$ZodUUID",(e,t)=>{if(t.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ct(o))}else t.pattern??(t.pattern=ct());se.init(e,t)}),Vn=p("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=gn),se.init(e,t)}),Wn=p("$ZodURL",(e,t)=>{se.init(e,t),e._zod.check=n=>{try{const o=n.value.trim(),s=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=s.href:n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Bn=p("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=yn(t)),se.init(e,t)}),Rn=p("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=vn),se.init(e,t)}),Jn=p("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=_n(t)),se.init(e,t)}),Un=p("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=hn),se.init(e,t)}),Gn=p("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=pn),se.init(e,t),e._zod.bag.format="ipv4"}),Hn=p("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=mn),se.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Kn=p("$ZodCustomStringFormat",(e,t)=>{se.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),ft=p("$ZodNumber",(e,t)=>{U.init(e,t),e._zod.pattern=e._zod.bag.pattern??zn,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),n}}),Yn=p("$ZodNumberFormat",(e,t)=>{Tn.init(e,t),ft.init(e,t)}),Xn=p("$ZodBoolean",(e,t)=>{U.init(e,t),e._zod.pattern=$n,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),Qn=p("$ZodAny",(e,t)=>{U.init(e,t),e._zod.parse=n=>n});function ht(e,t,n){e.issues.length&&t.issues.push(...Qt(n,e.issues)),t.value[n]=e.value}const gt=p("$ZodArray",(e,t)=>{U.init(e,t),e._zod.parse=(n,o)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const i=[];for(let r=0;r<s.length;r++){const a=s[r],c=t.element._zod.run({value:a,issues:[]},o);c instanceof Promise?i.push(c.then(u=>ht(u,n,r))):ht(c,n,r)}return i.length?Promise.all(i).then(()=>n):n}});function pt(e,t,n,o){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const s=e.filter(i=>!be(i));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(r=>fe(r,o,de())))}),t)}const er=p("$ZodUnion",(e,t)=>{U.init(e,t),L(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),L(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),L(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),L(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${s.map(i=>De(i.source)).join("|")})$`)}});const n=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(n)return o(s,i);let r=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:s.value,issues:[]},i);if(u instanceof Promise)a.push(u),r=!0;else{if(u.issues.length===0)return u;a.push(u)}}return r?Promise.all(a).then(c=>pt(c,s,e,i)):pt(a,s,e,i)}}),tr=p("$ZodIntersection",(e,t)=>{U.init(e,t),e._zod.parse=(n,o)=>{const s=n.value,i=t.left._zod.run({value:s,issues:[]},o),r=t.right._zod.run({value:s,issues:[]},o);return i instanceof Promise||r instanceof Promise?Promise.all([i,r]).then(([c,u])=>mt(n,c,u)):mt(n,i,r)}});function Re(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(qe(e)&&qe(t)){const n=Object.keys(t),o=Object.keys(e).filter(i=>n.indexOf(i)!==-1),s={...e,...t};for(const i of o){const r=Re(e[i],t[i]);if(!r.valid)return{valid:!1,mergeErrorPath:[i,...r.mergeErrorPath]};s[i]=r.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let o=0;o<e.length;o++){const s=e[o],i=t[o],r=Re(s,i);if(!r.valid)return{valid:!1,mergeErrorPath:[o,...r.mergeErrorPath]};n.push(r.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function mt(e,t,n){const o=new Map;let s;for(const a of t.issues)if(a.code==="unrecognized_keys"){s??(s=a);for(const c of a.keys)o.has(c)||o.set(c,{}),o.get(c).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)o.has(c)||o.set(c,{}),o.get(c).r=!0;else e.issues.push(a);const i=[...o].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&s&&e.issues.push({...s,keys:i}),be(e))return e;const r=Re(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const nr=p("$ZodTransform",(e,t)=>{U.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Xe(e.constructor.name);const s=t.transform(n.value,n);if(o.async)return(s instanceof Promise?s:Promise.resolve(s)).then(r=>(n.value=r,n));if(s instanceof Promise)throw new me;return n.value=s,n}});function bt(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Je=p("$ZodOptional",(e,t)=>{U.init(e,t),e._zod.optin="optional",e._zod.optout="optional",L(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),L(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${De(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(n,o);return s instanceof Promise?s.then(i=>bt(i,n.value)):bt(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,o)}}),rr=p("$ZodExactOptional",(e,t)=>{Je.init(e,t),L(e._zod,"values",()=>t.innerType._zod.values),L(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,o)=>t.innerType._zod.run(n,o)}),or=p("$ZodNullable",(e,t)=>{U.init(e,t),L(e._zod,"optin",()=>t.innerType._zod.optin),L(e._zod,"optout",()=>t.innerType._zod.optout),L(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${De(n.source)}|null)$`):void 0}),L(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>n.value===null?n:t.innerType._zod.run(n,o)}),sr=p("$ZodDefault",(e,t)=>{U.init(e,t),e._zod.optin="optional",L(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,o);return s instanceof Promise?s.then(i=>vt(i,t)):vt(s,t)}});function vt(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ir=p("$ZodPrefault",(e,t)=>{U.init(e,t),e._zod.optin="optional",L(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>(o.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,o))}),ar=p("$ZodNonOptional",(e,t)=>{U.init(e,t),L(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{const s=t.innerType._zod.run(n,o);return s instanceof Promise?s.then(i=>_t(i,e)):_t(s,e)}});function _t(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const cr=p("$ZodCatch",(e,t)=>{U.init(e,t),L(e._zod,"optin",()=>t.innerType._zod.optin),L(e._zod,"optout",()=>t.innerType._zod.optout),L(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);const s=t.innerType._zod.run(n,o);return s instanceof Promise?s.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(r=>fe(r,o,de()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>fe(i,o,de()))},input:n.value}),n.issues=[]),n)}}),ur=p("$ZodPipe",(e,t)=>{U.init(e,t),L(e._zod,"values",()=>t.in._zod.values),L(e._zod,"optin",()=>t.in._zod.optin),L(e._zod,"optout",()=>t.out._zod.optout),L(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction==="backward"){const i=t.out._zod.run(n,o);return i instanceof Promise?i.then(r=>Le(r,t.in,o)):Le(i,t.in,o)}const s=t.in._zod.run(n,o);return s instanceof Promise?s.then(i=>Le(i,t.out,o)):Le(s,t.out,o)}});function Le(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const lr=p("$ZodReadonly",(e,t)=>{U.init(e,t),L(e._zod,"propValues",()=>t.innerType._zod.propValues),L(e._zod,"values",()=>t.innerType._zod.values),L(e._zod,"optin",()=>t.innerType?._zod?.optin),L(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);const s=t.innerType._zod.run(n,o);return s instanceof Promise?s.then(yt):yt(s)}});function yt(e){return e.value=Object.freeze(e.value),e}const wt=p("$ZodCustom",(e,t)=>{oe.init(e,t),U.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=n=>{const o=n.value,s=t.fn(o);if(s instanceof Promise)return s.then(i=>kt(i,n,o,e));kt(s,n,o,e)}});function kt(e,t,n,o){if(!e){const s={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(s.params=o._zod.def.params),t.issues.push($e(s))}}var zt;class dr{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const o=n[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const o={...this.get(n)??{}};delete o.id;const s={...o,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function fr(){return new dr}(zt=globalThis).__zod_globalRegistry??(zt.__zod_globalRegistry=fr());const Oe=globalThis.__zod_globalRegistry;function hr(e,t){return new e({type:"string",...P(t)})}function gr(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...P(t)})}function pr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...P(t)})}function mr(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...P(t)})}function br(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...P(t)})}function vr(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...P(t)})}function _r(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...P(t)})}function yr(e,t){return new e({type:"string",format:"date",check:"string_format",...P(t)})}function wr(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...P(t)})}function kr(e,t){return new e({type:"string",format:"duration",check:"string_format",...P(t)})}function zr(e,t){return new e({type:"number",checks:[],...P(t)})}function $r(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...P(t)})}function Or(e,t){return new e({type:"boolean",...P(t)})}function Ir(e){return new e({type:"any"})}function Sr(e,t){return new Sn({check:"less_than",...P(t),value:e,inclusive:!0})}function Er(e,t){return new En({check:"greater_than",...P(t),value:e,inclusive:!0})}function Ne(e,t){return new Cn({check:"max_length",...P(t),maximum:e})}function ve(e,t){return new Pn({check:"min_length",...P(t),minimum:e})}function $t(e,t){return new Zn({check:"length_equals",...P(t),length:e})}function Ot(e,t){return new xn({check:"string_format",format:"regex",...P(t),pattern:e})}function Tr(e){return new Ln({check:"string_format",format:"lowercase",...P(e)})}function Cr(e){return new Nn({check:"string_format",format:"uppercase",...P(e)})}function Pr(e,t){return new Mn({check:"string_format",format:"includes",...P(t),includes:e})}function Zr(e,t){return new An({check:"string_format",format:"starts_with",...P(t),prefix:e})}function xr(e,t){return new Fn({check:"string_format",format:"ends_with",...P(t),suffix:e})}function _e(e){return new jn({check:"overwrite",tx:e})}function Lr(e){return _e(t=>t.normalize(e))}function Nr(){return _e(e=>e.trim())}function Mr(){return _e(e=>e.toLowerCase())}function Ar(){return _e(e=>e.toUpperCase())}function Fr(){return _e(e=>Yt(e))}function jr(e,t,n){return new e({type:"array",element:t,...P(n)})}function It(e,t,n){return new e({type:"custom",check:"custom",fn:t,...P(n)})}function St(e){const t=Dr(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push($e(o,n.value,t._zod.def));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),n.issues.push($e(s))}},e(n.value,n)));return t}function Dr(e,t){const n=new oe({check:"custom",...P(t)});return n._zod.check=e,n}function qr(e,t,n,o={}){const s=P(o),i={...P(o),check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:a=>n.test(a),...s};return n instanceof RegExp&&(i.pattern=n),new e(i)}function Et(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Oe,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Q(e,t,n={path:[],schemaPath:[]}){var o;const s=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const r={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,r);const a=e._zod.toJSONSchema?.();if(a)r.schema=a;else{const d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,r.schema,d);else{const h=r.schema,m=t.processors[s.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);m(e,t,h,d)}const f=e._zod.parent;f&&(r.ref||(r.ref=f),Q(f,t,d),t.seen.get(f).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(r.schema,c),t.io==="input"&&ee(e)&&(delete r.schema.examples,delete r.schema.default),t.io==="input"&&r.schema._prefault&&((o=r.schema).default??(o.default=r.schema._prefault)),delete r.schema._prefault,t.seen.get(e).schema}function Tt(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=new Map;for(const r of e.seen.entries()){const a=e.metadataRegistry.get(r[0])?.id;if(a){const c=o.get(a);if(c&&c!==r[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,r[0])}}const s=r=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const f=e.external.registry.get(r[0])?.id,h=e.external.uri??(_=>_);if(f)return{ref:h(f)};const m=r[1].defId??r[1].schema.id??`schema${e.counter++}`;return r[1].defId=m,{defId:m,ref:`${h("__shared")}#/${a}/${m}`}}if(r[1]===n)return{ref:"#"};const u=`#/${a}/`,d=r[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},i=r=>{if(r[1].schema.$ref)return;const a=r[1],{ref:c,defId:u}=s(r);a.def={...a.schema},u&&(a.defId=u);const d=a.schema;for(const f in d)delete d[f];d.$ref=c};if(e.cycles==="throw")for(const r of e.seen.entries()){const a=r[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
1
+ (function(Ue,xt){typeof exports=="object"&&typeof module<"u"?xt(exports,require("@golemui/gui-shared"),require("react/jsx-runtime"),require("@golemui/core"),require("@golemui/react"),require("react")):typeof define=="function"&&define.amd?define(["exports","@golemui/gui-shared","react/jsx-runtime","@golemui/core","@golemui/react","react"],xt):(Ue=typeof globalThis<"u"?globalThis:Ue||self,xt(Ue["gui-react"]={},Ue.guiShared,Ue.jsxRuntime,Ue.core,Ue.react$1,Ue.react))})(this,(function(Ue,xt,y,vt,x,g){"use strict";const Zi={button:async()=>(await Promise.resolve().then(()=>Cd)).Button,calendar:async()=>(await Promise.resolve().then(()=>qd)).Calendar,currency:async()=>(await Promise.resolve().then(()=>Wd)).Currency,dateInput:async()=>(await Promise.resolve().then(()=>Jd)).DateInput,datePicker:async()=>(await Promise.resolve().then(()=>Qd)).DatePicker,dropdown:async()=>(await Promise.resolve().then(()=>hu)).Dropdown,list:async()=>(await Promise.resolve().then(()=>mu)).List,password:async()=>(await Promise.resolve().then(()=>bu)).Password,textinput:async()=>(await Promise.resolve().then(()=>_u)).TextInput,textarea:async()=>(await Promise.resolve().then(()=>Ou)).TextArea,markdown:async()=>(await Promise.resolve().then(()=>Mu)).Markdown,checkbox:async()=>(await Promise.resolve().then(()=>Fu)).Checkbox,toggle:async()=>(await Promise.resolve().then(()=>Zu)).Toggle,number:async()=>(await Promise.resolve().then(()=>Hu)).NumberInput,select:async()=>(await Promise.resolve().then(()=>Qu)).Select,radiogroup:async()=>(await Promise.resolve().then(()=>nc)).RadioGroup,rangeCalendar:async()=>(await Promise.resolve().then(()=>oc)).RangeCalendar,rangeDateInput:async()=>(await Promise.resolve().then(()=>cc)).RangeDateInput,rangeDatePicker:async()=>(await Promise.resolve().then(()=>pc)).RangeDatePicker,repeater:async()=>(await Promise.resolve().then(()=>gc)).Repeater,flex:async()=>(await Promise.resolve().then(()=>Dc)).Flex,grid:async()=>(await Promise.resolve().then(()=>wc)).Grid,tabs:async()=>(await Promise.resolve().then(()=>kc)).Tabs,accordion:async()=>(await Promise.resolve().then(()=>Sc)).Accordion,alert:async()=>(await Promise.resolve().then(()=>Oc)).Alert,markdownText:async()=>(await Promise.resolve().then(()=>Ic)).MarkdownText,renderer:async()=>(await Promise.resolve().then(()=>Tc)).Renderer},Gt={ACTIONS:"ACTIONS",LAYOUTS:"LAYOUTS",DISPLAYS:"DISPLAYS"};function $s(e){return function(t,i=()=>!0){return{kind:"leaf",selectorType:e,matcher:i,config:t}}}const Yt=new Map;function qi(e,t){if(Yt.has(e))throw new Error(`Item type "${e}" is already registered.`);Yt.set(e,t)}function Mt(e){const t=Yt.get(e);if(!t)throw new Error(`No handler registered for item type "${e}". Did you forget to import the registration module?`);return t}function Vi(e){return Yt.has(e)}function Z(e){const t=o=>{if(!e.sensibleDefaults)return{};let l={...e.sensibleDefaults.base};for(const d of o){const c=d.config;for(const h of e.sensibleDefaults.fields){const p=h;c[p]!=null&&(l={...l,[p]:c[p]})}}return l},i=(o,l)=>e.sensibleDefaults?e.sensibleDefaults.apply(o,l):o,n=o=>{switch(e.entryShape){case"bare":return{baseDef:o};case"keyed":{const l=o;return{baseDef:l.def,path:l.key}}case"compound":{const l=o;return{baseDef:l.def,children:l.children}}}},s={rollUpSensibleDefaults:t,applySensibleDefaults:i,mapToWidget:e.mapToWidget,parseEntry:n,...e.afterMerge?{afterMerge:e.afterMerge}:{},...e.buildCustomWidget?{buildCustomWidget:e.buildCustomWidget}:{},...e.getChildren?{getChildren:e.getChildren}:{}};qi(e.itemType,s);const r=$s(e.itemType);return{gsl:r,gslByUid:(o,l)=>r(l,(d=>d.uid===o))}}function Ss(e){return e?e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()):""}function we(e,t){return e.label!=null||t.suppressAutomaticLabels||!e.path?e:{...e,label:Ss(e.path)}}function st(e,t){return e.placeholder!=null||t.suppressAutomaticPlaceholders||!e.path?e:{...e,placeholder:e.path}}const As=(e,t)=>({type:"ITEMS",itemType:Gt.DISPLAYS,items:[{render:e}],tags:[]});class Os{deepMerge(t,i){if(i==null)return t;if(t==null||typeof t!="object"||typeof i!="object"||Array.isArray(t)||Array.isArray(i))return i;const n={...t};for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&(typeof i[s]=="object"&&!Array.isArray(i[s])&&i[s]!==null&&typeof t[s]=="object"&&!Array.isArray(t[s])&&t[s]!==null?n[s]=this.deepMerge(t[s],i[s]):n[s]=i[s]);return n}}const Es=new Os;function Is(e,t){return{items:[e],type:"ITEMS",itemType:Gt.ACTIONS,tags:t??[]}}const Cs=e=>Is({uid:"#submit",label:"Submit"}),Ui={INPUTS:new Set(["INPUTS","TEXTAREA","PASSWORD","SELECT","DROPDOWN","RADIOGROUP","CHECKBOX","CALENDAR","DATE_INPUT","DATE_PICKER","RANGE_CALENDAR","RANGE_DATE_INPUT","RANGE_DATE_PICKER","CURRENCY","MARKDOWN","LIST","CUSTOM_INPUT","REPEATER"]),ACTIONS:new Set(["ACTIONS","CUSTOM_ACTION"]),DISPLAYS:new Set(["DISPLAYS","ALERTS","CUSTOM_DISPLAY"]),LAYOUTS:new Set(["LAYOUTS","TABS","ACCORDION","CUSTOM_LAYOUT"])};function Ts(e,t){const i=Ui[e];return i?i.has(t):e===t}class Ps{resolve(t,i){const n=[];for(const r of i)r.kind==="aggregated"?this.collectFromAggregated(r,t,n):this.collectFromLeaf(r,t,n);const s=this.rollUpSensibleDefaults(n);return{leafSelectors:n,sensibleDefaults:s}}collectFromAggregated(t,i,n){if(t.matcher(i))for(const s of t.children)this.collectFromLeaf(s,i,n)}collectFromLeaf(t,i,n){Ts(t.selectorType,i.itemType??"")&&t.matcher(i)&&n.push(t)}rollUpSensibleDefaults(t){const i=new Map,n=(r,a)=>{const o=i.get(r)??[];o.push(a),i.set(r,o)};for(const r of t){const a=Ui[r.selectorType];if(a)for(const o of a)n(o,r);else n(r.selectorType,r)}const s={};for(const[r,a]of i)Vi(r)&&(s[r]=Mt(r).rollUpSensibleDefaults(a));return s}}const xs=new Ps;class Ms{constructor(t){this.objectUtils=t}merge(t,i,n){let s={},r=null;typeof t=="function"&&(r=t);const a=this.collectDecorators(n);for(const d of a){if(r!=null){r=this.composeRuntimeFunctions(r,d);continue}if(typeof d=="function"){const c=d({...s,...typeof t=="function"?{}:t});if(typeof c=="function"){r=this.createPromotedFunction(s,t,c,i,n);continue}s=this.objectUtils.deepMerge(s,c)}else s=this.objectUtils.deepMerge(s,d)}if(r!=null)return{kind:"dynamic",fn:this.wrapWithSensibleDefaults(r,s,i,n)};const o=this.objectUtils.deepMerge(t,s);return{kind:"static",def:this.applySensibleDefaults({...o},i,n)}}collectDecorators(t){const i=[];for(const n of t.leafSelectors){const s=n.config;s.override!=null&&i.push(s.override)}return i}applySensibleDefaults(t,i,n){if(!Vi(i))return t;const s=n.sensibleDefaults[i]??{};return Mt(i).applySensibleDefaults(t,s)}createPromotedFunction(t,i,n,s,r){return a=>{const o=n(a);let l=this.objectUtils.deepMerge(t,o);return l=this.objectUtils.deepMerge(l,i),this.applySensibleDefaults(l,s,r)}}wrapWithSensibleDefaults(t,i,n,s){return r=>{let a=t(r);return Object.keys(i).length>0&&(a=this.objectUtils.deepMerge(i,a)),this.applySensibleDefaults(a,n,s)}}composeRuntimeFunctions(t,i){return typeof i=="function"?n=>{const s=t(n),r=i(s);return typeof r=="function"?r(n):this.objectUtils.deepMerge(r,s)}:n=>{const s=t(n);return this.objectUtils.deepMerge(s,i)}}}const Ls=new Ms(Es);class Ns{mapToWidget(t,i){if(t.kind==="dynamic"){const n=t.fn;return(s=>{const r=n(s);return this.mapStaticDef(r,i)})}return this.mapStaticDef(t.def,i)}mapStaticDef(t,i){const n=Mt(i).mapToWidget(t);return this.applyBaseWidgetFields(n,t)}applyBaseWidgetFields(t,i){return i.size!=null&&(t.size=i.size),i.defaultValue!=null&&t.kind==="input"&&(t.defaultValue=i.defaultValue),i.on!=null&&(t.on=i.on),i.include!=null&&(t.include=i.include),i.exclude!=null&&(t.exclude=i.exclude),t}}const zs=new Ns;class Fs{normalizeSelectors(t){const i=Array.isArray(t)?t:[t],n=[],s=[];for(const r of i)r.kind==="leaf"?s.push(r):n.push(r);return s.length>0&&n.unshift({kind:"aggregated",matcher:()=>!0,children:s}),n}extractFormConfig(){return{suppressAutomaticStack:!1,suppressAutomaticSubmit:!1,onSubmit:t=>console.log("Form submitted:",t)}}}const Rs=new Fs,Hi={onLoad:"load",onChange:"change",onFilter:"filter",onBlur:"blur"},Bs=Object.keys(Hi);class js{extractOnClickFromMergeResult(t,i,n,s){if(t.kind==="dynamic"){const o=t.fn;return{kind:"dynamic",fn:d=>{const c=o(d);return this.wireOnClick(c,i,n,s)}}}const r=t.def;return{kind:"static",def:this.wireOnClick(r,i,n,s)}}countSubmitButtons(t){let i=0;for(const n of t){if(n.type!=="ITEMS")continue;const s=Mt(n.itemType);for(const r of n.items){const a=s.getChildren?.(r);if(a&&(i+=this.countSubmitButtons(a)),n.itemType===Gt.ACTIONS){if(typeof r=="function")continue;const o=r;(o.uid==="#submit"||o.onClick==="submit")&&i++}}}return i}wireOnClick(t,i,n,s){const r=t.uid==="#submit"||t.onClick==="submit",a=r?"#submit":s.next(),o=r?"submit":a,l=t.onClick,c=(typeof l=="function"?l:void 0)??(r?n.onSubmit:void 0);if(c){i.set(o,m=>c(m.data));const{onClick:h,...p}=t;return{...p,uid:a,on:{click:o}}}if(r){const{onClick:h,...p}=t;return{...p,uid:a,on:{click:"submit"}}}if(typeof l=="string"){const{onClick:h,...p}=t;return{...p,uid:a,on:{click:l}}}return{...t,uid:a}}wireInputLayoutEvents(t,i,n){if(t.kind==="dynamic"){const r=t.fn;return{kind:"dynamic",fn:o=>{const l=r(o);return this.wireEventProperties(l,i,n)}}}return{kind:"static",def:this.wireEventProperties(t.def,i,n)}}wireEventProperties(t,i,n){const s={...t.on||{}};let r=!1;const a={...t};for(const o of Bs){const l=t[o];if(l==null)continue;const d=Hi[o];if(typeof l=="function"){const c=n.next();i.set(c,l),s[d]=c,r=!0}else typeof l=="string"&&(s[d]=l,r=!0);delete a[o]}return r&&(a.on=s),a}}const Kt=new js,Zs={input:new Set(["disabled","readonly","label","validator","size"]),action:new Set(["disabled","label","size"]),layout:new Set(["size"]),display:new Set([])},Wi={onChange:"change",onLoad:"load",onFilter:"filter",onClick:"click"};class qs{extractFromMergeResult(t,i){const n={};for(const o of i){const l=o.targetState,d=o.config,c=d.override&&typeof d.override!="function"?d.override:d;n[l]={...n[l]||{},...c}}if(t.kind==="dynamic"){const o=t.fn;return{cleanedResult:{kind:"dynamic",fn:d=>{const c=o(d),{states:h,...p}=c;return p}},stateData:{stateOverrides:n}}}const{states:s,...r}=t.def,a={};for(const[o,l]of Object.entries(n))a[o]={...l};if(s)for(const[o,l]of Object.entries(s))a[o]={...a[o]||{},...l};return{cleanedResult:{kind:"static",def:r},stateData:{stateOverrides:a}}}applyToWidget(t,i,n,s){const{stateOverrides:r}=i;if(Object.keys(r).length===0)return t;const a={...t},o=t.kind,l=Zs[o]||new Set;t.props&&(a.props={...t.props}),t.on&&(a.on={...t.on});for(const[d,c]of Object.entries(r))for(const[h,p]of Object.entries(c))h==="visible"?this.applyVisibility(a,d,p):Wi[h]?this.applyStateEvent(a,d,h,p,n,s):l.has(h)?a[`${h}.${d}`]=p:(a.props||(a.props={}),a.props[`${h}.${d}`]=p);return a}hasStateData(t){return Object.keys(t.stateOverrides).length>0}applyVisibility(t,i,n){if(n){const s=t.include?.in||[];t.include={...t.include||{},in:[...s,i]}}else{const s=t.exclude?.from||[];t.exclude={...t.exclude||{},from:[...s,i]}}}applyStateEvent(t,i,n,s,r,a){const o=Wi[n];if(t.on||(t.on={}),typeof s=="function"){const l=a.next();r.set(l,s),t.on[`${o}.${i}`]=l}else typeof s=="string"&&(t.on[`${o}.${i}`]=s)}}const Vs=new qs;function Us(){let e=0;return{next:()=>`event_${e++}`}}class Hs{constructor(t,i,n,s,r){this.resolver=t,this.merger=i,this.mapper=n,this.eventWiring=s,this.stateExpansion=r}walkAndMap(t,i,n){const s=new Map,r=Us(),a={value:0},o=new Set;return{widgets:this.walkItems(t,i,s,n,r,a,o),eventRegistry:s}}walkItems(t,i,n,s,r,a,o){return t.flatMap(l=>{if(l.type!=="ITEMS")throw new Error("Unexpected gui shortcut type");return l.items.map(d=>this.processItem(d,l.itemType,l.tags,i,n,s,r,a,o))})}processItem(t,i,n,s,r,a,o,l,d){const c=i,h=Mt(i),p=h.parseEntry(t),m=this.buildBaseDef(p),f=this.buildDecoratorForMatching(m,c,n),w=this.resolver.resolve(f,s),S=w.leafSelectors.filter(k=>k.targetState!=null),T={leafSelectors:w.leafSelectors.filter(k=>k.targetState==null),sensibleDefaults:w.sensibleDefaults};let C=this.merger.merge(m,c,T);h.afterMerge&&(C=h.afterMerge(C,{eventRegistry:r,formConfig:a,eventIdGenerator:o})),C=this.eventWiring.wireInputLayoutEvents(C,r,o);const{cleanedResult:I,stateData:A}=this.stateExpansion.extractFromMergeResult(C,S);let D;if(h.buildCustomWidget){const k=this.buildCustomWidgetContext(p.children,s,r,a,o,l,d);D=this.buildCustomWidget(h,I,k)}else D=this.mapper.mapToWidget(I,c);if(typeof D!="function"){const k=D;k.uid||(k.path&&!d.has(k.path)?(k.uid=k.path,d.add(k.path)):k.uid=`dx_${l.value++}`)}if(this.stateExpansion.hasStateData(A))if(typeof D=="function"){const k=D;D=(P=>{const O=k(P);return this.stateExpansion.applyToWidget(O,A,r,o)})}else D=this.stateExpansion.applyToWidget(D,A,r,o);return D}buildCustomWidgetContext(t,i,n,s,r,a,o){return{children:t,mapStaticDef:(l,d)=>this.mapper.mapStaticDef(l,d),walkChildren:l=>this.walkItems(l,i,n,s,r,a,o)}}buildCustomWidget(t,i,n){return t.buildCustomWidget(i,n)}buildBaseDef(t){const i=t.baseDef;return typeof i=="function"?n=>{const r=i(n??{});return t.path!=null?{...r,path:t.path}:r}:t.path!=null?{...i,path:t.path}:i}buildDecoratorForMatching(t,i,n){if(typeof t=="function")return{itemType:i,tags:[...n]};const s=[...n,..."tags"in t&&t.tags?t.tags:[]],r="uid"in t?t.uid:void 0,a="type"in t?t.type:void 0;return{itemType:i,tags:s,uid:r,type:a}}}function ye(e){const{uid:t,path:i,label:n,disabled:s,readonly:r,defaultValue:a,tags:o,type:l,size:d,onLoad:c,onChange:h,onFilter:p,on:m,states:f,include:w,exclude:S,validator:T,...C}=e;return C}function Pe(e,t){return typeof e=="function"?e:{type:t,...e??{}}}function Ws(e){switch(e.type){case"text":return Ys(e);case"number":return Ks(e);case"boolean":return Gs(e);default:throw new Error(`Unsupported field type "${e.type}"`)}}function Gs(e){const t=ye(e);return{uid:e.uid??"",kind:"input",type:"toggle",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:Pe(e.validator,"boolean")}:{},props:t}}function Ys(e){const t=ye(e);return{uid:e.uid??"",kind:"input",type:"textinput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},props:{placeholder:t.placeholder??"",...t},validator:Pe(e.validator,"string")}}function Ks(e){const t=ye(e);return{uid:e.uid??"",kind:"input",type:"number",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},props:{placeholder:t.placeholder??"",...t},validator:Pe(e.validator,"number")}}Z({itemType:"INPUTS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>{let i=we(e,t);return i=st(i,t),i}},mapToWidget:Ws});function Js(e){const{uid:t,label:i,disabled:n,on:s,onClick:r,data:a,type:o,tags:l,size:d,include:c,exclude:h,states:p,...m}=e;return{uid:t??"",kind:"action",type:"button",disabled:n,label:i,...s!=null?{on:s}:{},props:m}}Z({itemType:"ACTIONS",entryShape:"bare",mapToWidget:Js,afterMerge:(e,t)=>Kt.extractOnClickFromMergeResult(e,t.eventRegistry,t.formConfig,t.eventIdGenerator)});function Xs(e){const{uid:t,widgetName:i,tags:n,size:s,onChange:r,include:a,exclude:o,...l}=e,{on:d,...c}=l;return{uid:t??"",kind:"layout",type:i??"flex",props:{direction:c.direction??"column",...c},children:[]}}function Qs(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"LAYOUTS"),children:i};const n=e.fn;return(s=>{const r=n(s);return{...t.mapStaticDef(r,"LAYOUTS"),children:i}})}function ea(e){return e.children}Z({itemType:"LAYOUTS",entryShape:"compound",mapToWidget:Xs,buildCustomWidget:Qs,getChildren:ea});function ta(e){return{uid:"",kind:"display",type:"renderer",props:{render:e.render}}}function ia(e,t){if(e.kind==="static"){const n=e.def;return(s=>({uid:"",kind:"display",type:"renderer",...n.include!=null?{include:n.include}:{},...n.exclude!=null?{exclude:n.exclude}:{},props:{render:n.render(s??{})}}))}const i=e.fn;return(n=>{const s=i(n);return{uid:"",kind:"display",type:"renderer",...s.include!=null?{include:s.include}:{},...s.exclude!=null?{exclude:s.exclude}:{},props:{render:s.render(n??{})}}})}Z({itemType:"DISPLAYS",entryShape:"bare",mapToWidget:ta,buildCustomWidget:ia}),Z({itemType:"CALENDAR",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>we(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"calendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:Pe(e.validator,"string")}:{},props:ye(e)})}),Z({itemType:"TEXTAREA",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>st(we(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"textarea",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:Pe(e.validator,"string")}:{},props:ye(e)})}),Z({itemType:"PASSWORD",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>st(we(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"password",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:Pe(e.validator,"string")}:{},props:ye(e)})}),Z({itemType:"CHECKBOX",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>we(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"checkbox",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:Pe(e.validator,"boolean")}:{},props:ye(e)})}),Z({itemType:"DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>we(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:Pe(e.validator,"string")}:{},props:ye(e)})}),Z({itemType:"CURRENCY",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>st(we(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"currency",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:Pe(e.validator,"number")}:{},props:ye(e)})}),Z({itemType:"RANGE_CALENDAR",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>we(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeCalendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:Pe(e.validator,"array")}:{},props:ye(e)})}),Z({itemType:"SELECT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>st(we(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"select",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:ye(e)})}),Z({itemType:"RADIOGROUP",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>we(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"radiogroup",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:ye(e)})});function na(e){return{uid:e.uid??"",kind:"layout",type:"tabs",props:{tabs:e.tabs,renderMode:e.renderMode??"all",...e.defaultOpen!=null?{defaultOpen:e.defaultOpen}:{}},children:[]}}function sa(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"TABS"),children:i};const n=e.fn;return(s=>{const r=n(s);return{...t.mapStaticDef(r,"TABS"),children:i}})}function aa(e){return e.children}Z({itemType:"TABS",entryShape:"compound",mapToWidget:na,buildCustomWidget:sa,getChildren:aa}),Z({itemType:"LIST",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>we(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"list",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:ye(e)})}),Z({itemType:"ALERTS",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"alert",props:{text:e.text,...e.level!=null?{level:e.level}:{}}})}),Z({itemType:"DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>st(we(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"datePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:Pe(e.validator,"string")}:{},props:ye(e)})}),Z({itemType:"DROPDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>st(we(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dropdown",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:ye(e)})});function ra(e){return{uid:e.uid??"",kind:"layout",type:"accordion",props:{sections:e.sections,renderMode:e.renderMode??"all",...e.singleOpen!=null?{singleOpen:e.singleOpen}:{},...e.defaultOpen!=null?{defaultOpen:e.defaultOpen}:{}},children:[]}}function oa(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"ACCORDION"),children:i};const n=e.fn;return(s=>{const r=n(s);return{...t.mapStaticDef(r,"ACCORDION"),children:i}})}function la(e){return e.children}Z({itemType:"ACCORDION",entryShape:"compound",mapToWidget:ra,buildCustomWidget:oa,getChildren:la});function da(e){const t={};return e.addLabel!=null&&(t.addLabel=e.addLabel),e.removeLabel!=null&&(t.removeLabel=e.removeLabel),e.limit!=null&&(t.limit=e.limit),e.title!=null&&(t.title=e.title),e.addButtonIcon!=null&&(t.addButtonIcon=e.addButtonIcon),e.removeButtonIcon!=null&&(t.removeButtonIcon=e.removeButtonIcon),t}function ua(e){return{uid:e.uid??"",kind:"input",type:"repeater",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:Pe(e.validator,"array")}:{},props:{...da(e),template:{kind:"layout",type:"flex",children:[],props:{direction:"column"}}}}}function fi(e,t){for(const i of e){if(typeof i=="function")continue;const n=i;typeof n.path=="string"&&n.path&&(n.path=t+n.path),"children"in n&&Array.isArray(n.children)&&fi(n.children,t);const s=n.props;s?.template?.children&&Array.isArray(s.template.children)&&fi(s.template.children,t)}}function ca(e,t){const i=t.walkChildren(t.children??[]),n=e.kind==="static"?e.def.path??"":e.fn({})?.path??"";n&&fi(i,n+".items.");const s={kind:"layout",type:"flex",uid:"",children:i,props:{direction:"column"}};if(e.kind==="static"){const a=t.mapStaticDef(e.def,"REPEATER");return{...a,props:{...a.props,template:s}}}const r=e.fn;return(a=>{const o=r(a),l=t.mapStaticDef(o,"REPEATER");return{...l,props:{...l.props,template:s}}})}function ha(e){return{baseDef:e.def,path:e.key,children:e.children}}function pa(e){return e.children}qi("REPEATER",{parseEntry:ha,rollUpSensibleDefaults:()=>({}),applySensibleDefaults:e=>e,mapToWidget:ua,buildCustomWidget:ca,getChildren:pa}),Z({itemType:"MARKDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>st(we(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"markdown",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:Pe(e.validator,"string")}:{},props:ye(e)})}),Z({itemType:"RANGE_DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>we(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:Pe(e.validator,"array")}:{},props:ye(e)})}),Z({itemType:"RANGE_DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>st(we(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDatePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:Pe(e.validator,"array")}:{},props:ye(e)})}),Z({itemType:"CUSTOM_DISPLAY",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:e.customType,props:e.props??{}})}),Z({itemType:"CUSTOM_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>we(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:e.customType,path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.defaultValue!=null?{defaultValue:e.defaultValue}:{},...e.validator!=null?{validator:e.validator}:{},props:e.props??{}})}),Z({itemType:"CUSTOM_ACTION",entryShape:"bare",mapToWidget:e=>{const{uid:t,label:i,disabled:n,on:s,onClick:r,data:a,customType:o,tags:l,size:d,include:c,exclude:h,states:p,props:m,...f}=e;return{uid:t??"",kind:"action",type:e.customType,label:i,disabled:n,...s!=null?{on:s}:{},props:{...m,...f}}},afterMerge:(e,t)=>Kt.extractOnClickFromMergeResult(e,t.eventRegistry,t.formConfig,t.eventIdGenerator)});function ma(e){return{uid:e.uid??"",kind:"layout",type:e.customType,props:e.props??{},children:[]}}function ya(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"CUSTOM_LAYOUT"),children:i};const n=e.fn;return(s=>{const r=n(s);return{...t.mapStaticDef(r,"CUSTOM_LAYOUT"),children:i}})}function fa(e){return e.children}Z({itemType:"CUSTOM_LAYOUT",entryShape:"compound",mapToWidget:ma,buildCustomWidget:ya,getChildren:fa});class ga{constructor(t,i,n){this.selectorNormalizer=t,this.eventWiring=i,this.walker=n}processDxFacade(t,i=[],n){const{defs:s,gslSelectors:r,formConfig:a}=this.prepareForm(t,i,n),{widgets:o,eventRegistry:l}=this.walker.walkAndMap(s,r,a),d=o[0];return this.buildResult({form:d},l,a)}prepareForm(t,i,n){const r=(Array.isArray(t)?[...t]:[t]).map(d=>typeof d=="function"?As(d):d),a=this.selectorNormalizer.normalizeSelectors(i),o={...this.selectorNormalizer.extractFormConfig(),...n},l=this.eventWiring.countSubmitButtons(r);if(l>1)throw new Error(`Only one submit button is allowed per form, but ${l} were found. A button is a submit button if it has uid: '#submit' or onClick: 'submit'.`);if(!o.suppressAutomaticSubmit&&l===0&&r.push(Cs()),!o.suppressAutomaticStack){const d={def:{uid:"#root",direction:"column",widgetName:"flex"},children:r};return{defs:[{type:"ITEMS",itemType:Gt.LAYOUTS,items:[d],tags:[]}],gslSelectors:a,formConfig:o}}return{defs:r,gslSelectors:a,formConfig:o}}convertStateNames(t){const i={};for(const[n,s]of Object.entries(t))i[n.replace(/\$/g,":")]=s;return i}buildResult(t,i,n){n.states&&Object.keys(n.states).length>0&&(t={...t,states:this.convertStateNames(n.states)});const s={form:t};return i.size>0&&(s.events=r=>{const a=i.get(r.name);if(a){const o=d=>{if(d&&typeof d=="object"&&"path"in d&&!("type"in d)){const{path:c,...h}=d;for(const[p,m]of Object.entries(h))r.callback({type:"OVERRIDE_WIDGET_PROP",payload:{path:c,prop:p,value:m}})}else r.callback(d)},l={...r,callback:o,update:o};a(l)}}),n.dependencies&&(s.dependencies=n.dependencies),n.widgetLoaders&&(s.widgetLoaders=n.widgetLoaders),n.validateOn&&(s.validateOn=n.validateOn),n.itemRenderers&&(s.itemRenderers=n.itemRenderers),s}}const ba=new Hs(xs,Ls,zs,Kt,Vs),Da=new ga(Rs,Kt,ba);function va(e){return typeof e=="function"?!0:Array.isArray(e)?e.length===0||e.every(Gi):Gi(e)}function Gi(e){if(typeof e=="function")return!0;if(e===null||typeof e!="object")return!1;const t=e;return t.type==="ITEMS"&&typeof t.itemType=="string"}const Yi=Object.freeze({}),wa=Object.freeze({}),Ki=new WeakMap;function gi(e,t){return e==null?t:typeof e=="object"?e:{}}function _a(e,t,i){if(!va(e))return{formDef:e};const n=gi(e,Yi),s=gi(t,Yi),r=gi(i,wa);let a=Ki.get(n);a||(a=new WeakMap,Ki.set(n,a));let o=a.get(s);o||(o=new WeakMap,a.set(s,o));const l=o.get(r);if(l)return l;const d=Da.processDxFacade(e,t,i),c={formDef:d.form,formEvent:d.events,dependencies:d.dependencies,widgetLoaders:d.widgetLoaders,validateOn:d.validateOn,itemRenderers:d.itemRenderers};return o.set(r,c),c}function ka(e,t){if(e!=null&&typeof e=="object"&&"__rid"in e)return e.__rid;const i=t();return Object.defineProperty(e,"__rid",{value:i,enumerable:!1,configurable:!1}),i}function b(e,t,i){function n(o,l){if(o._zod||Object.defineProperty(o,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),o._zod.traits.has(e))return;o._zod.traits.add(e),t(o,l);const d=a.prototype,c=Object.keys(d);for(let h=0;h<c.length;h++){const p=c[h];p in o||(o[p]=d[p].bind(o))}}const s=i?.Parent??Object;class r extends s{}Object.defineProperty(r,"name",{value:e});function a(o){var l;const d=i?.Parent?new r:this;n(d,o),(l=d._zod).deferred??(l.deferred=[]);for(const c of d._zod.deferred)c();return d}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:o=>i?.Parent&&o instanceof i.Parent?!0:o?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class wt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ji extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const $a={};function ut(e){return $a}function bi(e,t){return typeof t=="bigint"?t.toString():t}function Di(e){return e==null}function vi(e){const t=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(t,i)}const Xi=Symbol("evaluating");function R(e,t,i){let n;Object.defineProperty(e,t,{get(){if(n!==Xi)return n===void 0&&(n=Xi,n=i()),n},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Sa(...e){const t={};for(const i of e){const n=Object.getOwnPropertyDescriptors(i);Object.assign(t,n)}return Object.defineProperties({},t)}function Aa(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Qi="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function en(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function wi(e){if(en(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const i=t.prototype;return!(en(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function tn(e){return wi(e)?{...e}:Array.isArray(e)?[...e]:e}function _i(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function nn(e,t,i){const n=new e._zod.constr(t??e._zod.def);return(!t||i?.parent)&&(n._zod.parent=e),n}function L(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}const Oa={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function _t(e,t=0){if(e.aborted===!0)return!0;for(let i=t;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function Ea(e,t){return t.map(i=>{var n;return(n=i).path??(n.path=[]),i.path.unshift(e),i})}function Jt(e){return typeof e=="string"?e:e?.message}function ct(e,t,i){const n={...e,path:e.path??[]};if(!e.message){const s=Jt(e.inst?._zod.def?.error?.(e))??Jt(t?.error?.(e))??Jt(i.customError?.(e))??Jt(i.localeError?.(e))??"Invalid input";n.message=s}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function ki(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Lt(...e){const[t,i,n]=e;return typeof t=="string"?{message:t,code:"custom",input:i,inst:n}:{...t}}const sn=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,bi,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},an=b("$ZodError",sn),Xt=b("$ZodError",sn,{Parent:Error});function Ia(e,t=i=>i.message){const i={},n=[];for(const s of e.issues)s.path.length>0?(i[s.path[0]]=i[s.path[0]]||[],i[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:i}}function Ca(e,t=i=>i.message){const i={_errors:[]},n=s=>{for(const r of s.issues)if(r.code==="invalid_union"&&r.errors.length)r.errors.map(a=>n({issues:a}));else if(r.code==="invalid_key")n({issues:r.issues});else if(r.code==="invalid_element")n({issues:r.issues});else if(r.path.length===0)i._errors.push(t(r));else{let a=i,o=0;for(;o<r.path.length;){const l=r.path[o];o===r.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(t(r))):a[l]=a[l]||{_errors:[]},a=a[l],o++}}};return n(e),i}const Qt=e=>(t,i,n,s)=>{const r=n?Object.assign(n,{async:!1}):{async:!1},a=t._zod.run({value:i,issues:[]},r);if(a instanceof Promise)throw new wt;if(a.issues.length){const o=new(s?.Err??e)(a.issues.map(l=>ct(l,r,ut())));throw Qi(o,s?.callee),o}return a.value},Ta=Qt(Xt),ei=e=>async(t,i,n,s)=>{const r=n?Object.assign(n,{async:!0}):{async:!0};let a=t._zod.run({value:i,issues:[]},r);if(a instanceof Promise&&(a=await a),a.issues.length){const o=new(s?.Err??e)(a.issues.map(l=>ct(l,r,ut())));throw Qi(o,s?.callee),o}return a.value},Pa=ei(Xt),ti=e=>(t,i,n)=>{const s=n?{...n,async:!1}:{async:!1},r=t._zod.run({value:i,issues:[]},s);if(r instanceof Promise)throw new wt;return r.issues.length?{success:!1,error:new(e??an)(r.issues.map(a=>ct(a,s,ut())))}:{success:!0,data:r.value}},rn=ti(Xt),ii=e=>async(t,i,n)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let r=t._zod.run({value:i,issues:[]},s);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map(a=>ct(a,s,ut())))}:{success:!0,data:r.value}},on=ii(Xt),xa=e=>(t,i,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Qt(e)(t,i,s)},Ma=e=>(t,i,n)=>Qt(e)(t,i,n),La=e=>async(t,i,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ei(e)(t,i,s)},Na=e=>async(t,i,n)=>ei(e)(t,i,n),za=e=>(t,i,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ti(e)(t,i,s)},Fa=e=>(t,i,n)=>ti(e)(t,i,n),Ra=e=>async(t,i,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ii(e)(t,i,s)},Ba=e=>async(t,i,n)=>ii(e)(t,i,n),ja=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ln=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Za=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,qa=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Va=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ua=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,dn="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Ha=new RegExp(`^${dn}$`);function un(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Wa(e){return new RegExp(`^${un(e)}$`)}function Ga(e){const t=un({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${i.join("|")})`;return new RegExp(`^${dn}T(?:${n})$`)}const Ya=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Ka=/^-?\d+$/,Ja=/^-?\d+(?:\.\d+)?$/,Xa=/^(?:true|false)$/i,Qa=/^[^A-Z]*$/,er=/^[^a-z]*$/,qe=b("$ZodCheck",(e,t)=>{var i;e._zod??(e._zod={}),e._zod.def=t,(i=e._zod).onattach??(i.onattach=[])}),cn={number:"number",bigint:"bigint",object:"date"},tr=b("$ZodCheckLessThan",(e,t)=>{qe.init(e,t);const i=cn[typeof t.value];e._zod.onattach.push(n=>{const s=n._zod.bag,r=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:i,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ir=b("$ZodCheckGreaterThan",(e,t)=>{qe.init(e,t);const i=cn[typeof t.value];e._zod.onattach.push(n=>{const s=n._zod.bag,r=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:i,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),nr=b("$ZodCheckNumberFormat",(e,t)=>{qe.init(e,t),t.format=t.format||"float64";const i=t.format?.includes("int"),n=i?"int":"number",[s,r]=Oa[t.format];e._zod.onattach.push(a=>{const o=a._zod.bag;o.format=t.format,o.minimum=s,o.maximum=r,i&&(o.pattern=Ka)}),e._zod.check=a=>{const o=a.value;if(i){if(!Number.isInteger(o)){a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:o,inst:e});return}if(!Number.isSafeInteger(o)){o>0?a.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):a.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}o<s&&a.issues.push({origin:"number",input:o,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),o>r&&a.issues.push({origin:"number",input:o,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),sr=b("$ZodCheckMaxLength",(e,t)=>{var i;qe.init(e,t),(i=e._zod.def).when??(i.when=n=>{const s=n.value;return!Di(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const s=n.value;if(s.length<=t.maximum)return;const a=ki(s);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),ar=b("$ZodCheckMinLength",(e,t)=>{var i;qe.init(e,t),(i=e._zod.def).when??(i.when=n=>{const s=n.value;return!Di(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const s=n.value;if(s.length>=t.minimum)return;const a=ki(s);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),rr=b("$ZodCheckLengthEquals",(e,t)=>{var i;qe.init(e,t),(i=e._zod.def).when??(i.when=n=>{const s=n.value;return!Di(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=n=>{const s=n.value,r=s.length;if(r===t.length)return;const a=ki(s),o=r>t.length;n.issues.push({origin:a,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ni=b("$ZodCheckStringFormat",(e,t)=>{var i,n;qe.init(e,t),e._zod.onattach.push(s=>{const r=s._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(i=e._zod).check??(i.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),or=b("$ZodCheckRegex",(e,t)=>{ni.init(e,t),e._zod.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),lr=b("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Qa),ni.init(e,t)}),dr=b("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=er),ni.init(e,t)}),ur=b("$ZodCheckIncludes",(e,t)=>{qe.init(e,t);const i=_i(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${i}`:i);t.pattern=n,e._zod.onattach.push(s=>{const r=s._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),cr=b("$ZodCheckStartsWith",(e,t)=>{qe.init(e,t);const i=new RegExp(`^${_i(t.prefix)}.*`);t.pattern??(t.pattern=i),e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),hr=b("$ZodCheckEndsWith",(e,t)=>{qe.init(e,t);const i=new RegExp(`.*${_i(t.suffix)}$`);t.pattern??(t.pattern=i),e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),pr=b("$ZodCheckOverwrite",(e,t)=>{qe.init(e,t),e._zod.check=i=>{i.value=t.tx(i.value)}}),mr={major:4,minor:3,patch:6},de=b("$ZodType",(e,t)=>{var i;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=mr;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const s of n)for(const r of s._zod.onattach)r(e);if(n.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(a,o,l)=>{let d=_t(a),c;for(const h of o){if(h._zod.def.when){if(!h._zod.def.when(a))continue}else if(d)continue;const p=a.issues.length,m=h._zod.check(a);if(m instanceof Promise&&l?.async===!1)throw new wt;if(c||m instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await m,a.issues.length!==p&&(d||(d=_t(a,p)))});else{if(a.issues.length===p)continue;d||(d=_t(a,p))}}return c?c.then(()=>a):a},r=(a,o,l)=>{if(_t(a))return a.aborted=!0,a;const d=s(o,n,l);if(d instanceof Promise){if(l.async===!1)throw new wt;return d.then(c=>e._zod.parse(c,l))}return e._zod.parse(d,l)};e._zod.run=(a,o)=>{if(o.skipChecks)return e._zod.parse(a,o);if(o.direction==="backward"){const d=e._zod.parse({value:a.value,issues:[]},{...o,skipChecks:!0});return d instanceof Promise?d.then(c=>r(c,a,o)):r(d,a,o)}const l=e._zod.parse(a,o);if(l instanceof Promise){if(o.async===!1)throw new wt;return l.then(d=>s(d,n,o))}return s(l,n,o)}}R(e,"~standard",()=>({validate:s=>{try{const r=rn(e,s);return r.success?{value:r.data}:{issues:r.error?.issues}}catch{return on(e,s).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),$i=b("$ZodString",(e,t)=>{de.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ya(e._zod.bag),e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),He=b("$ZodStringFormat",(e,t)=>{ni.init(e,t),$i.init(e,t)}),yr=b("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ln(n))}else t.pattern??(t.pattern=ln());He.init(e,t)}),fr=b("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Za),He.init(e,t)}),gr=b("$ZodURL",(e,t)=>{He.init(e,t),e._zod.check=i=>{try{const n=i.value.trim(),s=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:i.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:i.value,inst:e,continue:!t.abort})),t.normalize?i.value=s.href:i.value=n;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!t.abort})}}}),br=b("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ga(t)),He.init(e,t)}),Dr=b("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ha),He.init(e,t)}),vr=b("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Wa(t)),He.init(e,t)}),wr=b("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ja),He.init(e,t)}),_r=b("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=qa),He.init(e,t),e._zod.bag.format="ipv4"}),kr=b("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Va),He.init(e,t),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!t.abort})}}}),$r=b("$ZodCustomStringFormat",(e,t)=>{He.init(e,t),e._zod.check=i=>{t.fn(i.value)||i.issues.push({code:"invalid_format",format:t.format,input:i.value,inst:e,continue:!t.abort})}}),hn=b("$ZodNumber",(e,t)=>{de.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ja,e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=Number(i.value)}catch{}const s=i.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return i;const r=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...r?{received:r}:{}}),i}}),Sr=b("$ZodNumberFormat",(e,t)=>{nr.init(e,t),hn.init(e,t)}),Ar=b("$ZodBoolean",(e,t)=>{de.init(e,t),e._zod.pattern=Xa,e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=!!i.value}catch{}const s=i.value;return typeof s=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),i}}),Or=b("$ZodAny",(e,t)=>{de.init(e,t),e._zod.parse=i=>i});function pn(e,t,i){e.issues.length&&t.issues.push(...Ea(i,e.issues)),t.value[i]=e.value}const mn=b("$ZodArray",(e,t)=>{de.init(e,t),e._zod.parse=(i,n)=>{const s=i.value;if(!Array.isArray(s))return i.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),i;i.value=Array(s.length);const r=[];for(let a=0;a<s.length;a++){const o=s[a],l=t.element._zod.run({value:o,issues:[]},n);l instanceof Promise?r.push(l.then(d=>pn(d,i,a))):pn(l,i,a)}return r.length?Promise.all(r).then(()=>i):i}});function yn(e,t,i,n){for(const r of e)if(r.issues.length===0)return t.value=r.value,t;const s=e.filter(r=>!_t(r));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:i,errors:e.map(r=>r.issues.map(a=>ct(a,n,ut())))}),t)}const Er=b("$ZodUnion",(e,t)=>{de.init(e,t),R(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),R(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),R(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),R(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(r=>r._zod.pattern);return new RegExp(`^(${s.map(r=>vi(r.source)).join("|")})$`)}});const i=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(s,r)=>{if(i)return n(s,r);let a=!1;const o=[];for(const l of t.options){const d=l._zod.run({value:s.value,issues:[]},r);if(d instanceof Promise)o.push(d),a=!0;else{if(d.issues.length===0)return d;o.push(d)}}return a?Promise.all(o).then(l=>yn(l,s,e,r)):yn(o,s,e,r)}}),Ir=b("$ZodIntersection",(e,t)=>{de.init(e,t),e._zod.parse=(i,n)=>{const s=i.value,r=t.left._zod.run({value:s,issues:[]},n),a=t.right._zod.run({value:s,issues:[]},n);return r instanceof Promise||a instanceof Promise?Promise.all([r,a]).then(([l,d])=>fn(i,l,d)):fn(i,r,a)}});function Si(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(wi(e)&&wi(t)){const i=Object.keys(t),n=Object.keys(e).filter(r=>i.indexOf(r)!==-1),s={...e,...t};for(const r of n){const a=Si(e[r],t[r]);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};s[r]=a.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let n=0;n<e.length;n++){const s=e[n],r=t[n],a=Si(s,r);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};i.push(a.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function fn(e,t,i){const n=new Map;let s;for(const o of t.issues)if(o.code==="unrecognized_keys"){s??(s=o);for(const l of o.keys)n.has(l)||n.set(l,{}),n.get(l).l=!0}else e.issues.push(o);for(const o of i.issues)if(o.code==="unrecognized_keys")for(const l of o.keys)n.has(l)||n.set(l,{}),n.get(l).r=!0;else e.issues.push(o);const r=[...n].filter(([,o])=>o.l&&o.r).map(([o])=>o);if(r.length&&s&&e.issues.push({...s,keys:r}),_t(e))return e;const a=Si(t.value,i.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const Cr=b("$ZodTransform",(e,t)=>{de.init(e,t),e._zod.parse=(i,n)=>{if(n.direction==="backward")throw new Ji(e.constructor.name);const s=t.transform(i.value,i);if(n.async)return(s instanceof Promise?s:Promise.resolve(s)).then(a=>(i.value=a,i));if(s instanceof Promise)throw new wt;return i.value=s,i}});function gn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Ai=b("$ZodOptional",(e,t)=>{de.init(e,t),e._zod.optin="optional",e._zod.optout="optional",R(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),R(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${vi(i.source)})?$`):void 0}),e._zod.parse=(i,n)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(i,n);return s instanceof Promise?s.then(r=>gn(r,i.value)):gn(s,i.value)}return i.value===void 0?i:t.innerType._zod.run(i,n)}}),Tr=b("$ZodExactOptional",(e,t)=>{Ai.init(e,t),R(e._zod,"values",()=>t.innerType._zod.values),R(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(i,n)=>t.innerType._zod.run(i,n)}),Pr=b("$ZodNullable",(e,t)=>{de.init(e,t),R(e._zod,"optin",()=>t.innerType._zod.optin),R(e._zod,"optout",()=>t.innerType._zod.optout),R(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${vi(i.source)}|null)$`):void 0}),R(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(i,n)=>i.value===null?i:t.innerType._zod.run(i,n)}),xr=b("$ZodDefault",(e,t)=>{de.init(e,t),e._zod.optin="optional",R(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,n)=>{if(n.direction==="backward")return t.innerType._zod.run(i,n);if(i.value===void 0)return i.value=t.defaultValue,i;const s=t.innerType._zod.run(i,n);return s instanceof Promise?s.then(r=>bn(r,t)):bn(s,t)}});function bn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Mr=b("$ZodPrefault",(e,t)=>{de.init(e,t),e._zod.optin="optional",R(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,n)=>(n.direction==="backward"||i.value===void 0&&(i.value=t.defaultValue),t.innerType._zod.run(i,n))}),Lr=b("$ZodNonOptional",(e,t)=>{de.init(e,t),R(e._zod,"values",()=>{const i=t.innerType._zod.values;return i?new Set([...i].filter(n=>n!==void 0)):void 0}),e._zod.parse=(i,n)=>{const s=t.innerType._zod.run(i,n);return s instanceof Promise?s.then(r=>Dn(r,e)):Dn(s,e)}});function Dn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Nr=b("$ZodCatch",(e,t)=>{de.init(e,t),R(e._zod,"optin",()=>t.innerType._zod.optin),R(e._zod,"optout",()=>t.innerType._zod.optout),R(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,n)=>{if(n.direction==="backward")return t.innerType._zod.run(i,n);const s=t.innerType._zod.run(i,n);return s instanceof Promise?s.then(r=>(i.value=r.value,r.issues.length&&(i.value=t.catchValue({...i,error:{issues:r.issues.map(a=>ct(a,n,ut()))},input:i.value}),i.issues=[]),i)):(i.value=s.value,s.issues.length&&(i.value=t.catchValue({...i,error:{issues:s.issues.map(r=>ct(r,n,ut()))},input:i.value}),i.issues=[]),i)}}),zr=b("$ZodPipe",(e,t)=>{de.init(e,t),R(e._zod,"values",()=>t.in._zod.values),R(e._zod,"optin",()=>t.in._zod.optin),R(e._zod,"optout",()=>t.out._zod.optout),R(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(i,n)=>{if(n.direction==="backward"){const r=t.out._zod.run(i,n);return r instanceof Promise?r.then(a=>si(a,t.in,n)):si(r,t.in,n)}const s=t.in._zod.run(i,n);return s instanceof Promise?s.then(r=>si(r,t.out,n)):si(s,t.out,n)}});function si(e,t,i){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},i)}const Fr=b("$ZodReadonly",(e,t)=>{de.init(e,t),R(e._zod,"propValues",()=>t.innerType._zod.propValues),R(e._zod,"values",()=>t.innerType._zod.values),R(e._zod,"optin",()=>t.innerType?._zod?.optin),R(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(i,n)=>{if(n.direction==="backward")return t.innerType._zod.run(i,n);const s=t.innerType._zod.run(i,n);return s instanceof Promise?s.then(vn):vn(s)}});function vn(e){return e.value=Object.freeze(e.value),e}const wn=b("$ZodCustom",(e,t)=>{qe.init(e,t),de.init(e,t),e._zod.parse=(i,n)=>i,e._zod.check=i=>{const n=i.value,s=t.fn(n);if(s instanceof Promise)return s.then(r=>_n(r,i,n,e));_n(s,i,n,e)}});function _n(e,t,i,n){if(!e){const s={code:"custom",input:i,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(s.params=n._zod.def.params),t.issues.push(Lt(s))}}var kn;class Rr{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...i){const n=i[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const i=this._map.get(t);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(t),this}get(t){const i=t._zod.parent;if(i){const n={...this.get(i)??{}};delete n.id;const s={...n,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Br(){return new Rr}(kn=globalThis).__zod_globalRegistry??(kn.__zod_globalRegistry=Br());const Nt=globalThis.__zod_globalRegistry;function jr(e,t){return new e({type:"string",...L(t)})}function Zr(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...L(t)})}function qr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...L(t)})}function Vr(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...L(t)})}function Ur(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...L(t)})}function Hr(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...L(t)})}function Wr(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...L(t)})}function Gr(e,t){return new e({type:"string",format:"date",check:"string_format",...L(t)})}function Yr(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...L(t)})}function Kr(e,t){return new e({type:"string",format:"duration",check:"string_format",...L(t)})}function Jr(e,t){return new e({type:"number",checks:[],...L(t)})}function Xr(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...L(t)})}function Qr(e,t){return new e({type:"boolean",...L(t)})}function eo(e){return new e({type:"any"})}function to(e,t){return new tr({check:"less_than",...L(t),value:e,inclusive:!0})}function io(e,t){return new ir({check:"greater_than",...L(t),value:e,inclusive:!0})}function ai(e,t){return new sr({check:"max_length",...L(t),maximum:e})}function kt(e,t){return new ar({check:"min_length",...L(t),minimum:e})}function $n(e,t){return new rr({check:"length_equals",...L(t),length:e})}function Sn(e,t){return new or({check:"string_format",format:"regex",...L(t),pattern:e})}function no(e){return new lr({check:"string_format",format:"lowercase",...L(e)})}function so(e){return new dr({check:"string_format",format:"uppercase",...L(e)})}function ao(e,t){return new ur({check:"string_format",format:"includes",...L(t),includes:e})}function ro(e,t){return new cr({check:"string_format",format:"starts_with",...L(t),prefix:e})}function oo(e,t){return new hr({check:"string_format",format:"ends_with",...L(t),suffix:e})}function $t(e){return new pr({check:"overwrite",tx:e})}function lo(e){return $t(t=>t.normalize(e))}function uo(){return $t(e=>e.trim())}function co(){return $t(e=>e.toLowerCase())}function ho(){return $t(e=>e.toUpperCase())}function po(){return $t(e=>Aa(e))}function mo(e,t,i){return new e({type:"array",element:t,...L(i)})}function An(e,t,i){return new e({type:"custom",check:"custom",fn:t,...L(i)})}function On(e){const t=yo(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push(Lt(n,i.value,t._zod.def));else{const s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=i.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),i.issues.push(Lt(s))}},e(i.value,i)));return t}function yo(e,t){const i=new qe({check:"custom",...L(t)});return i._zod.check=e,i}function fo(e,t,i,n={}){const s=L(n),r={...L(n),check:"string_format",type:"string",format:t,fn:typeof i=="function"?i:o=>i.test(o),...s};return i instanceof RegExp&&(r.pattern=i),new e(r)}function En(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Nt,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function xe(e,t,i={path:[],schemaPath:[]}){var n;const s=e._zod.def,r=t.seen.get(e);if(r)return r.count++,i.schemaPath.includes(e)&&(r.cycle=i.path),r.schema;const a={schema:{},count:1,cycle:void 0,path:i.path};t.seen.set(e,a);const o=e._zod.toJSONSchema?.();if(o)a.schema=o;else{const c={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,c);else{const p=a.schema,m=t.processors[s.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);m(e,t,p,c)}const h=e._zod.parent;h&&(a.ref||(a.ref=h),xe(h,t,c),t.seen.get(h).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&Me(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function In(e,t){const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const a of e.seen.entries()){const o=e.metadataRegistry.get(a[0])?.id;if(o){const l=n.get(o);if(l&&l!==a[0])throw new Error(`Duplicate schema id "${o}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(o,a[0])}}const s=a=>{const o=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(a[0])?.id,p=e.external.uri??(f=>f);if(h)return{ref:p(h)};const m=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=m,{defId:m,ref:`${p("__shared")}#/${o}/${m}`}}if(a[1]===i)return{ref:"#"};const d=`#/${o}/`,c=a[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:d+c}},r=a=>{if(a[1].schema.$ref)return;const o=a[1],{ref:l,defId:d}=s(a);o.def={...o.schema},d&&(o.defId=d);const c=o.schema;for(const h in c)delete c[h];c.$ref=l};if(e.cycles==="throw")for(const a of e.seen.entries()){const o=a[1];if(o.cycle)throw new Error(`Cycle detected: #/${o.cycle?.join("/")}/<root>
2
2
 
3
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const a=r[1];if(t===r[0]){i(r);continue}if(e.external){const u=e.external.registry.get(r[0])?.id;if(t!==r[0]&&u){i(r);continue}}if(e.metadataRegistry.get(r[0])?.id){i(r);continue}if(a.cycle){i(r);continue}if(a.count>1&&e.reused==="ref"){i(r);continue}}}function Ct(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=r=>{const a=e.seen.get(r);if(a.ref===null)return;const c=a.def??a.schema,u={...c},d=a.ref;if(a.ref=null,d){o(d);const h=e.seen.get(d),m=h.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(m)):Object.assign(c,m),Object.assign(c,u),r._zod.parent===d)for(const y in c)y==="$ref"||y==="allOf"||y in u||delete c[y];if(m.$ref&&h.def)for(const y in c)y==="$ref"||y==="allOf"||y in h.def&&JSON.stringify(c[y])===JSON.stringify(h.def[y])&&delete c[y]}const f=r._zod.parent;if(f&&f!==d){o(f);const h=e.seen.get(f);if(h?.schema.$ref&&(c.$ref=h.schema.$ref,h.def))for(const m in c)m==="$ref"||m==="allOf"||m in h.def&&JSON.stringify(c[m])===JSON.stringify(h.def[m])&&delete c[m]}e.override({zodSchema:r,jsonSchema:c,path:a.path??[]})};for(const r of[...e.seen.entries()].reverse())o(r[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const r=e.external.registry.get(t)?.id;if(!r)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(r)}Object.assign(s,n.def??n.schema);const i=e.external?.defs??{};for(const r of e.seen.entries()){const a=r[1];a.def&&a.defId&&(i[a.defId]=a.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?s.$defs=i:s.definitions=i);try{const r=JSON.parse(JSON.stringify(s));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:Me(t,"input",e.processors),output:Me(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch{throw new Error("Error converting schema to JSON.")}}function ee(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return ee(o.element,n);if(o.type==="set")return ee(o.valueType,n);if(o.type==="lazy")return ee(o.getter(),n);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return ee(o.innerType,n);if(o.type==="intersection")return ee(o.left,n)||ee(o.right,n);if(o.type==="record"||o.type==="map")return ee(o.keyType,n)||ee(o.valueType,n);if(o.type==="pipe")return ee(o.in,n)||ee(o.out,n);if(o.type==="object"){for(const s in o.shape)if(ee(o.shape[s],n))return!0;return!1}if(o.type==="union"){for(const s of o.options)if(ee(s,n))return!0;return!1}if(o.type==="tuple"){for(const s of o.items)if(ee(s,n))return!0;return!!(o.rest&&ee(o.rest,n))}return!1}const Vr=(e,t={})=>n=>{const o=Et({...n,processors:t});return Q(e,o),Tt(o,e),Ct(o,e)},Me=(e,t,n={})=>o=>{const{libraryOptions:s,target:i}=o??{},r=Et({...s??{},target:i,io:t,processors:n});return Q(e,r),Tt(r,e),Ct(r,e)},Wr={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Br=(e,t,n,o)=>{const s=n;s.type="string";const{minimum:i,maximum:r,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof i=="number"&&(s.minLength=i),typeof r=="number"&&(s.maxLength=r),a&&(s.format=Wr[a]??a,s.format===""&&delete s.format,a==="time"&&delete s.format),u&&(s.contentEncoding=u),c&&c.size>0){const d=[...c];d.length===1?s.pattern=d[0].source:d.length>1&&(s.allOf=[...d.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},Rr=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Jr=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Ur=(e,t,n,o)=>{const s=n,i=e._zod.def,{minimum:r,maximum:a}=e._zod.bag;typeof r=="number"&&(s.minItems=r),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=Q(i.element,t,{...o,path:[...o.path,"items"]})},Gr=(e,t,n,o)=>{const s=e._zod.def,i=s.inclusive===!1,r=s.options.map((a,c)=>Q(a,t,{...o,path:[...o.path,i?"oneOf":"anyOf",c]}));i?n.oneOf=r:n.anyOf=r},Hr=(e,t,n,o)=>{const s=e._zod.def,i=Q(s.left,t,{...o,path:[...o.path,"allOf",0]}),r=Q(s.right,t,{...o,path:[...o.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(r)?r.allOf:[r]];n.allOf=c},Kr=(e,t,n,o)=>{const s=e._zod.def,i=Q(s.innerType,t,o),r=t.seen.get(e);t.target==="openapi-3.0"?(r.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},Yr=(e,t,n,o)=>{const s=e._zod.def;Q(s.innerType,t,o);const i=t.seen.get(e);i.ref=s.innerType},Xr=(e,t,n,o)=>{const s=e._zod.def;Q(s.innerType,t,o);const i=t.seen.get(e);i.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},Qr=(e,t,n,o)=>{const s=e._zod.def;Q(s.innerType,t,o);const i=t.seen.get(e);i.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},eo=(e,t,n,o)=>{const s=e._zod.def;Q(s.innerType,t,o);const i=t.seen.get(e);i.ref=s.innerType;let r;try{r=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=r},to=(e,t,n,o)=>{const s=e._zod.def,i=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Q(i,t,o);const r=t.seen.get(e);r.ref=i},no=(e,t,n,o)=>{const s=e._zod.def;Q(s.innerType,t,o);const i=t.seen.get(e);i.ref=s.innerType,n.readOnly=!0},Pt=(e,t,n,o)=>{const s=e._zod.def;Q(s.innerType,t,o);const i=t.seen.get(e);i.ref=s.innerType},ro=p("ZodISODateTime",(e,t)=>{Bn.init(e,t),Ae.init(e,t)});function oo(e){return _r(ro,e)}const so=p("ZodISODate",(e,t)=>{Rn.init(e,t),Ae.init(e,t)});function io(e){return yr(so,e)}const ao=p("ZodISOTime",(e,t)=>{Jn.init(e,t),Ae.init(e,t)});function co(e){return wr(ao,e)}const uo=p("ZodISODuration",(e,t)=>{Un.init(e,t),Ae.init(e,t)});function lo(e){return kr(uo,e)}const ie=p("ZodError",(e,t)=>{st.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>tn(e,n)},flatten:{value:n=>en(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Fe,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Fe,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),fo=Te(ie),ho=Ce(ie),go=Pe(ie),po=Ze(ie),mo=on(ie),bo=sn(ie),vo=an(ie),_o=cn(ie),yo=un(ie),wo=ln(ie),ko=dn(ie),zo=fn(ie),te=p("ZodType",(e,t)=>(U.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Me(e,"input"),output:Me(e,"output")}}),e.toJSONSchema=Vr(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Kt(t,{checks:[...t.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),e.with=e.check,e.clone=(n,o)=>rt(e,n,o),e.brand=()=>e,e.register=((n,o)=>(n.add(e,o),e)),e.parse=(n,o)=>fo(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>go(e,n,o),e.parseAsync=async(n,o)=>ho(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>po(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>mo(e,n,o),e.decode=(n,o)=>bo(e,n,o),e.encodeAsync=async(n,o)=>vo(e,n,o),e.decodeAsync=async(n,o)=>_o(e,n,o),e.safeEncode=(n,o)=>yo(e,n,o),e.safeDecode=(n,o)=>wo(e,n,o),e.safeEncodeAsync=async(n,o)=>ko(e,n,o),e.safeDecodeAsync=async(n,o)=>zo(e,n,o),e.refine=(n,o)=>e.check(Ho(n,o)),e.superRefine=n=>e.check(Ko(n)),e.overwrite=n=>e.check(_e(n)),e.optional=()=>Zt(e),e.exactOptional=()=>No(e),e.nullable=()=>xt(e),e.nullish=()=>Zt(xt(e)),e.nonoptional=n=>Vo(e,n),e.array=()=>Io(e),e.or=n=>Eo([e,n]),e.and=n=>Co(e,n),e.transform=n=>Lt(e,Zo(n)),e.default=n=>Fo(e,n),e.prefault=n=>Do(e,n),e.catch=n=>Bo(e,n),e.pipe=n=>Lt(e,n),e.readonly=()=>Uo(e),e.describe=n=>{const o=e.clone();return Oe.add(o,{description:n}),o},Object.defineProperty(e,"description",{get(){return Oe.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Oe.get(e);const o=e.clone();return Oe.add(o,n[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),$o=p("_ZodString",(e,t)=>{Be.init(e,t),te.init(e,t),e._zod.processJSONSchema=(o,s,i)=>Br(e,o,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...o)=>e.check(Ot(...o)),e.includes=(...o)=>e.check(Pr(...o)),e.startsWith=(...o)=>e.check(Zr(...o)),e.endsWith=(...o)=>e.check(xr(...o)),e.min=(...o)=>e.check(ve(...o)),e.max=(...o)=>e.check(Ne(...o)),e.length=(...o)=>e.check($t(...o)),e.nonempty=(...o)=>e.check(ve(1,...o)),e.lowercase=o=>e.check(Tr(o)),e.uppercase=o=>e.check(Cr(o)),e.trim=()=>e.check(Nr()),e.normalize=(...o)=>e.check(Lr(...o)),e.toLowerCase=()=>e.check(Mr()),e.toUpperCase=()=>e.check(Ar()),e.slugify=()=>e.check(Fr())}),Ae=p("ZodStringFormat",(e,t)=>{se.init(e,t),$o.init(e,t)}),Oo=p("ZodArray",(e,t)=>{gt.init(e,t),te.init(e,t),e._zod.processJSONSchema=(n,o,s)=>Ur(e,n,o,s),e.element=t.element,e.min=(n,o)=>e.check(ve(n,o)),e.nonempty=n=>e.check(ve(1,n)),e.max=(n,o)=>e.check(Ne(n,o)),e.length=(n,o)=>e.check($t(n,o)),e.unwrap=()=>e.element});function Io(e,t){return jr(Oo,e,t)}const So=p("ZodUnion",(e,t)=>{er.init(e,t),te.init(e,t),e._zod.processJSONSchema=(n,o,s)=>Gr(e,n,o,s),e.options=t.options});function Eo(e,t){return new So({type:"union",options:e,...P(t)})}const To=p("ZodIntersection",(e,t)=>{tr.init(e,t),te.init(e,t),e._zod.processJSONSchema=(n,o,s)=>Hr(e,n,o,s)});function Co(e,t){return new To({type:"intersection",left:e,right:t})}const Po=p("ZodTransform",(e,t)=>{nr.init(e,t),te.init(e,t),e._zod.processJSONSchema=(n,o,s)=>Jr(e,n),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Xe(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push($e(i,n.value,t));else{const r=i;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push($e(r))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n)):(n.value=s,n)}});function Zo(e){return new Po({type:"transform",transform:e})}const xo=p("ZodOptional",(e,t)=>{Je.init(e,t),te.init(e,t),e._zod.processJSONSchema=(n,o,s)=>Pt(e,n,o,s),e.unwrap=()=>e._zod.def.innerType});function Zt(e){return new xo({type:"optional",innerType:e})}const Lo=p("ZodExactOptional",(e,t)=>{rr.init(e,t),te.init(e,t),e._zod.processJSONSchema=(n,o,s)=>Pt(e,n,o,s),e.unwrap=()=>e._zod.def.innerType});function No(e){return new Lo({type:"optional",innerType:e})}const Mo=p("ZodNullable",(e,t)=>{or.init(e,t),te.init(e,t),e._zod.processJSONSchema=(n,o,s)=>Kr(e,n,o,s),e.unwrap=()=>e._zod.def.innerType});function xt(e){return new Mo({type:"nullable",innerType:e})}const Ao=p("ZodDefault",(e,t)=>{sr.init(e,t),te.init(e,t),e._zod.processJSONSchema=(n,o,s)=>Xr(e,n,o,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Fo(e,t){return new Ao({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():nt(t)}})}const jo=p("ZodPrefault",(e,t)=>{ir.init(e,t),te.init(e,t),e._zod.processJSONSchema=(n,o,s)=>Qr(e,n,o,s),e.unwrap=()=>e._zod.def.innerType});function Do(e,t){return new jo({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():nt(t)}})}const qo=p("ZodNonOptional",(e,t)=>{ar.init(e,t),te.init(e,t),e._zod.processJSONSchema=(n,o,s)=>Yr(e,n,o,s),e.unwrap=()=>e._zod.def.innerType});function Vo(e,t){return new qo({type:"nonoptional",innerType:e,...P(t)})}const Wo=p("ZodCatch",(e,t)=>{cr.init(e,t),te.init(e,t),e._zod.processJSONSchema=(n,o,s)=>eo(e,n,o,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Bo(e,t){return new Wo({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Ro=p("ZodPipe",(e,t)=>{ur.init(e,t),te.init(e,t),e._zod.processJSONSchema=(n,o,s)=>to(e,n,o,s),e.in=t.in,e.out=t.out});function Lt(e,t){return new Ro({type:"pipe",in:e,out:t})}const Jo=p("ZodReadonly",(e,t)=>{lr.init(e,t),te.init(e,t),e._zod.processJSONSchema=(n,o,s)=>no(e,n,o,s),e.unwrap=()=>e._zod.def.innerType});function Uo(e){return new Jo({type:"readonly",innerType:e})}const Go=p("ZodCustom",(e,t)=>{wt.init(e,t),te.init(e,t),e._zod.processJSONSchema=(n,o,s)=>Rr(e,n)});function Ho(e,t={}){return It(Go,e,t)}function Ko(e){return St(e)}const he=p("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");U.init(e,t),e.def=t,e.type=t.type,e.parse=(n,o)=>nn(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>it(e,n,o),e.parseAsync=async(n,o)=>rn(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>at(e,n,o),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]},{parent:!0}),e.with=e.check,e.clone=(n,o)=>rt(e,n,o),e.brand=()=>e,e.register=((n,o)=>(n.add(e,o),e)),e.apply=n=>n(e)}),Nt=p("ZodMiniString",(e,t)=>{Be.init(e,t),he.init(e,t)});function Mt(e){return hr(Nt,e)}const ye=p("ZodMiniStringFormat",(e,t)=>{se.init(e,t),Nt.init(e,t)}),Yo=p("ZodMiniEmail",(e,t)=>{Vn.init(e,t),ye.init(e,t)});function Xo(e){return gr(Yo,e)}const Qo=p("ZodMiniUUID",(e,t)=>{qn.init(e,t),ye.init(e,t)});function es(e){return pr(Qo,e)}const ts=p("ZodMiniURL",(e,t)=>{Wn.init(e,t),ye.init(e,t)});function ns(e){return mr(ts,e)}const rs=p("ZodMiniIPv4",(e,t)=>{Gn.init(e,t),ye.init(e,t)});function os(e){return br(rs,e)}const ss=p("ZodMiniIPv6",(e,t)=>{Hn.init(e,t),ye.init(e,t)});function is(e){return vr(ss,e)}const as=p("ZodMiniCustomStringFormat",(e,t)=>{Kn.init(e,t),ye.init(e,t)});function cs(e){return qr(as,"hostname",bn,e)}const At=p("ZodMiniNumber",(e,t)=>{ft.init(e,t),he.init(e,t)});function Ft(e){return zr(At,e)}const us=p("ZodMiniNumberFormat",(e,t)=>{Yn.init(e,t),At.init(e,t)});function ls(e){return $r(us,e)}const ds=p("ZodMiniBoolean",(e,t)=>{Xn.init(e,t),he.init(e,t)});function jt(e){return Or(ds,e)}const fs=p("ZodMiniAny",(e,t)=>{Qn.init(e,t),he.init(e,t)});function Ue(){return Ir(fs)}const hs=p("ZodMiniArray",(e,t)=>{gt.init(e,t),he.init(e,t)});function Dt(e,t){return new hs({type:"array",element:e,...P(t)})}const gs=p("ZodMiniOptional",(e,t)=>{Je.init(e,t),he.init(e,t)});function ps(e){return new gs({type:"optional",innerType:e})}const ms=p("ZodMiniCustom",(e,t)=>{wt.init(e,t),he.init(e,t)});function K(e,t={}){return It(ms,e,t)}function qt(e){return St(e)}const Ge={email:{schema:Xo()},hostname:{schema:cs()},ipv4:{schema:os()},ipv6:{schema:is()},url:{schema:ns()},uuid:{schema:es()},date:{schema:io()},time:{schema:co()},"date-time":{schema:oo()},duration:{schema:lo()}},bs=Object.keys(Ge),vs=e=>(t,n)=>{switch(t.type){case"string":return _s(t,n);case"integer":case"number":return ws(t,n);case"boolean":return ks(t,n);case"array":return zs(t,n);case"custom":{if(!e)throw new Error('Validator type "custom" requires a customValidators object, but it was not supplied.');return $s(t,e)}}};function B(e,t){if(e!==void 0)return typeof e=="string"?e:t?.translate(e.key,e.params,e.default)??e.default}function _s(e,t){return Ie(e,n=>{const o=B(n.messages?.invalid,t);let s=o?Mt(o):Mt();if(n.required===!0){const i=B(n.messages?.required,t)??"This field is required";s=s.check(K(r=>r.length>0,{error:i}))}if(typeof n.minLength=="number"){const i=B(n.messages?.minLength,t),r=n.minLength;s=s.check(i?K(a=>a.length>=r,{error:i}):ve(r))}if(typeof n.maxLength=="number"){const i=B(n.messages?.maxLength,t),r=n.maxLength;s=s.check(i?K(a=>a.length<=r,{error:i}):Ne(r))}if(typeof n.pattern=="string"){const i=B(n.messages?.pattern,t),r=new RegExp(n.pattern);s=s.check(i?K(a=>r.test(a),{error:i}):Ot(r))}if(n.enum){const i=n.enum,r=B(n.messages?.enum,t);s=s.check(K(a=>i.includes(a),r?{error:r}:void 0))}if(n.const!==void 0){const i=B(n.messages?.const,t);s=s.check(K(r=>r===n.const,i?{error:i}:void 0))}if(n.format!==void 0)if(bs.includes(n.format)){const i=B(n.messages?.format,t);s=s.check(i?qt((r,a)=>{const c=ze.standardValidate(Ge[n.format].schema,r);ze.isStandardValidateSuccess(c)||a.addIssue({code:"custom",path:[],message:i})}):Ge[n.format].schema)}else console.error(`The string validation format "${n.format}" is not supported`);return s})}const ys=(e,t)=>{if(t===0)return!1;const n=e/t;return Math.abs(n-Math.round(n))<1e-10};function ws(e,t){return Ie(e,n=>{const o=B(n.messages?.invalid,t);let s=o?Ft(o):Ft();if(n.type==="integer"&&(s=s.check(ls())),n.minimum!==void 0){const i=B(n.messages?.minimum,t),r=n.minimum;s=s.check(i?K(a=>a>=r,{error:i}):Er(r))}if(n.maximum!==void 0){const i=B(n.messages?.maximum,t),r=n.maximum;s=s.check(i?K(a=>a<=r,{error:i}):Sr(r))}if(n.exclusiveMinimum!==void 0){const i=B(n.messages?.exclusiveMinimum,t),r=n.exclusiveMinimum;s=s.check(K(a=>a>r,i?{error:i}:void 0))}if(n.exclusiveMaximum!==void 0){const i=B(n.messages?.exclusiveMaximum,t),r=n.exclusiveMaximum;s=s.check(K(a=>a<r,i?{error:i}:void 0))}if(n.multipleOf!==void 0){const i=B(n.messages?.multipleOf,t),r=n.multipleOf;s=s.check(K(a=>ys(a,r),i?{error:i}:void 0))}if(n.enum){const i=n.enum,r=B(n.messages?.enum,t);s=s.check(K(a=>i.includes(a),r?{error:r}:void 0))}if(n.const!==void 0){const i=B(n.messages?.const,t);s=s.check(K(r=>r===n.const,i?{error:i}:void 0))}return s})}function ks(e,t){return Ie(e,n=>{const o=B(n.messages?.invalid,t);let s=o?jt(o):jt();if(n.const!==void 0){const i=B(n.messages?.const,t);s=s.check(K(r=>r===n.const,i?{error:i}:void 0))}return s})}function zs(e,t){return Ie(e,n=>{const o=B(n.messages?.invalid,t);let s=o?Dt(Ue(),o):Dt(Ue());if(n.required===!0){const i=B(n.messages?.required,t)??"This field is required";s=s.check(K(r=>r.length>0,{error:i}))}if(typeof n.minItems=="number"){const i=B(n.messages?.minItems,t),r=n.minItems;s=s.check(i?K(a=>a.length>=r,{error:i}):ve(r))}if(typeof n.maxItems=="number"){const i=B(n.messages?.maxItems,t),r=n.maxItems;s=s.check(i?K(a=>a.length<=r,{error:i}):Ne(r))}return s})}function $s(e,t){return Ie(e,n=>{let o=Ue();return ze.filterTap(Object.keys(n),s=>s!=="type"&&s!=="required",s=>{const i=n[s],r=t[s],a=r(i);o=o.check(qt((c,u)=>{const d=ze.standardValidate(a,c);if(!ze.isStandardValidateSuccess(d)){const f=d.issues[0];u.addIssue({code:"custom",path:[],message:f?.message||`Validation failed for ${s}`})}}))}),o})}function Ie(e,t){const n=t(e);return e.required?n:ps(n)}function Os({config:e,formHealth:t=void 0,formEvent:n=void 0,autocomplete:o,ref:s}){const i=g.useMemo(()=>Ke.resolveFormInput(e.formDef,e.formSelectors,e.formConfig),[e]),r={formDef:i.formDef,widgetLoaders:{...Ye,...i.widgetLoaders,...e.customWidgetLoaders??{}},dependencies:{...i.dependencies??{},...e.dependencies??{}},validateOn:e.validateOn??i.validateOn??"eager",itemRenderers:{...i.itemRenderers??{},...e.itemRenderers??{}},localization:e.localization,middlewares:e.middlewares??[],data:e.data,meta:e.meta,formName:e.formName},a=vs({...e.customValidators??{}}),c=i.formEvent&&n?u=>{i.formEvent?.(u),n(u)}:n??i.formEvent;return l.jsx(Gt.FormComponent,{ref:s,config:r,validators:a,autocomplete:o,formHealth:t,formEvent:c})}function Is(e){const t=e.widget,{uid:n,templateData:o,onClick:s}=E.useActionWidget(t);return l.jsx("div",{className:"gui-button gui-field",style:{flex:o.size},children:l.jsx("gui-button",{uid:n,label:o.label,disabled:o.disabled,variant:o.variant,icon:o.icon,iconPosition:o.iconPosition,onClick:s})})}const Ss=Object.freeze(Object.defineProperty({__proto__:null,Button:Is},Symbol.toStringTag,{value:"Module"}));function Es(e){const t=e.widget,{uid:n,errors:o,value:s,isTouched:i,templateData:r,onBlur:a,onValueChanged:c}=E.useInputWidget(t),u=g.useCallback(F=>{const q=F,j=V=>c(V.detail.value),D=V=>{a()};return F&&(q.addEventListener("blur",D),q.addEventListener("change",j)),()=>{q.removeEventListener("blur",D),q.removeEventListener("change",j)}},[c,a]),d=r.label,f=r.hint,h=r.prevMonthIcon,m=r.nextMonthIcon,_=r.prevMonthAriaLabel,y=r.nextMonthAriaLabel,k=r.dayFormat,T=r.weekdayFormat,C=r.monthFormat,I=r.minDate,w=r.maxDate,b=r.disabledRanges,z=r.numberOfMonths,S=r.lang,O=r.disabled,$=r.readonly,N=r.validator?.required;return l.jsx("div",{className:"gui-calendar gui-field",style:{flex:r.size},children:l.jsx("gui-calendar",{ref:u,uid:n,label:d,hint:f,errors:o,touched:i,required:N,disabled:O,readOnly:$,value:s,prevMonthIcon:h,nextMonthIcon:m,prevMonthAriaLabel:_,nextMonthAriaLabel:y,dayFormat:k,weekdayFormat:T,monthFormat:C,minDate:I,maxDate:w,disabledRanges:b,numberOfMonths:z,localeId:S})})}const Ts=Object.freeze(Object.defineProperty({__proto__:null,Calendar:Es},Symbol.toStringTag,{value:"Module"}));function Cs(e){const t=e.widget,{uid:n,errors:o,value:s,isTouched:i,templateData:r,onValueChanged:a,onBlur:c}=E.useInputWidget(t),u=g.useCallback(S=>a(S.nativeEvent.detail.value),[a]),d=r.label,f=r.hint,h=r.placeholder,m=r.currency,_=r.step,y=r.maximumFractionDigits,k=r.minimumFractionDigits,T=r.autocomplete,C=r.icon,I=r.disabled,w=r.readonly,b=r.validator?.required,z=r.lang;return l.jsx("div",{className:"gui-currency gui-field",style:{flex:r.size},children:l.jsx("gui-currency",{uid:n,label:d,hint:f,errors:o,touched:i,required:b,disabled:I,readOnly:w,value:s,currency:m,step:_,maximumFractionDigits:y,minimumFractionDigits:k,icon:C,autocomplete:T??void 0,placeholder:h??void 0,localeId:z,onInput:u,onBlur:c})})}const Ps=Object.freeze(Object.defineProperty({__proto__:null,Currency:Cs},Symbol.toStringTag,{value:"Module"}));function Zs(e){const t=e.widget,{uid:n,errors:o,value:s,isTouched:i,templateData:r,onValueChanged:a,onBlur:c,injectValidationIssues:u}=E.useInputWidget(t),d=g.useCallback(C=>{const I=C,w=z=>{u(null),a(z.detail.value)},b=z=>{u([z.detail.message])};return C&&(I.addEventListener("change",w),I.addEventListener("blur",c),I.addEventListener("inputError",b)),()=>{I.removeEventListener("change",w),I.removeEventListener("blur",c),I.removeEventListener("inputError",b)}},[a,c,u]),f=r.label,h=r.hint,m=r.icon,_=r.disabled,y=r.readonly,k=r.validator?.required,T=r.lang;return l.jsx("div",{className:"gui-date gui-field",style:{flex:r.size},children:l.jsx("gui-date",{ref:d,uid:n,label:f,hint:h,errors:o,touched:i,required:k,disabled:_,readOnly:y,value:s,icon:m,localeId:T})})}const xs=Object.freeze(Object.defineProperty({__proto__:null,DateInput:Zs},Symbol.toStringTag,{value:"Module"}));function Vt({errors:e,uid:t}){return l.jsx("ul",{className:"gui-validator",id:`${t}_errors`,"data-cy":`${t}_validator-errors`,children:e.map((n,o)=>l.jsx("li",{className:"gui-validator__error",role:"alert","data-cy":`${t}_validator-error`,children:n},o))})}function Ls(e){const t=e.widget,{uid:n,errors:o,value:s,isTouched:i,templateData:r,onValueChanged:a,onBlur:c,injectValidationIssues:u}=E.useInputWidget(t),[d,f]=g.useState(!1),h=g.useRef(null),m=g.useRef(null),_=g.useRef(null),y=g.useCallback(W=>{const M=W,Y=le=>{u(null),a(le.detail.value)},X=le=>{u([le.detail.message])},G=()=>{f(!0)};return m.current=W,W&&(M.addEventListener("change",Y),M.addEventListener("focus",G),M.addEventListener("blur",c),M.addEventListener("inputError",X)),()=>{M.removeEventListener("change",Y),M.removeEventListener("focus",G),M.removeEventListener("blur",c),M.removeEventListener("inputError",X)}},[a,c,u]),k=g.useCallback(W=>{const M=W,Y=G=>{u(null),a(G.detail.value)},X=G=>{c(),f(!1)};return _.current=W,W&&(M.addEventListener("blur",X),M.addEventListener("change",Y)),()=>{M.addEventListener("blur",X),M.addEventListener("change",Y)}},[a,u,c]);g.useEffect(()=>{const W=M=>{if(!d)return;const Y=M.composedPath(),X=m.current&&Y.includes(m.current),G=_.current&&Y.includes(_.current);!X&&!G&&f(!1)};return document.addEventListener("click",W),()=>{document.removeEventListener("click",W)}},[d]);const T=W=>{if(!d)return;const M=W.relatedTarget;M&&h.current?.contains(M)||f(!1)},C=W=>{const M=W.target,Y=M.closest(".gui-date-input__part"),X=M.closest("gui-calendar");Y||X?d||f(!0):f(G=>!G)},I=r.hint,w=r.icon,b=r.prevMonthIcon,z=r.nextMonthIcon,S=r.prevMonthAriaLabel,O=r.nextMonthAriaLabel,$=r.dayFormat,N=r.weekdayFormat,F=r.monthFormat,q=r.minDate,j=r.maxDate,D=r.disabledRanges,V=r.numberOfMonths,ne=i&&o&&o.length>0,we=r.disabled,ke=r.readonly,ue=r.validator?.required,ge=r.lang;return l.jsxs("div",{ref:h,className:"gui-date-picker gui-field",style:{flex:r.size},onBlur:T,children:[r.label&&l.jsxs("label",{className:"gui-label",htmlFor:n,"data-cy":`${n}_label`,children:[r.label+(ue?" *":""),I&&l.jsx("div",{className:"gui-widget-hint",id:`${n}_hint`,children:I})]}),l.jsxs("div",{role:"button",tabIndex:-1,className:"gui-widget",onClick:C,onKeyUp:W=>{W.target===W.currentTarget&&(W.key==="Enter"||W.key===" ")&&f(M=>!M)},"aria-expanded":d,children:[l.jsx("gui-date",{ref:y,uid:n,hint:I,showErrors:!1,errors:o,touched:i,required:ue,disabled:we,readOnly:ke,value:s,icon:w,localeId:ge}),l.jsx("span",{className:"gui-date-picker__arrow",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 256 256",children:l.jsx("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"})})}),d&&l.jsx("gui-calendar",{ref:k,uid:n,hint:I,touched:i,required:ue,disabled:we,readOnly:ke,value:s,prevMonthIcon:b,nextMonthIcon:z,prevMonthAriaLabel:S,nextMonthAriaLabel:O,dayFormat:$,weekdayFormat:N,monthFormat:F,minDate:q,maxDate:j,disabledRanges:D,numberOfMonths:V,localeId:ge})]}),ne&&l.jsx(Vt,{errors:o,uid:n})]})}const Ns=Object.freeze(Object.defineProperty({__proto__:null,DatePicker:Ls},Symbol.toStringTag,{value:"Module"}));function Wt({template:e,selected:t,disabled:n,focused:o}){const s=["gui-list__item",n?"gui-list__item-disabled":"",t?"gui-list__item-selected":"",o?"gui-list__item-focused":""].filter(Boolean).join(" ");return l.jsx("div",{role:"option",className:s,"aria-selected":t,children:e})}function Ms(e){const t=e.widget,{uid:n,errors:o,value:s,isTouched:i,templateData:r,onFilter:a,onValueChanged:c,onBlur:u}=E.useInputWidget(t),[d,f]=g.useState({start:0,end:10}),[h,m]=g.useState([]),[_,y]=g.useState([]),[k,T]=g.useState(-1),[C,I]=g.useState(!1),[w,b]=g.useState(!1),[z,S]=g.useState(void 0),O=g.useRef(null),$=g.useRef(null),N=g.useRef(null),F=g.useMemo(()=>h.slice(d.start,d.end),[h,d]),q=g.useCallback(()=>{u(),b(!1),I(!1)},[u]),j=g.useCallback(v=>{if(c(v),$.current){const x=(r.items||[]).find(A=>r.valueField?A[r.valueField]===v:A===v);if(x){const A=r.valueField?x[r.valueField]:x;$.current.value=String(A)}else v||($.current.value="")}b(!1),I(!1)},[c,r]),D=g.useCallback((v,Z)=>{r.readonly||(j(v.value),a(""),T(Z),S(v),I(!1),b(!1),O.current&&O.current.focusItemAtIndex(Z))},[j,a,r.readonly]);g.useEffect(()=>{const v=O.current;if(!v)return;const Z=J=>{const{startIndex:H,endIndex:ce}=J.detail;f({start:H,end:ce})},x=J=>{const H=J.detail;if(m(H?[...H]:[]),!z&&s!=null&&H){const ce=H.find(Rt=>Rt.value===s);ce&&S(ce)}},A=J=>{const H=J.detail.index;T(H)},ae=J=>{const H=J.detail.value;j(H),S(h.find(ce=>ce.value===H)),I(!1),b(!1)};return v.addEventListener("gui-range-change",Z),v.addEventListener("gui-update-items",x),v.addEventListener("gui-focus-change",A),v.addEventListener("change",ae),()=>{v.removeEventListener("gui-range-change",Z),v.removeEventListener("gui-update-items",x),v.removeEventListener("gui-focus-change",A),v.removeEventListener("change",ae)}},[j,h,c]),g.useEffect(()=>{const v=Z=>{if(!w)return;const x=Z.target,A=$.current&&$.current.contains(x),ae=O.current&&O.current.contains(x);!A&&!ae&&q()};return document.addEventListener("click",v),()=>document.removeEventListener("click",v)},[q,w]),g.useEffect(()=>{const Z=z?.template!==null&&typeof z?.template=="object"?r.labelField??"label":null,x=Z?z?.template[Z]:z?.template;$.current.value=x??""},[z,r.labelField]),g.useEffect(()=>{N.current&&$.current&&O.current&&(N.current.targetElement=[$.current,O.current])},[]);const V=async v=>{switch(v.key){case"ArrowDown":v.preventDefault(),b(!0),setTimeout(()=>{O.current&&(O.current.focus(),O.current.scrollToSelectedIndex())},0);break;case"Enter":$.current?.value||j(null);break}},ne=g.useCallback(v=>{const Z=!!t.on?.filter;if(a(v),v&&!Z){I(!0),b(!0);const x=r.searchFields??[r.labelField,r.valueField].filter(H=>!!H),A=x.length>0,J=(r.items||[]).filter(H=>{const ce=Object.keys(H);if(!ce.length)return H.toString().toLowerCase().includes(v.toLowerCase());const Jt=(He,Ei)=>He||H[Ei].toString().toLowerCase().includes(v.toLowerCase());return A?ce.filter(He=>x.includes(He)).reduce(Jt,!1):ce.reduce(Jt,!1)});y(J)}else I(!1),y([...r.items||[]])},[t.on?.filter,a,r.items,r.labelField,r.searchFields,r.valueField]),we=E.useDebounceCallback(ne,r.inputDebounce??500),ke=v=>{const Z=v.target.value;w||b(!0),we(Z)},ue=g.useCallback(()=>{w||(b(!0),setTimeout(()=>{O.current&&O.current.scrollToSelectedIndex()},0))},[w]),ge=v=>{const Z=v.relatedTarget,x=$.current&&$.current.contains(Z),A=O.current&&O.current.contains(Z);x||A||q()},W=E.useItemRenderer(r.itemRenderer)||Wt,M=r.label,Y=r.validator?.required,X=r.disabled,G=r.readonly,le=!!t.on?.filter,R=i&&o&&o.length>0;return l.jsxs("div",{className:"gui-dropdown gui-field",style:{flex:r.size},children:[l.jsx("gui-label",{ref:N,uid:n,label:M,hint:r.hint,errors:o,touched:i,required:Y,native:!1}),l.jsxs("div",{className:"gui-widget","aria-expanded":w,children:[l.jsx("input",{ref:$,type:"text",id:n,"data-cy":`${n}_textinput`,defaultValue:s??"",required:Y,disabled:X,readOnly:G,placeholder:r.placeholder??"",autoComplete:r.autocomplete??void 0,onKeyDown:V,onInput:ke,onFocus:ue,onBlur:ge,"aria-labelledby":r.label?`${n}_label`:void 0,"aria-describedby":r.hint?`${n}_hint`:void 0}),l.jsx("span",{className:"gui-dropdown__arrow",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 256 256",children:l.jsx("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"})})}),l.jsx("gui-list",{ref:O,id:`${n}-list`,uid:n,value:s??"",valueField:r.valueField,items:C&&!le?_:r.items,itemHeight:r.itemHeight,height:r.height,required:Y,touched:i,disabled:X||G,readOnly:G,hidden:!w,onFocus:ue,onBlur:ge,children:F.map((v,Z)=>{const x=d.start+Z,A=s===v.value,ae=k===x,J=r.labelField??"label",ce=v.template!==null&&typeof v.template=="object"&&J&&!r.itemRenderer?v.template[J]:v.template;return l.jsx("div",{role:"option",tabIndex:-1,className:"gui-list__item-wrapper",id:`${n}-item-${x}`,style:{height:`${r.itemHeight||40}px`},"aria-selected":A,onClick:()=>D(v,x),children:l.jsx(W,{template:ce,value:v.value,index:x,selected:A,disabled:X||G,focused:ae})},x)})})]}),R&&l.jsx("gui-errors",{uid:n,errors:o,touched:i})]})}const As=Object.freeze(Object.defineProperty({__proto__:null,Dropdown:Ms},Symbol.toStringTag,{value:"Module"}));function Fs(e){const t=e.widget,{uid:n,errors:o,value:s,isTouched:i,templateData:r,onValueChanged:a,onBlur:c}=E.useInputWidget(t),u=g.useCallback($=>{k.current&&$.relatedTarget&&k.current.contains($.relatedTarget)||c()},[c]),[d,f]=g.useState({start:0,end:10}),[h,m]=g.useState([]),[_,y]=g.useState(-1),k=g.useRef(null),T=g.useMemo(()=>(h.length>0?h:r.items||[]).slice(d.start,d.end),[h,r.items,d]);g.useEffect(()=>{const $=k.current;if(!$)return;const N=D=>{const{startIndex:V,endIndex:ne}=D.detail;f({start:V,end:ne})},F=D=>{const V=D.detail;m(V?[...V]:[])},q=D=>{const V=D.detail.index;y(V)},j=D=>{const V=D.detail.value;a(V)};return $.addEventListener("change",j),$.addEventListener("gui-update-items",F),$.addEventListener("gui-range-change",N),$.addEventListener("gui-focus-change",q),()=>{$.removeEventListener("change",j),$.removeEventListener("gui-update-items",F),$.removeEventListener("gui-range-change",N),$.removeEventListener("gui-focus-change",q)}},[a]);const C=g.useCallback(($,N)=>{r.disabled||(a($.value),y(N),k.current&&k.current.focusItemAtIndex(N))},[a]),I=E.useItemRenderer(r.itemRenderer)||Wt,w=r.label,b=r.validator?.required,z=r.disabled,S=r.readonly,O=i&&o&&o.length>0;return l.jsxs("div",{className:"gui-list gui-field",style:{flex:r.size},children:[l.jsx("gui-label",{targetElement:k.current||void 0,uid:n,label:w,hint:r.hint,errors:o,touched:i,required:b,native:!1}),l.jsx("div",{className:"gui-widget",children:l.jsx("gui-list",{ref:k,id:n,uid:n,value:s??"",valueField:r.valueField,items:r.items,itemHeight:r.itemHeight,height:r.height,required:b,touched:i,disabled:z,readOnly:S,onBlur:u,children:T.map(($,N)=>{const F=d.start+N,q=s===$.value,j=_===F,D=r.labelField??"label",ne=$.template!==null&&typeof $.template=="object"&&D&&!r.itemRenderer?$.template[D]:$.template;return l.jsx("div",{role:"option",tabIndex:-1,id:`${n}-item-${F}`,className:"gui-list__item-wrapper",style:{height:`${r.itemHeight||40}px`},"aria-selected":q,"aria-disabled":z?"true":"false",onClick:()=>C($,F),children:l.jsx(I,{template:ne,value:$.value,index:N,selected:q,disabled:z,focused:j})},F)})})}),O&&l.jsx("gui-errors",{uid:n,errors:o,touched:i})]})}const js=Object.freeze(Object.defineProperty({__proto__:null,List:Fs},Symbol.toStringTag,{value:"Module"}));function Ds(e){const t=e.widget,{uid:n,errors:o,value:s,isTouched:i,templateData:r,onValueChanged:a,onBlur:c}=E.useInputWidget(t),u=g.useCallback(z=>a(z.nativeEvent.detail.value),[a]),d=r.label,f=r.hint,h=r.placeholder,m=r.autocomplete,_=r.showPasswordIcon,y=r.hidePasswordIcon,k=r.showPasswordLabel,T=r.hidePasswordLabel,C=r.icon,I=r.disabled,w=r.readonly,b=r.validator?.required;return l.jsx("div",{className:"gui-password gui-field",style:{flex:r.size},children:l.jsx("gui-password",{uid:n,label:d,hint:f,errors:o,touched:i,required:b,disabled:I,readOnly:w,value:s,icon:C,placeholder:h??void 0,autocomplete:m??void 0,showPasswordIcon:_,hidePasswordIcon:y,showPasswordLabel:k,hidePasswordLabel:T,onInput:u,onBlur:c})})}const qs=Object.freeze(Object.defineProperty({__proto__:null,Password:Ds},Symbol.toStringTag,{value:"Module"}));function Vs(e){const t=e.widget,{uid:n,errors:o,value:s,isTouched:i,templateData:r,onValueChanged:a,onBlur:c}=E.useInputWidget(t),u=g.useCallback(C=>a(C.nativeEvent.detail.value),[a]),d=r.label,f=r.hint,h=r.placeholder,m=r.autocomplete,_=r.icon,y=r.disabled,k=r.readonly,T=r.validator?.required;return l.jsx("div",{className:"gui-textinput gui-field",style:{flex:r.size},children:l.jsx("gui-textinput",{uid:n,label:d,hint:f,errors:o,touched:i,required:T,disabled:y,readOnly:k,value:s,icon:_,placeholder:h??void 0,autocomplete:m??void 0,onInput:u,onBlur:c})})}const Ws=Object.freeze(Object.defineProperty({__proto__:null,TextInput:Vs},Symbol.toStringTag,{value:"Module"}));function Bs(e){const t=e.widget,{uid:n,errors:o,value:s,isTouched:i,templateData:r,onValueChanged:a,onBlur:c}=E.useInputWidget(t),u=g.useCallback(b=>a(b.nativeEvent.detail.value),[a]),d=r.label,f=r.hint,h=r.placeholder,m=r.validator?.maxLength,_=r.counterMode,y=r.autocomplete,k=r.autoGrow,T=r.minimumHeight,C=r.disabled,I=r.readonly,w=r.validator?.required;return l.jsx("div",{className:"gui-textarea gui-field",style:{flex:r.size},children:l.jsx("gui-textarea",{uid:n,label:d,errors:o,touched:i,required:w,disabled:C,readOnly:I,value:s,hint:f,placeholder:h,autocomplete:y??void 0,counterMode:_,minimumHeight:T,autoGrow:k,maxLength:m,onInput:u,onBlur:c})})}const Rs=Object.freeze(Object.defineProperty({__proto__:null,TextArea:Bs},Symbol.toStringTag,{value:"Module"}));function Js(e){const t=e.widget,{uid:n,errors:o,value:s,isTouched:i,templateData:r,onValueChanged:a,onBlur:c}=E.useInputWidget(t),u=g.useCallback(ne=>a(ne.nativeEvent.detail.value),[a]),d=r.label,f=r.hint,h=r.placeholder,m=r.autocomplete,_=r.validator?.maxLength,y=r.counterMode,k=r.autoGrow,T=r.minimumHeight,C=r.tools,I=r.defaultOpenPreview,w=r.headingTitle,b=r.boldTitle,z=r.italicTitle,S=r.strikethroughTitle,O=r.quoteTitle,$=r.linkTitle,N=r.orderedListTitle,F=r.unorderedListTitle,q=r.splitViewTitle,j=r.disabled,D=r.readonly,V=r.validator?.required;return l.jsx("div",{className:"gui-markdown gui-field",style:{flex:r.size},children:l.jsx("gui-markdown",{uid:n,label:d,errors:o,touched:i,required:V,disabled:j,readOnly:D,value:s,hint:f,placeholder:h,autocomplete:m??void 0,counterMode:y,minimumHeight:T,autoGrow:k,maxLength:_,tools:C,defaultOpenPreview:I,headingTitle:w,boldTitle:b,italicTitle:z,strikethroughTitle:S,quoteTitle:O,linkTitle:$,orderedListTitle:N,unorderedListTitle:F,splitViewTitle:q,dependencies:r.deps,onInput:u,onBlur:c})})}const Us=Object.freeze(Object.defineProperty({__proto__:null,Markdown:Js},Symbol.toStringTag,{value:"Module"}));function Gs(e){const t=e.widget,{uid:n,errors:o,value:s,onValueChanged:i,onBlur:r,templateData:a,isTouched:c}=E.useInputWidget(t),u=g.useCallback(k=>i(k.nativeEvent.detail.value),[i]),d=a.label,f=a.hint,h=a.checkboxPosition,m=a.disabled,_=a.readonly,y=a.validator?.required;return l.jsx("div",{className:"gui-checkbox gui-field",style:{flex:a.size},children:l.jsx("gui-checkbox",{uid:n,label:d,errors:o,touched:c,required:y,disabled:m,readOnly:_,value:s,hint:f,checkboxPosition:h,onChange:u,onBlur:r})})}const Hs=Object.freeze(Object.defineProperty({__proto__:null,Checkbox:Gs},Symbol.toStringTag,{value:"Module"}));function Ks(e){const t=e.widget,{uid:n,errors:o,value:s,onValueChanged:i,onBlur:r,templateData:a,isTouched:c}=E.useInputWidget(t),u=g.useCallback(k=>i(k.nativeEvent.detail.value),[i]),d=a.label,f=a.hint,h=a.togglePosition,m=a.disabled,_=a.readonly,y=a.validator?.required;return l.jsx("div",{className:"gui-toggle gui-field",style:{flex:a.size},children:l.jsx("gui-toggle",{uid:n,label:d,errors:o,touched:c,required:y,disabled:m,readOnly:_,value:s,hint:f,togglePosition:h,onChange:u,onBlur:r})})}const Ys=Object.freeze(Object.defineProperty({__proto__:null,Toggle:Ks},Symbol.toStringTag,{value:"Module"}));function Xs(e){const t=e.widget,{uid:n,errors:o,value:s,isTouched:i,templateData:r,onValueChanged:a,onBlur:c}=E.useInputWidget(t),u=g.useCallback(b=>a(b.nativeEvent.detail.value),[a]),d=r.label,f=r.hint,h=r.placeholder,m=r.step,_=r.minimum,y=r.maximum,k=r.autocomplete,T=r.autoGrow,C=r.disabled,I=r.readonly,w=r.validator?.required;return l.jsx("div",{className:"gui-number gui-field",style:{flex:r.size},children:l.jsx("gui-number",{uid:n,label:d,hint:f,errors:o,touched:i,required:w,disabled:C,readOnly:I,value:s,step:m,minimum:_,maximum:y,autoGrow:T,autocomplete:k??void 0,placeholder:h??void 0,onInput:u,onBlur:c})})}const Qs=Object.freeze(Object.defineProperty({__proto__:null,NumberInput:Xs},Symbol.toStringTag,{value:"Module"}));function ei(e){const t=e.widget,{uid:n,errors:o,value:s,isTouched:i,templateData:r,onValueChanged:a,onBlur:c,injectValidationIssues:u}=E.useInputWidget(t),d=g.useCallback(S=>a(S.nativeEvent.detail.value),[a]),f=g.useCallback(S=>{const O=S,$=N=>{u([N.detail.message])};return S&&O.addEventListener("inputError",$),()=>{O.removeEventListener("inputError",$)}},[u]),h=r.options,m=r.label,_=r.hint,y=r.placeholder,k=r.autocomplete,T=r.icon,C=r.valueField,I=r.labelField,w=r.disabled,b=r.readonly,z=r.validator?.required;return l.jsx("div",{className:"gui-select gui-field",style:{flex:r.size},children:l.jsx("gui-select",{ref:f,uid:n,label:m,errors:o,touched:i,required:z,disabled:w,readOnly:b,value:s,hint:_,placeholder:y,autocomplete:k??void 0,icon:T,options:h,labelField:I,valueField:C,onChange:d,onBlur:c})})}const ti=Object.freeze(Object.defineProperty({__proto__:null,Select:ei},Symbol.toStringTag,{value:"Module"}));function ni(e){const t=e.widget,{uid:n,errors:o,value:s,isTouched:i,templateData:r,onValueChanged:a,onBlur:c}=E.useInputWidget(t),u=g.useCallback(I=>a(I.nativeEvent.detail.value),[a]),d=r.label,f=r.hint,h=r.options,m=r.labelField,_=r.valueField,y=r.direction,k=r.disabled,T=r.readonly,C=r.validator?.required;return l.jsx("div",{className:"gui-radiogroup gui-field",style:{flex:r.size},children:l.jsx("gui-radiogroup",{uid:n,label:d,errors:o,touched:i,required:C,disabled:k,readOnly:T,value:s,hint:f,options:h,labelField:m,valueField:_,direction:y,onChange:u,onBlur:c})})}const ri=Object.freeze(Object.defineProperty({__proto__:null,RadioGroup:ni},Symbol.toStringTag,{value:"Module"}));function oi(e){const t=e.widget,{uid:n,errors:o,value:s,isTouched:i,templateData:r,onBlur:a,onValueChanged:c}=E.useInputWidget(t),u=g.useCallback(q=>{const j=q,D=ne=>c(ne.detail.value),V=ne=>{a()};return q&&(j.addEventListener("blur",V),j.addEventListener("change",D)),()=>{j.removeEventListener("blur",V),j.removeEventListener("change",D)}},[c,a]),d=r.label,f=r.hint,h=r.prevMonthIcon,m=r.nextMonthIcon,_=r.prevMonthAriaLabel,y=r.nextMonthAriaLabel,k=r.dayFormat,T=r.weekdayFormat,C=r.monthFormat,I=r.minDate,w=r.maxDate,b=r.disabledRanges,z=r.numberOfMonths,S=r.removePillAriaLabel,O=r.lang,$=r.disabled,N=r.readonly,F=r.validator?.required;return l.jsx("div",{className:"gui-range-calendar gui-field",style:{flex:r.size},children:l.jsx("gui-range-calendar",{ref:u,uid:n,label:d,hint:f,errors:o,touched:i,required:F,disabled:$,readOnly:N,value:s,prevMonthIcon:h,nextMonthIcon:m,prevMonthAriaLabel:_,nextMonthAriaLabel:y,dayFormat:k,weekdayFormat:T,monthFormat:C,minDate:I,maxDate:w,disabledRanges:b,numberOfMonths:z,hidePills:!1,removePillAriaLabel:S,localeId:O})})}const si=Object.freeze(Object.defineProperty({__proto__:null,RangeCalendar:oi},Symbol.toStringTag,{value:"Module"}));function ii(e){const t=e.widget,{uid:n,errors:o,value:s,isTouched:i,templateData:r,onBlur:a,onValueChanged:c,injectValidationIssues:u}=E.useInputWidget(t),d=g.useCallback(z=>{const S=z,O=F=>{u(null),c(F.detail.value)},$=()=>{a()},N=F=>{u([F.detail.message])};return z&&(S.addEventListener("blur",$),S.addEventListener("change",O),S.addEventListener("inputError",N)),()=>{S.removeEventListener("blur",$),S.removeEventListener("change",O),S.removeEventListener("inputError",N)}},[c,a,u]),f=r.label,h=r.hint,m=r.icon,_=r.lang,y=r.separator,k=r.removePillAriaLabel,T=r.startDateAriaLabel,C=r.endDateAriaLabel,I=r.disabled,w=r.readonly,b=r.validator?.required;return l.jsx("div",{className:"gui-range-date-input gui-field",style:{flex:r.size},children:l.jsx("gui-range-date",{ref:d,uid:n,label:f,hint:h,errors:o,touched:i,required:b,disabled:I,readOnly:w,value:s,icon:m,localeId:_,separator:y,removePillAriaLabel:k,startDateAriaLabel:T,endDateAriaLabel:C})})}const ai=Object.freeze(Object.defineProperty({__proto__:null,RangeDateInput:ii},Symbol.toStringTag,{value:"Module"}));function ci(e){const t=e.widget,{uid:n,errors:o,value:s,isTouched:i,templateData:r,onValueChanged:a,onBlur:c,injectValidationIssues:u}=E.useInputWidget(t),[d,f]=g.useState(!1),[h,m]=g.useState(void 0),_=g.useRef(null),y=g.useRef(null),k=g.useRef(null),T=g.useCallback(R=>{const v=R,Z=J=>{u(null),a(J.detail.value)},x=J=>{u([J.detail.message])},A=()=>{f(!0)},ae=J=>{m(J.detail.range.start),f(!0)};return y.current=R,R&&(v.addEventListener("change",Z),v.addEventListener("focus",A),v.addEventListener("blur",c),v.addEventListener("inputError",x),v.addEventListener("pillClick",ae)),()=>{v.removeEventListener("change",Z),v.removeEventListener("focus",A),v.removeEventListener("blur",c),v.removeEventListener("inputError",x),v.removeEventListener("pillClick",ae)}},[a,c,u]),C=g.useCallback(R=>{const v=R,Z=A=>{u(null),a(A.detail.value)},x=A=>{c(),f(!1)};return k.current=R,R&&(v.addEventListener("blur",x),v.addEventListener("change",Z)),()=>{v.addEventListener("blur",x),v.addEventListener("change",Z)}},[a,u,c]);g.useEffect(()=>{const R=v=>{if(!d)return;const Z=v.composedPath(),x=y.current&&Z.includes(y.current),A=k.current&&Z.includes(k.current);!x&&!A&&f(!1)};return document.addEventListener("click",R),()=>{document.removeEventListener("click",R)}},[d]);const I=R=>{if(!d)return;const v=R.relatedTarget;v&&_.current?.contains(v)||f(!1)},w=R=>{const v=R.target,Z=v.closest(".gui-range-date-input__part"),x=v.closest("gui-range-calendar"),A=v.closest(".gui-range-date-input__pill"),ae=v.closest(".gui-range-date-input__pill--count");Z||x||A?d||f(!0):ae?d&&f(!1):f(J=>!J)},b=r.hint,z=r.icon,S=r.separator,O=r.removePillAriaLabel,$=r.startDateAriaLabel,N=r.endDateAriaLabel,F=r.prevMonthIcon,q=r.nextMonthIcon,j=r.prevMonthAriaLabel,D=r.nextMonthAriaLabel,V=r.dayFormat,ne=r.weekdayFormat,we=r.monthFormat,ke=r.minDate,ue=r.maxDate,ge=r.disabledRanges,W=r.numberOfMonths,M=i&&o&&o.length>0,Y=r.disabled,X=r.readonly,G=r.validator?.required,le=r.lang;return l.jsxs("div",{ref:_,className:"gui-range-date-picker gui-field",style:{flex:r.size},onBlur:I,children:[r.label&&l.jsxs("label",{className:"gui-label",htmlFor:n,"data-cy":`${n}_label`,children:[r.label+(G?" *":""),b&&l.jsx("div",{className:"gui-widget-hint",id:`${n}_hint`,children:b})]}),l.jsxs("div",{role:"button",tabIndex:-1,className:"gui-widget",onClick:w,onKeyUp:R=>{R.target===R.currentTarget&&(R.key==="Enter"||R.key===" ")&&f(v=>!v)},"aria-expanded":d,children:[l.jsx("gui-range-date",{ref:T,uid:n,hint:b,showErrors:!1,errors:o,touched:i,required:G,disabled:Y,readOnly:X,value:s,icon:z,localeId:le,separator:S,removePillAriaLabel:O,startDateAriaLabel:$,endDateAriaLabel:N}),l.jsx("span",{className:"gui-range-date-picker__arrow",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 256 256",children:l.jsx("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"})})}),d&&l.jsx("gui-range-calendar",{ref:C,uid:n,hint:b,touched:i,required:G,disabled:Y,readOnly:X,value:s,focusDate:h,prevMonthIcon:F,nextMonthIcon:q,prevMonthAriaLabel:j,nextMonthAriaLabel:D,dayFormat:V,weekdayFormat:ne,monthFormat:we,minDate:ke,maxDate:ue,disabledRanges:ge,numberOfMonths:W,localeId:le,hidePills:!0})]}),M&&l.jsx(Vt,{errors:o,uid:n})]})}const ui=Object.freeze(Object.defineProperty({__proto__:null,RangeDatePicker:ci},Symbol.toStringTag,{value:"Module"}));let li=0;const di=()=>li++;function fi(e){const t=e.widget,{uid:n,value:o,onValueChanged:s,templateData:i,errors:r,isTouched:a,onBlur:c}=E.useInputWidget(t),u=g.useRef(null),d=g.useCallback(w=>{const b=[...w??[],{}];s(b)},[s]),f=g.useCallback((w,b)=>{const z=(w??[]).filter((S,O)=>b!==O);"structuredClone"in window?s(structuredClone(z)):s(JSON.parse(JSON.stringify(z)))},[s]),[h,m]=g.useState(!1),_=g.useCallback(w=>{w.stopPropagation(),m(!0)},[]),y=g.useCallback(w=>{w.stopPropagation(),c(),m(!1)},[]),k=E.useRepeaterIndexes(),T=g.useCallback(()=>o?.map((w,b)=>{const z=Ke.getItemKey(w,di);return l.jsx(E.RepeaterIndexesContext.Provider,{value:[...k,b],children:l.jsxs("div",{className:"gui-repeater__card",children:[l.jsxs("div",{className:"gui-repeater__card-header",children:[i.title&&l.jsx("span",{className:"gui-repeater__card-title",children:`${i.title} ${b+1}`}),l.jsxs("button",{type:"button",tabIndex:0,className:"gui-button gui-button--sm gui-repeater__remove-btn",onClick:()=>f(o,b),children:[i.removeButtonIcon&&l.jsx("span",{className:`gui-widget-icon gui-button-icon ${i.removeButtonIcon}`,"data-icon":i.removeButtonIcon}),i.removeLabel??"Remove"]})]}),l.jsx(E.WidgetRenderer,{widget:i.template},`${n}-${z}`)]})},`${n}-${z}`)}),[i,o,n,f,k]),C=i.validator?.required,I=a&&r&&r.length>0;return l.jsxs("div",{className:"gui-repeater gui-field",style:{flex:i.size},children:[l.jsxs("div",{ref:u,id:n,className:`gui-repeater__main-card gui-repeater__card${h?" gui-repeater__card--focused":""}`,onFocus:_,onBlur:y,children:[l.jsx("gui-label",{targetElement:u.current||void 0,uid:n,label:i.label,errors:r,touched:a,required:C,native:!1}),T(),l.jsxs("button",{type:"button",tabIndex:0,className:"gui-button gui-repeater__add-btn",onClick:()=>d(o||[]),disabled:i.limit?i.limit===(o?.length??0):!1,children:[i.addButtonIcon&&l.jsx("span",{className:`gui-widget-icon gui-button-icon ${i.addButtonIcon}`,"data-icon":i.addButtonIcon}),i.addLabel??"Add"]})]}),I&&l.jsx("gui-errors",{uid:n,errors:r,touched:a})]})}const hi=Object.freeze(Object.defineProperty({__proto__:null,Repeater:fi},Symbol.toStringTag,{value:"Module"}));function gi(e){const t=e.widget,{uid:n,children:o,templateData:s}=E.useLayoutWidget(t),i=g.useCallback(()=>o?o.map(u=>l.jsx(E.WidgetRenderer,{widget:u},u.uid)):null,[o]),r=`gui-flex__widget--${s.direction??"column"}`,a=`gui-flex__widget--justify-${s.justify??"stretch"}`,c=`gui-flex__widget--align-${s.align??"start"}`;return l.jsx("div",{className:"gui-flex gui-field",style:{flex:s.size},children:l.jsx("div",{className:`gui-flex__widget ${r} ${a} ${c}`,style:s.gap?{gap:`${s.gap}px`}:{},id:n,children:i()})})}const pi=Object.freeze(Object.defineProperty({__proto__:null,Flex:gi},Symbol.toStringTag,{value:"Module"}));function mi(e){const t=e.widget,{uid:n,children:o,templateData:s}=E.useLayoutWidget(t),i=s.direction!=="column",r=g.useCallback(()=>o.map(f=>{const h=f;return l.jsx("div",{className:"gui-grid__cell",style:{gridColumn:`span ${h.size||1}`},children:l.jsx(E.WidgetRenderer,{widget:h})},h.uid)}),[o]),a=i?"gui-grid__widget--row":"gui-grid__widget--column",c=`gui-grid__widget--align-${s.align??"stretch"}`,u=s.justify?`gui-grid__widget--justify-${s.justify}`:"",d={};return s.columnGap!==void 0&&(d.columnGap=`${s.columnGap}px`),s.rowGap!==void 0&&(d.rowGap=`${s.rowGap}px`),l.jsx("div",{className:"gui-grid gui-field",style:{flex:s.size},children:l.jsx("div",{className:`gui-grid__widget ${a} ${i&&(s.autoFit??!0)?"gui-grid__widget--row--auto-fit":""} ${c} ${u}`,style:d,id:n,children:r()})})}const bi=Object.freeze(Object.defineProperty({__proto__:null,Grid:mi},Symbol.toStringTag,{value:"Module"}));function vi(e){const t=g.useRef(null),n=e.widget,{uid:o,children:s,templateData:i,onChange:r}=E.useLayoutWidget(n),a=g.useRef([]),c=g.useRef(null),u=g.useRef(null),[d,f]=g.useState(!1),[h,m]=g.useState(!1),[_,y]=g.useState(i.defaultOpen);g.useEffect(()=>{const w=c.current,b=u.current,z=pe.createIntersectionObserver(w,O=>f(O)),S=pe.createIntersectionObserver(b,O=>m(O));return()=>{z.disconnect(),S.disconnect()}},[]),g.useEffect(()=>{_===void 0&&i.tabs?.length>0&&y(i.tabs[0].uid)},[i.tabs,_]),g.useEffect(()=>{i.defaultOpen&&y(i.defaultOpen)},[i.defaultOpen]),g.useEffect(()=>{const b=(i.tabs||[]).findIndex(z=>z.uid===_);b>-1&&a.current[b].scrollIntoView({block:"nearest",inline:"nearest"})},[_,i.tabs]);const k=g.useCallback(w=>{y(w),r(w)},[r]),T=g.useCallback(w=>{const b=i.tabs.findIndex(O=>O.uid===_),z=a.current,S=t.current?window.getComputedStyle(t.current).direction==="rtl":!1;switch(w.key){case"ArrowLeft":{const O=b+(S?1:-1);O>=0&&O<i.tabs.length&&(k(i.tabs[O].uid),z[O]?.focus());break}case"ArrowRight":{const O=b+(S?-1:1);O>=0&&O<i.tabs.length&&(k(i.tabs[O].uid),z[O]?.focus());break}case"Home":k(i.tabs[0].uid),z[0]?.focus();break;case"End":k(i.tabs[i.tabs.length-1].uid),z[i.tabs.length-1]?.focus();break;default:return}},[_,i.tabs,k]),C=g.useCallback(()=>(i.tabs||[]).map((b,z)=>l.jsx("li",{role:"presentation",children:l.jsx("button",{ref:S=>{a.current[z]=S},type:"button",role:"tab",tabIndex:b.uid===_?0:-1,"data-cy":`tab_${n.uid}_${z}`,id:`tab_${n.uid}_${z}`,"aria-controls":`tabpanel_${n.uid}_${z}`,"aria-selected":b.uid===_?"true":"false",className:`${b.uid===_?"active":""}`,onClick:()=>k(b.uid),onKeyDown:S=>T(S),onFocus:S=>{S.target.scrollIntoView({block:"nearest",inline:"nearest"})},children:b.label})},`tab_${n.uid}_${b.uid}`)),[i,_,n,a,k,T]),I=g.useCallback(()=>{const w=s.findIndex(b=>b.uid===_);return s.filter(b=>b.uid===_||i.renderMode!=="activeOnly").map(b=>l.jsx("section",{role:"tabpanel","data-cy":`tabpanel_${n.uid}_${w}`,id:`tabpanel_${n.uid}_${w}`,hidden:b.uid!==_&&i.renderMode!=="activeOnly","aria-labelledby":`tab_${n.uid}_${w}`,children:l.jsx(E.WidgetRenderer,{widget:b},b.uid)},`tabpanel_${n.uid}_${b.uid}`))},[s,_,n]);return l.jsxs("div",{className:"gui-tabs gui-field",style:{flex:i.size},children:[l.jsx("nav",{className:E.cn({"gui-widget":!0,"gui-widget--horizontal":!0,"gui-tabs--start-shadow":!d,"gui-tabs--end-shadow":!h}),id:o,children:l.jsxs("ul",{role:"tablist",children:[l.jsx("li",{role:"presentation",ref:c,className:"gui-sentinel gui-sentinel__start"}),C(),l.jsx("li",{role:"presentation",ref:u,className:"gui-sentinel gui-sentinel__end"})]})}),I()]})}const _i=Object.freeze(Object.defineProperty({__proto__:null,Tabs:vi},Symbol.toStringTag,{value:"Module"})),Bt={};function yi(e){const t=e.widget,{uid:n,children:o,templateData:s,onChange:i}=E.useLayoutWidget(t),[r,a]=g.useState(Bt);g.useEffect(()=>{r===Bt&&s.defaultOpen&&a(s.defaultOpen||{})},[r,s]);const c=g.useCallback(f=>{const h={...r};s.singleOpen&&Object.keys(h).filter(m=>m!==f).forEach(m=>{h[m]=m===f?!h[m]:!1}),h[f]=!h[f],a(h),i(h)},[r,s.singleOpen,i]),u=g.useCallback(f=>{const h=o.find(_=>_.uid===f),m=r[f];return(m||s.renderMode!=="activeOnly")&&h?l.jsx("section",{className:"gui-widget",role:"region",id:`accordion_section_${f}`,hidden:!m&&s.renderMode!=="activeOnly","aria-labelledby":`accordion_button_${f}`,children:l.jsx(E.WidgetRenderer,{widget:h})}):null},[o,r,s.renderMode]),d=g.useCallback(()=>(s.sections||[]).map((h,m)=>l.jsxs("div",{className:"gui-accordion__section",children:[l.jsxs("button",{type:"button",tabIndex:0,id:`accordion_button_${h.uid}`,"aria-controls":`accordion_section_${h.uid}`,"aria-expanded":r[h.uid]?"true":"false",className:r[h.uid]?"active":"",onClick:()=>c(h.uid),children:[h.label,l.jsx("span",{className:"gui-accordion__arrow",children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 256 256",children:l.jsx("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"})})})]}),u(h.uid)]},`${"accordion_section_"+h.uid}`)),[s.sections,r,u,c]);return l.jsx("div",{className:"gui-accordion gui-field",style:{flex:s.size},children:l.jsx("div",{className:"gui-widget",id:n,children:d()})})}const wi=Object.freeze(Object.defineProperty({__proto__:null,Accordion:yi},Symbol.toStringTag,{value:"Module"}));function ki(e){const t=e.widget,{uid:n,templateData:o}=E.useDisplayWdiget(t);return l.jsx("div",{className:"gui-alert gui-field",style:{flex:o.size},children:l.jsx("div",{className:"gui-widget",id:n,children:l.jsx("div",{role:"alert",className:`gui-alert-notification gui-alert-notification--${o.level||"default"}`,children:o.text})})})}const zi=Object.freeze(Object.defineProperty({__proto__:null,Alert:ki},Symbol.toStringTag,{value:"Module"}));function $i(e){const t=e.widget,{uid:n,templateData:o}=E.useDisplayWdiget(t);return l.jsx("div",{className:"gui-markdown-text gui-field",style:{flex:o.size},children:l.jsx("div",{className:"gui-widget",id:n,children:l.jsx("gui-markdown-text",{md:o.md,dependencies:o.deps})})})}const Oi=Object.freeze(Object.defineProperty({__proto__:null,MarkdownText:$i},Symbol.toStringTag,{value:"Module"}));function Ii(e){const t=e.widget,{uid:n,templateData:o}=E.useDisplayWdiget(t),s=o?.render;return l.jsx("div",{className:"gui-renderer gui-field",style:{flex:o.size},children:l.jsx("div",{className:"gui-widget",id:n,children:s})})}const Si=Object.freeze(Object.defineProperty({__proto__:null,Renderer:Ii},Symbol.toStringTag,{value:"Module"}));re.GuiForm=Os,re.widgetLoaders=Ye,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})}));
3
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const o=a[1];if(t===a[0]){r(a);continue}if(e.external){const d=e.external.registry.get(a[0])?.id;if(t!==a[0]&&d){r(a);continue}}if(e.metadataRegistry.get(a[0])?.id){r(a);continue}if(o.cycle){r(a);continue}if(o.count>1&&e.reused==="ref"){r(a);continue}}}function Cn(e,t){const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=a=>{const o=e.seen.get(a);if(o.ref===null)return;const l=o.def??o.schema,d={...l},c=o.ref;if(o.ref=null,c){n(c);const p=e.seen.get(c),m=p.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(m)):Object.assign(l,m),Object.assign(l,d),a._zod.parent===c)for(const w in l)w==="$ref"||w==="allOf"||w in d||delete l[w];if(m.$ref&&p.def)for(const w in l)w==="$ref"||w==="allOf"||w in p.def&&JSON.stringify(l[w])===JSON.stringify(p.def[w])&&delete l[w]}const h=a._zod.parent;if(h&&h!==c){n(h);const p=e.seen.get(h);if(p?.schema.$ref&&(l.$ref=p.schema.$ref,p.def))for(const m in l)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(l[m])===JSON.stringify(p.def[m])&&delete l[m]}e.override({zodSchema:a,jsonSchema:l,path:o.path??[]})};for(const a of[...e.seen.entries()].reverse())n(a[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(a)}Object.assign(s,i.def??i.schema);const r=e.external?.defs??{};for(const a of e.seen.entries()){const o=a[1];o.def&&o.defId&&(r[o.defId]=o.def)}e.external||Object.keys(r).length>0&&(e.target==="draft-2020-12"?s.$defs=r:s.definitions=r);try{const a=JSON.parse(JSON.stringify(s));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:ri(t,"input",e.processors),output:ri(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Me(e,t){const i=t??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Me(n.element,i);if(n.type==="set")return Me(n.valueType,i);if(n.type==="lazy")return Me(n.getter(),i);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Me(n.innerType,i);if(n.type==="intersection")return Me(n.left,i)||Me(n.right,i);if(n.type==="record"||n.type==="map")return Me(n.keyType,i)||Me(n.valueType,i);if(n.type==="pipe")return Me(n.in,i)||Me(n.out,i);if(n.type==="object"){for(const s in n.shape)if(Me(n.shape[s],i))return!0;return!1}if(n.type==="union"){for(const s of n.options)if(Me(s,i))return!0;return!1}if(n.type==="tuple"){for(const s of n.items)if(Me(s,i))return!0;return!!(n.rest&&Me(n.rest,i))}return!1}const go=(e,t={})=>i=>{const n=En({...i,processors:t});return xe(e,n),In(n,e),Cn(n,e)},ri=(e,t,i={})=>n=>{const{libraryOptions:s,target:r}=n??{},a=En({...s??{},target:r,io:t,processors:i});return xe(e,a),In(a,e),Cn(a,e)},bo={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Do=(e,t,i,n)=>{const s=i;s.type="string";const{minimum:r,maximum:a,format:o,patterns:l,contentEncoding:d}=e._zod.bag;if(typeof r=="number"&&(s.minLength=r),typeof a=="number"&&(s.maxLength=a),o&&(s.format=bo[o]??o,s.format===""&&delete s.format,o==="time"&&delete s.format),d&&(s.contentEncoding=d),l&&l.size>0){const c=[...l];c.length===1?s.pattern=c[0].source:c.length>1&&(s.allOf=[...c.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},vo=(e,t,i,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},wo=(e,t,i,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},_o=(e,t,i,n)=>{const s=i,r=e._zod.def,{minimum:a,maximum:o}=e._zod.bag;typeof a=="number"&&(s.minItems=a),typeof o=="number"&&(s.maxItems=o),s.type="array",s.items=xe(r.element,t,{...n,path:[...n.path,"items"]})},ko=(e,t,i,n)=>{const s=e._zod.def,r=s.inclusive===!1,a=s.options.map((o,l)=>xe(o,t,{...n,path:[...n.path,r?"oneOf":"anyOf",l]}));r?i.oneOf=a:i.anyOf=a},$o=(e,t,i,n)=>{const s=e._zod.def,r=xe(s.left,t,{...n,path:[...n.path,"allOf",0]}),a=xe(s.right,t,{...n,path:[...n.path,"allOf",1]}),o=d=>"allOf"in d&&Object.keys(d).length===1,l=[...o(r)?r.allOf:[r],...o(a)?a.allOf:[a]];i.allOf=l},So=(e,t,i,n)=>{const s=e._zod.def,r=xe(s.innerType,t,n),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=s.innerType,i.nullable=!0):i.anyOf=[r,{type:"null"}]},Ao=(e,t,i,n)=>{const s=e._zod.def;xe(s.innerType,t,n);const r=t.seen.get(e);r.ref=s.innerType},Oo=(e,t,i,n)=>{const s=e._zod.def;xe(s.innerType,t,n);const r=t.seen.get(e);r.ref=s.innerType,i.default=JSON.parse(JSON.stringify(s.defaultValue))},Eo=(e,t,i,n)=>{const s=e._zod.def;xe(s.innerType,t,n);const r=t.seen.get(e);r.ref=s.innerType,t.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},Io=(e,t,i,n)=>{const s=e._zod.def;xe(s.innerType,t,n);const r=t.seen.get(e);r.ref=s.innerType;let a;try{a=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=a},Co=(e,t,i,n)=>{const s=e._zod.def,r=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;xe(r,t,n);const a=t.seen.get(e);a.ref=r},To=(e,t,i,n)=>{const s=e._zod.def;xe(s.innerType,t,n);const r=t.seen.get(e);r.ref=s.innerType,i.readOnly=!0},Tn=(e,t,i,n)=>{const s=e._zod.def;xe(s.innerType,t,n);const r=t.seen.get(e);r.ref=s.innerType},Po=b("ZodISODateTime",(e,t)=>{br.init(e,t),oi.init(e,t)});function xo(e){return Wr(Po,e)}const Mo=b("ZodISODate",(e,t)=>{Dr.init(e,t),oi.init(e,t)});function Lo(e){return Gr(Mo,e)}const No=b("ZodISOTime",(e,t)=>{vr.init(e,t),oi.init(e,t)});function zo(e){return Yr(No,e)}const Fo=b("ZodISODuration",(e,t)=>{wr.init(e,t),oi.init(e,t)});function Ro(e){return Kr(Fo,e)}const We=b("ZodError",(e,t)=>{an.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>Ca(e,i)},flatten:{value:i=>Ia(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,bi,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,bi,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Bo=Qt(We),jo=ei(We),Zo=ti(We),qo=ii(We),Vo=xa(We),Uo=Ma(We),Ho=La(We),Wo=Na(We),Go=za(We),Yo=Fa(We),Ko=Ra(We),Jo=Ba(We),Le=b("ZodType",(e,t)=>(de.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ri(e,"input"),output:ri(e,"output")}}),e.toJSONSchema=go(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...i)=>e.clone(Sa(t,{checks:[...t.checks??[],...i.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(i,n)=>nn(e,i,n),e.brand=()=>e,e.register=((i,n)=>(i.add(e,n),e)),e.parse=(i,n)=>Bo(e,i,n,{callee:e.parse}),e.safeParse=(i,n)=>Zo(e,i,n),e.parseAsync=async(i,n)=>jo(e,i,n,{callee:e.parseAsync}),e.safeParseAsync=async(i,n)=>qo(e,i,n),e.spa=e.safeParseAsync,e.encode=(i,n)=>Vo(e,i,n),e.decode=(i,n)=>Uo(e,i,n),e.encodeAsync=async(i,n)=>Ho(e,i,n),e.decodeAsync=async(i,n)=>Wo(e,i,n),e.safeEncode=(i,n)=>Go(e,i,n),e.safeDecode=(i,n)=>Yo(e,i,n),e.safeEncodeAsync=async(i,n)=>Ko(e,i,n),e.safeDecodeAsync=async(i,n)=>Jo(e,i,n),e.refine=(i,n)=>e.check(kl(i,n)),e.superRefine=i=>e.check($l(i)),e.overwrite=i=>e.check($t(i)),e.optional=()=>Pn(e),e.exactOptional=()=>dl(e),e.nullable=()=>xn(e),e.nullish=()=>Pn(xn(e)),e.nonoptional=i=>fl(e,i),e.array=()=>el(e),e.or=i=>il([e,i]),e.and=i=>sl(e,i),e.transform=i=>Mn(e,rl(i)),e.default=i=>hl(e,i),e.prefault=i=>ml(e,i),e.catch=i=>bl(e,i),e.pipe=i=>Mn(e,i),e.readonly=()=>wl(e),e.describe=i=>{const n=e.clone();return Nt.add(n,{description:i}),n},Object.defineProperty(e,"description",{get(){return Nt.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return Nt.get(e);const n=e.clone();return Nt.add(n,i[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),Xo=b("_ZodString",(e,t)=>{$i.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(n,s,r)=>Do(e,n,s);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...n)=>e.check(Sn(...n)),e.includes=(...n)=>e.check(ao(...n)),e.startsWith=(...n)=>e.check(ro(...n)),e.endsWith=(...n)=>e.check(oo(...n)),e.min=(...n)=>e.check(kt(...n)),e.max=(...n)=>e.check(ai(...n)),e.length=(...n)=>e.check($n(...n)),e.nonempty=(...n)=>e.check(kt(1,...n)),e.lowercase=n=>e.check(no(n)),e.uppercase=n=>e.check(so(n)),e.trim=()=>e.check(uo()),e.normalize=(...n)=>e.check(lo(...n)),e.toLowerCase=()=>e.check(co()),e.toUpperCase=()=>e.check(ho()),e.slugify=()=>e.check(po())}),oi=b("ZodStringFormat",(e,t)=>{He.init(e,t),Xo.init(e,t)}),Qo=b("ZodArray",(e,t)=>{mn.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(i,n,s)=>_o(e,i,n,s),e.element=t.element,e.min=(i,n)=>e.check(kt(i,n)),e.nonempty=i=>e.check(kt(1,i)),e.max=(i,n)=>e.check(ai(i,n)),e.length=(i,n)=>e.check($n(i,n)),e.unwrap=()=>e.element});function el(e,t){return mo(Qo,e,t)}const tl=b("ZodUnion",(e,t)=>{Er.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(i,n,s)=>ko(e,i,n,s),e.options=t.options});function il(e,t){return new tl({type:"union",options:e,...L(t)})}const nl=b("ZodIntersection",(e,t)=>{Ir.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(i,n,s)=>$o(e,i,n,s)});function sl(e,t){return new nl({type:"intersection",left:e,right:t})}const al=b("ZodTransform",(e,t)=>{Cr.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(i,n,s)=>wo(e,i),e._zod.parse=(i,n)=>{if(n.direction==="backward")throw new Ji(e.constructor.name);i.addIssue=r=>{if(typeof r=="string")i.issues.push(Lt(r,i.value,t));else{const a=r;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=i.value),a.inst??(a.inst=e),i.issues.push(Lt(a))}};const s=t.transform(i.value,i);return s instanceof Promise?s.then(r=>(i.value=r,i)):(i.value=s,i)}});function rl(e){return new al({type:"transform",transform:e})}const ol=b("ZodOptional",(e,t)=>{Ai.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(i,n,s)=>Tn(e,i,n,s),e.unwrap=()=>e._zod.def.innerType});function Pn(e){return new ol({type:"optional",innerType:e})}const ll=b("ZodExactOptional",(e,t)=>{Tr.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(i,n,s)=>Tn(e,i,n,s),e.unwrap=()=>e._zod.def.innerType});function dl(e){return new ll({type:"optional",innerType:e})}const ul=b("ZodNullable",(e,t)=>{Pr.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(i,n,s)=>So(e,i,n,s),e.unwrap=()=>e._zod.def.innerType});function xn(e){return new ul({type:"nullable",innerType:e})}const cl=b("ZodDefault",(e,t)=>{xr.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(i,n,s)=>Oo(e,i,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function hl(e,t){return new cl({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():tn(t)}})}const pl=b("ZodPrefault",(e,t)=>{Mr.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(i,n,s)=>Eo(e,i,n,s),e.unwrap=()=>e._zod.def.innerType});function ml(e,t){return new pl({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():tn(t)}})}const yl=b("ZodNonOptional",(e,t)=>{Lr.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(i,n,s)=>Ao(e,i,n,s),e.unwrap=()=>e._zod.def.innerType});function fl(e,t){return new yl({type:"nonoptional",innerType:e,...L(t)})}const gl=b("ZodCatch",(e,t)=>{Nr.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(i,n,s)=>Io(e,i,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function bl(e,t){return new gl({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Dl=b("ZodPipe",(e,t)=>{zr.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(i,n,s)=>Co(e,i,n,s),e.in=t.in,e.out=t.out});function Mn(e,t){return new Dl({type:"pipe",in:e,out:t})}const vl=b("ZodReadonly",(e,t)=>{Fr.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(i,n,s)=>To(e,i,n,s),e.unwrap=()=>e._zod.def.innerType});function wl(e){return new vl({type:"readonly",innerType:e})}const _l=b("ZodCustom",(e,t)=>{wn.init(e,t),Le.init(e,t),e._zod.processJSONSchema=(i,n,s)=>vo(e,i)});function kl(e,t={}){return An(_l,e,t)}function $l(e){return On(e)}const ht=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");de.init(e,t),e.def=t,e.type=t.type,e.parse=(i,n)=>Ta(e,i,n,{callee:e.parse}),e.safeParse=(i,n)=>rn(e,i,n),e.parseAsync=async(i,n)=>Pa(e,i,n,{callee:e.parseAsync}),e.safeParseAsync=async(i,n)=>on(e,i,n),e.check=(...i)=>e.clone({...t,checks:[...t.checks??[],...i.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(i,n)=>nn(e,i,n),e.brand=()=>e,e.register=((i,n)=>(i.add(e,n),e)),e.apply=i=>i(e)}),Ln=b("ZodMiniString",(e,t)=>{$i.init(e,t),ht.init(e,t)});function Nn(e){return jr(Ln,e)}const St=b("ZodMiniStringFormat",(e,t)=>{He.init(e,t),Ln.init(e,t)}),Sl=b("ZodMiniEmail",(e,t)=>{fr.init(e,t),St.init(e,t)});function Al(e){return Zr(Sl,e)}const Ol=b("ZodMiniUUID",(e,t)=>{yr.init(e,t),St.init(e,t)});function El(e){return qr(Ol,e)}const Il=b("ZodMiniURL",(e,t)=>{gr.init(e,t),St.init(e,t)});function Cl(e){return Vr(Il,e)}const Tl=b("ZodMiniIPv4",(e,t)=>{_r.init(e,t),St.init(e,t)});function Pl(e){return Ur(Tl,e)}const xl=b("ZodMiniIPv6",(e,t)=>{kr.init(e,t),St.init(e,t)});function Ml(e){return Hr(xl,e)}const Ll=b("ZodMiniCustomStringFormat",(e,t)=>{$r.init(e,t),St.init(e,t)});function Nl(e){return fo(Ll,"hostname",Ua,e)}const zn=b("ZodMiniNumber",(e,t)=>{hn.init(e,t),ht.init(e,t)});function Fn(e){return Jr(zn,e)}const zl=b("ZodMiniNumberFormat",(e,t)=>{Sr.init(e,t),zn.init(e,t)});function Fl(e){return Xr(zl,e)}const Rl=b("ZodMiniBoolean",(e,t)=>{Ar.init(e,t),ht.init(e,t)});function Rn(e){return Qr(Rl,e)}const Bl=b("ZodMiniAny",(e,t)=>{Or.init(e,t),ht.init(e,t)});function Oi(){return eo(Bl)}const jl=b("ZodMiniArray",(e,t)=>{mn.init(e,t),ht.init(e,t)});function Bn(e,t){return new jl({type:"array",element:e,...L(t)})}const Zl=b("ZodMiniOptional",(e,t)=>{Ai.init(e,t),ht.init(e,t)});function ql(e){return new Zl({type:"optional",innerType:e})}const Vl=b("ZodMiniCustom",(e,t)=>{wn.init(e,t),ht.init(e,t)});function _e(e,t={}){return An(Vl,e,t)}function jn(e){return On(e)}const Ei={email:{schema:Al()},hostname:{schema:Nl()},ipv4:{schema:Pl()},ipv6:{schema:Ml()},url:{schema:Cl()},uuid:{schema:El()},date:{schema:Lo()},time:{schema:zo()},"date-time":{schema:xo()},duration:{schema:Ro()}},Ul=Object.keys(Ei),Hl=e=>(t,i)=>{switch(t.type){case"string":return Wl(t,i);case"integer":case"number":return Yl(t,i);case"boolean":return Kl(t,i);case"array":return Jl(t,i);case"custom":{if(!e)throw new Error('Validator type "custom" requires a customValidators object, but it was not supplied.');return Xl(t,e)}}};function Q(e,t){if(e!==void 0)return typeof e=="string"?e:t?.translate(e.key,e.params,e.default)??e.default}function Wl(e,t){return zt(e,i=>{const n=Q(i.messages?.invalid,t);let s=n?Nn(n):Nn();if(i.required===!0){const r=Q(i.messages?.required,t)??"This field is required";s=s.check(_e(a=>a.length>0,{error:r}))}if(typeof i.minLength=="number"){const r=Q(i.messages?.minLength,t),a=i.minLength;s=s.check(r?_e(o=>o.length>=a,{error:r}):kt(a))}if(typeof i.maxLength=="number"){const r=Q(i.messages?.maxLength,t),a=i.maxLength;s=s.check(r?_e(o=>o.length<=a,{error:r}):ai(a))}if(typeof i.pattern=="string"){const r=Q(i.messages?.pattern,t),a=new RegExp(i.pattern);s=s.check(r?_e(o=>a.test(o),{error:r}):Sn(a))}if(i.enum){const r=i.enum,a=Q(i.messages?.enum,t);s=s.check(_e(o=>r.includes(o),a?{error:a}:void 0))}if(i.const!==void 0){const r=Q(i.messages?.const,t);s=s.check(_e(a=>a===i.const,r?{error:r}:void 0))}if(i.format!==void 0)if(Ul.includes(i.format)){const r=Q(i.messages?.format,t);s=s.check(r?jn((a,o)=>{const l=vt.standardValidate(Ei[i.format].schema,a);vt.isStandardValidateSuccess(l)||o.addIssue({code:"custom",path:[],message:r})}):Ei[i.format].schema)}else console.error(`The string validation format "${i.format}" is not supported`);return s})}const Gl=(e,t)=>{if(t===0)return!1;const i=e/t;return Math.abs(i-Math.round(i))<1e-10};function Yl(e,t){return zt(e,i=>{const n=Q(i.messages?.invalid,t);let s=n?Fn(n):Fn();if(i.type==="integer"&&(s=s.check(Fl())),i.minimum!==void 0){const r=Q(i.messages?.minimum,t),a=i.minimum;s=s.check(r?_e(o=>o>=a,{error:r}):io(a))}if(i.maximum!==void 0){const r=Q(i.messages?.maximum,t),a=i.maximum;s=s.check(r?_e(o=>o<=a,{error:r}):to(a))}if(i.exclusiveMinimum!==void 0){const r=Q(i.messages?.exclusiveMinimum,t),a=i.exclusiveMinimum;s=s.check(_e(o=>o>a,r?{error:r}:void 0))}if(i.exclusiveMaximum!==void 0){const r=Q(i.messages?.exclusiveMaximum,t),a=i.exclusiveMaximum;s=s.check(_e(o=>o<a,r?{error:r}:void 0))}if(i.multipleOf!==void 0){const r=Q(i.messages?.multipleOf,t),a=i.multipleOf;s=s.check(_e(o=>Gl(o,a),r?{error:r}:void 0))}if(i.enum){const r=i.enum,a=Q(i.messages?.enum,t);s=s.check(_e(o=>r.includes(o),a?{error:a}:void 0))}if(i.const!==void 0){const r=Q(i.messages?.const,t);s=s.check(_e(a=>a===i.const,r?{error:r}:void 0))}return s})}function Kl(e,t){return zt(e,i=>{const n=Q(i.messages?.invalid,t);let s=n?Rn(n):Rn();if(i.const!==void 0){const r=Q(i.messages?.const,t);s=s.check(_e(a=>a===i.const,r?{error:r}:void 0))}return s})}function Jl(e,t){return zt(e,i=>{const n=Q(i.messages?.invalid,t);let s=n?Bn(Oi(),n):Bn(Oi());if(i.required===!0){const r=Q(i.messages?.required,t)??"This field is required";s=s.check(_e(a=>a.length>0,{error:r}))}if(typeof i.minItems=="number"){const r=Q(i.messages?.minItems,t),a=i.minItems;s=s.check(r?_e(o=>o.length>=a,{error:r}):kt(a))}if(typeof i.maxItems=="number"){const r=Q(i.messages?.maxItems,t),a=i.maxItems;s=s.check(r?_e(o=>o.length<=a,{error:r}):ai(a))}return s})}function Xl(e,t){return zt(e,i=>{let n=Oi();return vt.filterTap(Object.keys(i),s=>s!=="type"&&s!=="required",s=>{const r=i[s],a=t[s],o=a(r);n=n.check(jn((l,d)=>{const c=vt.standardValidate(o,l);if(!vt.isStandardValidateSuccess(c)){const h=c.issues[0];d.addIssue({code:"custom",path:[],message:h?.message||`Validation failed for ${s}`})}}))}),n})}function zt(e,t){const i=t(e);return e.required?i:ql(i)}function Ql({config:e,formHealth:t=void 0,formEvent:i=void 0,autocomplete:n,ref:s}){const r=g.useMemo(()=>_a(e.formDef,e.formSelectors,e.formConfig),[e]),a={formDef:r.formDef,widgetLoaders:{...Zi,...r.widgetLoaders,...e.customWidgetLoaders??{}},dependencies:{...r.dependencies??{},...e.dependencies??{}},validateOn:e.validateOn??r.validateOn??"eager",itemRenderers:{...r.itemRenderers??{},...e.itemRenderers??{}},localization:e.localization,middlewares:e.middlewares??[],data:e.data,meta:e.meta,formName:e.formName},o=Hl({...e.customValidators??{}}),l=r.formEvent&&i?d=>{r.formEvent?.(d),i(d)}:i??r.formEvent;return y.jsx(x.FormComponent,{ref:s,config:a,validators:o,autocomplete:n,formHealth:t,formEvent:l})}const li=globalThis,Ii=li.ShadowRoot&&(li.ShadyCSS===void 0||li.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Zn=Symbol(),qn=new WeakMap;let ed=class{constructor(t,i,n){if(this._$cssResult$=!0,n!==Zn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=i}get styleSheet(){let t=this.o;const i=this.t;if(Ii&&t===void 0){const n=i!==void 0&&i.length===1;n&&(t=qn.get(i)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&qn.set(i,t))}return t}toString(){return this.cssText}};const td=e=>new ed(typeof e=="string"?e:e+"",void 0,Zn),id=(e,t)=>{if(Ii)e.adoptedStyleSheets=t.map(i=>i instanceof CSSStyleSheet?i:i.styleSheet);else for(const i of t){const n=document.createElement("style"),s=li.litNonce;s!==void 0&&n.setAttribute("nonce",s),n.textContent=i.cssText,e.appendChild(n)}},Vn=Ii?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let i="";for(const n of t.cssRules)i+=n.cssText;return td(i)})(e):e;const{is:nd,defineProperty:sd,getOwnPropertyDescriptor:ad,getOwnPropertyNames:rd,getOwnPropertySymbols:od,getPrototypeOf:ld}=Object,di=globalThis,Un=di.trustedTypes,dd=Un?Un.emptyScript:"",ud=di.reactiveElementPolyfillSupport,Ft=(e,t)=>e,ui={toAttribute(e,t){switch(t){case Boolean:e=e?dd:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=e!==null;break;case Number:i=e===null?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch{i=null}}return i}},Ci=(e,t)=>!nd(e,t),Hn={attribute:!0,type:String,converter:ui,reflect:!1,useDefault:!1,hasChanged:Ci};Symbol.metadata??=Symbol("metadata"),di.litPropertyMetadata??=new WeakMap;let At=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,i=Hn){if(i.state&&(i.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((i=Object.create(i)).wrapped=!0),this.elementProperties.set(t,i),!i.noAccessor){const n=Symbol(),s=this.getPropertyDescriptor(t,n,i);s!==void 0&&sd(this.prototype,t,s)}}static getPropertyDescriptor(t,i,n){const{get:s,set:r}=ad(this.prototype,t)??{get(){return this[i]},set(a){this[i]=a}};return{get:s,set(a){const o=s?.call(this);r?.call(this,a),this.requestUpdate(t,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Hn}static _$Ei(){if(this.hasOwnProperty(Ft("elementProperties")))return;const t=ld(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Ft("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ft("properties"))){const i=this.properties,n=[...rd(i),...od(i)];for(const s of n)this.createProperty(s,i[s])}const t=this[Symbol.metadata];if(t!==null){const i=litPropertyMetadata.get(t);if(i!==void 0)for(const[n,s]of i)this.elementProperties.set(n,s)}this._$Eh=new Map;for(const[i,n]of this.elementProperties){const s=this._$Eu(i,n);s!==void 0&&this._$Eh.set(s,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const s of n)i.unshift(Vn(s))}else t!==void 0&&i.push(Vn(t));return i}static _$Eu(t,i){const n=i.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,i=this.constructor.elementProperties;for(const n of i.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return id(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,i,n){this._$AK(t,n)}_$ET(t,i){const n=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,n);if(s!==void 0&&n.reflect===!0){const r=(n.converter?.toAttribute!==void 0?n.converter:ui).toAttribute(i,n.type);this._$Em=t,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(t,i){const n=this.constructor,s=n._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const r=n.getPropertyOptions(s),a=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:ui;this._$Em=s;const o=a.fromAttribute(i,r.type);this[s]=o??this._$Ej?.get(s)??o,this._$Em=null}}requestUpdate(t,i,n,s=!1,r){if(t!==void 0){const a=this.constructor;if(s===!1&&(r=this[t]),n??=a.getPropertyOptions(t),!((n.hasChanged??Ci)(r,i)||n.useDefault&&n.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(a._$Eu(t,n))))return;this.C(t,i,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,i,{useDefault:n,reflect:s,wrapped:r},a){n&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,a??i??this[t]),r!==!0||a!==void 0)||(this._$AL.has(t)||(this.hasUpdated||n||(i=void 0),this._$AL.set(t,i)),s===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[s,r]of this._$Ep)this[s]=r;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[s,r]of n){const{wrapped:a}=r,o=this[s];a!==!0||this._$AL.has(s)||o===void 0||this.C(s,void 0,r,o)}}let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),this._$EO?.forEach(n=>n.hostUpdate?.()),this.update(i)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(i)}willUpdate(t){}_$AE(t){this._$EO?.forEach(i=>i.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(i=>this._$ET(i,this[i])),this._$EM()}updated(t){}firstUpdated(t){}};At.elementStyles=[],At.shadowRootOptions={mode:"open"},At[Ft("elementProperties")]=new Map,At[Ft("finalized")]=new Map,ud?.({ReactiveElement:At}),(di.reactiveElementVersions??=[]).push("2.1.2");const Ti=globalThis,Wn=e=>e,ci=Ti.trustedTypes,Gn=ci?ci.createPolicy("lit-html",{createHTML:e=>e}):void 0,Yn="$lit$",ot=`lit$${Math.random().toFixed(9).slice(2)}$`,Kn="?"+ot,cd=`<${Kn}>`,pt=document,Rt=()=>pt.createComment(""),Bt=e=>e===null||typeof e!="object"&&typeof e!="function",Pi=Array.isArray,hd=e=>Pi(e)||typeof e?.[Symbol.iterator]=="function",xi=`[
4
+ \f\r]`,jt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Jn=/-->/g,Xn=/>/g,mt=RegExp(`>|${xi}(?:([^\\s"'>=/]+)(${xi}*=${xi}*(?:[^
5
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Qn=/'/g,es=/"/g,ts=/^(?:script|style|textarea|title)$/i,pd=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),v=pd(1),ze=Symbol.for("lit-noChange"),_=Symbol.for("lit-nothing"),is=new WeakMap,yt=pt.createTreeWalker(pt,129);function ns(e,t){if(!Pi(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Gn!==void 0?Gn.createHTML(t):t}const md=(e,t)=>{const i=e.length-1,n=[];let s,r=t===2?"<svg>":t===3?"<math>":"",a=jt;for(let o=0;o<i;o++){const l=e[o];let d,c,h=-1,p=0;for(;p<l.length&&(a.lastIndex=p,c=a.exec(l),c!==null);)p=a.lastIndex,a===jt?c[1]==="!--"?a=Jn:c[1]!==void 0?a=Xn:c[2]!==void 0?(ts.test(c[2])&&(s=RegExp("</"+c[2],"g")),a=mt):c[3]!==void 0&&(a=mt):a===mt?c[0]===">"?(a=s??jt,h=-1):c[1]===void 0?h=-2:(h=a.lastIndex-c[2].length,d=c[1],a=c[3]===void 0?mt:c[3]==='"'?es:Qn):a===es||a===Qn?a=mt:a===Jn||a===Xn?a=jt:(a=mt,s=void 0);const m=a===mt&&e[o+1].startsWith("/>")?" ":"";r+=a===jt?l+cd:h>=0?(n.push(d),l.slice(0,h)+Yn+l.slice(h)+ot+m):l+ot+(h===-2?o:m)}return[ns(e,r+(e[i]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),n]};class Zt{constructor({strings:t,_$litType$:i},n){let s;this.parts=[];let r=0,a=0;const o=t.length-1,l=this.parts,[d,c]=md(t,i);if(this.el=Zt.createElement(d,n),yt.currentNode=this.el.content,i===2||i===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=yt.nextNode())!==null&&l.length<o;){if(s.nodeType===1){if(s.hasAttributes())for(const h of s.getAttributeNames())if(h.endsWith(Yn)){const p=c[a++],m=s.getAttribute(h).split(ot),f=/([.?@])?(.*)/.exec(p);l.push({type:1,index:r,name:f[2],strings:m,ctor:f[1]==="."?fd:f[1]==="?"?gd:f[1]==="@"?bd:hi}),s.removeAttribute(h)}else h.startsWith(ot)&&(l.push({type:6,index:r}),s.removeAttribute(h));if(ts.test(s.tagName)){const h=s.textContent.split(ot),p=h.length-1;if(p>0){s.textContent=ci?ci.emptyScript:"";for(let m=0;m<p;m++)s.append(h[m],Rt()),yt.nextNode(),l.push({type:2,index:++r});s.append(h[p],Rt())}}}else if(s.nodeType===8)if(s.data===Kn)l.push({type:2,index:r});else{let h=-1;for(;(h=s.data.indexOf(ot,h+1))!==-1;)l.push({type:7,index:r}),h+=ot.length-1}r++}}static createElement(t,i){const n=pt.createElement("template");return n.innerHTML=t,n}}function Ot(e,t,i=e,n){if(t===ze)return t;let s=n!==void 0?i._$Co?.[n]:i._$Cl;const r=Bt(t)?void 0:t._$litDirective$;return s?.constructor!==r&&(s?._$AO?.(!1),r===void 0?s=void 0:(s=new r(e),s._$AT(e,i,n)),n!==void 0?(i._$Co??=[])[n]=s:i._$Cl=s),s!==void 0&&(t=Ot(e,s._$AS(e,t.values),s,n)),t}class yd{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:n}=this._$AD,s=(t?.creationScope??pt).importNode(i,!0);yt.currentNode=s;let r=yt.nextNode(),a=0,o=0,l=n[0];for(;l!==void 0;){if(a===l.index){let d;l.type===2?d=new Et(r,r.nextSibling,this,t):l.type===1?d=new l.ctor(r,l.name,l.strings,this,t):l.type===6&&(d=new Dd(r,this,t)),this._$AV.push(d),l=n[++o]}a!==l?.index&&(r=yt.nextNode(),a++)}return yt.currentNode=pt,s}p(t){let i=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(t,n,i),i+=n.strings.length-2):n._$AI(t[i])),i++}}class Et{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,n,s){this.type=2,this._$AH=_,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=n,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return i!==void 0&&t?.nodeType===11&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=Ot(this,t,i),Bt(t)?t===_||t==null||t===""?(this._$AH!==_&&this._$AR(),this._$AH=_):t!==this._$AH&&t!==ze&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):hd(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==_&&Bt(this._$AH)?this._$AA.nextSibling.data=t:this.T(pt.createTextNode(t)),this._$AH=t}$(t){const{values:i,_$litType$:n}=t,s=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=Zt.createElement(ns(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(i);else{const r=new yd(s,this),a=r.u(this.options);r.p(i),this.T(a),this._$AH=r}}_$AC(t){let i=is.get(t.strings);return i===void 0&&is.set(t.strings,i=new Zt(t)),i}k(t){Pi(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let n,s=0;for(const r of t)s===i.length?i.push(n=new Et(this.O(Rt()),this.O(Rt()),this,this.options)):n=i[s],n._$AI(r),s++;s<i.length&&(this._$AR(n&&n._$AB.nextSibling,s),i.length=s)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t!==this._$AB;){const n=Wn(t).nextSibling;Wn(t).remove(),t=n}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class hi{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,n,s,r){this.type=1,this._$AH=_,this._$AN=void 0,this.element=t,this.name=i,this._$AM=s,this.options=r,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=_}_$AI(t,i=this,n,s){const r=this.strings;let a=!1;if(r===void 0)t=Ot(this,t,i,0),a=!Bt(t)||t!==this._$AH&&t!==ze,a&&(this._$AH=t);else{const o=t;let l,d;for(t=r[0],l=0;l<r.length-1;l++)d=Ot(this,o[n+l],i,l),d===ze&&(d=this._$AH[l]),a||=!Bt(d)||d!==this._$AH[l],d===_?t=_:t!==_&&(t+=(d??"")+r[l+1]),this._$AH[l]=d}a&&!s&&this.j(t)}j(t){t===_?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class fd extends hi{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===_?void 0:t}}class gd extends hi{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==_)}}class bd extends hi{constructor(t,i,n,s,r){super(t,i,n,s,r),this.type=5}_$AI(t,i=this){if((t=Ot(this,t,i,0)??_)===ze)return;const n=this._$AH,s=t===_&&n!==_||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,r=t!==_&&(n===_||s);s&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class Dd{constructor(t,i,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){Ot(this,t)}}const vd={I:Et},wd=Ti.litHtmlPolyfillSupport;wd?.(Zt,Et),(Ti.litHtmlVersions??=[]).push("3.3.2");const _d=(e,t,i)=>{const n=i?.renderBefore??t;let s=n._$litPart$;if(s===void 0){const r=i?.renderBefore??null;n._$litPart$=s=new Et(t.insertBefore(Rt(),r),r,void 0,i??{})}return s._$AI(e),s};const Mi=globalThis;let ee=class extends At{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=_d(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ze}};ee._$litElement$=!0,ee.finalized=!0,Mi.litElementHydrateSupport?.({LitElement:ee});const kd=Mi.litElementPolyfillSupport;kd?.({LitElement:ee}),(Mi.litElementVersions??=[]).push("4.2.2");const ue=e=>(t,i)=>{i!==void 0?i.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)};const $d={attribute:!0,type:String,converter:ui,reflect:!1,hasChanged:Ci},Sd=(e=$d,t,i)=>{const{kind:n,metadata:s}=i;let r=globalThis.litPropertyMetadata.get(s);if(r===void 0&&globalThis.litPropertyMetadata.set(s,r=new Map),n==="setter"&&((e=Object.create(e)).wrapped=!0),r.set(i.name,e),n==="accessor"){const{name:a}=i;return{set(o){const l=t.get.call(this);t.set.call(this,o),this.requestUpdate(a,l,e,!0,o)},init(o){return o!==void 0&&this.C(a,void 0,e,o),o}}}if(n==="setter"){const{name:a}=i;return function(o){const l=this[a];t.call(this,o),this.requestUpdate(a,l,e,!0,o)}}throw Error("Unsupported decorator location: "+n)};function u(e){return(t,i)=>typeof i=="object"?Sd(e,t,i):((n,s,r)=>{const a=s.hasOwnProperty(r);return s.constructor.createProperty(r,n),a?Object.getOwnPropertyDescriptor(s,r):void 0})(e,t,i)}function Y(e){return u({...e,state:!0,attribute:!1})}const Ad=(e,t,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(e,t,i),i);function ss(e,t){return(i,n,s)=>{const r=a=>a.renderRoot?.querySelector(e)??null;return Ad(i,n,{get(){return r(this)}})}}const tt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},qt=e=>(...t)=>({_$litDirective$:e,values:t});let Vt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,n){this._$Ct=t,this._$AM=i,this._$Ci=n}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}};const fe=qt(class extends Vt{constructor(e){if(super(e),e.type!==tt.ATTRIBUTE||e.name!=="class"||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(n=>n!=="")));for(const n in t)t[n]&&!this.nt?.has(n)&&this.st.add(n);return this.render(t)}const i=e.element.classList;for(const n of this.st)n in t||(i.remove(n),this.st.delete(n));for(const n in t){const s=!!t[n];s===this.st.has(n)||this.nt?.has(n)||(s?(i.add(n),this.st.add(n)):(i.remove(n),this.st.delete(n)))}return ze}});var Od=Object.defineProperty,Ed=Object.getOwnPropertyDescriptor,ft=(e,t,i,n)=>{for(var s=n>1?void 0:n?Ed(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&Od(t,i,s),s};let at=class extends ee{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.disabled=!1,this.icon=void 0,this.variant="filled",this.iconPosition="left"}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){const e=this.icon,t=this.iconPosition||"left",i={"gui-button-with-icon":!!e,[`gui-button-icon-${t}`]:!0,"gui-button--outlined":this.variant==="outlined","gui-button--link":this.variant==="link"},n=e?v`<span class="gui-widget-icon gui-button-icon ${e}" data-icon=${e}></span>`:_;return v`
6
+ <div class="gui-widget">
7
+ <button
8
+ type="button"
9
+ tabindex="0"
10
+ id=${this.uid}
11
+ class=${fe(i)}
12
+ data-cy=${`${this.uid}_button`}
13
+ ?disabled=${this.disabled}
14
+ >
15
+ ${t==="left"?n:_}
16
+ ${this.label?v`<span>${this.label}</span>`:_}
17
+ ${t==="right"?n:_}
18
+ </button>
19
+ </div>
20
+ `}};ft([u({type:String})],at.prototype,"uid",2),ft([u({type:String})],at.prototype,"label",2),ft([u({type:Boolean})],at.prototype,"disabled",2),ft([u({type:String})],at.prototype,"icon",2),ft([u({type:String})],at.prototype,"variant",2),ft([u({type:String})],at.prototype,"iconPosition",2),at=ft([ue("gui-button")],at),typeof customElements<"u"&&!customElements.get("gui-button")&&customElements.define("gui-button",at);function Id(e){const t=e.widget,{uid:i,templateData:n,onClick:s}=x.useActionWidget(t);return y.jsx("div",{className:"gui-button gui-field",style:{flex:n.size},children:y.jsx("gui-button",{uid:i,label:n.label,disabled:n.disabled,variant:n.variant,icon:n.icon,iconPosition:n.iconPosition,onClick:s})})}const Cd=Object.freeze(Object.defineProperty({__proto__:null,Button:Id},Symbol.toStringTag,{value:"Module"})),Td={aa:{firstDay:7,weekend:[6,7],minimalDays:1},"aa-DJ":{firstDay:6,weekend:[6,7],minimalDays:1},"aa-ER":{firstDay:1,weekend:[6,7],minimalDays:1},ab:{firstDay:1,weekend:[6,7],minimalDays:1},af:{firstDay:7,weekend:[6,7],minimalDays:1},"af-NA":{firstDay:1,weekend:[6,7],minimalDays:1},agq:{firstDay:1,weekend:[6,7],minimalDays:1},ak:{firstDay:1,weekend:[6,7],minimalDays:1},am:{firstDay:7,weekend:[6,7],minimalDays:1},an:{firstDay:1,weekend:[6,7],minimalDays:4},ann:{firstDay:1,weekend:[6,7],minimalDays:1},apc:{firstDay:6,weekend:[5,6],minimalDays:1},ar:{firstDay:6,weekend:[5,6],minimalDays:1},"ar-AE":{firstDay:6,weekend:[6,7],minimalDays:1},"ar-BH":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-DJ":{firstDay:6,weekend:[6,7],minimalDays:1},"ar-DZ":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-EG":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-EH":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-ER":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-IL":{firstDay:7,weekend:[5,6],minimalDays:1},"ar-IQ":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-JO":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-KM":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-KW":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-LB":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-LY":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-MA":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-MR":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-OM":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-PS":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-QA":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-SA":{firstDay:7,weekend:[5,6],minimalDays:1},"ar-SD":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-SO":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-SS":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-SY":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-TD":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-TN":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-YE":{firstDay:7,weekend:[5,6],minimalDays:1},arn:{firstDay:1,weekend:[6,7],minimalDays:1},as:{firstDay:7,weekend:[7],minimalDays:1},asa:{firstDay:1,weekend:[6,7],minimalDays:1},ast:{firstDay:1,weekend:[6,7],minimalDays:4},az:{firstDay:1,weekend:[6,7],minimalDays:1},"az-Arab":{firstDay:6,weekend:[5],minimalDays:1},"az-Arab-IQ":{firstDay:6,weekend:[5,6],minimalDays:1},"az-Arab-TR":{firstDay:1,weekend:[6,7],minimalDays:1},"az-Cyrl":{firstDay:1,weekend:[6,7],minimalDays:1},"az-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},ba:{firstDay:1,weekend:[6,7],minimalDays:4},bal:{firstDay:7,weekend:[6,7],minimalDays:1},"bal-Arab":{firstDay:7,weekend:[6,7],minimalDays:1},"bal-Latn":{firstDay:7,weekend:[6,7],minimalDays:1},bas:{firstDay:1,weekend:[6,7],minimalDays:1},be:{firstDay:1,weekend:[6,7],minimalDays:1},"be-tarask":{firstDay:1,weekend:[6,7],minimalDays:1},bem:{firstDay:1,weekend:[6,7],minimalDays:1},bew:{firstDay:7,weekend:[6,7],minimalDays:1},bez:{firstDay:1,weekend:[6,7],minimalDays:1},bg:{firstDay:1,weekend:[6,7],minimalDays:4},bgc:{firstDay:7,weekend:[7],minimalDays:1},bgn:{firstDay:7,weekend:[6,7],minimalDays:1},"bgn-AE":{firstDay:6,weekend:[6,7],minimalDays:1},"bgn-AF":{firstDay:6,weekend:[4,5],minimalDays:1},"bgn-IR":{firstDay:6,weekend:[5],minimalDays:1},"bgn-OM":{firstDay:6,weekend:[5,6],minimalDays:1},bho:{firstDay:7,weekend:[7],minimalDays:1},blo:{firstDay:1,weekend:[6,7],minimalDays:1},blt:{firstDay:1,weekend:[6,7],minimalDays:1},bm:{firstDay:1,weekend:[6,7],minimalDays:1},"bm-Nkoo":{firstDay:1,weekend:[6,7],minimalDays:1},bn:{firstDay:7,weekend:[6,7],minimalDays:1},"bn-IN":{firstDay:7,weekend:[7],minimalDays:1},bo:{firstDay:1,weekend:[6,7],minimalDays:1},"bo-IN":{firstDay:7,weekend:[7],minimalDays:1},br:{firstDay:1,weekend:[6,7],minimalDays:4},brx:{firstDay:7,weekend:[7],minimalDays:1},bs:{firstDay:1,weekend:[6,7],minimalDays:1},"bs-Cyrl":{firstDay:1,weekend:[6,7],minimalDays:1},"bs-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},bss:{firstDay:1,weekend:[6,7],minimalDays:1},byn:{firstDay:1,weekend:[6,7],minimalDays:1},ca:{firstDay:1,weekend:[6,7],minimalDays:4},"ca-AD":{firstDay:1,weekend:[6,7],minimalDays:4},"ca-ES-valencia":{firstDay:1,weekend:[6,7],minimalDays:4},"ca-FR":{firstDay:1,weekend:[6,7],minimalDays:4},"ca-IT":{firstDay:1,weekend:[6,7],minimalDays:4},cad:{firstDay:7,weekend:[6,7],minimalDays:1},cch:{firstDay:1,weekend:[6,7],minimalDays:1},ccp:{firstDay:7,weekend:[6,7],minimalDays:1},"ccp-IN":{firstDay:7,weekend:[7],minimalDays:1},ce:{firstDay:1,weekend:[6,7],minimalDays:4},ceb:{firstDay:7,weekend:[6,7],minimalDays:1},cgg:{firstDay:1,weekend:[7],minimalDays:1},cho:{firstDay:7,weekend:[6,7],minimalDays:1},chr:{firstDay:7,weekend:[6,7],minimalDays:1},cic:{firstDay:7,weekend:[6,7],minimalDays:1},ckb:{firstDay:6,weekend:[5,6],minimalDays:1},"ckb-IR":{firstDay:6,weekend:[5],minimalDays:1},co:{firstDay:1,weekend:[6,7],minimalDays:4},cs:{firstDay:1,weekend:[6,7],minimalDays:4},csw:{firstDay:7,weekend:[6,7],minimalDays:1},cu:{firstDay:1,weekend:[6,7],minimalDays:4},cv:{firstDay:1,weekend:[6,7],minimalDays:4},cy:{firstDay:1,weekend:[6,7],minimalDays:4},da:{firstDay:1,weekend:[6,7],minimalDays:4},"da-GL":{firstDay:1,weekend:[6,7],minimalDays:1},dav:{firstDay:7,weekend:[6,7],minimalDays:1},de:{firstDay:1,weekend:[6,7],minimalDays:4},"de-AT":{firstDay:1,weekend:[6,7],minimalDays:4},"de-BE":{firstDay:1,weekend:[6,7],minimalDays:4},"de-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"de-IT":{firstDay:1,weekend:[6,7],minimalDays:4},"de-LI":{firstDay:1,weekend:[6,7],minimalDays:4},"de-LU":{firstDay:1,weekend:[6,7],minimalDays:4},dje:{firstDay:1,weekend:[6,7],minimalDays:1},doi:{firstDay:7,weekend:[7],minimalDays:1},dsb:{firstDay:1,weekend:[6,7],minimalDays:4},dua:{firstDay:1,weekend:[6,7],minimalDays:1},dv:{firstDay:5,weekend:[6,7],minimalDays:1},dyo:{firstDay:1,weekend:[6,7],minimalDays:1},dz:{firstDay:7,weekend:[6,7],minimalDays:1},ebu:{firstDay:7,weekend:[6,7],minimalDays:1},ee:{firstDay:1,weekend:[6,7],minimalDays:1},"ee-TG":{firstDay:1,weekend:[6,7],minimalDays:1},el:{firstDay:1,weekend:[6,7],minimalDays:4},"el-CY":{firstDay:1,weekend:[6,7],minimalDays:1},"el-polyton":{firstDay:1,weekend:[6,7],minimalDays:4},en:{firstDay:7,weekend:[6,7],minimalDays:1},"en-001":{firstDay:1,weekend:[6,7],minimalDays:1},"en-150":{firstDay:1,weekend:[6,7],minimalDays:1},"en-AE":{firstDay:6,weekend:[6,7],minimalDays:1},"en-AG":{firstDay:7,weekend:[6,7],minimalDays:1},"en-AI":{firstDay:1,weekend:[6,7],minimalDays:1},"en-AS":{firstDay:7,weekend:[6,7],minimalDays:1},"en-AT":{firstDay:1,weekend:[6,7],minimalDays:4},"en-AU":{firstDay:1,weekend:[6,7],minimalDays:1},"en-BB":{firstDay:1,weekend:[6,7],minimalDays:1},"en-BE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-BI":{firstDay:1,weekend:[6,7],minimalDays:1},"en-BM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-BS":{firstDay:7,weekend:[6,7],minimalDays:1},"en-BW":{firstDay:7,weekend:[6,7],minimalDays:1},"en-BZ":{firstDay:7,weekend:[6,7],minimalDays:1},"en-CA":{firstDay:7,weekend:[6,7],minimalDays:1},"en-CC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"en-CK":{firstDay:1,weekend:[6,7],minimalDays:1},"en-CM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-CX":{firstDay:1,weekend:[6,7],minimalDays:1},"en-CY":{firstDay:1,weekend:[6,7],minimalDays:1},"en-DE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-DG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-DK":{firstDay:1,weekend:[6,7],minimalDays:4},"en-DM":{firstDay:7,weekend:[6,7],minimalDays:1},"en-Dsrt":{firstDay:7,weekend:[6,7],minimalDays:1},"en-ER":{firstDay:1,weekend:[6,7],minimalDays:1},"en-FI":{firstDay:1,weekend:[6,7],minimalDays:4},"en-FJ":{firstDay:1,weekend:[6,7],minimalDays:4},"en-FK":{firstDay:1,weekend:[6,7],minimalDays:1},"en-FM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-GB":{firstDay:1,weekend:[6,7],minimalDays:4},"en-GD":{firstDay:1,weekend:[6,7],minimalDays:1},"en-GG":{firstDay:1,weekend:[6,7],minimalDays:4},"en-GH":{firstDay:1,weekend:[6,7],minimalDays:1},"en-GI":{firstDay:1,weekend:[6,7],minimalDays:4},"en-GM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-GU":{firstDay:7,weekend:[6,7],minimalDays:1},"en-GY":{firstDay:1,weekend:[6,7],minimalDays:1},"en-HK":{firstDay:7,weekend:[6,7],minimalDays:1},"en-ID":{firstDay:7,weekend:[6,7],minimalDays:1},"en-IE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-IL":{firstDay:7,weekend:[5,6],minimalDays:1},"en-IM":{firstDay:1,weekend:[6,7],minimalDays:4},"en-IN":{firstDay:7,weekend:[7],minimalDays:1},"en-IO":{firstDay:1,weekend:[6,7],minimalDays:1},"en-JE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-JM":{firstDay:7,weekend:[6,7],minimalDays:1},"en-KE":{firstDay:7,weekend:[6,7],minimalDays:1},"en-KI":{firstDay:1,weekend:[6,7],minimalDays:1},"en-KN":{firstDay:1,weekend:[6,7],minimalDays:1},"en-KY":{firstDay:1,weekend:[6,7],minimalDays:1},"en-LC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-LR":{firstDay:1,weekend:[6,7],minimalDays:1},"en-LS":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MH":{firstDay:7,weekend:[6,7],minimalDays:1},"en-MO":{firstDay:7,weekend:[6,7],minimalDays:1},"en-MP":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MS":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MT":{firstDay:7,weekend:[6,7],minimalDays:1},"en-MU":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MV":{firstDay:5,weekend:[6,7],minimalDays:1},"en-MW":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MY":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NA":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NF":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NL":{firstDay:1,weekend:[6,7],minimalDays:4},"en-NR":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NU":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NZ":{firstDay:1,weekend:[6,7],minimalDays:1},"en-PG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-PH":{firstDay:7,weekend:[6,7],minimalDays:1},"en-PK":{firstDay:7,weekend:[6,7],minimalDays:1},"en-PN":{firstDay:1,weekend:[6,7],minimalDays:1},"en-PR":{firstDay:7,weekend:[6,7],minimalDays:1},"en-PW":{firstDay:1,weekend:[6,7],minimalDays:1},"en-RW":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SB":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SD":{firstDay:6,weekend:[5,6],minimalDays:1},"en-SE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-SG":{firstDay:7,weekend:[6,7],minimalDays:1},"en-SH":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SI":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SL":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SS":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SX":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SZ":{firstDay:1,weekend:[6,7],minimalDays:1},"en-Shaw":{firstDay:1,weekend:[6,7],minimalDays:4},"en-TC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-TK":{firstDay:1,weekend:[6,7],minimalDays:1},"en-TO":{firstDay:1,weekend:[6,7],minimalDays:1},"en-TT":{firstDay:7,weekend:[6,7],minimalDays:1},"en-TV":{firstDay:1,weekend:[6,7],minimalDays:1},"en-TZ":{firstDay:1,weekend:[6,7],minimalDays:1},"en-UG":{firstDay:1,weekend:[7],minimalDays:1},"en-UM":{firstDay:7,weekend:[6,7],minimalDays:1},"en-VC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-VG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-VI":{firstDay:7,weekend:[6,7],minimalDays:1},"en-VU":{firstDay:1,weekend:[6,7],minimalDays:1},"en-WS":{firstDay:7,weekend:[6,7],minimalDays:1},"en-ZA":{firstDay:7,weekend:[6,7],minimalDays:1},"en-ZM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-ZW":{firstDay:7,weekend:[6,7],minimalDays:1},eo:{firstDay:1,weekend:[6,7],minimalDays:1},es:{firstDay:1,weekend:[6,7],minimalDays:4},"es-419":{firstDay:1,weekend:[6,7],minimalDays:1},"es-AR":{firstDay:1,weekend:[6,7],minimalDays:1},"es-BO":{firstDay:1,weekend:[6,7],minimalDays:1},"es-BR":{firstDay:7,weekend:[6,7],minimalDays:1},"es-BZ":{firstDay:7,weekend:[6,7],minimalDays:1},"es-CL":{firstDay:1,weekend:[6,7],minimalDays:1},"es-CO":{firstDay:7,weekend:[6,7],minimalDays:1},"es-CR":{firstDay:1,weekend:[6,7],minimalDays:1},"es-CU":{firstDay:1,weekend:[6,7],minimalDays:1},"es-DO":{firstDay:7,weekend:[6,7],minimalDays:1},"es-EA":{firstDay:1,weekend:[6,7],minimalDays:1},"es-EC":{firstDay:1,weekend:[6,7],minimalDays:1},"es-GQ":{firstDay:1,weekend:[6,7],minimalDays:1},"es-GT":{firstDay:7,weekend:[6,7],minimalDays:1},"es-HN":{firstDay:7,weekend:[6,7],minimalDays:1},"es-IC":{firstDay:1,weekend:[6,7],minimalDays:1},"es-MX":{firstDay:7,weekend:[6,7],minimalDays:1},"es-NI":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PA":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PE":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PH":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PR":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PY":{firstDay:7,weekend:[6,7],minimalDays:1},"es-SV":{firstDay:7,weekend:[6,7],minimalDays:1},"es-US":{firstDay:7,weekend:[6,7],minimalDays:1},"es-UY":{firstDay:1,weekend:[6,7],minimalDays:1},"es-VE":{firstDay:7,weekend:[6,7],minimalDays:1},et:{firstDay:1,weekend:[6,7],minimalDays:4},eu:{firstDay:1,weekend:[6,7],minimalDays:4},ewo:{firstDay:1,weekend:[6,7],minimalDays:1},fa:{firstDay:6,weekend:[5],minimalDays:1},"fa-AF":{firstDay:6,weekend:[4,5],minimalDays:1},ff:{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-BF":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-CM":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-GH":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-GM":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-GW":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-LR":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-MR":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-NE":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-NG":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-SL":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-SN":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-BF":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-CM":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-GH":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-GM":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-GN":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-GW":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-LR":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-MR":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-NE":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-NG":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-SL":{firstDay:1,weekend:[6,7],minimalDays:1},fi:{firstDay:1,weekend:[6,7],minimalDays:4},fil:{firstDay:7,weekend:[6,7],minimalDays:1},fo:{firstDay:1,weekend:[6,7],minimalDays:4},"fo-DK":{firstDay:1,weekend:[6,7],minimalDays:4},fr:{firstDay:1,weekend:[6,7],minimalDays:4},"fr-BE":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-BF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-BI":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-BJ":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-BL":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CA":{firstDay:7,weekend:[6,7],minimalDays:1},"fr-CD":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CG":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-CI":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CM":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-DJ":{firstDay:6,weekend:[6,7],minimalDays:1},"fr-DZ":{firstDay:6,weekend:[5,6],minimalDays:1},"fr-GA":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-GF":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-GN":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-GP":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-GQ":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-HT":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-KM":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-LU":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-MA":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-MC":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-MF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-MG":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-ML":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-MQ":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-MR":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-MU":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-NC":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-NE":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-PF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-PM":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-RE":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-RW":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-SC":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-SN":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-SY":{firstDay:6,weekend:[5,6],minimalDays:1},"fr-TD":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-TG":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-TN":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-VU":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-WF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-YT":{firstDay:1,weekend:[6,7],minimalDays:1},frr:{firstDay:1,weekend:[6,7],minimalDays:4},fur:{firstDay:1,weekend:[6,7],minimalDays:4},fy:{firstDay:1,weekend:[6,7],minimalDays:4},ga:{firstDay:1,weekend:[6,7],minimalDays:4},"ga-GB":{firstDay:1,weekend:[6,7],minimalDays:4},gaa:{firstDay:1,weekend:[6,7],minimalDays:1},gd:{firstDay:1,weekend:[6,7],minimalDays:4},gez:{firstDay:7,weekend:[6,7],minimalDays:1},"gez-ER":{firstDay:1,weekend:[6,7],minimalDays:1},gl:{firstDay:1,weekend:[6,7],minimalDays:4},gn:{firstDay:7,weekend:[6,7],minimalDays:1},gsw:{firstDay:1,weekend:[6,7],minimalDays:4},"gsw-FR":{firstDay:1,weekend:[6,7],minimalDays:4},"gsw-LI":{firstDay:1,weekend:[6,7],minimalDays:4},gu:{firstDay:7,weekend:[7],minimalDays:1},guz:{firstDay:7,weekend:[6,7],minimalDays:1},gv:{firstDay:1,weekend:[6,7],minimalDays:4},ha:{firstDay:1,weekend:[6,7],minimalDays:1},"ha-Arab":{firstDay:1,weekend:[6,7],minimalDays:1},"ha-Arab-SD":{firstDay:6,weekend:[5,6],minimalDays:1},"ha-GH":{firstDay:1,weekend:[6,7],minimalDays:1},"ha-NE":{firstDay:1,weekend:[6,7],minimalDays:1},haw:{firstDay:7,weekend:[6,7],minimalDays:1},he:{firstDay:7,weekend:[5,6],minimalDays:1},hi:{firstDay:7,weekend:[7],minimalDays:1},"hi-Latn":{firstDay:7,weekend:[7],minimalDays:1},hnj:{firstDay:7,weekend:[6,7],minimalDays:1},"hnj-Hmnp":{firstDay:7,weekend:[6,7],minimalDays:1},hr:{firstDay:1,weekend:[6,7],minimalDays:1},"hr-BA":{firstDay:1,weekend:[6,7],minimalDays:1},hsb:{firstDay:1,weekend:[6,7],minimalDays:4},hu:{firstDay:1,weekend:[6,7],minimalDays:4},hy:{firstDay:1,weekend:[6,7],minimalDays:1},ia:{firstDay:1,weekend:[6,7],minimalDays:1},id:{firstDay:7,weekend:[6,7],minimalDays:1},ie:{firstDay:1,weekend:[6,7],minimalDays:4},ig:{firstDay:1,weekend:[6,7],minimalDays:1},ii:{firstDay:1,weekend:[6,7],minimalDays:1},io:{firstDay:1,weekend:[6,7],minimalDays:1},is:{firstDay:1,weekend:[6,7],minimalDays:4},it:{firstDay:1,weekend:[6,7],minimalDays:4},"it-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"it-SM":{firstDay:1,weekend:[6,7],minimalDays:4},"it-VA":{firstDay:1,weekend:[6,7],minimalDays:4},iu:{firstDay:7,weekend:[6,7],minimalDays:1},"iu-Latn":{firstDay:7,weekend:[6,7],minimalDays:1},ja:{firstDay:7,weekend:[6,7],minimalDays:1},jbo:{firstDay:1,weekend:[6,7],minimalDays:1},jgo:{firstDay:1,weekend:[6,7],minimalDays:1},jmc:{firstDay:1,weekend:[6,7],minimalDays:1},jv:{firstDay:7,weekend:[6,7],minimalDays:1},ka:{firstDay:1,weekend:[6,7],minimalDays:1},kab:{firstDay:6,weekend:[5,6],minimalDays:1},kaj:{firstDay:1,weekend:[6,7],minimalDays:1},kam:{firstDay:7,weekend:[6,7],minimalDays:1},kcg:{firstDay:1,weekend:[6,7],minimalDays:1},kde:{firstDay:1,weekend:[6,7],minimalDays:1},kea:{firstDay:1,weekend:[6,7],minimalDays:1},ken:{firstDay:1,weekend:[6,7],minimalDays:1},kgp:{firstDay:7,weekend:[6,7],minimalDays:1},khq:{firstDay:1,weekend:[6,7],minimalDays:1},ki:{firstDay:7,weekend:[6,7],minimalDays:1},kk:{firstDay:1,weekend:[6,7],minimalDays:1},kkj:{firstDay:1,weekend:[6,7],minimalDays:1},kl:{firstDay:1,weekend:[6,7],minimalDays:1},kln:{firstDay:7,weekend:[6,7],minimalDays:1},km:{firstDay:7,weekend:[6,7],minimalDays:1},kn:{firstDay:7,weekend:[7],minimalDays:1},ko:{firstDay:7,weekend:[6,7],minimalDays:1},"ko-CN":{firstDay:1,weekend:[6,7],minimalDays:1},"ko-KP":{firstDay:1,weekend:[6,7],minimalDays:1},kok:{firstDay:7,weekend:[7],minimalDays:1},kpe:{firstDay:1,weekend:[6,7],minimalDays:1},"kpe-GN":{firstDay:1,weekend:[6,7],minimalDays:1},ks:{firstDay:7,weekend:[7],minimalDays:1},"ks-Arab":{firstDay:7,weekend:[7],minimalDays:1},"ks-Deva":{firstDay:7,weekend:[7],minimalDays:1},ksb:{firstDay:1,weekend:[6,7],minimalDays:1},ksf:{firstDay:1,weekend:[6,7],minimalDays:1},ksh:{firstDay:1,weekend:[6,7],minimalDays:4},ku:{firstDay:1,weekend:[6,7],minimalDays:1},kw:{firstDay:1,weekend:[6,7],minimalDays:4},kxv:{firstDay:7,weekend:[7],minimalDays:1},"kxv-Deva":{firstDay:7,weekend:[7],minimalDays:1},"kxv-Latn":{firstDay:7,weekend:[7],minimalDays:1},"kxv-Orya":{firstDay:7,weekend:[7],minimalDays:1},"kxv-Telu":{firstDay:7,weekend:[7],minimalDays:1},ky:{firstDay:1,weekend:[6,7],minimalDays:1},la:{firstDay:1,weekend:[6,7],minimalDays:4},lag:{firstDay:1,weekend:[6,7],minimalDays:1},lb:{firstDay:1,weekend:[6,7],minimalDays:4},lg:{firstDay:1,weekend:[7],minimalDays:1},lij:{firstDay:1,weekend:[6,7],minimalDays:4},lkt:{firstDay:7,weekend:[6,7],minimalDays:1},lmo:{firstDay:1,weekend:[6,7],minimalDays:4},ln:{firstDay:1,weekend:[6,7],minimalDays:1},"ln-AO":{firstDay:1,weekend:[6,7],minimalDays:1},"ln-CF":{firstDay:1,weekend:[6,7],minimalDays:1},"ln-CG":{firstDay:1,weekend:[6,7],minimalDays:1},lo:{firstDay:7,weekend:[6,7],minimalDays:1},lrc:{firstDay:6,weekend:[5],minimalDays:1},"lrc-IQ":{firstDay:6,weekend:[5,6],minimalDays:1},lt:{firstDay:1,weekend:[6,7],minimalDays:4},lu:{firstDay:1,weekend:[6,7],minimalDays:1},luo:{firstDay:7,weekend:[6,7],minimalDays:1},luy:{firstDay:7,weekend:[6,7],minimalDays:1},lv:{firstDay:1,weekend:[6,7],minimalDays:1},mai:{firstDay:7,weekend:[7],minimalDays:1},mas:{firstDay:7,weekend:[6,7],minimalDays:1},"mas-TZ":{firstDay:1,weekend:[6,7],minimalDays:1},mdf:{firstDay:1,weekend:[6,7],minimalDays:4},mer:{firstDay:7,weekend:[6,7],minimalDays:1},mfe:{firstDay:1,weekend:[6,7],minimalDays:1},mg:{firstDay:1,weekend:[6,7],minimalDays:1},mgh:{firstDay:7,weekend:[6,7],minimalDays:1},mgo:{firstDay:1,weekend:[6,7],minimalDays:1},mi:{firstDay:1,weekend:[6,7],minimalDays:1},mic:{firstDay:7,weekend:[6,7],minimalDays:1},mk:{firstDay:1,weekend:[6,7],minimalDays:1},ml:{firstDay:7,weekend:[7],minimalDays:1},mn:{firstDay:1,weekend:[6,7],minimalDays:1},"mn-Mong":{firstDay:1,weekend:[6,7],minimalDays:1},"mn-Mong-MN":{firstDay:1,weekend:[6,7],minimalDays:1},mni:{firstDay:7,weekend:[7],minimalDays:1},"mni-Beng":{firstDay:7,weekend:[7],minimalDays:1},"mni-Mtei":{firstDay:7,weekend:[7],minimalDays:1},moh:{firstDay:7,weekend:[6,7],minimalDays:1},mr:{firstDay:7,weekend:[7],minimalDays:1},ms:{firstDay:1,weekend:[6,7],minimalDays:1},"ms-Arab":{firstDay:1,weekend:[6,7],minimalDays:1},"ms-Arab-BN":{firstDay:1,weekend:[6,7],minimalDays:1},"ms-BN":{firstDay:1,weekend:[6,7],minimalDays:1},"ms-ID":{firstDay:7,weekend:[6,7],minimalDays:1},"ms-SG":{firstDay:7,weekend:[6,7],minimalDays:1},mt:{firstDay:7,weekend:[6,7],minimalDays:1},mua:{firstDay:1,weekend:[6,7],minimalDays:1},mus:{firstDay:7,weekend:[6,7],minimalDays:1},my:{firstDay:7,weekend:[6,7],minimalDays:1},myv:{firstDay:1,weekend:[6,7],minimalDays:4},mzn:{firstDay:6,weekend:[5],minimalDays:1},naq:{firstDay:1,weekend:[6,7],minimalDays:1},nb:{firstDay:1,weekend:[6,7],minimalDays:4},"nb-SJ":{firstDay:1,weekend:[6,7],minimalDays:4},nd:{firstDay:7,weekend:[6,7],minimalDays:1},nds:{firstDay:1,weekend:[6,7],minimalDays:4},"nds-NL":{firstDay:1,weekend:[6,7],minimalDays:4},ne:{firstDay:7,weekend:[6,7],minimalDays:1},"ne-IN":{firstDay:7,weekend:[7],minimalDays:1},nl:{firstDay:1,weekend:[6,7],minimalDays:4},"nl-AW":{firstDay:1,weekend:[6,7],minimalDays:1},"nl-BE":{firstDay:1,weekend:[6,7],minimalDays:4},"nl-BQ":{firstDay:1,weekend:[6,7],minimalDays:1},"nl-CW":{firstDay:1,weekend:[6,7],minimalDays:1},"nl-SR":{firstDay:1,weekend:[6,7],minimalDays:1},"nl-SX":{firstDay:1,weekend:[6,7],minimalDays:1},nmg:{firstDay:1,weekend:[6,7],minimalDays:1},nn:{firstDay:1,weekend:[6,7],minimalDays:4},nnh:{firstDay:1,weekend:[6,7],minimalDays:1},no:{firstDay:1,weekend:[6,7],minimalDays:4},nqo:{firstDay:1,weekend:[6,7],minimalDays:1},nr:{firstDay:7,weekend:[6,7],minimalDays:1},nso:{firstDay:7,weekend:[6,7],minimalDays:1},nus:{firstDay:1,weekend:[6,7],minimalDays:1},nv:{firstDay:7,weekend:[6,7],minimalDays:1},ny:{firstDay:1,weekend:[6,7],minimalDays:1},nyn:{firstDay:1,weekend:[7],minimalDays:1},oc:{firstDay:1,weekend:[6,7],minimalDays:4},"oc-ES":{firstDay:1,weekend:[6,7],minimalDays:4},om:{firstDay:7,weekend:[6,7],minimalDays:1},"om-KE":{firstDay:7,weekend:[6,7],minimalDays:1},or:{firstDay:7,weekend:[7],minimalDays:1},os:{firstDay:1,weekend:[6,7],minimalDays:1},"os-RU":{firstDay:1,weekend:[6,7],minimalDays:4},osa:{firstDay:7,weekend:[6,7],minimalDays:1},pa:{firstDay:7,weekend:[7],minimalDays:1},"pa-Arab":{firstDay:7,weekend:[6,7],minimalDays:1},"pa-Guru":{firstDay:7,weekend:[7],minimalDays:1},pap:{firstDay:1,weekend:[6,7],minimalDays:1},"pap-AW":{firstDay:1,weekend:[6,7],minimalDays:1},pcm:{firstDay:1,weekend:[6,7],minimalDays:1},pis:{firstDay:1,weekend:[6,7],minimalDays:1},pl:{firstDay:1,weekend:[6,7],minimalDays:4},prg:{firstDay:1,weekend:[6,7],minimalDays:4},ps:{firstDay:6,weekend:[4,5],minimalDays:1},"ps-PK":{firstDay:7,weekend:[6,7],minimalDays:1},pt:{firstDay:7,weekend:[6,7],minimalDays:1},"pt-AO":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"pt-CV":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-GQ":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-GW":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-LU":{firstDay:1,weekend:[6,7],minimalDays:4},"pt-MO":{firstDay:7,weekend:[6,7],minimalDays:1},"pt-MZ":{firstDay:7,weekend:[6,7],minimalDays:1},"pt-PT":{firstDay:7,weekend:[6,7],minimalDays:4},"pt-ST":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-TL":{firstDay:1,weekend:[6,7],minimalDays:1},qu:{firstDay:7,weekend:[6,7],minimalDays:1},"qu-BO":{firstDay:1,weekend:[6,7],minimalDays:1},"qu-EC":{firstDay:1,weekend:[6,7],minimalDays:1},quc:{firstDay:7,weekend:[6,7],minimalDays:1},raj:{firstDay:7,weekend:[7],minimalDays:1},rhg:{firstDay:7,weekend:[6,7],minimalDays:1},"rhg-Rohg":{firstDay:7,weekend:[6,7],minimalDays:1},"rhg-Rohg-BD":{firstDay:7,weekend:[6,7],minimalDays:1},rif:{firstDay:1,weekend:[6,7],minimalDays:1},rm:{firstDay:1,weekend:[6,7],minimalDays:4},rn:{firstDay:1,weekend:[6,7],minimalDays:1},ro:{firstDay:1,weekend:[6,7],minimalDays:1},"ro-MD":{firstDay:1,weekend:[6,7],minimalDays:1},rof:{firstDay:1,weekend:[6,7],minimalDays:1},ru:{firstDay:1,weekend:[6,7],minimalDays:4},"ru-BY":{firstDay:1,weekend:[6,7],minimalDays:1},"ru-KG":{firstDay:1,weekend:[6,7],minimalDays:1},"ru-KZ":{firstDay:1,weekend:[6,7],minimalDays:1},"ru-MD":{firstDay:1,weekend:[6,7],minimalDays:1},"ru-UA":{firstDay:1,weekend:[6,7],minimalDays:1},rw:{firstDay:1,weekend:[6,7],minimalDays:1},rwk:{firstDay:1,weekend:[6,7],minimalDays:1},sa:{firstDay:7,weekend:[7],minimalDays:1},sah:{firstDay:1,weekend:[6,7],minimalDays:4},saq:{firstDay:7,weekend:[6,7],minimalDays:1},sat:{firstDay:7,weekend:[7],minimalDays:1},"sat-Deva":{firstDay:7,weekend:[7],minimalDays:1},"sat-Olck":{firstDay:7,weekend:[7],minimalDays:1},sbp:{firstDay:1,weekend:[6,7],minimalDays:1},sc:{firstDay:1,weekend:[6,7],minimalDays:4},scn:{firstDay:1,weekend:[6,7],minimalDays:4},sd:{firstDay:7,weekend:[6,7],minimalDays:1},"sd-Arab":{firstDay:7,weekend:[6,7],minimalDays:1},"sd-Deva":{firstDay:7,weekend:[7],minimalDays:1},sdh:{firstDay:6,weekend:[5],minimalDays:1},"sdh-IQ":{firstDay:6,weekend:[5,6],minimalDays:1},se:{firstDay:1,weekend:[6,7],minimalDays:4},"se-FI":{firstDay:1,weekend:[6,7],minimalDays:4},"se-SE":{firstDay:1,weekend:[6,7],minimalDays:4},seh:{firstDay:7,weekend:[6,7],minimalDays:1},ses:{firstDay:1,weekend:[6,7],minimalDays:1},sg:{firstDay:1,weekend:[6,7],minimalDays:1},shi:{firstDay:1,weekend:[6,7],minimalDays:1},"shi-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},"shi-Tfng":{firstDay:1,weekend:[6,7],minimalDays:1},shn:{firstDay:7,weekend:[6,7],minimalDays:1},"shn-TH":{firstDay:7,weekend:[6,7],minimalDays:1},si:{firstDay:1,weekend:[6,7],minimalDays:1},sid:{firstDay:7,weekend:[6,7],minimalDays:1},sk:{firstDay:1,weekend:[6,7],minimalDays:4},skr:{firstDay:7,weekend:[6,7],minimalDays:1},sl:{firstDay:1,weekend:[6,7],minimalDays:1},sma:{firstDay:1,weekend:[6,7],minimalDays:4},"sma-NO":{firstDay:1,weekend:[6,7],minimalDays:4},smj:{firstDay:1,weekend:[6,7],minimalDays:4},"smj-NO":{firstDay:1,weekend:[6,7],minimalDays:4},smn:{firstDay:1,weekend:[6,7],minimalDays:4},sms:{firstDay:1,weekend:[6,7],minimalDays:4},sn:{firstDay:7,weekend:[6,7],minimalDays:1},so:{firstDay:1,weekend:[6,7],minimalDays:1},"so-DJ":{firstDay:6,weekend:[6,7],minimalDays:1},"so-ET":{firstDay:7,weekend:[6,7],minimalDays:1},"so-KE":{firstDay:7,weekend:[6,7],minimalDays:1},sq:{firstDay:1,weekend:[6,7],minimalDays:1},"sq-MK":{firstDay:1,weekend:[6,7],minimalDays:1},"sq-XK":{firstDay:1,weekend:[6,7],minimalDays:1},sr:{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Cyrl":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Cyrl-BA":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Cyrl-ME":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Cyrl-XK":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Latn-BA":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Latn-ME":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Latn-XK":{firstDay:1,weekend:[6,7],minimalDays:1},ss:{firstDay:7,weekend:[6,7],minimalDays:1},"ss-SZ":{firstDay:1,weekend:[6,7],minimalDays:1},ssy:{firstDay:1,weekend:[6,7],minimalDays:1},st:{firstDay:7,weekend:[6,7],minimalDays:1},"st-LS":{firstDay:1,weekend:[6,7],minimalDays:1},su:{firstDay:7,weekend:[6,7],minimalDays:1},"su-Latn":{firstDay:7,weekend:[6,7],minimalDays:1},sv:{firstDay:1,weekend:[6,7],minimalDays:4},"sv-AX":{firstDay:1,weekend:[6,7],minimalDays:4},"sv-FI":{firstDay:1,weekend:[6,7],minimalDays:4},sw:{firstDay:1,weekend:[6,7],minimalDays:1},"sw-CD":{firstDay:1,weekend:[6,7],minimalDays:1},"sw-KE":{firstDay:7,weekend:[6,7],minimalDays:1},"sw-UG":{firstDay:1,weekend:[7],minimalDays:1},syr:{firstDay:6,weekend:[5,6],minimalDays:1},"syr-SY":{firstDay:6,weekend:[5,6],minimalDays:1},szl:{firstDay:1,weekend:[6,7],minimalDays:4},ta:{firstDay:7,weekend:[7],minimalDays:1},"ta-LK":{firstDay:1,weekend:[6,7],minimalDays:1},"ta-MY":{firstDay:1,weekend:[6,7],minimalDays:1},"ta-SG":{firstDay:7,weekend:[6,7],minimalDays:1},te:{firstDay:7,weekend:[7],minimalDays:1},teo:{firstDay:1,weekend:[7],minimalDays:1},"teo-KE":{firstDay:7,weekend:[6,7],minimalDays:1},tg:{firstDay:1,weekend:[6,7],minimalDays:1},th:{firstDay:7,weekend:[6,7],minimalDays:1},ti:{firstDay:7,weekend:[6,7],minimalDays:1},"ti-ER":{firstDay:1,weekend:[6,7],minimalDays:1},tig:{firstDay:1,weekend:[6,7],minimalDays:1},tk:{firstDay:1,weekend:[6,7],minimalDays:1},tn:{firstDay:7,weekend:[6,7],minimalDays:1},"tn-BW":{firstDay:7,weekend:[6,7],minimalDays:1},to:{firstDay:1,weekend:[6,7],minimalDays:1},tok:{firstDay:1,weekend:[6,7],minimalDays:1},tpi:{firstDay:1,weekend:[6,7],minimalDays:1},tr:{firstDay:1,weekend:[6,7],minimalDays:1},"tr-CY":{firstDay:1,weekend:[6,7],minimalDays:1},trv:{firstDay:7,weekend:[6,7],minimalDays:1},trw:{firstDay:7,weekend:[6,7],minimalDays:1},ts:{firstDay:7,weekend:[6,7],minimalDays:1},tt:{firstDay:1,weekend:[6,7],minimalDays:4},twq:{firstDay:1,weekend:[6,7],minimalDays:1},tyv:{firstDay:1,weekend:[6,7],minimalDays:4},tzm:{firstDay:1,weekend:[6,7],minimalDays:1},ug:{firstDay:1,weekend:[6,7],minimalDays:1},uk:{firstDay:1,weekend:[6,7],minimalDays:1},und:{firstDay:7,weekend:[6,7],minimalDays:1},ur:{firstDay:7,weekend:[6,7],minimalDays:1},"ur-IN":{firstDay:7,weekend:[7],minimalDays:1},uz:{firstDay:1,weekend:[6,7],minimalDays:1},"uz-Arab":{firstDay:6,weekend:[4,5],minimalDays:1},"uz-Cyrl":{firstDay:1,weekend:[6,7],minimalDays:1},"uz-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},vai:{firstDay:1,weekend:[6,7],minimalDays:1},"vai-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},"vai-Vaii":{firstDay:1,weekend:[6,7],minimalDays:1},ve:{firstDay:7,weekend:[6,7],minimalDays:1},vec:{firstDay:1,weekend:[6,7],minimalDays:4},vi:{firstDay:1,weekend:[6,7],minimalDays:1},vmw:{firstDay:7,weekend:[6,7],minimalDays:1},vo:{firstDay:1,weekend:[6,7],minimalDays:1},vun:{firstDay:1,weekend:[6,7],minimalDays:1},wa:{firstDay:1,weekend:[6,7],minimalDays:4},wae:{firstDay:1,weekend:[6,7],minimalDays:4},wal:{firstDay:7,weekend:[6,7],minimalDays:1},wbp:{firstDay:1,weekend:[6,7],minimalDays:1},wo:{firstDay:1,weekend:[6,7],minimalDays:1},xh:{firstDay:7,weekend:[6,7],minimalDays:1},xnr:{firstDay:7,weekend:[7],minimalDays:1},xog:{firstDay:1,weekend:[7],minimalDays:1},yav:{firstDay:1,weekend:[6,7],minimalDays:1},yi:{firstDay:1,weekend:[6,7],minimalDays:1},yo:{firstDay:1,weekend:[6,7],minimalDays:1},"yo-BJ":{firstDay:1,weekend:[6,7],minimalDays:1},yrl:{firstDay:7,weekend:[6,7],minimalDays:1},"yrl-CO":{firstDay:7,weekend:[6,7],minimalDays:1},"yrl-VE":{firstDay:7,weekend:[6,7],minimalDays:1},yue:{firstDay:7,weekend:[6,7],minimalDays:1},"yue-Hans":{firstDay:1,weekend:[6,7],minimalDays:1},"yue-Hant":{firstDay:7,weekend:[6,7],minimalDays:1},za:{firstDay:1,weekend:[6,7],minimalDays:1},zgh:{firstDay:1,weekend:[6,7],minimalDays:1},zh:{firstDay:1,weekend:[6,7],minimalDays:1},"zh-Hans":{firstDay:1,weekend:[6,7],minimalDays:1},"zh-Hans-HK":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hans-MO":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hans-SG":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hant":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hant-HK":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hant-MO":{firstDay:7,weekend:[6,7],minimalDays:1},zu:{firstDay:7,weekend:[6,7],minimalDays:1}};function rt(e){const t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${t}-${i}-${n}`}function as(e){return Ut(e,new Date)}function Ut(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function Pd(e){const t=[0,1,2,3,4,5,6],i=e%7;return[...t.slice(i),...t.slice(0,i)]}function rs(e){const t=Td[e??"en"]||{firstDay:0};return Pd(t.firstDay)}function xd(e){const t=new Intl.DateTimeFormat(e,{weekday:"narrow"}),i=new Date(2025,10,30);return rs(e).map(n=>{const s=new Date(i);return s.setDate(i.getDate()+n),t.format(s)})}function gt(e,t,i){for(let n=0;n<i;n++){const s=new Date(t.getFullYear(),t.getMonth()+n,1);if(e.getMonth()===s.getMonth()&&e.getFullYear()===s.getFullYear())return!0}return!1}function Md(e,t,i="long"){return new Intl.DateTimeFormat(e,{month:i,year:"numeric"}).formatToParts(t).filter(s=>s.type==="month"||s.type==="year")}function os(e,t){const i=e||"en-US",r=new Intl.DateTimeFormat(i,{day:"numeric"}).formatToParts(t).find(a=>a.type==="day");return r?r.value:t.getDate().toString()}function Li(e,t){const i=rt(e),n=rt(t);return i===n?{start:i}:{start:i,end:n}}function ls(e){return e.length?e.map(n=>({start:new Date(n.start).getTime(),end:new Date(n.end??n.start).getTime()})).sort((n,s)=>n.start-s.start).reduce((n,s)=>{const r=n[n.length-1];if(r){const a=new Date(r.end);if(a.setDate(a.getDate()+1),s.start<=a.getTime())return r.end=Math.max(r.end,s.end),n}return[...n,s]},[]).map(n=>Li(new Date(n.start),new Date(n.end))):[]}class Fe{constructor(t,i){t.addController(this),this.getTargets=i.getTargets,this.getState=i.getState}hostConnected(){}hostUpdated(){const t=this.getTargets();if(!t)return;let i=[];t instanceof NodeList?i=Array.from(t):Array.isArray(t)?i=t:i=[t];const{uid:n,templateData:s}=this.getState(),{touched:r,errors:a,readonly:o,disabled:l,hint:d}=s,c=r&&a&&a.length>0;vt.filterTap(i,h=>!!h,h=>{const p=(m,f)=>{f?h.setAttribute(m,f):h.removeAttribute(m)};p("aria-describedby",d?`${n}_hint`:null),p("aria-invalid",c?"true":null),p("aria-errormessage",c?`${n}_errors`:null),p("aria-readonly",l||o?"true":null)})}}const{I:Ld}=vd,ds=e=>e,Nd=e=>e.strings===void 0,us=()=>document.createComment(""),Ht=(e,t,i)=>{const n=e._$AA.parentNode,s=t===void 0?e._$AB:t._$AA;if(i===void 0){const r=n.insertBefore(us(),s),a=n.insertBefore(us(),s);i=new Ld(r,a,e,e.options)}else{const r=i._$AB.nextSibling,a=i._$AM,o=a!==e;if(o){let l;i._$AQ?.(e),i._$AM=e,i._$AP!==void 0&&(l=e._$AU)!==a._$AU&&i._$AP(l)}if(r!==s||o){let l=i._$AA;for(;l!==r;){const d=ds(l).nextSibling;ds(n).insertBefore(l,s),l=d}}}return i},bt=(e,t,i=e)=>(e._$AI(t,i),e),zd={},cs=(e,t=zd)=>e._$AH=t,Fd=e=>e._$AH,Ni=e=>{e._$AR(),e._$AA.remove()};const hs=(e,t,i)=>{const n=new Map;for(let s=t;s<=i;s++)n.set(e[s],s);return n},it=qt(class extends Vt{constructor(e){if(super(e),e.type!==tt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,t,i){let n;i===void 0?i=t:t!==void 0&&(n=t);const s=[],r=[];let a=0;for(const o of e)s[a]=n?n(o,a):a,r[a]=i(o,a),a++;return{values:r,keys:s}}render(e,t,i){return this.dt(e,t,i).values}update(e,[t,i,n]){const s=Fd(e),{values:r,keys:a}=this.dt(t,i,n);if(!Array.isArray(s))return this.ut=a,r;const o=this.ut??=[],l=[];let d,c,h=0,p=s.length-1,m=0,f=r.length-1;for(;h<=p&&m<=f;)if(s[h]===null)h++;else if(s[p]===null)p--;else if(o[h]===a[m])l[m]=bt(s[h],r[m]),h++,m++;else if(o[p]===a[f])l[f]=bt(s[p],r[f]),p--,f--;else if(o[h]===a[f])l[f]=bt(s[h],r[f]),Ht(e,l[f+1],s[h]),h++,f--;else if(o[p]===a[m])l[m]=bt(s[p],r[m]),Ht(e,s[h],s[p]),p--,m++;else if(d===void 0&&(d=hs(a,m,f),c=hs(o,h,p)),d.has(o[h]))if(d.has(o[p])){const w=c.get(a[m]),S=w!==void 0?s[w]:null;if(S===null){const T=Ht(e,s[h]);bt(T,r[m]),l[m]=T}else l[m]=bt(S,r[m]),Ht(e,s[h],S),s[w]=null;m++}else Ni(s[p]),p--;else Ni(s[h]),h++;for(;m<=f;){const w=Ht(e,l[f+1]);bt(w,r[m]),l[m++]=w}for(;h<=p;){const w=s[h++];w!==null&&Ni(w)}return this.ut=a,cs(e,l),ze}}),Ge=(e,t,i=!1,n=void 0,s=!0)=>s?t.label?v`<label
21
+ class="gui-label"
22
+ for=${e}
23
+ data-cy=${`${e}_label`}
24
+ id=${n?`${e}_${n}_label`:`${e}_label`}
25
+ >
26
+ ${t.label+(t.required?" *":"")} ${ps(e,t)}
27
+ ${i?Ee(e,t):_}
28
+ </label>`:_:t.label?v`<span
29
+ class="gui-label"
30
+ data-cy=${`${e}_label`}
31
+ id=${n?`${e}_${n}_label`:`${e}_label`}
32
+ >
33
+ ${t.label+(t.required?" *":"")} ${ps(e,t)}
34
+ ${i?Ee(e,t):_}
35
+ </span>`:_,ps=(e,t)=>t.hint?v`<div class="gui-widget-hint" id=${`${e}_hint`}>${t.hint}</div>`:v``,pi=(e,t)=>{const i={[`gui-${e}--icon`]:!1,[`gui-${e}--icon-right`]:!1};if(t.icon){i[`gui-${e}--icon`]=!0;const n={"gui-widget-icon":!0,[t.icon]:!0};return{widgetClasses:i,html:v`<span class=${fe(n)} data-icon=${t.icon}></span>`}}else return{widgetClasses:i,html:v``}},Ee=(e,t)=>{const i=t.touched&&t.errors&&t.errors.length>0;return v`${i?v`<ul class="gui-validator" id=${`${e}_errors`} data-cy=${`${e}_validator-errors`}>
36
+ ${t.errors?.map(n=>v`<li class="gui-validator__error" role="alert" data-cy=${`${e}_validator-error`}>
37
+ ${n}
38
+ </li>`)}
39
+ </ul>`:""}`};var Rd=Object.defineProperty,te=(e,t,i,n)=>{for(var s=void 0,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=a(t,i,s)||s);return s&&Rd(t,i,s),s};class V extends ee{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.localeId=void 0,this.errors=[],this.touched=void 0,this.required=!1,this.disabled=!1,this.readOnly=!1,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel="",this.nextMonthAriaLabel="",this.dayFormat="numeric",this.weekdayFormat="narrow",this.monthFormat="long",this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=1,this._currentDate=new Date,this._yearSelectorOpen=!1,this.ariaController=new Fe(this,{getTargets:()=>this.querySelectorAll(".gui-calendar-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}renderAboveCalendar(){return _}render(){const t={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required},i=Array.from({length:this.numberOfMonths??1},(n,s)=>s);return v`
40
+ ${this.label?Ge(this.uid,t,!1,"calendar"):_}
41
+
42
+ <div class="gui-widget" @focusout=${this.onFocusOut}>
43
+ <div
44
+ id=${this.uid}
45
+ class="gui-calendar-input"
46
+ role="group"
47
+ aria-labelledby=${this.label?`${this.uid}_calendar_label`:_}
48
+ ?aria-disabled=${this.disabled}
49
+ >
50
+ ${this.renderAboveCalendar()}
51
+ <div class="gui-calendar__container">
52
+ <button
53
+ type="button"
54
+ tabindex="0"
55
+ class="gui-button gui-calendar__month-button gui-calendar__month-button--prev"
56
+ ?disabled=${!this.canGoPrev()}
57
+ @click=${this.prevMonth}
58
+ aria-label=${this.prevMonthAriaLabel??"Previous month"}
59
+ >
60
+ ${this.prevMonthIcon?v`<span
61
+ class=${`gui-widget-icon ${this.prevMonthIcon}`}
62
+ data-icon=${this.prevMonthIcon}
63
+ ></span>`:"<"}
64
+ </button>
65
+
66
+ <div class="gui-calendar__months-grid">
67
+ ${i.map(n=>this.renderMonthPanel(n))}
68
+ </div>
69
+
70
+ <button
71
+ type="button"
72
+ tabindex="0"
73
+ class="gui-button gui-calendar__month-button gui-calendar__month-button--next"
74
+ ?disabled=${!this.canGoNext()}
75
+ @click=${this.nextMonth}
76
+ aria-label=${this.nextMonthAriaLabel??"Next month"}
77
+ >
78
+ ${this.nextMonthIcon?v`<span
79
+ class=${`gui-widget-icon ${this.nextMonthIcon}`}
80
+ data-icon=${this.nextMonthIcon}
81
+ ></span>`:">"}
82
+ </button>
83
+ </div>
84
+ </div>
85
+ </div>
86
+
87
+ ${this.errors?.length?Ee(this.uid,t):_}
88
+ `}renderMonthPanel(t){const i=this.getDaysInMonth(t),n=this.chunkDays(i),s=xd(this.localeId),r=new Date(this._currentDate);return r.setDate(1),r.setMonth(r.getMonth()+t),v`
89
+ <div class="gui-calendar__panel">
90
+ ${this.renderHeader(r)}
91
+ ${this._yearSelectorOpen&&t===0?this.renderYearGrid():v`
92
+ <div class="gui-calendar__days-grid" role="grid">
93
+ <div role="row" class="gui-calendar__rows">
94
+ ${it(s,(a,o)=>o,a=>v`<span class="gui-calendar__weekday" role="gridcell">${a}</span>`)}
95
+ </div>
96
+
97
+ ${it(n,a=>v`
98
+ <div role="row" class="gui-calendar__rows">
99
+ ${it(a,o=>o.date.toISOString(),o=>this.renderDay(o))}
100
+ </div>
101
+ `)}
102
+ </div>
103
+ `}
104
+ </div>
105
+ `}renderHeader(t){const i=Md(this.localeId,t,this.monthFormat);return v`
106
+ <header class="gui-calendar__header">
107
+ <h2>
108
+ ${i.map(n=>n.type==="year"?v`<button
109
+ type="button"
110
+ tabindex="0"
111
+ class="gui-calendar__year-selector"
112
+ @click=${this.toggleYearSelector}
113
+ aria-expanded=${this._yearSelectorOpen}
114
+ aria-label="Select year"
115
+ >
116
+ <span class="gui-calendar__year-value">${n.value}</span>
117
+ <span class="gui-calendar__year-arrow" aria-hidden="true">
118
+ <svg
119
+ xmlns="http://www.w3.org/2000/svg"
120
+ width="16"
121
+ height="16"
122
+ viewBox="0 0 256 256"
123
+ >
124
+ <path
125
+ d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
126
+ ></path>
127
+ </svg>
128
+ </span>
129
+ </button>`:v`<span class="gui-calendar__month-name">${n.value}</span>`)}
130
+ </h2>
131
+ </header>
132
+ `}renderYearGrid(){const t=this._currentDate.getFullYear(),i=this._yearList;return v`
133
+ <div
134
+ class="gui-calendar__year-grid"
135
+ role="grid"
136
+ aria-label="Year selection"
137
+ @keydown=${this.handleYearKeydown}
138
+ >
139
+ ${this.chunkYears(i).map(n=>v`
140
+ <div role="row" class="gui-calendar__year-row">
141
+ ${n.map(s=>v`
142
+ <button
143
+ type="button"
144
+ role="gridcell"
145
+ class="gui-calendar__year-button ${s===t?"current":""}"
146
+ tabindex=${s===t?0:-1}
147
+ data-year=${s}
148
+ @click=${r=>{r.stopPropagation(),this.selectYear(s)}}
149
+ aria-selected=${s===t}
150
+ >
151
+ ${s}
152
+ </button>
153
+ `)}
154
+ </div>
155
+ `)}
156
+ </div>
157
+ `}chunkYears(t){const i=[];for(let n=0;n<t.length;n+=4)i.push(t.slice(n,n+4));return i}toggleYearSelector(){this._yearSelectorOpen=!this._yearSelectorOpen,this._yearSelectorOpen&&this.updateComplete.then(()=>{this.scrollToCurrentYear(),this.focusCurrentYearButton()})}selectYear(t){this.querySelector(".gui-calendar__year-selector")?.focus();const n=this._currentDate;this._currentDate=new Date(t,n.getMonth(),1),this._yearSelectorOpen=!1,this.updateComplete.then(()=>{this.querySelector('.gui-calendar__day-button[tabindex="0"]')?.focus()})}scrollToCurrentYear(){const t=this.querySelector(".gui-calendar__year-grid"),i=this.querySelector(".gui-calendar__year-button.current");if(t&&i){const n=t.getBoundingClientRect(),s=i.getBoundingClientRect(),r=t.scrollTop+(s.top-n.top)-n.height/2+s.height/2;t.scrollTop=Math.max(0,r)}}focusCurrentYearButton(){this.querySelector(".gui-calendar__year-button.current")?.focus()}handleYearKeydown(t){const i=t.target;if(!i.classList.contains("gui-calendar__year-button"))return;const n=Array.from(this.querySelectorAll(".gui-calendar__year-button")),s=n.indexOf(i),r=window.getComputedStyle(this).direction==="rtl";let a=0;switch(t.key){case"ArrowLeft":a=r?1:-1;break;case"ArrowRight":a=r?-1:1;break;case"ArrowUp":a=-4;break;case"ArrowDown":a=4;break;case"Enter":case" ":{t.preventDefault();const l=parseInt(i.dataset.year??"",10);isNaN(l)||this.selectYear(l);return}case"Escape":{t.preventDefault(),this.querySelector(".gui-calendar__year-selector")?.focus(),this._yearSelectorOpen=!1;return}default:return}t.preventDefault();const o=s+a;o>=0&&o<n.length&&n[o].focus()}get _effectiveMinYear(){return this.minDate?new Date(this.minDate).getFullYear():1900}get _effectiveMaxYear(){return this.maxDate?new Date(this.maxDate).getFullYear():2099}get _yearList(){const t=[];for(let i=this._effectiveMinYear;i<=this._effectiveMaxYear;i++)t.push(i);return t}async handleKeydown(t,i){if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)&&t.key!==" "&&t.key!=="Enter")return;const s=Array.from(this.querySelectorAll(".gui-calendar__day-button:not(.other-month)")),r=s.indexOf(t.target),a=window.getComputedStyle(this).direction==="rtl";let o=0;switch(t.key){case"ArrowLeft":o=a?1:-1;break;case"ArrowRight":o=a?-1:1;break;case"ArrowUp":o=-7;break;case"ArrowDown":o=7;break;case" ":case"Enter":t.preventDefault(),this.selectDate(i,t);return}t.preventDefault();const l=this.findNextFocusableIndex(r,o,s);let d=!1;if(l<0)if(this.canGoPrev())this.prevMonth(),d=!0;else{s.find(h=>!this.isButtonDisabled(h))?.focus();return}else if(l>=s.length)if(this.canGoNext())this.nextMonth(),d=!0;else{[...s].reverse().find(p=>!this.isButtonDisabled(p))?.focus();return}if(d){await this.updateComplete;const c=Array.from(this.querySelectorAll(".gui-calendar__day-button:not(.other-month)")),h=Array.from(this.querySelectorAll(".gui-calendar__panel"));let p;if(l<0)p=h[0].querySelectorAll(".gui-calendar__day-button:not(.other-month)").length+l;else{const f=h[h.length-1].querySelectorAll(".gui-calendar__day-button:not(.other-month)").length;p=c.length-f+(l-s.length)}if(this.isButtonDisabled(c[p])){const m=this.findNextFocusableIndex(p,o,c);if(m<0||m>=c.length){const f=c.findIndex(w=>!this.isButtonDisabled(w));f>-1&&c[f].focus()}else c[m]?.focus()}else{const m=Math.max(0,Math.min(p,c.length-1));c[m]?.focus()}}else s[l]?.focus()}chunkDays(t){const i=[];for(let n=0;n<t.length;n+=7)i.push(t.slice(n,n+7));return i}onFocusOut(t){t.relatedTarget&&this.contains(t.relatedTarget)||(this._blurRafId!==void 0&&cancelAnimationFrame(this._blurRafId),this._blurRafId=requestAnimationFrame(()=>{this._blurRafId=void 0,this.contains(document.activeElement)||this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}))}disconnectedCallback(){super.disconnectedCallback(),this._blurRafId!==void 0&&cancelAnimationFrame(this._blurRafId)}isDisabled(t){const i=rt(t);if(this.minDate&&i<this.minDate||this.maxDate&&i>this.maxDate)return!0;if(this.disabledRanges&&this.disabledRanges.length>0)for(const n of this.disabledRanges){const s=n.start.split("T")[0],r=n.end?n.end.split("T")[0]:s;if(i>=s&&i<=r)return!0}return!1}prevMonth(){const t=this._currentDate;this._currentDate=new Date(t.getFullYear(),t.getMonth()-1,1)}nextMonth(){const t=this._currentDate;this._currentDate=new Date(t.getFullYear(),t.getMonth()+1,1)}generateDateGrid(t=0){const i=this._currentDate.getFullYear(),n=this._currentDate.getMonth()+t,s=new Date(i,n,1),r=s.getDay(),a=rs(this.localeId)[0],o=(r-a+7)%7,l=new Date(s);l.setDate(s.getDate()-o);const d=[];for(let c=0;c<42;c++){const h=new Date(l);h.setDate(l.getDate()+c),d.push(h)}return d}findNextFocusableIndex(t,i,n){let s=t+i;for(;s>=0&&s<n.length;){const r=n[s];if(!this.isButtonDisabled(r))return s;s+=i}return s}isButtonDisabled(t){return t?t.hasAttribute("disabled"):!0}canGoPrev(){if(!this.minDate)return!0;const t=new Date(this._currentDate.getFullYear(),this._currentDate.getMonth(),0);return rt(t)>=this.minDate}canGoNext(){if(!this.maxDate)return!0;const t=(this.numberOfMonths??1)-1,i=new Date(this._currentDate.getFullYear(),this._currentDate.getMonth()+t+1,1);return rt(i)<=this.maxDate}}te([u({type:String})],V.prototype,"uid"),te([u({type:String})],V.prototype,"label"),te([u({type:String})],V.prototype,"hint"),te([u({type:String,attribute:"locale-id"})],V.prototype,"localeId"),te([u({type:Array})],V.prototype,"errors"),te([u({type:Boolean})],V.prototype,"touched"),te([u({type:Boolean})],V.prototype,"required"),te([u({type:Boolean})],V.prototype,"disabled"),te([u({type:Boolean,attribute:"readonly"})],V.prototype,"readOnly"),te([u({type:String,attribute:"prev-month-icon"})],V.prototype,"prevMonthIcon"),te([u({type:String,attribute:"next-month-icon"})],V.prototype,"nextMonthIcon"),te([u({type:String,attribute:"prev-month-aria-label"})],V.prototype,"prevMonthAriaLabel"),te([u({type:String,attribute:"next-month-aria-label"})],V.prototype,"nextMonthAriaLabel"),te([u({type:String})],V.prototype,"dayFormat"),te([u({type:String})],V.prototype,"weekdayFormat"),te([u({type:String})],V.prototype,"monthFormat"),te([u({type:String})],V.prototype,"minDate"),te([u({type:String})],V.prototype,"maxDate"),te([u({type:Array})],V.prototype,"disabledRanges"),te([u({type:Number})],V.prototype,"numberOfMonths"),te([Y()],V.prototype,"_currentDate"),te([Y()],V.prototype,"_yearSelectorOpen");var Bd=Object.defineProperty,jd=Object.getOwnPropertyDescriptor,ms=(e,t,i,n)=>{for(var s=n>1?void 0:n?jd(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&Bd(t,i,s),s};let mi=class extends V{constructor(){super(...arguments),this.value=void 0}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){if(e.has("value")&&this.value){const t=new Date(this.value);!isNaN(t.getTime())&&!gt(t,this._currentDate,this.numberOfMonths??1)&&(this._currentDate=t)}}renderDay(e){const t={"gui-calendar__day-button":!0,today:e.isToday,selected:e.isSelected,disabled:e.isDisabled,"other-month":!e.isCurrentMonth};return v`
158
+ <button
159
+ type="button"
160
+ role="gridcell"
161
+ class=${fe(t)}
162
+ tabindex=${e.isFocusable?0:-1}
163
+ ?disabled=${!e.isCurrentMonth||e.isDisabled}
164
+ data-date=${e.date.toISOString()}
165
+ @click=${()=>this.selectDate(e)}
166
+ @keydown=${i=>this.handleKeydown(i,e)}
167
+ aria-selected=${e.isSelected}
168
+ >
169
+ ${e.dayLabel}
170
+ </button>
171
+ `}getDaysInMonth(e){const t=new Date(this._currentDate);t.setDate(1),t.setMonth(t.getMonth()+e);const i=this.generateDateGrid(e),n=t.getMonth();let s=i.map(r=>{const a=r.getMonth()===n,o=this.isDisabled(r),l=!!this.value&&Ut(r,new Date(this.value)),d=as(r),c=(l||d)&&a;return{date:r,dayLabel:os(this.localeId,r),isCurrentMonth:a,isToday:d,isDisabled:o,isSelected:l,isFocusable:c}});for(let r=0;r<2;r++)s.slice(-7).every(o=>!o.isCurrentMonth)&&(s=s.slice(0,-7));if(e===0&&!s.some(r=>r.isFocusable)){const r=this.value?new Date(this.value):new Date;if(!gt(r,this._currentDate,this.numberOfMonths??1)){const a=s.find(o=>o.isCurrentMonth&&!o.isDisabled);a&&(a.isFocusable=!0)}}return s}selectDate(e){if(!e.isCurrentMonth||e.isDisabled||this.disabled||this.readOnly)return;const t=rt(e.date);this.value=t,this.dispatchEvent(new CustomEvent("change",{detail:{value:t},bubbles:!0,composed:!0}))}};ms([u({type:String})],mi.prototype,"value",2),mi=ms([ue("gui-calendar")],mi),typeof customElements<"u"&&!customElements.get("gui-calendar")&&customElements.define("gui-calendar",mi);function Zd(e){const t=e.widget,{uid:i,errors:n,value:s,isTouched:r,templateData:a,onBlur:o,onValueChanged:l}=x.useInputWidget(t),d=g.useCallback(H=>{const K=H,W=J=>l(J.detail.value),G=J=>{o()};return H&&(K.addEventListener("blur",G),K.addEventListener("change",W)),()=>{K.removeEventListener("blur",G),K.removeEventListener("change",W)}},[l,o]),c=a.label,h=a.hint,p=a.prevMonthIcon,m=a.nextMonthIcon,f=a.prevMonthAriaLabel,w=a.nextMonthAriaLabel,S=a.dayFormat,T=a.weekdayFormat,C=a.monthFormat,I=a.minDate,A=a.maxDate,D=a.disabledRanges,k=a.numberOfMonths,P=a.lang,O=a.disabled,E=a.readonly,B=a.validator?.required;return y.jsx("div",{className:"gui-calendar gui-field",style:{flex:a.size},children:y.jsx("gui-calendar",{ref:d,uid:i,label:c,hint:h,errors:n,touched:r,required:B,disabled:O,readOnly:E,value:s,prevMonthIcon:p,nextMonthIcon:m,prevMonthAriaLabel:f,nextMonthAriaLabel:w,dayFormat:S,weekdayFormat:T,monthFormat:C,minDate:I,maxDate:A,disabledRanges:D,numberOfMonths:k,localeId:P})})}const qd=Object.freeze(Object.defineProperty({__proto__:null,Calendar:Zd},Symbol.toStringTag,{value:"Module"}));var Vd=Object.defineProperty,Ud=Object.getOwnPropertyDescriptor,re=(e,t,i,n)=>{for(var s=n>1?void 0:n?Ud(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&Vd(t,i,s),s};let ie=class extends ee{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.currency=void 0,this.step=void 0,this.maximumFractionDigits=void 0,this.minimumFractionDigits=void 0,this.hint=void 0,this.icon=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.ariaController=new Fe(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){e.has("value")&&document.activeElement!==this.inputElement&&(this.displayValue=this.formatCurrency(this.value))}render(){super.render();const e={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,currency:this.currency,maximumFractionDigits:this.maximumFractionDigits,minimumFractionDigits:this.minimumFractionDigits,icon:this.icon,placeholder:this.placeholder,autocomplete:this.autocomplete};this.displayValue=this.formatCurrency(this.value);const t=pi("currency",e),i={"gui-currency--icon":!!this.icon};return v`
172
+ ${Ge(this.uid,e)}
173
+
174
+ <div class="gui-widget">
175
+ <input
176
+ type="number"
177
+ inputmode="decimal"
178
+ id=${this.uid}
179
+ data-cy=${`${this.uid}_currency`}
180
+ class=${fe(i)}
181
+ step=${this.step&&this.step>0?this.step:_}
182
+ .value=${this.value??""}
183
+ ?required=${this.disabled}
184
+ ?disabled=${this.disabled}
185
+ ?readonly=${this.readOnly}
186
+ placeholder=${this.placeholder||_}
187
+ autocomplete=${this.autocomplete||_}
188
+ @input=${this.handleInput}
189
+ @focus=${this.handleFocus}
190
+ @blur=${this.handleBlur}
191
+ />
192
+ ${this.displayValue?v`<label
193
+ for=${this.uid}
194
+ class="gui-currency__format-value ${this.icon?"gui-currency__format-value--icon":""}"
195
+ >${this.displayValue}</label
196
+ >`:_}
197
+ ${t.html}
198
+ </div>
199
+
200
+ ${Ee(this.uid,e)}
201
+ `}handleInput(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.displayValue=this.formatCurrency(t.valueAsNumber),this.dispatchEvent(new CustomEvent("input",{detail:{value:t.valueAsNumber},bubbles:!0,composed:!0}))}}handleFocus(){this.displayValue=this.formatCurrency(this.value)}handleBlur(){this.displayValue=this.formatCurrency(this.value),this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}formatCurrency(e){if(e===""||e===void 0||e===null||isNaN(e))return"";try{return new Intl.NumberFormat(this.localeId??"en",{style:"currency",currency:this.currency??"USD",maximumFractionDigits:this.maximumFractionDigits??Math.max(this.minimumFractionDigits??2,2),minimumFractionDigits:this.minimumFractionDigits??2}).format(e)}catch(t){return console.warn("Invalid locale or currency",t),e.toString()}}get separators(){const e=new Intl.NumberFormat(this.localeId??"en").format(1111.1);return{group:e.replace(/1/g,"").replace(/\d/g,"")[0]||",",decimal:e.replace(/1/g,"").replace(/\d/g,"").slice(-1)||"."}}};re([u({type:String})],ie.prototype,"uid",2),re([u({type:String})],ie.prototype,"label",2),re([u({type:String,attribute:"locale-id"})],ie.prototype,"localeId",2),re([u({type:Array})],ie.prototype,"errors",2),re([u({type:Boolean})],ie.prototype,"touched",2),re([u({type:Boolean})],ie.prototype,"required",2),re([u({type:Boolean})],ie.prototype,"disabled",2),re([u({type:Boolean,attribute:"readonly"})],ie.prototype,"readOnly",2),re([u({type:String})],ie.prototype,"value",2),re([u({type:String})],ie.prototype,"currency",2),re([u({type:String})],ie.prototype,"step",2),re([u({type:String})],ie.prototype,"maximumFractionDigits",2),re([u({type:String})],ie.prototype,"minimumFractionDigits",2),re([u({type:String})],ie.prototype,"hint",2),re([u({type:String})],ie.prototype,"icon",2),re([u({type:String})],ie.prototype,"placeholder",2),re([u({type:String})],ie.prototype,"autocomplete",2),re([Y()],ie.prototype,"displayValue",2),re([ss("input")],ie.prototype,"inputElement",2),ie=re([ue("gui-currency")],ie),typeof customElements<"u"&&!customElements.get("gui-currency")&&customElements.define("gui-currency",ie);function Hd(e){const t=e.widget,{uid:i,errors:n,value:s,isTouched:r,templateData:a,onValueChanged:o,onBlur:l}=x.useInputWidget(t),d=g.useCallback(P=>o(P.nativeEvent.detail.value),[o]),c=a.label,h=a.hint,p=a.placeholder,m=a.currency,f=a.step,w=a.maximumFractionDigits,S=a.minimumFractionDigits,T=a.autocomplete,C=a.icon,I=a.disabled,A=a.readonly,D=a.validator?.required,k=a.lang;return y.jsx("div",{className:"gui-currency gui-field",style:{flex:a.size},children:y.jsx("gui-currency",{uid:i,label:c,hint:h,errors:n,touched:r,required:D,disabled:I,readOnly:A,value:s,currency:m,step:f,maximumFractionDigits:w,minimumFractionDigits:S,icon:C,autocomplete:T??void 0,placeholder:p??void 0,localeId:k,onInput:d,onBlur:l})})}const Wd=Object.freeze(Object.defineProperty({__proto__:null,Currency:Hd},Symbol.toStringTag,{value:"Module"}));const ys=qt(class extends Vt{constructor(e){if(super(e),e.type!==tt.PROPERTY&&e.type!==tt.ATTRIBUTE&&e.type!==tt.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Nd(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===ze||t===_)return t;const i=e.element,n=e.name;if(e.type===tt.PROPERTY){if(t===i[n])return ze}else if(e.type===tt.BOOLEAN_ATTRIBUTE){if(!!t===i.hasAttribute(n))return ze}else if(e.type===tt.ATTRIBUTE&&i.getAttribute(n)===t+"")return ze;return cs(e),t}});var Gd=Object.defineProperty,Yd=Object.getOwnPropertyDescriptor,Ie=(e,t,i,n)=>{for(var s=n>1?void 0:n?Yd(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&Gd(t,i,s),s};let ge=class extends ee{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.icon="",this.hint=void 0,this._day="",this._month="",this._year="",this.MIN_DAY=1,this.MAX_DAY=31,this.MAX_VALID_DAY=(e,t)=>e===2?new Date(t,1,29).getDate()===29||!t?29:28:e===4||e===6||e===9||e===11?30:31,this.MIN_MONTH=1,this.MAX_MONTH=12,this.MIN_YEAR=1e3,this.MAX_YEAR=9999,this.ariaController=new Fe(this,{getTargets:()=>this.querySelectorAll(".gui-date-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){e.has("value")&&this.parseValue(this.value??"")}render(){const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,icon:this.icon,hint:this.hint},t=new Intl.DateTimeFormat(this.localeId??"en",{year:"numeric",month:"numeric",day:"numeric"}).formatToParts(new Date),i={"gui-widget-icon":!0,[this.icon]:!0};return v`
202
+ ${this.label?Ge(this.uid,e):_}
203
+
204
+ <div class="gui-widget">
205
+ <div class="gui-date-input ${this.icon?"gui-calendar--icon":""}" role="group">
206
+ ${it(t,n=>n.type,(n,s)=>{const r=s===0?0:-1;switch(n.type){case"day":return this.renderInput("day","dd",2,r,this._day);case"month":return this.renderInput("month","mm",2,r,this._month);case"year":return this.renderInput("year","yyyy",4,r,this._year);case"literal":return v`<span class="gui-date-input__separator">${n.value}</span>`;default:return""}})}
207
+ </div>
208
+ ${this.icon?v`<span class=${fe(i)} data-icon=${this.icon}></span>`:_}
209
+ </div>
210
+
211
+ ${this.showErrors&&this.errors?.length?Ee(this.uid,e):_}
212
+ `}renderInput(e,t,i,n,s){return v`
213
+ <div class="gui-date-input__touch-target">
214
+ <input
215
+ type="text"
216
+ inputmode="numeric"
217
+ class="gui-date-input__part ${e==="year"?"gui-date-input__year":""}"
218
+ data-type=${e}
219
+ maxlength=${i}
220
+ placeholder=${t}
221
+ tabindex=${n}
222
+ ?required=${this.required}
223
+ ?disabled=${this.disabled}
224
+ ?readonly=${this.readOnly}
225
+ autocomplete="off"
226
+ .value=${ys(s)}
227
+ @keydown=${this.handleKeyDown}
228
+ @keyup=${r=>this.handleKeyUp(r,e)}
229
+ @focus=${this.handleFocus}
230
+ @blur=${r=>this.handleBlur(r,e)}
231
+ @change=${r=>this.handleChange(r,e)}
232
+ />
233
+ <div class="gui-date-input__visual-underline"></div>
234
+ </div>
235
+ `}parseValue(e){if(!e){this._day="",this._month="",this._year="";return}const t=new Date(e);isNaN(t.getTime())||(this._day=t.getDate().toString().padStart(2,"0"),this._month=(t.getMonth()+1).toString().padStart(2,"0"),this._year=t.getFullYear().toString())}handleKeyDown(e){["Backspace","Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Delete","Enter"].includes(e.key)||e.ctrlKey||e.metaKey||this.readOnly||/^[0-9]$/.test(e.key)||e.preventDefault()}handleFocus(e){this.dispatchEvent(new CustomEvent("focus",{detail:e}))}handleKeyUp(e,t){if(this.readOnly)return;const i=window.getComputedStyle(this).direction==="rtl",n=e.target,s=Array.from(this.querySelectorAll("input")),r=s.indexOf(n);switch(n.value.length===n.maxLength&&/^[0-9]$/.test(e.key)&&(r===s.length-1?s[0].focus():s[r+1].focus()),e.key){case"ArrowUp":{const a=isNaN(parseInt(n.value,10)+1)?1:parseInt(n.value,10)+1;t==="year"&&(this._year=a.toString().padStart(4,"0")),t==="month"&&(this._month=a.toString().padStart(2,"0")),t==="day"&&(this._day=a.toString().padStart(2,"0")),n.select(),this.validateAndEmit();break}case"ArrowDown":{const a=isNaN(parseInt(n.value,10)-1)?1:parseInt(n.value,10)-1;t==="year"&&(this._year=a.toString().padStart(4,"0")),t==="month"&&(this._month=a.toString().padStart(2,"0")),t==="day"&&(this._day=a.toString().padStart(2,"0")),n.select(),this.validateAndEmit();break}case"ArrowLeft":{const a=i?r+1:r-1;a>=0&&a<s.length&&(s[a].focus(),s[a].select());break}case"ArrowRight":{const a=i?r-1:r+1;a>=0&&a<s.length&&(s[a].focus(),s[a].select());break}}}handleChange(e,t){if(e.stopImmediatePropagation(),this.readOnly)return;const n=e.target.value.replace(/[^0-9]/g,"");switch(t){case"day":this._day=n;break;case"month":this._month=n;break;case"year":this._year=n;break}this.validateAndEmit()}handleBlur(e,t){const i=e.target,n=parseInt(i.value,10);if(!isNaN(n)&&n>0){const s=t==="year"?4:2;i.value=n.toString().padStart(s,"0")}else this.dispatchEvent(new CustomEvent("change",{detail:{value:null}}));this.dispatchEvent(new CustomEvent("blur"))}validateAndEmit(){let e=parseInt(this._year,10),t=parseInt(this._month,10),i=parseInt(this._day,10);e>this.MAX_YEAR&&(e=this.MAX_YEAR,this._year=e.toString().padStart(4,"0")),e<this.MIN_YEAR&&(e=this.MIN_YEAR,this._year=e.toString().padStart(4,"0")),t>this.MAX_MONTH&&(t=this.MAX_MONTH,this._month=t.toString().padStart(2,"0")),t<this.MIN_MONTH&&(t=this.MIN_MONTH,this._month=t.toString().padStart(2,"0")),i>this.MAX_DAY&&(i=this.MAX_DAY,this._day=i.toString().padStart(2,"0")),i<this.MIN_DAY&&(i=this.MIN_DAY,this._day=i.toString().padStart(2,"0"));const n=!isNaN(e)&&String(e).length===4,s=!isNaN(t)&&t>0;if(!isNaN(i)&&i>0&&s&&n){const a=this.MAX_VALID_DAY(t,e);if(i>a)this.dispatchEvent(new CustomEvent("inputError",{detail:{message:"Invalid date: day is greater than the maximum valid day for the month and year."},bubbles:!0}));else{const o=new Date(e,t-1,i);this.value=rt(o),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0}))}}this.requestUpdate()}};Ie([u({type:String})],ge.prototype,"uid",2),Ie([u({type:String})],ge.prototype,"label",2),Ie([u({type:String,attribute:"locale-id"})],ge.prototype,"localeId",2),Ie([u({type:Array})],ge.prototype,"errors",2),Ie([u({type:Boolean})],ge.prototype,"showErrors",2),Ie([u({type:Boolean})],ge.prototype,"touched",2),Ie([u({type:Boolean})],ge.prototype,"required",2),Ie([u({type:Boolean})],ge.prototype,"disabled",2),Ie([u({type:Boolean,attribute:"readonly"})],ge.prototype,"readOnly",2),Ie([u({type:String})],ge.prototype,"value",2),Ie([u({type:String})],ge.prototype,"icon",2),Ie([u({type:String})],ge.prototype,"hint",2),Ie([Y()],ge.prototype,"_day",2),Ie([Y()],ge.prototype,"_month",2),Ie([Y()],ge.prototype,"_year",2),ge=Ie([ue("gui-date")],ge),typeof customElements<"u"&&!customElements.get("gui-date")&&customElements.define("gui-date",ge);function Kd(e){const t=e.widget,{uid:i,errors:n,value:s,isTouched:r,templateData:a,onValueChanged:o,onBlur:l,injectValidationIssues:d}=x.useInputWidget(t),c=g.useCallback(C=>{const I=C,A=k=>{d(null),o(k.detail.value)},D=k=>{d([k.detail.message])};return C&&(I.addEventListener("change",A),I.addEventListener("blur",l),I.addEventListener("inputError",D)),()=>{I.removeEventListener("change",A),I.removeEventListener("blur",l),I.removeEventListener("inputError",D)}},[o,l,d]),h=a.label,p=a.hint,m=a.icon,f=a.disabled,w=a.readonly,S=a.validator?.required,T=a.lang;return y.jsx("div",{className:"gui-date gui-field",style:{flex:a.size},children:y.jsx("gui-date",{ref:c,uid:i,label:h,hint:p,errors:n,touched:r,required:S,disabled:f,readOnly:w,value:s,icon:m,localeId:T})})}const Jd=Object.freeze(Object.defineProperty({__proto__:null,DateInput:Kd},Symbol.toStringTag,{value:"Module"}));function fs({errors:e,uid:t}){return y.jsx("ul",{className:"gui-validator",id:`${t}_errors`,"data-cy":`${t}_validator-errors`,children:e.map((i,n)=>y.jsx("li",{className:"gui-validator__error",role:"alert","data-cy":`${t}_validator-error`,children:i},n))})}function Xd(e){const t=e.widget,{uid:i,errors:n,value:s,isTouched:r,templateData:a,onValueChanged:o,onBlur:l,injectValidationIssues:d}=x.useInputWidget(t),[c,h]=g.useState(!1),p=g.useRef(null),m=g.useRef(null),f=g.useRef(null),w=g.useCallback(X=>{const j=X,Oe=dt=>{d(null),o(dt.detail.value)},Te=dt=>{d([dt.detail.message])},De=()=>{h(!0)};return m.current=X,X&&(j.addEventListener("change",Oe),j.addEventListener("focus",De),j.addEventListener("blur",l),j.addEventListener("inputError",Te)),()=>{j.removeEventListener("change",Oe),j.removeEventListener("focus",De),j.removeEventListener("blur",l),j.removeEventListener("inputError",Te)}},[o,l,d]),S=g.useCallback(X=>{const j=X,Oe=De=>{d(null),o(De.detail.value)},Te=De=>{l(),h(!1)};return f.current=X,X&&(j.addEventListener("blur",Te),j.addEventListener("change",Oe)),()=>{j.addEventListener("blur",Te),j.addEventListener("change",Oe)}},[o,d,l]);g.useEffect(()=>{const X=j=>{if(!c)return;const Oe=j.composedPath(),Te=m.current&&Oe.includes(m.current),De=f.current&&Oe.includes(f.current);!Te&&!De&&h(!1)};return document.addEventListener("click",X),()=>{document.removeEventListener("click",X)}},[c]);const T=X=>{if(!c)return;const j=X.relatedTarget;j&&p.current?.contains(j)||h(!1)},C=X=>{const j=X.target,Oe=j.closest(".gui-date-input__part"),Te=j.closest("gui-calendar");Oe||Te?c||h(!0):h(De=>!De)},I=a.hint,A=a.icon,D=a.prevMonthIcon,k=a.nextMonthIcon,P=a.prevMonthAriaLabel,O=a.nextMonthAriaLabel,E=a.dayFormat,B=a.weekdayFormat,H=a.monthFormat,K=a.minDate,W=a.maxDate,G=a.disabledRanges,J=a.numberOfMonths,Ze=r&&n&&n.length>0,Tt=a.disabled,Pt=a.readonly,lt=a.validator?.required,Dt=a.lang;return y.jsxs("div",{ref:p,className:"gui-date-picker gui-field",style:{flex:a.size},onBlur:T,children:[a.label&&y.jsxs("label",{className:"gui-label",htmlFor:i,"data-cy":`${i}_label`,children:[a.label+(lt?" *":""),I&&y.jsx("div",{className:"gui-widget-hint",id:`${i}_hint`,children:I})]}),y.jsxs("div",{role:"button",tabIndex:-1,className:"gui-widget",onClick:C,onKeyUp:X=>{X.target===X.currentTarget&&(X.key==="Enter"||X.key===" ")&&h(j=>!j)},"aria-expanded":c,children:[y.jsx("gui-date",{ref:w,uid:i,hint:I,showErrors:!1,errors:n,touched:r,required:lt,disabled:Tt,readOnly:Pt,value:s,icon:A,localeId:Dt}),y.jsx("span",{className:"gui-date-picker__arrow",children:y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"})})}),c&&y.jsx("gui-calendar",{ref:S,uid:i,hint:I,touched:r,required:lt,disabled:Tt,readOnly:Pt,value:s,prevMonthIcon:D,nextMonthIcon:k,prevMonthAriaLabel:P,nextMonthAriaLabel:O,dayFormat:E,weekdayFormat:B,monthFormat:H,minDate:K,maxDate:W,disabledRanges:G,numberOfMonths:J,localeId:Dt})]}),Ze&&y.jsx(fs,{errors:n,uid:i})]})}const Qd=Object.freeze(Object.defineProperty({__proto__:null,DatePicker:Xd},Symbol.toStringTag,{value:"Module"}));function gs({template:e,selected:t,disabled:i,focused:n}){const s=["gui-list__item",i?"gui-list__item-disabled":"",t?"gui-list__item-selected":"",n?"gui-list__item-focused":""].filter(Boolean).join(" ");return y.jsx("div",{role:"option",className:s,"aria-selected":t,children:e})}var eu=Object.defineProperty,tu=Object.getOwnPropertyDescriptor,et=(e,t,i,n)=>{for(var s=n>1?void 0:n?tu(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&eu(t,i,s),s};let Ve=class extends ee{constructor(){super(...arguments),this.targetElement=void 0,this.uid=void 0,this.label=void 0,this.hint=void 0,this.required=void 0,this.errors=[],this.disabled=!1,this.readOnly=!1,this.touched=!1,this.native=!0,this.ariaController=new Fe(this,{getTargets:()=>Array.isArray(this.targetElement)?[...this.targetElement]:[this.targetElement],getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}render(){return super.render(),v`${Ge(this.uid,{label:this.label,hint:this.hint,required:this.required,errors:this.errors,touched:this.touched},!1,void 0,this.native)}`}};et([u({type:Object})],Ve.prototype,"targetElement",2),et([u({type:String})],Ve.prototype,"uid",2),et([u({type:String})],Ve.prototype,"label",2),et([u({type:String})],Ve.prototype,"hint",2),et([u({type:Boolean})],Ve.prototype,"required",2),et([u({type:Array})],Ve.prototype,"errors",2),et([u({type:Boolean})],Ve.prototype,"disabled",2),et([u({type:Boolean,attribute:"readonly"})],Ve.prototype,"readOnly",2),et([u({type:Boolean})],Ve.prototype,"touched",2),et([u({type:Boolean})],Ve.prototype,"native",2),Ve=et([ue("gui-label")],Ve),typeof customElements<"u"&&!customElements.get("gui-label")&&customElements.define("gui-label",Ve);const iu=e=>e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"template")&&Object.prototype.hasOwnProperty.call(e,"value");function nu(e){const t=typeof e;return t==="string"||t==="number"}const su=(e,{valueField:t})=>{if(e===null||typeof e!="object")return!1;const i=e,n=t??"value";return!!Object.prototype.hasOwnProperty.call(i,n)};function au(e,{valueField:t}){if(e===null||typeof e!="object")throw new Error("Provided value is not an object");const i=e,n=t??"value",s=Object.prototype.hasOwnProperty.call(i,n)?n:void 0;if(!s)throw new Error("No valueField exists on the object");return r=>{if(r===null||typeof r!="object")throw new Error("Item is not an object");return{template:r,value:s?r[s]:""}}}const ru=(e,t)=>{if(Array.isArray(e)&&e.length>0&&!iu(e[0])){if(nu(e[0]))return e.map(i=>({template:i,value:i}));if(su(e[0],t)){const i=au(e[0],t);return e.map(i)}else throw new Error("Invalid list item shape")}return e};var ou=Object.defineProperty,lu=Object.getOwnPropertyDescriptor,be=(e,t,i,n)=>{for(var s=n>1?void 0:n?lu(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&ou(t,i,s),s};let oe=class extends ee{constructor(){super(...arguments),this.uid=void 0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.valueField=void 0,this.label=void 0,this.hint=void 0,this.items=[],this.itemHeight=void 0,this.height=void 0,this._items=[],this._scrollTop=0,this._viewportHeight=0,this._focusedIndex=-1,this.buffer=5}willUpdate(e){super.willUpdate(e),e.has("items")&&this.updateItems(),(e.has("items")||e.has("_scrollTop")||e.has("height"))&&this.emitRangeChange()}firstUpdated(){this.measureViewport(),new ResizeObserver(()=>this.measureViewport()).observe(this.viewportElement)}render(){const e=this.height??300,t=this.itemHeight??40,i=(this.items?.length??0)*t,{offsetY:n}=this.calculateRange(),s=this._focusedIndex>=0?`${this.uid}-item-${this._focusedIndex}`:void 0;return v`
236
+ <div
237
+ role="listbox"
238
+ id=${this.uid}
239
+ tabindex=${this.disabled?-1:0}
240
+ class="gui-list__scroll-viewport"
241
+ style="max-height: ${e}px; overflow-y: auto; position: relative; display: block;"
242
+ @scroll="${this.onScroll}"
243
+ @keydown="${this.onKeyDown}"
244
+ @focus="${this.onFocus}"
245
+ @focusout="${this.onFocusOut}"
246
+ aria-required=${this.required?"true":_}
247
+ aria-disabled=${this.disabled||this.readOnly?"true":_}
248
+ aria-activedescendant="${s??_}"
249
+ aria-label=${this.label??_}
250
+ aria-description=${this.hint??_}
251
+ >
252
+ <div
253
+ class="gui-list__spacer"
254
+ style="height: ${i}px; width: 1px; opacity: 0; pointer-events: none;"
255
+ ></div>
256
+
257
+ <div
258
+ class="gui-list__content"
259
+ style="transform: translateY(${n}px); position: absolute; top: 0; left: 0; width: 100%;"
260
+ >
261
+ <slot></slot>
262
+ </div>
263
+ </div>
264
+ `}focus(e){this.viewportElement?this.viewportElement.focus(e):super.focus(e)}focusItemAtIndex(e){this._focusedIndex=e}scrollToSelectedIndex(){const e=this.items.findIndex(t=>(this.valueField?t[this.valueField]:t)===this.value);this.scrollToIndex(e)}onKeyDown(e){if(this.disabled||this.readOnly)return;const t=this.itemHeight??40,i=Math.ceil(this._viewportHeight/t),n=this.items.length-1;let s=!1;switch(e.key){case"ArrowDown":this.setFocusedIndex(Math.min(this._focusedIndex+1,n)),s=!0;break;case"ArrowUp":this.setFocusedIndex(Math.max(this._focusedIndex-1,0)),s=!0;break;case"PageDown":this.setFocusedIndex(Math.min(this._focusedIndex+i,n)),s=!0;break;case"PageUp":this.setFocusedIndex(Math.max(this._focusedIndex-i,0)),s=!0;break;case"Home":this.setFocusedIndex(0),s=!0;break;case"End":this.setFocusedIndex(n),s=!0;break;case"Enter":case" ":{const r=this.items[this._focusedIndex],a=r!=null;this._focusedIndex>=0&&a&&this.selectItem(this.items[this._focusedIndex]),s=!0;break}}s&&e.preventDefault()}onFocus(){if(!this.value||!this.items.length)return;const e=this.items.findIndex(t=>(this.valueField?t[this.valueField]:t)===this.value);this._focusedIndex=e,this.scrollToIndex(e),this.dispatchEvent(new CustomEvent("gui-focus-change",{detail:{index:e},bubbles:!0,composed:!0}))}onFocusOut(e){e.relatedTarget&&this.contains(e.relatedTarget)||(this._focusedIndex=-1,this.dispatchEvent(new CustomEvent("gui-focus-change",{detail:{index:-1},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0})))}scrollToIndex(e){const t=this.itemHeight??40,i=this.height??300,n=e*t,s=n+t,r=this.viewportElement.scrollTop,a=r+i;n<r?this.viewportElement.scrollTop=n:s>a&&(this.viewportElement.scrollTop=s-i)}selectItem(e){this.dispatchEvent(new CustomEvent("change",{detail:{value:this.valueField?e[this.valueField]:e},bubbles:!0,composed:!0}))}setFocusedIndex(e){e<0||e>=this.items.length||(this._focusedIndex=e,this.scrollToIndex(e),this.dispatchEvent(new CustomEvent("gui-focus-change",{detail:{index:e},bubbles:!0,composed:!0})))}updateItems(){this._items=ru(this.items,{valueField:this.valueField}),this.dispatchEvent(new CustomEvent("gui-update-items",{detail:this._items,bubbles:!0,composed:!0}))}emitRangeChange(){const{startIndex:e,endIndex:t}=this.calculateRange();this.dispatchEvent(new CustomEvent("gui-range-change",{detail:{startIndex:e,endIndex:t},bubbles:!0,composed:!0}))}measureViewport(){this.viewportElement&&(this._viewportHeight=this.viewportElement.offsetHeight,this.emitRangeChange())}onScroll(e){const t=e.target;this._scrollTop=t.scrollTop}calculateRange(){const e=this.itemHeight??40,t=this.items?.length??0,i=Math.ceil(this._viewportHeight/e),n=Math.floor(this._scrollTop/e),s=Math.max(0,n-this.buffer),r=Math.min(t,n+i+this.buffer),a=s*e;return{startIndex:s,endIndex:r,offsetY:a}}};be([u({type:String})],oe.prototype,"uid",2),be([u({type:Boolean})],oe.prototype,"touched",2),be([u({type:Boolean})],oe.prototype,"required",2),be([u({type:Boolean})],oe.prototype,"disabled",2),be([u({type:Boolean,attribute:"readonly"})],oe.prototype,"readOnly",2),be([u({type:String})],oe.prototype,"value",2),be([u({type:String})],oe.prototype,"valueField",2),be([u({type:String})],oe.prototype,"label",2),be([u({type:String})],oe.prototype,"hint",2),be([u({type:Array})],oe.prototype,"items",2),be([u({type:Number})],oe.prototype,"itemHeight",2),be([u({type:Number})],oe.prototype,"height",2),be([Y()],oe.prototype,"_items",2),be([Y()],oe.prototype,"_scrollTop",2),be([Y()],oe.prototype,"_viewportHeight",2),be([Y()],oe.prototype,"_focusedIndex",2),be([ss(".gui-list__scroll-viewport")],oe.prototype,"viewportElement",2),oe=be([ue("gui-list")],oe),typeof customElements<"u"&&!customElements.get("gui-list")&&customElements.define("gui-list",oe);var du=Object.defineProperty,uu=Object.getOwnPropertyDescriptor,yi=(e,t,i,n)=>{for(var s=n>1?void 0:n?uu(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&du(t,i,s),s};let It=class extends ee{constructor(){super(...arguments),this.uid=void 0,this.errors=[],this.touched=!1}createRenderRoot(){return this}render(){return super.render(),v`${Ee(this.uid,{touched:this.touched,errors:this.errors})}`}};yi([u({type:String})],It.prototype,"uid",2),yi([u({type:Array})],It.prototype,"errors",2),yi([u({type:Boolean})],It.prototype,"touched",2),It=yi([ue("gui-errors")],It),typeof customElements<"u"&&!customElements.get("gui-errors")&&customElements.define("gui-errors",It);function cu(e){const t=e.widget,{uid:i,errors:n,value:s,isTouched:r,templateData:a,onFilter:o,onValueChanged:l,onBlur:d}=x.useInputWidget(t),[c,h]=g.useState({start:0,end:10}),[p,m]=g.useState([]),[f,w]=g.useState([]),[S,T]=g.useState(-1),[C,I]=g.useState(!1),[A,D]=g.useState(!1),[k,P]=g.useState(void 0),O=g.useRef(null),E=g.useRef(null),B=g.useRef(null),H=g.useMemo(()=>p.slice(c.start,c.end),[p,c]),K=g.useCallback(()=>{d(),D(!1),I(!1)},[d]),W=g.useCallback($=>{if(l($),E.current){const z=(a.items||[]).find(q=>a.valueField?q[a.valueField]===$:q===$);if(z){const q=a.valueField?z[a.valueField]:z;E.current.value=String(q)}else $||(E.current.value="")}D(!1),I(!1)},[l,a]),G=g.useCallback(($,N)=>{a.readonly||(W($.value),o(""),T(N),P($),I(!1),D(!1),O.current&&O.current.focusItemAtIndex(N))},[W,o,a.readonly]);g.useEffect(()=>{const $=O.current;if(!$)return;const N=le=>{const{startIndex:ve,endIndex:Qe}=le.detail;h({start:ve,end:Qe})},z=le=>{const ve=le.detail;if(m(ve?[...ve]:[]),!k&&s!=null&&ve){const Qe=ve.find(_s=>_s.value===s);Qe&&P(Qe)}},q=le=>{const ve=le.detail.index;T(ve)},Xe=le=>{const ve=le.detail.value;W(ve),P(p.find(Qe=>Qe.value===ve)),I(!1),D(!1)};return $.addEventListener("gui-range-change",N),$.addEventListener("gui-update-items",z),$.addEventListener("gui-focus-change",q),$.addEventListener("change",Xe),()=>{$.removeEventListener("gui-range-change",N),$.removeEventListener("gui-update-items",z),$.removeEventListener("gui-focus-change",q),$.removeEventListener("change",Xe)}},[W,p,l]),g.useEffect(()=>{const $=N=>{if(!A)return;const z=N.target,q=E.current&&E.current.contains(z),Xe=O.current&&O.current.contains(z);!q&&!Xe&&K()};return document.addEventListener("click",$),()=>document.removeEventListener("click",$)},[K,A]),g.useEffect(()=>{const N=k?.template!==null&&typeof k?.template=="object"?a.labelField??"label":null,z=N?k?.template[N]:k?.template;E.current.value=z??""},[k,a.labelField]),g.useEffect(()=>{B.current&&E.current&&O.current&&(B.current.targetElement=[E.current,O.current])},[]);const J=async $=>{switch($.key){case"ArrowDown":$.preventDefault(),D(!0),setTimeout(()=>{O.current&&(O.current.focus(),O.current.scrollToSelectedIndex())},0);break;case"Enter":E.current?.value||W(null);break}},Ze=g.useCallback($=>{const N=!!t.on?.filter;if(o($),$&&!N){I(!0),D(!0);const z=a.searchFields??[a.labelField,a.valueField].filter(ve=>!!ve),q=z.length>0,le=(a.items||[]).filter(ve=>{const Qe=Object.keys(ve);if(!Qe.length)return ve.toString().toLowerCase().includes($.toLowerCase());const ks=(ji,Pc)=>ji||ve[Pc].toString().toLowerCase().includes($.toLowerCase());return q?Qe.filter(ji=>z.includes(ji)).reduce(ks,!1):Qe.reduce(ks,!1)});w(le)}else I(!1),w([...a.items||[]])},[t.on?.filter,o,a.items,a.labelField,a.searchFields,a.valueField]),Tt=x.useDebounceCallback(Ze,a.inputDebounce??500),Pt=$=>{const N=$.target.value;A||D(!0),Tt(N)},lt=g.useCallback(()=>{A||(D(!0),setTimeout(()=>{O.current&&O.current.scrollToSelectedIndex()},0))},[A]),Dt=$=>{const N=$.relatedTarget,z=E.current&&E.current.contains(N),q=O.current&&O.current.contains(N);z||q||K()},X=x.useItemRenderer(a.itemRenderer)||gs,j=a.label,Oe=a.validator?.required,Te=a.disabled,De=a.readonly,dt=!!t.on?.filter,ae=r&&n&&n.length>0;return y.jsxs("div",{className:"gui-dropdown gui-field",style:{flex:a.size},children:[y.jsx("gui-label",{ref:B,uid:i,label:j,hint:a.hint,errors:n,touched:r,required:Oe,native:!1}),y.jsxs("div",{className:"gui-widget","aria-expanded":A,children:[y.jsx("input",{ref:E,type:"text",id:i,"data-cy":`${i}_textinput`,defaultValue:s??"",required:Oe,disabled:Te,readOnly:De,placeholder:a.placeholder??"",autoComplete:a.autocomplete??void 0,onKeyDown:J,onInput:Pt,onFocus:lt,onBlur:Dt,"aria-labelledby":a.label?`${i}_label`:void 0,"aria-describedby":a.hint?`${i}_hint`:void 0}),y.jsx("span",{className:"gui-dropdown__arrow",children:y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"})})}),y.jsx("gui-list",{ref:O,id:`${i}-list`,uid:i,value:s??"",valueField:a.valueField,items:C&&!dt?f:a.items,itemHeight:a.itemHeight,height:a.height,required:Oe,touched:r,disabled:Te||De,readOnly:De,hidden:!A,onFocus:lt,onBlur:Dt,children:H.map(($,N)=>{const z=c.start+N,q=s===$.value,Xe=S===z,le=a.labelField??"label",Qe=$.template!==null&&typeof $.template=="object"&&le&&!a.itemRenderer?$.template[le]:$.template;return y.jsx("div",{role:"option",tabIndex:-1,className:"gui-list__item-wrapper",id:`${i}-item-${z}`,style:{height:`${a.itemHeight||40}px`},"aria-selected":q,onClick:()=>G($,z),children:y.jsx(X,{template:Qe,value:$.value,index:z,selected:q,disabled:Te||De,focused:Xe})},z)})})]}),ae&&y.jsx("gui-errors",{uid:i,errors:n,touched:r})]})}const hu=Object.freeze(Object.defineProperty({__proto__:null,Dropdown:cu},Symbol.toStringTag,{value:"Module"}));function pu(e){const t=e.widget,{uid:i,errors:n,value:s,isTouched:r,templateData:a,onValueChanged:o,onBlur:l}=x.useInputWidget(t),d=g.useCallback(E=>{S.current&&E.relatedTarget&&S.current.contains(E.relatedTarget)||l()},[l]),[c,h]=g.useState({start:0,end:10}),[p,m]=g.useState([]),[f,w]=g.useState(-1),S=g.useRef(null),T=g.useMemo(()=>(p.length>0?p:a.items||[]).slice(c.start,c.end),[p,a.items,c]);g.useEffect(()=>{const E=S.current;if(!E)return;const B=G=>{const{startIndex:J,endIndex:Ze}=G.detail;h({start:J,end:Ze})},H=G=>{const J=G.detail;m(J?[...J]:[])},K=G=>{const J=G.detail.index;w(J)},W=G=>{const J=G.detail.value;o(J)};return E.addEventListener("change",W),E.addEventListener("gui-update-items",H),E.addEventListener("gui-range-change",B),E.addEventListener("gui-focus-change",K),()=>{E.removeEventListener("change",W),E.removeEventListener("gui-update-items",H),E.removeEventListener("gui-range-change",B),E.removeEventListener("gui-focus-change",K)}},[o]);const C=g.useCallback((E,B)=>{a.disabled||(o(E.value),w(B),S.current&&S.current.focusItemAtIndex(B))},[o]),I=x.useItemRenderer(a.itemRenderer)||gs,A=a.label,D=a.validator?.required,k=a.disabled,P=a.readonly,O=r&&n&&n.length>0;return y.jsxs("div",{className:"gui-list gui-field",style:{flex:a.size},children:[y.jsx("gui-label",{targetElement:S.current||void 0,uid:i,label:A,hint:a.hint,errors:n,touched:r,required:D,native:!1}),y.jsx("div",{className:"gui-widget",children:y.jsx("gui-list",{ref:S,id:i,uid:i,value:s??"",valueField:a.valueField,items:a.items,itemHeight:a.itemHeight,height:a.height,required:D,touched:r,disabled:k,readOnly:P,onBlur:d,children:T.map((E,B)=>{const H=c.start+B,K=s===E.value,W=f===H,G=a.labelField??"label",Ze=E.template!==null&&typeof E.template=="object"&&G&&!a.itemRenderer?E.template[G]:E.template;return y.jsx("div",{role:"option",tabIndex:-1,id:`${i}-item-${H}`,className:"gui-list__item-wrapper",style:{height:`${a.itemHeight||40}px`},"aria-selected":K,"aria-disabled":k?"true":"false",onClick:()=>C(E,H),children:y.jsx(I,{template:Ze,value:E.value,index:B,selected:K,disabled:k,focused:W})},H)})})}),O&&y.jsx("gui-errors",{uid:i,errors:n,touched:r})]})}const mu=Object.freeze(Object.defineProperty({__proto__:null,List:pu},Symbol.toStringTag,{value:"Module"}));var yu=Object.defineProperty,fu=Object.getOwnPropertyDescriptor,ce=(e,t,i,n)=>{for(var s=n>1?void 0:n?fu(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&yu(t,i,s),s};let se=class extends ee{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.icon=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.showPasswordIcon=void 0,this.hidePasswordIcon=void 0,this.showPasswordLabel=void 0,this.hidePasswordLabel=void 0,this.showPassword=!1,this.ariaController=new Fe(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,icon:this.icon,placeholder:this.placeholder,autocomplete:this.autocomplete,showPasswordIcon:this.showPasswordIcon,hidePasswordIcon:this.hidePasswordIcon,showPasswordLabel:this.showPasswordLabel,hidePasswordLabel:this.hidePasswordLabel},t=pi("password",e),i={"gui-password--icon":!!this.icon};return v`
265
+ ${Ge(this.uid,e)}
266
+
267
+ <div class="gui-widget">
268
+ <input
269
+ type=${this.showPassword?"text":"password"}
270
+ id=${this.uid}
271
+ data-cy=${`${this.uid}_password`}
272
+ class=${fe(i)}
273
+ value=${this.value}
274
+ ?required=${this.disabled}
275
+ ?disabled=${this.disabled}
276
+ ?readonly=${this.readOnly}
277
+ placeholder=${this.placeholder||_}
278
+ autocomplete=${this.autocomplete||_}
279
+ @input=${this.valueChanged}
280
+ @blur=${this.onBlur}
281
+ />
282
+ ${t.html}
283
+ <button
284
+ class=${`gui-password__toggle gui-widget-icon ${this.showPassword&&e.showPasswordIcon?e.showPasswordIcon:""} ${!this.showPassword&&e.hidePasswordIcon?e.hidePasswordIcon:""}`}
285
+ data-icon=${this.showPassword?e.showPasswordIcon:e.hidePasswordIcon}
286
+ type="button"
287
+ tabindex="-1"
288
+ @click=${()=>this.showPassword=!this.showPassword}
289
+ >
290
+ ${e.showPasswordIcon||e.hidePasswordIcon?_:v`<span
291
+ >${this.showPassword?e.hidePasswordLabel??"Hide":e.showPasswordLabel??"Show"}</span
292
+ >`}
293
+ </button>
294
+ </div>
295
+
296
+ ${Ee(this.uid,e)}
297
+ `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.value},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};ce([u({type:String})],se.prototype,"uid",2),ce([u({type:String})],se.prototype,"label",2),ce([u({type:String,attribute:"locale-id"})],se.prototype,"localeId",2),ce([u({type:Array})],se.prototype,"errors",2),ce([u({type:Boolean})],se.prototype,"touched",2),ce([u({type:Boolean})],se.prototype,"required",2),ce([u({type:Boolean})],se.prototype,"disabled",2),ce([u({type:Boolean,attribute:"readonly"})],se.prototype,"readOnly",2),ce([u({type:String})],se.prototype,"value",2),ce([u({type:String})],se.prototype,"hint",2),ce([u({type:String})],se.prototype,"icon",2),ce([u({type:String})],se.prototype,"placeholder",2),ce([u({type:String})],se.prototype,"autocomplete",2),ce([u({type:String})],se.prototype,"showPasswordIcon",2),ce([u({type:String})],se.prototype,"hidePasswordIcon",2),ce([u({type:String})],se.prototype,"showPasswordLabel",2),ce([u({type:String})],se.prototype,"hidePasswordLabel",2),ce([Y()],se.prototype,"showPassword",2),se=ce([ue("gui-password")],se),typeof customElements<"u"&&!customElements.get("gui-password")&&customElements.define("gui-password",se);function gu(e){const t=e.widget,{uid:i,errors:n,value:s,isTouched:r,templateData:a,onValueChanged:o,onBlur:l}=x.useInputWidget(t),d=g.useCallback(k=>o(k.nativeEvent.detail.value),[o]),c=a.label,h=a.hint,p=a.placeholder,m=a.autocomplete,f=a.showPasswordIcon,w=a.hidePasswordIcon,S=a.showPasswordLabel,T=a.hidePasswordLabel,C=a.icon,I=a.disabled,A=a.readonly,D=a.validator?.required;return y.jsx("div",{className:"gui-password gui-field",style:{flex:a.size},children:y.jsx("gui-password",{uid:i,label:c,hint:h,errors:n,touched:r,required:D,disabled:I,readOnly:A,value:s,icon:C,placeholder:p??void 0,autocomplete:m??void 0,showPasswordIcon:f,hidePasswordIcon:w,showPasswordLabel:S,hidePasswordLabel:T,onInput:d,onBlur:l})})}const bu=Object.freeze(Object.defineProperty({__proto__:null,Password:gu},Symbol.toStringTag,{value:"Module"}));var Du=Object.defineProperty,vu=Object.getOwnPropertyDescriptor,Re=(e,t,i,n)=>{for(var s=n>1?void 0:n?vu(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&Du(t,i,s),s};let Ce=class extends ee{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.icon=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.ariaController=new Fe(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,icon:this.icon,placeholder:this.placeholder,autocomplete:this.autocomplete},t=pi("textinput",e),i={"gui-textinput--icon":!!this.icon};return v`
298
+ ${Ge(this.uid,e)}
299
+
300
+ <div class="gui-widget">
301
+ <input
302
+ type="text"
303
+ id=${this.uid}
304
+ data-cy=${`${this.uid}_textinput`}
305
+ class=${fe(i)}
306
+ value=${this.value}
307
+ ?required=${this.disabled}
308
+ ?disabled=${this.disabled}
309
+ ?readonly=${this.readOnly}
310
+ placeholder=${this.placeholder||_}
311
+ autocomplete=${this.autocomplete||_}
312
+ @input=${this.valueChanged}
313
+ @blur=${this.onBlur}
314
+ />
315
+ ${t.html}
316
+ </div>
317
+
318
+ ${Ee(this.uid,e)}
319
+ `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.value},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};Re([u({type:String})],Ce.prototype,"uid",2),Re([u({type:String})],Ce.prototype,"label",2),Re([u({type:String,attribute:"locale-id"})],Ce.prototype,"localeId",2),Re([u({type:Array})],Ce.prototype,"errors",2),Re([u({type:Boolean})],Ce.prototype,"touched",2),Re([u({type:Boolean})],Ce.prototype,"required",2),Re([u({type:Boolean})],Ce.prototype,"disabled",2),Re([u({type:Boolean,attribute:"readonly"})],Ce.prototype,"readOnly",2),Re([u({type:String})],Ce.prototype,"value",2),Re([u({type:String})],Ce.prototype,"hint",2),Re([u({type:String})],Ce.prototype,"icon",2),Re([u({type:String})],Ce.prototype,"placeholder",2),Re([u({type:String})],Ce.prototype,"autocomplete",2),Ce=Re([ue("gui-textinput")],Ce),typeof customElements<"u"&&!customElements.get("gui-textinput")&&customElements.define("gui-textinput",Ce);function wu(e){const t=e.widget,{uid:i,errors:n,value:s,isTouched:r,templateData:a,onValueChanged:o,onBlur:l}=x.useInputWidget(t),d=g.useCallback(C=>o(C.nativeEvent.detail.value),[o]),c=a.label,h=a.hint,p=a.placeholder,m=a.autocomplete,f=a.icon,w=a.disabled,S=a.readonly,T=a.validator?.required;return y.jsx("div",{className:"gui-textinput gui-field",style:{flex:a.size},children:y.jsx("gui-textinput",{uid:i,label:c,hint:h,errors:n,touched:r,required:T,disabled:w,readOnly:S,value:s,icon:f,placeholder:p??void 0,autocomplete:m??void 0,onInput:d,onBlur:l})})}const _u=Object.freeze(Object.defineProperty({__proto__:null,TextInput:wu},Symbol.toStringTag,{value:"Module"}));const bs="important",ku=" !"+bs,zi=qt(class extends Vt{constructor(e){if(super(e),e.type!==tt.ATTRIBUTE||e.name!=="style"||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,i)=>{const n=e[i];return n==null?t:t+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`},"")}update(e,[t]){const{style:i}=e.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const n of this.ft)t[n]==null&&(this.ft.delete(n),n.includes("-")?i.removeProperty(n):i[n]=null);for(const n in t){const s=t[n];if(s!=null){this.ft.add(n);const r=typeof s=="string"&&s.endsWith(ku);n.includes("-")||r?i.setProperty(n,r?s.slice(0,-11):s,r?bs:""):i[n]=s}}return ze}});var $u=Object.defineProperty,Su=Object.getOwnPropertyDescriptor,ke=(e,t,i,n)=>{for(var s=n>1?void 0:n?Su(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&$u(t,i,s),s};let he=class extends ee{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.minimumHeight=void 0,this.autoGrow=!1,this.maxLength=void 0,this.ariaController=new Fe(this,{getTargets:()=>this.querySelectorAll(`textarea[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint,placeholder:this.placeholder,autocomplete:this.autocomplete,counterMode:this.counterMode??"remaining",minimumHeight:this.minimumHeight??120,autoGrow:this.autoGrow??!1,maxLength:this.maxLength};let t=v``;if(e.counterMode&&e.maxLength){const s={"gui-textarea--counter":!0,"gui-textarea--counter__error":(e.value?.length??0)>e.maxLength},r=e.counterMode==="current"?v`<span>${e.value?.length??0}</span>`:v`<span>${e.maxLength-(e.value?.length??0)}</span>`;t=v`<div class=${fe(s)}>
320
+ ${r}
321
+ <span> / ${e.maxLength}</span>
322
+ </div>`}const i={height:`${e.minimumHeight}px`,"min-height":`${e.minimumHeight}px`},n=this.querySelector(`textarea[id="${this.uid}"]`);if(this.autoGrow&&n){const s=window.getComputedStyle(n),r=parseFloat(s.paddingTop),a=parseFloat(s.paddingBottom),o=r+a;n.style.height="auto",i.height=`${Math.max(this.minimumHeight??120,n.scrollHeight-o)}px`}return v`
323
+ ${Ge(this.uid,e)}
324
+
325
+ <div class="gui-widget">
326
+ <textarea
327
+ id=${this.uid}
328
+ data-cy=${`${this.uid}_textarea`}
329
+ style=${zi(i)}
330
+ ?required=${e.required}
331
+ ?disabled=${e.disabled}
332
+ ?readonly=${e.readonly}
333
+ placeholder=${e.placeholder||_}
334
+ autocomplete=${this.autocomplete||_}
335
+ @input=${this.valueChanged}
336
+ @blur=${this.onBlur}
337
+ ></textarea>
338
+ </div>
339
+
340
+ <div class="gui-textarea--validation">
341
+ <div>${Ee(this.uid,e)}</div>
342
+ ${t}
343
+ </div>
344
+ `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.value},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};ke([u({type:String})],he.prototype,"uid",2),ke([u({type:String})],he.prototype,"label",2),ke([u({type:String,attribute:"locale-id"})],he.prototype,"localeId",2),ke([u({type:Array})],he.prototype,"errors",2),ke([u({type:Boolean})],he.prototype,"touched",2),ke([u({type:Boolean})],he.prototype,"required",2),ke([u({type:Boolean})],he.prototype,"disabled",2),ke([u({type:Boolean,attribute:"readonly"})],he.prototype,"readOnly",2),ke([u({type:String})],he.prototype,"value",2),ke([u({type:String})],he.prototype,"hint",2),ke([u({type:String})],he.prototype,"placeholder",2),ke([u({type:String})],he.prototype,"autocomplete",2),ke([u({type:String,attribute:"countermode"})],he.prototype,"counterMode",2),ke([u({type:Number,attribute:"minimumheight"})],he.prototype,"minimumHeight",2),ke([u({type:Boolean,attribute:"autogrow"})],he.prototype,"autoGrow",2),ke([u({type:Number,attribute:"maxlength"})],he.prototype,"maxLength",2),he=ke([ue("gui-textarea")],he),typeof customElements<"u"&&!customElements.get("gui-textarea")&&customElements.define("gui-textarea",he);function Au(e){const t=e.widget,{uid:i,errors:n,value:s,isTouched:r,templateData:a,onValueChanged:o,onBlur:l}=x.useInputWidget(t),d=g.useCallback(D=>o(D.nativeEvent.detail.value),[o]),c=a.label,h=a.hint,p=a.placeholder,m=a.validator?.maxLength,f=a.counterMode,w=a.autocomplete,S=a.autoGrow,T=a.minimumHeight,C=a.disabled,I=a.readonly,A=a.validator?.required;return y.jsx("div",{className:"gui-textarea gui-field",style:{flex:a.size},children:y.jsx("gui-textarea",{uid:i,label:c,errors:n,touched:r,required:A,disabled:C,readOnly:I,value:s,hint:h,placeholder:p,autocomplete:w??void 0,counterMode:f,minimumHeight:T,autoGrow:S,maxLength:m,onInput:d,onBlur:l})})}const Ou=Object.freeze(Object.defineProperty({__proto__:null,TextArea:Au},Symbol.toStringTag,{value:"Module"}));const Fi=e=>e??_;class Ri extends Vt{constructor(t){if(super(t),this.it=_,t.type!==tt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===_||t==null)return this._t=void 0,this.it=t;if(t===ze)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const i=[t];return i.raw=i,this._t={_$litType$:this.constructor.resultType,strings:i,values:[]}}}Ri.directiveName="unsafeHTML",Ri.resultType=1;const Eu=qt(Ri);var Iu=Object.defineProperty,Cu=Object.getOwnPropertyDescriptor,Bi=(e,t,i,n)=>{for(var s=n>1?void 0:n?Cu(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&Iu(t,i,s),s};let Wt=class extends ee{constructor(){super(...arguments),this.md=void 0,this.dependencies=void 0}createRenderRoot(){return this}render(){return v`${Eu(this.dependencies?.markdown?.parse(this.md??""))}`}};Bi([u({type:String})],Wt.prototype,"md",2),Bi([u({type:Object})],Wt.prototype,"dependencies",2),Wt=Bi([ue("gui-markdown-text")],Wt),typeof customElements<"u"&&!customElements.get("gui-markdown-text")&&customElements.define("gui-markdown-text",Wt);var Tu=Object.defineProperty,Pu=Object.getOwnPropertyDescriptor,F=(e,t,i,n)=>{for(var s=n>1?void 0:n?Pu(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&Tu(t,i,s),s};let M=class extends ee{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.tools=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.minimumHeight=void 0,this.autoGrow=!1,this.defaultOpenPreview=void 0,this.maxLength=void 0,this.headingTitle=void 0,this.boldTitle=void 0,this.italicTitle=void 0,this.strikethroughTitle=void 0,this.quoteTitle=void 0,this.linkTitle=void 0,this.orderedListTitle=void 0,this.unorderedListTitle=void 0,this.splitViewTitle=void 0,this.dependencies=void 0,this.splitViewActive=!1,this.activeFormats={},this.splitViewInitialized=!1,this.ariaController=new Fe(this,{getTargets:()=>this.querySelectorAll(`textarea[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}updated(){this.recalculateAutoGrow()}willUpdate(e){!this.splitViewInitialized&&e.has("defaultOpenPreview")&&(this.splitViewActive=!!this.defaultOpenPreview,this.splitViewInitialized=!0)}render(){super.render();const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint,placeholder:this.placeholder,counterMode:this.counterMode??"remaining",minimumHeight:this.minimumHeight??120,autoGrow:this.autoGrow??!1,defaultOpenPreview:this.defaultOpenPreview??!1,maxLength:this.maxLength,dependencies:this.dependencies},t={"gui-markdown--icon":!1};let i=v``;if(e.counterMode&&e.maxLength){const s={"gui-markdown--counter":!0,"gui-markdown--counter__error":(e.value?.length??0)>e.maxLength},r=e.counterMode==="current"?v`<span>${e.value?.length??0}</span>`:v`<span>${e.maxLength-(e.value?.length??0)}</span>`;i=v`<div class=${fe(s)}>
345
+ ${r}
346
+ <span> / ${e.maxLength}</span>
347
+ </div>`}const n={"min-height":`${e.minimumHeight}px`};return v`
348
+ ${Ge(this.uid,e)}
349
+
350
+ <div
351
+ class=${fe({"gui-widget":!0,"gui-markdown--with-preview":this.splitViewActive})}
352
+ >
353
+ <nav class="gui-markdown__toolbar">
354
+ <ul>
355
+ ${(this.tools??["H","B","I","S","Q","L","|","OL","UL"]).map(s=>this.renderToolbarItem(s))}
356
+ <li>
357
+ <button
358
+ type="button"
359
+ tabindex="0"
360
+ class=${fe({"gui-markdown__toolbar-button":!0,"gui-markdown__toolbar-button--active":this.splitViewActive})}
361
+ @click=${this.splitView}
362
+ title=${this.splitViewTitle??"Split View"}
363
+ >
364
+ <svg
365
+ xmlns="http://www.w3.org/2000/svg"
366
+ width="20"
367
+ height="20"
368
+ viewBox="0 0 256 256"
369
+ >
370
+ <path
371
+ d="M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40ZM56,56h64V200H56ZM200,200H136V56h64V200Z"
372
+ ></path>
373
+ </svg>
374
+ </button>
375
+ </li>
376
+ </ul>
377
+ </nav>
378
+ <textarea
379
+ id=${Fi(this.uid)}
380
+ class=${fe(t)}
381
+ style=${zi(n)}
382
+ ?required=${e.required}
383
+ ?disabled=${e.disabled}
384
+ ?readonly=${e.readonly}
385
+ placeholder=${Fi(e.placeholder)}
386
+ autocomplete=${this.autocomplete||_}
387
+ .value=${this.value||""}
388
+ @input=${this.valueChanged}
389
+ @keyup=${this.detectFormats}
390
+ @mouseup=${this.detectFormats}
391
+ @blur=${this.onBlur}
392
+ ></textarea>
393
+
394
+ ${this.splitViewActive?v`
395
+ <section
396
+ data-cy=${Fi(this.uid?`${this.uid}_markdown`:_)}
397
+ class="gui-markdown__preview"
398
+ >
399
+ <gui-markdown-text
400
+ .md=${this.value||""}
401
+ .dependencies=${this.dependencies}
402
+ ></gui-markdown-text>
403
+ </section>
404
+ `:_}
405
+ </div>
406
+
407
+ <div class="gui-markdown--validation">
408
+ <div>${Ee(this.uid,e)}</div>
409
+ ${i}
410
+ </div>
411
+ `}recalculateAutoGrow(){if(!this.autoGrow)return;const e=this.querySelector(`textarea[id="${this.uid}"]`);if(!e)return;const t=window.getComputedStyle(e),i=parseFloat(t.paddingTop),n=parseFloat(t.paddingBottom),s=i+n;e.style.height="auto",e.style.height=`${Math.max(this.minimumHeight??120,e.scrollHeight-s)}px`}splitView(){this.splitViewActive=!this.splitViewActive}renderToolbarItem(e){switch(e){case"H":return v`<li>
412
+ <button
413
+ type="button"
414
+ tabindex="0"
415
+ class=${this.toolbarBtnClass("heading")}
416
+ @click=${this.applyFormat("# ","","heading")}
417
+ title=${this.headingTitle??"Heading"}
418
+ >
419
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256">
420
+ <path
421
+ d="M212,56V200a12,12,0,0,1-24,0V140H68v60a12,12,0,0,1-24,0V56a12,12,0,0,1,24,0v60H188V56a12,12,0,0,1,24,0Z"
422
+ ></path>
423
+ </svg>
424
+ </button>
425
+ </li>`;case"B":return v`<li>
426
+ <button
427
+ type="button"
428
+ tabindex="0"
429
+ class=${this.toolbarBtnClass("bold")}
430
+ @click=${this.applyFormat("**","**","bold")}
431
+ title=${this.boldTitle??"Bold"}
432
+ >
433
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256">
434
+ <path
435
+ d="M185.08,114.46A48,48,0,0,0,148,36H80A12,12,0,0,0,68,48V200a12,12,0,0,0,12,12h80a52,52,0,0,0,25.08-97.54ZM92,60h56a24,24,0,0,1,0,48H92Zm68,128H92V132h68a28,28,0,0,1,0,56Z"
436
+ ></path>
437
+ </svg>
438
+ </button>
439
+ </li>`;case"I":return v`<li>
440
+ <button
441
+ type="button"
442
+ tabindex="0"
443
+ class=${this.toolbarBtnClass("italic")}
444
+ @click=${this.applyFormat("_","_","italic")}
445
+ title=${this.italicTitle??"Italic"}
446
+ >
447
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256">
448
+ <path
449
+ d="M204,56a12,12,0,0,1-12,12H160.65l-40,120H144a12,12,0,0,1,0,24H64a12,12,0,0,1,0-24H95.35l40-120H112a12,12,0,0,1,0-24h80A12,12,0,0,1,204,56Z"
450
+ ></path>
451
+ </svg>
452
+ </button>
453
+ </li>`;case"S":return v`<li>
454
+ <button
455
+ type="button"
456
+ tabindex="0"
457
+ class=${this.toolbarBtnClass("strikethrough")}
458
+ @click=${this.applyFormat("~~","~~","strikethrough")}
459
+ title=${this.strikethroughTitle??"Strikethrough"}
460
+ >
461
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256">
462
+ <path
463
+ d="M224,128a8,8,0,0,1-8,8H175.93c9.19,7.11,16.07,17.2,16.07,32,0,13.34-7,25.7-19.75,34.79C160.33,211.31,144.61,216,128,216s-32.33-4.69-44.25-13.21C71,193.7,64,181.34,64,168a8,8,0,0,1,16,0c0,17.35,22,32,48,32s48-14.65,48-32c0-14.85-10.54-23.58-38.77-32H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM76.33,104a8,8,0,0,0,7.61-10.49A17.3,17.3,0,0,1,83.11,88c0-18.24,19.3-32,44.89-32,18.84,0,34.16,7.42,41,19.85a8,8,0,0,0,14-7.7C173.33,50.52,152.77,40,128,40,93.29,40,67.11,60.63,67.11,88a33.73,33.73,0,0,0,1.62,10.49A8,8,0,0,0,76.33,104Z"
464
+ ></path>
465
+ </svg>
466
+ </button>
467
+ </li>`;case"Q":return v`<li>
468
+ <button
469
+ type="button"
470
+ tabindex="0"
471
+ class=${this.toolbarBtnClass("quote")}
472
+ @click=${this.applyFormat("> ","","quote")}
473
+ title=${this.quoteTitle??"Quote"}
474
+ >
475
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256">
476
+ <path
477
+ d="M100,52H40A20,20,0,0,0,20,72v64a20,20,0,0,0,20,20H96v4a28,28,0,0,1-28,28,12,12,0,0,0,0,24,52.06,52.06,0,0,0,52-52V72A20,20,0,0,0,100,52Zm-4,80H44V76H96ZM216,52H156a20,20,0,0,0-20,20v64a20,20,0,0,0,20,20h56v4a28,28,0,0,1-28,28,12,12,0,0,0,0,24,52.06,52.06,0,0,0,52-52V72A20,20,0,0,0,216,52Zm-4,80H160V76h52Z"
478
+ ></path>
479
+ </svg>
480
+ </button>
481
+ </li>`;case"L":return v`<li>
482
+ <button
483
+ type="button"
484
+ tabindex="0"
485
+ class=${this.toolbarBtnClass("link")}
486
+ @click=${this.applyFormat("[","](url)","link")}
487
+ title=${this.linkTitle??"Link"}
488
+ >
489
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256">
490
+ <path
491
+ d="M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z"
492
+ ></path>
493
+ </svg>
494
+ </button>
495
+ </li>`;case"OL":return v`<li>
496
+ <button
497
+ type="button"
498
+ tabindex="0"
499
+ class=${this.toolbarBtnClass("orderedList")}
500
+ @click=${this.applyFormat("1. ","","orderedList")}
501
+ title=${this.orderedListTitle??"Ordered List"}
502
+ >
503
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256">
504
+ <path
505
+ d="M228,128a12,12,0,0,1-12,12H116a12,12,0,0,1,0-24H216A12,12,0,0,1,228,128ZM116,76H216a12,12,0,0,0,0-24H116a12,12,0,0,0,0,24ZM216,180H116a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24ZM44,59.31V104a12,12,0,0,0,24,0V40A12,12,0,0,0,50.64,29.27l-16,8a12,12,0,0,0,9.36,22Zm39.73,96.86a27.7,27.7,0,0,0-11.2-18.63A28.89,28.89,0,0,0,32.9,143a27.71,27.71,0,0,0-4.17,7.54,12,12,0,0,0,22.55,8.21,4,4,0,0,1,.58-1,4.78,4.78,0,0,1,6.5-.82,3.82,3.82,0,0,1,1.61,2.6,3.63,3.63,0,0,1-.77,2.77l-.13.17L30.39,200.82A12,12,0,0,0,40,220H72a12,12,0,0,0,0-24H64l14.28-19.11A27.48,27.48,0,0,0,83.73,156.17Z"
506
+ ></path>
507
+ </svg>
508
+ </button>
509
+ </li>`;case"UL":return v`<li>
510
+ <button
511
+ type="button"
512
+ tabindex="0"
513
+ class=${this.toolbarBtnClass("unorderedList")}
514
+ @click=${this.applyFormat("- ","","unorderedList")}
515
+ title=${this.unorderedListTitle??"Unordered List"}
516
+ >
517
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256">
518
+ <path
519
+ d="M76,64A12,12,0,0,1,88,52H216a12,12,0,0,1,0,24H88A12,12,0,0,1,76,64Zm140,52H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24Zm0,64H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24ZM44,112a16,16,0,1,0,16,16A16,16,0,0,0,44,112Zm0-64A16,16,0,1,0,60,64,16,16,0,0,0,44,48Zm0,128a16,16,0,1,0,16,16A16,16,0,0,0,44,176Z"
520
+ ></path>
521
+ </svg>
522
+ </button>
523
+ </li>`;case"|":return v`<li>
524
+ <span class="gui-markdown__toolbar-separator">
525
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256">
526
+ <path d="M140,24V232a12,12,0,0,1-24,0V24a12,12,0,0,1,24,0Z"></path>
527
+ </svg>
528
+ </span>
529
+ </li>`;default:return _}}toolbarBtnClass(e){return fe({"gui-markdown__toolbar-button":!0,"gui-markdown__toolbar-button--active":!!e&&!!this.activeFormats[e]})}detectFormats(){const e=this.querySelector(`textarea[id="${this.uid}"]`);if(!e)return;const{selectionStart:t,value:i}=e,n=i.lastIndexOf(`
530
+ `,t-1)+1,s=i.indexOf(`
531
+ `,t),r=i.substring(n,s===-1?i.length:s);this.activeFormats={heading:/^#{1,6}\s/.test(r),bold:this.isInsideInlineFormat(i,t,"**"),italic:this.isInsideInlineFormat(i,t,"_"),strikethrough:this.isInsideInlineFormat(i,t,"~~"),quote:r.startsWith("> "),link:this.isInsideLink(i,t),orderedList:/^\d+\.\s/.test(r),unorderedList:r.startsWith("- ")}}isInsideInlineFormat(e,t,i){const n=e.lastIndexOf(`
532
+ `,t-1)+1,s=e.indexOf(`
533
+ `,t),r=e.substring(n,s===-1?e.length:s),a=t-n;let o=0;for(;o<r.length;){const l=r.indexOf(i,o);if(l===-1)break;const d=r.indexOf(i,l+i.length);if(d===-1)break;if(a>=l&&a<=d+i.length)return!0;o=d+i.length}return!1}isInsideLink(e,t){const i=e.lastIndexOf(`
534
+ `,t-1)+1,n=e.indexOf(`
535
+ `,t),s=e.substring(i,n===-1?e.length:n),r=t-i,a=/\[[^\]]*\]\([^)]*\)/g;let o;for(;(o=a.exec(s))!==null;)if(r>=o.index&&r<=o.index+o[0].length)return!0;return!1}applyFormat(e,t="",i=""){return()=>{const n=this.querySelector(`textarea[id="${this.uid}"]`);if(n){if(i&&this.activeFormats[i])this.removeFormat(n,e,t,i);else{const{selectionStart:s,selectionEnd:r,value:a}=n,o=a.substring(s,r),l=a.substring(0,s),d=a.substring(r);n.value=`${l}${e}${o}${t}${d}`,n.selectionStart=s+e.length,n.selectionEnd=s+e.length+o.length}n.focus(),n.dispatchEvent(new Event("input",{bubbles:!0})),this.detectFormats()}}}removeFormat(e,t,i,n){const{selectionStart:s,value:r}=e,a=r.lastIndexOf(`
536
+ `,s-1)+1,o=r.indexOf(`
537
+ `,s),l=r.substring(a,o===-1?r.length:o);if(i)if(n==="link"){const d=s-a,c=/\[([^\]]*)\]\([^)]*\)/g;let h;for(;(h=c.exec(l))!==null;)if(d>=h.index&&d<=h.index+h[0].length){const p=h[1],m=a+h.index,f=m+h[0].length;e.value=`${r.substring(0,m)}${p}${r.substring(f)}`,e.selectionStart=m,e.selectionEnd=m+p.length;break}}else{const d=s-a;let c=0;for(;c<l.length;){const h=l.indexOf(t,c);if(h===-1)break;const p=l.indexOf(i,h+t.length);if(p===-1)break;if(d>=h&&d<=p+i.length){const m=l.substring(h+t.length,p),f=a+h,w=a+p+i.length;e.value=`${r.substring(0,f)}${m}${r.substring(w)}`,e.selectionStart=f,e.selectionEnd=f+m.length;break}c=p+i.length}}else{let d=t;if(n==="heading"){const m=l.match(/^#{1,6}\s/);m&&(d=m[0])}else if(n==="orderedList"){const m=l.match(/^\d+\.\s/);m&&(d=m[0])}const c=r.substring(0,a),h=l.substring(d.length),p=r.substring(o===-1?r.length:o);e.value=`${c}${h}${p}`,e.selectionStart=Math.max(a,s-d.length),e.selectionEnd=e.selectionStart}}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.value},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};F([u({type:String})],M.prototype,"uid",2),F([u({type:String})],M.prototype,"label",2),F([u({type:String,attribute:"locale-id"})],M.prototype,"localeId",2),F([u({type:Array})],M.prototype,"errors",2),F([u({type:Boolean})],M.prototype,"touched",2),F([u({type:Boolean})],M.prototype,"required",2),F([u({type:Boolean})],M.prototype,"disabled",2),F([u({type:Boolean,attribute:"readonly"})],M.prototype,"readOnly",2),F([u({type:String})],M.prototype,"value",2),F([u({type:String})],M.prototype,"hint",2),F([u({type:Array})],M.prototype,"tools",2),F([u({type:String})],M.prototype,"placeholder",2),F([u({type:String})],M.prototype,"autocomplete",2),F([u({type:String,attribute:"countermode"})],M.prototype,"counterMode",2),F([u({type:Number,attribute:"minimumheight"})],M.prototype,"minimumHeight",2),F([u({type:Boolean,attribute:"autogrow"})],M.prototype,"autoGrow",2),F([u({type:Boolean,attribute:"defaultopenpreview"})],M.prototype,"defaultOpenPreview",2),F([u({type:Number,attribute:"maxlength"})],M.prototype,"maxLength",2),F([u({type:String})],M.prototype,"headingTitle",2),F([u({type:String})],M.prototype,"boldTitle",2),F([u({type:String})],M.prototype,"italicTitle",2),F([u({type:String})],M.prototype,"strikethroughTitle",2),F([u({type:String})],M.prototype,"quoteTitle",2),F([u({type:String})],M.prototype,"linkTitle",2),F([u({type:String})],M.prototype,"orderedListTitle",2),F([u({type:String})],M.prototype,"unorderedListTitle",2),F([u({type:String})],M.prototype,"splitViewTitle",2),F([u({type:Object})],M.prototype,"dependencies",2),F([Y()],M.prototype,"splitViewActive",2),F([Y()],M.prototype,"activeFormats",2),M=F([ue("gui-markdown")],M),typeof customElements<"u"&&!customElements.get("gui-markdown")&&customElements.define("gui-markdown",M);function xu(e){const t=e.widget,{uid:i,errors:n,value:s,isTouched:r,templateData:a,onValueChanged:o,onBlur:l}=x.useInputWidget(t),d=g.useCallback(Ze=>o(Ze.nativeEvent.detail.value),[o]),c=a.label,h=a.hint,p=a.placeholder,m=a.autocomplete,f=a.validator?.maxLength,w=a.counterMode,S=a.autoGrow,T=a.minimumHeight,C=a.tools,I=a.defaultOpenPreview,A=a.headingTitle,D=a.boldTitle,k=a.italicTitle,P=a.strikethroughTitle,O=a.quoteTitle,E=a.linkTitle,B=a.orderedListTitle,H=a.unorderedListTitle,K=a.splitViewTitle,W=a.disabled,G=a.readonly,J=a.validator?.required;return y.jsx("div",{className:"gui-markdown gui-field",style:{flex:a.size},children:y.jsx("gui-markdown",{uid:i,label:c,errors:n,touched:r,required:J,disabled:W,readOnly:G,value:s,hint:h,placeholder:p,autocomplete:m??void 0,counterMode:w,minimumHeight:T,autoGrow:S,maxLength:f,tools:C,defaultOpenPreview:I,headingTitle:A,boldTitle:D,italicTitle:k,strikethroughTitle:P,quoteTitle:O,linkTitle:E,orderedListTitle:B,unorderedListTitle:H,splitViewTitle:K,dependencies:a.deps,onInput:d,onBlur:l})})}const Mu=Object.freeze(Object.defineProperty({__proto__:null,Markdown:xu},Symbol.toStringTag,{value:"Module"}));var Lu=Object.defineProperty,Nu=Object.getOwnPropertyDescriptor,Ye=(e,t,i,n)=>{for(var s=n>1?void 0:n?Nu(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&Lu(t,i,s),s};let Be=class extends ee{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=void 0,this.required=void 0,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.checkboxPosition="left",this.ariaController=new Fe(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,touched:this.touched,readonly:!1,disabled:!1}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,checkboxPosition:this.checkboxPosition};return e.checkboxPosition==="right"?this.classList.add("gui-checkbox--right"):this.classList.contains("gui-checkbox--right")&&this.classList.remove("gui-checkbox--right"),v`
538
+ <label
539
+ class="gui-label"
540
+ for=${this.uid}
541
+ data-cy=${`${this.uid}_label`}
542
+ id=${`${this.uid}_label`}
543
+ >
544
+ <div class="gui-widget gui-widget--horizontal">
545
+ <input
546
+ type="checkbox"
547
+ tabindex="0"
548
+ id=${this.uid}
549
+ data-cy=${`${this.uid}_checkbox`}
550
+ ?checked=${this.value}
551
+ ?required=${this.required}
552
+ ?disabled=${this.disabled||this.readOnly}
553
+ @change=${this.valueChanged}
554
+ @blur=${this.onBlur}
555
+ />
556
+ </div>
557
+
558
+ <span class="gui-label__container">
559
+ ${e.label+(e.required?" *":"")}
560
+ </span>
561
+ </label>
562
+
563
+ <div class="gui-widget-hint" id=${`${e.uid}_hint`}>
564
+ ${e.hint??_} ${Ee(this.uid,e)}
565
+ </div>
566
+ `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:t.checked},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};Ye([u({type:String})],Be.prototype,"uid",2),Ye([u({type:String})],Be.prototype,"label",2),Ye([u({type:String,attribute:"locale-id"})],Be.prototype,"localeId",2),Ye([u({type:Array})],Be.prototype,"errors",2),Ye([u({type:Boolean})],Be.prototype,"touched",2),Ye([u({type:Boolean})],Be.prototype,"required",2),Ye([u({type:Boolean})],Be.prototype,"disabled",2),Ye([u({type:Boolean,attribute:"readonly"})],Be.prototype,"readOnly",2),Ye([u({type:String})],Be.prototype,"value",2),Ye([u({type:String})],Be.prototype,"hint",2),Ye([u({type:String})],Be.prototype,"checkboxPosition",2),Be=Ye([ue("gui-checkbox")],Be),typeof customElements<"u"&&!customElements.get("gui-checkbox")&&customElements.define("gui-checkbox",Be);function zu(e){const t=e.widget,{uid:i,errors:n,value:s,onValueChanged:r,onBlur:a,templateData:o,isTouched:l}=x.useInputWidget(t),d=g.useCallback(S=>r(S.nativeEvent.detail.value),[r]),c=o.label,h=o.hint,p=o.checkboxPosition,m=o.disabled,f=o.readonly,w=o.validator?.required;return y.jsx("div",{className:"gui-checkbox gui-field",style:{flex:o.size},children:y.jsx("gui-checkbox",{uid:i,label:c,errors:n,touched:l,required:w,disabled:m,readOnly:f,value:s,hint:h,checkboxPosition:p,onChange:d,onBlur:a})})}const Fu=Object.freeze(Object.defineProperty({__proto__:null,Checkbox:zu},Symbol.toStringTag,{value:"Module"}));var Ru=Object.defineProperty,Bu=Object.getOwnPropertyDescriptor,Ke=(e,t,i,n)=>{for(var s=n>1?void 0:n?Bu(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&Ru(t,i,s),s};let je=class extends ee{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.togglePosition="left",this.ariaController=new Fe(this,{getTargets:()=>this.querySelectorAll('span[role="presentation"]'),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,touched:this.touched,readonly:!1,disabled:!1}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,togglePosition:this.togglePosition};return e.togglePosition==="right"?this.classList.add("gui-toggle--right"):this.classList.contains("gui-toggle--right")&&this.classList.remove("gui-toggle--right"),v`
567
+ <label
568
+ class="gui-label"
569
+ for=${this.uid}
570
+ data-cy=${`${this.uid}_label`}
571
+ id=${`${this.uid}_label`}
572
+ >
573
+ <div class="gui-widget gui-widget--horizontal gui-toggle--switch">
574
+ <input
575
+ type="checkbox"
576
+ tabindex="0"
577
+ id=${this.uid}
578
+ data-cy=${`${this.uid}_toggle`}
579
+ ?checked=${e.value}
580
+ ?required=${e.required}
581
+ ?disabled=${e.disabled||e.readonly}
582
+ @change=${this.valueChanged}
583
+ @blur=${this.onBlur}
584
+ />
585
+
586
+ <span class="gui-toggle--slider" role="presentation"></span>
587
+ </div>
588
+
589
+ <span class="gui-label__container">
590
+ ${e.label+(e.required?" *":"")}
591
+ </span>
592
+ </label>
593
+
594
+ <div class="gui-widget-hint" id=${`${e.uid}_hint`}>
595
+ ${e.hint??_} ${Ee(this.uid,e)}
596
+ </div>
597
+ `}valueChanged(e){if(e?.stopPropagation(),!this.readOnly){const t=e?.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:t.checked},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};Ke([u({type:String})],je.prototype,"uid",2),Ke([u({type:String})],je.prototype,"label",2),Ke([u({type:String,attribute:"locale-id"})],je.prototype,"localeId",2),Ke([u({type:Array})],je.prototype,"errors",2),Ke([u({type:Boolean})],je.prototype,"touched",2),Ke([u({type:Boolean})],je.prototype,"required",2),Ke([u({type:Boolean})],je.prototype,"disabled",2),Ke([u({type:Boolean,attribute:"readonly"})],je.prototype,"readOnly",2),Ke([u({type:String})],je.prototype,"value",2),Ke([u({type:String})],je.prototype,"hint",2),Ke([u({type:String})],je.prototype,"togglePosition",2),je=Ke([ue("gui-toggle")],je),typeof customElements<"u"&&!customElements.get("gui-toggle")&&customElements.define("gui-toggle",je);function ju(e){const t=e.widget,{uid:i,errors:n,value:s,onValueChanged:r,onBlur:a,templateData:o,isTouched:l}=x.useInputWidget(t),d=g.useCallback(S=>r(S.nativeEvent.detail.value),[r]),c=o.label,h=o.hint,p=o.togglePosition,m=o.disabled,f=o.readonly,w=o.validator?.required;return y.jsx("div",{className:"gui-toggle gui-field",style:{flex:o.size},children:y.jsx("gui-toggle",{uid:i,label:c,errors:n,touched:l,required:w,disabled:m,readOnly:f,value:s,hint:h,togglePosition:p,onChange:d,onBlur:a})})}const Zu=Object.freeze(Object.defineProperty({__proto__:null,Toggle:ju},Symbol.toStringTag,{value:"Module"}));var qu=Object.defineProperty,Vu=Object.getOwnPropertyDescriptor,$e=(e,t,i,n)=>{for(var s=n>1?void 0:n?Vu(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&qu(t,i,s),s};let pe=class extends ee{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.step=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.minimum=void 0,this.maximum=void 0,this.autoGrow=!1,this.ariaController=new Fe(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e=this.querySelector(`input[id="${this.uid}"]`),t={"min-width":"23px"};if(this.autoGrow)if(e){e.style.width="0px";const n=Math.max(23,e.scrollWidth);t.width=`${n}px`,t.maxWidth=`${n}px`,e.style.width=""}else t.width="47px";const i={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,step:this.step,placeholder:this.placeholder,autocomplete:this.autocomplete};return v`
598
+ ${Ge(this.uid,i)}
599
+
600
+ <div class="gui-widget">
601
+ <button
602
+ type="button"
603
+ tabindex="-1"
604
+ class="gui-button gui-number__minus"
605
+ ?disabled=${this.value<=this.minimum||this.disabled}
606
+ @click=${this.minus}
607
+ >
608
+ -
609
+ </button>
610
+
611
+ <input
612
+ type="number"
613
+ inputmode="decimal"
614
+ id=${this.uid}
615
+ data-cy=${`${this.uid}_number`}
616
+ style=${zi(t)}
617
+ value=${this.value}
618
+ ?required=${this.required}
619
+ ?disabled=${this.disabled}
620
+ ?readonly=${this.readOnly}
621
+ step=${typeof this.step=="number"?this.step:_}
622
+ placeholder=${this.placeholder||_}
623
+ autocomplete=${this.autocomplete||_}
624
+ @input=${this.valueChanged}
625
+ @keydown=${this.keyDown}
626
+ @blur=${this.onBlur}
627
+ />
628
+
629
+ <button
630
+ type="button"
631
+ tabindex="-1"
632
+ class="gui-button gui-number__plus"
633
+ ?disabled=${this.value>=this.maximum||this.disabled}
634
+ @click=${this.plus}
635
+ >
636
+ +
637
+ </button>
638
+ </div>
639
+
640
+ ${Ee(this.uid,i)}
641
+ `}keyDown(e){switch(e.stopPropagation(),e.key){case"ArrowUp":e.preventDefault(),this.plus();break;case"ArrowDown":e.preventDefault(),this.minus();break}}minus(){if(!this.readOnly){const e=this.querySelector(`input[id="${this.uid}"]`),t=typeof this.step=="number"?this.step:1;let i=Number(e.valueAsNumber)||Number(e.valueAsNumber)===0?e.valueAsNumber-t:1;i=Number(this.maximum)?Math.min(i,this.maximum):i,i=Number(this.minimum)?Math.max(i,this.minimum):i,e.valueAsNumber=i,this.value=i,this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value},bubbles:!0,composed:!0}))}}plus(){if(!this.readOnly){const e=this.querySelector(`input[id="${this.uid}"]`),t=typeof this.step=="number"?this.step:1;let i=Number(e.valueAsNumber)||Number(e.valueAsNumber)===0?e.valueAsNumber+t:1;i=Number(this.maximum)?Math.min(i,this.maximum):i,i=Number(this.minimum)?Math.max(i,this.minimum):i,e.valueAsNumber=i,this.value=i,this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value},bubbles:!0,composed:!0}))}}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.valueAsNumber},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};$e([u({type:String})],pe.prototype,"uid",2),$e([u({type:String})],pe.prototype,"label",2),$e([u({type:String})],pe.prototype,"hint",2),$e([u({type:String,attribute:"locale-id"})],pe.prototype,"localeId",2),$e([u({type:Array})],pe.prototype,"errors",2),$e([u({type:Boolean})],pe.prototype,"touched",2),$e([u({type:Boolean})],pe.prototype,"required",2),$e([u({type:Boolean})],pe.prototype,"disabled",2),$e([u({type:Boolean,attribute:"readonly"})],pe.prototype,"readOnly",2),$e([u({type:Number})],pe.prototype,"value",2),$e([u({type:Number})],pe.prototype,"step",2),$e([u({type:String})],pe.prototype,"placeholder",2),$e([u({type:String})],pe.prototype,"autocomplete",2),$e([u({type:Number})],pe.prototype,"minimum",2),$e([u({type:Number})],pe.prototype,"maximum",2),$e([u({type:Number})],pe.prototype,"autoGrow",2),pe=$e([ue("gui-number")],pe),typeof customElements<"u"&&!customElements.get("gui-number")&&customElements.define("gui-number",pe);function Uu(e){const t=e.widget,{uid:i,errors:n,value:s,isTouched:r,templateData:a,onValueChanged:o,onBlur:l}=x.useInputWidget(t),d=g.useCallback(D=>o(D.nativeEvent.detail.value),[o]),c=a.label,h=a.hint,p=a.placeholder,m=a.step,f=a.minimum,w=a.maximum,S=a.autocomplete,T=a.autoGrow,C=a.disabled,I=a.readonly,A=a.validator?.required;return y.jsx("div",{className:"gui-number gui-field",style:{flex:a.size},children:y.jsx("gui-number",{uid:i,label:c,hint:h,errors:n,touched:r,required:A,disabled:C,readOnly:I,value:s,step:m,minimum:f,maximum:w,autoGrow:T,autocomplete:S??void 0,placeholder:p??void 0,onInput:d,onBlur:l})})}const Hu=Object.freeze(Object.defineProperty({__proto__:null,NumberInput:Uu},Symbol.toStringTag,{value:"Module"}));function Wu(e){const t=typeof e;return t==="string"||t==="number"}function Ds(e,t){return t.find(i=>i.value.toString()===e)?.value}const vs=(e,t)=>{if(Array.isArray(e)&&e.length>0&&!xt.isOption(e[0])){if(Wu(e[0]))return e.map(i=>({label:i.toString(),value:i}));if(Gu(e[0],t)){const i=Yu(e[0],t);return e.map(i)}else throw new Error("Invalid option shape")}return e},Gu=(e,{labelField:t,valueField:i})=>{if(e===null||typeof e!="object")return!1;const n=e,s=t?Object.prototype.hasOwnProperty.call(n,t):!1,r=i?Object.prototype.hasOwnProperty.call(n,i):!1;return t&&!s?!1:!(i&&!r)};function Yu(e,{labelField:t,valueField:i}){if(e===null||typeof e!="object")throw new Error("Provided value is not an object");const n=e,s=t&&Object.prototype.hasOwnProperty.call(n,t)?t:void 0,r=i&&Object.prototype.hasOwnProperty.call(n,i)?i:void 0;if(!s&&!r)throw new Error("Neither labelField nor valueField exists on the object");return a=>{if(a===null||typeof a!="object")throw new Error("Item is not an object");const o=a;return{label:s?o[s]:"",value:r?o[r]:""}}}var Ku=Object.defineProperty,Ju=Object.getOwnPropertyDescriptor,Se=(e,t,i,n)=>{for(var s=n>1?void 0:n?Ju(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&Ku(t,i,s),s};let me=class extends ee{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.icon=void 0,this.autocomplete=void 0,this.options=[],this.placeholder=void 0,this.labelField=void 0,this.valueField=void 0,this.optionsLoading=!1,this.hasMatchingValue=!1,this.ariaController=new Fe(this,{getTargets:()=>this.querySelectorAll(`select[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint,icon:this.icon,autocomplete:this.autocomplete,options:this.options,placeholder:this.placeholder,labelField:this.labelField,valueField:this.valueField},t=pi("select",e);this.options=vs(this.options,{labelField:this.labelField,valueField:this.valueField}),this.hasMatchingValue=this.options?.length?this.options.find(({value:n})=>n===this.value)!==void 0:!1;const i=this.optionsLoading?v`<span>Loading...</span>`:v`
642
+ <option value="" disabled selected=${this.hasMatchingValue?_:""}>
643
+ ${this.placeholder??"Select an option"}
644
+ </option>
645
+ ${it(this.options||[],n=>n?.value,n=>v`<option
646
+ value=${n.value}
647
+ selected=${this.hasMatchingValue&&n.value===this.value?"":_}
648
+ >
649
+ ${n.label}
650
+ </option>`)}
651
+ `;return v`
652
+ ${Ge(this.uid,e)}
653
+
654
+ <div class="gui-widget">
655
+ <select
656
+ id=${this.uid}
657
+ tabindex="0"
658
+ data-cy=${`${this.uid}_select`}
659
+ class=${fe(t.widgetClasses)}
660
+ ?required=${e.required}
661
+ ?disabled=${e.disabled||e.readonly}
662
+ autocomplete=${this.autocomplete||_}
663
+ @change=${this.valueChanged}
664
+ @blur=${this.onBlur}
665
+ >
666
+ ${i}
667
+ </select>
668
+ <span class="gui-select__arrow"
669
+ ><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256">
670
+ <path
671
+ d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
672
+ ></path></svg
673
+ ></span>
674
+ ${t.html}
675
+ </div>
676
+
677
+ ${Ee(this.uid,e)}
678
+ `}updated(e){e.has("value")&&!this.hasMatchingValue&&this.value&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:`Invalid selection: '${this.value}' is not a valid option.`},bubbles:!0}))}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:Ds(t.value,this.options)},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};Se([u({type:String})],me.prototype,"uid",2),Se([u({type:String})],me.prototype,"label",2),Se([u({type:String,attribute:"locale-id"})],me.prototype,"localeId",2),Se([u({type:Array})],me.prototype,"errors",2),Se([u({type:Boolean})],me.prototype,"touched",2),Se([u({type:Boolean})],me.prototype,"required",2),Se([u({type:Boolean})],me.prototype,"disabled",2),Se([u({type:Boolean,attribute:"readonly"})],me.prototype,"readOnly",2),Se([u({type:String})],me.prototype,"value",2),Se([u({type:String})],me.prototype,"hint",2),Se([u({type:String})],me.prototype,"icon",2),Se([u({type:String})],me.prototype,"autocomplete",2),Se([u({type:String})],me.prototype,"options",2),Se([u({type:String})],me.prototype,"placeholder",2),Se([u({type:String})],me.prototype,"labelField",2),Se([u({type:String})],me.prototype,"valueField",2),me=Se([ue("gui-select")],me),typeof customElements<"u"&&!customElements.get("gui-select")&&customElements.define("gui-select",me);function Xu(e){const t=e.widget,{uid:i,errors:n,value:s,isTouched:r,templateData:a,onValueChanged:o,onBlur:l,injectValidationIssues:d}=x.useInputWidget(t),c=g.useCallback(P=>o(P.nativeEvent.detail.value),[o]),h=g.useCallback(P=>{const O=P,E=B=>{d([B.detail.message])};return P&&O.addEventListener("inputError",E),()=>{O.removeEventListener("inputError",E)}},[d]),p=a.options,m=a.label,f=a.hint,w=a.placeholder,S=a.autocomplete,T=a.icon,C=a.valueField,I=a.labelField,A=a.disabled,D=a.readonly,k=a.validator?.required;return y.jsx("div",{className:"gui-select gui-field",style:{flex:a.size},children:y.jsx("gui-select",{ref:h,uid:i,label:m,errors:n,touched:r,required:k,disabled:A,readOnly:D,value:s,hint:f,placeholder:w,autocomplete:S??void 0,icon:T,options:p,labelField:I,valueField:C,onChange:c,onBlur:l})})}const Qu=Object.freeze(Object.defineProperty({__proto__:null,Select:Xu},Symbol.toStringTag,{value:"Module"}));var ec=Object.defineProperty,tc=Object.getOwnPropertyDescriptor,Ne=(e,t,i,n)=>{for(var s=n>1?void 0:n?tc(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&ec(t,i,s),s};let Ae=class extends ee{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.options=[],this.labelField=void 0,this.valueField=void 0,this.direction="column",this.optionsLoading=!1,this.hasMatchingValue=!1,this.ariaController=new Fe(this,{getTargets:()=>this.querySelectorAll(`input[name="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,touched:this.touched,readonly:!1,disabled:!1}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint,options:this.options,labelField:this.labelField,valueField:this.valueField,direction:this.direction};this.options=vs(this.options,{labelField:this.labelField,valueField:this.valueField});const t=this.value;this.hasMatchingValue=this.options?.length?this.options.find(({value:n})=>n===t)!==void 0:!1;const i=this.optionsLoading?v`<span>Loading...</span>`:v`
679
+ ${it(this.options||[],n=>n?.value,(n,s)=>{const r=this.hasMatchingValue&&n.value===e.value,a=!this.hasMatchingValue&&s===0,o=r||a;return v`<label for=${`${this.uid}_${s}`}>
680
+ <input
681
+ type="radio"
682
+ tabindex=${o?"0":"-1"}
683
+ id=${`${this.uid}_${s}`}
684
+ data-cy=${`${this.uid}_radiogroup_${s}`}
685
+ name=${this.uid}
686
+ value=${n.value}
687
+ ?checked=${r}
688
+ ?required=${e.required}
689
+ ?disabled=${e.disabled||e.readonly}
690
+ @change=${this.valueChanged}
691
+ @blur=${this.onBlur}
692
+ />
693
+ ${n.label}
694
+ </label>`})}
695
+ `;return v`
696
+ ${Ge(this.uid,e,!1,void 0,!1)}
697
+
698
+ <div
699
+ class="gui-widget${this.direction==="row"?" gui-widget--horizontal":""}"
700
+ role="radiogroup"
701
+ id=${this.uid}
702
+ aria-labelledby=${e.label?`${this.uid}_label`:_}
703
+ aria-describedby=${e.hint?`${this.uid}_hint`:_}
704
+ >
705
+ ${i}
706
+ </div>
707
+
708
+ ${Ee(this.uid,e)}
709
+ `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:Ds(t.value,this.options)},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};Ne([u({type:String})],Ae.prototype,"uid",2),Ne([u({type:String})],Ae.prototype,"label",2),Ne([u({type:String,attribute:"locale-id"})],Ae.prototype,"localeId",2),Ne([u({type:Array})],Ae.prototype,"errors",2),Ne([u({type:Boolean})],Ae.prototype,"touched",2),Ne([u({type:Boolean})],Ae.prototype,"required",2),Ne([u({type:Boolean})],Ae.prototype,"disabled",2),Ne([u({type:Boolean,attribute:"readonly"})],Ae.prototype,"readOnly",2),Ne([u({type:String})],Ae.prototype,"value",2),Ne([u({type:String})],Ae.prototype,"hint",2),Ne([u({type:String})],Ae.prototype,"options",2),Ne([u({type:String})],Ae.prototype,"labelField",2),Ne([u({type:String})],Ae.prototype,"valueField",2),Ne([u({type:String})],Ae.prototype,"direction",2),Ae=Ne([ue("gui-radiogroup")],Ae),typeof customElements<"u"&&!customElements.get("gui-radiogroup")&&customElements.define("gui-radiogroup",Ae);function ic(e){const t=e.widget,{uid:i,errors:n,value:s,isTouched:r,templateData:a,onValueChanged:o,onBlur:l}=x.useInputWidget(t),d=g.useCallback(I=>o(I.nativeEvent.detail.value),[o]),c=a.label,h=a.hint,p=a.options,m=a.labelField,f=a.valueField,w=a.direction,S=a.disabled,T=a.readonly,C=a.validator?.required;return y.jsx("div",{className:"gui-radiogroup gui-field",style:{flex:a.size},children:y.jsx("gui-radiogroup",{uid:i,label:c,errors:n,touched:r,required:C,disabled:S,readOnly:T,value:s,hint:h,options:p,labelField:m,valueField:f,direction:w,onChange:d,onBlur:l})})}const nc=Object.freeze(Object.defineProperty({__proto__:null,RadioGroup:ic},Symbol.toStringTag,{value:"Module"}));function Ct(e,t,i){if(!e)throw new TypeError("The element provided to the IntersectionObserver must exist");const n=new IntersectionObserver(s=>{s.forEach(r=>{t(r.isIntersecting)})},i);return n.observe(e),n}var sc=Object.defineProperty,ac=Object.getOwnPropertyDescriptor,nt=(e,t,i,n)=>{for(var s=n>1?void 0:n?ac(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&sc(t,i,s),s};let Je=class extends V{constructor(){super(...arguments),this.value=[],this.focusDate=void 0,this.hidePills=!1,this.removePillAriaLabel=void 0,this._anchorDate=null,this._nextDate=null,this._isSelecting=!1,this._isStartVisible=!0,this._isEndVisible=!0,this._skipValueNavigation=!1}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){if(e.has("value")&&!e.has("focusDate")){if(this._skipValueNavigation)this._skipValueNavigation=!1;else if(this.value){const t=Array.isArray(this.value)?this.value:[{start:this.value}];if(t.length>0&&t[0].start){const i=new Date(t[0].start);!isNaN(i.getTime())&&!gt(i,this._currentDate,this.numberOfMonths??1)&&(this._currentDate=i)}}}if(e.has("focusDate")&&this.focusDate){const t=new Date(this.focusDate);isNaN(t.getTime())||(gt(t,this._currentDate,this.numberOfMonths??1)||(this._currentDate=t),this.focusDate=void 0)}}renderDay(e){const t={"gui-calendar__day-button":!0,today:e.isToday,"other-month":!e.isCurrentMonth,"range-start":e.isRangeStart&&!e.isOneDayRange,"range-end":e.isRangeEnd&&!e.isOneDayRange,selected:e.isOneDayRange,"in-range":e.isInRange,"is-anchor":e.isAnchor,"is-selecting":e.isSelecting,disabled:e.isDisabled};return v`
710
+ <button
711
+ type="button"
712
+ role="gridcell"
713
+ class=${fe(t)}
714
+ tabindex=${e.isFocusable?0:-1}
715
+ ?disabled=${!e.isCurrentMonth||e.isDisabled}
716
+ data-date=${e.date.toISOString()}
717
+ @click=${i=>this.selectDate(e,i)}
718
+ @mouseover=${()=>this.onMouseOver(e)}
719
+ @focus=${()=>this.onMouseOver(e)}
720
+ @keydown=${i=>this.handleKeydown(i,e)}
721
+ aria-selected=${e.isRangeStart||e.isRangeEnd||e.isInRange?"true":"false"}
722
+ >
723
+ ${e.dayLabel}
724
+ </button>
725
+ `}getDaysInMonth(e){const t=new Date(this._currentDate);t.setDate(1),t.setMonth(t.getMonth()+e);const i=this.generateDateGrid(e),n=t.getMonth();let s=i.map(r=>{const a=r.getMonth()===n,o=this.isDisabled(r),l=as(r),{isRangeStart:d,isRangeEnd:c,isInRange:h,isSelecting:p}=this.checkDateStatus(r),m=l||d,f=this._anchorDate?Ut(r,this._anchorDate):!1;return{date:r,dayLabel:os(this.localeId,r),isCurrentMonth:a,isToday:l,isRangeStart:d,isRangeEnd:c,isInRange:h,isDisabled:o,isOneDayRange:d&&c,isAnchor:f,isFocusable:m,isSelecting:p&&a}});for(let r=0;r<2;r++)s.slice(-7).every(o=>!o.isCurrentMonth)&&(s=s.slice(0,-7));if(e===0&&!s.some(r=>r.isFocusable)){const r=this.numberOfMonths??1,a=gt(new Date,this._currentDate,r),o=this.value?.some(l=>gt(new Date(l.start),this._currentDate,r))??!1;if(!a&&!o){const l=s.find(d=>d.isCurrentMonth&&!d.isDisabled);l&&(l.isFocusable=!0)}}return s}checkDateStatus(e){let t=!1,i=!1,n=!1,s=!1;if(this._isSelecting&&this._nextDate&&this._anchorDate){const r=this._nextDate.date,a=new Date(this._anchorDate);r.getTime()>a.getTime()?s=e.getTime()>=a.getTime()&&e.getTime()<=r.getTime():s=e.getTime()>=r.getTime()&&e.getTime()<=a.getTime()}if(this.value&&Array.isArray(this.value))for(const r of this.value){const a=new Date(r.start);if(Ut(e,a)&&(t=!0,i=!r.end),r.end){const o=new Date(r.end);Ut(e,o)&&(i=!0);const l=e.getTime(),d=a.getTime(),c=o.getTime();l>d&&l<c&&(n=!0)}}return{isRangeStart:t,isRangeEnd:i,isInRange:n,isSelecting:s}}selectDate(e,t=null){if(!e.isCurrentMonth||this.disabled||this.readOnly)return;const i=e.date;if(!this._anchorDate){this._isSelecting=!0,this._anchorDate=i;return}let n=this._anchorDate,s=i;i<n&&(n=i,s=this._anchorDate);const r=this.calculateValidRanges(n,s),a=[...this.value||[],...r];this._skipValueNavigation=!0,this.value=ls(a),this._isSelecting=!1,this._nextDate=null,this._anchorDate=null,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))}calculateValidRanges(e,t){const i=[],n=new Date(e),s=new Date(t);n.setHours(0,0,0,0),s.setHours(0,0,0,0);let r=null;for(;n<=s;){if(!this.isDisabled(n))r||(r=new Date(n));else if(r){const o=new Date(n);o.setDate(n.getDate()-1),i.push(Li(r,o)),r=null}n.setDate(n.getDate()+1)}return r&&i.push(Li(r,t)),i}onMouseOver(e){this._isSelecting&&(this._nextDate=e)}updated(){this.hidePills||this.setupObservers()}disconnectedCallback(){super.disconnectedCallback(),this.disconnectObservers()}renderAboveCalendar(){if(this.hidePills)return _;const e=this.getSortedPills();return e.length===0?_:v`
726
+ <div
727
+ class=${fe({"gui-range-calendar__pills-wrapper":!0,"gui-range-calendar--start-shadow":!this._isStartVisible,"gui-range-calendar--end-shadow":!this._isEndVisible})}
728
+ >
729
+ <div class="gui-range-calendar__pills" role="list">
730
+ <span class="gui-sentinel gui-sentinel__start"></span>
731
+ ${it(e,t=>`${t.start}-${t.end??t.start}`,(t,i)=>this.renderPill(t,i))}
732
+ <span class="gui-sentinel gui-sentinel__end"></span>
733
+ </div>
734
+ </div>
735
+ `}renderPill(e,t){const i=this.formatDateForDisplay(e.start),n=e.end?this.formatDateForDisplay(e.end):i,s=`${i} - ${n}`;return v`
736
+ <div
737
+ class="gui-range-calendar__pill"
738
+ role="listitem"
739
+ tabindex="0"
740
+ aria-label="${this.removePillAriaLabel??"Remove date"} ${s}"
741
+ @click=${()=>this.navigateToDate(e.start)}
742
+ @keydown=${r=>this.handlePillKeydown(r,t)}
743
+ >
744
+ <span class="gui-range-calendar__pill-text">${s}</span>
745
+ <button
746
+ type="button"
747
+ class="gui-range-calendar__pill-remove"
748
+ tabindex="-1"
749
+ ?disabled=${this.disabled||this.readOnly}
750
+ @click=${r=>{r.stopPropagation(),this.removePill(t)}}
751
+ >
752
+ <svg
753
+ xmlns="http://www.w3.org/2000/svg"
754
+ width="16"
755
+ height="16"
756
+ viewBox="0 0 256 256"
757
+ fill="currentColor"
758
+ aria-hidden="true"
759
+ >
760
+ <path
761
+ d="M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"
762
+ ></path>
763
+ </svg>
764
+ </button>
765
+ </div>
766
+ `}formatDateForDisplay(e){const t=new Date(e);return isNaN(t.getTime())?e:new Intl.DateTimeFormat(this.localeId??"en",{year:"numeric",month:"2-digit",day:"2-digit"}).format(t)}getSortedPills(){return!this.value||!Array.isArray(this.value)?[]:[...this.value].sort((e,t)=>new Date(e.start).getTime()-new Date(t.start).getTime())}removePill(e){if(this.disabled||this.readOnly)return;const t=this.getSortedPills();t.splice(e,1),this.value=[...t],this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))}handlePillKeydown(e,t){if(e.key==="Delete"||e.key==="Backspace"){e.preventDefault(),this.removePill(t);return}if(e.key==="Enter"){e.preventDefault();const i=this.getSortedPills();i[t]&&this.navigateToDate(i[t].start);return}if(e.key==="ArrowLeft"||e.key==="ArrowRight"){e.preventDefault();const i=this.querySelectorAll(".gui-range-calendar__pills .gui-range-calendar__pill"),n=e.key==="ArrowLeft"?t-1:t+1;n>=0&&n<i.length&&i[n].focus()}}navigateToDate(e){const t=new Date(e);!isNaN(t.getTime())&&!gt(t,this._currentDate,this.numberOfMonths??1)&&(this._currentDate=t)}setupObservers(){const e=this.querySelector(".gui-sentinel__start"),t=this.querySelector(".gui-sentinel__end");e&&!this.startObserver&&(this.startObserver=Ct(e,i=>this._isStartVisible=i)),t&&!this.endObserver&&(this.endObserver=Ct(t,i=>this._isEndVisible=i)),!e&&this.startObserver&&(this.startObserver.disconnect(),this.startObserver=void 0,this._isStartVisible=!0),!t&&this.endObserver&&(this.endObserver.disconnect(),this.endObserver=void 0,this._isEndVisible=!0)}disconnectObservers(){this.startObserver?.disconnect(),this.endObserver?.disconnect(),this.startObserver=void 0,this.endObserver=void 0}};nt([u({type:Array})],Je.prototype,"value",2),nt([u({type:String})],Je.prototype,"focusDate",2),nt([u({type:Boolean})],Je.prototype,"hidePills",2),nt([u({type:String})],Je.prototype,"removePillAriaLabel",2),nt([Y()],Je.prototype,"_anchorDate",2),nt([Y()],Je.prototype,"_nextDate",2),nt([Y()],Je.prototype,"_isSelecting",2),nt([Y()],Je.prototype,"_isStartVisible",2),nt([Y()],Je.prototype,"_isEndVisible",2),Je=nt([ue("gui-range-calendar")],Je),typeof customElements<"u"&&!customElements.get("gui-range-calendar")&&customElements.define("gui-range-calendar",Je);function rc(e){const t=e.widget,{uid:i,errors:n,value:s,isTouched:r,templateData:a,onBlur:o,onValueChanged:l}=x.useInputWidget(t),d=g.useCallback(K=>{const W=K,G=Ze=>l(Ze.detail.value),J=Ze=>{o()};return K&&(W.addEventListener("blur",J),W.addEventListener("change",G)),()=>{W.removeEventListener("blur",J),W.removeEventListener("change",G)}},[l,o]),c=a.label,h=a.hint,p=a.prevMonthIcon,m=a.nextMonthIcon,f=a.prevMonthAriaLabel,w=a.nextMonthAriaLabel,S=a.dayFormat,T=a.weekdayFormat,C=a.monthFormat,I=a.minDate,A=a.maxDate,D=a.disabledRanges,k=a.numberOfMonths,P=a.removePillAriaLabel,O=a.lang,E=a.disabled,B=a.readonly,H=a.validator?.required;return y.jsx("div",{className:"gui-range-calendar gui-field",style:{flex:a.size},children:y.jsx("gui-range-calendar",{ref:d,uid:i,label:c,hint:h,errors:n,touched:r,required:H,disabled:E,readOnly:B,value:s,prevMonthIcon:p,nextMonthIcon:m,prevMonthAriaLabel:f,nextMonthAriaLabel:w,dayFormat:S,weekdayFormat:T,monthFormat:C,minDate:I,maxDate:A,disabledRanges:D,numberOfMonths:k,hidePills:!1,removePillAriaLabel:P,localeId:O})})}const oc=Object.freeze(Object.defineProperty({__proto__:null,RangeCalendar:rc},Symbol.toStringTag,{value:"Module"}));var lc=Object.defineProperty,dc=Object.getOwnPropertyDescriptor,ne=(e,t,i,n)=>{for(var s=n>1?void 0:n?dc(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&lc(t,i,s),s};let U=class extends ee{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=[],this.hint=void 0,this.icon="",this.removePillAriaLabel=void 0,this.startDateAriaLabel=void 0,this.endDateAriaLabel=void 0,this.separator=void 0,this._startDate={day:"",month:"",year:""},this._endDate={day:"",month:"",year:""},this._isStartVisible=!0,this._isEndVisible=!0,this._showPillsList=!1,this.MIN_DAY=1,this.MAX_DAY=31,this.MAX_VALID_DAY=(e,t)=>e===2?new Date(t,1,29).getDate()===29||!t?29:28:e===4||e===6||e===9||e===11?30:31,this.MIN_MONTH=1,this.MAX_MONTH=12,this.MIN_YEAR=1e3,this.MAX_YEAR=9999,this.ariaController=new Fe(this,{getTargets:()=>this.querySelectorAll(".gui-range-date-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})}),this.handleOutsideInteraction=e=>{const t=this.querySelector(".gui-range-date-input__pills-compact"),i=this.querySelector(".gui-range-date-input__pills-dropdown"),n=e.composedPath()[0];!t?.contains(n)&&!i?.contains(n)&&(this._showPillsList=!1,this.removeOutsideListeners())}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}updated(){this.setupObservers()}disconnectedCallback(){super.disconnectedCallback(),this.disconnectObservers(),this.removeOutsideListeners()}render(){const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint},t=new Intl.DateTimeFormat(this.localeId??"en",{year:"numeric",month:"numeric",day:"numeric"}).formatToParts(new Date),i=this.getSortedPills(),n={"gui-widget-icon":!0,[this.icon]:!!this.icon};return v`
767
+ ${this.label?Ge(this.uid,e,!1,void 0,!1):_}
768
+
769
+ <div class="gui-widget">
770
+ <div
771
+ class="gui-range-date-input ${this.icon?"gui-range-date-input--icon":""}"
772
+ role="group"
773
+ aria-label=${this.label??"Date range input"}
774
+ >
775
+ ${this.icon?v`<span class=${fe(n)} data-icon=${this.icon}></span>`:_}
776
+ ${i.length>0?v`<div
777
+ class=${fe({"gui-range-date-input__pills-wrapper":!0,"gui-range-date-input--start-shadow":!this._isStartVisible,"gui-range-date-input--end-shadow":!this._isEndVisible})}
778
+ >
779
+ <div class="gui-range-date-input__pills" role="list">
780
+ <span class="gui-sentinel gui-sentinel__start"></span>
781
+ ${it(i,s=>`${s.start}-${s.end??s.start}`,(s,r)=>this.renderPill(s,r))}
782
+ <span class="gui-sentinel gui-sentinel__end"></span>
783
+ </div>
784
+ </div>
785
+ <div class="gui-range-date-input__pills-compact">
786
+ <button
787
+ type="button"
788
+ tabindex="0"
789
+ class="gui-range-date-input__pill--count"
790
+ aria-label="${i.length} date ranges"
791
+ @click=${this.togglePillsList}
792
+ >
793
+ ${i.length}
794
+ </button>
795
+ </div>`:_}
796
+
797
+ <div class="gui-range-date-input__inputs">
798
+ <div
799
+ class="gui-range-date-input__field"
800
+ role="group"
801
+ aria-label=${this.startDateAriaLabel??"Start date"}
802
+ >
803
+ ${this.renderDateInputs("start",t)}
804
+ </div>
805
+
806
+ <span class="gui-range-date-input__separator">${this.separator??"-"}</span>
807
+
808
+ <div
809
+ class="gui-range-date-input__field"
810
+ role="group"
811
+ aria-label=${this.endDateAriaLabel??"End date"}
812
+ >
813
+ ${this.renderDateInputs("end",t)}
814
+ </div>
815
+ </div>
816
+ </div>
817
+ ${this._showPillsList&&i.length>0?v`<div class="gui-range-date-input__pills-dropdown" role="list">
818
+ ${it(i,s=>`${s.start}-${s.end??s.start}`,(s,r)=>this.renderPill(s,r))}
819
+ </div>`:_}
820
+ </div>
821
+
822
+ ${this.showErrors&&this.errors?.length?Ee(this.uid,e):_}
823
+ `}renderPill(e,t){const i=this.formatDateForDisplay(e.start),n=e.end?this.formatDateForDisplay(e.end):i,s=`${i} - ${n}`;return v`
824
+ <div
825
+ class="gui-range-date-input__pill"
826
+ role="listitem"
827
+ tabindex="0"
828
+ aria-label="${this.removePillAriaLabel??"Remove date"} ${s}"
829
+ @click=${()=>this.onPillClick(e)}
830
+ @focus=${this.handlePillFocus}
831
+ @keydown=${r=>this.handlePillKeydown(r,t)}
832
+ >
833
+ <span class="gui-range-date-input__pill-text">${s}</span>
834
+ <button
835
+ type="button"
836
+ class="gui-range-date-input__pill-remove"
837
+ tabindex="-1"
838
+ ?disabled=${this.disabled||this.readOnly}
839
+ @click=${()=>this.removePill(t)}
840
+ >
841
+ <svg
842
+ xmlns="http://www.w3.org/2000/svg"
843
+ width="16"
844
+ height="16"
845
+ viewBox="0 0 256 256"
846
+ fill="currentColor"
847
+ aria-hidden="true"
848
+ >
849
+ <path
850
+ d="M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"
851
+ ></path>
852
+ </svg>
853
+ </button>
854
+ </div>
855
+ `}renderDateInputs(e,t){const i=e==="start"?this._startDate:this._endDate;return it(t,n=>`${e}-${n.type}`,(n,s)=>{const r=e==="start"&&s===0?0:-1;switch(n.type){case"day":return this.renderInput(e,"day","dd",2,r,i.day);case"month":return this.renderInput(e,"month","mm",2,r,i.month);case"year":return this.renderInput(e,"year","yyyy",4,r,i.year);case"literal":return v`<span class="gui-range-date-input__separator">${n.value}</span>`;default:return""}})}renderInput(e,t,i,n,s,r){return v`
856
+ <div class="gui-range-date-input__touch-target">
857
+ <input
858
+ type="text"
859
+ inputmode="numeric"
860
+ class="gui-range-date-input__part ${t==="year"?"gui-range-date-input__year":""}"
861
+ data-type=${t}
862
+ data-group=${e}
863
+ maxlength=${n}
864
+ placeholder=${i}
865
+ tabindex=${s}
866
+ ?required=${this.required}
867
+ ?disabled=${this.disabled}
868
+ ?readonly=${this.readOnly}
869
+ autocomplete="off"
870
+ .value=${ys(r)}
871
+ @keydown=${this.handleKeyDown}
872
+ @keyup=${a=>this.handleKeyUp(a,e,t)}
873
+ @focus=${this.handleFocus}
874
+ @blur=${a=>this.handleBlur(a,e,t)}
875
+ @change=${a=>this.handleChange(a,e,t)}
876
+ />
877
+ <div class="gui-range-date-input__visual-underline"></div>
878
+ </div>
879
+ `}formatDateForDisplay(e){const t=new Date(e);return isNaN(t.getTime())?e:new Intl.DateTimeFormat(this.localeId??"en",{year:"numeric",month:"2-digit",day:"2-digit"}).format(t)}getSortedPills(){return!this.value||!Array.isArray(this.value)?[]:[...this.value].sort((e,t)=>new Date(e.start).getTime()-new Date(t.start).getTime())}togglePillsList(){this._showPillsList=!this._showPillsList,this._showPillsList?requestAnimationFrame(()=>{document.addEventListener("pointerdown",this.handleOutsideInteraction),document.addEventListener("focusin",this.handleOutsideInteraction),this.querySelector(".gui-range-date-input__pills-dropdown .gui-range-date-input__pill")?.focus()}):this.removeOutsideListeners()}removeOutsideListeners(){document.removeEventListener("pointerdown",this.handleOutsideInteraction),document.removeEventListener("focusin",this.handleOutsideInteraction)}removePill(e){if(this.disabled||this.readOnly)return;const t=this.getSortedPills();t.splice(e,1),this.value=[...t],this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),this._showPillsList&&t.length===0&&(this._showPillsList=!1,this.removeOutsideListeners()),requestAnimationFrame(()=>{const i=this._showPillsList?".gui-range-date-input__pills-dropdown .gui-range-date-input__pill":".gui-range-date-input__pills .gui-range-date-input__pill",n=this.querySelectorAll(i);if(n.length>0){const s=Math.min(e,n.length-1);n[s].focus()}else this.querySelector(".gui-range-date-input__field input")?.focus()})}handlePillFocus(e){e.target.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}handlePillKeydown(e,t){if(e.key==="Delete"||e.key==="Backspace"){e.preventDefault(),e.stopPropagation(),this.removePill(t);return}if(e.key==="Enter"||e.key===" "){e.preventDefault();const r=this.getSortedPills();r[t]&&this.onPillClick(r[t]);return}const i=this._showPillsList,n=i?"ArrowUp":"ArrowLeft",s=i?"ArrowDown":"ArrowRight";if(e.key===n||e.key===s){e.preventDefault();const r=i?".gui-range-date-input__pills-dropdown .gui-range-date-input__pill":".gui-range-date-input__pills .gui-range-date-input__pill",a=this.querySelectorAll(r),o=e.key===n?t-1:t+1;o>=0&&o<a.length&&a[o].focus()}}onPillClick(e){this.dispatchEvent(new CustomEvent("pillClick",{detail:{range:e},bubbles:!0,composed:!0}))}handleKeyDown(e){["Backspace","Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Delete","Enter"].includes(e.key)||e.ctrlKey||e.metaKey||this.readOnly||/^[0-9]$/.test(e.key)||e.preventDefault()}handleFocus(e){this.dispatchEvent(new CustomEvent("focus",{detail:e}))}handleKeyUp(e,t,i){if(this.readOnly)return;const n=window.getComputedStyle(this).direction==="rtl",s=e.target,r=this.getGroupInputs(t),a=r.indexOf(s);if(s.value.length===s.maxLength&&/^[0-9]$/.test(e.key))if(a===r.length-1){if(t==="start"){const o=this.getGroupInputs("end");o.length>0&&o[0].focus()}}else r[a+1].focus();switch(e.key){case"Enter":{if(this.tryCreatePill(),this.value&&this.value.length>0){const o=this.value[this.value.length-1];this.onPillClick(o)}break}case"ArrowUp":{const o=isNaN(parseInt(s.value,10)+1)?1:parseInt(s.value,10)+1;this.setDatePartValue(t,i,o),s.select(),this.tryCreatePill();break}case"ArrowDown":{const o=isNaN(parseInt(s.value,10)-1)?1:parseInt(s.value,10)-1;this.setDatePartValue(t,i,o),s.select(),this.tryCreatePill();break}case"ArrowLeft":{const o=n?a+1:a-1;if(o>=0&&o<r.length)r[o].focus(),r[o].select();else{const l=n?"end":"start";if(t!==l){const d=this.getGroupInputs(l);if(d.length>0){const c=d[d.length-1];c.focus(),c.select()}}}break}case"ArrowRight":{const o=n?a-1:a+1;if(o>=0&&o<r.length)r[o].focus(),r[o].select();else{const l=n?"start":"end";if(t!==l){const d=this.getGroupInputs(l);d.length>0&&(d[0].focus(),d[0].select())}}break}}}handleChange(e,t,i){if(e.stopImmediatePropagation(),this.readOnly)return;const s=e.target.value.replace(/[^0-9]/g,"");this.updateDatePart(t,i,s),this.tryCreatePill()}handleBlur(e,t,i){const n=e.target,s=parseInt(n.value,10);if(!isNaN(s)&&s>0){const r=i==="year"?4:2;n.value=s.toString().padStart(r,"0")}this.dispatchEvent(new CustomEvent("blur"))}getGroupInputs(e){return Array.from(this.querySelectorAll(`input[data-group="${e}"]`))}setDatePartValue(e,t,i){const n=e==="start"?this._startDate:this._endDate,s=t==="year"?4:2;t==="day"&&(n.day=i.toString().padStart(s,"0")),t==="month"&&(n.month=i.toString().padStart(s,"0")),t==="year"&&(n.year=i.toString().padStart(s,"0")),e==="start"?this._startDate={...n}:this._endDate={...n}}updateDatePart(e,t,i){e==="start"?this._startDate={...this._startDate,[t]:i}:this._endDate={...this._endDate,[t]:i}}validateDateParts(e){let t=parseInt(e.year,10),i=parseInt(e.month,10),n=parseInt(e.day,10);if(isNaN(t)||isNaN(i)||isNaN(n)||String(t).length<4)return null;t=Math.max(this.MIN_YEAR,Math.min(this.MAX_YEAR,t)),i=Math.max(this.MIN_MONTH,Math.min(this.MAX_MONTH,i)),n=Math.max(this.MIN_DAY,Math.min(this.MAX_DAY,n));const s=this.MAX_VALID_DAY(i,t);return n>s?(this.dispatchEvent(new CustomEvent("inputError",{detail:{message:"Invalid date: day is greater than the maximum valid day for the month and year."},bubbles:!0})),null):new Date(t,i-1,n)}setupObservers(){const e=this.querySelector(".gui-sentinel__start"),t=this.querySelector(".gui-sentinel__end");e&&!this.startObserver&&(this.startObserver=Ct(e,i=>this._isStartVisible=i)),t&&!this.endObserver&&(this.endObserver=Ct(t,i=>this._isEndVisible=i)),!e&&this.startObserver&&(this.startObserver.disconnect(),this.startObserver=void 0,this._isStartVisible=!0),!t&&this.endObserver&&(this.endObserver.disconnect(),this.endObserver=void 0,this._isEndVisible=!0)}disconnectObservers(){this.startObserver?.disconnect(),this.endObserver?.disconnect(),this.startObserver=void 0,this.endObserver=void 0}tryCreatePill(){const e=this.validateDateParts(this._startDate),t=this.validateDateParts(this._endDate);if(!e||!t)return;let i=e,n=t;t.getTime()<e.getTime()&&(i=t,n=e);const s=rt(i),r=rt(n),a=s===r?{start:s}:{start:s,end:r},o=this.value?[...this.value]:[];o.push(a),this.value=ls(o),this._startDate={day:"",month:"",year:""},this._endDate={day:"",month:"",year:""},this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),requestAnimationFrame(()=>{const l=this.getGroupInputs("start");l.length>0&&l[0].focus()}),this.requestUpdate()}};ne([u({type:String})],U.prototype,"uid",2),ne([u({type:String})],U.prototype,"label",2),ne([u({type:String,attribute:"locale-id"})],U.prototype,"localeId",2),ne([u({type:Array})],U.prototype,"errors",2),ne([u({type:Boolean})],U.prototype,"showErrors",2),ne([u({type:Boolean})],U.prototype,"touched",2),ne([u({type:Boolean})],U.prototype,"required",2),ne([u({type:Boolean})],U.prototype,"disabled",2),ne([u({type:Boolean,attribute:"readonly"})],U.prototype,"readOnly",2),ne([u({type:Array})],U.prototype,"value",2),ne([u({type:String})],U.prototype,"hint",2),ne([u({type:String})],U.prototype,"icon",2),ne([u({type:String})],U.prototype,"removePillAriaLabel",2),ne([u({type:String})],U.prototype,"startDateAriaLabel",2),ne([u({type:String})],U.prototype,"endDateAriaLabel",2),ne([u({type:String})],U.prototype,"separator",2),ne([Y()],U.prototype,"_startDate",2),ne([Y()],U.prototype,"_endDate",2),ne([Y()],U.prototype,"_isStartVisible",2),ne([Y()],U.prototype,"_isEndVisible",2),ne([Y()],U.prototype,"_showPillsList",2),U=ne([ue("gui-range-date")],U),typeof customElements<"u"&&!customElements.get("gui-range-date")&&customElements.define("gui-range-date",U);function uc(e){const t=e.widget,{uid:i,errors:n,value:s,isTouched:r,templateData:a,onBlur:o,onValueChanged:l,injectValidationIssues:d}=x.useInputWidget(t),c=g.useCallback(k=>{const P=k,O=H=>{d(null),l(H.detail.value)},E=()=>{o()},B=H=>{d([H.detail.message])};return k&&(P.addEventListener("blur",E),P.addEventListener("change",O),P.addEventListener("inputError",B)),()=>{P.removeEventListener("blur",E),P.removeEventListener("change",O),P.removeEventListener("inputError",B)}},[l,o,d]),h=a.label,p=a.hint,m=a.icon,f=a.lang,w=a.separator,S=a.removePillAriaLabel,T=a.startDateAriaLabel,C=a.endDateAriaLabel,I=a.disabled,A=a.readonly,D=a.validator?.required;return y.jsx("div",{className:"gui-range-date-input gui-field",style:{flex:a.size},children:y.jsx("gui-range-date",{ref:c,uid:i,label:h,hint:p,errors:n,touched:r,required:D,disabled:I,readOnly:A,value:s,icon:m,localeId:f,separator:w,removePillAriaLabel:S,startDateAriaLabel:T,endDateAriaLabel:C})})}const cc=Object.freeze(Object.defineProperty({__proto__:null,RangeDateInput:uc},Symbol.toStringTag,{value:"Module"}));function hc(e){const t=e.widget,{uid:i,errors:n,value:s,isTouched:r,templateData:a,onValueChanged:o,onBlur:l,injectValidationIssues:d}=x.useInputWidget(t),[c,h]=g.useState(!1),[p,m]=g.useState(void 0),f=g.useRef(null),w=g.useRef(null),S=g.useRef(null),T=g.useCallback(ae=>{const $=ae,N=le=>{d(null),o(le.detail.value)},z=le=>{d([le.detail.message])},q=()=>{h(!0)},Xe=le=>{m(le.detail.range.start),h(!0)};return w.current=ae,ae&&($.addEventListener("change",N),$.addEventListener("focus",q),$.addEventListener("blur",l),$.addEventListener("inputError",z),$.addEventListener("pillClick",Xe)),()=>{$.removeEventListener("change",N),$.removeEventListener("focus",q),$.removeEventListener("blur",l),$.removeEventListener("inputError",z),$.removeEventListener("pillClick",Xe)}},[o,l,d]),C=g.useCallback(ae=>{const $=ae,N=q=>{d(null),o(q.detail.value)},z=q=>{l(),h(!1)};return S.current=ae,ae&&($.addEventListener("blur",z),$.addEventListener("change",N)),()=>{$.addEventListener("blur",z),$.addEventListener("change",N)}},[o,d,l]);g.useEffect(()=>{const ae=$=>{if(!c)return;const N=$.composedPath(),z=w.current&&N.includes(w.current),q=S.current&&N.includes(S.current);!z&&!q&&h(!1)};return document.addEventListener("click",ae),()=>{document.removeEventListener("click",ae)}},[c]);const I=ae=>{if(!c)return;const $=ae.relatedTarget;$&&f.current?.contains($)||h(!1)},A=ae=>{const $=ae.target,N=$.closest(".gui-range-date-input__part"),z=$.closest("gui-range-calendar"),q=$.closest(".gui-range-date-input__pill"),Xe=$.closest(".gui-range-date-input__pill--count");N||z||q?c||h(!0):Xe?c&&h(!1):h(le=>!le)},D=a.hint,k=a.icon,P=a.separator,O=a.removePillAriaLabel,E=a.startDateAriaLabel,B=a.endDateAriaLabel,H=a.prevMonthIcon,K=a.nextMonthIcon,W=a.prevMonthAriaLabel,G=a.nextMonthAriaLabel,J=a.dayFormat,Ze=a.weekdayFormat,Tt=a.monthFormat,Pt=a.minDate,lt=a.maxDate,Dt=a.disabledRanges,X=a.numberOfMonths,j=r&&n&&n.length>0,Oe=a.disabled,Te=a.readonly,De=a.validator?.required,dt=a.lang;return y.jsxs("div",{ref:f,className:"gui-range-date-picker gui-field",style:{flex:a.size},onBlur:I,children:[a.label&&y.jsxs("label",{className:"gui-label",htmlFor:i,"data-cy":`${i}_label`,children:[a.label+(De?" *":""),D&&y.jsx("div",{className:"gui-widget-hint",id:`${i}_hint`,children:D})]}),y.jsxs("div",{role:"button",tabIndex:-1,className:"gui-widget",onClick:A,onKeyUp:ae=>{ae.target===ae.currentTarget&&(ae.key==="Enter"||ae.key===" ")&&h($=>!$)},"aria-expanded":c,children:[y.jsx("gui-range-date",{ref:T,uid:i,hint:D,showErrors:!1,errors:n,touched:r,required:De,disabled:Oe,readOnly:Te,value:s,icon:k,localeId:dt,separator:P,removePillAriaLabel:O,startDateAriaLabel:E,endDateAriaLabel:B}),y.jsx("span",{className:"gui-range-date-picker__arrow",children:y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"})})}),c&&y.jsx("gui-range-calendar",{ref:C,uid:i,hint:D,touched:r,required:De,disabled:Oe,readOnly:Te,value:s,focusDate:p,prevMonthIcon:H,nextMonthIcon:K,prevMonthAriaLabel:W,nextMonthAriaLabel:G,dayFormat:J,weekdayFormat:Ze,monthFormat:Tt,minDate:Pt,maxDate:lt,disabledRanges:Dt,numberOfMonths:X,localeId:dt,hidePills:!0})]}),j&&y.jsx(fs,{errors:n,uid:i})]})}const pc=Object.freeze(Object.defineProperty({__proto__:null,RangeDatePicker:hc},Symbol.toStringTag,{value:"Module"}));let mc=0;const yc=()=>mc++;function fc(e){const t=e.widget,{uid:i,value:n,onValueChanged:s,templateData:r,errors:a,isTouched:o,onBlur:l}=x.useInputWidget(t),d=g.useRef(null),c=g.useCallback(A=>{const D=[...A??[],{}];s(D)},[s]),h=g.useCallback((A,D)=>{const k=(A??[]).filter((P,O)=>D!==O);"structuredClone"in window?s(structuredClone(k)):s(JSON.parse(JSON.stringify(k)))},[s]),[p,m]=g.useState(!1),f=g.useCallback(A=>{A.stopPropagation(),m(!0)},[]),w=g.useCallback(A=>{A.stopPropagation(),l(),m(!1)},[]),S=x.useRepeaterIndexes(),T=g.useCallback(()=>n?.map((A,D)=>{const k=ka(A,yc);return y.jsx(x.RepeaterIndexesContext.Provider,{value:[...S,D],children:y.jsxs("div",{className:"gui-repeater__card",children:[y.jsxs("div",{className:"gui-repeater__card-header",children:[r.title&&y.jsx("span",{className:"gui-repeater__card-title",children:`${r.title} ${D+1}`}),y.jsxs("button",{type:"button",tabIndex:0,className:"gui-button gui-button--sm gui-repeater__remove-btn",onClick:()=>h(n,D),children:[r.removeButtonIcon&&y.jsx("span",{className:`gui-widget-icon gui-button-icon ${r.removeButtonIcon}`,"data-icon":r.removeButtonIcon}),r.removeLabel??"Remove"]})]}),y.jsx(x.WidgetRenderer,{widget:r.template},`${i}-${k}`)]})},`${i}-${k}`)}),[r,n,i,h,S]),C=r.validator?.required,I=o&&a&&a.length>0;return y.jsxs("div",{className:"gui-repeater gui-field",style:{flex:r.size},children:[y.jsxs("div",{ref:d,id:i,className:`gui-repeater__main-card gui-repeater__card${p?" gui-repeater__card--focused":""}`,onFocus:f,onBlur:w,children:[y.jsx("gui-label",{targetElement:d.current||void 0,uid:i,label:r.label,errors:a,touched:o,required:C,native:!1}),T(),y.jsxs("button",{type:"button",tabIndex:0,className:"gui-button gui-repeater__add-btn",onClick:()=>c(n||[]),disabled:r.limit?r.limit===(n?.length??0):!1,children:[r.addButtonIcon&&y.jsx("span",{className:`gui-widget-icon gui-button-icon ${r.addButtonIcon}`,"data-icon":r.addButtonIcon}),r.addLabel??"Add"]})]}),I&&y.jsx("gui-errors",{uid:i,errors:a,touched:o})]})}const gc=Object.freeze(Object.defineProperty({__proto__:null,Repeater:fc},Symbol.toStringTag,{value:"Module"}));function bc(e){const t=e.widget,{uid:i,children:n,templateData:s}=x.useLayoutWidget(t),r=g.useCallback(()=>n?n.map(d=>y.jsx(x.WidgetRenderer,{widget:d},d.uid)):null,[n]),a=`gui-flex__widget--${s.direction??"column"}`,o=`gui-flex__widget--justify-${s.justify??"stretch"}`,l=`gui-flex__widget--align-${s.align??"start"}`;return y.jsx("div",{className:"gui-flex gui-field",style:{flex:s.size},children:y.jsx("div",{className:`gui-flex__widget ${a} ${o} ${l}`,style:s.gap?{gap:`${s.gap}px`}:{},id:i,children:r()})})}const Dc=Object.freeze(Object.defineProperty({__proto__:null,Flex:bc},Symbol.toStringTag,{value:"Module"}));function vc(e){const t=e.widget,{uid:i,children:n,templateData:s}=x.useLayoutWidget(t),r=s.direction!=="column",a=g.useCallback(()=>n.map(h=>{const p=h;return y.jsx("div",{className:"gui-grid__cell",style:{gridColumn:`span ${p.size||1}`},children:y.jsx(x.WidgetRenderer,{widget:p})},p.uid)}),[n]),o=r?"gui-grid__widget--row":"gui-grid__widget--column",l=`gui-grid__widget--align-${s.align??"stretch"}`,d=s.justify?`gui-grid__widget--justify-${s.justify}`:"",c={};return s.columnGap!==void 0&&(c.columnGap=`${s.columnGap}px`),s.rowGap!==void 0&&(c.rowGap=`${s.rowGap}px`),y.jsx("div",{className:"gui-grid gui-field",style:{flex:s.size},children:y.jsx("div",{className:`gui-grid__widget ${o} ${r&&(s.autoFit??!0)?"gui-grid__widget--row--auto-fit":""} ${l} ${d}`,style:c,id:i,children:a()})})}const wc=Object.freeze(Object.defineProperty({__proto__:null,Grid:vc},Symbol.toStringTag,{value:"Module"}));function _c(e){const t=g.useRef(null),i=e.widget,{uid:n,children:s,templateData:r,onChange:a}=x.useLayoutWidget(i),o=g.useRef([]),l=g.useRef(null),d=g.useRef(null),[c,h]=g.useState(!1),[p,m]=g.useState(!1),[f,w]=g.useState(r.defaultOpen);g.useEffect(()=>{const A=l.current,D=d.current,k=Ct(A,O=>h(O)),P=Ct(D,O=>m(O));return()=>{k.disconnect(),P.disconnect()}},[]),g.useEffect(()=>{f===void 0&&r.tabs?.length>0&&w(r.tabs[0].uid)},[r.tabs,f]),g.useEffect(()=>{r.defaultOpen&&w(r.defaultOpen)},[r.defaultOpen]),g.useEffect(()=>{const D=(r.tabs||[]).findIndex(k=>k.uid===f);D>-1&&o.current[D].scrollIntoView({block:"nearest",inline:"nearest"})},[f,r.tabs]);const S=g.useCallback(A=>{w(A),a(A)},[a]),T=g.useCallback(A=>{const D=r.tabs.findIndex(O=>O.uid===f),k=o.current,P=t.current?window.getComputedStyle(t.current).direction==="rtl":!1;switch(A.key){case"ArrowLeft":{const O=D+(P?1:-1);O>=0&&O<r.tabs.length&&(S(r.tabs[O].uid),k[O]?.focus());break}case"ArrowRight":{const O=D+(P?-1:1);O>=0&&O<r.tabs.length&&(S(r.tabs[O].uid),k[O]?.focus());break}case"Home":S(r.tabs[0].uid),k[0]?.focus();break;case"End":S(r.tabs[r.tabs.length-1].uid),k[r.tabs.length-1]?.focus();break;default:return}},[f,r.tabs,S]),C=g.useCallback(()=>(r.tabs||[]).map((D,k)=>y.jsx("li",{role:"presentation",children:y.jsx("button",{ref:P=>{o.current[k]=P},type:"button",role:"tab",tabIndex:D.uid===f?0:-1,"data-cy":`tab_${i.uid}_${k}`,id:`tab_${i.uid}_${k}`,"aria-controls":`tabpanel_${i.uid}_${k}`,"aria-selected":D.uid===f?"true":"false",className:`${D.uid===f?"active":""}`,onClick:()=>S(D.uid),onKeyDown:P=>T(P),onFocus:P=>{P.target.scrollIntoView({block:"nearest",inline:"nearest"})},children:D.label})},`tab_${i.uid}_${D.uid}`)),[r,f,i,o,S,T]),I=g.useCallback(()=>{const A=s.findIndex(D=>D.uid===f);return s.filter(D=>D.uid===f||r.renderMode!=="activeOnly").map(D=>y.jsx("section",{role:"tabpanel","data-cy":`tabpanel_${i.uid}_${A}`,id:`tabpanel_${i.uid}_${A}`,hidden:D.uid!==f&&r.renderMode!=="activeOnly","aria-labelledby":`tab_${i.uid}_${A}`,children:y.jsx(x.WidgetRenderer,{widget:D},D.uid)},`tabpanel_${i.uid}_${D.uid}`))},[s,f,i]);return y.jsxs("div",{className:"gui-tabs gui-field",style:{flex:r.size},children:[y.jsx("nav",{className:x.cn({"gui-widget":!0,"gui-widget--horizontal":!0,"gui-tabs--start-shadow":!c,"gui-tabs--end-shadow":!p}),id:n,children:y.jsxs("ul",{role:"tablist",children:[y.jsx("li",{role:"presentation",ref:l,className:"gui-sentinel gui-sentinel__start"}),C(),y.jsx("li",{role:"presentation",ref:d,className:"gui-sentinel gui-sentinel__end"})]})}),I()]})}const kc=Object.freeze(Object.defineProperty({__proto__:null,Tabs:_c},Symbol.toStringTag,{value:"Module"})),ws={};function $c(e){const t=e.widget,{uid:i,children:n,templateData:s,onChange:r}=x.useLayoutWidget(t),[a,o]=g.useState(ws);g.useEffect(()=>{a===ws&&s.defaultOpen&&o(s.defaultOpen||{})},[a,s]);const l=g.useCallback(h=>{const p={...a};s.singleOpen&&Object.keys(p).filter(m=>m!==h).forEach(m=>{p[m]=m===h?!p[m]:!1}),p[h]=!p[h],o(p),r(p)},[a,s.singleOpen,r]),d=g.useCallback(h=>{const p=n.find(f=>f.uid===h),m=a[h];return(m||s.renderMode!=="activeOnly")&&p?y.jsx("section",{className:"gui-widget",role:"region",id:`accordion_section_${h}`,hidden:!m&&s.renderMode!=="activeOnly","aria-labelledby":`accordion_button_${h}`,children:y.jsx(x.WidgetRenderer,{widget:p})}):null},[n,a,s.renderMode]),c=g.useCallback(()=>(s.sections||[]).map((p,m)=>y.jsxs("div",{className:"gui-accordion__section",children:[y.jsxs("button",{type:"button",tabIndex:0,id:`accordion_button_${p.uid}`,"aria-controls":`accordion_section_${p.uid}`,"aria-expanded":a[p.uid]?"true":"false",className:a[p.uid]?"active":"",onClick:()=>l(p.uid),children:[p.label,y.jsx("span",{className:"gui-accordion__arrow",children:y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 256 256",children:y.jsx("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"})})})]}),d(p.uid)]},`${"accordion_section_"+p.uid}`)),[s.sections,a,d,l]);return y.jsx("div",{className:"gui-accordion gui-field",style:{flex:s.size},children:y.jsx("div",{className:"gui-widget",id:i,children:c()})})}const Sc=Object.freeze(Object.defineProperty({__proto__:null,Accordion:$c},Symbol.toStringTag,{value:"Module"}));function Ac(e){const t=e.widget,{uid:i,templateData:n}=x.useDisplayWdiget(t);return y.jsx("div",{className:"gui-alert gui-field",style:{flex:n.size},children:y.jsx("div",{className:"gui-widget",id:i,children:y.jsx("div",{role:"alert",className:`gui-alert-notification gui-alert-notification--${n.level||"default"}`,children:n.text})})})}const Oc=Object.freeze(Object.defineProperty({__proto__:null,Alert:Ac},Symbol.toStringTag,{value:"Module"}));function Ec(e){const t=e.widget,{uid:i,templateData:n}=x.useDisplayWdiget(t);return y.jsx("div",{className:"gui-markdown-text gui-field",style:{flex:n.size},children:y.jsx("div",{className:"gui-widget",id:i,children:y.jsx("gui-markdown-text",{md:n.md,dependencies:n.deps})})})}const Ic=Object.freeze(Object.defineProperty({__proto__:null,MarkdownText:Ec},Symbol.toStringTag,{value:"Module"}));function Cc(e){const t=e.widget,{uid:i,templateData:n}=x.useDisplayWdiget(t),s=n?.render;return y.jsx("div",{className:"gui-renderer gui-field",style:{flex:n.size},children:y.jsx("div",{className:"gui-widget",id:i,children:s})})}const Tc=Object.freeze(Object.defineProperty({__proto__:null,Renderer:Cc},Symbol.toStringTag,{value:"Module"}));Ue.GuiForm=Ql,Ue.widgetLoaders=Zi,Object.defineProperty(Ue,Symbol.toStringTag,{value:"Module"})}));