@metron-labs/quote-react 0.1.14 → 0.1.15

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.
@@ -1,12 +1,12 @@
1
- import{a as Ra,b as Y}from"./chunk-SQE76S5B.js";var im=Ra(et=>{"use strict";function vc(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,n=e[r];if(0<ll(n,t))e[r]=t,e[a]=n,a=r;else break e}}function Ua(e){return e.length===0?null:e[0]}function cl(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var r=0,n=e.length,i=n>>>1;r<i;){var o=2*(r+1)-1,l=e[o],c=o+1,u=e[c];if(0>ll(l,a))c<n&&0>ll(u,l)?(e[r]=u,e[c]=a,r=c):(e[r]=l,e[o]=a,r=o);else if(c<n&&0>ll(u,a))e[r]=u,e[c]=a,r=c;else break e}}return t}function ll(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}et.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Jd=performance,et.unstable_now=function(){return Jd.now()}):(gc=Date,Pd=gc.now(),et.unstable_now=function(){return gc.now()-Pd});var Jd,gc,Pd,Xa=[],br=[],Rw=1,ua=null,zt=3,wc=!1,Yn=!1,Xn=!1,yc=!1,Wd=typeof setTimeout=="function"?setTimeout:null,em=typeof clearTimeout=="function"?clearTimeout:null,Fd=typeof setImmediate<"u"?setImmediate:null;function sl(e){for(var t=Ua(br);t!==null;){if(t.callback===null)cl(br);else if(t.startTime<=e)cl(br),t.sortIndex=t.expirationTime,vc(Xa,t);else break;t=Ua(br)}}function _c(e){if(Xn=!1,sl(e),!Yn)if(Ua(Xa)!==null)Yn=!0,zi||(zi=!0,Ti());else{var t=Ua(br);t!==null&&xc(_c,t.startTime-e)}}var zi=!1,$n=-1,tm=5,am=-1;function rm(){return yc?!0:!(et.unstable_now()-am<tm)}function hc(){if(yc=!1,zi){var e=et.unstable_now();am=e;var t=!0;try{e:{Yn=!1,Xn&&(Xn=!1,em($n),$n=-1),wc=!0;var a=zt;try{t:{for(sl(e),ua=Ua(Xa);ua!==null&&!(ua.expirationTime>e&&rm());){var r=ua.callback;if(typeof r=="function"){ua.callback=null,zt=ua.priorityLevel;var n=r(ua.expirationTime<=e);if(e=et.unstable_now(),typeof n=="function"){ua.callback=n,sl(e),t=!0;break t}ua===Ua(Xa)&&cl(Xa),sl(e)}else cl(Xa);ua=Ua(Xa)}if(ua!==null)t=!0;else{var i=Ua(br);i!==null&&xc(_c,i.startTime-e),t=!1}}break e}finally{ua=null,zt=a,wc=!1}t=void 0}}finally{t?Ti():zi=!1}}}var Ti;typeof Fd=="function"?Ti=function(){Fd(hc)}:typeof MessageChannel<"u"?(bc=new MessageChannel,Id=bc.port2,bc.port1.onmessage=hc,Ti=function(){Id.postMessage(null)}):Ti=function(){Wd(hc,0)};var bc,Id;function xc(e,t){$n=Wd(function(){e(et.unstable_now())},t)}et.unstable_IdlePriority=5;et.unstable_ImmediatePriority=1;et.unstable_LowPriority=4;et.unstable_NormalPriority=3;et.unstable_Profiling=null;et.unstable_UserBlockingPriority=2;et.unstable_cancelCallback=function(e){e.callback=null};et.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):tm=0<e?Math.floor(1e3/e):5};et.unstable_getCurrentPriorityLevel=function(){return zt};et.unstable_next=function(e){switch(zt){case 1:case 2:case 3:var t=3;break;default:t=zt}var a=zt;zt=t;try{return e()}finally{zt=a}};et.unstable_requestPaint=function(){yc=!0};et.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=zt;zt=e;try{return t()}finally{zt=a}};et.unstable_scheduleCallback=function(e,t,a){var r=et.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?r+a:r):a=r,e){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=a+n,e={id:Rw++,callback:t,priorityLevel:e,startTime:a,expirationTime:n,sortIndex:-1},a>r?(e.sortIndex=a,vc(br,e),Ua(Xa)===null&&e===Ua(br)&&(Xn?(em($n),$n=-1):Xn=!0,xc(_c,a-r))):(e.sortIndex=n,vc(Xa,e),Yn||wc||(Yn=!0,zi||(zi=!0,Ti()))),e};et.unstable_shouldYield=rm;et.unstable_wrapCallback=function(e){var t=zt;return function(){var a=zt;zt=t;try{return e.apply(this,arguments)}finally{zt=a}}}});var om=Ra((V_,nm)=>{"use strict";nm.exports=im()});var bm=Ra(ge=>{"use strict";var Sc=Symbol.for("react.transitional.element"),Uw=Symbol.for("react.portal"),Dw=Symbol.for("react.fragment"),Bw=Symbol.for("react.strict_mode"),Ow=Symbol.for("react.profiler"),Lw=Symbol.for("react.consumer"),Hw=Symbol.for("react.context"),jw=Symbol.for("react.forward_ref"),Gw=Symbol.for("react.suspense"),Qw=Symbol.for("react.memo"),um=Symbol.for("react.lazy"),Yw=Symbol.for("react.activity"),lm=Symbol.iterator;function Xw(e){return e===null||typeof e!="object"?null:(e=lm&&e[lm]||e["@@iterator"],typeof e=="function"?e:null)}var dm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},mm=Object.assign,fm={};function Ri(e,t,a){this.props=e,this.context=t,this.refs=fm,this.updater=a||dm}Ri.prototype.isReactComponent={};Ri.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ri.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function gm(){}gm.prototype=Ri.prototype;function Cc(e,t,a){this.props=e,this.context=t,this.refs=fm,this.updater=a||dm}var qc=Cc.prototype=new gm;qc.constructor=Cc;mm(qc,Ri.prototype);qc.isPureReactComponent=!0;var sm=Array.isArray;function Nc(){}var Je={H:null,A:null,T:null,S:null},hm=Object.prototype.hasOwnProperty;function Ec(e,t,a){var r=a.ref;return{$$typeof:Sc,type:e,key:t,ref:r!==void 0?r:null,props:a}}function $w(e,t){return Ec(e.type,t,e.props)}function Mc(e){return typeof e=="object"&&e!==null&&e.$$typeof===Sc}function Vw(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var cm=/\/+/g;function kc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Vw(""+e.key):t.toString(36)}function Zw(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Nc,Nc):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Ai(e,t,a,r,n){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Sc:case Uw:o=!0;break;case um:return o=e._init,Ai(o(e._payload),t,a,r,n)}}if(o)return n=n(e),o=r===""?"."+kc(e,0):r,sm(n)?(a="",o!=null&&(a=o.replace(cm,"$&/")+"/"),Ai(n,t,a,"",function(u){return u})):n!=null&&(Mc(n)&&(n=$w(n,a+(n.key==null||e&&e.key===n.key?"":(""+n.key).replace(cm,"$&/")+"/")+o)),t.push(n)),1;o=0;var l=r===""?".":r+":";if(sm(e))for(var c=0;c<e.length;c++)r=e[c],i=l+kc(r,c),o+=Ai(r,t,a,i,n);else if(c=Xw(e),typeof c=="function")for(e=c.call(e),c=0;!(r=e.next()).done;)r=r.value,i=l+kc(r,c++),o+=Ai(r,t,a,i,n);else if(i==="object"){if(typeof e.then=="function")return Ai(Zw(e),t,a,r,n);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return o}function pl(e,t,a){if(e==null)return e;var r=[],n=0;return Ai(e,r,"","",function(i){return t.call(a,i,n++)}),r}function Kw(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){(e._status===0||e._status===-1)&&(e._status=1,e._result=a)},function(a){(e._status===0||e._status===-1)&&(e._status=2,e._result=a)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var pm=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Jw={map:pl,forEach:function(e,t,a){pl(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return pl(e,function(){t++}),t},toArray:function(e){return pl(e,function(t){return t})||[]},only:function(e){if(!Mc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ge.Activity=Yw;ge.Children=Jw;ge.Component=Ri;ge.Fragment=Dw;ge.Profiler=Ow;ge.PureComponent=Cc;ge.StrictMode=Bw;ge.Suspense=Gw;ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Je;ge.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Je.H.useMemoCache(e)}};ge.cache=function(e){return function(){return e.apply(null,arguments)}};ge.cacheSignal=function(){return null};ge.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=mm({},e.props),n=e.key;if(t!=null)for(i in t.key!==void 0&&(n=""+t.key),t)!hm.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(r[i]=t[i]);var i=arguments.length-2;if(i===1)r.children=a;else if(1<i){for(var o=Array(i),l=0;l<i;l++)o[l]=arguments[l+2];r.children=o}return Ec(e.type,n,r)};ge.createContext=function(e){return e={$$typeof:Hw,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Lw,_context:e},e};ge.createElement=function(e,t,a){var r,n={},i=null;if(t!=null)for(r in t.key!==void 0&&(i=""+t.key),t)hm.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(n[r]=t[r]);var o=arguments.length-2;if(o===1)n.children=a;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];n.children=l}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)n[r]===void 0&&(n[r]=o[r]);return Ec(e,i,n)};ge.createRef=function(){return{current:null}};ge.forwardRef=function(e){return{$$typeof:jw,render:e}};ge.isValidElement=Mc;ge.lazy=function(e){return{$$typeof:um,_payload:{_status:-1,_result:e},_init:Kw}};ge.memo=function(e,t){return{$$typeof:Qw,type:e,compare:t===void 0?null:t}};ge.startTransition=function(e){var t=Je.T,a={};Je.T=a;try{var r=e(),n=Je.S;n!==null&&n(a,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Nc,pm)}catch(i){pm(i)}finally{t!==null&&a.types!==null&&(t.types=a.types),Je.T=t}};ge.unstable_useCacheRefresh=function(){return Je.H.useCacheRefresh()};ge.use=function(e){return Je.H.use(e)};ge.useActionState=function(e,t,a){return Je.H.useActionState(e,t,a)};ge.useCallback=function(e,t){return Je.H.useCallback(e,t)};ge.useContext=function(e){return Je.H.useContext(e)};ge.useDebugValue=function(){};ge.useDeferredValue=function(e,t){return Je.H.useDeferredValue(e,t)};ge.useEffect=function(e,t){return Je.H.useEffect(e,t)};ge.useEffectEvent=function(e){return Je.H.useEffectEvent(e)};ge.useId=function(){return Je.H.useId()};ge.useImperativeHandle=function(e,t,a){return Je.H.useImperativeHandle(e,t,a)};ge.useInsertionEffect=function(e,t){return Je.H.useInsertionEffect(e,t)};ge.useLayoutEffect=function(e,t){return Je.H.useLayoutEffect(e,t)};ge.useMemo=function(e,t){return Je.H.useMemo(e,t)};ge.useOptimistic=function(e,t){return Je.H.useOptimistic(e,t)};ge.useReducer=function(e,t,a){return Je.H.useReducer(e,t,a)};ge.useRef=function(e){return Je.H.useRef(e)};ge.useState=function(e){return Je.H.useState(e)};ge.useSyncExternalStore=function(e,t,a){return Je.H.useSyncExternalStore(e,t,a)};ge.useTransition=function(){return Je.H.useTransition()};ge.version="19.2.3"});var $e=Ra((K_,vm)=>{"use strict";vm.exports=bm()});var ym=Ra(Ut=>{"use strict";var Pw=$e();function wm(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function vr(){}var Rt={d:{f:vr,r:function(){throw Error(wm(522))},D:vr,C:vr,L:vr,m:vr,X:vr,S:vr,M:vr},p:0,findDOMNode:null},Fw=Symbol.for("react.portal");function Iw(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Fw,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}var Vn=Pw.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function ul(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Rt;Ut.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(wm(299));return Iw(e,t,null,a)};Ut.flushSync=function(e){var t=Vn.T,a=Rt.p;try{if(Vn.T=null,Rt.p=2,e)return e()}finally{Vn.T=t,Rt.p=a,Rt.d.f()}};Ut.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Rt.d.C(e,t))};Ut.prefetchDNS=function(e){typeof e=="string"&&Rt.d.D(e)};Ut.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,r=ul(a,t.crossOrigin),n=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?Rt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:n,fetchPriority:i}):a==="script"&&Rt.d.X(e,{crossOrigin:r,integrity:n,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Ut.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=ul(t.as,t.crossOrigin);Rt.d.M(e,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Rt.d.M(e)};Ut.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,r=ul(a,t.crossOrigin);Rt.d.L(e,a,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Ut.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=ul(t.as,t.crossOrigin);Rt.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Rt.d.m(e)};Ut.requestFormReset=function(e){Rt.d.r(e)};Ut.unstable_batchedUpdates=function(e,t){return e(t)};Ut.useFormState=function(e,t,a){return Vn.H.useFormState(e,t,a)};Ut.useFormStatus=function(){return Vn.H.useHostTransitionStatus()};Ut.version="19.2.3"});var km=Ra((P_,xm)=>{"use strict";function _m(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_m)}catch(e){console.error(e)}}_m(),xm.exports=ym()});var Bb=Ra(Bs=>{"use strict";var bt=om(),Pf=$e(),Ww=km();function D(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Ff(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ro(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function If(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Wf(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Nm(e){if(Ro(e)!==e)throw Error(D(188))}function e0(e){var t=e.alternate;if(!t){if(t=Ro(e),t===null)throw Error(D(188));return t!==e?null:e}for(var a=e,r=t;;){var n=a.return;if(n===null)break;var i=n.alternate;if(i===null){if(r=n.return,r!==null){a=r;continue}break}if(n.child===i.child){for(i=n.child;i;){if(i===a)return Nm(n),e;if(i===r)return Nm(n),t;i=i.sibling}throw Error(D(188))}if(a.return!==r.return)a=n,r=i;else{for(var o=!1,l=n.child;l;){if(l===a){o=!0,a=n,r=i;break}if(l===r){o=!0,r=n,a=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===a){o=!0,a=i,r=n;break}if(l===r){o=!0,r=i,a=n;break}l=l.sibling}if(!o)throw Error(D(189))}}if(a.alternate!==r)throw Error(D(190))}if(a.tag!==3)throw Error(D(188));return a.stateNode.current===a?e:t}function eg(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=eg(e),t!==null)return t;e=e.sibling}return null}var Ie=Object.assign,t0=Symbol.for("react.element"),dl=Symbol.for("react.transitional.element"),eo=Symbol.for("react.portal"),Hi=Symbol.for("react.fragment"),tg=Symbol.for("react.strict_mode"),cp=Symbol.for("react.profiler"),ag=Symbol.for("react.consumer"),Ia=Symbol.for("react.context"),iu=Symbol.for("react.forward_ref"),pp=Symbol.for("react.suspense"),up=Symbol.for("react.suspense_list"),nu=Symbol.for("react.memo"),wr=Symbol.for("react.lazy"),dp=Symbol.for("react.activity"),a0=Symbol.for("react.memo_cache_sentinel"),Sm=Symbol.iterator;function Zn(e){return e===null||typeof e!="object"?null:(e=Sm&&e[Sm]||e["@@iterator"],typeof e=="function"?e:null)}var r0=Symbol.for("react.client.reference");function mp(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===r0?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Hi:return"Fragment";case cp:return"Profiler";case tg:return"StrictMode";case pp:return"Suspense";case up:return"SuspenseList";case dp:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case eo:return"Portal";case Ia:return e.displayName||"Context";case ag:return(e._context.displayName||"Context")+".Consumer";case iu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case nu:return t=e.displayName||null,t!==null?t:mp(e.type)||"Memo";case wr:t=e._payload,e=e._init;try{return mp(e(t))}catch{}}return null}var to=Array.isArray,de=Pf.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Re=Ww.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ti={pending:!1,data:null,method:null,action:null},fp=[],ji=-1;function Ha(e){return{current:e}}function _t(e){0>ji||(e.current=fp[ji],fp[ji]=null,ji--)}function Ve(e,t){ji++,fp[ji]=e.current,e.current=t}var La=Ha(null),wo=Ha(null),Tr=Ha(null),$l=Ha(null);function Vl(e,t){switch(Ve(Tr,t),Ve(wo,e),Ve(La,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Rf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Rf(t),e=xb(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}_t(La),Ve(La,e)}function nn(){_t(La),_t(wo),_t(Tr)}function gp(e){e.memoizedState!==null&&Ve($l,e);var t=La.current,a=xb(t,e.type);t!==a&&(Ve(wo,e),Ve(La,a))}function Zl(e){wo.current===e&&(_t(La),_t(wo)),$l.current===e&&(_t($l),To._currentValue=ti)}var Tc,Cm;function Fr(e){if(Tc===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Tc=t&&t[1]||"",Cm=-1<a.stack.indexOf(`
1
+ import{a as Ra,b as Y}from"./chunk-SQE76S5B.js";var im=Ra(We=>{"use strict";function vc(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,n=e[r];if(0<ll(n,t))e[r]=t,e[a]=n,a=r;else break e}}function Ua(e){return e.length===0?null:e[0]}function cl(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var r=0,n=e.length,i=n>>>1;r<i;){var o=2*(r+1)-1,l=e[o],c=o+1,p=e[c];if(0>ll(l,a))c<n&&0>ll(p,l)?(e[r]=p,e[c]=a,r=c):(e[r]=l,e[o]=a,r=o);else if(c<n&&0>ll(p,a))e[r]=p,e[c]=a,r=c;else break e}}return t}function ll(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}We.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Jd=performance,We.unstable_now=function(){return Jd.now()}):(gc=Date,Pd=gc.now(),We.unstable_now=function(){return gc.now()-Pd});var Jd,gc,Pd,$a=[],br=[],Rw=1,pa=null,At=3,wc=!1,Yn=!1,Xn=!1,yc=!1,Wd=typeof setTimeout=="function"?setTimeout:null,em=typeof clearTimeout=="function"?clearTimeout:null,Fd=typeof setImmediate<"u"?setImmediate:null;function sl(e){for(var t=Ua(br);t!==null;){if(t.callback===null)cl(br);else if(t.startTime<=e)cl(br),t.sortIndex=t.expirationTime,vc($a,t);else break;t=Ua(br)}}function _c(e){if(Xn=!1,sl(e),!Yn)if(Ua($a)!==null)Yn=!0,zi||(zi=!0,Ti());else{var t=Ua(br);t!==null&&xc(_c,t.startTime-e)}}var zi=!1,$n=-1,tm=5,am=-1;function rm(){return yc?!0:!(We.unstable_now()-am<tm)}function hc(){if(yc=!1,zi){var e=We.unstable_now();am=e;var t=!0;try{e:{Yn=!1,Xn&&(Xn=!1,em($n),$n=-1),wc=!0;var a=At;try{t:{for(sl(e),pa=Ua($a);pa!==null&&!(pa.expirationTime>e&&rm());){var r=pa.callback;if(typeof r=="function"){pa.callback=null,At=pa.priorityLevel;var n=r(pa.expirationTime<=e);if(e=We.unstable_now(),typeof n=="function"){pa.callback=n,sl(e),t=!0;break t}pa===Ua($a)&&cl($a),sl(e)}else cl($a);pa=Ua($a)}if(pa!==null)t=!0;else{var i=Ua(br);i!==null&&xc(_c,i.startTime-e),t=!1}}break e}finally{pa=null,At=a,wc=!1}t=void 0}}finally{t?Ti():zi=!1}}}var Ti;typeof Fd=="function"?Ti=function(){Fd(hc)}:typeof MessageChannel<"u"?(bc=new MessageChannel,Id=bc.port2,bc.port1.onmessage=hc,Ti=function(){Id.postMessage(null)}):Ti=function(){Wd(hc,0)};var bc,Id;function xc(e,t){$n=Wd(function(){e(We.unstable_now())},t)}We.unstable_IdlePriority=5;We.unstable_ImmediatePriority=1;We.unstable_LowPriority=4;We.unstable_NormalPriority=3;We.unstable_Profiling=null;We.unstable_UserBlockingPriority=2;We.unstable_cancelCallback=function(e){e.callback=null};We.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):tm=0<e?Math.floor(1e3/e):5};We.unstable_getCurrentPriorityLevel=function(){return At};We.unstable_next=function(e){switch(At){case 1:case 2:case 3:var t=3;break;default:t=At}var a=At;At=t;try{return e()}finally{At=a}};We.unstable_requestPaint=function(){yc=!0};We.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=At;At=e;try{return t()}finally{At=a}};We.unstable_scheduleCallback=function(e,t,a){var r=We.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?r+a:r):a=r,e){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=a+n,e={id:Rw++,callback:t,priorityLevel:e,startTime:a,expirationTime:n,sortIndex:-1},a>r?(e.sortIndex=a,vc(br,e),Ua($a)===null&&e===Ua(br)&&(Xn?(em($n),$n=-1):Xn=!0,xc(_c,a-r))):(e.sortIndex=n,vc($a,e),Yn||wc||(Yn=!0,zi||(zi=!0,Ti()))),e};We.unstable_shouldYield=rm;We.unstable_wrapCallback=function(e){var t=At;return function(){var a=At;At=t;try{return e.apply(this,arguments)}finally{At=a}}}});var om=Ra((V_,nm)=>{"use strict";nm.exports=im()});var bm=Ra(ge=>{"use strict";var Sc=Symbol.for("react.transitional.element"),Uw=Symbol.for("react.portal"),Dw=Symbol.for("react.fragment"),Bw=Symbol.for("react.strict_mode"),Ow=Symbol.for("react.profiler"),Lw=Symbol.for("react.consumer"),Hw=Symbol.for("react.context"),jw=Symbol.for("react.forward_ref"),Gw=Symbol.for("react.suspense"),Qw=Symbol.for("react.memo"),pm=Symbol.for("react.lazy"),Yw=Symbol.for("react.activity"),lm=Symbol.iterator;function Xw(e){return e===null||typeof e!="object"?null:(e=lm&&e[lm]||e["@@iterator"],typeof e=="function"?e:null)}var dm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},mm=Object.assign,fm={};function Ri(e,t,a){this.props=e,this.context=t,this.refs=fm,this.updater=a||dm}Ri.prototype.isReactComponent={};Ri.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ri.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function gm(){}gm.prototype=Ri.prototype;function Cc(e,t,a){this.props=e,this.context=t,this.refs=fm,this.updater=a||dm}var qc=Cc.prototype=new gm;qc.constructor=Cc;mm(qc,Ri.prototype);qc.isPureReactComponent=!0;var sm=Array.isArray;function Nc(){}var Ke={H:null,A:null,T:null,S:null},hm=Object.prototype.hasOwnProperty;function Ec(e,t,a){var r=a.ref;return{$$typeof:Sc,type:e,key:t,ref:r!==void 0?r:null,props:a}}function $w(e,t){return Ec(e.type,t,e.props)}function Mc(e){return typeof e=="object"&&e!==null&&e.$$typeof===Sc}function Vw(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var cm=/\/+/g;function kc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Vw(""+e.key):t.toString(36)}function Zw(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Nc,Nc):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Ai(e,t,a,r,n){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Sc:case Uw:o=!0;break;case pm:return o=e._init,Ai(o(e._payload),t,a,r,n)}}if(o)return n=n(e),o=r===""?"."+kc(e,0):r,sm(n)?(a="",o!=null&&(a=o.replace(cm,"$&/")+"/"),Ai(n,t,a,"",function(p){return p})):n!=null&&(Mc(n)&&(n=$w(n,a+(n.key==null||e&&e.key===n.key?"":(""+n.key).replace(cm,"$&/")+"/")+o)),t.push(n)),1;o=0;var l=r===""?".":r+":";if(sm(e))for(var c=0;c<e.length;c++)r=e[c],i=l+kc(r,c),o+=Ai(r,t,a,i,n);else if(c=Xw(e),typeof c=="function")for(e=c.call(e),c=0;!(r=e.next()).done;)r=r.value,i=l+kc(r,c++),o+=Ai(r,t,a,i,n);else if(i==="object"){if(typeof e.then=="function")return Ai(Zw(e),t,a,r,n);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return o}function ul(e,t,a){if(e==null)return e;var r=[],n=0;return Ai(e,r,"","",function(i){return t.call(a,i,n++)}),r}function Kw(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){(e._status===0||e._status===-1)&&(e._status=1,e._result=a)},function(a){(e._status===0||e._status===-1)&&(e._status=2,e._result=a)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var um=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Jw={map:ul,forEach:function(e,t,a){ul(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return ul(e,function(){t++}),t},toArray:function(e){return ul(e,function(t){return t})||[]},only:function(e){if(!Mc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ge.Activity=Yw;ge.Children=Jw;ge.Component=Ri;ge.Fragment=Dw;ge.Profiler=Ow;ge.PureComponent=Cc;ge.StrictMode=Bw;ge.Suspense=Gw;ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ke;ge.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Ke.H.useMemoCache(e)}};ge.cache=function(e){return function(){return e.apply(null,arguments)}};ge.cacheSignal=function(){return null};ge.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=mm({},e.props),n=e.key;if(t!=null)for(i in t.key!==void 0&&(n=""+t.key),t)!hm.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(r[i]=t[i]);var i=arguments.length-2;if(i===1)r.children=a;else if(1<i){for(var o=Array(i),l=0;l<i;l++)o[l]=arguments[l+2];r.children=o}return Ec(e.type,n,r)};ge.createContext=function(e){return e={$$typeof:Hw,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Lw,_context:e},e};ge.createElement=function(e,t,a){var r,n={},i=null;if(t!=null)for(r in t.key!==void 0&&(i=""+t.key),t)hm.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(n[r]=t[r]);var o=arguments.length-2;if(o===1)n.children=a;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];n.children=l}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)n[r]===void 0&&(n[r]=o[r]);return Ec(e,i,n)};ge.createRef=function(){return{current:null}};ge.forwardRef=function(e){return{$$typeof:jw,render:e}};ge.isValidElement=Mc;ge.lazy=function(e){return{$$typeof:pm,_payload:{_status:-1,_result:e},_init:Kw}};ge.memo=function(e,t){return{$$typeof:Qw,type:e,compare:t===void 0?null:t}};ge.startTransition=function(e){var t=Ke.T,a={};Ke.T=a;try{var r=e(),n=Ke.S;n!==null&&n(a,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Nc,um)}catch(i){um(i)}finally{t!==null&&a.types!==null&&(t.types=a.types),Ke.T=t}};ge.unstable_useCacheRefresh=function(){return Ke.H.useCacheRefresh()};ge.use=function(e){return Ke.H.use(e)};ge.useActionState=function(e,t,a){return Ke.H.useActionState(e,t,a)};ge.useCallback=function(e,t){return Ke.H.useCallback(e,t)};ge.useContext=function(e){return Ke.H.useContext(e)};ge.useDebugValue=function(){};ge.useDeferredValue=function(e,t){return Ke.H.useDeferredValue(e,t)};ge.useEffect=function(e,t){return Ke.H.useEffect(e,t)};ge.useEffectEvent=function(e){return Ke.H.useEffectEvent(e)};ge.useId=function(){return Ke.H.useId()};ge.useImperativeHandle=function(e,t,a){return Ke.H.useImperativeHandle(e,t,a)};ge.useInsertionEffect=function(e,t){return Ke.H.useInsertionEffect(e,t)};ge.useLayoutEffect=function(e,t){return Ke.H.useLayoutEffect(e,t)};ge.useMemo=function(e,t){return Ke.H.useMemo(e,t)};ge.useOptimistic=function(e,t){return Ke.H.useOptimistic(e,t)};ge.useReducer=function(e,t,a){return Ke.H.useReducer(e,t,a)};ge.useRef=function(e){return Ke.H.useRef(e)};ge.useState=function(e){return Ke.H.useState(e)};ge.useSyncExternalStore=function(e,t,a){return Ke.H.useSyncExternalStore(e,t,a)};ge.useTransition=function(){return Ke.H.useTransition()};ge.version="19.2.3"});var Xe=Ra((K_,vm)=>{"use strict";vm.exports=bm()});var ym=Ra(Ut=>{"use strict";var Pw=Xe();function wm(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function vr(){}var Rt={d:{f:vr,r:function(){throw Error(wm(522))},D:vr,C:vr,L:vr,m:vr,X:vr,S:vr,M:vr},p:0,findDOMNode:null},Fw=Symbol.for("react.portal");function Iw(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Fw,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}var Vn=Pw.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function pl(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Rt;Ut.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(wm(299));return Iw(e,t,null,a)};Ut.flushSync=function(e){var t=Vn.T,a=Rt.p;try{if(Vn.T=null,Rt.p=2,e)return e()}finally{Vn.T=t,Rt.p=a,Rt.d.f()}};Ut.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Rt.d.C(e,t))};Ut.prefetchDNS=function(e){typeof e=="string"&&Rt.d.D(e)};Ut.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,r=pl(a,t.crossOrigin),n=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?Rt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:n,fetchPriority:i}):a==="script"&&Rt.d.X(e,{crossOrigin:r,integrity:n,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Ut.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=pl(t.as,t.crossOrigin);Rt.d.M(e,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Rt.d.M(e)};Ut.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,r=pl(a,t.crossOrigin);Rt.d.L(e,a,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Ut.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=pl(t.as,t.crossOrigin);Rt.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Rt.d.m(e)};Ut.requestFormReset=function(e){Rt.d.r(e)};Ut.unstable_batchedUpdates=function(e,t){return e(t)};Ut.useFormState=function(e,t,a){return Vn.H.useFormState(e,t,a)};Ut.useFormStatus=function(){return Vn.H.useHostTransitionStatus()};Ut.version="19.2.3"});var km=Ra((P_,xm)=>{"use strict";function _m(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_m)}catch(e){console.error(e)}}_m(),xm.exports=ym()});var Bb=Ra(Bs=>{"use strict";var ft=om(),Pf=Xe(),Ww=km();function D(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Ff(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ro(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function If(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Wf(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Nm(e){if(Ro(e)!==e)throw Error(D(188))}function e0(e){var t=e.alternate;if(!t){if(t=Ro(e),t===null)throw Error(D(188));return t!==e?null:e}for(var a=e,r=t;;){var n=a.return;if(n===null)break;var i=n.alternate;if(i===null){if(r=n.return,r!==null){a=r;continue}break}if(n.child===i.child){for(i=n.child;i;){if(i===a)return Nm(n),e;if(i===r)return Nm(n),t;i=i.sibling}throw Error(D(188))}if(a.return!==r.return)a=n,r=i;else{for(var o=!1,l=n.child;l;){if(l===a){o=!0,a=n,r=i;break}if(l===r){o=!0,r=n,a=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===a){o=!0,a=i,r=n;break}if(l===r){o=!0,r=i,a=n;break}l=l.sibling}if(!o)throw Error(D(189))}}if(a.alternate!==r)throw Error(D(190))}if(a.tag!==3)throw Error(D(188));return a.stateNode.current===a?e:t}function eg(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=eg(e),t!==null)return t;e=e.sibling}return null}var Fe=Object.assign,t0=Symbol.for("react.element"),dl=Symbol.for("react.transitional.element"),eo=Symbol.for("react.portal"),Hi=Symbol.for("react.fragment"),tg=Symbol.for("react.strict_mode"),cu=Symbol.for("react.profiler"),ag=Symbol.for("react.consumer"),Wa=Symbol.for("react.context"),ip=Symbol.for("react.forward_ref"),uu=Symbol.for("react.suspense"),pu=Symbol.for("react.suspense_list"),np=Symbol.for("react.memo"),wr=Symbol.for("react.lazy"),du=Symbol.for("react.activity"),a0=Symbol.for("react.memo_cache_sentinel"),Sm=Symbol.iterator;function Zn(e){return e===null||typeof e!="object"?null:(e=Sm&&e[Sm]||e["@@iterator"],typeof e=="function"?e:null)}var r0=Symbol.for("react.client.reference");function mu(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===r0?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Hi:return"Fragment";case cu:return"Profiler";case tg:return"StrictMode";case uu:return"Suspense";case pu:return"SuspenseList";case du:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case eo:return"Portal";case Wa:return e.displayName||"Context";case ag:return(e._context.displayName||"Context")+".Consumer";case ip:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case np:return t=e.displayName||null,t!==null?t:mu(e.type)||"Memo";case wr:t=e._payload,e=e._init;try{return mu(e(t))}catch{}}return null}var to=Array.isArray,me=Pf.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ae=Ww.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ti={pending:!1,data:null,method:null,action:null},fu=[],ji=-1;function Ha(e){return{current:e}}function wt(e){0>ji||(e.current=fu[ji],fu[ji]=null,ji--)}function $e(e,t){ji++,fu[ji]=e.current,e.current=t}var La=Ha(null),wo=Ha(null),Tr=Ha(null),$l=Ha(null);function Vl(e,t){switch($e(Tr,t),$e(wo,e),$e(La,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Rf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Rf(t),e=xb(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}wt(La),$e(La,e)}function nn(){wt(La),wt(wo),wt(Tr)}function gu(e){e.memoizedState!==null&&$e($l,e);var t=La.current,a=xb(t,e.type);t!==a&&($e(wo,e),$e(La,a))}function Zl(e){wo.current===e&&(wt(La),wt(wo)),$l.current===e&&(wt($l),To._currentValue=ti)}var Tc,Cm;function Fr(e){if(Tc===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Tc=t&&t[1]||"",Cm=-1<a.stack.indexOf(`
2
2
  at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+Tc+e+Cm}var zc=!1;function Ac(e,t){if(!e||zc)return"";zc=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var b=function(){throw Error()};if(Object.defineProperty(b.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(b,[])}catch(h){var d=h}Reflect.construct(e,[],b)}else{try{b.call()}catch(h){d=h}e.call(b.prototype)}}else{try{throw Error()}catch(h){d=h}(b=e())&&typeof b.catch=="function"&&b.catch(function(){})}}catch(h){if(h&&d&&typeof h.stack=="string")return[h.stack,d.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=r.DetermineComponentFrameRoot(),o=i[0],l=i[1];if(o&&l){var c=o.split(`
4
- `),u=l.split(`
5
- `);for(n=r=0;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;for(;n<u.length&&!u[n].includes("DetermineComponentFrameRoot");)n++;if(r===c.length||n===u.length)for(r=c.length-1,n=u.length-1;1<=r&&0<=n&&c[r]!==u[n];)n--;for(;1<=r&&0<=n;r--,n--)if(c[r]!==u[n]){if(r!==1||n!==1)do if(r--,n--,0>n||c[r]!==u[n]){var f=`
3
+ `+Tc+e+Cm}var zc=!1;function Ac(e,t){if(!e||zc)return"";zc=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var v=function(){throw Error()};if(Object.defineProperty(v.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(v,[])}catch(h){var m=h}Reflect.construct(e,[],v)}else{try{v.call()}catch(h){m=h}e.call(v.prototype)}}else{try{throw Error()}catch(h){m=h}(v=e())&&typeof v.catch=="function"&&v.catch(function(){})}}catch(h){if(h&&m&&typeof h.stack=="string")return[h.stack,m.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=r.DetermineComponentFrameRoot(),o=i[0],l=i[1];if(o&&l){var c=o.split(`
4
+ `),p=l.split(`
5
+ `);for(n=r=0;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;for(;n<p.length&&!p[n].includes("DetermineComponentFrameRoot");)n++;if(r===c.length||n===p.length)for(r=c.length-1,n=p.length-1;1<=r&&0<=n&&c[r]!==p[n];)n--;for(;1<=r&&0<=n;r--,n--)if(c[r]!==p[n]){if(r!==1||n!==1)do if(r--,n--,0>n||c[r]!==p[n]){var f=`
6
6
  `+c[r].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),f}while(1<=r&&0<=n);break}}}finally{zc=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Fr(a):""}function i0(e,t){switch(e.tag){case 26:case 27:case 5:return Fr(e.type);case 16:return Fr("Lazy");case 13:return e.child!==t&&t!==null?Fr("Suspense Fallback"):Fr("Suspense");case 19:return Fr("SuspenseList");case 0:case 15:return Ac(e.type,!1);case 11:return Ac(e.type.render,!1);case 1:return Ac(e.type,!0);case 31:return Fr("Activity");default:return""}}function qm(e){try{var t="",a=null;do t+=i0(e,a),a=e,e=e.return;while(e);return t}catch(r){return`
7
7
  Error generating stack: `+r.message+`
8
- `+r.stack}}var hp=Object.prototype.hasOwnProperty,ou=bt.unstable_scheduleCallback,Rc=bt.unstable_cancelCallback,n0=bt.unstable_shouldYield,o0=bt.unstable_requestPaint,ta=bt.unstable_now,l0=bt.unstable_getCurrentPriorityLevel,rg=bt.unstable_ImmediatePriority,ig=bt.unstable_UserBlockingPriority,Kl=bt.unstable_NormalPriority,s0=bt.unstable_LowPriority,ng=bt.unstable_IdlePriority,c0=bt.log,p0=bt.unstable_setDisableYieldValue,Uo=null,aa=null;function Sr(e){if(typeof c0=="function"&&p0(e),aa&&typeof aa.setStrictMode=="function")try{aa.setStrictMode(Uo,e)}catch{}}var ra=Math.clz32?Math.clz32:m0,u0=Math.log,d0=Math.LN2;function m0(e){return e>>>=0,e===0?32:31-(u0(e)/d0|0)|0}var ml=256,fl=262144,gl=4194304;function Ir(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ys(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=r&134217727;return l!==0?(r=l&~i,r!==0?n=Ir(r):(o&=l,o!==0?n=Ir(o):a||(a=l&~e,a!==0&&(n=Ir(a))))):(l=r&~i,l!==0?n=Ir(l):o!==0?n=Ir(o):a||(a=r&~e,a!==0&&(n=Ir(a)))),n===0?0:t!==0&&t!==n&&(t&i)===0&&(i=n&-n,a=t&-t,i>=a||i===32&&(a&4194048)!==0)?t:n}function Do(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function f0(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function og(){var e=gl;return gl<<=1,(gl&62914560)===0&&(gl=4194304),e}function Uc(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Bo(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function g0(e,t,a,r,n,i){var o=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(a=o&~a;0<a;){var f=31-ra(a),b=1<<f;l[f]=0,c[f]=-1;var d=u[f];if(d!==null)for(u[f]=null,f=0;f<d.length;f++){var h=d[f];h!==null&&(h.lane&=-536870913)}a&=~b}r!==0&&lg(e,r,0),i!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=i&~(o&~t))}function lg(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ra(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function sg(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-ra(a),n=1<<r;n&t|e[r]&t&&(e[r]|=t),a&=~n}}function cg(e,t){var a=t&-t;return a=(a&42)!==0?1:lu(a),(a&(e.suspendedLanes|t))!==0?0:a}function lu(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function su(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function pg(){var e=Re.p;return e!==0?e:(e=window.event,e===void 0?32:Rb(e.type))}function Em(e,t){var a=Re.p;try{return Re.p=e,t()}finally{Re.p=a}}var Yr=Math.random().toString(36).slice(2),Nt="__reactFiber$"+Yr,Xt="__reactProps$"+Yr,hn="__reactContainer$"+Yr,bp="__reactEvents$"+Yr,h0="__reactListeners$"+Yr,b0="__reactHandles$"+Yr,Mm="__reactResources$"+Yr,Oo="__reactMarker$"+Yr;function cu(e){delete e[Nt],delete e[Xt],delete e[bp],delete e[h0],delete e[b0]}function Gi(e){var t=e[Nt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[hn]||a[Nt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Lf(e);e!==null;){if(a=e[Nt])return a;e=Lf(e)}return t}e=a,a=e.parentNode}return null}function bn(e){if(e=e[Nt]||e[hn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ao(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(D(33))}function Fi(e){var t=e[Mm];return t||(t=e[Mm]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function yt(e){e[Oo]=!0}var ug=new Set,dg={};function ui(e,t){on(e,t),on(e+"Capture",t)}function on(e,t){for(dg[e]=t,e=0;e<t.length;e++)ug.add(t[e])}var v0=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Tm={},zm={};function w0(e){return hp.call(zm,e)?!0:hp.call(Tm,e)?!1:v0.test(e)?zm[e]=!0:(Tm[e]=!0,!1)}function Tl(e,t,a){if(w0(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function hl(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function $a(e,t,a,r){if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+r)}}function ma(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function mg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function y0(e,t,a){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var n=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(o){a=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(o){a=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function vp(e){if(!e._valueTracker){var t=mg(e)?"checked":"value";e._valueTracker=y0(e,t,""+e[t])}}function fg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=mg(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function Jl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var _0=/[\n"\\]/g;function ha(e){return e.replace(_0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function wp(e,t,a,r,n,i,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ma(t)):e.value!==""+ma(t)&&(e.value=""+ma(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?yp(e,o,ma(t)):a!=null?yp(e,o,ma(a)):r!=null&&e.removeAttribute("value"),n==null&&i!=null&&(e.defaultChecked=!!i),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+ma(l):e.removeAttribute("name")}function gg(e,t,a,r,n,i,o,l){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||a!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){vp(e);return}a=a!=null?""+ma(a):"",t=t!=null?""+ma(t):a,l||t===e.value||(e.value=t),e.defaultValue=t}r=r??n,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=l?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),vp(e)}function yp(e,t,a){t==="number"&&Jl(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Ii(e,t,a,r){if(e=e.options,t){t={};for(var n=0;n<a.length;n++)t["$"+a[n]]=!0;for(a=0;a<e.length;a++)n=t.hasOwnProperty("$"+e[a].value),e[a].selected!==n&&(e[a].selected=n),n&&r&&(e[a].defaultSelected=!0)}else{for(a=""+ma(a),t=null,n=0;n<e.length;n++){if(e[n].value===a){e[n].selected=!0,r&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function hg(e,t,a){if(t!=null&&(t=""+ma(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+ma(a):""}function bg(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(D(92));if(to(r)){if(1<r.length)throw Error(D(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=ma(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),vp(e)}function ln(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var x0=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Am(e,t,a){var r=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,a):typeof a!="number"||a===0||x0.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function vg(e,t,a){if(t!=null&&typeof t!="object")throw Error(D(62));if(e=e.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var n in t)r=t[n],t.hasOwnProperty(n)&&a[n]!==r&&Am(e,n,r)}else for(var i in t)t.hasOwnProperty(i)&&Am(e,i,t[i])}function pu(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var k0=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),N0=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function zl(e){return N0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Wa(){}var _p=null;function uu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qi=null,Wi=null;function Rm(e){var t=bn(e);if(t&&(e=t.stateNode)){var a=e[Xt]||null;e:switch(e=t.stateNode,t.type){case"input":if(wp(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+ha(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var n=r[Xt]||null;if(!n)throw Error(D(90));wp(r,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&fg(r)}break e;case"textarea":hg(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Ii(e,!!a.multiple,t,!1)}}}var Dc=!1;function wg(e,t,a){if(Dc)return e(t,a);Dc=!0;try{var r=e(t);return r}finally{if(Dc=!1,(Qi!==null||Wi!==null)&&(As(),Qi&&(t=Qi,e=Wi,Wi=Qi=null,Rm(t),e)))for(t=0;t<e.length;t++)Rm(e[t])}}function yo(e,t){var a=e.stateNode;if(a===null)return null;var r=a[Xt]||null;if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(D(231,t,typeof a));return a}var ir=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xp=!1;if(ir)try{Ui={},Object.defineProperty(Ui,"passive",{get:function(){xp=!0}}),window.addEventListener("test",Ui,Ui),window.removeEventListener("test",Ui,Ui)}catch{xp=!1}var Ui,Cr=null,du=null,Al=null;function yg(){if(Al)return Al;var e,t=du,a=t.length,r,n="value"in Cr?Cr.value:Cr.textContent,i=n.length;for(e=0;e<a&&t[e]===n[e];e++);var o=a-e;for(r=1;r<=o&&t[a-r]===n[i-r];r++);return Al=n.slice(e,1<r?1-r:void 0)}function Rl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function bl(){return!0}function Um(){return!1}function $t(e){function t(a,r,n,i,o){this._reactName=a,this._targetInst=n,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(a=e[l],this[l]=a?a(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?bl:Um,this.isPropagationStopped=Um,this}return Ie(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=bl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=bl)},persist:function(){},isPersistent:bl}),t}var di={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_s=$t(di),Lo=Ie({},di,{view:0,detail:0}),S0=$t(Lo),Bc,Oc,Kn,xs=Ie({},Lo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Kn&&(Kn&&e.type==="mousemove"?(Bc=e.screenX-Kn.screenX,Oc=e.screenY-Kn.screenY):Oc=Bc=0,Kn=e),Bc)},movementY:function(e){return"movementY"in e?e.movementY:Oc}}),Dm=$t(xs),C0=Ie({},xs,{dataTransfer:0}),q0=$t(C0),E0=Ie({},Lo,{relatedTarget:0}),Lc=$t(E0),M0=Ie({},di,{animationName:0,elapsedTime:0,pseudoElement:0}),T0=$t(M0),z0=Ie({},di,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),A0=$t(z0),R0=Ie({},di,{data:0}),Bm=$t(R0),U0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},D0={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},B0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function O0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=B0[e])?!!t[e]:!1}function mu(){return O0}var L0=Ie({},Lo,{key:function(e){if(e.key){var t=U0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Rl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?D0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mu,charCode:function(e){return e.type==="keypress"?Rl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Rl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),H0=$t(L0),j0=Ie({},xs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Om=$t(j0),G0=Ie({},Lo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mu}),Q0=$t(G0),Y0=Ie({},di,{propertyName:0,elapsedTime:0,pseudoElement:0}),X0=$t(Y0),$0=Ie({},xs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),V0=$t($0),Z0=Ie({},di,{newState:0,oldState:0}),K0=$t(Z0),J0=[9,13,27,32],fu=ir&&"CompositionEvent"in window,no=null;ir&&"documentMode"in document&&(no=document.documentMode);var P0=ir&&"TextEvent"in window&&!no,_g=ir&&(!fu||no&&8<no&&11>=no),Lm=" ",Hm=!1;function xg(e,t){switch(e){case"keyup":return J0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Yi=!1;function F0(e,t){switch(e){case"compositionend":return kg(t);case"keypress":return t.which!==32?null:(Hm=!0,Lm);case"textInput":return e=t.data,e===Lm&&Hm?null:e;default:return null}}function I0(e,t){if(Yi)return e==="compositionend"||!fu&&xg(e,t)?(e=yg(),Al=du=Cr=null,Yi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return _g&&t.locale!=="ko"?null:t.data;default:return null}}var W0={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function jm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!W0[e.type]:t==="textarea"}function Ng(e,t,a,r){Qi?Wi?Wi.push(r):Wi=[r]:Qi=r,t=ms(t,"onChange"),0<t.length&&(a=new _s("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var oo=null,_o=null;function ey(e){wb(e,0)}function ks(e){var t=ao(e);if(fg(t))return e}function Gm(e,t){if(e==="change")return t}var Sg=!1;ir&&(ir?(wl="oninput"in document,wl||(Hc=document.createElement("div"),Hc.setAttribute("oninput","return;"),wl=typeof Hc.oninput=="function"),vl=wl):vl=!1,Sg=vl&&(!document.documentMode||9<document.documentMode));var vl,wl,Hc;function Qm(){oo&&(oo.detachEvent("onpropertychange",Cg),_o=oo=null)}function Cg(e){if(e.propertyName==="value"&&ks(_o)){var t=[];Ng(t,_o,e,uu(e)),wg(ey,t)}}function ty(e,t,a){e==="focusin"?(Qm(),oo=t,_o=a,oo.attachEvent("onpropertychange",Cg)):e==="focusout"&&Qm()}function ay(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ks(_o)}function ry(e,t){if(e==="click")return ks(t)}function iy(e,t){if(e==="input"||e==="change")return ks(t)}function ny(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var na=typeof Object.is=="function"?Object.is:ny;function xo(e,t){if(na(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var n=a[r];if(!hp.call(t,n)||!na(e[n],t[n]))return!1}return!0}function Ym(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xm(e,t){var a=Ym(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Ym(a)}}function qg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Eg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Jl(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Jl(e.document)}return t}function gu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var oy=ir&&"documentMode"in document&&11>=document.documentMode,Xi=null,kp=null,lo=null,Np=!1;function $m(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Np||Xi==null||Xi!==Jl(r)||(r=Xi,"selectionStart"in r&&gu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),lo&&xo(lo,r)||(lo=r,r=ms(kp,"onSelect"),0<r.length&&(t=new _s("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Xi)))}function Pr(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var $i={animationend:Pr("Animation","AnimationEnd"),animationiteration:Pr("Animation","AnimationIteration"),animationstart:Pr("Animation","AnimationStart"),transitionrun:Pr("Transition","TransitionRun"),transitionstart:Pr("Transition","TransitionStart"),transitioncancel:Pr("Transition","TransitionCancel"),transitionend:Pr("Transition","TransitionEnd")},jc={},Mg={};ir&&(Mg=document.createElement("div").style,"AnimationEvent"in window||(delete $i.animationend.animation,delete $i.animationiteration.animation,delete $i.animationstart.animation),"TransitionEvent"in window||delete $i.transitionend.transition);function mi(e){if(jc[e])return jc[e];if(!$i[e])return e;var t=$i[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Mg)return jc[e]=t[a];return e}var Tg=mi("animationend"),zg=mi("animationiteration"),Ag=mi("animationstart"),ly=mi("transitionrun"),sy=mi("transitionstart"),cy=mi("transitioncancel"),Rg=mi("transitionend"),Ug=new Map,Sp="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Sp.push("scrollEnd");function Ma(e,t){Ug.set(e,t),ui(t,[e])}var Pl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},da=[],Vi=0,hu=0;function Ns(){for(var e=Vi,t=hu=Vi=0;t<e;){var a=da[t];da[t++]=null;var r=da[t];da[t++]=null;var n=da[t];da[t++]=null;var i=da[t];if(da[t++]=null,r!==null&&n!==null){var o=r.pending;o===null?n.next=n:(n.next=o.next,o.next=n),r.pending=n}i!==0&&Dg(a,n,i)}}function Ss(e,t,a,r){da[Vi++]=e,da[Vi++]=t,da[Vi++]=a,da[Vi++]=r,hu|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function bu(e,t,a,r){return Ss(e,t,a,r),Fl(e)}function fi(e,t){return Ss(e,null,null,t),Fl(e)}function Dg(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var n=!1,i=e.return;i!==null;)i.childLanes|=a,r=i.alternate,r!==null&&(r.childLanes|=a),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(n=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,n&&t!==null&&(n=31-ra(a),e=i.hiddenUpdates,r=e[n],r===null?e[n]=[t]:r.push(t),t.lane=a|536870912),i):null}function Fl(e){if(50<bo)throw bo=0,Vp=null,Error(D(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Zi={};function py(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wt(e,t,a,r){return new py(e,t,a,r)}function vu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function tr(e,t){var a=e.alternate;return a===null?(a=Wt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Bg(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ul(e,t,a,r,n,i){var o=0;if(r=e,typeof e=="function")vu(e)&&(o=1);else if(typeof e=="string")o=m1(e,a,La.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case dp:return e=Wt(31,a,t,n),e.elementType=dp,e.lanes=i,e;case Hi:return ai(a.children,n,i,t);case tg:o=8,n|=24;break;case cp:return e=Wt(12,a,t,n|2),e.elementType=cp,e.lanes=i,e;case pp:return e=Wt(13,a,t,n),e.elementType=pp,e.lanes=i,e;case up:return e=Wt(19,a,t,n),e.elementType=up,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ia:o=10;break e;case ag:o=9;break e;case iu:o=11;break e;case nu:o=14;break e;case wr:o=16,r=null;break e}o=29,a=Error(D(130,e===null?"null":typeof e,"")),r=null}return t=Wt(o,a,t,n),t.elementType=e,t.type=r,t.lanes=i,t}function ai(e,t,a,r){return e=Wt(7,e,r,t),e.lanes=a,e}function Gc(e,t,a){return e=Wt(6,e,null,t),e.lanes=a,e}function Og(e){var t=Wt(18,null,null,0);return t.stateNode=e,t}function Qc(e,t,a){return t=Wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Vm=new WeakMap;function ba(e,t){if(typeof e=="object"&&e!==null){var a=Vm.get(e);return a!==void 0?a:(t={value:e,source:t,stack:qm(t)},Vm.set(e,t),t)}return{value:e,source:t,stack:qm(t)}}var Ki=[],Ji=0,Il=null,ko=0,fa=[],ga=0,Hr=null,Da=1,Ba="";function Pa(e,t){Ki[Ji++]=ko,Ki[Ji++]=Il,Il=e,ko=t}function Lg(e,t,a){fa[ga++]=Da,fa[ga++]=Ba,fa[ga++]=Hr,Hr=e;var r=Da;e=Ba;var n=32-ra(r)-1;r&=~(1<<n),a+=1;var i=32-ra(t)+n;if(30<i){var o=n-n%5;i=(r&(1<<o)-1).toString(32),r>>=o,n-=o,Da=1<<32-ra(t)+n|a<<n|r,Ba=i+e}else Da=1<<i|a<<n|r,Ba=e}function wu(e){e.return!==null&&(Pa(e,1),Lg(e,1,0))}function yu(e){for(;e===Il;)Il=Ki[--Ji],Ki[Ji]=null,ko=Ki[--Ji],Ki[Ji]=null;for(;e===Hr;)Hr=fa[--ga],fa[ga]=null,Ba=fa[--ga],fa[ga]=null,Da=fa[--ga],fa[ga]=null}function Hg(e,t){fa[ga++]=Da,fa[ga++]=Ba,fa[ga++]=Hr,Da=t.id,Ba=t.overflow,Hr=e}var St=null,Fe=null,Se=!1,zr=null,va=!1,Cp=Error(D(519));function jr(e){var t=Error(D(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw No(ba(t,e)),Cp}function Zm(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[Nt]=e,t[Xt]=r,a){case"dialog":xe("cancel",t),xe("close",t);break;case"iframe":case"object":case"embed":xe("load",t);break;case"video":case"audio":for(a=0;a<Eo.length;a++)xe(Eo[a],t);break;case"source":xe("error",t);break;case"img":case"image":case"link":xe("error",t),xe("load",t);break;case"details":xe("toggle",t);break;case"input":xe("invalid",t),gg(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":xe("invalid",t);break;case"textarea":xe("invalid",t),bg(t,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||r.suppressHydrationWarning===!0||_b(t.textContent,a)?(r.popover!=null&&(xe("beforetoggle",t),xe("toggle",t)),r.onScroll!=null&&xe("scroll",t),r.onScrollEnd!=null&&xe("scrollend",t),r.onClick!=null&&(t.onclick=Wa),t=!0):t=!1,t||jr(e,!0)}function Km(e){for(St=e.return;St;)switch(St.tag){case 5:case 31:case 13:va=!1;return;case 27:case 3:va=!0;return;default:St=St.return}}function Di(e){if(e!==St)return!1;if(!Se)return Km(e),Se=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Fp(e.type,e.memoizedProps)),a=!a),a&&Fe&&jr(e),Km(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(D(317));Fe=Of(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(D(317));Fe=Of(e)}else t===27?(t=Fe,Xr(e.type)?(e=tu,tu=null,Fe=e):Fe=t):Fe=St?ya(e.stateNode.nextSibling):null;return!0}function oi(){Fe=St=null,Se=!1}function Yc(){var e=zr;return e!==null&&(Qt===null?Qt=e:Qt.push.apply(Qt,e),zr=null),e}function No(e){zr===null?zr=[e]:zr.push(e)}var qp=Ha(null),gi=null,er=null;function _r(e,t,a){Ve(qp,t._currentValue),t._currentValue=a}function ar(e){e._currentValue=qp.current,_t(qp)}function Ep(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function Mp(e,t,a,r){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var i=n.dependencies;if(i!==null){var o=n.child;i=i.firstContext;e:for(;i!==null;){var l=i;i=n;for(var c=0;c<t.length;c++)if(l.context===t[c]){i.lanes|=a,l=i.alternate,l!==null&&(l.lanes|=a),Ep(i.return,a,e),r||(o=null);break e}i=l.next}}else if(n.tag===18){if(o=n.return,o===null)throw Error(D(341));o.lanes|=a,i=o.alternate,i!==null&&(i.lanes|=a),Ep(o,a,e),o=null}else o=n.child;if(o!==null)o.return=n;else for(o=n;o!==null;){if(o===e){o=null;break}if(n=o.sibling,n!==null){n.return=o.return,o=n;break}o=o.return}n=o}}function vn(e,t,a,r){e=null;for(var n=t,i=!1;n!==null;){if(!i){if((n.flags&524288)!==0)i=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var o=n.alternate;if(o===null)throw Error(D(387));if(o=o.memoizedProps,o!==null){var l=n.type;na(n.pendingProps.value,o.value)||(e!==null?e.push(l):e=[l])}}else if(n===$l.current){if(o=n.alternate,o===null)throw Error(D(387));o.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(To):e=[To])}n=n.return}e!==null&&Mp(t,e,a,r),t.flags|=262144}function Wl(e){for(e=e.firstContext;e!==null;){if(!na(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function li(e){gi=e,er=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ct(e){return jg(gi,e)}function yl(e,t){return gi===null&&li(e),jg(e,t)}function jg(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},er===null){if(e===null)throw Error(D(308));er=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else er=er.next=t;return a}var uy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},dy=bt.unstable_scheduleCallback,my=bt.unstable_NormalPriority,mt={$$typeof:Ia,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _u(){return{controller:new uy,data:new Map,refCount:0}}function Ho(e){e.refCount--,e.refCount===0&&dy(my,function(){e.controller.abort()})}var so=null,Tp=0,sn=0,en=null;function fy(e,t){if(so===null){var a=so=[];Tp=0,sn=Vu(),en={status:"pending",value:void 0,then:function(r){a.push(r)}}}return Tp++,t.then(Jm,Jm),t}function Jm(){if(--Tp===0&&so!==null){en!==null&&(en.status="fulfilled");var e=so;so=null,sn=0,en=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function gy(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(n){a.push(n)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var n=0;n<a.length;n++)(0,a[n])(t)},function(n){for(r.status="rejected",r.reason=n,n=0;n<a.length;n++)(0,a[n])(void 0)}),r}var Pm=de.S;de.S=function(e,t){eb=ta(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&fy(e,t),Pm!==null&&Pm(e,t)};var ri=Ha(null);function xu(){var e=ri.current;return e!==null?e:Ye.pooledCache}function Dl(e,t){t===null?Ve(ri,ri.current):Ve(ri,t.pool)}function Gg(){var e=xu();return e===null?null:{parent:mt._currentValue,pool:e}}var wn=Error(D(460)),ku=Error(D(474)),Cs=Error(D(542)),es={then:function(){}};function Fm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Qg(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Wa,Wa),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Wm(e),e;default:if(typeof t.status=="string")t.then(Wa,Wa);else{if(e=Ye,e!==null&&100<e.shellSuspendCounter)throw Error(D(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=r}},function(r){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Wm(e),e}throw ii=t,wn}}function Wr(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(ii=a,wn):a}}var ii=null;function Im(){if(ii===null)throw Error(D(459));var e=ii;return ii=null,e}function Wm(e){if(e===wn||e===Cs)throw Error(D(483))}var tn=null,So=0;function _l(e){var t=So;return So+=1,tn===null&&(tn=[]),Qg(tn,e,t)}function Jn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function xl(e,t){throw t.$$typeof===t0?Error(D(525)):(e=Object.prototype.toString.call(t),Error(D(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Yg(e){function t(m,p){if(e){var g=m.deletions;g===null?(m.deletions=[p],m.flags|=16):g.push(p)}}function a(m,p){if(!e)return null;for(;p!==null;)t(m,p),p=p.sibling;return null}function r(m){for(var p=new Map;m!==null;)m.key!==null?p.set(m.key,m):p.set(m.index,m),m=m.sibling;return p}function n(m,p){return m=tr(m,p),m.index=0,m.sibling=null,m}function i(m,p,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<p?(m.flags|=67108866,p):g):(m.flags|=67108866,p)):(m.flags|=1048576,p)}function o(m){return e&&m.alternate===null&&(m.flags|=67108866),m}function l(m,p,g,v){return p===null||p.tag!==6?(p=Gc(g,m.mode,v),p.return=m,p):(p=n(p,g),p.return=m,p)}function c(m,p,g,v){var N=g.type;return N===Hi?f(m,p,g.props.children,v,g.key):p!==null&&(p.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===wr&&Wr(N)===p.type)?(p=n(p,g.props),Jn(p,g),p.return=m,p):(p=Ul(g.type,g.key,g.props,null,m.mode,v),Jn(p,g),p.return=m,p)}function u(m,p,g,v){return p===null||p.tag!==4||p.stateNode.containerInfo!==g.containerInfo||p.stateNode.implementation!==g.implementation?(p=Qc(g,m.mode,v),p.return=m,p):(p=n(p,g.children||[]),p.return=m,p)}function f(m,p,g,v,N){return p===null||p.tag!==7?(p=ai(g,m.mode,v,N),p.return=m,p):(p=n(p,g),p.return=m,p)}function b(m,p,g){if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return p=Gc(""+p,m.mode,g),p.return=m,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case dl:return g=Ul(p.type,p.key,p.props,null,m.mode,g),Jn(g,p),g.return=m,g;case eo:return p=Qc(p,m.mode,g),p.return=m,p;case wr:return p=Wr(p),b(m,p,g)}if(to(p)||Zn(p))return p=ai(p,m.mode,g,null),p.return=m,p;if(typeof p.then=="function")return b(m,_l(p),g);if(p.$$typeof===Ia)return b(m,yl(m,p),g);xl(m,p)}return null}function d(m,p,g,v){var N=p!==null?p.key:null;if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return N!==null?null:l(m,p,""+g,v);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case dl:return g.key===N?c(m,p,g,v):null;case eo:return g.key===N?u(m,p,g,v):null;case wr:return g=Wr(g),d(m,p,g,v)}if(to(g)||Zn(g))return N!==null?null:f(m,p,g,v,null);if(typeof g.then=="function")return d(m,p,_l(g),v);if(g.$$typeof===Ia)return d(m,p,yl(m,g),v);xl(m,g)}return null}function h(m,p,g,v,N){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return m=m.get(g)||null,l(p,m,""+v,N);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case dl:return m=m.get(v.key===null?g:v.key)||null,c(p,m,v,N);case eo:return m=m.get(v.key===null?g:v.key)||null,u(p,m,v,N);case wr:return v=Wr(v),h(m,p,g,v,N)}if(to(v)||Zn(v))return m=m.get(g)||null,f(p,m,v,N,null);if(typeof v.then=="function")return h(m,p,g,_l(v),N);if(v.$$typeof===Ia)return h(m,p,g,yl(p,v),N);xl(p,v)}return null}function w(m,p,g,v){for(var N=null,T=null,M=p,R=p=0,j=null;M!==null&&R<g.length;R++){M.index>R?(j=M,M=null):j=M.sibling;var W=d(m,M,g[R],v);if(W===null){M===null&&(M=j);break}e&&M&&W.alternate===null&&t(m,M),p=i(W,p,R),T===null?N=W:T.sibling=W,T=W,M=j}if(R===g.length)return a(m,M),Se&&Pa(m,R),N;if(M===null){for(;R<g.length;R++)M=b(m,g[R],v),M!==null&&(p=i(M,p,R),T===null?N=M:T.sibling=M,T=M);return Se&&Pa(m,R),N}for(M=r(M);R<g.length;R++)j=h(M,m,R,g[R],v),j!==null&&(e&&j.alternate!==null&&M.delete(j.key===null?R:j.key),p=i(j,p,R),T===null?N=j:T.sibling=j,T=j);return e&&M.forEach(function(ye){return t(m,ye)}),Se&&Pa(m,R),N}function E(m,p,g,v){if(g==null)throw Error(D(151));for(var N=null,T=null,M=p,R=p=0,j=null,W=g.next();M!==null&&!W.done;R++,W=g.next()){M.index>R?(j=M,M=null):j=M.sibling;var ye=d(m,M,W.value,v);if(ye===null){M===null&&(M=j);break}e&&M&&ye.alternate===null&&t(m,M),p=i(ye,p,R),T===null?N=ye:T.sibling=ye,T=ye,M=j}if(W.done)return a(m,M),Se&&Pa(m,R),N;if(M===null){for(;!W.done;R++,W=g.next())W=b(m,W.value,v),W!==null&&(p=i(W,p,R),T===null?N=W:T.sibling=W,T=W);return Se&&Pa(m,R),N}for(M=r(M);!W.done;R++,W=g.next())W=h(M,m,R,W.value,v),W!==null&&(e&&W.alternate!==null&&M.delete(W.key===null?R:W.key),p=i(W,p,R),T===null?N=W:T.sibling=W,T=W);return e&&M.forEach(function(Ce){return t(m,Ce)}),Se&&Pa(m,R),N}function U(m,p,g,v){if(typeof g=="object"&&g!==null&&g.type===Hi&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case dl:e:{for(var N=g.key;p!==null;){if(p.key===N){if(N=g.type,N===Hi){if(p.tag===7){a(m,p.sibling),v=n(p,g.props.children),v.return=m,m=v;break e}}else if(p.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===wr&&Wr(N)===p.type){a(m,p.sibling),v=n(p,g.props),Jn(v,g),v.return=m,m=v;break e}a(m,p);break}else t(m,p);p=p.sibling}g.type===Hi?(v=ai(g.props.children,m.mode,v,g.key),v.return=m,m=v):(v=Ul(g.type,g.key,g.props,null,m.mode,v),Jn(v,g),v.return=m,m=v)}return o(m);case eo:e:{for(N=g.key;p!==null;){if(p.key===N)if(p.tag===4&&p.stateNode.containerInfo===g.containerInfo&&p.stateNode.implementation===g.implementation){a(m,p.sibling),v=n(p,g.children||[]),v.return=m,m=v;break e}else{a(m,p);break}else t(m,p);p=p.sibling}v=Qc(g,m.mode,v),v.return=m,m=v}return o(m);case wr:return g=Wr(g),U(m,p,g,v)}if(to(g))return w(m,p,g,v);if(Zn(g)){if(N=Zn(g),typeof N!="function")throw Error(D(150));return g=N.call(g),E(m,p,g,v)}if(typeof g.then=="function")return U(m,p,_l(g),v);if(g.$$typeof===Ia)return U(m,p,yl(m,g),v);xl(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,p!==null&&p.tag===6?(a(m,p.sibling),v=n(p,g),v.return=m,m=v):(a(m,p),v=Gc(g,m.mode,v),v.return=m,m=v),o(m)):a(m,p)}return function(m,p,g,v){try{So=0;var N=U(m,p,g,v);return tn=null,N}catch(M){if(M===wn||M===Cs)throw M;var T=Wt(29,M,null,m.mode);return T.lanes=v,T.return=m,T}}}var si=Yg(!0),Xg=Yg(!1),yr=!1;function Nu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ar(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Rr(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ae&2)!==0){var n=r.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),r.pending=t,t=Fl(e),Dg(e,null,a),t}return Ss(e,r,t,a),Fl(e)}function co(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,sg(e,a)}}function Xc(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var n=null,i=null;if(a=a.firstBaseUpdate,a!==null){do{var o={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};i===null?n=i=o:i=i.next=o,a=a.next}while(a!==null);i===null?n=i=t:i=i.next=t}else n=i=t;a={baseState:r.baseState,firstBaseUpdate:n,lastBaseUpdate:i,shared:r.shared,callbacks:r.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Ap=!1;function po(){if(Ap){var e=en;if(e!==null)throw e}}function uo(e,t,a,r){Ap=!1;var n=e.updateQueue;yr=!1;var i=n.firstBaseUpdate,o=n.lastBaseUpdate,l=n.shared.pending;if(l!==null){n.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==o&&(l===null?f.firstBaseUpdate=u:l.next=u,f.lastBaseUpdate=c))}if(i!==null){var b=n.baseState;o=0,f=u=c=null,l=i;do{var d=l.lane&-536870913,h=d!==l.lane;if(h?(Ne&d)===d:(r&d)===d){d!==0&&d===sn&&(Ap=!0),f!==null&&(f=f.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var w=e,E=l;d=t;var U=a;switch(E.tag){case 1:if(w=E.payload,typeof w=="function"){b=w.call(U,b,d);break e}b=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=E.payload,d=typeof w=="function"?w.call(U,b,d):w,d==null)break e;b=Ie({},b,d);break e;case 2:yr=!0}}d=l.callback,d!==null&&(e.flags|=64,h&&(e.flags|=8192),h=n.callbacks,h===null?n.callbacks=[d]:h.push(d))}else h={lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(u=f=h,c=b):f=f.next=h,o|=d;if(l=l.next,l===null){if(l=n.shared.pending,l===null)break;h=l,l=h.next,h.next=null,n.lastBaseUpdate=h,n.shared.pending=null}}while(!0);f===null&&(c=b),n.baseState=c,n.firstBaseUpdate=u,n.lastBaseUpdate=f,i===null&&(n.shared.lanes=0),Qr|=o,e.lanes=o,e.memoizedState=b}}function $g(e,t){if(typeof e!="function")throw Error(D(191,e));e.call(t)}function Vg(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)$g(a[e],t)}var cn=Ha(null),ts=Ha(0);function ef(e,t){e=sr,Ve(ts,e),Ve(cn,t),sr=e|t.baseLanes}function Rp(){Ve(ts,sr),Ve(cn,cn.current)}function Su(){sr=ts.current,_t(cn),_t(ts)}var oa=Ha(null),wa=null;function xr(e){var t=e.alternate;Ve(lt,lt.current&1),Ve(oa,e),wa===null&&(t===null||cn.current!==null||t.memoizedState!==null)&&(wa=e)}function Up(e){Ve(lt,lt.current),Ve(oa,e),wa===null&&(wa=e)}function Zg(e){e.tag===22?(Ve(lt,lt.current),Ve(oa,e),wa===null&&(wa=e)):kr(e)}function kr(){Ve(lt,lt.current),Ve(oa,oa.current)}function It(e){_t(oa),wa===e&&(wa=null),_t(lt)}var lt=Ha(0);function as(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Wp(a)||eu(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var nr=0,he=null,Ge=null,ut=null,rs=!1,an=!1,ci=!1,is=0,Co=0,rn=null,hy=0;function it(){throw Error(D(321))}function Cu(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!na(e[a],t[a]))return!1;return!0}function qu(e,t,a,r,n,i){return nr=i,he=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,de.H=e===null||e.memoizedState===null?Nh:Lu,ci=!1,i=a(r,n),ci=!1,an&&(i=Jg(t,a,r,n)),Kg(e),i}function Kg(e){de.H=qo;var t=Ge!==null&&Ge.next!==null;if(nr=0,ut=Ge=he=null,rs=!1,Co=0,rn=null,t)throw Error(D(300));e===null||ft||(e=e.dependencies,e!==null&&Wl(e)&&(ft=!0))}function Jg(e,t,a,r){he=e;var n=0;do{if(an&&(rn=null),Co=0,an=!1,25<=n)throw Error(D(301));if(n+=1,ut=Ge=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}de.H=Sh,i=t(a,r)}while(an);return i}function by(){var e=de.H,t=e.useState()[0];return t=typeof t.then=="function"?jo(t):t,e=e.useState()[0],(Ge!==null?Ge.memoizedState:null)!==e&&(he.flags|=1024),t}function Eu(){var e=is!==0;return is=0,e}function Mu(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Tu(e){if(rs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}rs=!1}nr=0,ut=Ge=he=null,an=!1,Co=is=0,rn=null}function Dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ut===null?he.memoizedState=ut=e:ut=ut.next=e,ut}function st(){if(Ge===null){var e=he.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var t=ut===null?he.memoizedState:ut.next;if(t!==null)ut=t,Ge=e;else{if(e===null)throw he.alternate===null?Error(D(467)):Error(D(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},ut===null?he.memoizedState=ut=e:ut=ut.next=e}return ut}function qs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function jo(e){var t=Co;return Co+=1,rn===null&&(rn=[]),e=Qg(rn,e,t),t=he,(ut===null?t.memoizedState:ut.next)===null&&(t=t.alternate,de.H=t===null||t.memoizedState===null?Nh:Lu),e}function Es(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return jo(e);if(e.$$typeof===Ia)return Ct(e)}throw Error(D(438,String(e)))}function zu(e){var t=null,a=he.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=he.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=qs(),he.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),r=0;r<e;r++)a[r]=a0;return t.index++,a}function or(e,t){return typeof t=="function"?t(e):t}function Bl(e){var t=st();return Au(t,Ge,e)}function Au(e,t,a){var r=e.queue;if(r===null)throw Error(D(311));r.lastRenderedReducer=a;var n=e.baseQueue,i=r.pending;if(i!==null){if(n!==null){var o=n.next;n.next=i.next,i.next=o}t.baseQueue=n=i,r.pending=null}if(i=e.baseState,n===null)e.memoizedState=i;else{t=n.next;var l=o=null,c=null,u=t,f=!1;do{var b=u.lane&-536870913;if(b!==u.lane?(Ne&b)===b:(nr&b)===b){var d=u.revertLane;if(d===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),b===sn&&(f=!0);else if((nr&d)===d){u=u.next,d===sn&&(f=!0);continue}else b={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=b,o=i):c=c.next=b,he.lanes|=d,Qr|=d;b=u.action,ci&&a(i,b),i=u.hasEagerState?u.eagerState:a(i,b)}else d={lane:b,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},c===null?(l=c=d,o=i):c=c.next=d,he.lanes|=b,Qr|=b;u=u.next}while(u!==null&&u!==t);if(c===null?o=i:c.next=l,!na(i,e.memoizedState)&&(ft=!0,f&&(a=en,a!==null)))throw a;e.memoizedState=i,e.baseState=o,e.baseQueue=c,r.lastRenderedState=i}return n===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function $c(e){var t=st(),a=t.queue;if(a===null)throw Error(D(311));a.lastRenderedReducer=e;var r=a.dispatch,n=a.pending,i=t.memoizedState;if(n!==null){a.pending=null;var o=n=n.next;do i=e(i,o.action),o=o.next;while(o!==n);na(i,t.memoizedState)||(ft=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),a.lastRenderedState=i}return[i,r]}function Pg(e,t,a){var r=he,n=st(),i=Se;if(i){if(a===void 0)throw Error(D(407));a=a()}else a=t();var o=!na((Ge||n).memoizedState,a);if(o&&(n.memoizedState=a,ft=!0),n=n.queue,Ru(Wg.bind(null,r,n,e),[e]),n.getSnapshot!==t||o||ut!==null&&ut.memoizedState.tag&1){if(r.flags|=2048,pn(9,{destroy:void 0},Ig.bind(null,r,n,a,t),null),Ye===null)throw Error(D(349));i||(nr&127)!==0||Fg(r,t,a)}return a}function Fg(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=he.updateQueue,t===null?(t=qs(),he.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Ig(e,t,a,r){t.value=a,t.getSnapshot=r,eh(t)&&th(e)}function Wg(e,t,a){return a(function(){eh(t)&&th(e)})}function eh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!na(e,a)}catch{return!0}}function th(e){var t=fi(e,2);t!==null&&Yt(t,e,2)}function Dp(e){var t=Dt();if(typeof e=="function"){var a=e;if(e=a(),ci){Sr(!0);try{a()}finally{Sr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:or,lastRenderedState:e},t}function ah(e,t,a,r){return e.baseState=a,Au(e,Ge,typeof r=="function"?r:or)}function vy(e,t,a,r,n){if(Ts(e))throw Error(D(485));if(e=t.action,e!==null){var i={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){i.listeners.push(o)}};de.T!==null?a(!0):i.isTransition=!1,r(i),a=t.pending,a===null?(i.next=t.pending=i,rh(t,i)):(i.next=a.next,t.pending=a.next=i)}}function rh(e,t){var a=t.action,r=t.payload,n=e.state;if(t.isTransition){var i=de.T,o={};de.T=o;try{var l=a(n,r),c=de.S;c!==null&&c(o,l),tf(e,t,l)}catch(u){Bp(e,t,u)}finally{i!==null&&o.types!==null&&(i.types=o.types),de.T=i}}else try{i=a(n,r),tf(e,t,i)}catch(u){Bp(e,t,u)}}function tf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){af(e,t,r)},function(r){return Bp(e,t,r)}):af(e,t,a)}function af(e,t,a){t.status="fulfilled",t.value=a,ih(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,rh(e,a)))}function Bp(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,ih(t),t=t.next;while(t!==r)}e.action=null}function ih(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function nh(e,t){return t}function rf(e,t){if(Se){var a=Ye.formState;if(a!==null){e:{var r=he;if(Se){if(Fe){t:{for(var n=Fe,i=va;n.nodeType!==8;){if(!i){n=null;break t}if(n=ya(n.nextSibling),n===null){n=null;break t}}i=n.data,n=i==="F!"||i==="F"?n:null}if(n){Fe=ya(n.nextSibling),r=n.data==="F!";break e}}jr(r)}r=!1}r&&(t=a[0])}}return a=Dt(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nh,lastRenderedState:t},a.queue=r,a=_h.bind(null,he,r),r.dispatch=a,r=Dp(!1),i=Ou.bind(null,he,!1,r.queue),r=Dt(),n={state:t,dispatch:null,action:e,pending:null},r.queue=n,a=vy.bind(null,he,n,i,a),n.dispatch=a,r.memoizedState=e,[t,a,!1]}function nf(e){var t=st();return oh(t,Ge,e)}function oh(e,t,a){if(t=Au(e,t,nh)[0],e=Bl(or)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=jo(t)}catch(o){throw o===wn?Cs:o}else r=t;t=st();var n=t.queue,i=n.dispatch;return a!==t.memoizedState&&(he.flags|=2048,pn(9,{destroy:void 0},wy.bind(null,n,a),null)),[r,i,e]}function wy(e,t){e.action=t}function of(e){var t=st(),a=Ge;if(a!==null)return oh(t,a,e);st(),t=t.memoizedState,a=st();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function pn(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=he.updateQueue,t===null&&(t=qs(),he.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e),e}function lh(){return st().memoizedState}function Ol(e,t,a,r){var n=Dt();he.flags|=e,n.memoizedState=pn(1|t,{destroy:void 0},a,r===void 0?null:r)}function Ms(e,t,a,r){var n=st();r=r===void 0?null:r;var i=n.memoizedState.inst;Ge!==null&&r!==null&&Cu(r,Ge.memoizedState.deps)?n.memoizedState=pn(t,i,a,r):(he.flags|=e,n.memoizedState=pn(1|t,i,a,r))}function lf(e,t){Ol(8390656,8,e,t)}function Ru(e,t){Ms(2048,8,e,t)}function yy(e){he.flags|=4;var t=he.updateQueue;if(t===null)t=qs(),he.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function sh(e){var t=st().memoizedState;return yy({ref:t,nextImpl:e}),function(){if((Ae&2)!==0)throw Error(D(440));return t.impl.apply(void 0,arguments)}}function ch(e,t){return Ms(4,2,e,t)}function ph(e,t){return Ms(4,4,e,t)}function uh(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function dh(e,t,a){a=a!=null?a.concat([e]):null,Ms(4,4,uh.bind(null,t,e),a)}function Uu(){}function mh(e,t){var a=st();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&Cu(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function fh(e,t){var a=st();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&Cu(t,r[1]))return r[0];if(r=e(),ci){Sr(!0);try{e()}finally{Sr(!1)}}return a.memoizedState=[r,t],r}function Du(e,t,a){return a===void 0||(nr&1073741824)!==0&&(Ne&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=ab(),he.lanes|=e,Qr|=e,a)}function gh(e,t,a,r){return na(a,t)?a:cn.current!==null?(e=Du(e,a,r),na(e,t)||(ft=!0),e):(nr&42)===0||(nr&1073741824)!==0&&(Ne&261930)===0?(ft=!0,e.memoizedState=a):(e=ab(),he.lanes|=e,Qr|=e,t)}function hh(e,t,a,r,n){var i=Re.p;Re.p=i!==0&&8>i?i:8;var o=de.T,l={};de.T=l,Ou(e,!1,t,a);try{var c=n(),u=de.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=gy(c,r);mo(e,t,f,ia(e))}else mo(e,t,r,ia(e))}catch(b){mo(e,t,{then:function(){},status:"rejected",reason:b},ia())}finally{Re.p=i,o!==null&&l.types!==null&&(o.types=l.types),de.T=o}}function _y(){}function Op(e,t,a,r){if(e.tag!==5)throw Error(D(476));var n=bh(e).queue;hh(e,n,t,ti,a===null?_y:function(){return vh(e),a(r)})}function bh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ti,baseState:ti,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:or,lastRenderedState:ti},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:or,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function vh(e){var t=bh(e);t.next===null&&(t=e.alternate.memoizedState),mo(e,t.next.queue,{},ia())}function Bu(){return Ct(To)}function wh(){return st().memoizedState}function yh(){return st().memoizedState}function xy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=ia();e=Ar(a);var r=Rr(t,e,a);r!==null&&(Yt(r,t,a),co(r,t,a)),t={cache:_u()},e.payload=t;return}t=t.return}}function ky(e,t,a){var r=ia();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ts(e)?xh(t,a):(a=bu(e,t,a,r),a!==null&&(Yt(a,e,r),kh(a,t,r)))}function _h(e,t,a){var r=ia();mo(e,t,a,r)}function mo(e,t,a,r){var n={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ts(e))xh(t,n);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,a);if(n.hasEagerState=!0,n.eagerState=l,na(l,o))return Ss(e,t,n,0),Ye===null&&Ns(),!1}catch{}if(a=bu(e,t,n,r),a!==null)return Yt(a,e,r),kh(a,t,r),!0}return!1}function Ou(e,t,a,r){if(r={lane:2,revertLane:Vu(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ts(e)){if(t)throw Error(D(479))}else t=bu(e,a,r,2),t!==null&&Yt(t,e,2)}function Ts(e){var t=e.alternate;return e===he||t!==null&&t===he}function xh(e,t){an=rs=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function kh(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,sg(e,a)}}var qo={readContext:Ct,use:Es,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useLayoutEffect:it,useInsertionEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useSyncExternalStore:it,useId:it,useHostTransitionStatus:it,useFormState:it,useActionState:it,useOptimistic:it,useMemoCache:it,useCacheRefresh:it};qo.useEffectEvent=it;var Nh={readContext:Ct,use:Es,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:Ct,useEffect:lf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Ol(4194308,4,uh.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Ol(4194308,4,e,t)},useInsertionEffect:function(e,t){Ol(4,2,e,t)},useMemo:function(e,t){var a=Dt();t=t===void 0?null:t;var r=e();if(ci){Sr(!0);try{e()}finally{Sr(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=Dt();if(a!==void 0){var n=a(t);if(ci){Sr(!0);try{a(t)}finally{Sr(!1)}}}else n=t;return r.memoizedState=r.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},r.queue=e,e=e.dispatch=ky.bind(null,he,e),[r.memoizedState,e]},useRef:function(e){var t=Dt();return e={current:e},t.memoizedState=e},useState:function(e){e=Dp(e);var t=e.queue,a=_h.bind(null,he,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Uu,useDeferredValue:function(e,t){var a=Dt();return Du(a,e,t)},useTransition:function(){var e=Dp(!1);return e=hh.bind(null,he,e.queue,!0,!1),Dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=he,n=Dt();if(Se){if(a===void 0)throw Error(D(407));a=a()}else{if(a=t(),Ye===null)throw Error(D(349));(Ne&127)!==0||Fg(r,t,a)}n.memoizedState=a;var i={value:a,getSnapshot:t};return n.queue=i,lf(Wg.bind(null,r,i,e),[e]),r.flags|=2048,pn(9,{destroy:void 0},Ig.bind(null,r,i,a,t),null),a},useId:function(){var e=Dt(),t=Ye.identifierPrefix;if(Se){var a=Ba,r=Da;a=(r&~(1<<32-ra(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=is++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=hy++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Bu,useFormState:rf,useActionState:rf,useOptimistic:function(e){var t=Dt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Ou.bind(null,he,!0,a),a.dispatch=t,[e,t]},useMemoCache:zu,useCacheRefresh:function(){return Dt().memoizedState=xy.bind(null,he)},useEffectEvent:function(e){var t=Dt(),a={impl:e};return t.memoizedState=a,function(){if((Ae&2)!==0)throw Error(D(440));return a.impl.apply(void 0,arguments)}}},Lu={readContext:Ct,use:Es,useCallback:mh,useContext:Ct,useEffect:Ru,useImperativeHandle:dh,useInsertionEffect:ch,useLayoutEffect:ph,useMemo:fh,useReducer:Bl,useRef:lh,useState:function(){return Bl(or)},useDebugValue:Uu,useDeferredValue:function(e,t){var a=st();return gh(a,Ge.memoizedState,e,t)},useTransition:function(){var e=Bl(or)[0],t=st().memoizedState;return[typeof e=="boolean"?e:jo(e),t]},useSyncExternalStore:Pg,useId:wh,useHostTransitionStatus:Bu,useFormState:nf,useActionState:nf,useOptimistic:function(e,t){var a=st();return ah(a,Ge,e,t)},useMemoCache:zu,useCacheRefresh:yh};Lu.useEffectEvent=sh;var Sh={readContext:Ct,use:Es,useCallback:mh,useContext:Ct,useEffect:Ru,useImperativeHandle:dh,useInsertionEffect:ch,useLayoutEffect:ph,useMemo:fh,useReducer:$c,useRef:lh,useState:function(){return $c(or)},useDebugValue:Uu,useDeferredValue:function(e,t){var a=st();return Ge===null?Du(a,e,t):gh(a,Ge.memoizedState,e,t)},useTransition:function(){var e=$c(or)[0],t=st().memoizedState;return[typeof e=="boolean"?e:jo(e),t]},useSyncExternalStore:Pg,useId:wh,useHostTransitionStatus:Bu,useFormState:of,useActionState:of,useOptimistic:function(e,t){var a=st();return Ge!==null?ah(a,Ge,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:zu,useCacheRefresh:yh};Sh.useEffectEvent=sh;function Vc(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:Ie({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Lp={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=ia(),n=Ar(r);n.payload=t,a!=null&&(n.callback=a),t=Rr(e,n,r),t!==null&&(Yt(t,e,r),co(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=ia(),n=Ar(r);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=Rr(e,n,r),t!==null&&(Yt(t,e,r),co(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=ia(),r=Ar(a);r.tag=2,t!=null&&(r.callback=t),t=Rr(e,r,a),t!==null&&(Yt(t,e,a),co(t,e,a))}};function sf(e,t,a,r,n,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!xo(a,r)||!xo(n,i):!0}function cf(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&Lp.enqueueReplaceState(t,t.state,null)}function pi(e,t){var a=t;if("ref"in t){a={};for(var r in t)r!=="ref"&&(a[r]=t[r])}if(e=e.defaultProps){a===t&&(a=Ie({},a));for(var n in e)a[n]===void 0&&(a[n]=e[n])}return a}function Ch(e){Pl(e)}function qh(e){console.error(e)}function Eh(e){Pl(e)}function ns(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function pf(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function Hp(e,t,a){return a=Ar(a),a.tag=3,a.payload={element:null},a.callback=function(){ns(e,t)},a}function Mh(e){return e=Ar(e),e.tag=3,e}function Th(e,t,a,r){var n=a.type.getDerivedStateFromError;if(typeof n=="function"){var i=r.value;e.payload=function(){return n(i)},e.callback=function(){pf(t,a,r)}}var o=a.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){pf(t,a,r),typeof n!="function"&&(Ur===null?Ur=new Set([this]):Ur.add(this));var l=r.stack;this.componentDidCatch(r.value,{componentStack:l!==null?l:""})})}function Ny(e,t,a,r,n){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&vn(t,a,n,!0),a=oa.current,a!==null){switch(a.tag){case 31:case 13:return wa===null?ps():a.alternate===null&&nt===0&&(nt=3),a.flags&=-257,a.flags|=65536,a.lanes=n,r===es?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),rp(e,r,n)),!1;case 22:return a.flags|=65536,r===es?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([r]):a.add(r)),rp(e,r,n)),!1}throw Error(D(435,a.tag))}return rp(e,r,n),ps(),!1}if(Se)return t=oa.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,r!==Cp&&(e=Error(D(422),{cause:r}),No(ba(e,a)))):(r!==Cp&&(t=Error(D(423),{cause:r}),No(ba(t,a))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,r=ba(r,a),n=Hp(e.stateNode,r,n),Xc(e,n),nt!==4&&(nt=2)),!1;var i=Error(D(520),{cause:r});if(i=ba(i,a),ho===null?ho=[i]:ho.push(i),nt!==4&&(nt=2),t===null)return!0;r=ba(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=n&-n,a.lanes|=e,e=Hp(a.stateNode,r,e),Xc(a,e),!1;case 1:if(t=a.type,i=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Ur===null||!Ur.has(i))))return a.flags|=65536,n&=-n,a.lanes|=n,n=Mh(n),Th(n,e,a,r),Xc(a,n),!1}a=a.return}while(a!==null);return!1}var Hu=Error(D(461)),ft=!1;function kt(e,t,a,r){t.child=e===null?Xg(t,null,a,r):si(t,e.child,a,r)}function uf(e,t,a,r,n){a=a.render;var i=t.ref;if("ref"in r){var o={};for(var l in r)l!=="ref"&&(o[l]=r[l])}else o=r;return li(t),r=qu(e,t,a,o,i,n),l=Eu(),e!==null&&!ft?(Mu(e,t,n),lr(e,t,n)):(Se&&l&&wu(t),t.flags|=1,kt(e,t,r,n),t.child)}function df(e,t,a,r,n){if(e===null){var i=a.type;return typeof i=="function"&&!vu(i)&&i.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=i,zh(e,t,i,r,n)):(e=Ul(a.type,null,r,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!ju(e,n)){var o=i.memoizedProps;if(a=a.compare,a=a!==null?a:xo,a(o,r)&&e.ref===t.ref)return lr(e,t,n)}return t.flags|=1,e=tr(i,r),e.ref=t.ref,e.return=t,t.child=e}function zh(e,t,a,r,n){if(e!==null){var i=e.memoizedProps;if(xo(i,r)&&e.ref===t.ref)if(ft=!1,t.pendingProps=r=i,ju(e,n))(e.flags&131072)!==0&&(ft=!0);else return t.lanes=e.lanes,lr(e,t,n)}return jp(e,t,a,r,n)}function Ah(e,t,a,r){var n=r.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|a:a,e!==null){for(r=t.child=e.child,n=0;r!==null;)n=n|r.lanes|r.childLanes,r=r.sibling;r=n&~i}else r=0,t.child=null;return mf(e,t,i,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Dl(t,i!==null?i.cachePool:null),i!==null?ef(t,i):Rp(),Zg(t);else return r=t.lanes=536870912,mf(e,t,i!==null?i.baseLanes|a:a,a,r)}else i!==null?(Dl(t,i.cachePool),ef(t,i),kr(t),t.memoizedState=null):(e!==null&&Dl(t,null),Rp(),kr(t));return kt(e,t,n,a),t.child}function ro(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function mf(e,t,a,r,n){var i=xu();return i=i===null?null:{parent:mt._currentValue,pool:i},t.memoizedState={baseLanes:a,cachePool:i},e!==null&&Dl(t,null),Rp(),Zg(t),e!==null&&vn(e,t,r,!0),t.childLanes=n,null}function Ll(e,t){return t=os({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ff(e,t,a){return si(t,e.child,null,a),e=Ll(t,t.pendingProps),e.flags|=2,It(t),t.memoizedState=null,e}function Sy(e,t,a){var r=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Se){if(r.mode==="hidden")return e=Ll(t,r),t.lanes=536870912,ro(null,e);if(Up(t),(e=Fe)?(e=Nb(e,va),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hr!==null?{id:Da,overflow:Ba}:null,retryLane:536870912,hydrationErrors:null},a=Og(e),a.return=t,t.child=a,St=t,Fe=null)):e=null,e===null)throw jr(t);return t.lanes=536870912,null}return Ll(t,r)}var i=e.memoizedState;if(i!==null){var o=i.dehydrated;if(Up(t),n)if(t.flags&256)t.flags&=-257,t=ff(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(D(558));else if(ft||vn(e,t,a,!1),n=(a&e.childLanes)!==0,ft||n){if(r=Ye,r!==null&&(o=cg(r,a),o!==0&&o!==i.retryLane))throw i.retryLane=o,fi(e,o),Yt(r,e,o),Hu;ps(),t=ff(e,t,a)}else e=i.treeContext,Fe=ya(o.nextSibling),St=t,Se=!0,zr=null,va=!1,e!==null&&Hg(t,e),t=Ll(t,r),t.flags|=4096;return t}return e=tr(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Hl(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(D(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function jp(e,t,a,r,n){return li(t),a=qu(e,t,a,r,void 0,n),r=Eu(),e!==null&&!ft?(Mu(e,t,n),lr(e,t,n)):(Se&&r&&wu(t),t.flags|=1,kt(e,t,a,n),t.child)}function gf(e,t,a,r,n,i){return li(t),t.updateQueue=null,a=Jg(t,r,a,n),Kg(e),r=Eu(),e!==null&&!ft?(Mu(e,t,i),lr(e,t,i)):(Se&&r&&wu(t),t.flags|=1,kt(e,t,a,i),t.child)}function hf(e,t,a,r,n){if(li(t),t.stateNode===null){var i=Zi,o=a.contextType;typeof o=="object"&&o!==null&&(i=Ct(o)),i=new a(r,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Lp,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=r,i.state=t.memoizedState,i.refs={},Nu(t),o=a.contextType,i.context=typeof o=="object"&&o!==null?Ct(o):Zi,i.state=t.memoizedState,o=a.getDerivedStateFromProps,typeof o=="function"&&(Vc(t,a,o,r),i.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(o=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),o!==i.state&&Lp.enqueueReplaceState(i,i.state,null),uo(t,r,i,n),po(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){i=t.stateNode;var l=t.memoizedProps,c=pi(a,l);i.props=c;var u=i.context,f=a.contextType;o=Zi,typeof f=="object"&&f!==null&&(o=Ct(f));var b=a.getDerivedStateFromProps;f=typeof b=="function"||typeof i.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l||u!==o)&&cf(t,i,r,o),yr=!1;var d=t.memoizedState;i.state=d,uo(t,r,i,n),po(),u=t.memoizedState,l||d!==u||yr?(typeof b=="function"&&(Vc(t,a,b,r),u=t.memoizedState),(c=yr||sf(t,a,c,r,d,u,o))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),i.props=r,i.state=u,i.context=o,r=c):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,zp(e,t),o=t.memoizedProps,f=pi(a,o),i.props=f,b=t.pendingProps,d=i.context,u=a.contextType,c=Zi,typeof u=="object"&&u!==null&&(c=Ct(u)),l=a.getDerivedStateFromProps,(u=typeof l=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==b||d!==c)&&cf(t,i,r,c),yr=!1,d=t.memoizedState,i.state=d,uo(t,r,i,n),po();var h=t.memoizedState;o!==b||d!==h||yr||e!==null&&e.dependencies!==null&&Wl(e.dependencies)?(typeof l=="function"&&(Vc(t,a,l,r),h=t.memoizedState),(f=yr||sf(t,a,f,r,d,h,c)||e!==null&&e.dependencies!==null&&Wl(e.dependencies))?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,h,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,h,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),i.props=r,i.state=h,i.context=c,r=f):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return i=r,Hl(e,t),r=(t.flags&128)!==0,i||r?(i=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&r?(t.child=si(t,e.child,null,n),t.child=si(t,null,a,n)):kt(e,t,a,n),t.memoizedState=i.state,e=t.child):e=lr(e,t,n),e}function bf(e,t,a,r){return oi(),t.flags|=256,kt(e,t,a,r),t.child}var Zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kc(e){return{baseLanes:e,cachePool:Gg()}}function Jc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=ea),e}function Rh(e,t,a){var r=t.pendingProps,n=!1,i=(t.flags&128)!==0,o;if((o=i)||(o=e!==null&&e.memoizedState===null?!1:(lt.current&2)!==0),o&&(n=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(Se){if(n?xr(t):kr(t),(e=Fe)?(e=Nb(e,va),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hr!==null?{id:Da,overflow:Ba}:null,retryLane:536870912,hydrationErrors:null},a=Og(e),a.return=t,t.child=a,St=t,Fe=null)):e=null,e===null)throw jr(t);return eu(e)?t.lanes=32:t.lanes=536870912,null}var l=r.children;return r=r.fallback,n?(kr(t),n=t.mode,l=os({mode:"hidden",children:l},n),r=ai(r,n,a,null),l.return=t,r.return=t,l.sibling=r,t.child=l,r=t.child,r.memoizedState=Kc(a),r.childLanes=Jc(e,o,a),t.memoizedState=Zc,ro(null,r)):(xr(t),Gp(t,l))}var c=e.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(i)t.flags&256?(xr(t),t.flags&=-257,t=Pc(e,t,a)):t.memoizedState!==null?(kr(t),t.child=e.child,t.flags|=128,t=null):(kr(t),l=r.fallback,n=t.mode,r=os({mode:"visible",children:r.children},n),l=ai(l,n,a,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,si(t,e.child,null,a),r=t.child,r.memoizedState=Kc(a),r.childLanes=Jc(e,o,a),t.memoizedState=Zc,t=ro(null,r));else if(xr(t),eu(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var u=o.dgst;o=u,r=Error(D(419)),r.stack="",r.digest=o,No({value:r,source:null,stack:null}),t=Pc(e,t,a)}else if(ft||vn(e,t,a,!1),o=(a&e.childLanes)!==0,ft||o){if(o=Ye,o!==null&&(r=cg(o,a),r!==0&&r!==c.retryLane))throw c.retryLane=r,fi(e,r),Yt(o,e,r),Hu;Wp(l)||ps(),t=Pc(e,t,a)}else Wp(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,Fe=ya(l.nextSibling),St=t,Se=!0,zr=null,va=!1,e!==null&&Hg(t,e),t=Gp(t,r.children),t.flags|=4096);return t}return n?(kr(t),l=r.fallback,n=t.mode,c=e.child,u=c.sibling,r=tr(c,{mode:"hidden",children:r.children}),r.subtreeFlags=c.subtreeFlags&65011712,u!==null?l=tr(u,l):(l=ai(l,n,a,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,ro(null,r),r=t.child,l=e.child.memoizedState,l===null?l=Kc(a):(n=l.cachePool,n!==null?(c=mt._currentValue,n=n.parent!==c?{parent:c,pool:c}:n):n=Gg(),l={baseLanes:l.baseLanes|a,cachePool:n}),r.memoizedState=l,r.childLanes=Jc(e,o,a),t.memoizedState=Zc,ro(e.child,r)):(xr(t),a=e.child,e=a.sibling,a=tr(a,{mode:"visible",children:r.children}),a.return=t,a.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=a,t.memoizedState=null,a)}function Gp(e,t){return t=os({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function os(e,t){return e=Wt(22,e,null,t),e.lanes=0,e}function Pc(e,t,a){return si(t,e.child,null,a),e=Gp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function vf(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ep(e.return,t,a)}function Fc(e,t,a,r,n,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:n,treeForkCount:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=a,o.tailMode=n,o.treeForkCount=i)}function Uh(e,t,a){var r=t.pendingProps,n=r.revealOrder,i=r.tail;r=r.children;var o=lt.current,l=(o&2)!==0;if(l?(o=o&1|2,t.flags|=128):o&=1,Ve(lt,o),kt(e,t,r,a),r=Se?ko:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vf(e,a,t);else if(e.tag===19)vf(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(n){case"forwards":for(a=t.child,n=null;a!==null;)e=a.alternate,e!==null&&as(e)===null&&(n=a),a=a.sibling;a=n,a===null?(n=t.child,t.child=null):(n=a.sibling,a.sibling=null),Fc(t,!1,n,a,i,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&as(e)===null){t.child=n;break}e=n.sibling,n.sibling=a,a=n,n=e}Fc(t,!0,a,null,i,r);break;case"together":Fc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function lr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Qr|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(vn(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(D(153));if(t.child!==null){for(e=t.child,a=tr(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=tr(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function ju(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Wl(e)))}function Cy(e,t,a){switch(t.tag){case 3:Vl(t,t.stateNode.containerInfo),_r(t,mt,e.memoizedState.cache),oi();break;case 27:case 5:gp(t);break;case 4:Vl(t,t.stateNode.containerInfo);break;case 10:_r(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Up(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(xr(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Rh(e,t,a):(xr(t),e=lr(e,t,a),e!==null?e.sibling:null);xr(t);break;case 19:var n=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(vn(e,t,a,!1),r=(a&t.childLanes)!==0),n){if(r)return Uh(e,t,a);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Ve(lt,lt.current),r)break;return null;case 22:return t.lanes=0,Ah(e,t,a,t.pendingProps);case 24:_r(t,mt,e.memoizedState.cache)}return lr(e,t,a)}function Dh(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)ft=!0;else{if(!ju(e,a)&&(t.flags&128)===0)return ft=!1,Cy(e,t,a);ft=(e.flags&131072)!==0}else ft=!1,Se&&(t.flags&1048576)!==0&&Lg(t,ko,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Wr(t.elementType),t.type=e,typeof e=="function")vu(e)?(r=pi(e,r),t.tag=1,t=hf(null,t,e,r,a)):(t.tag=0,t=jp(null,t,e,r,a));else{if(e!=null){var n=e.$$typeof;if(n===iu){t.tag=11,t=uf(null,t,e,r,a);break e}else if(n===nu){t.tag=14,t=df(null,t,e,r,a);break e}}throw t=mp(e)||e,Error(D(306,t,""))}}return t;case 0:return jp(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,n=pi(r,t.pendingProps),hf(e,t,r,n,a);case 3:e:{if(Vl(t,t.stateNode.containerInfo),e===null)throw Error(D(387));r=t.pendingProps;var i=t.memoizedState;n=i.element,zp(e,t),uo(t,r,null,a);var o=t.memoizedState;if(r=o.cache,_r(t,mt,r),r!==i.cache&&Mp(t,[mt],a,!0),po(),r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=bf(e,t,r,a);break e}else if(r!==n){n=ba(Error(D(424)),t),No(n),t=bf(e,t,r,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Fe=ya(e.firstChild),St=t,Se=!0,zr=null,va=!0,a=Xg(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(oi(),r===n){t=lr(e,t,a);break e}kt(e,t,r,a)}t=t.child}return t;case 26:return Hl(e,t),e===null?(a=jf(t.type,null,t.pendingProps,null))?t.memoizedState=a:Se||(a=t.type,e=t.pendingProps,r=fs(Tr.current).createElement(a),r[Nt]=t,r[Xt]=e,qt(r,a,e),yt(r),t.stateNode=r):t.memoizedState=jf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return gp(t),e===null&&Se&&(r=t.stateNode=Sb(t.type,t.pendingProps,Tr.current),St=t,va=!0,n=Fe,Xr(t.type)?(tu=n,Fe=ya(r.firstChild)):Fe=n),kt(e,t,t.pendingProps.children,a),Hl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Se&&((n=r=Fe)&&(r=e1(r,t.type,t.pendingProps,va),r!==null?(t.stateNode=r,St=t,Fe=ya(r.firstChild),va=!1,n=!0):n=!1),n||jr(t)),gp(t),n=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,r=i.children,Fp(n,i)?r=null:o!==null&&Fp(n,o)&&(t.flags|=32),t.memoizedState!==null&&(n=qu(e,t,by,null,null,a),To._currentValue=n),Hl(e,t),kt(e,t,r,a),t.child;case 6:return e===null&&Se&&((e=a=Fe)&&(a=t1(a,t.pendingProps,va),a!==null?(t.stateNode=a,St=t,Fe=null,e=!0):e=!1),e||jr(t)),null;case 13:return Rh(e,t,a);case 4:return Vl(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=si(t,null,r,a):kt(e,t,r,a),t.child;case 11:return uf(e,t,t.type,t.pendingProps,a);case 7:return kt(e,t,t.pendingProps,a),t.child;case 8:return kt(e,t,t.pendingProps.children,a),t.child;case 12:return kt(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,_r(t,t.type,r.value),kt(e,t,r.children,a),t.child;case 9:return n=t.type._context,r=t.pendingProps.children,li(t),n=Ct(n),r=r(n),t.flags|=1,kt(e,t,r,a),t.child;case 14:return df(e,t,t.type,t.pendingProps,a);case 15:return zh(e,t,t.type,t.pendingProps,a);case 19:return Uh(e,t,a);case 31:return Sy(e,t,a);case 22:return Ah(e,t,a,t.pendingProps);case 24:return li(t),r=Ct(mt),e===null?(n=xu(),n===null&&(n=Ye,i=_u(),n.pooledCache=i,i.refCount++,i!==null&&(n.pooledCacheLanes|=a),n=i),t.memoizedState={parent:r,cache:n},Nu(t),_r(t,mt,n)):((e.lanes&a)!==0&&(zp(e,t),uo(t,null,null,a),po()),n=e.memoizedState,i=t.memoizedState,n.parent!==r?(n={parent:r,cache:r},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),_r(t,mt,r)):(r=i.cache,_r(t,mt,r),r!==n.cache&&Mp(t,[mt],a,!0))),kt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(D(156,t.tag))}function Va(e){e.flags|=4}function Ic(e,t,a,r,n){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(nb())e.flags|=8192;else throw ii=es,ku}else e.flags&=-16777217}function wf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Eb(t))if(nb())e.flags|=8192;else throw ii=es,ku}function kl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?og():536870912,e.lanes|=t,un|=t)}function Pn(e,t){if(!Se)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var n=e.child;n!==null;)a|=n.lanes|n.childLanes,r|=n.subtreeFlags&65011712,r|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)a|=n.lanes|n.childLanes,r|=n.subtreeFlags,r|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function qy(e,t,a){var r=t.pendingProps;switch(yu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pe(t),null;case 1:return Pe(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ar(mt),nn(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Di(t)?Va(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Yc())),Pe(t),null;case 26:var n=t.type,i=t.memoizedState;return e===null?(Va(t),i!==null?(Pe(t),wf(t,i)):(Pe(t),Ic(t,n,null,r,a))):i?i!==e.memoizedState?(Va(t),Pe(t),wf(t,i)):(Pe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Va(t),Pe(t),Ic(t,n,e,r,a)),null;case 27:if(Zl(t),a=Tr.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Va(t);else{if(!r){if(t.stateNode===null)throw Error(D(166));return Pe(t),null}e=La.current,Di(t)?Zm(t,e):(e=Sb(n,r,a),t.stateNode=e,Va(t))}return Pe(t),null;case 5:if(Zl(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Va(t);else{if(!r){if(t.stateNode===null)throw Error(D(166));return Pe(t),null}if(i=La.current,Di(t))Zm(t,i);else{var o=fs(Tr.current);switch(i){case 1:i=o.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:i=o.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":i=o.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":i=o.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":i=o.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof r.is=="string"?o.createElement("select",{is:r.is}):o.createElement("select"),r.multiple?i.multiple=!0:r.size&&(i.size=r.size);break;default:i=typeof r.is=="string"?o.createElement(n,{is:r.is}):o.createElement(n)}}i[Nt]=t,i[Xt]=r;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)i.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=i;e:switch(qt(i,n,r),n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Va(t)}}return Pe(t),Ic(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Va(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(D(166));if(e=Tr.current,Di(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,n=St,n!==null)switch(n.tag){case 27:case 5:r=n.memoizedProps}e[Nt]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||_b(e.nodeValue,a)),e||jr(t,!0)}else e=fs(e).createTextNode(r),e[Nt]=t,t.stateNode=e}return Pe(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Di(t),a!==null){if(e===null){if(!r)throw Error(D(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(D(557));e[Nt]=t}else oi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Pe(t),e=!1}else a=Yc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(It(t),t):(It(t),null);if((t.flags&128)!==0)throw Error(D(558))}return Pe(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=Di(t),r!==null&&r.dehydrated!==null){if(e===null){if(!n)throw Error(D(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(D(317));n[Nt]=t}else oi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Pe(t),n=!1}else n=Yc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(It(t),t):(It(t),null)}return It(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,n=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(n=r.alternate.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==n&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),kl(t,t.updateQueue),Pe(t),null);case 4:return nn(),e===null&&Zu(t.stateNode.containerInfo),Pe(t),null;case 10:return ar(t.type),Pe(t),null;case 19:if(_t(lt),r=t.memoizedState,r===null)return Pe(t),null;if(n=(t.flags&128)!==0,i=r.rendering,i===null)if(n)Pn(r,!1);else{if(nt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=as(e),i!==null){for(t.flags|=128,Pn(r,!1),e=i.updateQueue,t.updateQueue=e,kl(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Bg(a,e),a=a.sibling;return Ve(lt,lt.current&1|2),Se&&Pa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ta()>ss&&(t.flags|=128,n=!0,Pn(r,!1),t.lanes=4194304)}else{if(!n)if(e=as(i),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,kl(t,e),Pn(r,!0),r.tail===null&&r.tailMode==="hidden"&&!i.alternate&&!Se)return Pe(t),null}else 2*ta()-r.renderingStartTime>ss&&a!==536870912&&(t.flags|=128,n=!0,Pn(r,!1),t.lanes=4194304);r.isBackwards?(i.sibling=t.child,t.child=i):(e=r.last,e!==null?e.sibling=i:t.child=i,r.last=i)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ta(),e.sibling=null,a=lt.current,Ve(lt,n?a&1|2:a&1),Se&&Pa(t,r.treeForkCount),e):(Pe(t),null);case 22:case 23:return It(t),Su(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(Pe(t),t.subtreeFlags&6&&(t.flags|=8192)):Pe(t),a=t.updateQueue,a!==null&&kl(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),e!==null&&_t(ri),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ar(mt),Pe(t),null;case 25:return null;case 30:return null}throw Error(D(156,t.tag))}function Ey(e,t){switch(yu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ar(mt),nn(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Zl(t),null;case 31:if(t.memoizedState!==null){if(It(t),t.alternate===null)throw Error(D(340));oi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(It(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(D(340));oi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _t(lt),null;case 4:return nn(),null;case 10:return ar(t.type),null;case 22:case 23:return It(t),Su(),e!==null&&_t(ri),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ar(mt),null;case 25:return null;default:return null}}function Bh(e,t){switch(yu(t),t.tag){case 3:ar(mt),nn();break;case 26:case 27:case 5:Zl(t);break;case 4:nn();break;case 31:t.memoizedState!==null&&It(t);break;case 13:It(t);break;case 19:_t(lt);break;case 10:ar(t.type);break;case 22:case 23:It(t),Su(),e!==null&&_t(ri);break;case 24:ar(mt)}}function Go(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var n=r.next;a=n;do{if((a.tag&e)===e){r=void 0;var i=a.create,o=a.inst;r=i(),o.destroy=r}a=a.next}while(a!==n)}}catch(l){Oe(t,t.return,l)}}function Gr(e,t,a){try{var r=t.updateQueue,n=r!==null?r.lastEffect:null;if(n!==null){var i=n.next;r=i;do{if((r.tag&e)===e){var o=r.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,n=t;var c=a,u=l;try{u()}catch(f){Oe(n,c,f)}}}r=r.next}while(r!==i)}}catch(f){Oe(t,t.return,f)}}function Oh(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Vg(t,a)}catch(r){Oe(e,e.return,r)}}}function Lh(e,t,a){a.props=pi(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){Oe(e,t,r)}}function fo(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(n){Oe(e,t,n)}}function Oa(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(n){Oe(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(n){Oe(e,t,n)}else a.current=null}function Hh(e){var t=e.type,a=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(n){Oe(e,e.return,n)}}function Wc(e,t,a){try{var r=e.stateNode;Ky(r,e.type,a,t),r[Xt]=t}catch(n){Oe(e,e.return,n)}}function jh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Xr(e.type)||e.tag===4}function ep(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||jh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Xr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Qp(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Wa));else if(r!==4&&(r===27&&Xr(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Qp(e,t,a),e=e.sibling;e!==null;)Qp(e,t,a),e=e.sibling}function ls(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(r===27&&Xr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(ls(e,t,a),e=e.sibling;e!==null;)ls(e,t,a),e=e.sibling}function Gh(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);qt(t,r,a),t[Nt]=e,t[Xt]=a}catch(i){Oe(e,e.return,i)}}var Fa=!1,dt=!1,tp=!1,yf=typeof WeakSet=="function"?WeakSet:Set,wt=null;function My(e,t){if(e=e.containerInfo,Jp=vs,e=Eg(e),gu(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var n=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{a.nodeType,i.nodeType}catch{a=null;break e}var o=0,l=-1,c=-1,u=0,f=0,b=e,d=null;t:for(;;){for(var h;b!==a||n!==0&&b.nodeType!==3||(l=o+n),b!==i||r!==0&&b.nodeType!==3||(c=o+r),b.nodeType===3&&(o+=b.nodeValue.length),(h=b.firstChild)!==null;)d=b,b=h;for(;;){if(b===e)break t;if(d===a&&++u===n&&(l=o),d===i&&++f===r&&(c=o),(h=b.nextSibling)!==null)break;b=d,d=b.parentNode}b=h}a=l===-1||c===-1?null:{start:l,end:c}}else a=null}a=a||{start:0,end:0}}else a=null;for(Pp={focusedElem:e,selectionRange:a},vs=!1,wt=t;wt!==null;)if(t=wt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,wt=e;else for(;wt!==null;){switch(t=wt,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)n=e[a],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,a=t,n=i.memoizedProps,i=i.memoizedState,r=a.stateNode;try{var w=pi(a.type,n);e=r.getSnapshotBeforeUpdate(w,i),r.__reactInternalSnapshotBeforeUpdate=e}catch(E){Oe(a,a.return,E)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Ip(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ip(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(D(163))}if(e=t.sibling,e!==null){e.return=t.return,wt=e;break}wt=t.return}}function Qh(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Ka(e,a),r&4&&Go(5,a);break;case 1:if(Ka(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(o){Oe(a,a.return,o)}else{var n=pi(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Oe(a,a.return,o)}}r&64&&Oh(a),r&512&&fo(a,a.return);break;case 3:if(Ka(e,a),r&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Vg(e,t)}catch(o){Oe(a,a.return,o)}}break;case 27:t===null&&r&4&&Gh(a);case 26:case 5:Ka(e,a),t===null&&r&4&&Hh(a),r&512&&fo(a,a.return);break;case 12:Ka(e,a);break;case 31:Ka(e,a),r&4&&$h(e,a);break;case 13:Ka(e,a),r&4&&Vh(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Ly.bind(null,a),a1(e,a))));break;case 22:if(r=a.memoizedState!==null||Fa,!r){t=t!==null&&t.memoizedState!==null||dt,n=Fa;var i=dt;Fa=r,(dt=t)&&!i?Ja(e,a,(a.subtreeFlags&8772)!==0):Ka(e,a),Fa=n,dt=i}break;case 30:break;default:Ka(e,a)}}function Yh(e){var t=e.alternate;t!==null&&(e.alternate=null,Yh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&cu(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var tt=null,Gt=!1;function Za(e,t,a){for(a=a.child;a!==null;)Xh(e,t,a),a=a.sibling}function Xh(e,t,a){if(aa&&typeof aa.onCommitFiberUnmount=="function")try{aa.onCommitFiberUnmount(Uo,a)}catch{}switch(a.tag){case 26:dt||Oa(a,t),Za(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:dt||Oa(a,t);var r=tt,n=Gt;Xr(a.type)&&(tt=a.stateNode,Gt=!1),Za(e,t,a),vo(a.stateNode),tt=r,Gt=n;break;case 5:dt||Oa(a,t);case 6:if(r=tt,n=Gt,tt=null,Za(e,t,a),tt=r,Gt=n,tt!==null)if(Gt)try{(tt.nodeType===9?tt.body:tt.nodeName==="HTML"?tt.ownerDocument.body:tt).removeChild(a.stateNode)}catch(i){Oe(a,t,i)}else try{tt.removeChild(a.stateNode)}catch(i){Oe(a,t,i)}break;case 18:tt!==null&&(Gt?(e=tt,Df(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),gn(e)):Df(tt,a.stateNode));break;case 4:r=tt,n=Gt,tt=a.stateNode.containerInfo,Gt=!0,Za(e,t,a),tt=r,Gt=n;break;case 0:case 11:case 14:case 15:Gr(2,a,t),dt||Gr(4,a,t),Za(e,t,a);break;case 1:dt||(Oa(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&Lh(a,t,r)),Za(e,t,a);break;case 21:Za(e,t,a);break;case 22:dt=(r=dt)||a.memoizedState!==null,Za(e,t,a),dt=r;break;default:Za(e,t,a)}}function $h(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{gn(e)}catch(a){Oe(t,t.return,a)}}}function Vh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{gn(e)}catch(a){Oe(t,t.return,a)}}function Ty(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new yf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new yf),t;default:throw Error(D(435,e.tag))}}function Nl(e,t){var a=Ty(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var n=Hy.bind(null,e,r);r.then(n,n)}})}function Ht(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var n=a[r],i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(Xr(l.type)){tt=l.stateNode,Gt=!1;break e}break;case 5:tt=l.stateNode,Gt=!1;break e;case 3:case 4:tt=l.stateNode.containerInfo,Gt=!0;break e}l=l.return}if(tt===null)throw Error(D(160));Xh(i,o,n),tt=null,Gt=!1,i=n.alternate,i!==null&&(i.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Zh(t,e),t=t.sibling}var Ea=null;function Zh(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ht(t,e),jt(e),r&4&&(Gr(3,e,e.return),Go(3,e),Gr(5,e,e.return));break;case 1:Ht(t,e),jt(e),r&512&&(dt||a===null||Oa(a,a.return)),r&64&&Fa&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var n=Ea;if(Ht(t,e),jt(e),r&512&&(dt||a===null||Oa(a,a.return)),r&4){var i=a!==null?a.memoizedState:null;if(r=e.memoizedState,a===null)if(r===null)if(e.stateNode===null){e:{r=e.type,a=e.memoizedProps,n=n.ownerDocument||n;t:switch(r){case"title":i=n.getElementsByTagName("title")[0],(!i||i[Oo]||i[Nt]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=n.createElement(r),n.head.insertBefore(i,n.querySelector("head > title"))),qt(i,r,a),i[Nt]=e,yt(i),r=i;break e;case"link":var o=Qf("link","href",n).get(r+(a.href||""));if(o){for(var l=0;l<o.length;l++)if(i=o[l],i.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&i.getAttribute("rel")===(a.rel==null?null:a.rel)&&i.getAttribute("title")===(a.title==null?null:a.title)&&i.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){o.splice(l,1);break t}}i=n.createElement(r),qt(i,r,a),n.head.appendChild(i);break;case"meta":if(o=Qf("meta","content",n).get(r+(a.content||""))){for(l=0;l<o.length;l++)if(i=o[l],i.getAttribute("content")===(a.content==null?null:""+a.content)&&i.getAttribute("name")===(a.name==null?null:a.name)&&i.getAttribute("property")===(a.property==null?null:a.property)&&i.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&i.getAttribute("charset")===(a.charSet==null?null:a.charSet)){o.splice(l,1);break t}}i=n.createElement(r),qt(i,r,a),n.head.appendChild(i);break;default:throw Error(D(468,r))}i[Nt]=e,yt(i),r=i}e.stateNode=r}else Yf(n,e.type,e.stateNode);else e.stateNode=Gf(n,r,e.memoizedProps);else i!==r?(i===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):i.count--,r===null?Yf(n,e.type,e.stateNode):Gf(n,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Wc(e,e.memoizedProps,a.memoizedProps)}break;case 27:Ht(t,e),jt(e),r&512&&(dt||a===null||Oa(a,a.return)),a!==null&&r&4&&Wc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Ht(t,e),jt(e),r&512&&(dt||a===null||Oa(a,a.return)),e.flags&32){n=e.stateNode;try{ln(n,"")}catch(w){Oe(e,e.return,w)}}r&4&&e.stateNode!=null&&(n=e.memoizedProps,Wc(e,n,a!==null?a.memoizedProps:n)),r&1024&&(tp=!0);break;case 6:if(Ht(t,e),jt(e),r&4){if(e.stateNode===null)throw Error(D(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(w){Oe(e,e.return,w)}}break;case 3:if(Ql=null,n=Ea,Ea=gs(t.containerInfo),Ht(t,e),Ea=n,jt(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{gn(t.containerInfo)}catch(w){Oe(e,e.return,w)}tp&&(tp=!1,Kh(e));break;case 4:r=Ea,Ea=gs(e.stateNode.containerInfo),Ht(t,e),jt(e),Ea=r;break;case 12:Ht(t,e),jt(e);break;case 31:Ht(t,e),jt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Nl(e,r)));break;case 13:Ht(t,e),jt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(zs=ta()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Nl(e,r)));break;case 22:n=e.memoizedState!==null;var c=a!==null&&a.memoizedState!==null,u=Fa,f=dt;if(Fa=u||n,dt=f||c,Ht(t,e),dt=f,Fa=u,jt(e),r&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(a===null||c||Fa||dt||ei(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){c=a=t;try{if(i=c.stateNode,n)o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=c.stateNode;var b=c.memoizedProps.style,d=b!=null&&b.hasOwnProperty("display")?b.display:null;l.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(w){Oe(c,c.return,w)}}}else if(t.tag===6){if(a===null){c=t;try{c.stateNode.nodeValue=n?"":c.memoizedProps}catch(w){Oe(c,c.return,w)}}}else if(t.tag===18){if(a===null){c=t;try{var h=c.stateNode;n?Bf(h,!0):Bf(c.stateNode,!1)}catch(w){Oe(c,c.return,w)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,Nl(e,a))));break;case 19:Ht(t,e),jt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Nl(e,r)));break;case 30:break;case 21:break;default:Ht(t,e),jt(e)}}function jt(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(jh(r)){a=r;break}r=r.return}if(a==null)throw Error(D(160));switch(a.tag){case 27:var n=a.stateNode,i=ep(e);ls(e,i,n);break;case 5:var o=a.stateNode;a.flags&32&&(ln(o,""),a.flags&=-33);var l=ep(e);ls(e,l,o);break;case 3:case 4:var c=a.stateNode.containerInfo,u=ep(e);Qp(e,u,c);break;default:throw Error(D(161))}}catch(f){Oe(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Kh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Kh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ka(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Qh(e,t.alternate,t),t=t.sibling}function ei(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Gr(4,t,t.return),ei(t);break;case 1:Oa(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Lh(t,t.return,a),ei(t);break;case 27:vo(t.stateNode);case 26:case 5:Oa(t,t.return),ei(t);break;case 22:t.memoizedState===null&&ei(t);break;case 30:ei(t);break;default:ei(t)}e=e.sibling}}function Ja(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,n=e,i=t,o=i.flags;switch(i.tag){case 0:case 11:case 15:Ja(n,i,a),Go(4,i);break;case 1:if(Ja(n,i,a),r=i,n=r.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(u){Oe(r,r.return,u)}if(r=i,n=r.updateQueue,n!==null){var l=r.stateNode;try{var c=n.shared.hiddenCallbacks;if(c!==null)for(n.shared.hiddenCallbacks=null,n=0;n<c.length;n++)$g(c[n],l)}catch(u){Oe(r,r.return,u)}}a&&o&64&&Oh(i),fo(i,i.return);break;case 27:Gh(i);case 26:case 5:Ja(n,i,a),a&&r===null&&o&4&&Hh(i),fo(i,i.return);break;case 12:Ja(n,i,a);break;case 31:Ja(n,i,a),a&&o&4&&$h(n,i);break;case 13:Ja(n,i,a),a&&o&4&&Vh(n,i);break;case 22:i.memoizedState===null&&Ja(n,i,a),fo(i,i.return);break;case 30:break;default:Ja(n,i,a)}t=t.sibling}}function Gu(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Ho(a))}function Qu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ho(e))}function qa(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Jh(e,t,a,r),t=t.sibling}function Jh(e,t,a,r){var n=t.flags;switch(t.tag){case 0:case 11:case 15:qa(e,t,a,r),n&2048&&Go(9,t);break;case 1:qa(e,t,a,r);break;case 3:qa(e,t,a,r),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ho(e)));break;case 12:if(n&2048){qa(e,t,a,r),e=t.stateNode;try{var i=t.memoizedProps,o=i.id,l=i.onPostCommit;typeof l=="function"&&l(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Oe(t,t.return,c)}}else qa(e,t,a,r);break;case 31:qa(e,t,a,r);break;case 13:qa(e,t,a,r);break;case 23:break;case 22:i=t.stateNode,o=t.alternate,t.memoizedState!==null?i._visibility&2?qa(e,t,a,r):go(e,t):i._visibility&2?qa(e,t,a,r):(i._visibility|=2,Oi(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),n&2048&&Gu(o,t);break;case 24:qa(e,t,a,r),n&2048&&Qu(t.alternate,t);break;default:qa(e,t,a,r)}}function Oi(e,t,a,r,n){for(n=n&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,o=t,l=a,c=r,u=o.flags;switch(o.tag){case 0:case 11:case 15:Oi(i,o,l,c,n),Go(8,o);break;case 23:break;case 22:var f=o.stateNode;o.memoizedState!==null?f._visibility&2?Oi(i,o,l,c,n):go(i,o):(f._visibility|=2,Oi(i,o,l,c,n)),n&&u&2048&&Gu(o.alternate,o);break;case 24:Oi(i,o,l,c,n),n&&u&2048&&Qu(o.alternate,o);break;default:Oi(i,o,l,c,n)}t=t.sibling}}function go(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,n=r.flags;switch(r.tag){case 22:go(a,r),n&2048&&Gu(r.alternate,r);break;case 24:go(a,r),n&2048&&Qu(r.alternate,r);break;default:go(a,r)}t=t.sibling}}var io=8192;function Bi(e,t,a){if(e.subtreeFlags&io)for(e=e.child;e!==null;)Ph(e,t,a),e=e.sibling}function Ph(e,t,a){switch(e.tag){case 26:Bi(e,t,a),e.flags&io&&e.memoizedState!==null&&f1(a,Ea,e.memoizedState,e.memoizedProps);break;case 5:Bi(e,t,a);break;case 3:case 4:var r=Ea;Ea=gs(e.stateNode.containerInfo),Bi(e,t,a),Ea=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=io,io=16777216,Bi(e,t,a),io=r):Bi(e,t,a));break;default:Bi(e,t,a)}}function Fh(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Fn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];wt=r,Wh(r,e)}Fh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ih(e),e=e.sibling}function Ih(e){switch(e.tag){case 0:case 11:case 15:Fn(e),e.flags&2048&&Gr(9,e,e.return);break;case 3:Fn(e);break;case 12:Fn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,jl(e)):Fn(e);break;default:Fn(e)}}function jl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];wt=r,Wh(r,e)}Fh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Gr(8,t,t.return),jl(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,jl(t));break;default:jl(t)}e=e.sibling}}function Wh(e,t){for(;wt!==null;){var a=wt;switch(a.tag){case 0:case 11:case 15:Gr(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ho(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,wt=r;else e:for(a=e;wt!==null;){r=wt;var n=r.sibling,i=r.return;if(Yh(r),r===a){wt=null;break e}if(n!==null){n.return=i,wt=n;break e}wt=i}}}var zy={getCacheForType:function(e){var t=Ct(mt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Ct(mt).controller.signal}},Ay=typeof WeakMap=="function"?WeakMap:Map,Ae=0,Ye=null,ke=null,Ne=0,Be=0,Ft=null,qr=!1,yn=!1,Yu=!1,sr=0,nt=0,Qr=0,ni=0,Xu=0,ea=0,un=0,ho=null,Qt=null,Yp=!1,zs=0,eb=0,ss=1/0,cs=null,Ur=null,ht=0,Dr=null,dn=null,rr=0,Xp=0,$p=null,tb=null,bo=0,Vp=null;function ia(){return(Ae&2)!==0&&Ne!==0?Ne&-Ne:de.T!==null?Vu():pg()}function ab(){if(ea===0)if((Ne&536870912)===0||Se){var e=fl;fl<<=1,(fl&3932160)===0&&(fl=262144),ea=e}else ea=536870912;return e=oa.current,e!==null&&(e.flags|=32),ea}function Yt(e,t,a){(e===Ye&&(Be===2||Be===9)||e.cancelPendingCommit!==null)&&(mn(e,0),Er(e,Ne,ea,!1)),Bo(e,a),((Ae&2)===0||e!==Ye)&&(e===Ye&&((Ae&2)===0&&(ni|=a),nt===4&&Er(e,Ne,ea,!1)),ja(e))}function rb(e,t,a){if((Ae&6)!==0)throw Error(D(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Do(e,t),n=r?Dy(e,t):ap(e,t,!0),i=r;do{if(n===0){yn&&!r&&Er(e,t,0,!1);break}else{if(a=e.current.alternate,i&&!Ry(a)){n=ap(e,t,!1),i=!1;continue}if(n===2){if(i=t,e.errorRecoveryDisabledLanes&i)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var l=e;n=ho;var c=l.current.memoizedState.isDehydrated;if(c&&(mn(l,o).flags|=256),o=ap(l,o,!1),o!==2){if(Yu&&!c){l.errorRecoveryDisabledLanes|=i,ni|=i,n=4;break e}i=Qt,Qt=n,i!==null&&(Qt===null?Qt=i:Qt.push.apply(Qt,i))}n=o}if(i=!1,n!==2)continue}}if(n===1){mn(e,0),Er(e,t,0,!0);break}e:{switch(r=e,i=n,i){case 0:case 1:throw Error(D(345));case 4:if((t&4194048)!==t)break;case 6:Er(r,t,ea,!qr);break e;case 2:Qt=null;break;case 3:case 5:break;default:throw Error(D(329))}if((t&62914560)===t&&(n=zs+300-ta(),10<n)){if(Er(r,t,ea,!qr),ys(r,0,!0)!==0)break e;rr=t,r.timeoutHandle=kb(_f.bind(null,r,a,Qt,cs,Yp,t,ea,ni,un,qr,i,"Throttled",-0,0),n);break e}_f(r,a,Qt,cs,Yp,t,ea,ni,un,qr,i,null,-0,0)}}break}while(!0);ja(e)}function _f(e,t,a,r,n,i,o,l,c,u,f,b,d,h){if(e.timeoutHandle=-1,b=t.subtreeFlags,b&8192||(b&16785408)===16785408){b={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Wa},Ph(t,i,b);var w=(i&62914560)===i?zs-ta():(i&4194048)===i?eb-ta():0;if(w=g1(b,w),w!==null){rr=i,e.cancelPendingCommit=w(kf.bind(null,e,t,i,a,r,n,o,l,c,f,b,null,d,h)),Er(e,i,o,!u);return}}kf(e,t,i,a,r,n,o,l,c)}function Ry(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var n=a[r],i=n.getSnapshot;n=n.value;try{if(!na(i(),n))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Er(e,t,a,r){t&=~Xu,t&=~ni,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var n=t;0<n;){var i=31-ra(n),o=1<<i;r[i]=-1,n&=~o}a!==0&&lg(e,a,t)}function As(){return(Ae&6)===0?(Qo(0,!1),!1):!0}function $u(){if(ke!==null){if(Be===0)var e=ke.return;else e=ke,er=gi=null,Tu(e),tn=null,So=0,e=ke;for(;e!==null;)Bh(e.alternate,e),e=e.return;ke=null}}function mn(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Fy(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),rr=0,$u(),Ye=e,ke=a=tr(e.current,null),Ne=t,Be=0,Ft=null,qr=!1,yn=Do(e,t),Yu=!1,un=ea=Xu=ni=Qr=nt=0,Qt=ho=null,Yp=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var n=31-ra(r),i=1<<n;t|=e[n],r&=~i}return sr=t,Ns(),a}function ib(e,t){he=null,de.H=qo,t===wn||t===Cs?(t=Im(),Be=3):t===ku?(t=Im(),Be=4):Be=t===Hu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ft=t,ke===null&&(nt=1,ns(e,ba(t,e.current)))}function nb(){var e=oa.current;return e===null?!0:(Ne&4194048)===Ne?wa===null:(Ne&62914560)===Ne||(Ne&536870912)!==0?e===wa:!1}function ob(){var e=de.H;return de.H=qo,e===null?qo:e}function lb(){var e=de.A;return de.A=zy,e}function ps(){nt=4,qr||(Ne&4194048)!==Ne&&oa.current!==null||(yn=!0),(Qr&134217727)===0&&(ni&134217727)===0||Ye===null||Er(Ye,Ne,ea,!1)}function ap(e,t,a){var r=Ae;Ae|=2;var n=ob(),i=lb();(Ye!==e||Ne!==t)&&(cs=null,mn(e,t)),t=!1;var o=nt;e:do try{if(Be!==0&&ke!==null){var l=ke,c=Ft;switch(Be){case 8:$u(),o=6;break e;case 3:case 2:case 9:case 6:oa.current===null&&(t=!0);var u=Be;if(Be=0,Ft=null,Pi(e,l,c,u),a&&yn){o=0;break e}break;default:u=Be,Be=0,Ft=null,Pi(e,l,c,u)}}Uy(),o=nt;break}catch(f){ib(e,f)}while(!0);return t&&e.shellSuspendCounter++,er=gi=null,Ae=r,de.H=n,de.A=i,ke===null&&(Ye=null,Ne=0,Ns()),o}function Uy(){for(;ke!==null;)sb(ke)}function Dy(e,t){var a=Ae;Ae|=2;var r=ob(),n=lb();Ye!==e||Ne!==t?(cs=null,ss=ta()+500,mn(e,t)):yn=Do(e,t);e:do try{if(Be!==0&&ke!==null){t=ke;var i=Ft;t:switch(Be){case 1:Be=0,Ft=null,Pi(e,t,i,1);break;case 2:case 9:if(Fm(i)){Be=0,Ft=null,xf(t);break}t=function(){Be!==2&&Be!==9||Ye!==e||(Be=7),ja(e)},i.then(t,t);break e;case 3:Be=7;break e;case 4:Be=5;break e;case 7:Fm(i)?(Be=0,Ft=null,xf(t)):(Be=0,Ft=null,Pi(e,t,i,7));break;case 5:var o=null;switch(ke.tag){case 26:o=ke.memoizedState;case 5:case 27:var l=ke;if(o?Eb(o):l.stateNode.complete){Be=0,Ft=null;var c=l.sibling;if(c!==null)ke=c;else{var u=l.return;u!==null?(ke=u,Rs(u)):ke=null}break t}}Be=0,Ft=null,Pi(e,t,i,5);break;case 6:Be=0,Ft=null,Pi(e,t,i,6);break;case 8:$u(),nt=6;break e;default:throw Error(D(462))}}By();break}catch(f){ib(e,f)}while(!0);return er=gi=null,de.H=r,de.A=n,Ae=a,ke!==null?0:(Ye=null,Ne=0,Ns(),nt)}function By(){for(;ke!==null&&!n0();)sb(ke)}function sb(e){var t=Dh(e.alternate,e,sr);e.memoizedProps=e.pendingProps,t===null?Rs(e):ke=t}function xf(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=gf(a,t,t.pendingProps,t.type,void 0,Ne);break;case 11:t=gf(a,t,t.pendingProps,t.type.render,t.ref,Ne);break;case 5:Tu(t);default:Bh(a,t),t=ke=Bg(t,sr),t=Dh(a,t,sr)}e.memoizedProps=e.pendingProps,t===null?Rs(e):ke=t}function Pi(e,t,a,r){er=gi=null,Tu(t),tn=null,So=0;var n=t.return;try{if(Ny(e,n,t,a,Ne)){nt=1,ns(e,ba(a,e.current)),ke=null;return}}catch(i){if(n!==null)throw ke=n,i;nt=1,ns(e,ba(a,e.current)),ke=null;return}t.flags&32768?(Se||r===1?e=!0:yn||(Ne&536870912)!==0?e=!1:(qr=e=!0,(r===2||r===9||r===3||r===6)&&(r=oa.current,r!==null&&r.tag===13&&(r.flags|=16384))),cb(t,e)):Rs(t)}function Rs(e){var t=e;do{if((t.flags&32768)!==0){cb(t,qr);return}e=t.return;var a=qy(t.alternate,t,sr);if(a!==null){ke=a;return}if(t=t.sibling,t!==null){ke=t;return}ke=t=e}while(t!==null);nt===0&&(nt=5)}function cb(e,t){do{var a=Ey(e.alternate,e);if(a!==null){a.flags&=32767,ke=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){ke=e;return}ke=e=a}while(e!==null);nt=6,ke=null}function kf(e,t,a,r,n,i,o,l,c){e.cancelPendingCommit=null;do Us();while(ht!==0);if((Ae&6)!==0)throw Error(D(327));if(t!==null){if(t===e.current)throw Error(D(177));if(i=t.lanes|t.childLanes,i|=hu,g0(e,a,i,o,l,c),e===Ye&&(ke=Ye=null,Ne=0),dn=t,Dr=e,rr=a,Xp=i,$p=n,tb=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,jy(Kl,function(){return fb(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=de.T,de.T=null,n=Re.p,Re.p=2,o=Ae,Ae|=4;try{My(e,t,a)}finally{Ae=o,Re.p=n,de.T=r}}ht=1,pb(),ub(),db()}}function pb(){if(ht===1){ht=0;var e=Dr,t=dn,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=de.T,de.T=null;var r=Re.p;Re.p=2;var n=Ae;Ae|=4;try{Zh(t,e);var i=Pp,o=Eg(e.containerInfo),l=i.focusedElem,c=i.selectionRange;if(o!==l&&l&&l.ownerDocument&&qg(l.ownerDocument.documentElement,l)){if(c!==null&&gu(l)){var u=c.start,f=c.end;if(f===void 0&&(f=u),"selectionStart"in l)l.selectionStart=u,l.selectionEnd=Math.min(f,l.value.length);else{var b=l.ownerDocument||document,d=b&&b.defaultView||window;if(d.getSelection){var h=d.getSelection(),w=l.textContent.length,E=Math.min(c.start,w),U=c.end===void 0?E:Math.min(c.end,w);!h.extend&&E>U&&(o=U,U=E,E=o);var m=Xm(l,E),p=Xm(l,U);if(m&&p&&(h.rangeCount!==1||h.anchorNode!==m.node||h.anchorOffset!==m.offset||h.focusNode!==p.node||h.focusOffset!==p.offset)){var g=b.createRange();g.setStart(m.node,m.offset),h.removeAllRanges(),E>U?(h.addRange(g),h.extend(p.node,p.offset)):(g.setEnd(p.node,p.offset),h.addRange(g))}}}}for(b=[],h=l;h=h.parentNode;)h.nodeType===1&&b.push({element:h,left:h.scrollLeft,top:h.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<b.length;l++){var v=b[l];v.element.scrollLeft=v.left,v.element.scrollTop=v.top}}vs=!!Jp,Pp=Jp=null}finally{Ae=n,Re.p=r,de.T=a}}e.current=t,ht=2}}function ub(){if(ht===2){ht=0;var e=Dr,t=dn,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=de.T,de.T=null;var r=Re.p;Re.p=2;var n=Ae;Ae|=4;try{Qh(e,t.alternate,t)}finally{Ae=n,Re.p=r,de.T=a}}ht=3}}function db(){if(ht===4||ht===3){ht=0,o0();var e=Dr,t=dn,a=rr,r=tb;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ht=5:(ht=0,dn=Dr=null,mb(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(Ur=null),su(a),t=t.stateNode,aa&&typeof aa.onCommitFiberRoot=="function")try{aa.onCommitFiberRoot(Uo,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=de.T,n=Re.p,Re.p=2,de.T=null;try{for(var i=e.onRecoverableError,o=0;o<r.length;o++){var l=r[o];i(l.value,{componentStack:l.stack})}}finally{de.T=t,Re.p=n}}(rr&3)!==0&&Us(),ja(e),n=e.pendingLanes,(a&261930)!==0&&(n&42)!==0?e===Vp?bo++:(bo=0,Vp=e):bo=0,Qo(0,!1)}}function mb(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ho(t)))}function Us(){return pb(),ub(),db(),fb()}function fb(){if(ht!==5)return!1;var e=Dr,t=Xp;Xp=0;var a=su(rr),r=de.T,n=Re.p;try{Re.p=32>a?32:a,de.T=null,a=$p,$p=null;var i=Dr,o=rr;if(ht=0,dn=Dr=null,rr=0,(Ae&6)!==0)throw Error(D(331));var l=Ae;if(Ae|=4,Ih(i.current),Jh(i,i.current,o,a),Ae=l,Qo(0,!1),aa&&typeof aa.onPostCommitFiberRoot=="function")try{aa.onPostCommitFiberRoot(Uo,i)}catch{}return!0}finally{Re.p=n,de.T=r,mb(e,t)}}function Nf(e,t,a){t=ba(a,t),t=Hp(e.stateNode,t,2),e=Rr(e,t,2),e!==null&&(Bo(e,2),ja(e))}function Oe(e,t,a){if(e.tag===3)Nf(e,e,a);else for(;t!==null;){if(t.tag===3){Nf(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ur===null||!Ur.has(r))){e=ba(a,e),a=Mh(2),r=Rr(t,a,2),r!==null&&(Th(a,r,t,e),Bo(r,2),ja(r));break}}t=t.return}}function rp(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new Ay;var n=new Set;r.set(t,n)}else n=r.get(t),n===void 0&&(n=new Set,r.set(t,n));n.has(a)||(Yu=!0,n.add(a),e=Oy.bind(null,e,t,a),t.then(e,e))}function Oy(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ye===e&&(Ne&a)===a&&(nt===4||nt===3&&(Ne&62914560)===Ne&&300>ta()-zs?(Ae&2)===0&&mn(e,0):Xu|=a,un===Ne&&(un=0)),ja(e)}function gb(e,t){t===0&&(t=og()),e=fi(e,t),e!==null&&(Bo(e,t),ja(e))}function Ly(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),gb(e,a)}function Hy(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,n=e.memoizedState;n!==null&&(a=n.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(D(314))}r!==null&&r.delete(t),gb(e,a)}function jy(e,t){return ou(e,t)}var us=null,Li=null,Zp=!1,ds=!1,ip=!1,Mr=0;function ja(e){e!==Li&&e.next===null&&(Li===null?us=Li=e:Li=Li.next=e),ds=!0,Zp||(Zp=!0,Qy())}function Qo(e,t){if(!ip&&ds){ip=!0;do for(var a=!1,r=us;r!==null;){if(!t)if(e!==0){var n=r.pendingLanes;if(n===0)var i=0;else{var o=r.suspendedLanes,l=r.pingedLanes;i=(1<<31-ra(42|e)+1)-1,i&=n&~(o&~l),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(a=!0,Sf(r,i))}else i=Ne,i=ys(r,r===Ye?i:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(i&3)===0||Do(r,i)||(a=!0,Sf(r,i));r=r.next}while(a);ip=!1}}function Gy(){hb()}function hb(){ds=Zp=!1;var e=0;Mr!==0&&Py()&&(e=Mr);for(var t=ta(),a=null,r=us;r!==null;){var n=r.next,i=bb(r,t);i===0?(r.next=null,a===null?us=n:a.next=n,n===null&&(Li=a)):(a=r,(e!==0||(i&3)!==0)&&(ds=!0)),r=n}ht!==0&&ht!==5||Qo(e,!1),Mr!==0&&(Mr=0)}function bb(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,n=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var o=31-ra(i),l=1<<o,c=n[o];c===-1?((l&a)===0||(l&r)!==0)&&(n[o]=f0(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}if(t=Ye,a=Ne,a=ys(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(Be===2||Be===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Rc(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Do(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&Rc(r),su(a)){case 2:case 8:a=ig;break;case 32:a=Kl;break;case 268435456:a=ng;break;default:a=Kl}return r=vb.bind(null,e),a=ou(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&Rc(r),e.callbackPriority=2,e.callbackNode=null,2}function vb(e,t){if(ht!==0&&ht!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Us()&&e.callbackNode!==a)return null;var r=Ne;return r=ys(e,e===Ye?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(rb(e,r,t),bb(e,ta()),e.callbackNode!=null&&e.callbackNode===a?vb.bind(null,e):null)}function Sf(e,t){if(Us())return null;rb(e,t,!0)}function Qy(){Iy(function(){(Ae&6)!==0?ou(rg,Gy):hb()})}function Vu(){if(Mr===0){var e=sn;e===0&&(e=ml,ml<<=1,(ml&261888)===0&&(ml=256)),Mr=e}return Mr}function Cf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:zl(""+e)}function qf(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Yy(e,t,a,r,n){if(t==="submit"&&a&&a.stateNode===n){var i=Cf((n[Xt]||null).action),o=r.submitter;o&&(t=(t=o[Xt]||null)?Cf(t.formAction):o.getAttribute("formAction"),t!==null&&(i=t,o=null));var l=new _s("action","action",null,r,n);e.push({event:l,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Mr!==0){var c=o?qf(n,o):new FormData(n);Op(a,{pending:!0,data:c,method:n.method,action:i},null,c)}}else typeof i=="function"&&(l.preventDefault(),c=o?qf(n,o):new FormData(n),Op(a,{pending:!0,data:c,method:n.method,action:i},i,c))},currentTarget:n}]})}}for(Sl=0;Sl<Sp.length;Sl++)Cl=Sp[Sl],Ef=Cl.toLowerCase(),Mf=Cl[0].toUpperCase()+Cl.slice(1),Ma(Ef,"on"+Mf);var Cl,Ef,Mf,Sl;Ma(Tg,"onAnimationEnd");Ma(zg,"onAnimationIteration");Ma(Ag,"onAnimationStart");Ma("dblclick","onDoubleClick");Ma("focusin","onFocus");Ma("focusout","onBlur");Ma(ly,"onTransitionRun");Ma(sy,"onTransitionStart");Ma(cy,"onTransitionCancel");Ma(Rg,"onTransitionEnd");on("onMouseEnter",["mouseout","mouseover"]);on("onMouseLeave",["mouseout","mouseover"]);on("onPointerEnter",["pointerout","pointerover"]);on("onPointerLeave",["pointerout","pointerover"]);ui("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ui("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ui("onBeforeInput",["compositionend","keypress","textInput","paste"]);ui("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ui("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ui("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Eo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Xy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Eo));function wb(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],n=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&n.isPropagationStopped())break e;i=l,n.currentTarget=u;try{i(n)}catch(f){Pl(f)}n.currentTarget=null,i=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&n.isPropagationStopped())break e;i=l,n.currentTarget=u;try{i(n)}catch(f){Pl(f)}n.currentTarget=null,i=c}}}}function xe(e,t){var a=t[bp];a===void 0&&(a=t[bp]=new Set);var r=e+"__bubble";a.has(r)||(yb(t,e,2,!1),a.add(r))}function np(e,t,a){var r=0;t&&(r|=4),yb(a,e,r,t)}var ql="_reactListening"+Math.random().toString(36).slice(2);function Zu(e){if(!e[ql]){e[ql]=!0,ug.forEach(function(a){a!=="selectionchange"&&(Xy.has(a)||np(a,!1,e),np(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ql]||(t[ql]=!0,np("selectionchange",!1,t))}}function yb(e,t,a,r){switch(Rb(t)){case 2:var n=v1;break;case 8:n=w1;break;default:n=Fu}a=n.bind(null,t,a,e),n=void 0,!xp||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),r?n!==void 0?e.addEventListener(t,a,{capture:!0,passive:n}):e.addEventListener(t,a,!0):n!==void 0?e.addEventListener(t,a,{passive:n}):e.addEventListener(t,a,!1)}function op(e,t,a,r,n){var i=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===n)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===n)return;o=o.return}for(;l!==null;){if(o=Gi(l),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=i=o;continue e}l=l.parentNode}}r=r.return}wg(function(){var u=i,f=uu(a),b=[];e:{var d=Ug.get(e);if(d!==void 0){var h=_s,w=e;switch(e){case"keypress":if(Rl(a)===0)break e;case"keydown":case"keyup":h=H0;break;case"focusin":w="focus",h=Lc;break;case"focusout":w="blur",h=Lc;break;case"beforeblur":case"afterblur":h=Lc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Dm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=q0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=Q0;break;case Tg:case zg:case Ag:h=T0;break;case Rg:h=X0;break;case"scroll":case"scrollend":h=S0;break;case"wheel":h=V0;break;case"copy":case"cut":case"paste":h=A0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Om;break;case"toggle":case"beforetoggle":h=K0}var E=(t&4)!==0,U=!E&&(e==="scroll"||e==="scrollend"),m=E?d!==null?d+"Capture":null:d;E=[];for(var p=u,g;p!==null;){var v=p;if(g=v.stateNode,v=v.tag,v!==5&&v!==26&&v!==27||g===null||m===null||(v=yo(p,m),v!=null&&E.push(Mo(p,v,g))),U)break;p=p.return}0<E.length&&(d=new h(d,w,null,a,f),b.push({event:d,listeners:E}))}}if((t&7)===0){e:{if(d=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",d&&a!==_p&&(w=a.relatedTarget||a.fromElement)&&(Gi(w)||w[hn]))break e;if((h||d)&&(d=f.window===f?f:(d=f.ownerDocument)?d.defaultView||d.parentWindow:window,h?(w=a.relatedTarget||a.toElement,h=u,w=w?Gi(w):null,w!==null&&(U=Ro(w),E=w.tag,w!==U||E!==5&&E!==27&&E!==6)&&(w=null)):(h=null,w=u),h!==w)){if(E=Dm,v="onMouseLeave",m="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(E=Om,v="onPointerLeave",m="onPointerEnter",p="pointer"),U=h==null?d:ao(h),g=w==null?d:ao(w),d=new E(v,p+"leave",h,a,f),d.target=U,d.relatedTarget=g,v=null,Gi(f)===u&&(E=new E(m,p+"enter",w,a,f),E.target=g,E.relatedTarget=U,v=E),U=v,h&&w)t:{for(E=$y,m=h,p=w,g=0,v=m;v;v=E(v))g++;v=0;for(var N=p;N;N=E(N))v++;for(;0<g-v;)m=E(m),g--;for(;0<v-g;)p=E(p),v--;for(;g--;){if(m===p||p!==null&&m===p.alternate){E=m;break t}m=E(m),p=E(p)}E=null}else E=null;h!==null&&Tf(b,d,h,E,!1),w!==null&&U!==null&&Tf(b,U,w,E,!0)}}e:{if(d=u?ao(u):window,h=d.nodeName&&d.nodeName.toLowerCase(),h==="select"||h==="input"&&d.type==="file")var T=Gm;else if(jm(d))if(Sg)T=iy;else{T=ay;var M=ty}else h=d.nodeName,!h||h.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?u&&pu(u.elementType)&&(T=Gm):T=ry;if(T&&(T=T(e,u))){Ng(b,T,a,f);break e}M&&M(e,d,u),e==="focusout"&&u&&d.type==="number"&&u.memoizedProps.value!=null&&yp(d,"number",d.value)}switch(M=u?ao(u):window,e){case"focusin":(jm(M)||M.contentEditable==="true")&&(Xi=M,kp=u,lo=null);break;case"focusout":lo=kp=Xi=null;break;case"mousedown":Np=!0;break;case"contextmenu":case"mouseup":case"dragend":Np=!1,$m(b,a,f);break;case"selectionchange":if(oy)break;case"keydown":case"keyup":$m(b,a,f)}var R;if(fu)e:{switch(e){case"compositionstart":var j="onCompositionStart";break e;case"compositionend":j="onCompositionEnd";break e;case"compositionupdate":j="onCompositionUpdate";break e}j=void 0}else Yi?xg(e,a)&&(j="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(j="onCompositionStart");j&&(_g&&a.locale!=="ko"&&(Yi||j!=="onCompositionStart"?j==="onCompositionEnd"&&Yi&&(R=yg()):(Cr=f,du="value"in Cr?Cr.value:Cr.textContent,Yi=!0)),M=ms(u,j),0<M.length&&(j=new Bm(j,e,null,a,f),b.push({event:j,listeners:M}),R?j.data=R:(R=kg(a),R!==null&&(j.data=R)))),(R=P0?F0(e,a):I0(e,a))&&(j=ms(u,"onBeforeInput"),0<j.length&&(M=new Bm("onBeforeInput","beforeinput",null,a,f),b.push({event:M,listeners:j}),M.data=R)),Yy(b,e,u,a,f)}wb(b,t)})}function Mo(e,t,a){return{instance:e,listener:t,currentTarget:a}}function ms(e,t){for(var a=t+"Capture",r=[];e!==null;){var n=e,i=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||i===null||(n=yo(e,a),n!=null&&r.unshift(Mo(e,n,i)),n=yo(e,t),n!=null&&r.push(Mo(e,n,i))),e.tag===3)return r;e=e.return}return[]}function $y(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Tf(e,t,a,r,n){for(var i=t._reactName,o=[];a!==null&&a!==r;){var l=a,c=l.alternate,u=l.stateNode;if(l=l.tag,c!==null&&c===r)break;l!==5&&l!==26&&l!==27||u===null||(c=u,n?(u=yo(a,i),u!=null&&o.unshift(Mo(a,u,c))):n||(u=yo(a,i),u!=null&&o.push(Mo(a,u,c)))),a=a.return}o.length!==0&&e.push({event:t,listeners:o})}var Vy=/\r\n?/g,Zy=/\u0000|\uFFFD/g;function zf(e){return(typeof e=="string"?e:""+e).replace(Vy,`
9
- `).replace(Zy,"")}function _b(e,t){return t=zf(t),zf(e)===t}function je(e,t,a,r,n,i){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||ln(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&ln(e,""+r);break;case"className":hl(e,"class",r);break;case"tabIndex":hl(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":hl(e,a,r);break;case"style":vg(e,r,i);break;case"data":if(t!=="object"){hl(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=zl(""+r),e.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(a==="formAction"?(t!=="input"&&je(e,t,"name",n.name,n,null),je(e,t,"formEncType",n.formEncType,n,null),je(e,t,"formMethod",n.formMethod,n,null),je(e,t,"formTarget",n.formTarget,n,null)):(je(e,t,"encType",n.encType,n,null),je(e,t,"method",n.method,n,null),je(e,t,"target",n.target,n,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=zl(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=Wa);break;case"onScroll":r!=null&&xe("scroll",e);break;case"onScrollEnd":r!=null&&xe("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(D(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(D(60));e.innerHTML=a}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}a=zl(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""+r):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":r===!0?e.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(a,r):e.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(a):e.setAttribute(a,r);break;case"popover":xe("beforetoggle",e),xe("toggle",e),Tl(e,"popover",r);break;case"xlinkActuate":$a(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":$a(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":$a(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":$a(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":$a(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":$a(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":$a(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":$a(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":$a(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Tl(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=k0.get(a)||a,Tl(e,a,r))}}function Kp(e,t,a,r,n,i){switch(a){case"style":vg(e,r,i);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(D(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(D(60));e.innerHTML=a}}break;case"children":typeof r=="string"?ln(e,r):(typeof r=="number"||typeof r=="bigint")&&ln(e,""+r);break;case"onScroll":r!=null&&xe("scroll",e);break;case"onScrollEnd":r!=null&&xe("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Wa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!dg.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(n=a.endsWith("Capture"),t=a.slice(2,n?a.length-7:void 0),i=e[Xt]||null,i=i!=null?i[a]:null,typeof i=="function"&&e.removeEventListener(t,i,n),typeof r=="function")){typeof i!="function"&&i!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,r,n);break e}a in e?e[a]=r:r===!0?e.setAttribute(a,""):Tl(e,a,r)}}}function qt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xe("error",e),xe("load",e);var r=!1,n=!1,i;for(i in a)if(a.hasOwnProperty(i)){var o=a[i];if(o!=null)switch(i){case"src":r=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(D(137,t));default:je(e,t,i,o,a,null)}}n&&je(e,t,"srcSet",a.srcSet,a,null),r&&je(e,t,"src",a.src,a,null);return;case"input":xe("invalid",e);var l=i=o=n=null,c=null,u=null;for(r in a)if(a.hasOwnProperty(r)){var f=a[r];if(f!=null)switch(r){case"name":n=f;break;case"type":o=f;break;case"checked":c=f;break;case"defaultChecked":u=f;break;case"value":i=f;break;case"defaultValue":l=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(D(137,t));break;default:je(e,t,r,f,a,null)}}gg(e,i,l,c,u,o,n,!1);return;case"select":xe("invalid",e),r=o=i=null;for(n in a)if(a.hasOwnProperty(n)&&(l=a[n],l!=null))switch(n){case"value":i=l;break;case"defaultValue":o=l;break;case"multiple":r=l;default:je(e,t,n,l,a,null)}t=i,a=o,e.multiple=!!r,t!=null?Ii(e,!!r,t,!1):a!=null&&Ii(e,!!r,a,!0);return;case"textarea":xe("invalid",e),i=n=r=null;for(o in a)if(a.hasOwnProperty(o)&&(l=a[o],l!=null))switch(o){case"value":r=l;break;case"defaultValue":n=l;break;case"children":i=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(D(91));break;default:je(e,t,o,l,a,null)}bg(e,r,n,i);return;case"option":for(c in a)a.hasOwnProperty(c)&&(r=a[c],r!=null)&&(c==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":je(e,t,c,r,a,null));return;case"dialog":xe("beforetoggle",e),xe("toggle",e),xe("cancel",e),xe("close",e);break;case"iframe":case"object":xe("load",e);break;case"video":case"audio":for(r=0;r<Eo.length;r++)xe(Eo[r],e);break;case"image":xe("error",e),xe("load",e);break;case"details":xe("toggle",e);break;case"embed":case"source":case"link":xe("error",e),xe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in a)if(a.hasOwnProperty(u)&&(r=a[u],r!=null))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(D(137,t));default:je(e,t,u,r,a,null)}return;default:if(pu(t)){for(f in a)a.hasOwnProperty(f)&&(r=a[f],r!==void 0&&Kp(e,t,f,r,a,void 0));return}}for(l in a)a.hasOwnProperty(l)&&(r=a[l],r!=null&&je(e,t,l,r,a,null))}function Ky(e,t,a,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,i=null,o=null,l=null,c=null,u=null,f=null;for(h in a){var b=a[h];if(a.hasOwnProperty(h)&&b!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":c=b;default:r.hasOwnProperty(h)||je(e,t,h,null,r,b)}}for(var d in r){var h=r[d];if(b=a[d],r.hasOwnProperty(d)&&(h!=null||b!=null))switch(d){case"type":i=h;break;case"name":n=h;break;case"checked":u=h;break;case"defaultChecked":f=h;break;case"value":o=h;break;case"defaultValue":l=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(D(137,t));break;default:h!==b&&je(e,t,d,h,r,b)}}wp(e,o,l,c,u,f,i,n);return;case"select":h=o=l=d=null;for(i in a)if(c=a[i],a.hasOwnProperty(i)&&c!=null)switch(i){case"value":break;case"multiple":h=c;default:r.hasOwnProperty(i)||je(e,t,i,null,r,c)}for(n in r)if(i=r[n],c=a[n],r.hasOwnProperty(n)&&(i!=null||c!=null))switch(n){case"value":d=i;break;case"defaultValue":l=i;break;case"multiple":o=i;default:i!==c&&je(e,t,n,i,r,c)}t=l,a=o,r=h,d!=null?Ii(e,!!a,d,!1):!!r!=!!a&&(t!=null?Ii(e,!!a,t,!0):Ii(e,!!a,a?[]:"",!1));return;case"textarea":h=d=null;for(l in a)if(n=a[l],a.hasOwnProperty(l)&&n!=null&&!r.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:je(e,t,l,null,r,n)}for(o in r)if(n=r[o],i=a[o],r.hasOwnProperty(o)&&(n!=null||i!=null))switch(o){case"value":d=n;break;case"defaultValue":h=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(D(91));break;default:n!==i&&je(e,t,o,n,r,i)}hg(e,d,h);return;case"option":for(var w in a)d=a[w],a.hasOwnProperty(w)&&d!=null&&!r.hasOwnProperty(w)&&(w==="selected"?e.selected=!1:je(e,t,w,null,r,d));for(c in r)d=r[c],h=a[c],r.hasOwnProperty(c)&&d!==h&&(d!=null||h!=null)&&(c==="selected"?e.selected=d&&typeof d!="function"&&typeof d!="symbol":je(e,t,c,d,r,h));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var E in a)d=a[E],a.hasOwnProperty(E)&&d!=null&&!r.hasOwnProperty(E)&&je(e,t,E,null,r,d);for(u in r)if(d=r[u],h=a[u],r.hasOwnProperty(u)&&d!==h&&(d!=null||h!=null))switch(u){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(D(137,t));break;default:je(e,t,u,d,r,h)}return;default:if(pu(t)){for(var U in a)d=a[U],a.hasOwnProperty(U)&&d!==void 0&&!r.hasOwnProperty(U)&&Kp(e,t,U,void 0,r,d);for(f in r)d=r[f],h=a[f],!r.hasOwnProperty(f)||d===h||d===void 0&&h===void 0||Kp(e,t,f,d,r,h);return}}for(var m in a)d=a[m],a.hasOwnProperty(m)&&d!=null&&!r.hasOwnProperty(m)&&je(e,t,m,null,r,d);for(b in r)d=r[b],h=a[b],!r.hasOwnProperty(b)||d===h||d==null&&h==null||je(e,t,b,d,r,h)}function Af(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Jy(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var n=a[r],i=n.transferSize,o=n.initiatorType,l=n.duration;if(i&&l&&Af(o)){for(o=0,l=n.responseEnd,r+=1;r<a.length;r++){var c=a[r],u=c.startTime;if(u>l)break;var f=c.transferSize,b=c.initiatorType;f&&Af(b)&&(c=c.responseEnd,o+=f*(c<l?1:(l-u)/(c-u)))}if(--r,t+=8*(i+o)/(n.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Jp=null,Pp=null;function fs(e){return e.nodeType===9?e:e.ownerDocument}function Rf(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function xb(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Fp(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var lp=null;function Py(){var e=window.event;return e&&e.type==="popstate"?e===lp?!1:(lp=e,!0):(lp=null,!1)}var kb=typeof setTimeout=="function"?setTimeout:void 0,Fy=typeof clearTimeout=="function"?clearTimeout:void 0,Uf=typeof Promise=="function"?Promise:void 0,Iy=typeof queueMicrotask=="function"?queueMicrotask:typeof Uf<"u"?function(e){return Uf.resolve(null).then(e).catch(Wy)}:kb;function Wy(e){setTimeout(function(){throw e})}function Xr(e){return e==="head"}function Df(e,t){var a=t,r=0;do{var n=a.nextSibling;if(e.removeChild(a),n&&n.nodeType===8)if(a=n.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(n),gn(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")vo(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,vo(a);for(var i=a.firstChild;i;){var o=i.nextSibling,l=i.nodeName;i[Oo]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&i.rel.toLowerCase()==="stylesheet"||a.removeChild(i),i=o}}else a==="body"&&vo(e.ownerDocument.body);a=n}while(a);gn(t)}function Bf(e,t){var a=e;e=0;do{var r=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=r}while(a)}function Ip(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Ip(a),cu(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function e1(e,t,a,r){for(;e.nodeType===1;){var n=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Oo])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==n.rel||e.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute("title")!==(n.title==null?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=ya(e.nextSibling),e===null)break}return null}function t1(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=ya(e.nextSibling),e===null))return null;return e}function Nb(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ya(e.nextSibling),e===null))return null;return e}function Wp(e){return e.data==="$?"||e.data==="$~"}function eu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function a1(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var r=function(){t(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function ya(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var tu=null;function Of(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return ya(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Lf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Sb(e,t,a){switch(t=fs(a),e){case"html":if(e=t.documentElement,!e)throw Error(D(452));return e;case"head":if(e=t.head,!e)throw Error(D(453));return e;case"body":if(e=t.body,!e)throw Error(D(454));return e;default:throw Error(D(451))}}function vo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);cu(e)}var _a=new Map,Hf=new Set;function gs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var cr=Re.d;Re.d={f:r1,r:i1,D:n1,C:o1,L:l1,m:s1,X:p1,S:c1,M:u1};function r1(){var e=cr.f(),t=As();return e||t}function i1(e){var t=bn(e);t!==null&&t.tag===5&&t.type==="form"?vh(t):cr.r(e)}var _n=typeof document>"u"?null:document;function Cb(e,t,a){var r=_n;if(r&&typeof t=="string"&&t){var n=ha(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof a=="string"&&(n+='[crossorigin="'+a+'"]'),Hf.has(n)||(Hf.add(n),e={rel:e,crossOrigin:a,href:t},r.querySelector(n)===null&&(t=r.createElement("link"),qt(t,"link",e),yt(t),r.head.appendChild(t)))}}function n1(e){cr.D(e),Cb("dns-prefetch",e,null)}function o1(e,t){cr.C(e,t),Cb("preconnect",e,t)}function l1(e,t,a){cr.L(e,t,a);var r=_n;if(r&&e&&t){var n='link[rel="preload"][as="'+ha(t)+'"]';t==="image"&&a&&a.imageSrcSet?(n+='[imagesrcset="'+ha(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(n+='[imagesizes="'+ha(a.imageSizes)+'"]')):n+='[href="'+ha(e)+'"]';var i=n;switch(t){case"style":i=fn(e);break;case"script":i=xn(e)}_a.has(i)||(e=Ie({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),_a.set(i,e),r.querySelector(n)!==null||t==="style"&&r.querySelector(Yo(i))||t==="script"&&r.querySelector(Xo(i))||(t=r.createElement("link"),qt(t,"link",e),yt(t),r.head.appendChild(t)))}}function s1(e,t){cr.m(e,t);var a=_n;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+ha(r)+'"][href="'+ha(e)+'"]',i=n;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=xn(e)}if(!_a.has(i)&&(e=Ie({rel:"modulepreload",href:e},t),_a.set(i,e),a.querySelector(n)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Xo(i)))return}r=a.createElement("link"),qt(r,"link",e),yt(r),a.head.appendChild(r)}}}function c1(e,t,a){cr.S(e,t,a);var r=_n;if(r&&e){var n=Fi(r).hoistableStyles,i=fn(e);t=t||"default";var o=n.get(i);if(!o){var l={loading:0,preload:null};if(o=r.querySelector(Yo(i)))l.loading=5;else{e=Ie({rel:"stylesheet",href:e,"data-precedence":t},a),(a=_a.get(i))&&Ku(e,a);var c=o=r.createElement("link");yt(c),qt(c,"link",e),c._p=new Promise(function(u,f){c.onload=u,c.onerror=f}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Gl(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:l},n.set(i,o)}}}function p1(e,t){cr.X(e,t);var a=_n;if(a&&e){var r=Fi(a).hoistableScripts,n=xn(e),i=r.get(n);i||(i=a.querySelector(Xo(n)),i||(e=Ie({src:e,async:!0},t),(t=_a.get(n))&&Ju(e,t),i=a.createElement("script"),yt(i),qt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(n,i))}}function u1(e,t){cr.M(e,t);var a=_n;if(a&&e){var r=Fi(a).hoistableScripts,n=xn(e),i=r.get(n);i||(i=a.querySelector(Xo(n)),i||(e=Ie({src:e,async:!0,type:"module"},t),(t=_a.get(n))&&Ju(e,t),i=a.createElement("script"),yt(i),qt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(n,i))}}function jf(e,t,a,r){var n=(n=Tr.current)?gs(n):null;if(!n)throw Error(D(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=fn(a.href),a=Fi(n).hoistableStyles,r=a.get(t),r||(r={type:"style",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=fn(a.href);var i=Fi(n).hoistableStyles,o=i.get(e);if(o||(n=n.ownerDocument||n,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,o),(i=n.querySelector(Yo(e)))&&!i._p&&(o.instance=i,o.state.loading=5),_a.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},_a.set(e,a),i||d1(n,e,a,o.state))),t&&r===null)throw Error(D(528,""));return o}if(t&&r!==null)throw Error(D(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=xn(a),a=Fi(n).hoistableScripts,r=a.get(t),r||(r={type:"script",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(D(444,e))}}function fn(e){return'href="'+ha(e)+'"'}function Yo(e){return'link[rel="stylesheet"]['+e+"]"}function qb(e){return Ie({},e,{"data-precedence":e.precedence,precedence:null})}function d1(e,t,a,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),qt(t,"link",a),yt(t),e.head.appendChild(t))}function xn(e){return'[src="'+ha(e)+'"]'}function Xo(e){return"script[async]"+e}function Gf(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+ha(a.href)+'"]');if(r)return t.instance=r,yt(r),r;var n=Ie({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),yt(r),qt(r,"style",n),Gl(r,a.precedence,e),t.instance=r;case"stylesheet":n=fn(a.href);var i=e.querySelector(Yo(n));if(i)return t.state.loading|=4,t.instance=i,yt(i),i;r=qb(a),(n=_a.get(n))&&Ku(r,n),i=(e.ownerDocument||e).createElement("link"),yt(i);var o=i;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),qt(i,"link",r),t.state.loading|=4,Gl(i,a.precedence,e),t.instance=i;case"script":return i=xn(a.src),(n=e.querySelector(Xo(i)))?(t.instance=n,yt(n),n):(r=a,(n=_a.get(i))&&(r=Ie({},a),Ju(r,n)),e=e.ownerDocument||e,n=e.createElement("script"),yt(n),qt(n,"link",r),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(D(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Gl(r,a.precedence,e));return t.instance}function Gl(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=r.length?r[r.length-1]:null,i=n,o=0;o<r.length;o++){var l=r[o];if(l.dataset.precedence===t)i=l;else if(i!==n)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Ku(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ju(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ql=null;function Qf(e,t,a){if(Ql===null){var r=new Map,n=Ql=new Map;n.set(a,r)}else n=Ql,r=n.get(a),r||(r=new Map,n.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),n=0;n<a.length;n++){var i=a[n];if(!(i[Oo]||i[Nt]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var o=i.getAttribute(t)||"";o=e+o;var l=r.get(o);l?l.push(i):r.set(o,[i])}}return r}function Yf(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function m1(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Eb(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function f1(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var n=fn(r.href),i=t.querySelector(Yo(n));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=hs.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=i,yt(i);return}i=t.ownerDocument||t,r=qb(r),(n=_a.get(n))&&Ku(r,n),i=i.createElement("link"),yt(i);var o=i;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),qt(i,"link",r),a.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=hs.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var sp=0;function g1(e,t){return e.stylesheets&&e.count===0&&Yl(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&Yl(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&sp===0&&(sp=62500*Jy());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Yl(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>sp?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(n)}}:null}function hs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var bs=null;function Yl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,bs=new Map,t.forEach(h1,e),bs=null,hs.call(e))}function h1(e,t){if(!(t.state.loading&4)){var a=bs.get(e);if(a)var r=a.get(null);else{a=new Map,bs.set(e,a);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<n.length;i++){var o=n[i];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(a.set(o.dataset.precedence,o),r=o)}r&&a.set(null,r)}n=t.instance,o=n.getAttribute("data-precedence"),i=a.get(o)||r,i===r&&a.set(null,n),a.set(o,n),this.count++,r=hs.bind(this),n.addEventListener("load",r),n.addEventListener("error",r),i?i.parentNode.insertBefore(n,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var To={$$typeof:Ia,Provider:null,Consumer:null,_currentValue:ti,_currentValue2:ti,_threadCount:0};function b1(e,t,a,r,n,i,o,l,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Uc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Uc(0),this.hiddenUpdates=Uc(null),this.identifierPrefix=r,this.onUncaughtError=n,this.onCaughtError=i,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function Mb(e,t,a,r,n,i,o,l,c,u,f,b){return e=new b1(e,t,a,o,c,u,f,b,l),t=1,i===!0&&(t|=24),i=Wt(3,null,null,t),e.current=i,i.stateNode=e,t=_u(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:r,isDehydrated:a,cache:t},Nu(i),e}function Tb(e){return e?(e=Zi,e):Zi}function zb(e,t,a,r,n,i){n=Tb(n),r.context===null?r.context=n:r.pendingContext=n,r=Ar(t),r.payload={element:a},i=i===void 0?null:i,i!==null&&(r.callback=i),a=Rr(e,r,t),a!==null&&(Yt(a,e,t),co(a,e,t))}function Xf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Pu(e,t){Xf(e,t),(e=e.alternate)&&Xf(e,t)}function Ab(e){if(e.tag===13||e.tag===31){var t=fi(e,67108864);t!==null&&Yt(t,e,67108864),Pu(e,67108864)}}function $f(e){if(e.tag===13||e.tag===31){var t=ia();t=lu(t);var a=fi(e,t);a!==null&&Yt(a,e,t),Pu(e,t)}}var vs=!0;function v1(e,t,a,r){var n=de.T;de.T=null;var i=Re.p;try{Re.p=2,Fu(e,t,a,r)}finally{Re.p=i,de.T=n}}function w1(e,t,a,r){var n=de.T;de.T=null;var i=Re.p;try{Re.p=8,Fu(e,t,a,r)}finally{Re.p=i,de.T=n}}function Fu(e,t,a,r){if(vs){var n=au(r);if(n===null)op(e,t,r,ws,a),Vf(e,r);else if(_1(n,e,t,a,r))r.stopPropagation();else if(Vf(e,r),t&4&&-1<y1.indexOf(e)){for(;n!==null;){var i=bn(n);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var o=Ir(i.pendingLanes);if(o!==0){var l=i;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var c=1<<31-ra(o);l.entanglements[1]|=c,o&=~c}ja(i),(Ae&6)===0&&(ss=ta()+500,Qo(0,!1))}}break;case 31:case 13:l=fi(i,2),l!==null&&Yt(l,i,2),As(),Pu(i,2)}if(i=au(r),i===null&&op(e,t,r,ws,a),i===n)break;n=i}n!==null&&r.stopPropagation()}else op(e,t,r,null,a)}}function au(e){return e=uu(e),Iu(e)}var ws=null;function Iu(e){if(ws=null,e=Gi(e),e!==null){var t=Ro(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=If(t),e!==null)return e;e=null}else if(a===31){if(e=Wf(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ws=e,null}function Rb(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(l0()){case rg:return 2;case ig:return 8;case Kl:case s0:return 32;case ng:return 268435456;default:return 32}default:return 32}}var ru=!1,Br=null,Or=null,Lr=null,zo=new Map,Ao=new Map,Nr=[],y1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Vf(e,t){switch(e){case"focusin":case"focusout":Br=null;break;case"dragenter":case"dragleave":Or=null;break;case"mouseover":case"mouseout":Lr=null;break;case"pointerover":case"pointerout":zo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ao.delete(t.pointerId)}}function In(e,t,a,r,n,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:i,targetContainers:[n]},t!==null&&(t=bn(t),t!==null&&Ab(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function _1(e,t,a,r,n){switch(t){case"focusin":return Br=In(Br,e,t,a,r,n),!0;case"dragenter":return Or=In(Or,e,t,a,r,n),!0;case"mouseover":return Lr=In(Lr,e,t,a,r,n),!0;case"pointerover":var i=n.pointerId;return zo.set(i,In(zo.get(i)||null,e,t,a,r,n)),!0;case"gotpointercapture":return i=n.pointerId,Ao.set(i,In(Ao.get(i)||null,e,t,a,r,n)),!0}return!1}function Ub(e){var t=Gi(e.target);if(t!==null){var a=Ro(t);if(a!==null){if(t=a.tag,t===13){if(t=If(a),t!==null){e.blockedOn=t,Em(e.priority,function(){$f(a)});return}}else if(t===31){if(t=Wf(a),t!==null){e.blockedOn=t,Em(e.priority,function(){$f(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Xl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=au(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);_p=r,a.target.dispatchEvent(r),_p=null}else return t=bn(a),t!==null&&Ab(t),e.blockedOn=a,!1;t.shift()}return!0}function Zf(e,t,a){Xl(e)&&a.delete(t)}function x1(){ru=!1,Br!==null&&Xl(Br)&&(Br=null),Or!==null&&Xl(Or)&&(Or=null),Lr!==null&&Xl(Lr)&&(Lr=null),zo.forEach(Zf),Ao.forEach(Zf)}function El(e,t){e.blockedOn===t&&(e.blockedOn=null,ru||(ru=!0,bt.unstable_scheduleCallback(bt.unstable_NormalPriority,x1)))}var Ml=null;function Kf(e){Ml!==e&&(Ml=e,bt.unstable_scheduleCallback(bt.unstable_NormalPriority,function(){Ml===e&&(Ml=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],n=e[t+2];if(typeof r!="function"){if(Iu(r||a)===null)continue;break}var i=bn(a);i!==null&&(e.splice(t,3),t-=3,Op(i,{pending:!0,data:n,method:a.method,action:r},r,n))}}))}function gn(e){function t(c){return El(c,e)}Br!==null&&El(Br,e),Or!==null&&El(Or,e),Lr!==null&&El(Lr,e),zo.forEach(t),Ao.forEach(t);for(var a=0;a<Nr.length;a++){var r=Nr[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Nr.length&&(a=Nr[0],a.blockedOn===null);)Ub(a),a.blockedOn===null&&Nr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var n=a[r],i=a[r+1],o=n[Xt]||null;if(typeof i=="function")o||Kf(a);else if(o){var l=null;if(i&&i.hasAttribute("formAction")){if(n=i,o=i[Xt]||null)l=o.formAction;else if(Iu(n)!==null)continue}else l=o.action;typeof l=="function"?a[r+1]=l:(a.splice(r,3),r-=3),Kf(a)}}}function Db(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(o){return n=o})},focusReset:"manual",scroll:"manual"})}function t(){n!==null&&(n(),n=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,n=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),n!==null&&(n(),n=null)}}}function Wu(e){this._internalRoot=e}Ds.prototype.render=Wu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(D(409));var a=t.current,r=ia();zb(a,r,e,t,null,null)};Ds.prototype.unmount=Wu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;zb(e.current,2,null,e,null,null),As(),t[hn]=null}};function Ds(e){this._internalRoot=e}Ds.prototype.unstable_scheduleHydration=function(e){if(e){var t=pg();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Nr.length&&t!==0&&t<Nr[a].priority;a++);Nr.splice(a,0,e),a===0&&Ub(e)}};var Jf=Pf.version;if(Jf!=="19.2.3")throw Error(D(527,Jf,"19.2.3"));Re.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(D(188)):(e=Object.keys(e).join(","),Error(D(268,e)));return e=e0(t),e=e!==null?eg(e):null,e=e===null?null:e.stateNode,e};var k1={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:de,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Wn=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Wn.isDisabled&&Wn.supportsFiber))try{Uo=Wn.inject(k1),aa=Wn}catch{}var Wn;Bs.createRoot=function(e,t){if(!Ff(e))throw Error(D(299));var a=!1,r="",n=Ch,i=qh,o=Eh;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Mb(e,1,!1,null,null,a,r,null,n,i,o,Db),e[hn]=t.current,Zu(e),new Wu(t)};Bs.hydrateRoot=function(e,t,a){if(!Ff(e))throw Error(D(299));var r=!1,n="",i=Ch,o=qh,l=Eh,c=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onUncaughtError!==void 0&&(i=a.onUncaughtError),a.onCaughtError!==void 0&&(o=a.onCaughtError),a.onRecoverableError!==void 0&&(l=a.onRecoverableError),a.formState!==void 0&&(c=a.formState)),t=Mb(e,1,!0,t,a??null,r,n,c,i,o,l,Db),t.context=Tb(null),a=t.current,r=ia(),r=lu(r),n=Ar(r),n.callback=null,Rr(a,n,r),a=r,t.current.lanes=a,Bo(t,a),ja(t),e[hn]=t.current,Zu(e),new Ds(t)};Bs.version="19.2.3"});var Hb=Ra((I_,Lb)=>{"use strict";function Ob(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ob)}catch(e){console.error(e)}}Ob(),Lb.exports=Bb()});var Tv=Ra(Hs=>{"use strict";var M1=Symbol.for("react.transitional.element"),T1=Symbol.for("react.fragment");function Mv(e,t,a){var r=null;if(a!==void 0&&(r=""+a),t.key!==void 0&&(r=""+t.key),"key"in t){a={};for(var n in t)n!=="key"&&(a[n]=t[n])}else a=t;return t=a.ref,{$$typeof:M1,type:e,key:r,ref:t!==void 0?t:null,props:a}}Hs.Fragment=T1;Hs.jsx=Mv;Hs.jsxs=Mv});var re=Ra((kk,zv)=>{"use strict";zv.exports=Tv()});var xw=Y(Hb());var jb=`/* Every rule is scoped to .app-wrapper, the root of each widget, so nothing here styles
8
+ `+r.stack}}var hu=Object.prototype.hasOwnProperty,op=ft.unstable_scheduleCallback,Rc=ft.unstable_cancelCallback,n0=ft.unstable_shouldYield,o0=ft.unstable_requestPaint,aa=ft.unstable_now,l0=ft.unstable_getCurrentPriorityLevel,rg=ft.unstable_ImmediatePriority,ig=ft.unstable_UserBlockingPriority,Kl=ft.unstable_NormalPriority,s0=ft.unstable_LowPriority,ng=ft.unstable_IdlePriority,c0=ft.log,u0=ft.unstable_setDisableYieldValue,Uo=null,ra=null;function Sr(e){if(typeof c0=="function"&&u0(e),ra&&typeof ra.setStrictMode=="function")try{ra.setStrictMode(Uo,e)}catch{}}var ia=Math.clz32?Math.clz32:m0,p0=Math.log,d0=Math.LN2;function m0(e){return e>>>=0,e===0?32:31-(p0(e)/d0|0)|0}var ml=256,fl=262144,gl=4194304;function Ir(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ys(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=r&134217727;return l!==0?(r=l&~i,r!==0?n=Ir(r):(o&=l,o!==0?n=Ir(o):a||(a=l&~e,a!==0&&(n=Ir(a))))):(l=r&~i,l!==0?n=Ir(l):o!==0?n=Ir(o):a||(a=r&~e,a!==0&&(n=Ir(a)))),n===0?0:t!==0&&t!==n&&(t&i)===0&&(i=n&-n,a=t&-t,i>=a||i===32&&(a&4194048)!==0)?t:n}function Do(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function f0(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function og(){var e=gl;return gl<<=1,(gl&62914560)===0&&(gl=4194304),e}function Uc(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Bo(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function g0(e,t,a,r,n,i){var o=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,p=e.hiddenUpdates;for(a=o&~a;0<a;){var f=31-ia(a),v=1<<f;l[f]=0,c[f]=-1;var m=p[f];if(m!==null)for(p[f]=null,f=0;f<m.length;f++){var h=m[f];h!==null&&(h.lane&=-536870913)}a&=~v}r!==0&&lg(e,r,0),i!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=i&~(o&~t))}function lg(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ia(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function sg(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-ia(a),n=1<<r;n&t|e[r]&t&&(e[r]|=t),a&=~n}}function cg(e,t){var a=t&-t;return a=(a&42)!==0?1:lp(a),(a&(e.suspendedLanes|t))!==0?0:a}function lp(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function sp(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ug(){var e=Ae.p;return e!==0?e:(e=window.event,e===void 0?32:Rb(e.type))}function Em(e,t){var a=Ae.p;try{return Ae.p=e,t()}finally{Ae.p=a}}var Yr=Math.random().toString(36).slice(2),Nt="__reactFiber$"+Yr,Xt="__reactProps$"+Yr,hn="__reactContainer$"+Yr,bu="__reactEvents$"+Yr,h0="__reactListeners$"+Yr,b0="__reactHandles$"+Yr,Mm="__reactResources$"+Yr,Oo="__reactMarker$"+Yr;function cp(e){delete e[Nt],delete e[Xt],delete e[bu],delete e[h0],delete e[b0]}function Gi(e){var t=e[Nt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[hn]||a[Nt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Lf(e);e!==null;){if(a=e[Nt])return a;e=Lf(e)}return t}e=a,a=e.parentNode}return null}function bn(e){if(e=e[Nt]||e[hn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ao(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(D(33))}function Fi(e){var t=e[Mm];return t||(t=e[Mm]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function vt(e){e[Oo]=!0}var pg=new Set,dg={};function pi(e,t){on(e,t),on(e+"Capture",t)}function on(e,t){for(dg[e]=t,e=0;e<t.length;e++)pg.add(t[e])}var v0=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Tm={},zm={};function w0(e){return hu.call(zm,e)?!0:hu.call(Tm,e)?!1:v0.test(e)?zm[e]=!0:(Tm[e]=!0,!1)}function Tl(e,t,a){if(w0(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function hl(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Va(e,t,a,r){if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+r)}}function ma(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function mg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function y0(e,t,a){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var n=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(o){a=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(o){a=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function vu(e){if(!e._valueTracker){var t=mg(e)?"checked":"value";e._valueTracker=y0(e,t,""+e[t])}}function fg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=mg(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function Jl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var _0=/[\n"\\]/g;function ha(e){return e.replace(_0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function wu(e,t,a,r,n,i,o,l){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ma(t)):e.value!==""+ma(t)&&(e.value=""+ma(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?yu(e,o,ma(t)):a!=null?yu(e,o,ma(a)):r!=null&&e.removeAttribute("value"),n==null&&i!=null&&(e.defaultChecked=!!i),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+ma(l):e.removeAttribute("name")}function gg(e,t,a,r,n,i,o,l){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||a!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){vu(e);return}a=a!=null?""+ma(a):"",t=t!=null?""+ma(t):a,l||t===e.value||(e.value=t),e.defaultValue=t}r=r??n,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=l?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),vu(e)}function yu(e,t,a){t==="number"&&Jl(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Ii(e,t,a,r){if(e=e.options,t){t={};for(var n=0;n<a.length;n++)t["$"+a[n]]=!0;for(a=0;a<e.length;a++)n=t.hasOwnProperty("$"+e[a].value),e[a].selected!==n&&(e[a].selected=n),n&&r&&(e[a].defaultSelected=!0)}else{for(a=""+ma(a),t=null,n=0;n<e.length;n++){if(e[n].value===a){e[n].selected=!0,r&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function hg(e,t,a){if(t!=null&&(t=""+ma(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+ma(a):""}function bg(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(D(92));if(to(r)){if(1<r.length)throw Error(D(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=ma(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),vu(e)}function ln(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var x0=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Am(e,t,a){var r=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,a):typeof a!="number"||a===0||x0.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function vg(e,t,a){if(t!=null&&typeof t!="object")throw Error(D(62));if(e=e.style,a!=null){for(var r in a)!a.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var n in t)r=t[n],t.hasOwnProperty(n)&&a[n]!==r&&Am(e,n,r)}else for(var i in t)t.hasOwnProperty(i)&&Am(e,i,t[i])}function up(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var k0=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),N0=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function zl(e){return N0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function er(){}var _u=null;function pp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qi=null,Wi=null;function Rm(e){var t=bn(e);if(t&&(e=t.stateNode)){var a=e[Xt]||null;e:switch(e=t.stateNode,t.type){case"input":if(wu(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+ha(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var n=r[Xt]||null;if(!n)throw Error(D(90));wu(r,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&fg(r)}break e;case"textarea":hg(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Ii(e,!!a.multiple,t,!1)}}}var Dc=!1;function wg(e,t,a){if(Dc)return e(t,a);Dc=!0;try{var r=e(t);return r}finally{if(Dc=!1,(Qi!==null||Wi!==null)&&(As(),Qi&&(t=Qi,e=Wi,Wi=Qi=null,Rm(t),e)))for(t=0;t<e.length;t++)Rm(e[t])}}function yo(e,t){var a=e.stateNode;if(a===null)return null;var r=a[Xt]||null;if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(D(231,t,typeof a));return a}var nr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xu=!1;if(nr)try{Ui={},Object.defineProperty(Ui,"passive",{get:function(){xu=!0}}),window.addEventListener("test",Ui,Ui),window.removeEventListener("test",Ui,Ui)}catch{xu=!1}var Ui,Cr=null,dp=null,Al=null;function yg(){if(Al)return Al;var e,t=dp,a=t.length,r,n="value"in Cr?Cr.value:Cr.textContent,i=n.length;for(e=0;e<a&&t[e]===n[e];e++);var o=a-e;for(r=1;r<=o&&t[a-r]===n[i-r];r++);return Al=n.slice(e,1<r?1-r:void 0)}function Rl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function bl(){return!0}function Um(){return!1}function $t(e){function t(a,r,n,i,o){this._reactName=a,this._targetInst=n,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(a=e[l],this[l]=a?a(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?bl:Um,this.isPropagationStopped=Um,this}return Fe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=bl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=bl)},persist:function(){},isPersistent:bl}),t}var di={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_s=$t(di),Lo=Fe({},di,{view:0,detail:0}),S0=$t(Lo),Bc,Oc,Kn,xs=Fe({},Lo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mp,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Kn&&(Kn&&e.type==="mousemove"?(Bc=e.screenX-Kn.screenX,Oc=e.screenY-Kn.screenY):Oc=Bc=0,Kn=e),Bc)},movementY:function(e){return"movementY"in e?e.movementY:Oc}}),Dm=$t(xs),C0=Fe({},xs,{dataTransfer:0}),q0=$t(C0),E0=Fe({},Lo,{relatedTarget:0}),Lc=$t(E0),M0=Fe({},di,{animationName:0,elapsedTime:0,pseudoElement:0}),T0=$t(M0),z0=Fe({},di,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),A0=$t(z0),R0=Fe({},di,{data:0}),Bm=$t(R0),U0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},D0={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},B0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function O0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=B0[e])?!!t[e]:!1}function mp(){return O0}var L0=Fe({},Lo,{key:function(e){if(e.key){var t=U0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Rl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?D0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mp,charCode:function(e){return e.type==="keypress"?Rl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Rl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),H0=$t(L0),j0=Fe({},xs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Om=$t(j0),G0=Fe({},Lo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mp}),Q0=$t(G0),Y0=Fe({},di,{propertyName:0,elapsedTime:0,pseudoElement:0}),X0=$t(Y0),$0=Fe({},xs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),V0=$t($0),Z0=Fe({},di,{newState:0,oldState:0}),K0=$t(Z0),J0=[9,13,27,32],fp=nr&&"CompositionEvent"in window,no=null;nr&&"documentMode"in document&&(no=document.documentMode);var P0=nr&&"TextEvent"in window&&!no,_g=nr&&(!fp||no&&8<no&&11>=no),Lm=" ",Hm=!1;function xg(e,t){switch(e){case"keyup":return J0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Yi=!1;function F0(e,t){switch(e){case"compositionend":return kg(t);case"keypress":return t.which!==32?null:(Hm=!0,Lm);case"textInput":return e=t.data,e===Lm&&Hm?null:e;default:return null}}function I0(e,t){if(Yi)return e==="compositionend"||!fp&&xg(e,t)?(e=yg(),Al=dp=Cr=null,Yi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return _g&&t.locale!=="ko"?null:t.data;default:return null}}var W0={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function jm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!W0[e.type]:t==="textarea"}function Ng(e,t,a,r){Qi?Wi?Wi.push(r):Wi=[r]:Qi=r,t=ms(t,"onChange"),0<t.length&&(a=new _s("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var oo=null,_o=null;function ey(e){wb(e,0)}function ks(e){var t=ao(e);if(fg(t))return e}function Gm(e,t){if(e==="change")return t}var Sg=!1;nr&&(nr?(wl="oninput"in document,wl||(Hc=document.createElement("div"),Hc.setAttribute("oninput","return;"),wl=typeof Hc.oninput=="function"),vl=wl):vl=!1,Sg=vl&&(!document.documentMode||9<document.documentMode));var vl,wl,Hc;function Qm(){oo&&(oo.detachEvent("onpropertychange",Cg),_o=oo=null)}function Cg(e){if(e.propertyName==="value"&&ks(_o)){var t=[];Ng(t,_o,e,pp(e)),wg(ey,t)}}function ty(e,t,a){e==="focusin"?(Qm(),oo=t,_o=a,oo.attachEvent("onpropertychange",Cg)):e==="focusout"&&Qm()}function ay(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ks(_o)}function ry(e,t){if(e==="click")return ks(t)}function iy(e,t){if(e==="input"||e==="change")return ks(t)}function ny(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var oa=typeof Object.is=="function"?Object.is:ny;function xo(e,t){if(oa(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var n=a[r];if(!hu.call(t,n)||!oa(e[n],t[n]))return!1}return!0}function Ym(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xm(e,t){var a=Ym(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Ym(a)}}function qg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Eg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Jl(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Jl(e.document)}return t}function gp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var oy=nr&&"documentMode"in document&&11>=document.documentMode,Xi=null,ku=null,lo=null,Nu=!1;function $m(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Nu||Xi==null||Xi!==Jl(r)||(r=Xi,"selectionStart"in r&&gp(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),lo&&xo(lo,r)||(lo=r,r=ms(ku,"onSelect"),0<r.length&&(t=new _s("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Xi)))}function Pr(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var $i={animationend:Pr("Animation","AnimationEnd"),animationiteration:Pr("Animation","AnimationIteration"),animationstart:Pr("Animation","AnimationStart"),transitionrun:Pr("Transition","TransitionRun"),transitionstart:Pr("Transition","TransitionStart"),transitioncancel:Pr("Transition","TransitionCancel"),transitionend:Pr("Transition","TransitionEnd")},jc={},Mg={};nr&&(Mg=document.createElement("div").style,"AnimationEvent"in window||(delete $i.animationend.animation,delete $i.animationiteration.animation,delete $i.animationstart.animation),"TransitionEvent"in window||delete $i.transitionend.transition);function mi(e){if(jc[e])return jc[e];if(!$i[e])return e;var t=$i[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Mg)return jc[e]=t[a];return e}var Tg=mi("animationend"),zg=mi("animationiteration"),Ag=mi("animationstart"),ly=mi("transitionrun"),sy=mi("transitionstart"),cy=mi("transitioncancel"),Rg=mi("transitionend"),Ug=new Map,Su="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Su.push("scrollEnd");function Ta(e,t){Ug.set(e,t),pi(t,[e])}var Pl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},da=[],Vi=0,hp=0;function Ns(){for(var e=Vi,t=hp=Vi=0;t<e;){var a=da[t];da[t++]=null;var r=da[t];da[t++]=null;var n=da[t];da[t++]=null;var i=da[t];if(da[t++]=null,r!==null&&n!==null){var o=r.pending;o===null?n.next=n:(n.next=o.next,o.next=n),r.pending=n}i!==0&&Dg(a,n,i)}}function Ss(e,t,a,r){da[Vi++]=e,da[Vi++]=t,da[Vi++]=a,da[Vi++]=r,hp|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function bp(e,t,a,r){return Ss(e,t,a,r),Fl(e)}function fi(e,t){return Ss(e,null,null,t),Fl(e)}function Dg(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var n=!1,i=e.return;i!==null;)i.childLanes|=a,r=i.alternate,r!==null&&(r.childLanes|=a),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(n=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,n&&t!==null&&(n=31-ia(a),e=i.hiddenUpdates,r=e[n],r===null?e[n]=[t]:r.push(t),t.lane=a|536870912),i):null}function Fl(e){if(50<bo)throw bo=0,Vu=null,Error(D(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Zi={};function uy(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ea(e,t,a,r){return new uy(e,t,a,r)}function vp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ar(e,t){var a=e.alternate;return a===null?(a=ea(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Bg(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ul(e,t,a,r,n,i){var o=0;if(r=e,typeof e=="function")vp(e)&&(o=1);else if(typeof e=="string")o=m1(e,a,La.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case du:return e=ea(31,a,t,n),e.elementType=du,e.lanes=i,e;case Hi:return ai(a.children,n,i,t);case tg:o=8,n|=24;break;case cu:return e=ea(12,a,t,n|2),e.elementType=cu,e.lanes=i,e;case uu:return e=ea(13,a,t,n),e.elementType=uu,e.lanes=i,e;case pu:return e=ea(19,a,t,n),e.elementType=pu,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Wa:o=10;break e;case ag:o=9;break e;case ip:o=11;break e;case np:o=14;break e;case wr:o=16,r=null;break e}o=29,a=Error(D(130,e===null?"null":typeof e,"")),r=null}return t=ea(o,a,t,n),t.elementType=e,t.type=r,t.lanes=i,t}function ai(e,t,a,r){return e=ea(7,e,r,t),e.lanes=a,e}function Gc(e,t,a){return e=ea(6,e,null,t),e.lanes=a,e}function Og(e){var t=ea(18,null,null,0);return t.stateNode=e,t}function Qc(e,t,a){return t=ea(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Vm=new WeakMap;function ba(e,t){if(typeof e=="object"&&e!==null){var a=Vm.get(e);return a!==void 0?a:(t={value:e,source:t,stack:qm(t)},Vm.set(e,t),t)}return{value:e,source:t,stack:qm(t)}}var Ki=[],Ji=0,Il=null,ko=0,fa=[],ga=0,Hr=null,Da=1,Ba="";function Fa(e,t){Ki[Ji++]=ko,Ki[Ji++]=Il,Il=e,ko=t}function Lg(e,t,a){fa[ga++]=Da,fa[ga++]=Ba,fa[ga++]=Hr,Hr=e;var r=Da;e=Ba;var n=32-ia(r)-1;r&=~(1<<n),a+=1;var i=32-ia(t)+n;if(30<i){var o=n-n%5;i=(r&(1<<o)-1).toString(32),r>>=o,n-=o,Da=1<<32-ia(t)+n|a<<n|r,Ba=i+e}else Da=1<<i|a<<n|r,Ba=e}function wp(e){e.return!==null&&(Fa(e,1),Lg(e,1,0))}function yp(e){for(;e===Il;)Il=Ki[--Ji],Ki[Ji]=null,ko=Ki[--Ji],Ki[Ji]=null;for(;e===Hr;)Hr=fa[--ga],fa[ga]=null,Ba=fa[--ga],fa[ga]=null,Da=fa[--ga],fa[ga]=null}function Hg(e,t){fa[ga++]=Da,fa[ga++]=Ba,fa[ga++]=Hr,Da=t.id,Ba=t.overflow,Hr=e}var St=null,Pe=null,Se=!1,zr=null,va=!1,Cu=Error(D(519));function jr(e){var t=Error(D(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw No(ba(t,e)),Cu}function Zm(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[Nt]=e,t[Xt]=r,a){case"dialog":xe("cancel",t),xe("close",t);break;case"iframe":case"object":case"embed":xe("load",t);break;case"video":case"audio":for(a=0;a<Eo.length;a++)xe(Eo[a],t);break;case"source":xe("error",t);break;case"img":case"image":case"link":xe("error",t),xe("load",t);break;case"details":xe("toggle",t);break;case"input":xe("invalid",t),gg(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":xe("invalid",t);break;case"textarea":xe("invalid",t),bg(t,r.value,r.defaultValue,r.children)}a=r.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||r.suppressHydrationWarning===!0||_b(t.textContent,a)?(r.popover!=null&&(xe("beforetoggle",t),xe("toggle",t)),r.onScroll!=null&&xe("scroll",t),r.onScrollEnd!=null&&xe("scrollend",t),r.onClick!=null&&(t.onclick=er),t=!0):t=!1,t||jr(e,!0)}function Km(e){for(St=e.return;St;)switch(St.tag){case 5:case 31:case 13:va=!1;return;case 27:case 3:va=!0;return;default:St=St.return}}function Di(e){if(e!==St)return!1;if(!Se)return Km(e),Se=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Fu(e.type,e.memoizedProps)),a=!a),a&&Pe&&jr(e),Km(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(D(317));Pe=Of(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(D(317));Pe=Of(e)}else t===27?(t=Pe,Xr(e.type)?(e=tp,tp=null,Pe=e):Pe=t):Pe=St?ya(e.stateNode.nextSibling):null;return!0}function oi(){Pe=St=null,Se=!1}function Yc(){var e=zr;return e!==null&&(Qt===null?Qt=e:Qt.push.apply(Qt,e),zr=null),e}function No(e){zr===null?zr=[e]:zr.push(e)}var qu=Ha(null),gi=null,tr=null;function _r(e,t,a){$e(qu,t._currentValue),t._currentValue=a}function rr(e){e._currentValue=qu.current,wt(qu)}function Eu(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function Mu(e,t,a,r){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var i=n.dependencies;if(i!==null){var o=n.child;i=i.firstContext;e:for(;i!==null;){var l=i;i=n;for(var c=0;c<t.length;c++)if(l.context===t[c]){i.lanes|=a,l=i.alternate,l!==null&&(l.lanes|=a),Eu(i.return,a,e),r||(o=null);break e}i=l.next}}else if(n.tag===18){if(o=n.return,o===null)throw Error(D(341));o.lanes|=a,i=o.alternate,i!==null&&(i.lanes|=a),Eu(o,a,e),o=null}else o=n.child;if(o!==null)o.return=n;else for(o=n;o!==null;){if(o===e){o=null;break}if(n=o.sibling,n!==null){n.return=o.return,o=n;break}o=o.return}n=o}}function vn(e,t,a,r){e=null;for(var n=t,i=!1;n!==null;){if(!i){if((n.flags&524288)!==0)i=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var o=n.alternate;if(o===null)throw Error(D(387));if(o=o.memoizedProps,o!==null){var l=n.type;oa(n.pendingProps.value,o.value)||(e!==null?e.push(l):e=[l])}}else if(n===$l.current){if(o=n.alternate,o===null)throw Error(D(387));o.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(To):e=[To])}n=n.return}e!==null&&Mu(t,e,a,r),t.flags|=262144}function Wl(e){for(e=e.firstContext;e!==null;){if(!oa(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function li(e){gi=e,tr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ct(e){return jg(gi,e)}function yl(e,t){return gi===null&&li(e),jg(e,t)}function jg(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},tr===null){if(e===null)throw Error(D(308));tr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else tr=tr.next=t;return a}var py=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},dy=ft.unstable_scheduleCallback,my=ft.unstable_NormalPriority,pt={$$typeof:Wa,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _p(){return{controller:new py,data:new Map,refCount:0}}function Ho(e){e.refCount--,e.refCount===0&&dy(my,function(){e.controller.abort()})}var so=null,Tu=0,sn=0,en=null;function fy(e,t){if(so===null){var a=so=[];Tu=0,sn=Vp(),en={status:"pending",value:void 0,then:function(r){a.push(r)}}}return Tu++,t.then(Jm,Jm),t}function Jm(){if(--Tu===0&&so!==null){en!==null&&(en.status="fulfilled");var e=so;so=null,sn=0,en=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function gy(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(n){a.push(n)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var n=0;n<a.length;n++)(0,a[n])(t)},function(n){for(r.status="rejected",r.reason=n,n=0;n<a.length;n++)(0,a[n])(void 0)}),r}var Pm=me.S;me.S=function(e,t){eb=aa(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&fy(e,t),Pm!==null&&Pm(e,t)};var ri=Ha(null);function xp(){var e=ri.current;return e!==null?e:Qe.pooledCache}function Dl(e,t){t===null?$e(ri,ri.current):$e(ri,t.pool)}function Gg(){var e=xp();return e===null?null:{parent:pt._currentValue,pool:e}}var wn=Error(D(460)),kp=Error(D(474)),Cs=Error(D(542)),es={then:function(){}};function Fm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Qg(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(er,er),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Wm(e),e;default:if(typeof t.status=="string")t.then(er,er);else{if(e=Qe,e!==null&&100<e.shellSuspendCounter)throw Error(D(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=r}},function(r){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Wm(e),e}throw ii=t,wn}}function Wr(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(ii=a,wn):a}}var ii=null;function Im(){if(ii===null)throw Error(D(459));var e=ii;return ii=null,e}function Wm(e){if(e===wn||e===Cs)throw Error(D(483))}var tn=null,So=0;function _l(e){var t=So;return So+=1,tn===null&&(tn=[]),Qg(tn,e,t)}function Jn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function xl(e,t){throw t.$$typeof===t0?Error(D(525)):(e=Object.prototype.toString.call(t),Error(D(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Yg(e){function t(d,u){if(e){var g=d.deletions;g===null?(d.deletions=[u],d.flags|=16):g.push(u)}}function a(d,u){if(!e)return null;for(;u!==null;)t(d,u),u=u.sibling;return null}function r(d){for(var u=new Map;d!==null;)d.key!==null?u.set(d.key,d):u.set(d.index,d),d=d.sibling;return u}function n(d,u){return d=ar(d,u),d.index=0,d.sibling=null,d}function i(d,u,g){return d.index=g,e?(g=d.alternate,g!==null?(g=g.index,g<u?(d.flags|=67108866,u):g):(d.flags|=67108866,u)):(d.flags|=1048576,u)}function o(d){return e&&d.alternate===null&&(d.flags|=67108866),d}function l(d,u,g,b){return u===null||u.tag!==6?(u=Gc(g,d.mode,b),u.return=d,u):(u=n(u,g),u.return=d,u)}function c(d,u,g,b){var S=g.type;return S===Hi?f(d,u,g.props.children,b,g.key):u!==null&&(u.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===wr&&Wr(S)===u.type)?(u=n(u,g.props),Jn(u,g),u.return=d,u):(u=Ul(g.type,g.key,g.props,null,d.mode,b),Jn(u,g),u.return=d,u)}function p(d,u,g,b){return u===null||u.tag!==4||u.stateNode.containerInfo!==g.containerInfo||u.stateNode.implementation!==g.implementation?(u=Qc(g,d.mode,b),u.return=d,u):(u=n(u,g.children||[]),u.return=d,u)}function f(d,u,g,b,S){return u===null||u.tag!==7?(u=ai(g,d.mode,b,S),u.return=d,u):(u=n(u,g),u.return=d,u)}function v(d,u,g){if(typeof u=="string"&&u!==""||typeof u=="number"||typeof u=="bigint")return u=Gc(""+u,d.mode,g),u.return=d,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case dl:return g=Ul(u.type,u.key,u.props,null,d.mode,g),Jn(g,u),g.return=d,g;case eo:return u=Qc(u,d.mode,g),u.return=d,u;case wr:return u=Wr(u),v(d,u,g)}if(to(u)||Zn(u))return u=ai(u,d.mode,g,null),u.return=d,u;if(typeof u.then=="function")return v(d,_l(u),g);if(u.$$typeof===Wa)return v(d,yl(d,u),g);xl(d,u)}return null}function m(d,u,g,b){var S=u!==null?u.key:null;if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return S!==null?null:l(d,u,""+g,b);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case dl:return g.key===S?c(d,u,g,b):null;case eo:return g.key===S?p(d,u,g,b):null;case wr:return g=Wr(g),m(d,u,g,b)}if(to(g)||Zn(g))return S!==null?null:f(d,u,g,b,null);if(typeof g.then=="function")return m(d,u,_l(g),b);if(g.$$typeof===Wa)return m(d,u,yl(d,g),b);xl(d,g)}return null}function h(d,u,g,b,S){if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return d=d.get(g)||null,l(u,d,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case dl:return d=d.get(b.key===null?g:b.key)||null,c(u,d,b,S);case eo:return d=d.get(b.key===null?g:b.key)||null,p(u,d,b,S);case wr:return b=Wr(b),h(d,u,g,b,S)}if(to(b)||Zn(b))return d=d.get(g)||null,f(u,d,b,S,null);if(typeof b.then=="function")return h(d,u,g,_l(b),S);if(b.$$typeof===Wa)return h(d,u,g,yl(u,b),S);xl(u,b)}return null}function w(d,u,g,b){for(var S=null,T=null,M=u,R=u=0,G=null;M!==null&&R<g.length;R++){M.index>R?(G=M,M=null):G=M.sibling;var W=m(d,M,g[R],b);if(W===null){M===null&&(M=G);break}e&&M&&W.alternate===null&&t(d,M),u=i(W,u,R),T===null?S=W:T.sibling=W,T=W,M=G}if(R===g.length)return a(d,M),Se&&Fa(d,R),S;if(M===null){for(;R<g.length;R++)M=v(d,g[R],b),M!==null&&(u=i(M,u,R),T===null?S=M:T.sibling=M,T=M);return Se&&Fa(d,R),S}for(M=r(M);R<g.length;R++)G=h(M,d,R,g[R],b),G!==null&&(e&&G.alternate!==null&&M.delete(G.key===null?R:G.key),u=i(G,u,R),T===null?S=G:T.sibling=G,T=G);return e&&M.forEach(function(we){return t(d,we)}),Se&&Fa(d,R),S}function E(d,u,g,b){if(g==null)throw Error(D(151));for(var S=null,T=null,M=u,R=u=0,G=null,W=g.next();M!==null&&!W.done;R++,W=g.next()){M.index>R?(G=M,M=null):G=M.sibling;var we=m(d,M,W.value,b);if(we===null){M===null&&(M=G);break}e&&M&&we.alternate===null&&t(d,M),u=i(we,u,R),T===null?S=we:T.sibling=we,T=we,M=G}if(W.done)return a(d,M),Se&&Fa(d,R),S;if(M===null){for(;!W.done;R++,W=g.next())W=v(d,W.value,b),W!==null&&(u=i(W,u,R),T===null?S=W:T.sibling=W,T=W);return Se&&Fa(d,R),S}for(M=r(M);!W.done;R++,W=g.next())W=h(M,d,R,W.value,b),W!==null&&(e&&W.alternate!==null&&M.delete(W.key===null?R:W.key),u=i(W,u,R),T===null?S=W:T.sibling=W,T=W);return e&&M.forEach(function(Ce){return t(d,Ce)}),Se&&Fa(d,R),S}function U(d,u,g,b){if(typeof g=="object"&&g!==null&&g.type===Hi&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case dl:e:{for(var S=g.key;u!==null;){if(u.key===S){if(S=g.type,S===Hi){if(u.tag===7){a(d,u.sibling),b=n(u,g.props.children),b.return=d,d=b;break e}}else if(u.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===wr&&Wr(S)===u.type){a(d,u.sibling),b=n(u,g.props),Jn(b,g),b.return=d,d=b;break e}a(d,u);break}else t(d,u);u=u.sibling}g.type===Hi?(b=ai(g.props.children,d.mode,b,g.key),b.return=d,d=b):(b=Ul(g.type,g.key,g.props,null,d.mode,b),Jn(b,g),b.return=d,d=b)}return o(d);case eo:e:{for(S=g.key;u!==null;){if(u.key===S)if(u.tag===4&&u.stateNode.containerInfo===g.containerInfo&&u.stateNode.implementation===g.implementation){a(d,u.sibling),b=n(u,g.children||[]),b.return=d,d=b;break e}else{a(d,u);break}else t(d,u);u=u.sibling}b=Qc(g,d.mode,b),b.return=d,d=b}return o(d);case wr:return g=Wr(g),U(d,u,g,b)}if(to(g))return w(d,u,g,b);if(Zn(g)){if(S=Zn(g),typeof S!="function")throw Error(D(150));return g=S.call(g),E(d,u,g,b)}if(typeof g.then=="function")return U(d,u,_l(g),b);if(g.$$typeof===Wa)return U(d,u,yl(d,g),b);xl(d,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,u!==null&&u.tag===6?(a(d,u.sibling),b=n(u,g),b.return=d,d=b):(a(d,u),b=Gc(g,d.mode,b),b.return=d,d=b),o(d)):a(d,u)}return function(d,u,g,b){try{So=0;var S=U(d,u,g,b);return tn=null,S}catch(M){if(M===wn||M===Cs)throw M;var T=ea(29,M,null,d.mode);return T.lanes=b,T.return=d,T}}}var si=Yg(!0),Xg=Yg(!1),yr=!1;function Np(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ar(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Rr(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(ze&2)!==0){var n=r.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),r.pending=t,t=Fl(e),Dg(e,null,a),t}return Ss(e,r,t,a),Fl(e)}function co(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,sg(e,a)}}function Xc(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var n=null,i=null;if(a=a.firstBaseUpdate,a!==null){do{var o={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};i===null?n=i=o:i=i.next=o,a=a.next}while(a!==null);i===null?n=i=t:i=i.next=t}else n=i=t;a={baseState:r.baseState,firstBaseUpdate:n,lastBaseUpdate:i,shared:r.shared,callbacks:r.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Au=!1;function uo(){if(Au){var e=en;if(e!==null)throw e}}function po(e,t,a,r){Au=!1;var n=e.updateQueue;yr=!1;var i=n.firstBaseUpdate,o=n.lastBaseUpdate,l=n.shared.pending;if(l!==null){n.shared.pending=null;var c=l,p=c.next;c.next=null,o===null?i=p:o.next=p,o=c;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==o&&(l===null?f.firstBaseUpdate=p:l.next=p,f.lastBaseUpdate=c))}if(i!==null){var v=n.baseState;o=0,f=p=c=null,l=i;do{var m=l.lane&-536870913,h=m!==l.lane;if(h?(Ne&m)===m:(r&m)===m){m!==0&&m===sn&&(Au=!0),f!==null&&(f=f.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var w=e,E=l;m=t;var U=a;switch(E.tag){case 1:if(w=E.payload,typeof w=="function"){v=w.call(U,v,m);break e}v=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=E.payload,m=typeof w=="function"?w.call(U,v,m):w,m==null)break e;v=Fe({},v,m);break e;case 2:yr=!0}}m=l.callback,m!==null&&(e.flags|=64,h&&(e.flags|=8192),h=n.callbacks,h===null?n.callbacks=[m]:h.push(m))}else h={lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(p=f=h,c=v):f=f.next=h,o|=m;if(l=l.next,l===null){if(l=n.shared.pending,l===null)break;h=l,l=h.next,h.next=null,n.lastBaseUpdate=h,n.shared.pending=null}}while(!0);f===null&&(c=v),n.baseState=c,n.firstBaseUpdate=p,n.lastBaseUpdate=f,i===null&&(n.shared.lanes=0),Qr|=o,e.lanes=o,e.memoizedState=v}}function $g(e,t){if(typeof e!="function")throw Error(D(191,e));e.call(t)}function Vg(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)$g(a[e],t)}var cn=Ha(null),ts=Ha(0);function ef(e,t){e=cr,$e(ts,e),$e(cn,t),cr=e|t.baseLanes}function Ru(){$e(ts,cr),$e(cn,cn.current)}function Sp(){cr=ts.current,wt(cn),wt(ts)}var la=Ha(null),wa=null;function xr(e){var t=e.alternate;$e(ot,ot.current&1),$e(la,e),wa===null&&(t===null||cn.current!==null||t.memoizedState!==null)&&(wa=e)}function Uu(e){$e(ot,ot.current),$e(la,e),wa===null&&(wa=e)}function Zg(e){e.tag===22?($e(ot,ot.current),$e(la,e),wa===null&&(wa=e)):kr(e)}function kr(){$e(ot,ot.current),$e(la,la.current)}function Wt(e){wt(la),wa===e&&(wa=null),wt(ot)}var ot=Ha(0);function as(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Wu(a)||ep(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var or=0,he=null,je=null,ct=null,rs=!1,an=!1,ci=!1,is=0,Co=0,rn=null,hy=0;function rt(){throw Error(D(321))}function Cp(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!oa(e[a],t[a]))return!1;return!0}function qp(e,t,a,r,n,i){return or=i,he=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,me.H=e===null||e.memoizedState===null?Nh:Lp,ci=!1,i=a(r,n),ci=!1,an&&(i=Jg(t,a,r,n)),Kg(e),i}function Kg(e){me.H=qo;var t=je!==null&&je.next!==null;if(or=0,ct=je=he=null,rs=!1,Co=0,rn=null,t)throw Error(D(300));e===null||dt||(e=e.dependencies,e!==null&&Wl(e)&&(dt=!0))}function Jg(e,t,a,r){he=e;var n=0;do{if(an&&(rn=null),Co=0,an=!1,25<=n)throw Error(D(301));if(n+=1,ct=je=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}me.H=Sh,i=t(a,r)}while(an);return i}function by(){var e=me.H,t=e.useState()[0];return t=typeof t.then=="function"?jo(t):t,e=e.useState()[0],(je!==null?je.memoizedState:null)!==e&&(he.flags|=1024),t}function Ep(){var e=is!==0;return is=0,e}function Mp(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Tp(e){if(rs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}rs=!1}or=0,ct=je=he=null,an=!1,Co=is=0,rn=null}function Dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ct===null?he.memoizedState=ct=e:ct=ct.next=e,ct}function lt(){if(je===null){var e=he.alternate;e=e!==null?e.memoizedState:null}else e=je.next;var t=ct===null?he.memoizedState:ct.next;if(t!==null)ct=t,je=e;else{if(e===null)throw he.alternate===null?Error(D(467)):Error(D(310));je=e,e={memoizedState:je.memoizedState,baseState:je.baseState,baseQueue:je.baseQueue,queue:je.queue,next:null},ct===null?he.memoizedState=ct=e:ct=ct.next=e}return ct}function qs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function jo(e){var t=Co;return Co+=1,rn===null&&(rn=[]),e=Qg(rn,e,t),t=he,(ct===null?t.memoizedState:ct.next)===null&&(t=t.alternate,me.H=t===null||t.memoizedState===null?Nh:Lp),e}function Es(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return jo(e);if(e.$$typeof===Wa)return Ct(e)}throw Error(D(438,String(e)))}function zp(e){var t=null,a=he.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=he.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=qs(),he.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),r=0;r<e;r++)a[r]=a0;return t.index++,a}function lr(e,t){return typeof t=="function"?t(e):t}function Bl(e){var t=lt();return Ap(t,je,e)}function Ap(e,t,a){var r=e.queue;if(r===null)throw Error(D(311));r.lastRenderedReducer=a;var n=e.baseQueue,i=r.pending;if(i!==null){if(n!==null){var o=n.next;n.next=i.next,i.next=o}t.baseQueue=n=i,r.pending=null}if(i=e.baseState,n===null)e.memoizedState=i;else{t=n.next;var l=o=null,c=null,p=t,f=!1;do{var v=p.lane&-536870913;if(v!==p.lane?(Ne&v)===v:(or&v)===v){var m=p.revertLane;if(m===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null}),v===sn&&(f=!0);else if((or&m)===m){p=p.next,m===sn&&(f=!0);continue}else v={lane:0,revertLane:p.revertLane,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=v,o=i):c=c.next=v,he.lanes|=m,Qr|=m;v=p.action,ci&&a(i,v),i=p.hasEagerState?p.eagerState:a(i,v)}else m={lane:v,revertLane:p.revertLane,gesture:p.gesture,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=m,o=i):c=c.next=m,he.lanes|=v,Qr|=v;p=p.next}while(p!==null&&p!==t);if(c===null?o=i:c.next=l,!oa(i,e.memoizedState)&&(dt=!0,f&&(a=en,a!==null)))throw a;e.memoizedState=i,e.baseState=o,e.baseQueue=c,r.lastRenderedState=i}return n===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function $c(e){var t=lt(),a=t.queue;if(a===null)throw Error(D(311));a.lastRenderedReducer=e;var r=a.dispatch,n=a.pending,i=t.memoizedState;if(n!==null){a.pending=null;var o=n=n.next;do i=e(i,o.action),o=o.next;while(o!==n);oa(i,t.memoizedState)||(dt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),a.lastRenderedState=i}return[i,r]}function Pg(e,t,a){var r=he,n=lt(),i=Se;if(i){if(a===void 0)throw Error(D(407));a=a()}else a=t();var o=!oa((je||n).memoizedState,a);if(o&&(n.memoizedState=a,dt=!0),n=n.queue,Rp(Wg.bind(null,r,n,e),[e]),n.getSnapshot!==t||o||ct!==null&&ct.memoizedState.tag&1){if(r.flags|=2048,un(9,{destroy:void 0},Ig.bind(null,r,n,a,t),null),Qe===null)throw Error(D(349));i||(or&127)!==0||Fg(r,t,a)}return a}function Fg(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=he.updateQueue,t===null?(t=qs(),he.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Ig(e,t,a,r){t.value=a,t.getSnapshot=r,eh(t)&&th(e)}function Wg(e,t,a){return a(function(){eh(t)&&th(e)})}function eh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!oa(e,a)}catch{return!0}}function th(e){var t=fi(e,2);t!==null&&Yt(t,e,2)}function Du(e){var t=Dt();if(typeof e=="function"){var a=e;if(e=a(),ci){Sr(!0);try{a()}finally{Sr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:e},t}function ah(e,t,a,r){return e.baseState=a,Ap(e,je,typeof r=="function"?r:lr)}function vy(e,t,a,r,n){if(Ts(e))throw Error(D(485));if(e=t.action,e!==null){var i={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){i.listeners.push(o)}};me.T!==null?a(!0):i.isTransition=!1,r(i),a=t.pending,a===null?(i.next=t.pending=i,rh(t,i)):(i.next=a.next,t.pending=a.next=i)}}function rh(e,t){var a=t.action,r=t.payload,n=e.state;if(t.isTransition){var i=me.T,o={};me.T=o;try{var l=a(n,r),c=me.S;c!==null&&c(o,l),tf(e,t,l)}catch(p){Bu(e,t,p)}finally{i!==null&&o.types!==null&&(i.types=o.types),me.T=i}}else try{i=a(n,r),tf(e,t,i)}catch(p){Bu(e,t,p)}}function tf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){af(e,t,r)},function(r){return Bu(e,t,r)}):af(e,t,a)}function af(e,t,a){t.status="fulfilled",t.value=a,ih(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,rh(e,a)))}function Bu(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,ih(t),t=t.next;while(t!==r)}e.action=null}function ih(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function nh(e,t){return t}function rf(e,t){if(Se){var a=Qe.formState;if(a!==null){e:{var r=he;if(Se){if(Pe){t:{for(var n=Pe,i=va;n.nodeType!==8;){if(!i){n=null;break t}if(n=ya(n.nextSibling),n===null){n=null;break t}}i=n.data,n=i==="F!"||i==="F"?n:null}if(n){Pe=ya(n.nextSibling),r=n.data==="F!";break e}}jr(r)}r=!1}r&&(t=a[0])}}return a=Dt(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nh,lastRenderedState:t},a.queue=r,a=_h.bind(null,he,r),r.dispatch=a,r=Du(!1),i=Op.bind(null,he,!1,r.queue),r=Dt(),n={state:t,dispatch:null,action:e,pending:null},r.queue=n,a=vy.bind(null,he,n,i,a),n.dispatch=a,r.memoizedState=e,[t,a,!1]}function nf(e){var t=lt();return oh(t,je,e)}function oh(e,t,a){if(t=Ap(e,t,nh)[0],e=Bl(lr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=jo(t)}catch(o){throw o===wn?Cs:o}else r=t;t=lt();var n=t.queue,i=n.dispatch;return a!==t.memoizedState&&(he.flags|=2048,un(9,{destroy:void 0},wy.bind(null,n,a),null)),[r,i,e]}function wy(e,t){e.action=t}function of(e){var t=lt(),a=je;if(a!==null)return oh(t,a,e);lt(),t=t.memoizedState,a=lt();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function un(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=he.updateQueue,t===null&&(t=qs(),he.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e),e}function lh(){return lt().memoizedState}function Ol(e,t,a,r){var n=Dt();he.flags|=e,n.memoizedState=un(1|t,{destroy:void 0},a,r===void 0?null:r)}function Ms(e,t,a,r){var n=lt();r=r===void 0?null:r;var i=n.memoizedState.inst;je!==null&&r!==null&&Cp(r,je.memoizedState.deps)?n.memoizedState=un(t,i,a,r):(he.flags|=e,n.memoizedState=un(1|t,i,a,r))}function lf(e,t){Ol(8390656,8,e,t)}function Rp(e,t){Ms(2048,8,e,t)}function yy(e){he.flags|=4;var t=he.updateQueue;if(t===null)t=qs(),he.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function sh(e){var t=lt().memoizedState;return yy({ref:t,nextImpl:e}),function(){if((ze&2)!==0)throw Error(D(440));return t.impl.apply(void 0,arguments)}}function ch(e,t){return Ms(4,2,e,t)}function uh(e,t){return Ms(4,4,e,t)}function ph(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function dh(e,t,a){a=a!=null?a.concat([e]):null,Ms(4,4,ph.bind(null,t,e),a)}function Up(){}function mh(e,t){var a=lt();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&Cp(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function fh(e,t){var a=lt();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&Cp(t,r[1]))return r[0];if(r=e(),ci){Sr(!0);try{e()}finally{Sr(!1)}}return a.memoizedState=[r,t],r}function Dp(e,t,a){return a===void 0||(or&1073741824)!==0&&(Ne&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=ab(),he.lanes|=e,Qr|=e,a)}function gh(e,t,a,r){return oa(a,t)?a:cn.current!==null?(e=Dp(e,a,r),oa(e,t)||(dt=!0),e):(or&42)===0||(or&1073741824)!==0&&(Ne&261930)===0?(dt=!0,e.memoizedState=a):(e=ab(),he.lanes|=e,Qr|=e,t)}function hh(e,t,a,r,n){var i=Ae.p;Ae.p=i!==0&&8>i?i:8;var o=me.T,l={};me.T=l,Op(e,!1,t,a);try{var c=n(),p=me.S;if(p!==null&&p(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=gy(c,r);mo(e,t,f,na(e))}else mo(e,t,r,na(e))}catch(v){mo(e,t,{then:function(){},status:"rejected",reason:v},na())}finally{Ae.p=i,o!==null&&l.types!==null&&(o.types=l.types),me.T=o}}function _y(){}function Ou(e,t,a,r){if(e.tag!==5)throw Error(D(476));var n=bh(e).queue;hh(e,n,t,ti,a===null?_y:function(){return vh(e),a(r)})}function bh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ti,baseState:ti,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:ti},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function vh(e){var t=bh(e);t.next===null&&(t=e.alternate.memoizedState),mo(e,t.next.queue,{},na())}function Bp(){return Ct(To)}function wh(){return lt().memoizedState}function yh(){return lt().memoizedState}function xy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=na();e=Ar(a);var r=Rr(t,e,a);r!==null&&(Yt(r,t,a),co(r,t,a)),t={cache:_p()},e.payload=t;return}t=t.return}}function ky(e,t,a){var r=na();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Ts(e)?xh(t,a):(a=bp(e,t,a,r),a!==null&&(Yt(a,e,r),kh(a,t,r)))}function _h(e,t,a){var r=na();mo(e,t,a,r)}function mo(e,t,a,r){var n={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ts(e))xh(t,n);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,a);if(n.hasEagerState=!0,n.eagerState=l,oa(l,o))return Ss(e,t,n,0),Qe===null&&Ns(),!1}catch{}if(a=bp(e,t,n,r),a!==null)return Yt(a,e,r),kh(a,t,r),!0}return!1}function Op(e,t,a,r){if(r={lane:2,revertLane:Vp(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ts(e)){if(t)throw Error(D(479))}else t=bp(e,a,r,2),t!==null&&Yt(t,e,2)}function Ts(e){var t=e.alternate;return e===he||t!==null&&t===he}function xh(e,t){an=rs=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function kh(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,sg(e,a)}}var qo={readContext:Ct,use:Es,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useLayoutEffect:rt,useInsertionEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useSyncExternalStore:rt,useId:rt,useHostTransitionStatus:rt,useFormState:rt,useActionState:rt,useOptimistic:rt,useMemoCache:rt,useCacheRefresh:rt};qo.useEffectEvent=rt;var Nh={readContext:Ct,use:Es,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:Ct,useEffect:lf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Ol(4194308,4,ph.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Ol(4194308,4,e,t)},useInsertionEffect:function(e,t){Ol(4,2,e,t)},useMemo:function(e,t){var a=Dt();t=t===void 0?null:t;var r=e();if(ci){Sr(!0);try{e()}finally{Sr(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=Dt();if(a!==void 0){var n=a(t);if(ci){Sr(!0);try{a(t)}finally{Sr(!1)}}}else n=t;return r.memoizedState=r.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},r.queue=e,e=e.dispatch=ky.bind(null,he,e),[r.memoizedState,e]},useRef:function(e){var t=Dt();return e={current:e},t.memoizedState=e},useState:function(e){e=Du(e);var t=e.queue,a=_h.bind(null,he,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Up,useDeferredValue:function(e,t){var a=Dt();return Dp(a,e,t)},useTransition:function(){var e=Du(!1);return e=hh.bind(null,he,e.queue,!0,!1),Dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=he,n=Dt();if(Se){if(a===void 0)throw Error(D(407));a=a()}else{if(a=t(),Qe===null)throw Error(D(349));(Ne&127)!==0||Fg(r,t,a)}n.memoizedState=a;var i={value:a,getSnapshot:t};return n.queue=i,lf(Wg.bind(null,r,i,e),[e]),r.flags|=2048,un(9,{destroy:void 0},Ig.bind(null,r,i,a,t),null),a},useId:function(){var e=Dt(),t=Qe.identifierPrefix;if(Se){var a=Ba,r=Da;a=(r&~(1<<32-ia(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=is++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=hy++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Bp,useFormState:rf,useActionState:rf,useOptimistic:function(e){var t=Dt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Op.bind(null,he,!0,a),a.dispatch=t,[e,t]},useMemoCache:zp,useCacheRefresh:function(){return Dt().memoizedState=xy.bind(null,he)},useEffectEvent:function(e){var t=Dt(),a={impl:e};return t.memoizedState=a,function(){if((ze&2)!==0)throw Error(D(440));return a.impl.apply(void 0,arguments)}}},Lp={readContext:Ct,use:Es,useCallback:mh,useContext:Ct,useEffect:Rp,useImperativeHandle:dh,useInsertionEffect:ch,useLayoutEffect:uh,useMemo:fh,useReducer:Bl,useRef:lh,useState:function(){return Bl(lr)},useDebugValue:Up,useDeferredValue:function(e,t){var a=lt();return gh(a,je.memoizedState,e,t)},useTransition:function(){var e=Bl(lr)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:jo(e),t]},useSyncExternalStore:Pg,useId:wh,useHostTransitionStatus:Bp,useFormState:nf,useActionState:nf,useOptimistic:function(e,t){var a=lt();return ah(a,je,e,t)},useMemoCache:zp,useCacheRefresh:yh};Lp.useEffectEvent=sh;var Sh={readContext:Ct,use:Es,useCallback:mh,useContext:Ct,useEffect:Rp,useImperativeHandle:dh,useInsertionEffect:ch,useLayoutEffect:uh,useMemo:fh,useReducer:$c,useRef:lh,useState:function(){return $c(lr)},useDebugValue:Up,useDeferredValue:function(e,t){var a=lt();return je===null?Dp(a,e,t):gh(a,je.memoizedState,e,t)},useTransition:function(){var e=$c(lr)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:jo(e),t]},useSyncExternalStore:Pg,useId:wh,useHostTransitionStatus:Bp,useFormState:of,useActionState:of,useOptimistic:function(e,t){var a=lt();return je!==null?ah(a,je,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:zp,useCacheRefresh:yh};Sh.useEffectEvent=sh;function Vc(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:Fe({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Lu={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=na(),n=Ar(r);n.payload=t,a!=null&&(n.callback=a),t=Rr(e,n,r),t!==null&&(Yt(t,e,r),co(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=na(),n=Ar(r);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=Rr(e,n,r),t!==null&&(Yt(t,e,r),co(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=na(),r=Ar(a);r.tag=2,t!=null&&(r.callback=t),t=Rr(e,r,a),t!==null&&(Yt(t,e,a),co(t,e,a))}};function sf(e,t,a,r,n,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!xo(a,r)||!xo(n,i):!0}function cf(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&Lu.enqueueReplaceState(t,t.state,null)}function ui(e,t){var a=t;if("ref"in t){a={};for(var r in t)r!=="ref"&&(a[r]=t[r])}if(e=e.defaultProps){a===t&&(a=Fe({},a));for(var n in e)a[n]===void 0&&(a[n]=e[n])}return a}function Ch(e){Pl(e)}function qh(e){console.error(e)}function Eh(e){Pl(e)}function ns(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function uf(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function Hu(e,t,a){return a=Ar(a),a.tag=3,a.payload={element:null},a.callback=function(){ns(e,t)},a}function Mh(e){return e=Ar(e),e.tag=3,e}function Th(e,t,a,r){var n=a.type.getDerivedStateFromError;if(typeof n=="function"){var i=r.value;e.payload=function(){return n(i)},e.callback=function(){uf(t,a,r)}}var o=a.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){uf(t,a,r),typeof n!="function"&&(Ur===null?Ur=new Set([this]):Ur.add(this));var l=r.stack;this.componentDidCatch(r.value,{componentStack:l!==null?l:""})})}function Ny(e,t,a,r,n){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&vn(t,a,n,!0),a=la.current,a!==null){switch(a.tag){case 31:case 13:return wa===null?us():a.alternate===null&&it===0&&(it=3),a.flags&=-257,a.flags|=65536,a.lanes=n,r===es?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),ru(e,r,n)),!1;case 22:return a.flags|=65536,r===es?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([r]):a.add(r)),ru(e,r,n)),!1}throw Error(D(435,a.tag))}return ru(e,r,n),us(),!1}if(Se)return t=la.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,r!==Cu&&(e=Error(D(422),{cause:r}),No(ba(e,a)))):(r!==Cu&&(t=Error(D(423),{cause:r}),No(ba(t,a))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,r=ba(r,a),n=Hu(e.stateNode,r,n),Xc(e,n),it!==4&&(it=2)),!1;var i=Error(D(520),{cause:r});if(i=ba(i,a),ho===null?ho=[i]:ho.push(i),it!==4&&(it=2),t===null)return!0;r=ba(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=n&-n,a.lanes|=e,e=Hu(a.stateNode,r,e),Xc(a,e),!1;case 1:if(t=a.type,i=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Ur===null||!Ur.has(i))))return a.flags|=65536,n&=-n,a.lanes|=n,n=Mh(n),Th(n,e,a,r),Xc(a,n),!1}a=a.return}while(a!==null);return!1}var Hp=Error(D(461)),dt=!1;function kt(e,t,a,r){t.child=e===null?Xg(t,null,a,r):si(t,e.child,a,r)}function pf(e,t,a,r,n){a=a.render;var i=t.ref;if("ref"in r){var o={};for(var l in r)l!=="ref"&&(o[l]=r[l])}else o=r;return li(t),r=qp(e,t,a,o,i,n),l=Ep(),e!==null&&!dt?(Mp(e,t,n),sr(e,t,n)):(Se&&l&&wp(t),t.flags|=1,kt(e,t,r,n),t.child)}function df(e,t,a,r,n){if(e===null){var i=a.type;return typeof i=="function"&&!vp(i)&&i.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=i,zh(e,t,i,r,n)):(e=Ul(a.type,null,r,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!jp(e,n)){var o=i.memoizedProps;if(a=a.compare,a=a!==null?a:xo,a(o,r)&&e.ref===t.ref)return sr(e,t,n)}return t.flags|=1,e=ar(i,r),e.ref=t.ref,e.return=t,t.child=e}function zh(e,t,a,r,n){if(e!==null){var i=e.memoizedProps;if(xo(i,r)&&e.ref===t.ref)if(dt=!1,t.pendingProps=r=i,jp(e,n))(e.flags&131072)!==0&&(dt=!0);else return t.lanes=e.lanes,sr(e,t,n)}return ju(e,t,a,r,n)}function Ah(e,t,a,r){var n=r.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|a:a,e!==null){for(r=t.child=e.child,n=0;r!==null;)n=n|r.lanes|r.childLanes,r=r.sibling;r=n&~i}else r=0,t.child=null;return mf(e,t,i,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Dl(t,i!==null?i.cachePool:null),i!==null?ef(t,i):Ru(),Zg(t);else return r=t.lanes=536870912,mf(e,t,i!==null?i.baseLanes|a:a,a,r)}else i!==null?(Dl(t,i.cachePool),ef(t,i),kr(t),t.memoizedState=null):(e!==null&&Dl(t,null),Ru(),kr(t));return kt(e,t,n,a),t.child}function ro(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function mf(e,t,a,r,n){var i=xp();return i=i===null?null:{parent:pt._currentValue,pool:i},t.memoizedState={baseLanes:a,cachePool:i},e!==null&&Dl(t,null),Ru(),Zg(t),e!==null&&vn(e,t,r,!0),t.childLanes=n,null}function Ll(e,t){return t=os({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ff(e,t,a){return si(t,e.child,null,a),e=Ll(t,t.pendingProps),e.flags|=2,Wt(t),t.memoizedState=null,e}function Sy(e,t,a){var r=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Se){if(r.mode==="hidden")return e=Ll(t,r),t.lanes=536870912,ro(null,e);if(Uu(t),(e=Pe)?(e=Nb(e,va),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hr!==null?{id:Da,overflow:Ba}:null,retryLane:536870912,hydrationErrors:null},a=Og(e),a.return=t,t.child=a,St=t,Pe=null)):e=null,e===null)throw jr(t);return t.lanes=536870912,null}return Ll(t,r)}var i=e.memoizedState;if(i!==null){var o=i.dehydrated;if(Uu(t),n)if(t.flags&256)t.flags&=-257,t=ff(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(D(558));else if(dt||vn(e,t,a,!1),n=(a&e.childLanes)!==0,dt||n){if(r=Qe,r!==null&&(o=cg(r,a),o!==0&&o!==i.retryLane))throw i.retryLane=o,fi(e,o),Yt(r,e,o),Hp;us(),t=ff(e,t,a)}else e=i.treeContext,Pe=ya(o.nextSibling),St=t,Se=!0,zr=null,va=!1,e!==null&&Hg(t,e),t=Ll(t,r),t.flags|=4096;return t}return e=ar(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Hl(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(D(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function ju(e,t,a,r,n){return li(t),a=qp(e,t,a,r,void 0,n),r=Ep(),e!==null&&!dt?(Mp(e,t,n),sr(e,t,n)):(Se&&r&&wp(t),t.flags|=1,kt(e,t,a,n),t.child)}function gf(e,t,a,r,n,i){return li(t),t.updateQueue=null,a=Jg(t,r,a,n),Kg(e),r=Ep(),e!==null&&!dt?(Mp(e,t,i),sr(e,t,i)):(Se&&r&&wp(t),t.flags|=1,kt(e,t,a,i),t.child)}function hf(e,t,a,r,n){if(li(t),t.stateNode===null){var i=Zi,o=a.contextType;typeof o=="object"&&o!==null&&(i=Ct(o)),i=new a(r,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Lu,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=r,i.state=t.memoizedState,i.refs={},Np(t),o=a.contextType,i.context=typeof o=="object"&&o!==null?Ct(o):Zi,i.state=t.memoizedState,o=a.getDerivedStateFromProps,typeof o=="function"&&(Vc(t,a,o,r),i.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(o=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),o!==i.state&&Lu.enqueueReplaceState(i,i.state,null),po(t,r,i,n),uo(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){i=t.stateNode;var l=t.memoizedProps,c=ui(a,l);i.props=c;var p=i.context,f=a.contextType;o=Zi,typeof f=="object"&&f!==null&&(o=Ct(f));var v=a.getDerivedStateFromProps;f=typeof v=="function"||typeof i.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l||p!==o)&&cf(t,i,r,o),yr=!1;var m=t.memoizedState;i.state=m,po(t,r,i,n),uo(),p=t.memoizedState,l||m!==p||yr?(typeof v=="function"&&(Vc(t,a,v,r),p=t.memoizedState),(c=yr||sf(t,a,c,r,m,p,o))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=p),i.props=r,i.state=p,i.context=o,r=c):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,zu(e,t),o=t.memoizedProps,f=ui(a,o),i.props=f,v=t.pendingProps,m=i.context,p=a.contextType,c=Zi,typeof p=="object"&&p!==null&&(c=Ct(p)),l=a.getDerivedStateFromProps,(p=typeof l=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==v||m!==c)&&cf(t,i,r,c),yr=!1,m=t.memoizedState,i.state=m,po(t,r,i,n),uo();var h=t.memoizedState;o!==v||m!==h||yr||e!==null&&e.dependencies!==null&&Wl(e.dependencies)?(typeof l=="function"&&(Vc(t,a,l,r),h=t.memoizedState),(f=yr||sf(t,a,f,r,m,h,c)||e!==null&&e.dependencies!==null&&Wl(e.dependencies))?(p||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,h,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,h,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),i.props=r,i.state=h,i.context=c,r=f):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return i=r,Hl(e,t),r=(t.flags&128)!==0,i||r?(i=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&r?(t.child=si(t,e.child,null,n),t.child=si(t,null,a,n)):kt(e,t,a,n),t.memoizedState=i.state,e=t.child):e=sr(e,t,n),e}function bf(e,t,a,r){return oi(),t.flags|=256,kt(e,t,a,r),t.child}var Zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kc(e){return{baseLanes:e,cachePool:Gg()}}function Jc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=ta),e}function Rh(e,t,a){var r=t.pendingProps,n=!1,i=(t.flags&128)!==0,o;if((o=i)||(o=e!==null&&e.memoizedState===null?!1:(ot.current&2)!==0),o&&(n=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(Se){if(n?xr(t):kr(t),(e=Pe)?(e=Nb(e,va),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hr!==null?{id:Da,overflow:Ba}:null,retryLane:536870912,hydrationErrors:null},a=Og(e),a.return=t,t.child=a,St=t,Pe=null)):e=null,e===null)throw jr(t);return ep(e)?t.lanes=32:t.lanes=536870912,null}var l=r.children;return r=r.fallback,n?(kr(t),n=t.mode,l=os({mode:"hidden",children:l},n),r=ai(r,n,a,null),l.return=t,r.return=t,l.sibling=r,t.child=l,r=t.child,r.memoizedState=Kc(a),r.childLanes=Jc(e,o,a),t.memoizedState=Zc,ro(null,r)):(xr(t),Gu(t,l))}var c=e.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(i)t.flags&256?(xr(t),t.flags&=-257,t=Pc(e,t,a)):t.memoizedState!==null?(kr(t),t.child=e.child,t.flags|=128,t=null):(kr(t),l=r.fallback,n=t.mode,r=os({mode:"visible",children:r.children},n),l=ai(l,n,a,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,si(t,e.child,null,a),r=t.child,r.memoizedState=Kc(a),r.childLanes=Jc(e,o,a),t.memoizedState=Zc,t=ro(null,r));else if(xr(t),ep(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var p=o.dgst;o=p,r=Error(D(419)),r.stack="",r.digest=o,No({value:r,source:null,stack:null}),t=Pc(e,t,a)}else if(dt||vn(e,t,a,!1),o=(a&e.childLanes)!==0,dt||o){if(o=Qe,o!==null&&(r=cg(o,a),r!==0&&r!==c.retryLane))throw c.retryLane=r,fi(e,r),Yt(o,e,r),Hp;Wu(l)||us(),t=Pc(e,t,a)}else Wu(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,Pe=ya(l.nextSibling),St=t,Se=!0,zr=null,va=!1,e!==null&&Hg(t,e),t=Gu(t,r.children),t.flags|=4096);return t}return n?(kr(t),l=r.fallback,n=t.mode,c=e.child,p=c.sibling,r=ar(c,{mode:"hidden",children:r.children}),r.subtreeFlags=c.subtreeFlags&65011712,p!==null?l=ar(p,l):(l=ai(l,n,a,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,ro(null,r),r=t.child,l=e.child.memoizedState,l===null?l=Kc(a):(n=l.cachePool,n!==null?(c=pt._currentValue,n=n.parent!==c?{parent:c,pool:c}:n):n=Gg(),l={baseLanes:l.baseLanes|a,cachePool:n}),r.memoizedState=l,r.childLanes=Jc(e,o,a),t.memoizedState=Zc,ro(e.child,r)):(xr(t),a=e.child,e=a.sibling,a=ar(a,{mode:"visible",children:r.children}),a.return=t,a.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=a,t.memoizedState=null,a)}function Gu(e,t){return t=os({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function os(e,t){return e=ea(22,e,null,t),e.lanes=0,e}function Pc(e,t,a){return si(t,e.child,null,a),e=Gu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function vf(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Eu(e.return,t,a)}function Fc(e,t,a,r,n,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:n,treeForkCount:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=a,o.tailMode=n,o.treeForkCount=i)}function Uh(e,t,a){var r=t.pendingProps,n=r.revealOrder,i=r.tail;r=r.children;var o=ot.current,l=(o&2)!==0;if(l?(o=o&1|2,t.flags|=128):o&=1,$e(ot,o),kt(e,t,r,a),r=Se?ko:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vf(e,a,t);else if(e.tag===19)vf(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(n){case"forwards":for(a=t.child,n=null;a!==null;)e=a.alternate,e!==null&&as(e)===null&&(n=a),a=a.sibling;a=n,a===null?(n=t.child,t.child=null):(n=a.sibling,a.sibling=null),Fc(t,!1,n,a,i,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&as(e)===null){t.child=n;break}e=n.sibling,n.sibling=a,a=n,n=e}Fc(t,!0,a,null,i,r);break;case"together":Fc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function sr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Qr|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(vn(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(D(153));if(t.child!==null){for(e=t.child,a=ar(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=ar(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function jp(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Wl(e)))}function Cy(e,t,a){switch(t.tag){case 3:Vl(t,t.stateNode.containerInfo),_r(t,pt,e.memoizedState.cache),oi();break;case 27:case 5:gu(t);break;case 4:Vl(t,t.stateNode.containerInfo);break;case 10:_r(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Uu(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(xr(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Rh(e,t,a):(xr(t),e=sr(e,t,a),e!==null?e.sibling:null);xr(t);break;case 19:var n=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(vn(e,t,a,!1),r=(a&t.childLanes)!==0),n){if(r)return Uh(e,t,a);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),$e(ot,ot.current),r)break;return null;case 22:return t.lanes=0,Ah(e,t,a,t.pendingProps);case 24:_r(t,pt,e.memoizedState.cache)}return sr(e,t,a)}function Dh(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)dt=!0;else{if(!jp(e,a)&&(t.flags&128)===0)return dt=!1,Cy(e,t,a);dt=(e.flags&131072)!==0}else dt=!1,Se&&(t.flags&1048576)!==0&&Lg(t,ko,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Wr(t.elementType),t.type=e,typeof e=="function")vp(e)?(r=ui(e,r),t.tag=1,t=hf(null,t,e,r,a)):(t.tag=0,t=ju(null,t,e,r,a));else{if(e!=null){var n=e.$$typeof;if(n===ip){t.tag=11,t=pf(null,t,e,r,a);break e}else if(n===np){t.tag=14,t=df(null,t,e,r,a);break e}}throw t=mu(e)||e,Error(D(306,t,""))}}return t;case 0:return ju(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,n=ui(r,t.pendingProps),hf(e,t,r,n,a);case 3:e:{if(Vl(t,t.stateNode.containerInfo),e===null)throw Error(D(387));r=t.pendingProps;var i=t.memoizedState;n=i.element,zu(e,t),po(t,r,null,a);var o=t.memoizedState;if(r=o.cache,_r(t,pt,r),r!==i.cache&&Mu(t,[pt],a,!0),uo(),r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=bf(e,t,r,a);break e}else if(r!==n){n=ba(Error(D(424)),t),No(n),t=bf(e,t,r,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Pe=ya(e.firstChild),St=t,Se=!0,zr=null,va=!0,a=Xg(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(oi(),r===n){t=sr(e,t,a);break e}kt(e,t,r,a)}t=t.child}return t;case 26:return Hl(e,t),e===null?(a=jf(t.type,null,t.pendingProps,null))?t.memoizedState=a:Se||(a=t.type,e=t.pendingProps,r=fs(Tr.current).createElement(a),r[Nt]=t,r[Xt]=e,qt(r,a,e),vt(r),t.stateNode=r):t.memoizedState=jf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return gu(t),e===null&&Se&&(r=t.stateNode=Sb(t.type,t.pendingProps,Tr.current),St=t,va=!0,n=Pe,Xr(t.type)?(tp=n,Pe=ya(r.firstChild)):Pe=n),kt(e,t,t.pendingProps.children,a),Hl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Se&&((n=r=Pe)&&(r=e1(r,t.type,t.pendingProps,va),r!==null?(t.stateNode=r,St=t,Pe=ya(r.firstChild),va=!1,n=!0):n=!1),n||jr(t)),gu(t),n=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,r=i.children,Fu(n,i)?r=null:o!==null&&Fu(n,o)&&(t.flags|=32),t.memoizedState!==null&&(n=qp(e,t,by,null,null,a),To._currentValue=n),Hl(e,t),kt(e,t,r,a),t.child;case 6:return e===null&&Se&&((e=a=Pe)&&(a=t1(a,t.pendingProps,va),a!==null?(t.stateNode=a,St=t,Pe=null,e=!0):e=!1),e||jr(t)),null;case 13:return Rh(e,t,a);case 4:return Vl(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=si(t,null,r,a):kt(e,t,r,a),t.child;case 11:return pf(e,t,t.type,t.pendingProps,a);case 7:return kt(e,t,t.pendingProps,a),t.child;case 8:return kt(e,t,t.pendingProps.children,a),t.child;case 12:return kt(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,_r(t,t.type,r.value),kt(e,t,r.children,a),t.child;case 9:return n=t.type._context,r=t.pendingProps.children,li(t),n=Ct(n),r=r(n),t.flags|=1,kt(e,t,r,a),t.child;case 14:return df(e,t,t.type,t.pendingProps,a);case 15:return zh(e,t,t.type,t.pendingProps,a);case 19:return Uh(e,t,a);case 31:return Sy(e,t,a);case 22:return Ah(e,t,a,t.pendingProps);case 24:return li(t),r=Ct(pt),e===null?(n=xp(),n===null&&(n=Qe,i=_p(),n.pooledCache=i,i.refCount++,i!==null&&(n.pooledCacheLanes|=a),n=i),t.memoizedState={parent:r,cache:n},Np(t),_r(t,pt,n)):((e.lanes&a)!==0&&(zu(e,t),po(t,null,null,a),uo()),n=e.memoizedState,i=t.memoizedState,n.parent!==r?(n={parent:r,cache:r},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),_r(t,pt,r)):(r=i.cache,_r(t,pt,r),r!==n.cache&&Mu(t,[pt],a,!0))),kt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(D(156,t.tag))}function Za(e){e.flags|=4}function Ic(e,t,a,r,n){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(nb())e.flags|=8192;else throw ii=es,kp}else e.flags&=-16777217}function wf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Eb(t))if(nb())e.flags|=8192;else throw ii=es,kp}function kl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?og():536870912,e.lanes|=t,pn|=t)}function Pn(e,t){if(!Se)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Je(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var n=e.child;n!==null;)a|=n.lanes|n.childLanes,r|=n.subtreeFlags&65011712,r|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)a|=n.lanes|n.childLanes,r|=n.subtreeFlags,r|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function qy(e,t,a){var r=t.pendingProps;switch(yp(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Je(t),null;case 1:return Je(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),rr(pt),nn(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Di(t)?Za(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Yc())),Je(t),null;case 26:var n=t.type,i=t.memoizedState;return e===null?(Za(t),i!==null?(Je(t),wf(t,i)):(Je(t),Ic(t,n,null,r,a))):i?i!==e.memoizedState?(Za(t),Je(t),wf(t,i)):(Je(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Za(t),Je(t),Ic(t,n,e,r,a)),null;case 27:if(Zl(t),a=Tr.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Za(t);else{if(!r){if(t.stateNode===null)throw Error(D(166));return Je(t),null}e=La.current,Di(t)?Zm(t,e):(e=Sb(n,r,a),t.stateNode=e,Za(t))}return Je(t),null;case 5:if(Zl(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Za(t);else{if(!r){if(t.stateNode===null)throw Error(D(166));return Je(t),null}if(i=La.current,Di(t))Zm(t,i);else{var o=fs(Tr.current);switch(i){case 1:i=o.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:i=o.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":i=o.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":i=o.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":i=o.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof r.is=="string"?o.createElement("select",{is:r.is}):o.createElement("select"),r.multiple?i.multiple=!0:r.size&&(i.size=r.size);break;default:i=typeof r.is=="string"?o.createElement(n,{is:r.is}):o.createElement(n)}}i[Nt]=t,i[Xt]=r;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)i.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=i;e:switch(qt(i,n,r),n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Za(t)}}return Je(t),Ic(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Za(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(D(166));if(e=Tr.current,Di(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,n=St,n!==null)switch(n.tag){case 27:case 5:r=n.memoizedProps}e[Nt]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||_b(e.nodeValue,a)),e||jr(t,!0)}else e=fs(e).createTextNode(r),e[Nt]=t,t.stateNode=e}return Je(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Di(t),a!==null){if(e===null){if(!r)throw Error(D(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(D(557));e[Nt]=t}else oi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),e=!1}else a=Yc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Wt(t),t):(Wt(t),null);if((t.flags&128)!==0)throw Error(D(558))}return Je(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=Di(t),r!==null&&r.dehydrated!==null){if(e===null){if(!n)throw Error(D(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(D(317));n[Nt]=t}else oi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),n=!1}else n=Yc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(Wt(t),t):(Wt(t),null)}return Wt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,n=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(n=r.alternate.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==n&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),kl(t,t.updateQueue),Je(t),null);case 4:return nn(),e===null&&Zp(t.stateNode.containerInfo),Je(t),null;case 10:return rr(t.type),Je(t),null;case 19:if(wt(ot),r=t.memoizedState,r===null)return Je(t),null;if(n=(t.flags&128)!==0,i=r.rendering,i===null)if(n)Pn(r,!1);else{if(it!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=as(e),i!==null){for(t.flags|=128,Pn(r,!1),e=i.updateQueue,t.updateQueue=e,kl(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Bg(a,e),a=a.sibling;return $e(ot,ot.current&1|2),Se&&Fa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&aa()>ss&&(t.flags|=128,n=!0,Pn(r,!1),t.lanes=4194304)}else{if(!n)if(e=as(i),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,kl(t,e),Pn(r,!0),r.tail===null&&r.tailMode==="hidden"&&!i.alternate&&!Se)return Je(t),null}else 2*aa()-r.renderingStartTime>ss&&a!==536870912&&(t.flags|=128,n=!0,Pn(r,!1),t.lanes=4194304);r.isBackwards?(i.sibling=t.child,t.child=i):(e=r.last,e!==null?e.sibling=i:t.child=i,r.last=i)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=aa(),e.sibling=null,a=ot.current,$e(ot,n?a&1|2:a&1),Se&&Fa(t,r.treeForkCount),e):(Je(t),null);case 22:case 23:return Wt(t),Sp(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&(Je(t),t.subtreeFlags&6&&(t.flags|=8192)):Je(t),a=t.updateQueue,a!==null&&kl(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),e!==null&&wt(ri),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),rr(pt),Je(t),null;case 25:return null;case 30:return null}throw Error(D(156,t.tag))}function Ey(e,t){switch(yp(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return rr(pt),nn(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Zl(t),null;case 31:if(t.memoizedState!==null){if(Wt(t),t.alternate===null)throw Error(D(340));oi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Wt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(D(340));oi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return wt(ot),null;case 4:return nn(),null;case 10:return rr(t.type),null;case 22:case 23:return Wt(t),Sp(),e!==null&&wt(ri),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return rr(pt),null;case 25:return null;default:return null}}function Bh(e,t){switch(yp(t),t.tag){case 3:rr(pt),nn();break;case 26:case 27:case 5:Zl(t);break;case 4:nn();break;case 31:t.memoizedState!==null&&Wt(t);break;case 13:Wt(t);break;case 19:wt(ot);break;case 10:rr(t.type);break;case 22:case 23:Wt(t),Sp(),e!==null&&wt(ri);break;case 24:rr(pt)}}function Go(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var n=r.next;a=n;do{if((a.tag&e)===e){r=void 0;var i=a.create,o=a.inst;r=i(),o.destroy=r}a=a.next}while(a!==n)}}catch(l){Oe(t,t.return,l)}}function Gr(e,t,a){try{var r=t.updateQueue,n=r!==null?r.lastEffect:null;if(n!==null){var i=n.next;r=i;do{if((r.tag&e)===e){var o=r.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,n=t;var c=a,p=l;try{p()}catch(f){Oe(n,c,f)}}}r=r.next}while(r!==i)}}catch(f){Oe(t,t.return,f)}}function Oh(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Vg(t,a)}catch(r){Oe(e,e.return,r)}}}function Lh(e,t,a){a.props=ui(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){Oe(e,t,r)}}function fo(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(n){Oe(e,t,n)}}function Oa(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(n){Oe(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(n){Oe(e,t,n)}else a.current=null}function Hh(e){var t=e.type,a=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(n){Oe(e,e.return,n)}}function Wc(e,t,a){try{var r=e.stateNode;Ky(r,e.type,a,t),r[Xt]=t}catch(n){Oe(e,e.return,n)}}function jh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Xr(e.type)||e.tag===4}function eu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||jh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Xr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Qu(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=er));else if(r!==4&&(r===27&&Xr(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Qu(e,t,a),e=e.sibling;e!==null;)Qu(e,t,a),e=e.sibling}function ls(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(r===27&&Xr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(ls(e,t,a),e=e.sibling;e!==null;)ls(e,t,a),e=e.sibling}function Gh(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);qt(t,r,a),t[Nt]=e,t[Xt]=a}catch(i){Oe(e,e.return,i)}}var Ia=!1,ut=!1,tu=!1,yf=typeof WeakSet=="function"?WeakSet:Set,bt=null;function My(e,t){if(e=e.containerInfo,Ju=vs,e=Eg(e),gp(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var n=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{a.nodeType,i.nodeType}catch{a=null;break e}var o=0,l=-1,c=-1,p=0,f=0,v=e,m=null;t:for(;;){for(var h;v!==a||n!==0&&v.nodeType!==3||(l=o+n),v!==i||r!==0&&v.nodeType!==3||(c=o+r),v.nodeType===3&&(o+=v.nodeValue.length),(h=v.firstChild)!==null;)m=v,v=h;for(;;){if(v===e)break t;if(m===a&&++p===n&&(l=o),m===i&&++f===r&&(c=o),(h=v.nextSibling)!==null)break;v=m,m=v.parentNode}v=h}a=l===-1||c===-1?null:{start:l,end:c}}else a=null}a=a||{start:0,end:0}}else a=null;for(Pu={focusedElem:e,selectionRange:a},vs=!1,bt=t;bt!==null;)if(t=bt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,bt=e;else for(;bt!==null;){switch(t=bt,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)n=e[a],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,a=t,n=i.memoizedProps,i=i.memoizedState,r=a.stateNode;try{var w=ui(a.type,n);e=r.getSnapshotBeforeUpdate(w,i),r.__reactInternalSnapshotBeforeUpdate=e}catch(E){Oe(a,a.return,E)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Iu(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Iu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(D(163))}if(e=t.sibling,e!==null){e.return=t.return,bt=e;break}bt=t.return}}function Qh(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Ja(e,a),r&4&&Go(5,a);break;case 1:if(Ja(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(o){Oe(a,a.return,o)}else{var n=ui(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Oe(a,a.return,o)}}r&64&&Oh(a),r&512&&fo(a,a.return);break;case 3:if(Ja(e,a),r&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Vg(e,t)}catch(o){Oe(a,a.return,o)}}break;case 27:t===null&&r&4&&Gh(a);case 26:case 5:Ja(e,a),t===null&&r&4&&Hh(a),r&512&&fo(a,a.return);break;case 12:Ja(e,a);break;case 31:Ja(e,a),r&4&&$h(e,a);break;case 13:Ja(e,a),r&4&&Vh(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Ly.bind(null,a),a1(e,a))));break;case 22:if(r=a.memoizedState!==null||Ia,!r){t=t!==null&&t.memoizedState!==null||ut,n=Ia;var i=ut;Ia=r,(ut=t)&&!i?Pa(e,a,(a.subtreeFlags&8772)!==0):Ja(e,a),Ia=n,ut=i}break;case 30:break;default:Ja(e,a)}}function Yh(e){var t=e.alternate;t!==null&&(e.alternate=null,Yh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&cp(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var et=null,Gt=!1;function Ka(e,t,a){for(a=a.child;a!==null;)Xh(e,t,a),a=a.sibling}function Xh(e,t,a){if(ra&&typeof ra.onCommitFiberUnmount=="function")try{ra.onCommitFiberUnmount(Uo,a)}catch{}switch(a.tag){case 26:ut||Oa(a,t),Ka(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ut||Oa(a,t);var r=et,n=Gt;Xr(a.type)&&(et=a.stateNode,Gt=!1),Ka(e,t,a),vo(a.stateNode),et=r,Gt=n;break;case 5:ut||Oa(a,t);case 6:if(r=et,n=Gt,et=null,Ka(e,t,a),et=r,Gt=n,et!==null)if(Gt)try{(et.nodeType===9?et.body:et.nodeName==="HTML"?et.ownerDocument.body:et).removeChild(a.stateNode)}catch(i){Oe(a,t,i)}else try{et.removeChild(a.stateNode)}catch(i){Oe(a,t,i)}break;case 18:et!==null&&(Gt?(e=et,Df(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),gn(e)):Df(et,a.stateNode));break;case 4:r=et,n=Gt,et=a.stateNode.containerInfo,Gt=!0,Ka(e,t,a),et=r,Gt=n;break;case 0:case 11:case 14:case 15:Gr(2,a,t),ut||Gr(4,a,t),Ka(e,t,a);break;case 1:ut||(Oa(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&Lh(a,t,r)),Ka(e,t,a);break;case 21:Ka(e,t,a);break;case 22:ut=(r=ut)||a.memoizedState!==null,Ka(e,t,a),ut=r;break;default:Ka(e,t,a)}}function $h(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{gn(e)}catch(a){Oe(t,t.return,a)}}}function Vh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{gn(e)}catch(a){Oe(t,t.return,a)}}function Ty(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new yf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new yf),t;default:throw Error(D(435,e.tag))}}function Nl(e,t){var a=Ty(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var n=Hy.bind(null,e,r);r.then(n,n)}})}function Ht(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var n=a[r],i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(Xr(l.type)){et=l.stateNode,Gt=!1;break e}break;case 5:et=l.stateNode,Gt=!1;break e;case 3:case 4:et=l.stateNode.containerInfo,Gt=!0;break e}l=l.return}if(et===null)throw Error(D(160));Xh(i,o,n),et=null,Gt=!1,i=n.alternate,i!==null&&(i.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Zh(t,e),t=t.sibling}var Ma=null;function Zh(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ht(t,e),jt(e),r&4&&(Gr(3,e,e.return),Go(3,e),Gr(5,e,e.return));break;case 1:Ht(t,e),jt(e),r&512&&(ut||a===null||Oa(a,a.return)),r&64&&Ia&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:var n=Ma;if(Ht(t,e),jt(e),r&512&&(ut||a===null||Oa(a,a.return)),r&4){var i=a!==null?a.memoizedState:null;if(r=e.memoizedState,a===null)if(r===null)if(e.stateNode===null){e:{r=e.type,a=e.memoizedProps,n=n.ownerDocument||n;t:switch(r){case"title":i=n.getElementsByTagName("title")[0],(!i||i[Oo]||i[Nt]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=n.createElement(r),n.head.insertBefore(i,n.querySelector("head > title"))),qt(i,r,a),i[Nt]=e,vt(i),r=i;break e;case"link":var o=Qf("link","href",n).get(r+(a.href||""));if(o){for(var l=0;l<o.length;l++)if(i=o[l],i.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&i.getAttribute("rel")===(a.rel==null?null:a.rel)&&i.getAttribute("title")===(a.title==null?null:a.title)&&i.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){o.splice(l,1);break t}}i=n.createElement(r),qt(i,r,a),n.head.appendChild(i);break;case"meta":if(o=Qf("meta","content",n).get(r+(a.content||""))){for(l=0;l<o.length;l++)if(i=o[l],i.getAttribute("content")===(a.content==null?null:""+a.content)&&i.getAttribute("name")===(a.name==null?null:a.name)&&i.getAttribute("property")===(a.property==null?null:a.property)&&i.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&i.getAttribute("charset")===(a.charSet==null?null:a.charSet)){o.splice(l,1);break t}}i=n.createElement(r),qt(i,r,a),n.head.appendChild(i);break;default:throw Error(D(468,r))}i[Nt]=e,vt(i),r=i}e.stateNode=r}else Yf(n,e.type,e.stateNode);else e.stateNode=Gf(n,r,e.memoizedProps);else i!==r?(i===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):i.count--,r===null?Yf(n,e.type,e.stateNode):Gf(n,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Wc(e,e.memoizedProps,a.memoizedProps)}break;case 27:Ht(t,e),jt(e),r&512&&(ut||a===null||Oa(a,a.return)),a!==null&&r&4&&Wc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Ht(t,e),jt(e),r&512&&(ut||a===null||Oa(a,a.return)),e.flags&32){n=e.stateNode;try{ln(n,"")}catch(w){Oe(e,e.return,w)}}r&4&&e.stateNode!=null&&(n=e.memoizedProps,Wc(e,n,a!==null?a.memoizedProps:n)),r&1024&&(tu=!0);break;case 6:if(Ht(t,e),jt(e),r&4){if(e.stateNode===null)throw Error(D(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(w){Oe(e,e.return,w)}}break;case 3:if(Ql=null,n=Ma,Ma=gs(t.containerInfo),Ht(t,e),Ma=n,jt(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{gn(t.containerInfo)}catch(w){Oe(e,e.return,w)}tu&&(tu=!1,Kh(e));break;case 4:r=Ma,Ma=gs(e.stateNode.containerInfo),Ht(t,e),jt(e),Ma=r;break;case 12:Ht(t,e),jt(e);break;case 31:Ht(t,e),jt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Nl(e,r)));break;case 13:Ht(t,e),jt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(zs=aa()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Nl(e,r)));break;case 22:n=e.memoizedState!==null;var c=a!==null&&a.memoizedState!==null,p=Ia,f=ut;if(Ia=p||n,ut=f||c,Ht(t,e),ut=f,Ia=p,jt(e),r&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(a===null||c||Ia||ut||ei(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){c=a=t;try{if(i=c.stateNode,n)o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=c.stateNode;var v=c.memoizedProps.style,m=v!=null&&v.hasOwnProperty("display")?v.display:null;l.style.display=m==null||typeof m=="boolean"?"":(""+m).trim()}}catch(w){Oe(c,c.return,w)}}}else if(t.tag===6){if(a===null){c=t;try{c.stateNode.nodeValue=n?"":c.memoizedProps}catch(w){Oe(c,c.return,w)}}}else if(t.tag===18){if(a===null){c=t;try{var h=c.stateNode;n?Bf(h,!0):Bf(c.stateNode,!1)}catch(w){Oe(c,c.return,w)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,Nl(e,a))));break;case 19:Ht(t,e),jt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Nl(e,r)));break;case 30:break;case 21:break;default:Ht(t,e),jt(e)}}function jt(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(jh(r)){a=r;break}r=r.return}if(a==null)throw Error(D(160));switch(a.tag){case 27:var n=a.stateNode,i=eu(e);ls(e,i,n);break;case 5:var o=a.stateNode;a.flags&32&&(ln(o,""),a.flags&=-33);var l=eu(e);ls(e,l,o);break;case 3:case 4:var c=a.stateNode.containerInfo,p=eu(e);Qu(e,p,c);break;default:throw Error(D(161))}}catch(f){Oe(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Kh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Kh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ja(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Qh(e,t.alternate,t),t=t.sibling}function ei(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Gr(4,t,t.return),ei(t);break;case 1:Oa(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Lh(t,t.return,a),ei(t);break;case 27:vo(t.stateNode);case 26:case 5:Oa(t,t.return),ei(t);break;case 22:t.memoizedState===null&&ei(t);break;case 30:ei(t);break;default:ei(t)}e=e.sibling}}function Pa(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,n=e,i=t,o=i.flags;switch(i.tag){case 0:case 11:case 15:Pa(n,i,a),Go(4,i);break;case 1:if(Pa(n,i,a),r=i,n=r.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(p){Oe(r,r.return,p)}if(r=i,n=r.updateQueue,n!==null){var l=r.stateNode;try{var c=n.shared.hiddenCallbacks;if(c!==null)for(n.shared.hiddenCallbacks=null,n=0;n<c.length;n++)$g(c[n],l)}catch(p){Oe(r,r.return,p)}}a&&o&64&&Oh(i),fo(i,i.return);break;case 27:Gh(i);case 26:case 5:Pa(n,i,a),a&&r===null&&o&4&&Hh(i),fo(i,i.return);break;case 12:Pa(n,i,a);break;case 31:Pa(n,i,a),a&&o&4&&$h(n,i);break;case 13:Pa(n,i,a),a&&o&4&&Vh(n,i);break;case 22:i.memoizedState===null&&Pa(n,i,a),fo(i,i.return);break;case 30:break;default:Pa(n,i,a)}t=t.sibling}}function Gp(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Ho(a))}function Qp(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ho(e))}function Ea(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Jh(e,t,a,r),t=t.sibling}function Jh(e,t,a,r){var n=t.flags;switch(t.tag){case 0:case 11:case 15:Ea(e,t,a,r),n&2048&&Go(9,t);break;case 1:Ea(e,t,a,r);break;case 3:Ea(e,t,a,r),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ho(e)));break;case 12:if(n&2048){Ea(e,t,a,r),e=t.stateNode;try{var i=t.memoizedProps,o=i.id,l=i.onPostCommit;typeof l=="function"&&l(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Oe(t,t.return,c)}}else Ea(e,t,a,r);break;case 31:Ea(e,t,a,r);break;case 13:Ea(e,t,a,r);break;case 23:break;case 22:i=t.stateNode,o=t.alternate,t.memoizedState!==null?i._visibility&2?Ea(e,t,a,r):go(e,t):i._visibility&2?Ea(e,t,a,r):(i._visibility|=2,Oi(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),n&2048&&Gp(o,t);break;case 24:Ea(e,t,a,r),n&2048&&Qp(t.alternate,t);break;default:Ea(e,t,a,r)}}function Oi(e,t,a,r,n){for(n=n&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,o=t,l=a,c=r,p=o.flags;switch(o.tag){case 0:case 11:case 15:Oi(i,o,l,c,n),Go(8,o);break;case 23:break;case 22:var f=o.stateNode;o.memoizedState!==null?f._visibility&2?Oi(i,o,l,c,n):go(i,o):(f._visibility|=2,Oi(i,o,l,c,n)),n&&p&2048&&Gp(o.alternate,o);break;case 24:Oi(i,o,l,c,n),n&&p&2048&&Qp(o.alternate,o);break;default:Oi(i,o,l,c,n)}t=t.sibling}}function go(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,n=r.flags;switch(r.tag){case 22:go(a,r),n&2048&&Gp(r.alternate,r);break;case 24:go(a,r),n&2048&&Qp(r.alternate,r);break;default:go(a,r)}t=t.sibling}}var io=8192;function Bi(e,t,a){if(e.subtreeFlags&io)for(e=e.child;e!==null;)Ph(e,t,a),e=e.sibling}function Ph(e,t,a){switch(e.tag){case 26:Bi(e,t,a),e.flags&io&&e.memoizedState!==null&&f1(a,Ma,e.memoizedState,e.memoizedProps);break;case 5:Bi(e,t,a);break;case 3:case 4:var r=Ma;Ma=gs(e.stateNode.containerInfo),Bi(e,t,a),Ma=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=io,io=16777216,Bi(e,t,a),io=r):Bi(e,t,a));break;default:Bi(e,t,a)}}function Fh(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Fn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];bt=r,Wh(r,e)}Fh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ih(e),e=e.sibling}function Ih(e){switch(e.tag){case 0:case 11:case 15:Fn(e),e.flags&2048&&Gr(9,e,e.return);break;case 3:Fn(e);break;case 12:Fn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,jl(e)):Fn(e);break;default:Fn(e)}}function jl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var r=t[a];bt=r,Wh(r,e)}Fh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Gr(8,t,t.return),jl(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,jl(t));break;default:jl(t)}e=e.sibling}}function Wh(e,t){for(;bt!==null;){var a=bt;switch(a.tag){case 0:case 11:case 15:Gr(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var r=a.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ho(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,bt=r;else e:for(a=e;bt!==null;){r=bt;var n=r.sibling,i=r.return;if(Yh(r),r===a){bt=null;break e}if(n!==null){n.return=i,bt=n;break e}bt=i}}}var zy={getCacheForType:function(e){var t=Ct(pt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Ct(pt).controller.signal}},Ay=typeof WeakMap=="function"?WeakMap:Map,ze=0,Qe=null,ke=null,Ne=0,Be=0,It=null,qr=!1,yn=!1,Yp=!1,cr=0,it=0,Qr=0,ni=0,Xp=0,ta=0,pn=0,ho=null,Qt=null,Yu=!1,zs=0,eb=0,ss=1/0,cs=null,Ur=null,mt=0,Dr=null,dn=null,ir=0,Xu=0,$u=null,tb=null,bo=0,Vu=null;function na(){return(ze&2)!==0&&Ne!==0?Ne&-Ne:me.T!==null?Vp():ug()}function ab(){if(ta===0)if((Ne&536870912)===0||Se){var e=fl;fl<<=1,(fl&3932160)===0&&(fl=262144),ta=e}else ta=536870912;return e=la.current,e!==null&&(e.flags|=32),ta}function Yt(e,t,a){(e===Qe&&(Be===2||Be===9)||e.cancelPendingCommit!==null)&&(mn(e,0),Er(e,Ne,ta,!1)),Bo(e,a),((ze&2)===0||e!==Qe)&&(e===Qe&&((ze&2)===0&&(ni|=a),it===4&&Er(e,Ne,ta,!1)),ja(e))}function rb(e,t,a){if((ze&6)!==0)throw Error(D(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Do(e,t),n=r?Dy(e,t):au(e,t,!0),i=r;do{if(n===0){yn&&!r&&Er(e,t,0,!1);break}else{if(a=e.current.alternate,i&&!Ry(a)){n=au(e,t,!1),i=!1;continue}if(n===2){if(i=t,e.errorRecoveryDisabledLanes&i)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var l=e;n=ho;var c=l.current.memoizedState.isDehydrated;if(c&&(mn(l,o).flags|=256),o=au(l,o,!1),o!==2){if(Yp&&!c){l.errorRecoveryDisabledLanes|=i,ni|=i,n=4;break e}i=Qt,Qt=n,i!==null&&(Qt===null?Qt=i:Qt.push.apply(Qt,i))}n=o}if(i=!1,n!==2)continue}}if(n===1){mn(e,0),Er(e,t,0,!0);break}e:{switch(r=e,i=n,i){case 0:case 1:throw Error(D(345));case 4:if((t&4194048)!==t)break;case 6:Er(r,t,ta,!qr);break e;case 2:Qt=null;break;case 3:case 5:break;default:throw Error(D(329))}if((t&62914560)===t&&(n=zs+300-aa(),10<n)){if(Er(r,t,ta,!qr),ys(r,0,!0)!==0)break e;ir=t,r.timeoutHandle=kb(_f.bind(null,r,a,Qt,cs,Yu,t,ta,ni,pn,qr,i,"Throttled",-0,0),n);break e}_f(r,a,Qt,cs,Yu,t,ta,ni,pn,qr,i,null,-0,0)}}break}while(!0);ja(e)}function _f(e,t,a,r,n,i,o,l,c,p,f,v,m,h){if(e.timeoutHandle=-1,v=t.subtreeFlags,v&8192||(v&16785408)===16785408){v={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:er},Ph(t,i,v);var w=(i&62914560)===i?zs-aa():(i&4194048)===i?eb-aa():0;if(w=g1(v,w),w!==null){ir=i,e.cancelPendingCommit=w(kf.bind(null,e,t,i,a,r,n,o,l,c,f,v,null,m,h)),Er(e,i,o,!p);return}}kf(e,t,i,a,r,n,o,l,c)}function Ry(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var r=0;r<a.length;r++){var n=a[r],i=n.getSnapshot;n=n.value;try{if(!oa(i(),n))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Er(e,t,a,r){t&=~Xp,t&=~ni,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var n=t;0<n;){var i=31-ia(n),o=1<<i;r[i]=-1,n&=~o}a!==0&&lg(e,a,t)}function As(){return(ze&6)===0?(Qo(0,!1),!1):!0}function $p(){if(ke!==null){if(Be===0)var e=ke.return;else e=ke,tr=gi=null,Tp(e),tn=null,So=0,e=ke;for(;e!==null;)Bh(e.alternate,e),e=e.return;ke=null}}function mn(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Fy(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),ir=0,$p(),Qe=e,ke=a=ar(e.current,null),Ne=t,Be=0,It=null,qr=!1,yn=Do(e,t),Yp=!1,pn=ta=Xp=ni=Qr=it=0,Qt=ho=null,Yu=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var n=31-ia(r),i=1<<n;t|=e[n],r&=~i}return cr=t,Ns(),a}function ib(e,t){he=null,me.H=qo,t===wn||t===Cs?(t=Im(),Be=3):t===kp?(t=Im(),Be=4):Be=t===Hp?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,It=t,ke===null&&(it=1,ns(e,ba(t,e.current)))}function nb(){var e=la.current;return e===null?!0:(Ne&4194048)===Ne?wa===null:(Ne&62914560)===Ne||(Ne&536870912)!==0?e===wa:!1}function ob(){var e=me.H;return me.H=qo,e===null?qo:e}function lb(){var e=me.A;return me.A=zy,e}function us(){it=4,qr||(Ne&4194048)!==Ne&&la.current!==null||(yn=!0),(Qr&134217727)===0&&(ni&134217727)===0||Qe===null||Er(Qe,Ne,ta,!1)}function au(e,t,a){var r=ze;ze|=2;var n=ob(),i=lb();(Qe!==e||Ne!==t)&&(cs=null,mn(e,t)),t=!1;var o=it;e:do try{if(Be!==0&&ke!==null){var l=ke,c=It;switch(Be){case 8:$p(),o=6;break e;case 3:case 2:case 9:case 6:la.current===null&&(t=!0);var p=Be;if(Be=0,It=null,Pi(e,l,c,p),a&&yn){o=0;break e}break;default:p=Be,Be=0,It=null,Pi(e,l,c,p)}}Uy(),o=it;break}catch(f){ib(e,f)}while(!0);return t&&e.shellSuspendCounter++,tr=gi=null,ze=r,me.H=n,me.A=i,ke===null&&(Qe=null,Ne=0,Ns()),o}function Uy(){for(;ke!==null;)sb(ke)}function Dy(e,t){var a=ze;ze|=2;var r=ob(),n=lb();Qe!==e||Ne!==t?(cs=null,ss=aa()+500,mn(e,t)):yn=Do(e,t);e:do try{if(Be!==0&&ke!==null){t=ke;var i=It;t:switch(Be){case 1:Be=0,It=null,Pi(e,t,i,1);break;case 2:case 9:if(Fm(i)){Be=0,It=null,xf(t);break}t=function(){Be!==2&&Be!==9||Qe!==e||(Be=7),ja(e)},i.then(t,t);break e;case 3:Be=7;break e;case 4:Be=5;break e;case 7:Fm(i)?(Be=0,It=null,xf(t)):(Be=0,It=null,Pi(e,t,i,7));break;case 5:var o=null;switch(ke.tag){case 26:o=ke.memoizedState;case 5:case 27:var l=ke;if(o?Eb(o):l.stateNode.complete){Be=0,It=null;var c=l.sibling;if(c!==null)ke=c;else{var p=l.return;p!==null?(ke=p,Rs(p)):ke=null}break t}}Be=0,It=null,Pi(e,t,i,5);break;case 6:Be=0,It=null,Pi(e,t,i,6);break;case 8:$p(),it=6;break e;default:throw Error(D(462))}}By();break}catch(f){ib(e,f)}while(!0);return tr=gi=null,me.H=r,me.A=n,ze=a,ke!==null?0:(Qe=null,Ne=0,Ns(),it)}function By(){for(;ke!==null&&!n0();)sb(ke)}function sb(e){var t=Dh(e.alternate,e,cr);e.memoizedProps=e.pendingProps,t===null?Rs(e):ke=t}function xf(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=gf(a,t,t.pendingProps,t.type,void 0,Ne);break;case 11:t=gf(a,t,t.pendingProps,t.type.render,t.ref,Ne);break;case 5:Tp(t);default:Bh(a,t),t=ke=Bg(t,cr),t=Dh(a,t,cr)}e.memoizedProps=e.pendingProps,t===null?Rs(e):ke=t}function Pi(e,t,a,r){tr=gi=null,Tp(t),tn=null,So=0;var n=t.return;try{if(Ny(e,n,t,a,Ne)){it=1,ns(e,ba(a,e.current)),ke=null;return}}catch(i){if(n!==null)throw ke=n,i;it=1,ns(e,ba(a,e.current)),ke=null;return}t.flags&32768?(Se||r===1?e=!0:yn||(Ne&536870912)!==0?e=!1:(qr=e=!0,(r===2||r===9||r===3||r===6)&&(r=la.current,r!==null&&r.tag===13&&(r.flags|=16384))),cb(t,e)):Rs(t)}function Rs(e){var t=e;do{if((t.flags&32768)!==0){cb(t,qr);return}e=t.return;var a=qy(t.alternate,t,cr);if(a!==null){ke=a;return}if(t=t.sibling,t!==null){ke=t;return}ke=t=e}while(t!==null);it===0&&(it=5)}function cb(e,t){do{var a=Ey(e.alternate,e);if(a!==null){a.flags&=32767,ke=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){ke=e;return}ke=e=a}while(e!==null);it=6,ke=null}function kf(e,t,a,r,n,i,o,l,c){e.cancelPendingCommit=null;do Us();while(mt!==0);if((ze&6)!==0)throw Error(D(327));if(t!==null){if(t===e.current)throw Error(D(177));if(i=t.lanes|t.childLanes,i|=hp,g0(e,a,i,o,l,c),e===Qe&&(ke=Qe=null,Ne=0),dn=t,Dr=e,ir=a,Xu=i,$u=n,tb=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,jy(Kl,function(){return fb(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=me.T,me.T=null,n=Ae.p,Ae.p=2,o=ze,ze|=4;try{My(e,t,a)}finally{ze=o,Ae.p=n,me.T=r}}mt=1,ub(),pb(),db()}}function ub(){if(mt===1){mt=0;var e=Dr,t=dn,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=me.T,me.T=null;var r=Ae.p;Ae.p=2;var n=ze;ze|=4;try{Zh(t,e);var i=Pu,o=Eg(e.containerInfo),l=i.focusedElem,c=i.selectionRange;if(o!==l&&l&&l.ownerDocument&&qg(l.ownerDocument.documentElement,l)){if(c!==null&&gp(l)){var p=c.start,f=c.end;if(f===void 0&&(f=p),"selectionStart"in l)l.selectionStart=p,l.selectionEnd=Math.min(f,l.value.length);else{var v=l.ownerDocument||document,m=v&&v.defaultView||window;if(m.getSelection){var h=m.getSelection(),w=l.textContent.length,E=Math.min(c.start,w),U=c.end===void 0?E:Math.min(c.end,w);!h.extend&&E>U&&(o=U,U=E,E=o);var d=Xm(l,E),u=Xm(l,U);if(d&&u&&(h.rangeCount!==1||h.anchorNode!==d.node||h.anchorOffset!==d.offset||h.focusNode!==u.node||h.focusOffset!==u.offset)){var g=v.createRange();g.setStart(d.node,d.offset),h.removeAllRanges(),E>U?(h.addRange(g),h.extend(u.node,u.offset)):(g.setEnd(u.node,u.offset),h.addRange(g))}}}}for(v=[],h=l;h=h.parentNode;)h.nodeType===1&&v.push({element:h,left:h.scrollLeft,top:h.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<v.length;l++){var b=v[l];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}vs=!!Ju,Pu=Ju=null}finally{ze=n,Ae.p=r,me.T=a}}e.current=t,mt=2}}function pb(){if(mt===2){mt=0;var e=Dr,t=dn,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=me.T,me.T=null;var r=Ae.p;Ae.p=2;var n=ze;ze|=4;try{Qh(e,t.alternate,t)}finally{ze=n,Ae.p=r,me.T=a}}mt=3}}function db(){if(mt===4||mt===3){mt=0,o0();var e=Dr,t=dn,a=ir,r=tb;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?mt=5:(mt=0,dn=Dr=null,mb(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(Ur=null),sp(a),t=t.stateNode,ra&&typeof ra.onCommitFiberRoot=="function")try{ra.onCommitFiberRoot(Uo,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=me.T,n=Ae.p,Ae.p=2,me.T=null;try{for(var i=e.onRecoverableError,o=0;o<r.length;o++){var l=r[o];i(l.value,{componentStack:l.stack})}}finally{me.T=t,Ae.p=n}}(ir&3)!==0&&Us(),ja(e),n=e.pendingLanes,(a&261930)!==0&&(n&42)!==0?e===Vu?bo++:(bo=0,Vu=e):bo=0,Qo(0,!1)}}function mb(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ho(t)))}function Us(){return ub(),pb(),db(),fb()}function fb(){if(mt!==5)return!1;var e=Dr,t=Xu;Xu=0;var a=sp(ir),r=me.T,n=Ae.p;try{Ae.p=32>a?32:a,me.T=null,a=$u,$u=null;var i=Dr,o=ir;if(mt=0,dn=Dr=null,ir=0,(ze&6)!==0)throw Error(D(331));var l=ze;if(ze|=4,Ih(i.current),Jh(i,i.current,o,a),ze=l,Qo(0,!1),ra&&typeof ra.onPostCommitFiberRoot=="function")try{ra.onPostCommitFiberRoot(Uo,i)}catch{}return!0}finally{Ae.p=n,me.T=r,mb(e,t)}}function Nf(e,t,a){t=ba(a,t),t=Hu(e.stateNode,t,2),e=Rr(e,t,2),e!==null&&(Bo(e,2),ja(e))}function Oe(e,t,a){if(e.tag===3)Nf(e,e,a);else for(;t!==null;){if(t.tag===3){Nf(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ur===null||!Ur.has(r))){e=ba(a,e),a=Mh(2),r=Rr(t,a,2),r!==null&&(Th(a,r,t,e),Bo(r,2),ja(r));break}}t=t.return}}function ru(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new Ay;var n=new Set;r.set(t,n)}else n=r.get(t),n===void 0&&(n=new Set,r.set(t,n));n.has(a)||(Yp=!0,n.add(a),e=Oy.bind(null,e,t,a),t.then(e,e))}function Oy(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Qe===e&&(Ne&a)===a&&(it===4||it===3&&(Ne&62914560)===Ne&&300>aa()-zs?(ze&2)===0&&mn(e,0):Xp|=a,pn===Ne&&(pn=0)),ja(e)}function gb(e,t){t===0&&(t=og()),e=fi(e,t),e!==null&&(Bo(e,t),ja(e))}function Ly(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),gb(e,a)}function Hy(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,n=e.memoizedState;n!==null&&(a=n.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(D(314))}r!==null&&r.delete(t),gb(e,a)}function jy(e,t){return op(e,t)}var ps=null,Li=null,Zu=!1,ds=!1,iu=!1,Mr=0;function ja(e){e!==Li&&e.next===null&&(Li===null?ps=Li=e:Li=Li.next=e),ds=!0,Zu||(Zu=!0,Qy())}function Qo(e,t){if(!iu&&ds){iu=!0;do for(var a=!1,r=ps;r!==null;){if(!t)if(e!==0){var n=r.pendingLanes;if(n===0)var i=0;else{var o=r.suspendedLanes,l=r.pingedLanes;i=(1<<31-ia(42|e)+1)-1,i&=n&~(o&~l),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(a=!0,Sf(r,i))}else i=Ne,i=ys(r,r===Qe?i:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(i&3)===0||Do(r,i)||(a=!0,Sf(r,i));r=r.next}while(a);iu=!1}}function Gy(){hb()}function hb(){ds=Zu=!1;var e=0;Mr!==0&&Py()&&(e=Mr);for(var t=aa(),a=null,r=ps;r!==null;){var n=r.next,i=bb(r,t);i===0?(r.next=null,a===null?ps=n:a.next=n,n===null&&(Li=a)):(a=r,(e!==0||(i&3)!==0)&&(ds=!0)),r=n}mt!==0&&mt!==5||Qo(e,!1),Mr!==0&&(Mr=0)}function bb(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,n=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var o=31-ia(i),l=1<<o,c=n[o];c===-1?((l&a)===0||(l&r)!==0)&&(n[o]=f0(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}if(t=Qe,a=Ne,a=ys(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,a===0||e===t&&(Be===2||Be===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Rc(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Do(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&Rc(r),sp(a)){case 2:case 8:a=ig;break;case 32:a=Kl;break;case 268435456:a=ng;break;default:a=Kl}return r=vb.bind(null,e),a=op(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&Rc(r),e.callbackPriority=2,e.callbackNode=null,2}function vb(e,t){if(mt!==0&&mt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Us()&&e.callbackNode!==a)return null;var r=Ne;return r=ys(e,e===Qe?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(rb(e,r,t),bb(e,aa()),e.callbackNode!=null&&e.callbackNode===a?vb.bind(null,e):null)}function Sf(e,t){if(Us())return null;rb(e,t,!0)}function Qy(){Iy(function(){(ze&6)!==0?op(rg,Gy):hb()})}function Vp(){if(Mr===0){var e=sn;e===0&&(e=ml,ml<<=1,(ml&261888)===0&&(ml=256)),Mr=e}return Mr}function Cf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:zl(""+e)}function qf(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Yy(e,t,a,r,n){if(t==="submit"&&a&&a.stateNode===n){var i=Cf((n[Xt]||null).action),o=r.submitter;o&&(t=(t=o[Xt]||null)?Cf(t.formAction):o.getAttribute("formAction"),t!==null&&(i=t,o=null));var l=new _s("action","action",null,r,n);e.push({event:l,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Mr!==0){var c=o?qf(n,o):new FormData(n);Ou(a,{pending:!0,data:c,method:n.method,action:i},null,c)}}else typeof i=="function"&&(l.preventDefault(),c=o?qf(n,o):new FormData(n),Ou(a,{pending:!0,data:c,method:n.method,action:i},i,c))},currentTarget:n}]})}}for(Sl=0;Sl<Su.length;Sl++)Cl=Su[Sl],Ef=Cl.toLowerCase(),Mf=Cl[0].toUpperCase()+Cl.slice(1),Ta(Ef,"on"+Mf);var Cl,Ef,Mf,Sl;Ta(Tg,"onAnimationEnd");Ta(zg,"onAnimationIteration");Ta(Ag,"onAnimationStart");Ta("dblclick","onDoubleClick");Ta("focusin","onFocus");Ta("focusout","onBlur");Ta(ly,"onTransitionRun");Ta(sy,"onTransitionStart");Ta(cy,"onTransitionCancel");Ta(Rg,"onTransitionEnd");on("onMouseEnter",["mouseout","mouseover"]);on("onMouseLeave",["mouseout","mouseover"]);on("onPointerEnter",["pointerout","pointerover"]);on("onPointerLeave",["pointerout","pointerover"]);pi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));pi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));pi("onBeforeInput",["compositionend","keypress","textInput","paste"]);pi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));pi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));pi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Eo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Xy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Eo));function wb(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],n=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,p=l.currentTarget;if(l=l.listener,c!==i&&n.isPropagationStopped())break e;i=l,n.currentTarget=p;try{i(n)}catch(f){Pl(f)}n.currentTarget=null,i=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,p=l.currentTarget,l=l.listener,c!==i&&n.isPropagationStopped())break e;i=l,n.currentTarget=p;try{i(n)}catch(f){Pl(f)}n.currentTarget=null,i=c}}}}function xe(e,t){var a=t[bu];a===void 0&&(a=t[bu]=new Set);var r=e+"__bubble";a.has(r)||(yb(t,e,2,!1),a.add(r))}function nu(e,t,a){var r=0;t&&(r|=4),yb(a,e,r,t)}var ql="_reactListening"+Math.random().toString(36).slice(2);function Zp(e){if(!e[ql]){e[ql]=!0,pg.forEach(function(a){a!=="selectionchange"&&(Xy.has(a)||nu(a,!1,e),nu(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ql]||(t[ql]=!0,nu("selectionchange",!1,t))}}function yb(e,t,a,r){switch(Rb(t)){case 2:var n=v1;break;case 8:n=w1;break;default:n=Fp}a=n.bind(null,t,a,e),n=void 0,!xu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),r?n!==void 0?e.addEventListener(t,a,{capture:!0,passive:n}):e.addEventListener(t,a,!0):n!==void 0?e.addEventListener(t,a,{passive:n}):e.addEventListener(t,a,!1)}function ou(e,t,a,r,n){var i=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===n)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===n)return;o=o.return}for(;l!==null;){if(o=Gi(l),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=i=o;continue e}l=l.parentNode}}r=r.return}wg(function(){var p=i,f=pp(a),v=[];e:{var m=Ug.get(e);if(m!==void 0){var h=_s,w=e;switch(e){case"keypress":if(Rl(a)===0)break e;case"keydown":case"keyup":h=H0;break;case"focusin":w="focus",h=Lc;break;case"focusout":w="blur",h=Lc;break;case"beforeblur":case"afterblur":h=Lc;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Dm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=q0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=Q0;break;case Tg:case zg:case Ag:h=T0;break;case Rg:h=X0;break;case"scroll":case"scrollend":h=S0;break;case"wheel":h=V0;break;case"copy":case"cut":case"paste":h=A0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Om;break;case"toggle":case"beforetoggle":h=K0}var E=(t&4)!==0,U=!E&&(e==="scroll"||e==="scrollend"),d=E?m!==null?m+"Capture":null:m;E=[];for(var u=p,g;u!==null;){var b=u;if(g=b.stateNode,b=b.tag,b!==5&&b!==26&&b!==27||g===null||d===null||(b=yo(u,d),b!=null&&E.push(Mo(u,b,g))),U)break;u=u.return}0<E.length&&(m=new h(m,w,null,a,f),v.push({event:m,listeners:E}))}}if((t&7)===0){e:{if(m=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",m&&a!==_u&&(w=a.relatedTarget||a.fromElement)&&(Gi(w)||w[hn]))break e;if((h||m)&&(m=f.window===f?f:(m=f.ownerDocument)?m.defaultView||m.parentWindow:window,h?(w=a.relatedTarget||a.toElement,h=p,w=w?Gi(w):null,w!==null&&(U=Ro(w),E=w.tag,w!==U||E!==5&&E!==27&&E!==6)&&(w=null)):(h=null,w=p),h!==w)){if(E=Dm,b="onMouseLeave",d="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(E=Om,b="onPointerLeave",d="onPointerEnter",u="pointer"),U=h==null?m:ao(h),g=w==null?m:ao(w),m=new E(b,u+"leave",h,a,f),m.target=U,m.relatedTarget=g,b=null,Gi(f)===p&&(E=new E(d,u+"enter",w,a,f),E.target=g,E.relatedTarget=U,b=E),U=b,h&&w)t:{for(E=$y,d=h,u=w,g=0,b=d;b;b=E(b))g++;b=0;for(var S=u;S;S=E(S))b++;for(;0<g-b;)d=E(d),g--;for(;0<b-g;)u=E(u),b--;for(;g--;){if(d===u||u!==null&&d===u.alternate){E=d;break t}d=E(d),u=E(u)}E=null}else E=null;h!==null&&Tf(v,m,h,E,!1),w!==null&&U!==null&&Tf(v,U,w,E,!0)}}e:{if(m=p?ao(p):window,h=m.nodeName&&m.nodeName.toLowerCase(),h==="select"||h==="input"&&m.type==="file")var T=Gm;else if(jm(m))if(Sg)T=iy;else{T=ay;var M=ty}else h=m.nodeName,!h||h.toLowerCase()!=="input"||m.type!=="checkbox"&&m.type!=="radio"?p&&up(p.elementType)&&(T=Gm):T=ry;if(T&&(T=T(e,p))){Ng(v,T,a,f);break e}M&&M(e,m,p),e==="focusout"&&p&&m.type==="number"&&p.memoizedProps.value!=null&&yu(m,"number",m.value)}switch(M=p?ao(p):window,e){case"focusin":(jm(M)||M.contentEditable==="true")&&(Xi=M,ku=p,lo=null);break;case"focusout":lo=ku=Xi=null;break;case"mousedown":Nu=!0;break;case"contextmenu":case"mouseup":case"dragend":Nu=!1,$m(v,a,f);break;case"selectionchange":if(oy)break;case"keydown":case"keyup":$m(v,a,f)}var R;if(fp)e:{switch(e){case"compositionstart":var G="onCompositionStart";break e;case"compositionend":G="onCompositionEnd";break e;case"compositionupdate":G="onCompositionUpdate";break e}G=void 0}else Yi?xg(e,a)&&(G="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(G="onCompositionStart");G&&(_g&&a.locale!=="ko"&&(Yi||G!=="onCompositionStart"?G==="onCompositionEnd"&&Yi&&(R=yg()):(Cr=f,dp="value"in Cr?Cr.value:Cr.textContent,Yi=!0)),M=ms(p,G),0<M.length&&(G=new Bm(G,e,null,a,f),v.push({event:G,listeners:M}),R?G.data=R:(R=kg(a),R!==null&&(G.data=R)))),(R=P0?F0(e,a):I0(e,a))&&(G=ms(p,"onBeforeInput"),0<G.length&&(M=new Bm("onBeforeInput","beforeinput",null,a,f),v.push({event:M,listeners:G}),M.data=R)),Yy(v,e,p,a,f)}wb(v,t)})}function Mo(e,t,a){return{instance:e,listener:t,currentTarget:a}}function ms(e,t){for(var a=t+"Capture",r=[];e!==null;){var n=e,i=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||i===null||(n=yo(e,a),n!=null&&r.unshift(Mo(e,n,i)),n=yo(e,t),n!=null&&r.push(Mo(e,n,i))),e.tag===3)return r;e=e.return}return[]}function $y(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Tf(e,t,a,r,n){for(var i=t._reactName,o=[];a!==null&&a!==r;){var l=a,c=l.alternate,p=l.stateNode;if(l=l.tag,c!==null&&c===r)break;l!==5&&l!==26&&l!==27||p===null||(c=p,n?(p=yo(a,i),p!=null&&o.unshift(Mo(a,p,c))):n||(p=yo(a,i),p!=null&&o.push(Mo(a,p,c)))),a=a.return}o.length!==0&&e.push({event:t,listeners:o})}var Vy=/\r\n?/g,Zy=/\u0000|\uFFFD/g;function zf(e){return(typeof e=="string"?e:""+e).replace(Vy,`
9
+ `).replace(Zy,"")}function _b(e,t){return t=zf(t),zf(e)===t}function He(e,t,a,r,n,i){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||ln(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&ln(e,""+r);break;case"className":hl(e,"class",r);break;case"tabIndex":hl(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":hl(e,a,r);break;case"style":vg(e,r,i);break;case"data":if(t!=="object"){hl(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=zl(""+r),e.setAttribute(a,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(a==="formAction"?(t!=="input"&&He(e,t,"name",n.name,n,null),He(e,t,"formEncType",n.formEncType,n,null),He(e,t,"formMethod",n.formMethod,n,null),He(e,t,"formTarget",n.formTarget,n,null)):(He(e,t,"encType",n.encType,n,null),He(e,t,"method",n.method,n,null),He(e,t,"target",n.target,n,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=zl(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=er);break;case"onScroll":r!=null&&xe("scroll",e);break;case"onScrollEnd":r!=null&&xe("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(D(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(D(60));e.innerHTML=a}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}a=zl(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""+r):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":r===!0?e.setAttribute(a,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(a,r):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(a,r):e.removeAttribute(a);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(a):e.setAttribute(a,r);break;case"popover":xe("beforetoggle",e),xe("toggle",e),Tl(e,"popover",r);break;case"xlinkActuate":Va(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Va(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Va(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Va(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Va(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Va(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Va(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Va(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Va(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Tl(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=k0.get(a)||a,Tl(e,a,r))}}function Ku(e,t,a,r,n,i){switch(a){case"style":vg(e,r,i);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(D(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(D(60));e.innerHTML=a}}break;case"children":typeof r=="string"?ln(e,r):(typeof r=="number"||typeof r=="bigint")&&ln(e,""+r);break;case"onScroll":r!=null&&xe("scroll",e);break;case"onScrollEnd":r!=null&&xe("scrollend",e);break;case"onClick":r!=null&&(e.onclick=er);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!dg.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(n=a.endsWith("Capture"),t=a.slice(2,n?a.length-7:void 0),i=e[Xt]||null,i=i!=null?i[a]:null,typeof i=="function"&&e.removeEventListener(t,i,n),typeof r=="function")){typeof i!="function"&&i!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,r,n);break e}a in e?e[a]=r:r===!0?e.setAttribute(a,""):Tl(e,a,r)}}}function qt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xe("error",e),xe("load",e);var r=!1,n=!1,i;for(i in a)if(a.hasOwnProperty(i)){var o=a[i];if(o!=null)switch(i){case"src":r=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(D(137,t));default:He(e,t,i,o,a,null)}}n&&He(e,t,"srcSet",a.srcSet,a,null),r&&He(e,t,"src",a.src,a,null);return;case"input":xe("invalid",e);var l=i=o=n=null,c=null,p=null;for(r in a)if(a.hasOwnProperty(r)){var f=a[r];if(f!=null)switch(r){case"name":n=f;break;case"type":o=f;break;case"checked":c=f;break;case"defaultChecked":p=f;break;case"value":i=f;break;case"defaultValue":l=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(D(137,t));break;default:He(e,t,r,f,a,null)}}gg(e,i,l,c,p,o,n,!1);return;case"select":xe("invalid",e),r=o=i=null;for(n in a)if(a.hasOwnProperty(n)&&(l=a[n],l!=null))switch(n){case"value":i=l;break;case"defaultValue":o=l;break;case"multiple":r=l;default:He(e,t,n,l,a,null)}t=i,a=o,e.multiple=!!r,t!=null?Ii(e,!!r,t,!1):a!=null&&Ii(e,!!r,a,!0);return;case"textarea":xe("invalid",e),i=n=r=null;for(o in a)if(a.hasOwnProperty(o)&&(l=a[o],l!=null))switch(o){case"value":r=l;break;case"defaultValue":n=l;break;case"children":i=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(D(91));break;default:He(e,t,o,l,a,null)}bg(e,r,n,i);return;case"option":for(c in a)a.hasOwnProperty(c)&&(r=a[c],r!=null)&&(c==="selected"?e.selected=r&&typeof r!="function"&&typeof r!="symbol":He(e,t,c,r,a,null));return;case"dialog":xe("beforetoggle",e),xe("toggle",e),xe("cancel",e),xe("close",e);break;case"iframe":case"object":xe("load",e);break;case"video":case"audio":for(r=0;r<Eo.length;r++)xe(Eo[r],e);break;case"image":xe("error",e),xe("load",e);break;case"details":xe("toggle",e);break;case"embed":case"source":case"link":xe("error",e),xe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(p in a)if(a.hasOwnProperty(p)&&(r=a[p],r!=null))switch(p){case"children":case"dangerouslySetInnerHTML":throw Error(D(137,t));default:He(e,t,p,r,a,null)}return;default:if(up(t)){for(f in a)a.hasOwnProperty(f)&&(r=a[f],r!==void 0&&Ku(e,t,f,r,a,void 0));return}}for(l in a)a.hasOwnProperty(l)&&(r=a[l],r!=null&&He(e,t,l,r,a,null))}function Ky(e,t,a,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,i=null,o=null,l=null,c=null,p=null,f=null;for(h in a){var v=a[h];if(a.hasOwnProperty(h)&&v!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":c=v;default:r.hasOwnProperty(h)||He(e,t,h,null,r,v)}}for(var m in r){var h=r[m];if(v=a[m],r.hasOwnProperty(m)&&(h!=null||v!=null))switch(m){case"type":i=h;break;case"name":n=h;break;case"checked":p=h;break;case"defaultChecked":f=h;break;case"value":o=h;break;case"defaultValue":l=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(D(137,t));break;default:h!==v&&He(e,t,m,h,r,v)}}wu(e,o,l,c,p,f,i,n);return;case"select":h=o=l=m=null;for(i in a)if(c=a[i],a.hasOwnProperty(i)&&c!=null)switch(i){case"value":break;case"multiple":h=c;default:r.hasOwnProperty(i)||He(e,t,i,null,r,c)}for(n in r)if(i=r[n],c=a[n],r.hasOwnProperty(n)&&(i!=null||c!=null))switch(n){case"value":m=i;break;case"defaultValue":l=i;break;case"multiple":o=i;default:i!==c&&He(e,t,n,i,r,c)}t=l,a=o,r=h,m!=null?Ii(e,!!a,m,!1):!!r!=!!a&&(t!=null?Ii(e,!!a,t,!0):Ii(e,!!a,a?[]:"",!1));return;case"textarea":h=m=null;for(l in a)if(n=a[l],a.hasOwnProperty(l)&&n!=null&&!r.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:He(e,t,l,null,r,n)}for(o in r)if(n=r[o],i=a[o],r.hasOwnProperty(o)&&(n!=null||i!=null))switch(o){case"value":m=n;break;case"defaultValue":h=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(D(91));break;default:n!==i&&He(e,t,o,n,r,i)}hg(e,m,h);return;case"option":for(var w in a)m=a[w],a.hasOwnProperty(w)&&m!=null&&!r.hasOwnProperty(w)&&(w==="selected"?e.selected=!1:He(e,t,w,null,r,m));for(c in r)m=r[c],h=a[c],r.hasOwnProperty(c)&&m!==h&&(m!=null||h!=null)&&(c==="selected"?e.selected=m&&typeof m!="function"&&typeof m!="symbol":He(e,t,c,m,r,h));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var E in a)m=a[E],a.hasOwnProperty(E)&&m!=null&&!r.hasOwnProperty(E)&&He(e,t,E,null,r,m);for(p in r)if(m=r[p],h=a[p],r.hasOwnProperty(p)&&m!==h&&(m!=null||h!=null))switch(p){case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(D(137,t));break;default:He(e,t,p,m,r,h)}return;default:if(up(t)){for(var U in a)m=a[U],a.hasOwnProperty(U)&&m!==void 0&&!r.hasOwnProperty(U)&&Ku(e,t,U,void 0,r,m);for(f in r)m=r[f],h=a[f],!r.hasOwnProperty(f)||m===h||m===void 0&&h===void 0||Ku(e,t,f,m,r,h);return}}for(var d in a)m=a[d],a.hasOwnProperty(d)&&m!=null&&!r.hasOwnProperty(d)&&He(e,t,d,null,r,m);for(v in r)m=r[v],h=a[v],!r.hasOwnProperty(v)||m===h||m==null&&h==null||He(e,t,v,m,r,h)}function Af(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Jy(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var n=a[r],i=n.transferSize,o=n.initiatorType,l=n.duration;if(i&&l&&Af(o)){for(o=0,l=n.responseEnd,r+=1;r<a.length;r++){var c=a[r],p=c.startTime;if(p>l)break;var f=c.transferSize,v=c.initiatorType;f&&Af(v)&&(c=c.responseEnd,o+=f*(c<l?1:(l-p)/(c-p)))}if(--r,t+=8*(i+o)/(n.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Ju=null,Pu=null;function fs(e){return e.nodeType===9?e:e.ownerDocument}function Rf(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function xb(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Fu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var lu=null;function Py(){var e=window.event;return e&&e.type==="popstate"?e===lu?!1:(lu=e,!0):(lu=null,!1)}var kb=typeof setTimeout=="function"?setTimeout:void 0,Fy=typeof clearTimeout=="function"?clearTimeout:void 0,Uf=typeof Promise=="function"?Promise:void 0,Iy=typeof queueMicrotask=="function"?queueMicrotask:typeof Uf<"u"?function(e){return Uf.resolve(null).then(e).catch(Wy)}:kb;function Wy(e){setTimeout(function(){throw e})}function Xr(e){return e==="head"}function Df(e,t){var a=t,r=0;do{var n=a.nextSibling;if(e.removeChild(a),n&&n.nodeType===8)if(a=n.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(n),gn(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")vo(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,vo(a);for(var i=a.firstChild;i;){var o=i.nextSibling,l=i.nodeName;i[Oo]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&i.rel.toLowerCase()==="stylesheet"||a.removeChild(i),i=o}}else a==="body"&&vo(e.ownerDocument.body);a=n}while(a);gn(t)}function Bf(e,t){var a=e;e=0;do{var r=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=r}while(a)}function Iu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Iu(a),cp(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function e1(e,t,a,r){for(;e.nodeType===1;){var n=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Oo])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==n.rel||e.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute("title")!==(n.title==null?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=ya(e.nextSibling),e===null)break}return null}function t1(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=ya(e.nextSibling),e===null))return null;return e}function Nb(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ya(e.nextSibling),e===null))return null;return e}function Wu(e){return e.data==="$?"||e.data==="$~"}function ep(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function a1(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var r=function(){t(),a.removeEventListener("DOMContentLoaded",r)};a.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function ya(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var tp=null;function Of(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return ya(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Lf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Sb(e,t,a){switch(t=fs(a),e){case"html":if(e=t.documentElement,!e)throw Error(D(452));return e;case"head":if(e=t.head,!e)throw Error(D(453));return e;case"body":if(e=t.body,!e)throw Error(D(454));return e;default:throw Error(D(451))}}function vo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);cp(e)}var _a=new Map,Hf=new Set;function gs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ur=Ae.d;Ae.d={f:r1,r:i1,D:n1,C:o1,L:l1,m:s1,X:u1,S:c1,M:p1};function r1(){var e=ur.f(),t=As();return e||t}function i1(e){var t=bn(e);t!==null&&t.tag===5&&t.type==="form"?vh(t):ur.r(e)}var _n=typeof document>"u"?null:document;function Cb(e,t,a){var r=_n;if(r&&typeof t=="string"&&t){var n=ha(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof a=="string"&&(n+='[crossorigin="'+a+'"]'),Hf.has(n)||(Hf.add(n),e={rel:e,crossOrigin:a,href:t},r.querySelector(n)===null&&(t=r.createElement("link"),qt(t,"link",e),vt(t),r.head.appendChild(t)))}}function n1(e){ur.D(e),Cb("dns-prefetch",e,null)}function o1(e,t){ur.C(e,t),Cb("preconnect",e,t)}function l1(e,t,a){ur.L(e,t,a);var r=_n;if(r&&e&&t){var n='link[rel="preload"][as="'+ha(t)+'"]';t==="image"&&a&&a.imageSrcSet?(n+='[imagesrcset="'+ha(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(n+='[imagesizes="'+ha(a.imageSizes)+'"]')):n+='[href="'+ha(e)+'"]';var i=n;switch(t){case"style":i=fn(e);break;case"script":i=xn(e)}_a.has(i)||(e=Fe({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),_a.set(i,e),r.querySelector(n)!==null||t==="style"&&r.querySelector(Yo(i))||t==="script"&&r.querySelector(Xo(i))||(t=r.createElement("link"),qt(t,"link",e),vt(t),r.head.appendChild(t)))}}function s1(e,t){ur.m(e,t);var a=_n;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+ha(r)+'"][href="'+ha(e)+'"]',i=n;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=xn(e)}if(!_a.has(i)&&(e=Fe({rel:"modulepreload",href:e},t),_a.set(i,e),a.querySelector(n)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Xo(i)))return}r=a.createElement("link"),qt(r,"link",e),vt(r),a.head.appendChild(r)}}}function c1(e,t,a){ur.S(e,t,a);var r=_n;if(r&&e){var n=Fi(r).hoistableStyles,i=fn(e);t=t||"default";var o=n.get(i);if(!o){var l={loading:0,preload:null};if(o=r.querySelector(Yo(i)))l.loading=5;else{e=Fe({rel:"stylesheet",href:e,"data-precedence":t},a),(a=_a.get(i))&&Kp(e,a);var c=o=r.createElement("link");vt(c),qt(c,"link",e),c._p=new Promise(function(p,f){c.onload=p,c.onerror=f}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Gl(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:l},n.set(i,o)}}}function u1(e,t){ur.X(e,t);var a=_n;if(a&&e){var r=Fi(a).hoistableScripts,n=xn(e),i=r.get(n);i||(i=a.querySelector(Xo(n)),i||(e=Fe({src:e,async:!0},t),(t=_a.get(n))&&Jp(e,t),i=a.createElement("script"),vt(i),qt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(n,i))}}function p1(e,t){ur.M(e,t);var a=_n;if(a&&e){var r=Fi(a).hoistableScripts,n=xn(e),i=r.get(n);i||(i=a.querySelector(Xo(n)),i||(e=Fe({src:e,async:!0,type:"module"},t),(t=_a.get(n))&&Jp(e,t),i=a.createElement("script"),vt(i),qt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(n,i))}}function jf(e,t,a,r){var n=(n=Tr.current)?gs(n):null;if(!n)throw Error(D(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=fn(a.href),a=Fi(n).hoistableStyles,r=a.get(t),r||(r={type:"style",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=fn(a.href);var i=Fi(n).hoistableStyles,o=i.get(e);if(o||(n=n.ownerDocument||n,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,o),(i=n.querySelector(Yo(e)))&&!i._p&&(o.instance=i,o.state.loading=5),_a.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},_a.set(e,a),i||d1(n,e,a,o.state))),t&&r===null)throw Error(D(528,""));return o}if(t&&r!==null)throw Error(D(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=xn(a),a=Fi(n).hoistableScripts,r=a.get(t),r||(r={type:"script",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(D(444,e))}}function fn(e){return'href="'+ha(e)+'"'}function Yo(e){return'link[rel="stylesheet"]['+e+"]"}function qb(e){return Fe({},e,{"data-precedence":e.precedence,precedence:null})}function d1(e,t,a,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),qt(t,"link",a),vt(t),e.head.appendChild(t))}function xn(e){return'[src="'+ha(e)+'"]'}function Xo(e){return"script[async]"+e}function Gf(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+ha(a.href)+'"]');if(r)return t.instance=r,vt(r),r;var n=Fe({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),vt(r),qt(r,"style",n),Gl(r,a.precedence,e),t.instance=r;case"stylesheet":n=fn(a.href);var i=e.querySelector(Yo(n));if(i)return t.state.loading|=4,t.instance=i,vt(i),i;r=qb(a),(n=_a.get(n))&&Kp(r,n),i=(e.ownerDocument||e).createElement("link"),vt(i);var o=i;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),qt(i,"link",r),t.state.loading|=4,Gl(i,a.precedence,e),t.instance=i;case"script":return i=xn(a.src),(n=e.querySelector(Xo(i)))?(t.instance=n,vt(n),n):(r=a,(n=_a.get(i))&&(r=Fe({},a),Jp(r,n)),e=e.ownerDocument||e,n=e.createElement("script"),vt(n),qt(n,"link",r),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(D(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Gl(r,a.precedence,e));return t.instance}function Gl(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=r.length?r[r.length-1]:null,i=n,o=0;o<r.length;o++){var l=r[o];if(l.dataset.precedence===t)i=l;else if(i!==n)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Kp(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Jp(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ql=null;function Qf(e,t,a){if(Ql===null){var r=new Map,n=Ql=new Map;n.set(a,r)}else n=Ql,r=n.get(a),r||(r=new Map,n.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),n=0;n<a.length;n++){var i=a[n];if(!(i[Oo]||i[Nt]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var o=i.getAttribute(t)||"";o=e+o;var l=r.get(o);l?l.push(i):r.set(o,[i])}}return r}function Yf(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function m1(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Eb(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function f1(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var n=fn(r.href),i=t.querySelector(Yo(n));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=hs.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=i,vt(i);return}i=t.ownerDocument||t,r=qb(r),(n=_a.get(n))&&Kp(r,n),i=i.createElement("link"),vt(i);var o=i;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),qt(i,"link",r),a.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=hs.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var su=0;function g1(e,t){return e.stylesheets&&e.count===0&&Yl(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&Yl(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&su===0&&(su=62500*Jy());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Yl(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>su?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(n)}}:null}function hs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var bs=null;function Yl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,bs=new Map,t.forEach(h1,e),bs=null,hs.call(e))}function h1(e,t){if(!(t.state.loading&4)){var a=bs.get(e);if(a)var r=a.get(null);else{a=new Map,bs.set(e,a);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<n.length;i++){var o=n[i];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(a.set(o.dataset.precedence,o),r=o)}r&&a.set(null,r)}n=t.instance,o=n.getAttribute("data-precedence"),i=a.get(o)||r,i===r&&a.set(null,n),a.set(o,n),this.count++,r=hs.bind(this),n.addEventListener("load",r),n.addEventListener("error",r),i?i.parentNode.insertBefore(n,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var To={$$typeof:Wa,Provider:null,Consumer:null,_currentValue:ti,_currentValue2:ti,_threadCount:0};function b1(e,t,a,r,n,i,o,l,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Uc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Uc(0),this.hiddenUpdates=Uc(null),this.identifierPrefix=r,this.onUncaughtError=n,this.onCaughtError=i,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function Mb(e,t,a,r,n,i,o,l,c,p,f,v){return e=new b1(e,t,a,o,c,p,f,v,l),t=1,i===!0&&(t|=24),i=ea(3,null,null,t),e.current=i,i.stateNode=e,t=_p(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:r,isDehydrated:a,cache:t},Np(i),e}function Tb(e){return e?(e=Zi,e):Zi}function zb(e,t,a,r,n,i){n=Tb(n),r.context===null?r.context=n:r.pendingContext=n,r=Ar(t),r.payload={element:a},i=i===void 0?null:i,i!==null&&(r.callback=i),a=Rr(e,r,t),a!==null&&(Yt(a,e,t),co(a,e,t))}function Xf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Pp(e,t){Xf(e,t),(e=e.alternate)&&Xf(e,t)}function Ab(e){if(e.tag===13||e.tag===31){var t=fi(e,67108864);t!==null&&Yt(t,e,67108864),Pp(e,67108864)}}function $f(e){if(e.tag===13||e.tag===31){var t=na();t=lp(t);var a=fi(e,t);a!==null&&Yt(a,e,t),Pp(e,t)}}var vs=!0;function v1(e,t,a,r){var n=me.T;me.T=null;var i=Ae.p;try{Ae.p=2,Fp(e,t,a,r)}finally{Ae.p=i,me.T=n}}function w1(e,t,a,r){var n=me.T;me.T=null;var i=Ae.p;try{Ae.p=8,Fp(e,t,a,r)}finally{Ae.p=i,me.T=n}}function Fp(e,t,a,r){if(vs){var n=ap(r);if(n===null)ou(e,t,r,ws,a),Vf(e,r);else if(_1(n,e,t,a,r))r.stopPropagation();else if(Vf(e,r),t&4&&-1<y1.indexOf(e)){for(;n!==null;){var i=bn(n);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var o=Ir(i.pendingLanes);if(o!==0){var l=i;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var c=1<<31-ia(o);l.entanglements[1]|=c,o&=~c}ja(i),(ze&6)===0&&(ss=aa()+500,Qo(0,!1))}}break;case 31:case 13:l=fi(i,2),l!==null&&Yt(l,i,2),As(),Pp(i,2)}if(i=ap(r),i===null&&ou(e,t,r,ws,a),i===n)break;n=i}n!==null&&r.stopPropagation()}else ou(e,t,r,null,a)}}function ap(e){return e=pp(e),Ip(e)}var ws=null;function Ip(e){if(ws=null,e=Gi(e),e!==null){var t=Ro(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=If(t),e!==null)return e;e=null}else if(a===31){if(e=Wf(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ws=e,null}function Rb(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(l0()){case rg:return 2;case ig:return 8;case Kl:case s0:return 32;case ng:return 268435456;default:return 32}default:return 32}}var rp=!1,Br=null,Or=null,Lr=null,zo=new Map,Ao=new Map,Nr=[],y1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Vf(e,t){switch(e){case"focusin":case"focusout":Br=null;break;case"dragenter":case"dragleave":Or=null;break;case"mouseover":case"mouseout":Lr=null;break;case"pointerover":case"pointerout":zo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ao.delete(t.pointerId)}}function In(e,t,a,r,n,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:i,targetContainers:[n]},t!==null&&(t=bn(t),t!==null&&Ab(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function _1(e,t,a,r,n){switch(t){case"focusin":return Br=In(Br,e,t,a,r,n),!0;case"dragenter":return Or=In(Or,e,t,a,r,n),!0;case"mouseover":return Lr=In(Lr,e,t,a,r,n),!0;case"pointerover":var i=n.pointerId;return zo.set(i,In(zo.get(i)||null,e,t,a,r,n)),!0;case"gotpointercapture":return i=n.pointerId,Ao.set(i,In(Ao.get(i)||null,e,t,a,r,n)),!0}return!1}function Ub(e){var t=Gi(e.target);if(t!==null){var a=Ro(t);if(a!==null){if(t=a.tag,t===13){if(t=If(a),t!==null){e.blockedOn=t,Em(e.priority,function(){$f(a)});return}}else if(t===31){if(t=Wf(a),t!==null){e.blockedOn=t,Em(e.priority,function(){$f(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Xl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=ap(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);_u=r,a.target.dispatchEvent(r),_u=null}else return t=bn(a),t!==null&&Ab(t),e.blockedOn=a,!1;t.shift()}return!0}function Zf(e,t,a){Xl(e)&&a.delete(t)}function x1(){rp=!1,Br!==null&&Xl(Br)&&(Br=null),Or!==null&&Xl(Or)&&(Or=null),Lr!==null&&Xl(Lr)&&(Lr=null),zo.forEach(Zf),Ao.forEach(Zf)}function El(e,t){e.blockedOn===t&&(e.blockedOn=null,rp||(rp=!0,ft.unstable_scheduleCallback(ft.unstable_NormalPriority,x1)))}var Ml=null;function Kf(e){Ml!==e&&(Ml=e,ft.unstable_scheduleCallback(ft.unstable_NormalPriority,function(){Ml===e&&(Ml=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],n=e[t+2];if(typeof r!="function"){if(Ip(r||a)===null)continue;break}var i=bn(a);i!==null&&(e.splice(t,3),t-=3,Ou(i,{pending:!0,data:n,method:a.method,action:r},r,n))}}))}function gn(e){function t(c){return El(c,e)}Br!==null&&El(Br,e),Or!==null&&El(Or,e),Lr!==null&&El(Lr,e),zo.forEach(t),Ao.forEach(t);for(var a=0;a<Nr.length;a++){var r=Nr[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Nr.length&&(a=Nr[0],a.blockedOn===null);)Ub(a),a.blockedOn===null&&Nr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var n=a[r],i=a[r+1],o=n[Xt]||null;if(typeof i=="function")o||Kf(a);else if(o){var l=null;if(i&&i.hasAttribute("formAction")){if(n=i,o=i[Xt]||null)l=o.formAction;else if(Ip(n)!==null)continue}else l=o.action;typeof l=="function"?a[r+1]=l:(a.splice(r,3),r-=3),Kf(a)}}}function Db(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(o){return n=o})},focusReset:"manual",scroll:"manual"})}function t(){n!==null&&(n(),n=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,n=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),n!==null&&(n(),n=null)}}}function Wp(e){this._internalRoot=e}Ds.prototype.render=Wp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(D(409));var a=t.current,r=na();zb(a,r,e,t,null,null)};Ds.prototype.unmount=Wp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;zb(e.current,2,null,e,null,null),As(),t[hn]=null}};function Ds(e){this._internalRoot=e}Ds.prototype.unstable_scheduleHydration=function(e){if(e){var t=ug();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Nr.length&&t!==0&&t<Nr[a].priority;a++);Nr.splice(a,0,e),a===0&&Ub(e)}};var Jf=Pf.version;if(Jf!=="19.2.3")throw Error(D(527,Jf,"19.2.3"));Ae.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(D(188)):(e=Object.keys(e).join(","),Error(D(268,e)));return e=e0(t),e=e!==null?eg(e):null,e=e===null?null:e.stateNode,e};var k1={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:me,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Wn=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Wn.isDisabled&&Wn.supportsFiber))try{Uo=Wn.inject(k1),ra=Wn}catch{}var Wn;Bs.createRoot=function(e,t){if(!Ff(e))throw Error(D(299));var a=!1,r="",n=Ch,i=qh,o=Eh;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Mb(e,1,!1,null,null,a,r,null,n,i,o,Db),e[hn]=t.current,Zp(e),new Wp(t)};Bs.hydrateRoot=function(e,t,a){if(!Ff(e))throw Error(D(299));var r=!1,n="",i=Ch,o=qh,l=Eh,c=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onUncaughtError!==void 0&&(i=a.onUncaughtError),a.onCaughtError!==void 0&&(o=a.onCaughtError),a.onRecoverableError!==void 0&&(l=a.onRecoverableError),a.formState!==void 0&&(c=a.formState)),t=Mb(e,1,!0,t,a??null,r,n,c,i,o,l,Db),t.context=Tb(null),a=t.current,r=na(),r=lp(r),n=Ar(r),n.callback=null,Rr(a,n,r),a=r,t.current.lanes=a,Bo(t,a),ja(t),e[hn]=t.current,Zp(e),new Ds(t)};Bs.version="19.2.3"});var Hb=Ra((I_,Lb)=>{"use strict";function Ob(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ob)}catch(e){console.error(e)}}Ob(),Lb.exports=Bb()});var Tv=Ra(Hs=>{"use strict";var M1=Symbol.for("react.transitional.element"),T1=Symbol.for("react.fragment");function Mv(e,t,a){var r=null;if(a!==void 0&&(r=""+a),t.key!==void 0&&(r=""+t.key),"key"in t){a={};for(var n in t)n!=="key"&&(a[n]=t[n])}else a=t;return t=a.ref,{$$typeof:M1,type:e,key:r,ref:t!==void 0?t:null,props:a}}Hs.Fragment=T1;Hs.jsx=Mv;Hs.jsxs=Mv});var ie=Ra((kk,zv)=>{"use strict";zv.exports=Tv()});var xw=Y(Hb());var jb=`/* Every rule is scoped to .app-wrapper, the root of each widget, so nothing here styles
10
10
  the host page. Start new selectors with :where(.app-wrapper), which scopes without
11
11
  adding specificity, or with .app-wrapper for rules on the root itself. */
12
12
 
@@ -6714,11 +6714,11 @@ Error generating stack: `+r.message+`
6714
6714
  width: 100%;
6715
6715
  height: 100%;
6716
6716
  }
6717
- `;var ot=Y($e());var Os={};function Gb(e){Os=e}function hi(){return Os}function ed(){return!!Os.apiBaseUrl}var S1=e=>e.replace(/\/$/,"");function Vt(e){let t=Os.apiBaseUrl;return t?`${S1(t)}${e.replace(/^\/api\//,"/v1/")}`:e}var Qb="boq-session-id",Yb="x-boq-session";function Xb(){if(typeof window>"u")return"server";try{let e=window.localStorage.getItem(Qb);return e||(e=crypto.randomUUID(),window.localStorage.setItem(Qb,e)),e}catch{return crypto.randomUUID()}}var C1="x-boq-client";function Ls(){return hi().client}function pr(){let{client:e,apiKey:t}=hi();return ed()?t?{Authorization:`Bearer ${t}`}:{}:e?{[C1]:e}:{}}function bi(){return{...ed()?{}:{[Yb]:Xb()},...pr()}}function q1(e){return e&&typeof e=="object"&&e.success===!0&&"data"in e?e.data:e}async function la(e){return q1(await e.json().catch(()=>({})))}var $b=9e4;async function Vb(e,t){let a=new AbortController,r=setTimeout(()=>a.abort(),$b),n;try{n=await fetch(e,{...t,signal:a.signal})}catch(o){throw o?.name==="AbortError"?new Error(`Request to ${e} timed out after ${$b/1e3}s. Please try again.`):o}finally{clearTimeout(r)}let i=await la(n);if(!n.ok||i?.error){let o=i;throw new Error(o.detail??o.message??o.error??`Server error ${n.status}`)}return i}function Zb(e,t,a=!0){let r=new FormData;return r.append("file",e),t?.length&&r.append("provided_lines_json",JSON.stringify(t)),a||r.append("archive_source","false"),Vb(Vt("/api/schedule"),{method:"POST",body:r,headers:bi()})}function Kb(e,t){let a=t?`?account=${encodeURIComponent(t)}`:"";return Vb(Vt(`/api/schedule/${e}${a}`),{headers:pr()})}function Jb(e,t,a,r){let n=!1,i=null,o=performance.now();return{promise:new Promise((u,f)=>{let b=async()=>{if(!n)try{let d=await e();if(n)return;if(d.status==="completed"||d.status==="failed"){console.log(`[pollJob:${r??"job"}] ${d.status} (${Math.round(performance.now()-o)}ms)`),u(d);return}a?.(),i=setTimeout(b,t)}catch(d){n||f(d)}};i=setTimeout(b,t)}),cancel:()=>{n=!0,i&&(clearTimeout(i),i=null)}}}var sa=Y($e());var Pb=new URL("../assets/decking/boards/diagonal.webp",import.meta.url).href;var Fb=new URL("../assets/decking/boards/no-border.webp",import.meta.url).href;var Ib=new URL("../assets/decking/boards/picture-frame.webp",import.meta.url).href;var Wb=new URL("../assets/decking/boards/straight.webp",import.meta.url).href;var ev=new URL("../assets/fencing/gates/no-gate.webp",import.meta.url).href;var tv=new URL("../assets/fencing/gates/single-gate.webp",import.meta.url).href;var av=new URL("../assets/fencing/gravel-board.webp",import.meta.url).href;var rv=new URL("../assets/fencing/height/0.9.webp",import.meta.url).href;var iv=new URL("../assets/fencing/height/1.2.webp",import.meta.url).href;var nv=new URL("../assets/fencing/height/1.5.webp",import.meta.url).href;var ov=new URL("../assets/fencing/height/1.8.webp",import.meta.url).href;var lv=new URL("../assets/fencing/no-gravel-board.webp",import.meta.url).href;var sv=new URL("../assets/quick-order/paste-list.webp",import.meta.url).href;var cv=new URL("../assets/quick-order/photo-list.webp",import.meta.url).href;var pv=new URL("../assets/quick-order/upload-file.webp",import.meta.url).href;var uv=new URL("../assets/schedule-products/building-sand.webp",import.meta.url).href;var dv=new URL("../assets/schedule-products/drywall-screws.webp",import.meta.url).href;var mv=new URL("../assets/schedule-products/loft-insulation-roll.webp",import.meta.url).href;var fv=new URL("../assets/schedule-products/red-multi-stock-bricks.webp",import.meta.url).href;var gv=new URL("../assets/schedule-products/scrim-tape.webp",import.meta.url).href;var hv=new URL("../assets/schedule-products/wall-ties.webp",import.meta.url).href;var bv=new URL("../assets/tool-images/architrave.webp",import.meta.url).href;var vv=new URL("../assets/tool-images/brick-block.webp",import.meta.url).href;var wv=new URL("../assets/tool-images/concrete-aggregate.webp",import.meta.url).href;var yv=new URL("../assets/tool-images/decking.webp",import.meta.url).href;var _v=new URL("../assets/tool-images/fencing.webp",import.meta.url).href;var xv=new URL("../assets/tool-images/insulation.webp",import.meta.url).href;var kv=new URL("../assets/tool-images/paint.webp",import.meta.url).href;var Nv=new URL("../assets/tool-images/paving.webp",import.meta.url).href;var Sv=new URL("../assets/tool-images/plasterboard.webp",import.meta.url).href;var Cv=new URL("../assets/tool-images/skirting.webp",import.meta.url).href;var qv=new URL("../assets/tool-images/timber.webp",import.meta.url).href;var Ev=new URL("../assets/tool-images/truss.webp",import.meta.url).href;var Me=e=>typeof e=="string"?e:e.src,E1={"/decking/boards/diagonal.webp":Me(Pb),"/decking/boards/no-border.webp":Me(Fb),"/decking/boards/picture-frame.webp":Me(Ib),"/decking/boards/straight.webp":Me(Wb),"/fencing/gates/no-gate.webp":Me(ev),"/fencing/gates/single-gate.webp":Me(tv),"/fencing/gravel-board.webp":Me(av),"/fencing/height/0.9.webp":Me(rv),"/fencing/height/1.2.webp":Me(iv),"/fencing/height/1.5.webp":Me(nv),"/fencing/height/1.8.webp":Me(ov),"/fencing/no-gravel-board.webp":Me(lv),"/quick-order/paste-list.webp":Me(sv),"/quick-order/photo-list.webp":Me(cv),"/quick-order/upload-file.webp":Me(pv),"/schedule-products/building-sand.webp":Me(uv),"/schedule-products/drywall-screws.webp":Me(dv),"/schedule-products/loft-insulation-roll.webp":Me(mv),"/schedule-products/red-multi-stock-bricks.webp":Me(fv),"/schedule-products/scrim-tape.webp":Me(gv),"/schedule-products/wall-ties.webp":Me(hv),"/tool-images/architrave.webp":Me(bv),"/tool-images/brick-block.webp":Me(vv),"/tool-images/concrete-aggregate.webp":Me(wv),"/tool-images/decking.webp":Me(yv),"/tool-images/fencing.webp":Me(_v),"/tool-images/insulation.webp":Me(xv),"/tool-images/paint.webp":Me(kv),"/tool-images/paving.webp":Me(Nv),"/tool-images/plasterboard.webp":Me(Sv),"/tool-images/skirting.webp":Me(Cv),"/tool-images/timber.webp":Me(qv),"/tool-images/truss.webp":Me(Ev)};function Zt(e){return E1[e]??e}var td=Y(re());function Bt(){return(0,td.jsx)("svg",{className:"forward-arrow",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,td.jsx)("path",{d:"M3 8H13M13 8L9 4M13 8L9 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var ad=Y(re());function $o(){return(0,ad.jsx)("svg",{className:"close-icon",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,ad.jsx)("path",{d:"M3.5 3.5L12.5 12.5M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}var kn={schedule:[".xlsx",".xls",".csv",".pdf",".docx"],photo:[".png",".jpg",".jpeg",".webp",".gif",".bmp",".heic",".heif"],email:[".eml",".msg"]};var Rv=(e,t)=>kn[t].some(a=>e.toLowerCase().endsWith(a)),Nn=e=>e.type.startsWith("image/")||Rv(e.name,"photo"),z1=e=>Nn(e)||Rv(e.name,"schedule"),Av=e=>`${Math.max(.1,Math.round(e/1048576*10)/10)} MB`;function rd(e,t=5242880){return z1(e)?e.size===0?"That file is empty.":e.size>t?`That file is ${Av(e.size)} - the limit is ${Av(t)}.`:null:`Please upload a list or image file (${[...kn.schedule,...kn.photo].join(", ")}).`}var A1=e=>e.split(`
6718
- `).map(t=>t.trim()).filter(Boolean);function Uv(e){let t=A1(e);if(t.length>500)return`That's ${t.length} lines - the limit is 500. Split the list and match it in parts.`;if(e.length>5e4)return`That's ${e.length.toLocaleString("en-GB")} characters - the limit is ${5e4.toLocaleString("en-GB")}. Split the list and match it in parts.`;let a=t.findIndex(r=>r.length>500);return a>=0?`Line ${a+1} is ${t[a].length} characters - keep each item on its own line (max 500).`:null}async function Dv(e){if(e.size<=5242880)return e;let t;try{t=await createImageBitmap(e)}catch{return e}let a=Math.min(1,2e3/Math.max(t.width,t.height)),r=document.createElement("canvas");r.width=Math.round(t.width*a),r.height=Math.round(t.height*a);let n=r.getContext("2d");if(!n)return e;n.fillStyle="#fff",n.fillRect(0,0,r.width,r.height),n.drawImage(t,0,0,r.width,r.height),t.close();let i=await new Promise(o=>r.toBlob(o,"image/jpeg",.85));return!i||i.size>=e.size?e:new File([i],`${e.name.replace(/\.[^.]+$/,"")}.jpg`,{type:"image/jpeg"})}var $r=Y($e());var Gs=Y($e()),js=Y(re()),R1=[4,5,4],id=4e3;function ur(){let[e,t]=(0,Gs.useState)(0);(0,Gs.useEffect)(()=>{let r=setInterval(()=>t(n=>n+1),id);return()=>clearInterval(r)},[]);let a=0;return(0,js.jsx)("div",{className:"brick-wall","aria-hidden":!0,children:R1.map((r,n)=>(0,js.jsx)("div",{className:"brick-wall__course",children:Array.from({length:r},(i,o)=>(0,js.jsx)("span",{className:`brick-wall__brick${r===5&&(o===0||o===4)?" brick-wall__brick--half":""}`,style:{"--i":a++}},o))},n))},e)}var Vo=Y(re()),Qs=["Measuring twice, quoting once","Counting bricks so you don't have to","Haggling with the price of timber","Adding a bit extra for the skip","Double-checking nobody ordered too much sand","Rounding up, obviously","Making sure the numbers add up better than the last lot did","Checking if copper pipe is still worth its weight in gold","Squeezing a bit more accuracy out of the numbers","Totting it all up on the back of a fag packet, digitally","Making sure the quote is tighter than your tolerances","Nearly there, unlike most site schedules","Working out if it'll all fit on one pallet","Double-checking the VAT, because someone has to","Giving the calculator a proper workout","Making sure nothing's out of stock before you get excited"];function Bv(e){let t=[...e];for(let a=t.length-1;a>0;a--){let r=Math.floor(Math.random()*(a+1));[t[a],t[r]]=[t[r],t[a]]}return t}function Ov(){let e=(0,$r.useRef)(Bv(Qs.map((o,l)=>l))),t=(0,$r.useRef)(0),[a,r]=(0,$r.useState)(Qs[e.current[0]]),[n,i]=(0,$r.useState)(!0);return(0,$r.useEffect)(()=>{let o=setInterval(()=>{i(!1),window.setTimeout(()=>{t.current++,t.current>=e.current.length&&(e.current=Bv(Qs.map((l,c)=>c)),t.current=0),r(Qs[e.current[t.current]]),i(!0)},600)},id);return()=>clearInterval(o)},[]),(0,Vo.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",children:[(0,Vo.jsx)(ur,{}),(0,Vo.jsx)("p",{className:`banter-message${n?" is-visible":""}`,children:a})]})}var ee=Y(re()),U1=[...kn.schedule,...kn.photo].join(","),D1={paste:[{title:"Paste List",desc:"Paste your material list straight from a spreadsheet or document."},{title:"Check Matches",desc:"Review the suggested products and adjust any that need changing."},{title:"Review Quote",desc:"Review the matched materials for your quote."}],upload:[{title:"Upload File",desc:"Upload a photo, spreadsheet, Word document or PDF."},{title:"Check Matches",desc:"Review the suggested products and adjust any that need changing."},{title:"Review Quote",desc:"Review the matched materials for your quote."}]};function nd({onPasteSchedule:e,onUploadSchedule:t,onEntryModeChange:a}){let[r,n]=(0,sa.useState)(null),[i,o]=(0,sa.useState)(""),[l,c]=(0,sa.useState)(null),[u,f]=(0,sa.useState)(""),[b,d]=(0,sa.useState)(!1),[h,w]=(0,sa.useState)(!1),[E,U]=(0,sa.useState)(null),m=(0,sa.useRef)(0),p=(0,sa.useRef)(null),g=i.split(`
6719
- `).filter(X=>X.trim()).length,v=Uv(i),N=r==="paste"?!!i:!!l;(0,sa.useEffect)(()=>{if(!l||!Nn(l)){U(null);return}let X=URL.createObjectURL(l);return U(X),()=>URL.revokeObjectURL(X)},[l]);let T=X=>{n(X),a(null)},M=()=>{n(null),a(null)},R=X=>{if(!X?.length)return;if(X.length>1)return f("Please choose one file at a time.");let K=X[0],Z=rd(K,Nn(K)?1/0:void 0);if(Z)return f(Z);f(""),c(K)},j=async X=>{d(!0);try{await X()}finally{d(!1)}},W=async X=>{try{let K=await Dv(X),Z=rd(K);if(Z)throw new Error(Z);let ue=new FormData;ue.append("file",K);let Te=await fetch(Vt("/api/schedule/extract-photo"),{method:"POST",body:ue,headers:pr()}),pe=await la(Te);if(!Te.ok)throw new Error(pe?.error||pe?.message||"Failed to extract line items from image");let De=typeof pe?.text=="string"?pe.text.trim():"";if(!De)throw new Error("No line items were extracted from this image.");let Qe=Array.isArray(pe?.lines)?pe.lines.filter(ct=>!!(ct&&typeof ct=="object"&&typeof ct.text=="string")):void 0;await e(De,Qe,!1)}catch(K){f(K?.message||"Failed to extract line items from image")}},ye=()=>{if(l)return j(()=>Nn(l)?W(l):t(l))},Ce=X=>X.dataTransfer.types.includes("Files"),He=X=>{Ce(X)&&(X.preventDefault(),m.current+=1,w(!0))},We=X=>{Ce(X)&&(m.current-=1,m.current<=0&&(m.current=0,w(!1)))},ze=X=>{Ce(X)&&(X.preventDefault(),m.current=0,w(!1),R(X.dataTransfer.files),T("upload"))};return(0,ee.jsxs)("div",{className:"wizard-step entry-stage",onDragEnter:He,onDragOver:X=>Ce(X)&&X.preventDefault(),onDragLeave:We,onDrop:ze,children:[h&&(0,ee.jsx)("div",{className:"entry-drop-overlay","aria-hidden":"true",children:"Drop your file to upload"}),(0,ee.jsxs)("div",{className:"quick-order-card",children:[(0,ee.jsxs)("div",{className:"quick-order-alt",children:[(0,ee.jsxs)("div",{className:"quick-order-entry-copy",children:[(0,ee.jsx)("div",{className:"quick-order-alt-title",children:"How would you like to get started?"}),(0,ee.jsx)("p",{className:"quick-order-alt-intro",children:"Upload a file or type a list of items and quantities. We'll match them to our products and help you build a quote."})]}),(0,ee.jsxs)("div",{className:"entry-options entry-options--workflow entry-options--two",children:[(0,ee.jsxs)("button",{type:"button",className:`entry-option-card entry-option-card--paste${r==="paste"?" entry-option-card--active":""}`,onClick:()=>T("paste"),children:[(0,ee.jsxs)("span",{className:"entry-option-content",children:[(0,ee.jsx)("span",{className:"entry-option-title",children:"Type or paste a list"}),(0,ee.jsx)("span",{className:"entry-option-desc",children:"Enter your materials and quantities"})]}),(0,ee.jsx)("span",{className:"entry-option-media entry-option-media--paste","aria-hidden":"true",children:(0,ee.jsx)("img",{className:"fill-img",src:Zt("/quick-order/paste-list.webp"),alt:""})})]}),(0,ee.jsxs)("button",{type:"button",className:`entry-option-card entry-option-card--upload${r==="upload"?" entry-option-card--active":""}`,onClick:()=>T("upload"),children:[(0,ee.jsxs)("span",{className:"entry-option-content",children:[(0,ee.jsx)("span",{className:"entry-option-title",children:"Upload a file"}),(0,ee.jsx)("span",{className:"entry-option-desc",children:"A photo, spreadsheet, Word document or PDF"})]}),(0,ee.jsx)("span",{className:"entry-option-media entry-option-media--upload","aria-hidden":"true",children:(0,ee.jsx)("img",{className:"fill-img",src:Zt("/quick-order/photo-list.webp"),alt:""})})]})]})]}),r&&(0,ee.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"quick-order-workflow-title",onClick:()=>!N&&M(),children:(0,ee.jsxs)("section",{className:`quick-order-workflow-modal${b?" quick-order-workflow-modal--matching":""}`,onClick:X=>X.stopPropagation(),children:[(0,ee.jsxs)("header",{className:"quick-order-workflow-modal-header",children:[(0,ee.jsx)("h2",{id:"quick-order-workflow-title",children:r==="paste"?"Type or paste a list":"Upload a file"}),(0,ee.jsx)("button",{type:"button",className:"quick-order-workflow-close",onClick:M,"aria-label":"Close",children:(0,ee.jsx)($o,{})})]}),(0,ee.jsxs)("div",{className:"quick-order-panel",children:[(0,ee.jsxs)("div",{className:"quick-order-body","aria-hidden":b,children:[(0,ee.jsx)("div",{className:"quick-order-body-main",children:r==="paste"?(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)("textarea",{className:"paste-textarea",placeholder:`Paste your line items here, one per line, e.g.
6717
+ `;var nt=Y(Xe());var Os={};function Gb(e){Os=e}function hi(){return Os}function ed(){return!!Os.apiBaseUrl}var S1=e=>e.replace(/\/$/,"");function Bt(e){let t=Os.apiBaseUrl;return t?`${S1(t)}${e.replace(/^\/api\//,"/v1/")}`:e}var Qb="boq-session-id",Yb="x-boq-session";function Xb(){if(typeof window>"u")return"server";try{let e=window.localStorage.getItem(Qb);return e||(e=crypto.randomUUID(),window.localStorage.setItem(Qb,e)),e}catch{return crypto.randomUUID()}}var C1="x-boq-client";function Ls(){return hi().client}function Ga(){let{client:e,apiKey:t}=hi();return ed()?t?{Authorization:`Bearer ${t}`}:{}:e?{[C1]:e}:{}}function bi(){return{...ed()?{}:{[Yb]:Xb()},...Ga()}}function q1(e){return e&&typeof e=="object"&&e.success===!0&&"data"in e?e.data:e}async function Vt(e){return q1(await e.json().catch(()=>({})))}var $b=9e4;async function Vb(e,t){let a=new AbortController,r=setTimeout(()=>a.abort(),$b),n;try{n=await fetch(e,{...t,signal:a.signal})}catch(o){throw o?.name==="AbortError"?new Error(`Request to ${e} timed out after ${$b/1e3}s. Please try again.`):o}finally{clearTimeout(r)}let i=await Vt(n);if(!n.ok||i?.error){let o=i;throw new Error(o.detail??o.message??o.error??`Server error ${n.status}`)}return i}function Zb(e,t,a=!0){let r=new FormData;return r.append("file",e),t?.length&&r.append("provided_lines_json",JSON.stringify(t)),a||r.append("archive_source","false"),Vb(Bt("/api/schedule"),{method:"POST",body:r,headers:bi()})}function Kb(e,t){let a=t?`?account=${encodeURIComponent(t)}`:"";return Vb(Bt(`/api/schedule/${e}${a}`),{headers:Ga()})}function Jb(e,t,a,r){let n=!1,i=null,o=performance.now();return{promise:new Promise((p,f)=>{let v=async()=>{if(!n)try{let m=await e();if(n)return;if(m.status==="completed"||m.status==="failed"){console.log(`[pollJob:${r??"job"}] ${m.status} (${Math.round(performance.now()-o)}ms)`),p(m);return}a?.(),i=setTimeout(v,t)}catch(m){n||f(m)}};i=setTimeout(v,t)}),cancel:()=>{n=!0,i&&(clearTimeout(i),i=null)}}}var sa=Y(Xe());var Pb=new URL("../assets/decking/boards/diagonal.webp",import.meta.url).href;var Fb=new URL("../assets/decking/boards/no-border.webp",import.meta.url).href;var Ib=new URL("../assets/decking/boards/picture-frame.webp",import.meta.url).href;var Wb=new URL("../assets/decking/boards/straight.webp",import.meta.url).href;var ev=new URL("../assets/fencing/gates/no-gate.webp",import.meta.url).href;var tv=new URL("../assets/fencing/gates/single-gate.webp",import.meta.url).href;var av=new URL("../assets/fencing/gravel-board.webp",import.meta.url).href;var rv=new URL("../assets/fencing/height/0.9.webp",import.meta.url).href;var iv=new URL("../assets/fencing/height/1.2.webp",import.meta.url).href;var nv=new URL("../assets/fencing/height/1.5.webp",import.meta.url).href;var ov=new URL("../assets/fencing/height/1.8.webp",import.meta.url).href;var lv=new URL("../assets/fencing/no-gravel-board.webp",import.meta.url).href;var sv=new URL("../assets/quick-order/paste-list.webp",import.meta.url).href;var cv=new URL("../assets/quick-order/photo-list.webp",import.meta.url).href;var uv=new URL("../assets/quick-order/upload-file.webp",import.meta.url).href;var pv=new URL("../assets/schedule-products/building-sand.webp",import.meta.url).href;var dv=new URL("../assets/schedule-products/drywall-screws.webp",import.meta.url).href;var mv=new URL("../assets/schedule-products/loft-insulation-roll.webp",import.meta.url).href;var fv=new URL("../assets/schedule-products/red-multi-stock-bricks.webp",import.meta.url).href;var gv=new URL("../assets/schedule-products/scrim-tape.webp",import.meta.url).href;var hv=new URL("../assets/schedule-products/wall-ties.webp",import.meta.url).href;var bv=new URL("../assets/tool-images/architrave.webp",import.meta.url).href;var vv=new URL("../assets/tool-images/brick-block.webp",import.meta.url).href;var wv=new URL("../assets/tool-images/concrete-aggregate.webp",import.meta.url).href;var yv=new URL("../assets/tool-images/decking.webp",import.meta.url).href;var _v=new URL("../assets/tool-images/fencing.webp",import.meta.url).href;var xv=new URL("../assets/tool-images/insulation.webp",import.meta.url).href;var kv=new URL("../assets/tool-images/paint.webp",import.meta.url).href;var Nv=new URL("../assets/tool-images/paving.webp",import.meta.url).href;var Sv=new URL("../assets/tool-images/plasterboard.webp",import.meta.url).href;var Cv=new URL("../assets/tool-images/skirting.webp",import.meta.url).href;var qv=new URL("../assets/tool-images/timber.webp",import.meta.url).href;var Ev=new URL("../assets/tool-images/truss.webp",import.meta.url).href;var Me=e=>typeof e=="string"?e:e.src,E1={"/decking/boards/diagonal.webp":Me(Pb),"/decking/boards/no-border.webp":Me(Fb),"/decking/boards/picture-frame.webp":Me(Ib),"/decking/boards/straight.webp":Me(Wb),"/fencing/gates/no-gate.webp":Me(ev),"/fencing/gates/single-gate.webp":Me(tv),"/fencing/gravel-board.webp":Me(av),"/fencing/height/0.9.webp":Me(rv),"/fencing/height/1.2.webp":Me(iv),"/fencing/height/1.5.webp":Me(nv),"/fencing/height/1.8.webp":Me(ov),"/fencing/no-gravel-board.webp":Me(lv),"/quick-order/paste-list.webp":Me(sv),"/quick-order/photo-list.webp":Me(cv),"/quick-order/upload-file.webp":Me(uv),"/schedule-products/building-sand.webp":Me(pv),"/schedule-products/drywall-screws.webp":Me(dv),"/schedule-products/loft-insulation-roll.webp":Me(mv),"/schedule-products/red-multi-stock-bricks.webp":Me(fv),"/schedule-products/scrim-tape.webp":Me(gv),"/schedule-products/wall-ties.webp":Me(hv),"/tool-images/architrave.webp":Me(bv),"/tool-images/brick-block.webp":Me(vv),"/tool-images/concrete-aggregate.webp":Me(wv),"/tool-images/decking.webp":Me(yv),"/tool-images/fencing.webp":Me(_v),"/tool-images/insulation.webp":Me(xv),"/tool-images/paint.webp":Me(kv),"/tool-images/paving.webp":Me(Nv),"/tool-images/plasterboard.webp":Me(Sv),"/tool-images/skirting.webp":Me(Cv),"/tool-images/timber.webp":Me(qv),"/tool-images/truss.webp":Me(Ev)};function Zt(e){return E1[e]??e}var td=Y(ie());function Ot(){return(0,td.jsx)("svg",{className:"forward-arrow",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,td.jsx)("path",{d:"M3 8H13M13 8L9 4M13 8L9 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var ad=Y(ie());function $o(){return(0,ad.jsx)("svg",{className:"close-icon",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,ad.jsx)("path",{d:"M3.5 3.5L12.5 12.5M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}var kn={schedule:[".xlsx",".xls",".csv",".pdf",".docx"],photo:[".png",".jpg",".jpeg",".webp",".gif",".bmp",".heic",".heif"],email:[".eml",".msg"]};var Rv=(e,t)=>kn[t].some(a=>e.toLowerCase().endsWith(a)),Nn=e=>e.type.startsWith("image/")||Rv(e.name,"photo"),z1=e=>Nn(e)||Rv(e.name,"schedule"),Av=e=>`${Math.max(.1,Math.round(e/1048576*10)/10)} MB`;function rd(e,t=5242880){return z1(e)?e.size===0?"That file is empty.":e.size>t?`That file is ${Av(e.size)} - the limit is ${Av(t)}.`:null:`Please upload a list or image file (${[...kn.schedule,...kn.photo].join(", ")}).`}var A1=e=>e.split(`
6718
+ `).map(t=>t.trim()).filter(Boolean);function Uv(e){let t=A1(e);if(t.length>500)return`That's ${t.length} lines - the limit is 500. Split the list and match it in parts.`;if(e.length>5e4)return`That's ${e.length.toLocaleString("en-GB")} characters - the limit is ${5e4.toLocaleString("en-GB")}. Split the list and match it in parts.`;let a=t.findIndex(r=>r.length>500);return a>=0?`Line ${a+1} is ${t[a].length} characters - keep each item on its own line (max 500).`:null}async function Dv(e){if(e.size<=5242880)return e;let t;try{t=await createImageBitmap(e)}catch{return e}let a=Math.min(1,2e3/Math.max(t.width,t.height)),r=document.createElement("canvas");r.width=Math.round(t.width*a),r.height=Math.round(t.height*a);let n=r.getContext("2d");if(!n)return e;n.fillStyle="#fff",n.fillRect(0,0,r.width,r.height),n.drawImage(t,0,0,r.width,r.height),t.close();let i=await new Promise(o=>r.toBlob(o,"image/jpeg",.85));return!i||i.size>=e.size?e:new File([i],`${e.name.replace(/\.[^.]+$/,"")}.jpg`,{type:"image/jpeg"})}var $r=Y(Xe());var Gs=Y(Xe()),js=Y(ie()),R1=[4,5,4],id=4e3;function pr(){let[e,t]=(0,Gs.useState)(0);(0,Gs.useEffect)(()=>{let r=setInterval(()=>t(n=>n+1),id);return()=>clearInterval(r)},[]);let a=0;return(0,js.jsx)("div",{className:"brick-wall","aria-hidden":!0,children:R1.map((r,n)=>(0,js.jsx)("div",{className:"brick-wall__course",children:Array.from({length:r},(i,o)=>(0,js.jsx)("span",{className:`brick-wall__brick${r===5&&(o===0||o===4)?" brick-wall__brick--half":""}`,style:{"--i":a++}},o))},n))},e)}var Vo=Y(ie()),Qs=["Measuring twice, quoting once","Counting bricks so you don't have to","Haggling with the price of timber","Adding a bit extra for the skip","Double-checking nobody ordered too much sand","Rounding up, obviously","Making sure the numbers add up better than the last lot did","Checking if copper pipe is still worth its weight in gold","Squeezing a bit more accuracy out of the numbers","Totting it all up on the back of a fag packet, digitally","Making sure the quote is tighter than your tolerances","Nearly there, unlike most site schedules","Working out if it'll all fit on one pallet","Double-checking the VAT, because someone has to","Giving the calculator a proper workout","Making sure nothing's out of stock before you get excited"];function Bv(e){let t=[...e];for(let a=t.length-1;a>0;a--){let r=Math.floor(Math.random()*(a+1));[t[a],t[r]]=[t[r],t[a]]}return t}function Ov(){let e=(0,$r.useRef)(Bv(Qs.map((o,l)=>l))),t=(0,$r.useRef)(0),[a,r]=(0,$r.useState)(Qs[e.current[0]]),[n,i]=(0,$r.useState)(!0);return(0,$r.useEffect)(()=>{let o=setInterval(()=>{i(!1),window.setTimeout(()=>{t.current++,t.current>=e.current.length&&(e.current=Bv(Qs.map((l,c)=>c)),t.current=0),r(Qs[e.current[t.current]]),i(!0)},600)},id);return()=>clearInterval(o)},[]),(0,Vo.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",children:[(0,Vo.jsx)(pr,{}),(0,Vo.jsx)("p",{className:`banter-message${n?" is-visible":""}`,children:a})]})}var ee=Y(ie()),U1=[...kn.schedule,...kn.photo].join(","),D1={paste:[{title:"Paste List",desc:"Paste your material list straight from a spreadsheet or document."},{title:"Check Matches",desc:"Review the suggested products and adjust any that need changing."},{title:"Review Quote",desc:"Review the matched materials for your quote."}],upload:[{title:"Upload File",desc:"Upload a photo, spreadsheet, Word document or PDF."},{title:"Check Matches",desc:"Review the suggested products and adjust any that need changing."},{title:"Review Quote",desc:"Review the matched materials for your quote."}]};function nd({onPasteSchedule:e,onUploadSchedule:t,onEntryModeChange:a}){let[r,n]=(0,sa.useState)(null),[i,o]=(0,sa.useState)(""),[l,c]=(0,sa.useState)(null),[p,f]=(0,sa.useState)(""),[v,m]=(0,sa.useState)(!1),[h,w]=(0,sa.useState)(!1),[E,U]=(0,sa.useState)(null),d=(0,sa.useRef)(0),u=(0,sa.useRef)(null),g=i.split(`
6719
+ `).filter($=>$.trim()).length,b=Uv(i),S=r==="paste"?!!i:!!l;(0,sa.useEffect)(()=>{if(!l||!Nn(l)){U(null);return}let $=URL.createObjectURL(l);return U($),()=>URL.revokeObjectURL($)},[l]);let T=$=>{n($),a(null)},M=()=>{n(null),a(null)},R=$=>{if(!$?.length)return;if($.length>1)return f("Please choose one file at a time.");let K=$[0],Z=rd(K,Nn(K)?1/0:void 0);if(Z)return f(Z);f(""),c(K)},G=async $=>{m(!0);try{await $()}finally{m(!1)}},W=async $=>{try{let K=await Dv($),Z=rd(K);if(Z)throw new Error(Z);let de=new FormData;de.append("file",K);let Ue=await fetch(Bt("/api/schedule/extract-photo"),{method:"POST",body:de,headers:Ga()}),pe=await Vt(Ue);if(!Ue.ok)throw new Error(pe?.error||pe?.message||"Failed to extract line items from image");let qe=typeof pe?.text=="string"?pe.text.trim():"";if(!qe)throw new Error("No line items were extracted from this image.");let De=Array.isArray(pe?.lines)?pe.lines.filter(gt=>!!(gt&&typeof gt=="object"&&typeof gt.text=="string")):void 0;await e(qe,De,!1)}catch(K){f(K?.message||"Failed to extract line items from image")}},we=()=>{if(l)return G(()=>Nn(l)?W(l):t(l))},Ce=$=>$.dataTransfer.types.includes("Files"),Ge=$=>{Ce($)&&($.preventDefault(),d.current+=1,w(!0))},Ve=$=>{Ce($)&&(d.current-=1,d.current<=0&&(d.current=0,w(!1)))},Te=$=>{Ce($)&&($.preventDefault(),d.current=0,w(!1),R($.dataTransfer.files),T("upload"))};return(0,ee.jsxs)("div",{className:"wizard-step entry-stage",onDragEnter:Ge,onDragOver:$=>Ce($)&&$.preventDefault(),onDragLeave:Ve,onDrop:Te,children:[h&&(0,ee.jsx)("div",{className:"entry-drop-overlay","aria-hidden":"true",children:"Drop your file to upload"}),(0,ee.jsxs)("div",{className:"quick-order-card",children:[(0,ee.jsxs)("div",{className:"quick-order-alt",children:[(0,ee.jsxs)("div",{className:"quick-order-entry-copy",children:[(0,ee.jsx)("div",{className:"quick-order-alt-title",children:"How would you like to get started?"}),(0,ee.jsx)("p",{className:"quick-order-alt-intro",children:"Upload a file or type a list of items and quantities. We'll match them to our products and help you build a quote."})]}),(0,ee.jsxs)("div",{className:"entry-options entry-options--workflow entry-options--two",children:[(0,ee.jsxs)("button",{type:"button",className:`entry-option-card entry-option-card--paste${r==="paste"?" entry-option-card--active":""}`,onClick:()=>T("paste"),children:[(0,ee.jsxs)("span",{className:"entry-option-content",children:[(0,ee.jsx)("span",{className:"entry-option-title",children:"Type or paste a list"}),(0,ee.jsx)("span",{className:"entry-option-desc",children:"Enter your materials and quantities"})]}),(0,ee.jsx)("span",{className:"entry-option-media entry-option-media--paste","aria-hidden":"true",children:(0,ee.jsx)("img",{className:"fill-img",src:Zt("/quick-order/paste-list.webp"),alt:""})})]}),(0,ee.jsxs)("button",{type:"button",className:`entry-option-card entry-option-card--upload${r==="upload"?" entry-option-card--active":""}`,onClick:()=>T("upload"),children:[(0,ee.jsxs)("span",{className:"entry-option-content",children:[(0,ee.jsx)("span",{className:"entry-option-title",children:"Upload a file"}),(0,ee.jsx)("span",{className:"entry-option-desc",children:"A photo, spreadsheet, Word document or PDF"})]}),(0,ee.jsx)("span",{className:"entry-option-media entry-option-media--upload","aria-hidden":"true",children:(0,ee.jsx)("img",{className:"fill-img",src:Zt("/quick-order/photo-list.webp"),alt:""})})]})]})]}),r&&(0,ee.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"quick-order-workflow-title",onClick:()=>!S&&M(),children:(0,ee.jsxs)("section",{className:`quick-order-workflow-modal${v?" quick-order-workflow-modal--matching":""}`,onClick:$=>$.stopPropagation(),children:[(0,ee.jsxs)("header",{className:"quick-order-workflow-modal-header",children:[(0,ee.jsx)("h2",{id:"quick-order-workflow-title",children:r==="paste"?"Type or paste a list":"Upload a file"}),(0,ee.jsx)("button",{type:"button",className:"quick-order-workflow-close",onClick:M,"aria-label":"Close",children:(0,ee.jsx)($o,{})})]}),(0,ee.jsxs)("div",{className:"quick-order-panel",children:[(0,ee.jsxs)("div",{className:"quick-order-body","aria-hidden":v,children:[(0,ee.jsx)("div",{className:"quick-order-body-main",children:r==="paste"?(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)("textarea",{className:"paste-textarea",placeholder:`Paste your line items here, one per line, e.g.
6720
6720
  insulated plasterboard 50mm
6721
- C24 timber 4.8m`,value:i,onChange:X=>o(X.target.value),"aria-label":"Paste schedule line items"}),v&&(0,ee.jsxs)("div",{className:"error-box",role:"alert",children:[(0,ee.jsx)("strong",{children:"Error:"})," ",v]}),(0,ee.jsxs)("div",{className:"quick-order-hint",children:[(0,ee.jsx)("strong",{children:"Tip:"}),'\xA0Paste one line per item. Include a count, e.g. "x10", to help us find the right stock and pricing.']}),(0,ee.jsx)("div",{className:"quick-order-actions",children:(0,ee.jsxs)("button",{type:"button",className:"cta-btn",disabled:!g||!!v,onClick:()=>{j(()=>e(i))},"aria-label":"Match pasted lines",children:[(0,ee.jsx)("span",{children:"Match line items"}),(0,ee.jsx)("span",{className:"arrow",children:(0,ee.jsx)(Bt,{})})]})})]}):(0,ee.jsxs)(ee.Fragment,{children:[u&&(0,ee.jsxs)("div",{className:"error-box",role:"alert",children:[(0,ee.jsx)("strong",{children:"Error:"})," ",u]}),(0,ee.jsxs)("div",{className:`upload-zone${l?" has-file":""}`,onClick:()=>p.current?.click(),onDragOver:X=>X.preventDefault(),onDrop:ze,role:"button",tabIndex:0,onKeyDown:X=>(X.key==="Enter"||X.key===" ")&&p.current?.click(),"aria-label":"Upload zone: click or drag a list or image file here",children:[E?(0,ee.jsx)("img",{src:E,alt:l?.name??"Selected photo",className:"upload-zone-photo-preview"}):(0,ee.jsx)("div",{className:"upload-zone-icon",children:Nn(l??{name:"",type:""})?"\u{1F5BC}\uFE0F":"\u{1F4C4}"}),l?(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)("div",{className:"upload-zone-subtext",children:l.name}),(0,ee.jsx)("button",{type:"button",className:"link-btn link-btn--underline",onClick:X=>{X.stopPropagation(),c(null),f(""),p.current&&(p.current.value="")},children:"Remove"})]}):(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)("div",{className:"upload-zone-text",children:"Drop a photo, spreadsheet, Word document or PDF"}),(0,ee.jsx)("div",{className:"upload-zone-subtext",children:"or click to choose a file"})]}),(0,ee.jsx)("input",{ref:p,type:"file",accept:U1,className:"visually-hidden",onChange:X=>R(X.target.files),tabIndex:-1,"aria-hidden":"true"})]}),(0,ee.jsx)("div",{className:"quick-order-actions",children:(0,ee.jsxs)("button",{type:"button",className:"cta-btn",disabled:!l,onClick:()=>{ye()},"aria-label":"Match uploaded items",children:[(0,ee.jsx)("span",{children:"Match items"}),(0,ee.jsx)("span",{className:"arrow",children:(0,ee.jsx)(Bt,{})})]})})]})}),(0,ee.jsx)("aside",{className:"quick-order-sidebar",children:D1[r].map((X,K)=>(0,ee.jsxs)("div",{className:"quick-order-step quick-order-step--rail",children:[(0,ee.jsx)("span",{className:"quick-order-step-dot",children:K+1}),(0,ee.jsxs)("div",{children:[(0,ee.jsx)("div",{className:"quick-order-step-title",children:X.title}),(0,ee.jsx)("div",{className:"quick-order-step-desc",children:X.desc})]})]},X.title))})]}),b&&(0,ee.jsx)("div",{className:"quick-order-matching-overlay",children:(0,ee.jsx)(Ov,{})})]})]})})]})]})}var we=Y($e());var od=Y(re());function Vr(){return(0,od.jsx)("svg",{className:"back-arrow",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,od.jsx)("path",{d:"M13 8H3M3 8L7 4M3 8L7 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var vi=Y(re());function ld(){return(0,vi.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,vi.jsx)("path",{d:"M3 12a9 9 0 0 1 15.36-6.36L21 8"}),(0,vi.jsx)("path",{d:"M21 3v5h-5"}),(0,vi.jsx)("path",{d:"M21 12a9 9 0 0 1-15.36 6.36L3 16"}),(0,vi.jsx)("path",{d:"M3 21v-5h5"})]})}var Zo=Y(re());function sd({unit:e}){return(0,Zo.jsx)(Zo.Fragment,{children:e.split(/([²³])/).map((t,a)=>t==="\xB2"||t==="\xB3"?(0,Zo.jsx)("span",{className:"unit-sup",children:t},a):t)})}var Lv=Y(re());function B1(e,t){return t===1||/^m\d*$/i.test(e)?e:/(s|x|z|ch|sh)$/i.test(e)?`${e}es`:/[^aeiou]y$/i.test(e)?`${e.slice(0,-1)}ies`:`${e}s`}function Ta(e,t){let a=(e??"").trim();if(!a||a==="-")return"";let r=/^each$/i.test(a)?"unit":a;return t!=null?B1(r,t):r}function xa(e,t){let a=Ta(e,t);return a?(0,Lv.jsx)(sd,{unit:a}):null}function Ko(e){let t=(e??"").trim();if(!t)return"";let a=t.match(/^per\s+(.+)$/i);if(!a)return t;let r=Ta(a[1]);return r?`per ${r}`:""}function wi(e){return e===0?"-":Number.isInteger(e)?e.toString():e<1?e.toFixed(2):e.toFixed(1)}function at(e){return`\xA3${e.toLocaleString("en-GB",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function Hv(e){return`data:image/svg+xml;utf8,${encodeURIComponent(e)}`}var O1=[{match:["building sand"],path:"/schedule-products/building-sand.webp"},{match:["drywall screw"],path:"/schedule-products/drywall-screws.webp"},{match:["scrim"],path:"/schedule-products/scrim-tape.webp"},{match:["loft insulation","loft roll"],path:"/schedule-products/loft-insulation-roll.webp"},{match:["wall tie"],path:"/schedule-products/wall-ties.webp"},{match:["red multi","multi stock","brick"],path:"/schedule-products/red-multi-stock-bricks.webp"}];function Ga(e,t,a){if(a)return a;let r=(e||"").toLowerCase(),n=O1.find(i=>i.match.some(o=>r.includes(o)));return n?Zt(n.path):r.includes("insulation")?Hv(`
6721
+ C24 timber 4.8m`,value:i,onChange:$=>o($.target.value),"aria-label":"Paste schedule line items"}),b&&(0,ee.jsxs)("div",{className:"error-box",role:"alert",children:[(0,ee.jsx)("strong",{children:"Error:"})," ",b]}),(0,ee.jsxs)("div",{className:"quick-order-hint",children:[(0,ee.jsx)("strong",{children:"Tip:"}),'\xA0Paste one line per item. Include a count, e.g. "x10", to help us find the right stock and pricing.']}),(0,ee.jsx)("div",{className:"quick-order-actions",children:(0,ee.jsxs)("button",{type:"button",className:"cta-btn",disabled:!g||!!b,onClick:()=>{G(()=>e(i))},"aria-label":"Match pasted lines",children:[(0,ee.jsx)("span",{children:"Match line items"}),(0,ee.jsx)("span",{className:"arrow",children:(0,ee.jsx)(Ot,{})})]})})]}):(0,ee.jsxs)(ee.Fragment,{children:[p&&(0,ee.jsxs)("div",{className:"error-box",role:"alert",children:[(0,ee.jsx)("strong",{children:"Error:"})," ",p]}),(0,ee.jsxs)("div",{className:`upload-zone${l?" has-file":""}`,onClick:()=>u.current?.click(),onDragOver:$=>$.preventDefault(),onDrop:Te,role:"button",tabIndex:0,onKeyDown:$=>($.key==="Enter"||$.key===" ")&&u.current?.click(),"aria-label":"Upload zone: click or drag a list or image file here",children:[E?(0,ee.jsx)("img",{src:E,alt:l?.name??"Selected photo",className:"upload-zone-photo-preview"}):(0,ee.jsx)("div",{className:"upload-zone-icon",children:Nn(l??{name:"",type:""})?"\u{1F5BC}\uFE0F":"\u{1F4C4}"}),l?(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)("div",{className:"upload-zone-subtext",children:l.name}),(0,ee.jsx)("button",{type:"button",className:"link-btn link-btn--underline",onClick:$=>{$.stopPropagation(),c(null),f(""),u.current&&(u.current.value="")},children:"Remove"})]}):(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)("div",{className:"upload-zone-text",children:"Drop a photo, spreadsheet, Word document or PDF"}),(0,ee.jsx)("div",{className:"upload-zone-subtext",children:"or click to choose a file"})]}),(0,ee.jsx)("input",{ref:u,type:"file",accept:U1,className:"visually-hidden",onChange:$=>R($.target.files),tabIndex:-1,"aria-hidden":"true"})]}),(0,ee.jsx)("div",{className:"quick-order-actions",children:(0,ee.jsxs)("button",{type:"button",className:"cta-btn",disabled:!l,onClick:()=>{we()},"aria-label":"Match uploaded items",children:[(0,ee.jsx)("span",{children:"Match items"}),(0,ee.jsx)("span",{className:"arrow",children:(0,ee.jsx)(Ot,{})})]})})]})}),(0,ee.jsx)("aside",{className:"quick-order-sidebar",children:D1[r].map(($,K)=>(0,ee.jsxs)("div",{className:"quick-order-step quick-order-step--rail",children:[(0,ee.jsx)("span",{className:"quick-order-step-dot",children:K+1}),(0,ee.jsxs)("div",{children:[(0,ee.jsx)("div",{className:"quick-order-step-title",children:$.title}),(0,ee.jsx)("div",{className:"quick-order-step-desc",children:$.desc})]})]},$.title))})]}),v&&(0,ee.jsx)("div",{className:"quick-order-matching-overlay",children:(0,ee.jsx)(Ov,{})})]})]})})]})]})}var ve=Y(Xe());var od=Y(ie());function Vr(){return(0,od.jsx)("svg",{className:"back-arrow",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,od.jsx)("path",{d:"M13 8H3M3 8L7 4M3 8L7 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var vi=Y(ie());function ld(){return(0,vi.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,vi.jsx)("path",{d:"M3 12a9 9 0 0 1 15.36-6.36L21 8"}),(0,vi.jsx)("path",{d:"M21 3v5h-5"}),(0,vi.jsx)("path",{d:"M21 12a9 9 0 0 1-15.36 6.36L3 16"}),(0,vi.jsx)("path",{d:"M3 21v-5h5"})]})}var Zo=Y(ie());function sd({unit:e}){return(0,Zo.jsx)(Zo.Fragment,{children:e.split(/([²³])/).map((t,a)=>t==="\xB2"||t==="\xB3"?(0,Zo.jsx)("span",{className:"unit-sup",children:t},a):t)})}var Lv=Y(ie());function B1(e,t){return t===1||/^m\d*$/i.test(e)?e:/(s|x|z|ch|sh)$/i.test(e)?`${e}es`:/[^aeiou]y$/i.test(e)?`${e.slice(0,-1)}ies`:`${e}s`}function xa(e,t){let a=(e??"").trim();if(!a||a==="-")return"";let r=/^each$/i.test(a)?"unit":a;return t!=null?B1(r,t):r}function ka(e,t){let a=xa(e,t);return a?(0,Lv.jsx)(sd,{unit:a}):null}function Ko(e){let t=(e??"").trim();if(!t)return"";let a=t.match(/^per\s+(.+)$/i);if(!a)return t;let r=xa(a[1]);return r?`per ${r}`:""}function wi(e){return e===0?"-":Number.isInteger(e)?e.toString():e<1?e.toFixed(2):e.toFixed(1)}function tt(e){return`\xA3${e.toLocaleString("en-GB",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function Hv(e){return`data:image/svg+xml;utf8,${encodeURIComponent(e)}`}var O1=[{match:["building sand"],path:"/schedule-products/building-sand.webp"},{match:["drywall screw"],path:"/schedule-products/drywall-screws.webp"},{match:["scrim"],path:"/schedule-products/scrim-tape.webp"},{match:["loft insulation","loft roll"],path:"/schedule-products/loft-insulation-roll.webp"},{match:["wall tie"],path:"/schedule-products/wall-ties.webp"},{match:["red multi","multi stock","brick"],path:"/schedule-products/red-multi-stock-bricks.webp"}];function Qa(e,t,a){if(a)return a;let r=(e||"").toLowerCase(),n=O1.find(i=>i.match.some(o=>r.includes(o)));return n?Zt(n.path):r.includes("insulation")?Hv(`
6722
6722
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 420">
6723
6723
  <rect width="640" height="420" fill="#fbf1cf"/>
6724
6724
  <rect x="88" y="78" width="432" height="264" rx="16" fill="#f0c43f"/>
@@ -6737,9 +6737,9 @@ C24 timber 4.8m`,value:i,onChange:X=>o(X.target.value),"aria-label":"Paste sched
6737
6737
  <rect x="168" y="188" width="250" height="24" rx="12" fill="#aab5c0"/>
6738
6738
  <rect x="168" y="232" width="220" height="24" rx="12" fill="#aab5c0"/>
6739
6739
  </svg>
6740
- `)}function Zr(e,t){return{lineId:t.lineId,description:e?.description||t.description||"(no description)",requestedDescription:t.description,productId:e?.product_id??"-",price:e?.price??null,priceBasis:e?.price_basis??null,unit:t.unit,uoi:e?.uoi??t.unit,uoiCount:e?.uoi_count??null,saleUnit:e?.conversion?.sale_unit??null,saleUnitQuantity:e?.conversion?.sale_unit_quantity??null,unitConversions:e?.conversion?.unit_conversions?.map(a=>({requestUom:a.request_uom,quantityPerSaleUnit:a.quantity_per_sale_unit,evidence:a.evidence,confidence:a.confidence})),pdpPhotoUrl:e?.pdp_photo_url??null,measurementsMm:e?.measurements_mm??[],conversionType:e?.conversion?.conversion_type??null,requestUomsSupported:e?.conversion?.request_uoms_supported??null,salesUomNormalised:e?.conversion?.sales_uom_normalised??null,salesUnitSize:e?.conversion?.sales_unit_size??null,salesUnitSizeUom:e?.conversion?.sales_unit_size_uom??null,coverageQty:e?.conversion?.coverage_qty??null,coverageUom:e?.conversion?.coverage_uom??null,itemsPerPallet:e?.conversion?.items_per_pallet??null,itemsPerPack:e?.conversion?.items_per_pack??null,itemsPerBox:e?.conversion?.items_per_box??null,itemsPerM2:e?.conversion?.items_per_m2??null,wasteFactorDefault:e?.conversion?.waste_factor_default??null,roundingRule:e?.conversion?.rounding_rule??null,derivedCoverageM2:e?.conversion?.derived_coverage_m2??null,derivedLengthM:e?.conversion?.derived_length_m??null,quoteQtyFormulaType:e?.conversion?.quote_qty_formula_type??null,conversionConfidence:e?.conversion?.conversion_confidence??null,conversionNotes:e?.conversion?.conversion_notes??null,calculatorWasteIncluded:t.calculatorWasteIncluded,qty:t.qty}}var Xv=e=>(e??"").trim().toLowerCase(),L1={sqm:"m2","sq m":"m2","m\xB2":"m2",cbm:"m3","cu m":"m3",lm:"m","lin m":"m",metre:"m",meter:"m",each:"each",ea:"each",nr:"each",no:"each",item:"each",unit:"each",units:"each",pc:"each",pcs:"each",board:"sheet",bags:"bag",length:"length",lengths:"length",pallet:"pallet",pallets:"pallet"},H1=new Set(["sheet","length","box","bag","pack","roll","set","tub","each"]),jv=new Set(["box","bag","pack","pallet","roll","set","tub"]),Gv=(e,t)=>t==="ml"?e:["l","litre","litres"].includes(t)?e*1e3:null,Qv=(e,t)=>t==="g"?e:["kg","kilogram","kilograms"].includes(t)?e*1e3:["t","tonne","tonnes"].includes(t)?e*1e6:null,yi=e=>{let t=Xv(e);return L1[t]??t},rt=(e,t)=>{let a=yi(e),r=yi(t);return a.length>0&&a===r},j1=(e,t)=>{let a=Xv(t);return a?a.includes("round_up_1000")?Math.ceil(e):a.includes("allow_decimal")?Math.round(e*1e3)/1e3:a.includes("round_up")?Math.ceil(e):e:e},G1=e=>(e??"").split(",").map(t=>yi(t)).filter(Boolean),Q1=(e,t)=>{let a=G1(e.requestUomsSupported);return!!(a.length===0||a.includes(t)||rt(t,"pallet")&&e.itemsPerPallet!=null&&e.itemsPerPallet>0||rt(t,"pack")&&e.itemsPerPack!=null&&e.itemsPerPack>0||rt(t,"box")&&e.itemsPerBox!=null&&e.itemsPerBox>0)},Yv=(e,t)=>rt(t,"pallet")?e.itemsPerPallet??null:rt(t,"pack")?e.itemsPerPack??null:rt(t,"box")?e.itemsPerBox??null:null,Y1=(e,t,a)=>{if(!rt(t,"m2"))return null;let r=e.description.match(/(\d+(?:[.,]\d+)?)\s*(m2|m²|sqm|sq\.?\s*m)\s*(?:\/|per)\s*([a-z]+)/i);if(!r||!rt(r[3],a))return null;let n=Number.parseFloat(r[1].replace(",","."));return Number.isFinite(n)&&n>0?n:null};function za(e,t){let a=e.qty,r=yi(e.unit)||"-",n=yi(e.saleUnit??e.salesUnitSizeUom??e.uoi??e.salesUomNormalised)||"-",i=e.saleUnitQuantity??e.salesUnitSize??e.uoiCount??1,o=t?.wasteFactorEnabled===!1?0:t?.wasteFactorOverride??e.wasteFactorOverride??e.wasteFactorDefault??0,l=e.sellUnitsOverride!=null&&Number.isFinite(e.sellUnitsOverride)&&e.sellUnitsOverride>0,c=l?e.sellUnitsOverride??null:null,u=v=>({requestedAmount:a,requestedUnit:r,salesUnitSize:e.salesUnitSize??e.uoiCount??null,sellUnit:n,calculatedSellUnits:null,requiredSellUnits:c,unitPrice:e.price,lineTotal:e.price!=null&&c!=null?e.price*c:null,calculation:c!=null?`${v} Manually set to ${c} ${n}.`:v,costingMode:"review"});if(!Q1(e,r))return u("Requested unit is not supported by this catalogue conversion.");let f=null,b="review",d=e.roundingRule,h=`Quantity review required, initial request needed ${a} ${r}.`,w=1+o,E=Y1(e,r,n),U=e.unitConversions?.find(v=>rt(v.requestUom,r));if(!!e.saleUnit&&(rt(r,n)||!!U||rt(r,"each")&&!jv.has(n)))if(rt(r,n))f=a*w/i,b="direct",h=`${a} ${r}${o>0?` x ${w}`:""}`;else if(U){f=a*w/U.quantityPerSaleUnit,b="derived";let v=1/U.quantityPerSaleUnit,N=Math.round(v);h=rt(n,"each")&&U.quantityPerSaleUnit<1&&Math.abs(v-N)<1e-9?`${a} ${r}${o>0?` x ${w}`:""} x ${N} per ${r}`:`${a} ${r}${o>0?` x ${w}`:""} / ${U.quantityPerSaleUnit} ${r} per ${n}`}else rt(r,"each")&&!jv.has(n)&&(f=a*w/i,b="derived",h=`${a} ${n}${o>0?` x ${w}`:""}`);else if(rt(r,n)&&i>0)f=a*w/i,b="direct",h=o>0?`${a} ${r} x ${w} / ${i} ${n} per sell unit`:`${a} ${r} / ${i} ${n} per sell unit`;else if(rt(r,"each")&&i>0&&H1.has(n))f=a*w/i,b="derived",h=o>0?`${a} each x ${w} / ${i} each per ${n}`:`${a} each / ${i} each per ${n}`;else if(Yv(e,r)!=null&&i>0){let v=Yv(e,r)??0;f=a*v*w/i,b="derived";let N=`${a} ${r} x ${v} each${o>0?` x ${w}`:""}`;h=i===1&&rt(n,"each")?N:`${N} / ${i} each per ${n}`}else if(E!=null)f=a*w/E,b="derived",d??(d="round_up_each"),h=`${a} m2 x ${w} / ${E} m2 per ${n} (from product description)`;else if(e.conversionType==="basket_line_unit"){let v=e.coverageQty??null;v!=null&&v>0&&rt(r,e.coverageUom)&&(f=a*w/v,b="derived",h=`${a} ${r} x ${w} / ${v} ${e.coverageUom} per ${n}`)}else{if(e.conversionType==="count_only")return u(`Quantity review required, initial request needed ${a} ${r}.`);if(["area_from_dims","explicit_coverage_area","roll_area"].includes(e.conversionType??"")){let v=e.coverageQty??e.derivedCoverageM2??null;rt(r,"m2")&&v!=null&&v>0&&(f=a*w/v,b="derived",h=`${a} m2 x ${w} / ${v} m2 per ${n}`)}else if(e.conversionType==="count_per_area"){let v=e.coverageQty??null;rt(r,"m2")&&v!=null&&v>0?(f=a/v,b="derived",h=`${a} m2 / ${v} m2 per sell unit`):rt(r,"m2")&&e.itemsPerM2!=null&&e.itemsPerM2>0&&i>0&&(f=a*e.itemsPerM2*w/i,b="derived",h=`${a} m2 x ${e.itemsPerM2} ${n}/m2 x ${w} / ${i}`)}else if(e.conversionType==="length_from_dims"){let v=e.coverageQty??e.derivedLengthM??null;rt(r,"m")&&v!=null&&v>0&&(f=a*w/v,b="derived",h=`${a} m x ${w} / ${v} m per ${n}`)}else if(e.conversionType==="volume_from_description"){let v=Gv(a,r),N=Gv(e.coverageQty??0,yi(e.coverageUom));v!=null&&N!=null&&N>0&&(f=v*w/N,b="derived",h=`${a} ${r} x ${w} / ${e.coverageQty} ${e.coverageUom} per ${n}`)}else if(e.conversionType==="weight_from_description"){let v=Qv(a,r),N=Qv(e.coverageQty??0,yi(e.coverageUom));v!=null&&N!=null&&N>0&&(f=v*w/N,b="derived",h=`${a} ${r} x ${w} / ${e.coverageQty} ${e.coverageUom} per ${n}`)}else if(e.conversionType==="same_unit_volume"){let v=e.coverageQty??null;rt(r,"m3")&&v!=null&&v>0&&(f=a/v,b="derived",h=`${a} m3 / ${v} m3 per ${n}`)}}if(f==null||!Number.isFinite(f)||f<0)return u(`Quantity review required, initial request needed ${a} ${r}.`);let p=j1(f,d),g=l?e.sellUnitsOverride??null:p;return{requestedAmount:a,requestedUnit:r,salesUnitSize:i,sellUnit:n,calculatedSellUnits:p,requiredSellUnits:g,unitPrice:e.price,lineTotal:e.price!=null&&g!=null?e.price*g:null,calculation:l?`${h} = ${p} ${n} (manually set to ${g})`:`${h} = ${g} ${n}`,costingMode:b}}var $v=()=>import("./xlsx-K4MOA2QM.js"),Po=["Source Line ID","Split Line ID","Description","Section","Qty","Unit","Procurement intent","Procurement aliases","Build-up type","Layer count","Total thickness (mm)","Installation clues","System clues","Component requirements","Technical classification","Include in quote","Approval required","Approval type","Missing information","Adjudicator confidence","Decision reason","Selected candidate ID","Selected candidate description","Price basis","Price","Line total","Confidence","Status"],X1=Po.indexOf("Line total");function $1(e){return e.unmatchable?"Not matched (labour/plant/referential)":e.decision?.include_in_quote===!0&&e.decision.approval_required===!0?"Approval required":e.decision?.include_in_quote===!0?"Quoted":e.decision?.technical_classification==="no_suitable_candidate"?"No suitable candidate":(e.best,"No match")}async function Vv(e){let t=await $v(),a=t.utils.book_new(),r=new Date().toISOString().slice(0,10),n=[Po],i=0;for(let c of e){let{item:u,best:f,qty:b,band:d,unmatchable:h,decision:w}=c,E=[u.section,u.subsection,u.subheading].filter(Boolean).join(" / "),U=!h&&f?.price!=null?f.price*b:null;U!=null&&(i+=U),n.push([u.source_line_id,u.line_id,u.description_original||"(no description)",E,b,u.unit,u.procurement_intent||"-",u.procurement_aliases.join(", "),u.build_up_type,u.layer_count,u.total_required_thickness_mm,u.installation_clues.join(", "),u.system_clues.join(", "),u.component_requirements.join(", "),w?.technical_classification??"",w?.include_in_quote==null?"":w.include_in_quote?"yes":"no",w?.approval_required==null?"":w.approval_required?"yes":"no",w?.approval_type??"",w?.missing_information.join(", ")??"",w?.confidence??"",w?.reason??"",h?"-":f?.product_id??w?.selected_candidate_id??"-",h?"-":f?.description??"-",h?"-":f?.price_basis??"-",h?null:f?.price??null,U,h?"-":d,$1(c)])}n.push(Array(Po.length).fill(null));let o=Array(Po.length).fill(null);o[0]="Estimated total",o[X1]=i,n.push(o),n.push(["DISCLAIMER: These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence.",...Array(Po.length-1).fill(null)]);let l=t.utils.aoa_to_sheet(n);l["!cols"]=[{wch:12},{wch:12},{wch:44},{wch:24},{wch:8},{wch:8},{wch:28},{wch:28},{wch:16},{wch:10},{wch:12},{wch:24},{wch:24},{wch:24},{wch:22},{wch:14},{wch:14},{wch:18},{wch:24},{wch:16},{wch:48},{wch:16},{wch:40},{wch:10},{wch:10},{wch:12},{wch:11},{wch:26}],t.utils.book_append_sheet(a,l,"Schedule match"),t.writeFile(a,`schedule-quote-${r}.xlsx`)}var Jo=["Product ID","Description","Costing mode","Required amount","Req unit","Sell unit size","Sell unit","Required sell units","Unit price","Line total"];async function Zv(e,t){let a=await $v(),r=a.utils.book_new(),n=new Date().toISOString().slice(0,10),i=t?[["Account",t.name+" ("+t.id+")"],[],Jo]:[Jo],o=0;for(let u of e){let f=za(u),b=f.lineTotal;b!=null&&(o+=b),i.push([u.productId,u.description,f.costingMode,f.requestedAmount,Ta(f.requestedUnit),f.salesUnitSize,Ta(f.sellUnit),f.requiredSellUnits,f.unitPrice,b])}i.push(Array(Jo.length).fill(null));let l=Array(Jo.length).fill(null);l[0]="Estimated total",l[Jo.length-1]=o,i.push(l);let c=a.utils.aoa_to_sheet(i);c["!cols"]=[{wch:14},{wch:48},{wch:12},{wch:14},{wch:10},{wch:14},{wch:10},{wch:16},{wch:12},{wch:14}],a.utils.book_append_sheet(r,c,"Basket"),a.writeFile(r,t?`basket-${t.id}-${n}.xlsx`:`basket-${n}.xlsx`)}var s=Y(re()),pd="__none__",Fo=24,V1=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}];function Fv(e){return e==null?"low":e>=.7?"high":e>=.5?"medium":"low"}var Z1=e=>e.attrs.supply_nature==="labour_only"||e.attrs.supply_nature==="plant"||e.flags.includes("referential");function K1(e,t){if(t!==pd){if(t)return e?.candidates.find(a=>a.product_id===t);if(e?.decision?.selected_candidate_id!=null)return e.candidates.find(a=>a.product_id===e.decision.selected_candidate_id);if(e?.decision?.technical_classification!=="no_suitable_candidate")return e?.candidates?.[0]}}function Kv(e){return{product_id:e.productId,description:e.description,source_list:null,price:e.price,price_basis:e.priceBasis,uoi_count:e.uoiCount??null,uoi:e.uoi,pdp_photo_url:e.pdpPhotoUrl??null,measurements_mm:e.measurementsMm??[],conversion:{sale_unit:e.saleUnit,sale_unit_quantity:e.saleUnitQuantity,unit_conversions:e.unitConversions?.map(t=>({request_uom:t.requestUom,quantity_per_sale_unit:t.quantityPerSaleUnit,evidence:t.evidence,confidence:t.confidence})),sales_uom_normalised:e.salesUomNormalised,conversion_type:e.conversionType,request_uoms_supported:e.requestUomsSupported,sales_unit_size:e.salesUnitSize,sales_unit_size_uom:e.salesUnitSizeUom,coverage_qty:e.coverageQty,coverage_uom:e.coverageUom,items_per_pallet:e.itemsPerPallet,items_per_pack:e.itemsPerPack,items_per_box:e.itemsPerBox,items_per_m2:e.itemsPerM2,waste_factor_default:e.wasteFactorDefault,rounding_rule:e.roundingRule,derived_coverage_m2:e.derivedCoverageM2,derived_length_m:e.derivedLengthM,quote_qty_formula_type:e.quoteQtyFormulaType,conversion_confidence:e.conversionConfidence,conversion_notes:e.conversionNotes},scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"manual_cart_selection"}}function J1(e){return e?e.replace(/_/g," "):"not stated"}function P1({band:e}){return(0,s.jsx)("span",{className:`status-dot status-dot--${e}`,title:e,children:(0,s.jsx)("span",{className:"status-dot__mark"})})}function Cn(e,t){if(e==null)return"-";let a=Ko(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function ud(e){return e&&e.length>0?e.join(" x "):"-"}function F1(e){return e==null?"-":Number.isInteger(e/1e3)?`${e/1e3}m`:`${(e/1e3).toFixed(1)}m`}function Sn(e){let t=(e??[]).map(a=>a.trim()).filter(Boolean);return t.length>0?t.join(", "):"-"}function Kr(e,t){let a=t.filter(n=>n.source_line_id===e.source_line_id&&n.description_original===e.description_original),r=e.customer_display_label?.trim()||e.procurement_intent?.trim()||e.description_original||"";return a.length<=1||!e.procurement_intent||r===e.procurement_intent?r||"(no description)":`${r} -> ${e.procurement_intent}`}var Jv=[{background:"#fff7ed",borderColor:"#fdba74",color:"#9a3412"},{background:"#eff6ff",borderColor:"#93c5fd",color:"#1d4ed8"},{background:"#ecfeff",borderColor:"#67e8f9",color:"#0f766e"},{background:"#f0fdf4",borderColor:"#86efac",color:"#166534"},{background:"#fdf4ff",borderColor:"#f0abfc",color:"#a21caf"}];function I1(e){let t=new Map;return[...new Set(e.filter(dr).map(r=>r.linked_group_id))].forEach((r,n)=>{let i=n%26;t.set(r,{token:String.fromCharCode(65+i),bubbleStyle:Jv[n%Jv.length]})}),t}function dr(e){return!1}function qn(e){if(!e.linked_group_id)return null;let t=e.linked_group_label||"Linked group",a=e.linked_group_role==="anchor"?"anchor":e.linked_group_role==="dependent"?"dependent":"member",r=e.linked_group_shared_width_mm!=null?`, ${e.linked_group_shared_width_mm}mm family`:"";return`${t} (${a}${r})`}function cd({meta:e}){return e?(0,s.jsx)("span",{className:"results-linked-pill",style:e.bubbleStyle,children:`Link ${e.token}`}):null}function W1(e,t,a){let r=t?.rerank?.recommendedCandidateIds??[];if(r.length===0){let o=e.slice(0,5),l=o.some(c=>c.product_id===a)?void 0:e.find(c=>c.product_id===a);return l?[...o,l]:o}let n=new Map(e.map(o=>[o.product_id,o])),i=r.map(o=>n.get(o)).filter(o=>o!=null);if(a&&!i.some(o=>o.product_id===a)){let o=n.get(a);o&&i.unshift(o)}return[...new Map(i.map(o=>[o.product_id,o])).values()].slice(0,5)}function Ys(e){let t=e?.rerank?.recommendedCandidateIds??[];if(t.length===0||!e)return[];let a=new Map(e.candidates.map(r=>[r.product_id,r]));return t.map(r=>a.get(r)).filter(r=>r!=null)}function Xs(e){if(e>=6e4){let t=Math.floor(e/6e4),a=Math.round(e%6e4/1e3);return a===60?`${t+1}m`:`${t}m ${a}s`}return e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}s`:`${e}ms`}function e_({processStages:e,llmCalls:t,totalDurationMs:a,llmDurationMs:r,llmCallCount:n}){let i=[...t].sort((l,c)=>c.durationMs-l.durationMs).slice(0,12),o=Math.max(0,t.length-i.length);return(0,s.jsxs)("div",{className:"results-detail-block",style:{marginBottom:18},children:[(0,s.jsx)("h3",{style:{margin:"0 0 12px"},children:"Pipeline timings"}),(0,s.jsxs)("div",{className:"results-summary",style:{marginBottom:12},children:[(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:Xs(a)})," total"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:n})," LLM calls"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:Xs(r)})," LLM time"]})]}),(0,s.jsxs)("table",{className:"score-breakdown-table",style:{marginBottom:14},children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Process stage"}),(0,s.jsx)("th",{children:"Duration"})]})}),(0,s.jsx)("tbody",{children:e.map((l,c)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:l.label}),(0,s.jsx)("td",{children:Xs(l.durationMs)})]},`${l.key}-${c}`))})]}),t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h4",{style:{margin:"0 0 10px"},children:"LLM calls"}),(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Call"}),(0,s.jsx)("th",{children:"Duration"})]})}),(0,s.jsx)("tbody",{children:i.map((l,c)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:l.label}),(0,s.jsx)("td",{children:Xs(l.durationMs)})]},`${l.key}-${c}`))})]}),o>0&&(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Showing slowest ",i.length," of ",t.length," LLM calls."]})]})]})}function t_({queries:e}){return e.length===0?null:(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Retrieval by procurement query"}),e.map((t,a)=>(0,s.jsxs)("div",{style:{marginBottom:16},children:[(0,s.jsxs)("div",{className:"results-row-meta",style:{marginBottom:6},children:["Query: ",(0,s.jsx)("strong",{children:t.query})]}),t.candidates.length===0?(0,s.jsx)("p",{className:"results-empty-hint",children:"No candidates returned for this query."}):(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Product"}),(0,s.jsx)("th",{children:"Dims (mm)"}),(0,s.jsx)("th",{children:"Unit"}),(0,s.jsx)("th",{children:"bm25"})]})}),(0,s.jsx)("tbody",{children:t.candidates.slice(0,5).map((r,n)=>(0,s.jsxs)("tr",{children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{children:r.description}),(0,s.jsx)("div",{className:"results-row-meta",children:r.product_id})]}),(0,s.jsx)("td",{children:ud(r.measurements_mm)}),(0,s.jsx)("td",{children:Ko(r.price_basis)||"-"}),(0,s.jsx)("td",{children:r.bm25.toFixed(2)})]},`${r.product_id}-${n}`))})]})]},`${t.query}-${a}`))]})}function Pv({item:e,result:t}){let a=t?.retrieval_debug.map(n=>n.query).filter(Boolean)??[],r=[["Procurement intent",e.procurement_intent||"-"],["Procurement aliases",Sn(e.procurement_aliases)],["Retrieval queries",Sn(a)],["Category",e.attrs.category||"-"],["Fine category",e.attrs.category_fine||"-"],["Brand",e.attrs.brand||"-"],["Material",e.attrs.material||"-"],["Grade / standard",e.attrs.grade_standard||"-"],["Treatment",e.attrs.treatment||"-"],["Supply nature",e.attrs.supply_nature||"-"],["Measurements (mm)",ud(e.attrs.measurements_mm)],["Stock length",F1(e.attrs.stock_length_mm)],["Matching mode",e.matching_mode||"-"],["Build-up type",e.build_up_type||"-"],["Layer count",e.layer_count!=null?String(e.layer_count):"-"],["Required thickness (mm)",e.total_required_thickness_mm!=null?String(e.total_required_thickness_mm):"-"],["Allowed layer thicknesses (mm)",e.acceptable_layer_thicknesses_mm.length>0?e.acceptable_layer_thicknesses_mm.join(", "):"-"],["Installation clues",Sn(e.installation_clues)],["System clues",Sn(e.system_clues)],["Component requirements",Sn(e.component_requirements)],["Linked group",qn(e)||"-"],["Flags",Sn(e.flags)]];return(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Search context"}),(0,s.jsx)("dl",{className:"results-detail-grid",children:r.map(([n,i])=>(0,s.jsxs)(we.Fragment,{children:[(0,s.jsx)("dt",{children:n}),(0,s.jsx)("dd",{children:i})]},n))})]})}function a_({item:e}){let t=e.decomposition_debug;return t?(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Decomposition"}),(0,s.jsxs)("dl",{className:"results-detail-grid",children:[(0,s.jsxs)(we.Fragment,{children:[(0,s.jsx)("dt",{children:"Attempted"}),(0,s.jsx)("dd",{children:t.attempted?"yes":"no"})]}),(0,s.jsxs)(we.Fragment,{children:[(0,s.jsx)("dt",{children:"Applied"}),(0,s.jsx)("dd",{children:t.applied?"yes":"no"})]}),(0,s.jsxs)(we.Fragment,{children:[(0,s.jsx)("dt",{children:"Returned items"}),(0,s.jsx)("dd",{children:t.returned_item_count??"-"})]}),(0,s.jsxs)(we.Fragment,{children:[(0,s.jsx)("dt",{children:"Reason"}),(0,s.jsx)("dd",{children:t.reason||"-"})]}),(0,s.jsxs)(we.Fragment,{children:[(0,s.jsx)("dt",{children:"Returned intents"}),(0,s.jsx)("dd",{children:t.items.length>0?t.items.map(a=>`${a.intent}${a.inherits_quantity?" (inherits qty)":""}`).join(", "):"-"})]})]})]}):null}function r_({result:e}){let t=e?.adjudication_debug;if(!t)return null;let a=[["Dependent rerank applied",t.dependent_rerank_applied?"yes":"no"],["Linked parent selected product",t.linked_parent_selected_candidate_description||t.linked_parent_selected_candidate_id||"-"],["Dimension reason overridden",t.dimension_reason_overridden?"yes":"no"]];return(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Adjudication context"}),(0,s.jsx)("dl",{className:"results-detail-grid",children:a.map(([r,n])=>(0,s.jsxs)(we.Fragment,{children:[(0,s.jsx)("dt",{children:r}),(0,s.jsx)("dd",{children:n})]},r))}),t.rerank_line_item_input?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h5",{style:{margin:"12px 0 8px"},children:"Rerank input"}),(0,s.jsx)("pre",{className:"results-pre",children:JSON.stringify(t.rerank_line_item_input,null,2)})]}):null]})}function i_({item:e,decision:t,result:a,showRetrievalDebug:r,reviewOnly:n=!1,linkedGroupMeta:i}){if(!t)return null;let o=t.technical_classification==="no_suitable_candidate"?"Exact match not found:":`AI review (${t.confidence??"confidence not stated"}):`;return n?t.reason?(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,s.jsx)("strong",{children:o}),"\xA0",t.reason]}),dr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",i?`Link ${i.token} - `:"",qn(e)]}):null]}):null:!t.reason&&!r?(0,s.jsx)(Pv,{item:e,result:a}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Pv,{item:e,result:a}),r&&(0,s.jsx)(a_,{item:e}),r&&(0,s.jsx)(r_,{result:a}),t.reason&&(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,s.jsx)("strong",{children:o}),"\xA0",t.reason]}),dr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",i?`Link ${i.token} - `:"",qn(e)]}):null]}),r&&(0,s.jsx)(t_,{queries:a?.retrieval_debug??[]})]})}function n_({item:e,candidates:t,result:a,decision:r,unmatchable:n,selectedProductId:i,detailMode:o,onPick:l,onClear:c,showAll:u=!1,internal:f=!1,debugEnabled:b=!1,forceReviewNote:d=!1,linkedGroupMeta:h}){let w=f||o==="detailed",E=b&&o==="detailed",U=w||d?(0,s.jsx)(i_,{item:e,decision:r,result:a,showRetrievalDebug:E,reviewOnly:d&&!w,linkedGroupMeta:h}):null;if(n)return(0,s.jsxs)(s.Fragment,{children:[U,(0,s.jsx)("p",{className:"results-empty-hint",children:"Classified as labour/plant or referencing another line item - skipped by design."})]});if(t.length===0)return(0,s.jsxs)(s.Fragment,{children:[U,(0,s.jsx)("p",{className:"results-empty-hint",children:"No candidates were returned for this line item."})]});let m=u||f||o==="detailed"?t:W1(t,a,i);return(0,s.jsxs)(s.Fragment,{children:[U,(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Product"}),(0,s.jsx)("th",{children:"Dims (mm)"}),(0,s.jsx)("th",{children:"Price"}),E&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("th",{children:"dimension"}),(0,s.jsx)("th",{children:"grade"}),(0,s.jsx)("th",{children:"brand"}),(0,s.jsx)("th",{children:"fuzzy"}),(0,s.jsx)("th",{children:"bm25"}),(0,s.jsx)("th",{children:"overall"})]}),(0,s.jsx)("th",{"aria-label":"Actions"})]})}),(0,s.jsx)("tbody",{children:m.map((p,g)=>{let v=p.product_id===i;return(0,s.jsxs)("tr",{className:v?"score-breakdown-row--best":"",children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{children:p.description}),(0,s.jsx)("div",{className:"results-row-meta",children:p.product_id})]}),(0,s.jsx)("td",{children:(0,s.jsx)("span",{className:"unit-badge",children:ud(p.measurements_mm??p.debug?.candidate.measurements_mm)})}),(0,s.jsx)("td",{children:Cn(p.price,p.price_basis)}),E&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("td",{children:(p.scores?.dimension??0).toFixed(2)}),(0,s.jsx)("td",{children:(p.scores?.grade??0).toFixed(2)}),(0,s.jsx)("td",{children:(p.scores?.brand??0).toFixed(2)}),(0,s.jsx)("td",{children:(p.scores?.fuzzy??0).toFixed(2)}),(0,s.jsx)("td",{children:(p.scores?.bm25??0).toFixed(2)}),(0,s.jsx)("td",{children:(0,s.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,s.jsx)(P1,{band:Fv(p.scores?.overall)}),(0,s.jsx)("span",{className:"results-overall-cell",children:(p.scores?.overall??0).toFixed(2)})]})})]}),(0,s.jsx)("td",{children:(0,s.jsxs)("label",{className:"switch-toggle",title:v?"Currently selected":"Use this candidate",children:[(0,s.jsx)("input",{type:"checkbox",checked:v,onChange:()=>{v?c?.():l(p)},"aria-label":v?`${p.description} selected`:`Use ${p.description}`}),(0,s.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},`${p.product_id}-${g}`)})})]})]})}function dd({scheduleResult:e,onStartOver:t,cart:a,onAddToCart:r,onRemoveFromCart:n,onGoToBasket:i,cartSeeded:o,onCartSeeded:l,reviewGateComplete:c,onReviewGateComplete:u,internal:f=!1}){let b=!f&&Ls()==="QZA6-MRA4",d=b?"quote":"basket",{results:h,lineItems:w,parseReport:E,timings:U}=e,[m,p]=(0,we.useState)({}),[g,v]=(0,we.useState)({}),[N,T]=(0,we.useState)({}),[M,R]=(0,we.useState)(""),[j,W]=(0,we.useState)(null),[ye,Ce]=(0,we.useState)(1),[He,We]=(0,we.useState)(!1);(0,we.useEffect)(()=>{We(new URLSearchParams(window.location.search).get("debug")==="1")},[]);let[ze,X]=(0,we.useState)("simple"),[K,Z]=(0,we.useState)(f?"list":"tile"),[ue,Te]=(0,we.useState)(!1),[pe,De]=(0,we.useState)(null),[Qe,ct]=(0,we.useState)(""),[Ze,Lt]=(0,we.useState)([]),[G,P]=(0,we.useState)(!1),[fe,gt]=(0,we.useState)(null),[C,z]=(0,we.useState)(!1),[le,ve]=(0,we.useState)(null),qe=(0,we.useRef)(null),[pt,xt]=(0,we.useState)(new Set),[x,H]=(0,we.useState)(new Set),[B,ne]=(0,we.useState)(!1);(0,we.useEffect)(()=>{Ce(1)},[M,j,K]);let te=new Map(h.map(_=>[_.line_id,_])),S=I1(w),Q=w.map(_=>{let O=te.get(_.line_id),Ee=O?.decision,Tt=Z1(_),Xe=m[_.line_id],Pt=K1(O,Xe),Mi=a[_.line_id],zw=Xe===pd?void 0:g[_.line_id]??(Mi&&Mi.productId!==Pt?.product_id?Kv(Mi):Pt),Kd=Tt?void 0:zw,Aw=_.qty??0;return{item:_,result:O,decision:Ee,unmatchable:Tt,best:Kd,qty:Aw,band:Fv(Kd?.scores?.overall)}}),J=0,me=0;for(let _ of Q)_.unmatchable||_.decision?.include_in_quote!==!0||!_.best||(_.best.price!=null?J+=_.best.price*_.qty:me+=1);let _e=_=>!_.unmatchable&&!_.best&&_.decision?.technical_classification!=="no_suitable_candidate"&&Ys(_.result).length>0,Ke=_=>_.best??Ys(_.result)[0],ca=Q.filter(_=>!_.unmatchable&&!_.best).filter(_=>!x.has(_.item.line_id)),il=Q.filter(_=>x.has(_.item.line_id)),pa=Q;if(M.trim()){let _=M.trim().toLowerCase();pa=pa.filter(O=>O.item.description_original?.toLowerCase().includes(_)||Ke(O)?.description?.toLowerCase().includes(_))}if(j){let _=j==="asc"?1:-1;pa=[...pa].sort((O,Ee)=>_*(O.item.description_original||"").localeCompare(Ee.item.description_original||""))}let On=Math.max(1,Math.ceil(pa.length/Fo)),Jt=Math.min(ye,On),gr=pa.slice((Jt-1)*Fo,Jt*Fo),Ya=gr.filter(_=>!_.unmatchable&&_.best),Hd=gr.filter(_=>_e(_)),Ln=gr.filter(_=>!_.unmatchable&&(_.best||_e(_))),jd=gr.filter(_=>_.unmatchable||!_.best&&!_e(_)),F=pe?Q.find(_=>_.item.line_id===pe)??null:null,Nw=!f&&!c&&!F&&ca.length>0,Hn=(0,we.useRef)(null),jn=()=>{let _=qe.current;if(!_)return;let{top:O,left:Ee,width:Tt,height:Xe}=_.getBoundingClientRect(),Mi=_.querySelector(".bom-toolbar-btn")?.closest("td")?.getBoundingClientRect().left;ve({top:O,left:Ee,width:Mi?Mi-Ee:Tt,height:Xe})};(0,we.useEffect)(()=>(window.addEventListener("scroll",jn,!0),window.addEventListener("resize",jn),()=>{window.removeEventListener("scroll",jn,!0),window.removeEventListener("resize",jn)})),(0,we.useEffect)(()=>{let _=O=>{Hn.current&&!O.composedPath().includes(Hn.current)&&Hn.current.removeAttribute("open")};return document.addEventListener("click",_),()=>document.removeEventListener("click",_)},[]);let Ci=_=>{De(_),ct("")},Sw=()=>{if(!pe)return;let _=a[pe];if(_){p(O=>({...O,[pe]:_.productId})),v(O=>({...O,[pe]:Kv(_)}));return}p(O=>{let Ee={...O};return delete Ee[pe],Ee}),v(O=>{let Ee={...O};return delete Ee[pe],Ee})},hr=(_=!1)=>{let O=pe?a[pe]:void 0;!_&&O&&F?.best&&O.productId!==F.best.product_id&&!window.confirm("You have selected a new product. Leave without updating it?")||(_||Sw(),De(null),ne(!1))},Cw=_=>{if(xt(O=>new Set(O).add(_)),ca.some(O=>O.item.line_id!==_)){hr(!0);return}u(),hr(!0)},qw=_=>{if(dc(_),H(O=>new Set(O).add(_)),ca.some(O=>O.item.line_id!==_)){hr(!0);return}u(),hr(!0)},Ew=()=>{H(_=>new Set([..._,...ca.map(O=>O.item.line_id)])),u()},Gd=()=>{F?.best&&(Yd(F.item.line_id,F.best),r(qi(F)),B?Cw(F.item.line_id):hr(!0))},Qd=jd.length>0?(0,s.jsxs)("section",{className:"results-tile-section results-tile-section--unmatched","aria-label":"Items requiring matching",children:[(0,s.jsxs)("div",{className:"results-tile-section__head",children:[(0,s.jsx)("h3",{children:"Require Matching"}),(0,s.jsx)("p",{children:"We couldn\u2019t confidently match these to a product. Open one to pick from the closest options."})]}),(0,s.jsx)("div",{className:"results-unmatched-list",children:jd.map(_=>{let{item:O,qty:Ee}=_;return(0,s.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>Ci(O.line_id),children:[(0,s.jsx)("span",{className:"results-unmatched-card__main",children:(0,s.jsx)("span",{className:"results-unmatched-card__title",children:Kr(O,w)})}),(0,s.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},O.line_id)})})]}):null,dc=_=>{p(O=>({...O,[_]:pd})),v(O=>({...O,[_]:void 0})),T(O=>({...O,[_]:void 0})),n(_)},mc=(_,O)=>{p(Ee=>({...Ee,[_]:O.product_id})),v(Ee=>({...Ee,[_]:O}))},Yd=(_,O)=>{O.method==="catalogue_search"&&T(Ee=>({...Ee,[_]:O}))};function X_(){Vv(Q.map(({item:_,best:O,qty:Ee,band:Tt,unmatchable:Xe,decision:Pt})=>({item:_,best:O,qty:Ee,band:Tt,unmatchable:Xe,decision:Pt})))}function qi(_){let O=_.best??Ys(_.result)[0];return Zr(O,{lineId:_.item.line_id,description:_.item.description_original,unit:_.item.unit,qty:_.qty})}(0,we.useEffect)(()=>{if(!o){for(let _ of Q)!_.unmatchable&&_.best&&r(qi(_));l()}},[o]),(0,we.useEffect)(()=>{for(let _ of Q){let O=a[_.item.line_id];if(!O)continue;let Ee=qi(_);r({...Ee,qty:O.qty,sellUnitsOverride:O.sellUnitsOverride??null})}},[e]),(0,we.useEffect)(()=>{if(!pe){Lt([]),gt(null),P(!1);return}let _=Qe.trim();if(!_){Lt([]),gt(null),P(!1);return}let O=!1,Ee=window.setTimeout(async()=>{try{P(!0),gt(null);let Tt=await fetch(Vt(`/api/catalogue/search?q=${encodeURIComponent(_)}`),{headers:bi()}),Xe=await la(Tt);if(!Tt.ok)throw new Error(Xe?.error||Xe?.message||"Failed to search catalogue");O||Lt(Array.isArray(Xe?.items)?Xe.items:[])}catch(Tt){O||(Lt([]),gt(Tt?.message||"Failed to search catalogue"))}finally{O||P(!1)}},250);return()=>{O=!0,window.clearTimeout(Ee)}},[Qe,pe]);let fc=Object.keys(a).length,Ca=Qe.trim(),Xd=Ys(F?.result),nl=F?.decision?.technical_classification==="no_suitable_candidate"||!!F&&!F.best,$d=F?.decision?.technical_classification!=null,Vd=F?.decision?.reason??(nl?"No catalogue candidate found. Refine the request or search the catalogue.":null),Mw=Ze.map(_=>({product_id:_.product_id,description:_.description,source_list:_.source_list,price:_.price,price_basis:_.price_basis,uoi_count:_.uoi_count??null,uoi:_.uoi,pdp_photo_url:_.pdp_photo_url??null,conversion:_.conversion,measurements_mm:_.measurements_mm??[],scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"catalogue_search"})),Gn=Ca?Mw:Xd,Ei=F?N[F.item.line_id]:void 0,Qn=!Ca&&Ei&&!Gn.some(_=>_.product_id===Ei.product_id)?[...Gn,Ei]:Gn,Zd=(()=>{let _=Qn.slice(0,Ca?12:3);return Ca||!Ei||_.some(O=>O.product_id===Ei.product_id)?_:[..._,Ei]})(),ol=!!F?.best&&a[F.item.line_id]?.productId===F.best.product_id,Tw=!!F?.best&&!!a[F.item.line_id]&&!ol;return(0,s.jsxs)("div",{className:"wizard-step entry-stage",children:[(0,s.jsxs)("div",{className:`quick-order-card${f?"":" quick-order-card--customer"}`,children:[(0,s.jsx)("div",{className:`quick-order-hero${f?"":" quick-order-hero--customer"}`,children:f?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,s.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,s.jsx)("h1",{children:"Your Results"}),(0,s.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,s.jsx)("strong",{children:at(J)})," Est. total"]})]}),(0,s.jsx)("p",{children:"Each line item from your schedule matched against your catalogue, ranked by confidence."})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{children:"Review your matched products"}),(0,s.jsxs)("p",{children:["Check you're happy with these items, then click ",b?"View Quote":"View Basket"," to continue."]})]}),(0,s.jsxs)("button",{type:"button",className:"results-total-action",onClick:i,"aria-label":b?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("small",{children:b?"View Quote":"View Basket"}),(0,s.jsx)("strong",{children:at(J)})]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Bt,{})})]})]})}),(0,s.jsxs)("div",{className:"quick-order-panel",style:{paddingTop:16},children:[He&&(0,s.jsx)("div",{className:"results-summary",style:{marginBottom:12},children:(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn","aria-pressed":ue,onClick:()=>Te(_=>!_),children:ue?"Hide timings":"Show timings"})}),He&&ue&&(0,s.jsx)(e_,{...U}),!b&&(0,s.jsx)("div",{className:"results-toolbar-row",children:!F&&(0,s.jsxs)("div",{className:"results-summary",style:{marginBottom:0},children:[me>0&&(0,s.jsxs)("span",{className:"summary-chip summary-chip--neutral",children:[(0,s.jsx)("strong",{children:me})," need pricing"]}),(0,s.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search description...",value:M,onChange:_=>R(_.target.value),"aria-label":"Search line items"}),!f&&(0,s.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,s.jsx)("button",{type:"button",className:`results-view-toggle__btn${K==="tile"?" is-active":""}`,"aria-pressed":K==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>Z("tile"),children:(0,s.jsxs)("svg",{width:"18",height:"12",viewBox:"0 0 15 10",fill:"currentColor",children:[(0,s.jsx)("rect",{x:"0.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"5.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"10.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"0.5",y:"5.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"5.5",y:"5.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"10.5",y:"5.5",width:"4",height:"4"})]})}),(0,s.jsx)("button",{type:"button",className:`results-view-toggle__btn${K==="list"?" is-active":""}`,"aria-pressed":K==="list","aria-label":"List view",title:"List view",onClick:()=>Z("list"),children:(0,s.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,s.jsx)("line",{x1:"0.5",y1:"2.5",x2:"14.5",y2:"2.5"}),(0,s.jsx)("line",{x1:"0.5",y1:"7.5",x2:"14.5",y2:"7.5"}),(0,s.jsx)("line",{x1:"0.5",y1:"12.5",x2:"14.5",y2:"12.5"})]})})]}),He&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>X(_=>_==="simple"?"detailed":"simple"),children:ze==="detailed"?"Hide detailed view":"Show detailed view"}),(0,s.jsxs)("details",{ref:Hn,style:{position:"relative"},children:[(0,s.jsx)("summary",{className:"bom-toolbar-btn sort-menu-summary","aria-label":"Sort line items",style:{fontSize:16},children:"\u21C5"}),(0,s.jsx)("div",{className:"sort-menu-panel",children:V1.map(_=>{let O=j===_.dir;return(0,s.jsxs)("button",{type:"button",className:`sort-menu-item${O?" is-active":""}`,onClick:()=>{W(O?null:_.dir),Hn.current?.removeAttribute("open")},children:[(0,s.jsx)("span",{className:"sort-menu-item__check",children:O?"\u2713":""}),_.label]},_.dir)})})]})]})]})}),K==="tile"||F?(0,s.jsxs)(s.Fragment,{children:[F?(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop",role:"dialog","aria-modal":"true","aria-label":"Product options",onClick:()=>hr(),children:(0,s.jsxs)("section",{className:"quick-order-workflow-modal results-review-modal",onClick:_=>_.stopPropagation(),children:[(0,s.jsx)("button",{type:"button",className:"quick-order-workflow-close results-review-modal__close",onClick:()=>hr(),"aria-label":"Close product options",children:(0,s.jsx)($o,{})}),(0,s.jsx)("div",{className:"results-review-page",children:f?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"results-review-page__top",children:[(0,s.jsxs)("button",{type:"button",className:"bom-toolbar-btn bom-toolbar-btn--accent",onClick:()=>hr(),children:[(0,s.jsx)(Vr,{}),"Back to results"]}),(0,s.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[He&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>X(_=>_==="simple"?"detailed":"simple"),children:ze==="detailed"?"Hide detailed info":"Show detailed info"}),(0,s.jsx)("div",{className:"results-review-searchbar",children:(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products in catalogue...",value:Qe,onChange:_=>ct(_.target.value),"aria-label":"Search database candidates"})}),(0,s.jsx)("div",{className:"results-candidate-actions",children:(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>dc(F.item.line_id),children:"Clear selected product"})})]})]}),(0,s.jsxs)("div",{className:"results-review-page__hero",children:[(0,s.jsx)("div",{className:"results-review-page__image-wrap",children:(0,s.jsx)("img",{className:"fill-img results-review-page__image",src:Ga(Ke(F)?.description||F.item.description_original,Ke(F)?.product_id,Ke(F)?.pdp_photo_url),alt:""})}),(0,s.jsxs)("div",{className:"results-review-page__summary",children:[(0,s.jsx)("h2",{children:Kr(F.item,w)}),(0,s.jsxs)("p",{className:"results-review-page__meta",children:[wi(F.qty)," ",xa(F.item.unit,F.qty)]}),F.best?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:F.best.description}),F.best.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:Cn(F.best.price,F.best.price_basis)}):null]}):Ke(F)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:Ke(F)?.description}),Ke(F)?.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:Cn(Ke(F)?.price??null,Ke(F)?.price_basis??null)}):null,(0,s.jsx)("div",{className:"results-row-meta",children:"Best reviewed alternative - not yet selected"})]}):(0,s.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line item."}),dr(F.item)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:8},children:[(0,s.jsx)(cd,{meta:S.get(F.item.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:qn(F.item)})]}):null,(0,s.jsx)("div",{className:"results-review-page__actions",children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[F.item.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[F.item.line_id]?n(F.item.line_id):(F.best&&Yd(F.item.line_id,F.best),r(qi(F)))},disabled:!F.best,"aria-label":a[F.item.line_id]?f?"Remove from selection":`Remove from ${d}`:f?"Add to selection":`Add to ${d}`,children:a[F.item.line_id]?"\u2713 Added":f?"+ Add to selection":`Add to ${d}`})})]})]}),G?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,!G&&fe?(0,s.jsx)("div",{className:"results-empty-card",children:fe}):null,!G&&!fe&&Ca&&Gn.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No candidate products match this database search."}):!G&&!fe?(0,s.jsx)(n_,{item:F.item,candidates:Gn,result:F.result,decision:F.decision,unmatchable:F.unmatchable,selectedProductId:F.best?.product_id??null,detailMode:ze,linkedGroupMeta:dr(F.item)?S.get(F.item.linked_group_id):void 0,onPick:_=>mc(F.item.line_id,_),onClear:()=>dc(F.item.line_id),showAll:f||He||Ca.length>0,internal:f,debugEnabled:He,forceReviewNote:!0}):null]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("section",{className:"customer-review-request",children:[(0,s.jsx)("span",{className:"customer-review-eyebrow",children:"Original request"}),(0,s.jsx)("strong",{children:Kr(F.item,w)||"Original request"})]}),Vd?(0,s.jsxs)("section",{className:"customer-review-ai",children:[(0,s.jsx)("strong",{children:nl?"Exact match not found:":"AI review:"})," ",Vd]}):null,(0,s.jsxs)("section",{className:"customer-review-options",children:[(0,s.jsx)("div",{className:"customer-review-options__head",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{children:nl?"We couldn't find a suitable product":$d?"Choose a product":"We couldn't review this item"}),(0,s.jsx)("p",{children:nl?Xd.length>0?"These AI-reviewed alternatives may be useful, but need approval.":"Search the catalogue to choose an alternative.":$d?`Select the option you want to add to your ${d}.`:"Search the catalogue to choose a product."})]})}),!Ca&&Qn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:Zd.map(_=>{let O=_.product_id===F.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${O?" is-selected":""}`,onClick:()=>mc(F.item.line_id,_),"aria-pressed":O,children:[(0,s.jsx)("img",{className:"customer-review-option__image",src:Ga(_.description,_.product_id,_.pdp_photo_url),alt:"",width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:_.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:_.price!=null?`\xA3${Cn(_.price,_.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:O?"Selected":"Choose"})]},_.product_id)})}):null,Qn.length>0&&(0,s.jsx)("div",{className:"customer-review-divider",children:(0,s.jsx)("span",{children:"or"})}),(0,s.jsxs)("label",{className:"customer-review-search",children:[(0,s.jsx)("span",{children:"Search our full catalogue"}),(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products...",value:Qe,onChange:_=>ct(_.target.value),"aria-label":"Search catalogue"})]}),Ca&&G?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,Ca&&!G&&fe?(0,s.jsx)("div",{className:"results-empty-card",children:fe}):null,Ca&&!G&&!fe&&Qn.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No products match this search."}):null,Ca&&!G&&!fe&&Qn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:Zd.map(_=>{let O=_.product_id===F.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${O?" is-selected":""}`,onClick:()=>mc(F.item.line_id,_),"aria-pressed":O,children:[(0,s.jsx)("img",{className:"customer-review-option__image",src:Ga(_.description,_.product_id,_.pdp_photo_url),alt:"",width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:_.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:_.price!=null?`\xA3${Cn(_.price,_.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:O?"Selected":"Choose"})]},_.product_id)})}):null]}),F.best?Tw?(0,s.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,s.jsx)("button",{type:"button",className:"cta-btn customer-review-add",onClick:()=>{Gd()},children:(0,s.jsx)("span",{children:"Update product"})}),(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-add",onClick:()=>n(F.item.line_id),children:(0,s.jsx)("span",{children:`Remove from ${d}`})})]}):(0,s.jsx)("button",{type:"button",className:`cta-btn customer-review-add${ol?" cta-btn-secondary":""}`,onClick:()=>{ol?n(F.item.line_id):Gd()},children:(0,s.jsx)("span",{children:ol?`Remove from ${d}`:`Add selected product to ${d}`})}):null,B?(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-skip",onClick:()=>qw(F.item.line_id),children:"Skip this item"}):null]})})]})}):null,(0,s.jsxs)("div",{className:"results-tile-layout",children:[pa.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No line items match the current search/filter."}):null,Ln.length>0?(0,s.jsx)("section",{className:"results-tile-section","aria-label":"Matched and review items",children:(0,s.jsx)("div",{className:"results-tile-grid",children:Ln.map(_=>{let{item:O,best:Ee,qty:Tt}=_,Xe=Ke(_),Pt=!Ee&&_e(_);return(0,s.jsxs)("article",{className:"results-tile-card",children:[(0,s.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>Ci(O.line_id),"aria-label":`Review match for ${Kr(O,w)||"item"}`,children:[(0,s.jsxs)("div",{className:"results-tile-card__media",children:[Pt||dr(O)?(0,s.jsxs)("div",{className:"results-tile-card__badges",children:[dr(O)?(0,s.jsx)(cd,{meta:S.get(O.linked_group_id)}):(0,s.jsx)("span",{}),Pt?(0,s.jsx)("span",{style:{padding:"6px 10px",borderRadius:999,background:"#fef3c7",color:"#92400e",fontSize:12,fontWeight:700,lineHeight:1},children:"Partially matched"}):null]}):null,(0,s.jsx)("img",{className:"fill-img results-tile-card__image",src:Ga(Xe?.description||O.description_original,Xe?.product_id,Xe?.pdp_photo_url),alt:""})]}),(0,s.jsxs)("div",{className:"results-tile-card__body",children:[Xe?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"results-tile-card__heading",children:(0,s.jsx)("div",{className:"results-tile-card__title",children:Xe.description})})}):(0,s.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line item."}),(0,s.jsx)("div",{className:"results-tile-card__match",children:Xe?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-tile-card__match-label",children:Pt?"\u21B3 partially matched from":"\u21B3 matched from"}),(0,s.jsx)("div",{className:"results-tile-card__match-name",children:Kr(O,w)}),dr(O)?(0,s.jsx)("div",{className:"results-row-meta",children:qn(O)}):null]}):(0,s.jsx)("span",{className:"results-empty-hint",children:"No matched product selected."})})]}),(0,s.jsx)("span",{className:"results-tile-card__hover-prompt","aria-hidden":"true",children:"Click to view options"})]}),(0,s.jsxs)("div",{className:"results-tile-card__actions",children:[f&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Ci(O.line_id),children:"Review"}),(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[O.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[O.line_id]?n(O.line_id):r(qi(_))},disabled:!Xe,"aria-label":a[O.line_id]?f?"Remove from selection":`Remove from ${d}`:f?"Add to selection":`Add to ${d}`,children:a[O.line_id]?"\u2713 Added":f?"+ Add":`Add to ${d}`})]})]},O.line_id)})})}):null,Qd]})]}):(0,s.jsxs)(s.Fragment,{children:[le&&(0,s.jsx)("div",{className:"results-table__hover-overlay",style:le,"aria-hidden":"true",children:"Click to view options"}),(0,s.jsx)("div",{className:"bom-table-wrap",children:(0,s.jsxs)("table",{className:"bom-table results-table","aria-label":"Matched line items",children:[(0,s.jsxs)("colgroup",{children:[(0,s.jsx)("col",{className:"col-item"}),(0,s.jsx)("col",{style:{width:"220px"}}),(0,s.jsx)("col",{style:{width:"100px"}}),ze==="simple"&&(0,s.jsx)("col",{style:{width:"110px"}})]}),(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"bom-col-header",children:[(0,s.jsx)("th",{style:{textAlign:"left"},children:"Description"}),(0,s.jsx)("th",{style:{textAlign:"center"},children:"Product Matched"}),(0,s.jsx)("th",{style:{textAlign:"center"},children:"Price"}),ze==="simple"&&(0,s.jsx)("th",{style:{textAlign:"center"},children:f?"Selection":b?"Quote":"Basket"})]})}),(0,s.jsxs)("tbody",{children:[pa.length===0&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:ze==="simple"?4:3,className:"results-empty-hint",style:{padding:"16px 8px"},children:"No line items match the current search/filter."})}),Ln.map(_=>{let{item:O,result:Ee,decision:Tt,best:Xe}=_;return(0,s.jsxs)("tr",{className:"bom-row results-table__review-row",onClick:()=>Ci(O.line_id),onMouseEnter:Pt=>{qe.current=Pt.currentTarget,jn()},onMouseLeave:()=>{qe.current=null,ve(null)},children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{className:"bom-component-name",children:Kr(O,w)}),dr(O)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:4},children:[(0,s.jsx)(cd,{meta:S.get(O.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:qn(O)})]}):null]}),(0,s.jsx)("td",{children:Xe?(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"results-match-cell-text",title:Xe.description,children:Xe.description}),ze==="detailed"&&Tt?.technical_classification&&(0,s.jsxs)("div",{className:"results-row-meta",children:[J1(Tt.technical_classification),Tt.approval_required?" - approval required":""]})]}):(0,s.jsx)("span",{className:"results-empty-hint"})}),(0,s.jsx)("td",{style:{textAlign:"center"},children:Xe?.price!=null?Cn(Xe.price,Xe.price_basis):"-"}),ze==="simple"&&(0,s.jsx)("td",{style:{textAlign:"center"},children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[O.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,style:{width:84,justifyContent:"center"},onClick:Pt=>{Pt.stopPropagation(),a[O.line_id]?n(O.line_id):r(qi(_))},"aria-label":a[O.line_id]?f?"Remove from selection":`Remove from ${d}`:f?"Add to selection":`Add to ${d}`,children:a[O.line_id]?"\u2713 Added":f?"+ Add":`Add to ${d}`})})]},O.line_id)})]})]})}),Qd]}),!F&&On>1&&(0,s.jsxs)("div",{className:"results-pagination",children:[(0,s.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(Jt-1)*Fo+1,"\u2013",Math.min(Jt*Fo,pa.length)," of ",pa.length]}),(0,s.jsxs)("div",{className:"results-pagination-controls",children:[(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Ce(Jt-1),disabled:Jt===1,children:"Previous"}),(0,s.jsxs)("span",{className:"results-pagination-page",children:["Page ",Jt," of ",On]}),(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Ce(Jt+1),disabled:Jt===On,children:"Next"})]})]}),(E.itemCount!=null||E.headingCount!=null||E.skippedCount!=null)&&(0,s.jsxs)("div",{className:"results-summary",style:{marginTop:16},children:[E.itemCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:E.itemCount})," items parsed"]}),E.headingCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:E.headingCount})," headings"]}),E.skippedCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:E.skippedCount})," rows skipped"]})]}),(0,s.jsxs)("div",{className:"disclaimer-box",children:[(0,s.jsx)("span",{className:"disclaimer-icon",children:"\u26A0\uFE0F"}),(0,s.jsx)("p",{className:"disclaimer-text",children:"These matches are generated automatically and should be reviewed before purchase."})]}),!F&&(0,s.jsxs)("div",{className:"btn-row results-actions",children:[(0,s.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:(fc>0,"0 1 30%"),gap:10,justifyContent:"center"},onClick:()=>z(!0),"aria-label":"Start over",children:[(0,s.jsx)(ld,{}),(0,s.jsx)("span",{children:"Start Over"})]}),fc>0&&(0,s.jsxs)("button",{className:"cta-btn",style:{flex:"0 1 70%"},onClick:i,"aria-label":f?"View selection":b?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[f?"View Selection":b?"View Quote":"View Basket"," (",fc,")"]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Bt,{})})]})]})]})]}),Nw&&(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop review-gate-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"review-gate-title",children:(0,s.jsxs)("section",{className:"quick-order-workflow-modal review-gate-modal",children:[(0,s.jsxs)("div",{className:"review-gate-modal__header",children:[(0,s.jsx)("h2",{id:"review-gate-title",children:"Choose products for these items"}),(0,s.jsx)("p",{children:"We couldn\u2019t find a clear match for these items, so we need your help. Select an option from the suggestions, search the catalogue, or leave the item out."})]}),(0,s.jsx)("div",{className:"review-gate-list",children:ca.map(_=>{let O=pt.has(_.item.line_id),Ee=_e(_);return(0,s.jsx)("div",{className:`review-gate-item${O?" is-reviewed":""}`,children:(0,s.jsxs)("button",{type:"button",className:"review-gate-item__review",onClick:()=>{ne(!0),Ci(_.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Kr(_.item,w)}),(0,s.jsx)("span",{children:_.decision?.reason||(Ee?"A close alternative is available but needs confirmation.":"No product has been selected for this item yet.")})]}),(0,s.jsx)("span",{className:"review-gate-item__action",children:O?"Choice made":"Choose a product"})]})},_.item.line_id)})}),(0,s.jsx)("button",{type:"button",className:"review-gate-skip",onClick:Ew,children:"Skip all"}),il.length>0?(0,s.jsxs)("div",{className:"review-gate-skipped",children:[(0,s.jsx)("strong",{children:"Skipped"}),il.map(_=>(0,s.jsxs)("button",{type:"button",className:"review-gate-item is-skipped",onClick:()=>{H(O=>{let Ee=new Set(O);return Ee.delete(_.item.line_id),Ee}),ne(!0),Ci(_.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Kr(_.item,w)}),(0,s.jsx)("span",{children:`Not added to your ${d}.`})]}),(0,s.jsx)("span",{className:"review-gate-item__action",children:"Choose a product"})]},_.item.line_id))]}):null]})}),C&&(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop start-over-modal",role:"dialog","aria-modal":"true","aria-labelledby":"start-over-modal-title",children:(0,s.jsxs)("div",{className:"modal-card start-over-modal__card",children:[(0,s.jsx)("h2",{id:"start-over-modal-title",className:"modal-title",children:"Start over?"}),(0,s.jsxs)("p",{className:"modal-body",children:["This will clear the current results and ",b?"quote":"basket"," and take you back to the start."]}),(0,s.jsxs)("div",{className:"modal-actions",children:[(0,s.jsx)("button",{type:"button",className:"modal-btn modal-btn-secondary",onClick:()=>z(!1),children:"Cancel"}),(0,s.jsx)("button",{type:"button",className:"modal-btn modal-btn-danger",onClick:()=>{z(!1),t()},autoFocus:!0,children:"Start Over"})]})]})})]})}var At=Y($e());var q=Y(re()),o_=.2,Io=10,l_=(e,t)=>{let a=`${t.requestedAmount} ${Ta(t.requestedUnit,t.requestedAmount)}`,r=`${t.requiredSellUnits} ${Ta(t.sellUnit,t.requiredSellUnits??0)}`,n=e.unitConversions?.find(i=>i.requestUom===t.requestedUnit);return n&&n.quantityPerSaleUnit<1?`${a} requested \u2192 order ${r} (${Math.round(1/n.quantityPerSaleUnit)} ${Ta(t.sellUnit,2)} per ${Ta(t.requestedUnit,1)})`:e.coverageQty&&/^m per /i.test(e.coverageUom??"")?`${a} requested \u2192 order ${r} (${e.coverageQty} ${e.coverageUom})`:`${a} requested \u2192 order ${r}`},s_=e=>["box","pack"].includes(e.requestedUnit)?"Pack size needed to calculate the order quantity.":`This product is sold by ${Ta(e.sellUnit,1)}.`;function c_(){return(0,q.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,q.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,q.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,q.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,q.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}function Wo(){return(0,q.jsx)("svg",{width:"8",height:"5",viewBox:"0 0 8 5",fill:"none",children:(0,q.jsx)("path",{d:"M1 4L4 1L7 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function el({cart:e,onUpdateQty:t,onUpdateSellUnits:a,onResolveConversions:r,onRemove:n,onBack:i,internal:o=!1}){let l=(0,At.useId)(),c=!o&&Ls()==="QZA6-MRA4",u=Object.values(e),[f,b]=(0,At.useState)(""),[d,h]=(0,At.useState)(!1),[w,E]=(0,At.useState)(""),[U,m]=(0,At.useState)({}),[p,g]=(0,At.useState)({}),[v,N]=(0,At.useState)(1),[T,M]=(0,At.useState)({}),[R,j]=(0,At.useState)(!1),[W,ye]=(0,At.useState)("0"),Ce=(0,At.useRef)(new Set);(0,At.useEffect)(()=>{if(!r)return;let G=Object.values(e).filter(P=>P.productId!=="-"&&za(P).requiredSellUnits==null&&!Ce.current.has(P.lineId));G.length!==0&&(G.forEach(P=>Ce.current.add(P.lineId)),fetch(Vt("/api/catalogue/resolve-conversions"),{method:"POST",headers:{"Content-Type":"application/json",...pr()},body:JSON.stringify({lines:G.map(P=>({line_id:P.lineId,product_id:P.productId,requested_description:P.requestedDescription??P.description,requested_qty:P.qty,requested_uom:P.unit,selected_description:P.description,selected_uoi:P.uoi,selected_uoi_count:P.uoiCount,selected_conversion:{sales_uom_normalised:P.salesUomNormalised,conversion_type:P.conversionType,sales_unit_size:P.salesUnitSize,sales_unit_size_uom:P.salesUnitSizeUom,coverage_qty:P.coverageQty,coverage_uom:P.coverageUom}}))})}).then(P=>P.ok?la(P):null).then(P=>{let fe={};for(let gt of P?.data?.items??P?.items??[]){let C=gt?.conversion;!C||typeof gt?.line_id!="string"||(fe[gt.line_id]={conversionType:C.conversion_type,requestUomsSupported:C.request_uoms_supported,salesUomNormalised:C.sales_uom_normalised,salesUnitSize:C.sales_unit_size,salesUnitSizeUom:C.sales_unit_size_uom,coverageQty:C.coverage_qty,coverageUom:C.coverage_uom,roundingRule:C.rounding_rule,conversionConfidence:C.conversion_confidence,conversionNotes:C.conversion_notes})}Object.keys(fe).length>0&&r(fe)}).catch(()=>{}))},[e,r]);function He(G){m(P=>{let fe={...P};return delete fe[G],fe})}function We(G,P){let fe=parseFloat(P);!isNaN(fe)&&fe>=0&&t(G,fe),He(G)}function ze(G,P,fe){t(G,Math.max(0,P+fe)),He(G)}function X(G){g(P=>{let fe={...P};return delete fe[G],fe})}function K(G,P){let fe=parseFloat(P);!isNaN(fe)&&fe>=0&&a(G,fe),X(G)}function Z(G,P,fe){a(G,Math.max(0,P+fe)),X(G)}function ue(){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(f.trim())){E("Enter a valid email address so we can send your better price.");return}E(""),h(!0)}let Te=u.map(G=>({item:G,pricing:za(G,{wasteFactorEnabled:R,wasteFactorOverride:Math.max(0,Number.parseFloat(W)||0)/100})})),pe=Te.reduce((G,P)=>G+(P.pricing.lineTotal??0),0),De=pe*o_,Qe=pe+De,ct=Math.max(1,Math.ceil(Te.length/Io)),Ze=Math.min(v,ct),Lt=Te.slice((Ze-1)*Io,Ze*Io);return(0,q.jsx)("div",{className:`wizard-step entry-stage${c?" basket-layout--qza6-mra4":""}`,children:(0,q.jsxs)("div",{className:`quick-order-card${o?"":" quick-order-card--customer"}`,children:[(0,q.jsxs)("div",{className:`quick-order-hero${o?"":" quick-order-hero--customer"}`,children:[o&&(0,q.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,q.jsxs)("div",{className:"basket-hero-copy",children:[c&&(0,q.jsxs)("button",{type:"button",className:"cta-btn cta-btn-secondary basket-hero-back",onClick:i,children:[(0,q.jsx)(Vr,{}),(0,q.jsx)("span",{children:"Back to results"})]}),(0,q.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,q.jsx)("h1",{children:o?"Your Selection":c?"Request a better price":"Your Basket"}),o&&(0,q.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,q.jsx)("strong",{children:u.length})," ",u.length===1?"item":"items"]})]}),(0,q.jsx)("p",{children:o?"Review the items you&apos;ve added before exporting them for review.":c?"Check your quantities, then request a better price.":"Review your quantities and order summary before you buy."})]})]}),(0,q.jsx)("div",{className:"quick-order-panel",style:{paddingTop:16},children:u.length===0?(0,q.jsxs)("div",{className:"quick-order-history-empty",children:[(0,q.jsx)("div",{className:"basket-empty-icon","aria-hidden":"true",children:o?"\u{1F4CB}":"\u{1F9FA}"}),(0,q.jsx)("p",{children:o?"Your selection is empty.":c?"Your quote request is empty.":"Your basket is empty."}),(0,q.jsx)("p",{className:"basket-empty-hint",children:c?"Go back to your results and add items for your quote.":"Go back to your results and add quoted items."}),(0,q.jsx)("div",{className:"btn-row",style:{marginTop:20,justifyContent:"center"},children:(0,q.jsx)("button",{className:"cta-btn",style:{width:"auto",maxWidth:280},onClick:i,"aria-label":"Back to results",children:(0,q.jsx)("span",{children:"Back to Results"})})})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)("div",{className:"basket-layout",children:[(0,q.jsxs)("div",{className:"basket-main",children:[(0,q.jsx)("div",{className:"basket-list","aria-label":o?"Selection items":c?"Quote request items":"Basket items",children:Lt.map(({item:G,pricing:P})=>{let fe=U[G.lineId]??String(P.requestedAmount),gt=P.requestedUnit===P.sellUnit||P.costingMode==="review",C=P.requiredSellUnits==null||P.requestedAmount!==P.requiredSellUnits||P.requestedUnit!==P.sellUnit;return(0,q.jsxs)("article",{className:"basket-card",children:[(0,q.jsxs)("div",{className:"basket-card-top",children:[(0,q.jsx)("img",{className:"basket-card-thumb",src:Ga(G.description,G.productId,G.pdpPhotoUrl),alt:"",width:48,height:48}),(0,q.jsxs)("div",{className:"basket-card-info",children:[(0,q.jsx)("div",{className:"bom-component-name",children:G.description}),C&&P.costingMode!=="review"&&(0,q.jsxs)("button",{type:"button",className:"basket-calc-toggle",onClick:()=>M(z=>({...z,[G.lineId]:!z[G.lineId]})),"aria-expanded":!!T[G.lineId],children:["How we calculated this",(0,q.jsx)("span",{className:`basket-calc-toggle-chevron${T[G.lineId]?" basket-calc-toggle-chevron--open":""}`,children:(0,q.jsx)(Wo,{})})]})]}),(0,q.jsx)("div",{className:"basket-card-actions",children:(0,q.jsx)("button",{type:"button",className:"mf-remove-small-btn basket-card-remove",onClick:()=>n(G.lineId),"aria-label":`Remove ${G.description}`,children:(0,q.jsx)(c_,{})})})]}),o&&(0,q.jsxs)("div",{className:"results-detail-block basket-internal-detail",children:[(0,q.jsxs)("dl",{className:"results-detail-grid",children:[(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Conversion type"}),(0,q.jsx)("dd",{children:G.conversionType??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Conversion confidence"}),(0,q.jsx)("dd",{children:G.conversionConfidence??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Sales unit"}),(0,q.jsx)("dd",{children:G.salesUnitSize!=null?(0,q.jsxs)(q.Fragment,{children:[G.salesUnitSize," ",xa(G.salesUnitSizeUom,G.salesUnitSize)]}):"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Coverage"}),(0,q.jsx)("dd",{children:G.coverageQty!=null?(0,q.jsxs)(q.Fragment,{children:[G.coverageQty," ",xa(G.coverageUom,G.coverageQty)]}):"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Waste factor"}),(0,q.jsx)("dd",{children:G.wasteFactorDefault??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Rounding rule"}),(0,q.jsx)("dd",{children:G.roundingRule??"-"})]})]}),G.conversionNotes&&(0,q.jsx)("p",{className:"results-rerank-note",children:G.conversionNotes})]}),P.costingMode==="review"?(0,q.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,q.jsx)("strong",{children:"Quantity needs confirmation."})," ",s_(P)]}):C&&T[G.lineId]?(0,q.jsx)("p",{className:"basket-calc-text",children:l_(G,P)}):null,(0,q.jsxs)("div",{className:"basket-card-stats",children:[(0,q.jsxs)("div",{className:"basket-stat",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Requested qty"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsxs)("div",{className:"basket-qty-field",children:[(0,q.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:fe,disabled:gt,onChange:z=>m(le=>({...le,[G.lineId]:z.target.value})),onBlur:z=>We(G.lineId,z.target.value),onKeyDown:z=>{z.key==="Enter"&&z.target.blur()},"aria-label":`${G.description} requested quantity`}),(0,q.jsxs)("div",{className:"basket-qty-arrows",children:[(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow",disabled:gt,onClick:()=>ze(G.lineId,parseFloat(fe)||0,1),"aria-label":`Increase ${G.description} quantity`,children:(0,q.jsx)(Wo,{})}),(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",disabled:gt,onClick:()=>ze(G.lineId,parseFloat(fe)||0,-1),"aria-label":`Decrease ${G.description} quantity`,children:(0,q.jsx)(Wo,{})})]})]}),(0,q.jsx)("span",{className:"basket-metric-unit",children:xa(P.requestedUnit,parseFloat(fe)||0)})]})]}),(0,q.jsxs)("div",{className:"basket-stat basket-stat--right",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Order qty"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsxs)("div",{className:"basket-qty-field",children:[(0,q.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:p[G.lineId]??String(P.requiredSellUnits??""),onChange:z=>g(le=>({...le,[G.lineId]:z.target.value})),onBlur:z=>K(G.lineId,z.target.value),onKeyDown:z=>{z.key==="Enter"&&z.target.blur()},"aria-label":`${G.description} order quantity`}),(0,q.jsxs)("div",{className:"basket-qty-arrows",children:[(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow",onClick:()=>Z(G.lineId,parseFloat(p[G.lineId]??String(P.requiredSellUnits??"0"))||0,1),"aria-label":`Increase ${G.description} order quantity`,children:(0,q.jsx)(Wo,{})}),(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",onClick:()=>Z(G.lineId,parseFloat(p[G.lineId]??String(P.requiredSellUnits??"0"))||0,-1),"aria-label":`Decrease ${G.description} order quantity`,children:(0,q.jsx)(Wo,{})})]})]}),(0,q.jsx)("span",{className:"basket-metric-unit",children:xa(P.sellUnit,parseFloat(p[G.lineId]??String(P.requiredSellUnits??"0"))||0)})]})]}),(0,q.jsxs)("div",{className:"basket-stat basket-stat--total",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Total"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsx)("strong",{children:P.lineTotal!=null?at(P.lineTotal):"-"}),P.lineTotal!=null&&(0,q.jsx)("span",{className:"basket-metric-unit",children:"ex. VAT"})]})]})]})]},G.lineId)})}),ct>1&&(0,q.jsxs)("div",{className:"results-pagination",children:[(0,q.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(Ze-1)*Io+1,"\u2013",Math.min(Ze*Io,Te.length)," of ",Te.length]}),(0,q.jsxs)("div",{className:"results-pagination-controls",children:[(0,q.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>N(Ze-1),disabled:Ze===1,children:"Previous"}),(0,q.jsxs)("span",{className:"results-pagination-page",children:["Page ",Ze," of ",ct]}),(0,q.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>N(Ze+1),disabled:Ze===ct,children:"Next"})]})]})]}),(0,q.jsxs)("aside",{className:"basket-sidebar",children:[(0,q.jsx)("div",{className:"basket-sidebar-title",children:c?"Quote request summary":"Order summary"}),(0,q.jsxs)("div",{className:"basket-sidebar-row",children:[(0,q.jsx)("span",{children:c?"Standard price (ex. VAT)":"Subtotal (ex. VAT)"}),(0,q.jsx)("span",{children:at(pe)})]}),(0,q.jsxs)("div",{className:"basket-sidebar-row",children:[(0,q.jsx)("span",{children:"VAT (20%)"}),(0,q.jsx)("span",{children:at(De)})]}),(0,q.jsxs)("div",{className:"basket-sidebar-row basket-sidebar-row--total",children:[(0,q.jsx)("span",{children:c?"Standard price (inc. VAT)":"Total"}),(0,q.jsx)("span",{children:at(Qe)})]}),!c&&(0,q.jsx)("div",{className:"basket-summary-waste",children:(0,q.jsxs)("div",{className:"basket-waste-control",children:[(0,q.jsxs)("label",{className:"basket-global-waste",children:[(0,q.jsx)("input",{type:"checkbox",checked:R,onChange:G=>j(G.target.checked)}),(0,q.jsx)("span",{children:"Add waste factor"})]}),(0,q.jsxs)("label",{className:"basket-global-waste-percent",children:[(0,q.jsx)("input",{type:"number",inputMode:"decimal",min:"0",step:"0.1",value:W,onChange:G=>ye(G.target.value),disabled:!R,"aria-label":"Waste factor percent"}),(0,q.jsx)("span",{children:"%"})]})]})}),(0,q.jsx)("label",{htmlFor:`${l}-basket-reference`,className:"basket-sidebar-label",children:c?"Email for your better price":"Your reference (optional)"}),(0,q.jsx)("input",{id:`${l}-basket-reference`,type:c?"email":"text",className:"basket-sidebar-input",value:f,onChange:G=>{b(G.target.value),c&&E("")},placeholder:c?"you@example.com":"PO number or job reference"}),c&&w&&(0,q.jsx)("p",{className:"basket-quote-request-error",role:"alert",children:w}),c?d?(0,q.jsxs)("div",{className:"basket-quote-request-success",role:"status",children:[(0,q.jsx)("strong",{children:"Better price requested"}),(0,q.jsx)("span",{children:"We'll use this email address to prepare your better price."})]}):(0,q.jsx)("button",{type:"button",className:"cta-btn",onClick:ue,children:(0,q.jsx)("span",{children:"Get a better price"})}):(0,q.jsx)("button",{className:"cta-btn",onClick:()=>{Zv(u)},"aria-label":o?"Download selection":"Download basket",children:(0,q.jsx)("span",{children:o?"Download Quote":"Buy Now"})}),(0,q.jsxs)("p",{className:"basket-sidebar-disclaimer",children:[(0,q.jsx)("span",{"aria-hidden":"true",children:"\u26A0\uFE0F"}),c?"This is a quote request, not an order. We'll confirm your better price, availability and delivery before you approve.":"Prices and availability are estimates and should be confirmed before procurement."]})]})]}),(0,q.jsx)("div",{className:"btn-row results-actions",children:(0,q.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",gap:10,justifyContent:"center"},onClick:i,"aria-label":"Back to results",children:[(0,q.jsx)(Vr,{}),(0,q.jsx)("span",{children:"Back to results"})]})})]})})]})})}var Et=Y($e()),Iv=Y(re()),md=(0,Et.createContext)(null);function $s({children:e,onOpenBasket:t}){let[a,r]=(0,Et.useState)({}),n=(0,Et.useCallback)(d=>{r(h=>({...h,[d.lineId]:d}))},[]),i=(0,Et.useCallback)(d=>{r(h=>{let w={...h};for(let E of d)w[E.lineId]=E;return w})},[]),o=(0,Et.useCallback)(d=>{r(h=>{let w={...h};return delete w[d],w})},[]),l=(0,Et.useCallback)((d,h)=>{r(w=>w[d]?{...w,[d]:{...w[d],qty:h,sellUnitsOverride:null}}:w)},[]),c=(0,Et.useCallback)((d,h)=>{r(w=>w[d]?{...w,[d]:{...w[d],sellUnitsOverride:h}}:w)},[]),u=(0,Et.useCallback)(d=>{r(h=>{let w=!1,E={...h};for(let[U,m]of Object.entries(d))E[U]&&(E[U]={...E[U],...m},w=!0);return w?E:h})},[]),f=(0,Et.useCallback)(()=>r({}),[]),b=(0,Et.useMemo)(()=>({cart:a,count:Object.keys(a).length,addToCart:n,addManyToCart:i,removeFromCart:o,updateCartQty:l,updateCartSellUnits:c,updateCartConversions:u,clearCart:f,openBasket:t??(()=>{})}),[a,n,i,o,l,c,u,f,t]);return(0,Iv.jsx)(md.Provider,{value:b,children:e})}function En(){let e=(0,Et.useContext)(md);if(!e)throw new Error("useCart must be used inside a <CartProvider>");return e}function Vs(){return(0,Et.useContext)(md)}var Aa=Y(re());function Zs(e){return(0,Aa.jsx)($s,{children:(0,Aa.jsx)(p_,{...e})})}function p_({fullPage:e=!1,hideHeader:t=!1,internal:a=!1}){let[r,n]=(0,ot.useState)("entry"),[i,o]=(0,ot.useState)(null),[l,c]=(0,ot.useState)(""),u=(0,ot.useRef)(null),[f,b]=(0,ot.useState)(0),[d,h]=(0,ot.useState)(null),[w,E]=(0,ot.useState)(!1),{cart:U,addToCart:m,removeFromCart:p,updateCartQty:g,updateCartSellUnits:v,updateCartConversions:N,clearCart:T}=En(),[M,R]=(0,ot.useState)(!1),j=(0,ot.useRef)(new Map);(0,ot.useEffect)(()=>{let K=Object.values(U).filter(Z=>{if(Z.productId==="-"||za(Z).requiredSellUnits!=null)return!1;let ue=`${Z.productId}|${Z.qty}|${Z.unit}`;return j.current.get(Z.lineId)===ue?!1:(j.current.set(Z.lineId,ue),!0)});K.length!==0&&fetch(Vt("/api/catalogue/resolve-conversions"),{method:"POST",headers:{"Content-Type":"application/json",...pr()},body:JSON.stringify({lines:K.map(Z=>({line_id:Z.lineId,product_id:Z.productId,requested_description:Z.requestedDescription??Z.description,requested_qty:Z.qty,requested_uom:Z.unit,selected_description:Z.description,selected_uoi:Z.uoi,selected_uoi_count:Z.uoiCount,selected_conversion:{sales_uom_normalised:Z.salesUomNormalised,conversion_type:Z.conversionType,sales_unit_size:Z.salesUnitSize,sales_unit_size_uom:Z.salesUnitSizeUom,coverage_qty:Z.coverageQty,coverage_uom:Z.coverageUom}}))})}).then(Z=>Z.ok?la(Z):null).then(Z=>{let ue={};for(let Te of Z?.data?.items??Z?.items??[]){let pe=Te?.conversion;!pe||typeof Te?.line_id!="string"||(ue[Te.line_id]={conversionType:pe.conversion_type,requestUomsSupported:pe.request_uoms_supported,salesUomNormalised:pe.sales_uom_normalised,salesUnitSize:pe.sales_unit_size,salesUnitSizeUom:pe.sales_unit_size_uom,coverageQty:pe.coverage_qty,coverageUom:pe.coverage_uom,roundingRule:pe.rounding_rule,conversionConfidence:pe.conversion_confidence,conversionNotes:pe.conversion_notes})}Object.keys(ue).length>0&&N(ue)}).catch(()=>{})},[U,N]),(0,ot.useEffect)(()=>{if(window.location.hash!=="#matched-products"&&window.location.hash!=="#quote-request")return;let K=new URL(window.location.href);K.hash="",window.history.replaceState({...window.history.state??{},boqQuoteStage:"entry"},"",K)},[]);let W=(0,ot.useCallback)(K=>{if(typeof window>"u")return;let Z=new URL(window.location.href);Z.hash=K==="basket"?"quote-request":"matched-products";let ue={...window.history.state??{},boqQuoteStage:K};window.history.pushState(ue,"",Z)},[]);(0,ot.useEffect)(()=>{let K=Z=>{let ue=Z.state?.boqQuoteStage;n(ue==="basket"?"basket":ue==="results"&&d?"results":"entry")};return window.addEventListener("popstate",K),()=>window.removeEventListener("popstate",K)},[d]);let ye=(0,ot.useCallback)(()=>{W("basket"),n("basket"),window.scrollTo(0,0)},[W]),Ce=(0,ot.useCallback)(()=>{window.history.state?.boqQuoteStage==="basket"?window.history.back():n(d?"results":"entry")},[d]),He=()=>{n("entry"),o(null),c(""),b(0),h(null),E(!1),T(),R(!1)},We=(0,ot.useCallback)(async(K,Z,ue=!0)=>{c(""),b(0);let Te=0,pe=()=>{Te=Math.min(Te+1,3),b(Te)};try{let{jobId:De}=await Zb(K,Z,ue),{promise:Qe,cancel:ct}=Jb(()=>Kb(De),5e3,pe,"schedule");u.current=ct;let Ze=await Qe;if(Ze.status==="failed"||!Ze.result)throw new Error(Ze.error||"Failed to process schedule");E(!1),h(Ze.result),W("results"),n("results")}catch(De){c(De?.message||"Failed to process schedule"),n("entry")}finally{u.current?.(),u.current=null}},[W]),ze=(0,ot.useCallback)(async(K,Z,ue=!0)=>{let Te=K.trim();if(!Te)return;o("schedule");let pe=new File([Te],"pasted-schedule.txt",{type:"text/plain"});await We(pe,Z,ue)},[We]),X=(0,ot.useCallback)(async K=>{o("schedule"),await We(K)},[We]);return(0,Aa.jsx)("div",{className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}${!e&&r==="processing"?" app-wrapper--loading":""}`,style:hi().theme,children:(0,Aa.jsxs)("main",{className:"main-content",children:[l&&(0,Aa.jsxs)("div",{className:"error-box",role:"alert",children:[(0,Aa.jsx)("strong",{children:"Error:"})," ",l]}),r==="entry"&&(0,Aa.jsx)(nd,{onPasteSchedule:ze,onUploadSchedule:X,onEntryModeChange:o}),r==="results"&&i==="schedule"&&d&&(0,Aa.jsx)(dd,{scheduleResult:d,onStartOver:He,cart:U,onAddToCart:m,onRemoveFromCart:p,onGoToBasket:ye,cartSeeded:M,onCartSeeded:()=>R(!0),reviewGateComplete:w,onReviewGateComplete:()=>E(!0),internal:a}),r==="basket"&&(0,Aa.jsx)(el,{cart:U,onUpdateQty:g,onUpdateSellUnits:v,onRemove:p,onBack:Ce,internal:a})]})})}var cc=Y($e());var _i=Y($e()),ae=Y(re()),Wv=[{id:"ogee",label:"Ogee",blurb:"Traditional curved profile"},{id:"torus",label:"Torus",blurb:"Soft rounded detail"},{id:"ovolo",label:"Ovolo",blurb:"Traditional rounded profile"},{id:"pencil-round",label:"Pencil round",blurb:"Simple softened edge"},{id:"square-edge",label:"Square edge",blurb:"Clean contemporary edge"}],Ks=e=>Number.parseFloat(e)||0,ew=(e,t)=>Ks(e)*(t==="m"?1:.3048),fd=(e,t)=>Ks(e.quantity)*(2*ew(e.height,t)+ew(e.width,t)),u_=()=>({quantity:"1",width:"",height:""});function d_({profile:e}){return(0,ae.jsxs)("svg",{className:"architrave-calculator__profile-diagram",viewBox:"0 0 112 76","aria-hidden":"true",children:[(0,ae.jsx)("path",{d:{ogee:"M18 62 V38 C18 28 28 22 40 22 H78 C88 22 94 28 94 38 V62",torus:"M18 62 V40 C18 27 30 20 42 20 C54 20 58 30 66 30 C74 30 78 20 90 20 C102 20 94 34 94 40 V62",ovolo:"M18 62 V38 C18 28 30 20 42 20 H70 C82 20 94 28 94 38 V62","pencil-round":"M18 62 V38 C18 28 28 20 40 20 H72 C84 20 94 28 94 38 V62","square-edge":"M18 62 V20 H94 V62"}[e]}),(0,ae.jsx)("line",{x1:"12",y1:"66",x2:"100",y2:"66"})]})}function gd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,_i.useState)("m"),[i,o]=(0,_i.useState)({quantity:"1",width:"0.76",height:"1.98"}),[l,c]=(0,_i.useState)({quantity:"0",width:"1.52",height:"1.98"}),[u,f]=(0,_i.useState)([]),[b,d]=(0,_i.useState)("ogee"),[h,w]=(0,_i.useState)("2.4"),E=(N,T,M)=>{N(R=>({...R,[T]:M}))},U=fd(i,r)+fd(l,r)+u.reduce((N,T)=>N+fd(T,r),0),m=Ks(h)>0?Math.ceil(U/Ks(h)):0,p=Wv.find(N=>N.id===b)?.label??"",g=[{key:`architrave-${b}`,label:`Architrave (${p})`,qty:U,unit:"m",query:`${p} architrave`,category:"architrave"}],v=(N,T,M,R)=>(0,ae.jsxs)("div",{className:"architrave-calculator__opening-row",children:[(0,ae.jsx)("span",{children:N}),(0,ae.jsx)("input",{"aria-label":`${N} quantity`,type:"number",min:"0",step:"1",value:T.quantity,onChange:j=>M("quantity",j.target.value)}),(0,ae.jsx)("input",{"aria-label":`${N} width`,type:"number",min:"0",step:"0.01",value:T.width,onChange:j=>M("width",j.target.value)}),(0,ae.jsx)("input",{"aria-label":`${N} height`,type:"number",min:"0",step:"0.01",value:T.height,onChange:j=>M("height",j.target.value)}),R?(0,ae.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:R,children:"Remove"}):null]});return(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsxs)("div",{className:"truss-estimator",children:[(0,ae.jsxs)("div",{className:"quick-order-hero",children:[(0,ae.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ae.jsx)("h1",{children:"Architrave Calculator"}),(0,ae.jsx)("p",{children:"Estimate architrave lengths and board quantities for door openings."})]}),(0,ae.jsxs)("div",{className:"truss-estimator__card architrave-calculator",children:[(0,ae.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure your openings"}),(0,ae.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter each door or window opening. Mitred corners are allowed for, and board lengths are worked out from the net run."}),(0,ae.jsxs)("div",{className:"architrave-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Door openings"}),(0,ae.jsx)("p",{className:"architrave-calculator__hint",children:"Each opening is calculated as two side pieces plus one head piece."}),(0,ae.jsxs)("div",{className:"architrave-calculator__unit-row",children:[(0,ae.jsx)("span",{children:"Units"}),(0,ae.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,ae.jsx)("button",{type:"button",className:r==="m"?"is-selected":"",onClick:()=>n("m"),children:"Metres"}),(0,ae.jsx)("button",{type:"button",className:r==="ft"?"is-selected":"",onClick:()=>n("ft"),children:"Feet"})]})]}),(0,ae.jsxs)("div",{className:"architrave-calculator__dimensions-header",children:[(0,ae.jsx)("span",{children:"Opening"}),(0,ae.jsx)("span",{children:"Qty"}),(0,ae.jsxs)("span",{children:["Width (",r,")"]}),(0,ae.jsxs)("span",{children:["Height (",r,")"]}),(0,ae.jsx)("span",{})]}),v("Single doors",i,(N,T)=>E(o,N,T)),v("Double doors",l,(N,T)=>E(c,N,T)),u.map((N,T)=>v(`Alternative door ${T+1}`,N,(M,R)=>f(j=>j.map((W,ye)=>ye===T?{...W,[M]:R}:W)),()=>f(M=>M.filter((R,j)=>j!==T)))),(0,ae.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>f(N=>[...N,u_()]),children:"+ Add alternative-sized door"})]}),(0,ae.jsxs)("div",{className:"architrave-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Standard profile"}),(0,ae.jsx)("p",{className:"architrave-calculator__hint",children:"Choose the profile you plan to use. Length calculations are the same for each profile."}),(0,ae.jsx)("div",{className:"architrave-calculator__profiles",children:Wv.map(N=>(0,ae.jsxs)("button",{type:"button",className:`truss-estimator__option-card${b===N.id?" is-selected":""}`,onClick:()=>d(N.id),children:[(0,ae.jsx)(d_,{profile:N.id}),(0,ae.jsx)("div",{className:"truss-estimator__option-title",children:N.label}),(0,ae.jsx)("div",{className:"truss-estimator__option-copy",children:N.blurb})]},N.id))})]}),(0,ae.jsxs)("div",{className:"architrave-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,ae.jsx)("div",{className:"architrave-calculator__options",children:(0,ae.jsxs)("label",{className:"truss-estimator__field",children:[(0,ae.jsx)("span",{children:"Board length (m)"}),(0,ae.jsx)("input",{value:"4.40 m",disabled:!0})]})}),(0,ae.jsx)("p",{className:"architrave-calculator__hint",children:"Waste allows for mitred corners, cuts and damaged lengths."})]}),(0,ae.jsxs)("div",{className:"architrave-calculator__totals",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ae.jsxs)("div",{className:"architrave-calculator__result-grid",children:[(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Architrave needed"}),(0,ae.jsxs)("strong",{children:[U.toFixed(2)," m"]})]}),(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Board lengths"}),(0,ae.jsx)("strong",{children:m})]})]})]}),(0,ae.jsxs)("div",{className:"architrave-calculator__actions",children:[(0,ae.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ae.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(g),disabled:U<=0,children:a})]})]})]})})}var xi=Y($e()),ce=Y(re()),tw=60,aw=10,m_=.02,f_=.012,g_=.01,Mn=e=>Number.parseFloat(e)||0,h_=(e,t=2)=>e.toFixed(t);function hd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,xi.useState)("brick"),[i,o]=(0,xi.useState)("engineering-red"),[l,c]=(0,xi.useState)("metric"),[u,f]=(0,xi.useState)(""),[b,d]=(0,xi.useState)(""),[h,w]=(0,xi.useState)(!0),E=l==="metric"?Mn(u)*Mn(b):Mn(u)*Mn(b)*.092903,m=E*(r==="brick"?tw:aw),p=Math.ceil(m),g=E*(r==="brick"?m_:f_),v=Math.ceil(g/g_),N=l==="metric"?E:E*10.7639,T=[{key:r==="brick"?`brick-${i}`:"block",label:r==="brick"?{common:"Common concrete bricks","engineering-red":"Red engineering bricks","engineering-blue":"Blue engineering bricks"}[i]:"Blocks",qty:p,unit:"each",query:r==="brick"?"facing brick":"concrete block",category:"masonry"},...h?[{key:"mortar",label:"Blue Circle Quality Assured Mortar Mix 20kg",qty:v,unit:"bag",query:"ready mixed mortar",category:"mortar"}]:[]],M=R=>{if(R===l)return;let j=R==="imperial"?3.28084:.3048;f((Mn(u)*j).toFixed(2)),d((Mn(b)*j).toFixed(2)),c(R)};return(0,ce.jsx)(ce.Fragment,{children:(0,ce.jsxs)("div",{className:"truss-estimator",children:[(0,ce.jsxs)("div",{className:"quick-order-hero",children:[(0,ce.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ce.jsx)("h1",{children:"Brick & Block Calculator"}),(0,ce.jsx)("p",{children:"Estimate masonry units, sand and cement for a wall."})]}),(0,ce.jsxs)("div",{className:"truss-estimator__card brick-calculator",children:[(0,ce.jsx)("h2",{className:"truss-estimator__step-title",children:"Wall area and masonry type"}),(0,ce.jsx)("p",{className:"truss-estimator__step-sub",children:"Pick brick or block and enter the wall dimensions for unit counts plus ready-mixed mortar."}),(0,ce.jsxs)("div",{className:"brick-calculator__section",children:[(0,ce.jsx)("div",{className:"truss-estimator__section-heading",children:"Masonry type"}),(0,ce.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[["brick","Brick"],["block","Block"]].map(([R,j])=>(0,ce.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===R?" is-selected":""}`,onClick:()=>n(R),children:[(0,ce.jsx)("div",{className:"truss-estimator__option-title",children:j}),(0,ce.jsxs)("div",{className:"truss-estimator__option-copy",children:["Approx. ",R==="brick"?tw:aw," per m\xB2"]})]},R))})]}),r==="brick"&&(0,ce.jsxs)("div",{className:"brick-calculator__section",children:[(0,ce.jsx)("div",{className:"truss-estimator__section-heading",children:"Brick type"}),(0,ce.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:[["common","Common concrete","General-purpose grey concrete brick"],["engineering-red","Engineering red","Class B perforated, 65mm"],["engineering-blue","Engineering blue","Class B solid, 65mm"]].map(([R,j,W])=>(0,ce.jsxs)("button",{type:"button",className:`truss-estimator__option-card${i===R?" is-selected":""}`,onClick:()=>o(R),children:[(0,ce.jsx)("div",{className:"truss-estimator__option-title",children:j}),(0,ce.jsx)("div",{className:"truss-estimator__option-copy",children:W})]},R))})]}),(0,ce.jsxs)("div",{className:"brick-calculator__section",children:[(0,ce.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,ce.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,ce.jsx)("button",{type:"button",className:l==="metric"?"is-selected":"",onClick:()=>M("metric"),children:"Metric"}),(0,ce.jsx)("button",{type:"button",className:l==="imperial"?"is-selected":"",onClick:()=>M("imperial"),children:"Imperial"})]}),(0,ce.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ce.jsxs)("label",{className:"truss-estimator__field",children:[(0,ce.jsxs)("span",{children:["Height (",l==="metric"?"m":"ft",")"]}),(0,ce.jsx)("input",{type:"number",min:"0",step:"0.01",value:u,onChange:R=>f(R.target.value)})]}),(0,ce.jsxs)("label",{className:"truss-estimator__field",children:[(0,ce.jsxs)("span",{children:["Width (",l==="metric"?"m":"ft",")"]}),(0,ce.jsx)("input",{type:"number",min:"0",step:"0.01",value:b,onChange:R=>d(R.target.value)})]})]})]}),(0,ce.jsx)("div",{className:"brick-calculator__options",children:(0,ce.jsxs)("label",{className:"brick-calculator__checkbox",children:[(0,ce.jsx)("input",{type:"checkbox",checked:h,onChange:R=>w(R.target.checked)}),(0,ce.jsx)("span",{children:"Include ready-mixed mortar"})]})}),(0,ce.jsxs)("div",{className:"brick-calculator__totals",children:[(0,ce.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ce.jsxs)("div",{className:"brick-calculator__result-grid",children:[(0,ce.jsxs)("div",{children:[(0,ce.jsx)("span",{children:"Wall area"}),(0,ce.jsxs)("strong",{children:[h_(N)," ",l==="metric"?"m\xB2":"ft\xB2"]})]}),(0,ce.jsxs)("div",{children:[(0,ce.jsx)("span",{children:r==="brick"?"Bricks":"Blocks"}),(0,ce.jsx)("strong",{children:p.toLocaleString("en-GB")})]}),h?(0,ce.jsxs)("div",{children:[(0,ce.jsx)("span",{children:"Ready-mixed mortar"}),(0,ce.jsxs)("strong",{children:[v," x 20kg bags"]})]}):null]}),(0,ce.jsx)("p",{className:"brick-calculator__note",children:"Estimate based on standard nominal sizes and 10mm joints. Mortar bags are approximate; confirm the required mortar specification before ordering."})]}),(0,ce.jsxs)("div",{className:"brick-calculator__actions",children:[(0,ce.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ce.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(T),disabled:E<=0,children:a})]})]})]})})}var mr=Y($e());var rw=new Map;function b_(e){return{product_id:e.product_id,description:e.description,source_list:e.source_list??null,price:e.price??null,list_price:e.list_price,discount:e.discount,price_basis:e.price_basis??null,uoi_count:e.uoi_count??null,uoi:e.uoi??null,pdp_photo_url:e.pdp_photo_url??null,conversion:e.conversion,measurements_mm:e.measurements_mm??e.attrs?.measurements_mm??[],scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"estimator_catalogue_search"}}async function Jr(e,t,a=12,r){let n=`${e}||${t??""}||${a}||${r??""}`,i=rw.get(n);if(i)return i;let o=new URLSearchParams({q:e,limit:String(a)});t&&o.set("category",t),r&&o.set("account",r);let l=await fetch(Vt(`/api/catalogue/search?${o.toString()}`),{headers:bi()}),c=await la(l);if(!l.ok)throw new Error(c?.error||c?.message||"Could not reach the product catalogue");let u=Array.isArray(c?.items)?c.items.map(b_):[];return rw.set(n,u),u}async function iw(e,t){return await Promise.all(e.map(async r=>{try{return{requirement:r,candidates:await Jr(r.query,r.category,void 0,t)}}catch{return{requirement:r,candidates:[]}}}))}async function nw(){let e=await fetch(Vt("/api/catalogue"),{headers:bi()});if(!e.ok)return{itemCount:0,uploadedAt:null};let t=await la(e);return{itemCount:Number(t?.itemCount)||0,uploadedAt:t?.uploadedAt??null}}var $=Y(re()),v_=1.54,w_=1440,y_=25,bd=800,__=1500,vd=e=>Number.parseFloat(e)||0,Tn={mot:{label:"MOT Type 1",blurb:"Sub-base for patios and driveways",density:1.7,productId:"6001007"},"sharp-sand":{label:"Sharp sand",blurb:"Bedding and general groundwork",density:1.6,productId:"6001012"},gravel:{label:"20mm gravel",blurb:"Drainage and landscaping",density:1.6,productId:"6001004"}};function wd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let r=Vs(),[n,i]=(0,mr.useState)("m"),[o,l]=(0,mr.useState)(""),[c,u]=(0,mr.useState)(""),[f,b]=(0,mr.useState)(""),[d,h]=(0,mr.useState)("concrete"),[w,E]=(0,mr.useState)("mot"),[U,m]=(0,mr.useState)(!1),[p,g]=(0,mr.useState)(null),v=n==="m"?1:.3048,N=vd(o)*v*vd(c)*v*vd(f)*(n==="m"?.01:.0254),T=Tn[w],M=N*v_/7,R=M*w_,j=M*2,W=M*4,ye=Math.ceil(R/y_),Ce=Math.ceil(j*Tn["sharp-sand"].density*1e3/bd),He=Math.ceil(W*Tn.gravel.density*1e3/bd),We=Math.ceil(N*T.density*1e3/bd),ze=d==="concrete"?[{key:"cement",label:"Blue Circle General Purpose Grey Cement 25kg",qty:ye,productId:"6003004"},{key:"sharp-sand",label:"Sharp Sand Bulk Bag (800kg)",qty:Ce,productId:"6001012"},{key:"gravel",label:"20mm Non Decorative Pea Shingle/Gravel Bulk Bag (800kg)",qty:He,productId:"6001004"}]:[{key:w,label:`${T.label} Bulk Bag (800kg)`,qty:We,productId:T.productId}],X=()=>{if(t){t(ze.map(Z=>({key:Z.key,label:Z.label,qty:Z.qty,unit:"each",query:Z.productId})));return}K()},K=async()=>{let Z=Date.now();m(!0),g(null);try{let ue=await Promise.all(ze.map(async pe=>{let De=(await Jr(pe.productId)).find(Qe=>Qe.product_id===pe.productId);if(!De)throw new Error(`${pe.label} is no longer available in this catalogue.`);return Zr(De,{lineId:`concrete-aggregate:${pe.key}`,description:pe.label,unit:"bag",qty:pe.qty})})),Te=__-(Date.now()-Z);Te>0&&await new Promise(pe=>window.setTimeout(pe,Te)),r?.clearCart(),r?.addManyToCart(ue),r?.openBasket()}catch(ue){g(ue instanceof Error?ue.message:"Could not add the products to your basket.")}finally{m(!1)}};return U?(0,$.jsx)($.Fragment,{children:(0,$.jsxs)("div",{className:"truss-estimator",children:[(0,$.jsxs)("div",{className:"quick-order-hero",children:[(0,$.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,$.jsx)("h1",{children:"Your Materials"}),(0,$.jsx)("p",{children:"Calculating quantities from the Concrete & Aggregate Calculator."})]}),(0,$.jsx)("div",{className:"truss-estimator__card",children:(0,$.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{flex:1,justifyContent:"center"},children:[(0,$.jsx)(ur,{}),(0,$.jsx)("p",{className:"banter-message is-visible",children:"Preparing your materials\u2026"})]})})]})}):(0,$.jsx)($.Fragment,{children:(0,$.jsxs)("div",{className:"truss-estimator",children:[(0,$.jsxs)("div",{className:"quick-order-hero",children:[(0,$.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,$.jsx)("h1",{children:"Concrete & Aggregate Calculator"}),(0,$.jsx)("p",{children:"Calculate fixed site-mix concrete ingredients or aggregate bulk bags."})]}),(0,$.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,$.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose what you need"}),(0,$.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter the area and depth. The calculator adds the fixed Materials Market products directly to your basket."}),(0,$.jsxs)("div",{className:"materials-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Material type"}),(0,$.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,$.jsxs)("button",{type:"button",className:`truss-estimator__option-card${d==="concrete"?" is-selected":""}`,onClick:()=>h("concrete"),children:[(0,$.jsx)("div",{className:"truss-estimator__option-title",children:"Site-mixed concrete"}),(0,$.jsx)("div",{className:"truss-estimator__option-copy",children:"Cement, sharp sand and 20mm aggregate"})]}),(0,$.jsxs)("button",{type:"button",className:`truss-estimator__option-card${d==="aggregate"?" is-selected":""}`,onClick:()=>h("aggregate"),children:[(0,$.jsx)("div",{className:"truss-estimator__option-title",children:"Aggregates"}),(0,$.jsx)("div",{className:"truss-estimator__option-copy",children:"MOT Type 1, sharp sand or 20mm gravel"})]})]})]}),d==="aggregate"&&(0,$.jsxs)("div",{className:"materials-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Aggregate type"}),(0,$.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.keys(Tn).map(Z=>(0,$.jsxs)("button",{type:"button",className:`truss-estimator__option-card${w===Z?" is-selected":""}`,onClick:()=>E(Z),children:[(0,$.jsx)("div",{className:"truss-estimator__option-title",children:Tn[Z].label}),(0,$.jsx)("div",{className:"truss-estimator__option-copy",children:Tn[Z].blurb})]},Z))})]}),(0,$.jsxs)("div",{className:"materials-calculator__section",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and depth"}),(0,$.jsxs)("div",{className:"materials-calculator__unit-row",children:[(0,$.jsx)("span",{children:"Units"}),(0,$.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,$.jsx)("button",{type:"button",className:n==="m"?"is-selected":"",onClick:()=>i("m"),children:"Metric"}),(0,$.jsx)("button",{type:"button",className:n==="ft"?"is-selected":"",onClick:()=>i("ft"),children:"Imperial"})]})]}),(0,$.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsxs)("span",{children:["Length (",n,")"]}),(0,$.jsx)("input",{type:"number",min:"0",step:"0.01",value:o,onChange:Z=>l(Z.target.value)})]}),(0,$.jsxs)("label",{className:"truss-estimator__field",children:[(0,$.jsxs)("span",{children:["Width (",n,")"]}),(0,$.jsx)("input",{type:"number",min:"0",step:"0.01",value:c,onChange:Z=>u(Z.target.value)})]})]}),(0,$.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,$.jsxs)("span",{children:["Depth (",n==="m"?"cm":"inches",")"]}),(0,$.jsx)("input",{type:"number",min:"0",step:"0.1",value:f,onChange:Z=>b(Z.target.value)})]})]}),(0,$.jsxs)("div",{className:"materials-calculator__totals",children:[(0,$.jsx)("div",{className:"truss-estimator__section-heading",children:"Materials required"}),(0,$.jsx)("div",{className:"materials-calculator__result-grid",children:d==="concrete"?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Cement"}),(0,$.jsxs)("strong",{children:[R.toFixed(0)," kg"]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Sharp sand"}),(0,$.jsxs)("strong",{children:[j.toFixed(2)," m\xB3"]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"20mm aggregate"}),(0,$.jsxs)("strong",{children:[W.toFixed(2)," m\xB3"]})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:T.label}),(0,$.jsxs)("strong",{children:[N.toFixed(2)," m\xB3"]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("span",{children:"Approx. weight"}),(0,$.jsxs)("strong",{children:[(N*T.density).toFixed(2)," t"]})]}),(0,$.jsx)("div",{})]})}),(0,$.jsx)("p",{className:"materials-calculator__note",children:d==="concrete"?"Based on a 1:2:4 mix. Confirm the mix design for structural work.":"Figures are estimates. Confirm the specification and supplier quantities before ordering."})]}),p&&(0,$.jsx)("p",{className:"results-empty-hint estimator-products__error",children:p}),(0,$.jsxs)("div",{className:"materials-calculator__actions",children:[(0,$.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,$.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:X,disabled:N<=0||U,children:U?"Adding products\u2026":a})]})]})]})})}var Qa=Y($e());var A=Y(re()),zn=12,An=8,Js=.56,ow=.21,ka={ranges:{meridian:{label:"Standard grooved timber",blurb:"32 \xD7 125mm pressure-treated softwood boards.",boardLengthM:3.6,boardWidthM:.125},summit:{label:"Wide grooved timber",blurb:"32 \xD7 150mm pressure-treated softwood boards.",boardLengthM:3.6,boardWidthM:.15}},boardGapM:.006,wastage:{straight:.05,diagonal:.15},pictureFrame:{extraWastage:.08},joist:{lengthM:2.4,spacingOptions:[{id:"300",label:"300mm centres (heavy duty)",spacingM:.3},{id:"400",label:"400mm centres (standard)",spacingM:.4},{id:"450",label:"450mm centres (light use)",spacingM:.45}]}},ki=["range","grid","pictureFrame","substructure"],x_={range:null,colour:null,deckSizeMode:"quick",quickLengthM:"",quickWidthM:"",points:[],isOutlineClosed:!1,wallSegments:new Set,drawMode:"outline",drawError:"",pictureFrame:null,direction:null,deckHeightMode:"standard",deckHeightCm:"",joistSpacing:null,supportType:null,contact:{name:"",email:""}},Ps=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),Fs=(e,t,a)=>a.x>=Math.min(e.x,t.x)&&a.x<=Math.max(e.x,t.x)&&a.y>=Math.min(e.y,t.y)&&a.y<=Math.max(e.y,t.y),k_=(e,t,a,r)=>{let n=Ps(e,t,a),i=Ps(e,t,r),o=Ps(a,r,e),l=Ps(a,r,t);return n===0&&Fs(e,t,a)||i===0&&Fs(e,t,r)||o===0&&Fs(a,r,e)||l===0&&Fs(a,r,t)?!0:n>0!=i>0&&o>0!=l>0},yd=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1){let n=e[(r+1)%e.length];for(let i=r+1;i<a;i+=1)if(!(i===r+1||t&&r===0&&i===a-1)&&k_(e[r],n,e[i],e[(i+1)%e.length]))return!0}return!1};function _d({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,Qa.useState)(0),[i,o]=(0,Qa.useState)(x_),[l,c]=(0,Qa.useState)(1),[u,f]=(0,Qa.useState)({x:0,y:0}),[b,d]=(0,Qa.useState)(null),h=(0,Qa.useRef)(null),w=(0,Qa.useRef)(null),E=(0,Qa.useRef)(null),U=ki[r],m=i.range?ka.ranges[i.range]:null,p=zn/l,g=An/l,v=(zn-p)/2,N=(An-g)/2,T=Math.max(-zn,Math.min(zn*2-p,v+u.x)),M=Math.max(-An,Math.min(An*2-g,N+u.y)),R=Number.parseFloat(i.quickLengthM),j=Number.parseFloat(i.quickWidthM),W=R>0&&j>0,ye=C=>Math.abs(C.reduce((z,le,ve)=>{let qe=C[(ve+1)%C.length];return z+le.x*qe.y-qe.x*le.y},0))/2,Ce=(C,z)=>Math.hypot(z.x-C.x,z.y-C.y),He=i.isOutlineClosed?ye(i.points):0,We=i.isOutlineClosed?i.points.reduce((C,z,le)=>C+Ce(z,i.points[(le+1)%i.points.length]),0):0,ze=i.isOutlineClosed?i.points.reduce((C,z,le)=>C+(i.wallSegments.has(le)?0:Ce(z,i.points[(le+1)%i.points.length])),0):0,X=i.points.reduce((C,z)=>({x:C.x+z.x/i.points.length,y:C.y+z.y/i.points.length}),{x:0,y:0}),K=i.points.length>1?(()=>{let C=i.points[0],z=i.points[1],le=Ce(C,z),ve=le?-(z.y-C.y)/le:0,qe=le?(z.x-C.x)/le:0,pt=(C.x+z.x)/2,xt=(C.y+z.y)/2,x=ve*(pt-X.x)+qe*(xt-X.y)>=0?1:-1;return{x:pt+ve*Js*x,y:xt+qe*Js*x}})():null,ue=(()=>{let C=i.range?ka.ranges[i.range]:ka.ranges.meridian,z=i.deckSizeMode==="quick"?R*j:He,le=i.deckSizeMode==="quick"?2*(R+j):ze,ve=i.direction==="diagonal"?ka.wastage.diagonal:ka.wastage.straight,qe=i.pictureFrame==="yes"?ka.pictureFrame.extraWastage:0,xt=z/(C.boardWidthM+ka.boardGapM)/C.boardLengthM,x=Math.ceil(xt*(1+ve+qe)),H=Math.ceil(z*30*(1+ve+qe)/200),B=ka.joist.spacingOptions.find(S=>S.id===i.joistSpacing)??ka.joist.spacingOptions[1],ne=z/B.spacingM,te=Math.ceil(ne/ka.joist.lengthM);return{range:C,area:z,boardCount:x,screwBoxes:H,joistLengthsNeeded:te,spacing:B}})(),Te=ue?[{key:`boards-${i.range??"meridian"}`,label:`Deck boards (${ue.range.label})`,qty:ue.boardCount,unit:"each",query:"timber decking board",category:"decking",calculatorWasteIncluded:!0},{key:"joists",label:"Treated C24 joists",qty:ue.joistLengthsNeeded,unit:"each",query:"treated joist",category:"timber",calculatorWasteIncluded:!0},{key:"screws",label:"Green decking screws (200/box)",qty:ue.screwBoxes,unit:"box",query:"green decking screws",category:"fixings",calculatorWasteIncluded:!0}]:[],pe=()=>U==="range"?!!i.range:U==="grid"?i.deckSizeMode==="quick"?W:i.isOutlineClosed&&He>0:U==="pictureFrame"?!!i.pictureFrame&&!!i.direction:U==="substructure"?!!i.joistSpacing:!0,De=r===ki.length-1?a:"Next",Qe=(C,z,le=!1)=>{let ve=E.current?.getBoundingClientRect();if(!ve)return null;let qe=le?1:.25;return{x:Math.round(Math.max(T,Math.min(T+p,T+(C-ve.left)/ve.width*p))/qe)*qe,y:Math.round(Math.max(M,Math.min(M+g,M+(z-ve.top)/ve.height*g))/qe)*qe}},ct=C=>{if(i.isOutlineClosed){let le=C.target;if(le!==C.currentTarget&&!le.classList.contains("deck-outline__grid"))return;w.current={startX:C.clientX,startY:C.clientY,startViewX:T,startViewY:M},C.currentTarget.setPointerCapture(C.pointerId);return}if(i.drawMode!=="outline")return;let z=Qe(C.clientX,C.clientY,!0);z&&(d(null),o(le=>{let ve=[...le.points,z];return yd(ve,!1)?{...le,drawError:"Edges cannot cross. Choose another corner."}:{...le,points:ve,drawError:""}}))},Ze=(C,z)=>{if(!i.isOutlineClosed){C.stopPropagation(),z===0&&i.points.length>=3&&o(le=>({...le,isOutlineClosed:!0,drawMode:"edges"}));return}C.stopPropagation(),h.current=z,C.currentTarget.setPointerCapture(C.pointerId)},Lt=C=>{if(w.current){let ve=E.current?.getBoundingClientRect();if(!ve)return;let qe=w.current,pt=qe.startViewX-(C.clientX-qe.startX)/ve.width*p,xt=qe.startViewY-(C.clientY-qe.startY)/ve.height*g;f({x:pt-v,y:xt-N});return}!i.isOutlineClosed&&i.drawMode==="outline"&&d(Qe(C.clientX,C.clientY,!0));let z=h.current;if(z===null)return;let le=Qe(C.clientX,C.clientY);le&&o(ve=>{let qe=ve.points.map((pt,xt)=>xt===z?le:pt);return yd(qe,!0)?{...ve,drawError:"Edges cannot cross. Move the corner to a different position."}:{...ve,points:qe,drawError:""}})},G=C=>{w.current=null,h.current=null,C.currentTarget.hasPointerCapture(C.pointerId)&&C.currentTarget.releasePointerCapture(C.pointerId)},P=C=>{o(z=>{let le=new Set(z.wallSegments);return le.has(C)?le.delete(C):le.add(C),{...z,wallSegments:le}})},fe=()=>{r===0?e():n(C=>C-1)},gt=()=>{pe()&&(r===ki.length-1?t?.(Te):n(C=>C+1))};return(0,A.jsx)(A.Fragment,{children:(0,A.jsxs)("div",{className:"truss-estimator",children:[(0,A.jsxs)("div",{className:"quick-order-hero",children:[(0,A.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,A.jsx)("h1",{children:"Decking Calculator"}),(0,A.jsx)("p",{children:"Estimate timber boards, joists and screws for your deck."})]}),(0,A.jsxs)("div",{className:"truss-estimator__card",children:[(0,A.jsxs)("div",{className:"truss-estimator__body",children:[U==="range"?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",ki.length]}),(0,A.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your timber decking"}),(0,A.jsx)("p",{className:"truss-estimator__step-sub",children:"Both options are fixed, orderable pressure-treated timber boards."}),(0,A.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(ka.ranges).map(([C,z])=>(0,A.jsxs)("button",{type:"button",className:`truss-estimator__option-card${i.range===C?" is-selected":""}`,onClick:()=>o(le=>({...le,range:C})),children:[(0,A.jsx)("div",{className:"truss-estimator__option-title",children:z.label}),(0,A.jsx)("div",{className:"truss-estimator__option-copy",children:z.blurb}),(0,A.jsxs)("div",{className:"truss-estimator__option-copy",children:[z.boardLengthM,"m boards"]})]},C))})]}):null,U==="grid"?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",ki.length]}),(0,A.jsx)("h2",{className:"truss-estimator__step-title",children:"Tell us your deck size"}),(0,A.jsx)("p",{className:"truss-estimator__step-sub",children:"Start with a quick rectangle estimate, or draw an irregular deck for a more precise result."}),(0,A.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,A.jsx)("button",{type:"button",className:`truss-estimator__toggle${i.deckSizeMode==="quick"?" is-selected":""}`,onClick:()=>o(C=>({...C,deckSizeMode:"quick"})),children:"Quick estimate"}),(0,A.jsx)("button",{type:"button",className:`truss-estimator__toggle${i.deckSizeMode==="draw"?" is-selected":""}`,onClick:()=>o(C=>({...C,deckSizeMode:"draw",drawMode:"outline"})),children:"Draw your space"})]}),i.deckSizeMode==="quick"?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,A.jsxs)("label",{className:"truss-estimator__field",children:[(0,A.jsx)("span",{children:"Length (m)"}),(0,A.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:i.quickLengthM,onChange:C=>o(z=>({...z,quickLengthM:C.target.value}))})]}),(0,A.jsxs)("label",{className:"truss-estimator__field",children:[(0,A.jsx)("span",{children:"Width (m)"}),(0,A.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:i.quickWidthM,onChange:C=>o(z=>({...z,quickWidthM:C.target.value}))})]})]}),(0,A.jsx)("div",{className:"truss-estimator__grid-hint",children:"For L-shaped decks, cut-outs, or sides against a wall, use Draw your space."}),W?(0,A.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,A.jsxs)("div",{children:[(R*j).toFixed(2)," m\xB2 deck"]}),(0,A.jsxs)("div",{children:[(2*(R+j)).toFixed(2)," m perimeter"]})]}):null]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("div",{className:"truss-estimator__section-heading",children:"Draw your deck"}),(0,A.jsx)("p",{className:"truss-estimator__step-sub",children:"Click to add corners, then close the outline. Drag any handle to refine it."}),(0,A.jsxs)("div",{className:"deck-outline__toolbar",children:[i.isOutlineClosed?(0,A.jsxs)("div",{className:"deck-outline__summary",children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("span",{children:"Deck area"}),(0,A.jsxs)("strong",{children:[He.toFixed(2)," m\xB2"]})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("span",{children:"Perimeter"}),(0,A.jsxs)("strong",{children:[We.toFixed(2)," m"]})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("span",{children:"Wall edges"}),(0,A.jsx)("strong",{children:i.wallSegments.size>0?i.wallSegments.size:"None"})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)("span",{children:"Visible edge"}),(0,A.jsxs)("strong",{children:[ze.toFixed(2)," m"]})]})]}):null,(0,A.jsxs)("div",{className:"deck-outline__actions",children:[(0,A.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(C=>({...C,points:C.points.slice(0,-1)})),disabled:i.points.length===0||i.isOutlineClosed,children:"Undo"}),(0,A.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{d(null),o(C=>({...C,points:[],isOutlineClosed:!1,wallSegments:new Set,drawMode:"outline",drawError:""}))},disabled:i.points.length===0,children:"Clear"}),(0,A.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(C=>({...C,points:[{x:2,y:2},{x:8,y:2},{x:8,y:5},{x:2,y:5}],isOutlineClosed:!0,wallSegments:new Set,drawMode:"edges",drawError:""})),children:"Start with rectangle"})]})]}),(0,A.jsx)("div",{className:"deck-editor-layout",children:(0,A.jsxs)("div",{className:"deck-editor-layout__canvas-column",children:[(0,A.jsxs)("div",{className:"deck-outline",children:[(0,A.jsxs)("svg",{ref:E,className:`deck-outline__canvas${i.isOutlineClosed?" is-pan-mode":""}`,viewBox:`${T} ${M} ${p} ${g}`,preserveAspectRatio:"none","aria-label":"Deck outline drawing area",onPointerDown:ct,onPointerMove:Lt,onPointerUp:G,onPointerLeave:()=>{d(null),w.current||(h.current=null)},children:[(0,A.jsx)("defs",{children:(0,A.jsx)("pattern",{id:"deck-outline-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,A.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,A.jsx)("rect",{x:-zn,y:-An,width:zn*3,height:An*3,className:"deck-outline__grid",fill:"url(#deck-outline-grid)"}),i.points.length>1?(0,A.jsx)("polyline",{className:"deck-outline__preview",points:i.points.map(C=>`${C.x},${C.y}`).join(" ")}):null,i.isOutlineClosed?(0,A.jsx)("polygon",{className:"deck-outline__shape",points:i.points.map(C=>`${C.x},${C.y}`).join(" "),stroke:"none"}):null,i.points.length>1?i.points.slice(0,i.isOutlineClosed?void 0:-1).map((C,z)=>{let le=i.points[i.isOutlineClosed?(z+1)%i.points.length:z+1],ve=Ce(C,le),qe=ve?-(le.y-C.y)/ve:0,pt=ve?(le.x-C.x)/ve:0,xt=(C.x+le.x)/2,x=(C.y+le.y)/2,H=qe*(xt-X.x)+pt*(x-X.y)>=0?1:-1,B=xt+qe*Js*H,ne=x+pt*Js*H;return(0,A.jsxs)("g",{children:[(0,A.jsx)("line",{className:"deck-outline__edge-hit",x1:C.x,y1:C.y,x2:le.x,y2:le.y,onClick:i.isOutlineClosed?()=>P(z):void 0}),(0,A.jsx)("line",{className:`deck-outline__edge${i.wallSegments.has(z)?" is-wall":""}`,x1:C.x,y1:C.y,x2:le.x,y2:le.y,pointerEvents:"none"}),(0,A.jsxs)("text",{className:`deck-outline__edge-label${i.wallSegments.has(z)?" is-wall":""}`,x:B,y:ne,textAnchor:"middle",dominantBaseline:"central",fontSize:ow/l,children:[ve.toFixed(2)," m"]})]},`segment-${z}`)}):null,!i.isOutlineClosed&&i.points.length>0&&b?(()=>{let C=i.points[i.points.length-1],z=Ce(C,b);if(!z)return null;let le=-(b.y-C.y)/z,ve=(b.x-C.x)/z,qe=(C.x+b.x)/2,pt=(C.y+b.y)/2;return(0,A.jsxs)("g",{className:"deck-outline__live-measurement",children:[(0,A.jsx)("line",{x1:C.x,y1:C.y,x2:b.x,y2:b.y}),(0,A.jsxs)("text",{x:qe+le*.34,y:pt+ve*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:ow/l,children:[z.toFixed(2)," m"]})]})})():null,i.points.map((C,z)=>(0,A.jsx)("circle",{className:"deck-outline__point",cx:C.x,cy:C.y,r:"0.13",onPointerDown:le=>Ze(le,z)},`point-${z}`))]}),(0,A.jsxs)("div",{className:"deck-outline__zoom","aria-label":"Zoom controls",children:[(0,A.jsx)("button",{type:"button",onClick:()=>c(C=>Math.max(.5,C-.25)),disabled:l===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,A.jsxs)("span",{children:[Math.round(l*100),"%"]}),(0,A.jsx)("button",{type:"button",onClick:()=>c(C=>Math.min(1,C+.25)),disabled:l===1,"aria-label":"Zoom in",children:"+"})]}),i.isOutlineClosed&&i.wallSegments.size===0&&K?(0,A.jsx)("div",{className:"deck-outline__edge-prompt",role:"status",style:{left:`${(K.x-T)/p*100}%`,top:`${(K.y-M)/g*100}%`},children:"Tap an edge to mark it as a wall, or leave it as a visible edge."}):null,!i.isOutlineClosed&&i.points.length>=3?(0,A.jsx)("button",{type:"button",className:"deck-outline__close",onClick:()=>o(C=>yd(C.points,!0)?{...C,drawError:"Edges cannot cross. Adjust the outline before finishing."}:{...C,isOutlineClosed:!0,drawMode:"edges",drawError:""}),children:"Finish outline"}):null]}),(0,A.jsxs)("div",{className:"deck-outline__supporting",children:[(0,A.jsx)("div",{className:"truss-estimator__grid-hint",children:i.isOutlineClosed?"Drag a corner handle to refine the outline.":"Add at least three corners, then click Finish outline."}),i.drawError?(0,A.jsx)("div",{className:"deck-outline__error",role:"alert",children:i.drawError}):null]})]})})]})]}):null,U==="pictureFrame"?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",ki.length]}),(0,A.jsx)("h2",{className:"truss-estimator__step-title",children:"Picture frame border?"}),(0,A.jsx)("p",{className:"truss-estimator__step-sub",children:"A picture frame border runs boards around the perimeter for a finished look and uses extra material."}),(0,A.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No border",img:"/decking/boards/no-border.webp"},{id:"yes",label:"Picture frame",img:"/decking/boards/picture-frame.webp"}].map(C=>(0,A.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${i.pictureFrame===C.id?" is-selected":""}`,onClick:()=>o(z=>({...z,pictureFrame:C.id})),children:[(0,A.jsx)("img",{className:"truss-estimator__visual-card-img",src:Zt(C.img),alt:""}),(0,A.jsx)("span",{children:C.label})]},C.id))}),(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("div",{className:"truss-estimator__section-heading",children:"Board direction"}),(0,A.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"straight",label:"Straight",img:"/decking/boards/straight.webp"},{id:"diagonal",label:"Diagonal",img:"/decking/boards/diagonal.webp"}].map(C=>(0,A.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${i.direction===C.id?" is-selected":""}`,onClick:()=>o(z=>({...z,direction:C.id})),children:[(0,A.jsx)("img",{className:"truss-estimator__visual-card-img",src:Zt(C.img),alt:""}),(0,A.jsx)("span",{children:C.label})]},C.id))})]})]}):null,U==="substructure"?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",ki.length]}),(0,A.jsx)("h2",{className:"truss-estimator__step-title",children:"Substructure"}),(0,A.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the joist spacing. Posts, footings and ground preparation vary by site, so are not included."}),(0,A.jsx)("div",{className:"truss-estimator__section-heading",children:"Joist spacing"}),(0,A.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:ka.joist.spacingOptions.map(C=>(0,A.jsx)("button",{type:"button",className:`truss-estimator__option-card${i.joistSpacing===C.id?" is-selected":""}`,onClick:()=>o(z=>({...z,joistSpacing:C.id})),children:(0,A.jsx)("div",{className:"truss-estimator__option-title",children:C.label})},C.id))})]}):null]}),(0,A.jsxs)("div",{className:"truss-estimator__nav",children:[(0,A.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:fe,children:"Back"}),(0,A.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:gt,disabled:!pe(),children:[(0,A.jsx)("span",{children:De}),(0,A.jsx)("span",{className:"arrow",children:(0,A.jsx)(Bt,{})})]})]})]})]})})}var Sa=Y($e());var L=Y(re()),lw=12,sw=30,Rn=12,Un=8,cw=.56,Na={ranges:{boundary:{label:"Horizontal lap",blurb:"Traditional pressure-treated timber panels.",panelWidthM:1.83},skyline:{label:"Feather edge",blurb:"Heavier timber panels for a more solid boundary.",panelWidthM:1.83}},heights:["0.9","1.2","1.5","1.8"],gate:{single:{label:"Single lap gate",widthDefault:.9}},mounting:{concrete:{label:"Concrete posts",blurb:"Slotted concrete posts with matching panels."},postcrete:{label:"Postcrete bags",blurb:"Fast-set post-mix bags in a dug hole.",bagsPerPost:2}}},Ni=["range","height","gate","posts"],N_={range:null,colour:null,grid:new Set,excludedEdges:new Set,gridMode:"draw",boundaryMode:"quick",quickLengthM:"",boundaryPoints:[],boundaryClosed:!1,excludedBoundaryEdges:new Set,height:null,gravelBoard:null,gateType:null,gateWidthM:"",mountingType:null,contact:{name:"",email:""}},Is=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),Ws=(e,t,a)=>a.x>=Math.min(e.x,t.x)&&a.x<=Math.max(e.x,t.x)&&a.y>=Math.min(e.y,t.y)&&a.y<=Math.max(e.y,t.y),S_=(e,t,a,r)=>{let n=Is(e,t,a),i=Is(e,t,r),o=Is(a,r,e),l=Is(a,r,t);return n===0&&Ws(e,t,a)||i===0&&Ws(e,t,r)||o===0&&Ws(a,r,e)||l===0&&Ws(a,r,t)?!0:n>0!=i>0&&o>0!=l>0},ec=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1)for(let n=r+1;n<a;n+=1)if(!(n===r+1||t&&r===0&&n===a-1)&&S_(e[r],e[(r+1)%e.length],e[n],e[(n+1)%e.length]))return!0;return!1};function xd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,Sa.useState)(0),[i,o]=(0,Sa.useState)(N_),l=(0,Sa.useRef)(null),c=(0,Sa.useRef)(null),[u,f]=(0,Sa.useState)(1),[b,d]=(0,Sa.useState)({x:0,y:0}),[h,w]=(0,Sa.useState)(null),E=(0,Sa.useRef)(null),U=(0,Sa.useRef)(null),m=(0,Sa.useRef)(null),p=Ni[r],g=i.range?Na.ranges[i.range]:null,v=Rn/u,N=Un/u,T=(Rn-v)/2,M=(Un-N)/2,R=Math.max(-Rn,Math.min(Rn*2-v,T+b.x)),j=Math.max(-Un,Math.min(Un*2-N,M+b.y)),W=i.boundaryPoints.reduce((x,H)=>({x:x.x+H.x/Math.max(1,i.boundaryPoints.length),y:x.y+H.y/Math.max(1,i.boundaryPoints.length)}),{x:0,y:0}),ye=x=>{let H=new Set,B=[];return x.forEach(ne=>{let[te,S]=ne.split(",").map(Number),Q=[{key:`H,${te},${S}`,type:"H",x:te,y:S},{key:`H,${te},${S+1}`,type:"H",x:te,y:S+1},{key:`V,${te},${S}`,type:"V",x:te,y:S},{key:`V,${te+1},${S}`,type:"V",x:te+1,y:S}],J=[!x.has(`${te},${S-1}`),!x.has(`${te},${S+1}`),!x.has(`${te-1},${S}`),!x.has(`${te+1},${S}`)];Q.forEach((me,_e)=>{J[_e]&&!H.has(me.key)&&(H.add(me.key),B.push(me))})}),B},Ce=(x,H)=>ye(x).filter(B=>!H.has(B.key)),He=(x,H)=>Ce(x,H).length,We=(x,H)=>{let B={};Ce(x,H).forEach(te=>{var S,Q,J,me;te.type==="H"?((B[S=`${te.x},${te.y}`]||(B[S]=[])).push("H"),(B[Q=`${te.x+1},${te.y}`]||(B[Q]=[])).push("H")):((B[J=`${te.x},${te.y}`]||(B[J]=[])).push("V"),(B[me=`${te.x},${te.y+1}`]||(B[me]=[])).push("V"))});let ne=0;return Object.values(B).forEach(te=>{(te.length===1||te.length===2&&te[0]!==te[1]||te.length>=3)&&(ne+=1)}),ne},X=(()=>{let x=i.range?Na.ranges[i.range]:Na.ranges.boundary,H=i.height??"1.8",B=i.boundaryMode==="quick"?Math.max(0,Number.parseFloat(i.quickLengthM)||0):i.boundaryClosed?i.boundaryPoints.slice(0,-1).reduce((Jt,gr,Ya)=>Jt+(i.excludedBoundaryEdges.has(Ya)?0:Math.hypot(i.boundaryPoints[Ya+1].x-gr.x,i.boundaryPoints[Ya+1].y-gr.y)),0):0,ne=i.gateType&&i.gateType!=="none"?Number.parseFloat(i.gateWidthM)||Na.gate[i.gateType].widthDefault:0,te=Math.max(0,B-ne),S=te>0?Math.ceil(te/x.panelWidthM):0,Q=i.boundaryPoints.length>2&&i.boundaryPoints[0].x===i.boundaryPoints[i.boundaryPoints.length-1].x&&i.boundaryPoints[0].y===i.boundaryPoints[i.boundaryPoints.length-1].y,J=i.boundaryMode==="quick"?te>0?2:0:i.boundaryClosed?i.boundaryPoints.slice(0,Q?-1:void 0).reduce((Jt,gr,Ya)=>{let Hd=Ya>0&&!i.excludedBoundaryEdges.has(Ya-1),Ln=Ya<i.boundaryPoints.length-1&&!i.excludedBoundaryEdges.has(Ya);return Jt+(Hd||Ln?1:0)},0):0,me=te>0?Math.ceil(te/x.panelWidthM)+1:0,_e=Math.max(0,me-J),Ke=i.mountingType?Na.mounting[i.mountingType]:Na.mounting.concrete,vt=i.gateType&&i.gateType!=="none"?2:0,ca=_e+J+vt,il=i.mountingType==="postcrete"?ca*Na.mounting.postcrete.bagsPerPost:0,pa=i.gravelBoard==="yes"?S:0;return{range:x,height:H,totalEdgeM:B,fencedLengthM:te,gateWidthM:ne,panelsCount:S,cornerPostCount:J,intermediatePostCount:_e,gatePostCount:vt,totalPostCount:ca,bagsCount:il,gravelCount:pa,capCount:ca,mounting:Ke}})(),K=i.gateType&&i.gateType!=="none"?Na.gate[i.gateType].label:null,Z=Number(X.height)<=1.2?"6":"8",ue=X?[{key:`panels-${i.range??"boundary"}-${X.height}`,label:`${X.range.label} panels (${X.height}m)`,qty:X.panelsCount,unit:"each",query:"fence panel",category:"fencing"},...i.mountingType==="concrete"?[{key:`concrete-intermediate-${Z}`,label:"Intermediate concrete posts",qty:X.intermediatePostCount,unit:"each",query:"concrete fence post",category:"fencing"},{key:`concrete-end-${Z}`,label:"End and corner concrete posts",qty:X.cornerPostCount+X.gatePostCount,unit:"each",query:"concrete end post",category:"fencing"}]:[{key:`timber-post-${Z}`,label:"Timber fence posts",qty:X.totalPostCount,unit:"each",query:"timber fence post",category:"fencing"},{key:"postcrete",label:"Postcrete",qty:X.bagsCount,unit:"bag",query:"postcrete",category:"cement"}],...K?[{key:"gate",label:K,qty:1,unit:"each",query:"lap gate",category:"fencing"}]:[],...X.gravelCount>0?[{key:"gravel-boards",label:"Concrete gravel boards",qty:X.gravelCount,unit:"each",query:"gravel board",category:"fencing"}]:[]]:[],Te=()=>{if(p==="range"){let x=i.boundaryMode==="quick"?(Number.parseFloat(i.quickLengthM)||0)>0:i.boundaryClosed&&i.boundaryPoints.length>=2;return!!i.range&&x}return p==="height"?!!i.height&&!!i.gravelBoard:p==="gate"?!!i.gateType&&(i.gateType==="none"||i.gateWidthM.trim()!==""):p==="posts"?!!i.mountingType:!0},pe=r===Ni.length-1?a:"Next",De=x=>{o(H=>{let B=x(new Set(H.grid)),ne=new Set([...H.excludedEdges].filter(te=>ye(B).some(S=>S.key===te)));return{...H,grid:B,excludedEdges:ne}})},Qe=(x,H,B)=>{De(ne=>{let te=`${x},${H}`;return B?ne.add(te):ne.delete(te),ne})},ct=(x,H,B,ne,te)=>{let S=x,Q=H,J=Math.abs(B-x),me=x<B?1:-1,_e=-Math.abs(ne-H),Ke=H<ne?1:-1,vt=J+_e;for(;Qe(S,Q,te),!(S===B&&Q===ne);){let ca=2*vt;ca>=_e&&(vt+=_e,S+=me),ca<=J&&(vt+=J,Q+=Ke)}},Ze=(x,H)=>{let B=c.current?.getBoundingClientRect();if(!B)return null;let ne=Math.floor((x-B.left)/sw),te=Math.floor((H-B.top)/sw);return ne<0||te<0||ne>=lw||te>=lw?null:{x:ne,y:te}},Lt=x=>{if(i.gridMode!=="draw")return;let H=Ze(x.clientX,x.clientY);if(!H)return;x.preventDefault();let B=`${H.x},${H.y}`,ne=!i.grid.has(B);l.current={active:!0,paintValue:ne,lastX:H.x,lastY:H.y},x.currentTarget.setPointerCapture(x.pointerId),Qe(H.x,H.y,ne)},G=x=>{let H=l.current;if(!H?.active)return;let B=Ze(x.clientX,x.clientY);B&&(B.x===H.lastX&&B.y===H.lastY||(ct(H.lastX,H.lastY,B.x,B.y,H.paintValue),l.current={...H,lastX:B.x,lastY:B.y}))},P=x=>{l.current?.active&&(l.current=null,x.currentTarget.releasePointerCapture(x.pointerId))},fe=(x,H,B=!1)=>{let ne=m.current?.getBoundingClientRect();if(!ne)return null;let te=B?1:.25;return{x:Math.round(Math.max(R,Math.min(R+v,R+(x-ne.left)/ne.width*v))/te)*te,y:Math.round(Math.max(j,Math.min(j+N,j+(H-ne.top)/ne.height*N))/te)*te}},gt=x=>{if(i.boundaryClosed){let B=x.target;if(B!==x.currentTarget&&!B.classList.contains("fence-boundary__grid"))return;U.current={startX:x.clientX,startY:x.clientY,startViewX:R,startViewY:j},x.currentTarget.setPointerCapture(x.pointerId);return}let H=fe(x.clientX,x.clientY,!0);H&&(w(null),o(B=>{let ne=[...B.boundaryPoints,H];return ec(ne,!1)?{...B}:{...B,boundaryPoints:ne}}))},C=(x,H)=>{if(x.stopPropagation(),!i.boundaryClosed){if(H!==0||i.boundaryPoints.length<3)return;o(B=>ec(B.boundaryPoints,!0)?B:{...B,boundaryPoints:[...B.boundaryPoints,B.boundaryPoints[0]],boundaryClosed:!0});return}E.current=H,x.currentTarget.setPointerCapture(x.pointerId)},z=x=>{if(U.current){let B=m.current?.getBoundingClientRect();if(!B)return;let ne=U.current,te=ne.startViewX-(x.clientX-ne.startX)/B.width*v,S=ne.startViewY-(x.clientY-ne.startY)/B.height*N;d({x:te-T,y:S-M});return}if(i.boundaryClosed||w(fe(x.clientX,x.clientY,!0)),E.current===null)return;let H=fe(x.clientX,x.clientY);H&&o(B=>{let ne=B.boundaryPoints.length>2&&B.boundaryPoints[0].x===B.boundaryPoints[B.boundaryPoints.length-1].x&&B.boundaryPoints[0].y===B.boundaryPoints[B.boundaryPoints.length-1].y,te=B.boundaryPoints.map((S,Q)=>{let J=Q===E.current,me=ne&&E.current===0&&Q===B.boundaryPoints.length-1;return J||me?H:S});return ec(te,!1)?B:{...B,boundaryPoints:te}})},le=x=>{U.current=null,E.current=null,x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId)},ve=x=>{o(H=>{let B=new Set(H.excludedBoundaryEdges);return B.has(x)?B.delete(x):B.add(x),{...H,excludedBoundaryEdges:B}})},qe=()=>{r===0?e():n(x=>x-1)},pt=()=>{Te()&&(r===Ni.length-1?t?.(ue):n(x=>x+1))},xt=ye(i.grid);return(0,L.jsx)(L.Fragment,{children:(0,L.jsxs)("div",{className:"truss-estimator",children:[(0,L.jsxs)("div",{className:"quick-order-hero",children:[(0,L.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,L.jsx)("h1",{children:"Fencing Calculator"}),(0,L.jsx)("p",{children:"Estimate panels, posts and cost for your fence line in a few steps."})]}),(0,L.jsxs)("div",{className:"truss-estimator__card",children:[(0,L.jsxs)("div",{className:"truss-estimator__body",children:[p==="range"?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,L.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your fence panels"}),(0,L.jsx)("p",{className:"truss-estimator__step-sub",children:"The calculator uses fixed, orderable timber panels from the catalogue."}),(0,L.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Na.ranges).map(([x,H])=>(0,L.jsxs)("button",{type:"button",className:`truss-estimator__option-card${i.range===x?" is-selected":""}`,onClick:()=>o(B=>({...B,range:x})),children:[(0,L.jsx)("div",{className:"truss-estimator__option-title",children:H.label}),(0,L.jsx)("div",{className:"truss-estimator__option-copy",children:H.blurb})]},x))})]}):null,p==="range"?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("div",{className:"truss-estimator__section-heading",children:"Measure your fence line"}),(0,L.jsx)("p",{className:"truss-estimator__step-sub",children:"Use a quick total, or draw the boundary to mark existing edges that do not need new fencing."}),(0,L.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,L.jsx)("button",{type:"button",className:`truss-estimator__toggle${i.boundaryMode==="quick"?" is-selected":""}`,onClick:()=>o(x=>({...x,boundaryMode:"quick"})),children:"Quick estimate"}),(0,L.jsx)("button",{type:"button",className:`truss-estimator__toggle${i.boundaryMode==="draw"?" is-selected":""}`,onClick:()=>o(x=>({...x,boundaryMode:"draw"})),children:"Draw your boundary"})]}),i.boundaryMode==="quick"?(0,L.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact fence-boundary__quick-field",children:[(0,L.jsx)("span",{children:"Total fence length (m)"}),(0,L.jsx)("input",{type:"number",min:"0",step:"0.1",value:i.quickLengthM,onChange:x=>o(H=>({...H,quickLengthM:x.target.value}))})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("div",{className:"fence-boundary__toolbar",children:(0,L.jsxs)("div",{className:"fence-boundary__actions",children:[(0,L.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(x=>({...x,boundaryPoints:x.boundaryPoints.slice(0,-1),boundaryClosed:!1,excludedBoundaryEdges:new Set})),disabled:i.boundaryPoints.length===0||i.boundaryClosed,children:"Undo"}),(0,L.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{d({x:0,y:0}),w(null),o(x=>({...x,boundaryPoints:[],boundaryClosed:!1,excludedBoundaryEdges:new Set}))},disabled:i.boundaryPoints.length===0,children:"Clear"}),(0,L.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(x=>({...x,boundaryPoints:[{x:2,y:2},{x:8,y:2},{x:8,y:5},{x:2,y:5},{x:2,y:2}],boundaryClosed:!0,excludedBoundaryEdges:new Set})),children:"Start with rectangle"})]})}),(0,L.jsxs)("div",{className:"fence-boundary",children:[(0,L.jsxs)("svg",{ref:m,className:`fence-boundary__canvas${i.boundaryClosed?" is-pan-mode":""}`,viewBox:`${R} ${j} ${v} ${N}`,preserveAspectRatio:"none","aria-label":"Fence boundary drawing area",onPointerDown:gt,onPointerMove:z,onPointerUp:le,onPointerLeave:()=>{w(null),U.current||(E.current=null)},children:[(0,L.jsx)("defs",{children:(0,L.jsx)("pattern",{id:"fence-boundary-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,L.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,L.jsx)("rect",{x:-Rn,y:-Un,width:Rn*3,height:Un*3,className:"fence-boundary__grid",fill:"url(#fence-boundary-grid)"}),i.boundaryPoints.length>1?(0,L.jsx)("polyline",{className:"fence-boundary__preview",points:i.boundaryPoints.map(x=>`${x.x},${x.y}`).join(" ")}):null,i.boundaryPoints.length>1?i.boundaryPoints.slice(0,-1).map((x,H)=>{let B=i.boundaryPoints[H+1],ne=Math.hypot(B.x-x.x,B.y-x.y),te=ne?-(B.y-x.y)/ne:0,S=ne?(B.x-x.x)/ne:0,Q=(x.x+B.x)/2,J=(x.y+B.y)/2,me=te*(Q-W.x)+S*(J-W.y)>=0?1:-1,_e=Q+te*cw*me,Ke=J+S*cw*me;return(0,L.jsxs)("g",{children:[(0,L.jsx)("line",{className:"fence-boundary__edge-hit",x1:x.x,y1:x.y,x2:B.x,y2:B.y,onClick:i.boundaryClosed?()=>ve(H):void 0}),(0,L.jsx)("line",{className:`fence-boundary__edge${i.excludedBoundaryEdges.has(H)?" is-excluded":""}`,x1:x.x,y1:x.y,x2:B.x,y2:B.y,pointerEvents:"none"}),(0,L.jsxs)("text",{className:`fence-boundary__edge-label${i.excludedBoundaryEdges.has(H)?" is-excluded":""}`,x:_e,y:Ke,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/u,children:[ne.toFixed(2)," m"]})]},`fence-edge-${H}`)}):null,!i.boundaryClosed&&i.boundaryPoints.length>0&&h?(()=>{let x=i.boundaryPoints[i.boundaryPoints.length-1],H=Math.hypot(h.x-x.x,h.y-x.y);if(!H)return null;let B=-(h.y-x.y)/H,ne=(h.x-x.x)/H,te=(x.x+h.x)/2,S=(x.y+h.y)/2;return(0,L.jsxs)("g",{className:"fence-boundary__live-measurement",children:[(0,L.jsx)("line",{x1:x.x,y1:x.y,x2:h.x,y2:h.y}),(0,L.jsxs)("text",{x:te+B*.34,y:S+ne*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/u,children:[H.toFixed(2)," m"]})]})})():null,i.boundaryPoints.map((x,H)=>H>0&&H===i.boundaryPoints.length-1&&x.x===i.boundaryPoints[0]?.x&&x.y===i.boundaryPoints[0]?.y?null:(0,L.jsx)("circle",{className:`fence-boundary__point${!i.boundaryClosed&&H===0&&i.boundaryPoints.length>=3?" is-close-target":""}`,cx:x.x,cy:x.y,r:"0.13",onPointerDown:B=>C(B,H)},`fence-point-${H}`))]}),(0,L.jsxs)("div",{className:"fence-boundary__zoom","aria-label":"Zoom controls",children:[(0,L.jsx)("button",{type:"button",onClick:()=>f(x=>Math.max(.5,x-.25)),disabled:u===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,L.jsxs)("span",{children:[Math.round(u*100),"%"]}),(0,L.jsx)("button",{type:"button",onClick:()=>f(x=>Math.min(1,x+.25)),disabled:u===1,"aria-label":"Zoom in",children:"+"})]}),!i.boundaryClosed&&i.boundaryPoints.length>=2?(0,L.jsx)("button",{type:"button",className:"fence-boundary__close",onClick:()=>o(x=>ec(x.boundaryPoints,!1)?x:{...x,boundaryClosed:!0}),children:"Finish fence line"}):null]}),(0,L.jsx)("div",{className:"truss-estimator__grid-hint",children:i.boundaryClosed?"Drag the blank canvas to pan. Tap an edge to exclude it from the new fence.":"Click to add points, then finish the fence line. The displayed distances update as you draw."})]}),(0,L.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,L.jsx)("div",{children:i.boundaryMode==="quick"?`${(Number.parseFloat(i.quickLengthM)||0).toFixed(2)} m fence line`:`${X.totalEdgeM.toFixed(2)} m fence line`}),i.boundaryMode==="draw"&&i.boundaryClosed?(0,L.jsxs)("div",{children:[X.cornerPostCount," corner/end posts"]}):null]})]}):null,null,p==="height"?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,L.jsx)("h2",{className:"truss-estimator__step-title",children:"Fence height"}),(0,L.jsx)("p",{className:"truss-estimator__step-sub",children:"Select the nearest available panel height."}),(0,L.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:Na.heights.map(x=>(0,L.jsx)("button",{type:"button",className:`truss-estimator__visual-card${i.height===x?" is-selected":""}`,onClick:()=>o(H=>({...H,height:x})),children:(0,L.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--tall",src:Zt(`/fencing/height/${x}.webp`),alt:""})},x))}),(0,L.jsx)("div",{className:"truss-estimator__section-heading",children:"Gravel board?"}),(0,L.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No gravel board",img:"/fencing/no-gravel-board.webp"},{id:"yes",label:"Add gravel board",img:"/fencing/gravel-board.webp"}].map(x=>(0,L.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${i.gravelBoard===x.id?" is-selected":""}`,onClick:()=>o(H=>({...H,gravelBoard:x.id})),children:[(0,L.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:Zt(x.img),alt:""}),(0,L.jsx)("span",{children:x.label})]},x.id))})]}):null,p==="gate"?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,L.jsx)("h2",{className:"truss-estimator__step-title",children:"Do you need a gate?"}),(0,L.jsx)("p",{className:"truss-estimator__step-sub",children:"A gate opening replaces part of the panel run and adds a gate kit with heavy-duty posts."}),(0,L.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"none",label:"No gate",img:"/fencing/gates/no-gate.webp"},{id:"single",label:"Single gate",img:"/fencing/gates/single-gate.webp"}].map(x=>(0,L.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${i.gateType===x.id?" is-selected":""}`,onClick:()=>o(H=>({...H,gateType:x.id,gateWidthM:x.id==="none"?"":String(Na.gate[x.id].widthDefault)})),children:[(0,L.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:Zt(x.img),alt:""}),(0,L.jsx)("span",{children:x.label})]},x.id))}),i.gateType&&i.gateType!=="none"?(0,L.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,L.jsx)("span",{children:"Gate width (m)"}),(0,L.jsx)("input",{type:"text",inputMode:"decimal",value:i.gateWidthM,onChange:x=>o(H=>({...H,gateWidthM:x.target.value}))})]}):null]}):null,p==="posts"?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,L.jsx)("h2",{className:"truss-estimator__step-title",children:"Posts and fixing type"}),(0,L.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose how the posts will be set."}),(0,L.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Na.mounting).map(([x,H])=>(0,L.jsxs)("button",{type:"button",className:`truss-estimator__option-card${i.mountingType===x?" is-selected":""}`,onClick:()=>o(B=>({...B,mountingType:x})),children:[(0,L.jsx)("div",{className:"truss-estimator__option-title",children:H.label}),(0,L.jsx)("div",{className:"truss-estimator__option-copy",children:H.blurb})]},x))})]}):null]}),(0,L.jsxs)("div",{className:"truss-estimator__nav",children:[(0,L.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:qe,children:"Back"}),(0,L.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:pt,disabled:!Te(),children:[(0,L.jsx)("span",{children:pe}),(0,L.jsx)("span",{className:"arrow",children:(0,L.jsx)(Bt,{})})]})]})]})]})})}var tc=Y($e()),be=Y(re()),pw={floor:{label:"Floor",product:"Knauf Acoustic Roll",thickness:"100mm",coverage:12.36,salesUnit:"roll"},wall:{label:"Cavity wall",product:"Celotex CW4100",thickness:"100mm",coverage:3.24,salesUnit:"pack"},roof:{label:"Pitched roof",product:"Kingspan K107",thickness:"100mm",coverage:8.64,salesUnit:"pack"},loft:{label:"Loft",product:"Knauf Loft Roll 44",thickness:"100mm",coverage:13.89,salesUnit:"roll"}};function kd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,tc.useState)("floor"),[i,o]=(0,tc.useState)(""),[l,c]=(0,tc.useState)(""),u=Number.parseFloat(i)*Number.parseFloat(l)||0,f=pw[r],b=Math.ceil(u/f.coverage),d=[{key:`insulation-${r}`,label:`${f.product} ${f.thickness}`,qty:b,unit:f.salesUnit,query:f.product,category:"insulation"}],h=Object.entries(pw);return(0,be.jsx)(be.Fragment,{children:(0,be.jsxs)("div",{className:"truss-estimator",children:[(0,be.jsxs)("div",{className:"quick-order-hero",children:[(0,be.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,be.jsx)("h1",{children:"Insulation Calculator"}),(0,be.jsx)("p",{children:"Estimate insulation coverage and pack quantities for floors, walls, roofs and lofts."})]}),(0,be.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,be.jsx)("h2",{className:"truss-estimator__step-title",children:"Where and what you are insulating"}),(0,be.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the application and product, and enter the area, for coverage and pack quantities."}),(0,be.jsxs)("div",{className:"materials-calculator__section",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Application"}),(0,be.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:h.map(([w,E])=>(0,be.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===w?" is-selected":""}`,onClick:()=>n(w),children:[(0,be.jsx)("div",{className:"truss-estimator__option-title",children:E.label}),(0,be.jsxs)("div",{className:"truss-estimator__option-copy",children:[E.product,", ",E.thickness]})]},w))})]}),(0,be.jsxs)("div",{className:"materials-calculator__section",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Area"}),(0,be.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,be.jsxs)("label",{className:"truss-estimator__field",children:[(0,be.jsx)("span",{children:"Length (m)"}),(0,be.jsx)("input",{type:"number",min:"0",step:"0.01",value:i,onChange:w=>o(w.target.value)})]}),(0,be.jsxs)("label",{className:"truss-estimator__field",children:[(0,be.jsx)("span",{children:"Width (m)"}),(0,be.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:w=>c(w.target.value)})]})]})]}),(0,be.jsxs)("div",{className:"materials-calculator__totals",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,be.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,be.jsxs)("div",{children:[(0,be.jsx)("span",{children:"Insulated area"}),(0,be.jsxs)("strong",{children:[u.toFixed(2)," m\xB2"]})]}),(0,be.jsxs)("div",{children:[(0,be.jsx)("span",{children:f.product}),(0,be.jsxs)("strong",{children:[b," packs"]})]})]}),(0,be.jsx)("p",{className:"materials-calculator__note",children:"This is a simple product choice, not thermal or Building Regulations advice. Confirm the specification before ordering."})]}),(0,be.jsxs)("div",{className:"materials-calculator__actions",children:[(0,be.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,be.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(d),disabled:u<=0,children:a})]})]})]})})}var Dn=Y($e()),V=Y(re()),C_=10,q_=1.9*.762,E_=1.9*1.524,ac=()=>({height:"",width:""}),rc=e=>Number.parseFloat(e)||0,uw=({height:e,width:t})=>rc(e)*rc(t);function Nd({onBack:e}){let[t,a]=(0,Dn.useState)([ac()]),[r,n]=(0,Dn.useState)([ac()]),[i,o]=(0,Dn.useState)("0"),[l,c]=(0,Dn.useState)("0"),[u,f]=(0,Dn.useState)(1),b=t.reduce((m,p)=>m+uw(p),0),d=r.reduce((m,p)=>m+uw(p),0),h=rc(i)*q_+rc(l)*E_,w=Math.max(0,b-d-h),E=w*u/C_,U=(m,p,g,v)=>{m(N=>N.map((T,M)=>M===p?{...T,[g]:v}:T))};return(0,V.jsx)(V.Fragment,{children:(0,V.jsxs)("div",{className:"truss-estimator",children:[(0,V.jsxs)("div",{className:"quick-order-hero",children:[(0,V.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,V.jsx)("h1",{children:"Paint Calculator"}),(0,V.jsx)("p",{children:"Estimate how much paint you need for your walls, including multiple coats and excluded areas."})]}),(0,V.jsxs)("div",{className:"truss-estimator__card paint-calculator",children:[(0,V.jsx)("h2",{className:"truss-estimator__step-title",children:"Walls, exclusions and coats"}),(0,V.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter each wall, subtract windows and doors, and choose your number of coats. Quantities assume a coverage of 10 m\xB2 per litre."}),(0,V.jsxs)("div",{className:"paint-calculator__section",children:[(0,V.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,V.jsx)("p",{className:"paint-calculator__hint",children:"Enter the height and width of each wall you want to paint."}),(0,V.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,V.jsx)("span",{}),(0,V.jsx)("span",{children:"Height (m)"}),(0,V.jsx)("span",{children:"Width (m)"}),(0,V.jsx)("span",{})]}),t.map((m,p)=>(0,V.jsxs)("div",{className:"paint-calculator__row",children:[(0,V.jsxs)("span",{className:"paint-calculator__row-label",children:["Wall ",p+1]}),(0,V.jsxs)("label",{className:"truss-estimator__field",children:[(0,V.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,V.jsx)("input",{"aria-label":`Wall ${p+1} height in metres`,type:"number",min:"0",step:"0.01",value:m.height,onChange:g=>U(a,p,"height",g.target.value)})]}),(0,V.jsxs)("label",{className:"truss-estimator__field",children:[(0,V.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,V.jsx)("input",{"aria-label":`Wall ${p+1} width in metres`,type:"number",min:"0",step:"0.01",value:m.width,onChange:g=>U(a,p,"width",g.target.value)})]}),t.length>1?(0,V.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>a(g=>g.filter((v,N)=>N!==p)),children:"Remove"}):null]},`wall-${p}`)),(0,V.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>a(m=>[...m,ac()]),children:"+ Add another wall"})]}),(0,V.jsxs)("div",{className:"paint-calculator__section",children:[(0,V.jsx)("div",{className:"truss-estimator__section-heading",children:"Areas to exclude"}),(0,V.jsx)("p",{className:"paint-calculator__hint",children:"Add windows, sockets, skirting boards or other areas that will not be painted."}),(0,V.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,V.jsx)("span",{}),(0,V.jsx)("span",{children:"Height (m)"}),(0,V.jsx)("span",{children:"Width (m)"}),(0,V.jsx)("span",{})]}),r.map((m,p)=>(0,V.jsxs)("div",{className:"paint-calculator__row",children:[(0,V.jsxs)("span",{className:"paint-calculator__row-label",children:["Area ",p+1]}),(0,V.jsxs)("label",{className:"truss-estimator__field",children:[(0,V.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,V.jsx)("input",{"aria-label":`Area ${p+1} height in metres`,type:"number",min:"0",step:"0.01",value:m.height,onChange:g=>U(n,p,"height",g.target.value)})]}),(0,V.jsxs)("label",{className:"truss-estimator__field",children:[(0,V.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,V.jsx)("input",{"aria-label":`Area ${p+1} width in metres`,type:"number",min:"0",step:"0.01",value:m.width,onChange:g=>U(n,p,"width",g.target.value)})]}),r.length>1?(0,V.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>n(g=>g.filter((v,N)=>N!==p)),children:"Remove"}):null]},`excluded-${p}`)),(0,V.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>n(m=>[...m,ac()]),children:"+ Add another area"})]}),(0,V.jsxs)("div",{className:"paint-calculator__section",children:[(0,V.jsx)("div",{className:"truss-estimator__section-heading",children:"Doors and coats"}),(0,V.jsx)("p",{className:"paint-calculator__hint",children:"Enter the number of standard single and double doors to leave unpainted. Door sizes are estimated automatically."}),(0,V.jsxs)("div",{className:"truss-estimator__field-grid paint-calculator__small-fields",children:[(0,V.jsxs)("label",{className:"truss-estimator__field",children:[(0,V.jsx)("span",{children:"Doors"}),(0,V.jsx)("input",{type:"number",min:"0",step:"1",value:i,onChange:m=>o(m.target.value)})]}),(0,V.jsxs)("label",{className:"truss-estimator__field",children:[(0,V.jsx)("span",{children:"Double doors"}),(0,V.jsx)("input",{type:"number",min:"0",step:"1",value:l,onChange:m=>c(m.target.value)})]})]}),(0,V.jsxs)("div",{className:"paint-calculator__coat-field",children:[(0,V.jsx)("p",{className:"paint-calculator__hint",children:"Most walls need 2 coats for an even finish. Use 3 coats when changing colour significantly or covering a darker wall."}),(0,V.jsxs)("label",{className:"truss-estimator__field",children:[(0,V.jsx)("span",{children:"Number of coats"}),(0,V.jsxs)("select",{value:u,onChange:m=>f(Number(m.target.value)),children:[(0,V.jsx)("option",{value:"1",children:"1 coat"}),(0,V.jsx)("option",{value:"2",children:"2 coats"}),(0,V.jsx)("option",{value:"3",children:"3 coats"})]})]})]})]}),(0,V.jsxs)("div",{className:"paint-calculator__totals",children:[(0,V.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,V.jsxs)("div",{className:"paint-calculator__result-grid",children:[(0,V.jsxs)("div",{children:[(0,V.jsx)("span",{children:"Paintable area"}),(0,V.jsxs)("strong",{children:[w.toFixed(2)," m\xB2"]})]}),(0,V.jsxs)("div",{children:[(0,V.jsx)("span",{children:"Coverage"}),(0,V.jsxs)("strong",{children:[u," ",u===1?"coat":"coats"]})]}),(0,V.jsxs)("div",{children:[(0,V.jsx)("span",{children:"Paint required"}),(0,V.jsxs)("strong",{children:[E.toFixed(1)," litres"]})]})]}),(0,V.jsx)("p",{className:"paint-calculator__note",children:"Based on paint coverage of 10 m\xB2 per litre. Decorative paint is not currently stocked in this catalogue, so this remains an estimate only."})]}),(0,V.jsxs)("div",{className:"paint-calculator__actions",children:[(0,V.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,V.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",disabled:!0,children:"Paint products unavailable"})]})]})]})})}var fr=Y($e()),ie=Y(re()),ic=e=>Number.parseFloat(e)||0,Sd={paving:[{id:"council",label:"Council paving slab (600 \xD7 600mm)"},{id:"raj",label:"Raj blend sandstone (600 \xD7 600mm)"}],block:[{id:"brindle",label:"Brindle block paving (60mm)"},{id:"charcoal",label:"Charcoal block paving (60mm)"}],gravel:[{id:"pea",label:"20mm pea shingle"}]};function Cd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,fr.useState)("paving"),[i,o]=(0,fr.useState)("council"),[l,c]=(0,fr.useState)(""),[u,f]=(0,fr.useState)(""),[b,d]=(0,fr.useState)("100"),[h,w]=(0,fr.useState)("50"),[E,U]=(0,fr.useState)(!0),[m,p]=(0,fr.useState)(!0),g=ic(l)*ic(u),v=g,N=g*(ic(b)/1e3),T=g*.04,M=g*(ic(h)/1e3),R=Math.ceil(v/.36),j=Math.ceil(v/.1),W=Math.ceil(N*1700/800),ye=Math.ceil(T*1600/800),Ce=Math.ceil(M*1600/800),He=r==="paving"?{qty:R,unit:"each"}:r==="block"?{qty:v,unit:"m2"}:{qty:Ce,unit:"bag"},We={paving:"paving slab",block:"block paver",gravel:"decorative gravel"}[r],ze=[{key:`surface-${i}`,label:Sd[r].find(K=>K.id===i)?.label??"Surface material",qty:He.qty,unit:He.unit,query:We,category:"landscaping"},...E?[{key:"sub-base",label:"MOT Type 1 sub-base",qty:W,unit:"bag",query:"MOT Type 1 sub base",category:"aggregate"}]:[],...m?[{key:"bedding",label:"Sharp sand bedding",qty:ye,unit:"bag",query:"sharp sand",category:"aggregate"}]:[]];return(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsxs)("div",{className:"truss-estimator",children:[(0,ie.jsxs)("div",{className:"quick-order-hero",children:[(0,ie.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ie.jsx)("h1",{children:"Paving & Driveway Calculator"}),(0,ie.jsx)("p",{children:"Estimate paving, block paving, sub-base and bedding materials for outdoor areas."})]}),(0,ie.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,ie.jsx)("h2",{className:"truss-estimator__step-title",children:"Surface and ground build-up"}),(0,ie.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the surface material and enter the area. Sub-base and bedding sand are estimated alongside the surface units."}),(0,ie.jsxs)("div",{className:"materials-calculator__section",children:[(0,ie.jsx)("div",{className:"truss-estimator__section-heading",children:"Surface material"}),(0,ie.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:[["paving","Paving slabs","For patios and paths"],["block","Block paving","For driveways and paths"],["gravel","Decorative gravel","For paths and landscaping"]].map(([K,Z,ue])=>(0,ie.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===K?" is-selected":""}`,onClick:()=>{n(K),o(Sd[K][0].id)},children:[(0,ie.jsx)("div",{className:"truss-estimator__option-title",children:Z}),(0,ie.jsx)("div",{className:"truss-estimator__option-copy",children:ue})]},K))}),(0,ie.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,ie.jsx)("span",{children:"Finish"}),(0,ie.jsx)("select",{value:i,onChange:K=>o(K.target.value),children:Sd[r].map(K=>(0,ie.jsx)("option",{value:K.id,children:K.label},K.id))})]})]}),(0,ie.jsxs)("div",{className:"materials-calculator__section",children:[(0,ie.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and groundwork"}),(0,ie.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ie.jsxs)("label",{className:"truss-estimator__field",children:[(0,ie.jsx)("span",{children:"Length (m)"}),(0,ie.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:K=>c(K.target.value)})]}),(0,ie.jsxs)("label",{className:"truss-estimator__field",children:[(0,ie.jsx)("span",{children:"Width (m)"}),(0,ie.jsx)("input",{type:"number",min:"0",step:"0.01",value:u,onChange:K=>f(K.target.value)})]})]}),r==="gravel"&&(0,ie.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,ie.jsx)("span",{children:"Gravel depth (mm)"}),(0,ie.jsx)("input",{type:"number",min:"0",step:"10",value:h,onChange:K=>w(K.target.value)})]}),E&&(0,ie.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,ie.jsx)("span",{children:"Sub-base depth (mm)"}),(0,ie.jsx)("input",{type:"number",min:"0",step:"10",value:b,onChange:K=>d(K.target.value)})]}),(0,ie.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,ie.jsx)("input",{type:"checkbox",checked:E,onChange:K=>U(K.target.checked)}),(0,ie.jsx)("span",{children:"Include MOT Type 1 sub-base"})]}),(0,ie.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,ie.jsx)("input",{type:"checkbox",checked:m,onChange:K=>p(K.target.checked)}),(0,ie.jsx)("span",{children:"Include sharp sand bedding"})]})]}),(0,ie.jsxs)("div",{className:"materials-calculator__totals",children:[(0,ie.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ie.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:"Surface area"}),(0,ie.jsxs)("strong",{children:[g.toFixed(2)," m\xB2"]})]}),(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:r==="paving"?"Paving slabs":r==="block"?"Block paving":"Gravel"}),(0,ie.jsx)("strong",{children:r==="paving"?`${R} slabs`:r==="block"?`${v.toFixed(2)} m\xB2`:`${Ce} bulk bags`})]}),E&&(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:"MOT Type 1"}),(0,ie.jsxs)("strong",{children:[W," bulk bags"]})]}),m&&(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:"Sharp sand"}),(0,ie.jsxs)("strong",{children:[ye," bulk bags"]})]})]}),(0,ie.jsx)("p",{className:"materials-calculator__note",children:"Slab and block quantities use typical sizes. Confirm pack coverage and laying pattern before ordering."})]}),(0,ie.jsxs)("div",{className:"materials-calculator__actions",children:[(0,ie.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ie.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(ze),disabled:g<=0,children:a})]})]})]})})}var tl=Y($e()),oe=Y(re()),M_=2.88,dw=[{id:"standard",label:"Standard wallboard",blurb:"General internal walls and ceilings"},{id:"moisture",label:"Moisture resistant",blurb:"Kitchens, bathrooms and utility rooms"},{id:"fire",label:"Fire resistant",blurb:"Where fire-rated lining is required"},{id:"sound",label:"Sound resistant",blurb:"Improved acoustic performance"}],mw=()=>({length:"",height:""}),qd=e=>Number.parseFloat(e)||0;function Ed({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,tl.useState)([mw()]),[i,o]=(0,tl.useState)(""),[l,c]=(0,tl.useState)("standard"),[u,f]=(0,tl.useState)("screws"),b=r.reduce((T,M)=>T+qd(M.length)*qd(M.height),0),d=Math.max(0,b-qd(i)),h=Math.ceil(d/M_),w=Math.ceil(d*12),E=Math.ceil(w/1e3),U=Math.ceil(d*1.2),m=Math.ceil(U/90),p=Math.ceil(d/3.5),g=dw.find(T=>T.id===l)?.label??"Standard",v=[{key:"board",label:`${g} plasterboard`,qty:h,unit:"sheet",query:`${g} plasterboard`,category:"plasterboard"},...u==="screws"?[{key:"screws",label:"Drywall screws",qty:E,unit:"box",query:"drywall screws",category:"fixings"}]:[{key:"adhesive",label:"Board adhesive",qty:p,unit:"bag",query:"drywall board adhesive",category:"plasterboard"}],{key:"tape",label:"Joint tape",qty:m,unit:"roll",query:"plasterboard joint tape",category:"plasterboard"}],N=(T,M,R)=>{n(j=>j.map((W,ye)=>ye===T?{...W,[M]:R}:W))};return(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsxs)("div",{className:"truss-estimator",children:[(0,oe.jsxs)("div",{className:"quick-order-hero",children:[(0,oe.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,oe.jsx)("h1",{children:"Plasterboard & Drylining Calculator"}),(0,oe.jsx)("p",{children:"Estimate boards, fixings and jointing materials for walls and ceilings."})]}),(0,oe.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,oe.jsx)("h2",{className:"truss-estimator__step-title",children:"Boards, fixings and jointing"}),(0,oe.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter the surfaces you are lining and the board specification. Screws, tape and adhesive are estimated with the boards."}),(0,oe.jsxs)("div",{className:"materials-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Board type"}),(0,oe.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:dw.map(T=>(0,oe.jsxs)("button",{type:"button",className:`truss-estimator__option-card${l===T.id?" is-selected":""}`,onClick:()=>c(T.id),children:[(0,oe.jsx)("div",{className:"truss-estimator__option-title",children:T.label}),(0,oe.jsx)("div",{className:"truss-estimator__option-copy",children:T.blurb})]},T.id))})]}),(0,oe.jsxs)("div",{className:"materials-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Fixing method"}),(0,oe.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[["screws","Drywall screws","For timber or metal framing"],["adhesive","Board adhesive","For masonry dot-and-dab"]].map(([T,M,R])=>(0,oe.jsxs)("button",{type:"button",className:`truss-estimator__option-card${u===T?" is-selected":""}`,onClick:()=>f(T),children:[(0,oe.jsx)("div",{className:"truss-estimator__option-title",children:M}),(0,oe.jsx)("div",{className:"truss-estimator__option-copy",children:R})]},T))})]}),(0,oe.jsxs)("div",{className:"materials-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall and ceiling areas"}),(0,oe.jsx)("p",{className:"materials-calculator__hint",children:"Add each surface separately so different wall sizes are easy to measure."}),(0,oe.jsxs)("div",{className:"materials-calculator__dimensions-header",children:[(0,oe.jsx)("span",{children:"Surface"}),(0,oe.jsx)("span",{children:"Length (m)"}),(0,oe.jsx)("span",{children:"Height (m)"}),(0,oe.jsx)("span",{})]}),r.map((T,M)=>(0,oe.jsxs)("div",{className:"materials-calculator__surface-row",children:[(0,oe.jsxs)("span",{children:["Surface ",M+1]}),(0,oe.jsx)("input",{"aria-label":`Surface ${M+1} length`,type:"number",min:"0",step:"0.01",value:T.length,onChange:R=>N(M,"length",R.target.value)}),(0,oe.jsx)("input",{"aria-label":`Surface ${M+1} height`,type:"number",min:"0",step:"0.01",value:T.height,onChange:R=>N(M,"height",R.target.value)}),r.length>1?(0,oe.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>n(R=>R.filter((j,W)=>W!==M)),children:"Remove"}):null]},`surface-${M}`)),(0,oe.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>n(T=>[...T,mw()]),children:"+ Add another surface"}),(0,oe.jsxs)("label",{className:"truss-estimator__field materials-calculator__openings",children:[(0,oe.jsxs)("span",{children:["Openings to deduct (m\xB2) ",(0,oe.jsx)("small",{children:"optional"})]}),(0,oe.jsx)("input",{type:"number",min:"0",step:"0.01",value:i,onChange:T=>o(T.target.value)})]})]}),(0,oe.jsxs)("div",{className:"materials-calculator__totals",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,oe.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:"Board area"}),(0,oe.jsxs)("strong",{children:[d.toFixed(2)," m\xB2"]})]}),(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:"2.4 x 1.2 m boards"}),(0,oe.jsx)("strong",{children:h})]}),(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:u==="screws"?"Drywall screws":"Board adhesive"}),(0,oe.jsx)("strong",{children:u==="screws"?`${w} (${E} boxes)`:`${p} bags`})]}),(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:"Joint tape"}),(0,oe.jsxs)("strong",{children:[U," m (",m," rolls)"]})]})]}),(0,oe.jsx)("p",{className:"materials-calculator__note",children:"Figures are estimates. Confirm board specification, fixing patterns and fire or acoustic requirements before ordering."})]}),(0,oe.jsxs)("div",{className:"materials-calculator__actions",children:[(0,oe.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,oe.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(v),disabled:d<=0,children:a})]})]})]})})}var al=Y($e());var y=Y(re()),Mt={ranges:{standard:{label:"Standard Fink",blurb:"Classic W-shaped truss for standard pitched roofs."},attic:{label:"Attic",blurb:"Room-in-roof truss with usable attic space and clear span."},mono:{label:"Mono-pitch",blurb:"Single-slope truss for lean-to roofs and outbuildings."}},pitches:["15","20","22.5","25","30","35","40","45","50","55"],pitchMultipliers:{15:.95,20:.98,"22.5":1,25:1.02,30:1.05,35:1.1,40:1.18,45:1.27,50:1.38,55:1.52},overhang:{thresholdMM:300,surchargePerTruss:3.5},centresOptions:["400","600"],treatment:{treated:{label:"Treated (tanalised)",surchargePct:.08},untreated:{label:"Untreated",surchargePct:0}},estimate:{design:250,delivery:250,bracingPerMetre:6.5,girderMultiplier:1.8,ranges:{standard:{supplyAt8m:53.33,installPerTruss:30},attic:{supplyAt8m:128.35,installPerTruss:55},mono:{supplyAt8m:60,installPerTruss:38}}}},nc=["range","pitchAndDimensions","quantityAndGirders","bracing"],T_={range:null,pitch:null,spanMM:"",overhangMM:"",roofLengthM:"",centres:null,girderCount:0,bracing:null,treatment:null,contact:{name:"",email:""}};function z_({degrees:e}){let a=e*Math.PI/180,n=82-Math.min(58,38*Math.tan(a));return(0,y.jsxs)("svg",{viewBox:"0 0 100 100",className:"truss-estimator__diagram truss-estimator__diagram--small","aria-hidden":"true",children:[(0,y.jsx)("line",{x1:"6",y1:"82",x2:"94",y2:"82",stroke:"var(--border)",strokeWidth:"2"}),(0,y.jsx)("polygon",{points:`12,82 88,82 50,${n}`,fill:"var(--accent-light)",stroke:"var(--accent)",strokeWidth:"3",strokeLinejoin:"round"})]})}function A_({type:e}){let t="#b3835a",a="#5c3b22",r="#d9b48f",n="#d3d8de",i="#7c8494",o=(f,b,d,h,w=8,E)=>{let U=d-f,m=h-b,p=Math.hypot(U,m)||1,g=-m/p,v=U/p,N=w*.2;return(0,y.jsxs)("g",{children:[(0,y.jsx)("line",{x1:f,y1:b,x2:d,y2:h,stroke:a,strokeWidth:w+3,strokeLinecap:"square"}),(0,y.jsx)("line",{x1:f,y1:b,x2:d,y2:h,stroke:t,strokeWidth:w,strokeLinecap:"square"}),(0,y.jsx)("line",{x1:f-g*N,y1:b-v*N,x2:d-g*N,y2:h-v*N,stroke:r,strokeWidth:Math.max(1.5,w*.24),strokeLinecap:"round",opacity:"0.9"})]},E)},l=(f,b,d)=>(0,y.jsxs)("g",{children:[(0,y.jsx)("rect",{x:f-7.5,y:b-5.5,width:"15",height:"11",rx:"2",fill:n,stroke:i,strokeWidth:"1"}),(0,y.jsx)("circle",{cx:f-4,cy:b-2.5,r:"1",fill:i}),(0,y.jsx)("circle",{cx:f+4,cy:b-2.5,r:"1",fill:i}),(0,y.jsx)("circle",{cx:f-4,cy:b+2.5,r:"1",fill:i}),(0,y.jsx)("circle",{cx:f+4,cy:b+2.5,r:"1",fill:i}),(0,y.jsx)("circle",{cx:f,cy:b,r:"1",fill:i})]},d),c=(f,b)=>(0,y.jsx)("rect",{x:f-9,y:"110",width:"18",height:"10",fill:a},b),u=(0,y.jsx)("line",{x1:"6",y1:"122",x2:"194",y2:"122",stroke:"var(--border)",strokeWidth:"2"});return e==="attic"?(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[u,c(26,"wl"),c(174,"wr"),o(26,112,100,26,8,"b1"),o(174,112,100,26,8,"b2"),o(26,112,174,112,8,"b3"),o(58,112,58,70,6,"b4"),o(142,112,142,70,6,"b5"),o(58,70,142,70,7,"b6"),(0,y.jsx)("rect",{x:"90",y:"82",width:"20",height:"24",fill:"#cfe3f2",stroke:a,strokeWidth:"2"}),(0,y.jsx)("line",{x1:"100",y1:"82",x2:"100",y2:"106",stroke:a,strokeWidth:"1.5"}),l(26,112,"p1"),l(174,112,"p2"),l(100,26,"p3"),l(58,112,"p4"),l(58,70,"p5"),l(142,112,"p6"),l(142,70,"p7")]}):e==="mono"?(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[u,c(26,"wl"),c(174,"wr"),o(26,112,174,26,8,"b1"),o(174,26,174,112,8,"b2"),o(26,112,174,112,8,"b3"),o(90,112,90,75,5,"b4"),o(90,75,132,112,5,"b5"),l(26,112,"p1"),l(174,26,"p2"),l(174,112,"p3"),l(90,112,"p4"),l(90,75,"p5"),l(132,112,"p6")]}):(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[u,c(26,"wl"),c(174,"wr"),o(26,112,100,34,8,"b1"),o(174,112,100,34,8,"b2"),o(26,112,174,112,8,"b3"),o(63,112,100,34,5,"b4"),o(137,112,100,34,5,"b5"),o(63,112,54,83,5,"b6"),o(137,112,146,83,5,"b7"),(0,y.jsx)("rect",{x:"96",y:"108",width:"8",height:"8",fill:a}),l(26,112,"p1"),l(174,112,"p2"),l(100,34,"p3"),l(63,112,"p4"),l(137,112,"p5"),l(54,83,"p6"),l(146,83,"p7")]})}function R_({enabled:e}){return(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[(0,y.jsx)("line",{x1:"6",y1:"122",x2:"194",y2:"122",stroke:"var(--border)",strokeWidth:"2"}),(0,y.jsx)("rect",{x:"17",y:"110",width:"18",height:"10",fill:"#5c3b22"}),(0,y.jsx)("rect",{x:"165",y:"110",width:"18",height:"10",fill:"#5c3b22"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"100",y2:"34",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"100",y2:"34",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"174",y1:"112",x2:"100",y2:"34",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"174",y1:"112",x2:"100",y2:"34",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"174",y2:"112",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"174",y2:"112",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),e?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("line",{x1:"45",y1:"112",x2:"140",y2:"88",stroke:"var(--accent)",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"7 5"}),(0,y.jsx)("line",{x1:"155",y1:"112",x2:"60",y2:"88",stroke:"var(--accent)",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"7 5"})]}):null,(0,y.jsx)("rect",{x:"18.5",y:"106.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"}),(0,y.jsx)("rect",{x:"166.5",y:"106.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"}),(0,y.jsx)("rect",{x:"92.5",y:"28.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"})]})}function fw({treated:e}){let t=e?"#5a7a4a":"var(--accent)";return(0,y.jsxs)("svg",{viewBox:"0 0 100 100",className:"truss-estimator__diagram truss-estimator__diagram--small","aria-hidden":"true",children:[(0,y.jsx)("rect",{x:"10",y:"22",width:"80",height:"14",rx:"2",fill:t}),(0,y.jsx)("rect",{x:"10",y:"43",width:"80",height:"14",rx:"2",fill:e?"#8faf7a":"var(--accent-light)"}),(0,y.jsx)("rect",{x:"10",y:"64",width:"80",height:"14",rx:"2",fill:t})]})}function Md({onBack:e}){let[t,a]=(0,al.useState)(0),[r,n]=(0,al.useState)(T_),[i,o]=(0,al.useState)(!1),[l,c]=(0,al.useState)(!1),u=()=>{let m=Number.parseFloat(r.roofLengthM)||0,p=Number.parseFloat(r.centres??"");return m<=0||!p?0:Math.ceil(m*1e3/p)+1},b=(()=>{let m=r.range?Mt.ranges[r.range]:Mt.ranges.standard,p=r.pitch??"22.5",g=Mt.pitchMultipliers[p],v=(Number.parseFloat(r.spanMM)||0)/1e3,T=(Number.parseFloat(r.overhangMM)||0)>Mt.overhang.thresholdMM,M=u(),R=M+r.girderCount,j=Number.parseFloat(r.roofLengthM)||0,W=r.treatment?Mt.treatment[r.treatment]:Mt.treatment.untreated,ye=Mt.estimate.ranges[r.range??"standard"],Ce=ye.supplyAt8m*Math.max(.7,v/8)*g*(1+W.surchargePct)+(T?Mt.overhang.surchargePerTruss:0),He=M*Ce,We=r.girderCount*Ce*Mt.estimate.girderMultiplier,ze=r.bracing==="yes"?j*Mt.estimate.bracingPerMetre:0,X=He+We+ze+Mt.estimate.delivery,K=Mt.estimate.design+M*ye.installPerTruss+r.girderCount*40,Z=X+K,ue=Z*.2;return{range:m,count:M,girderCount:r.girderCount,overhangApplies:T,overhangUnits:R,roofLengthM:j,treatment:W,trussSupply:He,bracingMaterials:ze,delivery:Mt.estimate.delivery,labour:K,subtotal:Z,vat:ue,total:Z+ue}})(),d=()=>{let m=nc[t];return m==="range"?!!r.range:m==="pitchAndDimensions"?!!r.pitch&&r.spanMM.trim()!==""&&r.overhangMM.trim()!=="":m==="quantityAndGirders"?r.roofLengthM.trim()!==""&&!!r.centres:m==="bracing"?!!r.bracing&&!!r.treatment:!0},h=t===nc.length-1?"View truss request":"Next",w=()=>{i?o(!1):t===0?e():a(m=>m-1)},E=()=>{d()&&(t===nc.length-1?(c(!1),o(!0)):a(m=>m+1))},U=()=>{let m=nc[t];return m==="range"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 1 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your truss range"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Pricing shown is placeholder. Swap in your real engineering and pricing catalogue."}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--range",children:Object.entries(Mt.ranges).map(([p,g])=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r.range===p?" is-selected":""}`,onClick:()=>n(v=>({...v,range:p})),children:[(0,y.jsx)(A_,{type:p}),(0,y.jsxs)("div",{className:"truss-estimator__option-info",children:[(0,y.jsx)("div",{className:"truss-estimator__option-title",children:g.label}),(0,y.jsx)("div",{className:"truss-estimator__option-copy",children:g.blurb})]})]},p))})]}):m==="pitchAndDimensions"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 2 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Span, overhang and roof pitch"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Span is wall-to-wall, overhang is the eaves tail beyond the wall line. Steeper pitches use more timber per truss."}),(0,y.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,y.jsxs)("label",{className:"truss-estimator__field",children:[(0,y.jsx)("span",{children:"Span (mm)"}),(0,y.jsx)("input",{type:"text",inputMode:"numeric",value:r.spanMM,onChange:p=>n(g=>({...g,spanMM:p.target.value}))})]}),(0,y.jsxs)("label",{className:"truss-estimator__field",children:[(0,y.jsx)("span",{children:"Overhang (mm)"}),(0,y.jsx)("input",{type:"text",inputMode:"numeric",value:r.overhangMM,onChange:p=>n(g=>({...g,overhangMM:p.target.value}))}),(0,y.jsxs)("small",{children:["Overhangs beyond ",Mt.overhang.thresholdMM,"mm add a small surcharge per truss."]})]})]}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Roof pitch"}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:Mt.pitches.map(p=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${r.pitch===p?" is-selected":""}`,onClick:()=>n(g=>({...g,pitch:p})),children:[(0,y.jsx)(z_,{degrees:Number.parseFloat(p)}),(0,y.jsxs)("span",{children:[p,"\xB0"]})]},p))})]}):m==="quantityAndGirders"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 3 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Roof length"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Trusses are based on designs at 400mm or 600mm centres wherever possible."}),(0,y.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,y.jsx)("span",{children:"Roof length (m)"}),(0,y.jsx)("input",{type:"text",inputMode:"decimal",value:r.roofLengthM,onChange:p=>n(g=>({...g,roofLengthM:p.target.value}))})]}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Truss centres"}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--centres",children:Mt.centresOptions.map(p=>(0,y.jsx)("button",{type:"button",className:`truss-estimator__option-card truss-estimator__option-card--compact${r.centres===p?" is-selected":""}`,onClick:()=>n(g=>({...g,centres:p})),children:(0,y.jsxs)("div",{className:"truss-estimator__option-title",children:[p,"mm centres"]})},p))}),(0,y.jsxs)("div",{className:"truss-estimator__stat",children:[u()," trusses estimated"]}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Girder trusses"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Heavy-duty girder trusses carry point loads over large openings. Set 0 if you do not need any."}),(0,y.jsxs)("div",{className:"truss-estimator__stepper",children:[(0,y.jsx)("button",{type:"button",onClick:()=>n(p=>({...p,girderCount:Math.max(0,p.girderCount-1)})),children:"\u2212"}),(0,y.jsx)("span",{children:r.girderCount}),(0,y.jsx)("button",{type:"button",onClick:()=>n(p=>({...p,girderCount:Math.min(3,p.girderCount+1)})),children:"+"})]})]}):m==="bracing"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 4 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Bracing pack?"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"A timber bracing pack stabilises the roof structure once trusses are erected."}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No bracing pack"},{id:"yes",label:"Add bracing pack"}].map(p=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.bracing===p.id?" is-selected":""}`,onClick:()=>n(g=>({...g,bracing:p.id})),children:[(0,y.jsx)(R_,{enabled:p.id==="yes"}),(0,y.jsx)("span",{children:p.label})]},p.id))}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber treatment"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Tanalised timber protects against rot in exposed or damp locations."}),(0,y.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.treatment==="untreated"?" is-selected":""}`,onClick:()=>n(p=>({...p,treatment:"untreated"})),children:[(0,y.jsx)(fw,{treated:!1}),(0,y.jsx)("span",{children:"Untreated"})]}),(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.treatment==="treated"?" is-selected":""}`,onClick:()=>n(p=>({...p,treatment:"treated"})),children:[(0,y.jsx)(fw,{treated:!0}),(0,y.jsx)("span",{children:"Treated (+8% cost)"}),(0,y.jsx)("small",{children:"Applies to trusses, girders and overhang"})]})]})]}):null};return i?(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)("div",{className:"truss-estimator",children:[(0,y.jsxs)("div",{className:"quick-order-hero",children:[(0,y.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,y.jsx)("h1",{children:"Your truss estimate"}),(0,y.jsx)("p",{children:"A provisional quantity and specification based on the dimensions you entered."})]}),(0,y.jsxs)("div",{className:"truss-estimator__card truss-request",style:{minHeight:0},children:[(0,y.jsxs)("div",{className:"truss-request__heading",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Estimated requirement"}),(0,y.jsxs)("h2",{children:[b.range.label," roof trusses"]})]}),(0,y.jsxs)("strong",{children:[b.count,(0,y.jsx)("span",{children:"trusses"})]})]}),(0,y.jsxs)("div",{className:"truss-request__grid",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Span"}),(0,y.jsxs)("strong",{children:[r.spanMM," mm"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Roof length"}),(0,y.jsxs)("strong",{children:[r.roofLengthM," m"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Pitch"}),(0,y.jsxs)("strong",{children:[r.pitch,"\xB0"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Centres"}),(0,y.jsxs)("strong",{children:[r.centres," mm"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Overhang"}),(0,y.jsxs)("strong",{children:[r.overhangMM," mm"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Treatment"}),(0,y.jsx)("strong",{children:b.treatment.label})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Girder trusses"}),(0,y.jsx)("strong",{children:b.girderCount||"None"})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Bracing pack"}),(0,y.jsx)("strong",{children:r.bracing==="yes"?"Included":"Not included"})]})]}),(0,y.jsxs)("div",{className:"truss-request__price",children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Indicative cost estimate"}),(0,y.jsxs)("div",{className:"truss-request__price-grid",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Truss supply allowance"}),(0,y.jsx)("strong",{children:at(b.trussSupply)})]}),b.bracingMaterials>0&&(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Bracing materials allowance"}),(0,y.jsx)("strong",{children:at(b.bracingMaterials)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Delivery allowance"}),(0,y.jsx)("strong",{children:at(b.delivery)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Design and installation labour"}),(0,y.jsx)("strong",{children:at(b.labour)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Subtotal (ex. VAT)"}),(0,y.jsx)("strong",{children:at(b.subtotal)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"VAT (20%)"}),(0,y.jsx)("strong",{children:at(b.vat)})]}),(0,y.jsxs)("div",{className:"truss-request__price-total",children:[(0,y.jsx)("span",{children:"Estimated total"}),(0,y.jsx)("strong",{children:at(b.total)})]})]}),(0,y.jsx)("p",{children:"Trusses are not listed as fixed products in this catalogue, so supply, delivery and labour are benchmark allowances. Confirm the engineered design and final quote before ordering."})]}),(0,y.jsxs)("div",{className:"truss-request__notice",children:[(0,y.jsx)("strong",{children:"Before ordering"}),(0,y.jsx)("span",{children:"Roof trusses must be designed and signed off for the building. Confirm loading, bearings, wind bracing and final drawings with the truss manufacturer."})]}),(0,y.jsxs)("div",{className:"truss-estimator__nav",children:[(0,y.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:w,children:"Back to calculator"}),(0,y.jsx)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",justifyContent:"center",marginTop:0},onClick:()=>c(!0),children:"Request order"})]}),l&&(0,y.jsx)("p",{className:"truss-request__demo",children:"Demo only \u2014 no order has been sent."})]})]})}):(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)("div",{className:"truss-estimator",children:[(0,y.jsxs)("div",{className:"quick-order-hero",children:[(0,y.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,y.jsx)("h1",{children:"Roof Truss Calculator"}),(0,y.jsx)("p",{children:"Estimate trusses, girders and cost for your roof in a few steps."})]}),(0,y.jsxs)("div",{className:"truss-estimator__card",children:[(0,y.jsx)("div",{className:"truss-estimator__body",children:U()}),(0,y.jsxs)("div",{className:"truss-estimator__nav",children:[(0,y.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:w,children:"Back"}),(0,y.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:E,disabled:!d(),children:[(0,y.jsx)("span",{children:h}),(0,y.jsx)("span",{className:"arrow",children:(0,y.jsx)(Bt,{})})]})]})]})]})})}var Si=Y($e()),I=Y(re()),bw=e=>Number.parseFloat(e)||0,oc=(e,t)=>bw(e)*(t==="m"?1:.3048),gw=()=>({length:"",width:""}),hw=[{id:"chamfered",label:"Chamfered",blurb:"Clean angled edge"},{id:"ogee",label:"Ogee",blurb:"Traditional curved profile"},{id:"pencil-round",label:"Pencil round",blurb:"Simple softened edge"},{id:"torus",label:"Torus",blurb:"Soft rounded detail"}];function U_({profile:e}){return(0,I.jsxs)("svg",{className:"skirting-calculator__profile-diagram",viewBox:"0 0 120 84","aria-hidden":"true",children:[(0,I.jsx)("path",{d:{chamfered:"M16 70V43L43 16H104V70Z",ogee:"M16 70V47C16 36 27 31 40 31C40 21 50 16 63 16H104V70Z","pencil-round":"M16 70V37C16 25 25 16 37 16H104V70Z",torus:"M16 70V49C16 39 25 34 36 34C36 22 47 16 61 16H104V70Z"}[e]}),(0,I.jsx)("line",{x1:"12",y1:"70",x2:"108",y2:"70"})]})}function Td({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,Si.useState)("total"),[i,o]=(0,Si.useState)("m"),[l,c]=(0,Si.useState)(""),[u,f]=(0,Si.useState)([gw()]),[b,d]=(0,Si.useState)(""),[h,w]=(0,Si.useState)("chamfered"),E="4.2",U=r==="total"?oc(l,i):u.reduce((N,T)=>N+2*(oc(T.length,i)+oc(T.width,i)),0),m=Math.max(0,U-oc(b,i)),p=Math.ceil(m/bw(E)),g=[{key:`skirting-${h}`,label:`${hw.find(N=>N.id===h)?.label} skirting board`,qty:m,unit:"m",query:"skirting board",category:"skirting"}],v=(N,T,M)=>{f(R=>R.map((j,W)=>W===N?{...j,[T]:M}:j))};return(0,I.jsx)(I.Fragment,{children:(0,I.jsxs)("div",{className:"truss-estimator",children:[(0,I.jsxs)("div",{className:"quick-order-hero",children:[(0,I.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,I.jsx)("h1",{children:"Skirting Board Calculator"}),(0,I.jsx)("p",{children:"Work out how many skirting board lengths you need for one room or a whole project."})]}),(0,I.jsxs)("div",{className:"truss-estimator__card skirting-calculator",children:[(0,I.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure by room or total length"}),(0,I.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter a single total or work room by room. The run is converted straight into board lengths."}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"How would you like to measure?"}),(0,I.jsxs)("div",{className:"brick-calculator__unit-toggle skirting-calculator__mode-toggle",role:"group","aria-label":"Calculation method",children:[(0,I.jsx)("button",{type:"button",className:r==="total"?"is-selected":"",onClick:()=>n("total"),children:"Total length"}),(0,I.jsx)("button",{type:"button",className:r==="rooms"?"is-selected":"",onClick:()=>n("rooms"),children:"Room by room"})]})]}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Measurements"}),(0,I.jsxs)("div",{className:"skirting-calculator__unit-row",children:[(0,I.jsx)("span",{children:"Units"}),(0,I.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,I.jsx)("button",{type:"button",className:i==="m"?"is-selected":"",onClick:()=>o("m"),children:"Metres"}),(0,I.jsx)("button",{type:"button",className:i==="ft"?"is-selected":"",onClick:()=>o("ft"),children:"Feet"})]})]}),r==="total"?(0,I.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,I.jsxs)("span",{children:["Total skirting length (",i,")"]}),(0,I.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:N=>c(N.target.value)})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)("div",{className:"skirting-calculator__dimensions-header",children:[(0,I.jsx)("span",{children:"Room"}),(0,I.jsxs)("span",{children:["Length (",i,")"]}),(0,I.jsxs)("span",{children:["Width (",i,")"]}),(0,I.jsx)("span",{})]}),u.map((N,T)=>(0,I.jsxs)("div",{className:"skirting-calculator__room-row",children:[(0,I.jsxs)("span",{className:"skirting-calculator__room-label",children:["Room ",T+1]}),(0,I.jsx)("input",{"aria-label":`Room ${T+1} length in ${i}`,type:"number",min:"0",step:"0.01",value:N.length,onChange:M=>v(T,"length",M.target.value)}),(0,I.jsx)("input",{"aria-label":`Room ${T+1} width in ${i}`,type:"number",min:"0",step:"0.01",value:N.width,onChange:M=>v(T,"width",M.target.value)}),u.length>1?(0,I.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>f(M=>M.filter((R,j)=>j!==T)),children:"Remove"}):null]},`room-${T}`)),(0,I.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>f(N=>[...N,gw()]),children:"+ Add another room"})]}),(0,I.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,I.jsxs)("span",{children:["Openings and doorways to deduct (",i,") ",(0,I.jsx)("small",{children:"optional"})]}),(0,I.jsx)("input",{type:"number",min:"0",step:"0.01",value:b,onChange:N=>d(N.target.value)})]})]}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Profile"}),(0,I.jsx)("p",{className:"skirting-calculator__hint",children:"Choose the finish you want for the fixed 4.2m white-primed MDF boards."}),(0,I.jsx)("div",{className:"architrave-calculator__profiles",children:hw.map(N=>(0,I.jsxs)("button",{type:"button",className:`truss-estimator__option-card${h===N.id?" is-selected":""}`,onClick:()=>w(N.id),children:[(0,I.jsx)(U_,{profile:N.id}),(0,I.jsx)("div",{className:"truss-estimator__option-title",children:N.label}),(0,I.jsx)("div",{className:"truss-estimator__option-copy",children:N.blurb})]},N.id))})]}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,I.jsx)("div",{className:"truss-estimator__field-grid skirting-calculator__options-grid",children:(0,I.jsxs)("label",{className:"truss-estimator__field",children:[(0,I.jsx)("span",{children:"Board length"}),(0,I.jsx)("input",{value:"4.20 m",disabled:!0})]})}),(0,I.jsx)("p",{className:"skirting-calculator__hint",children:"Longer boards can reduce the number of joins, while 10% waste allows for cuts, corners and mistakes."})]}),(0,I.jsxs)("div",{className:"skirting-calculator__totals",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,I.jsxs)("div",{className:"skirting-calculator__result-grid",children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("span",{children:"Net skirting"}),(0,I.jsxs)("strong",{children:[m.toFixed(2)," m"]})]}),(0,I.jsxs)("div",{children:[(0,I.jsx)("span",{children:"Board lengths"}),(0,I.jsx)("strong",{children:p})]})]}),(0,I.jsx)("p",{className:"skirting-calculator__note",children:"Corners and joins vary by room layout. Measure each wall where possible for the most accurate result."})]}),(0,I.jsxs)("div",{className:"skirting-calculator__actions",children:[(0,I.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,I.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(g),disabled:m<=0,children:a})]})]})]})})}var Bn=Y($e()),se=Y(re()),rl=e=>Number.parseFloat(e)||0;function zd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,Bn.useState)("studs"),[i,o]=(0,Bn.useState)(""),[l,c]=(0,Bn.useState)(""),[u,f]=(0,Bn.useState)("600"),[b,d]=(0,Bn.useState)("2.4"),h=i&&l&&u?Math.ceil(rl(l)/(rl(u)/1e3))+1:0,w=h*rl(i),E=rl(b)>0?Math.ceil(w/rl(b)):0,U=[{key:r,label:{studs:"Stud timber",joists:"Joist timber",battens:"Batten timber"}[r],qty:w,unit:"m",query:{studs:"cls studwork timber",joists:"timber joist",battens:"roofing batten"}[r],category:"timber"}],m={studs:["Stud wall","Vertical studs along a wall length"],joists:["Joists","Parallel joists across a floor or deck"],battens:["Battens","Regularly spaced battens for lining or cladding"]},g={studs:{member:"Wall height",overall:"Wall length",help:"Studs repeat across the wall length.",count:"Studs"},joists:{member:"Joist span",overall:"Overall width",help:"Joists repeat across the overall floor or deck width.",count:"Joists"},battens:{member:"Batten length",overall:"Overall width",help:"Battens repeat across the overall lining or cladding width.",count:"Battens"}}[r];return(0,se.jsx)(se.Fragment,{children:(0,se.jsxs)("div",{className:"truss-estimator",children:[(0,se.jsxs)("div",{className:"quick-order-hero",children:[(0,se.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,se.jsx)("h1",{children:"Timber Calculator"}),(0,se.jsx)("p",{children:"Estimate studs, joists or battens from a run length, width and spacing."})]}),(0,se.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,se.jsx)("h2",{className:"truss-estimator__step-title",children:"Member size and spacing"}),(0,se.jsxs)("p",{className:"truss-estimator__step-sub",children:[g.help," Enter the member length and centres to estimate the number of pieces and stock lengths."]}),(0,se.jsxs)("div",{className:"materials-calculator__section",children:[(0,se.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber use"}),(0,se.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:Object.keys(m).map(v=>(0,se.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===v?" is-selected":""}`,onClick:()=>n(v),children:[(0,se.jsx)("div",{className:"truss-estimator__option-title",children:m[v][0]}),(0,se.jsx)("div",{className:"truss-estimator__option-copy",children:m[v][1]})]},v))})]}),(0,se.jsxs)("div",{className:"materials-calculator__section",children:[(0,se.jsx)("div",{className:"truss-estimator__section-heading",children:"Dimensions and spacing"}),(0,se.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,se.jsxs)("label",{className:"truss-estimator__field",children:[(0,se.jsxs)("span",{children:[g.member," (m)"]}),(0,se.jsx)("input",{type:"number",min:"0",step:"0.01",value:i,onChange:v=>o(v.target.value)})]}),(0,se.jsxs)("label",{className:"truss-estimator__field",children:[(0,se.jsxs)("span",{children:[g.overall," (m)"]}),(0,se.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:v=>c(v.target.value)})]})]}),(0,se.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,se.jsxs)("label",{className:"truss-estimator__field",children:[(0,se.jsx)("span",{children:"Centres (mm)"}),(0,se.jsxs)("select",{value:u,onChange:v=>f(v.target.value),children:[(0,se.jsx)("option",{value:"300",children:"300 mm"}),(0,se.jsx)("option",{value:"400",children:"400 mm"}),(0,se.jsx)("option",{value:"450",children:"450 mm"}),(0,se.jsx)("option",{value:"600",children:"600 mm"})]})]}),(0,se.jsxs)("label",{className:"truss-estimator__field",children:[(0,se.jsx)("span",{children:"Stock length (m)"}),(0,se.jsxs)("select",{value:b,onChange:v=>d(v.target.value),children:[(0,se.jsx)("option",{value:"2.4",children:"2.40 m"}),(0,se.jsx)("option",{value:"3.6",children:"3.60 m"}),(0,se.jsx)("option",{value:"4.8",children:"4.80 m"})]})]})]})]}),(0,se.jsxs)("div",{className:"materials-calculator__totals",children:[(0,se.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,se.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,se.jsxs)("div",{children:[(0,se.jsx)("span",{children:g.count}),(0,se.jsx)("strong",{children:h})]}),(0,se.jsxs)("div",{children:[(0,se.jsx)("span",{children:"Linear metres"}),(0,se.jsxs)("strong",{children:[w.toFixed(2)," m"]})]}),(0,se.jsxs)("div",{children:[(0,se.jsxs)("span",{children:[b," m lengths"]}),(0,se.jsx)("strong",{children:E})]})]}),(0,se.jsx)("p",{className:"materials-calculator__note",children:"Spacing is measured centre-to-centre. Add extra timber for plates, noggins, trimming and openings where required."})]}),(0,se.jsxs)("div",{className:"materials-calculator__actions",children:[(0,se.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,se.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(U),disabled:w<=0,children:a})]})]})]})})}var Ad=[{id:"truss",title:"Roof Truss Calculator",desc:"Estimate trusses, girders and roof structure costs.",imageUrl:"/tool-images/truss.webp",Component:Md},{id:"fencing",title:"Fencing Calculator",desc:"Estimate fence panels, posts, gravel boards and fixings.",imageUrl:"/tool-images/fencing.webp",Component:xd},{id:"decking",title:"Decking Calculator",desc:"Estimate boards, substructure and fixing quantities.",imageUrl:"/tool-images/decking.webp",Component:_d},{id:"brick-block",title:"Brick & Block Calculator",desc:"Estimate masonry units and ready-mixed mortar for a wall.",imageUrl:"/tool-images/brick-block.webp",Component:hd},{id:"paint",title:"Paint Calculator",desc:"Estimate paint for walls, doors and multiple coats.",imageUrl:"/tool-images/paint.webp",Component:Nd},{id:"skirting",title:"Skirting Board Calculator",desc:"Estimate skirting lengths for rooms and wall runs.",imageUrl:"/tool-images/skirting.webp",Component:Td},{id:"architrave",title:"Architrave Calculator",desc:"Estimate architrave lengths for door and window openings.",imageUrl:"/tool-images/architrave.webp",Component:gd},{id:"concrete-aggregate",title:"Concrete & Aggregate Calculator",desc:"Estimate concrete, MOT, sand and gravel quantities.",imageUrl:"/tool-images/concrete-aggregate.webp",Component:wd},{id:"plasterboard",title:"Plasterboard Calculator",desc:"Estimate plasterboard sheets, screws, tape and adhesive.",imageUrl:"/tool-images/plasterboard.webp",Component:Ed},{id:"insulation",title:"Insulation Calculator",desc:"Estimate insulation packs for floors, walls, roofs and lofts.",imageUrl:"/tool-images/insulation.webp",Component:kd},{id:"timber",title:"Timber Calculator",desc:"Estimate studs, joists and battens from spacing and lengths.",imageUrl:"/tool-images/timber.webp",Component:zd},{id:"paving",title:"Paving & Driveway Calculator",desc:"Estimate paving, block paving, MOT and sharp sand.",imageUrl:"/tool-images/paving.webp",Component:Cd}];var sc=Y($e());var Le=Y($e());var k=Y(re()),D_=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}],Rd={wasteFactorEnabled:!0},B_=3e3,vw=null;function lc(e,t){let a=Ko(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function O_(e){return e&&e.length>0?e.join(" x "):"-"}function Ud({toolId:e,requirements:t,ready:a,onBack:r,onTotalChange:n}){let i=Vs(),o=`${e}~${t.map(S=>`${S.key}|${S.query}|${S.category??""}|${S.qty}`).join("~")}`,l=o!==vw,[c,u]=(0,Le.useState)(null),[f,b]=(0,Le.useState)([]),[d,h]=(0,Le.useState)(l),[w,E]=(0,Le.useState)(null),[U,m]=(0,Le.useState)("tile"),[p,g]=(0,Le.useState)(null),[v,N]=(0,Le.useState)(""),[T,M]=(0,Le.useState)(null),[R,j]=(0,Le.useState)(""),[W,ye]=(0,Le.useState)([]),[Ce,He]=(0,Le.useState)(new Set),[We,ze]=(0,Le.useState)(null),[X,K]=(0,Le.useState)(""),[Z,ue]=(0,Le.useState)([]),Te=(0,Le.useRef)(null),pe=(0,Le.useRef)(!1),De=S=>`${e}:${S}`,Qe=S=>Zr(S.chosen,{lineId:De(S.requirement.key),description:S.requirement.label,unit:S.requirement.unit,qty:S.requirement.qty}),ct=(0,Le.useMemo)(()=>t.map(S=>`${S.key}|${S.query}|${S.category??""}`).join("~"),[t]);(0,Le.useEffect)(()=>{let S=!1;return nw().then(Q=>{S||u(Q.itemCount>0)}).catch(()=>{S||u(!1)}),()=>{S=!0}},[]),(0,Le.useEffect)(()=>{if(!a||!c)return;let S=!1,Q;l&&h(!0),E(null);let J=Date.now();return(async()=>{let me=null;try{me=(await iw(t)).map(({requirement:Ke,candidates:vt})=>({requirement:Ke,candidates:vt,chosen:vt[0]??null}))}catch(_e){S||E(_e instanceof Error?_e.message:"Could not load products")}if(!S){if(vw=o,l){let _e=B_-(Date.now()-J);_e>0&&await new Promise(Ke=>{Q=window.setTimeout(Ke,_e)})}S||(me&&(b(me),!pe.current&&i&&(pe.current=!0,i.addManyToCart(me.filter(_e=>_e.chosen).map(Qe)))),h(!1))}})(),()=>{S=!0,window.clearTimeout(Q)}},[a,c,ct]),(0,Le.useEffect)(()=>{if(!T)return;let S=R.trim();if(!S){ye([]);return}let Q=!1,J=window.setTimeout(()=>{Jr(S).then(me=>{Q||ye(me)}).catch(()=>{Q||ye([])})},250);return()=>{Q=!0,window.clearTimeout(J)}},[T,R]),(0,Le.useEffect)(()=>{if(!We)return;let S=X.trim();if(!S){ue([]);return}let Q=!1,J=window.setTimeout(()=>{Jr(S).then(me=>{Q||ue(me)}).catch(()=>{Q||ue([])})},250);return()=>{Q=!0,window.clearTimeout(J)}},[We,X]);let Ze=(0,Le.useMemo)(()=>{let S=v.trim().toLowerCase(),Q=S?f.filter(J=>J.requirement.label.toLowerCase().includes(S)||(J.chosen?.description??"").toLowerCase().includes(S)||(J.chosen?.product_id??"").toLowerCase().includes(S)):f;return p?[...Q].sort((J,me)=>{let _e=J.requirement.label.localeCompare(me.requirement.label);return p==="asc"?_e:-_e}):Q},[f,v,p]),Lt=Ze.filter(S=>S.chosen),G=Ze.filter(S=>!S.chosen),P=f.filter(S=>S.chosen),fe=P.filter(S=>S.chosen?.price==null).length,gt=P.reduce((S,Q)=>S+(za(Qe(Q),Rd).lineTotal??0),0);if((0,Le.useEffect)(()=>{n?.(gt)},[gt,n]),!a||c===!1)return null;let C=i?P.filter(S=>i.cart[De(S.requirement.key)]).length:0,z=We?f.find(S=>S.requirement.key===We)??null:null,ve=X.trim()?Z:z?.candidates??[],qe=S=>{let Q=T===S.requirement.key;M(Q?null:S.requirement.key),j(Q?"":S.requirement.query)},pt=(S,Q)=>{let J=f.find(me=>me.requirement.key===S);b(me=>me.map(_e=>_e.requirement.key===S?{..._e,chosen:Q}:_e)),i&&J&&i.cart[De(S)]&&i.addToCart(Qe({...J,chosen:Q})),M(null),j("")},xt=S=>{b(Q=>Q.map(J=>J.requirement.key===S?{...J,chosen:null}:J)),i?.cart[De(S)]&&i.removeFromCart(De(S))},x=S=>{ze(S.requirement.key),K(""),ue([])},H=()=>{ze(null),K(""),ue([])},B=S=>{if(!i)return;let Q=De(S.requirement.key);i.cart[Q]?i.removeFromCart(Q):i.addToCart(Qe(S))},ne=S=>{He(Q=>{let J=new Set(Q);return J.has(S)?J.delete(S):J.add(S),J})},te=S=>{let Q=W.length>0?W:S.candidates;return(0,k.jsxs)("div",{className:"estimator-products__picker",children:[(0,k.jsx)("input",{type:"text",className:"results-search-input",value:R,autoFocus:!0,placeholder:"Search products in catalogue...",onChange:J=>j(J.target.value),"aria-label":`Search a product for ${S.requirement.label}`}),(0,k.jsxs)("div",{className:"estimator-products__options",children:[Q.map(J=>(0,k.jsxs)("button",{type:"button",className:`estimator-products__option${J.product_id===S.chosen?.product_id?" is-selected":""}`,onClick:()=>pt(S.requirement.key,J),children:[(0,k.jsx)("span",{children:J.description}),(0,k.jsxs)("span",{className:"results-row-meta",children:[J.product_id,J.price!=null&&` \xB7 ${at(J.price)}`]})]},J.product_id)),Q.length===0&&(0,k.jsx)("p",{className:"results-empty-hint",children:"No matching products."})]})]})};return(0,k.jsxs)("section",{className:"estimator-products results-tile-section","aria-label":"Matched products",children:[!d&&(0,k.jsxs)("div",{className:"estimator-products__head",children:[(0,k.jsxs)("div",{className:"results-tile-section__head",children:[(0,k.jsx)("h3",{children:"Matched Products"}),(0,k.jsx)("p",{children:"Products matched to your estimate, check before adding to your basket."})]}),!z&&(0,k.jsxs)("div",{className:"results-summary estimator-products__toolbar",children:[fe>0&&(0,k.jsxs)("span",{className:"summary-chip summary-chip--neutral",children:[(0,k.jsx)("strong",{children:fe})," need pricing"]}),(0,k.jsxs)("div",{className:"estimator-products__controls",children:[(0,k.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search description...",value:v,onChange:S=>N(S.target.value),"aria-label":"Search matched products"}),(0,k.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,k.jsx)("button",{type:"button",className:`results-view-toggle__btn${U==="tile"?" is-active":""}`,"aria-pressed":U==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>m("tile"),children:(0,k.jsxs)("svg",{width:"18",height:"12",viewBox:"0 0 15 10",fill:"currentColor",children:[(0,k.jsx)("rect",{x:"0.5",y:"0.5",width:"4",height:"4"}),(0,k.jsx)("rect",{x:"5.5",y:"0.5",width:"4",height:"4"}),(0,k.jsx)("rect",{x:"10.5",y:"0.5",width:"4",height:"4"}),(0,k.jsx)("rect",{x:"0.5",y:"5.5",width:"4",height:"4"}),(0,k.jsx)("rect",{x:"5.5",y:"5.5",width:"4",height:"4"}),(0,k.jsx)("rect",{x:"10.5",y:"5.5",width:"4",height:"4"})]})}),(0,k.jsx)("button",{type:"button",className:`results-view-toggle__btn${U==="list"?" is-active":""}`,"aria-pressed":U==="list","aria-label":"List view",title:"List view",onClick:()=>m("list"),children:(0,k.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,k.jsx)("line",{x1:"0.5",y1:"2.5",x2:"14.5",y2:"2.5"}),(0,k.jsx)("line",{x1:"0.5",y1:"7.5",x2:"14.5",y2:"7.5"}),(0,k.jsx)("line",{x1:"0.5",y1:"12.5",x2:"14.5",y2:"12.5"})]})})]}),(0,k.jsxs)("details",{ref:Te,style:{position:"relative"},children:[(0,k.jsx)("summary",{className:"bom-toolbar-btn sort-menu-summary","aria-label":"Sort materials",style:{fontSize:16},children:"\u21C5"}),(0,k.jsx)("div",{className:"sort-menu-panel",children:D_.map(S=>{let Q=p===S.dir;return(0,k.jsxs)("button",{type:"button",className:`sort-menu-item${Q?" is-active":""}`,onClick:()=>{g(Q?null:S.dir),Te.current?.removeAttribute("open")},children:[(0,k.jsx)("span",{className:"sort-menu-item__check",children:Q?"\u2713":""}),S.label]},S.dir)})})]})]})]})]}),z&&(0,k.jsxs)("div",{className:"results-review-page",children:[(0,k.jsxs)("div",{className:"results-review-page__top",children:[(0,k.jsxs)("button",{type:"button",className:"bom-toolbar-btn bom-toolbar-btn--accent",onClick:H,children:[(0,k.jsx)(Vr,{}),"Back to results"]}),(0,k.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,k.jsx)("div",{className:"results-review-searchbar",children:(0,k.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products in catalogue...",value:X,onChange:S=>K(S.target.value),"aria-label":`Search a product for ${z.requirement.label}`})}),z.chosen&&(0,k.jsx)("div",{className:"results-candidate-actions",children:(0,k.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>xt(z.requirement.key),children:"Clear selected product"})})]})]}),(0,k.jsxs)("div",{className:"results-review-page__hero",children:[(0,k.jsx)("div",{className:"results-review-page__image-wrap",children:(0,k.jsx)("img",{className:"fill-img results-review-page__image",src:Ga(z.chosen?.description||z.requirement.label,z.chosen?.product_id,z.chosen?.pdp_photo_url),alt:""})}),(0,k.jsxs)("div",{className:"results-review-page__summary",children:[(0,k.jsx)("h2",{children:z.requirement.label}),(0,k.jsxs)("p",{className:"results-review-page__meta",children:[wi(z.requirement.qty)," ",xa(z.requirement.unit,z.requirement.qty)]}),z.chosen?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("div",{className:"results-review-page__product",children:z.chosen.description}),(0,k.jsxs)("div",{className:"results-row-meta",children:[z.chosen.product_id,z.chosen.price!=null?` \xB7 ${lc(z.chosen.price,z.chosen.price_basis)}`:""]})]}):(0,k.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line."}),(0,k.jsx)("div",{className:"results-review-page__actions",children:(0,k.jsx)("button",{type:"button",className:`bom-toolbar-btn${i?.cart[De(z.requirement.key)]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>B(z),disabled:!z.chosen||!i,children:i?.cart[De(z.requirement.key)]?"\u2713 Added":"+ Add to basket"})})]})]}),ve.length===0?(0,k.jsx)("p",{className:"results-empty-hint",children:"No matching products."}):(0,k.jsxs)("table",{className:"score-breakdown-table",children:[(0,k.jsx)("thead",{children:(0,k.jsxs)("tr",{children:[(0,k.jsx)("th",{children:"Product"}),(0,k.jsx)("th",{children:"Dims (mm)"}),(0,k.jsx)("th",{children:"Price"}),(0,k.jsx)("th",{"aria-label":"Actions"})]})}),(0,k.jsx)("tbody",{children:ve.map(S=>{let Q=S.product_id===z.chosen?.product_id;return(0,k.jsxs)("tr",{className:Q?"score-breakdown-row--best":"",children:[(0,k.jsxs)("td",{children:[(0,k.jsx)("div",{children:S.description}),(0,k.jsx)("div",{className:"results-row-meta",children:S.product_id})]}),(0,k.jsx)("td",{children:(0,k.jsx)("span",{className:"unit-badge",children:O_(S.measurements_mm)})}),(0,k.jsx)("td",{children:S.price!=null?lc(S.price,S.price_basis):"-"}),(0,k.jsx)("td",{children:(0,k.jsxs)("label",{className:"switch-toggle",title:Q?"Currently selected":"Use this candidate",children:[(0,k.jsx)("input",{type:"checkbox",checked:Q,onChange:()=>{Q?xt(z.requirement.key):pt(z.requirement.key,S)},"aria-label":Q?`${S.description} selected`:`Use ${S.description}`}),(0,k.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},S.product_id)})})]})]}),!z&&d&&(0,k.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{padding:"32px 24px"},children:[(0,k.jsx)(ur,{}),(0,k.jsx)("p",{className:"banter-message is-visible",style:{fontSize:15,minHeight:0},children:"Matching your materials against the catalogue\u2026"})]}),!z&&w&&(0,k.jsx)("p",{className:"results-empty-hint estimator-products__error",children:w}),!z&&!d&&!w&&Ze.length===0&&f.length>0&&(0,k.jsx)("p",{className:"results-empty-hint",children:"No materials match the current search."}),!z&&!d&&!w&&U==="tile"&&Lt.length>0&&(0,k.jsx)("div",{className:"results-tile-grid",children:Lt.map(S=>{let{requirement:Q,chosen:J}=S,me=J?za(Qe(S),Rd):null,_e=i?!!i.cart[De(Q.key)]:!1;return(0,k.jsxs)("article",{className:"results-tile-card",children:[(0,k.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>x(S),"aria-label":`Review match for ${Q.label}`,children:[(0,k.jsx)("div",{className:"results-tile-card__media",children:(0,k.jsx)("img",{className:"fill-img results-tile-card__image",src:Ga(J?.description||Q.label,J?.product_id,J?.pdp_photo_url),alt:""})}),(0,k.jsxs)("div",{className:"results-tile-card__body",children:[J?(0,k.jsxs)("div",{className:"results-tile-card__heading",children:[(0,k.jsx)("div",{className:"results-tile-card__title",children:J.description}),(0,k.jsxs)("div",{className:"results-tile-card__match-meta",children:[(0,k.jsx)("span",{children:J.product_id}),J.price!=null?(0,k.jsx)("span",{children:lc(J.price,J.price_basis)}):null]})]}):(0,k.jsx)("div",{className:"results-empty-hint",children:"No product matched for this line."}),(0,k.jsxs)("div",{className:"results-tile-card__match",children:[(0,k.jsx)("div",{className:"results-tile-card__match-label",children:"\u21B3 calculated as"}),(0,k.jsx)("div",{className:"results-tile-card__match-name",children:Q.label}),(0,k.jsxs)("div",{className:"results-tile-card__meta",children:[wi(Q.qty)," ",xa(Q.unit,Q.qty)]}),me?.requiredSellUnits!=null?(0,k.jsxs)("div",{className:"results-tile-card__meta estimator-products__order",children:["Order ",me.requiredSellUnits," ",me.sellUnit,me.lineTotal!=null?` \xB7 ${at(me.lineTotal)}`:""]}):J?(0,k.jsx)("div",{className:"results-row-meta",children:"Quantity needs review"}):null]})]})]}),(0,k.jsxs)("div",{className:"results-tile-card__actions",children:[(0,k.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>x(S),children:"Review"}),(0,k.jsx)("button",{type:"button",className:`bom-toolbar-btn${_e?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>B(S),disabled:!J||!i,children:_e?"\u2713 Added":"+ Add"})]})]},Q.key)})}),!z&&!d&&!w&&U==="list"&&Lt.length>0&&(0,k.jsx)("div",{className:"bom-table-wrap",children:(0,k.jsxs)("table",{className:"bom-table results-table","aria-label":"Matched materials",children:[(0,k.jsxs)("colgroup",{children:[(0,k.jsx)("col",{style:{width:"56px"}}),(0,k.jsx)("col",{className:"col-item"}),(0,k.jsx)("col",{style:{width:"90px"}}),(0,k.jsx)("col",{style:{width:"80px"}}),(0,k.jsx)("col",{style:{width:"220px"}}),(0,k.jsx)("col",{style:{width:"110px"}})]}),(0,k.jsx)("thead",{children:(0,k.jsxs)("tr",{className:"bom-col-header",children:[(0,k.jsx)("th",{"aria-label":"Expand"}),(0,k.jsx)("th",{style:{textAlign:"left"},children:"Description"}),(0,k.jsx)("th",{style:{textAlign:"center"},children:"Qty"}),(0,k.jsx)("th",{style:{textAlign:"center"},children:"Unit"}),(0,k.jsx)("th",{style:{textAlign:"center"},children:"Product Matched"}),(0,k.jsx)("th",{style:{textAlign:"center"},children:"Basket"})]})}),(0,k.jsx)("tbody",{children:Lt.map(S=>{let{requirement:Q,chosen:J}=S,me=J?za(Qe(S),Rd):null,_e=i?!!i.cart[De(Q.key)]:!1,Ke=Ce.has(Q.key);return(0,k.jsxs)(Le.Fragment,{children:[(0,k.jsxs)("tr",{className:"bom-row",children:[(0,k.jsx)("td",{className:"bom-actions",style:{textAlign:"center",paddingLeft:0,paddingRight:0},children:(0,k.jsx)("button",{type:"button",className:"link-btn",onClick:()=>ne(Q.key),"aria-expanded":Ke,"aria-label":Ke?"Collapse product options":"Expand product options",children:Ke?"\u25BE":"\u25B8"})}),(0,k.jsxs)("td",{style:{paddingLeft:0},children:[(0,k.jsx)("div",{className:"bom-component-name",children:Q.label}),me?.requiredSellUnits!=null&&(0,k.jsxs)("div",{className:"results-row-meta",children:["Order ",me.requiredSellUnits," ",me.sellUnit,me.lineTotal!=null?` \xB7 ${at(me.lineTotal)}`:""]})]}),(0,k.jsx)("td",{className:"bom-qty col-order",style:{textAlign:"center"},children:wi(Q.qty)}),(0,k.jsx)("td",{style:{textAlign:"center"},children:xa(Q.unit,Q.qty)}),(0,k.jsx)("td",{style:{textAlign:"center"},children:J?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("div",{className:"bom-component-name",children:J.description}),(0,k.jsxs)("div",{className:"results-row-meta",children:[J.product_id,J.price!=null&&` \xB7 ${lc(J.price,J.price_basis)}`]})]}):(0,k.jsx)("span",{className:"results-empty-hint",children:"No match"})}),(0,k.jsx)("td",{style:{textAlign:"center"},children:(0,k.jsx)("button",{type:"button",className:`bom-toolbar-btn${_e?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>B(S),disabled:!J||!i,children:_e?"\u2713 Added":"+ Add"})})]}),Ke&&(0,k.jsx)("tr",{children:(0,k.jsx)("td",{colSpan:6,style:{paddingLeft:0,paddingRight:0},children:T===Q.key?te(S):(0,k.jsxs)("div",{className:"estimator-products__picker",children:[(0,k.jsxs)("div",{className:"estimator-products__options",children:[S.candidates.map(vt=>(0,k.jsxs)("button",{type:"button",className:`estimator-products__option${vt.product_id===J?.product_id?" is-selected":""}`,onClick:()=>pt(Q.key,vt),children:[(0,k.jsx)("span",{children:vt.description}),(0,k.jsxs)("span",{className:"results-row-meta",children:[vt.product_id,vt.price!=null&&` \xB7 ${at(vt.price)}`]})]},vt.product_id)),S.candidates.length===0&&(0,k.jsx)("p",{className:"results-empty-hint",children:"No candidates found."})]}),(0,k.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>qe(S),children:"Search the catalogue"})]})})})]},Q.key)})})]})}),!z&&!d&&!w&&G.length>0&&(0,k.jsxs)("section",{className:"results-tile-section results-tile-section--unmatched","aria-label":"Items requiring matching",children:[(0,k.jsxs)("div",{className:"results-tile-section__head",children:[(0,k.jsx)("h3",{children:"Require Matching"}),(0,k.jsx)("p",{children:"We couldn\u2019t confidently match these to a product. Open one to pick from the closest options."})]}),(0,k.jsx)("div",{className:"results-unmatched-list",children:G.map(S=>(0,k.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>x(S),children:[(0,k.jsxs)("span",{className:"results-unmatched-card__main",children:[(0,k.jsx)("span",{className:"results-unmatched-card__title",children:S.requirement.label}),(0,k.jsxs)("span",{className:"results-row-meta",children:[wi(S.requirement.qty)," ",xa(S.requirement.unit,S.requirement.qty)]})]}),(0,k.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},S.requirement.key))})]}),!d&&!w&&f.length>0&&(0,k.jsxs)("div",{className:"disclaimer-box",style:{alignItems:"center"},children:[(0,k.jsx)("span",{className:"disclaimer-icon",children:"\u26A0\uFE0F"}),(0,k.jsx)("p",{className:"disclaimer-text",children:"These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence."})]}),!z&&!d&&!w&&(r||C>0)&&(0,k.jsxs)("div",{className:"btn-row estimator-products__footer",children:[r&&(0,k.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:r,children:"Back"}),C>0&&i&&(0,k.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:r?"0 1 70%":1,marginTop:0},onClick:i.openBasket,children:[(0,k.jsxs)("span",{children:["View Basket (",C,")"]}),(0,k.jsx)("span",{className:"arrow",children:(0,k.jsx)(Bt,{})})]})]})]})}var Ot=Y(re());function Dd({toolId:e,toolTitle:t,requirements:a,onBack:r}){let[n,i]=(0,sc.useState)(0),o=(0,sc.useCallback)(l=>i(l),[]);return(0,Ot.jsx)(Ot.Fragment,{children:(0,Ot.jsxs)("div",{className:"truss-estimator",children:[(0,Ot.jsxs)("div",{className:"quick-order-hero",children:[(0,Ot.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Ot.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,Ot.jsx)("h1",{children:"Your Materials"}),n>0&&(0,Ot.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,Ot.jsx)("strong",{children:at(n)})," Est. total"]})]}),(0,Ot.jsxs)("p",{children:["Quantities from the ",t,", matched against your merchant\u2019s catalogue."]})]}),(0,Ot.jsx)("div",{className:"truss-estimator__card",style:{minHeight:0},children:(0,Ot.jsx)(Ud,{toolId:e,requirements:a,ready:!0,onBack:r,onTotalChange:o})})]})})}var L_=(e,t)=>{let a=t.key,r={"brick-block":{"brick-common":"5001444","brick-engineering-red":"5002008","brick-engineering-blue":"5001439",block:"5003187",mortar:"6003088"},skirting:{"skirting-chamfered":"4006057","skirting-ogee":"4006045","skirting-pencil-round":"4006048","skirting-torus":"4006042"},architrave:{"architrave-ogee":"4006060","architrave-ovolo":"4006063","architrave-pencil-round":"4006061","architrave-square-edge":"4006062","architrave-torus":"4006059"},plasterboard:{board:"2001035",screws:"2006040",tape:"2007043",adhesive:"2004023"},insulation:{"insulation-floor":"3002110","insulation-wall":"3002012","insulation-roof":"3004047","insulation-loft":"3003046"},timber:{studs:"4001168",joists:"4001201",battens:"4001053"},fencing:{"panels-boundary-0.9":"4001268","panels-boundary-1.2":"4001269","panels-boundary-1.5":"4001270","panels-boundary-1.8":"4001271","panels-skyline-0.9":"4001264","panels-skyline-1.2":"4001265","panels-skyline-1.5":"4001266","panels-skyline-1.8":"4001267","concrete-intermediate-6":"4001290","concrete-intermediate-8":"4001291","concrete-end-6":"4001294","concrete-end-8":"4001295","timber-post-6":"4001242","timber-post-8":"4001243",postcrete:"6003008",gate:"4001630","gravel-boards":"4001284"},decking:{"boards-meridian":"4001251","boards-summit":"4001360",joists:"4001201",screws:"1001103"},paving:{"surface-council":"7003121","surface-raj":"7003003","surface-brindle":"4001621","surface-charcoal":"4001622","surface-pea":"6001004","sub-base":"6001007",bedding:"6001012"}};return e==="plasterboard"?{standard:"2001035",moisture:"2002039",fire:"2002087",sound:"2002044"}[t.label.split(" ")[0].toLowerCase()]??r[e]?.[a]??null:r[e]?.[a]??null};function ww(e,t){if(e==="paint"||e==="concrete-aggregate")return null;let a=t.map(r=>{let n=L_(e,r);return n?{key:r.key,productId:n,qty:r.qty,unit:r.unit}:null});return a.every(Boolean)?a:null}var Bd=Y($e());var Kt=Y(re()),H_=1500;function yw(e){let{addManyToCart:t,clearCart:a,openBasket:r}=En(),[n,i]=(0,Bd.useState)(!1),[o,l]=(0,Bd.useState)(null);return{adding:n,basketError:o,addToBasket:async(u,f)=>{let b=Date.now();i(!0),l(null);try{let d=await Promise.all(u.filter(w=>w.qty>0).map(async w=>{let E=(await Jr(w.productId)).find(U=>U.product_id===w.productId);if(!E)throw new Error("A selected product is no longer available in this catalogue.");return Zr(E,{lineId:`${e}:${w.key}`,description:E.description,unit:w.unit??"each",qty:w.qty,calculatorWasteIncluded:f})})),h=H_-(Date.now()-b);h>0&&await new Promise(w=>window.setTimeout(w,h)),a(),t(d),r()}catch(d){l(d instanceof Error?d.message:"Could not add the products to your basket.")}finally{i(!1)}}}}function _w({toolTitle:e}){return(0,Kt.jsx)(Kt.Fragment,{children:(0,Kt.jsxs)("div",{className:"truss-estimator",children:[(0,Kt.jsxs)("div",{className:"quick-order-hero",children:[(0,Kt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Kt.jsx)("h1",{children:"Your Materials"}),(0,Kt.jsxs)("p",{children:["Calculating quantities from the ",e,"."]})]}),(0,Kt.jsx)("div",{className:"truss-estimator__card",children:(0,Kt.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{flex:1,justifyContent:"center"},children:[(0,Kt.jsx)(ur,{}),(0,Kt.jsx)("p",{className:"banter-message is-visible",children:"Preparing your materials\u2026"})]})})]})})}var Ue=Y(re());function pc(e){let[t,a]=(0,cc.useState)(!1);return(0,Ue.jsx)($s,{onOpenBasket:()=>a(!0),children:(0,Ue.jsx)(j_,{...e,showBasket:t,onShowBasket:a})})}function j_({fullPage:e=!1,hideHeader:t=!1,internal:a=!1,showBasket:r,onShowBasket:n}){let[i,o]=(0,cc.useState)(null),[l,c]=(0,cc.useState)(null),u=Ad.find(g=>g.id===i),{cart:f,updateCartQty:b,updateCartSellUnits:d,updateCartConversions:h,removeFromCart:w}=En(),{adding:E,basketError:U,addToBasket:m}=yw(u?.title??"calculator"),p=g=>{if(!u)return;let v=ww(u.id,g);v?m(v,g[0]?.calculatorWasteIncluded??!1):c(g)};return(0,Ue.jsx)("div",{className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}`,style:hi().theme,children:(0,Ue.jsx)("main",{className:"main-content",children:r?(0,Ue.jsx)(el,{cart:f,onUpdateQty:b,onUpdateSellUnits:d,onResolveConversions:h,onRemove:w,onBack:()=>n(!1),internal:a}):E&&u?(0,Ue.jsx)(_w,{toolTitle:u.title}):u?(0,Ue.jsxs)(Ue.Fragment,{children:[(0,Ue.jsx)("div",{hidden:l!==null,children:(0,Ue.jsx)(u.Component,{onBack:()=>o(null),onReview:p})}),U&&(0,Ue.jsx)("p",{className:"results-empty-hint estimator-products__error",children:U}),l!==null&&(0,Ue.jsx)(Dd,{toolId:u.id,toolTitle:u.title,requirements:l,onBack:()=>c(null)})]}):(0,Ue.jsx)(Ue.Fragment,{children:(0,Ue.jsxs)("div",{className:"quick-order-card",children:[(0,Ue.jsxs)("div",{className:"quick-order-hero",children:[(0,Ue.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,Ue.jsx)("h1",{children:"Estimating Tools"}),(0,Ue.jsx)("p",{children:"Trade-specific calculators for trusses, fencing, decking, masonry and painting. Dial in your specs and get an instant material estimate."})]}),(0,Ue.jsxs)("div",{className:"quick-order-alt",children:[(0,Ue.jsx)("div",{className:"quick-order-alt-title",children:"Choose a Calculator"}),(0,Ue.jsx)("div",{className:"estimator-tools-grid",children:Ad.map(g=>(0,Ue.jsxs)("button",{type:"button",className:"estimator-tool-card",onClick:()=>{o(g.id),c(null)},children:[(0,Ue.jsx)("span",{className:"estimator-tool-card__image-wrap",children:(0,Ue.jsx)("img",{className:"fill-img estimator-tool-card__image",src:Zt(g.imageUrl),alt:""})}),(0,Ue.jsxs)("span",{className:"estimator-tool-card__content",children:[(0,Ue.jsx)("span",{className:"estimator-tool-card__title",children:g.title}),(0,Ue.jsx)("span",{className:"estimator-tool-card__desc",children:g.desc})]})]},g.id))})]})]})})})})}var uc=Y(re());function Od({config:e,children:t}){return Gb(e),(0,uc.jsx)(uc.Fragment,{children:t})}var Ld=Y(re()),G_="https://api.metronlabs.ai",Q_=["client","api-key","api-url","theme","hide-header"];function kw(e,t){var a;customElements.get(e)||customElements.define(e,(a=class extends HTMLElement{constructor(){super();this.root=null;this.attachShadow({mode:"open"})}connectedCallback(){if(this.dataset.version="0.1.14",!this.root){let n=document.createElement("div"),i=document.createElement("style");i.textContent=`:host { display: block; }
6740
+ `)}function Zr(e,t){return{lineId:t.lineId,description:e?.description||t.description||"(no description)",requestedDescription:t.description,productId:e?.product_id??"-",price:e?.price??null,priceBasis:e?.price_basis??null,unit:t.unit,uoi:e?.uoi??t.unit,uoiCount:e?.uoi_count??null,saleUnit:e?.conversion?.sale_unit??null,saleUnitQuantity:e?.conversion?.sale_unit_quantity??null,unitConversions:e?.conversion?.unit_conversions?.map(a=>({requestUom:a.request_uom,quantityPerSaleUnit:a.quantity_per_sale_unit,evidence:a.evidence,confidence:a.confidence})),pdpPhotoUrl:e?.pdp_photo_url??null,measurementsMm:e?.measurements_mm??[],conversionType:e?.conversion?.conversion_type??null,requestUomsSupported:e?.conversion?.request_uoms_supported??null,salesUomNormalised:e?.conversion?.sales_uom_normalised??null,salesUnitSize:e?.conversion?.sales_unit_size??null,salesUnitSizeUom:e?.conversion?.sales_unit_size_uom??null,coverageQty:e?.conversion?.coverage_qty??null,coverageUom:e?.conversion?.coverage_uom??null,itemsPerPallet:e?.conversion?.items_per_pallet??null,itemsPerPack:e?.conversion?.items_per_pack??null,itemsPerBox:e?.conversion?.items_per_box??null,itemsPerM2:e?.conversion?.items_per_m2??null,wasteFactorDefault:e?.conversion?.waste_factor_default??null,roundingRule:e?.conversion?.rounding_rule??null,derivedCoverageM2:e?.conversion?.derived_coverage_m2??null,derivedLengthM:e?.conversion?.derived_length_m??null,quoteQtyFormulaType:e?.conversion?.quote_qty_formula_type??null,conversionConfidence:e?.conversion?.conversion_confidence??null,conversionNotes:e?.conversion?.conversion_notes??null,calculatorWasteIncluded:t.calculatorWasteIncluded,qty:t.qty}}var Xv=e=>(e??"").trim().toLowerCase(),L1={sqm:"m2","sq m":"m2","m\xB2":"m2",cbm:"m3","cu m":"m3",lm:"m","lin m":"m",metre:"m",meter:"m",each:"each",ea:"each",nr:"each",no:"each",item:"each",unit:"each",units:"each",pc:"each",pcs:"each",board:"sheet",bags:"bag",length:"length",lengths:"length",pallet:"pallet",pallets:"pallet"},H1=new Set(["sheet","length","box","bag","pack","roll","set","tub","each"]),jv=new Set(["box","bag","pack","pallet","roll","set","tub"]),Gv=(e,t)=>t==="ml"?e:["l","litre","litres"].includes(t)?e*1e3:null,Qv=(e,t)=>t==="g"?e:["kg","kilogram","kilograms"].includes(t)?e*1e3:["t","tonne","tonnes"].includes(t)?e*1e6:null,yi=e=>{let t=Xv(e);return L1[t]??t},at=(e,t)=>{let a=yi(e),r=yi(t);return a.length>0&&a===r},j1=(e,t)=>{let a=Xv(t);return a?a.includes("round_up_1000")?Math.ceil(e):a.includes("allow_decimal")?Math.round(e*1e3)/1e3:a.includes("round_up")?Math.ceil(e):e:e},G1=e=>(e??"").split(",").map(t=>yi(t)).filter(Boolean),Q1=(e,t)=>{let a=G1(e.requestUomsSupported);return!!(a.length===0||a.includes(t)||at(t,"pallet")&&e.itemsPerPallet!=null&&e.itemsPerPallet>0||at(t,"pack")&&e.itemsPerPack!=null&&e.itemsPerPack>0||at(t,"box")&&e.itemsPerBox!=null&&e.itemsPerBox>0)},Yv=(e,t)=>at(t,"pallet")?e.itemsPerPallet??null:at(t,"pack")?e.itemsPerPack??null:at(t,"box")?e.itemsPerBox??null:null,Y1=(e,t,a)=>{if(!at(t,"m2"))return null;let r=e.description.match(/(\d+(?:[.,]\d+)?)\s*(m2|m²|sqm|sq\.?\s*m)\s*(?:\/|per)\s*([a-z]+)/i);if(!r||!at(r[3],a))return null;let n=Number.parseFloat(r[1].replace(",","."));return Number.isFinite(n)&&n>0?n:null};function za(e,t){let a=e.qty,r=yi(e.unit)||"-",n=yi(e.saleUnit??e.salesUnitSizeUom??e.uoi??e.salesUomNormalised)||"-",i=e.saleUnitQuantity??e.salesUnitSize??e.uoiCount??1,o=t?.wasteFactorEnabled===!1?0:t?.wasteFactorOverride??e.wasteFactorOverride??e.wasteFactorDefault??0,l=e.sellUnitsOverride!=null&&Number.isFinite(e.sellUnitsOverride)&&e.sellUnitsOverride>0,c=l?e.sellUnitsOverride??null:null,p=b=>({requestedAmount:a,requestedUnit:r,salesUnitSize:e.salesUnitSize??e.uoiCount??null,sellUnit:n,calculatedSellUnits:null,requiredSellUnits:c,unitPrice:e.price,lineTotal:e.price!=null&&c!=null?e.price*c:null,calculation:c!=null?`${b} Manually set to ${c} ${n}.`:b,costingMode:"review"});if(!Q1(e,r))return p("Requested unit is not supported by this catalogue conversion.");let f=null,v="review",m=e.roundingRule,h=`Quantity review required, initial request needed ${a} ${r}.`,w=1+o,E=Y1(e,r,n),U=e.unitConversions?.find(b=>at(b.requestUom,r));if(!!e.saleUnit&&(at(r,n)||!!U||at(r,"each")&&!jv.has(n)))if(at(r,n))f=a*w/i,v="direct",h=`${a} ${r}${o>0?` x ${w}`:""}`;else if(U){f=a*w/U.quantityPerSaleUnit,v="derived";let b=1/U.quantityPerSaleUnit,S=Math.round(b);h=at(n,"each")&&U.quantityPerSaleUnit<1&&Math.abs(b-S)<1e-9?`${a} ${r}${o>0?` x ${w}`:""} x ${S} per ${r}`:`${a} ${r}${o>0?` x ${w}`:""} / ${U.quantityPerSaleUnit} ${r} per ${n}`}else at(r,"each")&&!jv.has(n)&&(f=a*w/i,v="derived",h=`${a} ${n}${o>0?` x ${w}`:""}`);else if(at(r,n)&&i>0)f=a*w/i,v="direct",h=o>0?`${a} ${r} x ${w} / ${i} ${n} per sell unit`:`${a} ${r} / ${i} ${n} per sell unit`;else if(at(r,"each")&&i>0&&H1.has(n))f=a*w/i,v="derived",h=o>0?`${a} each x ${w} / ${i} each per ${n}`:`${a} each / ${i} each per ${n}`;else if(Yv(e,r)!=null&&i>0){let b=Yv(e,r)??0;f=a*b*w/i,v="derived";let S=`${a} ${r} x ${b} each${o>0?` x ${w}`:""}`;h=i===1&&at(n,"each")?S:`${S} / ${i} each per ${n}`}else if(E!=null)f=a*w/E,v="derived",m??(m="round_up_each"),h=`${a} m2 x ${w} / ${E} m2 per ${n} (from product description)`;else if(e.conversionType==="basket_line_unit"){let b=e.coverageQty??null;b!=null&&b>0&&at(r,e.coverageUom)&&(f=a*w/b,v="derived",h=`${a} ${r} x ${w} / ${b} ${e.coverageUom} per ${n}`)}else{if(e.conversionType==="count_only")return p(`Quantity review required, initial request needed ${a} ${r}.`);if(["area_from_dims","explicit_coverage_area","roll_area"].includes(e.conversionType??"")){let b=e.coverageQty??e.derivedCoverageM2??null;at(r,"m2")&&b!=null&&b>0&&(f=a*w/b,v="derived",h=`${a} m2 x ${w} / ${b} m2 per ${n}`)}else if(e.conversionType==="count_per_area"){let b=e.coverageQty??null;at(r,"m2")&&b!=null&&b>0?(f=a/b,v="derived",h=`${a} m2 / ${b} m2 per sell unit`):at(r,"m2")&&e.itemsPerM2!=null&&e.itemsPerM2>0&&i>0&&(f=a*e.itemsPerM2*w/i,v="derived",h=`${a} m2 x ${e.itemsPerM2} ${n}/m2 x ${w} / ${i}`)}else if(e.conversionType==="length_from_dims"){let b=e.coverageQty??e.derivedLengthM??null;at(r,"m")&&b!=null&&b>0&&(f=a*w/b,v="derived",h=`${a} m x ${w} / ${b} m per ${n}`)}else if(e.conversionType==="volume_from_description"){let b=Gv(a,r),S=Gv(e.coverageQty??0,yi(e.coverageUom));b!=null&&S!=null&&S>0&&(f=b*w/S,v="derived",h=`${a} ${r} x ${w} / ${e.coverageQty} ${e.coverageUom} per ${n}`)}else if(e.conversionType==="weight_from_description"){let b=Qv(a,r),S=Qv(e.coverageQty??0,yi(e.coverageUom));b!=null&&S!=null&&S>0&&(f=b*w/S,v="derived",h=`${a} ${r} x ${w} / ${e.coverageQty} ${e.coverageUom} per ${n}`)}else if(e.conversionType==="same_unit_volume"){let b=e.coverageQty??null;at(r,"m3")&&b!=null&&b>0&&(f=a/b,v="derived",h=`${a} m3 / ${b} m3 per ${n}`)}}if(f==null||!Number.isFinite(f)||f<0)return p(`Quantity review required, initial request needed ${a} ${r}.`);let u=j1(f,m),g=l?e.sellUnitsOverride??null:u;return{requestedAmount:a,requestedUnit:r,salesUnitSize:i,sellUnit:n,calculatedSellUnits:u,requiredSellUnits:g,unitPrice:e.price,lineTotal:e.price!=null&&g!=null?e.price*g:null,calculation:l?`${h} = ${u} ${n} (manually set to ${g})`:`${h} = ${g} ${n}`,costingMode:v}}var $v=()=>import("./xlsx-K4MOA2QM.js"),Po=["Source Line ID","Split Line ID","Description","Section","Qty","Unit","Procurement intent","Procurement aliases","Build-up type","Layer count","Total thickness (mm)","Installation clues","System clues","Component requirements","Technical classification","Include in quote","Approval required","Approval type","Missing information","Adjudicator confidence","Decision reason","Selected candidate ID","Selected candidate description","Price basis","Price","Line total","Confidence","Status"],X1=Po.indexOf("Line total");function $1(e){return e.unmatchable?"Not matched (labour/plant/referential)":e.decision?.include_in_quote===!0&&e.decision.approval_required===!0?"Approval required":e.decision?.include_in_quote===!0?"Quoted":e.decision?.technical_classification==="no_suitable_candidate"?"No suitable candidate":(e.best,"No match")}async function Vv(e){let t=await $v(),a=t.utils.book_new(),r=new Date().toISOString().slice(0,10),n=[Po],i=0;for(let c of e){let{item:p,best:f,qty:v,band:m,unmatchable:h,decision:w}=c,E=[p.section,p.subsection,p.subheading].filter(Boolean).join(" / "),U=!h&&f?.price!=null?f.price*v:null;U!=null&&(i+=U),n.push([p.source_line_id,p.line_id,p.description_original||"(no description)",E,v,p.unit,p.procurement_intent||"-",p.procurement_aliases.join(", "),p.build_up_type,p.layer_count,p.total_required_thickness_mm,p.installation_clues.join(", "),p.system_clues.join(", "),p.component_requirements.join(", "),w?.technical_classification??"",w?.include_in_quote==null?"":w.include_in_quote?"yes":"no",w?.approval_required==null?"":w.approval_required?"yes":"no",w?.approval_type??"",w?.missing_information.join(", ")??"",w?.confidence??"",w?.reason??"",h?"-":f?.product_id??w?.selected_candidate_id??"-",h?"-":f?.description??"-",h?"-":f?.price_basis??"-",h?null:f?.price??null,U,h?"-":m,$1(c)])}n.push(Array(Po.length).fill(null));let o=Array(Po.length).fill(null);o[0]="Estimated total",o[X1]=i,n.push(o),n.push(["DISCLAIMER: These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence.",...Array(Po.length-1).fill(null)]);let l=t.utils.aoa_to_sheet(n);l["!cols"]=[{wch:12},{wch:12},{wch:44},{wch:24},{wch:8},{wch:8},{wch:28},{wch:28},{wch:16},{wch:10},{wch:12},{wch:24},{wch:24},{wch:24},{wch:22},{wch:14},{wch:14},{wch:18},{wch:24},{wch:16},{wch:48},{wch:16},{wch:40},{wch:10},{wch:10},{wch:12},{wch:11},{wch:26}],t.utils.book_append_sheet(a,l,"Schedule match"),t.writeFile(a,`schedule-quote-${r}.xlsx`)}var Jo=["Product ID","Description","Costing mode","Required amount","Req unit","Sell unit size","Sell unit","Required sell units","Unit price","Line total"];async function Zv(e,t){let a=await $v(),r=a.utils.book_new(),n=new Date().toISOString().slice(0,10),i=t?[["Account",t.name+" ("+t.id+")"],[],Jo]:[Jo],o=0;for(let p of e){let f=za(p),v=f.lineTotal;v!=null&&(o+=v),i.push([p.productId,p.description,f.costingMode,f.requestedAmount,xa(f.requestedUnit),f.salesUnitSize,xa(f.sellUnit),f.requiredSellUnits,f.unitPrice,v])}i.push(Array(Jo.length).fill(null));let l=Array(Jo.length).fill(null);l[0]="Estimated total",l[Jo.length-1]=o,i.push(l);let c=a.utils.aoa_to_sheet(i);c["!cols"]=[{wch:14},{wch:48},{wch:12},{wch:14},{wch:10},{wch:14},{wch:10},{wch:16},{wch:12},{wch:14}],a.utils.book_append_sheet(r,c,"Basket"),a.writeFile(r,t?`basket-${t.id}-${n}.xlsx`:`basket-${n}.xlsx`)}var s=Y(ie()),ud="__none__",Fo=24,V1=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}];function Fv(e){return e==null?"low":e>=.7?"high":e>=.5?"medium":"low"}var Z1=e=>e.attrs.supply_nature==="labour_only"||e.attrs.supply_nature==="plant"||e.flags.includes("referential");function K1(e,t){if(t!==ud){if(t)return e?.candidates.find(a=>a.product_id===t);if(e?.decision?.selected_candidate_id!=null)return e.candidates.find(a=>a.product_id===e.decision.selected_candidate_id);if(e?.decision?.technical_classification!=="no_suitable_candidate")return e?.candidates?.[0]}}function Kv(e){return{product_id:e.productId,description:e.description,source_list:null,price:e.price,price_basis:e.priceBasis,uoi_count:e.uoiCount??null,uoi:e.uoi,pdp_photo_url:e.pdpPhotoUrl??null,measurements_mm:e.measurementsMm??[],conversion:{sale_unit:e.saleUnit,sale_unit_quantity:e.saleUnitQuantity,unit_conversions:e.unitConversions?.map(t=>({request_uom:t.requestUom,quantity_per_sale_unit:t.quantityPerSaleUnit,evidence:t.evidence,confidence:t.confidence})),sales_uom_normalised:e.salesUomNormalised,conversion_type:e.conversionType,request_uoms_supported:e.requestUomsSupported,sales_unit_size:e.salesUnitSize,sales_unit_size_uom:e.salesUnitSizeUom,coverage_qty:e.coverageQty,coverage_uom:e.coverageUom,items_per_pallet:e.itemsPerPallet,items_per_pack:e.itemsPerPack,items_per_box:e.itemsPerBox,items_per_m2:e.itemsPerM2,waste_factor_default:e.wasteFactorDefault,rounding_rule:e.roundingRule,derived_coverage_m2:e.derivedCoverageM2,derived_length_m:e.derivedLengthM,quote_qty_formula_type:e.quoteQtyFormulaType,conversion_confidence:e.conversionConfidence,conversion_notes:e.conversionNotes},scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"manual_cart_selection"}}function J1(e){return e?e.replace(/_/g," "):"not stated"}function P1({band:e}){return(0,s.jsx)("span",{className:`status-dot status-dot--${e}`,title:e,children:(0,s.jsx)("span",{className:"status-dot__mark"})})}function Cn(e,t){if(e==null)return"-";let a=Ko(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function pd(e){return e&&e.length>0?e.join(" x "):"-"}function F1(e){return e==null?"-":Number.isInteger(e/1e3)?`${e/1e3}m`:`${(e/1e3).toFixed(1)}m`}function Sn(e){let t=(e??[]).map(a=>a.trim()).filter(Boolean);return t.length>0?t.join(", "):"-"}function Kr(e,t){return e.customer_display_label?.trim()||e.description_original||"(no description)"}var Jv=[{background:"#fff7ed",borderColor:"#fdba74",color:"#9a3412"},{background:"#eff6ff",borderColor:"#93c5fd",color:"#1d4ed8"},{background:"#ecfeff",borderColor:"#67e8f9",color:"#0f766e"},{background:"#f0fdf4",borderColor:"#86efac",color:"#166534"},{background:"#fdf4ff",borderColor:"#f0abfc",color:"#a21caf"}];function I1(e){let t=new Map;return[...new Set(e.filter(dr).map(r=>r.linked_group_id))].forEach((r,n)=>{let i=n%26;t.set(r,{token:String.fromCharCode(65+i),bubbleStyle:Jv[n%Jv.length]})}),t}function dr(e){return!1}function qn(e){if(!e.linked_group_id)return null;let t=e.linked_group_label||"Linked group",a=e.linked_group_role==="anchor"?"anchor":e.linked_group_role==="dependent"?"dependent":"member",r=e.linked_group_shared_width_mm!=null?`, ${e.linked_group_shared_width_mm}mm family`:"";return`${t} (${a}${r})`}function cd({meta:e}){return e?(0,s.jsx)("span",{className:"results-linked-pill",style:e.bubbleStyle,children:`Link ${e.token}`}):null}function W1(e,t,a){let r=t?.rerank?.recommendedCandidateIds??[];if(r.length===0){let o=e.slice(0,5),l=o.some(c=>c.product_id===a)?void 0:e.find(c=>c.product_id===a);return l?[...o,l]:o}let n=new Map(e.map(o=>[o.product_id,o])),i=r.map(o=>n.get(o)).filter(o=>o!=null);if(a&&!i.some(o=>o.product_id===a)){let o=n.get(a);o&&i.unshift(o)}return[...new Map(i.map(o=>[o.product_id,o])).values()].slice(0,5)}function Ys(e){let t=e?.rerank?.recommendedCandidateIds??[];if(t.length===0||!e)return[];let a=new Map(e.candidates.map(r=>[r.product_id,r]));return t.map(r=>a.get(r)).filter(r=>r!=null)}function Xs(e){if(e>=6e4){let t=Math.floor(e/6e4),a=Math.round(e%6e4/1e3);return a===60?`${t+1}m`:`${t}m ${a}s`}return e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}s`:`${e}ms`}function e_({processStages:e,llmCalls:t,totalDurationMs:a,llmDurationMs:r,llmCallCount:n}){let i=[...t].sort((l,c)=>c.durationMs-l.durationMs).slice(0,12),o=Math.max(0,t.length-i.length);return(0,s.jsxs)("div",{className:"results-detail-block",style:{marginBottom:18},children:[(0,s.jsx)("h3",{style:{margin:"0 0 12px"},children:"Pipeline timings"}),(0,s.jsxs)("div",{className:"results-summary",style:{marginBottom:12},children:[(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:Xs(a)})," total"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:n})," LLM calls"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:Xs(r)})," LLM time"]})]}),(0,s.jsxs)("table",{className:"score-breakdown-table",style:{marginBottom:14},children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Process stage"}),(0,s.jsx)("th",{children:"Duration"})]})}),(0,s.jsx)("tbody",{children:e.map((l,c)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:l.label}),(0,s.jsx)("td",{children:Xs(l.durationMs)})]},`${l.key}-${c}`))})]}),t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h4",{style:{margin:"0 0 10px"},children:"LLM calls"}),(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Call"}),(0,s.jsx)("th",{children:"Duration"})]})}),(0,s.jsx)("tbody",{children:i.map((l,c)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:l.label}),(0,s.jsx)("td",{children:Xs(l.durationMs)})]},`${l.key}-${c}`))})]}),o>0&&(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Showing slowest ",i.length," of ",t.length," LLM calls."]})]})]})}function t_({queries:e}){return e.length===0?null:(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Retrieval by procurement query"}),e.map((t,a)=>(0,s.jsxs)("div",{style:{marginBottom:16},children:[(0,s.jsxs)("div",{className:"results-row-meta",style:{marginBottom:6},children:["Query: ",(0,s.jsx)("strong",{children:t.query})]}),t.candidates.length===0?(0,s.jsx)("p",{className:"results-empty-hint",children:"No candidates returned for this query."}):(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Product"}),(0,s.jsx)("th",{children:"Dims (mm)"}),(0,s.jsx)("th",{children:"Unit"}),(0,s.jsx)("th",{children:"bm25"})]})}),(0,s.jsx)("tbody",{children:t.candidates.slice(0,5).map((r,n)=>(0,s.jsxs)("tr",{children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{children:r.description}),(0,s.jsx)("div",{className:"results-row-meta",children:r.product_id})]}),(0,s.jsx)("td",{children:pd(r.measurements_mm)}),(0,s.jsx)("td",{children:Ko(r.price_basis)||"-"}),(0,s.jsx)("td",{children:r.bm25.toFixed(2)})]},`${r.product_id}-${n}`))})]})]},`${t.query}-${a}`))]})}function Pv({item:e,result:t}){let a=t?.retrieval_debug.map(n=>n.query).filter(Boolean)??[],r=[["Procurement intent",e.procurement_intent||"-"],["Procurement aliases",Sn(e.procurement_aliases)],["Retrieval queries",Sn(a)],["Category",e.attrs.category||"-"],["Fine category",e.attrs.category_fine||"-"],["Brand",e.attrs.brand||"-"],["Material",e.attrs.material||"-"],["Grade / standard",e.attrs.grade_standard||"-"],["Treatment",e.attrs.treatment||"-"],["Supply nature",e.attrs.supply_nature||"-"],["Measurements (mm)",pd(e.attrs.measurements_mm)],["Stock length",F1(e.attrs.stock_length_mm)],["Matching mode",e.matching_mode||"-"],["Build-up type",e.build_up_type||"-"],["Layer count",e.layer_count!=null?String(e.layer_count):"-"],["Required thickness (mm)",e.total_required_thickness_mm!=null?String(e.total_required_thickness_mm):"-"],["Allowed layer thicknesses (mm)",e.acceptable_layer_thicknesses_mm.length>0?e.acceptable_layer_thicknesses_mm.join(", "):"-"],["Installation clues",Sn(e.installation_clues)],["System clues",Sn(e.system_clues)],["Component requirements",Sn(e.component_requirements)],["Linked group",qn(e)||"-"],["Flags",Sn(e.flags)]];return(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Search context"}),(0,s.jsx)("dl",{className:"results-detail-grid",children:r.map(([n,i])=>(0,s.jsxs)(ve.Fragment,{children:[(0,s.jsx)("dt",{children:n}),(0,s.jsx)("dd",{children:i})]},n))})]})}function a_({item:e}){let t=e.decomposition_debug;return t?(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Decomposition"}),(0,s.jsxs)("dl",{className:"results-detail-grid",children:[(0,s.jsxs)(ve.Fragment,{children:[(0,s.jsx)("dt",{children:"Attempted"}),(0,s.jsx)("dd",{children:t.attempted?"yes":"no"})]}),(0,s.jsxs)(ve.Fragment,{children:[(0,s.jsx)("dt",{children:"Applied"}),(0,s.jsx)("dd",{children:t.applied?"yes":"no"})]}),(0,s.jsxs)(ve.Fragment,{children:[(0,s.jsx)("dt",{children:"Returned items"}),(0,s.jsx)("dd",{children:t.returned_item_count??"-"})]}),(0,s.jsxs)(ve.Fragment,{children:[(0,s.jsx)("dt",{children:"Reason"}),(0,s.jsx)("dd",{children:t.reason||"-"})]}),(0,s.jsxs)(ve.Fragment,{children:[(0,s.jsx)("dt",{children:"Returned intents"}),(0,s.jsx)("dd",{children:t.items.length>0?t.items.map(a=>`${a.intent}${a.inherits_quantity?" (inherits qty)":""}`).join(", "):"-"})]})]})]}):null}function r_({result:e}){let t=e?.adjudication_debug;if(!t)return null;let a=[["Dependent rerank applied",t.dependent_rerank_applied?"yes":"no"],["Linked parent selected product",t.linked_parent_selected_candidate_description||t.linked_parent_selected_candidate_id||"-"],["Dimension reason overridden",t.dimension_reason_overridden?"yes":"no"]];return(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsx)("h4",{style:{margin:"0 0 12px"},children:"Adjudication context"}),(0,s.jsx)("dl",{className:"results-detail-grid",children:a.map(([r,n])=>(0,s.jsxs)(ve.Fragment,{children:[(0,s.jsx)("dt",{children:r}),(0,s.jsx)("dd",{children:n})]},r))}),t.rerank_line_item_input?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h5",{style:{margin:"12px 0 8px"},children:"Rerank input"}),(0,s.jsx)("pre",{className:"results-pre",children:JSON.stringify(t.rerank_line_item_input,null,2)})]}):null]})}function i_({item:e,decision:t,result:a,showRetrievalDebug:r,reviewOnly:n=!1,linkedGroupMeta:i}){if(!t)return null;let o=t.technical_classification==="no_suitable_candidate"?"Exact match not found:":`AI review (${t.confidence??"confidence not stated"}):`;return n?t.reason?(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,s.jsx)("strong",{children:o}),"\xA0",t.reason]}),dr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",i?`Link ${i.token} - `:"",qn(e)]}):null]}):null:!t.reason&&!r?(0,s.jsx)(Pv,{item:e,result:a}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Pv,{item:e,result:a}),r&&(0,s.jsx)(a_,{item:e}),r&&(0,s.jsx)(r_,{result:a}),t.reason&&(0,s.jsxs)("div",{className:"results-detail-block",children:[(0,s.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,s.jsx)("strong",{children:o}),"\xA0",t.reason]}),dr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",i?`Link ${i.token} - `:"",qn(e)]}):null]}),r&&(0,s.jsx)(t_,{queries:a?.retrieval_debug??[]})]})}function n_({item:e,candidates:t,result:a,decision:r,unmatchable:n,selectedProductId:i,detailMode:o,onPick:l,onClear:c,showAll:p=!1,internal:f=!1,debugEnabled:v=!1,forceReviewNote:m=!1,linkedGroupMeta:h}){let w=f||o==="detailed",E=v&&o==="detailed",U=w||m?(0,s.jsx)(i_,{item:e,decision:r,result:a,showRetrievalDebug:E,reviewOnly:m&&!w,linkedGroupMeta:h}):null;if(n)return(0,s.jsxs)(s.Fragment,{children:[U,(0,s.jsx)("p",{className:"results-empty-hint",children:"Classified as labour/plant or referencing another line item - skipped by design."})]});if(t.length===0)return(0,s.jsxs)(s.Fragment,{children:[U,(0,s.jsx)("p",{className:"results-empty-hint",children:"No candidates were returned for this line item."})]});let d=p||f||o==="detailed"?t:W1(t,a,i);return(0,s.jsxs)(s.Fragment,{children:[U,(0,s.jsxs)("table",{className:"score-breakdown-table",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Product"}),(0,s.jsx)("th",{children:"Dims (mm)"}),(0,s.jsx)("th",{children:"Price"}),E&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("th",{children:"dimension"}),(0,s.jsx)("th",{children:"grade"}),(0,s.jsx)("th",{children:"brand"}),(0,s.jsx)("th",{children:"fuzzy"}),(0,s.jsx)("th",{children:"bm25"}),(0,s.jsx)("th",{children:"overall"})]}),(0,s.jsx)("th",{"aria-label":"Actions"})]})}),(0,s.jsx)("tbody",{children:d.map((u,g)=>{let b=u.product_id===i;return(0,s.jsxs)("tr",{className:b?"score-breakdown-row--best":"",children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{children:u.description}),(0,s.jsx)("div",{className:"results-row-meta",children:u.product_id})]}),(0,s.jsx)("td",{children:(0,s.jsx)("span",{className:"unit-badge",children:pd(u.measurements_mm??u.debug?.candidate.measurements_mm)})}),(0,s.jsx)("td",{children:Cn(u.price,u.price_basis)}),E&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("td",{children:(u.scores?.dimension??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.grade??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.brand??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.fuzzy??0).toFixed(2)}),(0,s.jsx)("td",{children:(u.scores?.bm25??0).toFixed(2)}),(0,s.jsx)("td",{children:(0,s.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,s.jsx)(P1,{band:Fv(u.scores?.overall)}),(0,s.jsx)("span",{className:"results-overall-cell",children:(u.scores?.overall??0).toFixed(2)})]})})]}),(0,s.jsx)("td",{children:(0,s.jsxs)("label",{className:"switch-toggle",title:b?"Currently selected":"Use this candidate",children:[(0,s.jsx)("input",{type:"checkbox",checked:b,onChange:()=>{b?c?.():l(u)},"aria-label":b?`${u.description} selected`:`Use ${u.description}`}),(0,s.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},`${u.product_id}-${g}`)})})]})]})}function dd({scheduleResult:e,onStartOver:t,cart:a,onAddToCart:r,onRemoveFromCart:n,onGoToBasket:i,cartSeeded:o,onCartSeeded:l,reviewGateComplete:c,onReviewGateComplete:p,internal:f=!1}){let v=!f&&Ls()==="QZA6-MRA4",m=v?"quote":"basket",{results:h,lineItems:w,parseReport:E,timings:U}=e,[d,u]=(0,ve.useState)({}),[g,b]=(0,ve.useState)({}),[S,T]=(0,ve.useState)({}),[M,R]=(0,ve.useState)(""),[G,W]=(0,ve.useState)(null),[we,Ce]=(0,ve.useState)(1),[Ge,Ve]=(0,ve.useState)(!1);(0,ve.useEffect)(()=>{Ve(new URLSearchParams(window.location.search).get("debug")==="1")},[]);let[Te,$]=(0,ve.useState)("simple"),[K,Z]=(0,ve.useState)(f?"list":"tile"),[de,Ue]=(0,ve.useState)(!1),[pe,qe]=(0,ve.useState)(null),[De,gt]=(0,ve.useState)(""),[yt,_t]=(0,ve.useState)([]),[Ie,Jt]=(0,ve.useState)(!1),[j,J]=(0,ve.useState)(null),[k,A]=(0,ve.useState)(!1),[te,se]=(0,ve.useState)(null),ye=(0,ve.useRef)(null),[st,xt]=(0,ve.useState)(new Set),[x,H]=(0,ve.useState)(new Set),[B,oe]=(0,ve.useState)(!1);(0,ve.useEffect)(()=>{Ce(1)},[M,G,K]);let ae=new Map(h.map(_=>[_.line_id,_])),C=I1(w),Q=w.map(_=>{let O=ae.get(_.line_id),Ee=O?.decision,zt=Z1(_),Ye=d[_.line_id],Ft=K1(O,Ye),Mi=a[_.line_id],zw=Ye===ud?void 0:g[_.line_id]??(Mi&&Mi.productId!==Ft?.product_id?Kv(Mi):Ft),Kd=zt?void 0:zw,Aw=_.qty??0;return{item:_,result:O,decision:Ee,unmatchable:zt,best:Kd,qty:Aw,band:Fv(Kd?.scores?.overall)}}),P=0,fe=0;for(let _ of Q)_.unmatchable||_.decision?.include_in_quote!==!0||!_.best||(_.best.price!=null?P+=_.best.price*_.qty:fe+=1);let _e=_=>!_.unmatchable&&!_.best&&_.decision?.technical_classification!=="no_suitable_candidate"&&Ys(_.result).length>0,Ze=_=>_.best??Ys(_.result)[0],ca=Q.filter(_=>!_.unmatchable&&!_.best).filter(_=>!x.has(_.item.line_id)),il=Q.filter(_=>x.has(_.item.line_id)),ua=Q;if(M.trim()){let _=M.trim().toLowerCase();ua=ua.filter(O=>O.item.description_original?.toLowerCase().includes(_)||Ze(O)?.description?.toLowerCase().includes(_))}if(G){let _=G==="asc"?1:-1;ua=[...ua].sort((O,Ee)=>_*(O.item.description_original||"").localeCompare(Ee.item.description_original||""))}let On=Math.max(1,Math.ceil(ua.length/Fo)),Pt=Math.min(we,On),gr=ua.slice((Pt-1)*Fo,Pt*Fo),Xa=gr.filter(_=>!_.unmatchable&&_.best),Hd=gr.filter(_=>_e(_)),Ln=gr.filter(_=>!_.unmatchable&&(_.best||_e(_))),jd=gr.filter(_=>_.unmatchable||!_.best&&!_e(_)),F=pe?Q.find(_=>_.item.line_id===pe)??null:null,Nw=!f&&!c&&!F&&ca.length>0,Hn=(0,ve.useRef)(null),jn=()=>{let _=ye.current;if(!_)return;let{top:O,left:Ee,width:zt,height:Ye}=_.getBoundingClientRect(),Mi=_.querySelector(".bom-toolbar-btn")?.closest("td")?.getBoundingClientRect().left;se({top:O,left:Ee,width:Mi?Mi-Ee:zt,height:Ye})};(0,ve.useEffect)(()=>(window.addEventListener("scroll",jn,!0),window.addEventListener("resize",jn),()=>{window.removeEventListener("scroll",jn,!0),window.removeEventListener("resize",jn)})),(0,ve.useEffect)(()=>{let _=O=>{Hn.current&&!O.composedPath().includes(Hn.current)&&Hn.current.removeAttribute("open")};return document.addEventListener("click",_),()=>document.removeEventListener("click",_)},[]);let Ci=_=>{qe(_),gt("")},Sw=()=>{if(!pe)return;let _=a[pe];if(_){u(O=>({...O,[pe]:_.productId})),b(O=>({...O,[pe]:Kv(_)}));return}u(O=>{let Ee={...O};return delete Ee[pe],Ee}),b(O=>{let Ee={...O};return delete Ee[pe],Ee})},hr=(_=!1)=>{let O=pe?a[pe]:void 0;!_&&O&&F?.best&&O.productId!==F.best.product_id&&!window.confirm("You have selected a new product. Leave without updating it?")||(_||Sw(),qe(null),oe(!1))},Cw=_=>{if(xt(O=>new Set(O).add(_)),ca.some(O=>O.item.line_id!==_)){hr(!0);return}p(),hr(!0)},qw=_=>{if(dc(_),H(O=>new Set(O).add(_)),ca.some(O=>O.item.line_id!==_)){hr(!0);return}p(),hr(!0)},Ew=()=>{H(_=>new Set([..._,...ca.map(O=>O.item.line_id)])),p()},Gd=()=>{F?.best&&(Yd(F.item.line_id,F.best),r(qi(F)),B?Cw(F.item.line_id):hr(!0))},Qd=jd.length>0?(0,s.jsxs)("section",{className:"results-tile-section results-tile-section--unmatched","aria-label":"Items requiring matching",children:[(0,s.jsxs)("div",{className:"results-tile-section__head",children:[(0,s.jsx)("h3",{children:"Require Matching"}),(0,s.jsx)("p",{children:"We couldn\u2019t confidently match these to a product. Open one to pick from the closest options."})]}),(0,s.jsx)("div",{className:"results-unmatched-list",children:jd.map(_=>{let{item:O,qty:Ee}=_;return(0,s.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>Ci(O.line_id),children:[(0,s.jsx)("span",{className:"results-unmatched-card__main",children:(0,s.jsx)("span",{className:"results-unmatched-card__title",children:Kr(O,w)})}),(0,s.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},O.line_id)})})]}):null,dc=_=>{u(O=>({...O,[_]:ud})),b(O=>({...O,[_]:void 0})),T(O=>({...O,[_]:void 0})),n(_)},mc=(_,O)=>{u(Ee=>({...Ee,[_]:O.product_id})),b(Ee=>({...Ee,[_]:O}))},Yd=(_,O)=>{O.method==="catalogue_search"&&T(Ee=>({...Ee,[_]:O}))};function X_(){Vv(Q.map(({item:_,best:O,qty:Ee,band:zt,unmatchable:Ye,decision:Ft})=>({item:_,best:O,qty:Ee,band:zt,unmatchable:Ye,decision:Ft})))}function qi(_){let O=_.best??Ys(_.result)[0];return Zr(O,{lineId:_.item.line_id,description:_.item.description_original,unit:_.item.unit,qty:_.qty})}(0,ve.useEffect)(()=>{if(!o){for(let _ of Q)!_.unmatchable&&_.best&&r(qi(_));l()}},[o]),(0,ve.useEffect)(()=>{for(let _ of Q){let O=a[_.item.line_id];if(!O)continue;let Ee=qi(_);r({...Ee,qty:O.qty,sellUnitsOverride:O.sellUnitsOverride??null})}},[e]),(0,ve.useEffect)(()=>{if(!pe){_t([]),J(null),Jt(!1);return}let _=De.trim();if(!_){_t([]),J(null),Jt(!1);return}let O=!1,Ee=window.setTimeout(async()=>{try{Jt(!0),J(null);let zt=await fetch(Bt(`/api/catalogue/search?q=${encodeURIComponent(_)}`),{headers:bi()}),Ye=await Vt(zt);if(!zt.ok)throw new Error(Ye?.error||Ye?.message||"Failed to search catalogue");O||_t(Array.isArray(Ye?.items)?Ye.items:[])}catch(zt){O||(_t([]),J(zt?.message||"Failed to search catalogue"))}finally{O||Jt(!1)}},250);return()=>{O=!0,window.clearTimeout(Ee)}},[De,pe]);let fc=Object.keys(a).length,qa=De.trim(),Xd=Ys(F?.result),nl=F?.decision?.technical_classification==="no_suitable_candidate"||!!F&&!F.best,$d=F?.decision?.technical_classification!=null,Vd=F?.decision?.reason??(nl?"No catalogue candidate found. Refine the request or search the catalogue.":null),Mw=yt.map(_=>({product_id:_.product_id,description:_.description,source_list:_.source_list,price:_.price,price_basis:_.price_basis,uoi_count:_.uoi_count??null,uoi:_.uoi,pdp_photo_url:_.pdp_photo_url??null,conversion:_.conversion,measurements_mm:_.measurements_mm??[],scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"catalogue_search"})),Gn=qa?Mw:Xd,Ei=F?S[F.item.line_id]:void 0,Qn=!qa&&Ei&&!Gn.some(_=>_.product_id===Ei.product_id)?[...Gn,Ei]:Gn,Zd=(()=>{let _=Qn.slice(0,qa?12:3);return qa||!Ei||_.some(O=>O.product_id===Ei.product_id)?_:[..._,Ei]})(),ol=!!F?.best&&a[F.item.line_id]?.productId===F.best.product_id,Tw=!!F?.best&&!!a[F.item.line_id]&&!ol;return(0,s.jsxs)("div",{className:"wizard-step entry-stage",children:[(0,s.jsxs)("div",{className:`quick-order-card${f?"":" quick-order-card--customer"}`,children:[(0,s.jsx)("div",{className:`quick-order-hero${f?"":" quick-order-hero--customer"}`,children:f?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,s.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,s.jsx)("h1",{children:"Your Results"}),(0,s.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,s.jsx)("strong",{children:tt(P)})," Est. total"]})]}),(0,s.jsx)("p",{children:"Each line item from your schedule matched against your catalogue, ranked by confidence."})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{children:"Review your matched products"}),(0,s.jsxs)("p",{children:["Check you're happy with these items, then click ",v?"View Quote":"View Basket"," to continue."]})]}),(0,s.jsxs)("button",{type:"button",className:"results-total-action",onClick:i,"aria-label":v?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("small",{children:v?"View Quote":"View Basket"}),(0,s.jsx)("strong",{children:tt(P)})]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Ot,{})})]})]})}),(0,s.jsxs)("div",{className:"quick-order-panel",style:{paddingTop:16},children:[Ge&&(0,s.jsx)("div",{className:"results-summary",style:{marginBottom:12},children:(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn","aria-pressed":de,onClick:()=>Ue(_=>!_),children:de?"Hide timings":"Show timings"})}),Ge&&de&&(0,s.jsx)(e_,{...U}),!v&&(0,s.jsx)("div",{className:"results-toolbar-row",children:!F&&(0,s.jsxs)("div",{className:"results-summary",style:{marginBottom:0},children:[fe>0&&(0,s.jsxs)("span",{className:"summary-chip summary-chip--neutral",children:[(0,s.jsx)("strong",{children:fe})," need pricing"]}),(0,s.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search description...",value:M,onChange:_=>R(_.target.value),"aria-label":"Search line items"}),!f&&(0,s.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,s.jsx)("button",{type:"button",className:`results-view-toggle__btn${K==="tile"?" is-active":""}`,"aria-pressed":K==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>Z("tile"),children:(0,s.jsxs)("svg",{width:"18",height:"12",viewBox:"0 0 15 10",fill:"currentColor",children:[(0,s.jsx)("rect",{x:"0.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"5.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"10.5",y:"0.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"0.5",y:"5.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"5.5",y:"5.5",width:"4",height:"4"}),(0,s.jsx)("rect",{x:"10.5",y:"5.5",width:"4",height:"4"})]})}),(0,s.jsx)("button",{type:"button",className:`results-view-toggle__btn${K==="list"?" is-active":""}`,"aria-pressed":K==="list","aria-label":"List view",title:"List view",onClick:()=>Z("list"),children:(0,s.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,s.jsx)("line",{x1:"0.5",y1:"2.5",x2:"14.5",y2:"2.5"}),(0,s.jsx)("line",{x1:"0.5",y1:"7.5",x2:"14.5",y2:"7.5"}),(0,s.jsx)("line",{x1:"0.5",y1:"12.5",x2:"14.5",y2:"12.5"})]})})]}),Ge&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>$(_=>_==="simple"?"detailed":"simple"),children:Te==="detailed"?"Hide detailed view":"Show detailed view"}),(0,s.jsxs)("details",{ref:Hn,style:{position:"relative"},children:[(0,s.jsx)("summary",{className:"bom-toolbar-btn sort-menu-summary","aria-label":"Sort line items",style:{fontSize:16},children:"\u21C5"}),(0,s.jsx)("div",{className:"sort-menu-panel",children:V1.map(_=>{let O=G===_.dir;return(0,s.jsxs)("button",{type:"button",className:`sort-menu-item${O?" is-active":""}`,onClick:()=>{W(O?null:_.dir),Hn.current?.removeAttribute("open")},children:[(0,s.jsx)("span",{className:"sort-menu-item__check",children:O?"\u2713":""}),_.label]},_.dir)})})]})]})]})}),K==="tile"||F?(0,s.jsxs)(s.Fragment,{children:[F?(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop",role:"dialog","aria-modal":"true","aria-label":"Product options",onClick:()=>hr(),children:(0,s.jsxs)("section",{className:"quick-order-workflow-modal results-review-modal",onClick:_=>_.stopPropagation(),children:[(0,s.jsx)("button",{type:"button",className:"quick-order-workflow-close results-review-modal__close",onClick:()=>hr(),"aria-label":"Close product options",children:(0,s.jsx)($o,{})}),(0,s.jsx)("div",{className:"results-review-page",children:f?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"results-review-page__top",children:[(0,s.jsxs)("button",{type:"button",className:"bom-toolbar-btn bom-toolbar-btn--accent",onClick:()=>hr(),children:[(0,s.jsx)(Vr,{}),"Back to results"]}),(0,s.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[Ge&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>$(_=>_==="simple"?"detailed":"simple"),children:Te==="detailed"?"Hide detailed info":"Show detailed info"}),(0,s.jsx)("div",{className:"results-review-searchbar",children:(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products in catalogue...",value:De,onChange:_=>gt(_.target.value),"aria-label":"Search database candidates"})}),(0,s.jsx)("div",{className:"results-candidate-actions",children:(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>dc(F.item.line_id),children:"Clear selected product"})})]})]}),(0,s.jsxs)("div",{className:"results-review-page__hero",children:[(0,s.jsx)("div",{className:"results-review-page__image-wrap",children:(0,s.jsx)("img",{className:"fill-img results-review-page__image",src:Qa(Ze(F)?.description||F.item.description_original,Ze(F)?.product_id,Ze(F)?.pdp_photo_url),alt:""})}),(0,s.jsxs)("div",{className:"results-review-page__summary",children:[(0,s.jsx)("h2",{children:Kr(F.item,w)}),(0,s.jsxs)("p",{className:"results-review-page__meta",children:[wi(F.qty)," ",ka(F.item.unit,F.qty)]}),F.best?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:F.best.description}),F.best.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:Cn(F.best.price,F.best.price_basis)}):null]}):Ze(F)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:Ze(F)?.description}),Ze(F)?.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:Cn(Ze(F)?.price??null,Ze(F)?.price_basis??null)}):null,(0,s.jsx)("div",{className:"results-row-meta",children:"Best reviewed alternative - not yet selected"})]}):(0,s.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line item."}),dr(F.item)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:8},children:[(0,s.jsx)(cd,{meta:C.get(F.item.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:qn(F.item)})]}):null,(0,s.jsx)("div",{className:"results-review-page__actions",children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[F.item.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[F.item.line_id]?n(F.item.line_id):(F.best&&Yd(F.item.line_id,F.best),r(qi(F)))},disabled:!F.best,"aria-label":a[F.item.line_id]?f?"Remove from selection":`Remove from ${m}`:f?"Add to selection":`Add to ${m}`,children:a[F.item.line_id]?"\u2713 Added":f?"+ Add to selection":`Add to ${m}`})})]})]}),Ie?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,!Ie&&j?(0,s.jsx)("div",{className:"results-empty-card",children:j}):null,!Ie&&!j&&qa&&Gn.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No candidate products match this database search."}):!Ie&&!j?(0,s.jsx)(n_,{item:F.item,candidates:Gn,result:F.result,decision:F.decision,unmatchable:F.unmatchable,selectedProductId:F.best?.product_id??null,detailMode:Te,linkedGroupMeta:dr(F.item)?C.get(F.item.linked_group_id):void 0,onPick:_=>mc(F.item.line_id,_),onClear:()=>dc(F.item.line_id),showAll:f||Ge||qa.length>0,internal:f,debugEnabled:Ge,forceReviewNote:!0}):null]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("section",{className:"customer-review-request",children:[(0,s.jsx)("span",{className:"customer-review-eyebrow",children:"Original request"}),(0,s.jsx)("strong",{children:Kr(F.item,w)||"Original request"})]}),Vd?(0,s.jsxs)("section",{className:"customer-review-ai",children:[(0,s.jsx)("strong",{children:nl?"Exact match not found:":"AI review:"})," ",Vd]}):null,(0,s.jsxs)("section",{className:"customer-review-options",children:[(0,s.jsx)("div",{className:"customer-review-options__head",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{children:nl?"We couldn't find a suitable product":$d?"Choose a product":"We couldn't review this item"}),(0,s.jsx)("p",{children:nl?Xd.length>0?"These AI-reviewed alternatives may be useful, but need approval.":"Search the catalogue to choose an alternative.":$d?`Select the option you want to add to your ${m}.`:"Search the catalogue to choose a product."})]})}),!qa&&Qn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:Zd.map(_=>{let O=_.product_id===F.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${O?" is-selected":""}`,onClick:()=>mc(F.item.line_id,_),"aria-pressed":O,children:[(0,s.jsx)("img",{className:"customer-review-option__image",src:Qa(_.description,_.product_id,_.pdp_photo_url),alt:"",width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:_.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:_.price!=null?`\xA3${Cn(_.price,_.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:O?"Selected":"Choose"})]},_.product_id)})}):null,Qn.length>0&&(0,s.jsx)("div",{className:"customer-review-divider",children:(0,s.jsx)("span",{children:"or"})}),(0,s.jsxs)("label",{className:"customer-review-search",children:[(0,s.jsx)("span",{children:"Search our full catalogue"}),(0,s.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products...",value:De,onChange:_=>gt(_.target.value),"aria-label":"Search catalogue"})]}),qa&&Ie?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,qa&&!Ie&&j?(0,s.jsx)("div",{className:"results-empty-card",children:j}):null,qa&&!Ie&&!j&&Qn.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No products match this search."}):null,qa&&!Ie&&!j&&Qn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:Zd.map(_=>{let O=_.product_id===F.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${O?" is-selected":""}`,onClick:()=>mc(F.item.line_id,_),"aria-pressed":O,children:[(0,s.jsx)("img",{className:"customer-review-option__image",src:Qa(_.description,_.product_id,_.pdp_photo_url),alt:"",width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:_.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:_.price!=null?`\xA3${Cn(_.price,_.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:O?"Selected":"Choose"})]},_.product_id)})}):null]}),F.best?Tw?(0,s.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,s.jsx)("button",{type:"button",className:"cta-btn customer-review-add",onClick:()=>{Gd()},children:(0,s.jsx)("span",{children:"Update product"})}),(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-add",onClick:()=>n(F.item.line_id),children:(0,s.jsx)("span",{children:`Remove from ${m}`})})]}):(0,s.jsx)("button",{type:"button",className:`cta-btn customer-review-add${ol?" cta-btn-secondary":""}`,onClick:()=>{ol?n(F.item.line_id):Gd()},children:(0,s.jsx)("span",{children:ol?`Remove from ${m}`:`Add selected product to ${m}`})}):null,B?(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-skip",onClick:()=>qw(F.item.line_id),children:"Skip this item"}):null]})})]})}):null,(0,s.jsxs)("div",{className:"results-tile-layout",children:[ua.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No line items match the current search/filter."}):null,Ln.length>0?(0,s.jsx)("section",{className:"results-tile-section","aria-label":"Matched and review items",children:(0,s.jsx)("div",{className:"results-tile-grid",children:Ln.map(_=>{let{item:O,best:Ee,qty:zt}=_,Ye=Ze(_),Ft=!Ee&&_e(_);return(0,s.jsxs)("article",{className:"results-tile-card",children:[(0,s.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>Ci(O.line_id),"aria-label":`Review match for ${Kr(O,w)||"item"}`,children:[(0,s.jsxs)("div",{className:"results-tile-card__media",children:[Ft||dr(O)?(0,s.jsxs)("div",{className:"results-tile-card__badges",children:[dr(O)?(0,s.jsx)(cd,{meta:C.get(O.linked_group_id)}):(0,s.jsx)("span",{}),Ft?(0,s.jsx)("span",{style:{padding:"6px 10px",borderRadius:999,background:"#fef3c7",color:"#92400e",fontSize:12,fontWeight:700,lineHeight:1},children:"Partially matched"}):null]}):null,(0,s.jsx)("img",{className:"fill-img results-tile-card__image",src:Qa(Ye?.description||O.description_original,Ye?.product_id,Ye?.pdp_photo_url),alt:""})]}),(0,s.jsxs)("div",{className:"results-tile-card__body",children:[Ye?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"results-tile-card__heading",children:(0,s.jsx)("div",{className:"results-tile-card__title",children:Ye.description})})}):(0,s.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line item."}),(0,s.jsx)("div",{className:"results-tile-card__match",children:Ye?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-tile-card__match-label",children:Ft?"\u21B3 partially matched from":"\u21B3 matched from"}),(0,s.jsx)("div",{className:"results-tile-card__match-name",children:Kr(O,w)}),dr(O)?(0,s.jsx)("div",{className:"results-row-meta",children:qn(O)}):null]}):(0,s.jsx)("span",{className:"results-empty-hint",children:"No matched product selected."})})]}),(0,s.jsx)("span",{className:"results-tile-card__hover-prompt","aria-hidden":"true",children:"Click to view options"})]}),(0,s.jsxs)("div",{className:"results-tile-card__actions",children:[f&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Ci(O.line_id),children:"Review"}),(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[O.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[O.line_id]?n(O.line_id):r(qi(_))},disabled:!Ye,"aria-label":a[O.line_id]?f?"Remove from selection":`Remove from ${m}`:f?"Add to selection":`Add to ${m}`,children:a[O.line_id]?"\u2713 Added":f?"+ Add":`Add to ${m}`})]})]},O.line_id)})})}):null,Qd]})]}):(0,s.jsxs)(s.Fragment,{children:[te&&(0,s.jsx)("div",{className:"results-table__hover-overlay",style:te,"aria-hidden":"true",children:"Click to view options"}),(0,s.jsx)("div",{className:"bom-table-wrap",children:(0,s.jsxs)("table",{className:"bom-table results-table","aria-label":"Matched line items",children:[(0,s.jsxs)("colgroup",{children:[(0,s.jsx)("col",{className:"col-item"}),(0,s.jsx)("col",{style:{width:"220px"}}),(0,s.jsx)("col",{style:{width:"100px"}}),Te==="simple"&&(0,s.jsx)("col",{style:{width:"110px"}})]}),(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"bom-col-header",children:[(0,s.jsx)("th",{style:{textAlign:"left"},children:"Description"}),(0,s.jsx)("th",{style:{textAlign:"center"},children:"Product Matched"}),(0,s.jsx)("th",{style:{textAlign:"center"},children:"Price"}),Te==="simple"&&(0,s.jsx)("th",{style:{textAlign:"center"},children:f?"Selection":v?"Quote":"Basket"})]})}),(0,s.jsxs)("tbody",{children:[ua.length===0&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:Te==="simple"?4:3,className:"results-empty-hint",style:{padding:"16px 8px"},children:"No line items match the current search/filter."})}),Ln.map(_=>{let{item:O,result:Ee,decision:zt,best:Ye}=_;return(0,s.jsxs)("tr",{className:"bom-row results-table__review-row",onClick:()=>Ci(O.line_id),onMouseEnter:Ft=>{ye.current=Ft.currentTarget,jn()},onMouseLeave:()=>{ye.current=null,se(null)},children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{className:"bom-component-name",children:Kr(O,w)}),dr(O)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:4},children:[(0,s.jsx)(cd,{meta:C.get(O.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:qn(O)})]}):null]}),(0,s.jsx)("td",{children:Ye?(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"results-match-cell-text",title:Ye.description,children:Ye.description}),Te==="detailed"&&zt?.technical_classification&&(0,s.jsxs)("div",{className:"results-row-meta",children:[J1(zt.technical_classification),zt.approval_required?" - approval required":""]})]}):(0,s.jsx)("span",{className:"results-empty-hint"})}),(0,s.jsx)("td",{style:{textAlign:"center"},children:Ye?.price!=null?Cn(Ye.price,Ye.price_basis):"-"}),Te==="simple"&&(0,s.jsx)("td",{style:{textAlign:"center"},children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[O.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,style:{width:84,justifyContent:"center"},onClick:Ft=>{Ft.stopPropagation(),a[O.line_id]?n(O.line_id):r(qi(_))},"aria-label":a[O.line_id]?f?"Remove from selection":`Remove from ${m}`:f?"Add to selection":`Add to ${m}`,children:a[O.line_id]?"\u2713 Added":f?"+ Add":`Add to ${m}`})})]},O.line_id)})]})]})}),Qd]}),!F&&On>1&&(0,s.jsxs)("div",{className:"results-pagination",children:[(0,s.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(Pt-1)*Fo+1,"\u2013",Math.min(Pt*Fo,ua.length)," of ",ua.length]}),(0,s.jsxs)("div",{className:"results-pagination-controls",children:[(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Ce(Pt-1),disabled:Pt===1,children:"Previous"}),(0,s.jsxs)("span",{className:"results-pagination-page",children:["Page ",Pt," of ",On]}),(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Ce(Pt+1),disabled:Pt===On,children:"Next"})]})]}),(E.itemCount!=null||E.headingCount!=null||E.skippedCount!=null)&&(0,s.jsxs)("div",{className:"results-summary",style:{marginTop:16},children:[E.itemCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:E.itemCount})," items parsed"]}),E.headingCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:E.headingCount})," headings"]}),E.skippedCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:E.skippedCount})," rows skipped"]})]}),(0,s.jsxs)("div",{className:"disclaimer-box",children:[(0,s.jsx)("span",{className:"disclaimer-icon",children:"\u26A0\uFE0F"}),(0,s.jsx)("p",{className:"disclaimer-text",children:"These matches are generated automatically and should be reviewed before purchase."})]}),!F&&(0,s.jsxs)("div",{className:"btn-row results-actions",children:[(0,s.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:(fc>0,"0 1 30%"),gap:10,justifyContent:"center"},onClick:()=>A(!0),"aria-label":"Start over",children:[(0,s.jsx)(ld,{}),(0,s.jsx)("span",{children:"Start Over"})]}),fc>0&&(0,s.jsxs)("button",{className:"cta-btn",style:{flex:"0 1 70%"},onClick:i,"aria-label":f?"View selection":v?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[f?"View Selection":v?"View Quote":"View Basket"," (",fc,")"]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Ot,{})})]})]})]})]}),Nw&&(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop review-gate-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"review-gate-title",children:(0,s.jsxs)("section",{className:"quick-order-workflow-modal review-gate-modal",children:[(0,s.jsxs)("div",{className:"review-gate-modal__header",children:[(0,s.jsx)("h2",{id:"review-gate-title",children:"Choose products for these items"}),(0,s.jsx)("p",{children:"We couldn\u2019t find a clear match for these items, so we need your help. Select an option from the suggestions, search the catalogue, or leave the item out."})]}),(0,s.jsx)("div",{className:"review-gate-list",children:ca.map(_=>{let O=st.has(_.item.line_id),Ee=_e(_);return(0,s.jsx)("div",{className:`review-gate-item${O?" is-reviewed":""}`,children:(0,s.jsxs)("button",{type:"button",className:"review-gate-item__review",onClick:()=>{oe(!0),Ci(_.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Kr(_.item,w)}),(0,s.jsx)("span",{children:_.decision?.reason||(Ee?"A close alternative is available but needs confirmation.":"No product has been selected for this item yet.")})]}),(0,s.jsx)("span",{className:"review-gate-item__action",children:O?"Choice made":"Choose a product"})]})},_.item.line_id)})}),(0,s.jsx)("button",{type:"button",className:"review-gate-skip",onClick:Ew,children:"Skip all"}),il.length>0?(0,s.jsxs)("div",{className:"review-gate-skipped",children:[(0,s.jsx)("strong",{children:"Skipped"}),il.map(_=>(0,s.jsxs)("button",{type:"button",className:"review-gate-item is-skipped",onClick:()=>{H(O=>{let Ee=new Set(O);return Ee.delete(_.item.line_id),Ee}),oe(!0),Ci(_.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Kr(_.item,w)}),(0,s.jsx)("span",{children:`Not added to your ${m}.`})]}),(0,s.jsx)("span",{className:"review-gate-item__action",children:"Choose a product"})]},_.item.line_id))]}):null]})}),k&&(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop start-over-modal",role:"dialog","aria-modal":"true","aria-labelledby":"start-over-modal-title",children:(0,s.jsxs)("div",{className:"modal-card start-over-modal__card",children:[(0,s.jsx)("h2",{id:"start-over-modal-title",className:"modal-title",children:"Start over?"}),(0,s.jsxs)("p",{className:"modal-body",children:["This will clear the current results and ",v?"quote":"basket"," and take you back to the start."]}),(0,s.jsxs)("div",{className:"modal-actions",children:[(0,s.jsx)("button",{type:"button",className:"modal-btn modal-btn-secondary",onClick:()=>A(!1),children:"Cancel"}),(0,s.jsx)("button",{type:"button",className:"modal-btn modal-btn-danger",onClick:()=>{A(!1),t()},autoFocus:!0,children:"Start Over"})]})]})})]})}var Et=Y(Xe());var q=Y(ie()),o_=.2,Io=10,l_=(e,t)=>{let a=`${t.requestedAmount} ${xa(t.requestedUnit,t.requestedAmount)}`,r=`${t.requiredSellUnits} ${xa(t.sellUnit,t.requiredSellUnits??0)}`,n=e.unitConversions?.find(i=>i.requestUom===t.requestedUnit);return n&&n.quantityPerSaleUnit<1?`${a} requested \u2192 order ${r} (${Math.round(1/n.quantityPerSaleUnit)} ${xa(t.sellUnit,2)} per ${xa(t.requestedUnit,1)})`:e.coverageQty&&/^m per /i.test(e.coverageUom??"")?`${a} requested \u2192 order ${r} (${e.coverageQty} ${e.coverageUom})`:`${a} requested \u2192 order ${r}`},s_=e=>["box","pack"].includes(e.requestedUnit)?"Pack size needed to calculate the order quantity.":`This product is sold by ${xa(e.sellUnit,1)}.`;function c_(){return(0,q.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,q.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,q.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,q.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,q.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}function Wo(){return(0,q.jsx)("svg",{width:"8",height:"5",viewBox:"0 0 8 5",fill:"none",children:(0,q.jsx)("path",{d:"M1 4L4 1L7 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function el({cart:e,onUpdateQty:t,onUpdateSellUnits:a,onResolveConversions:r,onRemove:n,onBack:i,internal:o=!1}){let l=(0,Et.useId)(),c=!o&&Ls()==="QZA6-MRA4",p=Object.values(e),[f,v]=(0,Et.useState)(""),[m,h]=(0,Et.useState)(!1),[w,E]=(0,Et.useState)(!1),[U,d]=(0,Et.useState)(""),[u,g]=(0,Et.useState)({}),[b,S]=(0,Et.useState)({}),[T,M]=(0,Et.useState)(1),[R,G]=(0,Et.useState)({}),[W,we]=(0,Et.useState)(!1),[Ce,Ge]=(0,Et.useState)("0"),Ve=(0,Et.useRef)(new Set);(0,Et.useEffect)(()=>{if(!r)return;let j=Object.values(e).filter(J=>J.productId!=="-"&&za(J).requiredSellUnits==null&&!Ve.current.has(J.lineId));j.length!==0&&(j.forEach(J=>Ve.current.add(J.lineId)),fetch(Bt("/api/catalogue/resolve-conversions"),{method:"POST",headers:{"Content-Type":"application/json",...Ga()},body:JSON.stringify({lines:j.map(J=>({line_id:J.lineId,product_id:J.productId,requested_description:J.requestedDescription??J.description,requested_qty:J.qty,requested_uom:J.unit,selected_description:J.description,selected_uoi:J.uoi,selected_uoi_count:J.uoiCount,selected_conversion:{sales_uom_normalised:J.salesUomNormalised,conversion_type:J.conversionType,sales_unit_size:J.salesUnitSize,sales_unit_size_uom:J.salesUnitSizeUom,coverage_qty:J.coverageQty,coverage_uom:J.coverageUom}}))})}).then(J=>J.ok?Vt(J):null).then(J=>{let k={};for(let A of J?.data?.items??J?.items??[]){let te=A?.conversion;!te||typeof A?.line_id!="string"||(k[A.line_id]={conversionType:te.conversion_type,requestUomsSupported:te.request_uoms_supported,salesUomNormalised:te.sales_uom_normalised,salesUnitSize:te.sales_unit_size,salesUnitSizeUom:te.sales_unit_size_uom,coverageQty:te.coverage_qty,coverageUom:te.coverage_uom,roundingRule:te.rounding_rule,conversionConfidence:te.conversion_confidence,conversionNotes:te.conversion_notes})}Object.keys(k).length>0&&r(k)}).catch(()=>{}))},[e,r]);function Te(j){g(J=>{let k={...J};return delete k[j],k})}function $(j,J){let k=parseFloat(J);!isNaN(k)&&k>=0&&t(j,k),Te(j)}function K(j,J,k){t(j,Math.max(0,J+k)),Te(j)}function Z(j){S(J=>{let k={...J};return delete k[j],k})}function de(j,J){let k=parseFloat(J);!isNaN(k)&&k>=0&&a(j,k),Z(j)}function Ue(j,J,k){a(j,Math.max(0,J+k)),Z(j)}async function pe(){let j=f.trim();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(j)){d("Enter a valid email address so we can send your better price.");return}d(""),E(!0);try{let J=await fetch(Bt("/api/quote-requests"),{method:"POST",headers:{"Content-Type":"application/json",...Ga()},body:JSON.stringify({email:j,items:qe.map(({item:k,pricing:A})=>{let te=A.requiredSellUnits??A.requestedAmount,se=A.requiredSellUnits!=null?A.sellUnit:A.requestedUnit;return{product_id:k.productId,description:k.description,quantity:te,unit:xa(se,te)}})})});if(!J.ok){let k=await Vt(J);d(J.status===429?"You've sent a few requests already. Please try again in a few minutes.":k?.message??"Your request couldn't be sent. Please try again.");return}h(!0)}catch{d("Your request couldn't be sent. Check your connection and try again.")}finally{E(!1)}}let qe=p.map(j=>({item:j,pricing:za(j,{wasteFactorEnabled:W,wasteFactorOverride:Math.max(0,Number.parseFloat(Ce)||0)/100})})),De=qe.reduce((j,J)=>j+(J.pricing.lineTotal??0),0),gt=De*o_,yt=De+gt,_t=Math.max(1,Math.ceil(qe.length/Io)),Ie=Math.min(T,_t),Jt=qe.slice((Ie-1)*Io,Ie*Io);return(0,q.jsx)("div",{className:`wizard-step entry-stage${c?" basket-layout--qza6-mra4":""}`,children:(0,q.jsxs)("div",{className:`quick-order-card${o?"":" quick-order-card--customer"}`,children:[(0,q.jsxs)("div",{className:`quick-order-hero${o?"":" quick-order-hero--customer"}`,children:[o&&(0,q.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,q.jsxs)("div",{className:"basket-hero-copy",children:[c&&(0,q.jsxs)("button",{type:"button",className:"cta-btn cta-btn-secondary basket-hero-back",onClick:i,children:[(0,q.jsx)(Vr,{}),(0,q.jsx)("span",{children:"Back to results"})]}),(0,q.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,q.jsx)("h1",{children:o?"Your Selection":c?"Request a quote":"Your Basket"}),o&&(0,q.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,q.jsx)("strong",{children:p.length})," ",p.length===1?"item":"items"]})]}),(0,q.jsx)("p",{children:o?"Review the items you&apos;ve added before exporting them for review.":c?"Check your items & quantities below, and we&apos;ll do our best to beat list prices.":"Review your quantities and order summary before you buy."})]})]}),(0,q.jsx)("div",{className:"quick-order-panel",style:{paddingTop:16},children:p.length===0?(0,q.jsxs)("div",{className:"quick-order-history-empty",children:[(0,q.jsx)("div",{className:"basket-empty-icon","aria-hidden":"true",children:o?"\u{1F4CB}":"\u{1F9FA}"}),(0,q.jsx)("p",{children:o?"Your selection is empty.":c?"Your quote request is empty.":"Your basket is empty."}),(0,q.jsx)("p",{className:"basket-empty-hint",children:c?"Go back to your results and add items for your quote.":"Go back to your results and add quoted items."}),(0,q.jsx)("div",{className:"btn-row",style:{marginTop:20,justifyContent:"center"},children:(0,q.jsx)("button",{className:"cta-btn",style:{width:"auto",maxWidth:280},onClick:i,"aria-label":"Back to results",children:(0,q.jsx)("span",{children:"Back to Results"})})})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)("div",{className:"basket-layout",children:[(0,q.jsxs)("div",{className:"basket-main",children:[(0,q.jsx)("div",{className:"basket-list","aria-label":o?"Selection items":c?"Quote request items":"Basket items",children:Jt.map(({item:j,pricing:J})=>{let k=u[j.lineId]??String(J.requestedAmount),A=J.requestedUnit===J.sellUnit||J.costingMode==="review",te=J.requiredSellUnits==null||J.requestedAmount!==J.requiredSellUnits||J.requestedUnit!==J.sellUnit;return(0,q.jsxs)("article",{className:"basket-card",children:[(0,q.jsxs)("div",{className:"basket-card-top",children:[(0,q.jsx)("img",{className:"basket-card-thumb",src:Qa(j.description,j.productId,j.pdpPhotoUrl),alt:"",width:48,height:48}),(0,q.jsxs)("div",{className:"basket-card-info",children:[(0,q.jsx)("div",{className:"bom-component-name",children:j.description}),te&&J.costingMode!=="review"&&(0,q.jsxs)("button",{type:"button",className:"basket-calc-toggle",onClick:()=>G(se=>({...se,[j.lineId]:!se[j.lineId]})),"aria-expanded":!!R[j.lineId],children:["How we calculated this",(0,q.jsx)("span",{className:`basket-calc-toggle-chevron${R[j.lineId]?" basket-calc-toggle-chevron--open":""}`,children:(0,q.jsx)(Wo,{})})]})]}),(0,q.jsx)("div",{className:"basket-card-actions",children:(0,q.jsx)("button",{type:"button",className:"mf-remove-small-btn basket-card-remove",onClick:()=>n(j.lineId),"aria-label":`Remove ${j.description}`,children:(0,q.jsx)(c_,{})})})]}),o&&(0,q.jsxs)("div",{className:"results-detail-block basket-internal-detail",children:[(0,q.jsxs)("dl",{className:"results-detail-grid",children:[(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Conversion type"}),(0,q.jsx)("dd",{children:j.conversionType??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Conversion confidence"}),(0,q.jsx)("dd",{children:j.conversionConfidence??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Sales unit"}),(0,q.jsx)("dd",{children:j.salesUnitSize!=null?(0,q.jsxs)(q.Fragment,{children:[j.salesUnitSize," ",ka(j.salesUnitSizeUom,j.salesUnitSize)]}):"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Coverage"}),(0,q.jsx)("dd",{children:j.coverageQty!=null?(0,q.jsxs)(q.Fragment,{children:[j.coverageQty," ",ka(j.coverageUom,j.coverageQty)]}):"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Waste factor"}),(0,q.jsx)("dd",{children:j.wasteFactorDefault??"-"})]}),(0,q.jsxs)("div",{children:[(0,q.jsx)("dt",{children:"Rounding rule"}),(0,q.jsx)("dd",{children:j.roundingRule??"-"})]})]}),j.conversionNotes&&(0,q.jsx)("p",{className:"results-rerank-note",children:j.conversionNotes})]}),J.costingMode==="review"?(0,q.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,q.jsx)("strong",{children:"Quantity needs confirmation."})," ",s_(J)]}):te&&R[j.lineId]?(0,q.jsx)("p",{className:"basket-calc-text",children:l_(j,J)}):null,(0,q.jsxs)("div",{className:"basket-card-stats",children:[(0,q.jsxs)("div",{className:"basket-stat",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Requested qty"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsxs)("div",{className:"basket-qty-field",children:[(0,q.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:k,disabled:A,onChange:se=>g(ye=>({...ye,[j.lineId]:se.target.value})),onBlur:se=>$(j.lineId,se.target.value),onKeyDown:se=>{se.key==="Enter"&&se.target.blur()},"aria-label":`${j.description} requested quantity`}),(0,q.jsxs)("div",{className:"basket-qty-arrows",children:[(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow",disabled:A,onClick:()=>K(j.lineId,parseFloat(k)||0,1),"aria-label":`Increase ${j.description} quantity`,children:(0,q.jsx)(Wo,{})}),(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",disabled:A,onClick:()=>K(j.lineId,parseFloat(k)||0,-1),"aria-label":`Decrease ${j.description} quantity`,children:(0,q.jsx)(Wo,{})})]})]}),(0,q.jsx)("span",{className:"basket-metric-unit",children:ka(J.requestedUnit,parseFloat(k)||0)})]})]}),(0,q.jsxs)("div",{className:"basket-stat basket-stat--right",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Order qty"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsxs)("div",{className:"basket-qty-field",children:[(0,q.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:b[j.lineId]??String(J.requiredSellUnits??""),onChange:se=>S(ye=>({...ye,[j.lineId]:se.target.value})),onBlur:se=>de(j.lineId,se.target.value),onKeyDown:se=>{se.key==="Enter"&&se.target.blur()},"aria-label":`${j.description} order quantity`}),(0,q.jsxs)("div",{className:"basket-qty-arrows",children:[(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow",onClick:()=>Ue(j.lineId,parseFloat(b[j.lineId]??String(J.requiredSellUnits??"0"))||0,1),"aria-label":`Increase ${j.description} order quantity`,children:(0,q.jsx)(Wo,{})}),(0,q.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",onClick:()=>Ue(j.lineId,parseFloat(b[j.lineId]??String(J.requiredSellUnits??"0"))||0,-1),"aria-label":`Decrease ${j.description} order quantity`,children:(0,q.jsx)(Wo,{})})]})]}),(0,q.jsx)("span",{className:"basket-metric-unit",children:ka(J.sellUnit,parseFloat(b[j.lineId]??String(J.requiredSellUnits??"0"))||0)})]})]}),(0,q.jsxs)("div",{className:"basket-stat basket-stat--total",children:[(0,q.jsx)("span",{className:"basket-stat-label",children:"Total"}),(0,q.jsxs)("div",{className:"basket-stat-value",children:[(0,q.jsx)("strong",{children:J.lineTotal!=null?tt(J.lineTotal):"-"}),J.lineTotal!=null&&(0,q.jsx)("span",{className:"basket-metric-unit",children:"ex. VAT"})]})]})]})]},j.lineId)})}),_t>1&&(0,q.jsxs)("div",{className:"results-pagination",children:[(0,q.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(Ie-1)*Io+1,"\u2013",Math.min(Ie*Io,qe.length)," of ",qe.length]}),(0,q.jsxs)("div",{className:"results-pagination-controls",children:[(0,q.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>M(Ie-1),disabled:Ie===1,children:"Previous"}),(0,q.jsxs)("span",{className:"results-pagination-page",children:["Page ",Ie," of ",_t]}),(0,q.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>M(Ie+1),disabled:Ie===_t,children:"Next"})]})]})]}),(0,q.jsxs)("aside",{className:"basket-sidebar",children:[(0,q.jsx)("div",{className:"basket-sidebar-title",children:c?"Quote request summary":"Order summary"}),(0,q.jsxs)("div",{className:"basket-sidebar-row",children:[(0,q.jsx)("span",{children:c?"List price (ex. VAT)":"Subtotal (ex. VAT)"}),(0,q.jsx)("span",{children:tt(De)})]}),(0,q.jsxs)("div",{className:"basket-sidebar-row",children:[(0,q.jsx)("span",{children:"VAT (20%)"}),(0,q.jsx)("span",{children:tt(gt)})]}),(0,q.jsxs)("div",{className:"basket-sidebar-row basket-sidebar-row--total",children:[(0,q.jsx)("span",{children:c?"List price (inc. VAT)":"Total"}),(0,q.jsx)("span",{children:tt(yt)})]}),!c&&(0,q.jsx)("div",{className:"basket-summary-waste",children:(0,q.jsxs)("div",{className:"basket-waste-control",children:[(0,q.jsxs)("label",{className:"basket-global-waste",children:[(0,q.jsx)("input",{type:"checkbox",checked:W,onChange:j=>we(j.target.checked)}),(0,q.jsx)("span",{children:"Add waste factor"})]}),(0,q.jsxs)("label",{className:"basket-global-waste-percent",children:[(0,q.jsx)("input",{type:"number",inputMode:"decimal",min:"0",step:"0.1",value:Ce,onChange:j=>Ge(j.target.value),disabled:!W,"aria-label":"Waste factor percent"}),(0,q.jsx)("span",{children:"%"})]})]})}),(0,q.jsx)("label",{htmlFor:`${l}-basket-reference`,className:"basket-sidebar-label",children:c?"Enter email for your sharper quote":"Your reference (optional)"}),(0,q.jsx)("input",{id:`${l}-basket-reference`,type:c?"email":"text",className:"basket-sidebar-input",value:f,onChange:j=>{v(j.target.value),c&&d("")},placeholder:c?"you@example.com":"PO number or job reference"}),c&&U&&(0,q.jsx)("p",{className:"basket-quote-request-error",role:"alert",children:U}),c?m?(0,q.jsxs)("div",{className:"basket-quote-request-success",role:"status",children:[(0,q.jsx)("strong",{children:"Better price requested"}),(0,q.jsx)("span",{children:"We'll use this email address to prepare your better price."})]}):(0,q.jsx)("button",{type:"button",className:"cta-btn",onClick:()=>{pe()},disabled:w,"aria-busy":w,children:(0,q.jsx)("span",{children:w?"Sending\u2026":"Request our best quote"})}):(0,q.jsx)("button",{className:"cta-btn",onClick:()=>{Zv(p)},"aria-label":o?"Download selection":"Download basket",children:(0,q.jsx)("span",{children:o?"Download Quote":"Buy Now"})}),(0,q.jsxs)("p",{className:"basket-sidebar-disclaimer",children:[(0,q.jsx)("span",{"aria-hidden":"true",children:"\u26A0\uFE0F"}),c?"This is a quote request, not an order. We'll confirm our best price, availability and delivery before you approve.":"Prices and availability are estimates and should be confirmed before procurement."]})]})]}),(0,q.jsx)("div",{className:"btn-row results-actions",children:(0,q.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",gap:10,justifyContent:"center"},onClick:i,"aria-label":"Back to results",children:[(0,q.jsx)(Vr,{}),(0,q.jsx)("span",{children:"Back to results"})]})})]})})]})})}var Mt=Y(Xe()),Iv=Y(ie()),md=(0,Mt.createContext)(null);function $s({children:e,onOpenBasket:t}){let[a,r]=(0,Mt.useState)({}),n=(0,Mt.useCallback)(m=>{r(h=>({...h,[m.lineId]:m}))},[]),i=(0,Mt.useCallback)(m=>{r(h=>{let w={...h};for(let E of m)w[E.lineId]=E;return w})},[]),o=(0,Mt.useCallback)(m=>{r(h=>{let w={...h};return delete w[m],w})},[]),l=(0,Mt.useCallback)((m,h)=>{r(w=>w[m]?{...w,[m]:{...w[m],qty:h,sellUnitsOverride:null}}:w)},[]),c=(0,Mt.useCallback)((m,h)=>{r(w=>w[m]?{...w,[m]:{...w[m],sellUnitsOverride:h}}:w)},[]),p=(0,Mt.useCallback)(m=>{r(h=>{let w=!1,E={...h};for(let[U,d]of Object.entries(m))E[U]&&(E[U]={...E[U],...d},w=!0);return w?E:h})},[]),f=(0,Mt.useCallback)(()=>r({}),[]),v=(0,Mt.useMemo)(()=>({cart:a,count:Object.keys(a).length,addToCart:n,addManyToCart:i,removeFromCart:o,updateCartQty:l,updateCartSellUnits:c,updateCartConversions:p,clearCart:f,openBasket:t??(()=>{})}),[a,n,i,o,l,c,p,f,t]);return(0,Iv.jsx)(md.Provider,{value:v,children:e})}function En(){let e=(0,Mt.useContext)(md);if(!e)throw new Error("useCart must be used inside a <CartProvider>");return e}function Vs(){return(0,Mt.useContext)(md)}var Aa=Y(ie());function Zs(e){return(0,Aa.jsx)($s,{children:(0,Aa.jsx)(u_,{...e})})}function u_({fullPage:e=!1,hideHeader:t=!1,internal:a=!1}){let[r,n]=(0,nt.useState)("entry"),[i,o]=(0,nt.useState)(null),[l,c]=(0,nt.useState)(""),p=(0,nt.useRef)(null),[f,v]=(0,nt.useState)(0),[m,h]=(0,nt.useState)(null),[w,E]=(0,nt.useState)(!1),{cart:U,addToCart:d,removeFromCart:u,updateCartQty:g,updateCartSellUnits:b,updateCartConversions:S,clearCart:T}=En(),[M,R]=(0,nt.useState)(!1),G=(0,nt.useRef)(new Map);(0,nt.useEffect)(()=>{let K=Object.values(U).filter(Z=>{if(Z.productId==="-"||za(Z).requiredSellUnits!=null)return!1;let de=`${Z.productId}|${Z.qty}|${Z.unit}`;return G.current.get(Z.lineId)===de?!1:(G.current.set(Z.lineId,de),!0)});K.length!==0&&fetch(Bt("/api/catalogue/resolve-conversions"),{method:"POST",headers:{"Content-Type":"application/json",...Ga()},body:JSON.stringify({lines:K.map(Z=>({line_id:Z.lineId,product_id:Z.productId,requested_description:Z.requestedDescription??Z.description,requested_qty:Z.qty,requested_uom:Z.unit,selected_description:Z.description,selected_uoi:Z.uoi,selected_uoi_count:Z.uoiCount,selected_conversion:{sales_uom_normalised:Z.salesUomNormalised,conversion_type:Z.conversionType,sales_unit_size:Z.salesUnitSize,sales_unit_size_uom:Z.salesUnitSizeUom,coverage_qty:Z.coverageQty,coverage_uom:Z.coverageUom}}))})}).then(Z=>Z.ok?Vt(Z):null).then(Z=>{let de={};for(let Ue of Z?.data?.items??Z?.items??[]){let pe=Ue?.conversion;!pe||typeof Ue?.line_id!="string"||(de[Ue.line_id]={conversionType:pe.conversion_type,requestUomsSupported:pe.request_uoms_supported,salesUomNormalised:pe.sales_uom_normalised,salesUnitSize:pe.sales_unit_size,salesUnitSizeUom:pe.sales_unit_size_uom,coverageQty:pe.coverage_qty,coverageUom:pe.coverage_uom,roundingRule:pe.rounding_rule,conversionConfidence:pe.conversion_confidence,conversionNotes:pe.conversion_notes})}Object.keys(de).length>0&&S(de)}).catch(()=>{})},[U,S]),(0,nt.useEffect)(()=>{if(window.location.hash!=="#matched-products"&&window.location.hash!=="#quote-request")return;let K=new URL(window.location.href);K.hash="",window.history.replaceState({...window.history.state??{},boqQuoteStage:"entry"},"",K)},[]);let W=(0,nt.useCallback)(K=>{if(typeof window>"u")return;let Z=new URL(window.location.href);Z.hash=K==="basket"?"quote-request":"matched-products";let de={...window.history.state??{},boqQuoteStage:K};window.history.pushState(de,"",Z)},[]);(0,nt.useEffect)(()=>{let K=Z=>{let de=Z.state?.boqQuoteStage;n(de==="basket"?"basket":de==="results"&&m?"results":"entry")};return window.addEventListener("popstate",K),()=>window.removeEventListener("popstate",K)},[m]);let we=(0,nt.useCallback)(()=>{W("basket"),n("basket"),window.scrollTo(0,0)},[W]),Ce=(0,nt.useCallback)(()=>{window.history.state?.boqQuoteStage==="basket"?window.history.back():n(m?"results":"entry")},[m]),Ge=()=>{n("entry"),o(null),c(""),v(0),h(null),E(!1),T(),R(!1)},Ve=(0,nt.useCallback)(async(K,Z,de=!0)=>{c(""),v(0);let Ue=0,pe=()=>{Ue=Math.min(Ue+1,3),v(Ue)};try{let{jobId:qe}=await Zb(K,Z,de),{promise:De,cancel:gt}=Jb(()=>Kb(qe),5e3,pe,"schedule");p.current=gt;let yt=await De;if(yt.status==="failed"||!yt.result)throw new Error(yt.error||"Failed to process schedule");E(!1),h(yt.result),W("results"),n("results")}catch(qe){c(qe?.message||"Failed to process schedule"),n("entry")}finally{p.current?.(),p.current=null}},[W]),Te=(0,nt.useCallback)(async(K,Z,de=!0)=>{let Ue=K.trim();if(!Ue)return;o("schedule");let pe=new File([Ue],"pasted-schedule.txt",{type:"text/plain"});await Ve(pe,Z,de)},[Ve]),$=(0,nt.useCallback)(async K=>{o("schedule"),await Ve(K)},[Ve]);return(0,Aa.jsx)("div",{className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}${!e&&r==="processing"?" app-wrapper--loading":""}`,style:hi().theme,children:(0,Aa.jsxs)("main",{className:"main-content",children:[l&&(0,Aa.jsxs)("div",{className:"error-box",role:"alert",children:[(0,Aa.jsx)("strong",{children:"Error:"})," ",l]}),r==="entry"&&(0,Aa.jsx)(nd,{onPasteSchedule:Te,onUploadSchedule:$,onEntryModeChange:o}),r==="results"&&i==="schedule"&&m&&(0,Aa.jsx)(dd,{scheduleResult:m,onStartOver:Ge,cart:U,onAddToCart:d,onRemoveFromCart:u,onGoToBasket:we,cartSeeded:M,onCartSeeded:()=>R(!0),reviewGateComplete:w,onReviewGateComplete:()=>E(!0),internal:a}),r==="basket"&&(0,Aa.jsx)(el,{cart:U,onUpdateQty:g,onUpdateSellUnits:b,onRemove:u,onBack:Ce,internal:a})]})})}var cc=Y(Xe());var _i=Y(Xe()),re=Y(ie()),Wv=[{id:"ogee",label:"Ogee",blurb:"Traditional curved profile"},{id:"torus",label:"Torus",blurb:"Soft rounded detail"},{id:"ovolo",label:"Ovolo",blurb:"Traditional rounded profile"},{id:"pencil-round",label:"Pencil round",blurb:"Simple softened edge"},{id:"square-edge",label:"Square edge",blurb:"Clean contemporary edge"}],Ks=e=>Number.parseFloat(e)||0,ew=(e,t)=>Ks(e)*(t==="m"?1:.3048),fd=(e,t)=>Ks(e.quantity)*(2*ew(e.height,t)+ew(e.width,t)),p_=()=>({quantity:"1",width:"",height:""});function d_({profile:e}){return(0,re.jsxs)("svg",{className:"architrave-calculator__profile-diagram",viewBox:"0 0 112 76","aria-hidden":"true",children:[(0,re.jsx)("path",{d:{ogee:"M18 62 V38 C18 28 28 22 40 22 H78 C88 22 94 28 94 38 V62",torus:"M18 62 V40 C18 27 30 20 42 20 C54 20 58 30 66 30 C74 30 78 20 90 20 C102 20 94 34 94 40 V62",ovolo:"M18 62 V38 C18 28 30 20 42 20 H70 C82 20 94 28 94 38 V62","pencil-round":"M18 62 V38 C18 28 28 20 40 20 H72 C84 20 94 28 94 38 V62","square-edge":"M18 62 V20 H94 V62"}[e]}),(0,re.jsx)("line",{x1:"12",y1:"66",x2:"100",y2:"66"})]})}function gd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,_i.useState)("m"),[i,o]=(0,_i.useState)({quantity:"1",width:"0.76",height:"1.98"}),[l,c]=(0,_i.useState)({quantity:"0",width:"1.52",height:"1.98"}),[p,f]=(0,_i.useState)([]),[v,m]=(0,_i.useState)("ogee"),[h,w]=(0,_i.useState)("2.4"),E=(S,T,M)=>{S(R=>({...R,[T]:M}))},U=fd(i,r)+fd(l,r)+p.reduce((S,T)=>S+fd(T,r),0),d=Ks(h)>0?Math.ceil(U/Ks(h)):0,u=Wv.find(S=>S.id===v)?.label??"",g=[{key:`architrave-${v}`,label:`Architrave (${u})`,qty:U,unit:"m",query:`${u} architrave`,category:"architrave"}],b=(S,T,M,R)=>(0,re.jsxs)("div",{className:"architrave-calculator__opening-row",children:[(0,re.jsx)("span",{children:S}),(0,re.jsx)("input",{"aria-label":`${S} quantity`,type:"number",min:"0",step:"1",value:T.quantity,onChange:G=>M("quantity",G.target.value)}),(0,re.jsx)("input",{"aria-label":`${S} width`,type:"number",min:"0",step:"0.01",value:T.width,onChange:G=>M("width",G.target.value)}),(0,re.jsx)("input",{"aria-label":`${S} height`,type:"number",min:"0",step:"0.01",value:T.height,onChange:G=>M("height",G.target.value)}),R?(0,re.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:R,children:"Remove"}):null]});return(0,re.jsx)(re.Fragment,{children:(0,re.jsxs)("div",{className:"truss-estimator",children:[(0,re.jsxs)("div",{className:"quick-order-hero",children:[(0,re.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,re.jsx)("h1",{children:"Architrave Calculator"}),(0,re.jsx)("p",{children:"Estimate architrave lengths and board quantities for door openings."})]}),(0,re.jsxs)("div",{className:"truss-estimator__card architrave-calculator",children:[(0,re.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure your openings"}),(0,re.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter each door or window opening. Mitred corners are allowed for, and board lengths are worked out from the net run."}),(0,re.jsxs)("div",{className:"architrave-calculator__section",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Door openings"}),(0,re.jsx)("p",{className:"architrave-calculator__hint",children:"Each opening is calculated as two side pieces plus one head piece."}),(0,re.jsxs)("div",{className:"architrave-calculator__unit-row",children:[(0,re.jsx)("span",{children:"Units"}),(0,re.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,re.jsx)("button",{type:"button",className:r==="m"?"is-selected":"",onClick:()=>n("m"),children:"Metres"}),(0,re.jsx)("button",{type:"button",className:r==="ft"?"is-selected":"",onClick:()=>n("ft"),children:"Feet"})]})]}),(0,re.jsxs)("div",{className:"architrave-calculator__dimensions-header",children:[(0,re.jsx)("span",{children:"Opening"}),(0,re.jsx)("span",{children:"Qty"}),(0,re.jsxs)("span",{children:["Width (",r,")"]}),(0,re.jsxs)("span",{children:["Height (",r,")"]}),(0,re.jsx)("span",{})]}),b("Single doors",i,(S,T)=>E(o,S,T)),b("Double doors",l,(S,T)=>E(c,S,T)),p.map((S,T)=>b(`Alternative door ${T+1}`,S,(M,R)=>f(G=>G.map((W,we)=>we===T?{...W,[M]:R}:W)),()=>f(M=>M.filter((R,G)=>G!==T)))),(0,re.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>f(S=>[...S,p_()]),children:"+ Add alternative-sized door"})]}),(0,re.jsxs)("div",{className:"architrave-calculator__section",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Standard profile"}),(0,re.jsx)("p",{className:"architrave-calculator__hint",children:"Choose the profile you plan to use. Length calculations are the same for each profile."}),(0,re.jsx)("div",{className:"architrave-calculator__profiles",children:Wv.map(S=>(0,re.jsxs)("button",{type:"button",className:`truss-estimator__option-card${v===S.id?" is-selected":""}`,onClick:()=>m(S.id),children:[(0,re.jsx)(d_,{profile:S.id}),(0,re.jsx)("div",{className:"truss-estimator__option-title",children:S.label}),(0,re.jsx)("div",{className:"truss-estimator__option-copy",children:S.blurb})]},S.id))})]}),(0,re.jsxs)("div",{className:"architrave-calculator__section",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,re.jsx)("div",{className:"architrave-calculator__options",children:(0,re.jsxs)("label",{className:"truss-estimator__field",children:[(0,re.jsx)("span",{children:"Board length (m)"}),(0,re.jsx)("input",{value:"4.40 m",disabled:!0})]})}),(0,re.jsx)("p",{className:"architrave-calculator__hint",children:"Waste allows for mitred corners, cuts and damaged lengths."})]}),(0,re.jsxs)("div",{className:"architrave-calculator__totals",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,re.jsxs)("div",{className:"architrave-calculator__result-grid",children:[(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:"Architrave needed"}),(0,re.jsxs)("strong",{children:[U.toFixed(2)," m"]})]}),(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:"Board lengths"}),(0,re.jsx)("strong",{children:d})]})]})]}),(0,re.jsxs)("div",{className:"architrave-calculator__actions",children:[(0,re.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,re.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(g),disabled:U<=0,children:a})]})]})]})})}var xi=Y(Xe()),ue=Y(ie()),tw=60,aw=10,m_=.02,f_=.012,g_=.01,Mn=e=>Number.parseFloat(e)||0,h_=(e,t=2)=>e.toFixed(t);function hd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,xi.useState)("brick"),[i,o]=(0,xi.useState)("engineering-red"),[l,c]=(0,xi.useState)("metric"),[p,f]=(0,xi.useState)(""),[v,m]=(0,xi.useState)(""),[h,w]=(0,xi.useState)(!0),E=l==="metric"?Mn(p)*Mn(v):Mn(p)*Mn(v)*.092903,d=E*(r==="brick"?tw:aw),u=Math.ceil(d),g=E*(r==="brick"?m_:f_),b=Math.ceil(g/g_),S=l==="metric"?E:E*10.7639,T=[{key:r==="brick"?`brick-${i}`:"block",label:r==="brick"?{common:"Common concrete bricks","engineering-red":"Red engineering bricks","engineering-blue":"Blue engineering bricks"}[i]:"Blocks",qty:u,unit:"each",query:r==="brick"?"facing brick":"concrete block",category:"masonry"},...h?[{key:"mortar",label:"Blue Circle Quality Assured Mortar Mix 20kg",qty:b,unit:"bag",query:"ready mixed mortar",category:"mortar"}]:[]],M=R=>{if(R===l)return;let G=R==="imperial"?3.28084:.3048;f((Mn(p)*G).toFixed(2)),m((Mn(v)*G).toFixed(2)),c(R)};return(0,ue.jsx)(ue.Fragment,{children:(0,ue.jsxs)("div",{className:"truss-estimator",children:[(0,ue.jsxs)("div",{className:"quick-order-hero",children:[(0,ue.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ue.jsx)("h1",{children:"Brick & Block Calculator"}),(0,ue.jsx)("p",{children:"Estimate masonry units, sand and cement for a wall."})]}),(0,ue.jsxs)("div",{className:"truss-estimator__card brick-calculator",children:[(0,ue.jsx)("h2",{className:"truss-estimator__step-title",children:"Wall area and masonry type"}),(0,ue.jsx)("p",{className:"truss-estimator__step-sub",children:"Pick brick or block and enter the wall dimensions for unit counts plus ready-mixed mortar."}),(0,ue.jsxs)("div",{className:"brick-calculator__section",children:[(0,ue.jsx)("div",{className:"truss-estimator__section-heading",children:"Masonry type"}),(0,ue.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[["brick","Brick"],["block","Block"]].map(([R,G])=>(0,ue.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===R?" is-selected":""}`,onClick:()=>n(R),children:[(0,ue.jsx)("div",{className:"truss-estimator__option-title",children:G}),(0,ue.jsxs)("div",{className:"truss-estimator__option-copy",children:["Approx. ",R==="brick"?tw:aw," per m\xB2"]})]},R))})]}),r==="brick"&&(0,ue.jsxs)("div",{className:"brick-calculator__section",children:[(0,ue.jsx)("div",{className:"truss-estimator__section-heading",children:"Brick type"}),(0,ue.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:[["common","Common concrete","General-purpose grey concrete brick"],["engineering-red","Engineering red","Class B perforated, 65mm"],["engineering-blue","Engineering blue","Class B solid, 65mm"]].map(([R,G,W])=>(0,ue.jsxs)("button",{type:"button",className:`truss-estimator__option-card${i===R?" is-selected":""}`,onClick:()=>o(R),children:[(0,ue.jsx)("div",{className:"truss-estimator__option-title",children:G}),(0,ue.jsx)("div",{className:"truss-estimator__option-copy",children:W})]},R))})]}),(0,ue.jsxs)("div",{className:"brick-calculator__section",children:[(0,ue.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,ue.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,ue.jsx)("button",{type:"button",className:l==="metric"?"is-selected":"",onClick:()=>M("metric"),children:"Metric"}),(0,ue.jsx)("button",{type:"button",className:l==="imperial"?"is-selected":"",onClick:()=>M("imperial"),children:"Imperial"})]}),(0,ue.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ue.jsxs)("label",{className:"truss-estimator__field",children:[(0,ue.jsxs)("span",{children:["Height (",l==="metric"?"m":"ft",")"]}),(0,ue.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:R=>f(R.target.value)})]}),(0,ue.jsxs)("label",{className:"truss-estimator__field",children:[(0,ue.jsxs)("span",{children:["Width (",l==="metric"?"m":"ft",")"]}),(0,ue.jsx)("input",{type:"number",min:"0",step:"0.01",value:v,onChange:R=>m(R.target.value)})]})]})]}),(0,ue.jsx)("div",{className:"brick-calculator__options",children:(0,ue.jsxs)("label",{className:"brick-calculator__checkbox",children:[(0,ue.jsx)("input",{type:"checkbox",checked:h,onChange:R=>w(R.target.checked)}),(0,ue.jsx)("span",{children:"Include ready-mixed mortar"})]})}),(0,ue.jsxs)("div",{className:"brick-calculator__totals",children:[(0,ue.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ue.jsxs)("div",{className:"brick-calculator__result-grid",children:[(0,ue.jsxs)("div",{children:[(0,ue.jsx)("span",{children:"Wall area"}),(0,ue.jsxs)("strong",{children:[h_(S)," ",l==="metric"?"m\xB2":"ft\xB2"]})]}),(0,ue.jsxs)("div",{children:[(0,ue.jsx)("span",{children:r==="brick"?"Bricks":"Blocks"}),(0,ue.jsx)("strong",{children:u.toLocaleString("en-GB")})]}),h?(0,ue.jsxs)("div",{children:[(0,ue.jsx)("span",{children:"Ready-mixed mortar"}),(0,ue.jsxs)("strong",{children:[b," x 20kg bags"]})]}):null]}),(0,ue.jsx)("p",{className:"brick-calculator__note",children:"Estimate based on standard nominal sizes and 10mm joints. Mortar bags are approximate; confirm the required mortar specification before ordering."})]}),(0,ue.jsxs)("div",{className:"brick-calculator__actions",children:[(0,ue.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ue.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(T),disabled:E<=0,children:a})]})]})]})})}var mr=Y(Xe());var rw=new Map;function b_(e){return{product_id:e.product_id,description:e.description,source_list:e.source_list??null,price:e.price??null,list_price:e.list_price,discount:e.discount,price_basis:e.price_basis??null,uoi_count:e.uoi_count??null,uoi:e.uoi??null,pdp_photo_url:e.pdp_photo_url??null,conversion:e.conversion,measurements_mm:e.measurements_mm??e.attrs?.measurements_mm??[],scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"estimator_catalogue_search"}}async function Jr(e,t,a=12,r){let n=`${e}||${t??""}||${a}||${r??""}`,i=rw.get(n);if(i)return i;let o=new URLSearchParams({q:e,limit:String(a)});t&&o.set("category",t),r&&o.set("account",r);let l=await fetch(Bt(`/api/catalogue/search?${o.toString()}`),{headers:bi()}),c=await Vt(l);if(!l.ok)throw new Error(c?.error||c?.message||"Could not reach the product catalogue");let p=Array.isArray(c?.items)?c.items.map(b_):[];return rw.set(n,p),p}async function iw(e,t){return await Promise.all(e.map(async r=>{try{return{requirement:r,candidates:await Jr(r.query,r.category,void 0,t)}}catch{return{requirement:r,candidates:[]}}}))}async function nw(){let e=await fetch(Bt("/api/catalogue"),{headers:bi()});if(!e.ok)return{itemCount:0,uploadedAt:null};let t=await Vt(e);return{itemCount:Number(t?.itemCount)||0,uploadedAt:t?.uploadedAt??null}}var X=Y(ie()),v_=1.54,w_=1440,y_=25,bd=800,__=1500,vd=e=>Number.parseFloat(e)||0,Tn={mot:{label:"MOT Type 1",blurb:"Sub-base for patios and driveways",density:1.7,productId:"6001007"},"sharp-sand":{label:"Sharp sand",blurb:"Bedding and general groundwork",density:1.6,productId:"6001012"},gravel:{label:"20mm gravel",blurb:"Drainage and landscaping",density:1.6,productId:"6001004"}};function wd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let r=Vs(),[n,i]=(0,mr.useState)("m"),[o,l]=(0,mr.useState)(""),[c,p]=(0,mr.useState)(""),[f,v]=(0,mr.useState)(""),[m,h]=(0,mr.useState)("concrete"),[w,E]=(0,mr.useState)("mot"),[U,d]=(0,mr.useState)(!1),[u,g]=(0,mr.useState)(null),b=n==="m"?1:.3048,S=vd(o)*b*vd(c)*b*vd(f)*(n==="m"?.01:.0254),T=Tn[w],M=S*v_/7,R=M*w_,G=M*2,W=M*4,we=Math.ceil(R/y_),Ce=Math.ceil(G*Tn["sharp-sand"].density*1e3/bd),Ge=Math.ceil(W*Tn.gravel.density*1e3/bd),Ve=Math.ceil(S*T.density*1e3/bd),Te=m==="concrete"?[{key:"cement",label:"Blue Circle General Purpose Grey Cement 25kg",qty:we,productId:"6003004"},{key:"sharp-sand",label:"Sharp Sand Bulk Bag (800kg)",qty:Ce,productId:"6001012"},{key:"gravel",label:"20mm Non Decorative Pea Shingle/Gravel Bulk Bag (800kg)",qty:Ge,productId:"6001004"}]:[{key:w,label:`${T.label} Bulk Bag (800kg)`,qty:Ve,productId:T.productId}],$=()=>{if(t){t(Te.map(Z=>({key:Z.key,label:Z.label,qty:Z.qty,unit:"each",query:Z.productId})));return}K()},K=async()=>{let Z=Date.now();d(!0),g(null);try{let de=await Promise.all(Te.map(async pe=>{let qe=(await Jr(pe.productId)).find(De=>De.product_id===pe.productId);if(!qe)throw new Error(`${pe.label} is no longer available in this catalogue.`);return Zr(qe,{lineId:`concrete-aggregate:${pe.key}`,description:pe.label,unit:"bag",qty:pe.qty})})),Ue=__-(Date.now()-Z);Ue>0&&await new Promise(pe=>window.setTimeout(pe,Ue)),r?.clearCart(),r?.addManyToCart(de),r?.openBasket()}catch(de){g(de instanceof Error?de.message:"Could not add the products to your basket.")}finally{d(!1)}};return U?(0,X.jsx)(X.Fragment,{children:(0,X.jsxs)("div",{className:"truss-estimator",children:[(0,X.jsxs)("div",{className:"quick-order-hero",children:[(0,X.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,X.jsx)("h1",{children:"Your Materials"}),(0,X.jsx)("p",{children:"Calculating quantities from the Concrete & Aggregate Calculator."})]}),(0,X.jsx)("div",{className:"truss-estimator__card",children:(0,X.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{flex:1,justifyContent:"center"},children:[(0,X.jsx)(pr,{}),(0,X.jsx)("p",{className:"banter-message is-visible",children:"Preparing your materials\u2026"})]})})]})}):(0,X.jsx)(X.Fragment,{children:(0,X.jsxs)("div",{className:"truss-estimator",children:[(0,X.jsxs)("div",{className:"quick-order-hero",children:[(0,X.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,X.jsx)("h1",{children:"Concrete & Aggregate Calculator"}),(0,X.jsx)("p",{children:"Calculate fixed site-mix concrete ingredients or aggregate bulk bags."})]}),(0,X.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,X.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose what you need"}),(0,X.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter the area and depth. The calculator adds the fixed Materials Market products directly to your basket."}),(0,X.jsxs)("div",{className:"materials-calculator__section",children:[(0,X.jsx)("div",{className:"truss-estimator__section-heading",children:"Material type"}),(0,X.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,X.jsxs)("button",{type:"button",className:`truss-estimator__option-card${m==="concrete"?" is-selected":""}`,onClick:()=>h("concrete"),children:[(0,X.jsx)("div",{className:"truss-estimator__option-title",children:"Site-mixed concrete"}),(0,X.jsx)("div",{className:"truss-estimator__option-copy",children:"Cement, sharp sand and 20mm aggregate"})]}),(0,X.jsxs)("button",{type:"button",className:`truss-estimator__option-card${m==="aggregate"?" is-selected":""}`,onClick:()=>h("aggregate"),children:[(0,X.jsx)("div",{className:"truss-estimator__option-title",children:"Aggregates"}),(0,X.jsx)("div",{className:"truss-estimator__option-copy",children:"MOT Type 1, sharp sand or 20mm gravel"})]})]})]}),m==="aggregate"&&(0,X.jsxs)("div",{className:"materials-calculator__section",children:[(0,X.jsx)("div",{className:"truss-estimator__section-heading",children:"Aggregate type"}),(0,X.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.keys(Tn).map(Z=>(0,X.jsxs)("button",{type:"button",className:`truss-estimator__option-card${w===Z?" is-selected":""}`,onClick:()=>E(Z),children:[(0,X.jsx)("div",{className:"truss-estimator__option-title",children:Tn[Z].label}),(0,X.jsx)("div",{className:"truss-estimator__option-copy",children:Tn[Z].blurb})]},Z))})]}),(0,X.jsxs)("div",{className:"materials-calculator__section",children:[(0,X.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and depth"}),(0,X.jsxs)("div",{className:"materials-calculator__unit-row",children:[(0,X.jsx)("span",{children:"Units"}),(0,X.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,X.jsx)("button",{type:"button",className:n==="m"?"is-selected":"",onClick:()=>i("m"),children:"Metric"}),(0,X.jsx)("button",{type:"button",className:n==="ft"?"is-selected":"",onClick:()=>i("ft"),children:"Imperial"})]})]}),(0,X.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,X.jsxs)("label",{className:"truss-estimator__field",children:[(0,X.jsxs)("span",{children:["Length (",n,")"]}),(0,X.jsx)("input",{type:"number",min:"0",step:"0.01",value:o,onChange:Z=>l(Z.target.value)})]}),(0,X.jsxs)("label",{className:"truss-estimator__field",children:[(0,X.jsxs)("span",{children:["Width (",n,")"]}),(0,X.jsx)("input",{type:"number",min:"0",step:"0.01",value:c,onChange:Z=>p(Z.target.value)})]})]}),(0,X.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,X.jsxs)("span",{children:["Depth (",n==="m"?"cm":"inches",")"]}),(0,X.jsx)("input",{type:"number",min:"0",step:"0.1",value:f,onChange:Z=>v(Z.target.value)})]})]}),(0,X.jsxs)("div",{className:"materials-calculator__totals",children:[(0,X.jsx)("div",{className:"truss-estimator__section-heading",children:"Materials required"}),(0,X.jsx)("div",{className:"materials-calculator__result-grid",children:m==="concrete"?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)("div",{children:[(0,X.jsx)("span",{children:"Cement"}),(0,X.jsxs)("strong",{children:[R.toFixed(0)," kg"]})]}),(0,X.jsxs)("div",{children:[(0,X.jsx)("span",{children:"Sharp sand"}),(0,X.jsxs)("strong",{children:[G.toFixed(2)," m\xB3"]})]}),(0,X.jsxs)("div",{children:[(0,X.jsx)("span",{children:"20mm aggregate"}),(0,X.jsxs)("strong",{children:[W.toFixed(2)," m\xB3"]})]})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)("div",{children:[(0,X.jsx)("span",{children:T.label}),(0,X.jsxs)("strong",{children:[S.toFixed(2)," m\xB3"]})]}),(0,X.jsxs)("div",{children:[(0,X.jsx)("span",{children:"Approx. weight"}),(0,X.jsxs)("strong",{children:[(S*T.density).toFixed(2)," t"]})]}),(0,X.jsx)("div",{})]})}),(0,X.jsx)("p",{className:"materials-calculator__note",children:m==="concrete"?"Based on a 1:2:4 mix. Confirm the mix design for structural work.":"Figures are estimates. Confirm the specification and supplier quantities before ordering."})]}),u&&(0,X.jsx)("p",{className:"results-empty-hint estimator-products__error",children:u}),(0,X.jsxs)("div",{className:"materials-calculator__actions",children:[(0,X.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,X.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:$,disabled:S<=0||U,children:U?"Adding products\u2026":a})]})]})]})})}var Ya=Y(Xe());var z=Y(ie()),zn=12,An=8,Js=.56,ow=.21,Na={ranges:{meridian:{label:"Standard grooved timber",blurb:"32 \xD7 125mm pressure-treated softwood boards.",boardLengthM:3.6,boardWidthM:.125},summit:{label:"Wide grooved timber",blurb:"32 \xD7 150mm pressure-treated softwood boards.",boardLengthM:3.6,boardWidthM:.15}},boardGapM:.006,wastage:{straight:.05,diagonal:.15},pictureFrame:{extraWastage:.08},joist:{lengthM:2.4,spacingOptions:[{id:"300",label:"300mm centres (heavy duty)",spacingM:.3},{id:"400",label:"400mm centres (standard)",spacingM:.4},{id:"450",label:"450mm centres (light use)",spacingM:.45}]}},ki=["range","grid","pictureFrame","substructure"],x_={range:null,colour:null,deckSizeMode:"quick",quickLengthM:"",quickWidthM:"",points:[],isOutlineClosed:!1,wallSegments:new Set,drawMode:"outline",drawError:"",pictureFrame:null,direction:null,deckHeightMode:"standard",deckHeightCm:"",joistSpacing:null,supportType:null,contact:{name:"",email:""}},Ps=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),Fs=(e,t,a)=>a.x>=Math.min(e.x,t.x)&&a.x<=Math.max(e.x,t.x)&&a.y>=Math.min(e.y,t.y)&&a.y<=Math.max(e.y,t.y),k_=(e,t,a,r)=>{let n=Ps(e,t,a),i=Ps(e,t,r),o=Ps(a,r,e),l=Ps(a,r,t);return n===0&&Fs(e,t,a)||i===0&&Fs(e,t,r)||o===0&&Fs(a,r,e)||l===0&&Fs(a,r,t)?!0:n>0!=i>0&&o>0!=l>0},yd=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1){let n=e[(r+1)%e.length];for(let i=r+1;i<a;i+=1)if(!(i===r+1||t&&r===0&&i===a-1)&&k_(e[r],n,e[i],e[(i+1)%e.length]))return!0}return!1};function _d({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,Ya.useState)(0),[i,o]=(0,Ya.useState)(x_),[l,c]=(0,Ya.useState)(1),[p,f]=(0,Ya.useState)({x:0,y:0}),[v,m]=(0,Ya.useState)(null),h=(0,Ya.useRef)(null),w=(0,Ya.useRef)(null),E=(0,Ya.useRef)(null),U=ki[r],d=i.range?Na.ranges[i.range]:null,u=zn/l,g=An/l,b=(zn-u)/2,S=(An-g)/2,T=Math.max(-zn,Math.min(zn*2-u,b+p.x)),M=Math.max(-An,Math.min(An*2-g,S+p.y)),R=Number.parseFloat(i.quickLengthM),G=Number.parseFloat(i.quickWidthM),W=R>0&&G>0,we=k=>Math.abs(k.reduce((A,te,se)=>{let ye=k[(se+1)%k.length];return A+te.x*ye.y-ye.x*te.y},0))/2,Ce=(k,A)=>Math.hypot(A.x-k.x,A.y-k.y),Ge=i.isOutlineClosed?we(i.points):0,Ve=i.isOutlineClosed?i.points.reduce((k,A,te)=>k+Ce(A,i.points[(te+1)%i.points.length]),0):0,Te=i.isOutlineClosed?i.points.reduce((k,A,te)=>k+(i.wallSegments.has(te)?0:Ce(A,i.points[(te+1)%i.points.length])),0):0,$=i.points.reduce((k,A)=>({x:k.x+A.x/i.points.length,y:k.y+A.y/i.points.length}),{x:0,y:0}),K=i.points.length>1?(()=>{let k=i.points[0],A=i.points[1],te=Ce(k,A),se=te?-(A.y-k.y)/te:0,ye=te?(A.x-k.x)/te:0,st=(k.x+A.x)/2,xt=(k.y+A.y)/2,x=se*(st-$.x)+ye*(xt-$.y)>=0?1:-1;return{x:st+se*Js*x,y:xt+ye*Js*x}})():null,de=(()=>{let k=i.range?Na.ranges[i.range]:Na.ranges.meridian,A=i.deckSizeMode==="quick"?R*G:Ge,te=i.deckSizeMode==="quick"?2*(R+G):Te,se=i.direction==="diagonal"?Na.wastage.diagonal:Na.wastage.straight,ye=i.pictureFrame==="yes"?Na.pictureFrame.extraWastage:0,xt=A/(k.boardWidthM+Na.boardGapM)/k.boardLengthM,x=Math.ceil(xt*(1+se+ye)),H=Math.ceil(A*30*(1+se+ye)/200),B=Na.joist.spacingOptions.find(C=>C.id===i.joistSpacing)??Na.joist.spacingOptions[1],oe=A/B.spacingM,ae=Math.ceil(oe/Na.joist.lengthM);return{range:k,area:A,boardCount:x,screwBoxes:H,joistLengthsNeeded:ae,spacing:B}})(),Ue=de?[{key:`boards-${i.range??"meridian"}`,label:`Deck boards (${de.range.label})`,qty:de.boardCount,unit:"each",query:"timber decking board",category:"decking",calculatorWasteIncluded:!0},{key:"joists",label:"Treated C24 joists",qty:de.joistLengthsNeeded,unit:"each",query:"treated joist",category:"timber",calculatorWasteIncluded:!0},{key:"screws",label:"Green decking screws (200/box)",qty:de.screwBoxes,unit:"box",query:"green decking screws",category:"fixings",calculatorWasteIncluded:!0}]:[],pe=()=>U==="range"?!!i.range:U==="grid"?i.deckSizeMode==="quick"?W:i.isOutlineClosed&&Ge>0:U==="pictureFrame"?!!i.pictureFrame&&!!i.direction:U==="substructure"?!!i.joistSpacing:!0,qe=r===ki.length-1?a:"Next",De=(k,A,te=!1)=>{let se=E.current?.getBoundingClientRect();if(!se)return null;let ye=te?1:.25;return{x:Math.round(Math.max(T,Math.min(T+u,T+(k-se.left)/se.width*u))/ye)*ye,y:Math.round(Math.max(M,Math.min(M+g,M+(A-se.top)/se.height*g))/ye)*ye}},gt=k=>{if(i.isOutlineClosed){let te=k.target;if(te!==k.currentTarget&&!te.classList.contains("deck-outline__grid"))return;w.current={startX:k.clientX,startY:k.clientY,startViewX:T,startViewY:M},k.currentTarget.setPointerCapture(k.pointerId);return}if(i.drawMode!=="outline")return;let A=De(k.clientX,k.clientY,!0);A&&(m(null),o(te=>{let se=[...te.points,A];return yd(se,!1)?{...te,drawError:"Edges cannot cross. Choose another corner."}:{...te,points:se,drawError:""}}))},yt=(k,A)=>{if(!i.isOutlineClosed){k.stopPropagation(),A===0&&i.points.length>=3&&o(te=>({...te,isOutlineClosed:!0,drawMode:"edges"}));return}k.stopPropagation(),h.current=A,k.currentTarget.setPointerCapture(k.pointerId)},_t=k=>{if(w.current){let se=E.current?.getBoundingClientRect();if(!se)return;let ye=w.current,st=ye.startViewX-(k.clientX-ye.startX)/se.width*u,xt=ye.startViewY-(k.clientY-ye.startY)/se.height*g;f({x:st-b,y:xt-S});return}!i.isOutlineClosed&&i.drawMode==="outline"&&m(De(k.clientX,k.clientY,!0));let A=h.current;if(A===null)return;let te=De(k.clientX,k.clientY);te&&o(se=>{let ye=se.points.map((st,xt)=>xt===A?te:st);return yd(ye,!0)?{...se,drawError:"Edges cannot cross. Move the corner to a different position."}:{...se,points:ye,drawError:""}})},Ie=k=>{w.current=null,h.current=null,k.currentTarget.hasPointerCapture(k.pointerId)&&k.currentTarget.releasePointerCapture(k.pointerId)},Jt=k=>{o(A=>{let te=new Set(A.wallSegments);return te.has(k)?te.delete(k):te.add(k),{...A,wallSegments:te}})},j=()=>{r===0?e():n(k=>k-1)},J=()=>{pe()&&(r===ki.length-1?t?.(Ue):n(k=>k+1))};return(0,z.jsx)(z.Fragment,{children:(0,z.jsxs)("div",{className:"truss-estimator",children:[(0,z.jsxs)("div",{className:"quick-order-hero",children:[(0,z.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,z.jsx)("h1",{children:"Decking Calculator"}),(0,z.jsx)("p",{children:"Estimate timber boards, joists and screws for your deck."})]}),(0,z.jsxs)("div",{className:"truss-estimator__card",children:[(0,z.jsxs)("div",{className:"truss-estimator__body",children:[U==="range"?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",ki.length]}),(0,z.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your timber decking"}),(0,z.jsx)("p",{className:"truss-estimator__step-sub",children:"Both options are fixed, orderable pressure-treated timber boards."}),(0,z.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Na.ranges).map(([k,A])=>(0,z.jsxs)("button",{type:"button",className:`truss-estimator__option-card${i.range===k?" is-selected":""}`,onClick:()=>o(te=>({...te,range:k})),children:[(0,z.jsx)("div",{className:"truss-estimator__option-title",children:A.label}),(0,z.jsx)("div",{className:"truss-estimator__option-copy",children:A.blurb}),(0,z.jsxs)("div",{className:"truss-estimator__option-copy",children:[A.boardLengthM,"m boards"]})]},k))})]}):null,U==="grid"?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",ki.length]}),(0,z.jsx)("h2",{className:"truss-estimator__step-title",children:"Tell us your deck size"}),(0,z.jsx)("p",{className:"truss-estimator__step-sub",children:"Start with a quick rectangle estimate, or draw an irregular deck for a more precise result."}),(0,z.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,z.jsx)("button",{type:"button",className:`truss-estimator__toggle${i.deckSizeMode==="quick"?" is-selected":""}`,onClick:()=>o(k=>({...k,deckSizeMode:"quick"})),children:"Quick estimate"}),(0,z.jsx)("button",{type:"button",className:`truss-estimator__toggle${i.deckSizeMode==="draw"?" is-selected":""}`,onClick:()=>o(k=>({...k,deckSizeMode:"draw",drawMode:"outline"})),children:"Draw your space"})]}),i.deckSizeMode==="quick"?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,z.jsxs)("label",{className:"truss-estimator__field",children:[(0,z.jsx)("span",{children:"Length (m)"}),(0,z.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:i.quickLengthM,onChange:k=>o(A=>({...A,quickLengthM:k.target.value}))})]}),(0,z.jsxs)("label",{className:"truss-estimator__field",children:[(0,z.jsx)("span",{children:"Width (m)"}),(0,z.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:i.quickWidthM,onChange:k=>o(A=>({...A,quickWidthM:k.target.value}))})]})]}),(0,z.jsx)("div",{className:"truss-estimator__grid-hint",children:"For L-shaped decks, cut-outs, or sides against a wall, use Draw your space."}),W?(0,z.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,z.jsxs)("div",{children:[(R*G).toFixed(2)," m\xB2 deck"]}),(0,z.jsxs)("div",{children:[(2*(R+G)).toFixed(2)," m perimeter"]})]}):null]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)("div",{className:"truss-estimator__section-heading",children:"Draw your deck"}),(0,z.jsx)("p",{className:"truss-estimator__step-sub",children:"Click to add corners, then close the outline. Drag any handle to refine it."}),(0,z.jsxs)("div",{className:"deck-outline__toolbar",children:[i.isOutlineClosed?(0,z.jsxs)("div",{className:"deck-outline__summary",children:[(0,z.jsxs)("div",{children:[(0,z.jsx)("span",{children:"Deck area"}),(0,z.jsxs)("strong",{children:[Ge.toFixed(2)," m\xB2"]})]}),(0,z.jsxs)("div",{children:[(0,z.jsx)("span",{children:"Perimeter"}),(0,z.jsxs)("strong",{children:[Ve.toFixed(2)," m"]})]}),(0,z.jsxs)("div",{children:[(0,z.jsx)("span",{children:"Wall edges"}),(0,z.jsx)("strong",{children:i.wallSegments.size>0?i.wallSegments.size:"None"})]}),(0,z.jsxs)("div",{children:[(0,z.jsx)("span",{children:"Visible edge"}),(0,z.jsxs)("strong",{children:[Te.toFixed(2)," m"]})]})]}):null,(0,z.jsxs)("div",{className:"deck-outline__actions",children:[(0,z.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(k=>({...k,points:k.points.slice(0,-1)})),disabled:i.points.length===0||i.isOutlineClosed,children:"Undo"}),(0,z.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{m(null),o(k=>({...k,points:[],isOutlineClosed:!1,wallSegments:new Set,drawMode:"outline",drawError:""}))},disabled:i.points.length===0,children:"Clear"}),(0,z.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(k=>({...k,points:[{x:2,y:2},{x:8,y:2},{x:8,y:5},{x:2,y:5}],isOutlineClosed:!0,wallSegments:new Set,drawMode:"edges",drawError:""})),children:"Start with rectangle"})]})]}),(0,z.jsx)("div",{className:"deck-editor-layout",children:(0,z.jsxs)("div",{className:"deck-editor-layout__canvas-column",children:[(0,z.jsxs)("div",{className:"deck-outline",children:[(0,z.jsxs)("svg",{ref:E,className:`deck-outline__canvas${i.isOutlineClosed?" is-pan-mode":""}`,viewBox:`${T} ${M} ${u} ${g}`,preserveAspectRatio:"none","aria-label":"Deck outline drawing area",onPointerDown:gt,onPointerMove:_t,onPointerUp:Ie,onPointerLeave:()=>{m(null),w.current||(h.current=null)},children:[(0,z.jsx)("defs",{children:(0,z.jsx)("pattern",{id:"deck-outline-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,z.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,z.jsx)("rect",{x:-zn,y:-An,width:zn*3,height:An*3,className:"deck-outline__grid",fill:"url(#deck-outline-grid)"}),i.points.length>1?(0,z.jsx)("polyline",{className:"deck-outline__preview",points:i.points.map(k=>`${k.x},${k.y}`).join(" ")}):null,i.isOutlineClosed?(0,z.jsx)("polygon",{className:"deck-outline__shape",points:i.points.map(k=>`${k.x},${k.y}`).join(" "),stroke:"none"}):null,i.points.length>1?i.points.slice(0,i.isOutlineClosed?void 0:-1).map((k,A)=>{let te=i.points[i.isOutlineClosed?(A+1)%i.points.length:A+1],se=Ce(k,te),ye=se?-(te.y-k.y)/se:0,st=se?(te.x-k.x)/se:0,xt=(k.x+te.x)/2,x=(k.y+te.y)/2,H=ye*(xt-$.x)+st*(x-$.y)>=0?1:-1,B=xt+ye*Js*H,oe=x+st*Js*H;return(0,z.jsxs)("g",{children:[(0,z.jsx)("line",{className:"deck-outline__edge-hit",x1:k.x,y1:k.y,x2:te.x,y2:te.y,onClick:i.isOutlineClosed?()=>Jt(A):void 0}),(0,z.jsx)("line",{className:`deck-outline__edge${i.wallSegments.has(A)?" is-wall":""}`,x1:k.x,y1:k.y,x2:te.x,y2:te.y,pointerEvents:"none"}),(0,z.jsxs)("text",{className:`deck-outline__edge-label${i.wallSegments.has(A)?" is-wall":""}`,x:B,y:oe,textAnchor:"middle",dominantBaseline:"central",fontSize:ow/l,children:[se.toFixed(2)," m"]})]},`segment-${A}`)}):null,!i.isOutlineClosed&&i.points.length>0&&v?(()=>{let k=i.points[i.points.length-1],A=Ce(k,v);if(!A)return null;let te=-(v.y-k.y)/A,se=(v.x-k.x)/A,ye=(k.x+v.x)/2,st=(k.y+v.y)/2;return(0,z.jsxs)("g",{className:"deck-outline__live-measurement",children:[(0,z.jsx)("line",{x1:k.x,y1:k.y,x2:v.x,y2:v.y}),(0,z.jsxs)("text",{x:ye+te*.34,y:st+se*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:ow/l,children:[A.toFixed(2)," m"]})]})})():null,i.points.map((k,A)=>(0,z.jsx)("circle",{className:"deck-outline__point",cx:k.x,cy:k.y,r:"0.13",onPointerDown:te=>yt(te,A)},`point-${A}`))]}),(0,z.jsxs)("div",{className:"deck-outline__zoom","aria-label":"Zoom controls",children:[(0,z.jsx)("button",{type:"button",onClick:()=>c(k=>Math.max(.5,k-.25)),disabled:l===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,z.jsxs)("span",{children:[Math.round(l*100),"%"]}),(0,z.jsx)("button",{type:"button",onClick:()=>c(k=>Math.min(1,k+.25)),disabled:l===1,"aria-label":"Zoom in",children:"+"})]}),i.isOutlineClosed&&i.wallSegments.size===0&&K?(0,z.jsx)("div",{className:"deck-outline__edge-prompt",role:"status",style:{left:`${(K.x-T)/u*100}%`,top:`${(K.y-M)/g*100}%`},children:"Tap an edge to mark it as a wall, or leave it as a visible edge."}):null,!i.isOutlineClosed&&i.points.length>=3?(0,z.jsx)("button",{type:"button",className:"deck-outline__close",onClick:()=>o(k=>yd(k.points,!0)?{...k,drawError:"Edges cannot cross. Adjust the outline before finishing."}:{...k,isOutlineClosed:!0,drawMode:"edges",drawError:""}),children:"Finish outline"}):null]}),(0,z.jsxs)("div",{className:"deck-outline__supporting",children:[(0,z.jsx)("div",{className:"truss-estimator__grid-hint",children:i.isOutlineClosed?"Drag a corner handle to refine the outline.":"Add at least three corners, then click Finish outline."}),i.drawError?(0,z.jsx)("div",{className:"deck-outline__error",role:"alert",children:i.drawError}):null]})]})})]})]}):null,U==="pictureFrame"?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",ki.length]}),(0,z.jsx)("h2",{className:"truss-estimator__step-title",children:"Picture frame border?"}),(0,z.jsx)("p",{className:"truss-estimator__step-sub",children:"A picture frame border runs boards around the perimeter for a finished look and uses extra material."}),(0,z.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No border",img:"/decking/boards/no-border.webp"},{id:"yes",label:"Picture frame",img:"/decking/boards/picture-frame.webp"}].map(k=>(0,z.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${i.pictureFrame===k.id?" is-selected":""}`,onClick:()=>o(A=>({...A,pictureFrame:k.id})),children:[(0,z.jsx)("img",{className:"truss-estimator__visual-card-img",src:Zt(k.img),alt:""}),(0,z.jsx)("span",{children:k.label})]},k.id))}),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)("div",{className:"truss-estimator__section-heading",children:"Board direction"}),(0,z.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"straight",label:"Straight",img:"/decking/boards/straight.webp"},{id:"diagonal",label:"Diagonal",img:"/decking/boards/diagonal.webp"}].map(k=>(0,z.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${i.direction===k.id?" is-selected":""}`,onClick:()=>o(A=>({...A,direction:k.id})),children:[(0,z.jsx)("img",{className:"truss-estimator__visual-card-img",src:Zt(k.img),alt:""}),(0,z.jsx)("span",{children:k.label})]},k.id))})]})]}):null,U==="substructure"?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",ki.length]}),(0,z.jsx)("h2",{className:"truss-estimator__step-title",children:"Substructure"}),(0,z.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the joist spacing. Posts, footings and ground preparation vary by site, so are not included."}),(0,z.jsx)("div",{className:"truss-estimator__section-heading",children:"Joist spacing"}),(0,z.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Na.joist.spacingOptions.map(k=>(0,z.jsx)("button",{type:"button",className:`truss-estimator__option-card${i.joistSpacing===k.id?" is-selected":""}`,onClick:()=>o(A=>({...A,joistSpacing:k.id})),children:(0,z.jsx)("div",{className:"truss-estimator__option-title",children:k.label})},k.id))})]}):null]}),(0,z.jsxs)("div",{className:"truss-estimator__nav",children:[(0,z.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:j,children:"Back"}),(0,z.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:J,disabled:!pe(),children:[(0,z.jsx)("span",{children:qe}),(0,z.jsx)("span",{className:"arrow",children:(0,z.jsx)(Ot,{})})]})]})]})]})})}var Ca=Y(Xe());var L=Y(ie()),lw=12,sw=30,Rn=12,Un=8,cw=.56,Sa={ranges:{boundary:{label:"Horizontal lap",blurb:"Traditional pressure-treated timber panels.",panelWidthM:1.83},skyline:{label:"Feather edge",blurb:"Heavier timber panels for a more solid boundary.",panelWidthM:1.83}},heights:["0.9","1.2","1.5","1.8"],gate:{single:{label:"Single lap gate",widthDefault:.9}},mounting:{concrete:{label:"Concrete posts",blurb:"Slotted concrete posts with matching panels."},postcrete:{label:"Postcrete bags",blurb:"Fast-set post-mix bags in a dug hole.",bagsPerPost:2}}},Ni=["range","height","gate","posts"],N_={range:null,colour:null,grid:new Set,excludedEdges:new Set,gridMode:"draw",boundaryMode:"quick",quickLengthM:"",boundaryPoints:[],boundaryClosed:!1,excludedBoundaryEdges:new Set,height:null,gravelBoard:null,gateType:null,gateWidthM:"",mountingType:null,contact:{name:"",email:""}},Is=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),Ws=(e,t,a)=>a.x>=Math.min(e.x,t.x)&&a.x<=Math.max(e.x,t.x)&&a.y>=Math.min(e.y,t.y)&&a.y<=Math.max(e.y,t.y),S_=(e,t,a,r)=>{let n=Is(e,t,a),i=Is(e,t,r),o=Is(a,r,e),l=Is(a,r,t);return n===0&&Ws(e,t,a)||i===0&&Ws(e,t,r)||o===0&&Ws(a,r,e)||l===0&&Ws(a,r,t)?!0:n>0!=i>0&&o>0!=l>0},ec=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1)for(let n=r+1;n<a;n+=1)if(!(n===r+1||t&&r===0&&n===a-1)&&S_(e[r],e[(r+1)%e.length],e[n],e[(n+1)%e.length]))return!0;return!1};function xd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,Ca.useState)(0),[i,o]=(0,Ca.useState)(N_),l=(0,Ca.useRef)(null),c=(0,Ca.useRef)(null),[p,f]=(0,Ca.useState)(1),[v,m]=(0,Ca.useState)({x:0,y:0}),[h,w]=(0,Ca.useState)(null),E=(0,Ca.useRef)(null),U=(0,Ca.useRef)(null),d=(0,Ca.useRef)(null),u=Ni[r],g=i.range?Sa.ranges[i.range]:null,b=Rn/p,S=Un/p,T=(Rn-b)/2,M=(Un-S)/2,R=Math.max(-Rn,Math.min(Rn*2-b,T+v.x)),G=Math.max(-Un,Math.min(Un*2-S,M+v.y)),W=i.boundaryPoints.reduce((x,H)=>({x:x.x+H.x/Math.max(1,i.boundaryPoints.length),y:x.y+H.y/Math.max(1,i.boundaryPoints.length)}),{x:0,y:0}),we=x=>{let H=new Set,B=[];return x.forEach(oe=>{let[ae,C]=oe.split(",").map(Number),Q=[{key:`H,${ae},${C}`,type:"H",x:ae,y:C},{key:`H,${ae},${C+1}`,type:"H",x:ae,y:C+1},{key:`V,${ae},${C}`,type:"V",x:ae,y:C},{key:`V,${ae+1},${C}`,type:"V",x:ae+1,y:C}],P=[!x.has(`${ae},${C-1}`),!x.has(`${ae},${C+1}`),!x.has(`${ae-1},${C}`),!x.has(`${ae+1},${C}`)];Q.forEach((fe,_e)=>{P[_e]&&!H.has(fe.key)&&(H.add(fe.key),B.push(fe))})}),B},Ce=(x,H)=>we(x).filter(B=>!H.has(B.key)),Ge=(x,H)=>Ce(x,H).length,Ve=(x,H)=>{let B={};Ce(x,H).forEach(ae=>{var C,Q,P,fe;ae.type==="H"?((B[C=`${ae.x},${ae.y}`]||(B[C]=[])).push("H"),(B[Q=`${ae.x+1},${ae.y}`]||(B[Q]=[])).push("H")):((B[P=`${ae.x},${ae.y}`]||(B[P]=[])).push("V"),(B[fe=`${ae.x},${ae.y+1}`]||(B[fe]=[])).push("V"))});let oe=0;return Object.values(B).forEach(ae=>{(ae.length===1||ae.length===2&&ae[0]!==ae[1]||ae.length>=3)&&(oe+=1)}),oe},$=(()=>{let x=i.range?Sa.ranges[i.range]:Sa.ranges.boundary,H=i.height??"1.8",B=i.boundaryMode==="quick"?Math.max(0,Number.parseFloat(i.quickLengthM)||0):i.boundaryClosed?i.boundaryPoints.slice(0,-1).reduce((Pt,gr,Xa)=>Pt+(i.excludedBoundaryEdges.has(Xa)?0:Math.hypot(i.boundaryPoints[Xa+1].x-gr.x,i.boundaryPoints[Xa+1].y-gr.y)),0):0,oe=i.gateType&&i.gateType!=="none"?Number.parseFloat(i.gateWidthM)||Sa.gate[i.gateType].widthDefault:0,ae=Math.max(0,B-oe),C=ae>0?Math.ceil(ae/x.panelWidthM):0,Q=i.boundaryPoints.length>2&&i.boundaryPoints[0].x===i.boundaryPoints[i.boundaryPoints.length-1].x&&i.boundaryPoints[0].y===i.boundaryPoints[i.boundaryPoints.length-1].y,P=i.boundaryMode==="quick"?ae>0?2:0:i.boundaryClosed?i.boundaryPoints.slice(0,Q?-1:void 0).reduce((Pt,gr,Xa)=>{let Hd=Xa>0&&!i.excludedBoundaryEdges.has(Xa-1),Ln=Xa<i.boundaryPoints.length-1&&!i.excludedBoundaryEdges.has(Xa);return Pt+(Hd||Ln?1:0)},0):0,fe=ae>0?Math.ceil(ae/x.panelWidthM)+1:0,_e=Math.max(0,fe-P),Ze=i.mountingType?Sa.mounting[i.mountingType]:Sa.mounting.concrete,ht=i.gateType&&i.gateType!=="none"?2:0,ca=_e+P+ht,il=i.mountingType==="postcrete"?ca*Sa.mounting.postcrete.bagsPerPost:0,ua=i.gravelBoard==="yes"?C:0;return{range:x,height:H,totalEdgeM:B,fencedLengthM:ae,gateWidthM:oe,panelsCount:C,cornerPostCount:P,intermediatePostCount:_e,gatePostCount:ht,totalPostCount:ca,bagsCount:il,gravelCount:ua,capCount:ca,mounting:Ze}})(),K=i.gateType&&i.gateType!=="none"?Sa.gate[i.gateType].label:null,Z=Number($.height)<=1.2?"6":"8",de=$?[{key:`panels-${i.range??"boundary"}-${$.height}`,label:`${$.range.label} panels (${$.height}m)`,qty:$.panelsCount,unit:"each",query:"fence panel",category:"fencing"},...i.mountingType==="concrete"?[{key:`concrete-intermediate-${Z}`,label:"Intermediate concrete posts",qty:$.intermediatePostCount,unit:"each",query:"concrete fence post",category:"fencing"},{key:`concrete-end-${Z}`,label:"End and corner concrete posts",qty:$.cornerPostCount+$.gatePostCount,unit:"each",query:"concrete end post",category:"fencing"}]:[{key:`timber-post-${Z}`,label:"Timber fence posts",qty:$.totalPostCount,unit:"each",query:"timber fence post",category:"fencing"},{key:"postcrete",label:"Postcrete",qty:$.bagsCount,unit:"bag",query:"postcrete",category:"cement"}],...K?[{key:"gate",label:K,qty:1,unit:"each",query:"lap gate",category:"fencing"}]:[],...$.gravelCount>0?[{key:"gravel-boards",label:"Concrete gravel boards",qty:$.gravelCount,unit:"each",query:"gravel board",category:"fencing"}]:[]]:[],Ue=()=>{if(u==="range"){let x=i.boundaryMode==="quick"?(Number.parseFloat(i.quickLengthM)||0)>0:i.boundaryClosed&&i.boundaryPoints.length>=2;return!!i.range&&x}return u==="height"?!!i.height&&!!i.gravelBoard:u==="gate"?!!i.gateType&&(i.gateType==="none"||i.gateWidthM.trim()!==""):u==="posts"?!!i.mountingType:!0},pe=r===Ni.length-1?a:"Next",qe=x=>{o(H=>{let B=x(new Set(H.grid)),oe=new Set([...H.excludedEdges].filter(ae=>we(B).some(C=>C.key===ae)));return{...H,grid:B,excludedEdges:oe}})},De=(x,H,B)=>{qe(oe=>{let ae=`${x},${H}`;return B?oe.add(ae):oe.delete(ae),oe})},gt=(x,H,B,oe,ae)=>{let C=x,Q=H,P=Math.abs(B-x),fe=x<B?1:-1,_e=-Math.abs(oe-H),Ze=H<oe?1:-1,ht=P+_e;for(;De(C,Q,ae),!(C===B&&Q===oe);){let ca=2*ht;ca>=_e&&(ht+=_e,C+=fe),ca<=P&&(ht+=P,Q+=Ze)}},yt=(x,H)=>{let B=c.current?.getBoundingClientRect();if(!B)return null;let oe=Math.floor((x-B.left)/sw),ae=Math.floor((H-B.top)/sw);return oe<0||ae<0||oe>=lw||ae>=lw?null:{x:oe,y:ae}},_t=x=>{if(i.gridMode!=="draw")return;let H=yt(x.clientX,x.clientY);if(!H)return;x.preventDefault();let B=`${H.x},${H.y}`,oe=!i.grid.has(B);l.current={active:!0,paintValue:oe,lastX:H.x,lastY:H.y},x.currentTarget.setPointerCapture(x.pointerId),De(H.x,H.y,oe)},Ie=x=>{let H=l.current;if(!H?.active)return;let B=yt(x.clientX,x.clientY);B&&(B.x===H.lastX&&B.y===H.lastY||(gt(H.lastX,H.lastY,B.x,B.y,H.paintValue),l.current={...H,lastX:B.x,lastY:B.y}))},Jt=x=>{l.current?.active&&(l.current=null,x.currentTarget.releasePointerCapture(x.pointerId))},j=(x,H,B=!1)=>{let oe=d.current?.getBoundingClientRect();if(!oe)return null;let ae=B?1:.25;return{x:Math.round(Math.max(R,Math.min(R+b,R+(x-oe.left)/oe.width*b))/ae)*ae,y:Math.round(Math.max(G,Math.min(G+S,G+(H-oe.top)/oe.height*S))/ae)*ae}},J=x=>{if(i.boundaryClosed){let B=x.target;if(B!==x.currentTarget&&!B.classList.contains("fence-boundary__grid"))return;U.current={startX:x.clientX,startY:x.clientY,startViewX:R,startViewY:G},x.currentTarget.setPointerCapture(x.pointerId);return}let H=j(x.clientX,x.clientY,!0);H&&(w(null),o(B=>{let oe=[...B.boundaryPoints,H];return ec(oe,!1)?{...B}:{...B,boundaryPoints:oe}}))},k=(x,H)=>{if(x.stopPropagation(),!i.boundaryClosed){if(H!==0||i.boundaryPoints.length<3)return;o(B=>ec(B.boundaryPoints,!0)?B:{...B,boundaryPoints:[...B.boundaryPoints,B.boundaryPoints[0]],boundaryClosed:!0});return}E.current=H,x.currentTarget.setPointerCapture(x.pointerId)},A=x=>{if(U.current){let B=d.current?.getBoundingClientRect();if(!B)return;let oe=U.current,ae=oe.startViewX-(x.clientX-oe.startX)/B.width*b,C=oe.startViewY-(x.clientY-oe.startY)/B.height*S;m({x:ae-T,y:C-M});return}if(i.boundaryClosed||w(j(x.clientX,x.clientY,!0)),E.current===null)return;let H=j(x.clientX,x.clientY);H&&o(B=>{let oe=B.boundaryPoints.length>2&&B.boundaryPoints[0].x===B.boundaryPoints[B.boundaryPoints.length-1].x&&B.boundaryPoints[0].y===B.boundaryPoints[B.boundaryPoints.length-1].y,ae=B.boundaryPoints.map((C,Q)=>{let P=Q===E.current,fe=oe&&E.current===0&&Q===B.boundaryPoints.length-1;return P||fe?H:C});return ec(ae,!1)?B:{...B,boundaryPoints:ae}})},te=x=>{U.current=null,E.current=null,x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId)},se=x=>{o(H=>{let B=new Set(H.excludedBoundaryEdges);return B.has(x)?B.delete(x):B.add(x),{...H,excludedBoundaryEdges:B}})},ye=()=>{r===0?e():n(x=>x-1)},st=()=>{Ue()&&(r===Ni.length-1?t?.(de):n(x=>x+1))},xt=we(i.grid);return(0,L.jsx)(L.Fragment,{children:(0,L.jsxs)("div",{className:"truss-estimator",children:[(0,L.jsxs)("div",{className:"quick-order-hero",children:[(0,L.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,L.jsx)("h1",{children:"Fencing Calculator"}),(0,L.jsx)("p",{children:"Estimate panels, posts and cost for your fence line in a few steps."})]}),(0,L.jsxs)("div",{className:"truss-estimator__card",children:[(0,L.jsxs)("div",{className:"truss-estimator__body",children:[u==="range"?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,L.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your fence panels"}),(0,L.jsx)("p",{className:"truss-estimator__step-sub",children:"The calculator uses fixed, orderable timber panels from the catalogue."}),(0,L.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Sa.ranges).map(([x,H])=>(0,L.jsxs)("button",{type:"button",className:`truss-estimator__option-card${i.range===x?" is-selected":""}`,onClick:()=>o(B=>({...B,range:x})),children:[(0,L.jsx)("div",{className:"truss-estimator__option-title",children:H.label}),(0,L.jsx)("div",{className:"truss-estimator__option-copy",children:H.blurb})]},x))})]}):null,u==="range"?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("div",{className:"truss-estimator__section-heading",children:"Measure your fence line"}),(0,L.jsx)("p",{className:"truss-estimator__step-sub",children:"Use a quick total, or draw the boundary to mark existing edges that do not need new fencing."}),(0,L.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,L.jsx)("button",{type:"button",className:`truss-estimator__toggle${i.boundaryMode==="quick"?" is-selected":""}`,onClick:()=>o(x=>({...x,boundaryMode:"quick"})),children:"Quick estimate"}),(0,L.jsx)("button",{type:"button",className:`truss-estimator__toggle${i.boundaryMode==="draw"?" is-selected":""}`,onClick:()=>o(x=>({...x,boundaryMode:"draw"})),children:"Draw your boundary"})]}),i.boundaryMode==="quick"?(0,L.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact fence-boundary__quick-field",children:[(0,L.jsx)("span",{children:"Total fence length (m)"}),(0,L.jsx)("input",{type:"number",min:"0",step:"0.1",value:i.quickLengthM,onChange:x=>o(H=>({...H,quickLengthM:x.target.value}))})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("div",{className:"fence-boundary__toolbar",children:(0,L.jsxs)("div",{className:"fence-boundary__actions",children:[(0,L.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(x=>({...x,boundaryPoints:x.boundaryPoints.slice(0,-1),boundaryClosed:!1,excludedBoundaryEdges:new Set})),disabled:i.boundaryPoints.length===0||i.boundaryClosed,children:"Undo"}),(0,L.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{m({x:0,y:0}),w(null),o(x=>({...x,boundaryPoints:[],boundaryClosed:!1,excludedBoundaryEdges:new Set}))},disabled:i.boundaryPoints.length===0,children:"Clear"}),(0,L.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(x=>({...x,boundaryPoints:[{x:2,y:2},{x:8,y:2},{x:8,y:5},{x:2,y:5},{x:2,y:2}],boundaryClosed:!0,excludedBoundaryEdges:new Set})),children:"Start with rectangle"})]})}),(0,L.jsxs)("div",{className:"fence-boundary",children:[(0,L.jsxs)("svg",{ref:d,className:`fence-boundary__canvas${i.boundaryClosed?" is-pan-mode":""}`,viewBox:`${R} ${G} ${b} ${S}`,preserveAspectRatio:"none","aria-label":"Fence boundary drawing area",onPointerDown:J,onPointerMove:A,onPointerUp:te,onPointerLeave:()=>{w(null),U.current||(E.current=null)},children:[(0,L.jsx)("defs",{children:(0,L.jsx)("pattern",{id:"fence-boundary-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,L.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,L.jsx)("rect",{x:-Rn,y:-Un,width:Rn*3,height:Un*3,className:"fence-boundary__grid",fill:"url(#fence-boundary-grid)"}),i.boundaryPoints.length>1?(0,L.jsx)("polyline",{className:"fence-boundary__preview",points:i.boundaryPoints.map(x=>`${x.x},${x.y}`).join(" ")}):null,i.boundaryPoints.length>1?i.boundaryPoints.slice(0,-1).map((x,H)=>{let B=i.boundaryPoints[H+1],oe=Math.hypot(B.x-x.x,B.y-x.y),ae=oe?-(B.y-x.y)/oe:0,C=oe?(B.x-x.x)/oe:0,Q=(x.x+B.x)/2,P=(x.y+B.y)/2,fe=ae*(Q-W.x)+C*(P-W.y)>=0?1:-1,_e=Q+ae*cw*fe,Ze=P+C*cw*fe;return(0,L.jsxs)("g",{children:[(0,L.jsx)("line",{className:"fence-boundary__edge-hit",x1:x.x,y1:x.y,x2:B.x,y2:B.y,onClick:i.boundaryClosed?()=>se(H):void 0}),(0,L.jsx)("line",{className:`fence-boundary__edge${i.excludedBoundaryEdges.has(H)?" is-excluded":""}`,x1:x.x,y1:x.y,x2:B.x,y2:B.y,pointerEvents:"none"}),(0,L.jsxs)("text",{className:`fence-boundary__edge-label${i.excludedBoundaryEdges.has(H)?" is-excluded":""}`,x:_e,y:Ze,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[oe.toFixed(2)," m"]})]},`fence-edge-${H}`)}):null,!i.boundaryClosed&&i.boundaryPoints.length>0&&h?(()=>{let x=i.boundaryPoints[i.boundaryPoints.length-1],H=Math.hypot(h.x-x.x,h.y-x.y);if(!H)return null;let B=-(h.y-x.y)/H,oe=(h.x-x.x)/H,ae=(x.x+h.x)/2,C=(x.y+h.y)/2;return(0,L.jsxs)("g",{className:"fence-boundary__live-measurement",children:[(0,L.jsx)("line",{x1:x.x,y1:x.y,x2:h.x,y2:h.y}),(0,L.jsxs)("text",{x:ae+B*.34,y:C+oe*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[H.toFixed(2)," m"]})]})})():null,i.boundaryPoints.map((x,H)=>H>0&&H===i.boundaryPoints.length-1&&x.x===i.boundaryPoints[0]?.x&&x.y===i.boundaryPoints[0]?.y?null:(0,L.jsx)("circle",{className:`fence-boundary__point${!i.boundaryClosed&&H===0&&i.boundaryPoints.length>=3?" is-close-target":""}`,cx:x.x,cy:x.y,r:"0.13",onPointerDown:B=>k(B,H)},`fence-point-${H}`))]}),(0,L.jsxs)("div",{className:"fence-boundary__zoom","aria-label":"Zoom controls",children:[(0,L.jsx)("button",{type:"button",onClick:()=>f(x=>Math.max(.5,x-.25)),disabled:p===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,L.jsxs)("span",{children:[Math.round(p*100),"%"]}),(0,L.jsx)("button",{type:"button",onClick:()=>f(x=>Math.min(1,x+.25)),disabled:p===1,"aria-label":"Zoom in",children:"+"})]}),!i.boundaryClosed&&i.boundaryPoints.length>=2?(0,L.jsx)("button",{type:"button",className:"fence-boundary__close",onClick:()=>o(x=>ec(x.boundaryPoints,!1)?x:{...x,boundaryClosed:!0}),children:"Finish fence line"}):null]}),(0,L.jsx)("div",{className:"truss-estimator__grid-hint",children:i.boundaryClosed?"Drag the blank canvas to pan. Tap an edge to exclude it from the new fence.":"Click to add points, then finish the fence line. The displayed distances update as you draw."})]}),(0,L.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,L.jsx)("div",{children:i.boundaryMode==="quick"?`${(Number.parseFloat(i.quickLengthM)||0).toFixed(2)} m fence line`:`${$.totalEdgeM.toFixed(2)} m fence line`}),i.boundaryMode==="draw"&&i.boundaryClosed?(0,L.jsxs)("div",{children:[$.cornerPostCount," corner/end posts"]}):null]})]}):null,null,u==="height"?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,L.jsx)("h2",{className:"truss-estimator__step-title",children:"Fence height"}),(0,L.jsx)("p",{className:"truss-estimator__step-sub",children:"Select the nearest available panel height."}),(0,L.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:Sa.heights.map(x=>(0,L.jsx)("button",{type:"button",className:`truss-estimator__visual-card${i.height===x?" is-selected":""}`,onClick:()=>o(H=>({...H,height:x})),children:(0,L.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--tall",src:Zt(`/fencing/height/${x}.webp`),alt:""})},x))}),(0,L.jsx)("div",{className:"truss-estimator__section-heading",children:"Gravel board?"}),(0,L.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No gravel board",img:"/fencing/no-gravel-board.webp"},{id:"yes",label:"Add gravel board",img:"/fencing/gravel-board.webp"}].map(x=>(0,L.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${i.gravelBoard===x.id?" is-selected":""}`,onClick:()=>o(H=>({...H,gravelBoard:x.id})),children:[(0,L.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:Zt(x.img),alt:""}),(0,L.jsx)("span",{children:x.label})]},x.id))})]}):null,u==="gate"?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,L.jsx)("h2",{className:"truss-estimator__step-title",children:"Do you need a gate?"}),(0,L.jsx)("p",{className:"truss-estimator__step-sub",children:"A gate opening replaces part of the panel run and adds a gate kit with heavy-duty posts."}),(0,L.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"none",label:"No gate",img:"/fencing/gates/no-gate.webp"},{id:"single",label:"Single gate",img:"/fencing/gates/single-gate.webp"}].map(x=>(0,L.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${i.gateType===x.id?" is-selected":""}`,onClick:()=>o(H=>({...H,gateType:x.id,gateWidthM:x.id==="none"?"":String(Sa.gate[x.id].widthDefault)})),children:[(0,L.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:Zt(x.img),alt:""}),(0,L.jsx)("span",{children:x.label})]},x.id))}),i.gateType&&i.gateType!=="none"?(0,L.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,L.jsx)("span",{children:"Gate width (m)"}),(0,L.jsx)("input",{type:"text",inputMode:"decimal",value:i.gateWidthM,onChange:x=>o(H=>({...H,gateWidthM:x.target.value}))})]}):null]}):null,u==="posts"?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ni.length]}),(0,L.jsx)("h2",{className:"truss-estimator__step-title",children:"Posts and fixing type"}),(0,L.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose how the posts will be set."}),(0,L.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(Sa.mounting).map(([x,H])=>(0,L.jsxs)("button",{type:"button",className:`truss-estimator__option-card${i.mountingType===x?" is-selected":""}`,onClick:()=>o(B=>({...B,mountingType:x})),children:[(0,L.jsx)("div",{className:"truss-estimator__option-title",children:H.label}),(0,L.jsx)("div",{className:"truss-estimator__option-copy",children:H.blurb})]},x))})]}):null]}),(0,L.jsxs)("div",{className:"truss-estimator__nav",children:[(0,L.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:ye,children:"Back"}),(0,L.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:st,disabled:!Ue(),children:[(0,L.jsx)("span",{children:pe}),(0,L.jsx)("span",{className:"arrow",children:(0,L.jsx)(Ot,{})})]})]})]})]})})}var tc=Y(Xe()),be=Y(ie()),uw={floor:{label:"Floor",product:"Knauf Acoustic Roll",thickness:"100mm",coverage:12.36,salesUnit:"roll"},wall:{label:"Cavity wall",product:"Celotex CW4100",thickness:"100mm",coverage:3.24,salesUnit:"pack"},roof:{label:"Pitched roof",product:"Kingspan K107",thickness:"100mm",coverage:8.64,salesUnit:"pack"},loft:{label:"Loft",product:"Knauf Loft Roll 44",thickness:"100mm",coverage:13.89,salesUnit:"roll"}};function kd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,tc.useState)("floor"),[i,o]=(0,tc.useState)(""),[l,c]=(0,tc.useState)(""),p=Number.parseFloat(i)*Number.parseFloat(l)||0,f=uw[r],v=Math.ceil(p/f.coverage),m=[{key:`insulation-${r}`,label:`${f.product} ${f.thickness}`,qty:v,unit:f.salesUnit,query:f.product,category:"insulation"}],h=Object.entries(uw);return(0,be.jsx)(be.Fragment,{children:(0,be.jsxs)("div",{className:"truss-estimator",children:[(0,be.jsxs)("div",{className:"quick-order-hero",children:[(0,be.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,be.jsx)("h1",{children:"Insulation Calculator"}),(0,be.jsx)("p",{children:"Estimate insulation coverage and pack quantities for floors, walls, roofs and lofts."})]}),(0,be.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,be.jsx)("h2",{className:"truss-estimator__step-title",children:"Where and what you are insulating"}),(0,be.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the application and product, and enter the area, for coverage and pack quantities."}),(0,be.jsxs)("div",{className:"materials-calculator__section",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Application"}),(0,be.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:h.map(([w,E])=>(0,be.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===w?" is-selected":""}`,onClick:()=>n(w),children:[(0,be.jsx)("div",{className:"truss-estimator__option-title",children:E.label}),(0,be.jsxs)("div",{className:"truss-estimator__option-copy",children:[E.product,", ",E.thickness]})]},w))})]}),(0,be.jsxs)("div",{className:"materials-calculator__section",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Area"}),(0,be.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,be.jsxs)("label",{className:"truss-estimator__field",children:[(0,be.jsx)("span",{children:"Length (m)"}),(0,be.jsx)("input",{type:"number",min:"0",step:"0.01",value:i,onChange:w=>o(w.target.value)})]}),(0,be.jsxs)("label",{className:"truss-estimator__field",children:[(0,be.jsx)("span",{children:"Width (m)"}),(0,be.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:w=>c(w.target.value)})]})]})]}),(0,be.jsxs)("div",{className:"materials-calculator__totals",children:[(0,be.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,be.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,be.jsxs)("div",{children:[(0,be.jsx)("span",{children:"Insulated area"}),(0,be.jsxs)("strong",{children:[p.toFixed(2)," m\xB2"]})]}),(0,be.jsxs)("div",{children:[(0,be.jsx)("span",{children:f.product}),(0,be.jsxs)("strong",{children:[v," packs"]})]})]}),(0,be.jsx)("p",{className:"materials-calculator__note",children:"This is a simple product choice, not thermal or Building Regulations advice. Confirm the specification before ordering."})]}),(0,be.jsxs)("div",{className:"materials-calculator__actions",children:[(0,be.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,be.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(m),disabled:p<=0,children:a})]})]})]})})}var Dn=Y(Xe()),V=Y(ie()),C_=10,q_=1.9*.762,E_=1.9*1.524,ac=()=>({height:"",width:""}),rc=e=>Number.parseFloat(e)||0,pw=({height:e,width:t})=>rc(e)*rc(t);function Nd({onBack:e}){let[t,a]=(0,Dn.useState)([ac()]),[r,n]=(0,Dn.useState)([ac()]),[i,o]=(0,Dn.useState)("0"),[l,c]=(0,Dn.useState)("0"),[p,f]=(0,Dn.useState)(1),v=t.reduce((d,u)=>d+pw(u),0),m=r.reduce((d,u)=>d+pw(u),0),h=rc(i)*q_+rc(l)*E_,w=Math.max(0,v-m-h),E=w*p/C_,U=(d,u,g,b)=>{d(S=>S.map((T,M)=>M===u?{...T,[g]:b}:T))};return(0,V.jsx)(V.Fragment,{children:(0,V.jsxs)("div",{className:"truss-estimator",children:[(0,V.jsxs)("div",{className:"quick-order-hero",children:[(0,V.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,V.jsx)("h1",{children:"Paint Calculator"}),(0,V.jsx)("p",{children:"Estimate how much paint you need for your walls, including multiple coats and excluded areas."})]}),(0,V.jsxs)("div",{className:"truss-estimator__card paint-calculator",children:[(0,V.jsx)("h2",{className:"truss-estimator__step-title",children:"Walls, exclusions and coats"}),(0,V.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter each wall, subtract windows and doors, and choose your number of coats. Quantities assume a coverage of 10 m\xB2 per litre."}),(0,V.jsxs)("div",{className:"paint-calculator__section",children:[(0,V.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,V.jsx)("p",{className:"paint-calculator__hint",children:"Enter the height and width of each wall you want to paint."}),(0,V.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,V.jsx)("span",{}),(0,V.jsx)("span",{children:"Height (m)"}),(0,V.jsx)("span",{children:"Width (m)"}),(0,V.jsx)("span",{})]}),t.map((d,u)=>(0,V.jsxs)("div",{className:"paint-calculator__row",children:[(0,V.jsxs)("span",{className:"paint-calculator__row-label",children:["Wall ",u+1]}),(0,V.jsxs)("label",{className:"truss-estimator__field",children:[(0,V.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,V.jsx)("input",{"aria-label":`Wall ${u+1} height in metres`,type:"number",min:"0",step:"0.01",value:d.height,onChange:g=>U(a,u,"height",g.target.value)})]}),(0,V.jsxs)("label",{className:"truss-estimator__field",children:[(0,V.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,V.jsx)("input",{"aria-label":`Wall ${u+1} width in metres`,type:"number",min:"0",step:"0.01",value:d.width,onChange:g=>U(a,u,"width",g.target.value)})]}),t.length>1?(0,V.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>a(g=>g.filter((b,S)=>S!==u)),children:"Remove"}):null]},`wall-${u}`)),(0,V.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>a(d=>[...d,ac()]),children:"+ Add another wall"})]}),(0,V.jsxs)("div",{className:"paint-calculator__section",children:[(0,V.jsx)("div",{className:"truss-estimator__section-heading",children:"Areas to exclude"}),(0,V.jsx)("p",{className:"paint-calculator__hint",children:"Add windows, sockets, skirting boards or other areas that will not be painted."}),(0,V.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,V.jsx)("span",{}),(0,V.jsx)("span",{children:"Height (m)"}),(0,V.jsx)("span",{children:"Width (m)"}),(0,V.jsx)("span",{})]}),r.map((d,u)=>(0,V.jsxs)("div",{className:"paint-calculator__row",children:[(0,V.jsxs)("span",{className:"paint-calculator__row-label",children:["Area ",u+1]}),(0,V.jsxs)("label",{className:"truss-estimator__field",children:[(0,V.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,V.jsx)("input",{"aria-label":`Area ${u+1} height in metres`,type:"number",min:"0",step:"0.01",value:d.height,onChange:g=>U(n,u,"height",g.target.value)})]}),(0,V.jsxs)("label",{className:"truss-estimator__field",children:[(0,V.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,V.jsx)("input",{"aria-label":`Area ${u+1} width in metres`,type:"number",min:"0",step:"0.01",value:d.width,onChange:g=>U(n,u,"width",g.target.value)})]}),r.length>1?(0,V.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>n(g=>g.filter((b,S)=>S!==u)),children:"Remove"}):null]},`excluded-${u}`)),(0,V.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>n(d=>[...d,ac()]),children:"+ Add another area"})]}),(0,V.jsxs)("div",{className:"paint-calculator__section",children:[(0,V.jsx)("div",{className:"truss-estimator__section-heading",children:"Doors and coats"}),(0,V.jsx)("p",{className:"paint-calculator__hint",children:"Enter the number of standard single and double doors to leave unpainted. Door sizes are estimated automatically."}),(0,V.jsxs)("div",{className:"truss-estimator__field-grid paint-calculator__small-fields",children:[(0,V.jsxs)("label",{className:"truss-estimator__field",children:[(0,V.jsx)("span",{children:"Doors"}),(0,V.jsx)("input",{type:"number",min:"0",step:"1",value:i,onChange:d=>o(d.target.value)})]}),(0,V.jsxs)("label",{className:"truss-estimator__field",children:[(0,V.jsx)("span",{children:"Double doors"}),(0,V.jsx)("input",{type:"number",min:"0",step:"1",value:l,onChange:d=>c(d.target.value)})]})]}),(0,V.jsxs)("div",{className:"paint-calculator__coat-field",children:[(0,V.jsx)("p",{className:"paint-calculator__hint",children:"Most walls need 2 coats for an even finish. Use 3 coats when changing colour significantly or covering a darker wall."}),(0,V.jsxs)("label",{className:"truss-estimator__field",children:[(0,V.jsx)("span",{children:"Number of coats"}),(0,V.jsxs)("select",{value:p,onChange:d=>f(Number(d.target.value)),children:[(0,V.jsx)("option",{value:"1",children:"1 coat"}),(0,V.jsx)("option",{value:"2",children:"2 coats"}),(0,V.jsx)("option",{value:"3",children:"3 coats"})]})]})]})]}),(0,V.jsxs)("div",{className:"paint-calculator__totals",children:[(0,V.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,V.jsxs)("div",{className:"paint-calculator__result-grid",children:[(0,V.jsxs)("div",{children:[(0,V.jsx)("span",{children:"Paintable area"}),(0,V.jsxs)("strong",{children:[w.toFixed(2)," m\xB2"]})]}),(0,V.jsxs)("div",{children:[(0,V.jsx)("span",{children:"Coverage"}),(0,V.jsxs)("strong",{children:[p," ",p===1?"coat":"coats"]})]}),(0,V.jsxs)("div",{children:[(0,V.jsx)("span",{children:"Paint required"}),(0,V.jsxs)("strong",{children:[E.toFixed(1)," litres"]})]})]}),(0,V.jsx)("p",{className:"paint-calculator__note",children:"Based on paint coverage of 10 m\xB2 per litre. Decorative paint is not currently stocked in this catalogue, so this remains an estimate only."})]}),(0,V.jsxs)("div",{className:"paint-calculator__actions",children:[(0,V.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,V.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",disabled:!0,children:"Paint products unavailable"})]})]})]})})}var fr=Y(Xe()),ne=Y(ie()),ic=e=>Number.parseFloat(e)||0,Sd={paving:[{id:"council",label:"Council paving slab (600 \xD7 600mm)"},{id:"raj",label:"Raj blend sandstone (600 \xD7 600mm)"}],block:[{id:"brindle",label:"Brindle block paving (60mm)"},{id:"charcoal",label:"Charcoal block paving (60mm)"}],gravel:[{id:"pea",label:"20mm pea shingle"}]};function Cd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,fr.useState)("paving"),[i,o]=(0,fr.useState)("council"),[l,c]=(0,fr.useState)(""),[p,f]=(0,fr.useState)(""),[v,m]=(0,fr.useState)("100"),[h,w]=(0,fr.useState)("50"),[E,U]=(0,fr.useState)(!0),[d,u]=(0,fr.useState)(!0),g=ic(l)*ic(p),b=g,S=g*(ic(v)/1e3),T=g*.04,M=g*(ic(h)/1e3),R=Math.ceil(b/.36),G=Math.ceil(b/.1),W=Math.ceil(S*1700/800),we=Math.ceil(T*1600/800),Ce=Math.ceil(M*1600/800),Ge=r==="paving"?{qty:R,unit:"each"}:r==="block"?{qty:b,unit:"m2"}:{qty:Ce,unit:"bag"},Ve={paving:"paving slab",block:"block paver",gravel:"decorative gravel"}[r],Te=[{key:`surface-${i}`,label:Sd[r].find(K=>K.id===i)?.label??"Surface material",qty:Ge.qty,unit:Ge.unit,query:Ve,category:"landscaping"},...E?[{key:"sub-base",label:"MOT Type 1 sub-base",qty:W,unit:"bag",query:"MOT Type 1 sub base",category:"aggregate"}]:[],...d?[{key:"bedding",label:"Sharp sand bedding",qty:we,unit:"bag",query:"sharp sand",category:"aggregate"}]:[]];return(0,ne.jsx)(ne.Fragment,{children:(0,ne.jsxs)("div",{className:"truss-estimator",children:[(0,ne.jsxs)("div",{className:"quick-order-hero",children:[(0,ne.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ne.jsx)("h1",{children:"Paving & Driveway Calculator"}),(0,ne.jsx)("p",{children:"Estimate paving, block paving, sub-base and bedding materials for outdoor areas."})]}),(0,ne.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,ne.jsx)("h2",{className:"truss-estimator__step-title",children:"Surface and ground build-up"}),(0,ne.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the surface material and enter the area. Sub-base and bedding sand are estimated alongside the surface units."}),(0,ne.jsxs)("div",{className:"materials-calculator__section",children:[(0,ne.jsx)("div",{className:"truss-estimator__section-heading",children:"Surface material"}),(0,ne.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:[["paving","Paving slabs","For patios and paths"],["block","Block paving","For driveways and paths"],["gravel","Decorative gravel","For paths and landscaping"]].map(([K,Z,de])=>(0,ne.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===K?" is-selected":""}`,onClick:()=>{n(K),o(Sd[K][0].id)},children:[(0,ne.jsx)("div",{className:"truss-estimator__option-title",children:Z}),(0,ne.jsx)("div",{className:"truss-estimator__option-copy",children:de})]},K))}),(0,ne.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,ne.jsx)("span",{children:"Finish"}),(0,ne.jsx)("select",{value:i,onChange:K=>o(K.target.value),children:Sd[r].map(K=>(0,ne.jsx)("option",{value:K.id,children:K.label},K.id))})]})]}),(0,ne.jsxs)("div",{className:"materials-calculator__section",children:[(0,ne.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and groundwork"}),(0,ne.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ne.jsxs)("label",{className:"truss-estimator__field",children:[(0,ne.jsx)("span",{children:"Length (m)"}),(0,ne.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:K=>c(K.target.value)})]}),(0,ne.jsxs)("label",{className:"truss-estimator__field",children:[(0,ne.jsx)("span",{children:"Width (m)"}),(0,ne.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:K=>f(K.target.value)})]})]}),r==="gravel"&&(0,ne.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,ne.jsx)("span",{children:"Gravel depth (mm)"}),(0,ne.jsx)("input",{type:"number",min:"0",step:"10",value:h,onChange:K=>w(K.target.value)})]}),E&&(0,ne.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,ne.jsx)("span",{children:"Sub-base depth (mm)"}),(0,ne.jsx)("input",{type:"number",min:"0",step:"10",value:v,onChange:K=>m(K.target.value)})]}),(0,ne.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,ne.jsx)("input",{type:"checkbox",checked:E,onChange:K=>U(K.target.checked)}),(0,ne.jsx)("span",{children:"Include MOT Type 1 sub-base"})]}),(0,ne.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,ne.jsx)("input",{type:"checkbox",checked:d,onChange:K=>u(K.target.checked)}),(0,ne.jsx)("span",{children:"Include sharp sand bedding"})]})]}),(0,ne.jsxs)("div",{className:"materials-calculator__totals",children:[(0,ne.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ne.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,ne.jsxs)("div",{children:[(0,ne.jsx)("span",{children:"Surface area"}),(0,ne.jsxs)("strong",{children:[g.toFixed(2)," m\xB2"]})]}),(0,ne.jsxs)("div",{children:[(0,ne.jsx)("span",{children:r==="paving"?"Paving slabs":r==="block"?"Block paving":"Gravel"}),(0,ne.jsx)("strong",{children:r==="paving"?`${R} slabs`:r==="block"?`${b.toFixed(2)} m\xB2`:`${Ce} bulk bags`})]}),E&&(0,ne.jsxs)("div",{children:[(0,ne.jsx)("span",{children:"MOT Type 1"}),(0,ne.jsxs)("strong",{children:[W," bulk bags"]})]}),d&&(0,ne.jsxs)("div",{children:[(0,ne.jsx)("span",{children:"Sharp sand"}),(0,ne.jsxs)("strong",{children:[we," bulk bags"]})]})]}),(0,ne.jsx)("p",{className:"materials-calculator__note",children:"Slab and block quantities use typical sizes. Confirm pack coverage and laying pattern before ordering."})]}),(0,ne.jsxs)("div",{className:"materials-calculator__actions",children:[(0,ne.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ne.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(Te),disabled:g<=0,children:a})]})]})]})})}var tl=Y(Xe()),le=Y(ie()),M_=2.88,dw=[{id:"standard",label:"Standard wallboard",blurb:"General internal walls and ceilings"},{id:"moisture",label:"Moisture resistant",blurb:"Kitchens, bathrooms and utility rooms"},{id:"fire",label:"Fire resistant",blurb:"Where fire-rated lining is required"},{id:"sound",label:"Sound resistant",blurb:"Improved acoustic performance"}],mw=()=>({length:"",height:""}),qd=e=>Number.parseFloat(e)||0;function Ed({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,tl.useState)([mw()]),[i,o]=(0,tl.useState)(""),[l,c]=(0,tl.useState)("standard"),[p,f]=(0,tl.useState)("screws"),v=r.reduce((T,M)=>T+qd(M.length)*qd(M.height),0),m=Math.max(0,v-qd(i)),h=Math.ceil(m/M_),w=Math.ceil(m*12),E=Math.ceil(w/1e3),U=Math.ceil(m*1.2),d=Math.ceil(U/90),u=Math.ceil(m/3.5),g=dw.find(T=>T.id===l)?.label??"Standard",b=[{key:"board",label:`${g} plasterboard`,qty:h,unit:"sheet",query:`${g} plasterboard`,category:"plasterboard"},...p==="screws"?[{key:"screws",label:"Drywall screws",qty:E,unit:"box",query:"drywall screws",category:"fixings"}]:[{key:"adhesive",label:"Board adhesive",qty:u,unit:"bag",query:"drywall board adhesive",category:"plasterboard"}],{key:"tape",label:"Joint tape",qty:d,unit:"roll",query:"plasterboard joint tape",category:"plasterboard"}],S=(T,M,R)=>{n(G=>G.map((W,we)=>we===T?{...W,[M]:R}:W))};return(0,le.jsx)(le.Fragment,{children:(0,le.jsxs)("div",{className:"truss-estimator",children:[(0,le.jsxs)("div",{className:"quick-order-hero",children:[(0,le.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,le.jsx)("h1",{children:"Plasterboard & Drylining Calculator"}),(0,le.jsx)("p",{children:"Estimate boards, fixings and jointing materials for walls and ceilings."})]}),(0,le.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,le.jsx)("h2",{className:"truss-estimator__step-title",children:"Boards, fixings and jointing"}),(0,le.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter the surfaces you are lining and the board specification. Screws, tape and adhesive are estimated with the boards."}),(0,le.jsxs)("div",{className:"materials-calculator__section",children:[(0,le.jsx)("div",{className:"truss-estimator__section-heading",children:"Board type"}),(0,le.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:dw.map(T=>(0,le.jsxs)("button",{type:"button",className:`truss-estimator__option-card${l===T.id?" is-selected":""}`,onClick:()=>c(T.id),children:[(0,le.jsx)("div",{className:"truss-estimator__option-title",children:T.label}),(0,le.jsx)("div",{className:"truss-estimator__option-copy",children:T.blurb})]},T.id))})]}),(0,le.jsxs)("div",{className:"materials-calculator__section",children:[(0,le.jsx)("div",{className:"truss-estimator__section-heading",children:"Fixing method"}),(0,le.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[["screws","Drywall screws","For timber or metal framing"],["adhesive","Board adhesive","For masonry dot-and-dab"]].map(([T,M,R])=>(0,le.jsxs)("button",{type:"button",className:`truss-estimator__option-card${p===T?" is-selected":""}`,onClick:()=>f(T),children:[(0,le.jsx)("div",{className:"truss-estimator__option-title",children:M}),(0,le.jsx)("div",{className:"truss-estimator__option-copy",children:R})]},T))})]}),(0,le.jsxs)("div",{className:"materials-calculator__section",children:[(0,le.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall and ceiling areas"}),(0,le.jsx)("p",{className:"materials-calculator__hint",children:"Add each surface separately so different wall sizes are easy to measure."}),(0,le.jsxs)("div",{className:"materials-calculator__dimensions-header",children:[(0,le.jsx)("span",{children:"Surface"}),(0,le.jsx)("span",{children:"Length (m)"}),(0,le.jsx)("span",{children:"Height (m)"}),(0,le.jsx)("span",{})]}),r.map((T,M)=>(0,le.jsxs)("div",{className:"materials-calculator__surface-row",children:[(0,le.jsxs)("span",{children:["Surface ",M+1]}),(0,le.jsx)("input",{"aria-label":`Surface ${M+1} length`,type:"number",min:"0",step:"0.01",value:T.length,onChange:R=>S(M,"length",R.target.value)}),(0,le.jsx)("input",{"aria-label":`Surface ${M+1} height`,type:"number",min:"0",step:"0.01",value:T.height,onChange:R=>S(M,"height",R.target.value)}),r.length>1?(0,le.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>n(R=>R.filter((G,W)=>W!==M)),children:"Remove"}):null]},`surface-${M}`)),(0,le.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>n(T=>[...T,mw()]),children:"+ Add another surface"}),(0,le.jsxs)("label",{className:"truss-estimator__field materials-calculator__openings",children:[(0,le.jsxs)("span",{children:["Openings to deduct (m\xB2) ",(0,le.jsx)("small",{children:"optional"})]}),(0,le.jsx)("input",{type:"number",min:"0",step:"0.01",value:i,onChange:T=>o(T.target.value)})]})]}),(0,le.jsxs)("div",{className:"materials-calculator__totals",children:[(0,le.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,le.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,le.jsxs)("div",{children:[(0,le.jsx)("span",{children:"Board area"}),(0,le.jsxs)("strong",{children:[m.toFixed(2)," m\xB2"]})]}),(0,le.jsxs)("div",{children:[(0,le.jsx)("span",{children:"2.4 x 1.2 m boards"}),(0,le.jsx)("strong",{children:h})]}),(0,le.jsxs)("div",{children:[(0,le.jsx)("span",{children:p==="screws"?"Drywall screws":"Board adhesive"}),(0,le.jsx)("strong",{children:p==="screws"?`${w} (${E} boxes)`:`${u} bags`})]}),(0,le.jsxs)("div",{children:[(0,le.jsx)("span",{children:"Joint tape"}),(0,le.jsxs)("strong",{children:[U," m (",d," rolls)"]})]})]}),(0,le.jsx)("p",{className:"materials-calculator__note",children:"Figures are estimates. Confirm board specification, fixing patterns and fire or acoustic requirements before ordering."})]}),(0,le.jsxs)("div",{className:"materials-calculator__actions",children:[(0,le.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,le.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(b),disabled:m<=0,children:a})]})]})]})})}var al=Y(Xe());var y=Y(ie()),Tt={ranges:{standard:{label:"Standard Fink",blurb:"Classic W-shaped truss for standard pitched roofs."},attic:{label:"Attic",blurb:"Room-in-roof truss with usable attic space and clear span."},mono:{label:"Mono-pitch",blurb:"Single-slope truss for lean-to roofs and outbuildings."}},pitches:["15","20","22.5","25","30","35","40","45","50","55"],pitchMultipliers:{15:.95,20:.98,"22.5":1,25:1.02,30:1.05,35:1.1,40:1.18,45:1.27,50:1.38,55:1.52},overhang:{thresholdMM:300,surchargePerTruss:3.5},centresOptions:["400","600"],treatment:{treated:{label:"Treated (tanalised)",surchargePct:.08},untreated:{label:"Untreated",surchargePct:0}},estimate:{design:250,delivery:250,bracingPerMetre:6.5,girderMultiplier:1.8,ranges:{standard:{supplyAt8m:53.33,installPerTruss:30},attic:{supplyAt8m:128.35,installPerTruss:55},mono:{supplyAt8m:60,installPerTruss:38}}}},nc=["range","pitchAndDimensions","quantityAndGirders","bracing"],T_={range:null,pitch:null,spanMM:"",overhangMM:"",roofLengthM:"",centres:null,girderCount:0,bracing:null,treatment:null,contact:{name:"",email:""}};function z_({degrees:e}){let a=e*Math.PI/180,n=82-Math.min(58,38*Math.tan(a));return(0,y.jsxs)("svg",{viewBox:"0 0 100 100",className:"truss-estimator__diagram truss-estimator__diagram--small","aria-hidden":"true",children:[(0,y.jsx)("line",{x1:"6",y1:"82",x2:"94",y2:"82",stroke:"var(--border)",strokeWidth:"2"}),(0,y.jsx)("polygon",{points:`12,82 88,82 50,${n}`,fill:"var(--accent-light)",stroke:"var(--accent)",strokeWidth:"3",strokeLinejoin:"round"})]})}function A_({type:e}){let t="#b3835a",a="#5c3b22",r="#d9b48f",n="#d3d8de",i="#7c8494",o=(f,v,m,h,w=8,E)=>{let U=m-f,d=h-v,u=Math.hypot(U,d)||1,g=-d/u,b=U/u,S=w*.2;return(0,y.jsxs)("g",{children:[(0,y.jsx)("line",{x1:f,y1:v,x2:m,y2:h,stroke:a,strokeWidth:w+3,strokeLinecap:"square"}),(0,y.jsx)("line",{x1:f,y1:v,x2:m,y2:h,stroke:t,strokeWidth:w,strokeLinecap:"square"}),(0,y.jsx)("line",{x1:f-g*S,y1:v-b*S,x2:m-g*S,y2:h-b*S,stroke:r,strokeWidth:Math.max(1.5,w*.24),strokeLinecap:"round",opacity:"0.9"})]},E)},l=(f,v,m)=>(0,y.jsxs)("g",{children:[(0,y.jsx)("rect",{x:f-7.5,y:v-5.5,width:"15",height:"11",rx:"2",fill:n,stroke:i,strokeWidth:"1"}),(0,y.jsx)("circle",{cx:f-4,cy:v-2.5,r:"1",fill:i}),(0,y.jsx)("circle",{cx:f+4,cy:v-2.5,r:"1",fill:i}),(0,y.jsx)("circle",{cx:f-4,cy:v+2.5,r:"1",fill:i}),(0,y.jsx)("circle",{cx:f+4,cy:v+2.5,r:"1",fill:i}),(0,y.jsx)("circle",{cx:f,cy:v,r:"1",fill:i})]},m),c=(f,v)=>(0,y.jsx)("rect",{x:f-9,y:"110",width:"18",height:"10",fill:a},v),p=(0,y.jsx)("line",{x1:"6",y1:"122",x2:"194",y2:"122",stroke:"var(--border)",strokeWidth:"2"});return e==="attic"?(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,100,26,8,"b1"),o(174,112,100,26,8,"b2"),o(26,112,174,112,8,"b3"),o(58,112,58,70,6,"b4"),o(142,112,142,70,6,"b5"),o(58,70,142,70,7,"b6"),(0,y.jsx)("rect",{x:"90",y:"82",width:"20",height:"24",fill:"#cfe3f2",stroke:a,strokeWidth:"2"}),(0,y.jsx)("line",{x1:"100",y1:"82",x2:"100",y2:"106",stroke:a,strokeWidth:"1.5"}),l(26,112,"p1"),l(174,112,"p2"),l(100,26,"p3"),l(58,112,"p4"),l(58,70,"p5"),l(142,112,"p6"),l(142,70,"p7")]}):e==="mono"?(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,174,26,8,"b1"),o(174,26,174,112,8,"b2"),o(26,112,174,112,8,"b3"),o(90,112,90,75,5,"b4"),o(90,75,132,112,5,"b5"),l(26,112,"p1"),l(174,26,"p2"),l(174,112,"p3"),l(90,112,"p4"),l(90,75,"p5"),l(132,112,"p6")]}):(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[p,c(26,"wl"),c(174,"wr"),o(26,112,100,34,8,"b1"),o(174,112,100,34,8,"b2"),o(26,112,174,112,8,"b3"),o(63,112,100,34,5,"b4"),o(137,112,100,34,5,"b5"),o(63,112,54,83,5,"b6"),o(137,112,146,83,5,"b7"),(0,y.jsx)("rect",{x:"96",y:"108",width:"8",height:"8",fill:a}),l(26,112,"p1"),l(174,112,"p2"),l(100,34,"p3"),l(63,112,"p4"),l(137,112,"p5"),l(54,83,"p6"),l(146,83,"p7")]})}function R_({enabled:e}){return(0,y.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[(0,y.jsx)("line",{x1:"6",y1:"122",x2:"194",y2:"122",stroke:"var(--border)",strokeWidth:"2"}),(0,y.jsx)("rect",{x:"17",y:"110",width:"18",height:"10",fill:"#5c3b22"}),(0,y.jsx)("rect",{x:"165",y:"110",width:"18",height:"10",fill:"#5c3b22"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"100",y2:"34",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"100",y2:"34",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"174",y1:"112",x2:"100",y2:"34",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"174",y1:"112",x2:"100",y2:"34",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"174",y2:"112",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,y.jsx)("line",{x1:"26",y1:"112",x2:"174",y2:"112",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),e?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("line",{x1:"45",y1:"112",x2:"140",y2:"88",stroke:"var(--accent)",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"7 5"}),(0,y.jsx)("line",{x1:"155",y1:"112",x2:"60",y2:"88",stroke:"var(--accent)",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"7 5"})]}):null,(0,y.jsx)("rect",{x:"18.5",y:"106.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"}),(0,y.jsx)("rect",{x:"166.5",y:"106.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"}),(0,y.jsx)("rect",{x:"92.5",y:"28.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"})]})}function fw({treated:e}){let t=e?"#5a7a4a":"var(--accent)";return(0,y.jsxs)("svg",{viewBox:"0 0 100 100",className:"truss-estimator__diagram truss-estimator__diagram--small","aria-hidden":"true",children:[(0,y.jsx)("rect",{x:"10",y:"22",width:"80",height:"14",rx:"2",fill:t}),(0,y.jsx)("rect",{x:"10",y:"43",width:"80",height:"14",rx:"2",fill:e?"#8faf7a":"var(--accent-light)"}),(0,y.jsx)("rect",{x:"10",y:"64",width:"80",height:"14",rx:"2",fill:t})]})}function Md({onBack:e}){let[t,a]=(0,al.useState)(0),[r,n]=(0,al.useState)(T_),[i,o]=(0,al.useState)(!1),[l,c]=(0,al.useState)(!1),p=()=>{let d=Number.parseFloat(r.roofLengthM)||0,u=Number.parseFloat(r.centres??"");return d<=0||!u?0:Math.ceil(d*1e3/u)+1},v=(()=>{let d=r.range?Tt.ranges[r.range]:Tt.ranges.standard,u=r.pitch??"22.5",g=Tt.pitchMultipliers[u],b=(Number.parseFloat(r.spanMM)||0)/1e3,T=(Number.parseFloat(r.overhangMM)||0)>Tt.overhang.thresholdMM,M=p(),R=M+r.girderCount,G=Number.parseFloat(r.roofLengthM)||0,W=r.treatment?Tt.treatment[r.treatment]:Tt.treatment.untreated,we=Tt.estimate.ranges[r.range??"standard"],Ce=we.supplyAt8m*Math.max(.7,b/8)*g*(1+W.surchargePct)+(T?Tt.overhang.surchargePerTruss:0),Ge=M*Ce,Ve=r.girderCount*Ce*Tt.estimate.girderMultiplier,Te=r.bracing==="yes"?G*Tt.estimate.bracingPerMetre:0,$=Ge+Ve+Te+Tt.estimate.delivery,K=Tt.estimate.design+M*we.installPerTruss+r.girderCount*40,Z=$+K,de=Z*.2;return{range:d,count:M,girderCount:r.girderCount,overhangApplies:T,overhangUnits:R,roofLengthM:G,treatment:W,trussSupply:Ge,bracingMaterials:Te,delivery:Tt.estimate.delivery,labour:K,subtotal:Z,vat:de,total:Z+de}})(),m=()=>{let d=nc[t];return d==="range"?!!r.range:d==="pitchAndDimensions"?!!r.pitch&&r.spanMM.trim()!==""&&r.overhangMM.trim()!=="":d==="quantityAndGirders"?r.roofLengthM.trim()!==""&&!!r.centres:d==="bracing"?!!r.bracing&&!!r.treatment:!0},h=t===nc.length-1?"View truss request":"Next",w=()=>{i?o(!1):t===0?e():a(d=>d-1)},E=()=>{m()&&(t===nc.length-1?(c(!1),o(!0)):a(d=>d+1))},U=()=>{let d=nc[t];return d==="range"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 1 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your truss range"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Pricing shown is placeholder. Swap in your real engineering and pricing catalogue."}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--range",children:Object.entries(Tt.ranges).map(([u,g])=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r.range===u?" is-selected":""}`,onClick:()=>n(b=>({...b,range:u})),children:[(0,y.jsx)(A_,{type:u}),(0,y.jsxs)("div",{className:"truss-estimator__option-info",children:[(0,y.jsx)("div",{className:"truss-estimator__option-title",children:g.label}),(0,y.jsx)("div",{className:"truss-estimator__option-copy",children:g.blurb})]})]},u))})]}):d==="pitchAndDimensions"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 2 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Span, overhang and roof pitch"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Span is wall-to-wall, overhang is the eaves tail beyond the wall line. Steeper pitches use more timber per truss."}),(0,y.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,y.jsxs)("label",{className:"truss-estimator__field",children:[(0,y.jsx)("span",{children:"Span (mm)"}),(0,y.jsx)("input",{type:"text",inputMode:"numeric",value:r.spanMM,onChange:u=>n(g=>({...g,spanMM:u.target.value}))})]}),(0,y.jsxs)("label",{className:"truss-estimator__field",children:[(0,y.jsx)("span",{children:"Overhang (mm)"}),(0,y.jsx)("input",{type:"text",inputMode:"numeric",value:r.overhangMM,onChange:u=>n(g=>({...g,overhangMM:u.target.value}))}),(0,y.jsxs)("small",{children:["Overhangs beyond ",Tt.overhang.thresholdMM,"mm add a small surcharge per truss."]})]})]}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Roof pitch"}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:Tt.pitches.map(u=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${r.pitch===u?" is-selected":""}`,onClick:()=>n(g=>({...g,pitch:u})),children:[(0,y.jsx)(z_,{degrees:Number.parseFloat(u)}),(0,y.jsxs)("span",{children:[u,"\xB0"]})]},u))})]}):d==="quantityAndGirders"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 3 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Roof length"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Trusses are based on designs at 400mm or 600mm centres wherever possible."}),(0,y.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,y.jsx)("span",{children:"Roof length (m)"}),(0,y.jsx)("input",{type:"text",inputMode:"decimal",value:r.roofLengthM,onChange:u=>n(g=>({...g,roofLengthM:u.target.value}))})]}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Truss centres"}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--centres",children:Tt.centresOptions.map(u=>(0,y.jsx)("button",{type:"button",className:`truss-estimator__option-card truss-estimator__option-card--compact${r.centres===u?" is-selected":""}`,onClick:()=>n(g=>({...g,centres:u})),children:(0,y.jsxs)("div",{className:"truss-estimator__option-title",children:[u,"mm centres"]})},u))}),(0,y.jsxs)("div",{className:"truss-estimator__stat",children:[p()," trusses estimated"]}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Girder trusses"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Heavy-duty girder trusses carry point loads over large openings. Set 0 if you do not need any."}),(0,y.jsxs)("div",{className:"truss-estimator__stepper",children:[(0,y.jsx)("button",{type:"button",onClick:()=>n(u=>({...u,girderCount:Math.max(0,u.girderCount-1)})),children:"\u2212"}),(0,y.jsx)("span",{children:r.girderCount}),(0,y.jsx)("button",{type:"button",onClick:()=>n(u=>({...u,girderCount:Math.min(3,u.girderCount+1)})),children:"+"})]})]}):d==="bracing"?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Step 4 of 4"}),(0,y.jsx)("h2",{className:"truss-estimator__step-title",children:"Bracing pack?"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"A timber bracing pack stabilises the roof structure once trusses are erected."}),(0,y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[{id:"no",label:"No bracing pack"},{id:"yes",label:"Add bracing pack"}].map(u=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.bracing===u.id?" is-selected":""}`,onClick:()=>n(g=>({...g,bracing:u.id})),children:[(0,y.jsx)(R_,{enabled:u.id==="yes"}),(0,y.jsx)("span",{children:u.label})]},u.id))}),(0,y.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber treatment"}),(0,y.jsx)("p",{className:"truss-estimator__step-sub",children:"Tanalised timber protects against rot in exposed or damp locations."}),(0,y.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.treatment==="untreated"?" is-selected":""}`,onClick:()=>n(u=>({...u,treatment:"untreated"})),children:[(0,y.jsx)(fw,{treated:!1}),(0,y.jsx)("span",{children:"Untreated"})]}),(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.treatment==="treated"?" is-selected":""}`,onClick:()=>n(u=>({...u,treatment:"treated"})),children:[(0,y.jsx)(fw,{treated:!0}),(0,y.jsx)("span",{children:"Treated (+8% cost)"}),(0,y.jsx)("small",{children:"Applies to trusses, girders and overhang"})]})]})]}):null};return i?(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)("div",{className:"truss-estimator",children:[(0,y.jsxs)("div",{className:"quick-order-hero",children:[(0,y.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,y.jsx)("h1",{children:"Your truss estimate"}),(0,y.jsx)("p",{children:"A provisional quantity and specification based on the dimensions you entered."})]}),(0,y.jsxs)("div",{className:"truss-estimator__card truss-request",style:{minHeight:0},children:[(0,y.jsxs)("div",{className:"truss-request__heading",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Estimated requirement"}),(0,y.jsxs)("h2",{children:[v.range.label," roof trusses"]})]}),(0,y.jsxs)("strong",{children:[v.count,(0,y.jsx)("span",{children:"trusses"})]})]}),(0,y.jsxs)("div",{className:"truss-request__grid",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Span"}),(0,y.jsxs)("strong",{children:[r.spanMM," mm"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Roof length"}),(0,y.jsxs)("strong",{children:[r.roofLengthM," m"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Pitch"}),(0,y.jsxs)("strong",{children:[r.pitch,"\xB0"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Centres"}),(0,y.jsxs)("strong",{children:[r.centres," mm"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Overhang"}),(0,y.jsxs)("strong",{children:[r.overhangMM," mm"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Treatment"}),(0,y.jsx)("strong",{children:v.treatment.label})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Girder trusses"}),(0,y.jsx)("strong",{children:v.girderCount||"None"})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Bracing pack"}),(0,y.jsx)("strong",{children:r.bracing==="yes"?"Included":"Not included"})]})]}),(0,y.jsxs)("div",{className:"truss-request__price",children:[(0,y.jsx)("div",{className:"truss-estimator__step-label",children:"Indicative cost estimate"}),(0,y.jsxs)("div",{className:"truss-request__price-grid",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Truss supply allowance"}),(0,y.jsx)("strong",{children:tt(v.trussSupply)})]}),v.bracingMaterials>0&&(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Bracing materials allowance"}),(0,y.jsx)("strong",{children:tt(v.bracingMaterials)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Delivery allowance"}),(0,y.jsx)("strong",{children:tt(v.delivery)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Design and installation labour"}),(0,y.jsx)("strong",{children:tt(v.labour)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Subtotal (ex. VAT)"}),(0,y.jsx)("strong",{children:tt(v.subtotal)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"VAT (20%)"}),(0,y.jsx)("strong",{children:tt(v.vat)})]}),(0,y.jsxs)("div",{className:"truss-request__price-total",children:[(0,y.jsx)("span",{children:"Estimated total"}),(0,y.jsx)("strong",{children:tt(v.total)})]})]}),(0,y.jsx)("p",{children:"Trusses are not listed as fixed products in this catalogue, so supply, delivery and labour are benchmark allowances. Confirm the engineered design and final quote before ordering."})]}),(0,y.jsxs)("div",{className:"truss-request__notice",children:[(0,y.jsx)("strong",{children:"Before ordering"}),(0,y.jsx)("span",{children:"Roof trusses must be designed and signed off for the building. Confirm loading, bearings, wind bracing and final drawings with the truss manufacturer."})]}),(0,y.jsxs)("div",{className:"truss-estimator__nav",children:[(0,y.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:w,children:"Back to calculator"}),(0,y.jsx)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",justifyContent:"center",marginTop:0},onClick:()=>c(!0),children:"Request order"})]}),l&&(0,y.jsx)("p",{className:"truss-request__demo",children:"Demo only \u2014 no order has been sent."})]})]})}):(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)("div",{className:"truss-estimator",children:[(0,y.jsxs)("div",{className:"quick-order-hero",children:[(0,y.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,y.jsx)("h1",{children:"Roof Truss Calculator"}),(0,y.jsx)("p",{children:"Estimate trusses, girders and cost for your roof in a few steps."})]}),(0,y.jsxs)("div",{className:"truss-estimator__card",children:[(0,y.jsx)("div",{className:"truss-estimator__body",children:U()}),(0,y.jsxs)("div",{className:"truss-estimator__nav",children:[(0,y.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:w,children:"Back"}),(0,y.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:E,disabled:!m(),children:[(0,y.jsx)("span",{children:h}),(0,y.jsx)("span",{className:"arrow",children:(0,y.jsx)(Ot,{})})]})]})]})]})})}var Si=Y(Xe()),I=Y(ie()),bw=e=>Number.parseFloat(e)||0,oc=(e,t)=>bw(e)*(t==="m"?1:.3048),gw=()=>({length:"",width:""}),hw=[{id:"chamfered",label:"Chamfered",blurb:"Clean angled edge"},{id:"ogee",label:"Ogee",blurb:"Traditional curved profile"},{id:"pencil-round",label:"Pencil round",blurb:"Simple softened edge"},{id:"torus",label:"Torus",blurb:"Soft rounded detail"}];function U_({profile:e}){return(0,I.jsxs)("svg",{className:"skirting-calculator__profile-diagram",viewBox:"0 0 120 84","aria-hidden":"true",children:[(0,I.jsx)("path",{d:{chamfered:"M16 70V43L43 16H104V70Z",ogee:"M16 70V47C16 36 27 31 40 31C40 21 50 16 63 16H104V70Z","pencil-round":"M16 70V37C16 25 25 16 37 16H104V70Z",torus:"M16 70V49C16 39 25 34 36 34C36 22 47 16 61 16H104V70Z"}[e]}),(0,I.jsx)("line",{x1:"12",y1:"70",x2:"108",y2:"70"})]})}function Td({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,Si.useState)("total"),[i,o]=(0,Si.useState)("m"),[l,c]=(0,Si.useState)(""),[p,f]=(0,Si.useState)([gw()]),[v,m]=(0,Si.useState)(""),[h,w]=(0,Si.useState)("chamfered"),E="4.2",U=r==="total"?oc(l,i):p.reduce((S,T)=>S+2*(oc(T.length,i)+oc(T.width,i)),0),d=Math.max(0,U-oc(v,i)),u=Math.ceil(d/bw(E)),g=[{key:`skirting-${h}`,label:`${hw.find(S=>S.id===h)?.label} skirting board`,qty:d,unit:"m",query:"skirting board",category:"skirting"}],b=(S,T,M)=>{f(R=>R.map((G,W)=>W===S?{...G,[T]:M}:G))};return(0,I.jsx)(I.Fragment,{children:(0,I.jsxs)("div",{className:"truss-estimator",children:[(0,I.jsxs)("div",{className:"quick-order-hero",children:[(0,I.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,I.jsx)("h1",{children:"Skirting Board Calculator"}),(0,I.jsx)("p",{children:"Work out how many skirting board lengths you need for one room or a whole project."})]}),(0,I.jsxs)("div",{className:"truss-estimator__card skirting-calculator",children:[(0,I.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure by room or total length"}),(0,I.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter a single total or work room by room. The run is converted straight into board lengths."}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"How would you like to measure?"}),(0,I.jsxs)("div",{className:"brick-calculator__unit-toggle skirting-calculator__mode-toggle",role:"group","aria-label":"Calculation method",children:[(0,I.jsx)("button",{type:"button",className:r==="total"?"is-selected":"",onClick:()=>n("total"),children:"Total length"}),(0,I.jsx)("button",{type:"button",className:r==="rooms"?"is-selected":"",onClick:()=>n("rooms"),children:"Room by room"})]})]}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Measurements"}),(0,I.jsxs)("div",{className:"skirting-calculator__unit-row",children:[(0,I.jsx)("span",{children:"Units"}),(0,I.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,I.jsx)("button",{type:"button",className:i==="m"?"is-selected":"",onClick:()=>o("m"),children:"Metres"}),(0,I.jsx)("button",{type:"button",className:i==="ft"?"is-selected":"",onClick:()=>o("ft"),children:"Feet"})]})]}),r==="total"?(0,I.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,I.jsxs)("span",{children:["Total skirting length (",i,")"]}),(0,I.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:S=>c(S.target.value)})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)("div",{className:"skirting-calculator__dimensions-header",children:[(0,I.jsx)("span",{children:"Room"}),(0,I.jsxs)("span",{children:["Length (",i,")"]}),(0,I.jsxs)("span",{children:["Width (",i,")"]}),(0,I.jsx)("span",{})]}),p.map((S,T)=>(0,I.jsxs)("div",{className:"skirting-calculator__room-row",children:[(0,I.jsxs)("span",{className:"skirting-calculator__room-label",children:["Room ",T+1]}),(0,I.jsx)("input",{"aria-label":`Room ${T+1} length in ${i}`,type:"number",min:"0",step:"0.01",value:S.length,onChange:M=>b(T,"length",M.target.value)}),(0,I.jsx)("input",{"aria-label":`Room ${T+1} width in ${i}`,type:"number",min:"0",step:"0.01",value:S.width,onChange:M=>b(T,"width",M.target.value)}),p.length>1?(0,I.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>f(M=>M.filter((R,G)=>G!==T)),children:"Remove"}):null]},`room-${T}`)),(0,I.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>f(S=>[...S,gw()]),children:"+ Add another room"})]}),(0,I.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,I.jsxs)("span",{children:["Openings and doorways to deduct (",i,") ",(0,I.jsx)("small",{children:"optional"})]}),(0,I.jsx)("input",{type:"number",min:"0",step:"0.01",value:v,onChange:S=>m(S.target.value)})]})]}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Profile"}),(0,I.jsx)("p",{className:"skirting-calculator__hint",children:"Choose the finish you want for the fixed 4.2m white-primed MDF boards."}),(0,I.jsx)("div",{className:"architrave-calculator__profiles",children:hw.map(S=>(0,I.jsxs)("button",{type:"button",className:`truss-estimator__option-card${h===S.id?" is-selected":""}`,onClick:()=>w(S.id),children:[(0,I.jsx)(U_,{profile:S.id}),(0,I.jsx)("div",{className:"truss-estimator__option-title",children:S.label}),(0,I.jsx)("div",{className:"truss-estimator__option-copy",children:S.blurb})]},S.id))})]}),(0,I.jsxs)("div",{className:"skirting-calculator__section",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,I.jsx)("div",{className:"truss-estimator__field-grid skirting-calculator__options-grid",children:(0,I.jsxs)("label",{className:"truss-estimator__field",children:[(0,I.jsx)("span",{children:"Board length"}),(0,I.jsx)("input",{value:"4.20 m",disabled:!0})]})}),(0,I.jsx)("p",{className:"skirting-calculator__hint",children:"Longer boards can reduce the number of joins, while 10% waste allows for cuts, corners and mistakes."})]}),(0,I.jsxs)("div",{className:"skirting-calculator__totals",children:[(0,I.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,I.jsxs)("div",{className:"skirting-calculator__result-grid",children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("span",{children:"Net skirting"}),(0,I.jsxs)("strong",{children:[d.toFixed(2)," m"]})]}),(0,I.jsxs)("div",{children:[(0,I.jsx)("span",{children:"Board lengths"}),(0,I.jsx)("strong",{children:u})]})]}),(0,I.jsx)("p",{className:"skirting-calculator__note",children:"Corners and joins vary by room layout. Measure each wall where possible for the most accurate result."})]}),(0,I.jsxs)("div",{className:"skirting-calculator__actions",children:[(0,I.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,I.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(g),disabled:d<=0,children:a})]})]})]})})}var Bn=Y(Xe()),ce=Y(ie()),rl=e=>Number.parseFloat(e)||0;function zd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,Bn.useState)("studs"),[i,o]=(0,Bn.useState)(""),[l,c]=(0,Bn.useState)(""),[p,f]=(0,Bn.useState)("600"),[v,m]=(0,Bn.useState)("2.4"),h=i&&l&&p?Math.ceil(rl(l)/(rl(p)/1e3))+1:0,w=h*rl(i),E=rl(v)>0?Math.ceil(w/rl(v)):0,U=[{key:r,label:{studs:"Stud timber",joists:"Joist timber",battens:"Batten timber"}[r],qty:w,unit:"m",query:{studs:"cls studwork timber",joists:"timber joist",battens:"roofing batten"}[r],category:"timber"}],d={studs:["Stud wall","Vertical studs along a wall length"],joists:["Joists","Parallel joists across a floor or deck"],battens:["Battens","Regularly spaced battens for lining or cladding"]},g={studs:{member:"Wall height",overall:"Wall length",help:"Studs repeat across the wall length.",count:"Studs"},joists:{member:"Joist span",overall:"Overall width",help:"Joists repeat across the overall floor or deck width.",count:"Joists"},battens:{member:"Batten length",overall:"Overall width",help:"Battens repeat across the overall lining or cladding width.",count:"Battens"}}[r];return(0,ce.jsx)(ce.Fragment,{children:(0,ce.jsxs)("div",{className:"truss-estimator",children:[(0,ce.jsxs)("div",{className:"quick-order-hero",children:[(0,ce.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ce.jsx)("h1",{children:"Timber Calculator"}),(0,ce.jsx)("p",{children:"Estimate studs, joists or battens from a run length, width and spacing."})]}),(0,ce.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,ce.jsx)("h2",{className:"truss-estimator__step-title",children:"Member size and spacing"}),(0,ce.jsxs)("p",{className:"truss-estimator__step-sub",children:[g.help," Enter the member length and centres to estimate the number of pieces and stock lengths."]}),(0,ce.jsxs)("div",{className:"materials-calculator__section",children:[(0,ce.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber use"}),(0,ce.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:Object.keys(d).map(b=>(0,ce.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===b?" is-selected":""}`,onClick:()=>n(b),children:[(0,ce.jsx)("div",{className:"truss-estimator__option-title",children:d[b][0]}),(0,ce.jsx)("div",{className:"truss-estimator__option-copy",children:d[b][1]})]},b))})]}),(0,ce.jsxs)("div",{className:"materials-calculator__section",children:[(0,ce.jsx)("div",{className:"truss-estimator__section-heading",children:"Dimensions and spacing"}),(0,ce.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ce.jsxs)("label",{className:"truss-estimator__field",children:[(0,ce.jsxs)("span",{children:[g.member," (m)"]}),(0,ce.jsx)("input",{type:"number",min:"0",step:"0.01",value:i,onChange:b=>o(b.target.value)})]}),(0,ce.jsxs)("label",{className:"truss-estimator__field",children:[(0,ce.jsxs)("span",{children:[g.overall," (m)"]}),(0,ce.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:b=>c(b.target.value)})]})]}),(0,ce.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ce.jsxs)("label",{className:"truss-estimator__field",children:[(0,ce.jsx)("span",{children:"Centres (mm)"}),(0,ce.jsxs)("select",{value:p,onChange:b=>f(b.target.value),children:[(0,ce.jsx)("option",{value:"300",children:"300 mm"}),(0,ce.jsx)("option",{value:"400",children:"400 mm"}),(0,ce.jsx)("option",{value:"450",children:"450 mm"}),(0,ce.jsx)("option",{value:"600",children:"600 mm"})]})]}),(0,ce.jsxs)("label",{className:"truss-estimator__field",children:[(0,ce.jsx)("span",{children:"Stock length (m)"}),(0,ce.jsxs)("select",{value:v,onChange:b=>m(b.target.value),children:[(0,ce.jsx)("option",{value:"2.4",children:"2.40 m"}),(0,ce.jsx)("option",{value:"3.6",children:"3.60 m"}),(0,ce.jsx)("option",{value:"4.8",children:"4.80 m"})]})]})]})]}),(0,ce.jsxs)("div",{className:"materials-calculator__totals",children:[(0,ce.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ce.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,ce.jsxs)("div",{children:[(0,ce.jsx)("span",{children:g.count}),(0,ce.jsx)("strong",{children:h})]}),(0,ce.jsxs)("div",{children:[(0,ce.jsx)("span",{children:"Linear metres"}),(0,ce.jsxs)("strong",{children:[w.toFixed(2)," m"]})]}),(0,ce.jsxs)("div",{children:[(0,ce.jsxs)("span",{children:[v," m lengths"]}),(0,ce.jsx)("strong",{children:E})]})]}),(0,ce.jsx)("p",{className:"materials-calculator__note",children:"Spacing is measured centre-to-centre. Add extra timber for plates, noggins, trimming and openings where required."})]}),(0,ce.jsxs)("div",{className:"materials-calculator__actions",children:[(0,ce.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ce.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(U),disabled:w<=0,children:a})]})]})]})})}var Ad=[{id:"truss",title:"Roof Truss Calculator",desc:"Estimate trusses, girders and roof structure costs.",imageUrl:"/tool-images/truss.webp",Component:Md},{id:"fencing",title:"Fencing Calculator",desc:"Estimate fence panels, posts, gravel boards and fixings.",imageUrl:"/tool-images/fencing.webp",Component:xd},{id:"decking",title:"Decking Calculator",desc:"Estimate boards, substructure and fixing quantities.",imageUrl:"/tool-images/decking.webp",Component:_d},{id:"brick-block",title:"Brick & Block Calculator",desc:"Estimate masonry units and ready-mixed mortar for a wall.",imageUrl:"/tool-images/brick-block.webp",Component:hd},{id:"paint",title:"Paint Calculator",desc:"Estimate paint for walls, doors and multiple coats.",imageUrl:"/tool-images/paint.webp",Component:Nd},{id:"skirting",title:"Skirting Board Calculator",desc:"Estimate skirting lengths for rooms and wall runs.",imageUrl:"/tool-images/skirting.webp",Component:Td},{id:"architrave",title:"Architrave Calculator",desc:"Estimate architrave lengths for door and window openings.",imageUrl:"/tool-images/architrave.webp",Component:gd},{id:"concrete-aggregate",title:"Concrete & Aggregate Calculator",desc:"Estimate concrete, MOT, sand and gravel quantities.",imageUrl:"/tool-images/concrete-aggregate.webp",Component:wd},{id:"plasterboard",title:"Plasterboard Calculator",desc:"Estimate plasterboard sheets, screws, tape and adhesive.",imageUrl:"/tool-images/plasterboard.webp",Component:Ed},{id:"insulation",title:"Insulation Calculator",desc:"Estimate insulation packs for floors, walls, roofs and lofts.",imageUrl:"/tool-images/insulation.webp",Component:kd},{id:"timber",title:"Timber Calculator",desc:"Estimate studs, joists and battens from spacing and lengths.",imageUrl:"/tool-images/timber.webp",Component:zd},{id:"paving",title:"Paving & Driveway Calculator",desc:"Estimate paving, block paving, MOT and sharp sand.",imageUrl:"/tool-images/paving.webp",Component:Cd}];var sc=Y(Xe());var Le=Y(Xe());var N=Y(ie()),D_=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}],Rd={wasteFactorEnabled:!0},B_=3e3,vw=null;function lc(e,t){let a=Ko(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function O_(e){return e&&e.length>0?e.join(" x "):"-"}function Ud({toolId:e,requirements:t,ready:a,onBack:r,onTotalChange:n}){let i=Vs(),o=`${e}~${t.map(C=>`${C.key}|${C.query}|${C.category??""}|${C.qty}`).join("~")}`,l=o!==vw,[c,p]=(0,Le.useState)(null),[f,v]=(0,Le.useState)([]),[m,h]=(0,Le.useState)(l),[w,E]=(0,Le.useState)(null),[U,d]=(0,Le.useState)("tile"),[u,g]=(0,Le.useState)(null),[b,S]=(0,Le.useState)(""),[T,M]=(0,Le.useState)(null),[R,G]=(0,Le.useState)(""),[W,we]=(0,Le.useState)([]),[Ce,Ge]=(0,Le.useState)(new Set),[Ve,Te]=(0,Le.useState)(null),[$,K]=(0,Le.useState)(""),[Z,de]=(0,Le.useState)([]),Ue=(0,Le.useRef)(null),pe=(0,Le.useRef)(!1),qe=C=>`${e}:${C}`,De=C=>Zr(C.chosen,{lineId:qe(C.requirement.key),description:C.requirement.label,unit:C.requirement.unit,qty:C.requirement.qty}),gt=(0,Le.useMemo)(()=>t.map(C=>`${C.key}|${C.query}|${C.category??""}`).join("~"),[t]);(0,Le.useEffect)(()=>{let C=!1;return nw().then(Q=>{C||p(Q.itemCount>0)}).catch(()=>{C||p(!1)}),()=>{C=!0}},[]),(0,Le.useEffect)(()=>{if(!a||!c)return;let C=!1,Q;l&&h(!0),E(null);let P=Date.now();return(async()=>{let fe=null;try{fe=(await iw(t)).map(({requirement:Ze,candidates:ht})=>({requirement:Ze,candidates:ht,chosen:ht[0]??null}))}catch(_e){C||E(_e instanceof Error?_e.message:"Could not load products")}if(!C){if(vw=o,l){let _e=B_-(Date.now()-P);_e>0&&await new Promise(Ze=>{Q=window.setTimeout(Ze,_e)})}C||(fe&&(v(fe),!pe.current&&i&&(pe.current=!0,i.addManyToCart(fe.filter(_e=>_e.chosen).map(De)))),h(!1))}})(),()=>{C=!0,window.clearTimeout(Q)}},[a,c,gt]),(0,Le.useEffect)(()=>{if(!T)return;let C=R.trim();if(!C){we([]);return}let Q=!1,P=window.setTimeout(()=>{Jr(C).then(fe=>{Q||we(fe)}).catch(()=>{Q||we([])})},250);return()=>{Q=!0,window.clearTimeout(P)}},[T,R]),(0,Le.useEffect)(()=>{if(!Ve)return;let C=$.trim();if(!C){de([]);return}let Q=!1,P=window.setTimeout(()=>{Jr(C).then(fe=>{Q||de(fe)}).catch(()=>{Q||de([])})},250);return()=>{Q=!0,window.clearTimeout(P)}},[Ve,$]);let yt=(0,Le.useMemo)(()=>{let C=b.trim().toLowerCase(),Q=C?f.filter(P=>P.requirement.label.toLowerCase().includes(C)||(P.chosen?.description??"").toLowerCase().includes(C)||(P.chosen?.product_id??"").toLowerCase().includes(C)):f;return u?[...Q].sort((P,fe)=>{let _e=P.requirement.label.localeCompare(fe.requirement.label);return u==="asc"?_e:-_e}):Q},[f,b,u]),_t=yt.filter(C=>C.chosen),Ie=yt.filter(C=>!C.chosen),Jt=f.filter(C=>C.chosen),j=Jt.filter(C=>C.chosen?.price==null).length,J=Jt.reduce((C,Q)=>C+(za(De(Q),Rd).lineTotal??0),0);if((0,Le.useEffect)(()=>{n?.(J)},[J,n]),!a||c===!1)return null;let k=i?Jt.filter(C=>i.cart[qe(C.requirement.key)]).length:0,A=Ve?f.find(C=>C.requirement.key===Ve)??null:null,se=$.trim()?Z:A?.candidates??[],ye=C=>{let Q=T===C.requirement.key;M(Q?null:C.requirement.key),G(Q?"":C.requirement.query)},st=(C,Q)=>{let P=f.find(fe=>fe.requirement.key===C);v(fe=>fe.map(_e=>_e.requirement.key===C?{..._e,chosen:Q}:_e)),i&&P&&i.cart[qe(C)]&&i.addToCart(De({...P,chosen:Q})),M(null),G("")},xt=C=>{v(Q=>Q.map(P=>P.requirement.key===C?{...P,chosen:null}:P)),i?.cart[qe(C)]&&i.removeFromCart(qe(C))},x=C=>{Te(C.requirement.key),K(""),de([])},H=()=>{Te(null),K(""),de([])},B=C=>{if(!i)return;let Q=qe(C.requirement.key);i.cart[Q]?i.removeFromCart(Q):i.addToCart(De(C))},oe=C=>{Ge(Q=>{let P=new Set(Q);return P.has(C)?P.delete(C):P.add(C),P})},ae=C=>{let Q=W.length>0?W:C.candidates;return(0,N.jsxs)("div",{className:"estimator-products__picker",children:[(0,N.jsx)("input",{type:"text",className:"results-search-input",value:R,autoFocus:!0,placeholder:"Search products in catalogue...",onChange:P=>G(P.target.value),"aria-label":`Search a product for ${C.requirement.label}`}),(0,N.jsxs)("div",{className:"estimator-products__options",children:[Q.map(P=>(0,N.jsxs)("button",{type:"button",className:`estimator-products__option${P.product_id===C.chosen?.product_id?" is-selected":""}`,onClick:()=>st(C.requirement.key,P),children:[(0,N.jsx)("span",{children:P.description}),(0,N.jsxs)("span",{className:"results-row-meta",children:[P.product_id,P.price!=null&&` \xB7 ${tt(P.price)}`]})]},P.product_id)),Q.length===0&&(0,N.jsx)("p",{className:"results-empty-hint",children:"No matching products."})]})]})};return(0,N.jsxs)("section",{className:"estimator-products results-tile-section","aria-label":"Matched products",children:[!m&&(0,N.jsxs)("div",{className:"estimator-products__head",children:[(0,N.jsxs)("div",{className:"results-tile-section__head",children:[(0,N.jsx)("h3",{children:"Matched Products"}),(0,N.jsx)("p",{children:"Products matched to your estimate, check before adding to your basket."})]}),!A&&(0,N.jsxs)("div",{className:"results-summary estimator-products__toolbar",children:[j>0&&(0,N.jsxs)("span",{className:"summary-chip summary-chip--neutral",children:[(0,N.jsx)("strong",{children:j})," need pricing"]}),(0,N.jsxs)("div",{className:"estimator-products__controls",children:[(0,N.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search description...",value:b,onChange:C=>S(C.target.value),"aria-label":"Search matched products"}),(0,N.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,N.jsx)("button",{type:"button",className:`results-view-toggle__btn${U==="tile"?" is-active":""}`,"aria-pressed":U==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>d("tile"),children:(0,N.jsxs)("svg",{width:"18",height:"12",viewBox:"0 0 15 10",fill:"currentColor",children:[(0,N.jsx)("rect",{x:"0.5",y:"0.5",width:"4",height:"4"}),(0,N.jsx)("rect",{x:"5.5",y:"0.5",width:"4",height:"4"}),(0,N.jsx)("rect",{x:"10.5",y:"0.5",width:"4",height:"4"}),(0,N.jsx)("rect",{x:"0.5",y:"5.5",width:"4",height:"4"}),(0,N.jsx)("rect",{x:"5.5",y:"5.5",width:"4",height:"4"}),(0,N.jsx)("rect",{x:"10.5",y:"5.5",width:"4",height:"4"})]})}),(0,N.jsx)("button",{type:"button",className:`results-view-toggle__btn${U==="list"?" is-active":""}`,"aria-pressed":U==="list","aria-label":"List view",title:"List view",onClick:()=>d("list"),children:(0,N.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,N.jsx)("line",{x1:"0.5",y1:"2.5",x2:"14.5",y2:"2.5"}),(0,N.jsx)("line",{x1:"0.5",y1:"7.5",x2:"14.5",y2:"7.5"}),(0,N.jsx)("line",{x1:"0.5",y1:"12.5",x2:"14.5",y2:"12.5"})]})})]}),(0,N.jsxs)("details",{ref:Ue,style:{position:"relative"},children:[(0,N.jsx)("summary",{className:"bom-toolbar-btn sort-menu-summary","aria-label":"Sort materials",style:{fontSize:16},children:"\u21C5"}),(0,N.jsx)("div",{className:"sort-menu-panel",children:D_.map(C=>{let Q=u===C.dir;return(0,N.jsxs)("button",{type:"button",className:`sort-menu-item${Q?" is-active":""}`,onClick:()=>{g(Q?null:C.dir),Ue.current?.removeAttribute("open")},children:[(0,N.jsx)("span",{className:"sort-menu-item__check",children:Q?"\u2713":""}),C.label]},C.dir)})})]})]})]})]}),A&&(0,N.jsxs)("div",{className:"results-review-page",children:[(0,N.jsxs)("div",{className:"results-review-page__top",children:[(0,N.jsxs)("button",{type:"button",className:"bom-toolbar-btn bom-toolbar-btn--accent",onClick:H,children:[(0,N.jsx)(Vr,{}),"Back to results"]}),(0,N.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,N.jsx)("div",{className:"results-review-searchbar",children:(0,N.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products in catalogue...",value:$,onChange:C=>K(C.target.value),"aria-label":`Search a product for ${A.requirement.label}`})}),A.chosen&&(0,N.jsx)("div",{className:"results-candidate-actions",children:(0,N.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>xt(A.requirement.key),children:"Clear selected product"})})]})]}),(0,N.jsxs)("div",{className:"results-review-page__hero",children:[(0,N.jsx)("div",{className:"results-review-page__image-wrap",children:(0,N.jsx)("img",{className:"fill-img results-review-page__image",src:Qa(A.chosen?.description||A.requirement.label,A.chosen?.product_id,A.chosen?.pdp_photo_url),alt:""})}),(0,N.jsxs)("div",{className:"results-review-page__summary",children:[(0,N.jsx)("h2",{children:A.requirement.label}),(0,N.jsxs)("p",{className:"results-review-page__meta",children:[wi(A.requirement.qty)," ",ka(A.requirement.unit,A.requirement.qty)]}),A.chosen?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{className:"results-review-page__product",children:A.chosen.description}),(0,N.jsxs)("div",{className:"results-row-meta",children:[A.chosen.product_id,A.chosen.price!=null?` \xB7 ${lc(A.chosen.price,A.chosen.price_basis)}`:""]})]}):(0,N.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line."}),(0,N.jsx)("div",{className:"results-review-page__actions",children:(0,N.jsx)("button",{type:"button",className:`bom-toolbar-btn${i?.cart[qe(A.requirement.key)]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>B(A),disabled:!A.chosen||!i,children:i?.cart[qe(A.requirement.key)]?"\u2713 Added":"+ Add to basket"})})]})]}),se.length===0?(0,N.jsx)("p",{className:"results-empty-hint",children:"No matching products."}):(0,N.jsxs)("table",{className:"score-breakdown-table",children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{children:"Product"}),(0,N.jsx)("th",{children:"Dims (mm)"}),(0,N.jsx)("th",{children:"Price"}),(0,N.jsx)("th",{"aria-label":"Actions"})]})}),(0,N.jsx)("tbody",{children:se.map(C=>{let Q=C.product_id===A.chosen?.product_id;return(0,N.jsxs)("tr",{className:Q?"score-breakdown-row--best":"",children:[(0,N.jsxs)("td",{children:[(0,N.jsx)("div",{children:C.description}),(0,N.jsx)("div",{className:"results-row-meta",children:C.product_id})]}),(0,N.jsx)("td",{children:(0,N.jsx)("span",{className:"unit-badge",children:O_(C.measurements_mm)})}),(0,N.jsx)("td",{children:C.price!=null?lc(C.price,C.price_basis):"-"}),(0,N.jsx)("td",{children:(0,N.jsxs)("label",{className:"switch-toggle",title:Q?"Currently selected":"Use this candidate",children:[(0,N.jsx)("input",{type:"checkbox",checked:Q,onChange:()=>{Q?xt(A.requirement.key):st(A.requirement.key,C)},"aria-label":Q?`${C.description} selected`:`Use ${C.description}`}),(0,N.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},C.product_id)})})]})]}),!A&&m&&(0,N.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{padding:"32px 24px"},children:[(0,N.jsx)(pr,{}),(0,N.jsx)("p",{className:"banter-message is-visible",style:{fontSize:15,minHeight:0},children:"Matching your materials against the catalogue\u2026"})]}),!A&&w&&(0,N.jsx)("p",{className:"results-empty-hint estimator-products__error",children:w}),!A&&!m&&!w&&yt.length===0&&f.length>0&&(0,N.jsx)("p",{className:"results-empty-hint",children:"No materials match the current search."}),!A&&!m&&!w&&U==="tile"&&_t.length>0&&(0,N.jsx)("div",{className:"results-tile-grid",children:_t.map(C=>{let{requirement:Q,chosen:P}=C,fe=P?za(De(C),Rd):null,_e=i?!!i.cart[qe(Q.key)]:!1;return(0,N.jsxs)("article",{className:"results-tile-card",children:[(0,N.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>x(C),"aria-label":`Review match for ${Q.label}`,children:[(0,N.jsx)("div",{className:"results-tile-card__media",children:(0,N.jsx)("img",{className:"fill-img results-tile-card__image",src:Qa(P?.description||Q.label,P?.product_id,P?.pdp_photo_url),alt:""})}),(0,N.jsxs)("div",{className:"results-tile-card__body",children:[P?(0,N.jsxs)("div",{className:"results-tile-card__heading",children:[(0,N.jsx)("div",{className:"results-tile-card__title",children:P.description}),(0,N.jsxs)("div",{className:"results-tile-card__match-meta",children:[(0,N.jsx)("span",{children:P.product_id}),P.price!=null?(0,N.jsx)("span",{children:lc(P.price,P.price_basis)}):null]})]}):(0,N.jsx)("div",{className:"results-empty-hint",children:"No product matched for this line."}),(0,N.jsxs)("div",{className:"results-tile-card__match",children:[(0,N.jsx)("div",{className:"results-tile-card__match-label",children:"\u21B3 calculated as"}),(0,N.jsx)("div",{className:"results-tile-card__match-name",children:Q.label}),(0,N.jsxs)("div",{className:"results-tile-card__meta",children:[wi(Q.qty)," ",ka(Q.unit,Q.qty)]}),fe?.requiredSellUnits!=null?(0,N.jsxs)("div",{className:"results-tile-card__meta estimator-products__order",children:["Order ",fe.requiredSellUnits," ",fe.sellUnit,fe.lineTotal!=null?` \xB7 ${tt(fe.lineTotal)}`:""]}):P?(0,N.jsx)("div",{className:"results-row-meta",children:"Quantity needs review"}):null]})]})]}),(0,N.jsxs)("div",{className:"results-tile-card__actions",children:[(0,N.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>x(C),children:"Review"}),(0,N.jsx)("button",{type:"button",className:`bom-toolbar-btn${_e?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>B(C),disabled:!P||!i,children:_e?"\u2713 Added":"+ Add"})]})]},Q.key)})}),!A&&!m&&!w&&U==="list"&&_t.length>0&&(0,N.jsx)("div",{className:"bom-table-wrap",children:(0,N.jsxs)("table",{className:"bom-table results-table","aria-label":"Matched materials",children:[(0,N.jsxs)("colgroup",{children:[(0,N.jsx)("col",{style:{width:"56px"}}),(0,N.jsx)("col",{className:"col-item"}),(0,N.jsx)("col",{style:{width:"90px"}}),(0,N.jsx)("col",{style:{width:"80px"}}),(0,N.jsx)("col",{style:{width:"220px"}}),(0,N.jsx)("col",{style:{width:"110px"}})]}),(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{className:"bom-col-header",children:[(0,N.jsx)("th",{"aria-label":"Expand"}),(0,N.jsx)("th",{style:{textAlign:"left"},children:"Description"}),(0,N.jsx)("th",{style:{textAlign:"center"},children:"Qty"}),(0,N.jsx)("th",{style:{textAlign:"center"},children:"Unit"}),(0,N.jsx)("th",{style:{textAlign:"center"},children:"Product Matched"}),(0,N.jsx)("th",{style:{textAlign:"center"},children:"Basket"})]})}),(0,N.jsx)("tbody",{children:_t.map(C=>{let{requirement:Q,chosen:P}=C,fe=P?za(De(C),Rd):null,_e=i?!!i.cart[qe(Q.key)]:!1,Ze=Ce.has(Q.key);return(0,N.jsxs)(Le.Fragment,{children:[(0,N.jsxs)("tr",{className:"bom-row",children:[(0,N.jsx)("td",{className:"bom-actions",style:{textAlign:"center",paddingLeft:0,paddingRight:0},children:(0,N.jsx)("button",{type:"button",className:"link-btn",onClick:()=>oe(Q.key),"aria-expanded":Ze,"aria-label":Ze?"Collapse product options":"Expand product options",children:Ze?"\u25BE":"\u25B8"})}),(0,N.jsxs)("td",{style:{paddingLeft:0},children:[(0,N.jsx)("div",{className:"bom-component-name",children:Q.label}),fe?.requiredSellUnits!=null&&(0,N.jsxs)("div",{className:"results-row-meta",children:["Order ",fe.requiredSellUnits," ",fe.sellUnit,fe.lineTotal!=null?` \xB7 ${tt(fe.lineTotal)}`:""]})]}),(0,N.jsx)("td",{className:"bom-qty col-order",style:{textAlign:"center"},children:wi(Q.qty)}),(0,N.jsx)("td",{style:{textAlign:"center"},children:ka(Q.unit,Q.qty)}),(0,N.jsx)("td",{style:{textAlign:"center"},children:P?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{className:"bom-component-name",children:P.description}),(0,N.jsxs)("div",{className:"results-row-meta",children:[P.product_id,P.price!=null&&` \xB7 ${lc(P.price,P.price_basis)}`]})]}):(0,N.jsx)("span",{className:"results-empty-hint",children:"No match"})}),(0,N.jsx)("td",{style:{textAlign:"center"},children:(0,N.jsx)("button",{type:"button",className:`bom-toolbar-btn${_e?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>B(C),disabled:!P||!i,children:_e?"\u2713 Added":"+ Add"})})]}),Ze&&(0,N.jsx)("tr",{children:(0,N.jsx)("td",{colSpan:6,style:{paddingLeft:0,paddingRight:0},children:T===Q.key?ae(C):(0,N.jsxs)("div",{className:"estimator-products__picker",children:[(0,N.jsxs)("div",{className:"estimator-products__options",children:[C.candidates.map(ht=>(0,N.jsxs)("button",{type:"button",className:`estimator-products__option${ht.product_id===P?.product_id?" is-selected":""}`,onClick:()=>st(Q.key,ht),children:[(0,N.jsx)("span",{children:ht.description}),(0,N.jsxs)("span",{className:"results-row-meta",children:[ht.product_id,ht.price!=null&&` \xB7 ${tt(ht.price)}`]})]},ht.product_id)),C.candidates.length===0&&(0,N.jsx)("p",{className:"results-empty-hint",children:"No candidates found."})]}),(0,N.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>ye(C),children:"Search the catalogue"})]})})})]},Q.key)})})]})}),!A&&!m&&!w&&Ie.length>0&&(0,N.jsxs)("section",{className:"results-tile-section results-tile-section--unmatched","aria-label":"Items requiring matching",children:[(0,N.jsxs)("div",{className:"results-tile-section__head",children:[(0,N.jsx)("h3",{children:"Require Matching"}),(0,N.jsx)("p",{children:"We couldn\u2019t confidently match these to a product. Open one to pick from the closest options."})]}),(0,N.jsx)("div",{className:"results-unmatched-list",children:Ie.map(C=>(0,N.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>x(C),children:[(0,N.jsxs)("span",{className:"results-unmatched-card__main",children:[(0,N.jsx)("span",{className:"results-unmatched-card__title",children:C.requirement.label}),(0,N.jsxs)("span",{className:"results-row-meta",children:[wi(C.requirement.qty)," ",ka(C.requirement.unit,C.requirement.qty)]})]}),(0,N.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},C.requirement.key))})]}),!m&&!w&&f.length>0&&(0,N.jsxs)("div",{className:"disclaimer-box",style:{alignItems:"center"},children:[(0,N.jsx)("span",{className:"disclaimer-icon",children:"\u26A0\uFE0F"}),(0,N.jsx)("p",{className:"disclaimer-text",children:"These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence."})]}),!A&&!m&&!w&&(r||k>0)&&(0,N.jsxs)("div",{className:"btn-row estimator-products__footer",children:[r&&(0,N.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:r,children:"Back"}),k>0&&i&&(0,N.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:r?"0 1 70%":1,marginTop:0},onClick:i.openBasket,children:[(0,N.jsxs)("span",{children:["View Basket (",k,")"]}),(0,N.jsx)("span",{className:"arrow",children:(0,N.jsx)(Ot,{})})]})]})]})}var Lt=Y(ie());function Dd({toolId:e,toolTitle:t,requirements:a,onBack:r}){let[n,i]=(0,sc.useState)(0),o=(0,sc.useCallback)(l=>i(l),[]);return(0,Lt.jsx)(Lt.Fragment,{children:(0,Lt.jsxs)("div",{className:"truss-estimator",children:[(0,Lt.jsxs)("div",{className:"quick-order-hero",children:[(0,Lt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Lt.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,Lt.jsx)("h1",{children:"Your Materials"}),n>0&&(0,Lt.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,Lt.jsx)("strong",{children:tt(n)})," Est. total"]})]}),(0,Lt.jsxs)("p",{children:["Quantities from the ",t,", matched against your merchant\u2019s catalogue."]})]}),(0,Lt.jsx)("div",{className:"truss-estimator__card",style:{minHeight:0},children:(0,Lt.jsx)(Ud,{toolId:e,requirements:a,ready:!0,onBack:r,onTotalChange:o})})]})})}var L_=(e,t)=>{let a=t.key,r={"brick-block":{"brick-common":"5001444","brick-engineering-red":"5002008","brick-engineering-blue":"5001439",block:"5003187",mortar:"6003088"},skirting:{"skirting-chamfered":"4006057","skirting-ogee":"4006045","skirting-pencil-round":"4006048","skirting-torus":"4006042"},architrave:{"architrave-ogee":"4006060","architrave-ovolo":"4006063","architrave-pencil-round":"4006061","architrave-square-edge":"4006062","architrave-torus":"4006059"},plasterboard:{board:"2001035",screws:"2006040",tape:"2007043",adhesive:"2004023"},insulation:{"insulation-floor":"3002110","insulation-wall":"3002012","insulation-roof":"3004047","insulation-loft":"3003046"},timber:{studs:"4001168",joists:"4001201",battens:"4001053"},fencing:{"panels-boundary-0.9":"4001268","panels-boundary-1.2":"4001269","panels-boundary-1.5":"4001270","panels-boundary-1.8":"4001271","panels-skyline-0.9":"4001264","panels-skyline-1.2":"4001265","panels-skyline-1.5":"4001266","panels-skyline-1.8":"4001267","concrete-intermediate-6":"4001290","concrete-intermediate-8":"4001291","concrete-end-6":"4001294","concrete-end-8":"4001295","timber-post-6":"4001242","timber-post-8":"4001243",postcrete:"6003008",gate:"4001630","gravel-boards":"4001284"},decking:{"boards-meridian":"4001251","boards-summit":"4001360",joists:"4001201",screws:"1001103"},paving:{"surface-council":"7003121","surface-raj":"7003003","surface-brindle":"4001621","surface-charcoal":"4001622","surface-pea":"6001004","sub-base":"6001007",bedding:"6001012"}};return e==="plasterboard"?{standard:"2001035",moisture:"2002039",fire:"2002087",sound:"2002044"}[t.label.split(" ")[0].toLowerCase()]??r[e]?.[a]??null:r[e]?.[a]??null};function ww(e,t){if(e==="paint"||e==="concrete-aggregate")return null;let a=t.map(r=>{let n=L_(e,r);return n?{key:r.key,productId:n,qty:r.qty,unit:r.unit}:null});return a.every(Boolean)?a:null}var Bd=Y(Xe());var Kt=Y(ie()),H_=1500;function yw(e){let{addManyToCart:t,clearCart:a,openBasket:r}=En(),[n,i]=(0,Bd.useState)(!1),[o,l]=(0,Bd.useState)(null);return{adding:n,basketError:o,addToBasket:async(p,f)=>{let v=Date.now();i(!0),l(null);try{let m=await Promise.all(p.filter(w=>w.qty>0).map(async w=>{let E=(await Jr(w.productId)).find(U=>U.product_id===w.productId);if(!E)throw new Error("A selected product is no longer available in this catalogue.");return Zr(E,{lineId:`${e}:${w.key}`,description:E.description,unit:w.unit??"each",qty:w.qty,calculatorWasteIncluded:f})})),h=H_-(Date.now()-v);h>0&&await new Promise(w=>window.setTimeout(w,h)),a(),t(m),r()}catch(m){l(m instanceof Error?m.message:"Could not add the products to your basket.")}finally{i(!1)}}}}function _w({toolTitle:e}){return(0,Kt.jsx)(Kt.Fragment,{children:(0,Kt.jsxs)("div",{className:"truss-estimator",children:[(0,Kt.jsxs)("div",{className:"quick-order-hero",children:[(0,Kt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Kt.jsx)("h1",{children:"Your Materials"}),(0,Kt.jsxs)("p",{children:["Calculating quantities from the ",e,"."]})]}),(0,Kt.jsx)("div",{className:"truss-estimator__card",children:(0,Kt.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{flex:1,justifyContent:"center"},children:[(0,Kt.jsx)(pr,{}),(0,Kt.jsx)("p",{className:"banter-message is-visible",children:"Preparing your materials\u2026"})]})})]})})}var Re=Y(ie());function uc(e){let[t,a]=(0,cc.useState)(!1);return(0,Re.jsx)($s,{onOpenBasket:()=>a(!0),children:(0,Re.jsx)(j_,{...e,showBasket:t,onShowBasket:a})})}function j_({fullPage:e=!1,hideHeader:t=!1,internal:a=!1,showBasket:r,onShowBasket:n}){let[i,o]=(0,cc.useState)(null),[l,c]=(0,cc.useState)(null),p=Ad.find(g=>g.id===i),{cart:f,updateCartQty:v,updateCartSellUnits:m,updateCartConversions:h,removeFromCart:w}=En(),{adding:E,basketError:U,addToBasket:d}=yw(p?.title??"calculator"),u=g=>{if(!p)return;let b=ww(p.id,g);b?d(b,g[0]?.calculatorWasteIncluded??!1):c(g)};return(0,Re.jsx)("div",{className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}`,style:hi().theme,children:(0,Re.jsx)("main",{className:"main-content",children:r?(0,Re.jsx)(el,{cart:f,onUpdateQty:v,onUpdateSellUnits:m,onResolveConversions:h,onRemove:w,onBack:()=>n(!1),internal:a}):E&&p?(0,Re.jsx)(_w,{toolTitle:p.title}):p?(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)("div",{hidden:l!==null,children:(0,Re.jsx)(p.Component,{onBack:()=>o(null),onReview:u})}),U&&(0,Re.jsx)("p",{className:"results-empty-hint estimator-products__error",children:U}),l!==null&&(0,Re.jsx)(Dd,{toolId:p.id,toolTitle:p.title,requirements:l,onBack:()=>c(null)})]}):(0,Re.jsx)(Re.Fragment,{children:(0,Re.jsxs)("div",{className:"quick-order-card",children:[(0,Re.jsxs)("div",{className:"quick-order-hero",children:[(0,Re.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,Re.jsx)("h1",{children:"Estimating Tools"}),(0,Re.jsx)("p",{children:"Trade-specific calculators for trusses, fencing, decking, masonry and painting. Dial in your specs and get an instant material estimate."})]}),(0,Re.jsxs)("div",{className:"quick-order-alt",children:[(0,Re.jsx)("div",{className:"quick-order-alt-title",children:"Choose a Calculator"}),(0,Re.jsx)("div",{className:"estimator-tools-grid",children:Ad.map(g=>(0,Re.jsxs)("button",{type:"button",className:"estimator-tool-card",onClick:()=>{o(g.id),c(null)},children:[(0,Re.jsx)("span",{className:"estimator-tool-card__image-wrap",children:(0,Re.jsx)("img",{className:"fill-img estimator-tool-card__image",src:Zt(g.imageUrl),alt:""})}),(0,Re.jsxs)("span",{className:"estimator-tool-card__content",children:[(0,Re.jsx)("span",{className:"estimator-tool-card__title",children:g.title}),(0,Re.jsx)("span",{className:"estimator-tool-card__desc",children:g.desc})]})]},g.id))})]})]})})})})}var pc=Y(ie());function Od({config:e,children:t}){return Gb(e),(0,pc.jsx)(pc.Fragment,{children:t})}var Ld=Y(ie()),G_="https://api.metronlabs.ai",Q_=["client","api-key","api-url","theme","hide-header"];function kw(e,t){var a;customElements.get(e)||customElements.define(e,(a=class extends HTMLElement{constructor(){super();this.root=null;this.attachShadow({mode:"open"})}connectedCallback(){if(this.dataset.version="0.1.15",!this.root){let n=document.createElement("div"),i=document.createElement("style");i.textContent=`:host { display: block; }
6741
6741
  :host > div { all: initial; display: block; }
6742
- ${jb}`,this.shadowRoot.replaceChildren(i,n),this.root=(0,xw.createRoot)(n)}this.renderWidget()}disconnectedCallback(){queueMicrotask(()=>{this.isConnected||!this.root||(this.root.unmount(),this.root=null)})}attributeChangedCallback(){this.root&&this.renderWidget()}renderWidget(){let n=this.getAttribute("client")??void 0,i=this.getAttribute("api-key")??void 0;(!n||!i)&&console.error(`<${e}> needs client and api-key attributes.`);let o={apiBaseUrl:this.getAttribute("api-url")||G_,client:n,apiKey:i,theme:Y_(e,this.getAttribute("theme"))};this.root.render((0,Ld.jsx)(Od,{config:o,children:(0,Ld.jsx)(t,{hideHeader:this.hasAttribute("hide-header")})}))}},a.observedAttributes=Q_,a))}function Y_(e,t){if(t)try{return JSON.parse(t)}catch{console.error(`<${e}> theme attribute isn't valid JSON; using the default colours.`);return}}kw("metron-labs-quick-quote",Zs);kw("metron-labs-estimating-tools",pc);
6742
+ ${jb}`,this.shadowRoot.replaceChildren(i,n),this.root=(0,xw.createRoot)(n)}this.renderWidget()}disconnectedCallback(){queueMicrotask(()=>{this.isConnected||!this.root||(this.root.unmount(),this.root=null)})}attributeChangedCallback(){this.root&&this.renderWidget()}renderWidget(){let n=this.getAttribute("client")??void 0,i=this.getAttribute("api-key")??void 0;(!n||!i)&&console.error(`<${e}> needs client and api-key attributes.`);let o={apiBaseUrl:this.getAttribute("api-url")||G_,client:n,apiKey:i,theme:Y_(e,this.getAttribute("theme"))};this.root.render((0,Ld.jsx)(Od,{config:o,children:(0,Ld.jsx)(t,{hideHeader:this.hasAttribute("hide-header")})}))}},a.observedAttributes=Q_,a))}function Y_(e,t){if(t)try{return JSON.parse(t)}catch{console.error(`<${e}> theme attribute isn't valid JSON; using the default colours.`);return}}kw("metron-labs-quick-quote",Zs);kw("metron-labs-estimating-tools",uc);
6743
6743
  /*! Bundled license information:
6744
6744
 
6745
6745
  scheduler/cjs/scheduler.production.js: