1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7243],{57243:(e,t,a)=>{a.d(t,{A:()=>R});var r=a(54568),n=a(7620),l=a(48442),s=a(98432),o=a(96530);let i=["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"],u=class extends n.Component{componentDidMount(){this.createFlatpickrInstance()}componentDidUpdate(e){let{options:t}=this.props,a=e.options;t=c(t,this.props),a=c(a,e);let r=Object.keys(t);for(let e=r.length-1;e>=0;e--){let n=r[e],l=t[n],s=l;l!==a[n]&&(i.includes(n)&&!Array.isArray(l)&&(s=[l]),this.flatpickr?.set(n,s))}void 0===this.props.value||this.props.value&&Array.isArray(this.props.value)&&e.value&&Array.isArray(e.value)&&this.props.value.every((t,a)=>Array.isArray(e.value)&&e.value[a]===t)||this.props.value===e.value||this.flatpickr?.setDate(this.props.value,!1)}componentWillUnmount(){this.destroyFlatpickrInstance()}render(){let e,{options:t,defaultValue:a,value:n,children:l,render:s}=this.props,o=(e={...this.props},delete e.options,delete e.defaultValue,delete e.value,delete e.render,delete e.onCreate,delete e.onDestroy,i.forEach(t=>delete e[t]),e);return s?s({...o,defaultValue:a,value:n},this.handleNodeChange):t.wrap?(0,r.jsx)("div",{...o,ref:this.handleNodeChange,children:l}):(0,r.jsx)("input",{...o,type:"text",defaultValue:a,ref:this.handleNodeChange})}constructor(...e){super(...e),this.node=null,this.getNode=()=>this.node,this.createFlatpickrInstance=()=>{let e={onClose:()=>{this.node?.blur()},...this.props.options};if(e=c(e,this.props),!this.node)return;this.flatpickr=(0,o.A)(this.node,e),void 0!==this.props.value&&this.flatpickr.setDate(this.props.value,!1);let{onCreate:t}=this.props;t&&this.flatpickr&&t(this.flatpickr)},this.destroyFlatpickrInstance=()=>{let{onDestroy:e}=this.props;e&&this.flatpickr&&e(this.flatpickr),this.flatpickr?.destroy(),this.flatpickr=void 0},this.handleNodeChange=e=>{this.node=e,this.flatpickr&&(this.destroyFlatpickrInstance(),this.createFlatpickrInstance())}}};function c(e,t){let a={...e};return i.forEach(e=>{let r=t[e];if(r){a[e]&&!Array.isArray(a[e])?a[e]=[a[e]]:a[e]||(a[e]=[]);let t=Array.isArray(r)?r:[r];a[e].push(...t)}}),a}var d=a(93420),p=a(82292),h=a(97509),m=a(80827),f=a(45911),v=a(24127),y=a(18932);let{element:g}=(0,l.T)("sn-date-picker");function k({container:e,name:t,years:a,currentYear:l,ariaLabel:s,onSelectYear:o}
1){let[i,u]=(0,n.useState)(!1),c=(0,n.useRef)(null),d=(0,n.useRef)(null),p=(0,n.useRef)(null),D=`${t.replace(/\W/g,"-")}-year-listbox`,x=(0,n.useMemo)(()=>a.map(e=>({key:String(e),text:String(e),value:e})),[a]),Y=(0,n.useMemo)(()=>x.find(e=>e.value===l),[x,l]),M=()=>c.current?.focus();(0,n.useEffect)(()=>{if(!i)return;let t=setTimeout(()=>p.current?.focus(),10),a=e=>{let t=e.composedPath?.()[0]??e.target;c.current?.contains(t)||p.current?.contains(t)||u(!1)},r=e=>{if(e.key!==f.z.Escape)return;let t=e.target;(c.current?.contains(t)||d.current?.contains(t))&&(e.stopPropagation(),e.preventDefault(),u(!1),M())};return document.addEventListener("mousedown",a,!0),e.addEventListener("keydown",r,!0),()=>{clearTimeout(t),document.removeEventListener("mousedown",a,!0),e.removeEventListener("keydown",r,!0)}},[i,e]);let C=e.querySelector(".flatpickr-current-month");if(!C)return null;let b=(0,r.jsxs)("button",{type:"button",ref:c,className:m(g("year-toggle"),{"is-open":i}),"aria-label":[s??"Year",l].filter(e=>null!=e).join(", "),"aria-haspopup":"listbox","aria-expanded":i,"aria-controls":i?D:void 0,onMouseDown:e=>e.preventDefault(),onClick:()=>u(e=>!e),onKeyDown:e=>{e.key!==f.z.ArrowDown&&e.key!==f.z.ArrowUp||i||(e.preventDefault(),u(!0))},children:[(0,r.jsx)("span",{className:g("year-value"),children:l}),(0,r.jsx)(v.A,{"aria-hidden":!0,className:g("year-chevron")})]}),A=(0,r.jsx)("div",{ref:d,className:m(g("year-dropdown"),{"is-open":i}),"aria-hidden":!i,children:i&&(0,r.jsx)(y.A,{ref:p,name:D.replace("-listbox",""),className:g("year-options"),options:x,selectedOptions:Y,onSelect:e=>{void 0!==e.value&&o(e.value),u(!1),M()},ariaLabel:s})});return(0,r.jsxs)(r.Fragment,{children:[(0,h.createPortal)(b,C),(0,h.createPortal)(A,e)]})}var D=a(91006);let{element:x}=(0,l.T)("sn-date-picker"),Y="selected",M=(0,n.forwardRef)(function({id:e,name:t,minDate:a,maxDate:l,value:s,defaultValue:o,type:i,format:c,onChange:h,...m},f){let v=(0,n.useRef)(null);(0,n.useImperativeHandle)(f,()=>({get element(){return v.current?.getNode()??null},focus(){v.current?.getNode()?.focus()}}),[]);let[y,g]=(0,n.useState)(),[M,C]=(0,n.useState)(),b=(0,n.useMemo)(()=>c??D.ko?.date,[c]),A=(0,n.useMemo)(()=>{let e=a?new Date(a):void 0;return e?.addMonths(-1),e?.setDate(e.daysInMonth()),e},[a]),F=(0,n.useMemo)(()=>{let e=l?new Date(l):void 0;return e?.setDate(e.daysInMonth()),e},[l]),w=(0,n.useMemo)(()=>{let e=[];return"month"===i&&e.push((0,d.A)({dateFormat:b.flatpickr.monthFormat})),e},[b?.flatpickr.monthFormat,i]),j=(0,n.useMemo)(()=>{if("month"!==i)return[];let e=l?.getFullYear()??new Date().getFullYear(),t=a?.getFullYear()??e-100,r=[];for(let a=e;a>=t;a--)r.push(a);return r},[i,a,l]),N=(e,t)=>{let a=t>e.currentYear?e.nextMonthNav:e.prevMonthNav,r=Math.abs(t-e.currentYear);for(let e=0;e<r;e++)a?.click()},E=e=>{if(!e.calendarContainer)return;let t=e.calendarContainer.querySelectorAll(".flatpickr-monthSelect-month");t.forEach(e=>{e.classList.contains("flatpickr-disabled")?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled")});let a=e.selectedDates?.[0];t.forEach(e=>e.classList.remove(Y)),a&&e.currentYear===a.getFullYear()&&t[a.getMonth()]?.classList.add(Y)},R=y?.currentYearElement?.getAttribute("aria-label")??void 0;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u,{...m,id:e??t,name:t,ref:v,value:s,options:{dateFormat:b.flatpickr.dateFormat,locale:b.flatpickr.locale,minDate:"month"===i?A:a,maxDate:"month"===i?F:l,plugins:w,defaultDate:o,disableMobile:!0,static:!0},onOpen:(e,t,a)=>{if("month"!==i)return;let r=a.selectedDates?.[0];r&&N(a,r.getFullYear()),setTimeout(()=>E(a))},onYearChange:(e,t,a)=>{"month"===i&&(C(a.currentYear),setTimeout(()=>E(a)))},onChange:(e,t)=>
1{let r=e?.[0];if(!(e=>{if("month"!==i||!e)return!1;let t=e.getFullYear(),r=e.getMonth();return!!(l&&(t>l.getFullYear()||t===l.getFullYear()&&r>l.getMonth())||a&&(t<a.getFullYear()||t===a.getFullYear()&&r<a.getMonth()))})(r))return h(r??t)},onReady:(e,t,a)=>{"month"===i&&(g(a),C(a.currentYear)),x("popup",{[i]:!0}).split(" ").forEach(e=>{a.calendarContainer?.classList.add(e)})},onDestroy:()=>{"month"===i&&g(void 0)}}),(0,r.jsx)(p.A,{className:x("calendar")}),"month"===i&&y?.calendarContainer?.isConnected&&(0,r.jsx)(k,{container:y.calendarContainer,name:t,years:j,currentYear:M,ariaLabel:R,onSelectYear:e=>N(y,e)})]})}),{element:C}=(0,l.T)("sn-date-picker"),b=(0,n.forwardRef)(function({id:e,name:t,minDate:a,maxDate:l,value:s,type:o,formatDate:i,onChange:u,...c},d){let h=(0,n.useCallback)(e=>{"Enter"!==e.key||(e.preventDefault(),e.currentTarget.showPicker())},[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{...c,id:e??t,name:t,ref:d,type:o,min:i(a),max:i(l),value:i(s)??"",onChange:u,onKeyDown:h}),(0,r.jsx)(p.A,{className:C("calendar")})]})});var A=a(1086);let F=(0,n.forwardRef)(function({id:e,name:t,minDate:a,maxDate:l,value:s,formatDate:o,onChange:i,...u},c){let d=(0,n.useMemo)(()=>{let e=a?.getFullYear()??1970;return Array((l?.getFullYear()??new Date(Date.now()).getFullYear())-e+1).fill(0).map((t,a)=>({key:`${e+a}`,text:`${e+a}`,value:o(new Date(e+a))}))},[a,l]);return(0,r.jsx)(A.A,{id:e??t,ref:c,name:t,options:d,value:o(s),onChange:i,...u})});var w=a(32528),j=a(31888);let{component:N}=(0,l.T)("sn-date-picker"),E="DatePicker",R=(0,n.forwardRef)(function({id:e,name:t,label:a,sublabel:l,help:o,message:i,valid:u,value:c,defaultValue:d,defaultDay:p="first",format:h,className:m,onChange:f,onValueChange:v,forceCustom:y,min:g,max:k,type:D="date",valueType:x="string","data-name":Y,...C},A){let R=(0,n.useRef)(null),I=(0,n.useRef)(null),S=(0,n.useRef)(null),L=(0,n.useMemo)(()=>{if(d)return d instanceof Date?d:new Date(d)},[d]),T=(0,n.useCallback)(e=>{let t="month"===D?"YYYY-MM":"year"===D?"YYYY":void 0;return e?.format(t)},[D]),[P,O]=(0,n.useState)(()=>"year"===D?L:void 0),U=(0,n.useMemo)(()=>{let e=document.createElement("input");return e.type=D,e.type===D},[D]),V=(0,n.useMemo)(()=>y||"month"===D||!U,[y,D,U]);(0,n.useImperativeHandle)(A,()=>({get element(){if("year"===D)return I.current;if(V)return S.current?.element??null;return R.current},focus(){"year"===D?I.current?.focus():V?S.current?.focus():R.current?.focus()}}),[V,D]);let _=(0,n.useMemo)(()=>g instanceof Date?g:s.p6.create(g),[g]),z=(0,n.useMemo)(()=>k instanceof Date?k:s.p6.create(k),[k]),$=(e,t)=>{let a=s.p6.create("string"==typeof e?e:e?.format());"year"===D&&a?.setMonth(11*("last"===p)),("month"===D||"year"===D)&&a?.setDate("last"===p?a.daysInMonth():1);let r="string"===x&&a?a.format():a;v?.(r,t??{validate:!0}),O(a)},q=e=>{f?.(e),$(e.target.value)};return(0,n.useEffect)(()=>{("string"===x?c:c?.format())!==P?.format()&&setTimeout(()=>$(c,{validate:!1}),1)},[c]),(0,r.jsx)(w.A,{label:a,sublabel:l,help:o,message:i,valid:u,disabled:C.disabled,className:N(m,{empty:!P,native:!V,[D]:!0}),"data-component":E,"data-id":t,id:e,name:t,"data-name":Y,children:(0,r.jsx)(j.A,{children:"year"===D?(0,r.jsx)(F,{id:e,ref:I,name:t,minDate:_,maxDate:z,value:P,formatDate:T,onChange:q,...C}):V?(0,r.jsx)(M,{id:e,ref:S,name:t,minDate:_,maxDate:z,value:P,defaultValue:L,type:D,format:h,onChange:$,...C}):(0,r.jsx)(b,{id:e,ref:R,name:t,minDate:_,maxDate:z,value:P??L,type:D,formatDate:T,onChange:q,...C})})})});R.displayName=E}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.