@spscommerce/ds-react 8.50.1 → 8.51.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.
package/lib/index.umd.cjs CHANGED
@@ -1,4 +1,4 @@
1
- (function(x,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react"),require("@spscommerce/utils"),require("moment-timezone"),require("@spscommerce/ds-shared"),require("@spscommerce/i18n"),require("react-dom"),require("@spscommerce/ds-colors"),require("@sps-woodland/tabs"),require("@sps-woodland/illustrations")):typeof define=="function"&&define.amd?define(["exports","react","@spscommerce/utils","moment-timezone","@spscommerce/ds-shared","@spscommerce/i18n","react-dom","@spscommerce/ds-colors","@sps-woodland/tabs","@sps-woodland/illustrations"],E):(x=typeof globalThis<"u"?globalThis:x||self,E(x.DSReact={},x.React,x.utils,x.moment$3,x.dsShared,x.i18n,x.ReactDOM,x.dsColors,x.tabs,x.illustrations))})(this,(function(x,E,S,Me,F,he,Ln,Nr,xm,gi){"use strict";function hi(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 r=hi(E),pn=hi(Me);function bi(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=bi(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function $(){for(var e,t,n=0,o="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=bi(e))&&(o&&(o+=" "),o+=t);return o}const km="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let We=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=km[n[e]&63];return t};function Rt(e){return E.useRef(e||We())}function Ge(e,t){const n=Rt(e),o=E.useRef(`${n.current}_ctrl`);return E.useEffect(()=>{t&&(t.id=o.current,t.update())},[t]),{wrapperId:n.current||void 0,controlId:o.current}}function Ir(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xr,vi;function Mm(){if(vi)return xr;vi=1;var e="[object Object]";function t(p){var f=!1;if(p!=null&&typeof p.toString!="function")try{f=!!(p+"")}catch{}return f}function n(p,f){return function(g){return p(f(g))}}var o=Function.prototype,a=Object.prototype,s=o.toString,i=a.hasOwnProperty,l=s.call(Object),c=a.toString,d=n(Object.getPrototypeOf,Object);function u(p){return!!p&&typeof p=="object"}function m(p){if(!u(p)||c.call(p)!=e||t(p))return!1;var f=d(p);if(f===null)return!0;var g=i.call(f,"constructor")&&f.constructor;return typeof g=="function"&&g instanceof g&&s.call(g)==l}return xr=m,xr}var Lm=Mm();const yi=Ir(Lm),Ze=new Set,un=new Set,wt=new Set,So=new Set;function Ei(e){Ze.has(e)||wt.has(e)||So.has(e)||un.add(e)}function Ti(e){Ze.has(e)||wt.has(e)||un.has(e)||So.add(e)}const Fe=pn.default||pn,mn="MM/DD/YYYY",_m="MM/DD/YYYY hh:mm A",Pm="MM/DD/YYYY HH:mm",Bm="hh:mm A",Om="HH:mm",Rm=/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/,_n=Symbol("Date Parse Error");function fn(e){return Fe.isMoment(e)?e.year()*1e4+(e.month()+1)*100+e.date():e.year*1e4+e.month*100+e.date}const j=Object.freeze({createFrom(e,t){if(!e)return null;if(typeof e=="string"){if(t){const n=Fe(e,t,!0);if(n.isValid())return Object.freeze({year:n.year(),month:n.month()+1,date:n.date()})}else{const n=Rm.exec(e);if(n){const[,o,a,s]=n;return Object.freeze({year:Number(s),month:Number(o),date:Number(a)})}}return Object.freeze({[_n]:!0,year:void 0,month:void 0,date:void 0})}return Object.freeze({year:e.year(),month:e.month()+1,date:e.date()})},createMomentFrom(e,t){if(!e)return null;let n=null;return typeof e=="string"?t?n=Fe(e,t,!0):n=Fe(e):Fe.isMoment(e)?n=e:n=j.toMoment(e),n!==null&&Fe.isMoment(n)&&n.isValid()?n:Object.freeze({[_n]:!0,year:void 0,month:void 0,date:void 0})},getRangeSeparator(e){return e?.includes("-")?"/":"-"},createRangeFrom(e,t){if(!e)return null;if(t){const n=j.getRangeSeparator(t),o=new RegExp(`[^\\d]*${n}[^\\d]*`);return e.split(o).slice(0,2).map(a=>j.createFrom(a,t))}else return e.split(/[^\d]*-[^\d]*/).slice(0,2).map(n=>j.createFrom(n))},isValid(e){return e?Fe.isMoment(e)?e.isValid():typeof e=="object"&&typeof e.year=="number"&&typeof e.month=="number"&&typeof e.date=="number"&&j.toMoment(e)?.isValid():!1},nullifyInvalidDate(e){return j.isValid(e)?e:null},toMoment(e){return e?Fe.isMoment(e)?e:Fe({...e,month:e.month-1}):null},toString(e,t){const n=j.toMoment(e);return n&&n.isValid()?n.format(t||mn):""},toStringRange(e,t){if(!e)return"";const n=j.getRangeSeparator(t);return e.slice(0,2).map(o=>j.toString(o,t)).join(n)},toDateTimeString(e,t=!1,n){return e&&Fe.isMoment(e)&&e.isValid()?n?t?e.format(`${n} ${Om}`):e.format(`${n} ${Bm}`):t?e.format(Pm):e.format(_m):""},toDateTimeStringRange(e,t=!1,n){if(!e)return"";const o=j.getRangeSeparator(n);return e.map(a=>j.toDateTimeString(a,t,n)).join(o)},create(){const e=new Date;return Object.freeze({year:e.getFullYear(),month:e.getMonth()+1,date:e.getDate()})},isSameDate(e,t){return e&&t&&e.year===t.year&&e.month===t.month&&e.date===t.date},isSameMonth(e,t){return e&&t&&e.year===t.year&&e.month===t.month},isAfter(e,t){return!e||!t?null:fn(e)>fn(t)},isBefore(e,t){return!e||!t?null:fn(e)<fn(t)},isInRange(e,t,n=!0){if(!e||!t||!t[0]||!t[1])return null;const o=fn(e),[a,s]=t.map(fn);return a&&s&&(n&&o>=a&&o<=s||!n&&o>a&&o<s)},prevMonth(e){return Object.freeze({year:e.month===1?e.year-1:e.year,month:e.month-1||12,date:e.date})},nextMonth(e){return Object.freeze({year:e.month===12?e.year+1:e.year,month:e.month+1>12?1:e.month+1,date:e.date})},createRangeFromPreset(e,t){if(typeof e.definition=="function")return e.definition();const n=Fe(),o=n.clone().subtract(Fe.duration(e.definition));return[j.createFrom(o,t),j.createFrom(n,t)]},createDateTimeRangeFromPreset(e){if(typeof e.definition=="function")return e.definition();const t=Fe().subtract(Fe.duration(e.definition)).startOf("day"),n=Fe().endOf("day");return[t,n]},splitMomentInDateTimeParts(e,t=!1,n,o=!1){let a="";t?a=o?"23:59":"00:00":a=o?"11:59":"12:00";const s=o?"PM":"AM";return e&&Fe.isMoment(e)&&e.isValid()?j.toDateTimeString(e,t,n).split(" "):["",a,t?void 0:s]},getCurrentMoment(){return Fe()},validateTimeString(e,t=!1){if(!e)return!0;const n=e.split(":"),o=n[0]||"0",a=n[1]||"0",s=Number.isNaN(Number(o))?NaN:parseInt(o,10),i=Number.isNaN(Number(a))?NaN:parseInt(a,10),l=n.length<=2&&o.length<=2&&a.length<=2;return t?l&&s>=0&&s<=23&&i>=0&&i<=59:l&&(!Number.isNaN(s)&&o.length===1||s>=1)&&s<=12&&i>=0&&i<=59},padIncompleteTimeString(e,t=!1){if(!e)return"";const n=e.split(":"),o=parseInt(n[0]||"0",10),a=parseInt(n[1]||"0",10);if(t){const s=o<10?`0${o}`:`${o}`,i=a<10?`0${a}`:`${a}`;return`${s}:${i}`}else{const s=o===0?"12":o<10?`0${o}`:`${o}`,i=a<10?`0${a}`:`${a}`;return`${s}:${i}`}}}),kr=["01:00","02:00","03:00","04:00","05:00","06:00","07:00","08:00","09:00","10:00","11:00","12:00"],Mr=["00:00","01:00","02:00","03:00","04:00","05:00","06:00","07:00","08:00","09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00","21:00","22:00","23:00"];let go=mn;function wi(e){go=e}const Pn=function(t){if(Array.isArray(t)){const n=Pn(t[0]),o=Pn(t[1]);return n||o}if(t&&t.hasOwnProperty("year")){if(t[_n])return{dateFormat:go};if(!j.isValid(t))return{dateValidity:!0}}return null};Ze.add("dateFormat"),Ze.add("dateValidity");const Ci=function(t){if(Array.isArray(t)){const n=Pn(t);if(n)return n;if(t&&j.isBefore(t[1],t[0]))return{dateRangeOrder:!0}}return null};Ze.add("dateRangeOrder");const Di=function({minDate:t,maxDate:n}){function o(a){const s=j.isBefore(a,t),i=j.isAfter(a,n),l={minExceeded:s?j.toString(t,go):null,maxExceeded:i?j.toString(n,go):null};return s||i?{dateConstraint:l}:null}return function(s){if(!s)return null;if(Array.isArray(s)){const i=o(s[0]),l=o(s[1]);return i||l}return s.hasOwnProperty("year")?o(s):null}};Ze.add("dateConstraint");const Fm=Object.freeze(Object.defineProperty({__proto__:null,date:Pn,dateConstraint:Di,dateRange:Ci,setDateFormat:wi},Symbol.toStringTag,{value:"Module"}));function Mt(e,t){for(const n of[].concat(e)){const o=t(n);if(o)return o}return null}const Am=function(t){function n(o){return Number(o)>=t?null:{min:t}}return o=>Mt(o,n)};Ze.add("min");const $m=function(t){function n(o){return Number(o)<=t?null:{max:t}}return o=>Mt(o,n)};un.add("max");const Vm=function(t){return typeof t>"u"||t===null||t===""||Number.isNaN(t)||t?.length===0?{required:!0}:null};un.add("required");const Km=function(t){function n(o){return o===void 0||o.toString().length<t?{minLength:t}:null}return o=>Mt(o,n)};Ze.add("minLength");const Hm=function(t){function n(o){return o==null||Array.isArray(o)&&o.length<t?{minLengthArray:t}:null}return o=>n(o)};Ze.add("minLengthArray");const Wm=function(t){function n(o){return o===void 0||o.toString().length<=t?null:{maxLength:t}}return o=>Mt(o,n)};wt.add("maxLength");const Gm=function(t){function n(o){return o==null||Array.isArray(o)&&o.length<=t?null:{maxLengthArray:t}}return o=>n(o)};Ze.add("maxLengthArray");const Um=function(t){const n=t instanceof RegExp?t:new RegExp(t);function o(a){return n.test(a)?null:{pattern:t}}return a=>Mt(a,o)};Ze.add("pattern");const zm=function(e){function t(n){return new RegExp("^\\p{L}*$","u").test(n)?null:{alpha:!0}}return Mt(e,t)};wt.add("alpha");const jm=function(e){function t(n){return/^[0-9,. ]*$/.test(n)?null:{numeric:!0}}return Mt(e,t)};wt.add("numeric");const Ym=function(e){function t(n){return/^-?[0-9,. ]*$/.test(n)?null:{positiveOrNegativeNumber:!0}}return Mt(e,t)};wt.add("positiveOrNegativeNumber");const qm=function(e){function t(n){return/^[^0-9]*$/.test(n)?null:{nonNumeric:!0}}return Mt(e,t)};wt.add("nonNumeric");const ho=Object.freeze({...Fm,min:Am,max:$m,required:Vm,minLength:Km,minLengthArray:Hm,maxLength:Wm,maxLengthArray:Gm,pattern:Um,alpha:zm,numeric:jm,nonNumeric:qm,positiveOrNegativeNumber:Ym,OnBlurErrorKeys:Ze});function bo(e,t=[]){const n=t.reduce((o,a)=>Object.assign(o,a(e)||{}),{});return Object.keys(n).length?n:null}var Ct=(e=>(e[e.ON_CHANGE=0]="ON_CHANGE",e[e.ON_BLUR=1]="ON_BLUR",e[e.ON_SUBMIT=2]="ON_SUBMIT",e))(Ct||{});function Jm(e,t={},n=[]){for(const[o,a]of Object.entries(t))a===0?Ei(o):a===2&&Ti(o);return r.useCallback(e,n)}class Yt{constructor(t,n){this.path=t,this.update=n,this.validators=[],this.#e=null,this.#t=null,this.#n=null,this.preventativeErrors=[],this.submitted=!1}#e;#t;#n;get errors(){return this.#e===null&&this.#t===null&&this.#n===null?null:{...this.#e??{},...this.#t??{},...this.#n??{}}}setValidators(t){return this.update(this.path,null,void 0,t),this}validate(t,n,o=!1){if(this.validators&&this.validators.length>0){const a=bo(t,this.validators);let s={onSubmit:{},onChange:{},onBlur:{}};a&&(s=Object.keys(a).reduce((i,l)=>(So.has(l)?i.onSubmit[l]=a[l]:un.has(l)?i.onChange[l]=a[l]:i.onBlur[l]=a[l],i),s)),(typeof n>"u"||n===Ct.ON_CHANGE)&&(this.#t=Object.keys(s.onChange).length===0?null:s.onChange),(typeof n>"u"||n===Ct.ON_BLUR)&&(this.#n=Object.keys(s.onBlur).length===0?null:s.onBlur),(typeof n>"u"||n===Ct.ON_SUBMIT)&&(this.#e=Object.keys(s.onSubmit).length===0?null:s.onSubmit,this.#t=Object.keys(s.onChange).length===0?null:s.onChange,this.#n=Object.keys(s.onBlur).length===0?null:s.onBlur),o||this.update(),this.isFocused()&&this.onFocus&&this.onFocus()}else this.errors&&(this.#e=null,this.#n=null,this.#t=null,o||this.update());return this}isValid(){return!this.errors||this.isPristine()}hasErrors(){return!!this.errors}isVisibilyInvalid(){return!this.isValid()}hasError(t){return this.errors&&Object.prototype.hasOwnProperty.call(this.errors,t)}hasPreventativeError(t){return this.preventativeErrors.includes(t)}hasPreventativeErrors(){return this.preventativeErrors.length>0}isRequired(){return this.validators&&this.validators.indexOf(ho.required)>-1}isSubmitted(){return this.submitted}onFocus(){}onBlur(){}}class Bn extends Yt{constructor(){super(...arguments),this.id=We(),this.focused=!1,this.pristine=!0}setValue(t){if(this.preventativeErrors=[],this.validators&&this.validators.length>0){const n=bo(t,this.validators);if(n&&Object.keys(n).filter(a=>wt.has(a)).length>0){this.preventativeErrors=Object.keys(n);return}}this.update(this.path,t)}isPristine(){return this.pristine}markAsPristine(){return this.pristine=!0,this.update(),this}markAsDirty(){return this.pristine=!1,this.update(),this}isFocused(){return this.focused}markAsFocused(){return this.focused=!0,this.update(),this.onFocus&&this.onFocus(),this}markAsBlurred(){return this.update(this.path,null,!0),this.onBlur&&this.onBlur(),this.preventativeErrors=[],this}markAsSubmitted(){return this.submitted=!0,this.update(this.path,null,!1,void 0,!0),this}}class qt extends Bn{constructor(t,n,o){const a=o?n:t,s=o||n;super(a,s),o&&this.inferMembers(t)}isFocused(){return super.isFocused()||this.rollup("isFocused")}isValid(){return super.isValid()&&this.rollup("isValid")}hasErrors(){return super.hasErrors()||Object.keys(this.fields).some(t=>this.fields[t].hasErrors())}contentsAreValid(){return this.rollup("isValid")&&this.rollup("contentsAreValid")}isPristine(){return super.isPristine()&&this.rollup("isPristine")}markAsPristine(){super.markAsPristine();for(const t of Object.keys(this.fields))this.fields[t].markAsPristine();return this}markAsDirty(){super.markAsDirty();for(const t of Object.keys(this.fields))this.fields[t].markAsDirty();return this}markAsBlurred(){super.markAsBlurred();for(const t of Object.keys(this.fields))this.fields[t].markAsBlurred();return this}markAsSubmitted(){super.markAsSubmitted();for(const t of Object.keys(this.fields))this.fields[t].markAsSubmitted();return this}inferSpsControl(t,n){return vo(t,[...this.path,n],this.update)}rollup(t){return Object.keys(this.fields).reduce((n,o)=>n&&(!this.fields[o][t]||this.fields[o][t]()),!0)}}class Ni extends qt{inferMembers(t){this.fields={};for(const n of Object.keys(t))this.fields[n]=this.inferSpsControl(t[n],n)}}class Ii extends qt{inferMembers(t){this.fields=t.map((n,o)=>this.inferSpsControl(n,String(o)))}}function vo(e,t,n){return e instanceof Yt?(e.path=t,e.update=n,e):Array.isArray(e)?new Ii(e,t,n):yi(e)?new Ni(e,t,n):new Bn(t,n)}function On(e,t){return t.length===0||!e?e:On(e.fields[t[0]],t.slice(1,t.length))}function Lr(e,t){if(t.length===0||!e)return[e];const n=t[0];if(t=t.slice(1,t.length),n==="*"){const o=Array.isArray(e.fields)?e.fields:Object.keys(e.fields).map(a=>e.fields[a]);return t.length===0?o:o.reduce((a,s)=>[...a,...Lr(s,t)],[])}return Lr(e.fields[n],t)}function _r(e,t,n){for(const o of Object.keys(t)){const a=t[o];for(const s of Lr(e,o.split(".")))s&&a&&n(s,a)}}function yo(e,t,n,o=!1,a=!1){_r(t,n,(s,i)=>{s.validators=typeof i=="function"?i(e):i,o&&s.validate(S.getPath(e,s.path),void 0,a)})}function Pr(e,t){const n=t[0];return t=t.slice(1),Array.isArray(e)?e.map((o,a)=>a===Number(n)?Pr(o,t):o):yi(e)?Object.keys(e).reduce((o,a)=>Object.assign(o,{[a]:a===n?Pr(e[a],t):e[a]}),{}):e}function Xm(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("The initial value of useSpsForm() hook must be an object.")}function xi(e,t={}){Xm(e);const[,n]=E.useState({}),o=E.useRef(!1);o.current=!1;const a=E.useRef(t),s=E.useCallback(p=>{const f=m.current;let g;if(p)if(p.path)if(p.markAsBlurred){const y=On(f.formMeta,p.path);if(y){y.focused=!1;const v=S.getPath(f.formValue,p.path);y.validate(v,Ct.ON_BLUR)}}else if(p.newValidators){if(a.current){const y=p.path.join(".");a.current={...a.current,[y]:p.newValidators},yo(f.formValue,f.formMeta,a.current,!0)}}else if(p.markAsSubmitted){const y=On(f.formMeta,p.path);if(y){y.submitted=!0;const v=S.getPath(f.formValue,p.path);y.validate(v,Ct.ON_SUBMIT)}}else g=Pr(f.formValue,p.path),S.setPath(g,p.path,p.value);else g=p.value;if(p?.updateFormOptions?.validators&&(a.current={...a.current,...p.updateFormOptions.validators},yo(f.formValue,f.formMeta,a.current,p.updateFormOptions?.runValidators??!0)),g){f.formMeta.submitted=!1,S.deepFreeze(g);const y=S.diff(f.formValue,g);for(const{type:b,key:h,parentPath:N,objects:[,w]}of y){const T=On(f.formMeta,N);if(typeof h!="symbol"&&T){let L;switch(b){case S.DiffChange.ADDITION:T.fields[h]=vo(w[h],[...N,h],l);break;case S.DiffChange.DELETION:Array.isArray(T.fields)?T.fields[h]=void 0:delete T.fields[h];break;case S.DiffChange.ALTERATION:L=vo(w[h],[...N,h],l),(L instanceof qt&&!(T.fields[h]instanceof qt)||!(L instanceof qt)&&T.fields[h]instanceof qt)&&(L.pristine=!1,T.fields[h]=L);break}}}const v=new Set;if(y.filter(b=>b.type===S.DiffChange.DELETION).reduce((b,h)=>(b.has(h.parentPath)||b.add(h.parentPath),b),v),Array.from(v).forEach(b=>{const h=On(f.formMeta,b);Array.isArray(h.fields)&&(h.fields=h.fields.filter(N=>N!==void 0))}),a.current){yo(g,f.formMeta,a.current);const b=new Set;t&&_r(f.formMeta,t,(h,N)=>{typeof N=="function"&&(h.validate(S.getPath(g,h.path)),b.add(h))});for(const{type:h,key:N,parentPath:w,objects:[,T]}of y)if(typeof N!="symbol"){let L=f.formMeta,A=g;if(L){for(const B of w)L=L.fields[B],A=A[B],b.has(L)||L.validate(A,Ct.ON_CHANGE);if(h===S.DiffChange.ADDITION||h===S.DiffChange.ALTERATION){const B=L.fields[N];if(!b.has(B)&&(L.fields[N].validate(T[N],Ct.ON_CHANGE),h===S.DiffChange.ADDITION&&B.fields))for(const[P,O]of Object.entries(B.fields))O.validate(T[N][P],Ct.ON_CHANGE)}}}}}m.current={...f,formValue:g||f.formValue},o.current||n({})},[]),i=E.useCallback((p,f)=>{p||f?s({value:p,updateFormOptions:f}):s()},[s]),l=E.useCallback((p,f,g=!1,y,v=!1)=>{p?s({path:p,value:f,markAsBlurred:g,newValidators:y,markAsSubmitted:v}):i()},[s,i]),c=E.useMemo(()=>{S.deepFreeze(e);const p=vo(e,[],l);return t&&yo(e,p,t,!1,!0),p},[]),d=E.useCallback(()=>(m.current.formMeta.markAsDirty(),a.current&&_r(m.current.formMeta,a.current,(p,f)=>{(typeof f=="function"||Array.isArray(f))&&p.validate(S.getPath(m.current.formValue,p.path))}),m.current.formMeta.isValid()),[]),u=E.useCallback(()=>m.current.formValue,[]),m=E.useRef({formValue:e,formMeta:c,updateForm:i,validateForm:d,getCurrentFormValue:u});return m.current}const Le=r.forwardRef((e,t)=>{const{className:n,children:o,focusInputOnClick:a,formControl:s,formMeta:i,inputRef:l,onClick:c,...d}=e,u=r.useRef(),p=l||(t||u);function f(){p&&p!==t&&p.current&&p.current.focus()}function g(){p&&p!==t&&p.current&&i&&i instanceof Bn&&i.markAsFocused()}function y(){p&&p!==t&&p.current&&i&&i instanceof Bn&&i.markAsBlurred()}const v=$("sps-form-group",(s&&s.isRequired()||i&&i.isRequired())&&"sps-form-group--required",(s&&!s.isValid()||i&&i.isVisibilyInvalid())&&"sps-form-group--error",i&&i.hasPreventativeErrors()&&"sps-form-group--preventative-error",n);function b(h){a&&f(),c&&c(h)}return r.useEffect(()=>{function h(N){N.target.classList.contains("sps-form-control__clear-btn")&&N.preventDefault()}return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[]),r.createElement("div",{...d,className:v,ref:t,tabIndex:-1,onClick:b,onFocus:g,onBlur:y},o)});Object.assign(Le,{displayName:"SpsFormComponentWrapper"});const ki=e=>typeof e=="object"&&e!=null&&e.nodeType===1,Mi=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",Eo=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return Mi(n.overflowY,t)||Mi(n.overflowX,t)||(o=>{const a=(s=>{if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch{return null}})(o);return!!a&&(a.clientHeight<o.scrollHeight||a.clientWidth<o.scrollWidth)})(e)}return!1},To=(e,t,n,o,a,s,i,l)=>s<e&&i>t||s>e&&i<t?0:s<=e&&l<=n||i>=t&&l>=n?s-e-o:i>t&&l<n||s<e&&l>n?i-t+a:0,Zm=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},Li=(e,t)=>{var n,o,a,s;if(typeof document>"u")return[];const{scrollMode:i,block:l,inline:c,boundary:d,skipOverflowHiddenElements:u}=t,m=typeof d=="function"?d:R=>R!==d;if(!ki(e))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,f=[];let g=e;for(;ki(g)&&m(g);){if(g=Zm(g),g===p){f.push(g);break}g!=null&&g===document.body&&Eo(g)&&!Eo(document.documentElement)||g!=null&&Eo(g,u)&&f.push(g)}const y=(o=(n=window.visualViewport)==null?void 0:n.width)!=null?o:innerWidth,v=(s=(a=window.visualViewport)==null?void 0:a.height)!=null?s:innerHeight,{scrollX:b,scrollY:h}=window,{height:N,width:w,top:T,right:L,bottom:A,left:B}=e.getBoundingClientRect(),{top:P,right:O,bottom:U,left:X}=(R=>{const M=window.getComputedStyle(R);return{top:parseFloat(M.scrollMarginTop)||0,right:parseFloat(M.scrollMarginRight)||0,bottom:parseFloat(M.scrollMarginBottom)||0,left:parseFloat(M.scrollMarginLeft)||0}})(e);let K=l==="start"||l==="nearest"?T-P:l==="end"?A+U:T+N/2-P+U,D=c==="center"?B+w/2-X+O:c==="end"?L+O:B-X;const V=[];for(let R=0;R<f.length;R++){const M=f[R],{height:Z,width:I,top:C,right:k,bottom:G,left:J}=M.getBoundingClientRect();if(i==="if-needed"&&T>=0&&B>=0&&A<=v&&L<=y&&(M===p&&!Eo(M)||T>=C&&A<=G&&B>=J&&L<=k))return V;const te=getComputedStyle(M),ne=parseInt(te.borderLeftWidth,10),H=parseInt(te.borderTopWidth,10),q=parseInt(te.borderRightWidth,10),Y=parseInt(te.borderBottomWidth,10);let W=0,ee=0;const z="offsetWidth"in M?M.offsetWidth-M.clientWidth-ne-q:0,Q="offsetHeight"in M?M.offsetHeight-M.clientHeight-H-Y:0,fe="offsetWidth"in M?M.offsetWidth===0?0:I/M.offsetWidth:0,se="offsetHeight"in M?M.offsetHeight===0?0:Z/M.offsetHeight:0;if(p===M)W=l==="start"?K:l==="end"?K-v:l==="nearest"?To(h,h+v,v,H,Y,h+K,h+K+N,N):K-v/2,ee=c==="start"?D:c==="center"?D-y/2:c==="end"?D-y:To(b,b+y,y,ne,q,b+D,b+D+w,w),W=Math.max(0,W+h),ee=Math.max(0,ee+b);else{W=l==="start"?K-C-H:l==="end"?K-G+Y+Q:l==="nearest"?To(C,G,Z,H,Y+Q,K,K+N,N):K-(C+Z/2)+Q/2,ee=c==="start"?D-J-ne:c==="center"?D-(J+I/2)+z/2:c==="end"?D-k+q+z:To(J,k,I,ne,q+z,D,D+w,w);const{scrollLeft:pe,scrollTop:He}=M;W=se===0?0:Math.max(0,Math.min(He+W/se,M.scrollHeight-Z/se+Q)),ee=fe===0?0:Math.max(0,Math.min(pe+ee/fe,M.scrollWidth-I/fe+z)),K+=He-W,D+=pe-ee}V.push({el:M,top:W,left:ee})}return V},Qm=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function wo(e,t){if(!e.isConnected||!(a=>{let s=a;for(;s&&s.parentNode;){if(s.parentNode===document)return!0;s=s.parentNode instanceof ShadowRoot?s.parentNode.host:s.parentNode}return!1})(e))return;const n=(a=>{const s=window.getComputedStyle(a);return{top:parseFloat(s.scrollMarginTop)||0,right:parseFloat(s.scrollMarginRight)||0,bottom:parseFloat(s.scrollMarginBottom)||0,left:parseFloat(s.scrollMarginLeft)||0}})(e);if((a=>typeof a=="object"&&typeof a.behavior=="function")(t))return t.behavior(Li(e,t));const o=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:a,top:s,left:i}of Li(e,Qm(t))){const l=s-n.top+n.bottom,c=i-n.left+n.right;a.scroll({top:l,left:c,behavior:o})}}const Br=Object.freeze(Object.defineProperty({__proto__:null,default:wo},Symbol.toStringTag,{value:"Module"})),ef={alt:"string",size:"SpinnerSize",title:"string"};function Or(e){const{alt:t,className:n,size:o=F.SpinnerSize.MEDIUM,"data-testid":a,title:s,unsafelyReplaceClassName:i,...l}=e,{t:c}=he.useWoodlandLanguage(),d=t||s||c("spinner.defaultAltText",{defaultValue:"Loading..."}),u=$(i||"sps-spinner",`sps-spinner--${o}`,n);return r.createElement("i",{className:u,"data-testid":a,title:d,...l})}Object.assign(Or,{props:ef,displayName:"SpsSpinner"});const tf=60;function Co(e){return typeof e>"u"?"inherit":`${e}px`}function Rr(e){switch(e){case F.Position.TOP_LEFT:return F.Position.BOTTOM_LEFT;case F.Position.TOP_MIDDLE:return F.Position.BOTTOM_MIDDLE;case F.Position.TOP_RIGHT:return F.Position.BOTTOM_RIGHT;case F.Position.RIGHT_TOP:return F.Position.LEFT_TOP;case F.Position.RIGHT_MIDDLE:return F.Position.LEFT_MIDDLE;case F.Position.RIGHT_BOTTOM:return F.Position.LEFT_BOTTOM;case F.Position.BOTTOM_RIGHT:return F.Position.TOP_RIGHT;case F.Position.BOTTOM_MIDDLE:return F.Position.TOP_MIDDLE;case F.Position.BOTTOM_LEFT:return F.Position.TOP_LEFT;case F.Position.LEFT_BOTTOM:return F.Position.RIGHT_BOTTOM;case F.Position.LEFT_MIDDLE:return F.Position.RIGHT_MIDDLE;case F.Position.LEFT_TOP:return F.Position.RIGHT_TOP}}function nf(e,t,n,o,a,s,i,l){const c=i&&i.current,d=c?c.scrollTop:window.pageYOffset,u=l?0:d,m=c?c.scrollLeft:window.pageXOffset,p=l?0:m,[f,g]=e.split(" ");let y,v,b,h;switch(f){case"top":b=t.height-n.top-u-s[0];break;case"left":v=t.width-n.left-p-s[0];break;case"right":h=n.right+p-s[0];break;case"bottom":y=n.bottom+u-s[0];break;default:throw new Error(`Invalid position ${e}`)}switch(g){case"left":h=n.left+p+s[1];break;case"top":y=n.top+u+s[1];break;case"middle":f==="top"||f==="bottom"?h=n.left+p+n.width/2-a/2+s[1]:(f==="left"||f==="right")&&(y=n.top+u+n.height/2-o.height/2+s[1]);break;case"bottom":b=t.height-n.bottom-u+s[1];break;case"right":v=t.width-n.right-p+s[1];break;default:throw new Error(`Invalid position ${e}`)}return[y,v,b,h]}function Sn(e,t,n,{altPosition:o,setMinWidth:a=!1,setWidth:s=!1,parentElementRef:i,fixed:l=!1,offsets:c=[0,0],altOffsets:d=c}){if(e.current&&t.current){const u=e.current.getBoundingClientRect(),m=t.current.getBoundingClientRect(),p=Math.max(document.documentElement.clientHeight,window.innerHeight||0),f=document.documentElement.getBoundingClientRect().width;let y=(i?.current??document.documentElement).getBoundingClientRect();l&&(y={x:0,y:0,width:f,height:p,top:0,left:0,bottom:p,right:f,toJSON(){return{width:f,height:p,top:0,left:0,bottom:p,right:f}}});const[v,b]=n.split(" ");let h=n;if(o&&(v==="top"&&m.top-u.height<tf||v==="right"&&m.right+u.width>f||v==="bottom"&&m.bottom+u.height>p||v==="left"&&m.left-u.width<0)&&(h=o),b==="left"&&m.left+u.width+(c?.[1]??0)>document.documentElement.getBoundingClientRect().right)switch(v){case"bottom":h=F.Position.BOTTOM_RIGHT;break;case"top":h=F.Position.TOP_RIGHT;break}const N=a?Math.max(m.width,u.width):u.width,w=s?m.width:N,[T,L,A,B]=nf(h,y,m,u,w,h===o?d:c,i,l),P={top:Co(T),right:Co(L),bottom:Co(A),left:Co(B)};return l&&(P.position="fixed",P.zIndex=F.ZStratum.BAR),a&&(P.minWidth=`${m.width}px`),s&&(P.width=`${m.width}px`),[P,h===o]}return[{},!1]}const rt=E.createContext(null);function gn(e,t=[]){const n=E.useContext(rt);return E.useMemo(()=>o=>{const s=n&&n.parentElementRef&&n.parentElementRef.current||document.body;let i=null,l=s.lastElementChild;for(;l&&l!==s.firstElementChild;){if(l.hasAttribute("data-portalid")&&l.getAttribute("data-portalid")===e){i=l;break}l=l.previousElementSibling}if(i)s.contains(i)||s.appendChild(i);else{i=document.createElement("div"),i.setAttribute("data-portalid",e),i.setAttribute("data-react-aria-top-layer","true");for(const c of t)i.classList.add(c);s.appendChild(i)}return Ln.createPortal(o,i)},[n])}const Fr=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","1","2","3","4","5","6","7","8","9","0"];async function _i(e,t,n,o,a,s){const i=typeof e.options=="function"?e.options(t.value):e.options||[],l=i instanceof Promise,c=m=>m.replace(/([.?*+^$[\]\\(){}|-])/g,"");n({pending:l}),s.current=l?i:null;const d=l?await i||[]:i||[];if(l&&s.current!==i)return;let u=Array.from(d).filter(Boolean).map(m=>new F.SpsOptionListOption(m,typeof m=="function"?{textKey:"label",captionKey:"caption"}:{textKey:e.textKey,captionKey:e.captionKey}));if(e.nullOption&&u.unshift(new F.SpsOptionListOption(null,{text:e.nullOption})),t.value&&!e.disableDefaultOptionsFiltering){const m=c(t.value);n({replacementPattern:new RegExp(`(${m})`,"ig")}),u=u.filter(p=>{const f=new RegExp(m,"i"),g=c(p.text);return e.filterByTextAndCaptionKey?f.test(g)||f.test(c(p.caption)):f.test(g)})}else n({replacementPattern:null});if(e.disabledOptions)for(const m of u)e.disabledOptions.includes(m.value)&&(m.disabled=!0);o(Object.freeze(u)),e.onOptionListChanged&&e.onOptionListChanged(u.length),a(u.some(m=>m.value&&!!m.value.icon)),n({pending:!1})}function of(e,t,n){const[o,a]=r.useState(Object.freeze([])),[s,i]=r.useState(!1),l=r.useRef(null),c=r.useRef(e.options);(typeof e.options!="function"||e.disableOptionsMemoization)&&(c.current=e.options);const d=r.useMemo(()=>typeof c.current=="function"?S.debounce(_i,typeof e.searchDebounce<"u"?e.searchDebounce:500):_i,[c.current,e.disabledOptions]);return r.useEffect(()=>{d(e,t,n,a,i,l)},[c.current,t.value,e.disabledOptions]),[o,s]}class Lt{constructor(t,n){this.target=t,this.isPgStoppedInternal=!1,this.currentTarget=t,this.nativeEvent=new CustomEvent("change",n),Object.defineProperty(this.nativeEvent,"target",{value:t,writable:!1,configurable:!1,enumerable:!0})}get bubbles(){return this.nativeEvent.bubbles}get cancelable(){return this.nativeEvent.cancelable}get defaultPrevented(){return this.nativeEvent.defaultPrevented}get eventPhase(){return this.nativeEvent.eventPhase}get isTrusted(){return this.nativeEvent.isTrusted}get timeStamp(){return this.nativeEvent.timeStamp}get type(){return this.nativeEvent.type}preventDefault(){this.nativeEvent.preventDefault()}isDefaultPrevented(){return this.defaultPrevented}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPgStoppedInternal=!0}isPropagationStopped(){return this.isPgStoppedInternal}persist(){throw new Error("This is not a real React ChangeEvent. React does not permit the creation of SyntheticEvents in userland.")}}function rf(e,t){return{...e,...t}}function Dt(e){return E.useReducer(rf,e)}function af({hideInlineSearch:e,showInlineSearch:t,options:n,onSearchChange:o,search:a="",searchPlaceholder:s,searchInputRef:i}){const{t:l}=he.useWoodlandLanguage(),c=s??l("select.searchPlaceholder",{defaultValue:"Search…"}),[d,u]=Dt({isAsync:typeof n=="function",pending:!1,value:a,replacementPattern:null}),m=r.useCallback(v=>{u({value:v.target.value}),o&&o(v)},[o]),p=r.useCallback(v=>{v.nativeEvent.stopImmediatePropagation(),v.stopPropagation()},[]),f=r.useCallback(v=>{v.nativeEvent.stopImmediatePropagation(),u({value:""}),o&&o(new Lt({value:""})),i?.current&&i.current.focus()},[o,i]),g=v=>{v&&(["Tab","Escape","Enter","Up","ArrowUp","Down","ArrowDown"].includes(v.key)||v.stopPropagation())};return r.useEffect(()=>{u({value:a})},[a]),[(d.isAsync||t)&&!e?r.createElement("div",{className:"sps-option-list__search sps-form-group sps-text-input"},r.createElement("div",{className:"sps-form-control"},!d.value&&r.createElement("i",{className:"sps-icon sps-icon-filter sps-text-input__icon"}),r.createElement("input",{type:"text",className:"sps-text-input__input",placeholder:c,ref:i,value:d.value,onChange:m,onClick:p,onKeyDown:g}),d.value&&r.createElement("i",{className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:f}))):r.createElement(r.Fragment,null),d,u]}const sf=wo||Br,lf=["Tab","Escape","Enter","Up","ArrowUp","Down","ArrowDown"];function cf(e,t,n){return n?(e&&e[n])===(t&&t[n]):e===t}function Pi(e,t,n){return typeof n.value=="function"&&n.disabled?!0:t?!!e?.find(o=>o[t]&&o[t]===n?.value?.[t]):!1}const Rn=r.forwardRef((e,t)=>{const{captionKey:n,comparisonKey:o,disabledOptions:a,options:s,tall:i,textKey:l,valueKey:c,zeroState:d,hideInlineSearch:u,showInlineSearch:m,onSearchChange:p,search:f,searchDebounce:g,searchPlaceholder:y,onSpecialActionSelect:v,attachTo:b,className:h,conformWidth:N,id:w,ignoreWidthStyles:T,isOpen:L,keepOpen:A,keyDown:B,nullOption:P,onOptionListChanged:O,onOptionSelected:U,onPositionFlip:X,onSelfToggle:K,optionRole:D,positionOverride:V,selectedOption:R,specialAction:M,unsafelyReplaceClassName:Z,loading:I,filterByTextAndCaptionKey:C,maxHeightPx:k,maxHeightRem:G,disableOptionsMemoization:J,disableDefaultOptionsFiltering:te,"data-testid":ne,typeaheadEvent:H,...q}=e,Y=r.useMemo(()=>M?new F.SpsOptionListOption(M,{textKey:"label",captionKey:"caption"}):null,[M]),[W,ee]=r.useState(-1),[z,Q]=r.useState(L),fe=t||r.useRef(null),se=r.useRef(null),pe=r.useRef(null),He=gn("sps-option-list-portal"),$e=r.useContext(rt),[Xe,nt]=V||[F.Position.BOTTOM_LEFT,F.Position.TOP_LEFT],[[mt,xe],ot]=r.useState([{},!1]),Ve=r.useRef(null),[ft,_e,oe]=af({...e,searchInputRef:Ve}),[ue,je]=of(e,_e,oe);r.useEffect(()=>{H&&Ye(H)},[H]),r.useEffect(()=>{ot(z?Sn(fe,b,Xe,{altPosition:nt,setMinWidth:!T,setWidth:!T&&N,...$e}):[{},!1])},[z,Xe,nt,ue]),r.useEffect(()=>{let ie;return z&&(ie=()=>{z&&ot(Sn(fe,b,Xe,{altPosition:nt,setMinWidth:!T,setWidth:!T&&N,...$e}))},document.addEventListener("scroll",ie)),()=>{ie&&document.removeEventListener("scroll",ie)}},[z]),r.useEffect(()=>{ee(-1)},[_e]);const mo=$(Z||"sps-option-list","z-stratum-dropdown",z&&"sps-option-list--open",_e.isAsync&&"sps-option-list--searchable",xe&&"sps-option-list--opens-upward",M&&M.label&&"sps-option-list--has-special-action",h),Dr=$(Z||"sps-option-list__options",i&&"sps-option-list__options--tall"),xt=r.useCallback(()=>{z||(Q(!0),Ve.current&&Ve.current.focus(),ee(-1),K&&K(!0))},[z,K]),jt=r.useCallback(()=>{z&&(Q(!1),ee(-1),K&&K(!1))},[z,K]),yt=r.useCallback((ie,de)=>{de||ie&&!ie.disabled&&(typeof ie.value=="function"?(ie.value(),v&&v()):typeof U=="function"&&U(ie.value),A||jt())},[U,jt]),fo=r.useCallback((ie,de,ke)=>{ie.stopPropagation(),yt(de,ke)},[yt]),ae=r.useRef(a||[]);ae.current=a||[];const we=r.useCallback(ie=>{switch(ie.key){case"Tab":case"Escape":jt();break;case"Enter":if(W>-1){const de=ue[W]||Y;ie.preventDefault();const ke=!!de&&Pi(ae.current,o||"",de);!ke&&de&&typeof U=="function"&&typeof de.value=="function"?de.value():de&&yt(de,ke)}break;case"Up":case"ArrowUp":{let de=W;xe?W<=-1?de=ue.length-1:W===0?M&&(de=ue.length):W<ue.length&&(de=W-1):W>-1&&(de=W-1),de!==W&&(ie.preventDefault(),ee(de));break}case"Down":case"ArrowDown":{xt();let de=W;xe?W!==-1&&(W>=ue.length?de=0:W===ue.length-1?de=-1:de=W+1):W<ue.length-1+ +!!M&&(de=W+1),de!==W&&(ie.preventDefault(),ee(de));break}default:xt()}},[jt,xt,W,yt,U,xe,ue]),Ke=r.useCallback(ie=>{xt();const de=ue.findIndex(ke=>{if(ke.textKey){const Tt=ke.textKey;return ke.value[Tt].toLowerCase().charAt([0])===ie.key.toLocaleLowerCase()}return ke.value.toString().toLowerCase().charAt([0])===ie.key.toLocaleLowerCase()});de>-1&&ee(de)},[ue]),Ye=r.useCallback(ie=>{ie&&(lf.includes(ie.key)?we(ie):Fr.includes(ie.key)&&!u&&Ke(ie))},[jt,xt,W,yt,U,xe,ue]);r.useEffect(()=>{if($e!==null&&document.getElementsByClassName("sps-modal__body").length>0){const ie=()=>{K&&K(!1)},de=document.getElementsByClassName("sps-modal__body")[0];return de.addEventListener("scroll",ie),()=>{de.removeEventListener("scroll",ie)}}},[]),r.useEffect(()=>{z&&pe.current&&sf(pe.current,{scrollMode:"if-needed",block:"nearest",inline:"nearest"})},[W,z]),r.useEffect(()=>{Q(L),L?Ve.current&&Ve.current.focus():ee(-1)},[L]),r.useEffect(()=>{B&&Ye(B)},[B]),r.useEffect(()=>{!z&&se.current&&(p&&_e.value&&p(new Lt({value:""})),oe({value:""}),se.current.scrollTop=0),z&&X&&X(xe)},[z]);const Ie=k?k/16:G,Et=Ie?{maxHeight:`${Ie}rem`}:{};function kt(ie,de){return de?r.createElement(r.Fragment,null,ie.split(de).map((ke,Tt)=>de.test(ke)?r.createElement("u",{key:Tt},ke):r.createElement(r.Fragment,{key:Tt},ke))):r.createElement(r.Fragment,null,ie)}return He(r.createElement("div",{className:mo,id:w,"aria-activedescendant":W>-1?`${w}-option-${W}`:"",tabIndex:-1,ref:fe,style:mt,onMouseLeave:()=>ee(-1),"data-testid":ne,...q},ft,r.createElement("div",{className:Dr,ref:se,"data-testid":`${ne}-options`,style:Et},!I&&!_e.pending&&d&&ue.length===0&&r.createElement("div",{className:"sps-option-list__zero-state"},d),(I||_e.pending)&&r.createElement("div",{className:"sps-option-list__loading"},r.createElement(Or,null)),!I&&!_e.pending&&ue.map((ie,de)=>{const ke=`${w}-option-${de}`,Tt=cf(ie.value,R,o),Im=Pi(ae.current,o||"",ie);return r.createElement("a",{key:ke,id:ke,role:D,"aria-selected":Tt,href:ie.href,className:$("sps-option-list__option",ie.caption&&"sps-option-list__option--has-caption",ie.disabled&&"sps-option-list__option--disabled",ie.bold&&"sps-option-list__option--bold",(Tt||Im)&&"sps-option-list__option--selected",W===de&&"sps-option-list__option--highlighted"),onClick:jC=>fo(jC,ie,Im),onMouseOver:()=>ee(de),tabIndex:-1,ref:W===de?pe:null,"data-testid":`${ne}-option-${de}`},ie.value&&ie.value.icon&&r.createElement("i",{className:$("sps-icon","sps-option-list__option-icon",`sps-icon-${String(ie.value.icon)}`)}),(!ie.value||!ie.value.icon&&je)&&r.createElement("span",{className:"sps-option-list__option-icon-spacer"}),r.createElement("span",null,kt(ie.text,_e.replacementPattern)),ie.caption&&r.createElement("div",{className:"sps-option-list__option-caption"},r.createElement("span",null,kt(ie.caption,_e.replacementPattern))))})),Y&&M?.label&&r.createElement("a",{className:$("sps-option-list__option","sps-option-list__special-action",W===ue.length&&"sps-option-list__option--highlighted",M.disabled&&"sps-option-list__special-action--disabled"),href:Y.href,target:Y.href&&M.newTab?"_blank":"_self",onClick:ie=>fo(ie,Y),onMouseOver:()=>ee(ue.length),"data-testid":`${ne}-special-action`},M.icon&&r.createElement("i",{className:$("sps-icon","sps-option-list__option-icon",`sps-icon-${String(M.icon)}`)}),!M.icon&&je&&r.createElement("span",{className:"sps-option-list__option-icon-spacer"}),r.createElement("span",null,M.label))))});Object.assign(Rn,{displayName:"SpsOptionList"});function hn(e){return{key:e.key,preventDefault:()=>{}}}function df(e,t,n=[]){return r.useMemo(()=>{function o(a){return r.createElement(e,{...a,...t},a.children)}return o},n)}function qe(e){return typeof e=="function"?e():e}const Bi=function({children:e,elements:t}){if(t.length===0)return r.createElement(r.Fragment,null,e);const[n,o]=Array.isArray(t[0])?t[0]:[t[0]];return r.createElement(n,{...o??{}},r.createElement(Bi,{elements:t.slice(1)},e))},Oi=function({children:e,providers:t=[],...n}){return r.createElement("div",{...n},r.createElement(Bi,{elements:t},e))},pf=function({children:e,className:t,...n}){return r.createElement(Oi,{className:`sps-app ${t}`,...n},e)};function at(e=[],t=[]){const n=Array.isArray(e)?S.flatten(e):[e],o=t.map(s=>Array.isArray(s)?s:[s]),a=new Array(o.length+1).fill(null).map(()=>[]);for(const s of n){let i=!1;for(let l=0;l<o.length;l+=1)for(const{type:c,props:d={}}of o[l])if(s.type===c&&Object.keys(d).every(m=>d[m]===s.props[m])){i=!0,a[l].push(s);break}i||a[a.length-1].push(s)}return a}function Ri(e,t,n){const o=Object.entries(t).filter(([,s])=>typeof s!="string"&&s.deprecated).map(([s])=>s),a=o.map(s=>n[s]);r.useEffect(()=>{a.find(s=>typeof s<"u")&&console.warn(`The following prop(s) of ${e} are deprecated: ${o.join(", ")}`)},a)}function Ar(e,t){const n=E.useRef(!1);E.useEffect(()=>()=>{n.current=!1},[]),E.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function $r(e,t,n){const o=r.useRef(t(...n));r.useEffect(()=>(document.addEventListener(e,o.current,{capture:!0}),()=>document.removeEventListener(e,o.current)),[]),r.useEffect(()=>{document.removeEventListener(e,o.current),o.current=t(...n),document.addEventListener(e,o.current,{capture:!0})},n)}function Fi(e,t,n){return function(a){!e.current?.contains(a.target)&&!t.current?.contains(a.target)&&n()}}function bn(e,t,n){const o=r.useRef(!1),[a,s]=r.useState(!1),i=r.useCallback(()=>{o.current?o.current=!1:s(!0)},[]),l=r.useCallback((c=!1)=>{s(!1),o.current=c,n&&n()},[]);return $r("mousedown",Fi,[e,t,l]),$r("pointerdown",Fi,[e,t,l]),{showPopup:a,doShowPopup:i,doHidePopup:l}}const Ai=e=>{const t=/(auto|scroll)/,n=(l,c)=>l.parentNode===null?c:n(l.parentNode,c.concat([l])),o=(l,c)=>getComputedStyle(l,null).getPropertyValue(c),a=l=>o(l,"overflow")+o(l,"overflow-y"),s=l=>t.test(a(l));return(l=>{if(!(l instanceof HTMLElement||l instanceof SVGElement))return;const c=n(l.parentNode,[]);for(let d=0;d<c.length;d+=1)if(s(c[d]))return c[d];return null})(e)};let Vr=0;function Fn({isOpen:e,rootRef:t}){r.useLayoutEffect(()=>{let n,o,a;if(e&&t.current){Vr+=1,n=Ai(t.current)||document.body,o=n===document.body?window.innerWidth-document.documentElement.clientWidth:n.offsetWidth-n.clientWidth,n.style.overflow="hidden";const s=window.getComputedStyle(n).paddingRight;if(n.style.paddingRight=s&&s!=="0px"?`calc(${s} + ${o}px)`:`${o}px`,n===document.body){if(a=document.getElementsByClassName("sps-navbar-container").item(0),a&&window.getComputedStyle(a).position==="fixed"){const i=window.getComputedStyle(a).paddingRight;a.style.paddingRight=i&&i!=="0px"?`calc(${i} + ${o}px)`:`${o}px`}else if(a=document.getElementsByTagName("nav").item(0)?.parentElement,a&&window.getComputedStyle(a).position==="fixed"){const l=window.getComputedStyle(a).paddingRight;a.style.paddingRight=l&&l!=="0px"?`calc(${l} + ${o}px)`:`${o}px`}}}return()=>{n&&(Vr-=1,Vr===0&&(n.style.overflow=null,n.style.paddingRight=null,a&&(a.style.paddingRight=null)))}},[e])}const uf={debounce:"number",disabled:"boolean",conformWidth:"boolean",formMeta:"SpsFormFieldMeta<string>",icon:"SpsIcon",onChange:"React.ChangeEventHandler",onSelectionChange:"(newValue: string) => void",placeholder:"string",suggestions:{type:`
1
+ (function(x,E){typeof exports=="object"&&typeof module<"u"?E(exports,require("react"),require("@spscommerce/utils"),require("moment-timezone"),require("@spscommerce/ds-shared"),require("@spscommerce/i18n"),require("react-dom"),require("@spscommerce/ds-colors"),require("@sps-woodland/illustrations")):typeof define=="function"&&define.amd?define(["exports","react","@spscommerce/utils","moment-timezone","@spscommerce/ds-shared","@spscommerce/i18n","react-dom","@spscommerce/ds-colors","@sps-woodland/illustrations"],E):(x=typeof globalThis<"u"?globalThis:x||self,E(x.DSReact={},x.React,x.utils,x.moment$3,x.dsShared,x.i18n,x.ReactDOM,x.dsColors,x.illustrations))})(this,(function(x,E,S,Me,F,he,Ln,Nr,gi){"use strict";function hi(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 r=hi(E),pn=hi(Me);function bi(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=bi(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function $(){for(var e,t,n=0,o="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=bi(e))&&(o&&(o+=" "),o+=t);return o}const xm="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let We=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=xm[n[e]&63];return t};function Rt(e){return E.useRef(e||We())}function Ge(e,t){const n=Rt(e),o=E.useRef(`${n.current}_ctrl`);return E.useEffect(()=>{t&&(t.id=o.current,t.update())},[t]),{wrapperId:n.current||void 0,controlId:o.current}}function Ir(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xr,vi;function km(){if(vi)return xr;vi=1;var e="[object Object]";function t(p){var f=!1;if(p!=null&&typeof p.toString!="function")try{f=!!(p+"")}catch{}return f}function n(p,f){return function(g){return p(f(g))}}var o=Function.prototype,a=Object.prototype,s=o.toString,i=a.hasOwnProperty,l=s.call(Object),c=a.toString,d=n(Object.getPrototypeOf,Object);function u(p){return!!p&&typeof p=="object"}function m(p){if(!u(p)||c.call(p)!=e||t(p))return!1;var f=d(p);if(f===null)return!0;var g=i.call(f,"constructor")&&f.constructor;return typeof g=="function"&&g instanceof g&&s.call(g)==l}return xr=m,xr}var Mm=km();const yi=Ir(Mm),Ze=new Set,un=new Set,wt=new Set,So=new Set;function Ei(e){Ze.has(e)||wt.has(e)||So.has(e)||un.add(e)}function Ti(e){Ze.has(e)||wt.has(e)||un.has(e)||So.add(e)}const Fe=pn.default||pn,mn="MM/DD/YYYY",Lm="MM/DD/YYYY hh:mm A",_m="MM/DD/YYYY HH:mm",Pm="hh:mm A",Bm="HH:mm",Om=/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/,_n=Symbol("Date Parse Error");function fn(e){return Fe.isMoment(e)?e.year()*1e4+(e.month()+1)*100+e.date():e.year*1e4+e.month*100+e.date}const j=Object.freeze({createFrom(e,t){if(!e)return null;if(typeof e=="string"){if(t){const n=Fe(e,t,!0);if(n.isValid())return Object.freeze({year:n.year(),month:n.month()+1,date:n.date()})}else{const n=Om.exec(e);if(n){const[,o,a,s]=n;return Object.freeze({year:Number(s),month:Number(o),date:Number(a)})}}return Object.freeze({[_n]:!0,year:void 0,month:void 0,date:void 0})}return Object.freeze({year:e.year(),month:e.month()+1,date:e.date()})},createMomentFrom(e,t){if(!e)return null;let n=null;return typeof e=="string"?t?n=Fe(e,t,!0):n=Fe(e):Fe.isMoment(e)?n=e:n=j.toMoment(e),n!==null&&Fe.isMoment(n)&&n.isValid()?n:Object.freeze({[_n]:!0,year:void 0,month:void 0,date:void 0})},getRangeSeparator(e){return e?.includes("-")?"/":"-"},createRangeFrom(e,t){if(!e)return null;if(t){const n=j.getRangeSeparator(t),o=new RegExp(`[^\\d]*${n}[^\\d]*`);return e.split(o).slice(0,2).map(a=>j.createFrom(a,t))}else return e.split(/[^\d]*-[^\d]*/).slice(0,2).map(n=>j.createFrom(n))},isValid(e){return e?Fe.isMoment(e)?e.isValid():typeof e=="object"&&typeof e.year=="number"&&typeof e.month=="number"&&typeof e.date=="number"&&j.toMoment(e)?.isValid():!1},nullifyInvalidDate(e){return j.isValid(e)?e:null},toMoment(e){return e?Fe.isMoment(e)?e:Fe({...e,month:e.month-1}):null},toString(e,t){const n=j.toMoment(e);return n&&n.isValid()?n.format(t||mn):""},toStringRange(e,t){if(!e)return"";const n=j.getRangeSeparator(t);return e.slice(0,2).map(o=>j.toString(o,t)).join(n)},toDateTimeString(e,t=!1,n){return e&&Fe.isMoment(e)&&e.isValid()?n?t?e.format(`${n} ${Bm}`):e.format(`${n} ${Pm}`):t?e.format(_m):e.format(Lm):""},toDateTimeStringRange(e,t=!1,n){if(!e)return"";const o=j.getRangeSeparator(n);return e.map(a=>j.toDateTimeString(a,t,n)).join(o)},create(){const e=new Date;return Object.freeze({year:e.getFullYear(),month:e.getMonth()+1,date:e.getDate()})},isSameDate(e,t){return e&&t&&e.year===t.year&&e.month===t.month&&e.date===t.date},isSameMonth(e,t){return e&&t&&e.year===t.year&&e.month===t.month},isAfter(e,t){return!e||!t?null:fn(e)>fn(t)},isBefore(e,t){return!e||!t?null:fn(e)<fn(t)},isInRange(e,t,n=!0){if(!e||!t||!t[0]||!t[1])return null;const o=fn(e),[a,s]=t.map(fn);return a&&s&&(n&&o>=a&&o<=s||!n&&o>a&&o<s)},prevMonth(e){return Object.freeze({year:e.month===1?e.year-1:e.year,month:e.month-1||12,date:e.date})},nextMonth(e){return Object.freeze({year:e.month===12?e.year+1:e.year,month:e.month+1>12?1:e.month+1,date:e.date})},createRangeFromPreset(e,t){if(typeof e.definition=="function")return e.definition();const n=Fe(),o=n.clone().subtract(Fe.duration(e.definition));return[j.createFrom(o,t),j.createFrom(n,t)]},createDateTimeRangeFromPreset(e){if(typeof e.definition=="function")return e.definition();const t=Fe().subtract(Fe.duration(e.definition)).startOf("day"),n=Fe().endOf("day");return[t,n]},splitMomentInDateTimeParts(e,t=!1,n,o=!1){let a="";t?a=o?"23:59":"00:00":a=o?"11:59":"12:00";const s=o?"PM":"AM";return e&&Fe.isMoment(e)&&e.isValid()?j.toDateTimeString(e,t,n).split(" "):["",a,t?void 0:s]},getCurrentMoment(){return Fe()},validateTimeString(e,t=!1){if(!e)return!0;const n=e.split(":"),o=n[0]||"0",a=n[1]||"0",s=Number.isNaN(Number(o))?NaN:parseInt(o,10),i=Number.isNaN(Number(a))?NaN:parseInt(a,10),l=n.length<=2&&o.length<=2&&a.length<=2;return t?l&&s>=0&&s<=23&&i>=0&&i<=59:l&&(!Number.isNaN(s)&&o.length===1||s>=1)&&s<=12&&i>=0&&i<=59},padIncompleteTimeString(e,t=!1){if(!e)return"";const n=e.split(":"),o=parseInt(n[0]||"0",10),a=parseInt(n[1]||"0",10);if(t){const s=o<10?`0${o}`:`${o}`,i=a<10?`0${a}`:`${a}`;return`${s}:${i}`}else{const s=o===0?"12":o<10?`0${o}`:`${o}`,i=a<10?`0${a}`:`${a}`;return`${s}:${i}`}}}),kr=["01:00","02:00","03:00","04:00","05:00","06:00","07:00","08:00","09:00","10:00","11:00","12:00"],Mr=["00:00","01:00","02:00","03:00","04:00","05:00","06:00","07:00","08:00","09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00","21:00","22:00","23:00"];let go=mn;function wi(e){go=e}const Pn=function(t){if(Array.isArray(t)){const n=Pn(t[0]),o=Pn(t[1]);return n||o}if(t&&t.hasOwnProperty("year")){if(t[_n])return{dateFormat:go};if(!j.isValid(t))return{dateValidity:!0}}return null};Ze.add("dateFormat"),Ze.add("dateValidity");const Ci=function(t){if(Array.isArray(t)){const n=Pn(t);if(n)return n;if(t&&j.isBefore(t[1],t[0]))return{dateRangeOrder:!0}}return null};Ze.add("dateRangeOrder");const Di=function({minDate:t,maxDate:n}){function o(a){const s=j.isBefore(a,t),i=j.isAfter(a,n),l={minExceeded:s?j.toString(t,go):null,maxExceeded:i?j.toString(n,go):null};return s||i?{dateConstraint:l}:null}return function(s){if(!s)return null;if(Array.isArray(s)){const i=o(s[0]),l=o(s[1]);return i||l}return s.hasOwnProperty("year")?o(s):null}};Ze.add("dateConstraint");const Rm=Object.freeze(Object.defineProperty({__proto__:null,date:Pn,dateConstraint:Di,dateRange:Ci,setDateFormat:wi},Symbol.toStringTag,{value:"Module"}));function Mt(e,t){for(const n of[].concat(e)){const o=t(n);if(o)return o}return null}const Fm=function(t){function n(o){return Number(o)>=t?null:{min:t}}return o=>Mt(o,n)};Ze.add("min");const Am=function(t){function n(o){return Number(o)<=t?null:{max:t}}return o=>Mt(o,n)};un.add("max");const $m=function(t){return typeof t>"u"||t===null||t===""||Number.isNaN(t)||t?.length===0?{required:!0}:null};un.add("required");const Vm=function(t){function n(o){return o===void 0||o.toString().length<t?{minLength:t}:null}return o=>Mt(o,n)};Ze.add("minLength");const Km=function(t){function n(o){return o==null||Array.isArray(o)&&o.length<t?{minLengthArray:t}:null}return o=>n(o)};Ze.add("minLengthArray");const Hm=function(t){function n(o){return o===void 0||o.toString().length<=t?null:{maxLength:t}}return o=>Mt(o,n)};wt.add("maxLength");const Wm=function(t){function n(o){return o==null||Array.isArray(o)&&o.length<=t?null:{maxLengthArray:t}}return o=>n(o)};Ze.add("maxLengthArray");const Gm=function(t){const n=t instanceof RegExp?t:new RegExp(t);function o(a){return n.test(a)?null:{pattern:t}}return a=>Mt(a,o)};Ze.add("pattern");const Um=function(e){function t(n){return new RegExp("^\\p{L}*$","u").test(n)?null:{alpha:!0}}return Mt(e,t)};wt.add("alpha");const zm=function(e){function t(n){return/^[0-9,. ]*$/.test(n)?null:{numeric:!0}}return Mt(e,t)};wt.add("numeric");const jm=function(e){function t(n){return/^-?[0-9,. ]*$/.test(n)?null:{positiveOrNegativeNumber:!0}}return Mt(e,t)};wt.add("positiveOrNegativeNumber");const Ym=function(e){function t(n){return/^[^0-9]*$/.test(n)?null:{nonNumeric:!0}}return Mt(e,t)};wt.add("nonNumeric");const ho=Object.freeze({...Rm,min:Fm,max:Am,required:$m,minLength:Vm,minLengthArray:Km,maxLength:Hm,maxLengthArray:Wm,pattern:Gm,alpha:Um,numeric:zm,nonNumeric:Ym,positiveOrNegativeNumber:jm,OnBlurErrorKeys:Ze});function bo(e,t=[]){const n=t.reduce((o,a)=>Object.assign(o,a(e)||{}),{});return Object.keys(n).length?n:null}var Ct=(e=>(e[e.ON_CHANGE=0]="ON_CHANGE",e[e.ON_BLUR=1]="ON_BLUR",e[e.ON_SUBMIT=2]="ON_SUBMIT",e))(Ct||{});function qm(e,t={},n=[]){for(const[o,a]of Object.entries(t))a===0?Ei(o):a===2&&Ti(o);return r.useCallback(e,n)}class Yt{constructor(t,n){this.path=t,this.update=n,this.validators=[],this.#e=null,this.#t=null,this.#n=null,this.preventativeErrors=[],this.submitted=!1}#e;#t;#n;get errors(){return this.#e===null&&this.#t===null&&this.#n===null?null:{...this.#e??{},...this.#t??{},...this.#n??{}}}setValidators(t){return this.update(this.path,null,void 0,t),this}validate(t,n,o=!1){if(this.validators&&this.validators.length>0){const a=bo(t,this.validators);let s={onSubmit:{},onChange:{},onBlur:{}};a&&(s=Object.keys(a).reduce((i,l)=>(So.has(l)?i.onSubmit[l]=a[l]:un.has(l)?i.onChange[l]=a[l]:i.onBlur[l]=a[l],i),s)),(typeof n>"u"||n===Ct.ON_CHANGE)&&(this.#t=Object.keys(s.onChange).length===0?null:s.onChange),(typeof n>"u"||n===Ct.ON_BLUR)&&(this.#n=Object.keys(s.onBlur).length===0?null:s.onBlur),(typeof n>"u"||n===Ct.ON_SUBMIT)&&(this.#e=Object.keys(s.onSubmit).length===0?null:s.onSubmit,this.#t=Object.keys(s.onChange).length===0?null:s.onChange,this.#n=Object.keys(s.onBlur).length===0?null:s.onBlur),o||this.update(),this.isFocused()&&this.onFocus&&this.onFocus()}else this.errors&&(this.#e=null,this.#n=null,this.#t=null,o||this.update());return this}isValid(){return!this.errors||this.isPristine()}hasErrors(){return!!this.errors}isVisibilyInvalid(){return!this.isValid()}hasError(t){return this.errors&&Object.prototype.hasOwnProperty.call(this.errors,t)}hasPreventativeError(t){return this.preventativeErrors.includes(t)}hasPreventativeErrors(){return this.preventativeErrors.length>0}isRequired(){return this.validators&&this.validators.indexOf(ho.required)>-1}isSubmitted(){return this.submitted}onFocus(){}onBlur(){}}class Bn extends Yt{constructor(){super(...arguments),this.id=We(),this.focused=!1,this.pristine=!0}setValue(t){if(this.preventativeErrors=[],this.validators&&this.validators.length>0){const n=bo(t,this.validators);if(n&&Object.keys(n).filter(a=>wt.has(a)).length>0){this.preventativeErrors=Object.keys(n);return}}this.update(this.path,t)}isPristine(){return this.pristine}markAsPristine(){return this.pristine=!0,this.update(),this}markAsDirty(){return this.pristine=!1,this.update(),this}isFocused(){return this.focused}markAsFocused(){return this.focused=!0,this.update(),this.onFocus&&this.onFocus(),this}markAsBlurred(){return this.update(this.path,null,!0),this.onBlur&&this.onBlur(),this.preventativeErrors=[],this}markAsSubmitted(){return this.submitted=!0,this.update(this.path,null,!1,void 0,!0),this}}class qt extends Bn{constructor(t,n,o){const a=o?n:t,s=o||n;super(a,s),o&&this.inferMembers(t)}isFocused(){return super.isFocused()||this.rollup("isFocused")}isValid(){return super.isValid()&&this.rollup("isValid")}hasErrors(){return super.hasErrors()||Object.keys(this.fields).some(t=>this.fields[t].hasErrors())}contentsAreValid(){return this.rollup("isValid")&&this.rollup("contentsAreValid")}isPristine(){return super.isPristine()&&this.rollup("isPristine")}markAsPristine(){super.markAsPristine();for(const t of Object.keys(this.fields))this.fields[t].markAsPristine();return this}markAsDirty(){super.markAsDirty();for(const t of Object.keys(this.fields))this.fields[t].markAsDirty();return this}markAsBlurred(){super.markAsBlurred();for(const t of Object.keys(this.fields))this.fields[t].markAsBlurred();return this}markAsSubmitted(){super.markAsSubmitted();for(const t of Object.keys(this.fields))this.fields[t].markAsSubmitted();return this}inferSpsControl(t,n){return vo(t,[...this.path,n],this.update)}rollup(t){return Object.keys(this.fields).reduce((n,o)=>n&&(!this.fields[o][t]||this.fields[o][t]()),!0)}}class Ni extends qt{inferMembers(t){this.fields={};for(const n of Object.keys(t))this.fields[n]=this.inferSpsControl(t[n],n)}}class Ii extends qt{inferMembers(t){this.fields=t.map((n,o)=>this.inferSpsControl(n,String(o)))}}function vo(e,t,n){return e instanceof Yt?(e.path=t,e.update=n,e):Array.isArray(e)?new Ii(e,t,n):yi(e)?new Ni(e,t,n):new Bn(t,n)}function On(e,t){return t.length===0||!e?e:On(e.fields[t[0]],t.slice(1,t.length))}function Lr(e,t){if(t.length===0||!e)return[e];const n=t[0];if(t=t.slice(1,t.length),n==="*"){const o=Array.isArray(e.fields)?e.fields:Object.keys(e.fields).map(a=>e.fields[a]);return t.length===0?o:o.reduce((a,s)=>[...a,...Lr(s,t)],[])}return Lr(e.fields[n],t)}function _r(e,t,n){for(const o of Object.keys(t)){const a=t[o];for(const s of Lr(e,o.split(".")))s&&a&&n(s,a)}}function yo(e,t,n,o=!1,a=!1){_r(t,n,(s,i)=>{s.validators=typeof i=="function"?i(e):i,o&&s.validate(S.getPath(e,s.path),void 0,a)})}function Pr(e,t){const n=t[0];return t=t.slice(1),Array.isArray(e)?e.map((o,a)=>a===Number(n)?Pr(o,t):o):yi(e)?Object.keys(e).reduce((o,a)=>Object.assign(o,{[a]:a===n?Pr(e[a],t):e[a]}),{}):e}function Jm(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("The initial value of useSpsForm() hook must be an object.")}function xi(e,t={}){Jm(e);const[,n]=E.useState({}),o=E.useRef(!1);o.current=!1;const a=E.useRef(t),s=E.useCallback(p=>{const f=m.current;let g;if(p)if(p.path)if(p.markAsBlurred){const y=On(f.formMeta,p.path);if(y){y.focused=!1;const v=S.getPath(f.formValue,p.path);y.validate(v,Ct.ON_BLUR)}}else if(p.newValidators){if(a.current){const y=p.path.join(".");a.current={...a.current,[y]:p.newValidators},yo(f.formValue,f.formMeta,a.current,!0)}}else if(p.markAsSubmitted){const y=On(f.formMeta,p.path);if(y){y.submitted=!0;const v=S.getPath(f.formValue,p.path);y.validate(v,Ct.ON_SUBMIT)}}else g=Pr(f.formValue,p.path),S.setPath(g,p.path,p.value);else g=p.value;if(p?.updateFormOptions?.validators&&(a.current={...a.current,...p.updateFormOptions.validators},yo(f.formValue,f.formMeta,a.current,p.updateFormOptions?.runValidators??!0)),g){f.formMeta.submitted=!1,S.deepFreeze(g);const y=S.diff(f.formValue,g);for(const{type:b,key:h,parentPath:N,objects:[,w]}of y){const T=On(f.formMeta,N);if(typeof h!="symbol"&&T){let L;switch(b){case S.DiffChange.ADDITION:T.fields[h]=vo(w[h],[...N,h],l);break;case S.DiffChange.DELETION:Array.isArray(T.fields)?T.fields[h]=void 0:delete T.fields[h];break;case S.DiffChange.ALTERATION:L=vo(w[h],[...N,h],l),(L instanceof qt&&!(T.fields[h]instanceof qt)||!(L instanceof qt)&&T.fields[h]instanceof qt)&&(L.pristine=!1,T.fields[h]=L);break}}}const v=new Set;if(y.filter(b=>b.type===S.DiffChange.DELETION).reduce((b,h)=>(b.has(h.parentPath)||b.add(h.parentPath),b),v),Array.from(v).forEach(b=>{const h=On(f.formMeta,b);Array.isArray(h.fields)&&(h.fields=h.fields.filter(N=>N!==void 0))}),a.current){yo(g,f.formMeta,a.current);const b=new Set;t&&_r(f.formMeta,t,(h,N)=>{typeof N=="function"&&(h.validate(S.getPath(g,h.path)),b.add(h))});for(const{type:h,key:N,parentPath:w,objects:[,T]}of y)if(typeof N!="symbol"){let L=f.formMeta,A=g;if(L){for(const B of w)L=L.fields[B],A=A[B],b.has(L)||L.validate(A,Ct.ON_CHANGE);if(h===S.DiffChange.ADDITION||h===S.DiffChange.ALTERATION){const B=L.fields[N];if(!b.has(B)&&(L.fields[N].validate(T[N],Ct.ON_CHANGE),h===S.DiffChange.ADDITION&&B.fields))for(const[P,O]of Object.entries(B.fields))O.validate(T[N][P],Ct.ON_CHANGE)}}}}}m.current={...f,formValue:g||f.formValue},o.current||n({})},[]),i=E.useCallback((p,f)=>{p||f?s({value:p,updateFormOptions:f}):s()},[s]),l=E.useCallback((p,f,g=!1,y,v=!1)=>{p?s({path:p,value:f,markAsBlurred:g,newValidators:y,markAsSubmitted:v}):i()},[s,i]),c=E.useMemo(()=>{S.deepFreeze(e);const p=vo(e,[],l);return t&&yo(e,p,t,!1,!0),p},[]),d=E.useCallback(()=>(m.current.formMeta.markAsDirty(),a.current&&_r(m.current.formMeta,a.current,(p,f)=>{(typeof f=="function"||Array.isArray(f))&&p.validate(S.getPath(m.current.formValue,p.path))}),m.current.formMeta.isValid()),[]),u=E.useCallback(()=>m.current.formValue,[]),m=E.useRef({formValue:e,formMeta:c,updateForm:i,validateForm:d,getCurrentFormValue:u});return m.current}const Le=r.forwardRef((e,t)=>{const{className:n,children:o,focusInputOnClick:a,formControl:s,formMeta:i,inputRef:l,onClick:c,...d}=e,u=r.useRef(),p=l||(t||u);function f(){p&&p!==t&&p.current&&p.current.focus()}function g(){p&&p!==t&&p.current&&i&&i instanceof Bn&&i.markAsFocused()}function y(){p&&p!==t&&p.current&&i&&i instanceof Bn&&i.markAsBlurred()}const v=$("sps-form-group",(s&&s.isRequired()||i&&i.isRequired())&&"sps-form-group--required",(s&&!s.isValid()||i&&i.isVisibilyInvalid())&&"sps-form-group--error",i&&i.hasPreventativeErrors()&&"sps-form-group--preventative-error",n);function b(h){a&&f(),c&&c(h)}return r.useEffect(()=>{function h(N){N.target.classList.contains("sps-form-control__clear-btn")&&N.preventDefault()}return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[]),r.createElement("div",{...d,className:v,ref:t,tabIndex:-1,onClick:b,onFocus:g,onBlur:y},o)});Object.assign(Le,{displayName:"SpsFormComponentWrapper"});const ki=e=>typeof e=="object"&&e!=null&&e.nodeType===1,Mi=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",Eo=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return Mi(n.overflowY,t)||Mi(n.overflowX,t)||(o=>{const a=(s=>{if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch{return null}})(o);return!!a&&(a.clientHeight<o.scrollHeight||a.clientWidth<o.scrollWidth)})(e)}return!1},To=(e,t,n,o,a,s,i,l)=>s<e&&i>t||s>e&&i<t?0:s<=e&&l<=n||i>=t&&l>=n?s-e-o:i>t&&l<n||s<e&&l>n?i-t+a:0,Xm=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},Li=(e,t)=>{var n,o,a,s;if(typeof document>"u")return[];const{scrollMode:i,block:l,inline:c,boundary:d,skipOverflowHiddenElements:u}=t,m=typeof d=="function"?d:R=>R!==d;if(!ki(e))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,f=[];let g=e;for(;ki(g)&&m(g);){if(g=Xm(g),g===p){f.push(g);break}g!=null&&g===document.body&&Eo(g)&&!Eo(document.documentElement)||g!=null&&Eo(g,u)&&f.push(g)}const y=(o=(n=window.visualViewport)==null?void 0:n.width)!=null?o:innerWidth,v=(s=(a=window.visualViewport)==null?void 0:a.height)!=null?s:innerHeight,{scrollX:b,scrollY:h}=window,{height:N,width:w,top:T,right:L,bottom:A,left:B}=e.getBoundingClientRect(),{top:P,right:O,bottom:U,left:X}=(R=>{const M=window.getComputedStyle(R);return{top:parseFloat(M.scrollMarginTop)||0,right:parseFloat(M.scrollMarginRight)||0,bottom:parseFloat(M.scrollMarginBottom)||0,left:parseFloat(M.scrollMarginLeft)||0}})(e);let K=l==="start"||l==="nearest"?T-P:l==="end"?A+U:T+N/2-P+U,D=c==="center"?B+w/2-X+O:c==="end"?L+O:B-X;const V=[];for(let R=0;R<f.length;R++){const M=f[R],{height:Z,width:I,top:C,right:k,bottom:G,left:J}=M.getBoundingClientRect();if(i==="if-needed"&&T>=0&&B>=0&&A<=v&&L<=y&&(M===p&&!Eo(M)||T>=C&&A<=G&&B>=J&&L<=k))return V;const te=getComputedStyle(M),ne=parseInt(te.borderLeftWidth,10),H=parseInt(te.borderTopWidth,10),q=parseInt(te.borderRightWidth,10),Y=parseInt(te.borderBottomWidth,10);let W=0,ee=0;const z="offsetWidth"in M?M.offsetWidth-M.clientWidth-ne-q:0,Q="offsetHeight"in M?M.offsetHeight-M.clientHeight-H-Y:0,fe="offsetWidth"in M?M.offsetWidth===0?0:I/M.offsetWidth:0,se="offsetHeight"in M?M.offsetHeight===0?0:Z/M.offsetHeight:0;if(p===M)W=l==="start"?K:l==="end"?K-v:l==="nearest"?To(h,h+v,v,H,Y,h+K,h+K+N,N):K-v/2,ee=c==="start"?D:c==="center"?D-y/2:c==="end"?D-y:To(b,b+y,y,ne,q,b+D,b+D+w,w),W=Math.max(0,W+h),ee=Math.max(0,ee+b);else{W=l==="start"?K-C-H:l==="end"?K-G+Y+Q:l==="nearest"?To(C,G,Z,H,Y+Q,K,K+N,N):K-(C+Z/2)+Q/2,ee=c==="start"?D-J-ne:c==="center"?D-(J+I/2)+z/2:c==="end"?D-k+q+z:To(J,k,I,ne,q+z,D,D+w,w);const{scrollLeft:pe,scrollTop:He}=M;W=se===0?0:Math.max(0,Math.min(He+W/se,M.scrollHeight-Z/se+Q)),ee=fe===0?0:Math.max(0,Math.min(pe+ee/fe,M.scrollWidth-I/fe+z)),K+=He-W,D+=pe-ee}V.push({el:M,top:W,left:ee})}return V},Zm=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function wo(e,t){if(!e.isConnected||!(a=>{let s=a;for(;s&&s.parentNode;){if(s.parentNode===document)return!0;s=s.parentNode instanceof ShadowRoot?s.parentNode.host:s.parentNode}return!1})(e))return;const n=(a=>{const s=window.getComputedStyle(a);return{top:parseFloat(s.scrollMarginTop)||0,right:parseFloat(s.scrollMarginRight)||0,bottom:parseFloat(s.scrollMarginBottom)||0,left:parseFloat(s.scrollMarginLeft)||0}})(e);if((a=>typeof a=="object"&&typeof a.behavior=="function")(t))return t.behavior(Li(e,t));const o=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:a,top:s,left:i}of Li(e,Zm(t))){const l=s-n.top+n.bottom,c=i-n.left+n.right;a.scroll({top:l,left:c,behavior:o})}}const Br=Object.freeze(Object.defineProperty({__proto__:null,default:wo},Symbol.toStringTag,{value:"Module"})),Qm={alt:"string",size:"SpinnerSize",title:"string"};function Or(e){const{alt:t,className:n,size:o=F.SpinnerSize.MEDIUM,"data-testid":a,title:s,unsafelyReplaceClassName:i,...l}=e,{t:c}=he.useWoodlandLanguage(),d=t||s||c("spinner.defaultAltText",{defaultValue:"Loading..."}),u=$(i||"sps-spinner",`sps-spinner--${o}`,n);return r.createElement("i",{className:u,"data-testid":a,title:d,...l})}Object.assign(Or,{props:Qm,displayName:"SpsSpinner"});const ef=60;function Co(e){return typeof e>"u"?"inherit":`${e}px`}function Rr(e){switch(e){case F.Position.TOP_LEFT:return F.Position.BOTTOM_LEFT;case F.Position.TOP_MIDDLE:return F.Position.BOTTOM_MIDDLE;case F.Position.TOP_RIGHT:return F.Position.BOTTOM_RIGHT;case F.Position.RIGHT_TOP:return F.Position.LEFT_TOP;case F.Position.RIGHT_MIDDLE:return F.Position.LEFT_MIDDLE;case F.Position.RIGHT_BOTTOM:return F.Position.LEFT_BOTTOM;case F.Position.BOTTOM_RIGHT:return F.Position.TOP_RIGHT;case F.Position.BOTTOM_MIDDLE:return F.Position.TOP_MIDDLE;case F.Position.BOTTOM_LEFT:return F.Position.TOP_LEFT;case F.Position.LEFT_BOTTOM:return F.Position.RIGHT_BOTTOM;case F.Position.LEFT_MIDDLE:return F.Position.RIGHT_MIDDLE;case F.Position.LEFT_TOP:return F.Position.RIGHT_TOP}}function tf(e,t,n,o,a,s,i,l){const c=i&&i.current,d=c?c.scrollTop:window.pageYOffset,u=l?0:d,m=c?c.scrollLeft:window.pageXOffset,p=l?0:m,[f,g]=e.split(" ");let y,v,b,h;switch(f){case"top":b=t.height-n.top-u-s[0];break;case"left":v=t.width-n.left-p-s[0];break;case"right":h=n.right+p-s[0];break;case"bottom":y=n.bottom+u-s[0];break;default:throw new Error(`Invalid position ${e}`)}switch(g){case"left":h=n.left+p+s[1];break;case"top":y=n.top+u+s[1];break;case"middle":f==="top"||f==="bottom"?h=n.left+p+n.width/2-a/2+s[1]:(f==="left"||f==="right")&&(y=n.top+u+n.height/2-o.height/2+s[1]);break;case"bottom":b=t.height-n.bottom-u+s[1];break;case"right":v=t.width-n.right-p+s[1];break;default:throw new Error(`Invalid position ${e}`)}return[y,v,b,h]}function Sn(e,t,n,{altPosition:o,setMinWidth:a=!1,setWidth:s=!1,parentElementRef:i,fixed:l=!1,offsets:c=[0,0],altOffsets:d=c}){if(e.current&&t.current){const u=e.current.getBoundingClientRect(),m=t.current.getBoundingClientRect(),p=Math.max(document.documentElement.clientHeight,window.innerHeight||0),f=document.documentElement.getBoundingClientRect().width;let y=(i?.current??document.documentElement).getBoundingClientRect();l&&(y={x:0,y:0,width:f,height:p,top:0,left:0,bottom:p,right:f,toJSON(){return{width:f,height:p,top:0,left:0,bottom:p,right:f}}});const[v,b]=n.split(" ");let h=n;if(o&&(v==="top"&&m.top-u.height<ef||v==="right"&&m.right+u.width>f||v==="bottom"&&m.bottom+u.height>p||v==="left"&&m.left-u.width<0)&&(h=o),b==="left"&&m.left+u.width+(c?.[1]??0)>document.documentElement.getBoundingClientRect().right)switch(v){case"bottom":h=F.Position.BOTTOM_RIGHT;break;case"top":h=F.Position.TOP_RIGHT;break}const N=a?Math.max(m.width,u.width):u.width,w=s?m.width:N,[T,L,A,B]=tf(h,y,m,u,w,h===o?d:c,i,l),P={top:Co(T),right:Co(L),bottom:Co(A),left:Co(B)};return l&&(P.position="fixed",P.zIndex=F.ZStratum.BAR),a&&(P.minWidth=`${m.width}px`),s&&(P.width=`${m.width}px`),[P,h===o]}return[{},!1]}const rt=E.createContext(null);function gn(e,t=[]){const n=E.useContext(rt);return E.useMemo(()=>o=>{const s=n&&n.parentElementRef&&n.parentElementRef.current||document.body;let i=null,l=s.lastElementChild;for(;l&&l!==s.firstElementChild;){if(l.hasAttribute("data-portalid")&&l.getAttribute("data-portalid")===e){i=l;break}l=l.previousElementSibling}if(i)s.contains(i)||s.appendChild(i);else{i=document.createElement("div"),i.setAttribute("data-portalid",e),i.setAttribute("data-react-aria-top-layer","true");for(const c of t)i.classList.add(c);s.appendChild(i)}return Ln.createPortal(o,i)},[n])}const Fr=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","1","2","3","4","5","6","7","8","9","0"];async function _i(e,t,n,o,a,s){const i=typeof e.options=="function"?e.options(t.value):e.options||[],l=i instanceof Promise,c=m=>m.replace(/([.?*+^$[\]\\(){}|-])/g,"");n({pending:l}),s.current=l?i:null;const d=l?await i||[]:i||[];if(l&&s.current!==i)return;let u=Array.from(d).filter(Boolean).map(m=>new F.SpsOptionListOption(m,typeof m=="function"?{textKey:"label",captionKey:"caption"}:{textKey:e.textKey,captionKey:e.captionKey}));if(e.nullOption&&u.unshift(new F.SpsOptionListOption(null,{text:e.nullOption})),t.value&&!e.disableDefaultOptionsFiltering){const m=c(t.value);n({replacementPattern:new RegExp(`(${m})`,"ig")}),u=u.filter(p=>{const f=new RegExp(m,"i"),g=c(p.text);return e.filterByTextAndCaptionKey?f.test(g)||f.test(c(p.caption)):f.test(g)})}else n({replacementPattern:null});if(e.disabledOptions)for(const m of u)e.disabledOptions.includes(m.value)&&(m.disabled=!0);o(Object.freeze(u)),e.onOptionListChanged&&e.onOptionListChanged(u.length),a(u.some(m=>m.value&&!!m.value.icon)),n({pending:!1})}function nf(e,t,n){const[o,a]=r.useState(Object.freeze([])),[s,i]=r.useState(!1),l=r.useRef(null),c=r.useRef(e.options);(typeof e.options!="function"||e.disableOptionsMemoization)&&(c.current=e.options);const d=r.useMemo(()=>typeof c.current=="function"?S.debounce(_i,typeof e.searchDebounce<"u"?e.searchDebounce:500):_i,[c.current,e.disabledOptions]);return r.useEffect(()=>{d(e,t,n,a,i,l)},[c.current,t.value,e.disabledOptions]),[o,s]}class Lt{constructor(t,n){this.target=t,this.isPgStoppedInternal=!1,this.currentTarget=t,this.nativeEvent=new CustomEvent("change",n),Object.defineProperty(this.nativeEvent,"target",{value:t,writable:!1,configurable:!1,enumerable:!0})}get bubbles(){return this.nativeEvent.bubbles}get cancelable(){return this.nativeEvent.cancelable}get defaultPrevented(){return this.nativeEvent.defaultPrevented}get eventPhase(){return this.nativeEvent.eventPhase}get isTrusted(){return this.nativeEvent.isTrusted}get timeStamp(){return this.nativeEvent.timeStamp}get type(){return this.nativeEvent.type}preventDefault(){this.nativeEvent.preventDefault()}isDefaultPrevented(){return this.defaultPrevented}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPgStoppedInternal=!0}isPropagationStopped(){return this.isPgStoppedInternal}persist(){throw new Error("This is not a real React ChangeEvent. React does not permit the creation of SyntheticEvents in userland.")}}function of(e,t){return{...e,...t}}function Dt(e){return E.useReducer(of,e)}function rf({hideInlineSearch:e,showInlineSearch:t,options:n,onSearchChange:o,search:a="",searchPlaceholder:s,searchInputRef:i}){const{t:l}=he.useWoodlandLanguage(),c=s??l("select.searchPlaceholder",{defaultValue:"Search…"}),[d,u]=Dt({isAsync:typeof n=="function",pending:!1,value:a,replacementPattern:null}),m=r.useCallback(v=>{u({value:v.target.value}),o&&o(v)},[o]),p=r.useCallback(v=>{v.nativeEvent.stopImmediatePropagation(),v.stopPropagation()},[]),f=r.useCallback(v=>{v.nativeEvent.stopImmediatePropagation(),u({value:""}),o&&o(new Lt({value:""})),i?.current&&i.current.focus()},[o,i]),g=v=>{v&&(["Tab","Escape","Enter","Up","ArrowUp","Down","ArrowDown"].includes(v.key)||v.stopPropagation())};return r.useEffect(()=>{u({value:a})},[a]),[(d.isAsync||t)&&!e?r.createElement("div",{className:"sps-option-list__search sps-form-group sps-text-input"},r.createElement("div",{className:"sps-form-control"},!d.value&&r.createElement("i",{className:"sps-icon sps-icon-filter sps-text-input__icon"}),r.createElement("input",{type:"text",className:"sps-text-input__input",placeholder:c,ref:i,value:d.value,onChange:m,onClick:p,onKeyDown:g}),d.value&&r.createElement("i",{className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:f}))):r.createElement(r.Fragment,null),d,u]}const af=wo||Br,sf=["Tab","Escape","Enter","Up","ArrowUp","Down","ArrowDown"];function lf(e,t,n){return n?(e&&e[n])===(t&&t[n]):e===t}function Pi(e,t,n){return typeof n.value=="function"&&n.disabled?!0:t?!!e?.find(o=>o[t]&&o[t]===n?.value?.[t]):!1}const Rn=r.forwardRef((e,t)=>{const{captionKey:n,comparisonKey:o,disabledOptions:a,options:s,tall:i,textKey:l,valueKey:c,zeroState:d,hideInlineSearch:u,showInlineSearch:m,onSearchChange:p,search:f,searchDebounce:g,searchPlaceholder:y,onSpecialActionSelect:v,attachTo:b,className:h,conformWidth:N,id:w,ignoreWidthStyles:T,isOpen:L,keepOpen:A,keyDown:B,nullOption:P,onOptionListChanged:O,onOptionSelected:U,onPositionFlip:X,onSelfToggle:K,optionRole:D,positionOverride:V,selectedOption:R,specialAction:M,unsafelyReplaceClassName:Z,loading:I,filterByTextAndCaptionKey:C,maxHeightPx:k,maxHeightRem:G,disableOptionsMemoization:J,disableDefaultOptionsFiltering:te,"data-testid":ne,typeaheadEvent:H,...q}=e,Y=r.useMemo(()=>M?new F.SpsOptionListOption(M,{textKey:"label",captionKey:"caption"}):null,[M]),[W,ee]=r.useState(-1),[z,Q]=r.useState(L),fe=t||r.useRef(null),se=r.useRef(null),pe=r.useRef(null),He=gn("sps-option-list-portal"),$e=r.useContext(rt),[Xe,nt]=V||[F.Position.BOTTOM_LEFT,F.Position.TOP_LEFT],[[mt,xe],ot]=r.useState([{},!1]),Ve=r.useRef(null),[ft,_e,oe]=rf({...e,searchInputRef:Ve}),[ue,je]=nf(e,_e,oe);r.useEffect(()=>{H&&Ye(H)},[H]),r.useEffect(()=>{ot(z?Sn(fe,b,Xe,{altPosition:nt,setMinWidth:!T,setWidth:!T&&N,...$e}):[{},!1])},[z,Xe,nt,ue]),r.useEffect(()=>{let ie;return z&&(ie=()=>{z&&ot(Sn(fe,b,Xe,{altPosition:nt,setMinWidth:!T,setWidth:!T&&N,...$e}))},document.addEventListener("scroll",ie)),()=>{ie&&document.removeEventListener("scroll",ie)}},[z]),r.useEffect(()=>{ee(-1)},[_e]);const mo=$(Z||"sps-option-list","z-stratum-dropdown",z&&"sps-option-list--open",_e.isAsync&&"sps-option-list--searchable",xe&&"sps-option-list--opens-upward",M&&M.label&&"sps-option-list--has-special-action",h),Dr=$(Z||"sps-option-list__options",i&&"sps-option-list__options--tall"),xt=r.useCallback(()=>{z||(Q(!0),Ve.current&&Ve.current.focus(),ee(-1),K&&K(!0))},[z,K]),jt=r.useCallback(()=>{z&&(Q(!1),ee(-1),K&&K(!1))},[z,K]),yt=r.useCallback((ie,de)=>{de||ie&&!ie.disabled&&(typeof ie.value=="function"?(ie.value(),v&&v()):typeof U=="function"&&U(ie.value),A||jt())},[U,jt]),fo=r.useCallback((ie,de,ke)=>{ie.stopPropagation(),yt(de,ke)},[yt]),ae=r.useRef(a||[]);ae.current=a||[];const we=r.useCallback(ie=>{switch(ie.key){case"Tab":case"Escape":jt();break;case"Enter":if(W>-1){const de=ue[W]||Y;ie.preventDefault();const ke=!!de&&Pi(ae.current,o||"",de);!ke&&de&&typeof U=="function"&&typeof de.value=="function"?de.value():de&&yt(de,ke)}break;case"Up":case"ArrowUp":{let de=W;xe?W<=-1?de=ue.length-1:W===0?M&&(de=ue.length):W<ue.length&&(de=W-1):W>-1&&(de=W-1),de!==W&&(ie.preventDefault(),ee(de));break}case"Down":case"ArrowDown":{xt();let de=W;xe?W!==-1&&(W>=ue.length?de=0:W===ue.length-1?de=-1:de=W+1):W<ue.length-1+ +!!M&&(de=W+1),de!==W&&(ie.preventDefault(),ee(de));break}default:xt()}},[jt,xt,W,yt,U,xe,ue]),Ke=r.useCallback(ie=>{xt();const de=ue.findIndex(ke=>{if(ke.textKey){const Tt=ke.textKey;return ke.value[Tt].toLowerCase().charAt([0])===ie.key.toLocaleLowerCase()}return ke.value.toString().toLowerCase().charAt([0])===ie.key.toLocaleLowerCase()});de>-1&&ee(de)},[ue]),Ye=r.useCallback(ie=>{ie&&(sf.includes(ie.key)?we(ie):Fr.includes(ie.key)&&!u&&Ke(ie))},[jt,xt,W,yt,U,xe,ue]);r.useEffect(()=>{if($e!==null&&document.getElementsByClassName("sps-modal__body").length>0){const ie=()=>{K&&K(!1)},de=document.getElementsByClassName("sps-modal__body")[0];return de.addEventListener("scroll",ie),()=>{de.removeEventListener("scroll",ie)}}},[]),r.useEffect(()=>{z&&pe.current&&af(pe.current,{scrollMode:"if-needed",block:"nearest",inline:"nearest"})},[W,z]),r.useEffect(()=>{Q(L),L?Ve.current&&Ve.current.focus():ee(-1)},[L]),r.useEffect(()=>{B&&Ye(B)},[B]),r.useEffect(()=>{!z&&se.current&&(p&&_e.value&&p(new Lt({value:""})),oe({value:""}),se.current.scrollTop=0),z&&X&&X(xe)},[z]);const Ie=k?k/16:G,Et=Ie?{maxHeight:`${Ie}rem`}:{};function kt(ie,de){return de?r.createElement(r.Fragment,null,ie.split(de).map((ke,Tt)=>de.test(ke)?r.createElement("u",{key:Tt},ke):r.createElement(r.Fragment,{key:Tt},ke))):r.createElement(r.Fragment,null,ie)}return He(r.createElement("div",{className:mo,id:w,"aria-activedescendant":W>-1?`${w}-option-${W}`:"",tabIndex:-1,ref:fe,style:mt,onMouseLeave:()=>ee(-1),"data-testid":ne,...q},ft,r.createElement("div",{className:Dr,ref:se,"data-testid":`${ne}-options`,style:Et},!I&&!_e.pending&&d&&ue.length===0&&r.createElement("div",{className:"sps-option-list__zero-state"},d),(I||_e.pending)&&r.createElement("div",{className:"sps-option-list__loading"},r.createElement(Or,null)),!I&&!_e.pending&&ue.map((ie,de)=>{const ke=`${w}-option-${de}`,Tt=lf(ie.value,R,o),Im=Pi(ae.current,o||"",ie);return r.createElement("a",{key:ke,id:ke,role:D,"aria-selected":Tt,href:ie.href,className:$("sps-option-list__option",ie.caption&&"sps-option-list__option--has-caption",ie.disabled&&"sps-option-list__option--disabled",ie.bold&&"sps-option-list__option--bold",(Tt||Im)&&"sps-option-list__option--selected",W===de&&"sps-option-list__option--highlighted"),onClick:jC=>fo(jC,ie,Im),onMouseOver:()=>ee(de),tabIndex:-1,ref:W===de?pe:null,"data-testid":`${ne}-option-${de}`},ie.value&&ie.value.icon&&r.createElement("i",{className:$("sps-icon","sps-option-list__option-icon",`sps-icon-${String(ie.value.icon)}`)}),(!ie.value||!ie.value.icon&&je)&&r.createElement("span",{className:"sps-option-list__option-icon-spacer"}),r.createElement("span",null,kt(ie.text,_e.replacementPattern)),ie.caption&&r.createElement("div",{className:"sps-option-list__option-caption"},r.createElement("span",null,kt(ie.caption,_e.replacementPattern))))})),Y&&M?.label&&r.createElement("a",{className:$("sps-option-list__option","sps-option-list__special-action",W===ue.length&&"sps-option-list__option--highlighted",M.disabled&&"sps-option-list__special-action--disabled"),href:Y.href,target:Y.href&&M.newTab?"_blank":"_self",onClick:ie=>fo(ie,Y),onMouseOver:()=>ee(ue.length),"data-testid":`${ne}-special-action`},M.icon&&r.createElement("i",{className:$("sps-icon","sps-option-list__option-icon",`sps-icon-${String(M.icon)}`)}),!M.icon&&je&&r.createElement("span",{className:"sps-option-list__option-icon-spacer"}),r.createElement("span",null,M.label))))});Object.assign(Rn,{displayName:"SpsOptionList"});function hn(e){return{key:e.key,preventDefault:()=>{}}}function cf(e,t,n=[]){return r.useMemo(()=>{function o(a){return r.createElement(e,{...a,...t},a.children)}return o},n)}function qe(e){return typeof e=="function"?e():e}const Bi=function({children:e,elements:t}){if(t.length===0)return r.createElement(r.Fragment,null,e);const[n,o]=Array.isArray(t[0])?t[0]:[t[0]];return r.createElement(n,{...o??{}},r.createElement(Bi,{elements:t.slice(1)},e))},Oi=function({children:e,providers:t=[],...n}){return r.createElement("div",{...n},r.createElement(Bi,{elements:t},e))},df=function({children:e,className:t,...n}){return r.createElement(Oi,{className:`sps-app ${t}`,...n},e)};function pf(e,t){const{type:n,props:o={},custom:a}=t;return a?a(e.type):e.type!==n?!1:Object.keys(o).every(s=>o[s]===e.props[s])}function at(e=[],t=[]){const n=Array.isArray(e)?S.flatten(e):[e],o=t.map(s=>Array.isArray(s)?s:[s]),a=new Array(o.length+1).fill(null).map(()=>[]);for(const s of n){let i=!1;for(let l=0;l<o.length;l+=1)for(const c of o[l])if(pf(s,c)){i=!0,a[l].push(s);break}i||a[a.length-1].push(s)}return a}function Ri(e,t,n){const o=Object.entries(t).filter(([,s])=>typeof s!="string"&&s.deprecated).map(([s])=>s),a=o.map(s=>n[s]);r.useEffect(()=>{a.find(s=>typeof s<"u")&&console.warn(`The following prop(s) of ${e} are deprecated: ${o.join(", ")}`)},a)}function Ar(e,t){const n=E.useRef(!1);E.useEffect(()=>()=>{n.current=!1},[]),E.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function $r(e,t,n){const o=r.useRef(t(...n));r.useEffect(()=>(document.addEventListener(e,o.current,{capture:!0}),()=>document.removeEventListener(e,o.current)),[]),r.useEffect(()=>{document.removeEventListener(e,o.current),o.current=t(...n),document.addEventListener(e,o.current,{capture:!0})},n)}function Fi(e,t,n){return function(a){!e.current?.contains(a.target)&&!t.current?.contains(a.target)&&n()}}function bn(e,t,n){const o=r.useRef(!1),[a,s]=r.useState(!1),i=r.useCallback(()=>{o.current?o.current=!1:s(!0)},[]),l=r.useCallback((c=!1)=>{s(!1),o.current=c,n&&n()},[]);return $r("mousedown",Fi,[e,t,l]),$r("pointerdown",Fi,[e,t,l]),{showPopup:a,doShowPopup:i,doHidePopup:l}}const Ai=e=>{const t=/(auto|scroll)/,n=(l,c)=>l.parentNode===null?c:n(l.parentNode,c.concat([l])),o=(l,c)=>getComputedStyle(l,null).getPropertyValue(c),a=l=>o(l,"overflow")+o(l,"overflow-y"),s=l=>t.test(a(l));return(l=>{if(!(l instanceof HTMLElement||l instanceof SVGElement))return;const c=n(l.parentNode,[]);for(let d=0;d<c.length;d+=1)if(s(c[d]))return c[d];return null})(e)};let Vr=0;function Fn({isOpen:e,rootRef:t}){r.useLayoutEffect(()=>{let n,o,a;if(e&&t.current){Vr+=1,n=Ai(t.current)||document.body,o=n===document.body?window.innerWidth-document.documentElement.clientWidth:n.offsetWidth-n.clientWidth,n.style.overflow="hidden";const s=window.getComputedStyle(n).paddingRight;if(n.style.paddingRight=s&&s!=="0px"?`calc(${s} + ${o}px)`:`${o}px`,n===document.body){if(a=document.getElementsByClassName("sps-navbar-container").item(0),a&&window.getComputedStyle(a).position==="fixed"){const i=window.getComputedStyle(a).paddingRight;a.style.paddingRight=i&&i!=="0px"?`calc(${i} + ${o}px)`:`${o}px`}else if(a=document.getElementsByTagName("nav").item(0)?.parentElement,a&&window.getComputedStyle(a).position==="fixed"){const l=window.getComputedStyle(a).paddingRight;a.style.paddingRight=l&&l!=="0px"?`calc(${l} + ${o}px)`:`${o}px`}}}return()=>{n&&(Vr-=1,Vr===0&&(n.style.overflow=null,n.style.paddingRight=null,a&&(a.style.paddingRight=null)))}},[e])}const uf={debounce:"number",disabled:"boolean",conformWidth:"boolean",formMeta:"SpsFormFieldMeta<string>",icon:"SpsIcon",onChange:"React.ChangeEventHandler",onSelectionChange:"(newValue: string) => void",placeholder:"string",suggestions:{type:`
2
2
  Eventually<Iterable<string>>
3
3
  | ((filter?: string) => Eventually<Iterable<string>>)
4
4
  `,required:!0},textKey:"string",captionKey:"string",tallOptionList:"boolean",value:"string",zeroState:"string",loading:"boolean",maxHeightOptionListPx:"number",maxHeightOptionListRem:"number",disableOptionsMemoization:"boolean",inputNotClearable:"boolean",autoFocusOnSelection:"boolean"};function Nt({className:e,debounce:t=0,disabled:n,conformWidth:o,formControl:a,formMeta:s,onChange:i,onSelectionChange:l,icon:c,id:d,placeholder:u="",suggestions:m,unsafelyReplaceClassName:p,textKey:f,captionKey:g,tallOptionList:y,value:v="",zeroState:b,loading:h,maxHeightOptionListPx:N,maxHeightOptionListRem:w,disableOptionsMemoization:T,inputNotClearable:L,autoFocusOnSelection:A,"data-testid":B,...P}){const O=s||a,{wrapperId:U,controlId:X}=Ge(d,O),[K,D]=Dt({keyDown:null,opensUpward:!1}),V=r.useRef(null),R=r.useRef(null),M=r.useRef(null),{showPopup:Z,doShowPopup:I,doHidePopup:C}=bn(V,M);function k(Y,W,ee=!1){O&&(O.setValue(Y),O.markAsDirty()),l&&ee?l(Y):i&&i(W||new Lt({value:Y}))}function G(Y){R.current&&(R.current.value="",k("")),Y.stopPropagation()}function J(Y){k(Y.target.value,Y)}function te(Y){n||(["Up","ArrowUp","Down","ArrowDown","Enter"].indexOf(Y.key)>-1&&Y.preventDefault(),Y.stopPropagation(),D({keyDown:hn(Y)})),Y.key==="Tab"&&C()}function ne(Y){Y?I():C()}function H(Y){D({opensUpward:Y})}const q=$(p||"sps-autocomplete",Z&&"sps-autocomplete--open",Z&&"z-stratum-dropdown",K.opensUpward&&"sps-autocomplete--opens-upward",n&&"sps-form-control--disabled",e);return r.useEffect(()=>{let Y;return Z&&(Y=()=>{C()},window.addEventListener("resize",Y)),()=>{Y&&window.removeEventListener("resize",Y)}},[Z]),Fn({isOpen:Z,rootRef:V}),r.createElement(Le,{id:U,className:q,formControl:a,formMeta:s,inputRef:R,ref:V,focusInputOnClick:!0,onClick:Y=>Y.nativeEvent.stopImmediatePropagation(),"data-testid":`${B}`},r.createElement("div",{className:"sps-text-input"},r.createElement("div",{className:"sps-form-control"},c&&r.createElement("i",{className:$("sps-text-input__icon","sps-icon",`sps-icon-${c}`)}),r.createElement("input",{type:"text",ref:R,value:v,className:"sps-text-input__input",placeholder:u,onFocus:I,onClick:I,onChange:J,onKeyDown:te,disabled:n,id:X,"data-testid":`${B}__input`,...P}),v&&!n&&!L&&r.createElement("i",{"aria-label":"clear",className:"sps-icon sps-icon-x-circle sps-form-control__clear-btn",onClick:Y=>G(Y)}))),r.createElement(Rn,{id:`${U}_options`,ref:M,attachTo:V,isOpen:Z,options:m,hideInlineSearch:!0,keyDown:K.keyDown,onOptionSelected:Y=>{const W=f&&typeof Y=="object"&&Y!==null?Y[f]??"":Y;k(W,void 0,!0),A&&R.current?.focus()},onPositionFlip:H,onSelfToggle:ne,offsets:[1,0],search:v,searchDebounce:t,textKey:f,captionKey:g,tall:y,zeroState:b,loading:h,maxHeightPx:N,maxHeightRem:w,disableOptionsMemoization:T,conformWidth:o}))}Object.assign(Nt,{props:uf,displayName:"SpsAutocomplete"});const $i={basic:{label:"Basic",examples:{basic:{react:S.code`
@@ -9832,7 +9832,7 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
9832
9832
  touch-action: pan-x pan-y pinch-zoom;
9833
9833
  }
9834
9834
  }
9835
- `.trim(),D.head.prepend(V)},[p]),E.useEffect(()=>{let D=v.current;return()=>{m||js(D.target??void 0);for(let V of D.disposables)V();D.disposables=[]}},[m]),{isPressed:c||g,pressProps:dt(f,K,{[Cu]:!0})}}function qs(e){return e.tagName==="A"&&e.hasAttribute("href")}function Js(e,t){const{key:n,code:o}=e,a=t,s=a.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||o==="Space")&&!(a instanceof pt(a).HTMLInputElement&&!ku(a,n)||a instanceof pt(a).HTMLTextAreaElement||a.isContentEditable)&&!((s==="link"||!s&&qs(a))&&n!=="Enter")}function XT(e){const{targetTouches:t}=e;return t.length>0?t[0]:null}function Nu(e,t){const n=e.changedTouches;for(let o=0;o<n.length;o++){const a=n[o];if(a.identifier===t)return a}return null}function zt(e,t){let n=0,o=0;return t.targetTouches&&t.targetTouches.length===1&&(n=t.targetTouches[0].clientX,o=t.targetTouches[0].clientY),{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:o}}function dn(e,t){let n=t.clientX,o=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:o,key:t.key}}function ZT(e){let t=0,n=0;return e.width!==void 0?t=e.width/2:e.radiusX!==void 0&&(t=e.radiusX),e.height!==void 0?n=e.height/2:e.radiusY!==void 0&&(n=e.radiusY),{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function QT(e,t){return!(e.left>t.right||t.left>e.right||e.top>t.bottom||t.top>e.bottom)}function Iu(e,t){let n=t.getBoundingClientRect(),o=ZT(e);return QT(n,o)}function ew(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!=="submit"&&e.type!=="reset":!qs(e)}function xu(e,t){return e instanceof HTMLInputElement?!ku(e,t):ew(e)}const tw=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function ku(e,t){return e.type==="checkbox"||e.type==="radio"?t===" ":tw.has(e.type)}let nw=0;const Xs=new Map;function ow(e){let[t,n]=E.useState();return Gt(()=>{if(!e)return;let o=Xs.get(e);if(o)n(o.element.id);else{let a=`react-aria-description-${nw++}`;n(a);let s=document.createElement("div");s.id=a,s.style.display="none",s.textContent=e,document.body.appendChild(s),o={refCount:0,element:s},Xs.set(e,o)}return o.refCount++,()=>{o&&--o.refCount===0&&(o.element.remove(),Xs.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}const rw=500;function aw(e){let{isDisabled:t,onLongPressStart:n,onLongPressEnd:o,onLongPress:a,threshold:s=rw,accessibilityDescription:i}=e;const l=E.useRef(void 0);let{addGlobalListener:c,removeGlobalListener:d}=Eu(),{pressProps:u}=Du({isDisabled:t,onPressStart(p){if(p.continuePropagation(),(p.pointerType==="mouse"||p.pointerType==="touch")&&(n&&n({...p,type:"longpressstart"}),l.current=setTimeout(()=>{p.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),Re(p.target).activeElement!==p.target&&Pt(p.target),a&&a({...p,type:"longpress"}),l.current=void 0},s),p.pointerType==="touch")){let f=y=>{y.preventDefault()},g=pt(p.target);c(p.target,"contextmenu",f,{once:!0}),c(g,"pointerup",()=>{setTimeout(()=>{d(p.target,"contextmenu",f)},30)},{once:!0})}},onPressEnd(p){l.current&&clearTimeout(l.current),o&&(p.pointerType==="mouse"||p.pointerType==="touch")&&o({...p,type:"longpressend"})}}),m=ow(a&&!t?i:void 0);return{longPressProps:dt(u,m)}}function sw(e){let{id:t,selectionManager:n,key:o,ref:a,shouldSelectOnPressUp:s,shouldUseVirtualFocus:i,focus:l,isDisabled:c,onAction:d,allowsDifferentPressOrigin:u,linkBehavior:m="action"}=e,p=$s();t=mr(t);let f=C=>{if(C.pointerType==="keyboard"&&Gs(C))n.toggleSelection(o);else{if(n.selectionMode==="none")return;if(n.isLink(o)){if(m==="selection"&&a.current){let k=n.getItemProps(o);p.open(a.current,C,k.href,k.routerOptions),n.setSelectedKeys(n.selectedKeys);return}else if(m==="override"||m==="none")return}n.selectionMode==="single"?n.isSelected(o)&&!n.disallowEmptySelection?n.toggleSelection(o):n.replaceSelection(o):C&&C.shiftKey?n.extendSelection(o):n.selectionBehavior==="toggle"||C&&(kn(C)||C.pointerType==="touch"||C.pointerType==="virtual")?n.toggleSelection(o):n.replaceSelection(o)}};E.useEffect(()=>{o===n.focusedKey&&n.isFocused&&(i?gu(a.current):l?l():It()!==a.current&&a.current&&yr(a.current))},[a,o,n.focusedKey,n.childFocusStrategy,n.isFocused,i]),c=c||n.isDisabled(o);let g={};!i&&!c?g={tabIndex:o===n.focusedKey?0:-1,onFocus(C){me(C)===a.current&&n.setFocusedKey(o)}}:c&&(g.onMouseDown=C=>{C.preventDefault()}),E.useEffect(()=>{c&&n.focusedKey===o&&n.setFocusedKey(null)},[n,c,o]);let y=n.isLink(o)&&m==="override",v=d&&e.UNSTABLE_itemBehavior==="action",b=n.isLink(o)&&m!=="selection"&&m!=="none",h=!c&&n.canSelectItem(o)&&!y&&!v,N=(d||b)&&!c,w=N&&(n.selectionBehavior==="replace"?!h:!h||n.isEmpty),T=N&&h&&n.selectionBehavior==="replace",L=w||T,A=E.useRef(null),B=L&&h,P=E.useRef(!1),O=E.useRef(!1),U=n.getItemProps(o),X=C=>{d&&(d(),a.current?.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))),b&&a.current&&p.open(a.current,C,U.href,U.routerOptions)},K={ref:a};if(s?(K.onPressStart=C=>{A.current=C.pointerType,P.current=B,C.pointerType==="keyboard"&&(!L||Lu(C.key))&&f(C)},u?(K.onPressUp=w?void 0:C=>{C.pointerType==="mouse"&&h&&f(C)},K.onPress=w?X:C=>{C.pointerType!=="keyboard"&&C.pointerType!=="mouse"&&h&&f(C)}):K.onPress=C=>{if(w||T&&C.pointerType!=="mouse"){if(C.pointerType==="keyboard"&&!Mu(C.key))return;X(C)}else C.pointerType!=="keyboard"&&h&&f(C)}):(K.onPressStart=C=>{A.current=C.pointerType,P.current=B,O.current=w,h&&(C.pointerType==="mouse"&&!w||C.pointerType==="keyboard"&&(!N||Lu(C.key)))&&f(C)},K.onPress=C=>{(C.pointerType==="touch"||C.pointerType==="pen"||C.pointerType==="virtual"||C.pointerType==="keyboard"&&L&&Mu(C.key)||C.pointerType==="mouse"&&O.current)&&(L?X(C):h&&f(C))}),g["data-collection"]=UT(n.collection),g["data-key"]=o,K.preventFocusOnPress=i,i&&(K=dt(K,{onPressStart(C){C.pointerType!=="touch"&&(n.setFocused(!0),n.setFocusedKey(o))},onPress(C){C.pointerType==="touch"&&(n.setFocused(!0),n.setFocusedKey(o))}})),U)for(let C of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])U[C]&&(K[C]=Ps(K[C],U[C]));let{pressProps:D,isPressed:V}=Du(K),R=T?C=>{A.current==="mouse"&&(C.stopPropagation(),C.preventDefault(),X(C))}:void 0,{longPressProps:M}=aw({isDisabled:!B,onLongPress(C){C.pointerType==="touch"&&(f(C),n.setSelectionBehavior("toggle"))}}),Z=C=>{A.current==="touch"&&P.current&&C.preventDefault()},I=m!=="none"&&n.isLink(o)?C=>{Ot.isOpening||C.preventDefault()}:void 0;return{itemProps:dt(g,h||w||i&&!c?D:{},B?M:{},{onDoubleClick:R,onDragStartCapture:Z,onClick:I,id:t},i?{onMouseDown:C=>C.preventDefault()}:void 0),isPressed:V,isSelected:n.isSelected(o),isFocused:n.isFocused&&n.focusedKey===o,isDisabled:c,allowsSelection:h,hasAction:L}}function Mu(e){return e==="Enter"}function Lu(e){return e===" "}function iw(e,t,n){let{key:o,isDisabled:a,shouldSelectOnPressUp:s}=e,{selectionManager:i,selectedKey:l}=t,c=o===l,d=a||t.isDisabled||t.selectionManager.isDisabled(o),u=t.collection.getItem(o),{itemProps:m,isPressed:p}=sw({selectionManager:i,key:o,ref:n,isDisabled:d,shouldSelectOnPressUp:s??u?.props.href!=null,linkBehavior:"selection"}),f=pr(t,o,"tab"),g=pr(t,o,"tabpanel"),{tabIndex:y}=m,v=QE(u?.props,{labelable:!0});delete v.id;let b=BT(u?.props),{focusableProps:h}=WT({...u?.props,isDisabled:d},n);return{tabProps:dt(v,h,b,m,{id:f,"aria-selected":c,"aria-disabled":d||void 0,"aria-controls":c?g:void 0,tabIndex:d?void 0:y,role:"tab"}),isSelected:c,isDisabled:d,isPressed:p}}class lw{constructor(t,n,o,a){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=i=>{if(i.nodeType===Node.ELEMENT_NODE){const l=i.shadowRoot;if(l){const c=this._doc.createTreeWalker(l,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(c),NodeFilter.FILTER_ACCEPT}else{if(typeof this.filter=="function")return this.filter(i);if(this.filter?.acceptNode)return this.filter.acceptNode(i);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=t,this.root=n,this.filter=a??null,this.whatToShow=o??NodeFilter.SHOW_ALL,this._currentNode=n,this._walkerStack.unshift(t.createTreeWalker(n,o,this._acceptNode));const s=n.shadowRoot;if(s){const i=this._doc.createTreeWalker(s,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(i)}}get currentNode(){return this._currentNode}set currentNode(t){if(!ye(this.root,t))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const n=[];let o=t,a=t;for(this._currentNode=t;o&&o!==this.root;)if(o.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const i=o,l=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});n.push(l),l.currentNode=a,this._currentSetFor.add(l),o=a=i.host}else o=o.parentNode;const s=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});n.push(s),s.currentNode=a,this._currentSetFor.add(s),this._walkerStack=n}get doc(){return this._doc}firstChild(){let t=this.currentNode,n=this.nextNode();return ye(t,n)?(n&&(this.currentNode=n),n):(this.currentNode=t,null)}lastChild(){let n=this._walkerStack[0].lastChild();return n&&(this.currentNode=n),n}nextNode(){const t=this._walkerStack[0].nextNode();if(t){if(t.shadowRoot){let o;if(typeof this.filter=="function"?o=this.filter(t):this.filter?.acceptNode&&(o=this.filter.acceptNode(t)),o===NodeFilter.FILTER_ACCEPT)return this.currentNode=t,t;let a=this.nextNode();return a&&(this.currentNode=a),a}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let n=this.nextNode();return n&&(this.currentNode=n),n}else return null}previousNode(){const t=this._walkerStack[0];if(t.currentNode===t.root){if(this._currentSetFor.has(t))if(this._currentSetFor.delete(t),this._walkerStack.length>1){this._walkerStack.shift();let o=this.previousNode();return o&&(this.currentNode=o),o}else return null;return null}const n=t.previousNode();if(n){if(n.shadowRoot){let a;if(typeof this.filter=="function"?a=this.filter(n):this.filter?.acceptNode&&(a=this.filter.acceptNode(n)),a===NodeFilter.FILTER_ACCEPT)return n&&(this.currentNode=n),n;let s=this.lastChild();return s&&(this.currentNode=s),s}return n&&(this.currentNode=n),n}else if(this._walkerStack.length>1){this._walkerStack.shift();let o=this.previousNode();return o&&(this.currentNode=o),o}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}}function cw(e,t,n,o){return Sr()?new lw(e,t,n,o):e.createTreeWalker(t,n,o)}function dw(e){if(!e.form)return Array.from(Re(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(o=>!o.form);const t=e.form.elements.namedItem(e.name);let n=pt(e);return t instanceof n.RadioNodeList?Array.from(t).filter(o=>o instanceof n.HTMLInputElement):t instanceof n.HTMLInputElement?[t]:[]}function pw(e){if(e.checked)return!0;const t=dw(e);return t.length>0&&!t.some(n=>n.checked)}function _u(e,t){return!e||!t?!1:t.some(n=>ye(n,e))}function Pu(e,t,n){let o=t?.tabbable?eu:Qp,a=e?.nodeType===Node.ELEMENT_NODE?e:null,s=Re(a),i=cw(s,e||s,NodeFilter.SHOW_ELEMENT,{acceptNode(l){return ye(t?.from,l)||t?.tabbable&&l.tagName==="INPUT"&&l.getAttribute("type")==="radio"&&(!pw(l)||i.currentNode.tagName==="INPUT"&&i.currentNode.type==="radio"&&i.currentNode.name===l.name)?NodeFilter.FILTER_REJECT:o(l)&&(!n||_u(l,n))&&(!t?.accept||t.accept(l))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(i.currentNode=t.from),i}class Zs{constructor(){this.fastMap=new Map,this.root=new Bu({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,n,o){let a=this.fastMap.get(n??null);if(!a)return;let s=new Bu({scopeRef:t});a.addChild(s),s.parent=a,this.fastMap.set(t,s),o&&(s.nodeToRestore=o)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let n=this.fastMap.get(t);if(!n)return;let o=n.parent;for(let s of this.traverse())s!==n&&n.nodeToRestore&&s.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&_u(s.nodeToRestore,n.scopeRef.current)&&(s.nodeToRestore=n.nodeToRestore);let a=n.children;o&&(o.removeChild(n),a.size>0&&a.forEach(s=>o&&o.addChild(s))),this.fastMap.delete(n.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let n of t.children)yield*this.traverse(n)}clone(){let t=new Zs;for(let n of this.traverse())t.addTreeNode(n.scopeRef,n.parent?.scopeRef??null,n.nodeToRestore);return t}}class Bu{constructor(t){this.children=new Set,this.contain=!1,this.scopeRef=t.scopeRef}addChild(t){this.children.add(t),t.parent=this}removeChild(t){this.children.delete(t),t.parent=void 0}}new Zs;function uw(e,t){let n=t?.isDisabled,[o,a]=E.useState(!1);return Gt(()=>{if(e?.current&&!n){let s=()=>{if(e.current){let l=Pu(e.current,{tabbable:!0});a(!!l.nextNode())}};s();let i=new MutationObserver(s);return i.observe(e.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{i.disconnect()}}}),n?!1:o}function Ou(e,t){let{id:n,"aria-label":o,"aria-labelledby":a}=e;return n=mr(n),a&&o?a=[...new Set([n,...a.trim().split(/\s+/)])].join(" "):a&&(a=a.trim().split(/\s+/).join(" ")),!o&&!a&&t&&(o=t),{id:n,"aria-label":o,"aria-labelledby":a}}function mw(e,t,n){let o=uw(n)?void 0:0;const a=pr(t,e.id??t?.selectedKey,"tabpanel"),s=Ou({...e,id:a,"aria-labelledby":pr(t,t?.selectedKey,"tab")});return{tabPanelProps:dt(s,{tabIndex:o,role:"tabpanel","aria-describedby":e["aria-describedby"],"aria-details":e["aria-details"]})}}class fw{constructor(t,n,o,a=new Set){this.collection=t,this.flipDirection=n==="rtl"&&o==="horizontal",this.disabledKeys=a,this.tabDirection=o==="horizontal"}getKeyLeftOf(t){return this.flipDirection?this.getNextKey(t):this.getPreviousKey(t)}getKeyRightOf(t){return this.flipDirection?this.getPreviousKey(t):this.getNextKey(t)}isDisabled(t){return this.disabledKeys.has(t)||!!this.collection.getItem(t)?.props?.isDisabled}getFirstKey(){let t=this.collection.getFirstKey();return t!=null&&this.isDisabled(t)&&(t=this.getNextKey(t)),t}getLastKey(){let t=this.collection.getLastKey();return t!=null&&this.isDisabled(t)&&(t=this.getPreviousKey(t)),t}getKeyAbove(t){return this.tabDirection?null:this.getPreviousKey(t)}getKeyBelow(t){return this.tabDirection?null:this.getNextKey(t)}getNextKey(t){let n=t;do n=this.collection.getKeyAfter(n),n==null&&(n=this.collection.getFirstKey());while(n!=null&&this.isDisabled(n));return n}getPreviousKey(t){let n=t;do n=this.collection.getKeyBefore(n),n==null&&(n=this.collection.getLastKey());while(n!=null&&this.isDisabled(n));return n}}const Sw=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),gw=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function hw(e){if(Intl.Locale){let n=new Intl.Locale(e).maximize(),o=typeof n.getTextInfo=="function"?n.getTextInfo():n.textInfo;if(o)return o.direction==="rtl";if(n.script)return Sw.has(n.script)}let t=e.split("-")[0];return gw.has(t)}const Ru=Symbol.for("react-aria.i18n.locale");function Fu(){let e=typeof window<"u"&&window[Ru]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:hw(e)?"rtl":"ltr"}}let Qs=Fu(),uo=new Set;function Au(){Qs=Fu();for(let e of uo)e(Qs)}function bw(){let e=Jp(),[t,n]=E.useState(Qs);return E.useEffect(()=>(uo.size===0&&window.addEventListener("languagechange",Au),uo.add(n),()=>{uo.delete(n),uo.size===0&&window.removeEventListener("languagechange",Au)}),[]),e?{locale:typeof window<"u"&&window[Ru]||"en-US",direction:"ltr"}:t}const vw=E.createContext(null);function $u(){let e=bw();return E.useContext(vw)||e}const yw="react-aria-clear-focus",Ew="react-aria-focus";function Tw(e,t){if(!e)return!1;let n=window.getComputedStyle(e),o=document.scrollingElement||document.documentElement,a=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return e===o&&n.overflow!=="hidden"&&(a=!0),a&&t&&(a=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),a}function Vu(e,t){let n=[],o=document.scrollingElement||document.documentElement;do Tw(e,t)&&n.push(e),e=e.parentElement;while(e&&e!==o);return n}function ei(e,t,n={}){let{block:o="nearest",inline:a="nearest"}=n;if(e===t)return;let s=e.scrollTop,i=e.scrollLeft,l=t.getBoundingClientRect(),c=e.getBoundingClientRect(),d=window.getComputedStyle(t),u=window.getComputedStyle(e),m=document.scrollingElement||document.documentElement,p=e===m?0:c.top,f=e===m?e.clientHeight:c.bottom,g=e===m?0:c.left,y=e===m?e.clientWidth:c.right,v=parseInt(d.scrollMarginTop,10)||0,b=parseInt(d.scrollMarginBottom,10)||0,h=parseInt(d.scrollMarginLeft,10)||0,N=parseInt(d.scrollMarginRight,10)||0,w=parseInt(u.scrollPaddingTop,10)||0,T=parseInt(u.scrollPaddingBottom,10)||0,L=parseInt(u.scrollPaddingLeft,10)||0,A=parseInt(u.scrollPaddingRight,10)||0,B=parseInt(u.borderTopWidth,10)||0,P=parseInt(u.borderBottomWidth,10)||0,O=parseInt(u.borderLeftWidth,10)||0,U=parseInt(u.borderRightWidth,10)||0,X=l.top-v,K=l.bottom+b,D=l.left-h,V=l.right+N,R=e===m?0:O+U,M=e===m?0:B+P,Z=e.offsetWidth-e.clientWidth-R,I=e.offsetHeight-e.clientHeight-M,C=p+B+w,k=f-P-T-I,G=g+O+L,J=y-U-A;u.direction==="rtl"&&!br()?G+=Z:J-=Z;let te=X<C||K>k,ne=D<G||V>J;if(te&&o==="start")s+=X-C;else if(te&&o==="center")s+=(X+K)/2-(C+k)/2;else if(te&&o==="end")s+=K-k;else if(te&&o==="nearest"){let H=X-C,q=K-k;s+=Math.abs(H)<=Math.abs(q)?H:q}if(ne&&a==="start")i+=D-G;else if(ne&&a==="center")i+=(D+V)/2-(G+J)/2;else if(ne&&a==="end")i+=V-J;else if(ne&&a==="nearest"){let H=D-G,q=V-J;i+=Math.abs(H)<=Math.abs(q)?H:q}if(process.env.NODE_ENV==="test"){e.scrollLeft=i,e.scrollTop=s;return}e.scrollTo({left:i,top:s})}function Ku(e,t={}){let{containingElement:n}=t;if(e&&e.isConnected){let o=document.scrollingElement||document.documentElement;if(window.getComputedStyle(o).overflow==="hidden"){let{left:s,top:i}=e.getBoundingClientRect(),l=Vu(e,!0);for(let u of l)ei(u,e);let{left:c,top:d}=e.getBoundingClientRect();if(Math.abs(s-c)>1||Math.abs(i-d)>1){l=n?Vu(n,!0):[];for(let u of l)ei(u,n,{block:"center",inline:"center"})}}else{let{left:s,top:i}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});let{left:l,top:c}=e.getBoundingClientRect();(Math.abs(s-l)>1||Math.abs(i-c)>1)&&(n?.scrollIntoView?.({block:"center",inline:"center"}),e.scrollIntoView?.({block:"nearest"}))}}}function Cr(e,t,n,o){let a=Tr(n),s=n==null;E.useEffect(()=>{if(s||!e.current)return;let i=e.current;return i.addEventListener(t,a,o),()=>{i.removeEventListener(t,a,o)}},[e,t,o,s])}const ww=1e3;function Cw(e){let{keyboardDelegate:t,selectionManager:n,onTypeSelect:o}=e,a=E.useRef({search:"",timeout:void 0}).current,s=i=>{let l=Dw(i.key);if(!(!l||i.ctrlKey||i.metaKey||!ye(i.currentTarget,me(i))||a.search.length===0&&l===" ")){if(l===" "&&a.search.trim().length>0&&(i.preventDefault(),"continuePropagation"in i||i.stopPropagation()),a.search+=l,t.getKeyForSearch!=null){let c=t.getKeyForSearch(a.search,n.focusedKey);c==null&&(c=t.getKeyForSearch(a.search)),c!=null&&(n.setFocusedKey(c),o&&o(c))}clearTimeout(a.timeout),a.timeout=setTimeout(()=>{a.search=""},ww)}};return{typeSelectProps:{onKeyDownCapture:t.getKeyForSearch?s:void 0}}}function Dw(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function Hu(e,t){const n=E.useRef(!0),o=E.useRef(null);Gt(()=>(n.current=!0,()=>{n.current=!1}),[]),Gt(()=>{n.current?n.current=!1:(!o.current||t.some((a,s)=>!Object.is(a,o[s])))&&e(),o.current=t},t)}function Nw(e){let{selectionManager:t,keyboardDelegate:n,ref:o,autoFocus:a=!1,shouldFocusWrap:s=!1,disallowEmptySelection:i=!1,disallowSelectAll:l=!1,escapeKeyBehavior:c="clearSelection",selectOnFocus:d=t.selectionBehavior==="replace",disallowTypeAhead:u=!1,shouldUseVirtualFocus:m,allowsTabNavigation:p=!1,scrollRef:f=o,linkBehavior:g="action"}=e,{direction:y}=$u(),v=$s(),b=D=>{if(D.altKey&&D.key==="Tab"&&D.preventDefault(),!o.current||!ye(o.current,me(D)))return;const V=(R,M)=>{if(R!=null){if(t.isLink(R)&&g==="selection"&&d&&!Gs(D)){Ln.flushSync(()=>{t.setFocusedKey(R,M)});let Z=Us(o,R),I=t.getItemProps(R);Z&&v.open(Z,D,I.href,I.routerOptions);return}if(t.setFocusedKey(R,M),t.isLink(R)&&g==="override")return;D.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(R):d&&!Gs(D)&&t.replaceSelection(R)}};switch(D.key){case"ArrowDown":if(n.getKeyBelow){let R=t.focusedKey!=null?n.getKeyBelow?.(t.focusedKey):n.getFirstKey?.();R==null&&s&&(R=n.getFirstKey?.(t.focusedKey)),R!=null&&(D.preventDefault(),V(R))}break;case"ArrowUp":if(n.getKeyAbove){let R=t.focusedKey!=null?n.getKeyAbove?.(t.focusedKey):n.getLastKey?.();R==null&&s&&(R=n.getLastKey?.(t.focusedKey)),R!=null&&(D.preventDefault(),V(R))}break;case"ArrowLeft":if(n.getKeyLeftOf){let R=t.focusedKey!=null?n.getKeyLeftOf?.(t.focusedKey):n.getFirstKey?.();R==null&&s&&(R=y==="rtl"?n.getFirstKey?.(t.focusedKey):n.getLastKey?.(t.focusedKey)),R!=null&&(D.preventDefault(),V(R,y==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){let R=t.focusedKey!=null?n.getKeyRightOf?.(t.focusedKey):n.getFirstKey?.();R==null&&s&&(R=y==="rtl"?n.getLastKey?.(t.focusedKey):n.getFirstKey?.(t.focusedKey)),R!=null&&(D.preventDefault(),V(R,y==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(t.focusedKey===null&&D.shiftKey)return;D.preventDefault();let R=n.getFirstKey(t.focusedKey,kn(D));t.setFocusedKey(R),R!=null&&(kn(D)&&D.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(R):d&&t.replaceSelection(R))}break;case"End":if(n.getLastKey){if(t.focusedKey===null&&D.shiftKey)return;D.preventDefault();let R=n.getLastKey(t.focusedKey,kn(D));t.setFocusedKey(R),R!=null&&(kn(D)&&D.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(R):d&&t.replaceSelection(R))}break;case"PageDown":if(n.getKeyPageBelow&&t.focusedKey!=null){let R=n.getKeyPageBelow(t.focusedKey);R!=null&&(D.preventDefault(),V(R))}break;case"PageUp":if(n.getKeyPageAbove&&t.focusedKey!=null){let R=n.getKeyPageAbove(t.focusedKey);R!=null&&(D.preventDefault(),V(R))}break;case"a":kn(D)&&t.selectionMode==="multiple"&&l!==!0&&(D.preventDefault(),t.selectAll());break;case"Escape":c==="clearSelection"&&!i&&t.selectedKeys.size!==0&&(D.stopPropagation(),D.preventDefault(),t.clearSelection());break;case"Tab":if(!p){if(D.shiftKey)o.current.focus();else{let R=Pu(o.current,{tabbable:!0}),M,Z;do Z=R.lastChild(),Z&&(M=Z);while(Z);let I=It();M&&(!Zp(M)||I&&!eu(I))&&Pt(M)}break}}},h=E.useRef({top:0,left:0});Cr(f,"scroll",()=>{h.current={top:f.current?.scrollTop??0,left:f.current?.scrollLeft??0}});let N=D=>{if(t.isFocused){ye(D.currentTarget,me(D))||t.setFocused(!1);return}if(ye(D.currentTarget,me(D))){if(t.setFocused(!0),t.focusedKey==null){let V=M=>{M!=null&&(t.setFocusedKey(M),d&&!t.isSelected(M)&&t.replaceSelection(M))},R=D.relatedTarget;R&&D.currentTarget.compareDocumentPosition(R)&Node.DOCUMENT_POSITION_FOLLOWING?V(t.lastSelectedKey??n.getLastKey?.()):V(t.firstSelectedKey??n.getFirstKey?.())}else f.current&&(f.current.scrollTop=h.current.top,f.current.scrollLeft=h.current.left);if(t.focusedKey!=null&&f.current){let V=Us(o,t.focusedKey);V instanceof HTMLElement&&(!Zp(V)&&!m&&Pt(V),Hs()==="keyboard"&&Ku(V,{containingElement:o.current}))}}},w=D=>{ye(D.currentTarget,D.relatedTarget)||t.setFocused(!1)},T=E.useRef(!1);Cr(o,Ew,m?D=>{let{detail:V}=D;D.stopPropagation(),t.setFocused(!0),V?.focusStrategy==="first"&&(T.current=!0)}:void 0),Hu(()=>{if(T.current){let D=n.getFirstKey?.()??null;if(D==null){let V=It();gu(o.current),hu(V,null),t.collection.size>0&&(T.current=!1)}else t.setFocusedKey(D),T.current=!1}},[t.collection]),Hu(()=>{t.collection.size>0&&(T.current=!1)},[t.focusedKey]),Cr(o,yw,m?D=>{D.stopPropagation(),t.setFocused(!1),D.detail?.clearFocusKey&&t.setFocusedKey(null)}:void 0);const L=E.useRef(a),A=E.useRef(!1);E.useEffect(()=>{if(L.current){let D=null;a==="first"&&(D=n.getFirstKey?.()??null),a==="last"&&(D=n.getLastKey?.()??null);let V=t.selectedKeys;if(V.size){for(let R of V)if(t.canSelectItem(R)){D=R;break}}t.setFocused(!0),t.setFocusedKey(D),D==null&&!m&&o.current&&yr(o.current),t.collection.size>0&&(L.current=!1,A.current=!0)}});let B=E.useRef(t.focusedKey),P=E.useRef(null);E.useEffect(()=>{if(t.isFocused&&t.focusedKey!=null&&(t.focusedKey!==B.current||A.current)&&f.current&&o.current){let D=Hs(),V=Us(o,t.focusedKey);if(!(V instanceof HTMLElement))return;(D==="keyboard"||A.current)&&(P.current&&cancelAnimationFrame(P.current),P.current=requestAnimationFrame(()=>{f.current&&(ei(f.current,V),D!=="virtual"&&Ku(V,{containingElement:o.current}))}))}!m&&t.isFocused&&t.focusedKey==null&&B.current!=null&&o.current&&yr(o.current),B.current=t.focusedKey,A.current=!1}),E.useEffect(()=>()=>{P.current&&cancelAnimationFrame(P.current)},[]),Cr(o,"react-aria-focus-scope-restore",D=>{D.preventDefault(),t.setFocused(!0)});let O={onKeyDown:b,onFocus:N,onBlur:w,onMouseDown(D){f.current===me(D)&&D.preventDefault()}},{typeSelectProps:U}=Cw({keyboardDelegate:n,selectionManager:t});u||(O=dt(U,O));let X;m||(X=t.focusedKey==null?0:-1);let K=GT(t.collection);return{collectionProps:dt(O,{tabIndex:X,"data-collection":K})}}function Iw(e,t,n){let{orientation:o="horizontal",keyboardActivation:a="automatic"}=e,{collection:s,selectionManager:i,disabledKeys:l}=t,{direction:c}=$u(),d=E.useMemo(()=>new fw(s,c,o,l),[s,l,o,c]),{collectionProps:u}=Nw({ref:n,selectionManager:i,keyboardDelegate:d,selectOnFocus:a==="automatic",disallowEmptySelection:!0,scrollRef:n,linkBehavior:"selection"}),m=mr();Yp.set(t,m);let p=Ou({...e,id:m});return{tabListProps:{...dt(u,p),role:"tablist","aria-orientation":o,tabIndex:void 0}}}function Wu({item:e,state:t}){const{key:n}=e,o=r.useRef(null),{tabProps:a}=iw({key:n},t,o),s=t.selectedKey===n,i=t.disabledKeys.has(n);return r.createElement("div",{...a,ref:o,className:$("sps-nav__item","sps-nav__link",s&&"active",i&&"sps-nav__item--disabled")},e.rendered)}function Gu({state:e,...t}){const n=r.useRef(null),{tabPanelProps:o}=mw(t,e,n);return r.createElement("div",{...o,ref:n,className:"sps-card__body"},e.selectedItem?e.selectedItem.props.children:null)}class Uu{constructor(t){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=t;let n=i=>{if(this.keyMap.set(i.key,i),i.childNodes&&i.type==="section")for(let l of i.childNodes)n(l)};for(let i of t)n(i);let o=null,a=0,s=0;for(let[i,l]of this.keyMap)o?(o.nextKey=i,l.prevKey=o.key):(this.firstKey=i,l.prevKey=void 0),l.type==="item"&&(l.index=a++),(l.type==="section"||l.type==="item")&&s++,o=l,o.nextKey=void 0;this._size=s,this.lastKey=o?.key??null}*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let n=this.keyMap.get(t);return n?n.prevKey??null:null}getKeyAfter(t){let n=this.keyMap.get(t);return n?n.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){return this.keyMap.get(t)??null}at(t){const n=[...this.getKeys()];return this.getItem(n[t])}getChildren(t){return this.keyMap.get(t)?.childNodes||[]}}class vt extends Set{constructor(t,n,o){super(t),t instanceof vt?(this.anchorKey=n??t.anchorKey,this.currentKey=o??t.currentKey):(this.anchorKey=n??null,this.currentKey=o??null)}}const xw=typeof document<"u"?E.useInsertionEffect??E.useLayoutEffect:()=>{};function zu(e,t,n){let[o,a]=E.useState(e||t),s=E.useRef(o),i=E.useRef(e!==void 0),l=e!==void 0;E.useEffect(()=>{let m=i.current;m!==l&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${m?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}.`),i.current=l},[l]);let c=l?e:o;xw(()=>{s.current=c});let[,d]=E.useReducer(()=>({}),{}),u=E.useCallback((m,...p)=>{let f=typeof m=="function"?m(s.current):m;Object.is(s.current,f)||(s.current=f,a(f),d(),n?.(f,...p))},[n]);return[c,u]}function kw(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Mw(e){let{selectionMode:t="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:o,selectionBehavior:a="toggle",disabledBehavior:s="all"}=e,i=E.useRef(!1),[,l]=E.useState(!1),c=E.useRef(null),d=E.useRef(null),[,u]=E.useState(null),m=E.useMemo(()=>ju(e.selectedKeys),[e.selectedKeys]),p=E.useMemo(()=>ju(e.defaultSelectedKeys,new vt),[e.defaultSelectedKeys]),[f,g]=zu(m,p,e.onSelectionChange),y=E.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),[v,b]=E.useState(a);a==="replace"&&v==="toggle"&&typeof f=="object"&&f.size===0&&b("replace");let h=E.useRef(a);return E.useEffect(()=>{a!==h.current&&(b(a),h.current=a)},[a]),{selectionMode:t,disallowEmptySelection:n,selectionBehavior:v,setSelectionBehavior:b,get isFocused(){return i.current},setFocused(N){i.current=N,l(N)},get focusedKey(){return c.current},get childFocusStrategy(){return d.current},setFocusedKey(N,w="first"){c.current=N,d.current=w,u(N)},selectedKeys:f,setSelectedKeys(N){(o||!kw(N,f))&&g(N)},disabledKeys:y,disabledBehavior:s}}function ju(e,t){return e?e==="all"?"all":new vt(e):t}function Lw(e,t){return typeof t.getChildren=="function"?t.getChildren(e.key):e.childNodes}function _w(e){return Pw(e)}function Pw(e,t){for(let n of e)return n}function ti(e,t,n){if(t.parentKey===n.parentKey)return t.index-n.index;let o=[...Yu(e,t),t],a=[...Yu(e,n),n],s=o.slice(0,a.length).findIndex((i,l)=>i!==a[l]);return s!==-1?(t=o[s],n=a[s],t.index-n.index):o.findIndex(i=>i===n)>=0?1:(a.findIndex(i=>i===t)>=0,-1)}function Yu(e,t){let n=[],o=t;for(;o?.parentKey!=null;)o=e.getItem(o.parentKey),o&&n.unshift(o);return n}class ni{constructor(t,n,o){this.collection=t,this.state=n,this.allowsCellSelection=o?.allowsCellSelection??!1,this._isSelectAll=null,this.layoutDelegate=o?.layoutDelegate||null,this.fullCollection=o?.fullCollection||null}get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(t){this.state.setSelectionBehavior(t)}get isFocused(){return this.state.isFocused}setFocused(t){this.state.setFocused(t)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(t,n){(t==null||this.collection.getItem(t))&&this.state.setFocusedKey(t,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(t){if(this.state.selectionMode==="none")return!1;let n=this.getKey(t);return n==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let t=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=t.every(o=>n.has(o)),this._isSelectAll}get firstSelectedKey(){let t=null;for(let n of this.state.selectedKeys){let o=this.collection.getItem(n);(!t||o&&ti(this.collection,o,t)<0)&&(t=o)}return t?.key??null}get lastSelectedKey(){let t=null;for(let n of this.state.selectedKeys){let o=this.collection.getItem(n);(!t||o&&ti(this.collection,o,t)>0)&&(t=o)}return t?.key??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(t){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(t);return}let n=this.getKey(t);if(n==null)return;let o;if(this.state.selectedKeys==="all")o=new vt([n],n,n);else{let a=this.state.selectedKeys,s=a.anchorKey??n;o=new vt(a,s,n);for(let i of this.getKeyRange(s,a.currentKey??n))o.delete(i);for(let i of this.getKeyRange(n,s))this.canSelectItem(i)&&o.add(i)}this.state.setSelectedKeys(o)}getKeyRange(t,n){let o=this.collection.getItem(t),a=this.collection.getItem(n);return o&&a?ti(this.collection,o,a)<=0?this.getKeyRangeInternal(t,n):this.getKeyRangeInternal(n,t):[]}getKeyRangeInternal(t,n){if(this.layoutDelegate?.getKeyRange)return this.layoutDelegate.getKeyRange(t,n);let o=[],a=t;for(;a!=null;){let s=this.collection.getItem(a);if(s&&(s.type==="item"||s.type==="cell"&&this.allowsCellSelection)&&o.push(a),a===n)return o;a=this.collection.getKeyAfter(a)}return[]}getKey(t){let n=this.collection.getItem(t);if(!n||n.type==="cell"&&this.allowsCellSelection)return t;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return!n||n.type!=="item"?null:n.key}toggleSelection(t){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(t)){this.replaceSelection(t);return}let n=this.getKey(t);if(n==null)return;let o=new vt(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);o.has(n)?o.delete(n):this.canSelectItem(n)&&(o.add(n),o.anchorKey=n,o.currentKey=n),!(this.disallowEmptySelection&&o.size===0)&&this.state.setSelectedKeys(o)}replaceSelection(t){if(this.selectionMode==="none")return;let n=this.getKey(t);if(n==null)return;let o=this.canSelectItem(n)?new vt([n],n,n):new vt;this.state.setSelectedKeys(o)}setSelectedKeys(t){if(this.selectionMode==="none")return;let n=new vt;for(let o of t){let a=this.getKey(o);if(a!=null&&(n.add(a),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let t=this.fullCollection??this.collection,n=[],o=a=>{for(;a!=null;){if(this.canSelectItemIn(a,t)){let s=t.getItem(a);s?.type==="item"&&n.push(a),s?.hasChildNodes&&(this.allowsCellSelection||s.type!=="item")&&o(_w(Lw(s,t))?.key??null)}a=t.getKeyAfter(a)}};return o(t.getFirstKey()),n}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new vt)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(t,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(t)&&!this.disallowEmptySelection?this.toggleSelection(t):this.replaceSelection(t):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(t):this.replaceSelection(t))}isSelectionEqual(t){if(t===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(t.size!==n.size)return!1;for(let o of t)if(!n.has(o))return!1;for(let o of n)if(!t.has(o))return!1;return!0}canSelectItem(t){return this.canSelectItemIn(t,this.collection)}canSelectItemIn(t,n){if(this.state.selectionMode==="none"||this.state.disabledKeys.has(t))return!1;let o=n.getItem(t);return!(!o||o?.props?.isDisabled||o.type==="cell"&&!this.allowsCellSelection)}isDisabled(t){return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(t)||!!this.collection.getItem(t)?.props?.isDisabled)}isLink(t){return!!this.collection.getItem(t)?.props?.href}getItemProps(t){return this.collection.getItem(t)?.props}withCollection(t){return new ni(t,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0,fullCollection:this.fullCollection??this.collection})}}class Bw{build(t,n){return this.context=n,qu(()=>this.iterateCollection(t))}*iterateCollection(t){let{children:n,items:o}=t;if(E.isValidElement(n)&&n.type===E.Fragment)yield*this.iterateCollection({children:n.props.children,items:o});else if(typeof n=="function"){if(!o)throw new Error("props.children was a function but props.items is missing");let a=0;for(let s of o)yield*this.getFullNode({value:s,index:a},{renderer:n}),a++}else{let a=[];E.Children.forEach(n,i=>{i&&a.push(i)});let s=0;for(let i of a){let l=this.getFullNode({element:i,index:s},{});for(let c of l)s++,yield c}}}getKey(t,n,o,a){if(t.key!=null)return t.key;if(n.type==="cell"&&n.key!=null)return`${a}${n.key}`;let s=n.value;if(s!=null){let i=s.key??s.id;if(i==null)throw new Error("No key found for item");return i}return a?`${a}.${n.index}`:`$.${n.index}`}getChildState(t,n){return{renderer:n.renderer||t.renderer}}*getFullNode(t,n,o,a){if(E.isValidElement(t.element)&&t.element.type===E.Fragment){let c=[];E.Children.forEach(t.element.props.children,u=>{c.push(u)});let d=t.index??0;for(const u of c)yield*this.getFullNode({element:u,index:d++},n,o,a);return}let s=t.element;if(!s&&t.value&&n&&n.renderer){let c=this.cache.get(t.value);if(c&&(!c.shouldInvalidate||!c.shouldInvalidate(this.context))){c.index=t.index,c.parentKey=a?a.key:null,yield c;return}s=n.renderer(t.value)}if(E.isValidElement(s)){let c=s.type;if(typeof c!="function"&&typeof c.getCollectionNode!="function"){let p=s.type;throw new Error(`Unknown element <${p}> in collection.`)}let d=c.getCollectionNode(s.props,this.context),u=t.index??0,m=d.next();for(;!m.done&&m.value;){let p=m.value;t.index=u;let f=p.key??null;f==null&&(f=p.element?null:this.getKey(s,t,n,o));let y=[...this.getFullNode({...p,key:f,index:u,wrapper:Ow(t.wrapper,p.wrapper)},this.getChildState(n,p),o?`${o}${s.key}`:s.key,a)];for(let v of y){if(v.value=p.value??t.value??null,v.value&&this.cache.set(v.value,v),t.type&&v.type!==t.type)throw new Error(`Unsupported type <${oi(v.type)}> in <${oi(a?.type??"unknown parent type")}>. Only <${oi(t.type)}> is supported.`);u++,yield v}m=d.next(y)}return}if(t.key==null||t.type==null)return;let i=this,l={type:t.type,props:t.props,key:t.key,parentKey:a?a.key:null,value:t.value??null,level:(a?.level??0)+(a?.type==="item"?1:0),index:t.index,rendered:t.rendered,textValue:t.textValue??"","aria-label":t["aria-label"],wrapper:t.wrapper,shouldInvalidate:t.shouldInvalidate,hasChildNodes:t.hasChildNodes||!1,childNodes:qu(function*(){if(!t.hasChildNodes||!t.childNodes)return;let c=0;for(let d of t.childNodes()){d.key!=null&&(d.key=`${l.key}${d.key}`);let u=i.getFullNode({...d,index:c},i.getChildState(n,d),l.key,l);for(let m of u)c++,yield m}})};yield l}constructor(){this.cache=new WeakMap}}function qu(e){let t=[],n=null;return{*[Symbol.iterator](){for(let o of t)yield o;n||(n=e());for(let o of n)t.push(o),yield o}}}function Ow(e,t){if(e&&t)return n=>e(t(n));if(e)return e;if(t)return t}function oi(e){return e[0].toUpperCase()+e.slice(1)}function Rw(e,t,n){let o=E.useMemo(()=>new Bw,[]),{children:a,items:s,collection:i}=e;return E.useMemo(()=>{if(i)return i;let c=o.build({children:a,items:s},n);return t(c)},[o,a,s,i,n,t])}function Fw(e){let{filter:t,layoutDelegate:n}=e,o=Mw(e),a=E.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),s=E.useCallback(d=>t?new Uu(t(d)):new Uu(d),[t]),i=E.useMemo(()=>({suppressTextValueWarning:e.suppressTextValueWarning}),[e.suppressTextValueWarning]),l=Rw(e,s,i),c=E.useMemo(()=>new ni(l,o,{layoutDelegate:n}),[l,o,n]);return Aw(l,c),{collection:l,disabledKeys:a,selectionManager:c}}function Aw(e,t){const n=E.useRef(null);E.useEffect(()=>{if(t.focusedKey!=null&&!e.getItem(t.focusedKey)&&n.current){let o=n.current.getKeyAfter(t.focusedKey),a=null;for(;o!=null;){let s=e.getItem(o);if(s&&s.type==="item"&&!t.isDisabled(o)){a=o;break}o=n.current.getKeyAfter(o)}if(a==null)for(o=n.current.getKeyBefore(t.focusedKey);o!=null;){let s=e.getItem(o);if(s&&s.type==="item"&&!t.isDisabled(o)){a=o;break}o=n.current.getKeyBefore(o)}t.setFocusedKey(a)}n.current=e},[e,t])}function $w(e){let[t,n]=zu(e.selectedKey,e.defaultSelectedKey??null,e.onSelectionChange),o=E.useMemo(()=>t!=null?[t]:[],[t]),{collection:a,disabledKeys:s,selectionManager:i}=Fw({...e,selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:o,onSelectionChange:c=>{if(c==="all")return;let d=c.values().next().value??null;d===t&&e.onSelectionChange&&e.onSelectionChange(d),n(d)}}),l=t!=null?a.getItem(t):null;return{collection:a,disabledKeys:s,selectionManager:i,selectedKey:t,setSelectedKey:n,selectedItem:l}}function Vw(e){let t=$w({...e,onSelectionChange:e.onSelectionChange?i=>{i!=null&&e.onSelectionChange?.(i)}:void 0,suppressTextValueWarning:!0,defaultSelectedKey:e.defaultSelectedKey??Ju(e.collection,e.disabledKeys?new Set(e.disabledKeys):new Set)??void 0}),{selectionManager:n,collection:o,selectedKey:a}=t,s=E.useRef(a);return E.useEffect(()=>{let i=a;e.selectedKey==null&&(n.isEmpty||i==null||!o.getItem(i))&&(i=Ju(o,t.disabledKeys),i!=null&&n.setSelectedKeys([i])),(i!=null&&n.focusedKey==null||!n.isFocused&&i!==s.current)&&n.setFocusedKey(i),s.current=i}),{...t,isDisabled:e.isDisabled||!1}}function Ju(e,t){let n=null;if(e){for(n=e.getFirstKey();n!=null&&(t.has(n)||e.getItem(n)?.props?.isDisabled)&&n!==e.getLastKey();)n=e.getKeyAfter(n);n!=null&&(t.has(n)||e.getItem(n)?.props?.isDisabled)&&n===e.getLastKey()&&(n=e.getFirstKey())}return n}const Kw={},Hw={};function ri(e){const{selectedKey:t,defaultSelectedKey:n,...o}=e,a={...o,selectedKey:t??void 0,defaultSelectedKey:n??void 0},s=Vw(a),i=r.useRef(null),{tabListProps:l}=Iw(a,s,i);return r.createElement(r.Fragment,null,r.createElement("div",{...l,ref:i,className:"sps-nav sps-nav--tabs sps-tabs-v2"},[...s.collection].map(c=>r.createElement(Wu,{key:c.key,item:c,state:s}))),r.createElement(Gu,{key:s.selectedItem?s.selectedItem.key:null,state:s}))}Object.assign(ri,{props:Kw,propTypes:Hw,displayName:"SpsTabsV2"});const Ww={};function ai({children:e,className:t,...n}){return r.createElement("div",{className:$("sps-card__footer",t),...n},e)}Object.assign(ai,{props:Ww,displayName:"SpsCardV2Footer"});const Gw={};function si({children:e,className:t,...n}){return r.createElement("div",{className:$("sps-card__header",t),...n},e)}Object.assign(si,{props:Gw,displayName:"SpsCardV2Header"});const Uw={};function Xu({children:e,className:t,...n}){const[o,a,s,i,l]=at(e,[{type:si},{type:ri},{type:xm.Tabs},{type:ai}]),c=a.length>0?a:s;return r.createElement("div",{className:$("sps-card",t),...n},o,c.length>0?c:r.createElement("div",{className:"sps-card__body"},l),i)}Object.assign(Xu,{props:Uw,displayName:"SpsCardV2"});const zw={};function Zu({children:e,className:t,...n}){return r.createElement("div",{className:$("sps-card__title",t),...n},e)}Object.assign(Zu,{props:zw,displayName:"SpsCardV2Title"});const jw={...md,controlsDisabled:"boolean",footerLinks:"ReactNodeOrRenderFn",formMeta:"SpsFormSetMeta<any>",isOpen:"boolean",onClear:"() => void",onSubmit:"React.FormEventHandler"};function Qu(e){const{children:t,className:n,controlsDisabled:o,footerLinks:a,formArray:s,formGroup:i,formMeta:l,isOpen:c,onClear:d,onSubmit:u,unsafelyReplaceClassName:m,...p}=e,{t:f}=he.useWoodlandLanguage();function g(){d&&d()}const y=$(m||"sps-advanced-search",c&&"sps-advanced-search--open",n);return r.createElement("div",{className:y,...p},r.createElement(ro,{onSubmit:u,formArray:s,formGroup:i,formMeta:l},r.createElement("div",{className:"sps-advanced-search__form"},t),r.createElement("div",{className:"sps-advanced-search__footer"},a&&r.createElement("div",{id:"footer_links"},qe(a)),r.createElement("div",{className:"sps-advanced-search__footer-controls"},r.createElement(Ne,{kind:F.ButtonKind.DEFAULT,type:F.ButtonType.BUTTON,className:"mr-2",onClick:g,disabled:o},f("advancedSearch.clear")),r.createElement(Ne,{kind:F.ButtonKind.KEY,type:F.ButtonType.SUBMIT,disabled:o},f("advancedSearch.search"))))))}Object.assign(Qu,{props:jw,displayName:"SpsAdvancedSearch"});const Yw={general:{label:"General Usage",description:({NavigateTo:e,Link:t})=>r.createElement(r.Fragment,null,r.createElement("p",null,'Advanced Search is comprised of a panel of input fields, and a text button that exposes and hides the panel. By default, the Advanced Search panel is hidden (with the exception of "Advanced Search Only" scenarios).'),r.createElement("p",null,"Advanced Search works in conjunction with the"," ",r.createElement(e,{to:"list-toolbar"},"List Bar")," and"," ",r.createElement(e,{to:"search-results-bar"},"Search Results")," components. Refer to those pages for additional details."),r.createElement("p",null,"Use the following guidelines when including Advanced Search on your page:",r.createElement("ul",null,r.createElement("li",null,"The Advanced Search Panel can contain any number of input fields."),r.createElement("li",null,"The Advanced Search Panel can place input fields in any unique layout to best serve the needs of the search criteria, but must adhere to the rules of the"," ",r.createElement(t,{to:"/style-and-layout/grid/"},"SPS Grid")," and guidelines for"," ",r.createElement(e,{to:"form"},"Form Layouts"),"."))))},basic:{label:"Basic Usage",description:({NavigateTo:e})=>r.createElement(r.Fragment,null,r.createElement("p",null,"A Basic Advanced Search consists of the List Bar with a search input and an Advanced Search text button. For more details on additional button and component options in the List Bar reference the ",r.createElement(e,{to:"list-toolbar"},"List Bar")," page.")),examples:{basic:{react:S.code`
9835
+ `.trim(),D.head.prepend(V)},[p]),E.useEffect(()=>{let D=v.current;return()=>{m||js(D.target??void 0);for(let V of D.disposables)V();D.disposables=[]}},[m]),{isPressed:c||g,pressProps:dt(f,K,{[Cu]:!0})}}function qs(e){return e.tagName==="A"&&e.hasAttribute("href")}function Js(e,t){const{key:n,code:o}=e,a=t,s=a.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||o==="Space")&&!(a instanceof pt(a).HTMLInputElement&&!ku(a,n)||a instanceof pt(a).HTMLTextAreaElement||a.isContentEditable)&&!((s==="link"||!s&&qs(a))&&n!=="Enter")}function XT(e){const{targetTouches:t}=e;return t.length>0?t[0]:null}function Nu(e,t){const n=e.changedTouches;for(let o=0;o<n.length;o++){const a=n[o];if(a.identifier===t)return a}return null}function zt(e,t){let n=0,o=0;return t.targetTouches&&t.targetTouches.length===1&&(n=t.targetTouches[0].clientX,o=t.targetTouches[0].clientY),{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:o}}function dn(e,t){let n=t.clientX,o=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:o,key:t.key}}function ZT(e){let t=0,n=0;return e.width!==void 0?t=e.width/2:e.radiusX!==void 0&&(t=e.radiusX),e.height!==void 0?n=e.height/2:e.radiusY!==void 0&&(n=e.radiusY),{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function QT(e,t){return!(e.left>t.right||t.left>e.right||e.top>t.bottom||t.top>e.bottom)}function Iu(e,t){let n=t.getBoundingClientRect(),o=ZT(e);return QT(n,o)}function ew(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!=="submit"&&e.type!=="reset":!qs(e)}function xu(e,t){return e instanceof HTMLInputElement?!ku(e,t):ew(e)}const tw=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function ku(e,t){return e.type==="checkbox"||e.type==="radio"?t===" ":tw.has(e.type)}let nw=0;const Xs=new Map;function ow(e){let[t,n]=E.useState();return Gt(()=>{if(!e)return;let o=Xs.get(e);if(o)n(o.element.id);else{let a=`react-aria-description-${nw++}`;n(a);let s=document.createElement("div");s.id=a,s.style.display="none",s.textContent=e,document.body.appendChild(s),o={refCount:0,element:s},Xs.set(e,o)}return o.refCount++,()=>{o&&--o.refCount===0&&(o.element.remove(),Xs.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}const rw=500;function aw(e){let{isDisabled:t,onLongPressStart:n,onLongPressEnd:o,onLongPress:a,threshold:s=rw,accessibilityDescription:i}=e;const l=E.useRef(void 0);let{addGlobalListener:c,removeGlobalListener:d}=Eu(),{pressProps:u}=Du({isDisabled:t,onPressStart(p){if(p.continuePropagation(),(p.pointerType==="mouse"||p.pointerType==="touch")&&(n&&n({...p,type:"longpressstart"}),l.current=setTimeout(()=>{p.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),Re(p.target).activeElement!==p.target&&Pt(p.target),a&&a({...p,type:"longpress"}),l.current=void 0},s),p.pointerType==="touch")){let f=y=>{y.preventDefault()},g=pt(p.target);c(p.target,"contextmenu",f,{once:!0}),c(g,"pointerup",()=>{setTimeout(()=>{d(p.target,"contextmenu",f)},30)},{once:!0})}},onPressEnd(p){l.current&&clearTimeout(l.current),o&&(p.pointerType==="mouse"||p.pointerType==="touch")&&o({...p,type:"longpressend"})}}),m=ow(a&&!t?i:void 0);return{longPressProps:dt(u,m)}}function sw(e){let{id:t,selectionManager:n,key:o,ref:a,shouldSelectOnPressUp:s,shouldUseVirtualFocus:i,focus:l,isDisabled:c,onAction:d,allowsDifferentPressOrigin:u,linkBehavior:m="action"}=e,p=$s();t=mr(t);let f=C=>{if(C.pointerType==="keyboard"&&Gs(C))n.toggleSelection(o);else{if(n.selectionMode==="none")return;if(n.isLink(o)){if(m==="selection"&&a.current){let k=n.getItemProps(o);p.open(a.current,C,k.href,k.routerOptions),n.setSelectedKeys(n.selectedKeys);return}else if(m==="override"||m==="none")return}n.selectionMode==="single"?n.isSelected(o)&&!n.disallowEmptySelection?n.toggleSelection(o):n.replaceSelection(o):C&&C.shiftKey?n.extendSelection(o):n.selectionBehavior==="toggle"||C&&(kn(C)||C.pointerType==="touch"||C.pointerType==="virtual")?n.toggleSelection(o):n.replaceSelection(o)}};E.useEffect(()=>{o===n.focusedKey&&n.isFocused&&(i?gu(a.current):l?l():It()!==a.current&&a.current&&yr(a.current))},[a,o,n.focusedKey,n.childFocusStrategy,n.isFocused,i]),c=c||n.isDisabled(o);let g={};!i&&!c?g={tabIndex:o===n.focusedKey?0:-1,onFocus(C){me(C)===a.current&&n.setFocusedKey(o)}}:c&&(g.onMouseDown=C=>{C.preventDefault()}),E.useEffect(()=>{c&&n.focusedKey===o&&n.setFocusedKey(null)},[n,c,o]);let y=n.isLink(o)&&m==="override",v=d&&e.UNSTABLE_itemBehavior==="action",b=n.isLink(o)&&m!=="selection"&&m!=="none",h=!c&&n.canSelectItem(o)&&!y&&!v,N=(d||b)&&!c,w=N&&(n.selectionBehavior==="replace"?!h:!h||n.isEmpty),T=N&&h&&n.selectionBehavior==="replace",L=w||T,A=E.useRef(null),B=L&&h,P=E.useRef(!1),O=E.useRef(!1),U=n.getItemProps(o),X=C=>{d&&(d(),a.current?.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))),b&&a.current&&p.open(a.current,C,U.href,U.routerOptions)},K={ref:a};if(s?(K.onPressStart=C=>{A.current=C.pointerType,P.current=B,C.pointerType==="keyboard"&&(!L||Lu(C.key))&&f(C)},u?(K.onPressUp=w?void 0:C=>{C.pointerType==="mouse"&&h&&f(C)},K.onPress=w?X:C=>{C.pointerType!=="keyboard"&&C.pointerType!=="mouse"&&h&&f(C)}):K.onPress=C=>{if(w||T&&C.pointerType!=="mouse"){if(C.pointerType==="keyboard"&&!Mu(C.key))return;X(C)}else C.pointerType!=="keyboard"&&h&&f(C)}):(K.onPressStart=C=>{A.current=C.pointerType,P.current=B,O.current=w,h&&(C.pointerType==="mouse"&&!w||C.pointerType==="keyboard"&&(!N||Lu(C.key)))&&f(C)},K.onPress=C=>{(C.pointerType==="touch"||C.pointerType==="pen"||C.pointerType==="virtual"||C.pointerType==="keyboard"&&L&&Mu(C.key)||C.pointerType==="mouse"&&O.current)&&(L?X(C):h&&f(C))}),g["data-collection"]=UT(n.collection),g["data-key"]=o,K.preventFocusOnPress=i,i&&(K=dt(K,{onPressStart(C){C.pointerType!=="touch"&&(n.setFocused(!0),n.setFocusedKey(o))},onPress(C){C.pointerType==="touch"&&(n.setFocused(!0),n.setFocusedKey(o))}})),U)for(let C of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])U[C]&&(K[C]=Ps(K[C],U[C]));let{pressProps:D,isPressed:V}=Du(K),R=T?C=>{A.current==="mouse"&&(C.stopPropagation(),C.preventDefault(),X(C))}:void 0,{longPressProps:M}=aw({isDisabled:!B,onLongPress(C){C.pointerType==="touch"&&(f(C),n.setSelectionBehavior("toggle"))}}),Z=C=>{A.current==="touch"&&P.current&&C.preventDefault()},I=m!=="none"&&n.isLink(o)?C=>{Ot.isOpening||C.preventDefault()}:void 0;return{itemProps:dt(g,h||w||i&&!c?D:{},B?M:{},{onDoubleClick:R,onDragStartCapture:Z,onClick:I,id:t},i?{onMouseDown:C=>C.preventDefault()}:void 0),isPressed:V,isSelected:n.isSelected(o),isFocused:n.isFocused&&n.focusedKey===o,isDisabled:c,allowsSelection:h,hasAction:L}}function Mu(e){return e==="Enter"}function Lu(e){return e===" "}function iw(e,t,n){let{key:o,isDisabled:a,shouldSelectOnPressUp:s}=e,{selectionManager:i,selectedKey:l}=t,c=o===l,d=a||t.isDisabled||t.selectionManager.isDisabled(o),u=t.collection.getItem(o),{itemProps:m,isPressed:p}=sw({selectionManager:i,key:o,ref:n,isDisabled:d,shouldSelectOnPressUp:s??u?.props.href!=null,linkBehavior:"selection"}),f=pr(t,o,"tab"),g=pr(t,o,"tabpanel"),{tabIndex:y}=m,v=QE(u?.props,{labelable:!0});delete v.id;let b=BT(u?.props),{focusableProps:h}=WT({...u?.props,isDisabled:d},n);return{tabProps:dt(v,h,b,m,{id:f,"aria-selected":c,"aria-disabled":d||void 0,"aria-controls":c?g:void 0,tabIndex:d?void 0:y,role:"tab"}),isSelected:c,isDisabled:d,isPressed:p}}class lw{constructor(t,n,o,a){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=i=>{if(i.nodeType===Node.ELEMENT_NODE){const l=i.shadowRoot;if(l){const c=this._doc.createTreeWalker(l,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(c),NodeFilter.FILTER_ACCEPT}else{if(typeof this.filter=="function")return this.filter(i);if(this.filter?.acceptNode)return this.filter.acceptNode(i);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=t,this.root=n,this.filter=a??null,this.whatToShow=o??NodeFilter.SHOW_ALL,this._currentNode=n,this._walkerStack.unshift(t.createTreeWalker(n,o,this._acceptNode));const s=n.shadowRoot;if(s){const i=this._doc.createTreeWalker(s,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(i)}}get currentNode(){return this._currentNode}set currentNode(t){if(!ye(this.root,t))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const n=[];let o=t,a=t;for(this._currentNode=t;o&&o!==this.root;)if(o.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const i=o,l=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});n.push(l),l.currentNode=a,this._currentSetFor.add(l),o=a=i.host}else o=o.parentNode;const s=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});n.push(s),s.currentNode=a,this._currentSetFor.add(s),this._walkerStack=n}get doc(){return this._doc}firstChild(){let t=this.currentNode,n=this.nextNode();return ye(t,n)?(n&&(this.currentNode=n),n):(this.currentNode=t,null)}lastChild(){let n=this._walkerStack[0].lastChild();return n&&(this.currentNode=n),n}nextNode(){const t=this._walkerStack[0].nextNode();if(t){if(t.shadowRoot){let o;if(typeof this.filter=="function"?o=this.filter(t):this.filter?.acceptNode&&(o=this.filter.acceptNode(t)),o===NodeFilter.FILTER_ACCEPT)return this.currentNode=t,t;let a=this.nextNode();return a&&(this.currentNode=a),a}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let n=this.nextNode();return n&&(this.currentNode=n),n}else return null}previousNode(){const t=this._walkerStack[0];if(t.currentNode===t.root){if(this._currentSetFor.has(t))if(this._currentSetFor.delete(t),this._walkerStack.length>1){this._walkerStack.shift();let o=this.previousNode();return o&&(this.currentNode=o),o}else return null;return null}const n=t.previousNode();if(n){if(n.shadowRoot){let a;if(typeof this.filter=="function"?a=this.filter(n):this.filter?.acceptNode&&(a=this.filter.acceptNode(n)),a===NodeFilter.FILTER_ACCEPT)return n&&(this.currentNode=n),n;let s=this.lastChild();return s&&(this.currentNode=s),s}return n&&(this.currentNode=n),n}else if(this._walkerStack.length>1){this._walkerStack.shift();let o=this.previousNode();return o&&(this.currentNode=o),o}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}}function cw(e,t,n,o){return Sr()?new lw(e,t,n,o):e.createTreeWalker(t,n,o)}function dw(e){if(!e.form)return Array.from(Re(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(o=>!o.form);const t=e.form.elements.namedItem(e.name);let n=pt(e);return t instanceof n.RadioNodeList?Array.from(t).filter(o=>o instanceof n.HTMLInputElement):t instanceof n.HTMLInputElement?[t]:[]}function pw(e){if(e.checked)return!0;const t=dw(e);return t.length>0&&!t.some(n=>n.checked)}function _u(e,t){return!e||!t?!1:t.some(n=>ye(n,e))}function Pu(e,t,n){let o=t?.tabbable?eu:Qp,a=e?.nodeType===Node.ELEMENT_NODE?e:null,s=Re(a),i=cw(s,e||s,NodeFilter.SHOW_ELEMENT,{acceptNode(l){return ye(t?.from,l)||t?.tabbable&&l.tagName==="INPUT"&&l.getAttribute("type")==="radio"&&(!pw(l)||i.currentNode.tagName==="INPUT"&&i.currentNode.type==="radio"&&i.currentNode.name===l.name)?NodeFilter.FILTER_REJECT:o(l)&&(!n||_u(l,n))&&(!t?.accept||t.accept(l))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(i.currentNode=t.from),i}class Zs{constructor(){this.fastMap=new Map,this.root=new Bu({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,n,o){let a=this.fastMap.get(n??null);if(!a)return;let s=new Bu({scopeRef:t});a.addChild(s),s.parent=a,this.fastMap.set(t,s),o&&(s.nodeToRestore=o)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let n=this.fastMap.get(t);if(!n)return;let o=n.parent;for(let s of this.traverse())s!==n&&n.nodeToRestore&&s.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&_u(s.nodeToRestore,n.scopeRef.current)&&(s.nodeToRestore=n.nodeToRestore);let a=n.children;o&&(o.removeChild(n),a.size>0&&a.forEach(s=>o&&o.addChild(s))),this.fastMap.delete(n.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let n of t.children)yield*this.traverse(n)}clone(){let t=new Zs;for(let n of this.traverse())t.addTreeNode(n.scopeRef,n.parent?.scopeRef??null,n.nodeToRestore);return t}}class Bu{constructor(t){this.children=new Set,this.contain=!1,this.scopeRef=t.scopeRef}addChild(t){this.children.add(t),t.parent=this}removeChild(t){this.children.delete(t),t.parent=void 0}}new Zs;function uw(e,t){let n=t?.isDisabled,[o,a]=E.useState(!1);return Gt(()=>{if(e?.current&&!n){let s=()=>{if(e.current){let l=Pu(e.current,{tabbable:!0});a(!!l.nextNode())}};s();let i=new MutationObserver(s);return i.observe(e.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{i.disconnect()}}}),n?!1:o}function Ou(e,t){let{id:n,"aria-label":o,"aria-labelledby":a}=e;return n=mr(n),a&&o?a=[...new Set([n,...a.trim().split(/\s+/)])].join(" "):a&&(a=a.trim().split(/\s+/).join(" ")),!o&&!a&&t&&(o=t),{id:n,"aria-label":o,"aria-labelledby":a}}function mw(e,t,n){let o=uw(n)?void 0:0;const a=pr(t,e.id??t?.selectedKey,"tabpanel"),s=Ou({...e,id:a,"aria-labelledby":pr(t,t?.selectedKey,"tab")});return{tabPanelProps:dt(s,{tabIndex:o,role:"tabpanel","aria-describedby":e["aria-describedby"],"aria-details":e["aria-details"]})}}class fw{constructor(t,n,o,a=new Set){this.collection=t,this.flipDirection=n==="rtl"&&o==="horizontal",this.disabledKeys=a,this.tabDirection=o==="horizontal"}getKeyLeftOf(t){return this.flipDirection?this.getNextKey(t):this.getPreviousKey(t)}getKeyRightOf(t){return this.flipDirection?this.getPreviousKey(t):this.getNextKey(t)}isDisabled(t){return this.disabledKeys.has(t)||!!this.collection.getItem(t)?.props?.isDisabled}getFirstKey(){let t=this.collection.getFirstKey();return t!=null&&this.isDisabled(t)&&(t=this.getNextKey(t)),t}getLastKey(){let t=this.collection.getLastKey();return t!=null&&this.isDisabled(t)&&(t=this.getPreviousKey(t)),t}getKeyAbove(t){return this.tabDirection?null:this.getPreviousKey(t)}getKeyBelow(t){return this.tabDirection?null:this.getNextKey(t)}getNextKey(t){let n=t;do n=this.collection.getKeyAfter(n),n==null&&(n=this.collection.getFirstKey());while(n!=null&&this.isDisabled(n));return n}getPreviousKey(t){let n=t;do n=this.collection.getKeyBefore(n),n==null&&(n=this.collection.getLastKey());while(n!=null&&this.isDisabled(n));return n}}const Sw=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),gw=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function hw(e){if(Intl.Locale){let n=new Intl.Locale(e).maximize(),o=typeof n.getTextInfo=="function"?n.getTextInfo():n.textInfo;if(o)return o.direction==="rtl";if(n.script)return Sw.has(n.script)}let t=e.split("-")[0];return gw.has(t)}const Ru=Symbol.for("react-aria.i18n.locale");function Fu(){let e=typeof window<"u"&&window[Ru]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:hw(e)?"rtl":"ltr"}}let Qs=Fu(),uo=new Set;function Au(){Qs=Fu();for(let e of uo)e(Qs)}function bw(){let e=Jp(),[t,n]=E.useState(Qs);return E.useEffect(()=>(uo.size===0&&window.addEventListener("languagechange",Au),uo.add(n),()=>{uo.delete(n),uo.size===0&&window.removeEventListener("languagechange",Au)}),[]),e?{locale:typeof window<"u"&&window[Ru]||"en-US",direction:"ltr"}:t}const vw=E.createContext(null);function $u(){let e=bw();return E.useContext(vw)||e}const yw="react-aria-clear-focus",Ew="react-aria-focus";function Tw(e,t){if(!e)return!1;let n=window.getComputedStyle(e),o=document.scrollingElement||document.documentElement,a=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return e===o&&n.overflow!=="hidden"&&(a=!0),a&&t&&(a=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),a}function Vu(e,t){let n=[],o=document.scrollingElement||document.documentElement;do Tw(e,t)&&n.push(e),e=e.parentElement;while(e&&e!==o);return n}function ei(e,t,n={}){let{block:o="nearest",inline:a="nearest"}=n;if(e===t)return;let s=e.scrollTop,i=e.scrollLeft,l=t.getBoundingClientRect(),c=e.getBoundingClientRect(),d=window.getComputedStyle(t),u=window.getComputedStyle(e),m=document.scrollingElement||document.documentElement,p=e===m?0:c.top,f=e===m?e.clientHeight:c.bottom,g=e===m?0:c.left,y=e===m?e.clientWidth:c.right,v=parseInt(d.scrollMarginTop,10)||0,b=parseInt(d.scrollMarginBottom,10)||0,h=parseInt(d.scrollMarginLeft,10)||0,N=parseInt(d.scrollMarginRight,10)||0,w=parseInt(u.scrollPaddingTop,10)||0,T=parseInt(u.scrollPaddingBottom,10)||0,L=parseInt(u.scrollPaddingLeft,10)||0,A=parseInt(u.scrollPaddingRight,10)||0,B=parseInt(u.borderTopWidth,10)||0,P=parseInt(u.borderBottomWidth,10)||0,O=parseInt(u.borderLeftWidth,10)||0,U=parseInt(u.borderRightWidth,10)||0,X=l.top-v,K=l.bottom+b,D=l.left-h,V=l.right+N,R=e===m?0:O+U,M=e===m?0:B+P,Z=e.offsetWidth-e.clientWidth-R,I=e.offsetHeight-e.clientHeight-M,C=p+B+w,k=f-P-T-I,G=g+O+L,J=y-U-A;u.direction==="rtl"&&!br()?G+=Z:J-=Z;let te=X<C||K>k,ne=D<G||V>J;if(te&&o==="start")s+=X-C;else if(te&&o==="center")s+=(X+K)/2-(C+k)/2;else if(te&&o==="end")s+=K-k;else if(te&&o==="nearest"){let H=X-C,q=K-k;s+=Math.abs(H)<=Math.abs(q)?H:q}if(ne&&a==="start")i+=D-G;else if(ne&&a==="center")i+=(D+V)/2-(G+J)/2;else if(ne&&a==="end")i+=V-J;else if(ne&&a==="nearest"){let H=D-G,q=V-J;i+=Math.abs(H)<=Math.abs(q)?H:q}if(process.env.NODE_ENV==="test"){e.scrollLeft=i,e.scrollTop=s;return}e.scrollTo({left:i,top:s})}function Ku(e,t={}){let{containingElement:n}=t;if(e&&e.isConnected){let o=document.scrollingElement||document.documentElement;if(window.getComputedStyle(o).overflow==="hidden"){let{left:s,top:i}=e.getBoundingClientRect(),l=Vu(e,!0);for(let u of l)ei(u,e);let{left:c,top:d}=e.getBoundingClientRect();if(Math.abs(s-c)>1||Math.abs(i-d)>1){l=n?Vu(n,!0):[];for(let u of l)ei(u,n,{block:"center",inline:"center"})}}else{let{left:s,top:i}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});let{left:l,top:c}=e.getBoundingClientRect();(Math.abs(s-l)>1||Math.abs(i-c)>1)&&(n?.scrollIntoView?.({block:"center",inline:"center"}),e.scrollIntoView?.({block:"nearest"}))}}}function Cr(e,t,n,o){let a=Tr(n),s=n==null;E.useEffect(()=>{if(s||!e.current)return;let i=e.current;return i.addEventListener(t,a,o),()=>{i.removeEventListener(t,a,o)}},[e,t,o,s])}const ww=1e3;function Cw(e){let{keyboardDelegate:t,selectionManager:n,onTypeSelect:o}=e,a=E.useRef({search:"",timeout:void 0}).current,s=i=>{let l=Dw(i.key);if(!(!l||i.ctrlKey||i.metaKey||!ye(i.currentTarget,me(i))||a.search.length===0&&l===" ")){if(l===" "&&a.search.trim().length>0&&(i.preventDefault(),"continuePropagation"in i||i.stopPropagation()),a.search+=l,t.getKeyForSearch!=null){let c=t.getKeyForSearch(a.search,n.focusedKey);c==null&&(c=t.getKeyForSearch(a.search)),c!=null&&(n.setFocusedKey(c),o&&o(c))}clearTimeout(a.timeout),a.timeout=setTimeout(()=>{a.search=""},ww)}};return{typeSelectProps:{onKeyDownCapture:t.getKeyForSearch?s:void 0}}}function Dw(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function Hu(e,t){const n=E.useRef(!0),o=E.useRef(null);Gt(()=>(n.current=!0,()=>{n.current=!1}),[]),Gt(()=>{n.current?n.current=!1:(!o.current||t.some((a,s)=>!Object.is(a,o[s])))&&e(),o.current=t},t)}function Nw(e){let{selectionManager:t,keyboardDelegate:n,ref:o,autoFocus:a=!1,shouldFocusWrap:s=!1,disallowEmptySelection:i=!1,disallowSelectAll:l=!1,escapeKeyBehavior:c="clearSelection",selectOnFocus:d=t.selectionBehavior==="replace",disallowTypeAhead:u=!1,shouldUseVirtualFocus:m,allowsTabNavigation:p=!1,scrollRef:f=o,linkBehavior:g="action"}=e,{direction:y}=$u(),v=$s(),b=D=>{if(D.altKey&&D.key==="Tab"&&D.preventDefault(),!o.current||!ye(o.current,me(D)))return;const V=(R,M)=>{if(R!=null){if(t.isLink(R)&&g==="selection"&&d&&!Gs(D)){Ln.flushSync(()=>{t.setFocusedKey(R,M)});let Z=Us(o,R),I=t.getItemProps(R);Z&&v.open(Z,D,I.href,I.routerOptions);return}if(t.setFocusedKey(R,M),t.isLink(R)&&g==="override")return;D.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(R):d&&!Gs(D)&&t.replaceSelection(R)}};switch(D.key){case"ArrowDown":if(n.getKeyBelow){let R=t.focusedKey!=null?n.getKeyBelow?.(t.focusedKey):n.getFirstKey?.();R==null&&s&&(R=n.getFirstKey?.(t.focusedKey)),R!=null&&(D.preventDefault(),V(R))}break;case"ArrowUp":if(n.getKeyAbove){let R=t.focusedKey!=null?n.getKeyAbove?.(t.focusedKey):n.getLastKey?.();R==null&&s&&(R=n.getLastKey?.(t.focusedKey)),R!=null&&(D.preventDefault(),V(R))}break;case"ArrowLeft":if(n.getKeyLeftOf){let R=t.focusedKey!=null?n.getKeyLeftOf?.(t.focusedKey):n.getFirstKey?.();R==null&&s&&(R=y==="rtl"?n.getFirstKey?.(t.focusedKey):n.getLastKey?.(t.focusedKey)),R!=null&&(D.preventDefault(),V(R,y==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){let R=t.focusedKey!=null?n.getKeyRightOf?.(t.focusedKey):n.getFirstKey?.();R==null&&s&&(R=y==="rtl"?n.getLastKey?.(t.focusedKey):n.getFirstKey?.(t.focusedKey)),R!=null&&(D.preventDefault(),V(R,y==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(t.focusedKey===null&&D.shiftKey)return;D.preventDefault();let R=n.getFirstKey(t.focusedKey,kn(D));t.setFocusedKey(R),R!=null&&(kn(D)&&D.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(R):d&&t.replaceSelection(R))}break;case"End":if(n.getLastKey){if(t.focusedKey===null&&D.shiftKey)return;D.preventDefault();let R=n.getLastKey(t.focusedKey,kn(D));t.setFocusedKey(R),R!=null&&(kn(D)&&D.shiftKey&&t.selectionMode==="multiple"?t.extendSelection(R):d&&t.replaceSelection(R))}break;case"PageDown":if(n.getKeyPageBelow&&t.focusedKey!=null){let R=n.getKeyPageBelow(t.focusedKey);R!=null&&(D.preventDefault(),V(R))}break;case"PageUp":if(n.getKeyPageAbove&&t.focusedKey!=null){let R=n.getKeyPageAbove(t.focusedKey);R!=null&&(D.preventDefault(),V(R))}break;case"a":kn(D)&&t.selectionMode==="multiple"&&l!==!0&&(D.preventDefault(),t.selectAll());break;case"Escape":c==="clearSelection"&&!i&&t.selectedKeys.size!==0&&(D.stopPropagation(),D.preventDefault(),t.clearSelection());break;case"Tab":if(!p){if(D.shiftKey)o.current.focus();else{let R=Pu(o.current,{tabbable:!0}),M,Z;do Z=R.lastChild(),Z&&(M=Z);while(Z);let I=It();M&&(!Zp(M)||I&&!eu(I))&&Pt(M)}break}}},h=E.useRef({top:0,left:0});Cr(f,"scroll",()=>{h.current={top:f.current?.scrollTop??0,left:f.current?.scrollLeft??0}});let N=D=>{if(t.isFocused){ye(D.currentTarget,me(D))||t.setFocused(!1);return}if(ye(D.currentTarget,me(D))){if(t.setFocused(!0),t.focusedKey==null){let V=M=>{M!=null&&(t.setFocusedKey(M),d&&!t.isSelected(M)&&t.replaceSelection(M))},R=D.relatedTarget;R&&D.currentTarget.compareDocumentPosition(R)&Node.DOCUMENT_POSITION_FOLLOWING?V(t.lastSelectedKey??n.getLastKey?.()):V(t.firstSelectedKey??n.getFirstKey?.())}else f.current&&(f.current.scrollTop=h.current.top,f.current.scrollLeft=h.current.left);if(t.focusedKey!=null&&f.current){let V=Us(o,t.focusedKey);V instanceof HTMLElement&&(!Zp(V)&&!m&&Pt(V),Hs()==="keyboard"&&Ku(V,{containingElement:o.current}))}}},w=D=>{ye(D.currentTarget,D.relatedTarget)||t.setFocused(!1)},T=E.useRef(!1);Cr(o,Ew,m?D=>{let{detail:V}=D;D.stopPropagation(),t.setFocused(!0),V?.focusStrategy==="first"&&(T.current=!0)}:void 0),Hu(()=>{if(T.current){let D=n.getFirstKey?.()??null;if(D==null){let V=It();gu(o.current),hu(V,null),t.collection.size>0&&(T.current=!1)}else t.setFocusedKey(D),T.current=!1}},[t.collection]),Hu(()=>{t.collection.size>0&&(T.current=!1)},[t.focusedKey]),Cr(o,yw,m?D=>{D.stopPropagation(),t.setFocused(!1),D.detail?.clearFocusKey&&t.setFocusedKey(null)}:void 0);const L=E.useRef(a),A=E.useRef(!1);E.useEffect(()=>{if(L.current){let D=null;a==="first"&&(D=n.getFirstKey?.()??null),a==="last"&&(D=n.getLastKey?.()??null);let V=t.selectedKeys;if(V.size){for(let R of V)if(t.canSelectItem(R)){D=R;break}}t.setFocused(!0),t.setFocusedKey(D),D==null&&!m&&o.current&&yr(o.current),t.collection.size>0&&(L.current=!1,A.current=!0)}});let B=E.useRef(t.focusedKey),P=E.useRef(null);E.useEffect(()=>{if(t.isFocused&&t.focusedKey!=null&&(t.focusedKey!==B.current||A.current)&&f.current&&o.current){let D=Hs(),V=Us(o,t.focusedKey);if(!(V instanceof HTMLElement))return;(D==="keyboard"||A.current)&&(P.current&&cancelAnimationFrame(P.current),P.current=requestAnimationFrame(()=>{f.current&&(ei(f.current,V),D!=="virtual"&&Ku(V,{containingElement:o.current}))}))}!m&&t.isFocused&&t.focusedKey==null&&B.current!=null&&o.current&&yr(o.current),B.current=t.focusedKey,A.current=!1}),E.useEffect(()=>()=>{P.current&&cancelAnimationFrame(P.current)},[]),Cr(o,"react-aria-focus-scope-restore",D=>{D.preventDefault(),t.setFocused(!0)});let O={onKeyDown:b,onFocus:N,onBlur:w,onMouseDown(D){f.current===me(D)&&D.preventDefault()}},{typeSelectProps:U}=Cw({keyboardDelegate:n,selectionManager:t});u||(O=dt(U,O));let X;m||(X=t.focusedKey==null?0:-1);let K=GT(t.collection);return{collectionProps:dt(O,{tabIndex:X,"data-collection":K})}}function Iw(e,t,n){let{orientation:o="horizontal",keyboardActivation:a="automatic"}=e,{collection:s,selectionManager:i,disabledKeys:l}=t,{direction:c}=$u(),d=E.useMemo(()=>new fw(s,c,o,l),[s,l,o,c]),{collectionProps:u}=Nw({ref:n,selectionManager:i,keyboardDelegate:d,selectOnFocus:a==="automatic",disallowEmptySelection:!0,scrollRef:n,linkBehavior:"selection"}),m=mr();Yp.set(t,m);let p=Ou({...e,id:m});return{tabListProps:{...dt(u,p),role:"tablist","aria-orientation":o,tabIndex:void 0}}}function Wu({item:e,state:t}){const{key:n}=e,o=r.useRef(null),{tabProps:a}=iw({key:n},t,o),s=t.selectedKey===n,i=t.disabledKeys.has(n);return r.createElement("div",{...a,ref:o,className:$("sps-nav__item","sps-nav__link",s&&"active",i&&"sps-nav__item--disabled")},e.rendered)}function Gu({state:e,...t}){const n=r.useRef(null),{tabPanelProps:o}=mw(t,e,n);return r.createElement("div",{...o,ref:n,className:"sps-card__body"},e.selectedItem?e.selectedItem.props.children:null)}class Uu{constructor(t){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=t;let n=i=>{if(this.keyMap.set(i.key,i),i.childNodes&&i.type==="section")for(let l of i.childNodes)n(l)};for(let i of t)n(i);let o=null,a=0,s=0;for(let[i,l]of this.keyMap)o?(o.nextKey=i,l.prevKey=o.key):(this.firstKey=i,l.prevKey=void 0),l.type==="item"&&(l.index=a++),(l.type==="section"||l.type==="item")&&s++,o=l,o.nextKey=void 0;this._size=s,this.lastKey=o?.key??null}*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(t){let n=this.keyMap.get(t);return n?n.prevKey??null:null}getKeyAfter(t){let n=this.keyMap.get(t);return n?n.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(t){return this.keyMap.get(t)??null}at(t){const n=[...this.getKeys()];return this.getItem(n[t])}getChildren(t){return this.keyMap.get(t)?.childNodes||[]}}class vt extends Set{constructor(t,n,o){super(t),t instanceof vt?(this.anchorKey=n??t.anchorKey,this.currentKey=o??t.currentKey):(this.anchorKey=n??null,this.currentKey=o??null)}}const xw=typeof document<"u"?E.useInsertionEffect??E.useLayoutEffect:()=>{};function zu(e,t,n){let[o,a]=E.useState(e||t),s=E.useRef(o),i=E.useRef(e!==void 0),l=e!==void 0;E.useEffect(()=>{let m=i.current;m!==l&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${m?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}.`),i.current=l},[l]);let c=l?e:o;xw(()=>{s.current=c});let[,d]=E.useReducer(()=>({}),{}),u=E.useCallback((m,...p)=>{let f=typeof m=="function"?m(s.current):m;Object.is(s.current,f)||(s.current=f,a(f),d(),n?.(f,...p))},[n]);return[c,u]}function kw(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Mw(e){let{selectionMode:t="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:o,selectionBehavior:a="toggle",disabledBehavior:s="all"}=e,i=E.useRef(!1),[,l]=E.useState(!1),c=E.useRef(null),d=E.useRef(null),[,u]=E.useState(null),m=E.useMemo(()=>ju(e.selectedKeys),[e.selectedKeys]),p=E.useMemo(()=>ju(e.defaultSelectedKeys,new vt),[e.defaultSelectedKeys]),[f,g]=zu(m,p,e.onSelectionChange),y=E.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),[v,b]=E.useState(a);a==="replace"&&v==="toggle"&&typeof f=="object"&&f.size===0&&b("replace");let h=E.useRef(a);return E.useEffect(()=>{a!==h.current&&(b(a),h.current=a)},[a]),{selectionMode:t,disallowEmptySelection:n,selectionBehavior:v,setSelectionBehavior:b,get isFocused(){return i.current},setFocused(N){i.current=N,l(N)},get focusedKey(){return c.current},get childFocusStrategy(){return d.current},setFocusedKey(N,w="first"){c.current=N,d.current=w,u(N)},selectedKeys:f,setSelectedKeys(N){(o||!kw(N,f))&&g(N)},disabledKeys:y,disabledBehavior:s}}function ju(e,t){return e?e==="all"?"all":new vt(e):t}function Lw(e,t){return typeof t.getChildren=="function"?t.getChildren(e.key):e.childNodes}function _w(e){return Pw(e)}function Pw(e,t){for(let n of e)return n}function ti(e,t,n){if(t.parentKey===n.parentKey)return t.index-n.index;let o=[...Yu(e,t),t],a=[...Yu(e,n),n],s=o.slice(0,a.length).findIndex((i,l)=>i!==a[l]);return s!==-1?(t=o[s],n=a[s],t.index-n.index):o.findIndex(i=>i===n)>=0?1:(a.findIndex(i=>i===t)>=0,-1)}function Yu(e,t){let n=[],o=t;for(;o?.parentKey!=null;)o=e.getItem(o.parentKey),o&&n.unshift(o);return n}class ni{constructor(t,n,o){this.collection=t,this.state=n,this.allowsCellSelection=o?.allowsCellSelection??!1,this._isSelectAll=null,this.layoutDelegate=o?.layoutDelegate||null,this.fullCollection=o?.fullCollection||null}get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(t){this.state.setSelectionBehavior(t)}get isFocused(){return this.state.isFocused}setFocused(t){this.state.setFocused(t)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(t,n){(t==null||this.collection.getItem(t))&&this.state.setFocusedKey(t,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(t){if(this.state.selectionMode==="none")return!1;let n=this.getKey(t);return n==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let t=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=t.every(o=>n.has(o)),this._isSelectAll}get firstSelectedKey(){let t=null;for(let n of this.state.selectedKeys){let o=this.collection.getItem(n);(!t||o&&ti(this.collection,o,t)<0)&&(t=o)}return t?.key??null}get lastSelectedKey(){let t=null;for(let n of this.state.selectedKeys){let o=this.collection.getItem(n);(!t||o&&ti(this.collection,o,t)>0)&&(t=o)}return t?.key??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(t){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(t);return}let n=this.getKey(t);if(n==null)return;let o;if(this.state.selectedKeys==="all")o=new vt([n],n,n);else{let a=this.state.selectedKeys,s=a.anchorKey??n;o=new vt(a,s,n);for(let i of this.getKeyRange(s,a.currentKey??n))o.delete(i);for(let i of this.getKeyRange(n,s))this.canSelectItem(i)&&o.add(i)}this.state.setSelectedKeys(o)}getKeyRange(t,n){let o=this.collection.getItem(t),a=this.collection.getItem(n);return o&&a?ti(this.collection,o,a)<=0?this.getKeyRangeInternal(t,n):this.getKeyRangeInternal(n,t):[]}getKeyRangeInternal(t,n){if(this.layoutDelegate?.getKeyRange)return this.layoutDelegate.getKeyRange(t,n);let o=[],a=t;for(;a!=null;){let s=this.collection.getItem(a);if(s&&(s.type==="item"||s.type==="cell"&&this.allowsCellSelection)&&o.push(a),a===n)return o;a=this.collection.getKeyAfter(a)}return[]}getKey(t){let n=this.collection.getItem(t);if(!n||n.type==="cell"&&this.allowsCellSelection)return t;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return!n||n.type!=="item"?null:n.key}toggleSelection(t){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(t)){this.replaceSelection(t);return}let n=this.getKey(t);if(n==null)return;let o=new vt(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);o.has(n)?o.delete(n):this.canSelectItem(n)&&(o.add(n),o.anchorKey=n,o.currentKey=n),!(this.disallowEmptySelection&&o.size===0)&&this.state.setSelectedKeys(o)}replaceSelection(t){if(this.selectionMode==="none")return;let n=this.getKey(t);if(n==null)return;let o=this.canSelectItem(n)?new vt([n],n,n):new vt;this.state.setSelectedKeys(o)}setSelectedKeys(t){if(this.selectionMode==="none")return;let n=new vt;for(let o of t){let a=this.getKey(o);if(a!=null&&(n.add(a),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let t=this.fullCollection??this.collection,n=[],o=a=>{for(;a!=null;){if(this.canSelectItemIn(a,t)){let s=t.getItem(a);s?.type==="item"&&n.push(a),s?.hasChildNodes&&(this.allowsCellSelection||s.type!=="item")&&o(_w(Lw(s,t))?.key??null)}a=t.getKeyAfter(a)}};return o(t.getFirstKey()),n}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new vt)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(t,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(t)&&!this.disallowEmptySelection?this.toggleSelection(t):this.replaceSelection(t):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(t):this.replaceSelection(t))}isSelectionEqual(t){if(t===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(t.size!==n.size)return!1;for(let o of t)if(!n.has(o))return!1;for(let o of n)if(!t.has(o))return!1;return!0}canSelectItem(t){return this.canSelectItemIn(t,this.collection)}canSelectItemIn(t,n){if(this.state.selectionMode==="none"||this.state.disabledKeys.has(t))return!1;let o=n.getItem(t);return!(!o||o?.props?.isDisabled||o.type==="cell"&&!this.allowsCellSelection)}isDisabled(t){return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(t)||!!this.collection.getItem(t)?.props?.isDisabled)}isLink(t){return!!this.collection.getItem(t)?.props?.href}getItemProps(t){return this.collection.getItem(t)?.props}withCollection(t){return new ni(t,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0,fullCollection:this.fullCollection??this.collection})}}class Bw{build(t,n){return this.context=n,qu(()=>this.iterateCollection(t))}*iterateCollection(t){let{children:n,items:o}=t;if(E.isValidElement(n)&&n.type===E.Fragment)yield*this.iterateCollection({children:n.props.children,items:o});else if(typeof n=="function"){if(!o)throw new Error("props.children was a function but props.items is missing");let a=0;for(let s of o)yield*this.getFullNode({value:s,index:a},{renderer:n}),a++}else{let a=[];E.Children.forEach(n,i=>{i&&a.push(i)});let s=0;for(let i of a){let l=this.getFullNode({element:i,index:s},{});for(let c of l)s++,yield c}}}getKey(t,n,o,a){if(t.key!=null)return t.key;if(n.type==="cell"&&n.key!=null)return`${a}${n.key}`;let s=n.value;if(s!=null){let i=s.key??s.id;if(i==null)throw new Error("No key found for item");return i}return a?`${a}.${n.index}`:`$.${n.index}`}getChildState(t,n){return{renderer:n.renderer||t.renderer}}*getFullNode(t,n,o,a){if(E.isValidElement(t.element)&&t.element.type===E.Fragment){let c=[];E.Children.forEach(t.element.props.children,u=>{c.push(u)});let d=t.index??0;for(const u of c)yield*this.getFullNode({element:u,index:d++},n,o,a);return}let s=t.element;if(!s&&t.value&&n&&n.renderer){let c=this.cache.get(t.value);if(c&&(!c.shouldInvalidate||!c.shouldInvalidate(this.context))){c.index=t.index,c.parentKey=a?a.key:null,yield c;return}s=n.renderer(t.value)}if(E.isValidElement(s)){let c=s.type;if(typeof c!="function"&&typeof c.getCollectionNode!="function"){let p=s.type;throw new Error(`Unknown element <${p}> in collection.`)}let d=c.getCollectionNode(s.props,this.context),u=t.index??0,m=d.next();for(;!m.done&&m.value;){let p=m.value;t.index=u;let f=p.key??null;f==null&&(f=p.element?null:this.getKey(s,t,n,o));let y=[...this.getFullNode({...p,key:f,index:u,wrapper:Ow(t.wrapper,p.wrapper)},this.getChildState(n,p),o?`${o}${s.key}`:s.key,a)];for(let v of y){if(v.value=p.value??t.value??null,v.value&&this.cache.set(v.value,v),t.type&&v.type!==t.type)throw new Error(`Unsupported type <${oi(v.type)}> in <${oi(a?.type??"unknown parent type")}>. Only <${oi(t.type)}> is supported.`);u++,yield v}m=d.next(y)}return}if(t.key==null||t.type==null)return;let i=this,l={type:t.type,props:t.props,key:t.key,parentKey:a?a.key:null,value:t.value??null,level:(a?.level??0)+(a?.type==="item"?1:0),index:t.index,rendered:t.rendered,textValue:t.textValue??"","aria-label":t["aria-label"],wrapper:t.wrapper,shouldInvalidate:t.shouldInvalidate,hasChildNodes:t.hasChildNodes||!1,childNodes:qu(function*(){if(!t.hasChildNodes||!t.childNodes)return;let c=0;for(let d of t.childNodes()){d.key!=null&&(d.key=`${l.key}${d.key}`);let u=i.getFullNode({...d,index:c},i.getChildState(n,d),l.key,l);for(let m of u)c++,yield m}})};yield l}constructor(){this.cache=new WeakMap}}function qu(e){let t=[],n=null;return{*[Symbol.iterator](){for(let o of t)yield o;n||(n=e());for(let o of n)t.push(o),yield o}}}function Ow(e,t){if(e&&t)return n=>e(t(n));if(e)return e;if(t)return t}function oi(e){return e[0].toUpperCase()+e.slice(1)}function Rw(e,t,n){let o=E.useMemo(()=>new Bw,[]),{children:a,items:s,collection:i}=e;return E.useMemo(()=>{if(i)return i;let c=o.build({children:a,items:s},n);return t(c)},[o,a,s,i,n,t])}function Fw(e){let{filter:t,layoutDelegate:n}=e,o=Mw(e),a=E.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),s=E.useCallback(d=>t?new Uu(t(d)):new Uu(d),[t]),i=E.useMemo(()=>({suppressTextValueWarning:e.suppressTextValueWarning}),[e.suppressTextValueWarning]),l=Rw(e,s,i),c=E.useMemo(()=>new ni(l,o,{layoutDelegate:n}),[l,o,n]);return Aw(l,c),{collection:l,disabledKeys:a,selectionManager:c}}function Aw(e,t){const n=E.useRef(null);E.useEffect(()=>{if(t.focusedKey!=null&&!e.getItem(t.focusedKey)&&n.current){let o=n.current.getKeyAfter(t.focusedKey),a=null;for(;o!=null;){let s=e.getItem(o);if(s&&s.type==="item"&&!t.isDisabled(o)){a=o;break}o=n.current.getKeyAfter(o)}if(a==null)for(o=n.current.getKeyBefore(t.focusedKey);o!=null;){let s=e.getItem(o);if(s&&s.type==="item"&&!t.isDisabled(o)){a=o;break}o=n.current.getKeyBefore(o)}t.setFocusedKey(a)}n.current=e},[e,t])}function $w(e){let[t,n]=zu(e.selectedKey,e.defaultSelectedKey??null,e.onSelectionChange),o=E.useMemo(()=>t!=null?[t]:[],[t]),{collection:a,disabledKeys:s,selectionManager:i}=Fw({...e,selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:o,onSelectionChange:c=>{if(c==="all")return;let d=c.values().next().value??null;d===t&&e.onSelectionChange&&e.onSelectionChange(d),n(d)}}),l=t!=null?a.getItem(t):null;return{collection:a,disabledKeys:s,selectionManager:i,selectedKey:t,setSelectedKey:n,selectedItem:l}}function Vw(e){let t=$w({...e,onSelectionChange:e.onSelectionChange?i=>{i!=null&&e.onSelectionChange?.(i)}:void 0,suppressTextValueWarning:!0,defaultSelectedKey:e.defaultSelectedKey??Ju(e.collection,e.disabledKeys?new Set(e.disabledKeys):new Set)??void 0}),{selectionManager:n,collection:o,selectedKey:a}=t,s=E.useRef(a);return E.useEffect(()=>{let i=a;e.selectedKey==null&&(n.isEmpty||i==null||!o.getItem(i))&&(i=Ju(o,t.disabledKeys),i!=null&&n.setSelectedKeys([i])),(i!=null&&n.focusedKey==null||!n.isFocused&&i!==s.current)&&n.setFocusedKey(i),s.current=i}),{...t,isDisabled:e.isDisabled||!1}}function Ju(e,t){let n=null;if(e){for(n=e.getFirstKey();n!=null&&(t.has(n)||e.getItem(n)?.props?.isDisabled)&&n!==e.getLastKey();)n=e.getKeyAfter(n);n!=null&&(t.has(n)||e.getItem(n)?.props?.isDisabled)&&n===e.getLastKey()&&(n=e.getFirstKey())}return n}const Kw={},Hw={};function ri(e){const{selectedKey:t,defaultSelectedKey:n,...o}=e,a={...o,selectedKey:t??void 0,defaultSelectedKey:n??void 0},s=Vw(a),i=r.useRef(null),{tabListProps:l}=Iw(a,s,i);return r.createElement(r.Fragment,null,r.createElement("div",{...l,ref:i,className:"sps-nav sps-nav--tabs sps-tabs-v2"},[...s.collection].map(c=>r.createElement(Wu,{key:c.key,item:c,state:s}))),r.createElement(Gu,{key:s.selectedItem?s.selectedItem.key:null,state:s}))}Object.assign(ri,{props:Kw,propTypes:Hw,displayName:"SpsTabsV2"});const Ww={};function ai({children:e,className:t,...n}){return r.createElement("div",{className:$("sps-card__footer",t),...n},e)}Object.assign(ai,{props:Ww,displayName:"SpsCardV2Footer"});const Gw={};function si({children:e,className:t,...n}){return r.createElement("div",{className:$("sps-card__header",t),...n},e)}Object.assign(si,{props:Gw,displayName:"SpsCardV2Header"});const Uw={};function Xu({children:e,className:t,...n}){const[o,a,s,i,l]=at(e,[{type:si},{type:ri},{custom:d=>d?.displayName==="Tabs"},{type:ai}]),c=a.length>0?a:s;return r.createElement("div",{className:$("sps-card",t),...n},o,c.length>0?c:r.createElement("div",{className:"sps-card__body"},l),i)}Object.assign(Xu,{props:Uw,displayName:"SpsCardV2"});const zw={};function Zu({children:e,className:t,...n}){return r.createElement("div",{className:$("sps-card__title",t),...n},e)}Object.assign(Zu,{props:zw,displayName:"SpsCardV2Title"});const jw={...md,controlsDisabled:"boolean",footerLinks:"ReactNodeOrRenderFn",formMeta:"SpsFormSetMeta<any>",isOpen:"boolean",onClear:"() => void",onSubmit:"React.FormEventHandler"};function Qu(e){const{children:t,className:n,controlsDisabled:o,footerLinks:a,formArray:s,formGroup:i,formMeta:l,isOpen:c,onClear:d,onSubmit:u,unsafelyReplaceClassName:m,...p}=e,{t:f}=he.useWoodlandLanguage();function g(){d&&d()}const y=$(m||"sps-advanced-search",c&&"sps-advanced-search--open",n);return r.createElement("div",{className:y,...p},r.createElement(ro,{onSubmit:u,formArray:s,formGroup:i,formMeta:l},r.createElement("div",{className:"sps-advanced-search__form"},t),r.createElement("div",{className:"sps-advanced-search__footer"},a&&r.createElement("div",{id:"footer_links"},qe(a)),r.createElement("div",{className:"sps-advanced-search__footer-controls"},r.createElement(Ne,{kind:F.ButtonKind.DEFAULT,type:F.ButtonType.BUTTON,className:"mr-2",onClick:g,disabled:o},f("advancedSearch.clear")),r.createElement(Ne,{kind:F.ButtonKind.KEY,type:F.ButtonType.SUBMIT,disabled:o},f("advancedSearch.search"))))))}Object.assign(Qu,{props:jw,displayName:"SpsAdvancedSearch"});const Yw={general:{label:"General Usage",description:({NavigateTo:e,Link:t})=>r.createElement(r.Fragment,null,r.createElement("p",null,'Advanced Search is comprised of a panel of input fields, and a text button that exposes and hides the panel. By default, the Advanced Search panel is hidden (with the exception of "Advanced Search Only" scenarios).'),r.createElement("p",null,"Advanced Search works in conjunction with the"," ",r.createElement(e,{to:"list-toolbar"},"List Bar")," and"," ",r.createElement(e,{to:"search-results-bar"},"Search Results")," components. Refer to those pages for additional details."),r.createElement("p",null,"Use the following guidelines when including Advanced Search on your page:",r.createElement("ul",null,r.createElement("li",null,"The Advanced Search Panel can contain any number of input fields."),r.createElement("li",null,"The Advanced Search Panel can place input fields in any unique layout to best serve the needs of the search criteria, but must adhere to the rules of the"," ",r.createElement(t,{to:"/style-and-layout/grid/"},"SPS Grid")," and guidelines for"," ",r.createElement(e,{to:"form"},"Form Layouts"),"."))))},basic:{label:"Basic Usage",description:({NavigateTo:e})=>r.createElement(r.Fragment,null,r.createElement("p",null,"A Basic Advanced Search consists of the List Bar with a search input and an Advanced Search text button. For more details on additional button and component options in the List Bar reference the ",r.createElement(e,{to:"list-toolbar"},"List Bar")," page.")),examples:{basic:{react:S.code`
9836
9836
  import {
9837
9837
  SpsListToolbar,
9838
9838
  SpsListToolbarSearch,
@@ -12136,4 +12136,4 @@ ${t.join("").replace("]","\\]").replace(" ","\\s")}]+`);return e.split(n).filter
12136
12136
  </SpsCard>
12137
12137
  </div>
12138
12138
  </div>
12139
- `}}}};x.AsTypingErrorKeys=un,x.ContentOrderExample=cm,x.DEFAULT_DATETIME_PRESETS=_d,x.DEFAULT_PRESETS=es,x.DragDropContext=Zc,x.Draggable=dd,x.Droppable=ja,x.FauxChangeEvent=Lt,x.MANIFEST=jE,x.ModalAction=dm,x.OnBlurErrorKeys=Ze,x.OnSubmitErrorKeys=So,x.PortalContext=rt,x.PreventativeErrorKeys=wt,x.Provide=Oi,x.SimpleDateUtils=j,x.SpsAddRemoveFormRowExamples=gy,x.SpsAdvancedSearch=Qu,x.SpsAdvancedSearchExamples=Yw,x.SpsApp=pf,x.SpsAutocomplete=Nt,x.SpsAutocompleteExamples=$i,x.SpsButton=Ne,x.SpsButtonExamples=mE,x.SpsButtonGroup=cp,x.SpsCard=qa,x.SpsCardTabbedPane=Ya,x.SpsCardV2=Xu,x.SpsCardV2Footer=ai,x.SpsCardV2Header=si,x.SpsCardV2Title=Zu,x.SpsCheckbox=Jt,x.SpsCheckboxDropdown=rs,x.SpsCheckboxExamples=Vi,x.SpsClickableTag=An,x.SpsClickableTagExamples=Ki,x.SpsColumnChooser=Xa,x.SpsColumnChooserColumn=zo,x.SpsColumnChooserExamples=Sd,x.SpsConditionalField=Ms,x.SpsConditionalFieldExamples=Kp,x.SpsContentRow=Za,x.SpsContentRowCol=nn,x.SpsContentRowExamples=gd,x.SpsContentRowExpansion=jo,x.SpsContextBar=qw,x.SpsCurrencyInput=em,x.SpsCurrencyInputExamples=Qw,x.SpsDateRangePicker=ts,x.SpsDateRangePickerExamples=xd,x.SpsDateTime=os,x.SpsDateTimeRangePicker=ns,x.SpsDateTimeRangePickerExamples=Bd,x.SpsDatepicker=Qa,x.SpsDatepickerExamples=Dd,x.SpsDatetimeExamples=Od,x.SpsDd=$d,x.SpsDescriptionList=Zo,x.SpsDescriptionListDefinition=Qo,x.SpsDescriptionListExamples=Gd,x.SpsDescriptionListTerm=tr,x.SpsDl=Fd,x.SpsDropdown=an,x.SpsDropdownExamples=Ud,x.SpsDt=Wd,x.SpsFeedbackBlock=Ds,x.SpsFeedbackBlockExamples=FE,x.SpsFieldset=as,x.SpsFieldsetExamples=zd,x.SpsFilterPanel=Ns,x.SpsFilterPanelCap=xs,x.SpsFilterPanelExamples=Vp,x.SpsFilterPanelFilterBox=ks,x.SpsFilterPanelSection=Is,x.SpsFilterTile=Em,x.SpsFilterTileList=Tm,x.SpsFilterTileListExamples=WC,x.SpsFocusedTask=li,x.SpsFocusedTaskActions=ii,x.SpsFocusedTaskExamples=nC,x.SpsForm=ro,x.SpsFormArrayMeta=Ii,x.SpsFormComponentWrapper=Le,x.SpsFormExamples=fd,x.SpsFormFieldMeta=Bn,x.SpsFormGroupMeta=Ni,x.SpsFormMetaBase=Yt,x.SpsFormSetMeta=qt,x.SpsGrowler=ci,x.SpsGrowlerExamples=aC,x.SpsI=ht,x.SpsIconButtonPanel=dp,x.SpsIncrementor=ss,x.SpsIncrementorExamples=jd,x.SpsInputGroup=In,x.SpsInsightTile=tm,x.SpsInsights=sC,x.SpsKeyValueList=nm,x.SpsKeyValueListItem=om,x.SpsKeyValueTag=rm,x.SpsKeyValueTagExamples=pC,x.SpsLabel=is,x.SpsLabelExamples=Yd,x.SpsListActionBar=ls,x.SpsListActionBarExamples=up,x.SpsListToolbar=im,x.SpsListToolbarExamples=vC,x.SpsListToolbarSearch=pi,x.SpsListToolbarSearchInfo=ui,x.SpsListToolbarSortBy=lm,x.SpsLocaleProvider=$y,x.SpsMicroBlock=cs,x.SpsMicroBlockExamples=mp,x.SpsMicroZeroState=Dm,x.SpsModal=ds,x.SpsModalExamples=Sp,x.SpsModalFooter=or,x.SpsMultiSelect=us,x.SpsMultiSelectExamples=gp,x.SpsMultiValueTextInput=Ls,x.SpsMultiValueTextInputExamples=Gp,x.SpsPageSelector=rr,x.SpsPageSubtitle=um,x.SpsPageTitle=pm,x.SpsPageTitleExamples=CC,x.SpsPagination=ms,x.SpsPaginationExamples=hp,x.SpsProductBar=mm,x.SpsProductBarExamples=IC,x.SpsProductBarTab=mi,x.SpsProgressBar=fm,x.SpsProgressBarExamples=kC,x.SpsProgressRing=Ts,x.SpsRadioButton=fs,x.SpsRadioButtonExamples=bp,x.SpsScrollableContainer=Sm,x.SpsSearchResultsBar=sm,x.SpsSearchResultsBarExamples=fC,x.SpsSearchResultsBarV2=di,x.SpsSelect=on,x.SpsSelectExamples=kd,x.SpsSideNav=yp,x.SpsSideNavExamples=Ep,x.SpsSlackLink=gm,x.SpsSlackLinkExamples=_C,x.SpsSlideInPanel=ps,x.SpsSlideInPanelExamples=fp,x.SpsSortingHeader=hm,x.SpsSortingHeaderCell=fi,x.SpsSortingHeaderExamples=OC,x.SpsSpinner=Or,x.SpsSplitButton=Ss,x.SpsSplitButtonExamples=Tp,x.SpsSteppedProgressBar=bm,x.SpsSteppedProgressBarExamples=FC,x.SpsSummaryListColumn=hs,x.SpsSummaryListExamples=wp,x.SpsSummaryListExpansion=io,x.SpsSummaryListRow=gs,x.SpsTab=Wu,x.SpsTabPanel=Gu,x.SpsTable=sn,x.SpsTableBody=Wt,x.SpsTableCell=re,x.SpsTableExamples=pp,x.SpsTableHead=Ht,x.SpsTableHeader=Oe,x.SpsTableRow=De,x.SpsTabsV2=ri,x.SpsTag=gt,x.SpsTagExamples=gE,x.SpsTaskQueue=bs,x.SpsTaskQueueExamples=Cp,x.SpsTbody=sp,x.SpsTd=lp,x.SpsTextInput=sr,x.SpsTextInputExamples=Dp,x.SpsTextarea=vs,x.SpsTextareaExamples=Np,x.SpsTh=ep,x.SpsThead=np,x.SpsTile=vm,x.SpsTileList=ym,x.SpsTileListExamples=VC,x.SpsTimeInput=_s,x.SpsTimeInputExamples=zp,x.SpsToggle=ys,x.SpsToggleExamples=xp,x.SpsTooltip=ct,x.SpsTooltipExamples=kp,x.SpsTooltipTitle=Es,x.SpsTr=rp,x.SpsValidators=ho,x.SpsVerticalRule=Si,x.SpsVr=Cm,x.SpsWf=Lp,x.SpsWfDoc=Bp,x.SpsWfDs=Rp,x.SpsWfStep=Ap,x.SpsWizardExamples=_p,x.SpsWizardSidebar=ws,x.SpsWizardSubstep=Cs,x.SpsWorkflow=ir,x.SpsWorkflowDocument=lr,x.SpsWorkflowDocumentStatus=cr,x.SpsWorkflowExamples=$p,x.SpsWorkflowStep=dr,x.SpsZeroState=Nm,x.SpsZeroStateExamples=zC,x.TooltipVisibility=ge,x.ValidationMode=Ct,x.addOnChangeErrorKey=Ei,x.addOnSubmitErrorKey=Ti,x.bindProps=df,x.contentOf=qe,x.date=Pn,x.dateConstraint=Di,x.dateRange=Ci,x.findParentBranches=ar,x.flipPosition=Rr,x.formArray=py,x.formControl=uy,x.formGroup=my,x.getMember=Ja,x.getPosition=Sn,x.letterAndNumberKeys=Fr,x.resetServerContext=dv,x.selectChildren=at,x.setDateFormat=wi,x.toggleTooltipState=er,x.useCheckDeprecatedProps=Ri,x.useColumnCellResizer=Zd,x.useColumnHeaderResizer=Xd,x.useCustomValidator=Jm,x.useDidUpdateEffect=Ar,x.useDocumentEventListener=$r,x.useElementId=Rt,x.useForm=fy,x.useGrowlers=rC,x.useInputPopup=bn,x.useKeyboardSensor=zc,x.useModals=yC,x.useMouseSensor=Uc,x.usePatchReducer=Dt,x.usePortal=gn,x.useServerSideValidation=Sy,x.useSpsAction=EC,x.useSpsForm=xi,x.useSpsLocale=ao,x.useTouchSensor=jc,x.validate=bo,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})}));
12139
+ `}}}};x.AsTypingErrorKeys=un,x.ContentOrderExample=cm,x.DEFAULT_DATETIME_PRESETS=_d,x.DEFAULT_PRESETS=es,x.DragDropContext=Zc,x.Draggable=dd,x.Droppable=ja,x.FauxChangeEvent=Lt,x.MANIFEST=jE,x.ModalAction=dm,x.OnBlurErrorKeys=Ze,x.OnSubmitErrorKeys=So,x.PortalContext=rt,x.PreventativeErrorKeys=wt,x.Provide=Oi,x.SimpleDateUtils=j,x.SpsAddRemoveFormRowExamples=gy,x.SpsAdvancedSearch=Qu,x.SpsAdvancedSearchExamples=Yw,x.SpsApp=df,x.SpsAutocomplete=Nt,x.SpsAutocompleteExamples=$i,x.SpsButton=Ne,x.SpsButtonExamples=mE,x.SpsButtonGroup=cp,x.SpsCard=qa,x.SpsCardTabbedPane=Ya,x.SpsCardV2=Xu,x.SpsCardV2Footer=ai,x.SpsCardV2Header=si,x.SpsCardV2Title=Zu,x.SpsCheckbox=Jt,x.SpsCheckboxDropdown=rs,x.SpsCheckboxExamples=Vi,x.SpsClickableTag=An,x.SpsClickableTagExamples=Ki,x.SpsColumnChooser=Xa,x.SpsColumnChooserColumn=zo,x.SpsColumnChooserExamples=Sd,x.SpsConditionalField=Ms,x.SpsConditionalFieldExamples=Kp,x.SpsContentRow=Za,x.SpsContentRowCol=nn,x.SpsContentRowExamples=gd,x.SpsContentRowExpansion=jo,x.SpsContextBar=qw,x.SpsCurrencyInput=em,x.SpsCurrencyInputExamples=Qw,x.SpsDateRangePicker=ts,x.SpsDateRangePickerExamples=xd,x.SpsDateTime=os,x.SpsDateTimeRangePicker=ns,x.SpsDateTimeRangePickerExamples=Bd,x.SpsDatepicker=Qa,x.SpsDatepickerExamples=Dd,x.SpsDatetimeExamples=Od,x.SpsDd=$d,x.SpsDescriptionList=Zo,x.SpsDescriptionListDefinition=Qo,x.SpsDescriptionListExamples=Gd,x.SpsDescriptionListTerm=tr,x.SpsDl=Fd,x.SpsDropdown=an,x.SpsDropdownExamples=Ud,x.SpsDt=Wd,x.SpsFeedbackBlock=Ds,x.SpsFeedbackBlockExamples=FE,x.SpsFieldset=as,x.SpsFieldsetExamples=zd,x.SpsFilterPanel=Ns,x.SpsFilterPanelCap=xs,x.SpsFilterPanelExamples=Vp,x.SpsFilterPanelFilterBox=ks,x.SpsFilterPanelSection=Is,x.SpsFilterTile=Em,x.SpsFilterTileList=Tm,x.SpsFilterTileListExamples=WC,x.SpsFocusedTask=li,x.SpsFocusedTaskActions=ii,x.SpsFocusedTaskExamples=nC,x.SpsForm=ro,x.SpsFormArrayMeta=Ii,x.SpsFormComponentWrapper=Le,x.SpsFormExamples=fd,x.SpsFormFieldMeta=Bn,x.SpsFormGroupMeta=Ni,x.SpsFormMetaBase=Yt,x.SpsFormSetMeta=qt,x.SpsGrowler=ci,x.SpsGrowlerExamples=aC,x.SpsI=ht,x.SpsIconButtonPanel=dp,x.SpsIncrementor=ss,x.SpsIncrementorExamples=jd,x.SpsInputGroup=In,x.SpsInsightTile=tm,x.SpsInsights=sC,x.SpsKeyValueList=nm,x.SpsKeyValueListItem=om,x.SpsKeyValueTag=rm,x.SpsKeyValueTagExamples=pC,x.SpsLabel=is,x.SpsLabelExamples=Yd,x.SpsListActionBar=ls,x.SpsListActionBarExamples=up,x.SpsListToolbar=im,x.SpsListToolbarExamples=vC,x.SpsListToolbarSearch=pi,x.SpsListToolbarSearchInfo=ui,x.SpsListToolbarSortBy=lm,x.SpsLocaleProvider=$y,x.SpsMicroBlock=cs,x.SpsMicroBlockExamples=mp,x.SpsMicroZeroState=Dm,x.SpsModal=ds,x.SpsModalExamples=Sp,x.SpsModalFooter=or,x.SpsMultiSelect=us,x.SpsMultiSelectExamples=gp,x.SpsMultiValueTextInput=Ls,x.SpsMultiValueTextInputExamples=Gp,x.SpsPageSelector=rr,x.SpsPageSubtitle=um,x.SpsPageTitle=pm,x.SpsPageTitleExamples=CC,x.SpsPagination=ms,x.SpsPaginationExamples=hp,x.SpsProductBar=mm,x.SpsProductBarExamples=IC,x.SpsProductBarTab=mi,x.SpsProgressBar=fm,x.SpsProgressBarExamples=kC,x.SpsProgressRing=Ts,x.SpsRadioButton=fs,x.SpsRadioButtonExamples=bp,x.SpsScrollableContainer=Sm,x.SpsSearchResultsBar=sm,x.SpsSearchResultsBarExamples=fC,x.SpsSearchResultsBarV2=di,x.SpsSelect=on,x.SpsSelectExamples=kd,x.SpsSideNav=yp,x.SpsSideNavExamples=Ep,x.SpsSlackLink=gm,x.SpsSlackLinkExamples=_C,x.SpsSlideInPanel=ps,x.SpsSlideInPanelExamples=fp,x.SpsSortingHeader=hm,x.SpsSortingHeaderCell=fi,x.SpsSortingHeaderExamples=OC,x.SpsSpinner=Or,x.SpsSplitButton=Ss,x.SpsSplitButtonExamples=Tp,x.SpsSteppedProgressBar=bm,x.SpsSteppedProgressBarExamples=FC,x.SpsSummaryListColumn=hs,x.SpsSummaryListExamples=wp,x.SpsSummaryListExpansion=io,x.SpsSummaryListRow=gs,x.SpsTab=Wu,x.SpsTabPanel=Gu,x.SpsTable=sn,x.SpsTableBody=Wt,x.SpsTableCell=re,x.SpsTableExamples=pp,x.SpsTableHead=Ht,x.SpsTableHeader=Oe,x.SpsTableRow=De,x.SpsTabsV2=ri,x.SpsTag=gt,x.SpsTagExamples=gE,x.SpsTaskQueue=bs,x.SpsTaskQueueExamples=Cp,x.SpsTbody=sp,x.SpsTd=lp,x.SpsTextInput=sr,x.SpsTextInputExamples=Dp,x.SpsTextarea=vs,x.SpsTextareaExamples=Np,x.SpsTh=ep,x.SpsThead=np,x.SpsTile=vm,x.SpsTileList=ym,x.SpsTileListExamples=VC,x.SpsTimeInput=_s,x.SpsTimeInputExamples=zp,x.SpsToggle=ys,x.SpsToggleExamples=xp,x.SpsTooltip=ct,x.SpsTooltipExamples=kp,x.SpsTooltipTitle=Es,x.SpsTr=rp,x.SpsValidators=ho,x.SpsVerticalRule=Si,x.SpsVr=Cm,x.SpsWf=Lp,x.SpsWfDoc=Bp,x.SpsWfDs=Rp,x.SpsWfStep=Ap,x.SpsWizardExamples=_p,x.SpsWizardSidebar=ws,x.SpsWizardSubstep=Cs,x.SpsWorkflow=ir,x.SpsWorkflowDocument=lr,x.SpsWorkflowDocumentStatus=cr,x.SpsWorkflowExamples=$p,x.SpsWorkflowStep=dr,x.SpsZeroState=Nm,x.SpsZeroStateExamples=zC,x.TooltipVisibility=ge,x.ValidationMode=Ct,x.addOnChangeErrorKey=Ei,x.addOnSubmitErrorKey=Ti,x.bindProps=cf,x.contentOf=qe,x.date=Pn,x.dateConstraint=Di,x.dateRange=Ci,x.findParentBranches=ar,x.flipPosition=Rr,x.formArray=py,x.formControl=uy,x.formGroup=my,x.getMember=Ja,x.getPosition=Sn,x.letterAndNumberKeys=Fr,x.resetServerContext=dv,x.selectChildren=at,x.setDateFormat=wi,x.toggleTooltipState=er,x.useCheckDeprecatedProps=Ri,x.useColumnCellResizer=Zd,x.useColumnHeaderResizer=Xd,x.useCustomValidator=qm,x.useDidUpdateEffect=Ar,x.useDocumentEventListener=$r,x.useElementId=Rt,x.useForm=fy,x.useGrowlers=rC,x.useInputPopup=bn,x.useKeyboardSensor=zc,x.useModals=yC,x.useMouseSensor=Uc,x.usePatchReducer=Dt,x.usePortal=gn,x.useServerSideValidation=Sy,x.useSpsAction=EC,x.useSpsForm=xi,x.useSpsLocale=ao,x.useTouchSensor=jc,x.validate=bo,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})}));
@@ -1,5 +1,7 @@
1
1
  export interface ISelectChildrenGroup {
2
2
  type?: any;
3
3
  props?: Record<string, any>;
4
+ /** Custom predicate to match children (receives the child's type) */
5
+ custom?: (type: any) => boolean;
4
6
  }
5
7
  export declare function selectChildren(children?: any, groups?: Array<ISelectChildrenGroup | ISelectChildrenGroup[]>): any[][];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spscommerce/ds-react",
3
3
  "description": "SPS Design System React components",
4
- "version": "8.50.1",
4
+ "version": "8.51.0",
5
5
  "author": "SPS Commerce",
6
6
  "license": "UNLICENSED",
7
7
  "repository": "https://github.com/spscommerce/woodland/tree/main/packages/@spscommerce/ds-react",
@@ -46,12 +46,11 @@
46
46
  "moment-timezone": "^0.6.0",
47
47
  "react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
48
48
  "react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
49
- "@sps-woodland/illustrations": "8.50.1",
50
- "@sps-woodland/tabs": "8.50.1",
51
- "@spscommerce/ds-colors": "8.50.1",
52
- "@spscommerce/ds-shared": "8.50.1",
53
- "@spscommerce/i18n": "8.50.1",
54
- "@spscommerce/positioning": "8.50.1"
49
+ "@sps-woodland/illustrations": "8.51.0",
50
+ "@spscommerce/ds-colors": "8.51.0",
51
+ "@spscommerce/ds-shared": "8.51.0",
52
+ "@spscommerce/i18n": "8.51.0",
53
+ "@spscommerce/positioning": "8.51.0"
55
54
  },
56
55
  "devDependencies": {
57
56
  "@react-stately/collections": "3.12.10",
@@ -71,13 +70,12 @@
71
70
  "raf-stub": "3.0.0",
72
71
  "react": "16.14.0",
73
72
  "react-dom": "16.14.0",
74
- "@sps-woodland/illustrations": "8.50.1",
75
- "@sps-woodland/tabs": "8.50.1",
76
- "@spscommerce/ds-colors": "8.50.1",
77
- "@spscommerce/ds-shared": "8.50.1",
78
- "@spscommerce/i18n": "8.50.1",
79
- "@spscommerce/positioning": "8.50.1",
80
- "test": "8.50.1"
73
+ "@sps-woodland/illustrations": "8.51.0",
74
+ "@spscommerce/ds-colors": "8.51.0",
75
+ "@spscommerce/ds-shared": "8.51.0",
76
+ "@spscommerce/i18n": "8.51.0",
77
+ "@spscommerce/positioning": "8.51.0",
78
+ "test": "8.51.0"
81
79
  },
82
80
  "scripts": {
83
81
  "build": "pnpm run build:js && pnpm run build:types",
package/vite.config.mjs CHANGED
@@ -14,7 +14,9 @@ export default defineConfig({
14
14
  outDir: path.resolve(__dirname, "./lib"),
15
15
  emptyOutDir: false,
16
16
  rollupOptions: {
17
- external: pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [],
17
+ external: [
18
+ ...(pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : []),
19
+ ],
18
20
  },
19
21
  },
20
22
  });