@metron-labs/quote-react 0.1.72 → 0.1.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/embed/quote.js +11 -11
- package/dist/util/pricing.js +5 -1
- package/package.json +1 -1
package/dist/embed/quote.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{a as Ra,b as $}from"./chunk-SQE76S5B.js";var Om=Ra(et=>{"use strict";function Bc(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,i=e[r];if(0<vl(i,t))e[r]=t,e[a]=i,a=r;else break e}}function Aa(e){return e.length===0?null:e[0]}function _l(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,i=e.length,n=i>>>1;r<n;){var o=2*(r+1)-1,l=e[o],c=o+1,p=e[c];if(0>vl(l,a))c<i&&0>vl(p,l)?(e[r]=p,e[c]=a,r=c):(e[r]=l,e[o]=a,r=o);else if(c<i&&0>vl(p,a))e[r]=p,e[c]=a,r=c;else break e}}return t}function vl(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"?(qm=performance,et.unstable_now=function(){return qm.now()}):(Uc=Date,Em=Uc.now(),et.unstable_now=function(){return Uc.now()-Em});var qm,Uc,Em,Za=[],gr=[],_0=1,ua=null,Ut=3,Lc=!1,Wn=!1,eo=!1,Hc=!1,zm=typeof setTimeout=="function"?setTimeout:null,Rm=typeof clearTimeout=="function"?clearTimeout:null,Mm=typeof setImmediate<"u"?setImmediate:null;function yl(e){for(var t=Aa(gr);t!==null;){if(t.callback===null)_l(gr);else if(t.startTime<=e)_l(gr),t.sortIndex=t.expirationTime,Bc(Za,t);else break;t=Aa(gr)}}function Qc(e){if(eo=!1,yl(e),!Wn)if(Aa(Za)!==null)Wn=!0,Di||(Di=!0,Ui());else{var t=Aa(gr);t!==null&&Gc(Qc,t.startTime-e)}}var Di=!1,to=-1,Am=5,Um=-1;function Dm(){return Hc?!0:!(et.unstable_now()-Um<Am)}function Dc(){if(Hc=!1,Di){var e=et.unstable_now();Um=e;var t=!0;try{e:{Wn=!1,eo&&(eo=!1,Rm(to),to=-1),Lc=!0;var a=Ut;try{t:{for(yl(e),ua=Aa(Za);ua!==null&&!(ua.expirationTime>e&&Dm());){var r=ua.callback;if(typeof r=="function"){ua.callback=null,Ut=ua.priorityLevel;var i=r(ua.expirationTime<=e);if(e=et.unstable_now(),typeof i=="function"){ua.callback=i,yl(e),t=!0;break t}ua===Aa(Za)&&_l(Za),yl(e)}else _l(Za);ua=Aa(Za)}if(ua!==null)t=!0;else{var n=Aa(gr);n!==null&&Gc(Qc,n.startTime-e),t=!1}}break e}finally{ua=null,Ut=a,Lc=!1}t=void 0}}finally{t?Ui():Di=!1}}}var Ui;typeof Mm=="function"?Ui=function(){Mm(Dc)}:typeof MessageChannel<"u"?(Oc=new MessageChannel,Tm=Oc.port2,Oc.port1.onmessage=Dc,Ui=function(){Tm.postMessage(null)}):Ui=function(){zm(Dc,0)};var Oc,Tm;function Gc(e,t){to=zm(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"):Am=0<e?Math.floor(1e3/e):5};et.unstable_getCurrentPriorityLevel=function(){return Ut};et.unstable_next=function(e){switch(Ut){case 1:case 2:case 3:var t=3;break;default:t=Ut}var a=Ut;Ut=t;try{return e()}finally{Ut=a}};et.unstable_requestPaint=function(){Hc=!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=Ut;Ut=e;try{return t()}finally{Ut=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 i=-1;break;case 2:i=250;break;case 5:i=1073741823;break;case 4:i=1e4;break;default:i=5e3}return i=a+i,e={id:_0++,callback:t,priorityLevel:e,startTime:a,expirationTime:i,sortIndex:-1},a>r?(e.sortIndex=a,Bc(gr,e),Aa(Za)===null&&e===Aa(gr)&&(eo?(Rm(to),to=-1):eo=!0,Gc(Qc,a-r))):(e.sortIndex=i,Bc(Za,e),Wn||Lc||(Wn=!0,Di||(Di=!0,Ui()))),e};et.unstable_shouldYield=Dm;et.unstable_wrapCallback=function(e){var t=Ut;return function(){var a=Ut;Ut=t;try{return e.apply(this,arguments)}finally{Ut=a}}}});var Lm=Ra((jx,Bm)=>{"use strict";Bm.exports=Om()});var Pm=Ra(me=>{"use strict";var $c=Symbol.for("react.transitional.element"),x0=Symbol.for("react.portal"),k0=Symbol.for("react.fragment"),S0=Symbol.for("react.strict_mode"),N0=Symbol.for("react.profiler"),C0=Symbol.for("react.consumer"),q0=Symbol.for("react.context"),E0=Symbol.for("react.forward_ref"),M0=Symbol.for("react.suspense"),T0=Symbol.for("react.memo"),Ym=Symbol.for("react.lazy"),z0=Symbol.for("react.activity"),Hm=Symbol.iterator;function R0(e){return e===null||typeof e!="object"?null:(e=Hm&&e[Hm]||e["@@iterator"],typeof e=="function"?e:null)}var $m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Vm=Object.assign,Xm={};function Bi(e,t,a){this.props=e,this.context=t,this.refs=Xm,this.updater=a||$m}Bi.prototype.isReactComponent={};Bi.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")};Bi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Zm(){}Zm.prototype=Bi.prototype;function Vc(e,t,a){this.props=e,this.context=t,this.refs=Xm,this.updater=a||$m}var Xc=Vc.prototype=new Zm;Xc.constructor=Vc;Vm(Xc,Bi.prototype);Xc.isPureReactComponent=!0;var Qm=Array.isArray;function Yc(){}var Je={H:null,A:null,T:null,S:null},Km=Object.prototype.hasOwnProperty;function Zc(e,t,a){var r=a.ref;return{$$typeof:$c,type:e,key:t,ref:r!==void 0?r:null,props:a}}function A0(e,t){return Zc(e.type,t,e.props)}function Kc(e){return typeof e=="object"&&e!==null&&e.$$typeof===$c}function U0(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var Gm=/\/+/g;function jc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?U0(""+e.key):t.toString(36)}function D0(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Yc,Yc):(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 Oi(e,t,a,r,i){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(n){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case $c:case x0:o=!0;break;case Ym:return o=e._init,Oi(o(e._payload),t,a,r,i)}}if(o)return i=i(e),o=r===""?"."+jc(e,0):r,Qm(i)?(a="",o!=null&&(a=o.replace(Gm,"$&/")+"/"),Oi(i,t,a,"",function(p){return p})):i!=null&&(Kc(i)&&(i=A0(i,a+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(Gm,"$&/")+"/")+o)),t.push(i)),1;o=0;var l=r===""?".":r+":";if(Qm(e))for(var c=0;c<e.length;c++)r=e[c],n=l+jc(r,c),o+=Oi(r,t,a,n,i);else if(c=R0(e),typeof c=="function")for(e=c.call(e),c=0;!(r=e.next()).done;)r=r.value,n=l+jc(r,c++),o+=Oi(r,t,a,n,i);else if(n==="object"){if(typeof e.then=="function")return Oi(D0(e),t,a,r,i);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 xl(e,t,a){if(e==null)return e;var r=[],i=0;return Oi(e,r,"","",function(n){return t.call(a,n,i++)}),r}function O0(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 jm=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)},B0={map:xl,forEach:function(e,t,a){xl(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return xl(e,function(){t++}),t},toArray:function(e){return xl(e,function(t){return t})||[]},only:function(e){if(!Kc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};me.Activity=z0;me.Children=B0;me.Component=Bi;me.Fragment=k0;me.Profiler=N0;me.PureComponent=Vc;me.StrictMode=S0;me.Suspense=M0;me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Je;me.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Je.H.useMemoCache(e)}};me.cache=function(e){return function(){return e.apply(null,arguments)}};me.cacheSignal=function(){return null};me.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=Vm({},e.props),i=e.key;if(t!=null)for(n in t.key!==void 0&&(i=""+t.key),t)!Km.call(t,n)||n==="key"||n==="__self"||n==="__source"||n==="ref"&&t.ref===void 0||(r[n]=t[n]);var n=arguments.length-2;if(n===1)r.children=a;else if(1<n){for(var o=Array(n),l=0;l<n;l++)o[l]=arguments[l+2];r.children=o}return Zc(e.type,i,r)};me.createContext=function(e){return e={$$typeof:q0,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:C0,_context:e},e};me.createElement=function(e,t,a){var r,i={},n=null;if(t!=null)for(r in t.key!==void 0&&(n=""+t.key),t)Km.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=a;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return Zc(e,n,i)};me.createRef=function(){return{current:null}};me.forwardRef=function(e){return{$$typeof:E0,render:e}};me.isValidElement=Kc;me.lazy=function(e){return{$$typeof:Ym,_payload:{_status:-1,_result:e},_init:O0}};me.memo=function(e,t){return{$$typeof:T0,type:e,compare:t===void 0?null:t}};me.startTransition=function(e){var t=Je.T,a={};Je.T=a;try{var r=e(),i=Je.S;i!==null&&i(a,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(Yc,jm)}catch(n){jm(n)}finally{t!==null&&a.types!==null&&(t.types=a.types),Je.T=t}};me.unstable_useCacheRefresh=function(){return Je.H.useCacheRefresh()};me.use=function(e){return Je.H.use(e)};me.useActionState=function(e,t,a){return Je.H.useActionState(e,t,a)};me.useCallback=function(e,t){return Je.H.useCallback(e,t)};me.useContext=function(e){return Je.H.useContext(e)};me.useDebugValue=function(){};me.useDeferredValue=function(e,t){return Je.H.useDeferredValue(e,t)};me.useEffect=function(e,t){return Je.H.useEffect(e,t)};me.useEffectEvent=function(e){return Je.H.useEffectEvent(e)};me.useId=function(){return Je.H.useId()};me.useImperativeHandle=function(e,t,a){return Je.H.useImperativeHandle(e,t,a)};me.useInsertionEffect=function(e,t){return Je.H.useInsertionEffect(e,t)};me.useLayoutEffect=function(e,t){return Je.H.useLayoutEffect(e,t)};me.useMemo=function(e,t){return Je.H.useMemo(e,t)};me.useOptimistic=function(e,t){return Je.H.useOptimistic(e,t)};me.useReducer=function(e,t,a){return Je.H.useReducer(e,t,a)};me.useRef=function(e){return Je.H.useRef(e)};me.useState=function(e){return Je.H.useState(e)};me.useSyncExternalStore=function(e,t,a){return Je.H.useSyncExternalStore(e,t,a)};me.useTransition=function(){return Je.H.useTransition()};me.version="19.2.3"});var Ye=Ra(($x,Jm)=>{"use strict";Jm.exports=Pm()});var Fm=Ra(Lt=>{"use strict";var L0=Ye();function Im(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 br(){}var Bt={d:{f:br,r:function(){throw Error(Im(522))},D:br,C:br,L:br,m:br,X:br,S:br,M:br},p:0,findDOMNode:null},H0=Symbol.for("react.portal");function Q0(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:H0,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}var ao=L0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function kl(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Lt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Bt;Lt.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(Im(299));return Q0(e,t,null,a)};Lt.flushSync=function(e){var t=ao.T,a=Bt.p;try{if(ao.T=null,Bt.p=2,e)return e()}finally{ao.T=t,Bt.p=a,Bt.d.f()}};Lt.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Bt.d.C(e,t))};Lt.prefetchDNS=function(e){typeof e=="string"&&Bt.d.D(e)};Lt.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,r=kl(a,t.crossOrigin),i=typeof t.integrity=="string"?t.integrity:void 0,n=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?Bt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:n}):a==="script"&&Bt.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:n,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Lt.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=kl(t.as,t.crossOrigin);Bt.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&&Bt.d.M(e)};Lt.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,r=kl(a,t.crossOrigin);Bt.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})}};Lt.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=kl(t.as,t.crossOrigin);Bt.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 Bt.d.m(e)};Lt.requestFormReset=function(e){Bt.d.r(e)};Lt.unstable_batchedUpdates=function(e,t){return e(t)};Lt.useFormState=function(e,t,a){return ao.H.useFormState(e,t,a)};Lt.useFormStatus=function(){return ao.H.useHostTransitionStatus()};Lt.version="19.2.3"});var tf=Ra((Xx,ef)=>{"use strict";function Wm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Wm)}catch(e){console.error(e)}}Wm(),ef.exports=Fm()});var fw=Ra(Ks=>{"use strict";var bt=Lm(),Eh=Ye(),G0=tf();function H(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 Mh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Yo(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 Th(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 zh(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 af(e){if(Yo(e)!==e)throw Error(H(188))}function j0(e){var t=e.alternate;if(!t){if(t=Yo(e),t===null)throw Error(H(188));return t!==e?null:e}for(var a=e,r=t;;){var i=a.return;if(i===null)break;var n=i.alternate;if(n===null){if(r=i.return,r!==null){a=r;continue}break}if(i.child===n.child){for(n=i.child;n;){if(n===a)return af(i),e;if(n===r)return af(i),t;n=n.sibling}throw Error(H(188))}if(a.return!==r.return)a=i,r=n;else{for(var o=!1,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){for(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)throw Error(H(189))}}if(a.alternate!==r)throw Error(H(190))}if(a.tag!==3)throw Error(H(188));return a.stateNode.current===a?e:t}function Rh(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=Rh(e),t!==null)return t;e=e.sibling}return null}var We=Object.assign,Y0=Symbol.for("react.element"),Sl=Symbol.for("react.transitional.element"),uo=Symbol.for("react.portal"),Yi=Symbol.for("react.fragment"),Ah=Symbol.for("react.strict_mode"),Eu=Symbol.for("react.profiler"),Uh=Symbol.for("react.consumer"),tr=Symbol.for("react.context"),kp=Symbol.for("react.forward_ref"),Mu=Symbol.for("react.suspense"),Tu=Symbol.for("react.suspense_list"),Sp=Symbol.for("react.memo"),wr=Symbol.for("react.lazy"),zu=Symbol.for("react.activity"),$0=Symbol.for("react.memo_cache_sentinel"),rf=Symbol.iterator;function ro(e){return e===null||typeof e!="object"?null:(e=rf&&e[rf]||e["@@iterator"],typeof e=="function"?e:null)}var V0=Symbol.for("react.client.reference");function Ru(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===V0?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Yi:return"Fragment";case Eu:return"Profiler";case Ah:return"StrictMode";case Mu:return"Suspense";case Tu:return"SuspenseList";case zu:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case uo:return"Portal";case tr:return e.displayName||"Context";case Uh:return(e._context.displayName||"Context")+".Consumer";case kp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Sp:return t=e.displayName||null,t!==null?t:Ru(e.type)||"Memo";case wr:t=e._payload,e=e._init;try{return Ru(e(t))}catch{}}return null}var po=Array.isArray,se=Eh.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ae=G0.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ai={pending:!1,data:null,method:null,action:null},Au=[],$i=-1;function La(e){return{current:e}}function St(e){0>$i||(e.current=Au[$i],Au[$i]=null,$i--)}function Ke(e,t){$i++,Au[$i]=e.current,e.current=t}var Ba=La(null),Mo=La(null),Mr=La(null),rs=La(null);function is(e,t){switch(Ke(Mr,t),Ke(Mo,e),Ke(Ba,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ph(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ph(t),e=ew(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}St(Ba),Ke(Ba,e)}function cn(){St(Ba),St(Mo),St(Mr)}function Uu(e){e.memoizedState!==null&&Ke(rs,e);var t=Ba.current,a=ew(t,e.type);t!==a&&(Ke(Mo,e),Ke(Ba,a))}function ns(e){Mo.current===e&&(St(Ba),St(Mo)),rs.current===e&&(St(rs),Qo._currentValue=ai)}var Pc,nf;function Fr(e){if(Pc===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Pc=t&&t[1]||"",nf=-1<a.stack.indexOf(`
|
|
1
|
+
import{a as Ra,b as $}from"./chunk-SQE76S5B.js";var Bm=Ra(et=>{"use strict";function Bc(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,n=e[r];if(0<vl(n,t))e[r]=t,e[a]=n,a=r;else break e}}function Aa(e){return e.length===0?null:e[0]}function _l(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>vl(l,a))c<n&&0>vl(p,l)?(e[r]=p,e[c]=a,r=c):(e[r]=l,e[o]=a,r=o);else if(c<n&&0>vl(p,a))e[r]=p,e[c]=a,r=c;else break e}}return t}function vl(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"?(Em=performance,et.unstable_now=function(){return Em.now()}):(Uc=Date,Mm=Uc.now(),et.unstable_now=function(){return Uc.now()-Mm});var Em,Uc,Mm,Ka=[],gr=[],_0=1,ua=null,Ut=3,Lc=!1,Wn=!1,eo=!1,Hc=!1,Rm=typeof setTimeout=="function"?setTimeout:null,Am=typeof clearTimeout=="function"?clearTimeout:null,Tm=typeof setImmediate<"u"?setImmediate:null;function yl(e){for(var t=Aa(gr);t!==null;){if(t.callback===null)_l(gr);else if(t.startTime<=e)_l(gr),t.sortIndex=t.expirationTime,Bc(Ka,t);else break;t=Aa(gr)}}function Qc(e){if(eo=!1,yl(e),!Wn)if(Aa(Ka)!==null)Wn=!0,Di||(Di=!0,Ui());else{var t=Aa(gr);t!==null&&Gc(Qc,t.startTime-e)}}var Di=!1,to=-1,Um=5,Dm=-1;function Om(){return Hc?!0:!(et.unstable_now()-Dm<Um)}function Dc(){if(Hc=!1,Di){var e=et.unstable_now();Dm=e;var t=!0;try{e:{Wn=!1,eo&&(eo=!1,Am(to),to=-1),Lc=!0;var a=Ut;try{t:{for(yl(e),ua=Aa(Ka);ua!==null&&!(ua.expirationTime>e&&Om());){var r=ua.callback;if(typeof r=="function"){ua.callback=null,Ut=ua.priorityLevel;var n=r(ua.expirationTime<=e);if(e=et.unstable_now(),typeof n=="function"){ua.callback=n,yl(e),t=!0;break t}ua===Aa(Ka)&&_l(Ka),yl(e)}else _l(Ka);ua=Aa(Ka)}if(ua!==null)t=!0;else{var i=Aa(gr);i!==null&&Gc(Qc,i.startTime-e),t=!1}}break e}finally{ua=null,Ut=a,Lc=!1}t=void 0}}finally{t?Ui():Di=!1}}}var Ui;typeof Tm=="function"?Ui=function(){Tm(Dc)}:typeof MessageChannel<"u"?(Oc=new MessageChannel,zm=Oc.port2,Oc.port1.onmessage=Dc,Ui=function(){zm.postMessage(null)}):Ui=function(){Rm(Dc,0)};var Oc,zm;function Gc(e,t){to=Rm(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"):Um=0<e?Math.floor(1e3/e):5};et.unstable_getCurrentPriorityLevel=function(){return Ut};et.unstable_next=function(e){switch(Ut){case 1:case 2:case 3:var t=3;break;default:t=Ut}var a=Ut;Ut=t;try{return e()}finally{Ut=a}};et.unstable_requestPaint=function(){Hc=!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=Ut;Ut=e;try{return t()}finally{Ut=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:_0++,callback:t,priorityLevel:e,startTime:a,expirationTime:n,sortIndex:-1},a>r?(e.sortIndex=a,Bc(gr,e),Aa(Ka)===null&&e===Aa(gr)&&(eo?(Am(to),to=-1):eo=!0,Gc(Qc,a-r))):(e.sortIndex=n,Bc(Ka,e),Wn||Lc||(Wn=!0,Di||(Di=!0,Ui()))),e};et.unstable_shouldYield=Om;et.unstable_wrapCallback=function(e){var t=Ut;return function(){var a=Ut;Ut=t;try{return e.apply(this,arguments)}finally{Ut=a}}}});var Hm=Ra((jx,Lm)=>{"use strict";Lm.exports=Bm()});var Jm=Ra(fe=>{"use strict";var $c=Symbol.for("react.transitional.element"),x0=Symbol.for("react.portal"),k0=Symbol.for("react.fragment"),S0=Symbol.for("react.strict_mode"),N0=Symbol.for("react.profiler"),C0=Symbol.for("react.consumer"),q0=Symbol.for("react.context"),E0=Symbol.for("react.forward_ref"),M0=Symbol.for("react.suspense"),T0=Symbol.for("react.memo"),$m=Symbol.for("react.lazy"),z0=Symbol.for("react.activity"),Qm=Symbol.iterator;function R0(e){return e===null||typeof e!="object"?null:(e=Qm&&e[Qm]||e["@@iterator"],typeof e=="function"?e:null)}var Vm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Xm=Object.assign,Zm={};function Bi(e,t,a){this.props=e,this.context=t,this.refs=Zm,this.updater=a||Vm}Bi.prototype.isReactComponent={};Bi.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")};Bi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Km(){}Km.prototype=Bi.prototype;function Vc(e,t,a){this.props=e,this.context=t,this.refs=Zm,this.updater=a||Vm}var Xc=Vc.prototype=new Km;Xc.constructor=Vc;Xm(Xc,Bi.prototype);Xc.isPureReactComponent=!0;var Gm=Array.isArray;function Yc(){}var Je={H:null,A:null,T:null,S:null},Pm=Object.prototype.hasOwnProperty;function Zc(e,t,a){var r=a.ref;return{$$typeof:$c,type:e,key:t,ref:r!==void 0?r:null,props:a}}function A0(e,t){return Zc(e.type,t,e.props)}function Kc(e){return typeof e=="object"&&e!==null&&e.$$typeof===$c}function U0(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var jm=/\/+/g;function jc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?U0(""+e.key):t.toString(36)}function D0(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Yc,Yc):(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 Oi(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 $c:case x0:o=!0;break;case $m:return o=e._init,Oi(o(e._payload),t,a,r,n)}}if(o)return n=n(e),o=r===""?"."+jc(e,0):r,Gm(n)?(a="",o!=null&&(a=o.replace(jm,"$&/")+"/"),Oi(n,t,a,"",function(p){return p})):n!=null&&(Kc(n)&&(n=A0(n,a+(n.key==null||e&&e.key===n.key?"":(""+n.key).replace(jm,"$&/")+"/")+o)),t.push(n)),1;o=0;var l=r===""?".":r+":";if(Gm(e))for(var c=0;c<e.length;c++)r=e[c],i=l+jc(r,c),o+=Oi(r,t,a,i,n);else if(c=R0(e),typeof c=="function")for(e=c.call(e),c=0;!(r=e.next()).done;)r=r.value,i=l+jc(r,c++),o+=Oi(r,t,a,i,n);else if(i==="object"){if(typeof e.then=="function")return Oi(D0(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 xl(e,t,a){if(e==null)return e;var r=[],n=0;return Oi(e,r,"","",function(i){return t.call(a,i,n++)}),r}function O0(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 Ym=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)},B0={map:xl,forEach:function(e,t,a){xl(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return xl(e,function(){t++}),t},toArray:function(e){return xl(e,function(t){return t})||[]},only:function(e){if(!Kc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};fe.Activity=z0;fe.Children=B0;fe.Component=Bi;fe.Fragment=k0;fe.Profiler=N0;fe.PureComponent=Vc;fe.StrictMode=S0;fe.Suspense=M0;fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Je;fe.__COMPILER_RUNTIME={__proto__:null,c:function(e){return Je.H.useMemoCache(e)}};fe.cache=function(e){return function(){return e.apply(null,arguments)}};fe.cacheSignal=function(){return null};fe.cloneElement=function(e,t,a){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=Xm({},e.props),n=e.key;if(t!=null)for(i in t.key!==void 0&&(n=""+t.key),t)!Pm.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 Zc(e.type,n,r)};fe.createContext=function(e){return e={$$typeof:q0,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:C0,_context:e},e};fe.createElement=function(e,t,a){var r,n={},i=null;if(t!=null)for(r in t.key!==void 0&&(i=""+t.key),t)Pm.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 Zc(e,i,n)};fe.createRef=function(){return{current:null}};fe.forwardRef=function(e){return{$$typeof:E0,render:e}};fe.isValidElement=Kc;fe.lazy=function(e){return{$$typeof:$m,_payload:{_status:-1,_result:e},_init:O0}};fe.memo=function(e,t){return{$$typeof:T0,type:e,compare:t===void 0?null:t}};fe.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(Yc,Ym)}catch(i){Ym(i)}finally{t!==null&&a.types!==null&&(t.types=a.types),Je.T=t}};fe.unstable_useCacheRefresh=function(){return Je.H.useCacheRefresh()};fe.use=function(e){return Je.H.use(e)};fe.useActionState=function(e,t,a){return Je.H.useActionState(e,t,a)};fe.useCallback=function(e,t){return Je.H.useCallback(e,t)};fe.useContext=function(e){return Je.H.useContext(e)};fe.useDebugValue=function(){};fe.useDeferredValue=function(e,t){return Je.H.useDeferredValue(e,t)};fe.useEffect=function(e,t){return Je.H.useEffect(e,t)};fe.useEffectEvent=function(e){return Je.H.useEffectEvent(e)};fe.useId=function(){return Je.H.useId()};fe.useImperativeHandle=function(e,t,a){return Je.H.useImperativeHandle(e,t,a)};fe.useInsertionEffect=function(e,t){return Je.H.useInsertionEffect(e,t)};fe.useLayoutEffect=function(e,t){return Je.H.useLayoutEffect(e,t)};fe.useMemo=function(e,t){return Je.H.useMemo(e,t)};fe.useOptimistic=function(e,t){return Je.H.useOptimistic(e,t)};fe.useReducer=function(e,t,a){return Je.H.useReducer(e,t,a)};fe.useRef=function(e){return Je.H.useRef(e)};fe.useState=function(e){return Je.H.useState(e)};fe.useSyncExternalStore=function(e,t,a){return Je.H.useSyncExternalStore(e,t,a)};fe.useTransition=function(){return Je.H.useTransition()};fe.version="19.2.3"});var Ye=Ra(($x,Im)=>{"use strict";Im.exports=Jm()});var Wm=Ra(Lt=>{"use strict";var L0=Ye();function Fm(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 br(){}var Bt={d:{f:br,r:function(){throw Error(Fm(522))},D:br,C:br,L:br,m:br,X:br,S:br,M:br},p:0,findDOMNode:null},H0=Symbol.for("react.portal");function Q0(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:H0,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}var ao=L0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function kl(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Lt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Bt;Lt.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(Fm(299));return Q0(e,t,null,a)};Lt.flushSync=function(e){var t=ao.T,a=Bt.p;try{if(ao.T=null,Bt.p=2,e)return e()}finally{ao.T=t,Bt.p=a,Bt.d.f()}};Lt.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Bt.d.C(e,t))};Lt.prefetchDNS=function(e){typeof e=="string"&&Bt.d.D(e)};Lt.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var a=t.as,r=kl(a,t.crossOrigin),n=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;a==="style"?Bt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:n,fetchPriority:i}):a==="script"&&Bt.d.X(e,{crossOrigin:r,integrity:n,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Lt.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var a=kl(t.as,t.crossOrigin);Bt.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&&Bt.d.M(e)};Lt.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var a=t.as,r=kl(a,t.crossOrigin);Bt.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})}};Lt.preloadModule=function(e,t){if(typeof e=="string")if(t){var a=kl(t.as,t.crossOrigin);Bt.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 Bt.d.m(e)};Lt.requestFormReset=function(e){Bt.d.r(e)};Lt.unstable_batchedUpdates=function(e,t){return e(t)};Lt.useFormState=function(e,t,a){return ao.H.useFormState(e,t,a)};Lt.useFormStatus=function(){return ao.H.useHostTransitionStatus()};Lt.version="19.2.3"});var af=Ra((Xx,tf)=>{"use strict";function ef(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ef)}catch(e){console.error(e)}}ef(),tf.exports=Wm()});var hw=Ra(Ks=>{"use strict";var bt=Hm(),Mh=Ye(),G0=af();function B(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 Th(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Yo(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 zh(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 Rh(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 rf(e){if(Yo(e)!==e)throw Error(B(188))}function j0(e){var t=e.alternate;if(!t){if(t=Yo(e),t===null)throw Error(B(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 rf(n),e;if(i===r)return rf(n),t;i=i.sibling}throw Error(B(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(B(189))}}if(a.alternate!==r)throw Error(B(190))}if(a.tag!==3)throw Error(B(188));return a.stateNode.current===a?e:t}function Ah(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=Ah(e),t!==null)return t;e=e.sibling}return null}var We=Object.assign,Y0=Symbol.for("react.element"),Sl=Symbol.for("react.transitional.element"),uo=Symbol.for("react.portal"),Yi=Symbol.for("react.fragment"),Uh=Symbol.for("react.strict_mode"),Eu=Symbol.for("react.profiler"),Dh=Symbol.for("react.consumer"),ar=Symbol.for("react.context"),kp=Symbol.for("react.forward_ref"),Mu=Symbol.for("react.suspense"),Tu=Symbol.for("react.suspense_list"),Sp=Symbol.for("react.memo"),wr=Symbol.for("react.lazy"),zu=Symbol.for("react.activity"),$0=Symbol.for("react.memo_cache_sentinel"),nf=Symbol.iterator;function ro(e){return e===null||typeof e!="object"?null:(e=nf&&e[nf]||e["@@iterator"],typeof e=="function"?e:null)}var V0=Symbol.for("react.client.reference");function Ru(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===V0?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Yi:return"Fragment";case Eu:return"Profiler";case Uh:return"StrictMode";case Mu:return"Suspense";case Tu:return"SuspenseList";case zu:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case uo:return"Portal";case ar:return e.displayName||"Context";case Dh:return(e._context.displayName||"Context")+".Consumer";case kp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Sp:return t=e.displayName||null,t!==null?t:Ru(e.type)||"Memo";case wr:t=e._payload,e=e._init;try{return Ru(e(t))}catch{}}return null}var po=Array.isArray,ce=Mh.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ae=G0.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ai={pending:!1,data:null,method:null,action:null},Au=[],$i=-1;function La(e){return{current:e}}function St(e){0>$i||(e.current=Au[$i],Au[$i]=null,$i--)}function Ke(e,t){$i++,Au[$i]=e.current,e.current=t}var Ba=La(null),Mo=La(null),Mr=La(null),rs=La(null);function is(e,t){switch(Ke(Mr,t),Ke(Mo,e),Ke(Ba,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?dh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dh(t),e=tw(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}St(Ba),Ke(Ba,e)}function cn(){St(Ba),St(Mo),St(Mr)}function Uu(e){e.memoizedState!==null&&Ke(rs,e);var t=Ba.current,a=tw(t,e.type);t!==a&&(Ke(Mo,e),Ke(Ba,a))}function ns(e){Mo.current===e&&(St(Ba),St(Mo)),rs.current===e&&(St(rs),Qo._currentValue=ai)}var Pc,of;function Fr(e){if(Pc===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Pc=t&&t[1]||"",of=-1<a.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+Pc+e+
|
|
3
|
+
`+Pc+e+of}var Jc=!1;function Ic(e,t){if(!e||Jc)return"";Jc=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var h=function(){throw Error()};if(Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(g){var d=g}Reflect.construct(e,[],h)}else{try{h.call()}catch(g){d=g}e.call(h.prototype)}}else{try{throw Error()}catch(g){d=g}(h=e())&&typeof h.catch=="function"&&h.catch(function(){})}}catch(g){if(g&&d&&typeof g.stack=="string")return[g.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
4
|
`),p=l.split(`
|
|
5
|
-
`);for(
|
|
6
|
-
`+c[r].replace(" at new "," at ");return e.displayName&&
|
|
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
|
+
`+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{Jc=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Fr(a):""}function X0(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 Ic(e.type,!1);case 11:return Ic(e.type.render,!1);case 1:return Ic(e.type,!0);case 31:return Fr("Activity");default:return""}}function lf(e){try{var t="",a=null;do t+=X0(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 Du=Object.prototype.hasOwnProperty,Np=bt.unstable_scheduleCallback,Fc=bt.unstable_cancelCallback,Z0=bt.unstable_shouldYield,K0=bt.unstable_requestPaint,ia=bt.unstable_now,P0=bt.unstable_getCurrentPriorityLevel,Dh=bt.unstable_ImmediatePriority,Oh=bt.unstable_UserBlockingPriority,os=bt.unstable_NormalPriority,J0=bt.unstable_LowPriority,Bh=bt.unstable_IdlePriority,I0=bt.log,F0=bt.unstable_setDisableYieldValue,$o=null,na=null;function Sr(e){if(typeof I0=="function"&&F0(e),na&&typeof na.setStrictMode=="function")try{na.setStrictMode($o,e)}catch{}}var oa=Math.clz32?Math.clz32:ty,W0=Math.log,ey=Math.LN2;function ty(e){return e>>>=0,e===0?32:31-(W0(e)/ey|0)|0}var Nl=256,Cl=262144,ql=4194304;function Wr(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 Rs(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var i=0,n=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var l=r&134217727;return l!==0?(r=l&~n,r!==0?i=Wr(r):(o&=l,o!==0?i=Wr(o):a||(a=l&~e,a!==0&&(i=Wr(a))))):(l=r&~n,l!==0?i=Wr(l):o!==0?i=Wr(o):a||(a=r&~e,a!==0&&(i=Wr(a)))),i===0?0:t!==0&&t!==i&&(t&n)===0&&(n=i&-i,a=t&-t,n>=a||n===32&&(a&4194048)!==0)?t:i}function Vo(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ay(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 Lh(){var e=ql;return ql<<=1,(ql&62914560)===0&&(ql=4194304),e}function Wc(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Xo(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ry(e,t,a,r,i,n){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 m=31-oa(a),h=1<<m;l[m]=0,c[m]=-1;var d=p[m];if(d!==null)for(p[m]=null,m=0;m<d.length;m++){var b=d[m];b!==null&&(b.lane&=-536870913)}a&=~h}r!==0&&Hh(e,r,0),n!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=n&~(o&~t))}function Hh(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-oa(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function Qh(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-oa(a),i=1<<r;i&t|e[r]&t&&(e[r]|=t),a&=~i}}function Gh(e,t){var a=t&-t;return a=(a&42)!==0?1:Cp(a),(a&(e.suspendedLanes|t))!==0?0:a}function Cp(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 qp(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function jh(){var e=Ae.p;return e!==0?e:(e=window.event,e===void 0?32:pw(e.type))}function lf(e,t){var a=Ae.p;try{return Ae.p=e,t()}finally{Ae.p=a}}var jr=Math.random().toString(36).slice(2),qt="__reactFiber$"+jr,Pt="__reactProps$"+jr,yn="__reactContainer$"+jr,Ou="__reactEvents$"+jr,iy="__reactListeners$"+jr,ny="__reactHandles$"+jr,sf="__reactResources$"+jr,Zo="__reactMarker$"+jr;function Ep(e){delete e[qt],delete e[Pt],delete e[Ou],delete e[iy],delete e[ny]}function Vi(e){var t=e[qt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[yn]||a[qt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=gh(e);e!==null;){if(a=e[qt])return a;e=gh(e)}return t}e=a,a=e.parentNode}return null}function _n(e){if(e=e[qt]||e[yn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function mo(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(H(33))}function tn(e){var t=e[sf];return t||(t=e[sf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function kt(e){e[Zo]=!0}var Yh=new Set,$h={};function di(e,t){un(e,t),un(e+"Capture",t)}function un(e,t){for($h[e]=t,e=0;e<t.length;e++)Yh.add(t[e])}var oy=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]*$"),cf={},uf={};function ly(e){return Du.call(uf,e)?!0:Du.call(cf,e)?!1:oy.test(e)?uf[e]=!0:(cf[e]=!0,!1)}function jl(e,t,a){if(ly(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 El(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 Ka(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 da(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Vh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sy(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 i=r.get,n=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){a=""+o,n.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 Bu(e){if(!e._valueTracker){var t=Vh(e)?"checked":"value";e._valueTracker=sy(e,t,""+e[t])}}function Xh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=Vh(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function ls(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 cy=/[\n"\\]/g;function ha(e){return e.replace(cy,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Lu(e,t,a,r,i,n,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=""+da(t)):e.value!==""+da(t)&&(e.value=""+da(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?Hu(e,o,da(t)):a!=null?Hu(e,o,da(a)):r!=null&&e.removeAttribute("value"),i==null&&n!=null&&(e.defaultChecked=!!n),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+da(l):e.removeAttribute("name")}function Zh(e,t,a,r,i,n,o,l){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(e.type=n),t!=null||a!=null){if(!(n!=="submit"&&n!=="reset"||t!=null)){Bu(e);return}a=a!=null?""+da(a):"",t=t!=null?""+da(t):a,l||t===e.value||(e.value=t),e.defaultValue=t}r=r??i,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),Bu(e)}function Hu(e,t,a){t==="number"&&ls(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function an(e,t,a,r){if(e=e.options,t){t={};for(var i=0;i<a.length;i++)t["$"+a[i]]=!0;for(a=0;a<e.length;a++)i=t.hasOwnProperty("$"+e[a].value),e[a].selected!==i&&(e[a].selected=i),i&&r&&(e[a].defaultSelected=!0)}else{for(a=""+da(a),t=null,i=0;i<e.length;i++){if(e[i].value===a){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Kh(e,t,a){if(t!=null&&(t=""+da(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+da(a):""}function Ph(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(H(92));if(po(r)){if(1<r.length)throw Error(H(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=da(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),Bu(e)}function pn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var uy=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 pf(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||uy.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Jh(e,t,a){if(t!=null&&typeof t!="object")throw Error(H(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 i in t)r=t[i],t.hasOwnProperty(i)&&a[i]!==r&&pf(e,i,r)}else for(var n in t)t.hasOwnProperty(n)&&pf(e,n,t[n])}function Mp(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 py=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"]]),dy=/^[\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 Yl(e){return dy.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ar(){}var Qu=null;function Tp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xi=null,rn=null;function df(e){var t=_n(e);if(t&&(e=t.stateNode)){var a=e[Pt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Lu(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 i=r[Pt]||null;if(!i)throw Error(H(90));Lu(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<a.length;t++)r=a[t],r.form===e.form&&Xh(r)}break e;case"textarea":Kh(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&an(e,!!a.multiple,t,!1)}}}var eu=!1;function Ih(e,t,a){if(eu)return e(t,a);eu=!0;try{var r=e(t);return r}finally{if(eu=!1,(Xi!==null||rn!==null)&&($s(),Xi&&(t=Xi,e=rn,rn=Xi=null,df(t),e)))for(t=0;t<e.length;t++)df(e[t])}}function To(e,t){var a=e.stateNode;if(a===null)return null;var r=a[Pt]||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(H(231,t,typeof a));return a}var lr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gu=!1;if(lr)try{Li={},Object.defineProperty(Li,"passive",{get:function(){Gu=!0}}),window.addEventListener("test",Li,Li),window.removeEventListener("test",Li,Li)}catch{Gu=!1}var Li,Nr=null,zp=null,$l=null;function Fh(){if($l)return $l;var e,t=zp,a=t.length,r,i="value"in Nr?Nr.value:Nr.textContent,n=i.length;for(e=0;e<a&&t[e]===i[e];e++);var o=a-e;for(r=1;r<=o&&t[a-r]===i[n-r];r++);return $l=i.slice(e,1<r?1-r:void 0)}function Vl(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 Ml(){return!0}function mf(){return!1}function Jt(e){function t(a,r,i,n,o){this._reactName=a,this._targetInst=i,this.type=r,this.nativeEvent=n,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(a=e[l],this[l]=a?a(n):n[l]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?Ml:mf,this.isPropagationStopped=mf,this}return We(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=Ml)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Ml)},persist:function(){},isPersistent:Ml}),t}var mi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},As=Jt(mi),Ko=We({},mi,{view:0,detail:0}),my=Jt(Ko),tu,au,io,Us=We({},Ko,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rp,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!==io&&(io&&e.type==="mousemove"?(tu=e.screenX-io.screenX,au=e.screenY-io.screenY):au=tu=0,io=e),tu)},movementY:function(e){return"movementY"in e?e.movementY:au}}),ff=Jt(Us),fy=We({},Us,{dataTransfer:0}),hy=Jt(fy),gy=We({},Ko,{relatedTarget:0}),ru=Jt(gy),by=We({},mi,{animationName:0,elapsedTime:0,pseudoElement:0}),wy=Jt(by),vy=We({},mi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yy=Jt(vy),_y=We({},mi,{data:0}),hf=Jt(_y),xy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ky={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"},Sy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ny(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Sy[e])?!!t[e]:!1}function Rp(){return Ny}var Cy=We({},Ko,{key:function(e){if(e.key){var t=xy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Vl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ky[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rp,charCode:function(e){return e.type==="keypress"?Vl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Vl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qy=Jt(Cy),Ey=We({},Us,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gf=Jt(Ey),My=We({},Ko,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rp}),Ty=Jt(My),zy=We({},mi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ry=Jt(zy),Ay=We({},Us,{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}),Uy=Jt(Ay),Dy=We({},mi,{newState:0,oldState:0}),Oy=Jt(Dy),By=[9,13,27,32],Ap=lr&&"CompositionEvent"in window,go=null;lr&&"documentMode"in document&&(go=document.documentMode);var Ly=lr&&"TextEvent"in window&&!go,Wh=lr&&(!Ap||go&&8<go&&11>=go),bf=" ",wf=!1;function eg(e,t){switch(e){case"keyup":return By.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zi=!1;function Hy(e,t){switch(e){case"compositionend":return tg(t);case"keypress":return t.which!==32?null:(wf=!0,bf);case"textInput":return e=t.data,e===bf&&wf?null:e;default:return null}}function Qy(e,t){if(Zi)return e==="compositionend"||!Ap&&eg(e,t)?(e=Fh(),$l=zp=Nr=null,Zi=!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 Wh&&t.locale!=="ko"?null:t.data;default:return null}}var Gy={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 vf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Gy[e.type]:t==="textarea"}function ag(e,t,a,r){Xi?rn?rn.push(r):rn=[r]:Xi=r,t=Ns(t,"onChange"),0<t.length&&(a=new As("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var bo=null,zo=null;function jy(e){Ib(e,0)}function Ds(e){var t=mo(e);if(Xh(t))return e}function yf(e,t){if(e==="change")return t}var rg=!1;lr&&(lr?(zl="oninput"in document,zl||(iu=document.createElement("div"),iu.setAttribute("oninput","return;"),zl=typeof iu.oninput=="function"),Tl=zl):Tl=!1,rg=Tl&&(!document.documentMode||9<document.documentMode));var Tl,zl,iu;function _f(){bo&&(bo.detachEvent("onpropertychange",ig),zo=bo=null)}function ig(e){if(e.propertyName==="value"&&Ds(zo)){var t=[];ag(t,zo,e,Tp(e)),Ih(jy,t)}}function Yy(e,t,a){e==="focusin"?(_f(),bo=t,zo=a,bo.attachEvent("onpropertychange",ig)):e==="focusout"&&_f()}function $y(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ds(zo)}function Vy(e,t){if(e==="click")return Ds(t)}function Xy(e,t){if(e==="input"||e==="change")return Ds(t)}function Zy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var sa=typeof Object.is=="function"?Object.is:Zy;function Ro(e,t){if(sa(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 i=a[r];if(!Du.call(t,i)||!sa(e[i],t[i]))return!1}return!0}function xf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function kf(e,t){var a=xf(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=xf(a)}}function ng(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ng(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function og(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ls(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=ls(e.document)}return t}function Up(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 Ky=lr&&"documentMode"in document&&11>=document.documentMode,Ki=null,ju=null,wo=null,Yu=!1;function Sf(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Yu||Ki==null||Ki!==ls(r)||(r=Ki,"selectionStart"in r&&Up(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}),wo&&Ro(wo,r)||(wo=r,r=Ns(ju,"onSelect"),0<r.length&&(t=new As("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Ki)))}function Ir(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Pi={animationend:Ir("Animation","AnimationEnd"),animationiteration:Ir("Animation","AnimationIteration"),animationstart:Ir("Animation","AnimationStart"),transitionrun:Ir("Transition","TransitionRun"),transitionstart:Ir("Transition","TransitionStart"),transitioncancel:Ir("Transition","TransitionCancel"),transitionend:Ir("Transition","TransitionEnd")},nu={},lg={};lr&&(lg=document.createElement("div").style,"AnimationEvent"in window||(delete Pi.animationend.animation,delete Pi.animationiteration.animation,delete Pi.animationstart.animation),"TransitionEvent"in window||delete Pi.transitionend.transition);function fi(e){if(nu[e])return nu[e];if(!Pi[e])return e;var t=Pi[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in lg)return nu[e]=t[a];return e}var sg=fi("animationend"),cg=fi("animationiteration"),ug=fi("animationstart"),Py=fi("transitionrun"),Jy=fi("transitionstart"),Iy=fi("transitioncancel"),pg=fi("transitionend"),dg=new Map,$u="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(" ");$u.push("scrollEnd");function Ea(e,t){dg.set(e,t),di(t,[e])}var ss=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)},pa=[],Ji=0,Dp=0;function Os(){for(var e=Ji,t=Dp=Ji=0;t<e;){var a=pa[t];pa[t++]=null;var r=pa[t];pa[t++]=null;var i=pa[t];pa[t++]=null;var n=pa[t];if(pa[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}n!==0&&mg(a,i,n)}}function Bs(e,t,a,r){pa[Ji++]=e,pa[Ji++]=t,pa[Ji++]=a,pa[Ji++]=r,Dp|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Op(e,t,a,r){return Bs(e,t,a,r),cs(e)}function hi(e,t){return Bs(e,null,null,t),cs(e)}function mg(e,t,a){e.lanes|=a;var r=e.alternate;r!==null&&(r.lanes|=a);for(var i=!1,n=e.return;n!==null;)n.childLanes|=a,r=n.alternate,r!==null&&(r.childLanes|=a),n.tag===22&&(e=n.stateNode,e===null||e._visibility&1||(i=!0)),e=n,n=n.return;return e.tag===3?(n=e.stateNode,i&&t!==null&&(i=31-oa(a),e=n.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=a|536870912),n):null}function cs(e){if(50<qo)throw qo=0,pp=null,Error(H(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ii={};function Fy(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 aa(e,t,a,r){return new Fy(e,t,a,r)}function Bp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ir(e,t){var a=e.alternate;return a===null?(a=aa(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 fg(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 Xl(e,t,a,r,i,n){var o=0;if(r=e,typeof e=="function")Bp(e)&&(o=1);else if(typeof e=="string")o=t_(e,a,Ba.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case zu:return e=aa(31,a,t,i),e.elementType=zu,e.lanes=n,e;case Yi:return ri(a.children,i,n,t);case Ah:o=8,i|=24;break;case Eu:return e=aa(12,a,t,i|2),e.elementType=Eu,e.lanes=n,e;case Mu:return e=aa(13,a,t,i),e.elementType=Mu,e.lanes=n,e;case Tu:return e=aa(19,a,t,i),e.elementType=Tu,e.lanes=n,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case tr:o=10;break e;case Uh:o=9;break e;case kp:o=11;break e;case Sp:o=14;break e;case wr:o=16,r=null;break e}o=29,a=Error(H(130,e===null?"null":typeof e,"")),r=null}return t=aa(o,a,t,i),t.elementType=e,t.type=r,t.lanes=n,t}function ri(e,t,a,r){return e=aa(7,e,r,t),e.lanes=a,e}function ou(e,t,a){return e=aa(6,e,null,t),e.lanes=a,e}function hg(e){var t=aa(18,null,null,0);return t.stateNode=e,t}function lu(e,t,a){return t=aa(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Nf=new WeakMap;function ga(e,t){if(typeof e=="object"&&e!==null){var a=Nf.get(e);return a!==void 0?a:(t={value:e,source:t,stack:of(t)},Nf.set(e,t),t)}return{value:e,source:t,stack:of(t)}}var Fi=[],Wi=0,us=null,Ao=0,ma=[],fa=0,Lr=null,Ua=1,Da="";function Wa(e,t){Fi[Wi++]=Ao,Fi[Wi++]=us,us=e,Ao=t}function gg(e,t,a){ma[fa++]=Ua,ma[fa++]=Da,ma[fa++]=Lr,Lr=e;var r=Ua;e=Da;var i=32-oa(r)-1;r&=~(1<<i),a+=1;var n=32-oa(t)+i;if(30<n){var o=i-i%5;n=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ua=1<<32-oa(t)+i|a<<i|r,Da=n+e}else Ua=1<<n|a<<i|r,Da=e}function Lp(e){e.return!==null&&(Wa(e,1),gg(e,1,0))}function Hp(e){for(;e===us;)us=Fi[--Wi],Fi[Wi]=null,Ao=Fi[--Wi],Fi[Wi]=null;for(;e===Lr;)Lr=ma[--fa],ma[fa]=null,Da=ma[--fa],ma[fa]=null,Ua=ma[--fa],ma[fa]=null}function bg(e,t){ma[fa++]=Ua,ma[fa++]=Da,ma[fa++]=Lr,Ua=t.id,Da=t.overflow,Lr=e}var Et=null,Fe=null,Se=!1,Tr=null,ba=!1,Vu=Error(H(519));function Hr(e){var t=Error(H(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Uo(ga(t,e)),Vu}function Cf(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[qt]=e,t[Pt]=r,a){case"dialog":we("cancel",t),we("close",t);break;case"iframe":case"object":case"embed":we("load",t);break;case"video":case"audio":for(a=0;a<Lo.length;a++)we(Lo[a],t);break;case"source":we("error",t);break;case"img":case"image":case"link":we("error",t),we("load",t);break;case"details":we("toggle",t);break;case"input":we("invalid",t),Zh(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":we("invalid",t);break;case"textarea":we("invalid",t),Ph(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||Wb(t.textContent,a)?(r.popover!=null&&(we("beforetoggle",t),we("toggle",t)),r.onScroll!=null&&we("scroll",t),r.onScrollEnd!=null&&we("scrollend",t),r.onClick!=null&&(t.onclick=ar),t=!0):t=!1,t||Hr(e,!0)}function qf(e){for(Et=e.return;Et;)switch(Et.tag){case 5:case 31:case 13:ba=!1;return;case 27:case 3:ba=!0;return;default:Et=Et.return}}function Hi(e){if(e!==Et)return!1;if(!Se)return qf(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")||gp(e.type,e.memoizedProps)),a=!a),a&&Fe&&Hr(e),qf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));Fe=hh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));Fe=hh(e)}else t===27?(t=Fe,Yr(e.type)?(e=yp,yp=null,Fe=e):Fe=t):Fe=Et?va(e.stateNode.nextSibling):null;return!0}function li(){Fe=Et=null,Se=!1}function su(){var e=Tr;return e!==null&&(Zt===null?Zt=e:Zt.push.apply(Zt,e),Tr=null),e}function Uo(e){Tr===null?Tr=[e]:Tr.push(e)}var Xu=La(null),gi=null,rr=null;function yr(e,t,a){Ke(Xu,t._currentValue),t._currentValue=a}function nr(e){e._currentValue=Xu.current,St(Xu)}function Zu(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 Ku(e,t,a,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var n=i.dependencies;if(n!==null){var o=i.child;n=n.firstContext;e:for(;n!==null;){var l=n;n=i;for(var c=0;c<t.length;c++)if(l.context===t[c]){n.lanes|=a,l=n.alternate,l!==null&&(l.lanes|=a),Zu(n.return,a,e),r||(o=null);break e}n=l.next}}else if(i.tag===18){if(o=i.return,o===null)throw Error(H(341));o.lanes|=a,n=o.alternate,n!==null&&(n.lanes|=a),Zu(o,a,e),o=null}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}}function xn(e,t,a,r){e=null;for(var i=t,n=!1;i!==null;){if(!n){if((i.flags&524288)!==0)n=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var o=i.alternate;if(o===null)throw Error(H(387));if(o=o.memoizedProps,o!==null){var l=i.type;sa(i.pendingProps.value,o.value)||(e!==null?e.push(l):e=[l])}}else if(i===rs.current){if(o=i.alternate,o===null)throw Error(H(387));o.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Qo):e=[Qo])}i=i.return}e!==null&&Ku(t,e,a,r),t.flags|=262144}function ps(e){for(e=e.firstContext;e!==null;){if(!sa(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function si(e){gi=e,rr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Mt(e){return wg(gi,e)}function Rl(e,t){return gi===null&&si(e),wg(e,t)}function wg(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},rr===null){if(e===null)throw Error(H(308));rr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else rr=rr.next=t;return a}var Wy=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()})}},e1=bt.unstable_scheduleCallback,t1=bt.unstable_NormalPriority,pt={$$typeof:tr,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qp(){return{controller:new Wy,data:new Map,refCount:0}}function Po(e){e.refCount--,e.refCount===0&&e1(t1,function(){e.controller.abort()})}var vo=null,Pu=0,dn=0,nn=null;function a1(e,t){if(vo===null){var a=vo=[];Pu=0,dn=pd(),nn={status:"pending",value:void 0,then:function(r){a.push(r)}}}return Pu++,t.then(Ef,Ef),t}function Ef(){if(--Pu===0&&vo!==null){nn!==null&&(nn.status="fulfilled");var e=vo;vo=null,dn=0,nn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function r1(e,t){var a=[],r={status:"pending",value:null,reason:null,then:function(i){a.push(i)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var i=0;i<a.length;i++)(0,a[i])(t)},function(i){for(r.status="rejected",r.reason=i,i=0;i<a.length;i++)(0,a[i])(void 0)}),r}var Mf=se.S;se.S=function(e,t){Rb=ia(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&a1(e,t),Mf!==null&&Mf(e,t)};var ii=La(null);function Gp(){var e=ii.current;return e!==null?e:Xe.pooledCache}function Zl(e,t){t===null?Ke(ii,ii.current):Ke(ii,t.pool)}function vg(){var e=Gp();return e===null?null:{parent:pt._currentValue,pool:e}}var kn=Error(H(460)),jp=Error(H(474)),Ls=Error(H(542)),ds={then:function(){}};function Tf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function yg(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(ar,ar),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rf(e),e;default:if(typeof t.status=="string")t.then(ar,ar);else{if(e=Xe,e!==null&&100<e.shellSuspendCounter)throw Error(H(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=r}},function(r){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rf(e),e}throw ni=t,kn}}function ei(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(ni=a,kn):a}}var ni=null;function zf(){if(ni===null)throw Error(H(459));var e=ni;return ni=null,e}function Rf(e){if(e===kn||e===Ls)throw Error(H(483))}var on=null,Do=0;function Al(e){var t=Do;return Do+=1,on===null&&(on=[]),yg(on,e,t)}function no(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ul(e,t){throw t.$$typeof===Y0?Error(H(525)):(e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function _g(e){function t(f,u){if(e){var g=f.deletions;g===null?(f.deletions=[u],f.flags|=16):g.push(u)}}function a(f,u){if(!e)return null;for(;u!==null;)t(f,u),u=u.sibling;return null}function r(f){for(var u=new Map;f!==null;)f.key!==null?u.set(f.key,f):u.set(f.index,f),f=f.sibling;return u}function i(f,u){return f=ir(f,u),f.index=0,f.sibling=null,f}function n(f,u,g){return f.index=g,e?(g=f.alternate,g!==null?(g=g.index,g<u?(f.flags|=67108866,u):g):(f.flags|=67108866,u)):(f.flags|=1048576,u)}function o(f){return e&&f.alternate===null&&(f.flags|=67108866),f}function l(f,u,g,w){return u===null||u.tag!==6?(u=ou(g,f.mode,w),u.return=f,u):(u=i(u,g),u.return=f,u)}function c(f,u,g,w){var k=g.type;return k===Yi?m(f,u,g.props.children,w,g.key):u!==null&&(u.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===wr&&ei(k)===u.type)?(u=i(u,g.props),no(u,g),u.return=f,u):(u=Xl(g.type,g.key,g.props,null,f.mode,w),no(u,g),u.return=f,u)}function p(f,u,g,w){return u===null||u.tag!==4||u.stateNode.containerInfo!==g.containerInfo||u.stateNode.implementation!==g.implementation?(u=lu(g,f.mode,w),u.return=f,u):(u=i(u,g.children||[]),u.return=f,u)}function m(f,u,g,w,k){return u===null||u.tag!==7?(u=ri(g,f.mode,w,k),u.return=f,u):(u=i(u,g),u.return=f,u)}function h(f,u,g){if(typeof u=="string"&&u!==""||typeof u=="number"||typeof u=="bigint")return u=ou(""+u,f.mode,g),u.return=f,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case Sl:return g=Xl(u.type,u.key,u.props,null,f.mode,g),no(g,u),g.return=f,g;case uo:return u=lu(u,f.mode,g),u.return=f,u;case wr:return u=ei(u),h(f,u,g)}if(po(u)||ro(u))return u=ri(u,f.mode,g,null),u.return=f,u;if(typeof u.then=="function")return h(f,Al(u),g);if(u.$$typeof===tr)return h(f,Rl(f,u),g);Ul(f,u)}return null}function d(f,u,g,w){var k=u!==null?u.key:null;if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return k!==null?null:l(f,u,""+g,w);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Sl:return g.key===k?c(f,u,g,w):null;case uo:return g.key===k?p(f,u,g,w):null;case wr:return g=ei(g),d(f,u,g,w)}if(po(g)||ro(g))return k!==null?null:m(f,u,g,w,null);if(typeof g.then=="function")return d(f,u,Al(g),w);if(g.$$typeof===tr)return d(f,u,Rl(f,g),w);Ul(f,g)}return null}function b(f,u,g,w,k){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return f=f.get(g)||null,l(u,f,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Sl:return f=f.get(w.key===null?g:w.key)||null,c(u,f,w,k);case uo:return f=f.get(w.key===null?g:w.key)||null,p(u,f,w,k);case wr:return w=ei(w),b(f,u,g,w,k)}if(po(w)||ro(w))return f=f.get(g)||null,m(u,f,w,k,null);if(typeof w.then=="function")return b(f,u,g,Al(w),k);if(w.$$typeof===tr)return b(f,u,g,Rl(u,w),k);Ul(u,w)}return null}function v(f,u,g,w){for(var k=null,T=null,R=u,U=u=0,A=null;R!==null&&U<g.length;U++){R.index>U?(A=R,R=null):A=R.sibling;var Q=d(f,R,g[U],w);if(Q===null){R===null&&(R=A);break}e&&R&&Q.alternate===null&&t(f,R),u=n(Q,u,U),T===null?k=Q:T.sibling=Q,T=Q,R=A}if(U===g.length)return a(f,R),Se&&Wa(f,U),k;if(R===null){for(;U<g.length;U++)R=h(f,g[U],w),R!==null&&(u=n(R,u,U),T===null?k=R:T.sibling=R,T=R);return Se&&Wa(f,U),k}for(R=r(R);U<g.length;U++)A=b(R,f,U,g[U],w),A!==null&&(e&&A.alternate!==null&&R.delete(A.key===null?U:A.key),u=n(A,u,U),T===null?k=A:T.sibling=A,T=A);return e&&R.forEach(function(ie){return t(f,ie)}),Se&&Wa(f,U),k}function q(f,u,g,w){if(g==null)throw Error(H(151));for(var k=null,T=null,R=u,U=u=0,A=null,Q=g.next();R!==null&&!Q.done;U++,Q=g.next()){R.index>U?(A=R,R=null):A=R.sibling;var ie=d(f,R,Q.value,w);if(ie===null){R===null&&(R=A);break}e&&R&&ie.alternate===null&&t(f,R),u=n(ie,u,U),T===null?k=ie:T.sibling=ie,T=ie,R=A}if(Q.done)return a(f,R),Se&&Wa(f,U),k;if(R===null){for(;!Q.done;U++,Q=g.next())Q=h(f,Q.value,w),Q!==null&&(u=n(Q,u,U),T===null?k=Q:T.sibling=Q,T=Q);return Se&&Wa(f,U),k}for(R=r(R);!Q.done;U++,Q=g.next())Q=b(R,f,U,Q.value,w),Q!==null&&(e&&Q.alternate!==null&&R.delete(Q.key===null?U:Q.key),u=n(Q,u,U),T===null?k=Q:T.sibling=Q,T=Q);return e&&R.forEach(function(qe){return t(f,qe)}),Se&&Wa(f,U),k}function O(f,u,g,w){if(typeof g=="object"&&g!==null&&g.type===Yi&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Sl:e:{for(var k=g.key;u!==null;){if(u.key===k){if(k=g.type,k===Yi){if(u.tag===7){a(f,u.sibling),w=i(u,g.props.children),w.return=f,f=w;break e}}else if(u.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===wr&&ei(k)===u.type){a(f,u.sibling),w=i(u,g.props),no(w,g),w.return=f,f=w;break e}a(f,u);break}else t(f,u);u=u.sibling}g.type===Yi?(w=ri(g.props.children,f.mode,w,g.key),w.return=f,f=w):(w=Xl(g.type,g.key,g.props,null,f.mode,w),no(w,g),w.return=f,f=w)}return o(f);case uo:e:{for(k=g.key;u!==null;){if(u.key===k)if(u.tag===4&&u.stateNode.containerInfo===g.containerInfo&&u.stateNode.implementation===g.implementation){a(f,u.sibling),w=i(u,g.children||[]),w.return=f,f=w;break e}else{a(f,u);break}else t(f,u);u=u.sibling}w=lu(g,f.mode,w),w.return=f,f=w}return o(f);case wr:return g=ei(g),O(f,u,g,w)}if(po(g))return v(f,u,g,w);if(ro(g)){if(k=ro(g),typeof k!="function")throw Error(H(150));return g=k.call(g),q(f,u,g,w)}if(typeof g.then=="function")return O(f,u,Al(g),w);if(g.$$typeof===tr)return O(f,u,Rl(f,g),w);Ul(f,g)}return typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint"?(g=""+g,u!==null&&u.tag===6?(a(f,u.sibling),w=i(u,g),w.return=f,f=w):(a(f,u),w=ou(g,f.mode,w),w.return=f,f=w),o(f)):a(f,u)}return function(f,u,g,w){try{Do=0;var k=O(f,u,g,w);return on=null,k}catch(R){if(R===kn||R===Ls)throw R;var T=aa(29,R,null,f.mode);return T.lanes=w,T.return=f,T}}}var ci=_g(!0),xg=_g(!1),vr=!1;function Yp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ju(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 zr(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,(Re&2)!==0){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=cs(e),mg(e,null,a),t}return Bs(e,r,t,a),cs(e)}function yo(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,Qh(e,a)}}function cu(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var i=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var o={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};n===null?i=n=o:n=n.next=o,a=a.next}while(a!==null);n===null?i=n=t:n=n.next=t}else i=n=t;a={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:n,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 Iu=!1;function _o(){if(Iu){var e=nn;if(e!==null)throw e}}function xo(e,t,a,r){Iu=!1;var i=e.updateQueue;vr=!1;var n=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,p=c.next;c.next=null,o===null?n=p:o.next=p,o=c;var m=e.alternate;m!==null&&(m=m.updateQueue,l=m.lastBaseUpdate,l!==o&&(l===null?m.firstBaseUpdate=p:l.next=p,m.lastBaseUpdate=c))}if(n!==null){var h=i.baseState;o=0,m=p=c=null,l=n;do{var d=l.lane&-536870913,b=d!==l.lane;if(b?(ke&d)===d:(r&d)===d){d!==0&&d===dn&&(Iu=!0),m!==null&&(m=m.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var v=e,q=l;d=t;var O=a;switch(q.tag){case 1:if(v=q.payload,typeof v=="function"){h=v.call(O,h,d);break e}h=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=q.payload,d=typeof v=="function"?v.call(O,h,d):v,d==null)break e;h=We({},h,d);break e;case 2:vr=!0}}d=l.callback,d!==null&&(e.flags|=64,b&&(e.flags|=8192),b=i.callbacks,b===null?i.callbacks=[d]:b.push(d))}else b={lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},m===null?(p=m=b,c=h):m=m.next=b,o|=d;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;b=l,l=b.next,b.next=null,i.lastBaseUpdate=b,i.shared.pending=null}}while(!0);m===null&&(c=h),i.baseState=c,i.firstBaseUpdate=p,i.lastBaseUpdate=m,n===null&&(i.shared.lanes=0),Gr|=o,e.lanes=o,e.memoizedState=h}}function kg(e,t){if(typeof e!="function")throw Error(H(191,e));e.call(t)}function Sg(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)kg(a[e],t)}var mn=La(null),ms=La(0);function Af(e,t){e=pr,Ke(ms,e),Ke(mn,t),pr=e|t.baseLanes}function Fu(){Ke(ms,pr),Ke(mn,mn.current)}function $p(){pr=ms.current,St(mn),St(ms)}var ca=La(null),wa=null;function _r(e){var t=e.alternate;Ke(lt,lt.current&1),Ke(ca,e),wa===null&&(t===null||mn.current!==null||t.memoizedState!==null)&&(wa=e)}function Wu(e){Ke(lt,lt.current),Ke(ca,e),wa===null&&(wa=e)}function Ng(e){e.tag===22?(Ke(lt,lt.current),Ke(ca,e),wa===null&&(wa=e)):xr(e)}function xr(){Ke(lt,lt.current),Ke(ca,ca.current)}function ta(e){St(ca),wa===e&&(wa=null),St(lt)}var lt=La(0);function fs(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)||vp(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 sr=0,fe=null,Ve=null,ct=null,hs=!1,ln=!1,ui=!1,gs=0,Oo=0,sn=null,i1=0;function rt(){throw Error(H(321))}function Vp(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!sa(e[a],t[a]))return!1;return!0}function Xp(e,t,a,r,i,n){return sr=n,fe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,se.H=e===null||e.memoizedState===null?ab:rd,ui=!1,n=a(r,i),ui=!1,ln&&(n=qg(t,a,r,i)),Cg(e),n}function Cg(e){se.H=Bo;var t=Ve!==null&&Ve.next!==null;if(sr=0,ct=Ve=fe=null,hs=!1,Oo=0,sn=null,t)throw Error(H(300));e===null||dt||(e=e.dependencies,e!==null&&ps(e)&&(dt=!0))}function qg(e,t,a,r){fe=e;var i=0;do{if(ln&&(sn=null),Oo=0,ln=!1,25<=i)throw Error(H(301));if(i+=1,ct=Ve=null,e.updateQueue!=null){var n=e.updateQueue;n.lastEffect=null,n.events=null,n.stores=null,n.memoCache!=null&&(n.memoCache.index=0)}se.H=rb,n=t(a,r)}while(ln);return n}function n1(){var e=se.H,t=e.useState()[0];return t=typeof t.then=="function"?Jo(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(fe.flags|=1024),t}function Zp(){var e=gs!==0;return gs=0,e}function Kp(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Pp(e){if(hs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}hs=!1}sr=0,ct=Ve=fe=null,ln=!1,Oo=gs=0,sn=null}function Ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ct===null?fe.memoizedState=ct=e:ct=ct.next=e,ct}function st(){if(Ve===null){var e=fe.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=ct===null?fe.memoizedState:ct.next;if(t!==null)ct=t,Ve=e;else{if(e===null)throw fe.alternate===null?Error(H(467)):Error(H(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},ct===null?fe.memoizedState=ct=e:ct=ct.next=e}return ct}function Hs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Jo(e){var t=Oo;return Oo+=1,sn===null&&(sn=[]),e=yg(sn,e,t),t=fe,(ct===null?t.memoizedState:ct.next)===null&&(t=t.alternate,se.H=t===null||t.memoizedState===null?ab:rd),e}function Qs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Jo(e);if(e.$$typeof===tr)return Mt(e)}throw Error(H(438,String(e)))}function Jp(e){var t=null,a=fe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var r=fe.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Hs(),fe.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]=$0;return t.index++,a}function cr(e,t){return typeof t=="function"?t(e):t}function Kl(e){var t=st();return Ip(t,Ve,e)}function Ip(e,t,a){var r=e.queue;if(r===null)throw Error(H(311));r.lastRenderedReducer=a;var i=e.baseQueue,n=r.pending;if(n!==null){if(i!==null){var o=i.next;i.next=n.next,n.next=o}t.baseQueue=i=n,r.pending=null}if(n=e.baseState,i===null)e.memoizedState=n;else{t=i.next;var l=o=null,c=null,p=t,m=!1;do{var h=p.lane&-536870913;if(h!==p.lane?(ke&h)===h:(sr&h)===h){var d=p.revertLane;if(d===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null}),h===dn&&(m=!0);else if((sr&d)===d){p=p.next,d===dn&&(m=!0);continue}else h={lane:0,revertLane:p.revertLane,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=h,o=n):c=c.next=h,fe.lanes|=d,Gr|=d;h=p.action,ui&&a(n,h),n=p.hasEagerState?p.eagerState:a(n,h)}else d={lane:h,revertLane:p.revertLane,gesture:p.gesture,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=d,o=n):c=c.next=d,fe.lanes|=h,Gr|=h;p=p.next}while(p!==null&&p!==t);if(c===null?o=n:c.next=l,!sa(n,e.memoizedState)&&(dt=!0,m&&(a=nn,a!==null)))throw a;e.memoizedState=n,e.baseState=o,e.baseQueue=c,r.lastRenderedState=n}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function uu(e){var t=st(),a=t.queue;if(a===null)throw Error(H(311));a.lastRenderedReducer=e;var r=a.dispatch,i=a.pending,n=t.memoizedState;if(i!==null){a.pending=null;var o=i=i.next;do n=e(n,o.action),o=o.next;while(o!==i);sa(n,t.memoizedState)||(dt=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function Eg(e,t,a){var r=fe,i=st(),n=Se;if(n){if(a===void 0)throw Error(H(407));a=a()}else a=t();var o=!sa((Ve||i).memoizedState,a);if(o&&(i.memoizedState=a,dt=!0),i=i.queue,Fp(zg.bind(null,r,i,e),[e]),i.getSnapshot!==t||o||ct!==null&&ct.memoizedState.tag&1){if(r.flags|=2048,fn(9,{destroy:void 0},Tg.bind(null,r,i,a,t),null),Xe===null)throw Error(H(349));n||(sr&127)!==0||Mg(r,t,a)}return a}function Mg(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=fe.updateQueue,t===null?(t=Hs(),fe.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Tg(e,t,a,r){t.value=a,t.getSnapshot=r,Rg(t)&&Ag(e)}function zg(e,t,a){return a(function(){Rg(t)&&Ag(e)})}function Rg(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!sa(e,a)}catch{return!0}}function Ag(e){var t=hi(e,2);t!==null&&Kt(t,e,2)}function ep(e){var t=Ht();if(typeof e=="function"){var a=e;if(e=a(),ui){Sr(!0);try{a()}finally{Sr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:e},t}function Ug(e,t,a,r){return e.baseState=a,Ip(e,Ve,typeof r=="function"?r:cr)}function o1(e,t,a,r,i){if(js(e))throw Error(H(485));if(e=t.action,e!==null){var n={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){n.listeners.push(o)}};se.T!==null?a(!0):n.isTransition=!1,r(n),a=t.pending,a===null?(n.next=t.pending=n,Dg(t,n)):(n.next=a.next,t.pending=a.next=n)}}function Dg(e,t){var a=t.action,r=t.payload,i=e.state;if(t.isTransition){var n=se.T,o={};se.T=o;try{var l=a(i,r),c=se.S;c!==null&&c(o,l),Uf(e,t,l)}catch(p){tp(e,t,p)}finally{n!==null&&o.types!==null&&(n.types=o.types),se.T=n}}else try{n=a(i,r),Uf(e,t,n)}catch(p){tp(e,t,p)}}function Uf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){Df(e,t,r)},function(r){return tp(e,t,r)}):Df(e,t,a)}function Df(e,t,a){t.status="fulfilled",t.value=a,Og(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Dg(e,a)))}function tp(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,Og(t),t=t.next;while(t!==r)}e.action=null}function Og(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Bg(e,t){return t}function Of(e,t){if(Se){var a=Xe.formState;if(a!==null){e:{var r=fe;if(Se){if(Fe){t:{for(var i=Fe,n=ba;i.nodeType!==8;){if(!n){i=null;break t}if(i=va(i.nextSibling),i===null){i=null;break t}}n=i.data,i=n==="F!"||n==="F"?i:null}if(i){Fe=va(i.nextSibling),r=i.data==="F!";break e}}Hr(r)}r=!1}r&&(t=a[0])}}return a=Ht(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bg,lastRenderedState:t},a.queue=r,a=Wg.bind(null,fe,r),r.dispatch=a,r=ep(!1),n=ad.bind(null,fe,!1,r.queue),r=Ht(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,a=o1.bind(null,fe,i,n,a),i.dispatch=a,r.memoizedState=e,[t,a,!1]}function Bf(e){var t=st();return Lg(t,Ve,e)}function Lg(e,t,a){if(t=Ip(e,t,Bg)[0],e=Kl(cr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Jo(t)}catch(o){throw o===kn?Ls:o}else r=t;t=st();var i=t.queue,n=i.dispatch;return a!==t.memoizedState&&(fe.flags|=2048,fn(9,{destroy:void 0},l1.bind(null,i,a),null)),[r,n,e]}function l1(e,t){e.action=t}function Lf(e){var t=st(),a=Ve;if(a!==null)return Lg(t,a,e);st(),t=t.memoizedState,a=st();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function fn(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=fe.updateQueue,t===null&&(t=Hs(),fe.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 Hg(){return st().memoizedState}function Pl(e,t,a,r){var i=Ht();fe.flags|=e,i.memoizedState=fn(1|t,{destroy:void 0},a,r===void 0?null:r)}function Gs(e,t,a,r){var i=st();r=r===void 0?null:r;var n=i.memoizedState.inst;Ve!==null&&r!==null&&Vp(r,Ve.memoizedState.deps)?i.memoizedState=fn(t,n,a,r):(fe.flags|=e,i.memoizedState=fn(1|t,n,a,r))}function Hf(e,t){Pl(8390656,8,e,t)}function Fp(e,t){Gs(2048,8,e,t)}function s1(e){fe.flags|=4;var t=fe.updateQueue;if(t===null)t=Hs(),fe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Qg(e){var t=st().memoizedState;return s1({ref:t,nextImpl:e}),function(){if((Re&2)!==0)throw Error(H(440));return t.impl.apply(void 0,arguments)}}function Gg(e,t){return Gs(4,2,e,t)}function jg(e,t){return Gs(4,4,e,t)}function Yg(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 $g(e,t,a){a=a!=null?a.concat([e]):null,Gs(4,4,Yg.bind(null,t,e),a)}function Wp(){}function Vg(e,t){var a=st();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&Vp(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function Xg(e,t){var a=st();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&Vp(t,r[1]))return r[0];if(r=e(),ui){Sr(!0);try{e()}finally{Sr(!1)}}return a.memoizedState=[r,t],r}function ed(e,t,a){return a===void 0||(sr&1073741824)!==0&&(ke&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Ub(),fe.lanes|=e,Gr|=e,a)}function Zg(e,t,a,r){return sa(a,t)?a:mn.current!==null?(e=ed(e,a,r),sa(e,t)||(dt=!0),e):(sr&42)===0||(sr&1073741824)!==0&&(ke&261930)===0?(dt=!0,e.memoizedState=a):(e=Ub(),fe.lanes|=e,Gr|=e,t)}function Kg(e,t,a,r,i){var n=Ae.p;Ae.p=n!==0&&8>n?n:8;var o=se.T,l={};se.T=l,ad(e,!1,t,a);try{var c=i(),p=se.S;if(p!==null&&p(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var m=r1(c,r);ko(e,t,m,la(e))}else ko(e,t,r,la(e))}catch(h){ko(e,t,{then:function(){},status:"rejected",reason:h},la())}finally{Ae.p=n,o!==null&&l.types!==null&&(o.types=l.types),se.T=o}}function c1(){}function ap(e,t,a,r){if(e.tag!==5)throw Error(H(476));var i=Pg(e).queue;Kg(e,i,t,ai,a===null?c1:function(){return Jg(e),a(r)})}function Pg(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ai,baseState:ai,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:ai},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Jg(e){var t=Pg(e);t.next===null&&(t=e.alternate.memoizedState),ko(e,t.next.queue,{},la())}function td(){return Mt(Qo)}function Ig(){return st().memoizedState}function Fg(){return st().memoizedState}function u1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=la();e=zr(a);var r=Rr(t,e,a);r!==null&&(Kt(r,t,a),yo(r,t,a)),t={cache:Qp()},e.payload=t;return}t=t.return}}function p1(e,t,a){var r=la();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},js(e)?eb(t,a):(a=Op(e,t,a,r),a!==null&&(Kt(a,e,r),tb(a,t,r)))}function Wg(e,t,a){var r=la();ko(e,t,a,r)}function ko(e,t,a,r){var i={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(js(e))eb(t,i);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var o=t.lastRenderedState,l=n(o,a);if(i.hasEagerState=!0,i.eagerState=l,sa(l,o))return Bs(e,t,i,0),Xe===null&&Os(),!1}catch{}if(a=Op(e,t,i,r),a!==null)return Kt(a,e,r),tb(a,t,r),!0}return!1}function ad(e,t,a,r){if(r={lane:2,revertLane:pd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},js(e)){if(t)throw Error(H(479))}else t=Op(e,a,r,2),t!==null&&Kt(t,e,2)}function js(e){var t=e.alternate;return e===fe||t!==null&&t===fe}function eb(e,t){ln=hs=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function tb(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Qh(e,a)}}var Bo={readContext:Mt,use:Qs,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};Bo.useEffectEvent=rt;var ab={readContext:Mt,use:Qs,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:Mt,useEffect:Hf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Pl(4194308,4,Yg.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Pl(4194308,4,e,t)},useInsertionEffect:function(e,t){Pl(4,2,e,t)},useMemo:function(e,t){var a=Ht();t=t===void 0?null:t;var r=e();if(ui){Sr(!0);try{e()}finally{Sr(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=Ht();if(a!==void 0){var i=a(t);if(ui){Sr(!0);try{a(t)}finally{Sr(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=p1.bind(null,fe,e),[r.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:function(e){e=ep(e);var t=e.queue,a=Wg.bind(null,fe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Wp,useDeferredValue:function(e,t){var a=Ht();return ed(a,e,t)},useTransition:function(){var e=ep(!1);return e=Kg.bind(null,fe,e.queue,!0,!1),Ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=fe,i=Ht();if(Se){if(a===void 0)throw Error(H(407));a=a()}else{if(a=t(),Xe===null)throw Error(H(349));(ke&127)!==0||Mg(r,t,a)}i.memoizedState=a;var n={value:a,getSnapshot:t};return i.queue=n,Hf(zg.bind(null,r,n,e),[e]),r.flags|=2048,fn(9,{destroy:void 0},Tg.bind(null,r,n,a,t),null),a},useId:function(){var e=Ht(),t=Xe.identifierPrefix;if(Se){var a=Da,r=Ua;a=(r&~(1<<32-oa(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=gs++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=i1++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:td,useFormState:Of,useActionState:Of,useOptimistic:function(e){var t=Ht();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=ad.bind(null,fe,!0,a),a.dispatch=t,[e,t]},useMemoCache:Jp,useCacheRefresh:function(){return Ht().memoizedState=u1.bind(null,fe)},useEffectEvent:function(e){var t=Ht(),a={impl:e};return t.memoizedState=a,function(){if((Re&2)!==0)throw Error(H(440));return a.impl.apply(void 0,arguments)}}},rd={readContext:Mt,use:Qs,useCallback:Vg,useContext:Mt,useEffect:Fp,useImperativeHandle:$g,useInsertionEffect:Gg,useLayoutEffect:jg,useMemo:Xg,useReducer:Kl,useRef:Hg,useState:function(){return Kl(cr)},useDebugValue:Wp,useDeferredValue:function(e,t){var a=st();return Zg(a,Ve.memoizedState,e,t)},useTransition:function(){var e=Kl(cr)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Jo(e),t]},useSyncExternalStore:Eg,useId:Ig,useHostTransitionStatus:td,useFormState:Bf,useActionState:Bf,useOptimistic:function(e,t){var a=st();return Ug(a,Ve,e,t)},useMemoCache:Jp,useCacheRefresh:Fg};rd.useEffectEvent=Qg;var rb={readContext:Mt,use:Qs,useCallback:Vg,useContext:Mt,useEffect:Fp,useImperativeHandle:$g,useInsertionEffect:Gg,useLayoutEffect:jg,useMemo:Xg,useReducer:uu,useRef:Hg,useState:function(){return uu(cr)},useDebugValue:Wp,useDeferredValue:function(e,t){var a=st();return Ve===null?ed(a,e,t):Zg(a,Ve.memoizedState,e,t)},useTransition:function(){var e=uu(cr)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Jo(e),t]},useSyncExternalStore:Eg,useId:Ig,useHostTransitionStatus:td,useFormState:Lf,useActionState:Lf,useOptimistic:function(e,t){var a=st();return Ve!==null?Ug(a,Ve,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Jp,useCacheRefresh:Fg};rb.useEffectEvent=Qg;function pu(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:We({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var rp={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=la(),i=zr(r);i.payload=t,a!=null&&(i.callback=a),t=Rr(e,i,r),t!==null&&(Kt(t,e,r),yo(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=la(),i=zr(r);i.tag=1,i.payload=t,a!=null&&(i.callback=a),t=Rr(e,i,r),t!==null&&(Kt(t,e,r),yo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=la(),r=zr(a);r.tag=2,t!=null&&(r.callback=t),t=Rr(e,r,a),t!==null&&(Kt(t,e,a),yo(t,e,a))}};function Qf(e,t,a,r,i,n,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,n,o):t.prototype&&t.prototype.isPureReactComponent?!Ro(a,r)||!Ro(i,n):!0}function Gf(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&&rp.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=We({},a));for(var i in e)a[i]===void 0&&(a[i]=e[i])}return a}function ib(e){ss(e)}function nb(e){console.error(e)}function ob(e){ss(e)}function bs(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function jf(e,t,a){try{var r=e.onCaughtError;r(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function ip(e,t,a){return a=zr(a),a.tag=3,a.payload={element:null},a.callback=function(){bs(e,t)},a}function lb(e){return e=zr(e),e.tag=3,e}function sb(e,t,a,r){var i=a.type.getDerivedStateFromError;if(typeof i=="function"){var n=r.value;e.payload=function(){return i(n)},e.callback=function(){jf(t,a,r)}}var o=a.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){jf(t,a,r),typeof i!="function"&&(Ar===null?Ar=new Set([this]):Ar.add(this));var l=r.stack;this.componentDidCatch(r.value,{componentStack:l!==null?l:""})})}function d1(e,t,a,r,i){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&xn(t,a,i,!0),a=ca.current,a!==null){switch(a.tag){case 31:case 13:return wa===null?xs():a.alternate===null&&it===0&&(it=3),a.flags&=-257,a.flags|=65536,a.lanes=i,r===ds?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),xu(e,r,i)),!1;case 22:return a.flags|=65536,r===ds?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)),xu(e,r,i)),!1}throw Error(H(435,a.tag))}return xu(e,r,i),xs(),!1}if(Se)return t=ca.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Vu&&(e=Error(H(422),{cause:r}),Uo(ga(e,a)))):(r!==Vu&&(t=Error(H(423),{cause:r}),Uo(ga(t,a))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=ga(r,a),i=ip(e.stateNode,r,i),cu(e,i),it!==4&&(it=2)),!1;var n=Error(H(520),{cause:r});if(n=ga(n,a),Co===null?Co=[n]:Co.push(n),it!==4&&(it=2),t===null)return!0;r=ga(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=i&-i,a.lanes|=e,e=ip(a.stateNode,r,e),cu(a,e),!1;case 1:if(t=a.type,n=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||n!==null&&typeof n.componentDidCatch=="function"&&(Ar===null||!Ar.has(n))))return a.flags|=65536,i&=-i,a.lanes|=i,i=lb(i),sb(i,e,a,r),cu(a,i),!1}a=a.return}while(a!==null);return!1}var id=Error(H(461)),dt=!1;function Ct(e,t,a,r){t.child=e===null?xg(t,null,a,r):ci(t,e.child,a,r)}function Yf(e,t,a,r,i){a=a.render;var n=t.ref;if("ref"in r){var o={};for(var l in r)l!=="ref"&&(o[l]=r[l])}else o=r;return si(t),r=Xp(e,t,a,o,n,i),l=Zp(),e!==null&&!dt?(Kp(e,t,i),ur(e,t,i)):(Se&&l&&Lp(t),t.flags|=1,Ct(e,t,r,i),t.child)}function $f(e,t,a,r,i){if(e===null){var n=a.type;return typeof n=="function"&&!Bp(n)&&n.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=n,cb(e,t,n,r,i)):(e=Xl(a.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,!nd(e,i)){var o=n.memoizedProps;if(a=a.compare,a=a!==null?a:Ro,a(o,r)&&e.ref===t.ref)return ur(e,t,i)}return t.flags|=1,e=ir(n,r),e.ref=t.ref,e.return=t,t.child=e}function cb(e,t,a,r,i){if(e!==null){var n=e.memoizedProps;if(Ro(n,r)&&e.ref===t.ref)if(dt=!1,t.pendingProps=r=n,nd(e,i))(e.flags&131072)!==0&&(dt=!0);else return t.lanes=e.lanes,ur(e,t,i)}return np(e,t,a,r,i)}function ub(e,t,a,r){var i=r.children,n=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(n=n!==null?n.baseLanes|a:a,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~n}else r=0,t.child=null;return Vf(e,t,n,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Zl(t,n!==null?n.cachePool:null),n!==null?Af(t,n):Fu(),Ng(t);else return r=t.lanes=536870912,Vf(e,t,n!==null?n.baseLanes|a:a,a,r)}else n!==null?(Zl(t,n.cachePool),Af(t,n),xr(t),t.memoizedState=null):(e!==null&&Zl(t,null),Fu(),xr(t));return Ct(e,t,i,a),t.child}function fo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vf(e,t,a,r,i){var n=Gp();return n=n===null?null:{parent:pt._currentValue,pool:n},t.memoizedState={baseLanes:a,cachePool:n},e!==null&&Zl(t,null),Fu(),Ng(t),e!==null&&xn(e,t,r,!0),t.childLanes=i,null}function Jl(e,t){return t=ws({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Xf(e,t,a){return ci(t,e.child,null,a),e=Jl(t,t.pendingProps),e.flags|=2,ta(t),t.memoizedState=null,e}function m1(e,t,a){var r=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Se){if(r.mode==="hidden")return e=Jl(t,r),t.lanes=536870912,fo(null,e);if(Wu(t),(e=Fe)?(e=aw(e,ba),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Lr!==null?{id:Ua,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},a=hg(e),a.return=t,t.child=a,Et=t,Fe=null)):e=null,e===null)throw Hr(t);return t.lanes=536870912,null}return Jl(t,r)}var n=e.memoizedState;if(n!==null){var o=n.dehydrated;if(Wu(t),i)if(t.flags&256)t.flags&=-257,t=Xf(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(H(558));else if(dt||xn(e,t,a,!1),i=(a&e.childLanes)!==0,dt||i){if(r=Xe,r!==null&&(o=Gh(r,a),o!==0&&o!==n.retryLane))throw n.retryLane=o,hi(e,o),Kt(r,e,o),id;xs(),t=Xf(e,t,a)}else e=n.treeContext,Fe=va(o.nextSibling),Et=t,Se=!0,Tr=null,ba=!1,e!==null&&bg(t,e),t=Jl(t,r),t.flags|=4096;return t}return e=ir(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Il(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(H(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function np(e,t,a,r,i){return si(t),a=Xp(e,t,a,r,void 0,i),r=Zp(),e!==null&&!dt?(Kp(e,t,i),ur(e,t,i)):(Se&&r&&Lp(t),t.flags|=1,Ct(e,t,a,i),t.child)}function Zf(e,t,a,r,i,n){return si(t),t.updateQueue=null,a=qg(t,r,a,i),Cg(e),r=Zp(),e!==null&&!dt?(Kp(e,t,n),ur(e,t,n)):(Se&&r&&Lp(t),t.flags|=1,Ct(e,t,a,n),t.child)}function Kf(e,t,a,r,i){if(si(t),t.stateNode===null){var n=Ii,o=a.contextType;typeof o=="object"&&o!==null&&(n=Mt(o)),n=new a(r,n),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=rp,t.stateNode=n,n._reactInternals=t,n=t.stateNode,n.props=r,n.state=t.memoizedState,n.refs={},Yp(t),o=a.contextType,n.context=typeof o=="object"&&o!==null?Mt(o):Ii,n.state=t.memoizedState,o=a.getDerivedStateFromProps,typeof o=="function"&&(pu(t,a,o,r),n.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(o=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),o!==n.state&&rp.enqueueReplaceState(n,n.state,null),xo(t,r,n,i),_o(),n.state=t.memoizedState),typeof n.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){n=t.stateNode;var l=t.memoizedProps,c=pi(a,l);n.props=c;var p=n.context,m=a.contextType;o=Ii,typeof m=="object"&&m!==null&&(o=Mt(m));var h=a.getDerivedStateFromProps;m=typeof h=="function"||typeof n.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,m||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(l||p!==o)&&Gf(t,n,r,o),vr=!1;var d=t.memoizedState;n.state=d,xo(t,r,n,i),_o(),p=t.memoizedState,l||d!==p||vr?(typeof h=="function"&&(pu(t,a,h,r),p=t.memoizedState),(c=vr||Qf(t,a,c,r,d,p,o))?(m||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount()),typeof n.componentDidMount=="function"&&(t.flags|=4194308)):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=p),n.props=r,n.state=p,n.context=o,r=c):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{n=t.stateNode,Ju(e,t),o=t.memoizedProps,m=pi(a,o),n.props=m,h=t.pendingProps,d=n.context,p=a.contextType,c=Ii,typeof p=="object"&&p!==null&&(c=Mt(p)),l=a.getDerivedStateFromProps,(p=typeof l=="function"||typeof n.getSnapshotBeforeUpdate=="function")||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(o!==h||d!==c)&&Gf(t,n,r,c),vr=!1,d=t.memoizedState,n.state=d,xo(t,r,n,i),_o();var b=t.memoizedState;o!==h||d!==b||vr||e!==null&&e.dependencies!==null&&ps(e.dependencies)?(typeof l=="function"&&(pu(t,a,l,r),b=t.memoizedState),(m=vr||Qf(t,a,m,r,d,b,c)||e!==null&&e.dependencies!==null&&ps(e.dependencies))?(p||typeof n.UNSAFE_componentWillUpdate!="function"&&typeof n.componentWillUpdate!="function"||(typeof n.componentWillUpdate=="function"&&n.componentWillUpdate(r,b,c),typeof n.UNSAFE_componentWillUpdate=="function"&&n.UNSAFE_componentWillUpdate(r,b,c)),typeof n.componentDidUpdate=="function"&&(t.flags|=4),typeof n.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof n.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=b),n.props=r,n.state=b,n.context=c,r=m):(typeof n.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return n=r,Il(e,t),r=(t.flags&128)!==0,n||r?(n=t.stateNode,a=r&&typeof a.getDerivedStateFromError!="function"?null:n.render(),t.flags|=1,e!==null&&r?(t.child=ci(t,e.child,null,i),t.child=ci(t,null,a,i)):Ct(e,t,a,i),t.memoizedState=n.state,e=t.child):e=ur(e,t,i),e}function Pf(e,t,a,r){return li(),t.flags|=256,Ct(e,t,a,r),t.child}var du={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mu(e){return{baseLanes:e,cachePool:vg()}}function fu(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=ra),e}function pb(e,t,a){var r=t.pendingProps,i=!1,n=(t.flags&128)!==0,o;if((o=n)||(o=e!==null&&e.memoizedState===null?!1:(lt.current&2)!==0),o&&(i=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(Se){if(i?_r(t):xr(t),(e=Fe)?(e=aw(e,ba),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Lr!==null?{id:Ua,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},a=hg(e),a.return=t,t.child=a,Et=t,Fe=null)):e=null,e===null)throw Hr(t);return vp(e)?t.lanes=32:t.lanes=536870912,null}var l=r.children;return r=r.fallback,i?(xr(t),i=t.mode,l=ws({mode:"hidden",children:l},i),r=ri(r,i,a,null),l.return=t,r.return=t,l.sibling=r,t.child=l,r=t.child,r.memoizedState=mu(a),r.childLanes=fu(e,o,a),t.memoizedState=du,fo(null,r)):(_r(t),op(t,l))}var c=e.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(n)t.flags&256?(_r(t),t.flags&=-257,t=hu(e,t,a)):t.memoizedState!==null?(xr(t),t.child=e.child,t.flags|=128,t=null):(xr(t),l=r.fallback,i=t.mode,r=ws({mode:"visible",children:r.children},i),l=ri(l,i,a,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,ci(t,e.child,null,a),r=t.child,r.memoizedState=mu(a),r.childLanes=fu(e,o,a),t.memoizedState=du,t=fo(null,r));else if(_r(t),vp(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var p=o.dgst;o=p,r=Error(H(419)),r.stack="",r.digest=o,Uo({value:r,source:null,stack:null}),t=hu(e,t,a)}else if(dt||xn(e,t,a,!1),o=(a&e.childLanes)!==0,dt||o){if(o=Xe,o!==null&&(r=Gh(o,a),r!==0&&r!==c.retryLane))throw c.retryLane=r,hi(e,r),Kt(o,e,r),id;wp(l)||xs(),t=hu(e,t,a)}else wp(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,Fe=va(l.nextSibling),Et=t,Se=!0,Tr=null,ba=!1,e!==null&&bg(t,e),t=op(t,r.children),t.flags|=4096);return t}return i?(xr(t),l=r.fallback,i=t.mode,c=e.child,p=c.sibling,r=ir(c,{mode:"hidden",children:r.children}),r.subtreeFlags=c.subtreeFlags&65011712,p!==null?l=ir(p,l):(l=ri(l,i,a,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,fo(null,r),r=t.child,l=e.child.memoizedState,l===null?l=mu(a):(i=l.cachePool,i!==null?(c=pt._currentValue,i=i.parent!==c?{parent:c,pool:c}:i):i=vg(),l={baseLanes:l.baseLanes|a,cachePool:i}),r.memoizedState=l,r.childLanes=fu(e,o,a),t.memoizedState=du,fo(e.child,r)):(_r(t),a=e.child,e=a.sibling,a=ir(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 op(e,t){return t=ws({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ws(e,t){return e=aa(22,e,null,t),e.lanes=0,e}function hu(e,t,a){return ci(t,e.child,null,a),e=op(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Jf(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Zu(e.return,t,a)}function gu(e,t,a,r,i,n){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:i,treeForkCount:n}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=a,o.tailMode=i,o.treeForkCount=n)}function db(e,t,a){var r=t.pendingProps,i=r.revealOrder,n=r.tail;r=r.children;var o=lt.current,l=(o&2)!==0;if(l?(o=o&1|2,t.flags|=128):o&=1,Ke(lt,o),Ct(e,t,r,a),r=Se?Ao:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Jf(e,a,t);else if(e.tag===19)Jf(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(i){case"forwards":for(a=t.child,i=null;a!==null;)e=a.alternate,e!==null&&fs(e)===null&&(i=a),a=a.sibling;a=i,a===null?(i=t.child,t.child=null):(i=a.sibling,a.sibling=null),gu(t,!1,i,a,n,r);break;case"backwards":case"unstable_legacy-backwards":for(a=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&fs(e)===null){t.child=i;break}e=i.sibling,i.sibling=a,a=i,i=e}gu(t,!0,a,null,n,r);break;case"together":gu(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function ur(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Gr|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(xn(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,a=ir(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=ir(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function nd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ps(e)))}function f1(e,t,a){switch(t.tag){case 3:is(t,t.stateNode.containerInfo),yr(t,pt,e.memoizedState.cache),li();break;case 27:case 5:Uu(t);break;case 4:is(t,t.stateNode.containerInfo);break;case 10:yr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Wu(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(_r(t),t.flags|=128,null):(a&t.child.childLanes)!==0?pb(e,t,a):(_r(t),e=ur(e,t,a),e!==null?e.sibling:null);_r(t);break;case 19:var i=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(xn(e,t,a,!1),r=(a&t.childLanes)!==0),i){if(r)return db(e,t,a);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ke(lt,lt.current),r)break;return null;case 22:return t.lanes=0,ub(e,t,a,t.pendingProps);case 24:yr(t,pt,e.memoizedState.cache)}return ur(e,t,a)}function mb(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)dt=!0;else{if(!nd(e,a)&&(t.flags&128)===0)return dt=!1,f1(e,t,a);dt=(e.flags&131072)!==0}else dt=!1,Se&&(t.flags&1048576)!==0&&gg(t,Ao,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=ei(t.elementType),t.type=e,typeof e=="function")Bp(e)?(r=pi(e,r),t.tag=1,t=Kf(null,t,e,r,a)):(t.tag=0,t=np(null,t,e,r,a));else{if(e!=null){var i=e.$$typeof;if(i===kp){t.tag=11,t=Yf(null,t,e,r,a);break e}else if(i===Sp){t.tag=14,t=$f(null,t,e,r,a);break e}}throw t=Ru(e)||e,Error(H(306,t,""))}}return t;case 0:return np(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,i=pi(r,t.pendingProps),Kf(e,t,r,i,a);case 3:e:{if(is(t,t.stateNode.containerInfo),e===null)throw Error(H(387));r=t.pendingProps;var n=t.memoizedState;i=n.element,Ju(e,t),xo(t,r,null,a);var o=t.memoizedState;if(r=o.cache,yr(t,pt,r),r!==n.cache&&Ku(t,[pt],a,!0),_o(),r=o.element,n.isDehydrated)if(n={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){t=Pf(e,t,r,a);break e}else if(r!==i){i=ga(Error(H(424)),t),Uo(i),t=Pf(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=va(e.firstChild),Et=t,Se=!0,Tr=null,ba=!0,a=xg(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(li(),r===i){t=ur(e,t,a);break e}Ct(e,t,r,a)}t=t.child}return t;case 26:return Il(e,t),e===null?(a=wh(t.type,null,t.pendingProps,null))?t.memoizedState=a:Se||(a=t.type,e=t.pendingProps,r=Cs(Mr.current).createElement(a),r[qt]=t,r[Pt]=e,Tt(r,a,e),kt(r),t.stateNode=r):t.memoizedState=wh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Uu(t),e===null&&Se&&(r=t.stateNode=rw(t.type,t.pendingProps,Mr.current),Et=t,ba=!0,i=Fe,Yr(t.type)?(yp=i,Fe=va(r.firstChild)):Fe=i),Ct(e,t,t.pendingProps.children,a),Il(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Se&&((i=r=Fe)&&(r=j1(r,t.type,t.pendingProps,ba),r!==null?(t.stateNode=r,Et=t,Fe=va(r.firstChild),ba=!1,i=!0):i=!1),i||Hr(t)),Uu(t),i=t.type,n=t.pendingProps,o=e!==null?e.memoizedProps:null,r=n.children,gp(i,n)?r=null:o!==null&&gp(i,o)&&(t.flags|=32),t.memoizedState!==null&&(i=Xp(e,t,n1,null,null,a),Qo._currentValue=i),Il(e,t),Ct(e,t,r,a),t.child;case 6:return e===null&&Se&&((e=a=Fe)&&(a=Y1(a,t.pendingProps,ba),a!==null?(t.stateNode=a,Et=t,Fe=null,e=!0):e=!1),e||Hr(t)),null;case 13:return pb(e,t,a);case 4:return is(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ci(t,null,r,a):Ct(e,t,r,a),t.child;case 11:return Yf(e,t,t.type,t.pendingProps,a);case 7:return Ct(e,t,t.pendingProps,a),t.child;case 8:return Ct(e,t,t.pendingProps.children,a),t.child;case 12:return Ct(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,yr(t,t.type,r.value),Ct(e,t,r.children,a),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,si(t),i=Mt(i),r=r(i),t.flags|=1,Ct(e,t,r,a),t.child;case 14:return $f(e,t,t.type,t.pendingProps,a);case 15:return cb(e,t,t.type,t.pendingProps,a);case 19:return db(e,t,a);case 31:return m1(e,t,a);case 22:return ub(e,t,a,t.pendingProps);case 24:return si(t),r=Mt(pt),e===null?(i=Gp(),i===null&&(i=Xe,n=Qp(),i.pooledCache=n,n.refCount++,n!==null&&(i.pooledCacheLanes|=a),i=n),t.memoizedState={parent:r,cache:i},Yp(t),yr(t,pt,i)):((e.lanes&a)!==0&&(Ju(e,t),xo(t,null,null,a),_o()),i=e.memoizedState,n=t.memoizedState,i.parent!==r?(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),yr(t,pt,r)):(r=n.cache,yr(t,pt,r),r!==i.cache&&Ku(t,[pt],a,!0))),Ct(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(H(156,t.tag))}function Pa(e){e.flags|=4}function bu(e,t,a,r,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Bb())e.flags|=8192;else throw ni=ds,jp}else e.flags&=-16777217}function If(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ow(t))if(Bb())e.flags|=8192;else throw ni=ds,jp}function Dl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Lh():536870912,e.lanes|=t,hn|=t)}function oo(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 Ie(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var i=e.child;i!==null;)a|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)a|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function h1(e,t,a){var r=t.pendingProps;switch(Hp(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ie(t),null;case 1:return Ie(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),nr(pt),cn(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Hi(t)?Pa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,su())),Ie(t),null;case 26:var i=t.type,n=t.memoizedState;return e===null?(Pa(t),n!==null?(Ie(t),If(t,n)):(Ie(t),bu(t,i,null,r,a))):n?n!==e.memoizedState?(Pa(t),Ie(t),If(t,n)):(Ie(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Pa(t),Ie(t),bu(t,i,e,r,a)),null;case 27:if(ns(t),a=Mr.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pa(t);else{if(!r){if(t.stateNode===null)throw Error(H(166));return Ie(t),null}e=Ba.current,Hi(t)?Cf(t,e):(e=rw(i,r,a),t.stateNode=e,Pa(t))}return Ie(t),null;case 5:if(ns(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pa(t);else{if(!r){if(t.stateNode===null)throw Error(H(166));return Ie(t),null}if(n=Ba.current,Hi(t))Cf(t,n);else{var o=Cs(Mr.current);switch(n){case 1:n=o.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:n=o.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":n=o.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":n=o.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":n=o.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof r.is=="string"?o.createElement("select",{is:r.is}):o.createElement("select"),r.multiple?n.multiple=!0:r.size&&(n.size=r.size);break;default:n=typeof r.is=="string"?o.createElement(i,{is:r.is}):o.createElement(i)}}n[qt]=t,n[Pt]=r;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)n.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=n;e:switch(Tt(n,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Pa(t)}}return Ie(t),bu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Pa(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(e=Mr.current,Hi(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,i=Et,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[qt]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||Wb(e.nodeValue,a)),e||Hr(t,!0)}else e=Cs(e).createTextNode(r),e[qt]=t,t.stateNode=e}return Ie(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Hi(t),a!==null){if(e===null){if(!r)throw Error(H(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(557));e[qt]=t}else li(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ie(t),e=!1}else a=su(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(ta(t),t):(ta(t),null);if((t.flags&128)!==0)throw Error(H(558))}return Ie(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Hi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(H(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(H(317));i[qt]=t}else li(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ie(t),i=!1}else i=su(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(ta(t),t):(ta(t),null)}return ta(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==i&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Dl(t,t.updateQueue),Ie(t),null);case 4:return cn(),e===null&&dd(t.stateNode.containerInfo),Ie(t),null;case 10:return nr(t.type),Ie(t),null;case 19:if(St(lt),r=t.memoizedState,r===null)return Ie(t),null;if(i=(t.flags&128)!==0,n=r.rendering,n===null)if(i)oo(r,!1);else{if(it!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(n=fs(e),n!==null){for(t.flags|=128,oo(r,!1),e=n.updateQueue,t.updateQueue=e,Dl(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)fg(a,e),a=a.sibling;return Ke(lt,lt.current&1|2),Se&&Wa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ia()>ys&&(t.flags|=128,i=!0,oo(r,!1),t.lanes=4194304)}else{if(!i)if(e=fs(n),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Dl(t,e),oo(r,!0),r.tail===null&&r.tailMode==="hidden"&&!n.alternate&&!Se)return Ie(t),null}else 2*ia()-r.renderingStartTime>ys&&a!==536870912&&(t.flags|=128,i=!0,oo(r,!1),t.lanes=4194304);r.isBackwards?(n.sibling=t.child,t.child=n):(e=r.last,e!==null?e.sibling=n:t.child=n,r.last=n)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ia(),e.sibling=null,a=lt.current,Ke(lt,i?a&1|2:a&1),Se&&Wa(t,r.treeForkCount),e):(Ie(t),null);case 22:case 23:return ta(t),$p(),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&&(Ie(t),t.subtreeFlags&6&&(t.flags|=8192)):Ie(t),a=t.updateQueue,a!==null&&Dl(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&&St(ii),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),nr(pt),Ie(t),null;case 25:return null;case 30:return null}throw Error(H(156,t.tag))}function g1(e,t){switch(Hp(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return nr(pt),cn(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ns(t),null;case 31:if(t.memoizedState!==null){if(ta(t),t.alternate===null)throw Error(H(340));li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ta(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return St(lt),null;case 4:return cn(),null;case 10:return nr(t.type),null;case 22:case 23:return ta(t),$p(),e!==null&&St(ii),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return nr(pt),null;case 25:return null;default:return null}}function fb(e,t){switch(Hp(t),t.tag){case 3:nr(pt),cn();break;case 26:case 27:case 5:ns(t);break;case 4:cn();break;case 31:t.memoizedState!==null&&ta(t);break;case 13:ta(t);break;case 19:St(lt);break;case 10:nr(t.type);break;case 22:case 23:ta(t),$p(),e!==null&&St(ii);break;case 24:nr(pt)}}function Io(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var i=r.next;a=i;do{if((a.tag&e)===e){r=void 0;var n=a.create,o=a.inst;r=n(),o.destroy=r}a=a.next}while(a!==i)}}catch(l){Le(t,t.return,l)}}function Qr(e,t,a){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var n=i.next;r=n;do{if((r.tag&e)===e){var o=r.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,i=t;var c=a,p=l;try{p()}catch(m){Le(i,c,m)}}}r=r.next}while(r!==n)}}catch(m){Le(t,t.return,m)}}function hb(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Sg(t,a)}catch(r){Le(e,e.return,r)}}}function gb(e,t,a){a.props=pi(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){Le(e,t,r)}}function So(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(i){Le(e,t,i)}}function Oa(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(i){Le(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(i){Le(e,t,i)}else a.current=null}function bb(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(i){Le(e,e.return,i)}}function wu(e,t,a){try{var r=e.stateNode;O1(r,e.type,a,t),r[Pt]=t}catch(i){Le(e,e.return,i)}}function wb(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Yr(e.type)||e.tag===4}function vu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||wb(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&&Yr(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 lp(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=ar));else if(r!==4&&(r===27&&Yr(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(lp(e,t,a),e=e.sibling;e!==null;)lp(e,t,a),e=e.sibling}function vs(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&&Yr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(vs(e,t,a),e=e.sibling;e!==null;)vs(e,t,a),e=e.sibling}function vb(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Tt(t,r,a),t[qt]=e,t[Pt]=a}catch(n){Le(e,e.return,n)}}var er=!1,ut=!1,yu=!1,Ff=typeof WeakSet=="function"?WeakSet:Set,xt=null;function b1(e,t){if(e=e.containerInfo,fp=Ts,e=og(e),Up(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 i=r.anchorOffset,n=r.focusNode;r=r.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break e}var o=0,l=-1,c=-1,p=0,m=0,h=e,d=null;t:for(;;){for(var b;h!==a||i!==0&&h.nodeType!==3||(l=o+i),h!==n||r!==0&&h.nodeType!==3||(c=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(b=h.firstChild)!==null;)d=h,h=b;for(;;){if(h===e)break t;if(d===a&&++p===i&&(l=o),d===n&&++m===r&&(c=o),(b=h.nextSibling)!==null)break;h=d,d=h.parentNode}h=b}a=l===-1||c===-1?null:{start:l,end:c}}else a=null}a=a||{start:0,end:0}}else a=null;for(hp={focusedElem:e,selectionRange:a},Ts=!1,xt=t;xt!==null;)if(t=xt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,xt=e;else for(;xt!==null;){switch(t=xt,n=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++)i=e[a],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&n!==null){e=void 0,a=t,i=n.memoizedProps,n=n.memoizedState,r=a.stateNode;try{var v=pi(a.type,i);e=r.getSnapshotBeforeUpdate(v,n),r.__reactInternalSnapshotBeforeUpdate=e}catch(q){Le(a,a.return,q)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)bp(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":bp(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(H(163))}if(e=t.sibling,e!==null){e.return=t.return,xt=e;break}xt=t.return}}function yb(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Ia(e,a),r&4&&Io(5,a);break;case 1:if(Ia(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(o){Le(a,a.return,o)}else{var i=pi(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Le(a,a.return,o)}}r&64&&hb(a),r&512&&So(a,a.return);break;case 3:if(Ia(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{Sg(e,t)}catch(o){Le(a,a.return,o)}}break;case 27:t===null&&r&4&&vb(a);case 26:case 5:Ia(e,a),t===null&&r&4&&bb(a),r&512&&So(a,a.return);break;case 12:Ia(e,a);break;case 31:Ia(e,a),r&4&&kb(e,a);break;case 13:Ia(e,a),r&4&&Sb(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=C1.bind(null,a),$1(e,a))));break;case 22:if(r=a.memoizedState!==null||er,!r){t=t!==null&&t.memoizedState!==null||ut,i=er;var n=ut;er=r,(ut=t)&&!n?Fa(e,a,(a.subtreeFlags&8772)!==0):Ia(e,a),er=i,ut=n}break;case 30:break;default:Ia(e,a)}}function _b(e){var t=e.alternate;t!==null&&(e.alternate=null,_b(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ep(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,Xt=!1;function Ja(e,t,a){for(a=a.child;a!==null;)xb(e,t,a),a=a.sibling}function xb(e,t,a){if(na&&typeof na.onCommitFiberUnmount=="function")try{na.onCommitFiberUnmount($o,a)}catch{}switch(a.tag){case 26:ut||Oa(a,t),Ja(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=tt,i=Xt;Yr(a.type)&&(tt=a.stateNode,Xt=!1),Ja(e,t,a),Eo(a.stateNode),tt=r,Xt=i;break;case 5:ut||Oa(a,t);case 6:if(r=tt,i=Xt,tt=null,Ja(e,t,a),tt=r,Xt=i,tt!==null)if(Xt)try{(tt.nodeType===9?tt.body:tt.nodeName==="HTML"?tt.ownerDocument.body:tt).removeChild(a.stateNode)}catch(n){Le(a,t,n)}else try{tt.removeChild(a.stateNode)}catch(n){Le(a,t,n)}break;case 18:tt!==null&&(Xt?(e=tt,mh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),vn(e)):mh(tt,a.stateNode));break;case 4:r=tt,i=Xt,tt=a.stateNode.containerInfo,Xt=!0,Ja(e,t,a),tt=r,Xt=i;break;case 0:case 11:case 14:case 15:Qr(2,a,t),ut||Qr(4,a,t),Ja(e,t,a);break;case 1:ut||(Oa(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&gb(a,t,r)),Ja(e,t,a);break;case 21:Ja(e,t,a);break;case 22:ut=(r=ut)||a.memoizedState!==null,Ja(e,t,a),ut=r;break;default:Ja(e,t,a)}}function kb(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{vn(e)}catch(a){Le(t,t.return,a)}}}function Sb(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{vn(e)}catch(a){Le(t,t.return,a)}}function w1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ff),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ff),t;default:throw Error(H(435,e.tag))}}function Ol(e,t){var a=w1(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var i=q1.bind(null,e,r);r.then(i,i)}})}function $t(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var i=a[r],n=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(Yr(l.type)){tt=l.stateNode,Xt=!1;break e}break;case 5:tt=l.stateNode,Xt=!1;break e;case 3:case 4:tt=l.stateNode.containerInfo,Xt=!0;break e}l=l.return}if(tt===null)throw Error(H(160));xb(n,o,i),tt=null,Xt=!1,n=i.alternate,n!==null&&(n.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Nb(t,e),t=t.sibling}var qa=null;function Nb(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:$t(t,e),Vt(e),r&4&&(Qr(3,e,e.return),Io(3,e),Qr(5,e,e.return));break;case 1:$t(t,e),Vt(e),r&512&&(ut||a===null||Oa(a,a.return)),r&64&&er&&(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 i=qa;if($t(t,e),Vt(e),r&512&&(ut||a===null||Oa(a,a.return)),r&4){var n=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,i=i.ownerDocument||i;t:switch(r){case"title":n=i.getElementsByTagName("title")[0],(!n||n[Zo]||n[qt]||n.namespaceURI==="http://www.w3.org/2000/svg"||n.hasAttribute("itemprop"))&&(n=i.createElement(r),i.head.insertBefore(n,i.querySelector("head > title"))),Tt(n,r,a),n[qt]=e,kt(n),r=n;break e;case"link":var o=yh("link","href",i).get(r+(a.href||""));if(o){for(var l=0;l<o.length;l++)if(n=o[l],n.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&n.getAttribute("rel")===(a.rel==null?null:a.rel)&&n.getAttribute("title")===(a.title==null?null:a.title)&&n.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){o.splice(l,1);break t}}n=i.createElement(r),Tt(n,r,a),i.head.appendChild(n);break;case"meta":if(o=yh("meta","content",i).get(r+(a.content||""))){for(l=0;l<o.length;l++)if(n=o[l],n.getAttribute("content")===(a.content==null?null:""+a.content)&&n.getAttribute("name")===(a.name==null?null:a.name)&&n.getAttribute("property")===(a.property==null?null:a.property)&&n.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&n.getAttribute("charset")===(a.charSet==null?null:a.charSet)){o.splice(l,1);break t}}n=i.createElement(r),Tt(n,r,a),i.head.appendChild(n);break;default:throw Error(H(468,r))}n[qt]=e,kt(n),r=n}e.stateNode=r}else _h(i,e.type,e.stateNode);else e.stateNode=vh(i,r,e.memoizedProps);else n!==r?(n===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):n.count--,r===null?_h(i,e.type,e.stateNode):vh(i,r,e.memoizedProps)):r===null&&e.stateNode!==null&&wu(e,e.memoizedProps,a.memoizedProps)}break;case 27:$t(t,e),Vt(e),r&512&&(ut||a===null||Oa(a,a.return)),a!==null&&r&4&&wu(e,e.memoizedProps,a.memoizedProps);break;case 5:if($t(t,e),Vt(e),r&512&&(ut||a===null||Oa(a,a.return)),e.flags&32){i=e.stateNode;try{pn(i,"")}catch(v){Le(e,e.return,v)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,wu(e,i,a!==null?a.memoizedProps:i)),r&1024&&(yu=!0);break;case 6:if($t(t,e),Vt(e),r&4){if(e.stateNode===null)throw Error(H(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(v){Le(e,e.return,v)}}break;case 3:if(es=null,i=qa,qa=qs(t.containerInfo),$t(t,e),qa=i,Vt(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{vn(t.containerInfo)}catch(v){Le(e,e.return,v)}yu&&(yu=!1,Cb(e));break;case 4:r=qa,qa=qs(e.stateNode.containerInfo),$t(t,e),Vt(e),qa=r;break;case 12:$t(t,e),Vt(e);break;case 31:$t(t,e),Vt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ol(e,r)));break;case 13:$t(t,e),Vt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ys=ia()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ol(e,r)));break;case 22:i=e.memoizedState!==null;var c=a!==null&&a.memoizedState!==null,p=er,m=ut;if(er=p||i,ut=m||c,$t(t,e),ut=m,er=p,Vt(e),r&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(a===null||c||er||ut||ti(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){c=a=t;try{if(n=c.stateNode,i)o=n.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=c.stateNode;var h=c.memoizedProps.style,d=h!=null&&h.hasOwnProperty("display")?h.display:null;l.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(v){Le(c,c.return,v)}}}else if(t.tag===6){if(a===null){c=t;try{c.stateNode.nodeValue=i?"":c.memoizedProps}catch(v){Le(c,c.return,v)}}}else if(t.tag===18){if(a===null){c=t;try{var b=c.stateNode;i?fh(b,!0):fh(c.stateNode,!1)}catch(v){Le(c,c.return,v)}}}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,Ol(e,a))));break;case 19:$t(t,e),Vt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ol(e,r)));break;case 30:break;case 21:break;default:$t(t,e),Vt(e)}}function Vt(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(wb(r)){a=r;break}r=r.return}if(a==null)throw Error(H(160));switch(a.tag){case 27:var i=a.stateNode,n=vu(e);vs(e,n,i);break;case 5:var o=a.stateNode;a.flags&32&&(pn(o,""),a.flags&=-33);var l=vu(e);vs(e,l,o);break;case 3:case 4:var c=a.stateNode.containerInfo,p=vu(e);lp(e,p,c);break;default:throw Error(H(161))}}catch(m){Le(e,e.return,m)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Cb(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Cb(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ia(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)yb(e,t.alternate,t),t=t.sibling}function ti(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Qr(4,t,t.return),ti(t);break;case 1:Oa(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&gb(t,t.return,a),ti(t);break;case 27:Eo(t.stateNode);case 26:case 5:Oa(t,t.return),ti(t);break;case 22:t.memoizedState===null&&ti(t);break;case 30:ti(t);break;default:ti(t)}e=e.sibling}}function Fa(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,i=e,n=t,o=n.flags;switch(n.tag){case 0:case 11:case 15:Fa(i,n,a),Io(4,n);break;case 1:if(Fa(i,n,a),r=n,i=r.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(p){Le(r,r.return,p)}if(r=n,i=r.updateQueue,i!==null){var l=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)kg(c[i],l)}catch(p){Le(r,r.return,p)}}a&&o&64&&hb(n),So(n,n.return);break;case 27:vb(n);case 26:case 5:Fa(i,n,a),a&&r===null&&o&4&&bb(n),So(n,n.return);break;case 12:Fa(i,n,a);break;case 31:Fa(i,n,a),a&&o&4&&kb(i,n);break;case 13:Fa(i,n,a),a&&o&4&&Sb(i,n);break;case 22:n.memoizedState===null&&Fa(i,n,a),So(n,n.return);break;case 30:break;default:Fa(i,n,a)}t=t.sibling}}function od(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&&Po(a))}function ld(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Po(e))}function Ca(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)qb(e,t,a,r),t=t.sibling}function qb(e,t,a,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Ca(e,t,a,r),i&2048&&Io(9,t);break;case 1:Ca(e,t,a,r);break;case 3:Ca(e,t,a,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Po(e)));break;case 12:if(i&2048){Ca(e,t,a,r),e=t.stateNode;try{var n=t.memoizedProps,o=n.id,l=n.onPostCommit;typeof l=="function"&&l(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Le(t,t.return,c)}}else Ca(e,t,a,r);break;case 31:Ca(e,t,a,r);break;case 13:Ca(e,t,a,r);break;case 23:break;case 22:n=t.stateNode,o=t.alternate,t.memoizedState!==null?n._visibility&2?Ca(e,t,a,r):No(e,t):n._visibility&2?Ca(e,t,a,r):(n._visibility|=2,Gi(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),i&2048&&od(o,t);break;case 24:Ca(e,t,a,r),i&2048&&ld(t.alternate,t);break;default:Ca(e,t,a,r)}}function Gi(e,t,a,r,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var n=e,o=t,l=a,c=r,p=o.flags;switch(o.tag){case 0:case 11:case 15:Gi(n,o,l,c,i),Io(8,o);break;case 23:break;case 22:var m=o.stateNode;o.memoizedState!==null?m._visibility&2?Gi(n,o,l,c,i):No(n,o):(m._visibility|=2,Gi(n,o,l,c,i)),i&&p&2048&&od(o.alternate,o);break;case 24:Gi(n,o,l,c,i),i&&p&2048&&ld(o.alternate,o);break;default:Gi(n,o,l,c,i)}t=t.sibling}}function No(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,r=t,i=r.flags;switch(r.tag){case 22:No(a,r),i&2048&&od(r.alternate,r);break;case 24:No(a,r),i&2048&&ld(r.alternate,r);break;default:No(a,r)}t=t.sibling}}var ho=8192;function Qi(e,t,a){if(e.subtreeFlags&ho)for(e=e.child;e!==null;)Eb(e,t,a),e=e.sibling}function Eb(e,t,a){switch(e.tag){case 26:Qi(e,t,a),e.flags&ho&&e.memoizedState!==null&&a_(a,qa,e.memoizedState,e.memoizedProps);break;case 5:Qi(e,t,a);break;case 3:case 4:var r=qa;qa=qs(e.stateNode.containerInfo),Qi(e,t,a),qa=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=ho,ho=16777216,Qi(e,t,a),ho=r):Qi(e,t,a));break;default:Qi(e,t,a)}}function Mb(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 lo(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];xt=r,zb(r,e)}Mb(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Tb(e),e=e.sibling}function Tb(e){switch(e.tag){case 0:case 11:case 15:lo(e),e.flags&2048&&Qr(9,e,e.return);break;case 3:lo(e);break;case 12:lo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):lo(e);break;default:lo(e)}}function Fl(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];xt=r,zb(r,e)}Mb(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Qr(8,t,t.return),Fl(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function zb(e,t){for(;xt!==null;){var a=xt;switch(a.tag){case 0:case 11:case 15:Qr(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:Po(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,xt=r;else e:for(a=e;xt!==null;){r=xt;var i=r.sibling,n=r.return;if(_b(r),r===a){xt=null;break e}if(i!==null){i.return=n,xt=i;break e}xt=n}}}var v1={getCacheForType:function(e){var t=Mt(pt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Mt(pt).controller.signal}},y1=typeof WeakMap=="function"?WeakMap:Map,Re=0,Xe=null,ve=null,ke=0,Be=0,ea=null,Cr=!1,Sn=!1,sd=!1,pr=0,it=0,Gr=0,oi=0,cd=0,ra=0,hn=0,Co=null,Zt=null,sp=!1,Ys=0,Rb=0,ys=1/0,_s=null,Ar=null,gt=0,Ur=null,gn=null,or=0,cp=0,up=null,Ab=null,qo=0,pp=null;function la(){return(Re&2)!==0&&ke!==0?ke&-ke:se.T!==null?pd():jh()}function Ub(){if(ra===0)if((ke&536870912)===0||Se){var e=Cl;Cl<<=1,(Cl&3932160)===0&&(Cl=262144),ra=e}else ra=536870912;return e=ca.current,e!==null&&(e.flags|=32),ra}function Kt(e,t,a){(e===Xe&&(Be===2||Be===9)||e.cancelPendingCommit!==null)&&(bn(e,0),qr(e,ke,ra,!1)),Xo(e,a),((Re&2)===0||e!==Xe)&&(e===Xe&&((Re&2)===0&&(oi|=a),it===4&&qr(e,ke,ra,!1)),Ha(e))}function Db(e,t,a){if((Re&6)!==0)throw Error(H(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Vo(e,t),i=r?k1(e,t):_u(e,t,!0),n=r;do{if(i===0){Sn&&!r&&qr(e,t,0,!1);break}else{if(a=e.current.alternate,n&&!_1(a)){i=_u(e,t,!1),n=!1;continue}if(i===2){if(n=t,e.errorRecoveryDisabledLanes&n)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;i=Co;var c=l.current.memoizedState.isDehydrated;if(c&&(bn(l,o).flags|=256),o=_u(l,o,!1),o!==2){if(sd&&!c){l.errorRecoveryDisabledLanes|=n,oi|=n,i=4;break e}n=Zt,Zt=i,n!==null&&(Zt===null?Zt=n:Zt.push.apply(Zt,n))}i=o}if(n=!1,i!==2)continue}}if(i===1){bn(e,0),qr(e,t,0,!0);break}e:{switch(r=e,n=i,n){case 0:case 1:throw Error(H(345));case 4:if((t&4194048)!==t)break;case 6:qr(r,t,ra,!Cr);break e;case 2:Zt=null;break;case 3:case 5:break;default:throw Error(H(329))}if((t&62914560)===t&&(i=Ys+300-ia(),10<i)){if(qr(r,t,ra,!Cr),Rs(r,0,!0)!==0)break e;or=t,r.timeoutHandle=tw(Wf.bind(null,r,a,Zt,_s,sp,t,ra,oi,hn,Cr,n,"Throttled",-0,0),i);break e}Wf(r,a,Zt,_s,sp,t,ra,oi,hn,Cr,n,null,-0,0)}}break}while(!0);Ha(e)}function Wf(e,t,a,r,i,n,o,l,c,p,m,h,d,b){if(e.timeoutHandle=-1,h=t.subtreeFlags,h&8192||(h&16785408)===16785408){h={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ar},Eb(t,n,h);var v=(n&62914560)===n?Ys-ia():(n&4194048)===n?Rb-ia():0;if(v=r_(h,v),v!==null){or=n,e.cancelPendingCommit=v(th.bind(null,e,t,n,a,r,i,o,l,c,m,h,null,d,b)),qr(e,n,o,!p);return}}th(e,t,n,a,r,i,o,l,c)}function _1(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 i=a[r],n=i.getSnapshot;i=i.value;try{if(!sa(n(),i))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 qr(e,t,a,r){t&=~cd,t&=~oi,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var n=31-oa(i),o=1<<n;r[n]=-1,i&=~o}a!==0&&Hh(e,a,t)}function $s(){return(Re&6)===0?(Fo(0,!1),!1):!0}function ud(){if(ve!==null){if(Be===0)var e=ve.return;else e=ve,rr=gi=null,Pp(e),on=null,Do=0,e=ve;for(;e!==null;)fb(e.alternate,e),e=e.return;ve=null}}function bn(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,H1(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),or=0,ud(),Xe=e,ve=a=ir(e.current,null),ke=t,Be=0,ea=null,Cr=!1,Sn=Vo(e,t),sd=!1,hn=ra=cd=oi=Gr=it=0,Zt=Co=null,sp=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-oa(r),n=1<<i;t|=e[i],r&=~n}return pr=t,Os(),a}function Ob(e,t){fe=null,se.H=Bo,t===kn||t===Ls?(t=zf(),Be=3):t===jp?(t=zf(),Be=4):Be=t===id?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ea=t,ve===null&&(it=1,bs(e,ga(t,e.current)))}function Bb(){var e=ca.current;return e===null?!0:(ke&4194048)===ke?wa===null:(ke&62914560)===ke||(ke&536870912)!==0?e===wa:!1}function Lb(){var e=se.H;return se.H=Bo,e===null?Bo:e}function Hb(){var e=se.A;return se.A=v1,e}function xs(){it=4,Cr||(ke&4194048)!==ke&&ca.current!==null||(Sn=!0),(Gr&134217727)===0&&(oi&134217727)===0||Xe===null||qr(Xe,ke,ra,!1)}function _u(e,t,a){var r=Re;Re|=2;var i=Lb(),n=Hb();(Xe!==e||ke!==t)&&(_s=null,bn(e,t)),t=!1;var o=it;e:do try{if(Be!==0&&ve!==null){var l=ve,c=ea;switch(Be){case 8:ud(),o=6;break e;case 3:case 2:case 9:case 6:ca.current===null&&(t=!0);var p=Be;if(Be=0,ea=null,en(e,l,c,p),a&&Sn){o=0;break e}break;default:p=Be,Be=0,ea=null,en(e,l,c,p)}}x1(),o=it;break}catch(m){Ob(e,m)}while(!0);return t&&e.shellSuspendCounter++,rr=gi=null,Re=r,se.H=i,se.A=n,ve===null&&(Xe=null,ke=0,Os()),o}function x1(){for(;ve!==null;)Qb(ve)}function k1(e,t){var a=Re;Re|=2;var r=Lb(),i=Hb();Xe!==e||ke!==t?(_s=null,ys=ia()+500,bn(e,t)):Sn=Vo(e,t);e:do try{if(Be!==0&&ve!==null){t=ve;var n=ea;t:switch(Be){case 1:Be=0,ea=null,en(e,t,n,1);break;case 2:case 9:if(Tf(n)){Be=0,ea=null,eh(t);break}t=function(){Be!==2&&Be!==9||Xe!==e||(Be=7),Ha(e)},n.then(t,t);break e;case 3:Be=7;break e;case 4:Be=5;break e;case 7:Tf(n)?(Be=0,ea=null,eh(t)):(Be=0,ea=null,en(e,t,n,7));break;case 5:var o=null;switch(ve.tag){case 26:o=ve.memoizedState;case 5:case 27:var l=ve;if(o?ow(o):l.stateNode.complete){Be=0,ea=null;var c=l.sibling;if(c!==null)ve=c;else{var p=l.return;p!==null?(ve=p,Vs(p)):ve=null}break t}}Be=0,ea=null,en(e,t,n,5);break;case 6:Be=0,ea=null,en(e,t,n,6);break;case 8:ud(),it=6;break e;default:throw Error(H(462))}}S1();break}catch(m){Ob(e,m)}while(!0);return rr=gi=null,se.H=r,se.A=i,Re=a,ve!==null?0:(Xe=null,ke=0,Os(),it)}function S1(){for(;ve!==null&&!Z0();)Qb(ve)}function Qb(e){var t=mb(e.alternate,e,pr);e.memoizedProps=e.pendingProps,t===null?Vs(e):ve=t}function eh(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Zf(a,t,t.pendingProps,t.type,void 0,ke);break;case 11:t=Zf(a,t,t.pendingProps,t.type.render,t.ref,ke);break;case 5:Pp(t);default:fb(a,t),t=ve=fg(t,pr),t=mb(a,t,pr)}e.memoizedProps=e.pendingProps,t===null?Vs(e):ve=t}function en(e,t,a,r){rr=gi=null,Pp(t),on=null,Do=0;var i=t.return;try{if(d1(e,i,t,a,ke)){it=1,bs(e,ga(a,e.current)),ve=null;return}}catch(n){if(i!==null)throw ve=i,n;it=1,bs(e,ga(a,e.current)),ve=null;return}t.flags&32768?(Se||r===1?e=!0:Sn||(ke&536870912)!==0?e=!1:(Cr=e=!0,(r===2||r===9||r===3||r===6)&&(r=ca.current,r!==null&&r.tag===13&&(r.flags|=16384))),Gb(t,e)):Vs(t)}function Vs(e){var t=e;do{if((t.flags&32768)!==0){Gb(t,Cr);return}e=t.return;var a=h1(t.alternate,t,pr);if(a!==null){ve=a;return}if(t=t.sibling,t!==null){ve=t;return}ve=t=e}while(t!==null);it===0&&(it=5)}function Gb(e,t){do{var a=g1(e.alternate,e);if(a!==null){a.flags&=32767,ve=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){ve=e;return}ve=e=a}while(e!==null);it=6,ve=null}function th(e,t,a,r,i,n,o,l,c){e.cancelPendingCommit=null;do Xs();while(gt!==0);if((Re&6)!==0)throw Error(H(327));if(t!==null){if(t===e.current)throw Error(H(177));if(n=t.lanes|t.childLanes,n|=Dp,ry(e,a,n,o,l,c),e===Xe&&(ve=Xe=null,ke=0),gn=t,Ur=e,or=a,cp=n,up=i,Ab=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,E1(os,function(){return Xb(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=se.T,se.T=null,i=Ae.p,Ae.p=2,o=Re,Re|=4;try{b1(e,t,a)}finally{Re=o,Ae.p=i,se.T=r}}gt=1,jb(),Yb(),$b()}}function jb(){if(gt===1){gt=0;var e=Ur,t=gn,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=se.T,se.T=null;var r=Ae.p;Ae.p=2;var i=Re;Re|=4;try{Nb(t,e);var n=hp,o=og(e.containerInfo),l=n.focusedElem,c=n.selectionRange;if(o!==l&&l&&l.ownerDocument&&ng(l.ownerDocument.documentElement,l)){if(c!==null&&Up(l)){var p=c.start,m=c.end;if(m===void 0&&(m=p),"selectionStart"in l)l.selectionStart=p,l.selectionEnd=Math.min(m,l.value.length);else{var h=l.ownerDocument||document,d=h&&h.defaultView||window;if(d.getSelection){var b=d.getSelection(),v=l.textContent.length,q=Math.min(c.start,v),O=c.end===void 0?q:Math.min(c.end,v);!b.extend&&q>O&&(o=O,O=q,q=o);var f=kf(l,q),u=kf(l,O);if(f&&u&&(b.rangeCount!==1||b.anchorNode!==f.node||b.anchorOffset!==f.offset||b.focusNode!==u.node||b.focusOffset!==u.offset)){var g=h.createRange();g.setStart(f.node,f.offset),b.removeAllRanges(),q>O?(b.addRange(g),b.extend(u.node,u.offset)):(g.setEnd(u.node,u.offset),b.addRange(g))}}}}for(h=[],b=l;b=b.parentNode;)b.nodeType===1&&h.push({element:b,left:b.scrollLeft,top:b.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<h.length;l++){var w=h[l];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}Ts=!!fp,hp=fp=null}finally{Re=i,Ae.p=r,se.T=a}}e.current=t,gt=2}}function Yb(){if(gt===2){gt=0;var e=Ur,t=gn,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=se.T,se.T=null;var r=Ae.p;Ae.p=2;var i=Re;Re|=4;try{yb(e,t.alternate,t)}finally{Re=i,Ae.p=r,se.T=a}}gt=3}}function $b(){if(gt===4||gt===3){gt=0,K0();var e=Ur,t=gn,a=or,r=Ab;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?gt=5:(gt=0,gn=Ur=null,Vb(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Ar=null),qp(a),t=t.stateNode,na&&typeof na.onCommitFiberRoot=="function")try{na.onCommitFiberRoot($o,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=se.T,i=Ae.p,Ae.p=2,se.T=null;try{for(var n=e.onRecoverableError,o=0;o<r.length;o++){var l=r[o];n(l.value,{componentStack:l.stack})}}finally{se.T=t,Ae.p=i}}(or&3)!==0&&Xs(),Ha(e),i=e.pendingLanes,(a&261930)!==0&&(i&42)!==0?e===pp?qo++:(qo=0,pp=e):qo=0,Fo(0,!1)}}function Vb(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Po(t)))}function Xs(){return jb(),Yb(),$b(),Xb()}function Xb(){if(gt!==5)return!1;var e=Ur,t=cp;cp=0;var a=qp(or),r=se.T,i=Ae.p;try{Ae.p=32>a?32:a,se.T=null,a=up,up=null;var n=Ur,o=or;if(gt=0,gn=Ur=null,or=0,(Re&6)!==0)throw Error(H(331));var l=Re;if(Re|=4,Tb(n.current),qb(n,n.current,o,a),Re=l,Fo(0,!1),na&&typeof na.onPostCommitFiberRoot=="function")try{na.onPostCommitFiberRoot($o,n)}catch{}return!0}finally{Ae.p=i,se.T=r,Vb(e,t)}}function ah(e,t,a){t=ga(a,t),t=ip(e.stateNode,t,2),e=Rr(e,t,2),e!==null&&(Xo(e,2),Ha(e))}function Le(e,t,a){if(e.tag===3)ah(e,e,a);else for(;t!==null;){if(t.tag===3){ah(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ar===null||!Ar.has(r))){e=ga(a,e),a=lb(2),r=Rr(t,a,2),r!==null&&(sb(a,r,t,e),Xo(r,2),Ha(r));break}}t=t.return}}function xu(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new y1;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(a)||(sd=!0,i.add(a),e=N1.bind(null,e,t,a),t.then(e,e))}function N1(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Xe===e&&(ke&a)===a&&(it===4||it===3&&(ke&62914560)===ke&&300>ia()-Ys?(Re&2)===0&&bn(e,0):cd|=a,hn===ke&&(hn=0)),Ha(e)}function Zb(e,t){t===0&&(t=Lh()),e=hi(e,t),e!==null&&(Xo(e,t),Ha(e))}function C1(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Zb(e,a)}function q1(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(a=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(H(314))}r!==null&&r.delete(t),Zb(e,a)}function E1(e,t){return Np(e,t)}var ks=null,ji=null,dp=!1,Ss=!1,ku=!1,Er=0;function Ha(e){e!==ji&&e.next===null&&(ji===null?ks=ji=e:ji=ji.next=e),Ss=!0,dp||(dp=!0,T1())}function Fo(e,t){if(!ku&&Ss){ku=!0;do for(var a=!1,r=ks;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var n=0;else{var o=r.suspendedLanes,l=r.pingedLanes;n=(1<<31-oa(42|e)+1)-1,n&=i&~(o&~l),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(a=!0,rh(r,n))}else n=ke,n=Rs(r,r===Xe?n:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(n&3)===0||Vo(r,n)||(a=!0,rh(r,n));r=r.next}while(a);ku=!1}}function M1(){Kb()}function Kb(){Ss=dp=!1;var e=0;Er!==0&&L1()&&(e=Er);for(var t=ia(),a=null,r=ks;r!==null;){var i=r.next,n=Pb(r,t);n===0?(r.next=null,a===null?ks=i:a.next=i,i===null&&(ji=a)):(a=r,(e!==0||(n&3)!==0)&&(Ss=!0)),r=i}gt!==0&>!==5||Fo(e,!1),Er!==0&&(Er=0)}function Pb(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,n=e.pendingLanes&-62914561;0<n;){var o=31-oa(n),l=1<<o,c=i[o];c===-1?((l&a)===0||(l&r)!==0)&&(i[o]=ay(l,t)):c<=t&&(e.expiredLanes|=l),n&=~l}if(t=Xe,a=ke,a=Rs(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&&Fc(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Vo(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&Fc(r),qp(a)){case 2:case 8:a=Oh;break;case 32:a=os;break;case 268435456:a=Bh;break;default:a=os}return r=Jb.bind(null,e),a=Np(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&Fc(r),e.callbackPriority=2,e.callbackNode=null,2}function Jb(e,t){if(gt!==0&>!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Xs()&&e.callbackNode!==a)return null;var r=ke;return r=Rs(e,e===Xe?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Db(e,r,t),Pb(e,ia()),e.callbackNode!=null&&e.callbackNode===a?Jb.bind(null,e):null)}function rh(e,t){if(Xs())return null;Db(e,t,!0)}function T1(){Q1(function(){(Re&6)!==0?Np(Dh,M1):Kb()})}function pd(){if(Er===0){var e=dn;e===0&&(e=Nl,Nl<<=1,(Nl&261888)===0&&(Nl=256)),Er=e}return Er}function ih(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Yl(""+e)}function nh(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 z1(e,t,a,r,i){if(t==="submit"&&a&&a.stateNode===i){var n=ih((i[Pt]||null).action),o=r.submitter;o&&(t=(t=o[Pt]||null)?ih(t.formAction):o.getAttribute("formAction"),t!==null&&(n=t,o=null));var l=new As("action","action",null,r,i);e.push({event:l,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Er!==0){var c=o?nh(i,o):new FormData(i);ap(a,{pending:!0,data:c,method:i.method,action:n},null,c)}}else typeof n=="function"&&(l.preventDefault(),c=o?nh(i,o):new FormData(i),ap(a,{pending:!0,data:c,method:i.method,action:n},n,c))},currentTarget:i}]})}}for(Bl=0;Bl<$u.length;Bl++)Ll=$u[Bl],oh=Ll.toLowerCase(),lh=Ll[0].toUpperCase()+Ll.slice(1),Ea(oh,"on"+lh);var Ll,oh,lh,Bl;Ea(sg,"onAnimationEnd");Ea(cg,"onAnimationIteration");Ea(ug,"onAnimationStart");Ea("dblclick","onDoubleClick");Ea("focusin","onFocus");Ea("focusout","onBlur");Ea(Py,"onTransitionRun");Ea(Jy,"onTransitionStart");Ea(Iy,"onTransitionCancel");Ea(pg,"onTransitionEnd");un("onMouseEnter",["mouseout","mouseover"]);un("onMouseLeave",["mouseout","mouseover"]);un("onPointerEnter",["pointerout","pointerover"]);un("onPointerLeave",["pointerout","pointerover"]);di("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));di("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));di("onBeforeInput",["compositionend","keypress","textInput","paste"]);di("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));di("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));di("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lo="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(" "),R1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Lo));function Ib(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],i=r.event;r=r.listeners;e:{var n=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!==n&&i.isPropagationStopped())break e;n=l,i.currentTarget=p;try{n(i)}catch(m){ss(m)}i.currentTarget=null,n=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,p=l.currentTarget,l=l.listener,c!==n&&i.isPropagationStopped())break e;n=l,i.currentTarget=p;try{n(i)}catch(m){ss(m)}i.currentTarget=null,n=c}}}}function we(e,t){var a=t[Ou];a===void 0&&(a=t[Ou]=new Set);var r=e+"__bubble";a.has(r)||(Fb(t,e,2,!1),a.add(r))}function Su(e,t,a){var r=0;t&&(r|=4),Fb(a,e,r,t)}var Hl="_reactListening"+Math.random().toString(36).slice(2);function dd(e){if(!e[Hl]){e[Hl]=!0,Yh.forEach(function(a){a!=="selectionchange"&&(R1.has(a)||Su(a,!1,e),Su(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hl]||(t[Hl]=!0,Su("selectionchange",!1,t))}}function Fb(e,t,a,r){switch(pw(t)){case 2:var i=o_;break;case 8:i=l_;break;default:i=gd}a=i.bind(null,t,a,e),i=void 0,!Gu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,a,{capture:!0,passive:i}):e.addEventListener(t,a,!0):i!==void 0?e.addEventListener(t,a,{passive:i}):e.addEventListener(t,a,!1)}function Nu(e,t,a,r,i){var n=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===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;l!==null;){if(o=Vi(l),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=n=o;continue e}l=l.parentNode}}r=r.return}Ih(function(){var p=n,m=Tp(a),h=[];e:{var d=dg.get(e);if(d!==void 0){var b=As,v=e;switch(e){case"keypress":if(Vl(a)===0)break e;case"keydown":case"keyup":b=qy;break;case"focusin":v="focus",b=ru;break;case"focusout":v="blur",b=ru;break;case"beforeblur":case"afterblur":b=ru;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":b=ff;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":b=hy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":b=Ty;break;case sg:case cg:case ug:b=wy;break;case pg:b=Ry;break;case"scroll":case"scrollend":b=my;break;case"wheel":b=Uy;break;case"copy":case"cut":case"paste":b=yy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":b=gf;break;case"toggle":case"beforetoggle":b=Oy}var q=(t&4)!==0,O=!q&&(e==="scroll"||e==="scrollend"),f=q?d!==null?d+"Capture":null:d;q=[];for(var u=p,g;u!==null;){var w=u;if(g=w.stateNode,w=w.tag,w!==5&&w!==26&&w!==27||g===null||f===null||(w=To(u,f),w!=null&&q.push(Ho(u,w,g))),O)break;u=u.return}0<q.length&&(d=new b(d,v,null,a,m),h.push({event:d,listeners:q}))}}if((t&7)===0){e:{if(d=e==="mouseover"||e==="pointerover",b=e==="mouseout"||e==="pointerout",d&&a!==Qu&&(v=a.relatedTarget||a.fromElement)&&(Vi(v)||v[yn]))break e;if((b||d)&&(d=m.window===m?m:(d=m.ownerDocument)?d.defaultView||d.parentWindow:window,b?(v=a.relatedTarget||a.toElement,b=p,v=v?Vi(v):null,v!==null&&(O=Yo(v),q=v.tag,v!==O||q!==5&&q!==27&&q!==6)&&(v=null)):(b=null,v=p),b!==v)){if(q=ff,w="onMouseLeave",f="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(q=gf,w="onPointerLeave",f="onPointerEnter",u="pointer"),O=b==null?d:mo(b),g=v==null?d:mo(v),d=new q(w,u+"leave",b,a,m),d.target=O,d.relatedTarget=g,w=null,Vi(m)===p&&(q=new q(f,u+"enter",v,a,m),q.target=g,q.relatedTarget=O,w=q),O=w,b&&v)t:{for(q=A1,f=b,u=v,g=0,w=f;w;w=q(w))g++;w=0;for(var k=u;k;k=q(k))w++;for(;0<g-w;)f=q(f),g--;for(;0<w-g;)u=q(u),w--;for(;g--;){if(f===u||u!==null&&f===u.alternate){q=f;break t}f=q(f),u=q(u)}q=null}else q=null;b!==null&&sh(h,d,b,q,!1),v!==null&&O!==null&&sh(h,O,v,q,!0)}}e:{if(d=p?mo(p):window,b=d.nodeName&&d.nodeName.toLowerCase(),b==="select"||b==="input"&&d.type==="file")var T=yf;else if(vf(d))if(rg)T=Xy;else{T=$y;var R=Yy}else b=d.nodeName,!b||b.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?p&&Mp(p.elementType)&&(T=yf):T=Vy;if(T&&(T=T(e,p))){ag(h,T,a,m);break e}R&&R(e,d,p),e==="focusout"&&p&&d.type==="number"&&p.memoizedProps.value!=null&&Hu(d,"number",d.value)}switch(R=p?mo(p):window,e){case"focusin":(vf(R)||R.contentEditable==="true")&&(Ki=R,ju=p,wo=null);break;case"focusout":wo=ju=Ki=null;break;case"mousedown":Yu=!0;break;case"contextmenu":case"mouseup":case"dragend":Yu=!1,Sf(h,a,m);break;case"selectionchange":if(Ky)break;case"keydown":case"keyup":Sf(h,a,m)}var U;if(Ap)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Zi?eg(e,a)&&(A="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(A="onCompositionStart");A&&(Wh&&a.locale!=="ko"&&(Zi||A!=="onCompositionStart"?A==="onCompositionEnd"&&Zi&&(U=Fh()):(Nr=m,zp="value"in Nr?Nr.value:Nr.textContent,Zi=!0)),R=Ns(p,A),0<R.length&&(A=new hf(A,e,null,a,m),h.push({event:A,listeners:R}),U?A.data=U:(U=tg(a),U!==null&&(A.data=U)))),(U=Ly?Hy(e,a):Qy(e,a))&&(A=Ns(p,"onBeforeInput"),0<A.length&&(R=new hf("onBeforeInput","beforeinput",null,a,m),h.push({event:R,listeners:A}),R.data=U)),z1(h,e,p,a,m)}Ib(h,t)})}function Ho(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Ns(e,t){for(var a=t+"Capture",r=[];e!==null;){var i=e,n=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||n===null||(i=To(e,a),i!=null&&r.unshift(Ho(e,i,n)),i=To(e,t),i!=null&&r.push(Ho(e,i,n))),e.tag===3)return r;e=e.return}return[]}function A1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function sh(e,t,a,r,i){for(var n=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,i?(p=To(a,n),p!=null&&o.unshift(Ho(a,p,c))):i||(p=To(a,n),p!=null&&o.push(Ho(a,p,c)))),a=a.return}o.length!==0&&e.push({event:t,listeners:o})}var U1=/\r\n?/g,D1=/\u0000|\uFFFD/g;function ch(e){return(typeof e=="string"?e:""+e).replace(U1,`
|
|
9
|
-
`).replace(D1,"")}function Wb(e,t){return t=ch(t),ch(e)===t}function $e(e,t,a,r,i,n){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||pn(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&pn(e,""+r);break;case"className":El(e,"class",r);break;case"tabIndex":El(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":El(e,a,r);break;case"style":Jh(e,r,n);break;case"data":if(t!=="object"){El(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=Yl(""+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 n=="function"&&(a==="formAction"?(t!=="input"&&$e(e,t,"name",i.name,i,null),$e(e,t,"formEncType",i.formEncType,i,null),$e(e,t,"formMethod",i.formMethod,i,null),$e(e,t,"formTarget",i.formTarget,i,null)):($e(e,t,"encType",i.encType,i,null),$e(e,t,"method",i.method,i,null),$e(e,t,"target",i.target,i,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Yl(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=ar);break;case"onScroll":r!=null&&we("scroll",e);break;case"onScrollEnd":r!=null&&we("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(H(61));if(a=r.__html,a!=null){if(i.children!=null)throw Error(H(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=Yl(""+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":we("beforetoggle",e),we("toggle",e),jl(e,"popover",r);break;case"xlinkActuate":Ka(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Ka(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Ka(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Ka(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Ka(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Ka(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Ka(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Ka(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Ka(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":jl(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=py.get(a)||a,jl(e,a,r))}}function mp(e,t,a,r,i,n){switch(a){case"style":Jh(e,r,n);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(H(61));if(a=r.__html,a!=null){if(i.children!=null)throw Error(H(60));e.innerHTML=a}}break;case"children":typeof r=="string"?pn(e,r):(typeof r=="number"||typeof r=="bigint")&&pn(e,""+r);break;case"onScroll":r!=null&&we("scroll",e);break;case"onScrollEnd":r!=null&&we("scrollend",e);break;case"onClick":r!=null&&(e.onclick=ar);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$h.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(i=a.endsWith("Capture"),t=a.slice(2,i?a.length-7:void 0),n=e[Pt]||null,n=n!=null?n[a]:null,typeof n=="function"&&e.removeEventListener(t,n,i),typeof r=="function")){typeof n!="function"&&n!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,r,i);break e}a in e?e[a]=r:r===!0?e.setAttribute(a,""):jl(e,a,r)}}}function Tt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":we("error",e),we("load",e);var r=!1,i=!1,n;for(n in a)if(a.hasOwnProperty(n)){var o=a[n];if(o!=null)switch(n){case"src":r=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(H(137,t));default:$e(e,t,n,o,a,null)}}i&&$e(e,t,"srcSet",a.srcSet,a,null),r&&$e(e,t,"src",a.src,a,null);return;case"input":we("invalid",e);var l=n=o=i=null,c=null,p=null;for(r in a)if(a.hasOwnProperty(r)){var m=a[r];if(m!=null)switch(r){case"name":i=m;break;case"type":o=m;break;case"checked":c=m;break;case"defaultChecked":p=m;break;case"value":n=m;break;case"defaultValue":l=m;break;case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(H(137,t));break;default:$e(e,t,r,m,a,null)}}Zh(e,n,l,c,p,o,i,!1);return;case"select":we("invalid",e),r=o=n=null;for(i in a)if(a.hasOwnProperty(i)&&(l=a[i],l!=null))switch(i){case"value":n=l;break;case"defaultValue":o=l;break;case"multiple":r=l;default:$e(e,t,i,l,a,null)}t=n,a=o,e.multiple=!!r,t!=null?an(e,!!r,t,!1):a!=null&&an(e,!!r,a,!0);return;case"textarea":we("invalid",e),n=i=r=null;for(o in a)if(a.hasOwnProperty(o)&&(l=a[o],l!=null))switch(o){case"value":r=l;break;case"defaultValue":i=l;break;case"children":n=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(H(91));break;default:$e(e,t,o,l,a,null)}Ph(e,r,i,n);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":$e(e,t,c,r,a,null));return;case"dialog":we("beforetoggle",e),we("toggle",e),we("cancel",e),we("close",e);break;case"iframe":case"object":we("load",e);break;case"video":case"audio":for(r=0;r<Lo.length;r++)we(Lo[r],e);break;case"image":we("error",e),we("load",e);break;case"details":we("toggle",e);break;case"embed":case"source":case"link":we("error",e),we("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(H(137,t));default:$e(e,t,p,r,a,null)}return;default:if(Mp(t)){for(m in a)a.hasOwnProperty(m)&&(r=a[m],r!==void 0&&mp(e,t,m,r,a,void 0));return}}for(l in a)a.hasOwnProperty(l)&&(r=a[l],r!=null&&$e(e,t,l,r,a,null))}function O1(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 i=null,n=null,o=null,l=null,c=null,p=null,m=null;for(b in a){var h=a[b];if(a.hasOwnProperty(b)&&h!=null)switch(b){case"checked":break;case"value":break;case"defaultValue":c=h;default:r.hasOwnProperty(b)||$e(e,t,b,null,r,h)}}for(var d in r){var b=r[d];if(h=a[d],r.hasOwnProperty(d)&&(b!=null||h!=null))switch(d){case"type":n=b;break;case"name":i=b;break;case"checked":p=b;break;case"defaultChecked":m=b;break;case"value":o=b;break;case"defaultValue":l=b;break;case"children":case"dangerouslySetInnerHTML":if(b!=null)throw Error(H(137,t));break;default:b!==h&&$e(e,t,d,b,r,h)}}Lu(e,o,l,c,p,m,n,i);return;case"select":b=o=l=d=null;for(n in a)if(c=a[n],a.hasOwnProperty(n)&&c!=null)switch(n){case"value":break;case"multiple":b=c;default:r.hasOwnProperty(n)||$e(e,t,n,null,r,c)}for(i in r)if(n=r[i],c=a[i],r.hasOwnProperty(i)&&(n!=null||c!=null))switch(i){case"value":d=n;break;case"defaultValue":l=n;break;case"multiple":o=n;default:n!==c&&$e(e,t,i,n,r,c)}t=l,a=o,r=b,d!=null?an(e,!!a,d,!1):!!r!=!!a&&(t!=null?an(e,!!a,t,!0):an(e,!!a,a?[]:"",!1));return;case"textarea":b=d=null;for(l in a)if(i=a[l],a.hasOwnProperty(l)&&i!=null&&!r.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:$e(e,t,l,null,r,i)}for(o in r)if(i=r[o],n=a[o],r.hasOwnProperty(o)&&(i!=null||n!=null))switch(o){case"value":d=i;break;case"defaultValue":b=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(H(91));break;default:i!==n&&$e(e,t,o,i,r,n)}Kh(e,d,b);return;case"option":for(var v in a)d=a[v],a.hasOwnProperty(v)&&d!=null&&!r.hasOwnProperty(v)&&(v==="selected"?e.selected=!1:$e(e,t,v,null,r,d));for(c in r)d=r[c],b=a[c],r.hasOwnProperty(c)&&d!==b&&(d!=null||b!=null)&&(c==="selected"?e.selected=d&&typeof d!="function"&&typeof d!="symbol":$e(e,t,c,d,r,b));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 q in a)d=a[q],a.hasOwnProperty(q)&&d!=null&&!r.hasOwnProperty(q)&&$e(e,t,q,null,r,d);for(p in r)if(d=r[p],b=a[p],r.hasOwnProperty(p)&&d!==b&&(d!=null||b!=null))switch(p){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(H(137,t));break;default:$e(e,t,p,d,r,b)}return;default:if(Mp(t)){for(var O in a)d=a[O],a.hasOwnProperty(O)&&d!==void 0&&!r.hasOwnProperty(O)&&mp(e,t,O,void 0,r,d);for(m in r)d=r[m],b=a[m],!r.hasOwnProperty(m)||d===b||d===void 0&&b===void 0||mp(e,t,m,d,r,b);return}}for(var f in a)d=a[f],a.hasOwnProperty(f)&&d!=null&&!r.hasOwnProperty(f)&&$e(e,t,f,null,r,d);for(h in r)d=r[h],b=a[h],!r.hasOwnProperty(h)||d===b||d==null&&b==null||$e(e,t,h,d,r,b)}function uh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function B1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),r=0;r<a.length;r++){var i=a[r],n=i.transferSize,o=i.initiatorType,l=i.duration;if(n&&l&&uh(o)){for(o=0,l=i.responseEnd,r+=1;r<a.length;r++){var c=a[r],p=c.startTime;if(p>l)break;var m=c.transferSize,h=c.initiatorType;m&&uh(h)&&(c=c.responseEnd,o+=m*(c<l?1:(l-p)/(c-p)))}if(--r,t+=8*(n+o)/(i.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 fp=null,hp=null;function Cs(e){return e.nodeType===9?e:e.ownerDocument}function ph(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 ew(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 gp(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 Cu=null;function L1(){var e=window.event;return e&&e.type==="popstate"?e===Cu?!1:(Cu=e,!0):(Cu=null,!1)}var tw=typeof setTimeout=="function"?setTimeout:void 0,H1=typeof clearTimeout=="function"?clearTimeout:void 0,dh=typeof Promise=="function"?Promise:void 0,Q1=typeof queueMicrotask=="function"?queueMicrotask:typeof dh<"u"?function(e){return dh.resolve(null).then(e).catch(G1)}:tw;function G1(e){setTimeout(function(){throw e})}function Yr(e){return e==="head"}function mh(e,t){var a=t,r=0;do{var i=a.nextSibling;if(e.removeChild(a),i&&i.nodeType===8)if(a=i.data,a==="/$"||a==="/&"){if(r===0){e.removeChild(i),vn(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")Eo(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Eo(a);for(var n=a.firstChild;n;){var o=n.nextSibling,l=n.nodeName;n[Zo]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&n.rel.toLowerCase()==="stylesheet"||a.removeChild(n),n=o}}else a==="body"&&Eo(e.ownerDocument.body);a=i}while(a);vn(t)}function fh(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 bp(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":bp(a),Ep(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function j1(e,t,a,r){for(;e.nodeType===1;){var i=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Zo])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(n=e.getAttribute("rel"),n==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(n!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(n=e.getAttribute("src"),(n!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&n&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var n=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===n)return e}else return e;if(e=va(e.nextSibling),e===null)break}return null}function Y1(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=va(e.nextSibling),e===null))return null;return e}function aw(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=va(e.nextSibling),e===null))return null;return e}function wp(e){return e.data==="$?"||e.data==="$~"}function vp(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function $1(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 va(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 yp=null;function hh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return va(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function gh(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 rw(e,t,a){switch(t=Cs(a),e){case"html":if(e=t.documentElement,!e)throw Error(H(452));return e;case"head":if(e=t.head,!e)throw Error(H(453));return e;case"body":if(e=t.body,!e)throw Error(H(454));return e;default:throw Error(H(451))}}function Eo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ep(e)}var ya=new Map,bh=new Set;function qs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var dr=Ae.d;Ae.d={f:V1,r:X1,D:Z1,C:K1,L:P1,m:J1,X:F1,S:I1,M:W1};function V1(){var e=dr.f(),t=$s();return e||t}function X1(e){var t=_n(e);t!==null&&t.tag===5&&t.type==="form"?Jg(t):dr.r(e)}var Nn=typeof document>"u"?null:document;function iw(e,t,a){var r=Nn;if(r&&typeof t=="string"&&t){var i=ha(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof a=="string"&&(i+='[crossorigin="'+a+'"]'),bh.has(i)||(bh.add(i),e={rel:e,crossOrigin:a,href:t},r.querySelector(i)===null&&(t=r.createElement("link"),Tt(t,"link",e),kt(t),r.head.appendChild(t)))}}function Z1(e){dr.D(e),iw("dns-prefetch",e,null)}function K1(e,t){dr.C(e,t),iw("preconnect",e,t)}function P1(e,t,a){dr.L(e,t,a);var r=Nn;if(r&&e&&t){var i='link[rel="preload"][as="'+ha(t)+'"]';t==="image"&&a&&a.imageSrcSet?(i+='[imagesrcset="'+ha(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(i+='[imagesizes="'+ha(a.imageSizes)+'"]')):i+='[href="'+ha(e)+'"]';var n=i;switch(t){case"style":n=wn(e);break;case"script":n=Cn(e)}ya.has(n)||(e=We({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),ya.set(n,e),r.querySelector(i)!==null||t==="style"&&r.querySelector(Wo(n))||t==="script"&&r.querySelector(el(n))||(t=r.createElement("link"),Tt(t,"link",e),kt(t),r.head.appendChild(t)))}}function J1(e,t){dr.m(e,t);var a=Nn;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+ha(r)+'"][href="'+ha(e)+'"]',n=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=Cn(e)}if(!ya.has(n)&&(e=We({rel:"modulepreload",href:e},t),ya.set(n,e),a.querySelector(i)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(el(n)))return}r=a.createElement("link"),Tt(r,"link",e),kt(r),a.head.appendChild(r)}}}function I1(e,t,a){dr.S(e,t,a);var r=Nn;if(r&&e){var i=tn(r).hoistableStyles,n=wn(e);t=t||"default";var o=i.get(n);if(!o){var l={loading:0,preload:null};if(o=r.querySelector(Wo(n)))l.loading=5;else{e=We({rel:"stylesheet",href:e,"data-precedence":t},a),(a=ya.get(n))&&md(e,a);var c=o=r.createElement("link");kt(c),Tt(c,"link",e),c._p=new Promise(function(p,m){c.onload=p,c.onerror=m}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Wl(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:l},i.set(n,o)}}}function F1(e,t){dr.X(e,t);var a=Nn;if(a&&e){var r=tn(a).hoistableScripts,i=Cn(e),n=r.get(i);n||(n=a.querySelector(el(i)),n||(e=We({src:e,async:!0},t),(t=ya.get(i))&&fd(e,t),n=a.createElement("script"),kt(n),Tt(n,"link",e),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},r.set(i,n))}}function W1(e,t){dr.M(e,t);var a=Nn;if(a&&e){var r=tn(a).hoistableScripts,i=Cn(e),n=r.get(i);n||(n=a.querySelector(el(i)),n||(e=We({src:e,async:!0,type:"module"},t),(t=ya.get(i))&&fd(e,t),n=a.createElement("script"),kt(n),Tt(n,"link",e),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},r.set(i,n))}}function wh(e,t,a,r){var i=(i=Mr.current)?qs(i):null;if(!i)throw Error(H(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=wn(a.href),a=tn(i).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=wn(a.href);var n=tn(i).hoistableStyles,o=n.get(e);if(o||(i=i.ownerDocument||i,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(e,o),(n=i.querySelector(Wo(e)))&&!n._p&&(o.instance=n,o.state.loading=5),ya.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},ya.set(e,a),n||e_(i,e,a,o.state))),t&&r===null)throw Error(H(528,""));return o}if(t&&r!==null)throw Error(H(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Cn(a),a=tn(i).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(H(444,e))}}function wn(e){return'href="'+ha(e)+'"'}function Wo(e){return'link[rel="stylesheet"]['+e+"]"}function nw(e){return We({},e,{"data-precedence":e.precedence,precedence:null})}function e_(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}),Tt(t,"link",a),kt(t),e.head.appendChild(t))}function Cn(e){return'[src="'+ha(e)+'"]'}function el(e){return"script[async]"+e}function vh(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,kt(r),r;var i=We({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),kt(r),Tt(r,"style",i),Wl(r,a.precedence,e),t.instance=r;case"stylesheet":i=wn(a.href);var n=e.querySelector(Wo(i));if(n)return t.state.loading|=4,t.instance=n,kt(n),n;r=nw(a),(i=ya.get(i))&&md(r,i),n=(e.ownerDocument||e).createElement("link"),kt(n);var o=n;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),Tt(n,"link",r),t.state.loading|=4,Wl(n,a.precedence,e),t.instance=n;case"script":return n=Cn(a.src),(i=e.querySelector(el(n)))?(t.instance=i,kt(i),i):(r=a,(i=ya.get(n))&&(r=We({},a),fd(r,i)),e=e.ownerDocument||e,i=e.createElement("script"),kt(i),Tt(i,"link",r),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(H(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Wl(r,a.precedence,e));return t.instance}function Wl(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,n=i,o=0;o<r.length;o++){var l=r[o];if(l.dataset.precedence===t)n=l;else if(n!==i)break}n?n.parentNode.insertBefore(e,n.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function md(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function fd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var es=null;function yh(e,t,a){if(es===null){var r=new Map,i=es=new Map;i.set(a,r)}else i=es,r=i.get(a),r||(r=new Map,i.set(a,r));if(r.has(e))return r;for(r.set(e,null),a=a.getElementsByTagName(e),i=0;i<a.length;i++){var n=a[i];if(!(n[Zo]||n[qt]||e==="link"&&n.getAttribute("rel")==="stylesheet")&&n.namespaceURI!=="http://www.w3.org/2000/svg"){var o=n.getAttribute(t)||"";o=e+o;var l=r.get(o);l?l.push(n):r.set(o,[n])}}return r}function _h(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function t_(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 ow(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function a_(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 i=wn(r.href),n=t.querySelector(Wo(i));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Es.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=n,kt(n);return}n=t.ownerDocument||t,r=nw(r),(i=ya.get(i))&&md(r,i),n=n.createElement("link"),kt(n);var o=n;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),Tt(n,"link",r),a.instance=n}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Es.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var qu=0;function r_(e,t){return e.stylesheets&&e.count===0&&ts(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&ts(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4+t);0<e.imgBytes&&qu===0&&(qu=62500*B1());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ts(e,e.stylesheets),e.unsuspend)){var n=e.unsuspend;e.unsuspend=null,n()}},(e.imgBytes>qu?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Es(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ts(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ms=null;function ts(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ms=new Map,t.forEach(i_,e),Ms=null,Es.call(e))}function i_(e,t){if(!(t.state.loading&4)){var a=Ms.get(e);if(a)var r=a.get(null);else{a=new Map,Ms.set(e,a);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n<i.length;n++){var o=i[n];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(a.set(o.dataset.precedence,o),r=o)}r&&a.set(null,r)}i=t.instance,o=i.getAttribute("data-precedence"),n=a.get(o)||r,n===r&&a.set(null,i),a.set(o,i),this.count++,r=Es.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),n?n.parentNode.insertBefore(i,n.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qo={$$typeof:tr,Provider:null,Consumer:null,_currentValue:ai,_currentValue2:ai,_threadCount:0};function n_(e,t,a,r,i,n,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=Wc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wc(0),this.hiddenUpdates=Wc(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=n,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function lw(e,t,a,r,i,n,o,l,c,p,m,h){return e=new n_(e,t,a,o,c,p,m,h,l),t=1,n===!0&&(t|=24),n=aa(3,null,null,t),e.current=n,n.stateNode=e,t=Qp(),t.refCount++,e.pooledCache=t,t.refCount++,n.memoizedState={element:r,isDehydrated:a,cache:t},Yp(n),e}function sw(e){return e?(e=Ii,e):Ii}function cw(e,t,a,r,i,n){i=sw(i),r.context===null?r.context=i:r.pendingContext=i,r=zr(t),r.payload={element:a},n=n===void 0?null:n,n!==null&&(r.callback=n),a=Rr(e,r,t),a!==null&&(Kt(a,e,t),yo(a,e,t))}function xh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function hd(e,t){xh(e,t),(e=e.alternate)&&xh(e,t)}function uw(e){if(e.tag===13||e.tag===31){var t=hi(e,67108864);t!==null&&Kt(t,e,67108864),hd(e,67108864)}}function kh(e){if(e.tag===13||e.tag===31){var t=la();t=Cp(t);var a=hi(e,t);a!==null&&Kt(a,e,t),hd(e,t)}}var Ts=!0;function o_(e,t,a,r){var i=se.T;se.T=null;var n=Ae.p;try{Ae.p=2,gd(e,t,a,r)}finally{Ae.p=n,se.T=i}}function l_(e,t,a,r){var i=se.T;se.T=null;var n=Ae.p;try{Ae.p=8,gd(e,t,a,r)}finally{Ae.p=n,se.T=i}}function gd(e,t,a,r){if(Ts){var i=_p(r);if(i===null)Nu(e,t,r,zs,a),Sh(e,r);else if(c_(i,e,t,a,r))r.stopPropagation();else if(Sh(e,r),t&4&&-1<s_.indexOf(e)){for(;i!==null;){var n=_n(i);if(n!==null)switch(n.tag){case 3:if(n=n.stateNode,n.current.memoizedState.isDehydrated){var o=Wr(n.pendingLanes);if(o!==0){var l=n;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var c=1<<31-oa(o);l.entanglements[1]|=c,o&=~c}Ha(n),(Re&6)===0&&(ys=ia()+500,Fo(0,!1))}}break;case 31:case 13:l=hi(n,2),l!==null&&Kt(l,n,2),$s(),hd(n,2)}if(n=_p(r),n===null&&Nu(e,t,r,zs,a),n===i)break;i=n}i!==null&&r.stopPropagation()}else Nu(e,t,r,null,a)}}function _p(e){return e=Tp(e),bd(e)}var zs=null;function bd(e){if(zs=null,e=Vi(e),e!==null){var t=Yo(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=Th(t),e!==null)return e;e=null}else if(a===31){if(e=zh(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 zs=e,null}function pw(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(P0()){case Dh:return 2;case Oh:return 8;case os:case J0:return 32;case Bh:return 268435456;default:return 32}default:return 32}}var xp=!1,Dr=null,Or=null,Br=null,Go=new Map,jo=new Map,kr=[],s_="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 Sh(e,t){switch(e){case"focusin":case"focusout":Dr=null;break;case"dragenter":case"dragleave":Or=null;break;case"mouseover":case"mouseout":Br=null;break;case"pointerover":case"pointerout":Go.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":jo.delete(t.pointerId)}}function so(e,t,a,r,i,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:n,targetContainers:[i]},t!==null&&(t=_n(t),t!==null&&uw(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function c_(e,t,a,r,i){switch(t){case"focusin":return Dr=so(Dr,e,t,a,r,i),!0;case"dragenter":return Or=so(Or,e,t,a,r,i),!0;case"mouseover":return Br=so(Br,e,t,a,r,i),!0;case"pointerover":var n=i.pointerId;return Go.set(n,so(Go.get(n)||null,e,t,a,r,i)),!0;case"gotpointercapture":return n=i.pointerId,jo.set(n,so(jo.get(n)||null,e,t,a,r,i)),!0}return!1}function dw(e){var t=Vi(e.target);if(t!==null){var a=Yo(t);if(a!==null){if(t=a.tag,t===13){if(t=Th(a),t!==null){e.blockedOn=t,lf(e.priority,function(){kh(a)});return}}else if(t===31){if(t=zh(a),t!==null){e.blockedOn=t,lf(e.priority,function(){kh(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 as(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=_p(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Qu=r,a.target.dispatchEvent(r),Qu=null}else return t=_n(a),t!==null&&uw(t),e.blockedOn=a,!1;t.shift()}return!0}function Nh(e,t,a){as(e)&&a.delete(t)}function u_(){xp=!1,Dr!==null&&as(Dr)&&(Dr=null),Or!==null&&as(Or)&&(Or=null),Br!==null&&as(Br)&&(Br=null),Go.forEach(Nh),jo.forEach(Nh)}function Ql(e,t){e.blockedOn===t&&(e.blockedOn=null,xp||(xp=!0,bt.unstable_scheduleCallback(bt.unstable_NormalPriority,u_)))}var Gl=null;function Ch(e){Gl!==e&&(Gl=e,bt.unstable_scheduleCallback(bt.unstable_NormalPriority,function(){Gl===e&&(Gl=null);for(var t=0;t<e.length;t+=3){var a=e[t],r=e[t+1],i=e[t+2];if(typeof r!="function"){if(bd(r||a)===null)continue;break}var n=_n(a);n!==null&&(e.splice(t,3),t-=3,ap(n,{pending:!0,data:i,method:a.method,action:r},r,i))}}))}function vn(e){function t(c){return Ql(c,e)}Dr!==null&&Ql(Dr,e),Or!==null&&Ql(Or,e),Br!==null&&Ql(Br,e),Go.forEach(t),jo.forEach(t);for(var a=0;a<kr.length;a++){var r=kr[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<kr.length&&(a=kr[0],a.blockedOn===null);)dw(a),a.blockedOn===null&&kr.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(r=0;r<a.length;r+=3){var i=a[r],n=a[r+1],o=i[Pt]||null;if(typeof n=="function")o||Ch(a);else if(o){var l=null;if(n&&n.hasAttribute("formAction")){if(i=n,o=n[Pt]||null)l=o.formAction;else if(bd(i)!==null)continue}else l=o.action;typeof l=="function"?a[r+1]=l:(a.splice(r,3),r-=3),Ch(a)}}}function mw(){function e(n){n.canIntercept&&n.info==="react-transition"&&n.intercept({handler:function(){return new Promise(function(o){return i=o})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),r||setTimeout(a,20)}function a(){if(!r&&!navigation.transition){var n=navigation.currentEntry;n&&n.url!=null&&navigation.navigate(n.url,{state:n.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,i=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),i!==null&&(i(),i=null)}}}function wd(e){this._internalRoot=e}Zs.prototype.render=wd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));var a=t.current,r=la();cw(a,r,e,t,null,null)};Zs.prototype.unmount=wd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;cw(e.current,2,null,e,null,null),$s(),t[yn]=null}};function Zs(e){this._internalRoot=e}Zs.prototype.unstable_scheduleHydration=function(e){if(e){var t=jh();e={blockedOn:null,target:e,priority:t};for(var a=0;a<kr.length&&t!==0&&t<kr[a].priority;a++);kr.splice(a,0,e),a===0&&dw(e)}};var qh=Eh.version;if(qh!=="19.2.3")throw Error(H(527,qh,"19.2.3"));Ae.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=j0(t),e=e!==null?Rh(e):null,e=e===null?null:e.stateNode,e};var p_={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:se,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(co=__REACT_DEVTOOLS_GLOBAL_HOOK__,!co.isDisabled&&co.supportsFiber))try{$o=co.inject(p_),na=co}catch{}var co;Ks.createRoot=function(e,t){if(!Mh(e))throw Error(H(299));var a=!1,r="",i=ib,n=nb,o=ob;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(n=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=lw(e,1,!1,null,null,a,r,null,i,n,o,mw),e[yn]=t.current,dd(e),new wd(t)};Ks.hydrateRoot=function(e,t,a){if(!Mh(e))throw Error(H(299));var r=!1,i="",n=ib,o=nb,l=ob,c=null;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(i=a.identifierPrefix),a.onUncaughtError!==void 0&&(n=a.onUncaughtError),a.onCaughtError!==void 0&&(o=a.onCaughtError),a.onRecoverableError!==void 0&&(l=a.onRecoverableError),a.formState!==void 0&&(c=a.formState)),t=lw(e,1,!0,t,a??null,r,i,c,n,o,l,mw),t.context=sw(null),a=t.current,r=la(),r=Cp(r),i=zr(r),i.callback=null,Rr(a,i,r),a=r,t.current.lanes=a,Xo(t,a),Ha(t),e[yn]=t.current,dd(e),new Zs(t)};Ks.version="19.2.3"});var bw=Ra((Kx,gw)=>{"use strict";function hw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hw)}catch(e){console.error(e)}}hw(),gw.exports=fw()});var dv=Ra(Fs=>{"use strict";var __=Symbol.for("react.transitional.element"),x_=Symbol.for("react.fragment");function pv(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 i in t)i!=="key"&&(a[i]=t[i])}else a=t;return t=a.ref,{$$typeof:__,type:e,key:r,ref:t!==void 0?t:null,props:a}}Fs.Fragment=x_;Fs.jsx=pv;Fs.jsxs=pv});var F=Ra((x2,mv)=>{"use strict";mv.exports=dv()});var u0=$(bw());var ww=`/* Every rule is scoped to .app-wrapper, the root of each widget, so nothing here styles
|
|
8
|
+
`+r.stack}}var Du=Object.prototype.hasOwnProperty,Np=bt.unstable_scheduleCallback,Fc=bt.unstable_cancelCallback,Z0=bt.unstable_shouldYield,K0=bt.unstable_requestPaint,ia=bt.unstable_now,P0=bt.unstable_getCurrentPriorityLevel,Oh=bt.unstable_ImmediatePriority,Bh=bt.unstable_UserBlockingPriority,os=bt.unstable_NormalPriority,J0=bt.unstable_LowPriority,Lh=bt.unstable_IdlePriority,I0=bt.log,F0=bt.unstable_setDisableYieldValue,$o=null,na=null;function Sr(e){if(typeof I0=="function"&&F0(e),na&&typeof na.setStrictMode=="function")try{na.setStrictMode($o,e)}catch{}}var oa=Math.clz32?Math.clz32:ty,W0=Math.log,ey=Math.LN2;function ty(e){return e>>>=0,e===0?32:31-(W0(e)/ey|0)|0}var Nl=256,Cl=262144,ql=4194304;function Wr(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 Rs(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=Wr(r):(o&=l,o!==0?n=Wr(o):a||(a=l&~e,a!==0&&(n=Wr(a))))):(l=r&~i,l!==0?n=Wr(l):o!==0?n=Wr(o):a||(a=r&~e,a!==0&&(n=Wr(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 Vo(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ay(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 Hh(){var e=ql;return ql<<=1,(ql&62914560)===0&&(ql=4194304),e}function Wc(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Xo(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ry(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-oa(a),h=1<<f;l[f]=0,c[f]=-1;var d=p[f];if(d!==null)for(p[f]=null,f=0;f<d.length;f++){var g=d[f];g!==null&&(g.lane&=-536870913)}a&=~h}r!==0&&Qh(e,r,0),i!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=i&~(o&~t))}function Qh(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-oa(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|a&261930}function Gh(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-oa(a),n=1<<r;n&t|e[r]&t&&(e[r]|=t),a&=~n}}function jh(e,t){var a=t&-t;return a=(a&42)!==0?1:Cp(a),(a&(e.suspendedLanes|t))!==0?0:a}function Cp(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 qp(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Yh(){var e=Ae.p;return e!==0?e:(e=window.event,e===void 0?32:dw(e.type))}function sf(e,t){var a=Ae.p;try{return Ae.p=e,t()}finally{Ae.p=a}}var jr=Math.random().toString(36).slice(2),qt="__reactFiber$"+jr,Pt="__reactProps$"+jr,yn="__reactContainer$"+jr,Ou="__reactEvents$"+jr,iy="__reactListeners$"+jr,ny="__reactHandles$"+jr,cf="__reactResources$"+jr,Zo="__reactMarker$"+jr;function Ep(e){delete e[qt],delete e[Pt],delete e[Ou],delete e[iy],delete e[ny]}function Vi(e){var t=e[qt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[yn]||a[qt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=bh(e);e!==null;){if(a=e[qt])return a;e=bh(e)}return t}e=a,a=e.parentNode}return null}function _n(e){if(e=e[qt]||e[yn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function mo(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(B(33))}function tn(e){var t=e[cf];return t||(t=e[cf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function kt(e){e[Zo]=!0}var $h=new Set,Vh={};function di(e,t){un(e,t),un(e+"Capture",t)}function un(e,t){for(Vh[e]=t,e=0;e<t.length;e++)$h.add(t[e])}var oy=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]*$"),uf={},pf={};function ly(e){return Du.call(pf,e)?!0:Du.call(uf,e)?!1:oy.test(e)?pf[e]=!0:(uf[e]=!0,!1)}function jl(e,t,a){if(ly(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 El(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 Pa(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 da(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Xh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sy(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 Bu(e){if(!e._valueTracker){var t=Xh(e)?"checked":"value";e._valueTracker=sy(e,t,""+e[t])}}function Zh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=Xh(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function ls(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 cy=/[\n"\\]/g;function ha(e){return e.replace(cy,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Lu(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=""+da(t)):e.value!==""+da(t)&&(e.value=""+da(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?Hu(e,o,da(t)):a!=null?Hu(e,o,da(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=""+da(l):e.removeAttribute("name")}function Kh(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)){Bu(e);return}a=a!=null?""+da(a):"",t=t!=null?""+da(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),Bu(e)}function Hu(e,t,a){t==="number"&&ls(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function an(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=""+da(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 Ph(e,t,a){if(t!=null&&(t=""+da(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+da(a):""}function Jh(e,t,a,r){if(t==null){if(r!=null){if(a!=null)throw Error(B(92));if(po(r)){if(1<r.length)throw Error(B(93));r=r[0]}a=r}a==null&&(a=""),t=a}a=da(t),e.defaultValue=a,r=e.textContent,r===a&&r!==""&&r!==null&&(e.value=r),Bu(e)}function pn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var uy=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 df(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||uy.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Ih(e,t,a){if(t!=null&&typeof t!="object")throw Error(B(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&&df(e,n,r)}else for(var i in t)t.hasOwnProperty(i)&&df(e,i,t[i])}function Mp(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 py=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"]]),dy=/^[\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 Yl(e){return dy.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function rr(){}var Qu=null;function Tp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xi=null,rn=null;function mf(e){var t=_n(e);if(t&&(e=t.stateNode)){var a=e[Pt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Lu(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[Pt]||null;if(!n)throw Error(B(90));Lu(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&&Zh(r)}break e;case"textarea":Ph(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&an(e,!!a.multiple,t,!1)}}}var eu=!1;function Fh(e,t,a){if(eu)return e(t,a);eu=!0;try{var r=e(t);return r}finally{if(eu=!1,(Xi!==null||rn!==null)&&($s(),Xi&&(t=Xi,e=rn,rn=Xi=null,mf(t),e)))for(t=0;t<e.length;t++)mf(e[t])}}function To(e,t){var a=e.stateNode;if(a===null)return null;var r=a[Pt]||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(B(231,t,typeof a));return a}var sr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gu=!1;if(sr)try{Li={},Object.defineProperty(Li,"passive",{get:function(){Gu=!0}}),window.addEventListener("test",Li,Li),window.removeEventListener("test",Li,Li)}catch{Gu=!1}var Li,Nr=null,zp=null,$l=null;function Wh(){if($l)return $l;var e,t=zp,a=t.length,r,n="value"in Nr?Nr.value:Nr.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 $l=n.slice(e,1<r?1-r:void 0)}function Vl(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 Ml(){return!0}function ff(){return!1}function Jt(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)?Ml:ff,this.isPropagationStopped=ff,this}return We(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=Ml)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Ml)},persist:function(){},isPersistent:Ml}),t}var mi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},As=Jt(mi),Ko=We({},mi,{view:0,detail:0}),my=Jt(Ko),tu,au,io,Us=We({},Ko,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rp,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!==io&&(io&&e.type==="mousemove"?(tu=e.screenX-io.screenX,au=e.screenY-io.screenY):au=tu=0,io=e),tu)},movementY:function(e){return"movementY"in e?e.movementY:au}}),hf=Jt(Us),fy=We({},Us,{dataTransfer:0}),hy=Jt(fy),gy=We({},Ko,{relatedTarget:0}),ru=Jt(gy),by=We({},mi,{animationName:0,elapsedTime:0,pseudoElement:0}),wy=Jt(by),vy=We({},mi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yy=Jt(vy),_y=We({},mi,{data:0}),gf=Jt(_y),xy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ky={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"},Sy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ny(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Sy[e])?!!t[e]:!1}function Rp(){return Ny}var Cy=We({},Ko,{key:function(e){if(e.key){var t=xy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Vl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ky[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rp,charCode:function(e){return e.type==="keypress"?Vl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Vl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qy=Jt(Cy),Ey=We({},Us,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bf=Jt(Ey),My=We({},Ko,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rp}),Ty=Jt(My),zy=We({},mi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ry=Jt(zy),Ay=We({},Us,{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}),Uy=Jt(Ay),Dy=We({},mi,{newState:0,oldState:0}),Oy=Jt(Dy),By=[9,13,27,32],Ap=sr&&"CompositionEvent"in window,go=null;sr&&"documentMode"in document&&(go=document.documentMode);var Ly=sr&&"TextEvent"in window&&!go,eg=sr&&(!Ap||go&&8<go&&11>=go),wf=" ",vf=!1;function tg(e,t){switch(e){case"keyup":return By.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ag(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zi=!1;function Hy(e,t){switch(e){case"compositionend":return ag(t);case"keypress":return t.which!==32?null:(vf=!0,wf);case"textInput":return e=t.data,e===wf&&vf?null:e;default:return null}}function Qy(e,t){if(Zi)return e==="compositionend"||!Ap&&tg(e,t)?(e=Wh(),$l=zp=Nr=null,Zi=!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 eg&&t.locale!=="ko"?null:t.data;default:return null}}var Gy={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 yf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Gy[e.type]:t==="textarea"}function rg(e,t,a,r){Xi?rn?rn.push(r):rn=[r]:Xi=r,t=Ns(t,"onChange"),0<t.length&&(a=new As("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var bo=null,zo=null;function jy(e){Fb(e,0)}function Ds(e){var t=mo(e);if(Zh(t))return e}function _f(e,t){if(e==="change")return t}var ig=!1;sr&&(sr?(zl="oninput"in document,zl||(iu=document.createElement("div"),iu.setAttribute("oninput","return;"),zl=typeof iu.oninput=="function"),Tl=zl):Tl=!1,ig=Tl&&(!document.documentMode||9<document.documentMode));var Tl,zl,iu;function xf(){bo&&(bo.detachEvent("onpropertychange",ng),zo=bo=null)}function ng(e){if(e.propertyName==="value"&&Ds(zo)){var t=[];rg(t,zo,e,Tp(e)),Fh(jy,t)}}function Yy(e,t,a){e==="focusin"?(xf(),bo=t,zo=a,bo.attachEvent("onpropertychange",ng)):e==="focusout"&&xf()}function $y(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ds(zo)}function Vy(e,t){if(e==="click")return Ds(t)}function Xy(e,t){if(e==="input"||e==="change")return Ds(t)}function Zy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var sa=typeof Object.is=="function"?Object.is:Zy;function Ro(e,t){if(sa(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(!Du.call(t,n)||!sa(e[n],t[n]))return!1}return!0}function kf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sf(e,t){var a=kf(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=kf(a)}}function og(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?og(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function lg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ls(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=ls(e.document)}return t}function Up(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 Ky=sr&&"documentMode"in document&&11>=document.documentMode,Ki=null,ju=null,wo=null,Yu=!1;function Nf(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Yu||Ki==null||Ki!==ls(r)||(r=Ki,"selectionStart"in r&&Up(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}),wo&&Ro(wo,r)||(wo=r,r=Ns(ju,"onSelect"),0<r.length&&(t=new As("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Ki)))}function Ir(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Pi={animationend:Ir("Animation","AnimationEnd"),animationiteration:Ir("Animation","AnimationIteration"),animationstart:Ir("Animation","AnimationStart"),transitionrun:Ir("Transition","TransitionRun"),transitionstart:Ir("Transition","TransitionStart"),transitioncancel:Ir("Transition","TransitionCancel"),transitionend:Ir("Transition","TransitionEnd")},nu={},sg={};sr&&(sg=document.createElement("div").style,"AnimationEvent"in window||(delete Pi.animationend.animation,delete Pi.animationiteration.animation,delete Pi.animationstart.animation),"TransitionEvent"in window||delete Pi.transitionend.transition);function fi(e){if(nu[e])return nu[e];if(!Pi[e])return e;var t=Pi[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in sg)return nu[e]=t[a];return e}var cg=fi("animationend"),ug=fi("animationiteration"),pg=fi("animationstart"),Py=fi("transitionrun"),Jy=fi("transitionstart"),Iy=fi("transitioncancel"),dg=fi("transitionend"),mg=new Map,$u="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(" ");$u.push("scrollEnd");function Ea(e,t){mg.set(e,t),di(t,[e])}var ss=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)},pa=[],Ji=0,Dp=0;function Os(){for(var e=Ji,t=Dp=Ji=0;t<e;){var a=pa[t];pa[t++]=null;var r=pa[t];pa[t++]=null;var n=pa[t];pa[t++]=null;var i=pa[t];if(pa[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&&fg(a,n,i)}}function Bs(e,t,a,r){pa[Ji++]=e,pa[Ji++]=t,pa[Ji++]=a,pa[Ji++]=r,Dp|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Op(e,t,a,r){return Bs(e,t,a,r),cs(e)}function hi(e,t){return Bs(e,null,null,t),cs(e)}function fg(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-oa(a),e=i.hiddenUpdates,r=e[n],r===null?e[n]=[t]:r.push(t),t.lane=a|536870912),i):null}function cs(e){if(50<qo)throw qo=0,pp=null,Error(B(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ii={};function Fy(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 aa(e,t,a,r){return new Fy(e,t,a,r)}function Bp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function nr(e,t){var a=e.alternate;return a===null?(a=aa(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 hg(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 Xl(e,t,a,r,n,i){var o=0;if(r=e,typeof e=="function")Bp(e)&&(o=1);else if(typeof e=="string")o=t_(e,a,Ba.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case zu:return e=aa(31,a,t,n),e.elementType=zu,e.lanes=i,e;case Yi:return ri(a.children,n,i,t);case Uh:o=8,n|=24;break;case Eu:return e=aa(12,a,t,n|2),e.elementType=Eu,e.lanes=i,e;case Mu:return e=aa(13,a,t,n),e.elementType=Mu,e.lanes=i,e;case Tu:return e=aa(19,a,t,n),e.elementType=Tu,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ar:o=10;break e;case Dh:o=9;break e;case kp:o=11;break e;case Sp:o=14;break e;case wr:o=16,r=null;break e}o=29,a=Error(B(130,e===null?"null":typeof e,"")),r=null}return t=aa(o,a,t,n),t.elementType=e,t.type=r,t.lanes=i,t}function ri(e,t,a,r){return e=aa(7,e,r,t),e.lanes=a,e}function ou(e,t,a){return e=aa(6,e,null,t),e.lanes=a,e}function gg(e){var t=aa(18,null,null,0);return t.stateNode=e,t}function lu(e,t,a){return t=aa(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Cf=new WeakMap;function ga(e,t){if(typeof e=="object"&&e!==null){var a=Cf.get(e);return a!==void 0?a:(t={value:e,source:t,stack:lf(t)},Cf.set(e,t),t)}return{value:e,source:t,stack:lf(t)}}var Fi=[],Wi=0,us=null,Ao=0,ma=[],fa=0,Lr=null,Ua=1,Da="";function er(e,t){Fi[Wi++]=Ao,Fi[Wi++]=us,us=e,Ao=t}function bg(e,t,a){ma[fa++]=Ua,ma[fa++]=Da,ma[fa++]=Lr,Lr=e;var r=Ua;e=Da;var n=32-oa(r)-1;r&=~(1<<n),a+=1;var i=32-oa(t)+n;if(30<i){var o=n-n%5;i=(r&(1<<o)-1).toString(32),r>>=o,n-=o,Ua=1<<32-oa(t)+n|a<<n|r,Da=i+e}else Ua=1<<i|a<<n|r,Da=e}function Lp(e){e.return!==null&&(er(e,1),bg(e,1,0))}function Hp(e){for(;e===us;)us=Fi[--Wi],Fi[Wi]=null,Ao=Fi[--Wi],Fi[Wi]=null;for(;e===Lr;)Lr=ma[--fa],ma[fa]=null,Da=ma[--fa],ma[fa]=null,Ua=ma[--fa],ma[fa]=null}function wg(e,t){ma[fa++]=Ua,ma[fa++]=Da,ma[fa++]=Lr,Ua=t.id,Da=t.overflow,Lr=e}var Et=null,Fe=null,Ce=!1,Tr=null,ba=!1,Vu=Error(B(519));function Hr(e){var t=Error(B(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Uo(ga(t,e)),Vu}function qf(e){var t=e.stateNode,a=e.type,r=e.memoizedProps;switch(t[qt]=e,t[Pt]=r,a){case"dialog":ye("cancel",t),ye("close",t);break;case"iframe":case"object":case"embed":ye("load",t);break;case"video":case"audio":for(a=0;a<Lo.length;a++)ye(Lo[a],t);break;case"source":ye("error",t);break;case"img":case"image":case"link":ye("error",t),ye("load",t);break;case"details":ye("toggle",t);break;case"input":ye("invalid",t),Kh(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ye("invalid",t);break;case"textarea":ye("invalid",t),Jh(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||ew(t.textContent,a)?(r.popover!=null&&(ye("beforetoggle",t),ye("toggle",t)),r.onScroll!=null&&ye("scroll",t),r.onScrollEnd!=null&&ye("scrollend",t),r.onClick!=null&&(t.onclick=rr),t=!0):t=!1,t||Hr(e,!0)}function Ef(e){for(Et=e.return;Et;)switch(Et.tag){case 5:case 31:case 13:ba=!1;return;case 27:case 3:ba=!0;return;default:Et=Et.return}}function Hi(e){if(e!==Et)return!1;if(!Ce)return Ef(e),Ce=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||gp(e.type,e.memoizedProps)),a=!a),a&&Fe&&Hr(e),Ef(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));Fe=gh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));Fe=gh(e)}else t===27?(t=Fe,Yr(e.type)?(e=yp,yp=null,Fe=e):Fe=t):Fe=Et?va(e.stateNode.nextSibling):null;return!0}function li(){Fe=Et=null,Ce=!1}function su(){var e=Tr;return e!==null&&(Zt===null?Zt=e:Zt.push.apply(Zt,e),Tr=null),e}function Uo(e){Tr===null?Tr=[e]:Tr.push(e)}var Xu=La(null),gi=null,ir=null;function yr(e,t,a){Ke(Xu,t._currentValue),t._currentValue=a}function or(e){e._currentValue=Xu.current,St(Xu)}function Zu(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 Ku(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),Zu(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(B(341));o.lanes|=a,i=o.alternate,i!==null&&(i.lanes|=a),Zu(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 xn(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(B(387));if(o=o.memoizedProps,o!==null){var l=n.type;sa(n.pendingProps.value,o.value)||(e!==null?e.push(l):e=[l])}}else if(n===rs.current){if(o=n.alternate,o===null)throw Error(B(387));o.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(Qo):e=[Qo])}n=n.return}e!==null&&Ku(t,e,a,r),t.flags|=262144}function ps(e){for(e=e.firstContext;e!==null;){if(!sa(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function si(e){gi=e,ir=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Mt(e){return vg(gi,e)}function Rl(e,t){return gi===null&&si(e),vg(e,t)}function vg(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},ir===null){if(e===null)throw Error(B(308));ir=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ir=ir.next=t;return a}var Wy=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()})}},e1=bt.unstable_scheduleCallback,t1=bt.unstable_NormalPriority,pt={$$typeof:ar,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qp(){return{controller:new Wy,data:new Map,refCount:0}}function Po(e){e.refCount--,e.refCount===0&&e1(t1,function(){e.controller.abort()})}var vo=null,Pu=0,dn=0,nn=null;function a1(e,t){if(vo===null){var a=vo=[];Pu=0,dn=pd(),nn={status:"pending",value:void 0,then:function(r){a.push(r)}}}return Pu++,t.then(Mf,Mf),t}function Mf(){if(--Pu===0&&vo!==null){nn!==null&&(nn.status="fulfilled");var e=vo;vo=null,dn=0,nn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function r1(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 Tf=ce.S;ce.S=function(e,t){Ab=ia(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&a1(e,t),Tf!==null&&Tf(e,t)};var ii=La(null);function Gp(){var e=ii.current;return e!==null?e:Xe.pooledCache}function Zl(e,t){t===null?Ke(ii,ii.current):Ke(ii,t.pool)}function yg(){var e=Gp();return e===null?null:{parent:pt._currentValue,pool:e}}var kn=Error(B(460)),jp=Error(B(474)),Ls=Error(B(542)),ds={then:function(){}};function zf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function _g(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(rr,rr),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Af(e),e;default:if(typeof t.status=="string")t.then(rr,rr);else{if(e=Xe,e!==null&&100<e.shellSuspendCounter)throw Error(B(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,Af(e),e}throw ni=t,kn}}function ei(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(ni=a,kn):a}}var ni=null;function Rf(){if(ni===null)throw Error(B(459));var e=ni;return ni=null,e}function Af(e){if(e===kn||e===Ls)throw Error(B(483))}var on=null,Do=0;function Al(e){var t=Do;return Do+=1,on===null&&(on=[]),_g(on,e,t)}function no(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ul(e,t){throw t.$$typeof===Y0?Error(B(525)):(e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function xg(e){function t(m,u){if(e){var b=m.deletions;b===null?(m.deletions=[u],m.flags|=16):b.push(u)}}function a(m,u){if(!e)return null;for(;u!==null;)t(m,u),u=u.sibling;return null}function r(m){for(var u=new Map;m!==null;)m.key!==null?u.set(m.key,m):u.set(m.index,m),m=m.sibling;return u}function n(m,u){return m=nr(m,u),m.index=0,m.sibling=null,m}function i(m,u,b){return m.index=b,e?(b=m.alternate,b!==null?(b=b.index,b<u?(m.flags|=67108866,u):b):(m.flags|=67108866,u)):(m.flags|=1048576,u)}function o(m){return e&&m.alternate===null&&(m.flags|=67108866),m}function l(m,u,b,w){return u===null||u.tag!==6?(u=ou(b,m.mode,w),u.return=m,u):(u=n(u,b),u.return=m,u)}function c(m,u,b,w){var v=b.type;return v===Yi?f(m,u,b.props.children,w,b.key):u!==null&&(u.elementType===v||typeof v=="object"&&v!==null&&v.$$typeof===wr&&ei(v)===u.type)?(u=n(u,b.props),no(u,b),u.return=m,u):(u=Xl(b.type,b.key,b.props,null,m.mode,w),no(u,b),u.return=m,u)}function p(m,u,b,w){return u===null||u.tag!==4||u.stateNode.containerInfo!==b.containerInfo||u.stateNode.implementation!==b.implementation?(u=lu(b,m.mode,w),u.return=m,u):(u=n(u,b.children||[]),u.return=m,u)}function f(m,u,b,w,v){return u===null||u.tag!==7?(u=ri(b,m.mode,w,v),u.return=m,u):(u=n(u,b),u.return=m,u)}function h(m,u,b){if(typeof u=="string"&&u!==""||typeof u=="number"||typeof u=="bigint")return u=ou(""+u,m.mode,b),u.return=m,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case Sl:return b=Xl(u.type,u.key,u.props,null,m.mode,b),no(b,u),b.return=m,b;case uo:return u=lu(u,m.mode,b),u.return=m,u;case wr:return u=ei(u),h(m,u,b)}if(po(u)||ro(u))return u=ri(u,m.mode,b,null),u.return=m,u;if(typeof u.then=="function")return h(m,Al(u),b);if(u.$$typeof===ar)return h(m,Rl(m,u),b);Ul(m,u)}return null}function d(m,u,b,w){var v=u!==null?u.key:null;if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return v!==null?null:l(m,u,""+b,w);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Sl:return b.key===v?c(m,u,b,w):null;case uo:return b.key===v?p(m,u,b,w):null;case wr:return b=ei(b),d(m,u,b,w)}if(po(b)||ro(b))return v!==null?null:f(m,u,b,w,null);if(typeof b.then=="function")return d(m,u,Al(b),w);if(b.$$typeof===ar)return d(m,u,Rl(m,b),w);Ul(m,b)}return null}function g(m,u,b,w,v){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return m=m.get(b)||null,l(u,m,""+w,v);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Sl:return m=m.get(w.key===null?b:w.key)||null,c(u,m,w,v);case uo:return m=m.get(w.key===null?b:w.key)||null,p(u,m,w,v);case wr:return w=ei(w),g(m,u,b,w,v)}if(po(w)||ro(w))return m=m.get(b)||null,f(u,m,w,v,null);if(typeof w.then=="function")return g(m,u,b,Al(w),v);if(w.$$typeof===ar)return g(m,u,b,Rl(u,w),v);Ul(u,w)}return null}function y(m,u,b,w){for(var v=null,M=null,T=u,A=u=0,G=null;T!==null&&A<b.length;A++){T.index>A?(G=T,T=null):G=T.sibling;var Y=d(m,T,b[A],w);if(Y===null){T===null&&(T=G);break}e&&T&&Y.alternate===null&&t(m,T),u=i(Y,u,A),M===null?v=Y:M.sibling=Y,M=Y,T=G}if(A===b.length)return a(m,T),Ce&&er(m,A),v;if(T===null){for(;A<b.length;A++)T=h(m,b[A],w),T!==null&&(u=i(T,u,A),M===null?v=T:M.sibling=T,M=T);return Ce&&er(m,A),v}for(T=r(T);A<b.length;A++)G=g(T,m,A,b[A],w),G!==null&&(e&&G.alternate!==null&&T.delete(G.key===null?A:G.key),u=i(G,u,A),M===null?v=G:M.sibling=G,M=G);return e&&T.forEach(function(V){return t(m,V)}),Ce&&er(m,A),v}function R(m,u,b,w){if(b==null)throw Error(B(151));for(var v=null,M=null,T=u,A=u=0,G=null,Y=b.next();T!==null&&!Y.done;A++,Y=b.next()){T.index>A?(G=T,T=null):G=T.sibling;var V=d(m,T,Y.value,w);if(V===null){T===null&&(T=G);break}e&&T&&V.alternate===null&&t(m,T),u=i(V,u,A),M===null?v=V:M.sibling=V,M=V,T=G}if(Y.done)return a(m,T),Ce&&er(m,A),v;if(T===null){for(;!Y.done;A++,Y=b.next())Y=h(m,Y.value,w),Y!==null&&(u=i(Y,u,A),M===null?v=Y:M.sibling=Y,M=Y);return Ce&&er(m,A),v}for(T=r(T);!Y.done;A++,Y=b.next())Y=g(T,m,A,Y.value,w),Y!==null&&(e&&Y.alternate!==null&&T.delete(Y.key===null?A:Y.key),u=i(Y,u,A),M===null?v=Y:M.sibling=Y,M=Y);return e&&T.forEach(function(se){return t(m,se)}),Ce&&er(m,A),v}function L(m,u,b,w){if(typeof b=="object"&&b!==null&&b.type===Yi&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Sl:e:{for(var v=b.key;u!==null;){if(u.key===v){if(v=b.type,v===Yi){if(u.tag===7){a(m,u.sibling),w=n(u,b.props.children),w.return=m,m=w;break e}}else if(u.elementType===v||typeof v=="object"&&v!==null&&v.$$typeof===wr&&ei(v)===u.type){a(m,u.sibling),w=n(u,b.props),no(w,b),w.return=m,m=w;break e}a(m,u);break}else t(m,u);u=u.sibling}b.type===Yi?(w=ri(b.props.children,m.mode,w,b.key),w.return=m,m=w):(w=Xl(b.type,b.key,b.props,null,m.mode,w),no(w,b),w.return=m,m=w)}return o(m);case uo:e:{for(v=b.key;u!==null;){if(u.key===v)if(u.tag===4&&u.stateNode.containerInfo===b.containerInfo&&u.stateNode.implementation===b.implementation){a(m,u.sibling),w=n(u,b.children||[]),w.return=m,m=w;break e}else{a(m,u);break}else t(m,u);u=u.sibling}w=lu(b,m.mode,w),w.return=m,m=w}return o(m);case wr:return b=ei(b),L(m,u,b,w)}if(po(b))return y(m,u,b,w);if(ro(b)){if(v=ro(b),typeof v!="function")throw Error(B(150));return b=v.call(b),R(m,u,b,w)}if(typeof b.then=="function")return L(m,u,Al(b),w);if(b.$$typeof===ar)return L(m,u,Rl(m,b),w);Ul(m,b)}return typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint"?(b=""+b,u!==null&&u.tag===6?(a(m,u.sibling),w=n(u,b),w.return=m,m=w):(a(m,u),w=ou(b,m.mode,w),w.return=m,m=w),o(m)):a(m,u)}return function(m,u,b,w){try{Do=0;var v=L(m,u,b,w);return on=null,v}catch(T){if(T===kn||T===Ls)throw T;var M=aa(29,T,null,m.mode);return M.lanes=w,M.return=m,M}}}var ci=xg(!0),kg=xg(!1),vr=!1;function Yp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ju(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 zr(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,(Re&2)!==0){var n=r.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),r.pending=t,t=cs(e),fg(e,null,a),t}return Bs(e,r,t,a),cs(e)}function yo(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,Gh(e,a)}}function cu(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 Iu=!1;function _o(){if(Iu){var e=nn;if(e!==null)throw e}}function xo(e,t,a,r){Iu=!1;var n=e.updateQueue;vr=!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 h=n.baseState;o=0,f=p=c=null,l=i;do{var d=l.lane&-536870913,g=d!==l.lane;if(g?(Ne&d)===d:(r&d)===d){d!==0&&d===dn&&(Iu=!0),f!==null&&(f=f.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var y=e,R=l;d=t;var L=a;switch(R.tag){case 1:if(y=R.payload,typeof y=="function"){h=y.call(L,h,d);break e}h=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=R.payload,d=typeof y=="function"?y.call(L,h,d):y,d==null)break e;h=We({},h,d);break e;case 2:vr=!0}}d=l.callback,d!==null&&(e.flags|=64,g&&(e.flags|=8192),g=n.callbacks,g===null?n.callbacks=[d]:g.push(d))}else g={lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(p=f=g,c=h):f=f.next=g,o|=d;if(l=l.next,l===null){if(l=n.shared.pending,l===null)break;g=l,l=g.next,g.next=null,n.lastBaseUpdate=g,n.shared.pending=null}}while(!0);f===null&&(c=h),n.baseState=c,n.firstBaseUpdate=p,n.lastBaseUpdate=f,i===null&&(n.shared.lanes=0),Gr|=o,e.lanes=o,e.memoizedState=h}}function Sg(e,t){if(typeof e!="function")throw Error(B(191,e));e.call(t)}function Ng(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Sg(a[e],t)}var mn=La(null),ms=La(0);function Uf(e,t){e=dr,Ke(ms,e),Ke(mn,t),dr=e|t.baseLanes}function Fu(){Ke(ms,dr),Ke(mn,mn.current)}function $p(){dr=ms.current,St(mn),St(ms)}var ca=La(null),wa=null;function _r(e){var t=e.alternate;Ke(lt,lt.current&1),Ke(ca,e),wa===null&&(t===null||mn.current!==null||t.memoizedState!==null)&&(wa=e)}function Wu(e){Ke(lt,lt.current),Ke(ca,e),wa===null&&(wa=e)}function Cg(e){e.tag===22?(Ke(lt,lt.current),Ke(ca,e),wa===null&&(wa=e)):xr(e)}function xr(){Ke(lt,lt.current),Ke(ca,ca.current)}function ta(e){St(ca),wa===e&&(wa=null),St(lt)}var lt=La(0);function fs(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)||vp(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 cr=0,he=null,Ve=null,ct=null,hs=!1,ln=!1,ui=!1,gs=0,Oo=0,sn=null,i1=0;function rt(){throw Error(B(321))}function Vp(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!sa(e[a],t[a]))return!1;return!0}function Xp(e,t,a,r,n,i){return cr=i,he=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ce.H=e===null||e.memoizedState===null?rb:rd,ui=!1,i=a(r,n),ui=!1,ln&&(i=Eg(t,a,r,n)),qg(e),i}function qg(e){ce.H=Bo;var t=Ve!==null&&Ve.next!==null;if(cr=0,ct=Ve=he=null,hs=!1,Oo=0,sn=null,t)throw Error(B(300));e===null||dt||(e=e.dependencies,e!==null&&ps(e)&&(dt=!0))}function Eg(e,t,a,r){he=e;var n=0;do{if(ln&&(sn=null),Oo=0,ln=!1,25<=n)throw Error(B(301));if(n+=1,ct=Ve=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}ce.H=ib,i=t(a,r)}while(ln);return i}function n1(){var e=ce.H,t=e.useState()[0];return t=typeof t.then=="function"?Jo(t):t,e=e.useState()[0],(Ve!==null?Ve.memoizedState:null)!==e&&(he.flags|=1024),t}function Zp(){var e=gs!==0;return gs=0,e}function Kp(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Pp(e){if(hs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}hs=!1}cr=0,ct=Ve=he=null,ln=!1,Oo=gs=0,sn=null}function Ht(){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 st(){if(Ve===null){var e=he.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=ct===null?he.memoizedState:ct.next;if(t!==null)ct=t,Ve=e;else{if(e===null)throw he.alternate===null?Error(B(467)):Error(B(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},ct===null?he.memoizedState=ct=e:ct=ct.next=e}return ct}function Hs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Jo(e){var t=Oo;return Oo+=1,sn===null&&(sn=[]),e=_g(sn,e,t),t=he,(ct===null?t.memoizedState:ct.next)===null&&(t=t.alternate,ce.H=t===null||t.memoizedState===null?rb:rd),e}function Qs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Jo(e);if(e.$$typeof===ar)return Mt(e)}throw Error(B(438,String(e)))}function Jp(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=Hs(),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]=$0;return t.index++,a}function ur(e,t){return typeof t=="function"?t(e):t}function Kl(e){var t=st();return Ip(t,Ve,e)}function Ip(e,t,a){var r=e.queue;if(r===null)throw Error(B(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 h=p.lane&-536870913;if(h!==p.lane?(Ne&h)===h:(cr&h)===h){var d=p.revertLane;if(d===0)c!==null&&(c=c.next={lane:0,revertLane:0,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null}),h===dn&&(f=!0);else if((cr&d)===d){p=p.next,d===dn&&(f=!0);continue}else h={lane:0,revertLane:p.revertLane,gesture:null,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=h,o=i):c=c.next=h,he.lanes|=d,Gr|=d;h=p.action,ui&&a(i,h),i=p.hasEagerState?p.eagerState:a(i,h)}else d={lane:h,revertLane:p.revertLane,gesture:p.gesture,action:p.action,hasEagerState:p.hasEagerState,eagerState:p.eagerState,next:null},c===null?(l=c=d,o=i):c=c.next=d,he.lanes|=h,Gr|=h;p=p.next}while(p!==null&&p!==t);if(c===null?o=i:c.next=l,!sa(i,e.memoizedState)&&(dt=!0,f&&(a=nn,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 uu(e){var t=st(),a=t.queue;if(a===null)throw Error(B(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);sa(i,t.memoizedState)||(dt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),a.lastRenderedState=i}return[i,r]}function Mg(e,t,a){var r=he,n=st(),i=Ce;if(i){if(a===void 0)throw Error(B(407));a=a()}else a=t();var o=!sa((Ve||n).memoizedState,a);if(o&&(n.memoizedState=a,dt=!0),n=n.queue,Fp(Rg.bind(null,r,n,e),[e]),n.getSnapshot!==t||o||ct!==null&&ct.memoizedState.tag&1){if(r.flags|=2048,fn(9,{destroy:void 0},zg.bind(null,r,n,a,t),null),Xe===null)throw Error(B(349));i||(cr&127)!==0||Tg(r,t,a)}return a}function Tg(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=he.updateQueue,t===null?(t=Hs(),he.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function zg(e,t,a,r){t.value=a,t.getSnapshot=r,Ag(t)&&Ug(e)}function Rg(e,t,a){return a(function(){Ag(t)&&Ug(e)})}function Ag(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!sa(e,a)}catch{return!0}}function Ug(e){var t=hi(e,2);t!==null&&Kt(t,e,2)}function ep(e){var t=Ht();if(typeof e=="function"){var a=e;if(e=a(),ui){Sr(!0);try{a()}finally{Sr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:e},t}function Dg(e,t,a,r){return e.baseState=a,Ip(e,Ve,typeof r=="function"?r:ur)}function o1(e,t,a,r,n){if(js(e))throw Error(B(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)}};ce.T!==null?a(!0):i.isTransition=!1,r(i),a=t.pending,a===null?(i.next=t.pending=i,Og(t,i)):(i.next=a.next,t.pending=a.next=i)}}function Og(e,t){var a=t.action,r=t.payload,n=e.state;if(t.isTransition){var i=ce.T,o={};ce.T=o;try{var l=a(n,r),c=ce.S;c!==null&&c(o,l),Df(e,t,l)}catch(p){tp(e,t,p)}finally{i!==null&&o.types!==null&&(i.types=o.types),ce.T=i}}else try{i=a(n,r),Df(e,t,i)}catch(p){tp(e,t,p)}}function Df(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(r){Of(e,t,r)},function(r){return tp(e,t,r)}):Of(e,t,a)}function Of(e,t,a){t.status="fulfilled",t.value=a,Bg(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Og(e,a)))}function tp(e,t,a){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=a,Bg(t),t=t.next;while(t!==r)}e.action=null}function Bg(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Lg(e,t){return t}function Bf(e,t){if(Ce){var a=Xe.formState;if(a!==null){e:{var r=he;if(Ce){if(Fe){t:{for(var n=Fe,i=ba;n.nodeType!==8;){if(!i){n=null;break t}if(n=va(n.nextSibling),n===null){n=null;break t}}i=n.data,n=i==="F!"||i==="F"?n:null}if(n){Fe=va(n.nextSibling),r=n.data==="F!";break e}}Hr(r)}r=!1}r&&(t=a[0])}}return a=Ht(),a.memoizedState=a.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lg,lastRenderedState:t},a.queue=r,a=eb.bind(null,he,r),r.dispatch=a,r=ep(!1),i=ad.bind(null,he,!1,r.queue),r=Ht(),n={state:t,dispatch:null,action:e,pending:null},r.queue=n,a=o1.bind(null,he,n,i,a),n.dispatch=a,r.memoizedState=e,[t,a,!1]}function Lf(e){var t=st();return Hg(t,Ve,e)}function Hg(e,t,a){if(t=Ip(e,t,Lg)[0],e=Kl(ur)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Jo(t)}catch(o){throw o===kn?Ls:o}else r=t;t=st();var n=t.queue,i=n.dispatch;return a!==t.memoizedState&&(he.flags|=2048,fn(9,{destroy:void 0},l1.bind(null,n,a),null)),[r,i,e]}function l1(e,t){e.action=t}function Hf(e){var t=st(),a=Ve;if(a!==null)return Hg(t,a,e);st(),t=t.memoizedState,a=st();var r=a.queue.dispatch;return a.memoizedState=e,[t,r,!1]}function fn(e,t,a,r){return e={tag:e,create:a,deps:r,inst:t,next:null},t=he.updateQueue,t===null&&(t=Hs(),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 Qg(){return st().memoizedState}function Pl(e,t,a,r){var n=Ht();he.flags|=e,n.memoizedState=fn(1|t,{destroy:void 0},a,r===void 0?null:r)}function Gs(e,t,a,r){var n=st();r=r===void 0?null:r;var i=n.memoizedState.inst;Ve!==null&&r!==null&&Vp(r,Ve.memoizedState.deps)?n.memoizedState=fn(t,i,a,r):(he.flags|=e,n.memoizedState=fn(1|t,i,a,r))}function Qf(e,t){Pl(8390656,8,e,t)}function Fp(e,t){Gs(2048,8,e,t)}function s1(e){he.flags|=4;var t=he.updateQueue;if(t===null)t=Hs(),he.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Gg(e){var t=st().memoizedState;return s1({ref:t,nextImpl:e}),function(){if((Re&2)!==0)throw Error(B(440));return t.impl.apply(void 0,arguments)}}function jg(e,t){return Gs(4,2,e,t)}function Yg(e,t){return Gs(4,4,e,t)}function $g(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 Vg(e,t,a){a=a!=null?a.concat([e]):null,Gs(4,4,$g.bind(null,t,e),a)}function Wp(){}function Xg(e,t){var a=st();t=t===void 0?null:t;var r=a.memoizedState;return t!==null&&Vp(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function Zg(e,t){var a=st();t=t===void 0?null:t;var r=a.memoizedState;if(t!==null&&Vp(t,r[1]))return r[0];if(r=e(),ui){Sr(!0);try{e()}finally{Sr(!1)}}return a.memoizedState=[r,t],r}function ed(e,t,a){return a===void 0||(cr&1073741824)!==0&&(Ne&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Db(),he.lanes|=e,Gr|=e,a)}function Kg(e,t,a,r){return sa(a,t)?a:mn.current!==null?(e=ed(e,a,r),sa(e,t)||(dt=!0),e):(cr&42)===0||(cr&1073741824)!==0&&(Ne&261930)===0?(dt=!0,e.memoizedState=a):(e=Db(),he.lanes|=e,Gr|=e,t)}function Pg(e,t,a,r,n){var i=Ae.p;Ae.p=i!==0&&8>i?i:8;var o=ce.T,l={};ce.T=l,ad(e,!1,t,a);try{var c=n(),p=ce.S;if(p!==null&&p(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=r1(c,r);ko(e,t,f,la(e))}else ko(e,t,r,la(e))}catch(h){ko(e,t,{then:function(){},status:"rejected",reason:h},la())}finally{Ae.p=i,o!==null&&l.types!==null&&(o.types=l.types),ce.T=o}}function c1(){}function ap(e,t,a,r){if(e.tag!==5)throw Error(B(476));var n=Jg(e).queue;Pg(e,n,t,ai,a===null?c1:function(){return Ig(e),a(r)})}function Jg(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ai,baseState:ai,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:ai},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ig(e){var t=Jg(e);t.next===null&&(t=e.alternate.memoizedState),ko(e,t.next.queue,{},la())}function td(){return Mt(Qo)}function Fg(){return st().memoizedState}function Wg(){return st().memoizedState}function u1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=la();e=zr(a);var r=Rr(t,e,a);r!==null&&(Kt(r,t,a),yo(r,t,a)),t={cache:Qp()},e.payload=t;return}t=t.return}}function p1(e,t,a){var r=la();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},js(e)?tb(t,a):(a=Op(e,t,a,r),a!==null&&(Kt(a,e,r),ab(a,t,r)))}function eb(e,t,a){var r=la();ko(e,t,a,r)}function ko(e,t,a,r){var n={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(js(e))tb(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,sa(l,o))return Bs(e,t,n,0),Xe===null&&Os(),!1}catch{}if(a=Op(e,t,n,r),a!==null)return Kt(a,e,r),ab(a,t,r),!0}return!1}function ad(e,t,a,r){if(r={lane:2,revertLane:pd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},js(e)){if(t)throw Error(B(479))}else t=Op(e,a,r,2),t!==null&&Kt(t,e,2)}function js(e){var t=e.alternate;return e===he||t!==null&&t===he}function tb(e,t){ln=hs=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function ab(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Gh(e,a)}}var Bo={readContext:Mt,use:Qs,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};Bo.useEffectEvent=rt;var rb={readContext:Mt,use:Qs,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:Mt,useEffect:Qf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Pl(4194308,4,$g.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Pl(4194308,4,e,t)},useInsertionEffect:function(e,t){Pl(4,2,e,t)},useMemo:function(e,t){var a=Ht();t=t===void 0?null:t;var r=e();if(ui){Sr(!0);try{e()}finally{Sr(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=Ht();if(a!==void 0){var n=a(t);if(ui){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=p1.bind(null,he,e),[r.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:function(e){e=ep(e);var t=e.queue,a=eb.bind(null,he,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Wp,useDeferredValue:function(e,t){var a=Ht();return ed(a,e,t)},useTransition:function(){var e=ep(!1);return e=Pg.bind(null,he,e.queue,!0,!1),Ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=he,n=Ht();if(Ce){if(a===void 0)throw Error(B(407));a=a()}else{if(a=t(),Xe===null)throw Error(B(349));(Ne&127)!==0||Tg(r,t,a)}n.memoizedState=a;var i={value:a,getSnapshot:t};return n.queue=i,Qf(Rg.bind(null,r,i,e),[e]),r.flags|=2048,fn(9,{destroy:void 0},zg.bind(null,r,i,a,t),null),a},useId:function(){var e=Ht(),t=Xe.identifierPrefix;if(Ce){var a=Da,r=Ua;a=(r&~(1<<32-oa(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=gs++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=i1++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:td,useFormState:Bf,useActionState:Bf,useOptimistic:function(e){var t=Ht();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=ad.bind(null,he,!0,a),a.dispatch=t,[e,t]},useMemoCache:Jp,useCacheRefresh:function(){return Ht().memoizedState=u1.bind(null,he)},useEffectEvent:function(e){var t=Ht(),a={impl:e};return t.memoizedState=a,function(){if((Re&2)!==0)throw Error(B(440));return a.impl.apply(void 0,arguments)}}},rd={readContext:Mt,use:Qs,useCallback:Xg,useContext:Mt,useEffect:Fp,useImperativeHandle:Vg,useInsertionEffect:jg,useLayoutEffect:Yg,useMemo:Zg,useReducer:Kl,useRef:Qg,useState:function(){return Kl(ur)},useDebugValue:Wp,useDeferredValue:function(e,t){var a=st();return Kg(a,Ve.memoizedState,e,t)},useTransition:function(){var e=Kl(ur)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Jo(e),t]},useSyncExternalStore:Mg,useId:Fg,useHostTransitionStatus:td,useFormState:Lf,useActionState:Lf,useOptimistic:function(e,t){var a=st();return Dg(a,Ve,e,t)},useMemoCache:Jp,useCacheRefresh:Wg};rd.useEffectEvent=Gg;var ib={readContext:Mt,use:Qs,useCallback:Xg,useContext:Mt,useEffect:Fp,useImperativeHandle:Vg,useInsertionEffect:jg,useLayoutEffect:Yg,useMemo:Zg,useReducer:uu,useRef:Qg,useState:function(){return uu(ur)},useDebugValue:Wp,useDeferredValue:function(e,t){var a=st();return Ve===null?ed(a,e,t):Kg(a,Ve.memoizedState,e,t)},useTransition:function(){var e=uu(ur)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Jo(e),t]},useSyncExternalStore:Mg,useId:Fg,useHostTransitionStatus:td,useFormState:Hf,useActionState:Hf,useOptimistic:function(e,t){var a=st();return Ve!==null?Dg(a,Ve,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Jp,useCacheRefresh:Wg};ib.useEffectEvent=Gg;function pu(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:We({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var rp={enqueueSetState:function(e,t,a){e=e._reactInternals;var r=la(),n=zr(r);n.payload=t,a!=null&&(n.callback=a),t=Rr(e,n,r),t!==null&&(Kt(t,e,r),yo(t,e,r))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=la(),n=zr(r);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=Rr(e,n,r),t!==null&&(Kt(t,e,r),yo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=la(),r=zr(a);r.tag=2,t!=null&&(r.callback=t),t=Rr(e,r,a),t!==null&&(Kt(t,e,a),yo(t,e,a))}};function Gf(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?!Ro(a,r)||!Ro(n,i):!0}function jf(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&&rp.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=We({},a));for(var n in e)a[n]===void 0&&(a[n]=e[n])}return a}function nb(e){ss(e)}function ob(e){console.error(e)}function lb(e){ss(e)}function bs(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Yf(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 ip(e,t,a){return a=zr(a),a.tag=3,a.payload={element:null},a.callback=function(){bs(e,t)},a}function sb(e){return e=zr(e),e.tag=3,e}function cb(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(){Yf(t,a,r)}}var o=a.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){Yf(t,a,r),typeof n!="function"&&(Ar===null?Ar=new Set([this]):Ar.add(this));var l=r.stack;this.componentDidCatch(r.value,{componentStack:l!==null?l:""})})}function d1(e,t,a,r,n){if(a.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=a.alternate,t!==null&&xn(t,a,n,!0),a=ca.current,a!==null){switch(a.tag){case 31:case 13:return wa===null?xs():a.alternate===null&&it===0&&(it=3),a.flags&=-257,a.flags|=65536,a.lanes=n,r===ds?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([r]):t.add(r),xu(e,r,n)),!1;case 22:return a.flags|=65536,r===ds?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)),xu(e,r,n)),!1}throw Error(B(435,a.tag))}return xu(e,r,n),xs(),!1}if(Ce)return t=ca.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,r!==Vu&&(e=Error(B(422),{cause:r}),Uo(ga(e,a)))):(r!==Vu&&(t=Error(B(423),{cause:r}),Uo(ga(t,a))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,r=ga(r,a),n=ip(e.stateNode,r,n),cu(e,n),it!==4&&(it=2)),!1;var i=Error(B(520),{cause:r});if(i=ga(i,a),Co===null?Co=[i]:Co.push(i),it!==4&&(it=2),t===null)return!0;r=ga(r,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=n&-n,a.lanes|=e,e=ip(a.stateNode,r,e),cu(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"&&(Ar===null||!Ar.has(i))))return a.flags|=65536,n&=-n,a.lanes|=n,n=sb(n),cb(n,e,a,r),cu(a,n),!1}a=a.return}while(a!==null);return!1}var id=Error(B(461)),dt=!1;function Ct(e,t,a,r){t.child=e===null?kg(t,null,a,r):ci(t,e.child,a,r)}function $f(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 si(t),r=Xp(e,t,a,o,i,n),l=Zp(),e!==null&&!dt?(Kp(e,t,n),pr(e,t,n)):(Ce&&l&&Lp(t),t.flags|=1,Ct(e,t,r,n),t.child)}function Vf(e,t,a,r,n){if(e===null){var i=a.type;return typeof i=="function"&&!Bp(i)&&i.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=i,ub(e,t,i,r,n)):(e=Xl(a.type,null,r,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!nd(e,n)){var o=i.memoizedProps;if(a=a.compare,a=a!==null?a:Ro,a(o,r)&&e.ref===t.ref)return pr(e,t,n)}return t.flags|=1,e=nr(i,r),e.ref=t.ref,e.return=t,t.child=e}function ub(e,t,a,r,n){if(e!==null){var i=e.memoizedProps;if(Ro(i,r)&&e.ref===t.ref)if(dt=!1,t.pendingProps=r=i,nd(e,n))(e.flags&131072)!==0&&(dt=!0);else return t.lanes=e.lanes,pr(e,t,n)}return np(e,t,a,r,n)}function pb(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 Xf(e,t,i,a,r)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Zl(t,i!==null?i.cachePool:null),i!==null?Uf(t,i):Fu(),Cg(t);else return r=t.lanes=536870912,Xf(e,t,i!==null?i.baseLanes|a:a,a,r)}else i!==null?(Zl(t,i.cachePool),Uf(t,i),xr(t),t.memoizedState=null):(e!==null&&Zl(t,null),Fu(),xr(t));return Ct(e,t,n,a),t.child}function fo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Xf(e,t,a,r,n){var i=Gp();return i=i===null?null:{parent:pt._currentValue,pool:i},t.memoizedState={baseLanes:a,cachePool:i},e!==null&&Zl(t,null),Fu(),Cg(t),e!==null&&xn(e,t,r,!0),t.childLanes=n,null}function Jl(e,t){return t=ws({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Zf(e,t,a){return ci(t,e.child,null,a),e=Jl(t,t.pendingProps),e.flags|=2,ta(t),t.memoizedState=null,e}function m1(e,t,a){var r=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ce){if(r.mode==="hidden")return e=Jl(t,r),t.lanes=536870912,fo(null,e);if(Wu(t),(e=Fe)?(e=rw(e,ba),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Lr!==null?{id:Ua,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},a=gg(e),a.return=t,t.child=a,Et=t,Fe=null)):e=null,e===null)throw Hr(t);return t.lanes=536870912,null}return Jl(t,r)}var i=e.memoizedState;if(i!==null){var o=i.dehydrated;if(Wu(t),n)if(t.flags&256)t.flags&=-257,t=Zf(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(B(558));else if(dt||xn(e,t,a,!1),n=(a&e.childLanes)!==0,dt||n){if(r=Xe,r!==null&&(o=jh(r,a),o!==0&&o!==i.retryLane))throw i.retryLane=o,hi(e,o),Kt(r,e,o),id;xs(),t=Zf(e,t,a)}else e=i.treeContext,Fe=va(o.nextSibling),Et=t,Ce=!0,Tr=null,ba=!1,e!==null&&wg(t,e),t=Jl(t,r),t.flags|=4096;return t}return e=nr(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Il(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(B(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function np(e,t,a,r,n){return si(t),a=Xp(e,t,a,r,void 0,n),r=Zp(),e!==null&&!dt?(Kp(e,t,n),pr(e,t,n)):(Ce&&r&&Lp(t),t.flags|=1,Ct(e,t,a,n),t.child)}function Kf(e,t,a,r,n,i){return si(t),t.updateQueue=null,a=Eg(t,r,a,n),qg(e),r=Zp(),e!==null&&!dt?(Kp(e,t,i),pr(e,t,i)):(Ce&&r&&Lp(t),t.flags|=1,Ct(e,t,a,i),t.child)}function Pf(e,t,a,r,n){if(si(t),t.stateNode===null){var i=Ii,o=a.contextType;typeof o=="object"&&o!==null&&(i=Mt(o)),i=new a(r,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=rp,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=r,i.state=t.memoizedState,i.refs={},Yp(t),o=a.contextType,i.context=typeof o=="object"&&o!==null?Mt(o):Ii,i.state=t.memoizedState,o=a.getDerivedStateFromProps,typeof o=="function"&&(pu(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&&rp.enqueueReplaceState(i,i.state,null),xo(t,r,i,n),_o(),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 p=i.context,f=a.contextType;o=Ii,typeof f=="object"&&f!==null&&(o=Mt(f));var h=a.getDerivedStateFromProps;f=typeof h=="function"||typeof i.getSnapshotBeforeUpdate=="function",l=t.pendingProps!==l,f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l||p!==o)&&jf(t,i,r,o),vr=!1;var d=t.memoizedState;i.state=d,xo(t,r,i,n),_o(),p=t.memoizedState,l||d!==p||vr?(typeof h=="function"&&(pu(t,a,h,r),p=t.memoizedState),(c=vr||Gf(t,a,c,r,d,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,Ju(e,t),o=t.memoizedProps,f=pi(a,o),i.props=f,h=t.pendingProps,d=i.context,p=a.contextType,c=Ii,typeof p=="object"&&p!==null&&(c=Mt(p)),l=a.getDerivedStateFromProps,(p=typeof l=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==h||d!==c)&&jf(t,i,r,c),vr=!1,d=t.memoizedState,i.state=d,xo(t,r,i,n),_o();var g=t.memoizedState;o!==h||d!==g||vr||e!==null&&e.dependencies!==null&&ps(e.dependencies)?(typeof l=="function"&&(pu(t,a,l,r),g=t.memoizedState),(f=vr||Gf(t,a,f,r,d,g,c)||e!==null&&e.dependencies!==null&&ps(e.dependencies))?(p||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,g,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,g,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=g),i.props=r,i.state=g,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,Il(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=ci(t,e.child,null,n),t.child=ci(t,null,a,n)):Ct(e,t,a,n),t.memoizedState=i.state,e=t.child):e=pr(e,t,n),e}function Jf(e,t,a,r){return li(),t.flags|=256,Ct(e,t,a,r),t.child}var du={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mu(e){return{baseLanes:e,cachePool:yg()}}function fu(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=ra),e}function db(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(Ce){if(n?_r(t):xr(t),(e=Fe)?(e=rw(e,ba),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Lr!==null?{id:Ua,overflow:Da}:null,retryLane:536870912,hydrationErrors:null},a=gg(e),a.return=t,t.child=a,Et=t,Fe=null)):e=null,e===null)throw Hr(t);return vp(e)?t.lanes=32:t.lanes=536870912,null}var l=r.children;return r=r.fallback,n?(xr(t),n=t.mode,l=ws({mode:"hidden",children:l},n),r=ri(r,n,a,null),l.return=t,r.return=t,l.sibling=r,t.child=l,r=t.child,r.memoizedState=mu(a),r.childLanes=fu(e,o,a),t.memoizedState=du,fo(null,r)):(_r(t),op(t,l))}var c=e.memoizedState;if(c!==null&&(l=c.dehydrated,l!==null)){if(i)t.flags&256?(_r(t),t.flags&=-257,t=hu(e,t,a)):t.memoizedState!==null?(xr(t),t.child=e.child,t.flags|=128,t=null):(xr(t),l=r.fallback,n=t.mode,r=ws({mode:"visible",children:r.children},n),l=ri(l,n,a,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,ci(t,e.child,null,a),r=t.child,r.memoizedState=mu(a),r.childLanes=fu(e,o,a),t.memoizedState=du,t=fo(null,r));else if(_r(t),vp(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var p=o.dgst;o=p,r=Error(B(419)),r.stack="",r.digest=o,Uo({value:r,source:null,stack:null}),t=hu(e,t,a)}else if(dt||xn(e,t,a,!1),o=(a&e.childLanes)!==0,dt||o){if(o=Xe,o!==null&&(r=jh(o,a),r!==0&&r!==c.retryLane))throw c.retryLane=r,hi(e,r),Kt(o,e,r),id;wp(l)||xs(),t=hu(e,t,a)}else wp(l)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,Fe=va(l.nextSibling),Et=t,Ce=!0,Tr=null,ba=!1,e!==null&&wg(t,e),t=op(t,r.children),t.flags|=4096);return t}return n?(xr(t),l=r.fallback,n=t.mode,c=e.child,p=c.sibling,r=nr(c,{mode:"hidden",children:r.children}),r.subtreeFlags=c.subtreeFlags&65011712,p!==null?l=nr(p,l):(l=ri(l,n,a,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,fo(null,r),r=t.child,l=e.child.memoizedState,l===null?l=mu(a):(n=l.cachePool,n!==null?(c=pt._currentValue,n=n.parent!==c?{parent:c,pool:c}:n):n=yg(),l={baseLanes:l.baseLanes|a,cachePool:n}),r.memoizedState=l,r.childLanes=fu(e,o,a),t.memoizedState=du,fo(e.child,r)):(_r(t),a=e.child,e=a.sibling,a=nr(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 op(e,t){return t=ws({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ws(e,t){return e=aa(22,e,null,t),e.lanes=0,e}function hu(e,t,a){return ci(t,e.child,null,a),e=op(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function If(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Zu(e.return,t,a)}function gu(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 mb(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,Ke(lt,o),Ct(e,t,r,a),r=Ce?Ao:0,!l&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&If(e,a,t);else if(e.tag===19)If(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&&fs(e)===null&&(n=a),a=a.sibling;a=n,a===null?(n=t.child,t.child=null):(n=a.sibling,a.sibling=null),gu(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&&fs(e)===null){t.child=n;break}e=n.sibling,n.sibling=a,a=n,n=e}gu(t,!0,a,null,i,r);break;case"together":gu(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function pr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Gr|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(xn(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,a=nr(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=nr(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function nd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ps(e)))}function f1(e,t,a){switch(t.tag){case 3:is(t,t.stateNode.containerInfo),yr(t,pt,e.memoizedState.cache),li();break;case 27:case 5:Uu(t);break;case 4:is(t,t.stateNode.containerInfo);break;case 10:yr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Wu(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(_r(t),t.flags|=128,null):(a&t.child.childLanes)!==0?db(e,t,a):(_r(t),e=pr(e,t,a),e!==null?e.sibling:null);_r(t);break;case 19:var n=(e.flags&128)!==0;if(r=(a&t.childLanes)!==0,r||(xn(e,t,a,!1),r=(a&t.childLanes)!==0),n){if(r)return mb(e,t,a);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Ke(lt,lt.current),r)break;return null;case 22:return t.lanes=0,pb(e,t,a,t.pendingProps);case 24:yr(t,pt,e.memoizedState.cache)}return pr(e,t,a)}function fb(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)dt=!0;else{if(!nd(e,a)&&(t.flags&128)===0)return dt=!1,f1(e,t,a);dt=(e.flags&131072)!==0}else dt=!1,Ce&&(t.flags&1048576)!==0&&bg(t,Ao,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=ei(t.elementType),t.type=e,typeof e=="function")Bp(e)?(r=pi(e,r),t.tag=1,t=Pf(null,t,e,r,a)):(t.tag=0,t=np(null,t,e,r,a));else{if(e!=null){var n=e.$$typeof;if(n===kp){t.tag=11,t=$f(null,t,e,r,a);break e}else if(n===Sp){t.tag=14,t=Vf(null,t,e,r,a);break e}}throw t=Ru(e)||e,Error(B(306,t,""))}}return t;case 0:return np(e,t,t.type,t.pendingProps,a);case 1:return r=t.type,n=pi(r,t.pendingProps),Pf(e,t,r,n,a);case 3:e:{if(is(t,t.stateNode.containerInfo),e===null)throw Error(B(387));r=t.pendingProps;var i=t.memoizedState;n=i.element,Ju(e,t),xo(t,r,null,a);var o=t.memoizedState;if(r=o.cache,yr(t,pt,r),r!==i.cache&&Ku(t,[pt],a,!0),_o(),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=Jf(e,t,r,a);break e}else if(r!==n){n=ga(Error(B(424)),t),Uo(n),t=Jf(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=va(e.firstChild),Et=t,Ce=!0,Tr=null,ba=!0,a=kg(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(li(),r===n){t=pr(e,t,a);break e}Ct(e,t,r,a)}t=t.child}return t;case 26:return Il(e,t),e===null?(a=vh(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ce||(a=t.type,e=t.pendingProps,r=Cs(Mr.current).createElement(a),r[qt]=t,r[Pt]=e,Tt(r,a,e),kt(r),t.stateNode=r):t.memoizedState=vh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Uu(t),e===null&&Ce&&(r=t.stateNode=iw(t.type,t.pendingProps,Mr.current),Et=t,ba=!0,n=Fe,Yr(t.type)?(yp=n,Fe=va(r.firstChild)):Fe=n),Ct(e,t,t.pendingProps.children,a),Il(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ce&&((n=r=Fe)&&(r=j1(r,t.type,t.pendingProps,ba),r!==null?(t.stateNode=r,Et=t,Fe=va(r.firstChild),ba=!1,n=!0):n=!1),n||Hr(t)),Uu(t),n=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,r=i.children,gp(n,i)?r=null:o!==null&&gp(n,o)&&(t.flags|=32),t.memoizedState!==null&&(n=Xp(e,t,n1,null,null,a),Qo._currentValue=n),Il(e,t),Ct(e,t,r,a),t.child;case 6:return e===null&&Ce&&((e=a=Fe)&&(a=Y1(a,t.pendingProps,ba),a!==null?(t.stateNode=a,Et=t,Fe=null,e=!0):e=!1),e||Hr(t)),null;case 13:return db(e,t,a);case 4:return is(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ci(t,null,r,a):Ct(e,t,r,a),t.child;case 11:return $f(e,t,t.type,t.pendingProps,a);case 7:return Ct(e,t,t.pendingProps,a),t.child;case 8:return Ct(e,t,t.pendingProps.children,a),t.child;case 12:return Ct(e,t,t.pendingProps.children,a),t.child;case 10:return r=t.pendingProps,yr(t,t.type,r.value),Ct(e,t,r.children,a),t.child;case 9:return n=t.type._context,r=t.pendingProps.children,si(t),n=Mt(n),r=r(n),t.flags|=1,Ct(e,t,r,a),t.child;case 14:return Vf(e,t,t.type,t.pendingProps,a);case 15:return ub(e,t,t.type,t.pendingProps,a);case 19:return mb(e,t,a);case 31:return m1(e,t,a);case 22:return pb(e,t,a,t.pendingProps);case 24:return si(t),r=Mt(pt),e===null?(n=Gp(),n===null&&(n=Xe,i=Qp(),n.pooledCache=i,i.refCount++,i!==null&&(n.pooledCacheLanes|=a),n=i),t.memoizedState={parent:r,cache:n},Yp(t),yr(t,pt,n)):((e.lanes&a)!==0&&(Ju(e,t),xo(t,null,null,a),_o()),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),yr(t,pt,r)):(r=i.cache,yr(t,pt,r),r!==n.cache&&Ku(t,[pt],a,!0))),Ct(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(B(156,t.tag))}function Ja(e){e.flags|=4}function bu(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(Lb())e.flags|=8192;else throw ni=ds,jp}else e.flags&=-16777217}function Ff(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!lw(t))if(Lb())e.flags|=8192;else throw ni=ds,jp}function Dl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Hh():536870912,e.lanes|=t,hn|=t)}function oo(e,t){if(!Ce)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 Ie(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 h1(e,t,a){var r=t.pendingProps;switch(Hp(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ie(t),null;case 1:return Ie(t),null;case 3:return a=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),or(pt),cn(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Hi(t)?Ja(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,su())),Ie(t),null;case 26:var n=t.type,i=t.memoizedState;return e===null?(Ja(t),i!==null?(Ie(t),Ff(t,i)):(Ie(t),bu(t,n,null,r,a))):i?i!==e.memoizedState?(Ja(t),Ie(t),Ff(t,i)):(Ie(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Ja(t),Ie(t),bu(t,n,e,r,a)),null;case 27:if(ns(t),a=Mr.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ja(t);else{if(!r){if(t.stateNode===null)throw Error(B(166));return Ie(t),null}e=Ba.current,Hi(t)?qf(t,e):(e=iw(n,r,a),t.stateNode=e,Ja(t))}return Ie(t),null;case 5:if(ns(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ja(t);else{if(!r){if(t.stateNode===null)throw Error(B(166));return Ie(t),null}if(i=Ba.current,Hi(t))qf(t,i);else{var o=Cs(Mr.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[qt]=t,i[Pt]=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(Tt(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&&Ja(t)}}return Ie(t),bu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ja(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(B(166));if(e=Mr.current,Hi(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,n=Et,n!==null)switch(n.tag){case 27:case 5:r=n.memoizedProps}e[qt]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||ew(e.nodeValue,a)),e||Hr(t,!0)}else e=Cs(e).createTextNode(r),e[qt]=t,t.stateNode=e}return Ie(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=Hi(t),a!==null){if(e===null){if(!r)throw Error(B(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(557));e[qt]=t}else li(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ie(t),e=!1}else a=su(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(ta(t),t):(ta(t),null);if((t.flags&128)!==0)throw Error(B(558))}return Ie(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=Hi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!n)throw Error(B(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(B(317));n[qt]=t}else li(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ie(t),n=!1}else n=su(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(ta(t),t):(ta(t),null)}return ta(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),Dl(t,t.updateQueue),Ie(t),null);case 4:return cn(),e===null&&dd(t.stateNode.containerInfo),Ie(t),null;case 10:return or(t.type),Ie(t),null;case 19:if(St(lt),r=t.memoizedState,r===null)return Ie(t),null;if(n=(t.flags&128)!==0,i=r.rendering,i===null)if(n)oo(r,!1);else{if(it!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=fs(e),i!==null){for(t.flags|=128,oo(r,!1),e=i.updateQueue,t.updateQueue=e,Dl(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)hg(a,e),a=a.sibling;return Ke(lt,lt.current&1|2),Ce&&er(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ia()>ys&&(t.flags|=128,n=!0,oo(r,!1),t.lanes=4194304)}else{if(!n)if(e=fs(i),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,Dl(t,e),oo(r,!0),r.tail===null&&r.tailMode==="hidden"&&!i.alternate&&!Ce)return Ie(t),null}else 2*ia()-r.renderingStartTime>ys&&a!==536870912&&(t.flags|=128,n=!0,oo(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=ia(),e.sibling=null,a=lt.current,Ke(lt,n?a&1|2:a&1),Ce&&er(t,r.treeForkCount),e):(Ie(t),null);case 22:case 23:return ta(t),$p(),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&&(Ie(t),t.subtreeFlags&6&&(t.flags|=8192)):Ie(t),a=t.updateQueue,a!==null&&Dl(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&&St(ii),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),or(pt),Ie(t),null;case 25:return null;case 30:return null}throw Error(B(156,t.tag))}function g1(e,t){switch(Hp(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return or(pt),cn(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ns(t),null;case 31:if(t.memoizedState!==null){if(ta(t),t.alternate===null)throw Error(B(340));li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ta(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return St(lt),null;case 4:return cn(),null;case 10:return or(t.type),null;case 22:case 23:return ta(t),$p(),e!==null&&St(ii),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return or(pt),null;case 25:return null;default:return null}}function hb(e,t){switch(Hp(t),t.tag){case 3:or(pt),cn();break;case 26:case 27:case 5:ns(t);break;case 4:cn();break;case 31:t.memoizedState!==null&&ta(t);break;case 13:ta(t);break;case 19:St(lt);break;case 10:or(t.type);break;case 22:case 23:ta(t),$p(),e!==null&&St(ii);break;case 24:or(pt)}}function Io(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){Le(t,t.return,l)}}function Qr(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){Le(n,c,f)}}}r=r.next}while(r!==i)}}catch(f){Le(t,t.return,f)}}function gb(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Ng(t,a)}catch(r){Le(e,e.return,r)}}}function bb(e,t,a){a.props=pi(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){Le(e,t,r)}}function So(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){Le(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){Le(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){Le(e,t,n)}else a.current=null}function wb(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){Le(e,e.return,n)}}function wu(e,t,a){try{var r=e.stateNode;O1(r,e.type,a,t),r[Pt]=t}catch(n){Le(e,e.return,n)}}function vb(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Yr(e.type)||e.tag===4}function vu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vb(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&&Yr(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 lp(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=rr));else if(r!==4&&(r===27&&Yr(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(lp(e,t,a),e=e.sibling;e!==null;)lp(e,t,a),e=e.sibling}function vs(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&&Yr(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(vs(e,t,a),e=e.sibling;e!==null;)vs(e,t,a),e=e.sibling}function yb(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Tt(t,r,a),t[qt]=e,t[Pt]=a}catch(i){Le(e,e.return,i)}}var tr=!1,ut=!1,yu=!1,Wf=typeof WeakSet=="function"?WeakSet:Set,xt=null;function b1(e,t){if(e=e.containerInfo,fp=Ts,e=lg(e),Up(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,h=e,d=null;t:for(;;){for(var g;h!==a||n!==0&&h.nodeType!==3||(l=o+n),h!==i||r!==0&&h.nodeType!==3||(c=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(g=h.firstChild)!==null;)d=h,h=g;for(;;){if(h===e)break t;if(d===a&&++p===n&&(l=o),d===i&&++f===r&&(c=o),(g=h.nextSibling)!==null)break;h=d,d=h.parentNode}h=g}a=l===-1||c===-1?null:{start:l,end:c}}else a=null}a=a||{start:0,end:0}}else a=null;for(hp={focusedElem:e,selectionRange:a},Ts=!1,xt=t;xt!==null;)if(t=xt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,xt=e;else for(;xt!==null;){switch(t=xt,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 y=pi(a.type,n);e=r.getSnapshotBeforeUpdate(y,i),r.__reactInternalSnapshotBeforeUpdate=e}catch(R){Le(a,a.return,R)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)bp(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":bp(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(B(163))}if(e=t.sibling,e!==null){e.return=t.return,xt=e;break}xt=t.return}}function _b(e,t,a){var r=a.flags;switch(a.tag){case 0:case 11:case 15:Fa(e,a),r&4&&Io(5,a);break;case 1:if(Fa(e,a),r&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(o){Le(a,a.return,o)}else{var n=pi(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){Le(a,a.return,o)}}r&64&&gb(a),r&512&&So(a,a.return);break;case 3:if(Fa(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{Ng(e,t)}catch(o){Le(a,a.return,o)}}break;case 27:t===null&&r&4&&yb(a);case 26:case 5:Fa(e,a),t===null&&r&4&&wb(a),r&512&&So(a,a.return);break;case 12:Fa(e,a);break;case 31:Fa(e,a),r&4&&Sb(e,a);break;case 13:Fa(e,a),r&4&&Nb(e,a),r&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=C1.bind(null,a),$1(e,a))));break;case 22:if(r=a.memoizedState!==null||tr,!r){t=t!==null&&t.memoizedState!==null||ut,n=tr;var i=ut;tr=r,(ut=t)&&!i?Wa(e,a,(a.subtreeFlags&8772)!==0):Fa(e,a),tr=n,ut=i}break;case 30:break;default:Fa(e,a)}}function xb(e){var t=e.alternate;t!==null&&(e.alternate=null,xb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ep(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,Xt=!1;function Ia(e,t,a){for(a=a.child;a!==null;)kb(e,t,a),a=a.sibling}function kb(e,t,a){if(na&&typeof na.onCommitFiberUnmount=="function")try{na.onCommitFiberUnmount($o,a)}catch{}switch(a.tag){case 26:ut||Oa(a,t),Ia(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=tt,n=Xt;Yr(a.type)&&(tt=a.stateNode,Xt=!1),Ia(e,t,a),Eo(a.stateNode),tt=r,Xt=n;break;case 5:ut||Oa(a,t);case 6:if(r=tt,n=Xt,tt=null,Ia(e,t,a),tt=r,Xt=n,tt!==null)if(Xt)try{(tt.nodeType===9?tt.body:tt.nodeName==="HTML"?tt.ownerDocument.body:tt).removeChild(a.stateNode)}catch(i){Le(a,t,i)}else try{tt.removeChild(a.stateNode)}catch(i){Le(a,t,i)}break;case 18:tt!==null&&(Xt?(e=tt,fh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),vn(e)):fh(tt,a.stateNode));break;case 4:r=tt,n=Xt,tt=a.stateNode.containerInfo,Xt=!0,Ia(e,t,a),tt=r,Xt=n;break;case 0:case 11:case 14:case 15:Qr(2,a,t),ut||Qr(4,a,t),Ia(e,t,a);break;case 1:ut||(Oa(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"&&bb(a,t,r)),Ia(e,t,a);break;case 21:Ia(e,t,a);break;case 22:ut=(r=ut)||a.memoizedState!==null,Ia(e,t,a),ut=r;break;default:Ia(e,t,a)}}function Sb(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{vn(e)}catch(a){Le(t,t.return,a)}}}function Nb(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{vn(e)}catch(a){Le(t,t.return,a)}}function w1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Wf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Wf),t;default:throw Error(B(435,e.tag))}}function Ol(e,t){var a=w1(e);t.forEach(function(r){if(!a.has(r)){a.add(r);var n=q1.bind(null,e,r);r.then(n,n)}})}function $t(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(Yr(l.type)){tt=l.stateNode,Xt=!1;break e}break;case 5:tt=l.stateNode,Xt=!1;break e;case 3:case 4:tt=l.stateNode.containerInfo,Xt=!0;break e}l=l.return}if(tt===null)throw Error(B(160));kb(i,o,n),tt=null,Xt=!1,i=n.alternate,i!==null&&(i.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Cb(t,e),t=t.sibling}var qa=null;function Cb(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:$t(t,e),Vt(e),r&4&&(Qr(3,e,e.return),Io(3,e),Qr(5,e,e.return));break;case 1:$t(t,e),Vt(e),r&512&&(ut||a===null||Oa(a,a.return)),r&64&&tr&&(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=qa;if($t(t,e),Vt(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[Zo]||i[qt]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=n.createElement(r),n.head.insertBefore(i,n.querySelector("head > title"))),Tt(i,r,a),i[qt]=e,kt(i),r=i;break e;case"link":var o=_h("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),Tt(i,r,a),n.head.appendChild(i);break;case"meta":if(o=_h("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),Tt(i,r,a),n.head.appendChild(i);break;default:throw Error(B(468,r))}i[qt]=e,kt(i),r=i}e.stateNode=r}else xh(n,e.type,e.stateNode);else e.stateNode=yh(n,r,e.memoizedProps);else i!==r?(i===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):i.count--,r===null?xh(n,e.type,e.stateNode):yh(n,r,e.memoizedProps)):r===null&&e.stateNode!==null&&wu(e,e.memoizedProps,a.memoizedProps)}break;case 27:$t(t,e),Vt(e),r&512&&(ut||a===null||Oa(a,a.return)),a!==null&&r&4&&wu(e,e.memoizedProps,a.memoizedProps);break;case 5:if($t(t,e),Vt(e),r&512&&(ut||a===null||Oa(a,a.return)),e.flags&32){n=e.stateNode;try{pn(n,"")}catch(y){Le(e,e.return,y)}}r&4&&e.stateNode!=null&&(n=e.memoizedProps,wu(e,n,a!==null?a.memoizedProps:n)),r&1024&&(yu=!0);break;case 6:if($t(t,e),Vt(e),r&4){if(e.stateNode===null)throw Error(B(162));r=e.memoizedProps,a=e.stateNode;try{a.nodeValue=r}catch(y){Le(e,e.return,y)}}break;case 3:if(es=null,n=qa,qa=qs(t.containerInfo),$t(t,e),qa=n,Vt(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{vn(t.containerInfo)}catch(y){Le(e,e.return,y)}yu&&(yu=!1,qb(e));break;case 4:r=qa,qa=qs(e.stateNode.containerInfo),$t(t,e),Vt(e),qa=r;break;case 12:$t(t,e),Vt(e);break;case 31:$t(t,e),Vt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ol(e,r)));break;case 13:$t(t,e),Vt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ys=ia()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ol(e,r)));break;case 22:n=e.memoizedState!==null;var c=a!==null&&a.memoizedState!==null,p=tr,f=ut;if(tr=p||n,ut=f||c,$t(t,e),ut=f,tr=p,Vt(e),r&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(a===null||c||tr||ut||ti(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 h=c.memoizedProps.style,d=h!=null&&h.hasOwnProperty("display")?h.display:null;l.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(y){Le(c,c.return,y)}}}else if(t.tag===6){if(a===null){c=t;try{c.stateNode.nodeValue=n?"":c.memoizedProps}catch(y){Le(c,c.return,y)}}}else if(t.tag===18){if(a===null){c=t;try{var g=c.stateNode;n?hh(g,!0):hh(c.stateNode,!1)}catch(y){Le(c,c.return,y)}}}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,Ol(e,a))));break;case 19:$t(t,e),Vt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ol(e,r)));break;case 30:break;case 21:break;default:$t(t,e),Vt(e)}}function Vt(e){var t=e.flags;if(t&2){try{for(var a,r=e.return;r!==null;){if(vb(r)){a=r;break}r=r.return}if(a==null)throw Error(B(160));switch(a.tag){case 27:var n=a.stateNode,i=vu(e);vs(e,i,n);break;case 5:var o=a.stateNode;a.flags&32&&(pn(o,""),a.flags&=-33);var l=vu(e);vs(e,l,o);break;case 3:case 4:var c=a.stateNode.containerInfo,p=vu(e);lp(e,p,c);break;default:throw Error(B(161))}}catch(f){Le(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function qb(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;qb(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Fa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)_b(e,t.alternate,t),t=t.sibling}function ti(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Qr(4,t,t.return),ti(t);break;case 1:Oa(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&bb(t,t.return,a),ti(t);break;case 27:Eo(t.stateNode);case 26:case 5:Oa(t,t.return),ti(t);break;case 22:t.memoizedState===null&&ti(t);break;case 30:ti(t);break;default:ti(t)}e=e.sibling}}function Wa(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:Wa(n,i,a),Io(4,i);break;case 1:if(Wa(n,i,a),r=i,n=r.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(p){Le(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++)Sg(c[n],l)}catch(p){Le(r,r.return,p)}}a&&o&64&&gb(i),So(i,i.return);break;case 27:yb(i);case 26:case 5:Wa(n,i,a),a&&r===null&&o&4&&wb(i),So(i,i.return);break;case 12:Wa(n,i,a);break;case 31:Wa(n,i,a),a&&o&4&&Sb(n,i);break;case 13:Wa(n,i,a),a&&o&4&&Nb(n,i);break;case 22:i.memoizedState===null&&Wa(n,i,a),So(i,i.return);break;case 30:break;default:Wa(n,i,a)}t=t.sibling}}function od(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&&Po(a))}function ld(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Po(e))}function Ca(e,t,a,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Eb(e,t,a,r),t=t.sibling}function Eb(e,t,a,r){var n=t.flags;switch(t.tag){case 0:case 11:case 15:Ca(e,t,a,r),n&2048&&Io(9,t);break;case 1:Ca(e,t,a,r);break;case 3:Ca(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&&Po(e)));break;case 12:if(n&2048){Ca(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){Le(t,t.return,c)}}else Ca(e,t,a,r);break;case 31:Ca(e,t,a,r);break;case 13:Ca(e,t,a,r);break;case 23:break;case 22:i=t.stateNode,o=t.alternate,t.memoizedState!==null?i._visibility&2?Ca(e,t,a,r):No(e,t):i._visibility&2?Ca(e,t,a,r):(i._visibility|=2,Gi(e,t,a,r,(t.subtreeFlags&10256)!==0||!1)),n&2048&&od(o,t);break;case 24:Ca(e,t,a,r),n&2048&&ld(t.alternate,t);break;default:Ca(e,t,a,r)}}function Gi(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:Gi(i,o,l,c,n),Io(8,o);break;case 23:break;case 22:var f=o.stateNode;o.memoizedState!==null?f._visibility&2?Gi(i,o,l,c,n):No(i,o):(f._visibility|=2,Gi(i,o,l,c,n)),n&&p&2048&&od(o.alternate,o);break;case 24:Gi(i,o,l,c,n),n&&p&2048&&ld(o.alternate,o);break;default:Gi(i,o,l,c,n)}t=t.sibling}}function No(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:No(a,r),n&2048&&od(r.alternate,r);break;case 24:No(a,r),n&2048&&ld(r.alternate,r);break;default:No(a,r)}t=t.sibling}}var ho=8192;function Qi(e,t,a){if(e.subtreeFlags&ho)for(e=e.child;e!==null;)Mb(e,t,a),e=e.sibling}function Mb(e,t,a){switch(e.tag){case 26:Qi(e,t,a),e.flags&ho&&e.memoizedState!==null&&a_(a,qa,e.memoizedState,e.memoizedProps);break;case 5:Qi(e,t,a);break;case 3:case 4:var r=qa;qa=qs(e.stateNode.containerInfo),Qi(e,t,a),qa=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=ho,ho=16777216,Qi(e,t,a),ho=r):Qi(e,t,a));break;default:Qi(e,t,a)}}function Tb(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 lo(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];xt=r,Rb(r,e)}Tb(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)zb(e),e=e.sibling}function zb(e){switch(e.tag){case 0:case 11:case 15:lo(e),e.flags&2048&&Qr(9,e,e.return);break;case 3:lo(e);break;case 12:lo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):lo(e);break;default:lo(e)}}function Fl(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];xt=r,Rb(r,e)}Tb(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Qr(8,t,t.return),Fl(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function Rb(e,t){for(;xt!==null;){var a=xt;switch(a.tag){case 0:case 11:case 15:Qr(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:Po(a.memoizedState.cache)}if(r=a.child,r!==null)r.return=a,xt=r;else e:for(a=e;xt!==null;){r=xt;var n=r.sibling,i=r.return;if(xb(r),r===a){xt=null;break e}if(n!==null){n.return=i,xt=n;break e}xt=i}}}var v1={getCacheForType:function(e){var t=Mt(pt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Mt(pt).controller.signal}},y1=typeof WeakMap=="function"?WeakMap:Map,Re=0,Xe=null,_e=null,Ne=0,Be=0,ea=null,Cr=!1,Sn=!1,sd=!1,dr=0,it=0,Gr=0,oi=0,cd=0,ra=0,hn=0,Co=null,Zt=null,sp=!1,Ys=0,Ab=0,ys=1/0,_s=null,Ar=null,gt=0,Ur=null,gn=null,lr=0,cp=0,up=null,Ub=null,qo=0,pp=null;function la(){return(Re&2)!==0&&Ne!==0?Ne&-Ne:ce.T!==null?pd():Yh()}function Db(){if(ra===0)if((Ne&536870912)===0||Ce){var e=Cl;Cl<<=1,(Cl&3932160)===0&&(Cl=262144),ra=e}else ra=536870912;return e=ca.current,e!==null&&(e.flags|=32),ra}function Kt(e,t,a){(e===Xe&&(Be===2||Be===9)||e.cancelPendingCommit!==null)&&(bn(e,0),qr(e,Ne,ra,!1)),Xo(e,a),((Re&2)===0||e!==Xe)&&(e===Xe&&((Re&2)===0&&(oi|=a),it===4&&qr(e,Ne,ra,!1)),Ha(e))}function Ob(e,t,a){if((Re&6)!==0)throw Error(B(327));var r=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Vo(e,t),n=r?k1(e,t):_u(e,t,!0),i=r;do{if(n===0){Sn&&!r&&qr(e,t,0,!1);break}else{if(a=e.current.alternate,i&&!_1(a)){n=_u(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=Co;var c=l.current.memoizedState.isDehydrated;if(c&&(bn(l,o).flags|=256),o=_u(l,o,!1),o!==2){if(sd&&!c){l.errorRecoveryDisabledLanes|=i,oi|=i,n=4;break e}i=Zt,Zt=n,i!==null&&(Zt===null?Zt=i:Zt.push.apply(Zt,i))}n=o}if(i=!1,n!==2)continue}}if(n===1){bn(e,0),qr(e,t,0,!0);break}e:{switch(r=e,i=n,i){case 0:case 1:throw Error(B(345));case 4:if((t&4194048)!==t)break;case 6:qr(r,t,ra,!Cr);break e;case 2:Zt=null;break;case 3:case 5:break;default:throw Error(B(329))}if((t&62914560)===t&&(n=Ys+300-ia(),10<n)){if(qr(r,t,ra,!Cr),Rs(r,0,!0)!==0)break e;lr=t,r.timeoutHandle=aw(eh.bind(null,r,a,Zt,_s,sp,t,ra,oi,hn,Cr,i,"Throttled",-0,0),n);break e}eh(r,a,Zt,_s,sp,t,ra,oi,hn,Cr,i,null,-0,0)}}break}while(!0);Ha(e)}function eh(e,t,a,r,n,i,o,l,c,p,f,h,d,g){if(e.timeoutHandle=-1,h=t.subtreeFlags,h&8192||(h&16785408)===16785408){h={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:rr},Mb(t,i,h);var y=(i&62914560)===i?Ys-ia():(i&4194048)===i?Ab-ia():0;if(y=r_(h,y),y!==null){lr=i,e.cancelPendingCommit=y(ah.bind(null,e,t,i,a,r,n,o,l,c,f,h,null,d,g)),qr(e,i,o,!p);return}}ah(e,t,i,a,r,n,o,l,c)}function _1(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(!sa(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 qr(e,t,a,r){t&=~cd,t&=~oi,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var n=t;0<n;){var i=31-oa(n),o=1<<i;r[i]=-1,n&=~o}a!==0&&Qh(e,a,t)}function $s(){return(Re&6)===0?(Fo(0,!1),!1):!0}function ud(){if(_e!==null){if(Be===0)var e=_e.return;else e=_e,ir=gi=null,Pp(e),on=null,Do=0,e=_e;for(;e!==null;)hb(e.alternate,e),e=e.return;_e=null}}function bn(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,H1(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),lr=0,ud(),Xe=e,_e=a=nr(e.current,null),Ne=t,Be=0,ea=null,Cr=!1,Sn=Vo(e,t),sd=!1,hn=ra=cd=oi=Gr=it=0,Zt=Co=null,sp=!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-oa(r),i=1<<n;t|=e[n],r&=~i}return dr=t,Os(),a}function Bb(e,t){he=null,ce.H=Bo,t===kn||t===Ls?(t=Rf(),Be=3):t===jp?(t=Rf(),Be=4):Be=t===id?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ea=t,_e===null&&(it=1,bs(e,ga(t,e.current)))}function Lb(){var e=ca.current;return e===null?!0:(Ne&4194048)===Ne?wa===null:(Ne&62914560)===Ne||(Ne&536870912)!==0?e===wa:!1}function Hb(){var e=ce.H;return ce.H=Bo,e===null?Bo:e}function Qb(){var e=ce.A;return ce.A=v1,e}function xs(){it=4,Cr||(Ne&4194048)!==Ne&&ca.current!==null||(Sn=!0),(Gr&134217727)===0&&(oi&134217727)===0||Xe===null||qr(Xe,Ne,ra,!1)}function _u(e,t,a){var r=Re;Re|=2;var n=Hb(),i=Qb();(Xe!==e||Ne!==t)&&(_s=null,bn(e,t)),t=!1;var o=it;e:do try{if(Be!==0&&_e!==null){var l=_e,c=ea;switch(Be){case 8:ud(),o=6;break e;case 3:case 2:case 9:case 6:ca.current===null&&(t=!0);var p=Be;if(Be=0,ea=null,en(e,l,c,p),a&&Sn){o=0;break e}break;default:p=Be,Be=0,ea=null,en(e,l,c,p)}}x1(),o=it;break}catch(f){Bb(e,f)}while(!0);return t&&e.shellSuspendCounter++,ir=gi=null,Re=r,ce.H=n,ce.A=i,_e===null&&(Xe=null,Ne=0,Os()),o}function x1(){for(;_e!==null;)Gb(_e)}function k1(e,t){var a=Re;Re|=2;var r=Hb(),n=Qb();Xe!==e||Ne!==t?(_s=null,ys=ia()+500,bn(e,t)):Sn=Vo(e,t);e:do try{if(Be!==0&&_e!==null){t=_e;var i=ea;t:switch(Be){case 1:Be=0,ea=null,en(e,t,i,1);break;case 2:case 9:if(zf(i)){Be=0,ea=null,th(t);break}t=function(){Be!==2&&Be!==9||Xe!==e||(Be=7),Ha(e)},i.then(t,t);break e;case 3:Be=7;break e;case 4:Be=5;break e;case 7:zf(i)?(Be=0,ea=null,th(t)):(Be=0,ea=null,en(e,t,i,7));break;case 5:var o=null;switch(_e.tag){case 26:o=_e.memoizedState;case 5:case 27:var l=_e;if(o?lw(o):l.stateNode.complete){Be=0,ea=null;var c=l.sibling;if(c!==null)_e=c;else{var p=l.return;p!==null?(_e=p,Vs(p)):_e=null}break t}}Be=0,ea=null,en(e,t,i,5);break;case 6:Be=0,ea=null,en(e,t,i,6);break;case 8:ud(),it=6;break e;default:throw Error(B(462))}}S1();break}catch(f){Bb(e,f)}while(!0);return ir=gi=null,ce.H=r,ce.A=n,Re=a,_e!==null?0:(Xe=null,Ne=0,Os(),it)}function S1(){for(;_e!==null&&!Z0();)Gb(_e)}function Gb(e){var t=fb(e.alternate,e,dr);e.memoizedProps=e.pendingProps,t===null?Vs(e):_e=t}function th(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Kf(a,t,t.pendingProps,t.type,void 0,Ne);break;case 11:t=Kf(a,t,t.pendingProps,t.type.render,t.ref,Ne);break;case 5:Pp(t);default:hb(a,t),t=_e=hg(t,dr),t=fb(a,t,dr)}e.memoizedProps=e.pendingProps,t===null?Vs(e):_e=t}function en(e,t,a,r){ir=gi=null,Pp(t),on=null,Do=0;var n=t.return;try{if(d1(e,n,t,a,Ne)){it=1,bs(e,ga(a,e.current)),_e=null;return}}catch(i){if(n!==null)throw _e=n,i;it=1,bs(e,ga(a,e.current)),_e=null;return}t.flags&32768?(Ce||r===1?e=!0:Sn||(Ne&536870912)!==0?e=!1:(Cr=e=!0,(r===2||r===9||r===3||r===6)&&(r=ca.current,r!==null&&r.tag===13&&(r.flags|=16384))),jb(t,e)):Vs(t)}function Vs(e){var t=e;do{if((t.flags&32768)!==0){jb(t,Cr);return}e=t.return;var a=h1(t.alternate,t,dr);if(a!==null){_e=a;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);it===0&&(it=5)}function jb(e,t){do{var a=g1(e.alternate,e);if(a!==null){a.flags&=32767,_e=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){_e=e;return}_e=e=a}while(e!==null);it=6,_e=null}function ah(e,t,a,r,n,i,o,l,c){e.cancelPendingCommit=null;do Xs();while(gt!==0);if((Re&6)!==0)throw Error(B(327));if(t!==null){if(t===e.current)throw Error(B(177));if(i=t.lanes|t.childLanes,i|=Dp,ry(e,a,i,o,l,c),e===Xe&&(_e=Xe=null,Ne=0),gn=t,Ur=e,lr=a,cp=i,up=n,Ub=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,E1(os,function(){return Zb(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=ce.T,ce.T=null,n=Ae.p,Ae.p=2,o=Re,Re|=4;try{b1(e,t,a)}finally{Re=o,Ae.p=n,ce.T=r}}gt=1,Yb(),$b(),Vb()}}function Yb(){if(gt===1){gt=0;var e=Ur,t=gn,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=ce.T,ce.T=null;var r=Ae.p;Ae.p=2;var n=Re;Re|=4;try{Cb(t,e);var i=hp,o=lg(e.containerInfo),l=i.focusedElem,c=i.selectionRange;if(o!==l&&l&&l.ownerDocument&&og(l.ownerDocument.documentElement,l)){if(c!==null&&Up(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 h=l.ownerDocument||document,d=h&&h.defaultView||window;if(d.getSelection){var g=d.getSelection(),y=l.textContent.length,R=Math.min(c.start,y),L=c.end===void 0?R:Math.min(c.end,y);!g.extend&&R>L&&(o=L,L=R,R=o);var m=Sf(l,R),u=Sf(l,L);if(m&&u&&(g.rangeCount!==1||g.anchorNode!==m.node||g.anchorOffset!==m.offset||g.focusNode!==u.node||g.focusOffset!==u.offset)){var b=h.createRange();b.setStart(m.node,m.offset),g.removeAllRanges(),R>L?(g.addRange(b),g.extend(u.node,u.offset)):(b.setEnd(u.node,u.offset),g.addRange(b))}}}}for(h=[],g=l;g=g.parentNode;)g.nodeType===1&&h.push({element:g,left:g.scrollLeft,top:g.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<h.length;l++){var w=h[l];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}Ts=!!fp,hp=fp=null}finally{Re=n,Ae.p=r,ce.T=a}}e.current=t,gt=2}}function $b(){if(gt===2){gt=0;var e=Ur,t=gn,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=ce.T,ce.T=null;var r=Ae.p;Ae.p=2;var n=Re;Re|=4;try{_b(e,t.alternate,t)}finally{Re=n,Ae.p=r,ce.T=a}}gt=3}}function Vb(){if(gt===4||gt===3){gt=0,K0();var e=Ur,t=gn,a=lr,r=Ub;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?gt=5:(gt=0,gn=Ur=null,Xb(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(Ar=null),qp(a),t=t.stateNode,na&&typeof na.onCommitFiberRoot=="function")try{na.onCommitFiberRoot($o,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=ce.T,n=Ae.p,Ae.p=2,ce.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{ce.T=t,Ae.p=n}}(lr&3)!==0&&Xs(),Ha(e),n=e.pendingLanes,(a&261930)!==0&&(n&42)!==0?e===pp?qo++:(qo=0,pp=e):qo=0,Fo(0,!1)}}function Xb(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Po(t)))}function Xs(){return Yb(),$b(),Vb(),Zb()}function Zb(){if(gt!==5)return!1;var e=Ur,t=cp;cp=0;var a=qp(lr),r=ce.T,n=Ae.p;try{Ae.p=32>a?32:a,ce.T=null,a=up,up=null;var i=Ur,o=lr;if(gt=0,gn=Ur=null,lr=0,(Re&6)!==0)throw Error(B(331));var l=Re;if(Re|=4,zb(i.current),Eb(i,i.current,o,a),Re=l,Fo(0,!1),na&&typeof na.onPostCommitFiberRoot=="function")try{na.onPostCommitFiberRoot($o,i)}catch{}return!0}finally{Ae.p=n,ce.T=r,Xb(e,t)}}function rh(e,t,a){t=ga(a,t),t=ip(e.stateNode,t,2),e=Rr(e,t,2),e!==null&&(Xo(e,2),Ha(e))}function Le(e,t,a){if(e.tag===3)rh(e,e,a);else for(;t!==null;){if(t.tag===3){rh(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ar===null||!Ar.has(r))){e=ga(a,e),a=sb(2),r=Rr(t,a,2),r!==null&&(cb(a,r,t,e),Xo(r,2),Ha(r));break}}t=t.return}}function xu(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new y1;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)||(sd=!0,n.add(a),e=N1.bind(null,e,t,a),t.then(e,e))}function N1(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Xe===e&&(Ne&a)===a&&(it===4||it===3&&(Ne&62914560)===Ne&&300>ia()-Ys?(Re&2)===0&&bn(e,0):cd|=a,hn===Ne&&(hn=0)),Ha(e)}function Kb(e,t){t===0&&(t=Hh()),e=hi(e,t),e!==null&&(Xo(e,t),Ha(e))}function C1(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Kb(e,a)}function q1(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(B(314))}r!==null&&r.delete(t),Kb(e,a)}function E1(e,t){return Np(e,t)}var ks=null,ji=null,dp=!1,Ss=!1,ku=!1,Er=0;function Ha(e){e!==ji&&e.next===null&&(ji===null?ks=ji=e:ji=ji.next=e),Ss=!0,dp||(dp=!0,T1())}function Fo(e,t){if(!ku&&Ss){ku=!0;do for(var a=!1,r=ks;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-oa(42|e)+1)-1,i&=n&~(o&~l),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(a=!0,ih(r,i))}else i=Ne,i=Rs(r,r===Xe?i:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(i&3)===0||Vo(r,i)||(a=!0,ih(r,i));r=r.next}while(a);ku=!1}}function M1(){Pb()}function Pb(){Ss=dp=!1;var e=0;Er!==0&&L1()&&(e=Er);for(var t=ia(),a=null,r=ks;r!==null;){var n=r.next,i=Jb(r,t);i===0?(r.next=null,a===null?ks=n:a.next=n,n===null&&(ji=a)):(a=r,(e!==0||(i&3)!==0)&&(Ss=!0)),r=n}gt!==0&>!==5||Fo(e,!1),Er!==0&&(Er=0)}function Jb(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,n=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var o=31-oa(i),l=1<<o,c=n[o];c===-1?((l&a)===0||(l&r)!==0)&&(n[o]=ay(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}if(t=Xe,a=Ne,a=Rs(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&&Fc(r),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Vo(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(r!==null&&Fc(r),qp(a)){case 2:case 8:a=Bh;break;case 32:a=os;break;case 268435456:a=Lh;break;default:a=os}return r=Ib.bind(null,e),a=Np(a,r),e.callbackPriority=t,e.callbackNode=a,t}return r!==null&&r!==null&&Fc(r),e.callbackPriority=2,e.callbackNode=null,2}function Ib(e,t){if(gt!==0&>!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Xs()&&e.callbackNode!==a)return null;var r=Ne;return r=Rs(e,e===Xe?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Ob(e,r,t),Jb(e,ia()),e.callbackNode!=null&&e.callbackNode===a?Ib.bind(null,e):null)}function ih(e,t){if(Xs())return null;Ob(e,t,!0)}function T1(){Q1(function(){(Re&6)!==0?Np(Oh,M1):Pb()})}function pd(){if(Er===0){var e=dn;e===0&&(e=Nl,Nl<<=1,(Nl&261888)===0&&(Nl=256)),Er=e}return Er}function nh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Yl(""+e)}function oh(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 z1(e,t,a,r,n){if(t==="submit"&&a&&a.stateNode===n){var i=nh((n[Pt]||null).action),o=r.submitter;o&&(t=(t=o[Pt]||null)?nh(t.formAction):o.getAttribute("formAction"),t!==null&&(i=t,o=null));var l=new As("action","action",null,r,n);e.push({event:l,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Er!==0){var c=o?oh(n,o):new FormData(n);ap(a,{pending:!0,data:c,method:n.method,action:i},null,c)}}else typeof i=="function"&&(l.preventDefault(),c=o?oh(n,o):new FormData(n),ap(a,{pending:!0,data:c,method:n.method,action:i},i,c))},currentTarget:n}]})}}for(Bl=0;Bl<$u.length;Bl++)Ll=$u[Bl],lh=Ll.toLowerCase(),sh=Ll[0].toUpperCase()+Ll.slice(1),Ea(lh,"on"+sh);var Ll,lh,sh,Bl;Ea(cg,"onAnimationEnd");Ea(ug,"onAnimationIteration");Ea(pg,"onAnimationStart");Ea("dblclick","onDoubleClick");Ea("focusin","onFocus");Ea("focusout","onBlur");Ea(Py,"onTransitionRun");Ea(Jy,"onTransitionStart");Ea(Iy,"onTransitionCancel");Ea(dg,"onTransitionEnd");un("onMouseEnter",["mouseout","mouseover"]);un("onMouseLeave",["mouseout","mouseover"]);un("onPointerEnter",["pointerout","pointerover"]);un("onPointerLeave",["pointerout","pointerover"]);di("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));di("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));di("onBeforeInput",["compositionend","keypress","textInput","paste"]);di("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));di("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));di("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lo="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(" "),R1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Lo));function Fb(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){ss(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){ss(f)}n.currentTarget=null,i=c}}}}function ye(e,t){var a=t[Ou];a===void 0&&(a=t[Ou]=new Set);var r=e+"__bubble";a.has(r)||(Wb(t,e,2,!1),a.add(r))}function Su(e,t,a){var r=0;t&&(r|=4),Wb(a,e,r,t)}var Hl="_reactListening"+Math.random().toString(36).slice(2);function dd(e){if(!e[Hl]){e[Hl]=!0,$h.forEach(function(a){a!=="selectionchange"&&(R1.has(a)||Su(a,!1,e),Su(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hl]||(t[Hl]=!0,Su("selectionchange",!1,t))}}function Wb(e,t,a,r){switch(dw(t)){case 2:var n=o_;break;case 8:n=l_;break;default:n=gd}a=n.bind(null,t,a,e),n=void 0,!Gu||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 Nu(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=Vi(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}Fh(function(){var p=i,f=Tp(a),h=[];e:{var d=mg.get(e);if(d!==void 0){var g=As,y=e;switch(e){case"keypress":if(Vl(a)===0)break e;case"keydown":case"keyup":g=qy;break;case"focusin":y="focus",g=ru;break;case"focusout":y="blur",g=ru;break;case"beforeblur":case"afterblur":g=ru;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":g=hf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=hy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=Ty;break;case cg:case ug:case pg:g=wy;break;case dg:g=Ry;break;case"scroll":case"scrollend":g=my;break;case"wheel":g=Uy;break;case"copy":case"cut":case"paste":g=yy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=bf;break;case"toggle":case"beforetoggle":g=Oy}var R=(t&4)!==0,L=!R&&(e==="scroll"||e==="scrollend"),m=R?d!==null?d+"Capture":null:d;R=[];for(var u=p,b;u!==null;){var w=u;if(b=w.stateNode,w=w.tag,w!==5&&w!==26&&w!==27||b===null||m===null||(w=To(u,m),w!=null&&R.push(Ho(u,w,b))),L)break;u=u.return}0<R.length&&(d=new g(d,y,null,a,f),h.push({event:d,listeners:R}))}}if((t&7)===0){e:{if(d=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",d&&a!==Qu&&(y=a.relatedTarget||a.fromElement)&&(Vi(y)||y[yn]))break e;if((g||d)&&(d=f.window===f?f:(d=f.ownerDocument)?d.defaultView||d.parentWindow:window,g?(y=a.relatedTarget||a.toElement,g=p,y=y?Vi(y):null,y!==null&&(L=Yo(y),R=y.tag,y!==L||R!==5&&R!==27&&R!==6)&&(y=null)):(g=null,y=p),g!==y)){if(R=hf,w="onMouseLeave",m="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(R=bf,w="onPointerLeave",m="onPointerEnter",u="pointer"),L=g==null?d:mo(g),b=y==null?d:mo(y),d=new R(w,u+"leave",g,a,f),d.target=L,d.relatedTarget=b,w=null,Vi(f)===p&&(R=new R(m,u+"enter",y,a,f),R.target=b,R.relatedTarget=L,w=R),L=w,g&&y)t:{for(R=A1,m=g,u=y,b=0,w=m;w;w=R(w))b++;w=0;for(var v=u;v;v=R(v))w++;for(;0<b-w;)m=R(m),b--;for(;0<w-b;)u=R(u),w--;for(;b--;){if(m===u||u!==null&&m===u.alternate){R=m;break t}m=R(m),u=R(u)}R=null}else R=null;g!==null&&ch(h,d,g,R,!1),y!==null&&L!==null&&ch(h,L,y,R,!0)}}e:{if(d=p?mo(p):window,g=d.nodeName&&d.nodeName.toLowerCase(),g==="select"||g==="input"&&d.type==="file")var M=_f;else if(yf(d))if(ig)M=Xy;else{M=$y;var T=Yy}else g=d.nodeName,!g||g.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?p&&Mp(p.elementType)&&(M=_f):M=Vy;if(M&&(M=M(e,p))){rg(h,M,a,f);break e}T&&T(e,d,p),e==="focusout"&&p&&d.type==="number"&&p.memoizedProps.value!=null&&Hu(d,"number",d.value)}switch(T=p?mo(p):window,e){case"focusin":(yf(T)||T.contentEditable==="true")&&(Ki=T,ju=p,wo=null);break;case"focusout":wo=ju=Ki=null;break;case"mousedown":Yu=!0;break;case"contextmenu":case"mouseup":case"dragend":Yu=!1,Nf(h,a,f);break;case"selectionchange":if(Ky)break;case"keydown":case"keyup":Nf(h,a,f)}var A;if(Ap)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 Zi?tg(e,a)&&(G="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(G="onCompositionStart");G&&(eg&&a.locale!=="ko"&&(Zi||G!=="onCompositionStart"?G==="onCompositionEnd"&&Zi&&(A=Wh()):(Nr=f,zp="value"in Nr?Nr.value:Nr.textContent,Zi=!0)),T=Ns(p,G),0<T.length&&(G=new gf(G,e,null,a,f),h.push({event:G,listeners:T}),A?G.data=A:(A=ag(a),A!==null&&(G.data=A)))),(A=Ly?Hy(e,a):Qy(e,a))&&(G=Ns(p,"onBeforeInput"),0<G.length&&(T=new gf("onBeforeInput","beforeinput",null,a,f),h.push({event:T,listeners:G}),T.data=A)),z1(h,e,p,a,f)}Fb(h,t)})}function Ho(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Ns(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=To(e,a),n!=null&&r.unshift(Ho(e,n,i)),n=To(e,t),n!=null&&r.push(Ho(e,n,i))),e.tag===3)return r;e=e.return}return[]}function A1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ch(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=To(a,i),p!=null&&o.unshift(Ho(a,p,c))):n||(p=To(a,i),p!=null&&o.push(Ho(a,p,c)))),a=a.return}o.length!==0&&e.push({event:t,listeners:o})}var U1=/\r\n?/g,D1=/\u0000|\uFFFD/g;function uh(e){return(typeof e=="string"?e:""+e).replace(U1,`
|
|
9
|
+
`).replace(D1,"")}function ew(e,t){return t=uh(t),uh(e)===t}function $e(e,t,a,r,n,i){switch(a){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||pn(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&pn(e,""+r);break;case"className":El(e,"class",r);break;case"tabIndex":El(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":El(e,a,r);break;case"style":Ih(e,r,i);break;case"data":if(t!=="object"){El(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=Yl(""+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"&&$e(e,t,"name",n.name,n,null),$e(e,t,"formEncType",n.formEncType,n,null),$e(e,t,"formMethod",n.formMethod,n,null),$e(e,t,"formTarget",n.formTarget,n,null)):($e(e,t,"encType",n.encType,n,null),$e(e,t,"method",n.method,n,null),$e(e,t,"target",n.target,n,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(a);break}r=Yl(""+r),e.setAttribute(a,r);break;case"onClick":r!=null&&(e.onclick=rr);break;case"onScroll":r!=null&&ye("scroll",e);break;case"onScrollEnd":r!=null&&ye("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(B(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(B(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=Yl(""+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":ye("beforetoggle",e),ye("toggle",e),jl(e,"popover",r);break;case"xlinkActuate":Pa(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Pa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Pa(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Pa(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Pa(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Pa(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Pa(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Pa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Pa(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":jl(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=py.get(a)||a,jl(e,a,r))}}function mp(e,t,a,r,n,i){switch(a){case"style":Ih(e,r,i);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(B(61));if(a=r.__html,a!=null){if(n.children!=null)throw Error(B(60));e.innerHTML=a}}break;case"children":typeof r=="string"?pn(e,r):(typeof r=="number"||typeof r=="bigint")&&pn(e,""+r);break;case"onScroll":r!=null&&ye("scroll",e);break;case"onScrollEnd":r!=null&&ye("scrollend",e);break;case"onClick":r!=null&&(e.onclick=rr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vh.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[Pt]||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,""):jl(e,a,r)}}}function Tt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ye("error",e),ye("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(B(137,t));default:$e(e,t,i,o,a,null)}}n&&$e(e,t,"srcSet",a.srcSet,a,null),r&&$e(e,t,"src",a.src,a,null);return;case"input":ye("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(B(137,t));break;default:$e(e,t,r,f,a,null)}}Kh(e,i,l,c,p,o,n,!1);return;case"select":ye("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:$e(e,t,n,l,a,null)}t=i,a=o,e.multiple=!!r,t!=null?an(e,!!r,t,!1):a!=null&&an(e,!!r,a,!0);return;case"textarea":ye("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(B(91));break;default:$e(e,t,o,l,a,null)}Jh(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":$e(e,t,c,r,a,null));return;case"dialog":ye("beforetoggle",e),ye("toggle",e),ye("cancel",e),ye("close",e);break;case"iframe":case"object":ye("load",e);break;case"video":case"audio":for(r=0;r<Lo.length;r++)ye(Lo[r],e);break;case"image":ye("error",e),ye("load",e);break;case"details":ye("toggle",e);break;case"embed":case"source":case"link":ye("error",e),ye("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(B(137,t));default:$e(e,t,p,r,a,null)}return;default:if(Mp(t)){for(f in a)a.hasOwnProperty(f)&&(r=a[f],r!==void 0&&mp(e,t,f,r,a,void 0));return}}for(l in a)a.hasOwnProperty(l)&&(r=a[l],r!=null&&$e(e,t,l,r,a,null))}function O1(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(g in a){var h=a[g];if(a.hasOwnProperty(g)&&h!=null)switch(g){case"checked":break;case"value":break;case"defaultValue":c=h;default:r.hasOwnProperty(g)||$e(e,t,g,null,r,h)}}for(var d in r){var g=r[d];if(h=a[d],r.hasOwnProperty(d)&&(g!=null||h!=null))switch(d){case"type":i=g;break;case"name":n=g;break;case"checked":p=g;break;case"defaultChecked":f=g;break;case"value":o=g;break;case"defaultValue":l=g;break;case"children":case"dangerouslySetInnerHTML":if(g!=null)throw Error(B(137,t));break;default:g!==h&&$e(e,t,d,g,r,h)}}Lu(e,o,l,c,p,f,i,n);return;case"select":g=o=l=d=null;for(i in a)if(c=a[i],a.hasOwnProperty(i)&&c!=null)switch(i){case"value":break;case"multiple":g=c;default:r.hasOwnProperty(i)||$e(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&&$e(e,t,n,i,r,c)}t=l,a=o,r=g,d!=null?an(e,!!a,d,!1):!!r!=!!a&&(t!=null?an(e,!!a,t,!0):an(e,!!a,a?[]:"",!1));return;case"textarea":g=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:$e(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":g=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(B(91));break;default:n!==i&&$e(e,t,o,n,r,i)}Ph(e,d,g);return;case"option":for(var y in a)d=a[y],a.hasOwnProperty(y)&&d!=null&&!r.hasOwnProperty(y)&&(y==="selected"?e.selected=!1:$e(e,t,y,null,r,d));for(c in r)d=r[c],g=a[c],r.hasOwnProperty(c)&&d!==g&&(d!=null||g!=null)&&(c==="selected"?e.selected=d&&typeof d!="function"&&typeof d!="symbol":$e(e,t,c,d,r,g));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 R in a)d=a[R],a.hasOwnProperty(R)&&d!=null&&!r.hasOwnProperty(R)&&$e(e,t,R,null,r,d);for(p in r)if(d=r[p],g=a[p],r.hasOwnProperty(p)&&d!==g&&(d!=null||g!=null))switch(p){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(B(137,t));break;default:$e(e,t,p,d,r,g)}return;default:if(Mp(t)){for(var L in a)d=a[L],a.hasOwnProperty(L)&&d!==void 0&&!r.hasOwnProperty(L)&&mp(e,t,L,void 0,r,d);for(f in r)d=r[f],g=a[f],!r.hasOwnProperty(f)||d===g||d===void 0&&g===void 0||mp(e,t,f,d,r,g);return}}for(var m in a)d=a[m],a.hasOwnProperty(m)&&d!=null&&!r.hasOwnProperty(m)&&$e(e,t,m,null,r,d);for(h in r)d=r[h],g=a[h],!r.hasOwnProperty(h)||d===g||d==null&&g==null||$e(e,t,h,d,r,g)}function ph(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function B1(){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&&ph(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,h=c.initiatorType;f&&ph(h)&&(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 fp=null,hp=null;function Cs(e){return e.nodeType===9?e:e.ownerDocument}function dh(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 tw(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 gp(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 Cu=null;function L1(){var e=window.event;return e&&e.type==="popstate"?e===Cu?!1:(Cu=e,!0):(Cu=null,!1)}var aw=typeof setTimeout=="function"?setTimeout:void 0,H1=typeof clearTimeout=="function"?clearTimeout:void 0,mh=typeof Promise=="function"?Promise:void 0,Q1=typeof queueMicrotask=="function"?queueMicrotask:typeof mh<"u"?function(e){return mh.resolve(null).then(e).catch(G1)}:aw;function G1(e){setTimeout(function(){throw e})}function Yr(e){return e==="head"}function fh(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),vn(t);return}r--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")r++;else if(a==="html")Eo(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Eo(a);for(var i=a.firstChild;i;){var o=i.nextSibling,l=i.nodeName;i[Zo]||l==="SCRIPT"||l==="STYLE"||l==="LINK"&&i.rel.toLowerCase()==="stylesheet"||a.removeChild(i),i=o}}else a==="body"&&Eo(e.ownerDocument.body);a=n}while(a);vn(t)}function hh(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 bp(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":bp(a),Ep(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function j1(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[Zo])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=va(e.nextSibling),e===null)break}return null}function Y1(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=va(e.nextSibling),e===null))return null;return e}function rw(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=va(e.nextSibling),e===null))return null;return e}function wp(e){return e.data==="$?"||e.data==="$~"}function vp(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function $1(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 va(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 yp=null;function gh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return va(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function bh(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 iw(e,t,a){switch(t=Cs(a),e){case"html":if(e=t.documentElement,!e)throw Error(B(452));return e;case"head":if(e=t.head,!e)throw Error(B(453));return e;case"body":if(e=t.body,!e)throw Error(B(454));return e;default:throw Error(B(451))}}function Eo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ep(e)}var ya=new Map,wh=new Set;function qs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var mr=Ae.d;Ae.d={f:V1,r:X1,D:Z1,C:K1,L:P1,m:J1,X:F1,S:I1,M:W1};function V1(){var e=mr.f(),t=$s();return e||t}function X1(e){var t=_n(e);t!==null&&t.tag===5&&t.type==="form"?Ig(t):mr.r(e)}var Nn=typeof document>"u"?null:document;function nw(e,t,a){var r=Nn;if(r&&typeof t=="string"&&t){var n=ha(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof a=="string"&&(n+='[crossorigin="'+a+'"]'),wh.has(n)||(wh.add(n),e={rel:e,crossOrigin:a,href:t},r.querySelector(n)===null&&(t=r.createElement("link"),Tt(t,"link",e),kt(t),r.head.appendChild(t)))}}function Z1(e){mr.D(e),nw("dns-prefetch",e,null)}function K1(e,t){mr.C(e,t),nw("preconnect",e,t)}function P1(e,t,a){mr.L(e,t,a);var r=Nn;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=wn(e);break;case"script":i=Cn(e)}ya.has(i)||(e=We({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),ya.set(i,e),r.querySelector(n)!==null||t==="style"&&r.querySelector(Wo(i))||t==="script"&&r.querySelector(el(i))||(t=r.createElement("link"),Tt(t,"link",e),kt(t),r.head.appendChild(t)))}}function J1(e,t){mr.m(e,t);var a=Nn;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=Cn(e)}if(!ya.has(i)&&(e=We({rel:"modulepreload",href:e},t),ya.set(i,e),a.querySelector(n)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(el(i)))return}r=a.createElement("link"),Tt(r,"link",e),kt(r),a.head.appendChild(r)}}}function I1(e,t,a){mr.S(e,t,a);var r=Nn;if(r&&e){var n=tn(r).hoistableStyles,i=wn(e);t=t||"default";var o=n.get(i);if(!o){var l={loading:0,preload:null};if(o=r.querySelector(Wo(i)))l.loading=5;else{e=We({rel:"stylesheet",href:e,"data-precedence":t},a),(a=ya.get(i))&&md(e,a);var c=o=r.createElement("link");kt(c),Tt(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,Wl(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:l},n.set(i,o)}}}function F1(e,t){mr.X(e,t);var a=Nn;if(a&&e){var r=tn(a).hoistableScripts,n=Cn(e),i=r.get(n);i||(i=a.querySelector(el(n)),i||(e=We({src:e,async:!0},t),(t=ya.get(n))&&fd(e,t),i=a.createElement("script"),kt(i),Tt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(n,i))}}function W1(e,t){mr.M(e,t);var a=Nn;if(a&&e){var r=tn(a).hoistableScripts,n=Cn(e),i=r.get(n);i||(i=a.querySelector(el(n)),i||(e=We({src:e,async:!0,type:"module"},t),(t=ya.get(n))&&fd(e,t),i=a.createElement("script"),kt(i),Tt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},r.set(n,i))}}function vh(e,t,a,r){var n=(n=Mr.current)?qs(n):null;if(!n)throw Error(B(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=wn(a.href),a=tn(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=wn(a.href);var i=tn(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(Wo(e)))&&!i._p&&(o.instance=i,o.state.loading=5),ya.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},ya.set(e,a),i||e_(n,e,a,o.state))),t&&r===null)throw Error(B(528,""));return o}if(t&&r!==null)throw Error(B(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Cn(a),a=tn(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(B(444,e))}}function wn(e){return'href="'+ha(e)+'"'}function Wo(e){return'link[rel="stylesheet"]['+e+"]"}function ow(e){return We({},e,{"data-precedence":e.precedence,precedence:null})}function e_(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}),Tt(t,"link",a),kt(t),e.head.appendChild(t))}function Cn(e){return'[src="'+ha(e)+'"]'}function el(e){return"script[async]"+e}function yh(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,kt(r),r;var n=We({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),kt(r),Tt(r,"style",n),Wl(r,a.precedence,e),t.instance=r;case"stylesheet":n=wn(a.href);var i=e.querySelector(Wo(n));if(i)return t.state.loading|=4,t.instance=i,kt(i),i;r=ow(a),(n=ya.get(n))&&md(r,n),i=(e.ownerDocument||e).createElement("link"),kt(i);var o=i;return o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),Tt(i,"link",r),t.state.loading|=4,Wl(i,a.precedence,e),t.instance=i;case"script":return i=Cn(a.src),(n=e.querySelector(el(i)))?(t.instance=n,kt(n),n):(r=a,(n=ya.get(i))&&(r=We({},a),fd(r,n)),e=e.ownerDocument||e,n=e.createElement("script"),kt(n),Tt(n,"link",r),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(B(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Wl(r,a.precedence,e));return t.instance}function Wl(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 md(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function fd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var es=null;function _h(e,t,a){if(es===null){var r=new Map,n=es=new Map;n.set(a,r)}else n=es,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[Zo]||i[qt]||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 xh(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function t_(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 lw(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function a_(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=wn(r.href),i=t.querySelector(Wo(n));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Es.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=i,kt(i);return}i=t.ownerDocument||t,r=ow(r),(n=ya.get(n))&&md(r,n),i=i.createElement("link"),kt(i);var o=i;o._p=new Promise(function(l,c){o.onload=l,o.onerror=c}),Tt(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=Es.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var qu=0;function r_(e,t){return e.stylesheets&&e.count===0&&ts(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var r=setTimeout(function(){if(e.stylesheets&&ts(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&qu===0&&(qu=62500*B1());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ts(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>qu?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(n)}}:null}function Es(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ts(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ms=null;function ts(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ms=new Map,t.forEach(i_,e),Ms=null,Es.call(e))}function i_(e,t){if(!(t.state.loading&4)){var a=Ms.get(e);if(a)var r=a.get(null);else{a=new Map,Ms.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=Es.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 Qo={$$typeof:ar,Provider:null,Consumer:null,_currentValue:ai,_currentValue2:ai,_threadCount:0};function n_(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=Wc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wc(0),this.hiddenUpdates=Wc(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 sw(e,t,a,r,n,i,o,l,c,p,f,h){return e=new n_(e,t,a,o,c,p,f,h,l),t=1,i===!0&&(t|=24),i=aa(3,null,null,t),e.current=i,i.stateNode=e,t=Qp(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:r,isDehydrated:a,cache:t},Yp(i),e}function cw(e){return e?(e=Ii,e):Ii}function uw(e,t,a,r,n,i){n=cw(n),r.context===null?r.context=n:r.pendingContext=n,r=zr(t),r.payload={element:a},i=i===void 0?null:i,i!==null&&(r.callback=i),a=Rr(e,r,t),a!==null&&(Kt(a,e,t),yo(a,e,t))}function kh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function hd(e,t){kh(e,t),(e=e.alternate)&&kh(e,t)}function pw(e){if(e.tag===13||e.tag===31){var t=hi(e,67108864);t!==null&&Kt(t,e,67108864),hd(e,67108864)}}function Sh(e){if(e.tag===13||e.tag===31){var t=la();t=Cp(t);var a=hi(e,t);a!==null&&Kt(a,e,t),hd(e,t)}}var Ts=!0;function o_(e,t,a,r){var n=ce.T;ce.T=null;var i=Ae.p;try{Ae.p=2,gd(e,t,a,r)}finally{Ae.p=i,ce.T=n}}function l_(e,t,a,r){var n=ce.T;ce.T=null;var i=Ae.p;try{Ae.p=8,gd(e,t,a,r)}finally{Ae.p=i,ce.T=n}}function gd(e,t,a,r){if(Ts){var n=_p(r);if(n===null)Nu(e,t,r,zs,a),Nh(e,r);else if(c_(n,e,t,a,r))r.stopPropagation();else if(Nh(e,r),t&4&&-1<s_.indexOf(e)){for(;n!==null;){var i=_n(n);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var o=Wr(i.pendingLanes);if(o!==0){var l=i;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var c=1<<31-oa(o);l.entanglements[1]|=c,o&=~c}Ha(i),(Re&6)===0&&(ys=ia()+500,Fo(0,!1))}}break;case 31:case 13:l=hi(i,2),l!==null&&Kt(l,i,2),$s(),hd(i,2)}if(i=_p(r),i===null&&Nu(e,t,r,zs,a),i===n)break;n=i}n!==null&&r.stopPropagation()}else Nu(e,t,r,null,a)}}function _p(e){return e=Tp(e),bd(e)}var zs=null;function bd(e){if(zs=null,e=Vi(e),e!==null){var t=Yo(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=zh(t),e!==null)return e;e=null}else if(a===31){if(e=Rh(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 zs=e,null}function dw(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(P0()){case Oh:return 2;case Bh:return 8;case os:case J0:return 32;case Lh:return 268435456;default:return 32}default:return 32}}var xp=!1,Dr=null,Or=null,Br=null,Go=new Map,jo=new Map,kr=[],s_="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 Nh(e,t){switch(e){case"focusin":case"focusout":Dr=null;break;case"dragenter":case"dragleave":Or=null;break;case"mouseover":case"mouseout":Br=null;break;case"pointerover":case"pointerout":Go.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":jo.delete(t.pointerId)}}function so(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=_n(t),t!==null&&pw(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function c_(e,t,a,r,n){switch(t){case"focusin":return Dr=so(Dr,e,t,a,r,n),!0;case"dragenter":return Or=so(Or,e,t,a,r,n),!0;case"mouseover":return Br=so(Br,e,t,a,r,n),!0;case"pointerover":var i=n.pointerId;return Go.set(i,so(Go.get(i)||null,e,t,a,r,n)),!0;case"gotpointercapture":return i=n.pointerId,jo.set(i,so(jo.get(i)||null,e,t,a,r,n)),!0}return!1}function mw(e){var t=Vi(e.target);if(t!==null){var a=Yo(t);if(a!==null){if(t=a.tag,t===13){if(t=zh(a),t!==null){e.blockedOn=t,sf(e.priority,function(){Sh(a)});return}}else if(t===31){if(t=Rh(a),t!==null){e.blockedOn=t,sf(e.priority,function(){Sh(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 as(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=_p(e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Qu=r,a.target.dispatchEvent(r),Qu=null}else return t=_n(a),t!==null&&pw(t),e.blockedOn=a,!1;t.shift()}return!0}function Ch(e,t,a){as(e)&&a.delete(t)}function u_(){xp=!1,Dr!==null&&as(Dr)&&(Dr=null),Or!==null&&as(Or)&&(Or=null),Br!==null&&as(Br)&&(Br=null),Go.forEach(Ch),jo.forEach(Ch)}function Ql(e,t){e.blockedOn===t&&(e.blockedOn=null,xp||(xp=!0,bt.unstable_scheduleCallback(bt.unstable_NormalPriority,u_)))}var Gl=null;function qh(e){Gl!==e&&(Gl=e,bt.unstable_scheduleCallback(bt.unstable_NormalPriority,function(){Gl===e&&(Gl=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(bd(r||a)===null)continue;break}var i=_n(a);i!==null&&(e.splice(t,3),t-=3,ap(i,{pending:!0,data:n,method:a.method,action:r},r,n))}}))}function vn(e){function t(c){return Ql(c,e)}Dr!==null&&Ql(Dr,e),Or!==null&&Ql(Or,e),Br!==null&&Ql(Br,e),Go.forEach(t),jo.forEach(t);for(var a=0;a<kr.length;a++){var r=kr[a];r.blockedOn===e&&(r.blockedOn=null)}for(;0<kr.length&&(a=kr[0],a.blockedOn===null);)mw(a),a.blockedOn===null&&kr.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[Pt]||null;if(typeof i=="function")o||qh(a);else if(o){var l=null;if(i&&i.hasAttribute("formAction")){if(n=i,o=i[Pt]||null)l=o.formAction;else if(bd(n)!==null)continue}else l=o.action;typeof l=="function"?a[r+1]=l:(a.splice(r,3),r-=3),qh(a)}}}function fw(){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 wd(e){this._internalRoot=e}Zs.prototype.render=wd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));var a=t.current,r=la();uw(a,r,e,t,null,null)};Zs.prototype.unmount=wd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;uw(e.current,2,null,e,null,null),$s(),t[yn]=null}};function Zs(e){this._internalRoot=e}Zs.prototype.unstable_scheduleHydration=function(e){if(e){var t=Yh();e={blockedOn:null,target:e,priority:t};for(var a=0;a<kr.length&&t!==0&&t<kr[a].priority;a++);kr.splice(a,0,e),a===0&&mw(e)}};var Eh=Mh.version;if(Eh!=="19.2.3")throw Error(B(527,Eh,"19.2.3"));Ae.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=j0(t),e=e!==null?Ah(e):null,e=e===null?null:e.stateNode,e};var p_={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:ce,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(co=__REACT_DEVTOOLS_GLOBAL_HOOK__,!co.isDisabled&&co.supportsFiber))try{$o=co.inject(p_),na=co}catch{}var co;Ks.createRoot=function(e,t){if(!Th(e))throw Error(B(299));var a=!1,r="",n=nb,i=ob,o=lb;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=sw(e,1,!1,null,null,a,r,null,n,i,o,fw),e[yn]=t.current,dd(e),new wd(t)};Ks.hydrateRoot=function(e,t,a){if(!Th(e))throw Error(B(299));var r=!1,n="",i=nb,o=ob,l=lb,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=sw(e,1,!0,t,a??null,r,n,c,i,o,l,fw),t.context=cw(null),a=t.current,r=la(),r=Cp(r),n=zr(r),n.callback=null,Rr(a,n,r),a=r,t.current.lanes=a,Xo(t,a),Ha(t),e[yn]=t.current,dd(e),new Zs(t)};Ks.version="19.2.3"});var ww=Ra((Kx,bw)=>{"use strict";function gw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(gw)}catch(e){console.error(e)}}gw(),bw.exports=hw()});var mv=Ra(Fs=>{"use strict";var __=Symbol.for("react.transitional.element"),x_=Symbol.for("react.fragment");function dv(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:__,type:e,key:r,ref:t!==void 0?t:null,props:a}}Fs.Fragment=x_;Fs.jsx=dv;Fs.jsxs=dv});var W=Ra((x2,fv)=>{"use strict";fv.exports=mv()});var u0=$(ww());var vw=`/* 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
|
|
|
@@ -6967,13 +6967,13 @@ Error generating stack: `+r.message+`
|
|
|
6967
6967
|
grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr);
|
|
6968
6968
|
}
|
|
6969
6969
|
}
|
|
6970
|
-
`;var He=$(Ye());var Ps={};function
|
|
6971
|
-
`).map(t=>t.trim()).filter(Boolean);function
|
|
6972
|
-
`).filter(
|
|
6970
|
+
`;var He=$(Ye());var Ps={};function yw(e){Ps={...e,client:e.client?.trim().toUpperCase()||void 0}}function Dt(){return Ps}function vd(){return!!Ps.apiBaseUrl}var m_=e=>e.replace(/\/$/,"");function Ma(e){let t=Ps.apiBaseUrl;return t?`${m_(t)}${e.replace(/^\/api\//,"/v1/")}`:e}var qn=$(Ye());var f_="metron:step",h_="metron_step",tl=(0,qn.createContext)(()=>{}),En=()=>(0,qn.useContext)(tl);function Js(e,t){return(0,qn.useCallback)((a,r={})=>{let n=Dt(),i=n.analytics??"all";if(i==="none")return;let o={...r,widget:e,step:a};t.current?.dispatchEvent(new CustomEvent(f_,{detail:o,bubbles:!0,composed:!0})),n.onEvent?.(o);let l=window.dataLayer;i==="all"&&Array.isArray(l)&&l.push({event:h_,...o})},[e,t])}var _w="boq-session-id",xw="x-boq-session";function kw(){if(typeof window>"u")return"server";try{let e=window.localStorage.getItem(_w);return e||(e=crypto.randomUUID(),window.localStorage.setItem(_w,e)),e}catch{return crypto.randomUUID()}}var g_="x-boq-client";function Is(){return Dt().client}function Mn(){let{client:e,apiKey:t}=Dt();return vd()?t?{Authorization:`Bearer ${t}`}:{}:e?{[g_]:e}:{}}function bi(){return{...vd()?{}:{[xw]:kw()},...Mn()}}function b_(e){return e&&typeof e=="object"&&e.success===!0&&"data"in e?e.data:e}async function Qa(e){return b_(await e.json().catch(()=>({})))}var Sw=9e4;async function Nw(e,t){let a=new AbortController,r=setTimeout(()=>a.abort(),Sw),n;try{n=await fetch(e,{...t,signal:a.signal})}catch(o){throw o?.name==="AbortError"?new Error(`Request to ${e} timed out after ${Sw/1e3}s. Please try again.`):o}finally{clearTimeout(r)}let i=await Qa(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 Cw(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"),Nw(Ma("/api/schedule"),{method:"POST",body:r,headers:bi()})}function qw(e,t){let a=t?`?account=${encodeURIComponent(t)}`:"";return Nw(Ma(`/api/schedule/${e}${a}`),{headers:Mn()})}function Ew(e,t,a,r){let n=!1,i=null,o=performance.now();return{promise:new Promise((p,f)=>{let h=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)`),p(d);return}a?.(),i=setTimeout(h,t)}catch(d){n||f(d)}};i=setTimeout(h,t)}),cancel:()=>{n=!0,i&&(clearTimeout(i),i=null)}}}var Nt=$(Ye());var Mw=new URL("../assets/decking/boards/diagonal.webp",import.meta.url).href;var Tw=new URL("../assets/decking/boards/no-border.webp",import.meta.url).href;var zw=new URL("../assets/decking/boards/picture-frame.webp",import.meta.url).href;var Rw=new URL("../assets/decking/boards/straight.webp",import.meta.url).href;var Aw=new URL("../assets/fencing/gates/no-gate.webp",import.meta.url).href;var Uw=new URL("../assets/fencing/gates/single-gate.webp",import.meta.url).href;var Dw=new URL("../assets/fencing/gravel-board.webp",import.meta.url).href;var Ow=new URL("../assets/fencing/height/0.9.webp",import.meta.url).href;var Bw=new URL("../assets/fencing/height/1.2.webp",import.meta.url).href;var Lw=new URL("../assets/fencing/height/1.5.webp",import.meta.url).href;var Hw=new URL("../assets/fencing/height/1.8.webp",import.meta.url).href;var Qw=new URL("../assets/fencing/no-gravel-board.webp",import.meta.url).href;var Gw=new URL("../assets/quick-order/paste-list.webp",import.meta.url).href;var jw=new URL("../assets/quick-order/photo-list.webp",import.meta.url).href;var Yw=new URL("../assets/quick-order/upload-file.webp",import.meta.url).href;var $w=new URL("../assets/schedule-products/building-sand.webp",import.meta.url).href;var Vw=new URL("../assets/schedule-products/drywall-screws.webp",import.meta.url).href;var Xw=new URL("../assets/schedule-products/loft-insulation-roll.webp",import.meta.url).href;var Zw=new URL("../assets/schedule-products/red-multi-stock-bricks.webp",import.meta.url).href;var Kw=new URL("../assets/schedule-products/scrim-tape.webp",import.meta.url).href;var Pw=new URL("../assets/schedule-products/wall-ties.webp",import.meta.url).href;var Jw=new URL("../assets/tool-images/architrave.webp",import.meta.url).href;var Iw=new URL("../assets/tool-images/brick-block.webp",import.meta.url).href;var Fw=new URL("../assets/tool-images/concrete-aggregate.webp",import.meta.url).href;var Ww=new URL("../assets/tool-images/decking.webp",import.meta.url).href;var ev=new URL("../assets/tool-images/fencing.webp",import.meta.url).href;var tv=new URL("../assets/tool-images/insulation.webp",import.meta.url).href;var av=new URL("../assets/tool-images/paint.webp",import.meta.url).href;var rv=new URL("../assets/tool-images/paving.webp",import.meta.url).href;var iv=new URL("../assets/tool-images/plasterboard.webp",import.meta.url).href;var nv=new URL("../assets/tool-images/skirting.webp",import.meta.url).href;var ov=new URL("../assets/tool-images/timber.webp",import.meta.url).href;var lv=new URL("../assets/tool-images/truss.webp",import.meta.url).href;var Ee=e=>typeof e=="string"?e:e.src,w_={"/decking/boards/diagonal.webp":Ee(Mw),"/decking/boards/no-border.webp":Ee(Tw),"/decking/boards/picture-frame.webp":Ee(zw),"/decking/boards/straight.webp":Ee(Rw),"/fencing/gates/no-gate.webp":Ee(Aw),"/fencing/gates/single-gate.webp":Ee(Uw),"/fencing/gravel-board.webp":Ee(Dw),"/fencing/height/0.9.webp":Ee(Ow),"/fencing/height/1.2.webp":Ee(Bw),"/fencing/height/1.5.webp":Ee(Lw),"/fencing/height/1.8.webp":Ee(Hw),"/fencing/no-gravel-board.webp":Ee(Qw),"/quick-order/paste-list.webp":Ee(Gw),"/quick-order/photo-list.webp":Ee(jw),"/quick-order/upload-file.webp":Ee(Yw),"/schedule-products/building-sand.webp":Ee($w),"/schedule-products/drywall-screws.webp":Ee(Vw),"/schedule-products/loft-insulation-roll.webp":Ee(Xw),"/schedule-products/red-multi-stock-bricks.webp":Ee(Zw),"/schedule-products/scrim-tape.webp":Ee(Kw),"/schedule-products/wall-ties.webp":Ee(Pw),"/tool-images/architrave.webp":Ee(Jw),"/tool-images/brick-block.webp":Ee(Iw),"/tool-images/concrete-aggregate.webp":Ee(Fw),"/tool-images/decking.webp":Ee(Ww),"/tool-images/fencing.webp":Ee(ev),"/tool-images/insulation.webp":Ee(tv),"/tool-images/paint.webp":Ee(av),"/tool-images/paving.webp":Ee(rv),"/tool-images/plasterboard.webp":Ee(iv),"/tool-images/skirting.webp":Ee(nv),"/tool-images/timber.webp":Ee(ov),"/tool-images/truss.webp":Ee(lv)};function It(e){return w_[e]??e}var Tn={schedule:[".xlsx",".xls",".csv",".pdf",".docx"],photo:[".png",".jpg",".jpeg",".webp",".gif",".bmp",".heic",".heif"],email:[".eml",".msg"]};var cv=(e,t)=>Tn[t].some(a=>e.toLowerCase().endsWith(a)),zn=e=>e.type.startsWith("image/")||cv(e.name,"photo"),v_=e=>zn(e)||cv(e.name,"schedule"),sv=e=>`${Math.max(.1,Math.round(e/1048576*10)/10)} MB`;function yd(e,t=5242880){return v_(e)?e.size===0?"That file is empty.":e.size>t?`That file is ${sv(e.size)} - the limit is ${sv(t)}.`:null:`Please upload a list or image file (${[...Tn.schedule,...Tn.photo].join(", ")}).`}var y_=e=>e.split(`
|
|
6971
|
+
`).map(t=>t.trim()).filter(Boolean);function uv(e){let t=y_(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 pv(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=$(Ye());var ec=$(Ye()),Ws=$(W()),k_=[4,5,4],_d=4e3;function wi(){let[e,t]=(0,ec.useState)(0);(0,ec.useEffect)(()=>{let r=setInterval(()=>t(n=>n+1),_d);return()=>clearInterval(r)},[]);let a=0;return(0,Ws.jsx)("div",{className:"brick-wall","aria-hidden":!0,children:k_.map((r,n)=>(0,Ws.jsx)("div",{className:"brick-wall__course",children:Array.from({length:r},(i,o)=>(0,Ws.jsx)("span",{className:`brick-wall__brick${r===5&&(o===0||o===4)?" brick-wall__brick--half":""}`,style:{"--i":a++}},o))},n))},e)}var al=$(W()),tc=["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 hv(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 gv(){let e=(0,$r.useRef)(0),t=(0,$r.useRef)(hv(tc.map((o,l)=>l))),[a,r]=(0,$r.useState)(tc[t.current[0]]),[n,i]=(0,$r.useState)(!0);return(0,$r.useEffect)(()=>{let o=setInterval(()=>{i(!1),window.setTimeout(()=>{e.current++,e.current>=t.current.length&&(t.current=hv(tc.map((l,c)=>c)),e.current=0),r(tc[t.current[e.current]]),i(!0)},600)},_d);return()=>clearInterval(o)},[]),(0,al.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",children:[(0,al.jsx)(wi,{}),(0,al.jsx)("p",{className:`banter-message${n?" is-visible":""}`,children:a})]})}var ac=$(Ye());function rl(e,t){let a=(0,ac.useRef)(t);a.current=t,(0,ac.useEffect)(()=>{if(!e)return;let r=n=>{n.key!=="Escape"||n.defaultPrevented||n.isComposing||(n.preventDefault(),a.current())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e])}var xd={"#quote-entry":"entry","#matched-products":"results","#quote-request":"basket"},bv=!1,ic="",kd=!1,wv=()=>window.navigation,rc=-1;function S_(){if(kd)return-1;let e=wv()?.currentEntry?.index;return e==null||rc<0||e===rc?0:e<rc?-1:1}function N_(e){let t=new URL(ic||window.location.href),a=new URL(window.location.href);if(ic=a.href,t.pathname!==a.pathname||t.search!==a.search||!(t.hash in xd)&&!(a.hash in xd))return;let r=t.href===a.href?S_():0;if(r){e.stopImmediatePropagation(),window.history.go(r);return}kd=!1;let n=e.state;Object.defineProperty(e,"state",{value:null}),setTimeout(()=>{if(window.location.href!==a.href)return;let i=xd[a.hash],o=i&&n?.turbo?{boqQuoteStage:i}:n;JSON.stringify(window.history.state)!==JSON.stringify(o)&&window.history.replaceState(o,"",a.href)})}function vv(){bv||typeof window>"u"||(bv=!0,ic=window.location.href,window.addEventListener("popstate",N_,{capture:!0}),wv()?.addEventListener("currententrychange",e=>{rc=e.from?.index??-1}))}function Rn(e,t,a){window.history[e](t,"",a),ic=window.location.href}function nc(){kd=!0,window.history.back()}var Sd=$(W());function Qt(){return(0,Sd.jsx)("svg",{className:"forward-arrow",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Sd.jsx)("path",{d:"M3 8H13M13 8L9 4M13 8L9 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var Nd=$(W());function il(){return(0,Nd.jsx)("svg",{className:"close-icon",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,Nd.jsx)("path",{d:"M3.5 3.5L12.5 12.5M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}var I=$(W()),C_=[...Tn.schedule,...Tn.photo].join(","),q_={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."}]},An="#quote-entry",oc="metron-quick-quote-entry";function Cd({onPasteSchedule:e,onUploadSchedule:t,onEntryModeChange:a,draft:r,onSubmitDraft:n,onCancelMatch:i}){let o=(0,Nt.useRef)(null),l=En(),c=(0,Nt.useRef)(0),p=(0,Nt.useRef)(0),[f,h]=(0,Nt.useState)(()=>r&&typeof window<"u"&&window.location.hash===An?r.tab:null),[d,g]=(0,Nt.useState)(r?.text??""),[y,R]=(0,Nt.useState)(r?.file??null),[L,m]=(0,Nt.useState)(""),[u,b]=(0,Nt.useState)(!1),[w,v]=(0,Nt.useState)(!1),[M,T]=(0,Nt.useState)(null),A=d.split(`
|
|
6972
|
+
`).filter(K=>K.trim()).length,G=uv(d),Y=f==="paste"?!!d:!!y;(0,Nt.useEffect)(()=>{if(!y||!zn(y)){T(null);return}let K=URL.createObjectURL(y);return T(K),()=>URL.revokeObjectURL(K)},[y]);let V=(0,Nt.useRef)(f??r?.tab??null);f&&(V.current=f),(0,Nt.useEffect)(()=>{if(r||window.location.hash!==An)return;let K=null;try{K=JSON.parse(window.sessionStorage.getItem(oc)??"null")}catch{}if(!K?.tab){let ue=new URL(window.location.href);ue.hash="",Rn("replaceState",window.history.state,ue);return}V.current=K.tab,h(K.tab),g(K.text??"")},[]),(0,Nt.useEffect)(()=>{if(f)try{window.sessionStorage.setItem(oc,JSON.stringify({tab:f,text:d}))}catch{}},[f,d]),(0,Nt.useEffect)(()=>{let K=()=>{if(window.location.hash===An)return h(V.current);h(null),p.current++,b(!1),i?.()};return window.addEventListener("popstate",K),()=>window.removeEventListener("popstate",K)},[]);let se=K=>{l("method_selected",{method:K}),h(K),m(""),a(null);let ue=window.location.hash;if(ue===An)return;let Me=new URL(window.location.href);Me.hash=An,Rn(ue==="#matched-products"||ue==="#quote-request"?"replaceState":"pushState",{boqQuoteStage:"entry"},Me)},ge=()=>{h(null),a(null),window.location.hash===An&&nc()};rl(!!f&&!u,ge);let Ze=K=>{if(!K?.length)return;if(K.length>1)return m("Please choose one file at a time.");let ue=K[0],Me=yd(ue,zn(ue)?1/0:void 0);if(Me)return m(Me);m(""),R(ue)},Ue=async K=>{f==="paste"&&R(null),f==="upload"&&g(""),f&&n?.({tab:f,text:f==="paste"?d:"",file:f==="upload"?y:null});let ue=++p.current;m(""),b(!0);try{await K()}catch(Me){ue===p.current&&m(Me?.message||"Failed to process your list")}finally{ue===p.current&&b(!1)}},ve=()=>{if(y)return l("list_submitted",{method:zn(y)?"photo":"upload"}),Ue(async()=>{if(!zn(y))return t(y);let K;try{K=await pv(y);let ue=yd(K);if(ue)throw new Error(ue)}catch(ue){throw l("error",{stage:"photo"}),ue}await t(K)})},le=K=>K.dataTransfer.types.includes("Files"),ot=K=>{le(K)&&(K.preventDefault(),c.current+=1,v(!0))},ze=K=>{le(K)&&(c.current-=1,c.current<=0&&(c.current=0,v(!1)))},wt=K=>{le(K)&&(K.preventDefault(),c.current=0,v(!1),Ze(K.dataTransfer.files),se("upload"))};return(0,I.jsxs)("div",{className:"wizard-step entry-stage",onDragEnter:ot,onDragOver:K=>le(K)&&K.preventDefault(),onDragLeave:ze,onDrop:wt,children:[w&&(0,I.jsx)("div",{className:"entry-drop-overlay","aria-hidden":"true",children:"Drop your file to upload"}),(0,I.jsxs)("div",{className:"quick-order-card",children:[(0,I.jsxs)("div",{className:"quick-order-alt",children:[(0,I.jsxs)("div",{className:"quick-order-entry-copy",children:[(0,I.jsx)("div",{className:"quick-order-alt-title",children:"How would you like to get started?"}),(0,I.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,I.jsxs)("div",{className:"entry-options entry-options--workflow entry-options--two",children:[(0,I.jsxs)("button",{type:"button",className:`entry-option-card entry-option-card--paste${f==="paste"?" entry-option-card--active":""}`,onClick:()=>se("paste"),children:[(0,I.jsxs)("span",{className:"entry-option-content",children:[(0,I.jsx)("span",{className:"entry-option-title",children:"Type or paste a list"}),(0,I.jsx)("span",{className:"entry-option-desc",children:"Enter your materials and quantities"})]}),(0,I.jsx)("span",{className:"entry-option-media entry-option-media--paste","aria-hidden":"true",children:(0,I.jsx)("img",{className:"fill-img",src:It("/quick-order/paste-list.webp"),alt:""})})]}),(0,I.jsxs)("button",{type:"button",className:`entry-option-card entry-option-card--upload${f==="upload"?" entry-option-card--active":""}`,onClick:()=>se("upload"),children:[(0,I.jsxs)("span",{className:"entry-option-content",children:[(0,I.jsx)("span",{className:"entry-option-title",children:"Upload a file"}),(0,I.jsx)("span",{className:"entry-option-desc",children:"A photo, spreadsheet, Word document or PDF"})]}),(0,I.jsx)("span",{className:"entry-option-media entry-option-media--upload","aria-hidden":"true",children:(0,I.jsx)("img",{className:"fill-img",src:It("/quick-order/photo-list.webp"),alt:""})})]})]})]}),f&&(0,I.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop",role:"dialog","aria-modal":"true","aria-labelledby":"quick-order-workflow-title",onClick:()=>!Y&&ge(),children:(0,I.jsxs)("section",{className:`quick-order-workflow-modal${u?" quick-order-workflow-modal--matching":""}`,onClick:K=>K.stopPropagation(),children:[(0,I.jsxs)("header",{className:"quick-order-workflow-modal-header",children:[(0,I.jsx)("h2",{id:"quick-order-workflow-title",children:f==="paste"?"Type or paste a list":"Upload a file"}),(0,I.jsx)("button",{type:"button",className:"quick-order-workflow-close",onClick:ge,"aria-label":"Close",children:(0,I.jsx)(il,{})})]}),(0,I.jsxs)("div",{className:"quick-order-panel",children:[(0,I.jsxs)("div",{className:"quick-order-body","aria-hidden":u,children:[(0,I.jsx)("div",{className:"quick-order-body-main",children:f==="paste"?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("textarea",{className:"paste-textarea",placeholder:`Paste your line items here, one per line, e.g.
|
|
6973
6973
|
insulated plasterboard 50mm
|
|
6974
|
-
C24 timber 4.8m`,value:d,onChange:Z=>b(Z.target.value),"aria-label":"Paste schedule line items"}),(A||O)&&(0,J.jsxs)("div",{className:"error-box",role:"alert",children:[(0,J.jsx)("strong",{children:"Error:"})," ",A||O]}),(0,J.jsxs)("div",{className:"quick-order-hint",children:[(0,J.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,J.jsx)("div",{className:"quick-order-actions",children:(0,J.jsxs)("button",{type:"button",className:"cta-btn",disabled:!U||!!A,onClick:()=>{l("list_submitted",{method:"paste",lines:U}),Ue(()=>e(d))},"aria-label":"Match pasted lines",children:[(0,J.jsx)("span",{children:"Match line items"}),(0,J.jsx)("span",{className:"arrow",children:(0,J.jsx)(Qt,{})})]})})]}):(0,J.jsxs)(J.Fragment,{children:[O&&(0,J.jsxs)("div",{className:"error-box",role:"alert",children:[(0,J.jsx)("strong",{children:"Error:"})," ",O]}),(0,J.jsxs)("div",{className:`upload-zone${v?" has-file":""}`,onClick:()=>o.current?.click(),onDragOver:Z=>Z.preventDefault(),onDrop:wt,role:"button",tabIndex:0,onKeyDown:Z=>(Z.key==="Enter"||Z.key===" ")&&o.current?.click(),"aria-label":"Upload zone: click or drag a list or image file here",children:[T?(0,J.jsx)("img",{src:T,alt:v?.name??"Selected photo",className:"upload-zone-photo-preview"}):(0,J.jsx)("div",{className:"upload-zone-icon",children:(0,J.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,J.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,J.jsx)("polyline",{points:"14,2 14,8 20,8"}),(0,J.jsx)("polyline",{points:"9,15 11,17 15,13"})]})}),v?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)("div",{className:"upload-zone-subtext",children:v.name}),(0,J.jsx)("button",{type:"button",className:"link-btn link-btn--underline",onClick:Z=>{Z.stopPropagation(),q(null),f(""),o.current&&(o.current.value="")},children:"Remove"})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)("div",{className:"upload-zone-text",children:"Drop a photo, spreadsheet, Word document or PDF"}),(0,J.jsx)("div",{className:"upload-zone-subtext",children:"or click to choose a file"})]}),(0,J.jsx)("input",{ref:o,type:"file",accept:C_,className:"visually-hidden",onChange:Z=>Ze(Z.target.files),tabIndex:-1,"aria-hidden":"true"})]}),(0,J.jsx)("div",{className:"quick-order-actions",children:(0,J.jsxs)("button",{type:"button",className:"cta-btn",disabled:!v,onClick:()=>{be()},"aria-label":"Match uploaded items",children:[(0,J.jsx)("span",{children:"Match items"}),(0,J.jsx)("span",{className:"arrow",children:(0,J.jsx)(Qt,{})})]})})]})}),(0,J.jsx)("aside",{className:"quick-order-sidebar",children:q_[m].map((Z,ce)=>(0,J.jsxs)("div",{className:"quick-order-step quick-order-step--rail",children:[(0,J.jsx)("span",{className:"quick-order-step-dot",children:ce+1}),(0,J.jsxs)("div",{children:[(0,J.jsx)("div",{className:"quick-order-step-title",children:Z.title}),(0,J.jsx)("div",{className:"quick-order-step-desc",children:Z.desc})]})]},Z.title))})]}),u&&(0,J.jsx)("div",{className:"quick-order-matching-overlay",children:(0,J.jsx)(hv,{})})]})]})})]})]})}var zt=$(Ye()),yv=$(F());function Un(e){return JSON.stringify([e.productId,e.qty,e.unit,e.linkedContext??[]])}function E_(e,t){let a={...e,[t.lineId]:t};for(let[r,i]of Object.entries(a)){if(!i.linkedContext)continue;let n=i.linkedContext.find(l=>l.role==="anchor"&&l.line_id&&a[l.line_id]),o=n?.line_id?a[n.line_id]:void 0;if(!(!n||!o||n.product_id===o.productId&&n.description===o.description)){if(i.conversionType!=="basket_line_unit"){a[r]={...i,linkedContext:i.linkedContext.map(l=>l.line_id===n.line_id?{...l,product_id:o.productId,measurements_mm:o.measurementsMm??[],description:o.description}:l)};continue}a[r]={...i,qty:0,sellUnitsOverride:null,linkedContext:i.linkedContext.map(l=>l.line_id===n.line_id?{...l,product_id:o.productId,measurements_mm:o.measurementsMm??[],description:o.description}:l),conversionType:null,requestUomsSupported:null,salesUomNormalised:null,salesUnitSize:null,salesUnitSizeUom:null,coverageQty:null,coverageUom:null,roundingRule:null,conversionConfidence:null,conversionNotes:null}}}return a}var qd=(0,zt.createContext)(null);function lc({children:e,onOpenBasket:t}){let[a,r]=(0,zt.useState)({}),i=(0,zt.useCallback)(d=>{r(b=>E_(b,d))},[]),n=(0,zt.useCallback)(d=>{r(b=>{let v={...b};for(let q of d)v[q.lineId]=q;return v})},[]),o=(0,zt.useCallback)(d=>{r(b=>{let v={...b};return delete v[d],v})},[]),l=(0,zt.useCallback)((d,b)=>{r(v=>v[d]?{...v,[d]:{...v[d],qty:b,sellUnitsOverride:null}}:v)},[]),c=(0,zt.useCallback)((d,b)=>{r(v=>v[d]?{...v,[d]:{...v[d],sellUnitsOverride:b}}:v)},[]),p=(0,zt.useCallback)(d=>{r(b=>{let v=!1,q={...b};for(let[O,f]of Object.entries(d))q[O]&&(q[O]={...q[O],...f},v=!0);return v?q:b})},[]),m=(0,zt.useCallback)(()=>r({}),[]),h=(0,zt.useMemo)(()=>({cart:a,count:Object.keys(a).length,addToCart:i,addManyToCart:n,removeFromCart:o,updateCartQty:l,updateCartSellUnits:c,updateCartConversions:p,clearCart:m,openBasket:t??(()=>{})}),[a,i,n,o,l,c,p,m,t]);return(0,yv.jsx)(qd.Provider,{value:h,children:e})}function Dn(){let e=(0,zt.useContext)(qd);if(!e)throw new Error("useCart must be used inside a <CartProvider>");return e}function vv(){return(0,zt.useContext)(qd)}var mt=$(Ye());function vi(e){return e===0?"-":Number.isInteger(e)?e.toString():e<1?e.toFixed(2):e.toFixed(1)}function nt(e){return`\xA3${e.toLocaleString("en-GB",{minimumFractionDigits:2,maximumFractionDigits:2})}`}var Nv=e=>(e??"").trim().toLowerCase(),M_={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",piece:"each",pieces:"each",board:"sheet",bags:"bag",length:"length",lengths:"length",pallet:"pallet",pallets:"pallet"},Ed=new Set(["sheet","length","box","bag","pack","roll","set","tub","each"]),_v=new Set(["box","bag","pack","pallet","roll","set","tub"]),Md=(e,t)=>t==="ml"?e:["l","litre","litres"].includes(t)?e*1e3:null,Td=(e,t)=>t==="g"?e:["kg","kilogram","kilograms"].includes(t)?e*1e3:["t","tonne","tonnes"].includes(t)?e*1e6:null,mr=e=>{let t=Nv(e);return M_[t]??t},at=(e,t)=>{let a=mr(e),r=mr(t);return a.length>0&&a===r},xv=(e,t)=>{let a=Nv(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},T_=e=>(e??"").split(",").map(t=>mr(t)).filter(Boolean),z_=(e,t)=>{let a=T_(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)},kv=(e,t)=>at(t,"pallet")?e.itemsPerPallet??null:at(t,"pack")?e.itemsPerPack??null:at(t,"box")?e.itemsPerBox??null:null,Sv=(e,t)=>{let a=t==="volume"?/(\d+(?:[.,]\d+)?)\s*(ml|l|ltr|ltrs|litres?|liters?)\b/i:/(\d+(?:[.,]\d+)?)\s*(kg|kgs|tonnes?)\b/i,r=e.description.match(a);if(!r)return null;let i=Number.parseFloat(r[1].replace(",","."));if(!Number.isFinite(i)||i<=0)return null;let n=r[2].toLowerCase();return t==="volume"?{ml:n==="ml"?i:i*1e3}:{g:n.startsWith("tonne")?i*1e6:i*1e3}},R_=["volume_from_description","same_unit_volume"],A_=["weight_from_description","mass_from_pack","same_unit_mass"],U_=(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 i=Number.parseFloat(r[1].replace(",","."));return Number.isFinite(i)&&i>0?i:null};function sc(e,t){let a=e.map(r=>Ft(r,t).lineTotal);return a.some(r=>r==null)?null:a.reduce((r,i)=>r+(i??0),0)}function Ft(e,t){let a=D_(e,t);return a.sellUnit==="bag"&&a.requestedUnit!=="bag"&&/\bbulk bag\b/i.test(e.description)?{...a,sellUnit:"bulk bag"}:a}function D_(e,t){let a=e.qty,r=mr(e.saleUnit??e.salesUnitSizeUom??e.uoi??e.salesUomNormalised)||"-",i=mr(e.unit)||(a>0&&Ed.has(r)?r:"-"),n=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?Ed.has(r)?Math.ceil(e.sellUnitsOverride):e.sellUnitsOverride:null,p=A=>({requestedAmount:a,requestedUnit:i,salesUnitSize:e.salesUnitSize??e.uoiCount??null,sellUnit:r,calculatedSellUnits:null,requiredSellUnits:c,unitPrice:e.price,lineTotal:e.price!=null&&c!=null?e.price*c:null,calculation:c!=null?`${A} Order quantity set to ${c} ${r}.`:A,costingMode:"review"});if(!Number.isFinite(a)||a<=0)return p("Quantity needs confirmation.");let m=Md(a,i),h=Td(a,i),d=at(i,r)?null:m!=null&&!R_.includes(e.conversionType??"")?Sv(e,"volume"):h!=null&&!A_.includes(e.conversionType??"")?Sv(e,"weight"):null,b=d?.ml!=null?m:h,v=d?.ml??d?.g??null;if(b!=null&&v!=null){let A=mr(e.uoi)||r,Q=d?.ml!=null?`${v/1e3} l`:`${v/1e3} kg`,ie=l?c:Math.ceil(b*(1+o)/v-1e-9);return{requestedAmount:a,requestedUnit:i,salesUnitSize:1,sellUnit:A,calculatedSellUnits:ie,requiredSellUnits:ie,unitPrice:e.price,lineTotal:e.price!=null?e.price*ie:null,calculation:`${a} ${i}${o>0?` x ${1+o}`:""} / ${Q} per ${A} (from product description) = ${ie} ${A}`,costingMode:"derived"}}if(i==="sales_unit"){let A=mr(e.uoi)||r,Q=l?c:xv(a*(1+o),e.roundingRule??"round_up_each");return{requestedAmount:a,requestedUnit:A,salesUnitSize:1,sellUnit:A,calculatedSellUnits:Q,requiredSellUnits:Q,unitPrice:e.price,lineTotal:e.price!=null?e.price*Q:null,calculation:`${a} ${A}${o>0?` x ${1+o}`:""} = ${Q} ${A}`,costingMode:"direct"}}if(!z_(e,i))return p("Requested unit is not supported by this catalogue conversion.");let q=null,O="review",f=e.roundingRule,u=`Quantity review required, initial request needed ${a} ${i}.`,g=1+o,w=U_(e,i,r),k=e.unitConversions?.find(A=>at(A.requestUom,i));if(!!e.saleUnit&&(at(i,r)||!!k||at(i,"each")&&!_v.has(r)))if(at(i,r))q=a*g/n,O="direct",u=`${a} ${i}${o>0?` x ${g}`:""}`;else if(k){q=a*g/k.quantityPerSaleUnit,O="derived";let A=1/k.quantityPerSaleUnit,Q=Math.round(A);u=at(r,"each")&&k.quantityPerSaleUnit<1&&Math.abs(A-Q)<1e-9?`${a} ${i}${o>0?` x ${g}`:""} x ${Q} per ${i}`:`${a} ${i}${o>0?` x ${g}`:""} / ${k.quantityPerSaleUnit} ${i} per ${r}`}else at(i,"each")&&!_v.has(r)&&(q=a*g/n,O="derived",u=`${a} ${r}${o>0?` x ${g}`:""}`);else if(at(i,r)&&n>0)q=a*g/n,O="direct",u=o>0?`${a} ${i} x ${g} / ${n} ${r} per sell unit`:`${a} ${i} / ${n} ${r} per sell unit`;else if(at(i,"each")&&n>0&&Ed.has(r))q=a*g/n,O="derived",u=o>0?`${a} each x ${g} / ${n} each per ${r}`:`${a} each / ${n} each per ${r}`;else if(kv(e,i)!=null&&n>0){let A=kv(e,i)??0;q=a*A*g/n,O="derived";let Q=`${a} ${i} x ${A} each${o>0?` x ${g}`:""}`;u=n===1&&at(r,"each")?Q:`${Q} / ${n} each per ${r}`}else if(w!=null)q=a*g/w,O="derived",f??(f="round_up_each"),u=`${a} m2 x ${g} / ${w} m2 per ${r} (from product description)`;else if(e.conversionType==="basket_line_unit")n>0&&(q=a*g/n,O="derived",u=`${a} ${i}${o>0?` x ${g}`:""} / ${n} ${i} per ${r}`);else{if(e.conversionType==="count_only")return p(`Quantity review required, initial request needed ${a} ${i}.`);if(["area_from_dims","explicit_coverage_area","roll_area"].includes(e.conversionType??"")){let A=e.coverageQty??e.derivedCoverageM2??null;at(i,"m2")&&A!=null&&A>0&&(q=a*g/A,O="derived",u=`${a} m2 x ${g} / ${A} m2 per ${r}`)}else if(e.conversionType==="count_per_area"){let A=e.coverageQty??null;at(i,"m2")&&A!=null&&A>0?(q=a/A,O="derived",u=`${a} m2 / ${A} m2 per sell unit`):at(i,"m2")&&e.itemsPerM2!=null&&e.itemsPerM2>0&&n>0&&(q=a*e.itemsPerM2*g/n,O="derived",u=`${a} m2 x ${e.itemsPerM2} ${r}/m2 x ${g} / ${n}`)}else if(e.conversionType==="length_from_dims"){let A=e.coverageQty??e.derivedLengthM??null;at(i,"m")&&A!=null&&A>0&&(q=a*g/A,O="derived",u=`${a} m x ${g} / ${A} m per ${r}`)}else if(e.conversionType==="volume_from_description"){let A=Md(a,i),Q=Md(e.coverageQty??0,mr(e.coverageUom));A!=null&&Q!=null&&Q>0&&(q=A*g/Q,O="derived",u=`${a} ${i} x ${g} / ${e.coverageQty} ${e.coverageUom} per ${r}`)}else if(e.conversionType==="weight_from_description"||e.conversionType==="mass_from_pack"){let A=mr((e.coverageUom??"").split(" ")[0]),Q=Td(a,i),ie=Td(e.coverageQty??0,A);Q!=null&&ie!=null&&ie>0&&(q=Q*g/ie,O="derived",u=`${a} ${i} x ${g} / ${e.coverageQty} ${A} per ${r}`)}else if(e.conversionType==="same_unit_volume"){let A=e.coverageQty??null;at(i,"m3")&&A!=null&&A>0&&(q=a/A,O="derived",u=`${a} m3 / ${A} m3 per ${r}`)}}if(q==null||!Number.isFinite(q)||q<0)return p(`Quantity review required, initial request needed ${a} ${i}.`);let R=xv(q,f),U=l?c:R;return{requestedAmount:a,requestedUnit:i,salesUnitSize:n,sellUnit:r,calculatedSellUnits:R,requiredSellUnits:U,unitPrice:e.price,lineTotal:e.price!=null&&U!=null?e.price*U:null,calculation:l?`${u} = ${R} ${r} (manually set to ${U})`:`${u} = ${U} ${r}`,costingMode:O}}var nl=$(F());function zd({unit:e}){return(0,nl.jsx)(nl.Fragment,{children:e.split(/([²³])/).map((t,a)=>t==="\xB2"||t==="\xB3"?(0,nl.jsx)("span",{className:"unit-sup",children:t},a):t)})}var Cv=$(F());function O_(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 _a(e,t){let a=(e??"").trim();if(!a||a==="-")return"";let r=/^each$/i.test(a)?"unit":a;return t!=null?O_(r,t):r}function xa(e,t){let a=_a(e,t);return a?(0,Cv.jsx)(zd,{unit:a}):null}function ol(e){let t=(e??"").trim();if(!t)return"";let a=t.match(/^per\s+(.+)$/i);if(!a)return t;let r=_a(a[1]);return r?`per ${r}`:""}var qv=()=>import("./xlsx-K4MOA2QM.js"),sl=["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","Review required","Decision reason","Selected candidate ID","Selected candidate description","Price basis","Price","Line total","Confidence","Status"],B_=sl.indexOf("Line total");function L_(e){return e.unmatchable?"Not matched (labour/plant/referential)":e.best?"Selected":"Needs review"}async function Ev(e){let t=await qv(),a=t.utils.book_new(),r=new Date().toISOString().slice(0,10),i=[sl],n=0;for(let c of e){let{item:p,best:m,qty:h,band:d,unmatchable:b,decision:v}=c,q=[p.section,p.subsection,p.subheading].filter(Boolean).join(" / "),O=!b&&m?.price!=null?m.price*h:null;O!=null&&(n+=O),i.push([p.source_line_id,p.line_id,p.description_original||"(no description)",q,h,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(", "),m?"no":"yes",v?.reason??"",b?"-":m?.product_id??v?.selected_candidate_id??"-",b?"-":m?.description??"-",b?"-":m?.price_basis??"-",b?null:m?.price??null,O,b?"-":d,L_(c)])}i.push(Array(sl.length).fill(null));let o=Array(sl.length).fill(null);o[0]="Estimated total",o[B_]=n,i.push(o),i.push(["DISCLAIMER: These matches are generated automatically and should be reviewed before procurement, especially any items flagged as medium or low confidence.",...Array(sl.length-1).fill(null)]);let l=t.utils.aoa_to_sheet(i);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 ll=["Product ID","Description","Costing mode","Required amount","Req unit","Sell unit size","Sell unit","Required sell units","Unit price","Line total"];async function Mv(e,t){let a=await qv(),r=a.utils.book_new(),i=new Date().toISOString().slice(0,10),n=t?[["Account",t.name+" ("+t.id+")"],[],ll]:[ll],o=0;for(let p of e){let m=Ft(p),h=m.lineTotal;h!=null&&(o+=h),n.push([p.productId,p.description,m.costingMode,m.requestedAmount,_a(m.requestedUnit),m.salesUnitSize,_a(m.sellUnit),m.requiredSellUnits,m.unitPrice,h])}n.push(Array(ll.length).fill(null));let l=Array(ll.length).fill(null);l[0]="Estimated total",l[ll.length-1]=o,n.push(l);let c=a.utils.aoa_to_sheet(n);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}-${i}.xlsx`:`basket-${i}.xlsx`)}var Rd=$(F());function Vr(){return(0,Rd.jsx)("svg",{className:"back-arrow",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Rd.jsx)("path",{d:"M13 8H3M3 8L7 4M3 8L7 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var Ad=$(F());function yi(){return(0,Ad.jsx)("svg",{width:"8",height:"5",viewBox:"0 0 8 5",fill:"none",children:(0,Ad.jsx)("path",{d:"M1 4L4 1L7 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}var _i=$(F());function Ud(){return(0,_i.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,_i.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,_i.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,_i.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,_i.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}var Ga=$(F());function Dd(e){return(0,Ga.jsxs)("svg",{viewBox:"0 0 640 420",preserveAspectRatio:"xMidYMid slice",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...e,children:[(0,Ga.jsx)("rect",{width:"640",height:"420",fill:"#fbf1cf"}),(0,Ga.jsx)("rect",{x:"88",y:"78",width:"432",height:"264",rx:"16",fill:"#f0c43f"}),(0,Ga.jsx)("rect",{x:"120",y:"110",width:"368",height:"200",rx:"10",fill:"#ffd95e"}),(0,Ga.jsxs)("g",{stroke:"#e2b12e",strokeWidth:"8",opacity:"0.75",children:[(0,Ga.jsx)("line",{x1:"140",y1:"140",x2:"468",y2:"140"}),(0,Ga.jsx)("line",{x1:"140",y1:"190",x2:"468",y2:"190"}),(0,Ga.jsx)("line",{x1:"140",y1:"240",x2:"468",y2:"240"})]})]})}var Xr=$(F());function Od(e){return(0,Xr.jsxs)("svg",{viewBox:"0 0 640 420",preserveAspectRatio:"xMidYMid slice",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...e,children:[(0,Xr.jsx)("rect",{width:"640",height:"420",fill:"#edf1f5"}),(0,Xr.jsx)("rect",{x:"132",y:"108",width:"376",height:"204",rx:"18",fill:"#d5dde6"}),(0,Xr.jsx)("rect",{x:"168",y:"144",width:"304",height:"24",rx:"12",fill:"#9aa6b2"}),(0,Xr.jsx)("rect",{x:"168",y:"188",width:"250",height:"24",rx:"12",fill:"#aab5c0"}),(0,Xr.jsx)("rect",{x:"168",y:"232",width:"220",height:"24",rx:"12",fill:"#aab5c0"})]})}var Bd=$(F()),H_=[{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 Ta({description:e,photoUrl:t,className:a,width:r,height:i}){let n=(e||"").toLowerCase(),o=H_.find(p=>p.match.some(m=>n.includes(m))),l=t||o&&It(o.path);if(l)return(0,Bd.jsx)("img",{className:a,src:l,alt:"",width:r,height:i});let c=n.includes("insulation")?Dd:Od;return(0,Bd.jsx)(c,{className:a,width:r,height:i})}var M=$(F()),Tv=.2,cl=10,zv="Enter a valid email address so we can send your quote.",Q_=(e,t)=>{let a=`${t.requestedAmount} ${_a(t.requestedUnit,t.requestedAmount)}`,r=`${t.requiredSellUnits} ${_a(t.sellUnit,t.requiredSellUnits??0)}`,i=e.unitConversions?.find(o=>o.requestUom===t.requestedUnit);if(i&&i.quantityPerSaleUnit<1)return`${a} requested \u2192 order ${r} (${Math.round(1/i.quantityPerSaleUnit)} ${_a(t.sellUnit,2)} per ${_a(t.requestedUnit,1)})`;let n=t.sellUnit==="bulk bag"?e.description.match(/(\d+(?:\.\d+)?)\s*kg\b/i):null;return n?`${a} requested \u2192 order ${r} (${n[1]} kg each)`:e.coverageQty&&/^m per /i.test(e.coverageUom??"")?`${a} requested \u2192 order ${r} (${e.coverageQty} ${e.coverageUom})`:`${a} requested \u2192 order ${r}`},G_=e=>["box","pack"].includes(e.requestedUnit)?"Pack size needed to calculate the order quantity.":`This product is sold by the ${_a(e.sellUnit,1)}.`;function ul({cart:e,onUpdateQty:t,onUpdateSellUnits:a,onResolveConversions:r,onRemove:i,onBack:n,onStartNewQuote:o,onQuoteRequested:l,internal:c=!1}){let p=(0,mt.useId)(),m=En(),h=!c&&Is()==="QZA6-MRA4",d=!c,b=Object.values(e),v=(0,mt.useRef)(new Map),[q,O]=(0,mt.useState)(""),[f,u]=(0,mt.useState)(!1),[g,w]=(0,mt.useState)(!1),[k,T]=(0,mt.useState)(""),[R,U]=(0,mt.useState)({}),[A,Q]=(0,mt.useState)({}),[ie,qe]=(0,mt.useState)(1),[Te,Ze]=(0,mt.useState)({}),[Ue,be]=(0,mt.useState)(!1),[le,ot]=(0,mt.useState)("0"),[ze,wt]=(0,mt.useState)({});(0,mt.useEffect)(()=>{if(!r)return;for(let D of Object.values(e))Ft(D).requiredSellUnits!=null&&v.current.delete(D.lineId);let _=Object.values(e).filter(D=>{if(D.productId==="-"||Ft(D).requiredSellUnits!=null)return!1;let V=Un(D);return v.current.get(D.lineId)===V?!1:(v.current.set(D.lineId,V),!0)});if(_.length===0)return;let E=new Map(_.map(D=>[D.lineId,Un(D)]));wt(D=>({...D,...Object.fromEntries(E)})),fetch(Ma("/api/catalogue/resolve-conversions"),{method:"POST",headers:{"Content-Type":"application/json",...Mn()},body:JSON.stringify({lines:_.map(D=>({line_id:D.lineId,product_id:D.productId,requested_description:D.requestedDescription??D.description,requested_qty:D.qty,requested_uom:D.unit||null,linked_context:D.linkedContext??[],selected_description:D.description,selected_uoi:D.uoi,selected_uoi_count:D.uoiCount,selected_conversion:{sales_uom_normalised:D.salesUomNormalised,conversion_type:D.conversionType,sales_unit_size:D.salesUnitSize,sales_unit_size_uom:D.salesUnitSizeUom,coverage_qty:D.coverageQty,coverage_uom:D.coverageUom}}))})}).then(D=>D.ok?Qa(D):null).then(D=>{let V={},N=new Map(_.map(L=>[L.lineId,Un(L)]));for(let L of D?.data?.items??D?.items??[]){let X=L?.conversion;!X||typeof L?.line_id!="string"||v.current.get(L.line_id)!==N.get(L.line_id)||(V[L.line_id]={conversionConfidence:X.conversion_confidence,conversionNotes:X.conversion_notes,...Number.isFinite(X.suggested_order_qty)&&X.suggested_order_qty>0?{sellUnitsOverride:X.suggested_order_qty}:{}})}Object.keys(V).length>0&&r(V)}).catch(D=>console.error("Catalogue conversion resolution failed",D)).finally(()=>{wt(D=>{let V={...D};for(let[N,L]of E)V[N]===L&&delete V[N];return V})})},[e,r]);function Z(_){U(E=>{let D={...E};return delete D[_],D})}function ce(_,E){let D=parseFloat(E);!isNaN(D)&&D>=0&&t(_,Math.min(D,1e5)),Z(_)}function Ee(_,E,D){t(_,Math.min(1e5,Math.max(0,E+D))),Z(_)}function Ot(_){Q(E=>{let D={...E};return delete D[_],D})}function jt(_,E){let D=parseFloat(E);!isNaN(D)&&D>=0&&a(_,Math.min(D,1e5)),Ot(_)}function Ne(_,E,D){a(_,Math.min(1e5,Math.max(0,E+D))),Ot(_)}async function _e(){if(De.some(({pricing:E})=>E.lineTotal==null)){T(h?"Confirm the highlighted quantities before requesting a quote.":"Confirm the highlighted quantities before sending your basket.");return}let _=q.trim();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(_)){T(zv);return}T(""),w(!0);try{let E=await fetch(Ma("/api/quote-requests"),{method:"POST",headers:{"Content-Type":"application/json",...Mn()},body:JSON.stringify({email:_,items:De.map(({item:D,pricing:V})=>{let N=V.requiredSellUnits??V.requestedAmount,L=V.requiredSellUnits!=null?V.sellUnit:V.requestedUnit;return{product_id:D.productId,description:D.description,quantity:N,unit:_a(L,N),unit_price:V.requiredSellUnits!=null?V.unitPrice:null,line_total:V.lineTotal}})})});if(!E.ok){let D=await Qa(E);console.error("Quote request failed",E.status,D?.message),T(E.status===429?"You've sent a few requests already. Please try again in a few minutes.":"Your request couldn't be sent. Please try again, or contact us if it keeps happening.");return}z!=null&&m("quote_requested",{items:De.length,total:Math.round(z*100)/100}),u(!0),l?.(),window.scrollTo(0,0)}catch{T("Your request couldn't be sent. Check your connection and try again.")}finally{w(!1)}}let De=b.map(_=>({item:_,pricing:Ft(_,{wasteFactorEnabled:Ue,wasteFactorOverride:Math.max(0,Number.parseFloat(le)||0)/100})})),Ge=sc(b,{wasteFactorEnabled:Ue,wasteFactorOverride:Math.max(0,Number.parseFloat(le)||0)/100}),vt=Ge==null?null:Ge*Tv,z=Ge==null?null:Ge*(1+Tv),G=De.filter(({pricing:_})=>_.lineTotal==null).length,ne=Object.keys(ze).length,pe=!!r&&b.some(_=>{if(_.productId==="-"||Ft(_).requiredSellUnits!=null)return!1;let E=Un(_);return v.current.get(_.lineId)!==E||ze[_.lineId]===E}),de=(0,mt.useRef)({items:De.length,...z==null?{}:{total:Math.round(z*100)/100}});(0,mt.useEffect)(()=>{m("basket_viewed",de.current)},[m]);let je=Math.max(1,Math.ceil(De.length/cl)),Oe=Math.min(ie,je),x=De.slice((Oe-1)*cl,Oe*cl);return f?(0,M.jsx)("div",{className:"wizard-step entry-stage",children:(0,M.jsxs)("div",{className:"quote-request-sent",role:"status",children:[(0,M.jsx)("div",{className:"quote-request-sent-icon","aria-hidden":"true",children:(0,M.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,M.jsx)("polyline",{points:"5 12.5 10 17.5 19 7"})})}),(0,M.jsx)("h1",{children:h?"Quote requested":"Basket sent"}),h?(0,M.jsxs)("p",{children:["You're all done. We'll email your sharper price to ",(0,M.jsx)("strong",{children:q.trim()}),", usually within one working day."]}):(0,M.jsxs)("p",{children:["You're all done. We'll email ",(0,M.jsx)("strong",{children:q.trim()})," to confirm prices, availability and delivery, usually within one working day."]}),(0,M.jsx)("button",{type:"button",className:"cta-btn",onClick:o,children:(0,M.jsx)("span",{children:h?"Start a new quote":"Start a new basket"})}),(0,M.jsx)("p",{className:"quote-request-sent-note",children:h?"Nothing is charged until you approve the quote.":"Nothing is charged until you approve the order."})]})}):!c&&b.length===0?(0,M.jsx)("div",{className:"wizard-step entry-stage",children:(0,M.jsxs)("div",{className:"quote-request-sent",children:[(0,M.jsx)("div",{className:"quote-request-sent-icon","aria-hidden":"true",children:(0,M.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,M.jsx)("path",{d:"M3 9h18l-2 11H5z"}),(0,M.jsx)("path",{d:"M8 9l4-6 4 6"})]})}),(0,M.jsx)("h1",{children:h?"Your quote request is empty":"Your basket is empty"}),(0,M.jsx)("p",{children:h?"Start again with your list to build your quote.":"Start again with your list to fill your basket."}),(0,M.jsx)("button",{type:"button",className:"cta-btn",onClick:o,children:(0,M.jsx)("span",{children:"Back to start"})})]})}):(0,M.jsx)("div",{className:`wizard-step entry-stage${h?" basket-layout--qza6-mra4":""}`,children:(0,M.jsxs)("div",{className:`quick-order-card${c?"":" quick-order-card--customer"}`,children:[(0,M.jsxs)("div",{className:`quick-order-hero${c?"":" quick-order-hero--customer"}`,children:[c&&(0,M.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,M.jsxs)("div",{className:"basket-hero-copy",children:[h&&(0,M.jsxs)("button",{type:"button",className:"cta-btn cta-btn-secondary basket-hero-back",onClick:n,children:[(0,M.jsx)(Vr,{}),(0,M.jsx)("span",{children:"Back to results"})]}),(0,M.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,M.jsx)("h1",{children:c?"Your Selection":h?"Request a quote":"Your Basket"}),c&&(0,M.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,M.jsx)("strong",{children:b.length})," ",b.length===1?"item":"items"]})]}),(0,M.jsx)("p",{children:c?"Review the items you've added before exporting them for review.":h?"Check your items and quantities below, and we'll do our best to beat list prices.":"Review your quantities and order summary, then send us your basket."})]})]}),(0,M.jsx)("div",{className:"quick-order-panel",style:{paddingTop:16},children:pe?(0,M.jsxs)("div",{className:"basket-resolving",role:"status","aria-label":"Calculating order quantities",children:[(0,M.jsx)("span",{className:"basket-resolving-wheel","aria-hidden":"true"}),(0,M.jsx)("span",{children:"Calculating your quantities\u2026"})]}):b.length===0?(0,M.jsxs)("div",{className:"quick-order-history-empty",children:[(0,M.jsx)("div",{className:"basket-empty-icon","aria-hidden":"true",children:"\u{1F4CB}"}),(0,M.jsx)("p",{children:"Your selection is empty."}),(0,M.jsx)("p",{className:"basket-empty-hint",children:"Go back to your results and add quoted items."}),(0,M.jsx)("div",{className:"btn-row",style:{marginTop:20,justifyContent:"center"},children:(0,M.jsx)("button",{className:"cta-btn",style:{width:"auto",maxWidth:280},onClick:n,"aria-label":"Back to results",children:(0,M.jsx)("span",{children:"Back to Results"})})})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)("div",{className:"basket-layout",children:[(0,M.jsxs)("div",{className:"basket-main",children:[(0,M.jsx)("div",{className:"basket-list","aria-label":c?"Selection items":h?"Quote request items":"Basket items",children:x.map(({item:_,pricing:E})=>{let D=R[_.lineId]??String(E.requestedAmount),V=E.requestedUnit===E.sellUnit||E.costingMode==="review",N=E.requiredSellUnits==null||E.requestedAmount!==E.requiredSellUnits||E.requestedUnit!==E.sellUnit;return(0,M.jsxs)("article",{className:"basket-card",children:[(0,M.jsxs)("div",{className:"basket-card-top",children:[(0,M.jsx)(Ta,{className:"basket-card-thumb",description:_.description,photoUrl:_.pdpPhotoUrl,width:48,height:48}),(0,M.jsxs)("div",{className:"basket-card-info",children:[(0,M.jsx)("div",{className:"bom-component-name",children:_.description}),N&&E.costingMode!=="review"&&(0,M.jsxs)("button",{type:"button",className:"basket-calc-toggle",onClick:()=>Ze(L=>({...L,[_.lineId]:!L[_.lineId]})),"aria-expanded":!!Te[_.lineId],children:["How we calculated this",(0,M.jsx)("span",{className:`basket-calc-toggle-chevron${Te[_.lineId]?" basket-calc-toggle-chevron--open":""}`,children:(0,M.jsx)(yi,{})})]})]}),(0,M.jsx)("div",{className:"basket-card-actions",children:(0,M.jsx)("button",{type:"button",className:"mf-remove-small-btn basket-card-remove",onClick:()=>i(_.lineId),"aria-label":`Remove ${_.description}`,children:(0,M.jsx)(Ud,{})})})]}),c&&(0,M.jsxs)("div",{className:"results-detail-block basket-internal-detail",children:[(0,M.jsxs)("dl",{className:"results-detail-grid",children:[(0,M.jsxs)("div",{children:[(0,M.jsx)("dt",{children:"Conversion type"}),(0,M.jsx)("dd",{children:_.conversionType??"-"})]}),(0,M.jsxs)("div",{children:[(0,M.jsx)("dt",{children:"Conversion confidence"}),(0,M.jsx)("dd",{children:_.conversionConfidence??"-"})]}),(0,M.jsxs)("div",{children:[(0,M.jsx)("dt",{children:"Sales unit"}),(0,M.jsx)("dd",{children:_.salesUnitSize!=null?(0,M.jsxs)(M.Fragment,{children:[_.salesUnitSize," ",xa(_.salesUnitSizeUom,_.salesUnitSize)]}):"-"})]}),(0,M.jsxs)("div",{children:[(0,M.jsx)("dt",{children:"Coverage"}),(0,M.jsx)("dd",{children:_.coverageQty!=null?(0,M.jsxs)(M.Fragment,{children:[_.coverageQty," ",xa(_.coverageUom,_.coverageQty)]}):"-"})]}),(0,M.jsxs)("div",{children:[(0,M.jsx)("dt",{children:"Waste factor"}),(0,M.jsx)("dd",{children:_.wasteFactorDefault??"-"})]}),(0,M.jsxs)("div",{children:[(0,M.jsx)("dt",{children:"Rounding rule"}),(0,M.jsx)("dd",{children:_.roundingRule??"-"})]})]}),_.conversionNotes&&(0,M.jsx)("p",{className:"results-rerank-note",children:_.conversionNotes})]}),E.costingMode==="review"?(0,M.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,M.jsx)("strong",{children:ze[_.lineId]===Un(_)?"Calculating order quantity\u2026":"Quantity needs confirmation."})," ",G_(E)]}):N&&Te[_.lineId]?(0,M.jsx)("p",{className:"basket-calc-text",children:Q_(_,E)}):null,(0,M.jsxs)("div",{className:"basket-card-stats",children:[(0,M.jsxs)("div",{className:"basket-stat",children:[(0,M.jsx)("span",{className:"basket-stat-label",children:"Requested qty"}),(0,M.jsxs)("div",{className:"basket-stat-value",children:[(0,M.jsxs)("div",{className:"basket-qty-field",children:[(0,M.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:D,disabled:V,onChange:L=>U(X=>({...X,[_.lineId]:L.target.value})),onBlur:L=>ce(_.lineId,L.target.value),onKeyDown:L=>{L.key==="Enter"&&L.target.blur()},"aria-label":`${_.description} requested quantity`}),(0,M.jsxs)("div",{className:"basket-qty-arrows",children:[(0,M.jsx)("button",{type:"button",className:"basket-qty-arrow",disabled:V,onClick:()=>Ee(_.lineId,parseFloat(D)||0,1),"aria-label":`Increase ${_.description} quantity`,children:(0,M.jsx)(yi,{})}),(0,M.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",disabled:V,onClick:()=>Ee(_.lineId,parseFloat(D)||0,-1),"aria-label":`Decrease ${_.description} quantity`,children:(0,M.jsx)(yi,{})})]})]}),(0,M.jsx)("span",{className:"basket-metric-unit",children:xa(E.requestedUnit,parseFloat(D)||0)})]})]}),(0,M.jsxs)("div",{className:"basket-stat basket-stat--right",children:[(0,M.jsx)("span",{className:"basket-stat-label",children:"Order qty"}),(0,M.jsxs)("div",{className:"basket-stat-value",children:[(0,M.jsxs)("div",{className:"basket-qty-field",children:[(0,M.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:A[_.lineId]??String(E.requiredSellUnits??""),onChange:L=>Q(X=>({...X,[_.lineId]:L.target.value})),onBlur:L=>jt(_.lineId,L.target.value),onKeyDown:L=>{L.key==="Enter"&&L.target.blur()},"aria-label":`${_.description} order quantity`}),(0,M.jsxs)("div",{className:"basket-qty-arrows",children:[(0,M.jsx)("button",{type:"button",className:"basket-qty-arrow",onClick:()=>Ne(_.lineId,parseFloat(A[_.lineId]??String(E.requiredSellUnits??"0"))||0,1),"aria-label":`Increase ${_.description} order quantity`,children:(0,M.jsx)(yi,{})}),(0,M.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",onClick:()=>Ne(_.lineId,parseFloat(A[_.lineId]??String(E.requiredSellUnits??"0"))||0,-1),"aria-label":`Decrease ${_.description} order quantity`,children:(0,M.jsx)(yi,{})})]})]}),(0,M.jsx)("span",{className:"basket-metric-unit",children:xa(E.sellUnit,parseFloat(A[_.lineId]??String(E.requiredSellUnits??"0"))||0)})]})]}),(0,M.jsxs)("div",{className:"basket-stat basket-stat--total",children:[(0,M.jsx)("span",{className:"basket-stat-label",children:"Total"}),(0,M.jsxs)("div",{className:"basket-stat-value",children:[(0,M.jsx)("strong",{children:E.lineTotal!=null?nt(E.lineTotal):"-"}),E.lineTotal!=null&&(0,M.jsx)("span",{className:"basket-metric-unit",children:"ex. VAT"})]})]})]})]},_.lineId)})}),je>1&&(0,M.jsxs)("div",{className:"results-pagination",children:[(0,M.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(Oe-1)*cl+1,"\u2013",Math.min(Oe*cl,De.length)," of ",De.length]}),(0,M.jsxs)("div",{className:"results-pagination-controls",children:[(0,M.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>qe(Oe-1),disabled:Oe===1,children:"Previous"}),(0,M.jsxs)("span",{className:"results-pagination-page",children:["Page ",Oe," of ",je]}),(0,M.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>qe(Oe+1),disabled:Oe===je,children:"Next"})]})]})]}),(0,M.jsxs)("aside",{className:"basket-sidebar",children:[(0,M.jsx)("div",{className:"basket-sidebar-title",children:h?"Quote request summary":"Order summary"}),(0,M.jsxs)("div",{className:"basket-sidebar-row",children:[(0,M.jsx)("span",{children:h?"List price (ex. VAT)":"Subtotal (ex. VAT)"}),(0,M.jsx)("span",{children:Ge==null?"To confirm":nt(Ge)})]}),(0,M.jsxs)("div",{className:"basket-sidebar-row",children:[(0,M.jsx)("span",{children:"VAT (20%)"}),(0,M.jsx)("span",{children:vt==null?"To confirm":nt(vt)})]}),(0,M.jsxs)("div",{className:"basket-sidebar-row basket-sidebar-row--total",children:[(0,M.jsx)("span",{children:h?"List price (inc.\xA0VAT)":"Total"}),(0,M.jsx)("span",{children:z==null?"To confirm":nt(z)})]}),!h&&(0,M.jsx)("div",{className:"basket-summary-waste",children:(0,M.jsxs)("div",{className:"basket-waste-control",children:[(0,M.jsxs)("label",{className:"basket-global-waste",children:[(0,M.jsx)("input",{type:"checkbox",checked:Ue,onChange:_=>be(_.target.checked)}),(0,M.jsx)("span",{children:"Add waste factor"})]}),(0,M.jsxs)("label",{className:"basket-global-waste-percent",children:[(0,M.jsx)("input",{type:"number",inputMode:"decimal",min:"0",step:"0.1",value:le,onChange:_=>ot(_.target.value),disabled:!Ue,"aria-label":"Waste factor percent"}),(0,M.jsx)("span",{children:"%"})]})]})}),(0,M.jsx)("label",{htmlFor:`${p}-basket-reference`,className:"basket-sidebar-label",children:h?"Enter email for your sharper quote":d?"Your email":"Your reference (optional)"}),(0,M.jsx)("input",{id:`${p}-basket-reference`,type:d?"email":"text",className:"basket-sidebar-input",value:q,onChange:_=>{O(_.target.value),d&&T("")},placeholder:d?"you@example.com":"PO number or job reference","aria-invalid":d&&k===zv,"aria-describedby":d&&k?`${p}-basket-reference-error`:void 0}),d&&k&&(0,M.jsx)("p",{id:`${p}-basket-reference-error`,className:"basket-quote-request-error",role:"alert",children:k}),d?(0,M.jsx)("button",{type:"button",className:"cta-btn",onClick:()=>{_e()},disabled:g||G>0||ne>0,"aria-busy":g,children:(0,M.jsx)("span",{children:g?"Sending\u2026":h?"Request our best quote":"Send basket"})}):(0,M.jsx)("button",{className:"cta-btn",onClick:()=>{m("downloaded",{type:"basket",items:b.length}),Mv(b)},"aria-label":"Download selection",children:(0,M.jsx)("span",{children:"Download Quote"})}),(0,M.jsxs)("p",{className:"basket-sidebar-disclaimer",children:[(0,M.jsx)("span",{"aria-hidden":"true",children:"\u26A0\uFE0F"}),h?"This is a quote request, not an order. We'll confirm our best price, availability and delivery before you approve.":d?"Sending your basket isn't an order. We'll confirm prices, availability and delivery before you approve.":"Prices and availability are estimates and should be confirmed before procurement."]})]})]}),(0,M.jsx)("div",{className:"btn-row results-actions",children:(0,M.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",gap:10,justifyContent:"center"},onClick:n,"aria-label":"Back to results",children:[(0,M.jsx)(Vr,{}),(0,M.jsx)("span",{children:"Back to results"})]})})]})})]})})}var ye=$(Ye());function On(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,linkedContext:t.linkedContext}}var xi=$(F());function Hd(){return(0,xi.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,xi.jsx)("path",{d:"M3 12a9 9 0 0 1 15.36-6.36L21 8"}),(0,xi.jsx)("path",{d:"M21 3v5h-5"}),(0,xi.jsx)("path",{d:"M21 12a9 9 0 0 1-15.36 6.36L3 16"}),(0,xi.jsx)("path",{d:"M3 21v-5h5"})]})}var s=$(F()),jd="__none__",pl=24,j_=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}];function Dv(e){return e==null?"low":e>=.7?"high":e>=.5?"medium":"low"}var Y_=e=>e.attrs.supply_nature==="labour_only"||e.attrs.supply_nature==="plant"||e.flags.includes("referential");function $_(e,t){if(t!==jd){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)}}function Rv(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 V_({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 Ln(e,t){if(e==null)return"-";let a=ol(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function Yd(e){return e&&e.length>0?e.join(" x "):"-"}function X_(e){return e==null?"-":Number.isInteger(e/1e3)?`${e/1e3}m`:`${(e/1e3).toFixed(1)}m`}function Bn(e){let t=(e??[]).map(a=>a.trim()).filter(Boolean);return t.length>0?t.join(", "):"-"}function Zr(e,t){let a=typeof e.description_original=="string"?e.description_original.trim():"";return(typeof e.customer_display_label=="string"?e.customer_display_label.trim():"")||a||"(no description)"}function Z_(e,t){return t>0||e==null?null:nt(e)}var Av=[{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 K_(e){let t=new Map;return[...new Set(e.filter(Kr).map(r=>r.linked_group_id))].forEach((r,i)=>{let n=i%26;t.set(r,{token:String.fromCharCode(65+n),bubbleStyle:Av[i%Av.length]})}),t}function Kr(e){return!1}function Hn(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 Qd({meta:e}){return e?(0,s.jsx)("span",{className:"results-linked-pill",style:e.bubbleStyle,children:`Link ${e.token}`}):null}function P_(e,t,a){let r=t?.rerank?.recommendedCandidateIds??[],i=new Map(e.map(c=>[c.product_id,c])),n=r.length>0?r.map(c=>i.get(c)).filter(c=>c!=null):e.slice(0,6),o=a?i.get(a):void 0,l=o?[o,...n.filter(({product_id:c})=>c!==o.product_id)]:n;return[...new Map(l.map(c=>[c.product_id,c])).values()].slice(0,6)}function Gd(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 cc(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 J_({processStages:e,llmCalls:t,totalDurationMs:a,llmDurationMs:r,llmCallCount:i}){let n=[...t].sort((l,c)=>c.durationMs-l.durationMs).slice(0,12),o=Math.max(0,t.length-n.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:cc(a)})," total"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:i})," LLM calls"]}),(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:cc(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:cc(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:n.map((l,c)=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:l.label}),(0,s.jsx)("td",{children:cc(l.durationMs)})]},`${l.key}-${c}`))})]}),o>0&&(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Showing slowest ",n.length," of ",t.length," LLM calls."]})]})]})}function I_({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,i)=>(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:Yd(r.measurements_mm)}),(0,s.jsx)("td",{children:ol(r.price_basis)||"-"}),(0,s.jsx)("td",{children:r.bm25.toFixed(2)})]},`${r.product_id}-${i}`))})]})]},`${t.query}-${a}`))]})}function Uv({item:e,result:t}){let a=t?.retrieval_debug.map(i=>i.query).filter(Boolean)??[],r=[["Procurement intent",e.procurement_intent||"-"],["Procurement aliases",Bn(e.procurement_aliases)],["Retrieval queries",Bn(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)",Yd(e.attrs.measurements_mm)],["Stock length",X_(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",Bn(e.installation_clues)],["System clues",Bn(e.system_clues)],["Component requirements",Bn(e.component_requirements)],["Linked group",Hn(e)||"-"],["Flags",Bn(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(([i,n])=>(0,s.jsxs)(ye.Fragment,{children:[(0,s.jsx)("dt",{children:i}),(0,s.jsx)("dd",{children:n})]},i))})]})}function F_({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)(ye.Fragment,{children:[(0,s.jsx)("dt",{children:"Attempted"}),(0,s.jsx)("dd",{children:t.attempted?"yes":"no"})]}),(0,s.jsxs)(ye.Fragment,{children:[(0,s.jsx)("dt",{children:"Applied"}),(0,s.jsx)("dd",{children:t.applied?"yes":"no"})]}),(0,s.jsxs)(ye.Fragment,{children:[(0,s.jsx)("dt",{children:"Returned items"}),(0,s.jsx)("dd",{children:t.returned_item_count??"-"})]}),(0,s.jsxs)(ye.Fragment,{children:[(0,s.jsx)("dt",{children:"Reason"}),(0,s.jsx)("dd",{children:t.reason||"-"})]}),(0,s.jsxs)(ye.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 W_({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||"-"]];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,i])=>(0,s.jsxs)(ye.Fragment,{children:[(0,s.jsx)("dt",{children:r}),(0,s.jsx)("dd",{children:i})]},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 ex({item:e,decision:t,selectedProductId:a,result:r,showRetrievalDebug:i,reviewOnly:n=!1,linkedGroupMeta:o}){if(!t)return null;let l=a==null?"Needs review:":"Selected:";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:l}),"\xA0",t.reason]}),Kr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",o?`Link ${o.token} - `:"",Hn(e)]}):null]}):null:!t.reason&&!i?(0,s.jsx)(Uv,{item:e,result:r}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Uv,{item:e,result:r}),i&&(0,s.jsx)(F_,{item:e}),i&&(0,s.jsx)(W_,{result:r}),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:l}),"\xA0",t.reason]}),Kr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",o?`Link ${o.token} - `:"",Hn(e)]}):null]}),i&&(0,s.jsx)(I_,{queries:r?.retrieval_debug??[]})]})}function tx({item:e,candidates:t,result:a,decision:r,unmatchable:i,selectedProductId:n,detailMode:o,onPick:l,onClear:c,showAll:p=!1,internal:m=!1,debugEnabled:h=!1,forceReviewNote:d=!1,linkedGroupMeta:b}){let v=m||o==="detailed",q=h&&o==="detailed",O=v||d?(0,s.jsx)(ex,{item:e,decision:r,selectedProductId:n,result:a,showRetrievalDebug:q,reviewOnly:d&&!v,linkedGroupMeta:b}):null;if(i)return(0,s.jsxs)(s.Fragment,{children:[O,(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:[O,(0,s.jsx)("p",{className:"results-empty-hint",children:"No candidates were returned for this line item."})]});let f=p||m||o==="detailed"?t:P_(t,a,n);return(0,s.jsxs)(s.Fragment,{children:[O,(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"}),q&&(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:f.map((u,g)=>{let w=u.product_id===n;return(0,s.jsxs)("tr",{className:w?"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:Yd(u.measurements_mm??u.debug?.candidate.measurements_mm)})}),(0,s.jsx)("td",{children:Ln(u.price,u.price_basis)}),q&&(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)(V_,{band:Dv(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:w?"Currently selected":"Use this candidate",children:[(0,s.jsx)("input",{type:"checkbox",checked:w,onChange:()=>{w?c?.():l(u)},"aria-label":w?`${u.description} selected`:`Use ${u.description}`}),(0,s.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},`${u.product_id}-${g}`)})})]})]})}function $d({scheduleResult:e,onStartOver:t,cart:a,onAddToCart:r,onRemoveFromCart:i,onGoToBasket:n,cartSeeded:o,onCartSeeded:l,reviewGateComplete:c,onReviewGateComplete:p,internal:m=!1}){let h=!m&&Is()==="QZA6-MRA4",d=h?"quote":"basket",{results:b,lineItems:v,parseReport:q,timings:O}=e,[f,u]=(0,ye.useState)({}),g=En(),[w,k]=(0,ye.useState)({}),[T,R]=(0,ye.useState)({}),[U,A]=(0,ye.useState)(""),[Q,ie]=(0,ye.useState)(null),[qe,Te]=(0,ye.useState)(1),Ze=Dt().debug===!0,[Ue,be]=(0,ye.useState)("simple"),[le,ot]=(0,ye.useState)(m?"list":"tile"),[ze,wt]=(0,ye.useState)(!1),[Z,ce]=(0,ye.useState)(null),[Ee,Ot]=(0,ye.useState)(""),[jt,Ne]=(0,ye.useState)([]),[_e,De]=(0,ye.useState)(!1),[Ge,vt]=(0,ye.useState)(null),[z,G]=(0,ye.useState)(!1),[ne,pe]=(0,ye.useState)(null),de=(0,ye.useRef)(null),[je,Oe]=(0,ye.useState)(new Set),[x,_]=(0,ye.useState)(new Set),[E,D]=(0,ye.useState)(!1);(0,ye.useEffect)(()=>{Te(1)},[U,Q,le]);let V=new Map(b.map(S=>[S.line_id,S])),N=K_(v),L=v.map(S=>{let j=V.get(S.line_id),he=j?.decision,ht=Y_(S),Pe=f[S.line_id],Xa=$_(j,Pe),Ai=a[S.line_id],v0=Pe===jd?void 0:w[S.line_id]??(Ai&&Ai.productId!==Xa?.product_id?Rv(Ai):Xa),Cm=ht?void 0:v0,y0=S.qty??0;return{item:S,result:j,decision:he,unmatchable:ht,best:Cm,qty:y0,band:Dv(Cm?.scores?.overall)}}),ue=L.some(S=>!S.unmatchable&&!S.best&&!x.has(S.item.line_id))?null:sc(Object.values(a),{wasteFactorEnabled:!1,wasteFactorOverride:0}),xe=0;for(let S of L){if(S.unmatchable||!S.best)continue;let j=a[S.item.line_id];(!j||Ft(j).lineTotal==null)&&(xe+=1)}xe>0&&(ue=null);let yt=Z_(ue,xe),ft=S=>!S.unmatchable&&!S.best&&Gd(S.result).length>0,At=S=>S.best??Gd(S.result)[0],Jr=L.filter(S=>!S.unmatchable&&!S.best).filter(S=>!x.has(S.item.line_id)),Ec=L.filter(S=>x.has(S.item.line_id)),Yt=L;if(U.trim()){let S=U.trim().toLowerCase();Yt=Yt.filter(j=>j.item.description_original?.toLowerCase().includes(S)||At(j)?.description?.toLowerCase().includes(S))}if(Q){let S=Q==="asc"?1:-1;Yt=[...Yt].sort((j,he)=>S*(j.item.description_original||"").localeCompare(he.item.description_original||""))}let hr=Math.max(1,Math.ceil(Yt.length/pl)),_t=Math.min(qe,hr),Zn=Yt.slice((_t-1)*pl,_t*pl),wm=Zn.filter(S=>!S.unmatchable&&S.best),Mc=Zn.filter(S=>!S.unmatchable&&S.best),vm=Zn.filter(S=>S.unmatchable||!S.best),P=Z?L.find(S=>S.item.line_id===Z)??null:null,d0=!m&&!c&&!P&&Jr.length>0,Kn=(0,ye.useRef)(null),Pn=()=>{let S=de.current;if(!S)return;let{top:j,left:he,width:ht,height:Pe}=S.getBoundingClientRect(),Ai=S.querySelector(".bom-toolbar-btn")?.closest("td")?.getBoundingClientRect().left;pe({top:j,left:he,width:Ai?Ai-he:ht,height:Pe})};(0,ye.useEffect)(()=>(window.addEventListener("scroll",Pn,!0),window.addEventListener("resize",Pn),()=>{window.removeEventListener("scroll",Pn,!0),window.removeEventListener("resize",Pn)})),(0,ye.useEffect)(()=>{let S=j=>{Kn.current&&!j.composedPath().includes(Kn.current)&&Kn.current.removeAttribute("open")};return document.addEventListener("click",S),()=>document.removeEventListener("click",S)},[]);let zi=S=>{ce(S),Ot("")},m0=()=>{if(!Z)return;let S=a[Z];if(S){u(j=>({...j,[Z]:S.productId})),k(j=>({...j,[Z]:Rv(S)}));return}u(j=>{let he={...j};return delete he[Z],he}),k(j=>{let he={...j};return delete he[Z],he})},Va=(S=!1)=>{let j=Z?a[Z]:void 0;!S&&j&&P?.best&&j.productId!==P.best.product_id&&!window.confirm("You have selected a new product. Leave without updating it?")||(S||m0(),ce(null),D(!1))};rl(z,()=>G(!1)),rl(!!P&&!z,()=>Va());let f0=S=>{if(Oe(j=>new Set(j).add(S)),Jr.some(j=>j.item.line_id!==S)){Va(!0);return}p(),Va(!0)},h0=S=>{if(Tc(S),_(j=>new Set(j).add(S)),Jr.some(j=>j.item.line_id!==S)){Va(!0);return}p(),Va(!0)},g0=()=>{_(S=>new Set([...S,...Jr.map(j=>j.item.line_id)])),p()},ym=()=>{P?.best&&(xm(P.item.line_id,P.best),r(Jn(P)),E?f0(P.item.line_id):Va(!0))},_m=vm.length>0?(0,s.jsxs)("section",{className:"results-tile-section results-tile-section--unmatched","aria-label":"Items needing review",children:[(0,s.jsxs)("div",{className:"results-tile-section__head",children:[(0,s.jsx)("h3",{children:"Needs review"}),(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:vm.map(S=>{let{item:j,qty:he}=S;return(0,s.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>zi(j.line_id),children:[(0,s.jsx)("span",{className:"results-unmatched-card__main",children:(0,s.jsx)("span",{className:"results-unmatched-card__title",children:Zr(j,v)})}),(0,s.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},j.line_id)})})]}):null,Tc=S=>{u(j=>({...j,[S]:jd})),k(j=>({...j,[S]:void 0})),R(j=>({...j,[S]:void 0})),i(S)},zc=(S,j)=>{u(he=>({...he,[S]:j.product_id})),k(he=>({...he,[S]:j}))},xm=(S,j)=>{j.method==="catalogue_search"&&R(he=>({...he,[S]:j}))};function Qx(){g("downloaded",{type:"schedule",lines:L.length}),Ev(L.map(({item:S,best:j,qty:he,band:ht,unmatchable:Pe,decision:Xa})=>({item:S,best:j,qty:he,band:ht,unmatchable:Pe,decision:Xa})))}function Jn(S){let j=S.best;if(!j)throw new Error("Cannot add a line item without a selected product.");return On(j,{lineId:S.item.line_id,description:S.item.description_original,unit:S.item.unit,qty:S.qty,linkedContext:S.item.linked_group_role==="dependent"&&S.item.linked_group_id?v.filter(he=>he.linked_group_id===S.item.linked_group_id&&he.linked_group_role==="anchor").slice(0,1).map(he=>{let ht=a[he.line_id];return{line_id:he.line_id,product_id:ht?.productId??null,measurements_mm:ht?.measurementsMm??he.attrs.measurements_mm,description:ht?.description??he.description_original,qty:he.qty,unit:he.unit,role:"anchor"}}):void 0})}(0,ye.useEffect)(()=>{if(!o){for(let S of L)!S.unmatchable&&S.best&&r(Jn(S));l()}},[o]),(0,ye.useEffect)(()=>{if(!Z){Ne([]),vt(null),De(!1);return}let S=Ee.trim();if(!S){Ne([]),vt(null),De(!1);return}let j=!1,he=window.setTimeout(async()=>{try{De(!0),vt(null);let ht=await fetch(Ma(`/api/catalogue/search?q=${encodeURIComponent(S)}`),{headers:bi()}),Pe=await Qa(ht);if(!ht.ok)throw new Error(Pe?.error||Pe?.message||"Failed to search catalogue");j||Ne(Array.isArray(Pe?.items)?Pe.items:[])}catch(ht){j||(Ne([]),vt(ht?.message||"Failed to search catalogue"))}finally{j||De(!1)}},250);return()=>{j=!0,window.clearTimeout(he)}},[Ee,Z]);let Rc=Object.keys(a).length,Na=Ee.trim(),Ac=Gd(P?.result),bl=!!P&&!P.best&&(P.result?.candidates.length===0||P.result?.rerank?.selectedCandidateId===null),km=P?.result?.rerank!=null,Sm=P?.decision?.reason??(bl?"No catalogue candidate found. Refine the request or search the catalogue.":null),b0=jt.map(S=>({product_id:S.product_id,description:S.description,source_list:S.source_list,price:S.price,price_basis:S.price_basis,uoi_count:S.uoi_count??null,uoi:S.uoi,pdp_photo_url:S.pdp_photo_url??null,conversion:S.conversion,measurements_mm:S.measurements_mm??[],scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"catalogue_search"})),In=Na?b0:Ac,Ri=P?T[P.item.line_id]:void 0,Fn=!Na&&Ri&&!In.some(S=>S.product_id===Ri.product_id)?[...In,Ri]:In,Nm=(()=>{let S=Fn.slice(0,Na?12:6);return Na||!Ri||S.some(j=>j.product_id===Ri.product_id)?S:[...S,Ri]})(),wl=!!P?.best&&a[P.item.line_id]?.productId===P.best.product_id,w0=!!P?.best&&!!a[P.item.line_id]&&!wl;return(0,s.jsxs)("div",{className:"wizard-step entry-stage",children:[(0,s.jsxs)("div",{className:`quick-order-card${m?"":" quick-order-card--customer"}`,children:[(0,s.jsx)("div",{className:`quick-order-hero${m?"":" quick-order-hero--customer"}`,children:m?(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:yt??"Review quantities"})," 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 ",h?"View Quote":"View Basket"," to continue."]})]}),(0,s.jsxs)("button",{type:"button",className:"results-total-action",onClick:n,disabled:Rc===0,"aria-label":h?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("small",{children:h?"View Quote":"View Basket"}),yt!=null&&(0,s.jsx)("strong",{children:yt})]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Qt,{})})]})]})}),(0,s.jsxs)("div",{className:"quick-order-panel",style:{paddingTop:16},children:[Ze&&(0,s.jsx)("div",{className:"results-summary",style:{marginBottom:12},children:(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn","aria-pressed":ze,onClick:()=>wt(S=>!S),children:ze?"Hide timings":"Show timings"})}),Ze&&ze&&(0,s.jsx)(J_,{...O}),!h&&(0,s.jsx)("div",{className:"results-toolbar-row",children:!P&&(0,s.jsx)("div",{className:"results-summary",style:{marginBottom:0},children:(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:U,onChange:S=>A(S.target.value),"aria-label":"Search line items"}),!m&&(0,s.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,s.jsx)("button",{type:"button",className:`results-view-toggle__btn${le==="tile"?" is-active":""}`,"aria-pressed":le==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>ot("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${le==="list"?" is-active":""}`,"aria-pressed":le==="list","aria-label":"List view",title:"List view",onClick:()=>ot("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"})]})})]}),Ze&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>be(S=>S==="simple"?"detailed":"simple"),children:Ue==="detailed"?"Hide detailed view":"Show detailed view"}),(0,s.jsxs)("details",{ref:Kn,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:j_.map(S=>{let j=Q===S.dir;return(0,s.jsxs)("button",{type:"button",className:`sort-menu-item${j?" is-active":""}`,onClick:()=>{ie(j?null:S.dir),Kn.current?.removeAttribute("open")},children:[(0,s.jsx)("span",{className:"sort-menu-item__check",children:j?"\u2713":""}),S.label]},S.dir)})})]})]})})}),le==="tile"||P?(0,s.jsxs)(s.Fragment,{children:[P?(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop",role:"dialog","aria-modal":"true","aria-label":"Product options",onClick:()=>Va(),children:(0,s.jsxs)("section",{className:"quick-order-workflow-modal results-review-modal",onClick:S=>S.stopPropagation(),children:[(0,s.jsx)("button",{type:"button",className:"quick-order-workflow-close results-review-modal__close",onClick:()=>Va(),"aria-label":"Close product options",children:(0,s.jsx)(il,{})}),(0,s.jsx)("div",{className:"results-review-page",children:m?(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:()=>Va(),children:[(0,s.jsx)(Vr,{}),"Back to results"]}),(0,s.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[Ze&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>be(S=>S==="simple"?"detailed":"simple"),children:Ue==="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:Ee,onChange:S=>Ot(S.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:()=>Tc(P.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)(Ta,{className:"fill-img results-review-page__image",description:At(P)?.description||P.item.description_original,photoUrl:At(P)?.pdp_photo_url})}),(0,s.jsxs)("div",{className:"results-review-page__summary",children:[(0,s.jsx)("h2",{children:Zr(P.item,v)}),(0,s.jsxs)("p",{className:"results-review-page__meta",children:[vi(P.qty)," ",xa(P.item.unit,P.qty)]}),P.best?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:P.best.description}),P.best.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:Ln(P.best.price,P.best.price_basis)}):null]}):At(P)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:At(P)?.description}),At(P)?.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:Ln(At(P)?.price??null,At(P)?.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."}),Kr(P.item)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:8},children:[(0,s.jsx)(Qd,{meta:N.get(P.item.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:Hn(P.item)})]}):null,(0,s.jsx)("div",{className:"results-review-page__actions",children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[P.item.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[P.item.line_id]?i(P.item.line_id):(P.best&&xm(P.item.line_id,P.best),r(Jn(P)))},disabled:!P.best,"aria-label":a[P.item.line_id]?m?"Remove from selection":`Remove from ${d}`:m?"Add to selection":`Add to ${d}`,children:a[P.item.line_id]?"\u2713 Added":m?"+ Add to selection":`Add to ${d}`})})]})]}),_e?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,!_e&&Ge?(0,s.jsx)("div",{className:"results-empty-card",children:Ge}):null,!_e&&!Ge&&Na&&In.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No candidate products match this database search."}):!_e&&!Ge?(0,s.jsx)(tx,{item:P.item,candidates:In,result:P.result,decision:P.decision,unmatchable:P.unmatchable,selectedProductId:P.best?.product_id??null,detailMode:Ue,linkedGroupMeta:Kr(P.item)?N.get(P.item.linked_group_id):void 0,onPick:S=>zc(P.item.line_id,S),onClear:()=>Tc(P.item.line_id),showAll:m||Ze||Na.length>0,internal:m,debugEnabled:Ze,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:Zr(P.item,v)||"Original request"})]}),Sm?(0,s.jsxs)("section",{className:"customer-review-ai",children:[(0,s.jsx)("strong",{children:bl?"No automatic match:":"AI review:"})," ",Sm]}):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:bl?Ac.length>0?"Choose a product":"No suitable product found":km?"Choose a product":"We couldn't review this item"}),(0,s.jsx)("p",{children:bl?Ac.length>0?"No product was selected automatically. Review these related options before adding one.":"Search the catalogue to choose an alternative.":km?`Select the option you want to add to your ${d}.`:"Search the catalogue to choose a product."})]})}),!Na&&Fn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:Nm.map(S=>{let j=S.product_id===P.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${j?" is-selected":""}`,onClick:()=>zc(P.item.line_id,S),"aria-pressed":j,children:[(0,s.jsx)(Ta,{className:"customer-review-option__image",description:S.description,photoUrl:S.pdp_photo_url,width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:S.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:S.price!=null?`\xA3${Ln(S.price,S.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:j?"Selected":"Choose"})]},S.product_id)})}):null,Fn.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:Ee,onChange:S=>Ot(S.target.value),"aria-label":"Search catalogue"})]}),Na&&_e?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,Na&&!_e&&Ge?(0,s.jsx)("div",{className:"results-empty-card",children:Ge}):null,Na&&!_e&&!Ge&&Fn.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No products match this search."}):null,Na&&!_e&&!Ge&&Fn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:Nm.map(S=>{let j=S.product_id===P.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${j?" is-selected":""}`,onClick:()=>zc(P.item.line_id,S),"aria-pressed":j,children:[(0,s.jsx)(Ta,{className:"customer-review-option__image",description:S.description,photoUrl:S.pdp_photo_url,width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:S.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:S.price!=null?`\xA3${Ln(S.price,S.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:j?"Selected":"Choose"})]},S.product_id)})}):null]}),P.best?w0?(0,s.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,s.jsx)("button",{type:"button",className:"cta-btn customer-review-add",onClick:()=>{ym()},children:(0,s.jsx)("span",{children:"Update product"})}),(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-add",onClick:()=>i(P.item.line_id),children:(0,s.jsx)("span",{children:`Remove from ${d}`})})]}):(0,s.jsx)("button",{type:"button",className:`cta-btn customer-review-add${wl?" cta-btn-secondary":""}`,onClick:()=>{wl?i(P.item.line_id):ym()},children:(0,s.jsx)("span",{children:wl?`Remove from ${d}`:`Add selected product to ${d}`})}):null,E?(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-skip",onClick:()=>h0(P.item.line_id),children:"Skip this item"}):null]})})]})}):null,(0,s.jsxs)("div",{className:"results-tile-layout",children:[Yt.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No line items match the current search/filter."}):null,Mc.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:Mc.map(S=>{let{item:j,best:he,qty:ht}=S,Pe=At(S);return(0,s.jsxs)("article",{className:"results-tile-card",children:[(0,s.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>zi(j.line_id),"aria-label":`Review match for ${Zr(j,v)||"item"}`,children:[(0,s.jsxs)("div",{className:"results-tile-card__media",children:[Kr(j)?(0,s.jsx)("div",{className:"results-tile-card__badges",children:(0,s.jsx)(Qd,{meta:N.get(j.linked_group_id)})}):null,(0,s.jsx)(Ta,{className:"fill-img results-tile-card__image",description:Pe?.description||j.description_original,photoUrl:Pe?.pdp_photo_url})]}),(0,s.jsxs)("div",{className:"results-tile-card__body",children:[Pe?(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:Pe.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:Pe?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-tile-card__match-label",children:"\u21B3 matched from"}),(0,s.jsx)("div",{className:"results-tile-card__match-name",children:Zr(j,v)}),Kr(j)?(0,s.jsx)("div",{className:"results-row-meta",children:Hn(j)}):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:[m&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>zi(j.line_id),children:"Review"}),(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[j.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[j.line_id]?i(j.line_id):r(Jn(S))},disabled:!he,"aria-label":a[j.line_id]?m?"Remove from selection":`Remove from ${d}`:m?"Add to selection":`Add to ${d}`,children:a[j.line_id]?"\u2713 Added":m?"+ Add":`Add to ${d}`})]})]},j.line_id)})})}):null,_m]})]}):(0,s.jsxs)(s.Fragment,{children:[ne&&(0,s.jsx)("div",{className:"results-table__hover-overlay",style:ne,"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"}}),Ue==="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"}),Ue==="simple"&&(0,s.jsx)("th",{style:{textAlign:"center"},children:m?"Selection":h?"Quote":"Basket"})]})}),(0,s.jsxs)("tbody",{children:[Yt.length===0&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:Ue==="simple"?4:3,className:"results-empty-hint",style:{padding:"16px 8px"},children:"No line items match the current search/filter."})}),Mc.map(S=>{let{item:j,result:he,decision:ht,best:Pe}=S;return(0,s.jsxs)("tr",{className:"bom-row results-table__review-row",onClick:()=>zi(j.line_id),onMouseEnter:Xa=>{de.current=Xa.currentTarget,Pn()},onMouseLeave:()=>{de.current=null,pe(null)},children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{className:"bom-component-name",children:Zr(j,v)}),Kr(j)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:4},children:[(0,s.jsx)(Qd,{meta:N.get(j.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:Hn(j)})]}):null]}),(0,s.jsx)("td",{children:Pe?(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"results-match-cell-text",title:Pe.description,children:Pe.description}),Ue==="detailed"&&ht&&(0,s.jsx)("div",{className:"results-row-meta",children:ht.selected_candidate_id===Pe.product_id?"Automatically selected":"Selected"})]}):(0,s.jsx)("span",{className:"results-empty-hint"})}),(0,s.jsx)("td",{style:{textAlign:"center"},children:Pe?.price!=null?Ln(Pe.price,Pe.price_basis):"-"}),Ue==="simple"&&(0,s.jsx)("td",{style:{textAlign:"center"},children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[j.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,style:{width:84,justifyContent:"center"},onClick:Xa=>{Xa.stopPropagation(),a[j.line_id]?i(j.line_id):r(Jn(S))},"aria-label":a[j.line_id]?m?"Remove from selection":`Remove from ${d}`:m?"Add to selection":`Add to ${d}`,children:a[j.line_id]?"\u2713 Added":m?"+ Add":`Add to ${d}`})})]},j.line_id)})]})]})}),_m]}),!P&&hr>1&&(0,s.jsxs)("div",{className:"results-pagination",children:[(0,s.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(_t-1)*pl+1,"\u2013",Math.min(_t*pl,Yt.length)," of ",Yt.length]}),(0,s.jsxs)("div",{className:"results-pagination-controls",children:[(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Te(_t-1),disabled:_t===1,children:"Previous"}),(0,s.jsxs)("span",{className:"results-pagination-page",children:["Page ",_t," of ",hr]}),(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Te(_t+1),disabled:_t===hr,children:"Next"})]})]}),(q.itemCount!=null||q.headingCount!=null||q.skippedCount!=null)&&(0,s.jsxs)("div",{className:"results-summary",style:{marginTop:16},children:[q.itemCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:q.itemCount})," items parsed"]}),q.headingCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:q.headingCount})," headings"]}),q.skippedCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:q.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."})]}),!P&&(0,s.jsxs)("div",{className:"btn-row results-actions",children:[(0,s.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",gap:10,justifyContent:"center"},onClick:()=>G(!0),"aria-label":"Start over",children:[(0,s.jsx)(Hd,{}),(0,s.jsx)("span",{children:"Start Over"})]}),(0,s.jsxs)("button",{className:"cta-btn",style:{flex:"0 1 70%"},onClick:n,disabled:Rc===0,"aria-label":m?"View selection":h?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[m?"View Selection":h?"View Quote":"View Basket"," (",Rc,")"]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Qt,{})})]})]})]})]}),d0&&(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:Jr.map(S=>{let j=je.has(S.item.line_id),he=ft(S);return(0,s.jsx)("div",{className:`review-gate-item${j?" is-reviewed":""}`,children:(0,s.jsxs)("button",{type:"button",className:"review-gate-item__review",onClick:()=>{D(!0),zi(S.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Zr(S.item,v)}),(0,s.jsx)("span",{children:S.decision?.reason||(he?"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:j?"Choice made":"Choose a product"})]})},S.item.line_id)})}),(0,s.jsx)("button",{type:"button",className:"review-gate-skip",onClick:g0,children:"Skip all"}),Ec.length>0?(0,s.jsxs)("div",{className:"review-gate-skipped",children:[(0,s.jsx)("strong",{children:"Skipped"}),Ec.map(S=>(0,s.jsxs)("button",{type:"button",className:"review-gate-item is-skipped",onClick:()=>{_(j=>{let he=new Set(j);return he.delete(S.item.line_id),he}),D(!0),zi(S.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Zr(S.item,v)}),(0,s.jsx)("span",{children:`Not added to your ${d}.`})]}),(0,s.jsx)("span",{className:"review-gate-item__action",children:"Choose a product"})]},S.item.line_id))]}):null]})}),z&&(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 ",h?"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:()=>G(!1),children:"Cancel"}),(0,s.jsx)("button",{type:"button",className:"modal-btn modal-btn-danger",onClick:()=>{G(!1),t()},autoFocus:!0,children:"Start Over"})]})]})})]})}var ja=$(F()),Vd="metron-quick-quote",ax=1440*60*1e3;function uc(e){return(0,ja.jsx)(lc,{children:(0,ja.jsx)(rx,{...e})})}function rx({fullPage:e=!1,hideHeader:t=!1,internal:a=!1}){let[r,i]=(0,He.useState)("entry"),[n,o]=(0,He.useState)(null),l=(0,He.useRef)(null),c=(0,He.useRef)(0),[p,m]=(0,He.useState)(0),[h,d]=(0,He.useState)(null),[b,v]=(0,He.useState)(!1),{cart:q,addToCart:O,addManyToCart:f,removeFromCart:u,updateCartQty:g,updateCartSellUnits:w,updateCartConversions:k,clearCart:T}=Dn(),[R,U]=(0,He.useState)(!1),[A,Q]=(0,He.useState)(null),ie=()=>{Q(null);try{window.sessionStorage.removeItem(oc)}catch{}},qe=(0,He.useRef)(null),Te=Js("quick-quote",qe);(0,He.useEffect)(()=>{Te("viewed")},[Te]);let[Ze,Ue]=(0,He.useState)(!1);(0,He.useEffect)(()=>{wv();let Ne=window.location.hash,_e=null;try{_e=JSON.parse(window.sessionStorage.getItem(Vd)??"null")}catch{}if(_e&&!(Date.now()-(_e.savedAt??0)<ax)&&(_e=null),_e?.scheduleResult)o("schedule"),d(_e.scheduleResult),v(_e.reviewGateComplete),U(_e.cartSeeded),f(Object.values(_e.cart)),Ne==="#quote-request"?i("basket"):Ne==="#matched-products"&&i("results");else if(Ne==="#matched-products"||Ne==="#quote-request"){let De=new URL(window.location.href);De.hash="",Rn("replaceState",window.history.state,De)}Ue(!0)},[]),(0,He.useEffect)(()=>{if(Ze)try{h?window.sessionStorage.setItem(Vd,JSON.stringify({savedAt:Date.now(),scheduleResult:h,reviewGateComplete:b,cartSeeded:R,cart:q})):window.sessionStorage.removeItem(Vd)}catch{}},[Ze,h,b,R,q]);let be=(0,He.useCallback)(Ne=>{if(typeof window>"u")return;let _e=new URL(window.location.href);_e.hash=Ne==="basket"?"quote-request":"matched-products";let De=Ne==="results"&&(window.location.hash==="#matched-products"||window.location.hash==="#quote-request");Rn(De?"replaceState":"pushState",{boqQuoteStage:Ne},_e)},[]),le=(0,He.useRef)(!1);(0,He.useEffect)(()=>{let Ne=()=>{le.current=!1;let _e=window.location.hash;_e==="#quote-request"?i("basket"):_e==="#matched-products"&&h?(o("schedule"),i("results")):i("entry")};return window.addEventListener("popstate",Ne),()=>window.removeEventListener("popstate",Ne)},[h]);let ot=(0,He.useCallback)(()=>{be("basket"),i("basket")},[be]),ze=(0,He.useCallback)(()=>{if(window.location.hash==="#quote-request"){if(le.current)return;le.current=!0,nc();return}i(h?"results":"entry")},[h]),wt=(0,He.useRef)(r);(0,He.useEffect)(()=>{wt.current!==r&&(wt.current=r,window.scrollTo(0,0))},[r]);let Z=()=>{i("entry"),o(null),m(0),d(null),v(!1),T(),U(!1),ie()},ce=(0,He.useCallback)(async(Ne,_e,De=!0)=>{let Ge=++c.current;m(0);let vt=0,z=()=>{vt=Math.min(vt+1,3),m(vt)};try{let{jobId:G}=await Nw(Ne,_e,De);if(Ge!==c.current)return;let{promise:ne,cancel:pe}=qw(()=>Cw(G),5e3,z,"schedule");l.current=pe;let de=await ne;if(de.status==="failed"||!de.result)throw new Error(de.error||"Failed to process schedule");let je=de.result.lineItems.length,Oe=de.result.results.filter(x=>x.candidates.length>0).length;Te("results_shown",{lines:je,matched:Oe,unmatched:je-Oe}),T(),U(!1),v(!1),d(de.result),be("results"),i("results")}catch(G){if(Ge!==c.current)return;throw Te("error",{stage:"matching"}),G}finally{Ge===c.current&&(l.current?.(),l.current=null)}},[be,Te,T]),Ee=(0,He.useCallback)(()=>{c.current++,l.current?.(),l.current=null},[]),Ot=(0,He.useCallback)(async(Ne,_e,De=!0)=>{if(!Ne.trim())return;o("schedule");let Ge=new File([Ne],"pasted-schedule.txt",{type:"text/plain"});await ce(Ge,_e,De)},[ce]),jt=(0,He.useCallback)(async Ne=>{o("schedule"),await ce(Ne)},[ce]);return(0,ja.jsx)(tl.Provider,{value:Te,children:(0,ja.jsx)("div",{ref:qe,className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}${!e&&r==="processing"?" app-wrapper--loading":""}`,style:Dt().theme,children:(0,ja.jsxs)("main",{className:"main-content",children:[r==="entry"&&(0,ja.jsx)(Cd,{onPasteSchedule:Ot,onUploadSchedule:jt,onEntryModeChange:o,draft:A,onSubmitDraft:Q,onCancelMatch:Ee}),r==="results"&&n==="schedule"&&h&&(0,ja.jsx)($d,{scheduleResult:h,onStartOver:Z,cart:q,onAddToCart:O,onRemoveFromCart:u,onGoToBasket:ot,cartSeeded:R,onCartSeeded:()=>U(!0),reviewGateComplete:b,onReviewGateComplete:()=>v(!0),internal:a}),r==="basket"&&(0,ja.jsx)(ul,{cart:q,onUpdateQty:g,onUpdateSellUnits:w,onResolveConversions:k,onRemove:u,onBack:ze,onStartNewQuote:Z,onQuoteRequested:()=>{d(null),v(!1),U(!1),T(),ie()},internal:a})]})})})}var $a=$(Ye());var Si=$(Ye());var Ov={"NZ4Y-ZMSQ":{"brick-block":{"brick-common":"105499","brick-engineering-red":"1654","brick-engineering-blue":"1723",block:"501","mortar-cement":"1762 cement","mortar-sand":"564 building sand"},skirting:{"skirting-chamfered":"1525","skirting-ogee":"135 primed mdf ogee","skirting-pencil-round":"892","skirting-torus":"1941"},architrave:{"architrave-ogee":"134 primed mdf ogee","architrave-pencil-round":"1896","architrave-square-edge":"118 primed mdf square","architrave-torus":"1531"},plasterboard:{standard:"1647",moisture:"11 moisture plasterboard",fire:"14 fire plasterboard",sound:"1769",screws:"131160",tape:"1766",adhesive:"108439"},paint:{"paint-emulsion":"157217"},"concrete-aggregate":{cement:"1762 cement","sharp-sand":"563",gravel:"571",mot:"569"},insulation:{"insulation-floor":"152187","insulation-ground":"442","insulation-wall":"147","insulation-roof":"442","insulation-loft":"152180"},timber:{studs:"1213",joists:"208",battens:"1729"},fencing:{"panels-boundary-0.9":"66 lap fence panel","panels-boundary-1.2":"1450","panels-boundary-1.5":"1449","panels-boundary-1.8":"1448","panels-skyline-1.8":"1475","concrete-intermediate-8":"40197","concrete-end-8":"40198","timber-post-6":"141411","timber-post-8":"1709",postcrete:"12142","gate-boundary":"1984","gate-skyline":"40002","gravel-boards":"40200"},decking:{"boards-summit":"24322",joists:"208",screws:"131079"},paving:{"surface-council":"1669","surface-raj":"12363","surface-brindle":"304","surface-charcoal":"296","surface-pea":"431","sub-base":"569",bedding:"563"}}};function dl(e,t){let a=Ov[Dt().client??""]?.[e];if(!a)return null;let r=e==="plasterboard"&&t.key==="board"?t.label.split(" ")[0].toLowerCase():t.key;return a[r]??null}function ki(e,t){let a=Ov[Dt().client??""]?.[e];return!a||t in a}function Bv(e,t){let a=t.map(r=>{let i=dl(e,r);return i?{key:r.key,productId:i.split(" ")[0],search:i,qty:r.qty,unit:r.unit}:null});return a.length>0&&a.every(Boolean)?a:null}var ee=$(F()),Lv=[{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"}],pc=e=>Number.parseFloat(e)||0,Hv=(e,t)=>pc(e)*(t==="m"?1:.3048),Xd=(e,t)=>pc(e.quantity)*(2*Hv(e.height,t)+Hv(e.width,t)),ix=()=>({quantity:"1",width:"",height:""});function nx({profile:e}){return(0,ee.jsxs)("svg",{className:"architrave-calculator__profile-diagram",viewBox:"0 0 112 76","aria-hidden":"true",children:[(0,ee.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,ee.jsx)("line",{x1:"12",y1:"66",x2:"100",y2:"66"})]})}function Zd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Si.useState)("m"),[n,o]=(0,Si.useState)({quantity:"1",width:"0.76",height:"1.98"}),[l,c]=(0,Si.useState)({quantity:"0",width:"1.52",height:"1.98"}),[p,m]=(0,Si.useState)([]),[h,d]=(0,Si.useState)("ogee"),[b,v]=(0,Si.useState)("2.4"),q=(k,T,R)=>{k(U=>({...U,[T]:R}))},O=Xd(n,r)+Xd(l,r)+p.reduce((k,T)=>k+Xd(T,r),0),f=pc(b)>0?Math.ceil(O/pc(b)):0,u=Lv.find(k=>k.id===h)?.label??"",g=[{key:`architrave-${h}`,label:`Architrave (${u})`,qty:O,unit:"m",query:`${u} architrave`,category:"architrave"}],w=(k,T,R,U)=>(0,ee.jsxs)("div",{className:"architrave-calculator__opening-row",children:[(0,ee.jsx)("span",{children:k}),(0,ee.jsx)("input",{"aria-label":`${k} quantity`,type:"number",min:"0",step:"1",value:T.quantity,onChange:A=>R("quantity",A.target.value)}),(0,ee.jsx)("input",{"aria-label":`${k} width`,type:"number",min:"0",step:"0.01",value:T.width,onChange:A=>R("width",A.target.value)}),(0,ee.jsx)("input",{"aria-label":`${k} height`,type:"number",min:"0",step:"0.01",value:T.height,onChange:A=>R("height",A.target.value)}),U?(0,ee.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:U,children:"Remove"}):null]});return(0,ee.jsx)(ee.Fragment,{children:(0,ee.jsxs)("div",{className:"truss-estimator",children:[(0,ee.jsxs)("div",{className:"quick-order-hero",children:[(0,ee.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ee.jsx)("h1",{children:"Architrave Calculator"}),(0,ee.jsx)("p",{children:"Estimate architrave lengths and board quantities for door openings."})]}),(0,ee.jsxs)("div",{className:"truss-estimator__card architrave-calculator",children:[(0,ee.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure your openings"}),(0,ee.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,ee.jsxs)("div",{className:"architrave-calculator__section",children:[(0,ee.jsx)("div",{className:"truss-estimator__section-heading",children:"Door openings"}),(0,ee.jsx)("p",{className:"architrave-calculator__hint",children:"Each opening is calculated as two side pieces plus one head piece."}),(0,ee.jsxs)("div",{className:"architrave-calculator__unit-row",children:[(0,ee.jsx)("span",{children:"Units"}),(0,ee.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,ee.jsx)("button",{type:"button",className:r==="m"?"is-selected":"",onClick:()=>i("m"),children:"Metres"}),(0,ee.jsx)("button",{type:"button",className:r==="ft"?"is-selected":"",onClick:()=>i("ft"),children:"Feet"})]})]}),(0,ee.jsxs)("div",{className:"architrave-calculator__dimensions-header",children:[(0,ee.jsx)("span",{children:"Opening"}),(0,ee.jsx)("span",{children:"Qty"}),(0,ee.jsxs)("span",{children:["Width (",r,")"]}),(0,ee.jsxs)("span",{children:["Height (",r,")"]}),(0,ee.jsx)("span",{})]}),w("Single doors",n,(k,T)=>q(o,k,T)),w("Double doors",l,(k,T)=>q(c,k,T)),p.map((k,T)=>w(`Alternative door ${T+1}`,k,(R,U)=>m(A=>A.map((Q,ie)=>ie===T?{...Q,[R]:U}:Q)),()=>m(R=>R.filter((U,A)=>A!==T)))),(0,ee.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>m(k=>[...k,ix()]),children:"+ Add alternative-sized door"})]}),(0,ee.jsxs)("div",{className:"architrave-calculator__section",children:[(0,ee.jsx)("div",{className:"truss-estimator__section-heading",children:"Standard profile"}),(0,ee.jsx)("p",{className:"architrave-calculator__hint",children:"Choose the profile you plan to use. Length calculations are the same for each profile."}),(0,ee.jsx)("div",{className:"architrave-calculator__profiles",children:Lv.filter(k=>ki("architrave",`architrave-${k.id}`)).map(k=>(0,ee.jsxs)("button",{type:"button",className:`truss-estimator__option-card${h===k.id?" is-selected":""}`,onClick:()=>d(k.id),children:[(0,ee.jsx)(nx,{profile:k.id}),(0,ee.jsx)("div",{className:"truss-estimator__option-title",children:k.label}),(0,ee.jsx)("div",{className:"truss-estimator__option-copy",children:k.blurb})]},k.id))})]}),(0,ee.jsxs)("div",{className:"architrave-calculator__section",children:[(0,ee.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,ee.jsx)("div",{className:"architrave-calculator__options",children:(0,ee.jsxs)("label",{className:"truss-estimator__field",children:[(0,ee.jsx)("span",{children:"Board length (m)"}),(0,ee.jsx)("input",{value:"4.40 m",disabled:!0})]})}),(0,ee.jsx)("p",{className:"architrave-calculator__hint",children:"Waste allows for mitred corners, cuts and damaged lengths."})]}),(0,ee.jsxs)("div",{className:"architrave-calculator__totals",children:[(0,ee.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ee.jsxs)("div",{className:"architrave-calculator__result-grid",children:[(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{children:"Architrave needed"}),(0,ee.jsxs)("strong",{children:[O.toFixed(2)," m"]})]}),(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{children:"Board lengths"}),(0,ee.jsx)("strong",{children:f})]})]})]}),(0,ee.jsxs)("div",{className:"architrave-calculator__actions",children:[(0,ee.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ee.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(g),disabled:O<=0,children:a})]})]})]})})}var Ni=$(Ye()),ae=$(F()),Qv=60,Gv=10,ox=.02,lx=.012,jv=1,Yv=4,sx=1.33,cx=1440,ux=1600,Qn=e=>Number.parseFloat(e)||0,px=(e,t=2)=>e.toFixed(t);function Kd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Ni.useState)("brick"),[n,o]=(0,Ni.useState)("engineering-red"),[l,c]=(0,Ni.useState)("metric"),[p,m]=(0,Ni.useState)(""),[h,d]=(0,Ni.useState)(""),[b,v]=(0,Ni.useState)(!0),q=l==="metric"?Qn(p)*Qn(h):Qn(p)*Qn(h)*.092903,f=q*(r==="brick"?Qv:Gv),u=Math.ceil(f),w=q*(r==="brick"?ox:lx)*sx/(jv+Yv),k=Math.ceil(w*jv*cx),T=Math.ceil(w*Yv*ux),R=l==="metric"?q:q*10.7639,U=[{key:r==="brick"?`brick-${n}`:"block",label:r==="brick"?{common:"Common concrete bricks","engineering-red":"Red engineering bricks","engineering-blue":"Blue engineering bricks"}[n]:"Blocks",qty:u,unit:"each",query:r==="brick"?"facing brick":"concrete block",category:"masonry"},...b?[{key:"mortar-cement",label:"General purpose cement",qty:k,unit:"kg",query:"general purpose cement",category:"cement"},{key:"mortar-sand",label:"Building sand",qty:T,unit:"kg",query:"building sand",category:"aggregate"}]:[]],A=Q=>{if(Q===l)return;let ie=Q==="imperial"?3.28084:.3048;m((Qn(p)*ie).toFixed(2)),d((Qn(h)*ie).toFixed(2)),c(Q)};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:"Brick and Block Calculator"}),(0,ae.jsx)("p",{children:"Estimate masonry units, sand and cement for a wall."})]}),(0,ae.jsxs)("div",{className:"truss-estimator__card brick-calculator",children:[(0,ae.jsx)("h2",{className:"truss-estimator__step-title",children:"Wall area and masonry type"}),(0,ae.jsx)("p",{className:"truss-estimator__step-sub",children:"Pick brick or block and enter the wall dimensions for unit counts plus the cement and sand for the mortar."}),(0,ae.jsxs)("div",{className:"brick-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Masonry type"}),(0,ae.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[["brick","Brick"],["block","Block"]].map(([Q,ie])=>(0,ae.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===Q?" is-selected":""}`,onClick:()=>i(Q),children:[(0,ae.jsx)("div",{className:"truss-estimator__option-title",children:ie}),(0,ae.jsxs)("div",{className:"truss-estimator__option-copy",children:["Approx. ",Q==="brick"?Qv:Gv," per m\xB2"]})]},Q))})]}),r==="brick"&&(0,ae.jsxs)("div",{className:"brick-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Brick type"}),(0,ae.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(([Q,ie,qe])=>(0,ae.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n===Q?" is-selected":""}`,onClick:()=>o(Q),children:[(0,ae.jsx)("div",{className:"truss-estimator__option-title",children:ie}),(0,ae.jsx)("div",{className:"truss-estimator__option-copy",children:qe})]},Q))})]}),(0,ae.jsxs)("div",{className:"brick-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,ae.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,ae.jsx)("button",{type:"button",className:l==="metric"?"is-selected":"",onClick:()=>A("metric"),children:"Metric"}),(0,ae.jsx)("button",{type:"button",className:l==="imperial"?"is-selected":"",onClick:()=>A("imperial"),children:"Imperial"})]}),(0,ae.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ae.jsxs)("label",{className:"truss-estimator__field",children:[(0,ae.jsxs)("span",{children:["Height (",l==="metric"?"m":"ft",")"]}),(0,ae.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:Q=>m(Q.target.value)})]}),(0,ae.jsxs)("label",{className:"truss-estimator__field",children:[(0,ae.jsxs)("span",{children:["Width (",l==="metric"?"m":"ft",")"]}),(0,ae.jsx)("input",{type:"number",min:"0",step:"0.01",value:h,onChange:Q=>d(Q.target.value)})]})]})]}),(0,ae.jsx)("div",{className:"brick-calculator__options",children:(0,ae.jsxs)("label",{className:"brick-calculator__checkbox",children:[(0,ae.jsx)("input",{type:"checkbox",checked:b,onChange:Q=>v(Q.target.checked)}),(0,ae.jsx)("span",{children:"Include mortar (cement and building sand, mixed 1:4)"})]})}),(0,ae.jsxs)("div",{className:"brick-calculator__totals",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ae.jsxs)("div",{className:"brick-calculator__result-grid",children:[(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Wall area"}),(0,ae.jsxs)("strong",{children:[px(R)," ",l==="metric"?"m\xB2":"ft\xB2"]})]}),(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:r==="brick"?"Bricks":"Blocks"}),(0,ae.jsx)("strong",{children:u.toLocaleString("en-GB")})]}),b?(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Cement"}),(0,ae.jsxs)("strong",{children:[k," kg"]})]}),(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Building sand"}),(0,ae.jsxs)("strong",{children:[T," kg"]})]})]}):null]}),(0,ae.jsx)("p",{className:"brick-calculator__note",children:"Estimate based on standard nominal sizes and 10mm joints. Mortar is a general purpose 1:4 cement and sand mix; quantities are approximate, so confirm the specification before ordering."})]}),(0,ae.jsxs)("div",{className:"brick-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?.(U),disabled:q<=0,children:a})]})]})]})})}var Ci=$(Ye()),W=$(F()),dx=1.54,mx=1440,Pd=e=>Number.parseFloat(e)||0,Pr={mot:{label:"MOT Type 1",blurb:"Sub-base for patios and driveways",density:1.7,query:"MOT type 1"},"sharp-sand":{label:"Sharp sand",blurb:"Bedding and general groundwork",density:1.6,query:"sharp sand"},gravel:{label:"20mm gravel",blurb:"Drainage and landscaping",density:1.6,query:"20mm gravel"}};function Jd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Ci.useState)("m"),[n,o]=(0,Ci.useState)(""),[l,c]=(0,Ci.useState)(""),[p,m]=(0,Ci.useState)(""),[h,d]=(0,Ci.useState)("concrete"),[b,v]=(0,Ci.useState)("mot"),q=r==="m"?1:.3048,O=Pd(n)*q*Pd(l)*q*Pd(p)*(r==="m"?.01:.0254),f=Pr[b],u=O*dx/7,g=u*mx,w=u*2,k=u*4,T=(U,A)=>Math.ceil(U*A*1e3),R=h==="concrete"?[{key:"cement",label:"General purpose cement",qty:Math.ceil(g),unit:"kg",query:"general purpose cement"},{key:"sharp-sand",label:"Sharp sand",qty:T(w,Pr["sharp-sand"].density),unit:"kg",query:Pr["sharp-sand"].query},{key:"gravel",label:"20mm gravel",qty:T(k,Pr.gravel.density),unit:"kg",query:Pr.gravel.query}]:[{key:b,label:f.label,qty:T(O,f.density),unit:"kg",query:f.query}];return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)("div",{className:"truss-estimator",children:[(0,W.jsxs)("div",{className:"quick-order-hero",children:[(0,W.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,W.jsx)("h1",{children:"Concrete and Aggregate Calculator"}),(0,W.jsx)("p",{children:"Calculate fixed site-mix concrete ingredients or aggregate bulk bags."})]}),(0,W.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,W.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose what you need"}),(0,W.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter the area and depth. The calculator works out the materials and adds them to your basket."}),(0,W.jsxs)("div",{className:"materials-calculator__section",children:[(0,W.jsx)("div",{className:"truss-estimator__section-heading",children:"Material type"}),(0,W.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,W.jsxs)("button",{type:"button",className:`truss-estimator__option-card${h==="concrete"?" is-selected":""}`,onClick:()=>d("concrete"),children:[(0,W.jsx)("div",{className:"truss-estimator__option-title",children:"Site-mixed concrete"}),(0,W.jsx)("div",{className:"truss-estimator__option-copy",children:"Cement, sharp sand and 20mm aggregate"})]}),(0,W.jsxs)("button",{type:"button",className:`truss-estimator__option-card${h==="aggregate"?" is-selected":""}`,onClick:()=>d("aggregate"),children:[(0,W.jsx)("div",{className:"truss-estimator__option-title",children:"Aggregates"}),(0,W.jsx)("div",{className:"truss-estimator__option-copy",children:"MOT Type 1, sharp sand or 20mm gravel"})]})]})]}),h==="aggregate"&&(0,W.jsxs)("div",{className:"materials-calculator__section",children:[(0,W.jsx)("div",{className:"truss-estimator__section-heading",children:"Aggregate type"}),(0,W.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.keys(Pr).map(U=>(0,W.jsxs)("button",{type:"button",className:`truss-estimator__option-card${b===U?" is-selected":""}`,onClick:()=>v(U),children:[(0,W.jsx)("div",{className:"truss-estimator__option-title",children:Pr[U].label}),(0,W.jsx)("div",{className:"truss-estimator__option-copy",children:Pr[U].blurb})]},U))})]}),(0,W.jsxs)("div",{className:"materials-calculator__section",children:[(0,W.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and depth"}),(0,W.jsxs)("div",{className:"materials-calculator__unit-row",children:[(0,W.jsx)("span",{children:"Units"}),(0,W.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,W.jsx)("button",{type:"button",className:r==="m"?"is-selected":"",onClick:()=>i("m"),children:"Metric"}),(0,W.jsx)("button",{type:"button",className:r==="ft"?"is-selected":"",onClick:()=>i("ft"),children:"Imperial"})]})]}),(0,W.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,W.jsxs)("label",{className:"truss-estimator__field",children:[(0,W.jsxs)("span",{children:["Length (",r,")"]}),(0,W.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:U=>o(U.target.value)})]}),(0,W.jsxs)("label",{className:"truss-estimator__field",children:[(0,W.jsxs)("span",{children:["Width (",r,")"]}),(0,W.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:U=>c(U.target.value)})]})]}),(0,W.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,W.jsxs)("span",{children:["Depth (",r==="m"?"cm":"inches",")"]}),(0,W.jsx)("input",{type:"number",min:"0",step:"0.1",value:p,onChange:U=>m(U.target.value)})]})]}),(0,W.jsxs)("div",{className:"materials-calculator__totals",children:[(0,W.jsx)("div",{className:"truss-estimator__section-heading",children:"Materials required"}),(0,W.jsx)("div",{className:"materials-calculator__result-grid",children:h==="concrete"?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("span",{children:"Cement"}),(0,W.jsxs)("strong",{children:[g.toFixed(0)," kg"]})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("span",{children:"Sharp sand"}),(0,W.jsxs)("strong",{children:[w.toFixed(2)," m\xB3"]})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("span",{children:"20mm aggregate"}),(0,W.jsxs)("strong",{children:[k.toFixed(2)," m\xB3"]})]})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("span",{children:f.label}),(0,W.jsxs)("strong",{children:[O.toFixed(2)," m\xB3"]})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("span",{children:"Approx. weight"}),(0,W.jsxs)("strong",{children:[(O*f.density).toFixed(2)," t"]})]}),(0,W.jsx)("div",{})]})}),(0,W.jsx)("p",{className:"materials-calculator__note",children:h==="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."})]}),(0,W.jsxs)("div",{className:"materials-calculator__actions",children:[(0,W.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,W.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(R),disabled:O<=0,children:a})]})]})]})})}var Ya=$(Ye());var B=$(F()),Gn=12,jn=8,dc=.56,$v=.21,za={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:{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}]}},qi=["range","grid","pictureFrame","substructure"],fx={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:""}},mc=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),fc=(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),hx=(e,t,a,r)=>{let i=mc(e,t,a),n=mc(e,t,r),o=mc(a,r,e),l=mc(a,r,t);return i===0&&fc(e,t,a)||n===0&&fc(e,t,r)||o===0&&fc(a,r,e)||l===0&&fc(a,r,t)?!0:i>0!=n>0&&o>0!=l>0},Id=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1){let i=e[(r+1)%e.length];for(let n=r+1;n<a;n+=1)if(!(n===r+1||t&&r===0&&n===a-1)&&hx(e[r],i,e[n],e[(n+1)%e.length]))return!0}return!1};function Fd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Ya.useState)(0),[n,o]=(0,Ya.useState)(fx),[l,c]=(0,Ya.useState)(1),[p,m]=(0,Ya.useState)({x:0,y:0}),[h,d]=(0,Ya.useState)(null),b=(0,Ya.useRef)(null),v=(0,Ya.useRef)(null),q=(0,Ya.useRef)(null),O=qi[r],f=n.range?za.ranges[n.range]:null,u=Gn/l,g=jn/l,w=(Gn-u)/2,k=(jn-g)/2,T=Math.max(-Gn,Math.min(Gn*2-u,w+p.x)),R=Math.max(-jn,Math.min(jn*2-g,k+p.y)),U=Number.parseFloat(n.quickLengthM),A=Number.parseFloat(n.quickWidthM),Q=U>0&&A>0,ie=z=>Math.abs(z.reduce((G,ne,pe)=>{let de=z[(pe+1)%z.length];return G+ne.x*de.y-de.x*ne.y},0))/2,qe=(z,G)=>Math.hypot(G.x-z.x,G.y-z.y),Te=n.isOutlineClosed?ie(n.points):0,Ze=n.isOutlineClosed?n.points.reduce((z,G,ne)=>z+qe(G,n.points[(ne+1)%n.points.length]),0):0,Ue=n.isOutlineClosed?n.points.reduce((z,G,ne)=>z+(n.wallSegments.has(ne)?0:qe(G,n.points[(ne+1)%n.points.length])),0):0,be=n.points.reduce((z,G)=>({x:z.x+G.x/n.points.length,y:z.y+G.y/n.points.length}),{x:0,y:0}),le=n.points.length>1?(()=>{let z=n.points[0],G=n.points[1],ne=qe(z,G),pe=ne?-(G.y-z.y)/ne:0,de=ne?(G.x-z.x)/ne:0,je=(z.x+G.x)/2,Oe=(z.y+G.y)/2,x=pe*(je-be.x)+de*(Oe-be.y)>=0?1:-1;return{x:je+pe*dc*x,y:Oe+de*dc*x}})():null,ze=(()=>{let z=n.range?za.ranges[n.range]:za.ranges.meridian,G=n.deckSizeMode==="quick"?U*A:Te,ne=n.deckSizeMode==="quick"?2*(U+A):Ue,pe=n.direction==="diagonal"?za.wastage.diagonal:za.wastage.straight,de=n.pictureFrame==="yes"?za.pictureFrame.extraWastage:0,Oe=G/(z.boardWidthM+za.boardGapM)/z.boardLengthM,x=Math.ceil(Oe*(1+pe+de)),_=Math.ceil(G*30*(1+pe+de)/200),E=za.joist.spacingOptions.find(N=>N.id===n.joistSpacing)??za.joist.spacingOptions[1],D=G/E.spacingM,V=Math.ceil(D);return{range:z,area:G,boardCount:x,screwBoxes:_,joistMetres:V,spacing:E}})(),wt=ze?[{key:`boards-${n.range??"meridian"}`,label:`Deck boards (${ze.range.label})`,qty:Math.round(ze.boardCount*ze.range.boardLengthM*100)/100,unit:"m",query:"timber decking board",category:"decking",calculatorWasteIncluded:!0},{key:"joists",label:"Treated C24 joists",qty:ze.joistMetres,unit:"m",query:"treated joist",category:"timber",calculatorWasteIncluded:!0},{key:"screws",label:"Green decking screws (200/box)",qty:ze.screwBoxes,unit:"box",query:"green decking screws",category:"fixings",calculatorWasteIncluded:!0}]:[],Z=()=>O==="range"?!!n.range:O==="grid"?n.deckSizeMode==="quick"?Q:n.isOutlineClosed&&Te>0:O==="pictureFrame"?!!n.pictureFrame&&!!n.direction:O==="substructure"?!!n.joistSpacing:!0,ce=r===qi.length-1?a:"Next",Ee=(z,G,ne=!1)=>{let pe=q.current?.getBoundingClientRect();if(!pe)return null;let de=ne?1:.25;return{x:Math.round(Math.max(T,Math.min(T+u,T+(z-pe.left)/pe.width*u))/de)*de,y:Math.round(Math.max(R,Math.min(R+g,R+(G-pe.top)/pe.height*g))/de)*de}},Ot=z=>{if(n.isOutlineClosed){let ne=z.target;if(ne!==z.currentTarget&&!ne.classList.contains("deck-outline__grid"))return;v.current={startX:z.clientX,startY:z.clientY,startViewX:T,startViewY:R},z.currentTarget.setPointerCapture(z.pointerId);return}if(n.drawMode!=="outline")return;let G=Ee(z.clientX,z.clientY,!0);G&&(d(null),o(ne=>{let pe=[...ne.points,G];return Id(pe,!1)?{...ne,drawError:"Edges cannot cross. Choose another corner."}:{...ne,points:pe,drawError:""}}))},jt=(z,G)=>{if(!n.isOutlineClosed){z.stopPropagation(),G===0&&n.points.length>=3&&o(ne=>({...ne,isOutlineClosed:!0,drawMode:"edges"}));return}z.stopPropagation(),b.current=G,z.currentTarget.setPointerCapture(z.pointerId)},Ne=z=>{if(v.current){let pe=q.current?.getBoundingClientRect();if(!pe)return;let de=v.current,je=de.startViewX-(z.clientX-de.startX)/pe.width*u,Oe=de.startViewY-(z.clientY-de.startY)/pe.height*g;m({x:je-w,y:Oe-k});return}!n.isOutlineClosed&&n.drawMode==="outline"&&d(Ee(z.clientX,z.clientY,!0));let G=b.current;if(G===null)return;let ne=Ee(z.clientX,z.clientY);ne&&o(pe=>{let de=pe.points.map((je,Oe)=>Oe===G?ne:je);return Id(de,!0)?{...pe,drawError:"Edges cannot cross. Move the corner to a different position."}:{...pe,points:de,drawError:""}})},_e=z=>{v.current=null,b.current=null,z.currentTarget.hasPointerCapture(z.pointerId)&&z.currentTarget.releasePointerCapture(z.pointerId)},De=z=>{o(G=>{let ne=new Set(G.wallSegments);return ne.has(z)?ne.delete(z):ne.add(z),{...G,wallSegments:ne}})},Ge=()=>{r===0?e():i(z=>z-1)},vt=()=>{Z()&&(r===qi.length-1?t?.(wt):i(z=>z+1))};return(0,B.jsx)(B.Fragment,{children:(0,B.jsxs)("div",{className:"truss-estimator",children:[(0,B.jsxs)("div",{className:"quick-order-hero",children:[(0,B.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,B.jsx)("h1",{children:"Decking Calculator"}),(0,B.jsx)("p",{children:"Estimate timber boards, joists and screws for your deck."})]}),(0,B.jsxs)("div",{className:"truss-estimator__card",children:[(0,B.jsxs)("div",{className:"truss-estimator__body",children:[O==="range"?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",qi.length]}),(0,B.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your timber decking"}),(0,B.jsx)("p",{className:"truss-estimator__step-sub",children:"Both options are fixed, orderable pressure-treated timber boards."}),(0,B.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(za.ranges).filter(([z])=>ki("decking",`boards-${z}`)).map(([z,G])=>(0,B.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.range===z?" is-selected":""}`,onClick:()=>o(ne=>({...ne,range:z})),children:[(0,B.jsx)("div",{className:"truss-estimator__option-title",children:G.label}),(0,B.jsx)("div",{className:"truss-estimator__option-copy",children:G.blurb}),(0,B.jsxs)("div",{className:"truss-estimator__option-copy",children:[G.boardLengthM,"m boards"]})]},z))})]}):null,O==="grid"?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",qi.length]}),(0,B.jsx)("h2",{className:"truss-estimator__step-title",children:"Tell us your deck size"}),(0,B.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,B.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,B.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.deckSizeMode==="quick"?" is-selected":""}`,onClick:()=>o(z=>({...z,deckSizeMode:"quick"})),children:"Quick estimate"}),(0,B.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.deckSizeMode==="draw"?" is-selected":""}`,onClick:()=>o(z=>({...z,deckSizeMode:"draw",drawMode:"outline"})),children:"Draw your space"})]}),n.deckSizeMode==="quick"?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,B.jsxs)("label",{className:"truss-estimator__field",children:[(0,B.jsx)("span",{children:"Length (m)"}),(0,B.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:n.quickLengthM,onChange:z=>o(G=>({...G,quickLengthM:z.target.value}))})]}),(0,B.jsxs)("label",{className:"truss-estimator__field",children:[(0,B.jsx)("span",{children:"Width (m)"}),(0,B.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:n.quickWidthM,onChange:z=>o(G=>({...G,quickWidthM:z.target.value}))})]})]}),(0,B.jsx)("div",{className:"truss-estimator__grid-hint",children:"For L-shaped decks, cut-outs, or sides against a wall, use Draw your space."}),Q?(0,B.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,B.jsxs)("div",{children:[(U*A).toFixed(2)," m\xB2 deck"]}),(0,B.jsxs)("div",{children:[(2*(U+A)).toFixed(2)," m perimeter"]})]}):null]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("div",{className:"truss-estimator__section-heading",children:"Draw your deck"}),(0,B.jsx)("p",{className:"truss-estimator__step-sub",children:"Click to add corners, then close the outline. Drag any handle to refine it."}),(0,B.jsxs)("div",{className:"deck-outline__toolbar",children:[n.isOutlineClosed?(0,B.jsxs)("div",{className:"deck-outline__summary",children:[(0,B.jsxs)("div",{children:[(0,B.jsx)("span",{children:"Deck area"}),(0,B.jsxs)("strong",{children:[Te.toFixed(2)," m\xB2"]})]}),(0,B.jsxs)("div",{children:[(0,B.jsx)("span",{children:"Perimeter"}),(0,B.jsxs)("strong",{children:[Ze.toFixed(2)," m"]})]}),(0,B.jsxs)("div",{children:[(0,B.jsx)("span",{children:"Wall edges"}),(0,B.jsx)("strong",{children:n.wallSegments.size>0?n.wallSegments.size:"None"})]}),(0,B.jsxs)("div",{children:[(0,B.jsx)("span",{children:"Visible edge"}),(0,B.jsxs)("strong",{children:[Ue.toFixed(2)," m"]})]})]}):null,(0,B.jsxs)("div",{className:"deck-outline__actions",children:[(0,B.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(z=>({...z,points:z.points.slice(0,-1)})),disabled:n.points.length===0||n.isOutlineClosed,children:"Undo"}),(0,B.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{d(null),o(z=>({...z,points:[],isOutlineClosed:!1,wallSegments:new Set,drawMode:"outline",drawError:""}))},disabled:n.points.length===0,children:"Clear"}),(0,B.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(z=>({...z,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,B.jsx)("div",{className:"deck-editor-layout",children:(0,B.jsxs)("div",{className:"deck-editor-layout__canvas-column",children:[(0,B.jsxs)("div",{className:"deck-outline",children:[(0,B.jsxs)("svg",{ref:q,className:`deck-outline__canvas${n.isOutlineClosed?" is-pan-mode":""}`,viewBox:`${T} ${R} ${u} ${g}`,preserveAspectRatio:"none","aria-label":"Deck outline drawing area",onPointerDown:Ot,onPointerMove:Ne,onPointerUp:_e,onPointerLeave:()=>{d(null),v.current||(b.current=null)},children:[(0,B.jsx)("defs",{children:(0,B.jsx)("pattern",{id:"deck-outline-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,B.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,B.jsx)("rect",{x:-Gn,y:-jn,width:Gn*3,height:jn*3,className:"deck-outline__grid",fill:"url(#deck-outline-grid)"}),n.points.length>1?(0,B.jsx)("polyline",{className:"deck-outline__preview",points:n.points.map(z=>`${z.x},${z.y}`).join(" ")}):null,n.isOutlineClosed?(0,B.jsx)("polygon",{className:"deck-outline__shape",points:n.points.map(z=>`${z.x},${z.y}`).join(" "),stroke:"none"}):null,n.points.length>1?n.points.slice(0,n.isOutlineClosed?void 0:-1).map((z,G)=>{let ne=n.points[n.isOutlineClosed?(G+1)%n.points.length:G+1],pe=qe(z,ne),de=pe?-(ne.y-z.y)/pe:0,je=pe?(ne.x-z.x)/pe:0,Oe=(z.x+ne.x)/2,x=(z.y+ne.y)/2,_=de*(Oe-be.x)+je*(x-be.y)>=0?1:-1,E=Oe+de*dc*_,D=x+je*dc*_;return(0,B.jsxs)("g",{children:[(0,B.jsx)("line",{className:"deck-outline__edge-hit",x1:z.x,y1:z.y,x2:ne.x,y2:ne.y,onClick:n.isOutlineClosed?()=>De(G):void 0}),(0,B.jsx)("line",{className:`deck-outline__edge${n.wallSegments.has(G)?" is-wall":""}`,x1:z.x,y1:z.y,x2:ne.x,y2:ne.y,pointerEvents:"none"}),(0,B.jsxs)("text",{className:`deck-outline__edge-label${n.wallSegments.has(G)?" is-wall":""}`,x:E,y:D,textAnchor:"middle",dominantBaseline:"central",fontSize:$v/l,children:[pe.toFixed(2)," m"]})]},`segment-${G}`)}):null,!n.isOutlineClosed&&n.points.length>0&&h?(()=>{let z=n.points[n.points.length-1],G=qe(z,h);if(!G)return null;let ne=-(h.y-z.y)/G,pe=(h.x-z.x)/G,de=(z.x+h.x)/2,je=(z.y+h.y)/2;return(0,B.jsxs)("g",{className:"deck-outline__live-measurement",children:[(0,B.jsx)("line",{x1:z.x,y1:z.y,x2:h.x,y2:h.y}),(0,B.jsxs)("text",{x:de+ne*.34,y:je+pe*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:$v/l,children:[G.toFixed(2)," m"]})]})})():null,n.points.map((z,G)=>(0,B.jsx)("circle",{className:"deck-outline__point",cx:z.x,cy:z.y,r:"0.13",onPointerDown:ne=>jt(ne,G)},`point-${G}`))]}),(0,B.jsxs)("div",{className:"deck-outline__zoom","aria-label":"Zoom controls",children:[(0,B.jsx)("button",{type:"button",onClick:()=>c(z=>Math.max(.5,z-.25)),disabled:l===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,B.jsxs)("span",{children:[Math.round(l*100),"%"]}),(0,B.jsx)("button",{type:"button",onClick:()=>c(z=>Math.min(1,z+.25)),disabled:l===1,"aria-label":"Zoom in",children:"+"})]}),n.isOutlineClosed&&n.wallSegments.size===0&&le?(0,B.jsx)("div",{className:"deck-outline__edge-prompt",role:"status",style:{left:`${(le.x-T)/u*100}%`,top:`${(le.y-R)/g*100}%`},children:"Tap an edge to mark it as a wall, or leave it as a visible edge."}):null,!n.isOutlineClosed&&n.points.length>=3?(0,B.jsx)("button",{type:"button",className:"deck-outline__close",onClick:()=>o(z=>Id(z.points,!0)?{...z,drawError:"Edges cannot cross. Adjust the outline before finishing."}:{...z,isOutlineClosed:!0,drawMode:"edges",drawError:""}),children:"Finish outline"}):null]}),(0,B.jsxs)("div",{className:"deck-outline__supporting",children:[(0,B.jsx)("div",{className:"truss-estimator__grid-hint",children:n.isOutlineClosed?"Drag a corner handle to refine the outline.":"Add at least three corners, then click Finish outline."}),n.drawError?(0,B.jsx)("div",{className:"deck-outline__error",role:"alert",children:n.drawError}):null]})]})})]})]}):null,O==="pictureFrame"?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",qi.length]}),(0,B.jsx)("h2",{className:"truss-estimator__step-title",children:"Picture frame border?"}),(0,B.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,B.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(z=>(0,B.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.pictureFrame===z.id?" is-selected":""}`,onClick:()=>o(G=>({...G,pictureFrame:z.id})),children:[(0,B.jsx)("img",{className:"truss-estimator__visual-card-img",src:It(z.img),alt:""}),(0,B.jsx)("span",{children:z.label})]},z.id))}),(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("div",{className:"truss-estimator__section-heading",children:"Board direction"}),(0,B.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(z=>(0,B.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.direction===z.id?" is-selected":""}`,onClick:()=>o(G=>({...G,direction:z.id})),children:[(0,B.jsx)("img",{className:"truss-estimator__visual-card-img",src:It(z.img),alt:""}),(0,B.jsx)("span",{children:z.label})]},z.id))})]})]}):null,O==="substructure"?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",qi.length]}),(0,B.jsx)("h2",{className:"truss-estimator__step-title",children:"Substructure"}),(0,B.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,B.jsx)("div",{className:"truss-estimator__section-heading",children:"Joist spacing"}),(0,B.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:za.joist.spacingOptions.map(z=>(0,B.jsx)("button",{type:"button",className:`truss-estimator__option-card${n.joistSpacing===z.id?" is-selected":""}`,onClick:()=>o(G=>({...G,joistSpacing:z.id})),children:(0,B.jsx)("div",{className:"truss-estimator__option-title",children:z.label})},z.id))})]}):null]}),(0,B.jsxs)("div",{className:"truss-estimator__nav",children:[(0,B.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:Ge,children:"Back"}),(0,B.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:vt,disabled:!Z(),children:[(0,B.jsx)("span",{children:ce}),(0,B.jsx)("span",{className:"arrow",children:(0,B.jsx)(Qt,{})})]})]})]})]})})}var Sa=$(Ye());var Y=$(F()),Vv=12,Xv=30,Yn=12,$n=8,Zv=.56,ka={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 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}}},Ei=["range","height","gate","posts"],Wd=e=>Number(e)<=1.2?"6":"8",Kv=(e,t)=>ki("fencing",`panels-${e??"boundary"}-${t}`),Pv=(e,t)=>!t||ki("fencing",e==="concrete"?`concrete-intermediate-${Wd(t)}`:`timber-post-${Wd(t)}`),gx={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:""}},hc=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),gc=(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),bx=(e,t,a,r)=>{let i=hc(e,t,a),n=hc(e,t,r),o=hc(a,r,e),l=hc(a,r,t);return i===0&&gc(e,t,a)||n===0&&gc(e,t,r)||o===0&&gc(a,r,e)||l===0&&gc(a,r,t)?!0:i>0!=n>0&&o>0!=l>0},bc=(e,t)=>{let a=t?e.length:e.length-1;for(let r=0;r<a;r+=1)for(let i=r+1;i<a;i+=1)if(!(i===r+1||t&&r===0&&i===a-1)&&bx(e[r],e[(r+1)%e.length],e[i],e[(i+1)%e.length]))return!0;return!1};function em({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Sa.useState)(0),[n,o]=(0,Sa.useState)(gx),l=(0,Sa.useRef)(null),c=(0,Sa.useRef)(null),[p,m]=(0,Sa.useState)(1),[h,d]=(0,Sa.useState)({x:0,y:0}),[b,v]=(0,Sa.useState)(null),q=(0,Sa.useRef)(null),O=(0,Sa.useRef)(null),f=(0,Sa.useRef)(null),u=Ei[r],g=n.range?ka.ranges[n.range]:null,w=Yn/p,k=$n/p,T=(Yn-w)/2,R=($n-k)/2,U=Math.max(-Yn,Math.min(Yn*2-w,T+h.x)),A=Math.max(-$n,Math.min($n*2-k,R+h.y)),Q=n.boundaryPoints.reduce((x,_)=>({x:x.x+_.x/Math.max(1,n.boundaryPoints.length),y:x.y+_.y/Math.max(1,n.boundaryPoints.length)}),{x:0,y:0}),ie=x=>{let _=new Set,E=[];return x.forEach(D=>{let[V,N]=D.split(",").map(Number),L=[{key:`H,${V},${N}`,type:"H",x:V,y:N},{key:`H,${V},${N+1}`,type:"H",x:V,y:N+1},{key:`V,${V},${N}`,type:"V",x:V,y:N},{key:`V,${V+1},${N}`,type:"V",x:V+1,y:N}],X=[!x.has(`${V},${N-1}`),!x.has(`${V},${N+1}`),!x.has(`${V-1},${N}`),!x.has(`${V+1},${N}`)];L.forEach((ue,xe)=>{X[xe]&&!_.has(ue.key)&&(_.add(ue.key),E.push(ue))})}),E},qe=(x,_)=>ie(x).filter(E=>!_.has(E.key)),Te=(x,_)=>qe(x,_).length,Ze=(x,_)=>{let E={};qe(x,_).forEach(V=>{var N,L,X,ue;V.type==="H"?((E[N=`${V.x},${V.y}`]||(E[N]=[])).push("H"),(E[L=`${V.x+1},${V.y}`]||(E[L]=[])).push("H")):((E[X=`${V.x},${V.y}`]||(E[X]=[])).push("V"),(E[ue=`${V.x},${V.y+1}`]||(E[ue]=[])).push("V"))});let D=0;return Object.values(E).forEach(V=>{(V.length===1||V.length===2&&V[0]!==V[1]||V.length>=3)&&(D+=1)}),D},be=(()=>{let x=n.range?ka.ranges[n.range]:ka.ranges.boundary,_=n.height??"1.8",E=n.boundaryMode==="quick"?Math.max(0,Number.parseFloat(n.quickLengthM)||0):n.boundaryClosed?n.boundaryPoints.slice(0,-1).reduce((Yt,hr,_t)=>Yt+(n.excludedBoundaryEdges.has(_t)?0:Math.hypot(n.boundaryPoints[_t+1].x-hr.x,n.boundaryPoints[_t+1].y-hr.y)),0):0,D=n.gateType&&n.gateType!=="none"?Number.parseFloat(n.gateWidthM)||ka.gate[n.gateType].widthDefault:0,V=Math.max(0,E-D),N=V>0?Math.ceil(V/x.panelWidthM):0,L=n.boundaryPoints.length>2&&n.boundaryPoints[0].x===n.boundaryPoints[n.boundaryPoints.length-1].x&&n.boundaryPoints[0].y===n.boundaryPoints[n.boundaryPoints.length-1].y,X=n.boundaryMode==="quick"?V>0?2:0:n.boundaryClosed?n.boundaryPoints.slice(0,L?-1:void 0).reduce((Yt,hr,_t)=>{let Zn=_t>0&&!n.excludedBoundaryEdges.has(_t-1),wm=_t<n.boundaryPoints.length-1&&!n.excludedBoundaryEdges.has(_t);return Yt+(Zn||wm?1:0)},0):0,ue=V>0?Math.ceil(V/x.panelWidthM)+1:0,xe=Math.max(0,ue-X),yt=n.mountingType?ka.mounting[n.mountingType]:ka.mounting.concrete,ft=n.gateType&&n.gateType!=="none"?2:0,At=xe+X+ft,bm=n.mountingType==="postcrete"?At*ka.mounting.postcrete.bagsPerPost:0,Jr=n.gravelBoard==="yes"?N:0;return{range:x,height:_,totalEdgeM:E,fencedLengthM:V,gateWidthM:D,panelsCount:N,cornerPostCount:X,intermediatePostCount:xe,gatePostCount:ft,totalPostCount:At,bagsCount:bm,gravelCount:Jr,capCount:At,mounting:yt}})(),le=n.gateType&&n.gateType!=="none"?ka.gate[n.gateType].label:null,ot=Wd(be.height),ze=be?[{key:`panels-${n.range??"boundary"}-${be.height}`,label:`${be.range.label} panels (${be.height}m)`,qty:be.panelsCount,unit:"each",query:"fence panel",category:"fencing"},...n.mountingType==="concrete"?[{key:`concrete-intermediate-${ot}`,label:"Intermediate concrete posts",qty:be.intermediatePostCount,unit:"each",query:"concrete fence post",category:"fencing"},{key:`concrete-end-${ot}`,label:"End and corner concrete posts",qty:be.cornerPostCount+be.gatePostCount,unit:"each",query:"concrete end post",category:"fencing"}]:[{key:`timber-post-${ot}`,label:"Timber fence posts",qty:be.totalPostCount,unit:"each",query:"timber fence post",category:"fencing"},{key:"postcrete",label:"Postcrete",qty:be.bagsCount,unit:"bag",query:"postcrete",category:"cement"}],...le?[{key:`gate-${n.range??"boundary"}`,label:n.range==="skyline"?"Single feather edge gate":"Single lap gate",qty:1,unit:"each",query:n.range==="skyline"?"feather edge gate":"lap gate",category:"fencing"}]:[],...be.gravelCount>0?[{key:"gravel-boards",label:"Concrete gravel boards",qty:be.gravelCount,unit:"each",query:"gravel board",category:"fencing"}]:[]]:[],wt=()=>{if(u==="range"){let x=n.boundaryMode==="quick"?(Number.parseFloat(n.quickLengthM)||0)>0:n.boundaryClosed&&n.boundaryPoints.length>=2;return!!n.range&&x}return u==="height"?!!n.height&&!!n.gravelBoard:u==="gate"?!!n.gateType&&(n.gateType==="none"||n.gateWidthM.trim()!==""):u==="posts"?!!n.mountingType:!0},Z=r===Ei.length-1?a:"Next",ce=x=>{o(_=>{let E=x(new Set(_.grid)),D=new Set([..._.excludedEdges].filter(V=>ie(E).some(N=>N.key===V)));return{..._,grid:E,excludedEdges:D}})},Ee=(x,_,E)=>{ce(D=>{let V=`${x},${_}`;return E?D.add(V):D.delete(V),D})},Ot=(x,_,E,D,V)=>{let N=x,L=_,X=Math.abs(E-x),ue=x<E?1:-1,xe=-Math.abs(D-_),yt=_<D?1:-1,ft=X+xe;for(;Ee(N,L,V),!(N===E&&L===D);){let At=2*ft;At>=xe&&(ft+=xe,N+=ue),At<=X&&(ft+=X,L+=yt)}},jt=(x,_)=>{let E=c.current?.getBoundingClientRect();if(!E)return null;let D=Math.floor((x-E.left)/Xv),V=Math.floor((_-E.top)/Xv);return D<0||V<0||D>=Vv||V>=Vv?null:{x:D,y:V}},Ne=x=>{if(n.gridMode!=="draw")return;let _=jt(x.clientX,x.clientY);if(!_)return;x.preventDefault();let E=`${_.x},${_.y}`,D=!n.grid.has(E);l.current={active:!0,paintValue:D,lastX:_.x,lastY:_.y},x.currentTarget.setPointerCapture(x.pointerId),Ee(_.x,_.y,D)},_e=x=>{let _=l.current;if(!_?.active)return;let E=jt(x.clientX,x.clientY);E&&(E.x===_.lastX&&E.y===_.lastY||(Ot(_.lastX,_.lastY,E.x,E.y,_.paintValue),l.current={..._,lastX:E.x,lastY:E.y}))},De=x=>{l.current?.active&&(l.current=null,x.currentTarget.releasePointerCapture(x.pointerId))},Ge=(x,_,E=!1)=>{let D=f.current?.getBoundingClientRect();if(!D)return null;let V=E?1:.25;return{x:Math.round(Math.max(U,Math.min(U+w,U+(x-D.left)/D.width*w))/V)*V,y:Math.round(Math.max(A,Math.min(A+k,A+(_-D.top)/D.height*k))/V)*V}},vt=x=>{if(n.boundaryClosed){let E=x.target;if(E!==x.currentTarget&&!E.classList.contains("fence-boundary__grid"))return;O.current={startX:x.clientX,startY:x.clientY,startViewX:U,startViewY:A},x.currentTarget.setPointerCapture(x.pointerId);return}let _=Ge(x.clientX,x.clientY,!0);_&&(v(null),o(E=>{let D=[...E.boundaryPoints,_];return bc(D,!1)?{...E}:{...E,boundaryPoints:D}}))},z=(x,_)=>{if(x.stopPropagation(),!n.boundaryClosed){if(_!==0||n.boundaryPoints.length<3)return;o(E=>bc(E.boundaryPoints,!0)?E:{...E,boundaryPoints:[...E.boundaryPoints,E.boundaryPoints[0]],boundaryClosed:!0});return}q.current=_,x.currentTarget.setPointerCapture(x.pointerId)},G=x=>{if(O.current){let E=f.current?.getBoundingClientRect();if(!E)return;let D=O.current,V=D.startViewX-(x.clientX-D.startX)/E.width*w,N=D.startViewY-(x.clientY-D.startY)/E.height*k;d({x:V-T,y:N-R});return}if(n.boundaryClosed||v(Ge(x.clientX,x.clientY,!0)),q.current===null)return;let _=Ge(x.clientX,x.clientY);_&&o(E=>{let D=E.boundaryPoints.length>2&&E.boundaryPoints[0].x===E.boundaryPoints[E.boundaryPoints.length-1].x&&E.boundaryPoints[0].y===E.boundaryPoints[E.boundaryPoints.length-1].y,V=E.boundaryPoints.map((N,L)=>{let X=L===q.current,ue=D&&q.current===0&&L===E.boundaryPoints.length-1;return X||ue?_:N});return bc(V,!1)?E:{...E,boundaryPoints:V}})},ne=x=>{O.current=null,q.current=null,x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId)},pe=x=>{o(_=>{let E=new Set(_.excludedBoundaryEdges);return E.has(x)?E.delete(x):E.add(x),{..._,excludedBoundaryEdges:E}})},de=()=>{r===0?e():i(x=>x-1)},je=()=>{wt()&&(r===Ei.length-1?t?.(ze):i(x=>x+1))},Oe=ie(n.grid);return(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:"Fencing Calculator"}),(0,Y.jsx)("p",{children:"Estimate panels, posts and cost for your fence line in a few steps."})]}),(0,Y.jsxs)("div",{className:"truss-estimator__card",children:[(0,Y.jsxs)("div",{className:"truss-estimator__body",children:[u==="range"?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ei.length]}),(0,Y.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your fence panels"}),(0,Y.jsx)("p",{className:"truss-estimator__step-sub",children:"The calculator uses fixed, orderable timber panels from the catalogue."}),(0,Y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(ka.ranges).map(([x,_])=>(0,Y.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.range===x?" is-selected":""}`,onClick:()=>o(E=>({...E,range:x,height:E.height&&Kv(x,E.height)?E.height:null})),children:[(0,Y.jsx)("div",{className:"truss-estimator__option-title",children:_.label}),(0,Y.jsx)("div",{className:"truss-estimator__option-copy",children:_.blurb})]},x))})]}):null,u==="range"?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)("div",{className:"truss-estimator__section-heading",children:"Measure your fence line"}),(0,Y.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,Y.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,Y.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.boundaryMode==="quick"?" is-selected":""}`,onClick:()=>o(x=>({...x,boundaryMode:"quick"})),children:"Quick estimate"}),(0,Y.jsx)("button",{type:"button",className:`truss-estimator__toggle${n.boundaryMode==="draw"?" is-selected":""}`,onClick:()=>o(x=>({...x,boundaryMode:"draw"})),children:"Draw your boundary"})]}),n.boundaryMode==="quick"?(0,Y.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact fence-boundary__quick-field",children:[(0,Y.jsx)("span",{children:"Total fence length (m)"}),(0,Y.jsx)("input",{type:"number",min:"0",step:"0.1",value:n.quickLengthM,onChange:x=>o(_=>({..._,quickLengthM:x.target.value}))})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)("div",{className:"fence-boundary__toolbar",children:(0,Y.jsxs)("div",{className:"fence-boundary__actions",children:[(0,Y.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(x=>({...x,boundaryPoints:x.boundaryPoints.slice(0,-1),boundaryClosed:!1,excludedBoundaryEdges:new Set})),disabled:n.boundaryPoints.length===0||n.boundaryClosed,children:"Undo"}),(0,Y.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{d({x:0,y:0}),v(null),o(x=>({...x,boundaryPoints:[],boundaryClosed:!1,excludedBoundaryEdges:new Set}))},disabled:n.boundaryPoints.length===0,children:"Clear"}),(0,Y.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,Y.jsxs)("div",{className:"fence-boundary",children:[(0,Y.jsxs)("svg",{ref:f,className:`fence-boundary__canvas${n.boundaryClosed?" is-pan-mode":""}`,viewBox:`${U} ${A} ${w} ${k}`,preserveAspectRatio:"none","aria-label":"Fence boundary drawing area",onPointerDown:vt,onPointerMove:G,onPointerUp:ne,onPointerLeave:()=>{v(null),O.current||(q.current=null)},children:[(0,Y.jsx)("defs",{children:(0,Y.jsx)("pattern",{id:"fence-boundary-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,Y.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,Y.jsx)("rect",{x:-Yn,y:-$n,width:Yn*3,height:$n*3,className:"fence-boundary__grid",fill:"url(#fence-boundary-grid)"}),n.boundaryPoints.length>1?(0,Y.jsx)("polyline",{className:"fence-boundary__preview",points:n.boundaryPoints.map(x=>`${x.x},${x.y}`).join(" ")}):null,n.boundaryPoints.length>1?n.boundaryPoints.slice(0,-1).map((x,_)=>{let E=n.boundaryPoints[_+1],D=Math.hypot(E.x-x.x,E.y-x.y),V=D?-(E.y-x.y)/D:0,N=D?(E.x-x.x)/D:0,L=(x.x+E.x)/2,X=(x.y+E.y)/2,ue=V*(L-Q.x)+N*(X-Q.y)>=0?1:-1,xe=L+V*Zv*ue,yt=X+N*Zv*ue;return(0,Y.jsxs)("g",{children:[(0,Y.jsx)("line",{className:"fence-boundary__edge-hit",x1:x.x,y1:x.y,x2:E.x,y2:E.y,onClick:n.boundaryClosed?()=>pe(_):void 0}),(0,Y.jsx)("line",{className:`fence-boundary__edge${n.excludedBoundaryEdges.has(_)?" is-excluded":""}`,x1:x.x,y1:x.y,x2:E.x,y2:E.y,pointerEvents:"none"}),(0,Y.jsxs)("text",{className:`fence-boundary__edge-label${n.excludedBoundaryEdges.has(_)?" is-excluded":""}`,x:xe,y:yt,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[D.toFixed(2)," m"]})]},`fence-edge-${_}`)}):null,!n.boundaryClosed&&n.boundaryPoints.length>0&&b?(()=>{let x=n.boundaryPoints[n.boundaryPoints.length-1],_=Math.hypot(b.x-x.x,b.y-x.y);if(!_)return null;let E=-(b.y-x.y)/_,D=(b.x-x.x)/_,V=(x.x+b.x)/2,N=(x.y+b.y)/2;return(0,Y.jsxs)("g",{className:"fence-boundary__live-measurement",children:[(0,Y.jsx)("line",{x1:x.x,y1:x.y,x2:b.x,y2:b.y}),(0,Y.jsxs)("text",{x:V+E*.34,y:N+D*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[_.toFixed(2)," m"]})]})})():null,n.boundaryPoints.map((x,_)=>_>0&&_===n.boundaryPoints.length-1&&x.x===n.boundaryPoints[0]?.x&&x.y===n.boundaryPoints[0]?.y?null:(0,Y.jsx)("circle",{className:`fence-boundary__point${!n.boundaryClosed&&_===0&&n.boundaryPoints.length>=3?" is-close-target":""}`,cx:x.x,cy:x.y,r:"0.13",onPointerDown:E=>z(E,_)},`fence-point-${_}`))]}),(0,Y.jsxs)("div",{className:"fence-boundary__zoom","aria-label":"Zoom controls",children:[(0,Y.jsx)("button",{type:"button",onClick:()=>m(x=>Math.max(.5,x-.25)),disabled:p===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,Y.jsxs)("span",{children:[Math.round(p*100),"%"]}),(0,Y.jsx)("button",{type:"button",onClick:()=>m(x=>Math.min(1,x+.25)),disabled:p===1,"aria-label":"Zoom in",children:"+"})]}),!n.boundaryClosed&&n.boundaryPoints.length>=2?(0,Y.jsx)("button",{type:"button",className:"fence-boundary__close",onClick:()=>o(x=>bc(x.boundaryPoints,!1)?x:{...x,boundaryClosed:!0}),children:"Finish fence line"}):null]}),(0,Y.jsx)("div",{className:"truss-estimator__grid-hint",children:n.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,Y.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,Y.jsx)("div",{children:n.boundaryMode==="quick"?`${(Number.parseFloat(n.quickLengthM)||0).toFixed(2)} m fence line`:`${be.totalEdgeM.toFixed(2)} m fence line`}),n.boundaryMode==="draw"&&n.boundaryClosed?(0,Y.jsxs)("div",{children:[be.cornerPostCount," corner/end posts"]}):null]})]}):null,null,u==="height"?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ei.length]}),(0,Y.jsx)("h2",{className:"truss-estimator__step-title",children:"Fence height"}),(0,Y.jsx)("p",{className:"truss-estimator__step-sub",children:"Select the nearest available panel height."}),(0,Y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:ka.heights.filter(x=>Kv(n.range,x)).map(x=>(0,Y.jsx)("button",{type:"button",className:`truss-estimator__visual-card${n.height===x?" is-selected":""}`,onClick:()=>o(_=>({..._,height:x,mountingType:_.mountingType&&Pv(_.mountingType,x)?_.mountingType:null})),children:(0,Y.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--tall",src:It(`/fencing/height/${x}.webp`),alt:""})},x))}),(0,Y.jsx)("div",{className:"truss-estimator__section-heading",children:"Gravel board?"}),(0,Y.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,Y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${n.gravelBoard===x.id?" is-selected":""}`,onClick:()=>o(_=>({..._,gravelBoard:x.id})),children:[(0,Y.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:It(x.img),alt:""}),(0,Y.jsx)("span",{children:x.label})]},x.id))})]}):null,u==="gate"?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ei.length]}),(0,Y.jsx)("h2",{className:"truss-estimator__step-title",children:"Do you need a gate?"}),(0,Y.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,Y.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,Y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${n.gateType===x.id?" is-selected":""}`,onClick:()=>o(_=>({..._,gateType:x.id,gateWidthM:x.id==="none"?"":String(ka.gate[x.id].widthDefault)})),children:[(0,Y.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:It(x.img),alt:""}),(0,Y.jsx)("span",{children:x.label})]},x.id))}),n.gateType&&n.gateType!=="none"?(0,Y.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,Y.jsx)("span",{children:"Gate width (m)"}),(0,Y.jsx)("input",{type:"text",inputMode:"decimal",value:n.gateWidthM,onChange:x=>o(_=>({..._,gateWidthM:x.target.value}))})]}):null]}):null,u==="posts"?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ei.length]}),(0,Y.jsx)("h2",{className:"truss-estimator__step-title",children:"Posts and fixing type"}),(0,Y.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose how the posts will be set."}),(0,Y.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(ka.mounting).filter(([x])=>Pv(x,n.height)).map(([x,_])=>(0,Y.jsxs)("button",{type:"button",className:`truss-estimator__option-card${n.mountingType===x?" is-selected":""}`,onClick:()=>o(E=>({...E,mountingType:x})),children:[(0,Y.jsx)("div",{className:"truss-estimator__option-title",children:_.label}),(0,Y.jsx)("div",{className:"truss-estimator__option-copy",children:_.blurb})]},x))})]}):null]}),(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:de,children:"Back"}),(0,Y.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:je,disabled:!wt(),children:[(0,Y.jsx)("span",{children:Z}),(0,Y.jsx)("span",{className:"arrow",children:(0,Y.jsx)(Qt,{})})]})]})]})]})})}var wc=$(Ye()),ge=$(F()),Jv={floor:{label:"Floor between rooms",product:"Knauf Acoustic Roll",thickness:"100mm",coverage:12.36},ground:{label:"Ground floor",product:"Rigid PIR insulation board",thickness:"100mm",coverage:2.88},wall:{label:"Cavity wall",product:"Celotex CW4100",thickness:"100mm",coverage:3.24},roof:{label:"Pitched roof",product:"Kingspan K107",thickness:"100mm",coverage:8.64},loft:{label:"Loft",product:"Knauf Loft Roll 44",thickness:"100mm",coverage:13.89}};function tm({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,wc.useState)("floor"),[n,o]=(0,wc.useState)(""),[l,c]=(0,wc.useState)(""),p=Number.parseFloat(n)*Number.parseFloat(l)||0,m=Jv[r],h=Math.ceil(p/m.coverage),d=[{key:`insulation-${r}`,label:`${m.product} ${m.thickness}`,qty:Math.round(p*100)/100,unit:"m2",query:m.product,category:"insulation"}],b=Object.entries(Jv);return(0,ge.jsx)(ge.Fragment,{children:(0,ge.jsxs)("div",{className:"truss-estimator",children:[(0,ge.jsxs)("div",{className:"quick-order-hero",children:[(0,ge.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ge.jsx)("h1",{children:"Insulation Calculator"}),(0,ge.jsx)("p",{children:"Estimate insulation coverage and pack quantities for floors, walls, roofs and lofts."})]}),(0,ge.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,ge.jsx)("h2",{className:"truss-estimator__step-title",children:"Where and what you are insulating"}),(0,ge.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the application and product, and enter the area, for coverage and pack quantities."}),(0,ge.jsxs)("div",{className:"materials-calculator__section",children:[(0,ge.jsx)("div",{className:"truss-estimator__section-heading",children:"Application"}),(0,ge.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:b.map(([v,q])=>(0,ge.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===v?" is-selected":""}`,onClick:()=>i(v),children:[(0,ge.jsx)("div",{className:"truss-estimator__option-title",children:q.label}),(0,ge.jsxs)("div",{className:"truss-estimator__option-copy",children:[q.product,", ",q.thickness]})]},v))})]}),(0,ge.jsxs)("div",{className:"materials-calculator__section",children:[(0,ge.jsx)("div",{className:"truss-estimator__section-heading",children:"Area"}),(0,ge.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ge.jsxs)("label",{className:"truss-estimator__field",children:[(0,ge.jsx)("span",{children:"Length (m)"}),(0,ge.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:v=>o(v.target.value)})]}),(0,ge.jsxs)("label",{className:"truss-estimator__field",children:[(0,ge.jsx)("span",{children:"Width (m)"}),(0,ge.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:v=>c(v.target.value)})]})]})]}),(0,ge.jsxs)("div",{className:"materials-calculator__totals",children:[(0,ge.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ge.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,ge.jsxs)("div",{children:[(0,ge.jsx)("span",{children:"Insulated area"}),(0,ge.jsxs)("strong",{children:[p.toFixed(2)," m\xB2"]})]}),(0,ge.jsxs)("div",{children:[(0,ge.jsx)("span",{children:m.product}),(0,ge.jsxs)("strong",{children:[h," packs"]})]})]}),(0,ge.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,ge.jsxs)("div",{className:"materials-calculator__actions",children:[(0,ge.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ge.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(d),disabled:p<=0,children:a})]})]})]})})}var Vn=$(Ye());var K=$(F()),wx=10,vx=1.9*.762,yx=1.9*1.524,vc=()=>({height:"",width:""}),yc=e=>Number.parseFloat(e)||0,Iv=({height:e,width:t})=>yc(e)*yc(t);function am({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Vn.useState)([vc()]),[n,o]=(0,Vn.useState)([vc()]),[l,c]=(0,Vn.useState)("0"),[p,m]=(0,Vn.useState)("0"),[h,d]=(0,Vn.useState)(1),b=r.reduce((k,T)=>k+Iv(T),0),v=n.reduce((k,T)=>k+Iv(T),0),q=yc(l)*vx+yc(p)*yx,O=Math.max(0,b-v-q),f=O*h/wx,u={key:"paint-emulsion",label:"Matt emulsion, brilliant white",qty:Math.round(f*10)/10,unit:"litres",query:"matt emulsion brilliant white"},g=dl("paint",u)!=null,w=(k,T,R,U)=>{k(A=>A.map((Q,ie)=>ie===T?{...Q,[R]:U}:Q))};return(0,K.jsx)(K.Fragment,{children:(0,K.jsxs)("div",{className:"truss-estimator",children:[(0,K.jsxs)("div",{className:"quick-order-hero",children:[(0,K.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,K.jsx)("h1",{children:"Paint Calculator"}),(0,K.jsx)("p",{children:"Estimate how much paint you need for your walls, including multiple coats and excluded areas."})]}),(0,K.jsxs)("div",{className:"truss-estimator__card paint-calculator",children:[(0,K.jsx)("h2",{className:"truss-estimator__step-title",children:"Walls, exclusions and coats"}),(0,K.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,K.jsxs)("div",{className:"paint-calculator__section",children:[(0,K.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,K.jsx)("p",{className:"paint-calculator__hint",children:"Enter the height and width of each wall you want to paint."}),(0,K.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,K.jsx)("span",{}),(0,K.jsx)("span",{children:"Height (m)"}),(0,K.jsx)("span",{children:"Width (m)"}),(0,K.jsx)("span",{})]}),r.map((k,T)=>(0,K.jsxs)("div",{className:"paint-calculator__row",children:[(0,K.jsxs)("span",{className:"paint-calculator__row-label",children:["Wall ",T+1]}),(0,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,K.jsx)("input",{"aria-label":`Wall ${T+1} height in metres`,type:"number",min:"0",step:"0.01",value:k.height,onChange:R=>w(i,T,"height",R.target.value)})]}),(0,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,K.jsx)("input",{"aria-label":`Wall ${T+1} width in metres`,type:"number",min:"0",step:"0.01",value:k.width,onChange:R=>w(i,T,"width",R.target.value)})]}),r.length>1?(0,K.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>i(R=>R.filter((U,A)=>A!==T)),children:"Remove"}):null]},`wall-${T}`)),(0,K.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>i(k=>[...k,vc()]),children:"+ Add another wall"})]}),(0,K.jsxs)("div",{className:"paint-calculator__section",children:[(0,K.jsx)("div",{className:"truss-estimator__section-heading",children:"Areas to exclude"}),(0,K.jsx)("p",{className:"paint-calculator__hint",children:"Add windows, sockets, skirting boards or other areas that will not be painted."}),(0,K.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,K.jsx)("span",{}),(0,K.jsx)("span",{children:"Height (m)"}),(0,K.jsx)("span",{children:"Width (m)"}),(0,K.jsx)("span",{})]}),n.map((k,T)=>(0,K.jsxs)("div",{className:"paint-calculator__row",children:[(0,K.jsxs)("span",{className:"paint-calculator__row-label",children:["Area ",T+1]}),(0,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,K.jsx)("input",{"aria-label":`Area ${T+1} height in metres`,type:"number",min:"0",step:"0.01",value:k.height,onChange:R=>w(o,T,"height",R.target.value)})]}),(0,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,K.jsx)("input",{"aria-label":`Area ${T+1} width in metres`,type:"number",min:"0",step:"0.01",value:k.width,onChange:R=>w(o,T,"width",R.target.value)})]}),n.length>1?(0,K.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>o(R=>R.filter((U,A)=>A!==T)),children:"Remove"}):null]},`excluded-${T}`)),(0,K.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>o(k=>[...k,vc()]),children:"+ Add another area"})]}),(0,K.jsxs)("div",{className:"paint-calculator__section",children:[(0,K.jsx)("div",{className:"truss-estimator__section-heading",children:"Doors and coats"}),(0,K.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,K.jsxs)("div",{className:"truss-estimator__field-grid paint-calculator__small-fields",children:[(0,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{children:"Doors"}),(0,K.jsx)("input",{type:"number",min:"0",step:"1",value:l,onChange:k=>c(k.target.value)})]}),(0,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{children:"Double doors"}),(0,K.jsx)("input",{type:"number",min:"0",step:"1",value:p,onChange:k=>m(k.target.value)})]})]}),(0,K.jsxs)("div",{className:"paint-calculator__coat-field",children:[(0,K.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,K.jsxs)("label",{className:"truss-estimator__field",children:[(0,K.jsx)("span",{children:"Number of coats"}),(0,K.jsxs)("select",{value:h,onChange:k=>d(Number(k.target.value)),children:[(0,K.jsx)("option",{value:"1",children:"1 coat"}),(0,K.jsx)("option",{value:"2",children:"2 coats"}),(0,K.jsx)("option",{value:"3",children:"3 coats"})]})]})]})]}),(0,K.jsxs)("div",{className:"paint-calculator__totals",children:[(0,K.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,K.jsxs)("div",{className:"paint-calculator__result-grid",children:[(0,K.jsxs)("div",{children:[(0,K.jsx)("span",{children:"Paintable area"}),(0,K.jsxs)("strong",{children:[O.toFixed(2)," m\xB2"]})]}),(0,K.jsxs)("div",{children:[(0,K.jsx)("span",{children:"Coverage"}),(0,K.jsxs)("strong",{children:[h," ",h===1?"coat":"coats"]})]}),(0,K.jsxs)("div",{children:[(0,K.jsx)("span",{children:"Paint required"}),(0,K.jsxs)("strong",{children:[f.toFixed(1)," litres"]})]})]}),(0,K.jsx)("p",{className:"paint-calculator__note",children:g?"Based on paint coverage of 10 m\xB2 per litre. Ordered as brilliant white matt emulsion, rounded up to whole tins.":"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,K.jsxs)("div",{className:"paint-calculator__actions",children:[(0,K.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),g?(0,K.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.([u]),disabled:f<=0,children:a}):(0,K.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",disabled:!0,children:"Paint products unavailable"})]})]})]})})}var fr=$(Ye()),te=$(F()),_c=e=>Number.parseFloat(e)||0,rm={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 im({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,fr.useState)("paving"),[n,o]=(0,fr.useState)("council"),[l,c]=(0,fr.useState)(""),[p,m]=(0,fr.useState)(""),[h,d]=(0,fr.useState)("100"),[b,v]=(0,fr.useState)("50"),[q,O]=(0,fr.useState)(!0),[f,u]=(0,fr.useState)(!0),g=_c(l)*_c(p),w=g,k=g*(_c(h)/1e3),T=g*.04,R=g*(_c(b)/1e3),U=Math.ceil(w/.36),A=Math.ceil(w/.1),Q=Math.ceil(k*1700/800),ie=Math.ceil(T*1600/800),qe=Math.ceil(R*1600/800),Te=r==="paving"?{qty:U,unit:"each"}:r==="block"?{qty:w,unit:"m2"}:{qty:qe,unit:"bag"},Ze={paving:"paving slab",block:"block paver",gravel:"decorative gravel"}[r],Ue=[{key:`surface-${n}`,label:rm[r].find(le=>le.id===n)?.label??"Surface material",qty:Te.qty,unit:Te.unit,query:Ze,category:"landscaping"},...q?[{key:"sub-base",label:"MOT Type 1 sub-base",qty:Q,unit:"bag",query:"MOT Type 1 sub base",category:"aggregate"}]:[],...f?[{key:"bedding",label:"Sharp sand bedding",qty:ie,unit:"bag",query:"sharp sand",category:"aggregate"}]:[]];return(0,te.jsx)(te.Fragment,{children:(0,te.jsxs)("div",{className:"truss-estimator",children:[(0,te.jsxs)("div",{className:"quick-order-hero",children:[(0,te.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,te.jsx)("h1",{children:"Paving and Driveway Calculator"}),(0,te.jsx)("p",{children:"Estimate paving, block paving, sub-base and bedding materials for outdoor areas."})]}),(0,te.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,te.jsx)("h2",{className:"truss-estimator__step-title",children:"Surface and ground build-up"}),(0,te.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,te.jsxs)("div",{className:"materials-calculator__section",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Surface material"}),(0,te.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(([le,ot,ze])=>(0,te.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===le?" is-selected":""}`,onClick:()=>{i(le),o(rm[le][0].id)},children:[(0,te.jsx)("div",{className:"truss-estimator__option-title",children:ot}),(0,te.jsx)("div",{className:"truss-estimator__option-copy",children:ze})]},le))}),(0,te.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,te.jsx)("span",{children:"Finish"}),(0,te.jsx)("select",{value:n,onChange:le=>o(le.target.value),children:rm[r].map(le=>(0,te.jsx)("option",{value:le.id,children:le.label},le.id))})]})]}),(0,te.jsxs)("div",{className:"materials-calculator__section",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and groundwork"}),(0,te.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,te.jsxs)("label",{className:"truss-estimator__field",children:[(0,te.jsx)("span",{children:"Length (m)"}),(0,te.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:le=>c(le.target.value)})]}),(0,te.jsxs)("label",{className:"truss-estimator__field",children:[(0,te.jsx)("span",{children:"Width (m)"}),(0,te.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:le=>m(le.target.value)})]})]}),r==="gravel"&&(0,te.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,te.jsx)("span",{children:"Gravel depth (mm)"}),(0,te.jsx)("input",{type:"number",min:"0",step:"10",value:b,onChange:le=>v(le.target.value)})]}),q&&(0,te.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,te.jsx)("span",{children:"Sub-base depth (mm)"}),(0,te.jsx)("input",{type:"number",min:"0",step:"10",value:h,onChange:le=>d(le.target.value)})]}),(0,te.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,te.jsx)("input",{type:"checkbox",checked:q,onChange:le=>O(le.target.checked)}),(0,te.jsx)("span",{children:"Include MOT Type 1 sub-base"})]}),(0,te.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,te.jsx)("input",{type:"checkbox",checked:f,onChange:le=>u(le.target.checked)}),(0,te.jsx)("span",{children:"Include sharp sand bedding"})]})]}),(0,te.jsxs)("div",{className:"materials-calculator__totals",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,te.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:"Surface area"}),(0,te.jsxs)("strong",{children:[g.toFixed(2)," m\xB2"]})]}),(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:r==="paving"?"Paving slabs":r==="block"?"Block paving":"Gravel"}),(0,te.jsx)("strong",{children:r==="paving"?`${U} slabs`:r==="block"?`${w.toFixed(2)} m\xB2`:`${qe} bulk bags`})]}),q&&(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:"MOT Type 1"}),(0,te.jsxs)("strong",{children:[Q," bulk bags"]})]}),f&&(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:"Sharp sand"}),(0,te.jsxs)("strong",{children:[ie," bulk bags"]})]})]}),(0,te.jsx)("p",{className:"materials-calculator__note",children:"Slab and block quantities use typical sizes. Confirm pack coverage and laying pattern before ordering."})]}),(0,te.jsxs)("div",{className:"materials-calculator__actions",children:[(0,te.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,te.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(Ue),disabled:g<=0,children:a})]})]})]})})}var ml=$(Ye()),re=$(F()),_x=2.88,Fv=[{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"}],Wv=()=>({length:"",height:""}),nm=e=>Number.parseFloat(e)||0;function om({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,ml.useState)([Wv()]),[n,o]=(0,ml.useState)(""),[l,c]=(0,ml.useState)("standard"),[p,m]=(0,ml.useState)("screws"),h=r.reduce((T,R)=>T+nm(R.length)*nm(R.height),0),d=Math.max(0,h-nm(n)),b=Math.ceil(d/_x),v=Math.ceil(d*12),q=Math.ceil(v/1e3),O=Math.ceil(d*1.2),f=Math.ceil(O/90),u=Math.ceil(d/3.5),g=Fv.find(T=>T.id===l)?.label??"Standard",w=[{key:"board",label:`${g} plasterboard`,qty:b,unit:"sheet",query:`${g} plasterboard`,category:"plasterboard"},...p==="screws"?[{key:"screws",label:"Drywall screws",qty:q,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:f,unit:"roll",query:"plasterboard joint tape",category:"plasterboard"}],k=(T,R,U)=>{i(A=>A.map((Q,ie)=>ie===T?{...Q,[R]:U}:Q))};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:"Plasterboard and Drylining Calculator"}),(0,re.jsx)("p",{children:"Estimate boards, fixings and jointing materials for walls and ceilings."})]}),(0,re.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,re.jsx)("h2",{className:"truss-estimator__step-title",children:"Boards, fixings and jointing"}),(0,re.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,re.jsxs)("div",{className:"materials-calculator__section",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Board type"}),(0,re.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Fv.map(T=>(0,re.jsxs)("button",{type:"button",className:`truss-estimator__option-card${l===T.id?" is-selected":""}`,onClick:()=>c(T.id),children:[(0,re.jsx)("div",{className:"truss-estimator__option-title",children:T.label}),(0,re.jsx)("div",{className:"truss-estimator__option-copy",children:T.blurb})]},T.id))})]}),(0,re.jsxs)("div",{className:"materials-calculator__section",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Fixing method"}),(0,re.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,R,U])=>(0,re.jsxs)("button",{type:"button",className:`truss-estimator__option-card${p===T?" is-selected":""}`,onClick:()=>m(T),children:[(0,re.jsx)("div",{className:"truss-estimator__option-title",children:R}),(0,re.jsx)("div",{className:"truss-estimator__option-copy",children:U})]},T))})]}),(0,re.jsxs)("div",{className:"materials-calculator__section",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall and ceiling areas"}),(0,re.jsx)("p",{className:"materials-calculator__hint",children:"Add each surface separately so different wall sizes are easy to measure."}),(0,re.jsxs)("div",{className:"materials-calculator__dimensions-header",children:[(0,re.jsx)("span",{children:"Surface"}),(0,re.jsx)("span",{children:"Length (m)"}),(0,re.jsx)("span",{children:"Height (m)"}),(0,re.jsx)("span",{})]}),r.map((T,R)=>(0,re.jsxs)("div",{className:"materials-calculator__surface-row",children:[(0,re.jsxs)("span",{children:["Surface ",R+1]}),(0,re.jsx)("input",{"aria-label":`Surface ${R+1} length`,type:"number",min:"0",step:"0.01",value:T.length,onChange:U=>k(R,"length",U.target.value)}),(0,re.jsx)("input",{"aria-label":`Surface ${R+1} height`,type:"number",min:"0",step:"0.01",value:T.height,onChange:U=>k(R,"height",U.target.value)}),r.length>1?(0,re.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>i(U=>U.filter((A,Q)=>Q!==R)),children:"Remove"}):null]},`surface-${R}`)),(0,re.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>i(T=>[...T,Wv()]),children:"+ Add another surface"}),(0,re.jsxs)("label",{className:"truss-estimator__field materials-calculator__openings",children:[(0,re.jsxs)("span",{children:["Openings to deduct (m\xB2) ",(0,re.jsx)("small",{children:"optional"})]}),(0,re.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:T=>o(T.target.value)})]})]}),(0,re.jsxs)("div",{className:"materials-calculator__totals",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,re.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:"Board area"}),(0,re.jsxs)("strong",{children:[d.toFixed(2)," m\xB2"]})]}),(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:"2.4 x 1.2 m boards"}),(0,re.jsx)("strong",{children:b})]}),(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:p==="screws"?"Drywall screws":"Board adhesive"}),(0,re.jsx)("strong",{children:p==="screws"?`${v} (${q} boxes)`:`${u} bags`})]}),(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:"Joint tape"}),(0,re.jsxs)("strong",{children:[O," m (",f," rolls)"]})]})]}),(0,re.jsx)("p",{className:"materials-calculator__note",children:"Figures are estimates. Confirm board specification, fixing patterns and fire or acoustic requirements before ordering."})]}),(0,re.jsxs)("div",{className:"materials-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?.(w),disabled:d<=0,children:a})]})]})]})})}var fl=$(Ye());var y=$(F()),Rt={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}}}},xc=["range","pitchAndDimensions","quantityAndGirders","bracing"],xx={range:null,pitch:null,spanMM:"",overhangMM:"",roofLengthM:"",centres:null,girderCount:0,bracing:null,treatment:null,contact:{name:"",email:""}};function kx({degrees:e}){let a=e*Math.PI/180,i=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,${i}`,fill:"var(--accent-light)",stroke:"var(--accent)",strokeWidth:"3",strokeLinejoin:"round"})]})}function Sx({type:e}){let t="#b3835a",a="#5c3b22",r="#d9b48f",i="#d3d8de",n="#7c8494",o=(m,h,d,b,v=8,q)=>{let O=d-m,f=b-h,u=Math.hypot(O,f)||1,g=-f/u,w=O/u,k=v*.2;return(0,y.jsxs)("g",{children:[(0,y.jsx)("line",{x1:m,y1:h,x2:d,y2:b,stroke:a,strokeWidth:v+3,strokeLinecap:"square"}),(0,y.jsx)("line",{x1:m,y1:h,x2:d,y2:b,stroke:t,strokeWidth:v,strokeLinecap:"square"}),(0,y.jsx)("line",{x1:m-g*k,y1:h-w*k,x2:d-g*k,y2:b-w*k,stroke:r,strokeWidth:Math.max(1.5,v*.24),strokeLinecap:"round",opacity:"0.9"})]},q)},l=(m,h,d)=>(0,y.jsxs)("g",{children:[(0,y.jsx)("rect",{x:m-7.5,y:h-5.5,width:"15",height:"11",rx:"2",fill:i,stroke:n,strokeWidth:"1"}),(0,y.jsx)("circle",{cx:m-4,cy:h-2.5,r:"1",fill:n}),(0,y.jsx)("circle",{cx:m+4,cy:h-2.5,r:"1",fill:n}),(0,y.jsx)("circle",{cx:m-4,cy:h+2.5,r:"1",fill:n}),(0,y.jsx)("circle",{cx:m+4,cy:h+2.5,r:"1",fill:n}),(0,y.jsx)("circle",{cx:m,cy:h,r:"1",fill:n})]},d),c=(m,h)=>(0,y.jsx)("rect",{x:m-9,y:"110",width:"18",height:"10",fill:a},h),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 Nx({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 e0({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 lm({onBack:e}){let[t,a]=(0,fl.useState)(0),[r,i]=(0,fl.useState)(xx),[n,o]=(0,fl.useState)(!1),[l,c]=(0,fl.useState)(!1),p=()=>{let f=Number.parseFloat(r.roofLengthM)||0,u=Number.parseFloat(r.centres??"");return f<=0||!u?0:Math.ceil(f*1e3/u)+1},h=(()=>{let f=r.range?Rt.ranges[r.range]:Rt.ranges.standard,u=r.pitch??"22.5",g=Rt.pitchMultipliers[u],w=(Number.parseFloat(r.spanMM)||0)/1e3,T=(Number.parseFloat(r.overhangMM)||0)>Rt.overhang.thresholdMM,R=p(),U=R+r.girderCount,A=Number.parseFloat(r.roofLengthM)||0,Q=r.treatment?Rt.treatment[r.treatment]:Rt.treatment.untreated,ie=Rt.estimate.ranges[r.range??"standard"],qe=ie.supplyAt8m*Math.max(.7,w/8)*g*(1+Q.surchargePct)+(T?Rt.overhang.surchargePerTruss:0),Te=R*qe,Ze=r.girderCount*qe*Rt.estimate.girderMultiplier,Ue=r.bracing==="yes"?A*Rt.estimate.bracingPerMetre:0,be=Te+Ze+Ue+Rt.estimate.delivery,le=Rt.estimate.design+R*ie.installPerTruss+r.girderCount*40,ot=be+le,ze=ot*.2;return{range:f,count:R,girderCount:r.girderCount,overhangApplies:T,overhangUnits:U,roofLengthM:A,treatment:Q,trussSupply:Te,bracingMaterials:Ue,delivery:Rt.estimate.delivery,labour:le,subtotal:ot,vat:ze,total:ot+ze}})(),d=()=>{let f=xc[t];return f==="range"?!!r.range:f==="pitchAndDimensions"?!!r.pitch&&r.spanMM.trim()!==""&&r.overhangMM.trim()!=="":f==="quantityAndGirders"?r.roofLengthM.trim()!==""&&!!r.centres:f==="bracing"?!!r.bracing&&!!r.treatment:!0},b=t===xc.length-1?"View truss request":"Next",v=()=>{n?o(!1):t===0?e():a(f=>f-1)},q=()=>{d()&&(t===xc.length-1?(c(!1),o(!0)):a(f=>f+1))},O=()=>{let f=xc[t];return f==="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(Rt.ranges).map(([u,g])=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r.range===u?" is-selected":""}`,onClick:()=>i(w=>({...w,range:u})),children:[(0,y.jsx)(Sx,{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))})]}):f==="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=>i(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=>i(g=>({...g,overhangMM:u.target.value}))}),(0,y.jsxs)("small",{children:["Overhangs beyond ",Rt.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:Rt.pitches.map(u=>(0,y.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${r.pitch===u?" is-selected":""}`,onClick:()=>i(g=>({...g,pitch:u})),children:[(0,y.jsx)(kx,{degrees:Number.parseFloat(u)}),(0,y.jsxs)("span",{children:[u,"\xB0"]})]},u))})]}):f==="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=>i(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:Rt.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:()=>i(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:()=>i(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:()=>i(u=>({...u,girderCount:Math.min(3,u.girderCount+1)})),children:"+"})]})]}):f==="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:()=>i(g=>({...g,bracing:u.id})),children:[(0,y.jsx)(Nx,{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:()=>i(u=>({...u,treatment:"untreated"})),children:[(0,y.jsx)(e0,{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:()=>i(u=>({...u,treatment:"treated"})),children:[(0,y.jsx)(e0,{treated:!0}),(0,y.jsx)("span",{children:"Treated (+8% cost)"}),(0,y.jsx)("small",{children:"Applies to trusses, girders and overhang"})]})]})]}):null};return n?(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:[h.range.label," roof trusses"]})]}),(0,y.jsxs)("strong",{children:[h.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:h.treatment.label})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Girder trusses"}),(0,y.jsx)("strong",{children:h.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:nt(h.trussSupply)})]}),h.bracingMaterials>0&&(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Bracing materials allowance"}),(0,y.jsx)("strong",{children:nt(h.bracingMaterials)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Delivery allowance"}),(0,y.jsx)("strong",{children:nt(h.delivery)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Design and installation labour"}),(0,y.jsx)("strong",{children:nt(h.labour)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"Subtotal (ex. VAT)"}),(0,y.jsx)("strong",{children:nt(h.subtotal)})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:"VAT (20%)"}),(0,y.jsx)("strong",{children:nt(h.vat)})]}),(0,y.jsxs)("div",{className:"truss-request__price-total",children:[(0,y.jsx)("span",{children:"Estimated total"}),(0,y.jsx)("strong",{children:nt(h.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:v,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:O()}),(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:v,children:"Back"}),(0,y.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:q,disabled:!d(),children:[(0,y.jsx)("span",{children:b}),(0,y.jsx)("span",{className:"arrow",children:(0,y.jsx)(Qt,{})})]})]})]})]})})}var Mi=$(Ye()),I=$(F()),r0=e=>Number.parseFloat(e)||0,kc=(e,t)=>r0(e)*(t==="m"?1:.3048),t0=()=>({length:"",width:""}),a0=[{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 Cx({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 sm({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Mi.useState)("total"),[n,o]=(0,Mi.useState)("m"),[l,c]=(0,Mi.useState)(""),[p,m]=(0,Mi.useState)([t0()]),[h,d]=(0,Mi.useState)(""),[b,v]=(0,Mi.useState)("chamfered"),q="4.4",O=r==="total"?kc(l,n):p.reduce((k,T)=>k+2*(kc(T.length,n)+kc(T.width,n)),0),f=Math.max(0,O-kc(h,n)),u=Math.ceil(f/r0(q)),g=[{key:`skirting-${b}`,label:`${a0.find(k=>k.id===b)?.label} skirting board`,qty:f,unit:"m",query:"skirting board",category:"skirting"}],w=(k,T,R)=>{m(U=>U.map((A,Q)=>Q===k?{...A,[T]:R}:A))};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:()=>i("total"),children:"Total length"}),(0,I.jsx)("button",{type:"button",className:r==="rooms"?"is-selected":"",onClick:()=>i("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:n==="m"?"is-selected":"",onClick:()=>o("m"),children:"Metres"}),(0,I.jsx)("button",{type:"button",className:n==="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 (",n,")"]}),(0,I.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:k=>c(k.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 (",n,")"]}),(0,I.jsxs)("span",{children:["Width (",n,")"]}),(0,I.jsx)("span",{})]}),p.map((k,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 ${n}`,type:"number",min:"0",step:"0.01",value:k.length,onChange:R=>w(T,"length",R.target.value)}),(0,I.jsx)("input",{"aria-label":`Room ${T+1} width in ${n}`,type:"number",min:"0",step:"0.01",value:k.width,onChange:R=>w(T,"width",R.target.value)}),p.length>1?(0,I.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>m(R=>R.filter((U,A)=>A!==T)),children:"Remove"}):null]},`room-${T}`)),(0,I.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>m(k=>[...k,t0()]),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 (",n,") ",(0,I.jsx)("small",{children:"optional"})]}),(0,I.jsx)("input",{type:"number",min:"0",step:"0.01",value:h,onChange:k=>d(k.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.4m white-primed MDF boards."}),(0,I.jsx)("div",{className:"architrave-calculator__profiles",children:a0.map(k=>(0,I.jsxs)("button",{type:"button",className:`truss-estimator__option-card${b===k.id?" is-selected":""}`,onClick:()=>v(k.id),children:[(0,I.jsx)(Cx,{profile:k.id}),(0,I.jsx)("div",{className:"truss-estimator__option-title",children:k.label}),(0,I.jsx)("div",{className:"truss-estimator__option-copy",children:k.blurb})]},k.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.40 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:[f.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:f<=0,children:a})]})]})]})})}var Xn=$(Ye()),oe=$(F()),hl=e=>Number.parseFloat(e)||0;function cm({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,i]=(0,Xn.useState)("studs"),[n,o]=(0,Xn.useState)(""),[l,c]=(0,Xn.useState)(""),[p,m]=(0,Xn.useState)("600"),[h,d]=(0,Xn.useState)("2.4"),b=n&&l&&p?Math.ceil(hl(l)/(hl(p)/1e3))+1:0,v=b*hl(n),q=hl(h)>0?Math.ceil(v/hl(h)):0,O=[{key:r,label:{studs:"Stud timber",joists:"Joist timber",battens:"Batten timber"}[r],qty:v,unit:"m",query:{studs:"cls studwork timber",joists:"timber joist",battens:"roofing batten"}[r],category:"timber"}],f={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,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:"Timber Calculator"}),(0,oe.jsx)("p",{children:"Estimate studs, joists or battens from a run length, width and spacing."})]}),(0,oe.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,oe.jsx)("h2",{className:"truss-estimator__step-title",children:"Member size and spacing"}),(0,oe.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,oe.jsxs)("div",{className:"materials-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber use"}),(0,oe.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:Object.keys(f).map(w=>(0,oe.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===w?" is-selected":""}`,onClick:()=>i(w),children:[(0,oe.jsx)("div",{className:"truss-estimator__option-title",children:f[w][0]}),(0,oe.jsx)("div",{className:"truss-estimator__option-copy",children:f[w][1]})]},w))})]}),(0,oe.jsxs)("div",{className:"materials-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Dimensions and spacing"}),(0,oe.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,oe.jsxs)("label",{className:"truss-estimator__field",children:[(0,oe.jsxs)("span",{children:[g.member," (m)"]}),(0,oe.jsx)("input",{type:"number",min:"0",step:"0.01",value:n,onChange:w=>o(w.target.value)})]}),(0,oe.jsxs)("label",{className:"truss-estimator__field",children:[(0,oe.jsxs)("span",{children:[g.overall," (m)"]}),(0,oe.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:w=>c(w.target.value)})]})]}),(0,oe.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,oe.jsxs)("label",{className:"truss-estimator__field",children:[(0,oe.jsx)("span",{children:"Centres (mm)"}),(0,oe.jsxs)("select",{value:p,onChange:w=>m(w.target.value),children:[(0,oe.jsx)("option",{value:"300",children:"300 mm"}),(0,oe.jsx)("option",{value:"400",children:"400 mm"}),(0,oe.jsx)("option",{value:"450",children:"450 mm"}),(0,oe.jsx)("option",{value:"600",children:"600 mm"})]})]}),(0,oe.jsxs)("label",{className:"truss-estimator__field",children:[(0,oe.jsx)("span",{children:"Stock length (m)"}),(0,oe.jsxs)("select",{value:h,onChange:w=>d(w.target.value),children:[(0,oe.jsx)("option",{value:"2.4",children:"2.40 m"}),(0,oe.jsx)("option",{value:"3.6",children:"3.60 m"}),(0,oe.jsx)("option",{value:"4.8",children:"4.80 m"})]})]})]})]}),(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:g.count}),(0,oe.jsx)("strong",{children:b})]}),(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:"Linear metres"}),(0,oe.jsxs)("strong",{children:[v.toFixed(2)," m"]})]}),(0,oe.jsxs)("div",{children:[(0,oe.jsxs)("span",{children:[h," m lengths"]}),(0,oe.jsx)("strong",{children:q})]})]}),(0,oe.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,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?.(O),disabled:v<=0,children:a})]})]})]})})}var um=[{id:"truss",title:"Roof Truss Calculator",desc:"Estimate trusses, girders and roof structure costs.",imageUrl:"/tool-images/truss.webp",Component:lm},{id:"fencing",title:"Fencing Calculator",desc:"Estimate fence panels, posts, gravel boards and fixings.",imageUrl:"/tool-images/fencing.webp",Component:em},{id:"decking",title:"Decking Calculator",desc:"Estimate boards, substructure and fixing quantities.",imageUrl:"/tool-images/decking.webp",Component:Fd},{id:"brick-block",title:"Brick and Block Calculator",desc:"Estimate masonry units and ready-mixed mortar for a wall.",imageUrl:"/tool-images/brick-block.webp",Component:Kd},{id:"paint",title:"Paint Calculator",desc:"Estimate paint for walls, doors and multiple coats.",imageUrl:"/tool-images/paint.webp",Component:am},{id:"skirting",title:"Skirting Board Calculator",desc:"Estimate skirting lengths for rooms and wall runs.",imageUrl:"/tool-images/skirting.webp",Component:sm},{id:"architrave",title:"Architrave Calculator",desc:"Estimate architrave lengths for door and window openings.",imageUrl:"/tool-images/architrave.webp",Component:Zd},{id:"concrete-aggregate",title:"Concrete and Aggregate Calculator",desc:"Estimate concrete, MOT, sand and gravel quantities.",imageUrl:"/tool-images/concrete-aggregate.webp",Component:Jd},{id:"plasterboard",title:"Plasterboard Calculator",desc:"Estimate plasterboard sheets, screws, tape and adhesive.",imageUrl:"/tool-images/plasterboard.webp",Component:om},{id:"insulation",title:"Insulation Calculator",desc:"Estimate insulation packs for floors, walls, roofs and lofts.",imageUrl:"/tool-images/insulation.webp",Component:tm},{id:"timber",title:"Timber Calculator",desc:"Estimate studs, joists and battens from spacing and lengths.",imageUrl:"/tool-images/timber.webp",Component:cm},{id:"paving",title:"Paving and Driveway Calculator",desc:"Estimate paving, block paving, MOT and sharp sand.",imageUrl:"/tool-images/paving.webp",Component:im}];var pm=$(Ye());var qx=new Set(["bag","box","roll","pack"]),Ex=new Set(["each","bag","box","roll","pack","tub"]);function gl(e,t){let r=(t?.conversion?.request_uoms_supported??"").split(",").map(o=>o.trim().toLowerCase()).includes("sales_unit");if(e==="each"){let o=(t?.uoi_count??1)===1&&(t?.conversion?.sales_unit_size??1)===1;return r&&o?"sales_unit":e}if(!qx.has(e))return e;if(r)return"sales_unit";let i=t?.uoi;return i!=null&&Ex.has(i.toLowerCase())&&(t?.uoi_count??1)===1?i:e}var i0=new Map;function Mx(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 Ti(e,t,a=12,r){let i=`${Dt().client??""}||${e}||${t??""}||${a}||${r??""}`,n=i0.get(i);if(n)return n;let o=new URLSearchParams({q:e,limit:String(a)});t&&o.set("category",t),r&&o.set("account",r);let l=await fetch(Ma(`/api/catalogue/search?${o.toString()}`),{headers:bi()}),c=await Qa(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(Mx):[];return i0.set(i,p),p}async function n0(e,t,a){return await Promise.all(e.map(async i=>{try{let n=a?dl(a,i):null,[o,l]=await Promise.all([n?Ti(n,void 0,void 0,t).then(p=>p.find(m=>m.product_id===n.split(" ")[0]),()=>{}):void 0,Ti(i.query,i.category,void 0,t)]),c=o?[o,...l.filter(p=>p.product_id!==o.product_id)]:l;return{requirement:i,candidates:c}}catch{return{requirement:i,candidates:[]}}}))}async function o0(){let e=await fetch(Ma("/api/catalogue"),{headers:bi()});if(!e.ok)return{itemCount:0,uploadedAt:null};let t=await Qa(e);return{itemCount:Number(t?.itemCount)||0,uploadedAt:t?.uploadedAt??null}}var Wt=$(F()),Tx=1500;function l0(e){let{addManyToCart:t,clearCart:a,openBasket:r}=Dn(),[i,n]=(0,pm.useState)(!1),[o,l]=(0,pm.useState)(null);return{adding:i,basketError:o,addToBasket:async(p,m)=>{let h=Date.now();n(!0),l(null);try{let d=await Promise.all(p.filter(v=>v.qty>0).map(async v=>{let q=(await Ti(v.search)).find(O=>O.product_id===v.productId);if(!q)throw new Error("A selected product is no longer available in this catalogue.");return On(q,{lineId:`${e}:${v.key}`,description:q.description,unit:gl(v.unit??"each",q),qty:v.qty,calculatorWasteIncluded:m})})),b=Tx-(Date.now()-h);b>0&&await new Promise(v=>window.setTimeout(v,b)),a(),t(d),r()}catch(d){l(d instanceof Error?d.message:"Could not add the products to your basket.")}finally{n(!1)}}}}function s0({toolTitle:e}){return(0,Wt.jsx)(Wt.Fragment,{children:(0,Wt.jsxs)("div",{className:"truss-estimator",children:[(0,Wt.jsxs)("div",{className:"quick-order-hero",children:[(0,Wt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Wt.jsx)("h1",{children:"Your Materials"}),(0,Wt.jsxs)("p",{children:["Calculating quantities from the ",e,"."]})]}),(0,Wt.jsx)("div",{className:"truss-estimator__card",children:(0,Wt.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{flex:1,justifyContent:"center"},children:[(0,Wt.jsx)(wi,{}),(0,Wt.jsx)("p",{className:"banter-message is-visible",children:"Preparing your materials\u2026"})]})})]})})}var Nc=$(Ye());var Qe=$(Ye());var C=$(F()),zx=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}],dm={wasteFactorEnabled:!0},Rx=3e3,c0=null;function Sc(e,t){let a=ol(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function Ax(e){return e&&e.length>0?e.join(" x "):"-"}function mm({toolId:e,requirements:t,ready:a,onBack:r,onTotalChange:i}){let n=vv(),o=`${e}~${t.map(N=>`${N.key}|${N.query}|${N.category??""}|${N.qty}`).join("~")}`,l=o!==c0,[c,p]=(0,Qe.useState)(null),[m,h]=(0,Qe.useState)([]),[d,b]=(0,Qe.useState)(l),[v,q]=(0,Qe.useState)(null),[O,f]=(0,Qe.useState)("tile"),[u,g]=(0,Qe.useState)(null),[w,k]=(0,Qe.useState)(""),[T,R]=(0,Qe.useState)(null),[U,A]=(0,Qe.useState)(""),[Q,ie]=(0,Qe.useState)([]),[qe,Te]=(0,Qe.useState)(new Set),[Ze,Ue]=(0,Qe.useState)(null),[be,le]=(0,Qe.useState)(""),[ot,ze]=(0,Qe.useState)([]),wt=(0,Qe.useRef)(null),Z=(0,Qe.useRef)(!1),ce=N=>`${e}:${N}`,Ee=N=>On(N.chosen,{lineId:ce(N.requirement.key),description:N.requirement.label,unit:gl(N.requirement.unit,N.chosen),qty:N.requirement.qty}),Ot=(0,Qe.useMemo)(()=>t.map(N=>`${N.key}|${N.query}|${N.category??""}`).join("~"),[t]);(0,Qe.useEffect)(()=>{let N=!1;return o0().then(L=>{N||p(L.itemCount>0)}).catch(()=>{N||p(!1)}),()=>{N=!0}},[]),(0,Qe.useEffect)(()=>{if(!a||!c)return;let N=!1,L;l&&b(!0),q(null);let X=Date.now();return(async()=>{let ue=null;try{ue=(await n0(t,void 0,e)).map(({requirement:yt,candidates:ft})=>({requirement:yt,candidates:ft,chosen:ft[0]??null}))}catch(xe){N||q(xe instanceof Error?xe.message:"Could not load products")}if(!N){if(c0=o,l){let xe=Rx-(Date.now()-X);xe>0&&await new Promise(yt=>{L=window.setTimeout(yt,xe)})}N||(ue&&(h(ue),!Z.current&&n&&(Z.current=!0,n.addManyToCart(ue.filter(xe=>xe.chosen).map(Ee)))),b(!1))}})(),()=>{N=!0,window.clearTimeout(L)}},[a,c,Ot]),(0,Qe.useEffect)(()=>{if(!T)return;let N=U.trim();if(!N){ie([]);return}let L=!1,X=window.setTimeout(()=>{Ti(N).then(ue=>{L||ie(ue)}).catch(()=>{L||ie([])})},250);return()=>{L=!0,window.clearTimeout(X)}},[T,U]),(0,Qe.useEffect)(()=>{if(!Ze)return;let N=be.trim();if(!N){ze([]);return}let L=!1,X=window.setTimeout(()=>{Ti(N).then(ue=>{L||ze(ue)}).catch(()=>{L||ze([])})},250);return()=>{L=!0,window.clearTimeout(X)}},[Ze,be]);let jt=(0,Qe.useMemo)(()=>{let N=w.trim().toLowerCase(),L=N?m.filter(X=>X.requirement.label.toLowerCase().includes(N)||(X.chosen?.description??"").toLowerCase().includes(N)||(X.chosen?.product_id??"").toLowerCase().includes(N)):m;return u?[...L].sort((X,ue)=>{let xe=X.requirement.label.localeCompare(ue.requirement.label);return u==="asc"?xe:-xe}):L},[m,w,u]),Ne=jt.filter(N=>N.chosen),_e=jt.filter(N=>!N.chosen),De=m.filter(N=>N.chosen),Ge=De.filter(N=>N.chosen?.price==null).length,vt=De.reduce((N,L)=>N+(Ft(Ee(L),dm).lineTotal??0),0);if((0,Qe.useEffect)(()=>{i?.(vt)},[vt,i]),!a||c===!1)return null;let z=n?De.filter(N=>n.cart[ce(N.requirement.key)]).length:0,G=Ze?m.find(N=>N.requirement.key===Ze)??null:null,pe=be.trim()?ot:G?.candidates??[],de=N=>{let L=T===N.requirement.key;R(L?null:N.requirement.key),A(L?"":N.requirement.query)},je=(N,L)=>{let X=m.find(ue=>ue.requirement.key===N);h(ue=>ue.map(xe=>xe.requirement.key===N?{...xe,chosen:L}:xe)),n&&X&&n.cart[ce(N)]&&n.addToCart(Ee({...X,chosen:L})),R(null),A("")},Oe=N=>{h(L=>L.map(X=>X.requirement.key===N?{...X,chosen:null}:X)),n?.cart[ce(N)]&&n.removeFromCart(ce(N))},x=N=>{Ue(N.requirement.key),le(""),ze([])},_=()=>{Ue(null),le(""),ze([])},E=N=>{if(!n)return;let L=ce(N.requirement.key);n.cart[L]?n.removeFromCart(L):n.addToCart(Ee(N))},D=N=>{Te(L=>{let X=new Set(L);return X.has(N)?X.delete(N):X.add(N),X})},V=N=>{let L=Q.length>0?Q:N.candidates;return(0,C.jsxs)("div",{className:"estimator-products__picker",children:[(0,C.jsx)("input",{type:"text",className:"results-search-input",value:U,autoFocus:!0,placeholder:"Search products in catalogue...",onChange:X=>A(X.target.value),"aria-label":`Search a product for ${N.requirement.label}`}),(0,C.jsxs)("div",{className:"estimator-products__options",children:[L.map(X=>(0,C.jsxs)("button",{type:"button",className:`estimator-products__option${X.product_id===N.chosen?.product_id?" is-selected":""}`,onClick:()=>je(N.requirement.key,X),children:[(0,C.jsx)("span",{children:X.description}),(0,C.jsxs)("span",{className:"results-row-meta",children:[X.product_id,X.price!=null&&` \xB7 ${nt(X.price)}`]})]},X.product_id)),L.length===0&&(0,C.jsx)("p",{className:"results-empty-hint",children:"No matching products."})]})]})};return(0,C.jsxs)("section",{className:"estimator-products results-tile-section","aria-label":"Matched products",children:[!d&&(0,C.jsxs)("div",{className:"estimator-products__head",children:[(0,C.jsxs)("div",{className:"results-tile-section__head",children:[(0,C.jsx)("h3",{children:"Matched Products"}),(0,C.jsx)("p",{children:"Products matched to your estimate, check before adding to your basket."})]}),!G&&(0,C.jsx)("div",{className:"results-summary estimator-products__toolbar",children:(0,C.jsxs)("div",{className:"estimator-products__controls",children:[(0,C.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search description...",value:w,onChange:N=>k(N.target.value),"aria-label":"Search matched products"}),(0,C.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,C.jsx)("button",{type:"button",className:`results-view-toggle__btn${O==="tile"?" is-active":""}`,"aria-pressed":O==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>f("tile"),children:(0,C.jsxs)("svg",{width:"18",height:"12",viewBox:"0 0 15 10",fill:"currentColor",children:[(0,C.jsx)("rect",{x:"0.5",y:"0.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"5.5",y:"0.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"10.5",y:"0.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"0.5",y:"5.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"5.5",y:"5.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"10.5",y:"5.5",width:"4",height:"4"})]})}),(0,C.jsx)("button",{type:"button",className:`results-view-toggle__btn${O==="list"?" is-active":""}`,"aria-pressed":O==="list","aria-label":"List view",title:"List view",onClick:()=>f("list"),children:(0,C.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,C.jsx)("line",{x1:"0.5",y1:"2.5",x2:"14.5",y2:"2.5"}),(0,C.jsx)("line",{x1:"0.5",y1:"7.5",x2:"14.5",y2:"7.5"}),(0,C.jsx)("line",{x1:"0.5",y1:"12.5",x2:"14.5",y2:"12.5"})]})})]}),(0,C.jsxs)("details",{ref:wt,style:{position:"relative"},children:[(0,C.jsx)("summary",{className:"bom-toolbar-btn sort-menu-summary","aria-label":"Sort materials",style:{fontSize:16},children:"\u21C5"}),(0,C.jsx)("div",{className:"sort-menu-panel",children:zx.map(N=>{let L=u===N.dir;return(0,C.jsxs)("button",{type:"button",className:`sort-menu-item${L?" is-active":""}`,onClick:()=>{g(L?null:N.dir),wt.current?.removeAttribute("open")},children:[(0,C.jsx)("span",{className:"sort-menu-item__check",children:L?"\u2713":""}),N.label]},N.dir)})})]})]})})]}),G&&(0,C.jsxs)("div",{className:"results-review-page",children:[(0,C.jsxs)("div",{className:"results-review-page__top",children:[(0,C.jsxs)("button",{type:"button",className:"bom-toolbar-btn bom-toolbar-btn--accent",onClick:_,children:[(0,C.jsx)(Vr,{}),"Back to results"]}),(0,C.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,C.jsx)("div",{className:"results-review-searchbar",children:(0,C.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products in catalogue...",value:be,onChange:N=>le(N.target.value),"aria-label":`Search a product for ${G.requirement.label}`})}),G.chosen&&(0,C.jsx)("div",{className:"results-candidate-actions",children:(0,C.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Oe(G.requirement.key),children:"Clear selected product"})})]})]}),(0,C.jsxs)("div",{className:"results-review-page__hero",children:[(0,C.jsx)("div",{className:"results-review-page__image-wrap",children:(0,C.jsx)(Ta,{className:"fill-img results-review-page__image",description:G.chosen?.description||G.requirement.label,photoUrl:G.chosen?.pdp_photo_url})}),(0,C.jsxs)("div",{className:"results-review-page__summary",children:[(0,C.jsx)("h2",{children:G.requirement.label}),(0,C.jsxs)("p",{className:"results-review-page__meta",children:[vi(G.requirement.qty)," ",xa(G.requirement.unit,G.requirement.qty)]}),G.chosen?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"results-review-page__product",children:G.chosen.description}),(0,C.jsxs)("div",{className:"results-row-meta",children:[G.chosen.product_id,G.chosen.price!=null?` \xB7 ${Sc(G.chosen.price,G.chosen.price_basis)}`:""]})]}):(0,C.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line."}),(0,C.jsx)("div",{className:"results-review-page__actions",children:(0,C.jsx)("button",{type:"button",className:`bom-toolbar-btn${n?.cart[ce(G.requirement.key)]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>E(G),disabled:!G.chosen||!n,children:n?.cart[ce(G.requirement.key)]?"\u2713 Added":"+ Add to basket"})})]})]}),pe.length===0?(0,C.jsx)("p",{className:"results-empty-hint",children:"No matching products."}):(0,C.jsxs)("table",{className:"score-breakdown-table",children:[(0,C.jsx)("thead",{children:(0,C.jsxs)("tr",{children:[(0,C.jsx)("th",{children:"Product"}),(0,C.jsx)("th",{children:"Dims (mm)"}),(0,C.jsx)("th",{children:"Price"}),(0,C.jsx)("th",{"aria-label":"Actions"})]})}),(0,C.jsx)("tbody",{children:pe.map(N=>{let L=N.product_id===G.chosen?.product_id;return(0,C.jsxs)("tr",{className:L?"score-breakdown-row--best":"",children:[(0,C.jsxs)("td",{children:[(0,C.jsx)("div",{children:N.description}),(0,C.jsx)("div",{className:"results-row-meta",children:N.product_id})]}),(0,C.jsx)("td",{children:(0,C.jsx)("span",{className:"unit-badge",children:Ax(N.measurements_mm)})}),(0,C.jsx)("td",{children:N.price!=null?Sc(N.price,N.price_basis):"-"}),(0,C.jsx)("td",{children:(0,C.jsxs)("label",{className:"switch-toggle",title:L?"Currently selected":"Use this candidate",children:[(0,C.jsx)("input",{type:"checkbox",checked:L,onChange:()=>{L?Oe(G.requirement.key):je(G.requirement.key,N)},"aria-label":L?`${N.description} selected`:`Use ${N.description}`}),(0,C.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},N.product_id)})})]})]}),!G&&d&&(0,C.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{padding:"32px 24px"},children:[(0,C.jsx)(wi,{}),(0,C.jsx)("p",{className:"banter-message is-visible",style:{fontSize:15,minHeight:0},children:"Matching your materials against the catalogue\u2026"})]}),!G&&v&&(0,C.jsx)("p",{className:"results-empty-hint estimator-products__error",children:v}),!G&&!d&&!v&&jt.length===0&&m.length>0&&(0,C.jsx)("p",{className:"results-empty-hint",children:"No materials match the current search."}),!G&&!d&&!v&&O==="tile"&&Ne.length>0&&(0,C.jsx)("div",{className:"results-tile-grid",children:Ne.map(N=>{let{requirement:L,chosen:X}=N,ue=X?Ft(Ee(N),dm):null,xe=n?!!n.cart[ce(L.key)]:!1;return(0,C.jsxs)("article",{className:"results-tile-card",children:[(0,C.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>x(N),"aria-label":`Review match for ${L.label}`,children:[(0,C.jsx)("div",{className:"results-tile-card__media",children:(0,C.jsx)(Ta,{className:"fill-img results-tile-card__image",description:X?.description||L.label,photoUrl:X?.pdp_photo_url})}),(0,C.jsxs)("div",{className:"results-tile-card__body",children:[X?(0,C.jsxs)("div",{className:"results-tile-card__heading",children:[(0,C.jsx)("div",{className:"results-tile-card__title",children:X.description}),(0,C.jsxs)("div",{className:"results-tile-card__match-meta",children:[(0,C.jsx)("span",{children:X.product_id}),X.price!=null?(0,C.jsx)("span",{children:Sc(X.price,X.price_basis)}):null]})]}):(0,C.jsx)("div",{className:"results-empty-hint",children:"No product matched for this line."}),(0,C.jsxs)("div",{className:"results-tile-card__match",children:[(0,C.jsx)("div",{className:"results-tile-card__match-label",children:"\u21B3 calculated as"}),(0,C.jsx)("div",{className:"results-tile-card__match-name",children:L.label}),(0,C.jsxs)("div",{className:"results-tile-card__meta",children:[vi(L.qty)," ",xa(L.unit,L.qty)]}),ue?.requiredSellUnits!=null?(0,C.jsxs)("div",{className:"results-tile-card__meta estimator-products__order",children:["Order ",ue.requiredSellUnits," ",ue.sellUnit,ue.lineTotal!=null?` \xB7 ${nt(ue.lineTotal)}`:""]}):X?(0,C.jsx)("div",{className:"results-row-meta",children:"Quantity needs review"}):null]})]})]}),(0,C.jsxs)("div",{className:"results-tile-card__actions",children:[(0,C.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>x(N),children:"Review"}),(0,C.jsx)("button",{type:"button",className:`bom-toolbar-btn${xe?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>E(N),disabled:!X||!n,children:xe?"\u2713 Added":"+ Add"})]})]},L.key)})}),!G&&!d&&!v&&O==="list"&&Ne.length>0&&(0,C.jsx)("div",{className:"bom-table-wrap",children:(0,C.jsxs)("table",{className:"bom-table results-table","aria-label":"Matched materials",children:[(0,C.jsxs)("colgroup",{children:[(0,C.jsx)("col",{style:{width:"56px"}}),(0,C.jsx)("col",{className:"col-item"}),(0,C.jsx)("col",{style:{width:"90px"}}),(0,C.jsx)("col",{style:{width:"80px"}}),(0,C.jsx)("col",{style:{width:"220px"}}),(0,C.jsx)("col",{style:{width:"110px"}})]}),(0,C.jsx)("thead",{children:(0,C.jsxs)("tr",{className:"bom-col-header",children:[(0,C.jsx)("th",{"aria-label":"Expand"}),(0,C.jsx)("th",{style:{textAlign:"left"},children:"Description"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Qty"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Unit"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Product Matched"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Basket"})]})}),(0,C.jsx)("tbody",{children:Ne.map(N=>{let{requirement:L,chosen:X}=N,ue=X?Ft(Ee(N),dm):null,xe=n?!!n.cart[ce(L.key)]:!1,yt=qe.has(L.key);return(0,C.jsxs)(Qe.Fragment,{children:[(0,C.jsxs)("tr",{className:"bom-row",children:[(0,C.jsx)("td",{className:"bom-actions",style:{textAlign:"center",paddingLeft:0,paddingRight:0},children:(0,C.jsx)("button",{type:"button",className:"link-btn",onClick:()=>D(L.key),"aria-expanded":yt,"aria-label":yt?"Collapse product options":"Expand product options",children:yt?"\u25BE":"\u25B8"})}),(0,C.jsxs)("td",{style:{paddingLeft:0},children:[(0,C.jsx)("div",{className:"bom-component-name",children:L.label}),ue?.requiredSellUnits!=null&&(0,C.jsxs)("div",{className:"results-row-meta",children:["Order ",ue.requiredSellUnits," ",ue.sellUnit,ue.lineTotal!=null?` \xB7 ${nt(ue.lineTotal)}`:""]})]}),(0,C.jsx)("td",{className:"bom-qty col-order",style:{textAlign:"center"},children:vi(L.qty)}),(0,C.jsx)("td",{style:{textAlign:"center"},children:xa(L.unit,L.qty)}),(0,C.jsx)("td",{style:{textAlign:"center"},children:X?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"bom-component-name",children:X.description}),(0,C.jsxs)("div",{className:"results-row-meta",children:[X.product_id,X.price!=null&&` \xB7 ${Sc(X.price,X.price_basis)}`]})]}):(0,C.jsx)("span",{className:"results-empty-hint",children:"No match"})}),(0,C.jsx)("td",{style:{textAlign:"center"},children:(0,C.jsx)("button",{type:"button",className:`bom-toolbar-btn${xe?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>E(N),disabled:!X||!n,children:xe?"\u2713 Added":"+ Add"})})]}),yt&&(0,C.jsx)("tr",{children:(0,C.jsx)("td",{colSpan:6,style:{paddingLeft:0,paddingRight:0},children:T===L.key?V(N):(0,C.jsxs)("div",{className:"estimator-products__picker",children:[(0,C.jsxs)("div",{className:"estimator-products__options",children:[N.candidates.map(ft=>(0,C.jsxs)("button",{type:"button",className:`estimator-products__option${ft.product_id===X?.product_id?" is-selected":""}`,onClick:()=>je(L.key,ft),children:[(0,C.jsx)("span",{children:ft.description}),(0,C.jsxs)("span",{className:"results-row-meta",children:[ft.product_id,ft.price!=null&&` \xB7 ${nt(ft.price)}`]})]},ft.product_id)),N.candidates.length===0&&(0,C.jsx)("p",{className:"results-empty-hint",children:"No candidates found."})]}),(0,C.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>de(N),children:"Search the catalogue"})]})})})]},L.key)})})]})}),!G&&!d&&!v&&_e.length>0&&(0,C.jsxs)("section",{className:"results-tile-section results-tile-section--unmatched","aria-label":"Items requiring matching",children:[(0,C.jsxs)("div",{className:"results-tile-section__head",children:[(0,C.jsx)("h3",{children:"Require Matching"}),(0,C.jsx)("p",{children:"We couldn\u2019t confidently match these to a product. Open one to pick from the closest options."})]}),(0,C.jsx)("div",{className:"results-unmatched-list",children:_e.map(N=>(0,C.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>x(N),children:[(0,C.jsxs)("span",{className:"results-unmatched-card__main",children:[(0,C.jsx)("span",{className:"results-unmatched-card__title",children:N.requirement.label}),(0,C.jsxs)("span",{className:"results-row-meta",children:[vi(N.requirement.qty)," ",xa(N.requirement.unit,N.requirement.qty)]})]}),(0,C.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},N.requirement.key))})]}),!d&&!v&&m.length>0&&(0,C.jsxs)("div",{className:"disclaimer-box",style:{alignItems:"center"},children:[(0,C.jsx)("span",{className:"disclaimer-icon",children:"\u26A0\uFE0F"}),(0,C.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."})]}),!G&&!d&&!v&&(r||z>0)&&(0,C.jsxs)("div",{className:"btn-row estimator-products__footer",children:[r&&(0,C.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:r,children:"Back"}),z>0&&n&&(0,C.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:r?"0 1 70%":1,marginTop:0},onClick:n.openBasket,children:[(0,C.jsxs)("span",{children:["View Basket (",z,")"]}),(0,C.jsx)("span",{className:"arrow",children:(0,C.jsx)(Qt,{})})]})]})]})}var Gt=$(F());function fm({toolId:e,toolTitle:t,requirements:a,onBack:r}){let[i,n]=(0,Nc.useState)(0),o=(0,Nc.useCallback)(l=>n(l),[]);return(0,Gt.jsx)(Gt.Fragment,{children:(0,Gt.jsxs)("div",{className:"truss-estimator",children:[(0,Gt.jsxs)("div",{className:"quick-order-hero",children:[(0,Gt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Gt.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,Gt.jsx)("h1",{children:"Your Materials"}),i>0&&(0,Gt.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,Gt.jsx)("strong",{children:nt(i)})," Est. total"]})]}),(0,Gt.jsxs)("p",{children:["Quantities from the ",t,", matched against your merchant\u2019s catalogue."]})]}),(0,Gt.jsx)("div",{className:"truss-estimator__card",style:{minHeight:0},children:(0,Gt.jsx)(mm,{toolId:e,requirements:a,ready:!0,onBack:r,onTotalChange:o})})]})})}var Me=$(F());function Cc(e){let[t,a]=(0,$a.useState)(!1);return(0,Me.jsx)(lc,{onOpenBasket:()=>a(!0),children:(0,Me.jsx)(Ux,{...e,showBasket:t,onShowBasket:a})})}function Ux({fullPage:e=!1,hideHeader:t=!1,internal:a=!1,showBasket:r,onShowBasket:i}){let[n,o]=(0,$a.useState)(null),[l,c]=(0,$a.useState)(null),p=um.find(U=>U.id===n),{cart:m,updateCartQty:h,updateCartSellUnits:d,updateCartConversions:b,removeFromCart:v,clearCart:q}=Dn(),{adding:O,basketError:f,addToBasket:u}=l0(p?.title??"calculator"),g=(0,$a.useRef)(null),w=Js("estimating-tools",g);(0,$a.useEffect)(()=>{w("viewed")},[w]);let k=r?"basket":O?"adding":l?"review":n??"list",T=(0,$a.useRef)(k);(0,$a.useEffect)(()=>{T.current!==k&&(T.current=k,window.scrollTo(0,0))},[k]);let R=U=>{if(!p)return;w("estimate_completed",{calculator:p.id,lines:U.length});let A=Bv(p.id,U);A?u(A,U[0]?.calculatorWasteIncluded??!1):c(U)};return(0,Me.jsx)(tl.Provider,{value:w,children:(0,Me.jsx)("div",{ref:g,className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}${a?"":" estimating-tools--customer"}`,style:Dt().theme,children:(0,Me.jsx)("main",{className:"main-content",children:r?(0,Me.jsx)(ul,{cart:m,onUpdateQty:h,onUpdateSellUnits:d,onResolveConversions:b,onRemove:v,onBack:()=>i(!1),onStartNewQuote:()=>{q(),o(null),c(null),i(!1)},internal:a}):O&&p?(0,Me.jsx)(s0,{toolTitle:p.title}):p?(0,Me.jsxs)(Me.Fragment,{children:[(0,Me.jsx)("div",{hidden:l!==null,children:(0,Me.jsx)(p.Component,{onBack:()=>o(null),onReview:R})}),f&&(0,Me.jsx)("p",{className:"results-empty-hint estimator-products__error",children:f}),l!==null&&(0,Me.jsx)(fm,{toolId:p.id,toolTitle:p.title,requirements:l,onBack:()=>c(null)})]}):(0,Me.jsx)(Me.Fragment,{children:(0,Me.jsxs)("div",{className:"quick-order-card",children:[(0,Me.jsxs)("div",{className:"quick-order-hero",children:[(0,Me.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,Me.jsx)("h1",{children:"Estimating Tools"}),(0,Me.jsx)("p",{children:"Trade-specific calculators for trusses, fencing, decking, masonry and painting. Dial in your specs and get an instant material estimate."})]}),(0,Me.jsxs)("div",{className:"quick-order-alt",children:[(0,Me.jsx)("div",{className:"quick-order-alt-title",children:"Choose a Calculator"}),(0,Me.jsx)("div",{className:"estimator-tools-grid",children:um.map(U=>(0,Me.jsxs)("button",{type:"button",className:"estimator-tool-card",onClick:()=>{w("calculator_selected",{calculator:U.id}),o(U.id),c(null)},children:[(0,Me.jsx)("span",{className:"estimator-tool-card__image-wrap",children:(0,Me.jsx)("img",{className:"fill-img estimator-tool-card__image",src:It(U.imageUrl),alt:""})}),(0,Me.jsxs)("span",{className:"estimator-tool-card__content",children:[(0,Me.jsx)("span",{className:"estimator-tool-card__title",children:U.title}),(0,Me.jsx)("span",{className:"estimator-tool-card__desc",children:U.desc})]})]},U.id))})]})]})})})})})}var qc=$(F());function hm({config:e,children:t}){return vw(e),(0,qc.jsx)(qc.Fragment,{children:t})}var gm=$(F()),Dx="https://api.metronlabs.ai",Ox=["client","api-key","api-url","theme","hide-header","analytics"],Bx=["all","events-only","none"];function p0(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.72",this.id||(this.id=e),this.setAttribute("data-turbo-permanent",""),this.setAttribute("data-turbolinks-permanent",""),!this.root){let i=document.createElement("div"),n=document.createElement("style");n.textContent=`:host { display: block; }
|
|
6974
|
+
C24 timber 4.8m`,value:d,onChange:K=>g(K.target.value),"aria-label":"Paste schedule line items"}),(G||L)&&(0,I.jsxs)("div",{className:"error-box",role:"alert",children:[(0,I.jsx)("strong",{children:"Error:"})," ",G||L]}),(0,I.jsxs)("div",{className:"quick-order-hint",children:[(0,I.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,I.jsx)("div",{className:"quick-order-actions",children:(0,I.jsxs)("button",{type:"button",className:"cta-btn",disabled:!A||!!G,onClick:()=>{l("list_submitted",{method:"paste",lines:A}),Ue(()=>e(d))},"aria-label":"Match pasted lines",children:[(0,I.jsx)("span",{children:"Match line items"}),(0,I.jsx)("span",{className:"arrow",children:(0,I.jsx)(Qt,{})})]})})]}):(0,I.jsxs)(I.Fragment,{children:[L&&(0,I.jsxs)("div",{className:"error-box",role:"alert",children:[(0,I.jsx)("strong",{children:"Error:"})," ",L]}),(0,I.jsxs)("div",{className:`upload-zone${y?" has-file":""}`,onClick:()=>o.current?.click(),onDragOver:K=>K.preventDefault(),onDrop:wt,role:"button",tabIndex:0,onKeyDown:K=>(K.key==="Enter"||K.key===" ")&&o.current?.click(),"aria-label":"Upload zone: click or drag a list or image file here",children:[M?(0,I.jsx)("img",{src:M,alt:y?.name??"Selected photo",className:"upload-zone-photo-preview"}):(0,I.jsx)("div",{className:"upload-zone-icon",children:(0,I.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,I.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,I.jsx)("polyline",{points:"14,2 14,8 20,8"}),(0,I.jsx)("polyline",{points:"9,15 11,17 15,13"})]})}),y?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("div",{className:"upload-zone-subtext",children:y.name}),(0,I.jsx)("button",{type:"button",className:"link-btn link-btn--underline",onClick:K=>{K.stopPropagation(),R(null),m(""),o.current&&(o.current.value="")},children:"Remove"})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("div",{className:"upload-zone-text",children:"Drop a photo, spreadsheet, Word document or PDF"}),(0,I.jsx)("div",{className:"upload-zone-subtext",children:"or click to choose a file"})]}),(0,I.jsx)("input",{ref:o,type:"file",accept:C_,className:"visually-hidden",onChange:K=>Ze(K.target.files),tabIndex:-1,"aria-hidden":"true"})]}),(0,I.jsx)("div",{className:"quick-order-actions",children:(0,I.jsxs)("button",{type:"button",className:"cta-btn",disabled:!y,onClick:()=>{ve()},"aria-label":"Match uploaded items",children:[(0,I.jsx)("span",{children:"Match items"}),(0,I.jsx)("span",{className:"arrow",children:(0,I.jsx)(Qt,{})})]})})]})}),(0,I.jsx)("aside",{className:"quick-order-sidebar",children:q_[f].map((K,ue)=>(0,I.jsxs)("div",{className:"quick-order-step quick-order-step--rail",children:[(0,I.jsx)("span",{className:"quick-order-step-dot",children:ue+1}),(0,I.jsxs)("div",{children:[(0,I.jsx)("div",{className:"quick-order-step-title",children:K.title}),(0,I.jsx)("div",{className:"quick-order-step-desc",children:K.desc})]})]},K.title))})]}),u&&(0,I.jsx)("div",{className:"quick-order-matching-overlay",children:(0,I.jsx)(gv,{})})]})]})})]})]})}var zt=$(Ye()),_v=$(W());function Un(e){return JSON.stringify([e.productId,e.qty,e.unit,e.linkedContext??[]])}function E_(e,t){let a={...e,[t.lineId]:t};for(let[r,n]of Object.entries(a)){if(!n.linkedContext)continue;let i=n.linkedContext.find(l=>l.role==="anchor"&&l.line_id&&a[l.line_id]),o=i?.line_id?a[i.line_id]:void 0;if(!(!i||!o||i.product_id===o.productId&&i.description===o.description)){if(n.conversionType!=="basket_line_unit"){a[r]={...n,linkedContext:n.linkedContext.map(l=>l.line_id===i.line_id?{...l,product_id:o.productId,measurements_mm:o.measurementsMm??[],description:o.description}:l)};continue}a[r]={...n,qty:0,sellUnitsOverride:null,linkedContext:n.linkedContext.map(l=>l.line_id===i.line_id?{...l,product_id:o.productId,measurements_mm:o.measurementsMm??[],description:o.description}:l),conversionType:null,requestUomsSupported:null,salesUomNormalised:null,salesUnitSize:null,salesUnitSizeUom:null,coverageQty:null,coverageUom:null,roundingRule:null,conversionConfidence:null,conversionNotes:null}}}return a}var qd=(0,zt.createContext)(null);function lc({children:e,onOpenBasket:t}){let[a,r]=(0,zt.useState)({}),n=(0,zt.useCallback)(d=>{r(g=>E_(g,d))},[]),i=(0,zt.useCallback)(d=>{r(g=>{let y={...g};for(let R of d)y[R.lineId]=R;return y})},[]),o=(0,zt.useCallback)(d=>{r(g=>{let y={...g};return delete y[d],y})},[]),l=(0,zt.useCallback)((d,g)=>{r(y=>y[d]?{...y,[d]:{...y[d],qty:g,sellUnitsOverride:null}}:y)},[]),c=(0,zt.useCallback)((d,g)=>{r(y=>y[d]?{...y,[d]:{...y[d],sellUnitsOverride:g}}:y)},[]),p=(0,zt.useCallback)(d=>{r(g=>{let y=!1,R={...g};for(let[L,m]of Object.entries(d))R[L]&&(R[L]={...R[L],...m},y=!0);return y?R:g})},[]),f=(0,zt.useCallback)(()=>r({}),[]),h=(0,zt.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,_v.jsx)(qd.Provider,{value:h,children:e})}function Dn(){let e=(0,zt.useContext)(qd);if(!e)throw new Error("useCart must be used inside a <CartProvider>");return e}function yv(){return(0,zt.useContext)(qd)}var mt=$(Ye());function vi(e){return e===0?"-":Number.isInteger(e)?e.toString():e<1?e.toFixed(2):e.toFixed(1)}function nt(e){return`\xA3${e.toLocaleString("en-GB",{minimumFractionDigits:2,maximumFractionDigits:2})}`}var Nv=e=>(e??"").trim().toLowerCase(),M_={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",piece:"each",pieces:"each",board:"sheet",bags:"bag",length:"length",lengths:"length",pallet:"pallet",pallets:"pallet"},Ed=new Set(["sheet","length","box","bag","pack","roll","set","tub","each"]),Md=new Set(["box","bag","pack","pallet","roll","set","tub"]),Td=(e,t)=>t==="ml"?e:["l","litre","litres"].includes(t)?e*1e3:null,zd=(e,t)=>t==="g"?e:["kg","kilogram","kilograms"].includes(t)?e*1e3:["t","tonne","tonnes"].includes(t)?e*1e6:null,Ga=e=>{let t=Nv(e);return M_[t]??t},at=(e,t)=>{let a=Ga(e),r=Ga(t);return a.length>0&&a===r},xv=(e,t)=>{let a=Nv(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},T_=e=>(e??"").split(",").map(t=>Ga(t)).filter(Boolean),z_=(e,t)=>{let a=T_(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)},kv=(e,t)=>at(t,"pallet")?e.itemsPerPallet??null:at(t,"pack")?e.itemsPerPack??null:at(t,"box")?e.itemsPerBox??null:null,Sv=(e,t)=>{let a=t==="volume"?/(\d+(?:[.,]\d+)?)\s*(ml|l|ltr|ltrs|litres?|liters?)\b/i:/(\d+(?:[.,]\d+)?)\s*(kg|kgs|tonnes?)\b/i,r=e.description.match(a);if(!r)return null;let n=Number.parseFloat(r[1].replace(",","."));if(!Number.isFinite(n)||n<=0)return null;let i=r[2].toLowerCase();return t==="volume"?{ml:i==="ml"?n:n*1e3}:{g:i.startsWith("tonne")?n*1e6:n*1e3}},R_=["volume_from_description","same_unit_volume"],A_=["weight_from_description","mass_from_pack","same_unit_mass"],U_=(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 sc(e,t){let a=e.map(r=>Ft(r,t).lineTotal);return a.some(r=>r==null)?null:a.reduce((r,n)=>r+(n??0),0)}function Ft(e,t){let a=D_(e,t);return a.sellUnit==="bag"&&a.requestedUnit!=="bag"&&/\bbulk bag\b/i.test(e.description)?{...a,sellUnit:"bulk bag"}:a}function D_(e,t){let a=e.qty,r=Ga(e.saleUnit??e.salesUnitSizeUom??e.uoi??e.salesUomNormalised)||"-",n=e.unitConversions?.find(V=>at(V.requestUom,"each"))?.quantityPerSaleUnit,i=!Ga(e.unit)&&Md.has(r)&&n!=null&&n>1&&a>=n,o=Ga(e.unit)||(i?"each":a>0&&Ed.has(r)?r:"-"),l=e.saleUnitQuantity??e.salesUnitSize??e.uoiCount??1,c=t?.wasteFactorEnabled===!1?0:t?.wasteFactorOverride??e.wasteFactorOverride??e.wasteFactorDefault??0,p=e.sellUnitsOverride!=null&&Number.isFinite(e.sellUnitsOverride)&&e.sellUnitsOverride>0,f=p?Ed.has(r)?Math.ceil(e.sellUnitsOverride):e.sellUnitsOverride:null,h=V=>({requestedAmount:a,requestedUnit:o,salesUnitSize:e.salesUnitSize??e.uoiCount??null,sellUnit:r,calculatedSellUnits:null,requiredSellUnits:f,unitPrice:e.price,lineTotal:e.price!=null&&f!=null?e.price*f:null,calculation:f!=null?`${V} Order quantity set to ${f} ${r}.`:V,costingMode:"review"});if(!Number.isFinite(a)||a<=0)return h("Quantity needs confirmation.");let d=Td(a,o),g=zd(a,o),y=at(o,r)?null:d!=null&&!R_.includes(e.conversionType??"")?Sv(e,"volume"):g!=null&&!A_.includes(e.conversionType??"")?Sv(e,"weight"):null,R=y?.ml!=null?d:g,L=y?.ml??y?.g??null;if(R!=null&&L!=null){let V=Ga(e.uoi)||r,se=y?.ml!=null?`${L/1e3} l`:`${L/1e3} kg`,ge=p?f:Math.ceil(R*(1+c)/L-1e-9);return{requestedAmount:a,requestedUnit:o,salesUnitSize:1,sellUnit:V,calculatedSellUnits:ge,requiredSellUnits:ge,unitPrice:e.price,lineTotal:e.price!=null?e.price*ge:null,calculation:`${a} ${o}${c>0?` x ${1+c}`:""} / ${se} per ${V} (from product description) = ${ge} ${V}`,costingMode:"derived"}}if(o==="sales_unit"){let V=Ga(e.uoi)||r,se=p?f:xv(a*(1+c),e.roundingRule??"round_up_each");return{requestedAmount:a,requestedUnit:V,salesUnitSize:1,sellUnit:V,calculatedSellUnits:se,requiredSellUnits:se,unitPrice:e.price,lineTotal:e.price!=null?e.price*se:null,calculation:`${a} ${V}${c>0?` x ${1+c}`:""} = ${se} ${V}`,costingMode:"direct"}}if(!z_(e,o))return h("Requested unit is not supported by this catalogue conversion.");let m=null,u="review",b=e.roundingRule,w=`Quantity review required, initial request needed ${a} ${o}.`,v=1+c,M=U_(e,o,r),T=e.unitConversions?.find(V=>at(V.requestUom,o));if(!!e.saleUnit&&(at(o,r)||!!T||at(o,"each")&&!Md.has(r)))if(at(o,r))m=a*v/l,u="direct",w=`${a} ${o}${c>0?` x ${v}`:""}`;else if(T){m=a*v/T.quantityPerSaleUnit,u="derived";let V=1/T.quantityPerSaleUnit,se=Math.round(V);w=at(r,"each")&&T.quantityPerSaleUnit<1&&Math.abs(V-se)<1e-9?`${a} ${o}${c>0?` x ${v}`:""} x ${se} per ${o}`:`${a} ${o}${c>0?` x ${v}`:""} / ${T.quantityPerSaleUnit} ${o} per ${r}`}else at(o,"each")&&!Md.has(r)&&(m=a*v/l,u="derived",w=`${a} ${r}${c>0?` x ${v}`:""}`);else if(at(o,r)&&l>0)m=a*v/l,u="direct",w=c>0?`${a} ${o} x ${v} / ${l} ${r} per sell unit`:`${a} ${o} / ${l} ${r} per sell unit`;else if(at(o,"each")&&l>0&&Ed.has(r))m=a*v/l,u="derived",w=c>0?`${a} each x ${v} / ${l} each per ${r}`:`${a} each / ${l} each per ${r}`;else if(kv(e,o)!=null&&l>0){let V=kv(e,o)??0;m=a*V*v/l,u="derived";let se=`${a} ${o} x ${V} each${c>0?` x ${v}`:""}`;w=l===1&&at(r,"each")?se:`${se} / ${l} each per ${r}`}else if(M!=null)m=a*v/M,u="derived",b??(b="round_up_each"),w=`${a} m2 x ${v} / ${M} m2 per ${r} (from product description)`;else if(e.conversionType==="basket_line_unit")l>0&&(m=a*v/l,u="derived",w=`${a} ${o}${c>0?` x ${v}`:""} / ${l} ${o} per ${r}`);else{if(e.conversionType==="count_only")return h(`Quantity review required, initial request needed ${a} ${o}.`);if(["area_from_dims","explicit_coverage_area","roll_area"].includes(e.conversionType??"")){let V=e.coverageQty??e.derivedCoverageM2??null;at(o,"m2")&&V!=null&&V>0&&(m=a*v/V,u="derived",w=`${a} m2 x ${v} / ${V} m2 per ${r}`)}else if(e.conversionType==="count_per_area"){let V=e.coverageQty??null;at(o,"m2")&&V!=null&&V>0?(m=a/V,u="derived",w=`${a} m2 / ${V} m2 per sell unit`):at(o,"m2")&&e.itemsPerM2!=null&&e.itemsPerM2>0&&l>0&&(m=a*e.itemsPerM2*v/l,u="derived",w=`${a} m2 x ${e.itemsPerM2} ${r}/m2 x ${v} / ${l}`)}else if(e.conversionType==="length_from_dims"){let V=e.coverageQty??e.derivedLengthM??null;at(o,"m")&&V!=null&&V>0&&(m=a*v/V,u="derived",w=`${a} m x ${v} / ${V} m per ${r}`)}else if(e.conversionType==="volume_from_description"){let V=Td(a,o),se=Td(e.coverageQty??0,Ga(e.coverageUom));V!=null&&se!=null&&se>0&&(m=V*v/se,u="derived",w=`${a} ${o} x ${v} / ${e.coverageQty} ${e.coverageUom} per ${r}`)}else if(e.conversionType==="weight_from_description"||e.conversionType==="mass_from_pack"){let V=Ga((e.coverageUom??"").split(" ")[0]),se=zd(a,o),ge=zd(e.coverageQty??0,V);se!=null&&ge!=null&&ge>0&&(m=se*v/ge,u="derived",w=`${a} ${o} x ${v} / ${e.coverageQty} ${V} per ${r}`)}else if(e.conversionType==="same_unit_volume"){let V=e.coverageQty??null;at(o,"m3")&&V!=null&&V>0&&(m=a/V,u="derived",w=`${a} m3 / ${V} m3 per ${r}`)}}if(m==null||!Number.isFinite(m)||m<0)return h(`Quantity review required, initial request needed ${a} ${o}.`);let G=xv(m,b),Y=p?f:G;return{requestedAmount:a,requestedUnit:o,salesUnitSize:l,sellUnit:r,calculatedSellUnits:G,requiredSellUnits:Y,unitPrice:e.price,lineTotal:e.price!=null&&Y!=null?e.price*Y:null,calculation:p?`${w} = ${G} ${r} (manually set to ${Y})`:`${w} = ${Y} ${r}`,costingMode:u}}var nl=$(W());function Rd({unit:e}){return(0,nl.jsx)(nl.Fragment,{children:e.split(/([²³])/).map((t,a)=>t==="\xB2"||t==="\xB3"?(0,nl.jsx)("span",{className:"unit-sup",children:t},a):t)})}var Cv=$(W());function O_(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 _a(e,t){let a=(e??"").trim();if(!a||a==="-")return"";let r=/^each$/i.test(a)?"unit":a;return t!=null?O_(r,t):r}function xa(e,t){let a=_a(e,t);return a?(0,Cv.jsx)(Rd,{unit:a}):null}function ol(e){let t=(e??"").trim();if(!t)return"";let a=t.match(/^per\s+(.+)$/i);if(!a)return t;let r=_a(a[1]);return r?`per ${r}`:""}var qv=()=>import("./xlsx-K4MOA2QM.js"),sl=["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","Review required","Decision reason","Selected candidate ID","Selected candidate description","Price basis","Price","Line total","Confidence","Status"],B_=sl.indexOf("Line total");function L_(e){return e.unmatchable?"Not matched (labour/plant/referential)":e.best?"Selected":"Needs review"}async function Ev(e){let t=await qv(),a=t.utils.book_new(),r=new Date().toISOString().slice(0,10),n=[sl],i=0;for(let c of e){let{item:p,best:f,qty:h,band:d,unmatchable:g,decision:y}=c,R=[p.section,p.subsection,p.subheading].filter(Boolean).join(" / "),L=!g&&f?.price!=null?f.price*h:null;L!=null&&(i+=L),n.push([p.source_line_id,p.line_id,p.description_original||"(no description)",R,h,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(", "),f?"no":"yes",y?.reason??"",g?"-":f?.product_id??y?.selected_candidate_id??"-",g?"-":f?.description??"-",g?"-":f?.price_basis??"-",g?null:f?.price??null,L,g?"-":d,L_(c)])}n.push(Array(sl.length).fill(null));let o=Array(sl.length).fill(null);o[0]="Estimated total",o[B_]=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(sl.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 ll=["Product ID","Description","Costing mode","Required amount","Req unit","Sell unit size","Sell unit","Required sell units","Unit price","Line total"];async function Mv(e,t){let a=await qv(),r=a.utils.book_new(),n=new Date().toISOString().slice(0,10),i=t?[["Account",t.name+" ("+t.id+")"],[],ll]:[ll],o=0;for(let p of e){let f=Ft(p),h=f.lineTotal;h!=null&&(o+=h),i.push([p.productId,p.description,f.costingMode,f.requestedAmount,_a(f.requestedUnit),f.salesUnitSize,_a(f.sellUnit),f.requiredSellUnits,f.unitPrice,h])}i.push(Array(ll.length).fill(null));let l=Array(ll.length).fill(null);l[0]="Estimated total",l[ll.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 Ad=$(W());function Vr(){return(0,Ad.jsx)("svg",{className:"back-arrow",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Ad.jsx)("path",{d:"M13 8H3M3 8L7 4M3 8L7 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var Ud=$(W());function yi(){return(0,Ud.jsx)("svg",{width:"8",height:"5",viewBox:"0 0 8 5",fill:"none",children:(0,Ud.jsx)("path",{d:"M1 4L4 1L7 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}var _i=$(W());function Dd(){return(0,_i.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,_i.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,_i.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,_i.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,_i.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}var ja=$(W());function Od(e){return(0,ja.jsxs)("svg",{viewBox:"0 0 640 420",preserveAspectRatio:"xMidYMid slice",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...e,children:[(0,ja.jsx)("rect",{width:"640",height:"420",fill:"#fbf1cf"}),(0,ja.jsx)("rect",{x:"88",y:"78",width:"432",height:"264",rx:"16",fill:"#f0c43f"}),(0,ja.jsx)("rect",{x:"120",y:"110",width:"368",height:"200",rx:"10",fill:"#ffd95e"}),(0,ja.jsxs)("g",{stroke:"#e2b12e",strokeWidth:"8",opacity:"0.75",children:[(0,ja.jsx)("line",{x1:"140",y1:"140",x2:"468",y2:"140"}),(0,ja.jsx)("line",{x1:"140",y1:"190",x2:"468",y2:"190"}),(0,ja.jsx)("line",{x1:"140",y1:"240",x2:"468",y2:"240"})]})]})}var Xr=$(W());function Bd(e){return(0,Xr.jsxs)("svg",{viewBox:"0 0 640 420",preserveAspectRatio:"xMidYMid slice",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...e,children:[(0,Xr.jsx)("rect",{width:"640",height:"420",fill:"#edf1f5"}),(0,Xr.jsx)("rect",{x:"132",y:"108",width:"376",height:"204",rx:"18",fill:"#d5dde6"}),(0,Xr.jsx)("rect",{x:"168",y:"144",width:"304",height:"24",rx:"12",fill:"#9aa6b2"}),(0,Xr.jsx)("rect",{x:"168",y:"188",width:"250",height:"24",rx:"12",fill:"#aab5c0"}),(0,Xr.jsx)("rect",{x:"168",y:"232",width:"220",height:"24",rx:"12",fill:"#aab5c0"})]})}var Ld=$(W()),H_=[{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 Ta({description:e,photoUrl:t,className:a,width:r,height:n}){let i=(e||"").toLowerCase(),o=H_.find(p=>p.match.some(f=>i.includes(f))),l=t||o&&It(o.path);if(l)return(0,Ld.jsx)("img",{className:a,src:l,alt:"",width:r,height:n});let c=i.includes("insulation")?Od:Bd;return(0,Ld.jsx)(c,{className:a,width:r,height:n})}var E=$(W()),Tv=.2,cl=10,zv="Enter a valid email address so we can send your quote.",Q_=(e,t)=>{let a=`${t.requestedAmount} ${_a(t.requestedUnit,t.requestedAmount)}`,r=`${t.requiredSellUnits} ${_a(t.sellUnit,t.requiredSellUnits??0)}`,n=e.unitConversions?.find(o=>o.requestUom===t.requestedUnit);if(n&&n.quantityPerSaleUnit<1)return`${a} requested \u2192 order ${r} (${Math.round(1/n.quantityPerSaleUnit)} ${_a(t.sellUnit,2)} per ${_a(t.requestedUnit,1)})`;let i=t.sellUnit==="bulk bag"?e.description.match(/(\d+(?:\.\d+)?)\s*kg\b/i):null;return i?`${a} requested \u2192 order ${r} (${i[1]} kg each)`:e.coverageQty&&/^m per /i.test(e.coverageUom??"")?`${a} requested \u2192 order ${r} (${e.coverageQty} ${e.coverageUom})`:`${a} requested \u2192 order ${r}`},G_=e=>["box","pack"].includes(e.requestedUnit)?"Pack size needed to calculate the order quantity.":`This product is sold by the ${_a(e.sellUnit,1)}.`;function ul({cart:e,onUpdateQty:t,onUpdateSellUnits:a,onResolveConversions:r,onRemove:n,onBack:i,onStartNewQuote:o,onQuoteRequested:l,internal:c=!1}){let p=(0,mt.useId)(),f=En(),h=!c&&Is()==="QZA6-MRA4",d=!c,g=Object.values(e),y=(0,mt.useRef)(new Map),[R,L]=(0,mt.useState)(""),[m,u]=(0,mt.useState)(!1),[b,w]=(0,mt.useState)(!1),[v,M]=(0,mt.useState)(""),[T,A]=(0,mt.useState)({}),[G,Y]=(0,mt.useState)({}),[V,se]=(0,mt.useState)(1),[ge,Ze]=(0,mt.useState)({}),[Ue,ve]=(0,mt.useState)(!1),[le,ot]=(0,mt.useState)("0"),[ze,wt]=(0,mt.useState)({});(0,mt.useEffect)(()=>{if(!r)return;for(let U of Object.values(e))Ft(U).requiredSellUnits!=null&&y.current.delete(U.lineId);let x=Object.values(e).filter(U=>{if(U.productId==="-"||Ft(U).requiredSellUnits!=null)return!1;let X=Un(U);return y.current.get(U.lineId)===X?!1:(y.current.set(U.lineId,X),!0)});if(x.length===0)return;let q=new Map(x.map(U=>[U.lineId,Un(U)]));wt(U=>({...U,...Object.fromEntries(q)})),fetch(Ma("/api/catalogue/resolve-conversions"),{method:"POST",headers:{"Content-Type":"application/json",...Mn()},body:JSON.stringify({lines:x.map(U=>({line_id:U.lineId,product_id:U.productId,requested_description:U.requestedDescription??U.description,requested_qty:U.qty,requested_uom:U.unit||null,linked_context:U.linkedContext??[],selected_description:U.description,selected_uoi:U.uoi,selected_uoi_count:U.uoiCount,selected_conversion:{sales_uom_normalised:U.salesUomNormalised,conversion_type:U.conversionType,sales_unit_size:U.salesUnitSize,sales_unit_size_uom:U.salesUnitSizeUom,coverage_qty:U.coverageQty,coverage_uom:U.coverageUom}}))})}).then(U=>U.ok?Qa(U):null).then(U=>{let X={},N=new Map(x.map(O=>[O.lineId,Un(O)]));for(let O of U?.data?.items??U?.items??[]){let Z=O?.conversion;!Z||typeof O?.line_id!="string"||y.current.get(O.line_id)!==N.get(O.line_id)||(X[O.line_id]={conversionConfidence:Z.conversion_confidence,conversionNotes:Z.conversion_notes,...Number.isFinite(Z.suggested_order_qty)&&Z.suggested_order_qty>0?{sellUnitsOverride:Z.suggested_order_qty}:{}})}Object.keys(X).length>0&&r(X)}).catch(U=>console.error("Catalogue conversion resolution failed",U)).finally(()=>{wt(U=>{let X={...U};for(let[N,O]of q)X[N]===O&&delete X[N];return X})})},[e,r]);function K(x){A(q=>{let U={...q};return delete U[x],U})}function ue(x,q){let U=parseFloat(q);!isNaN(U)&&U>=0&&t(x,Math.min(U,1e5)),K(x)}function Me(x,q,U){t(x,Math.min(1e5,Math.max(0,q+U))),K(x)}function Ot(x){Y(q=>{let U={...q};return delete U[x],U})}function jt(x,q){let U=parseFloat(q);!isNaN(U)&&U>=0&&a(x,Math.min(U,1e5)),Ot(x)}function qe(x,q,U){a(x,Math.min(1e5,Math.max(0,q+U))),Ot(x)}async function ke(){if(De.some(({pricing:q})=>q.lineTotal==null)){M(h?"Confirm the highlighted quantities before requesting a quote.":"Confirm the highlighted quantities before sending your basket.");return}let x=R.trim();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(x)){M(zv);return}M(""),w(!0);try{let q=await fetch(Ma("/api/quote-requests"),{method:"POST",headers:{"Content-Type":"application/json",...Mn()},body:JSON.stringify({email:x,items:De.map(({item:U,pricing:X})=>{let N=X.requiredSellUnits??X.requestedAmount,O=X.requiredSellUnits!=null?X.sellUnit:X.requestedUnit;return{product_id:U.productId,description:U.description,quantity:N,unit:_a(O,N),unit_price:X.requiredSellUnits!=null?X.unitPrice:null,line_total:X.lineTotal}})})});if(!q.ok){let U=await Qa(q);console.error("Quote request failed",q.status,U?.message),M(q.status===429?"You've sent a few requests already. Please try again in a few minutes.":"Your request couldn't be sent. Please try again, or contact us if it keeps happening.");return}z!=null&&f("quote_requested",{items:De.length,total:Math.round(z*100)/100}),u(!0),l?.(),window.scrollTo(0,0)}catch{M("Your request couldn't be sent. Check your connection and try again.")}finally{w(!1)}}let De=g.map(x=>({item:x,pricing:Ft(x,{wasteFactorEnabled:Ue,wasteFactorOverride:Math.max(0,Number.parseFloat(le)||0)/100})})),Ge=sc(g,{wasteFactorEnabled:Ue,wasteFactorOverride:Math.max(0,Number.parseFloat(le)||0)/100}),vt=Ge==null?null:Ge*Tv,z=Ge==null?null:Ge*(1+Tv),H=De.filter(({pricing:x})=>x.lineTotal==null).length,ne=Object.keys(ze).length,de=!!r&&g.some(x=>{if(x.productId==="-"||Ft(x).requiredSellUnits!=null)return!1;let q=Un(x);return y.current.get(x.lineId)!==q||ze[x.lineId]===q}),me=(0,mt.useRef)({items:De.length,...z==null?{}:{total:Math.round(z*100)/100}});(0,mt.useEffect)(()=>{f("basket_viewed",me.current)},[f]);let je=Math.max(1,Math.ceil(De.length/cl)),Oe=Math.min(V,je),k=De.slice((Oe-1)*cl,Oe*cl);return m?(0,E.jsx)("div",{className:"wizard-step entry-stage",children:(0,E.jsxs)("div",{className:"quote-request-sent",role:"status",children:[(0,E.jsx)("div",{className:"quote-request-sent-icon","aria-hidden":"true",children:(0,E.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,E.jsx)("polyline",{points:"5 12.5 10 17.5 19 7"})})}),(0,E.jsx)("h1",{children:h?"Quote requested":"Basket sent"}),h?(0,E.jsxs)("p",{children:["You're all done. We'll email your sharper price to ",(0,E.jsx)("strong",{children:R.trim()}),", usually within one working day."]}):(0,E.jsxs)("p",{children:["You're all done. We'll email ",(0,E.jsx)("strong",{children:R.trim()})," to confirm prices, availability and delivery, usually within one working day."]}),(0,E.jsx)("button",{type:"button",className:"cta-btn",onClick:o,children:(0,E.jsx)("span",{children:h?"Start a new quote":"Start a new basket"})}),(0,E.jsx)("p",{className:"quote-request-sent-note",children:h?"Nothing is charged until you approve the quote.":"Nothing is charged until you approve the order."})]})}):!c&&g.length===0?(0,E.jsx)("div",{className:"wizard-step entry-stage",children:(0,E.jsxs)("div",{className:"quote-request-sent",children:[(0,E.jsx)("div",{className:"quote-request-sent-icon","aria-hidden":"true",children:(0,E.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,E.jsx)("path",{d:"M3 9h18l-2 11H5z"}),(0,E.jsx)("path",{d:"M8 9l4-6 4 6"})]})}),(0,E.jsx)("h1",{children:h?"Your quote request is empty":"Your basket is empty"}),(0,E.jsx)("p",{children:h?"Start again with your list to build your quote.":"Start again with your list to fill your basket."}),(0,E.jsx)("button",{type:"button",className:"cta-btn",onClick:o,children:(0,E.jsx)("span",{children:"Back to start"})})]})}):(0,E.jsx)("div",{className:`wizard-step entry-stage${h?" basket-layout--qza6-mra4":""}`,children:(0,E.jsxs)("div",{className:`quick-order-card${c?"":" quick-order-card--customer"}`,children:[(0,E.jsxs)("div",{className:`quick-order-hero${c?"":" quick-order-hero--customer"}`,children:[c&&(0,E.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,E.jsxs)("div",{className:"basket-hero-copy",children:[h&&(0,E.jsxs)("button",{type:"button",className:"cta-btn cta-btn-secondary basket-hero-back",onClick:i,children:[(0,E.jsx)(Vr,{}),(0,E.jsx)("span",{children:"Back to results"})]}),(0,E.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,E.jsx)("h1",{children:c?"Your Selection":h?"Request a quote":"Your Basket"}),c&&(0,E.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,E.jsx)("strong",{children:g.length})," ",g.length===1?"item":"items"]})]}),(0,E.jsx)("p",{children:c?"Review the items you've added before exporting them for review.":h?"Check your items and quantities below, and we'll do our best to beat list prices.":"Review your quantities and order summary, then send us your basket."})]})]}),(0,E.jsx)("div",{className:"quick-order-panel",style:{paddingTop:16},children:de?(0,E.jsxs)("div",{className:"basket-resolving",role:"status","aria-label":"Calculating order quantities",children:[(0,E.jsx)("span",{className:"basket-resolving-wheel","aria-hidden":"true"}),(0,E.jsx)("span",{children:"Calculating your quantities\u2026"})]}):g.length===0?(0,E.jsxs)("div",{className:"quick-order-history-empty",children:[(0,E.jsx)("div",{className:"basket-empty-icon","aria-hidden":"true",children:"\u{1F4CB}"}),(0,E.jsx)("p",{children:"Your selection is empty."}),(0,E.jsx)("p",{className:"basket-empty-hint",children:"Go back to your results and add quoted items."}),(0,E.jsx)("div",{className:"btn-row",style:{marginTop:20,justifyContent:"center"},children:(0,E.jsx)("button",{className:"cta-btn",style:{width:"auto",maxWidth:280},onClick:i,"aria-label":"Back to results",children:(0,E.jsx)("span",{children:"Back to Results"})})})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:"basket-layout",children:[(0,E.jsxs)("div",{className:"basket-main",children:[(0,E.jsx)("div",{className:"basket-list","aria-label":c?"Selection items":h?"Quote request items":"Basket items",children:k.map(({item:x,pricing:q})=>{let U=T[x.lineId]??String(q.requestedAmount),X=q.requestedUnit===q.sellUnit||q.costingMode==="review",N=q.requiredSellUnits==null||q.requestedAmount!==q.requiredSellUnits||q.requestedUnit!==q.sellUnit;return(0,E.jsxs)("article",{className:"basket-card",children:[(0,E.jsxs)("div",{className:"basket-card-top",children:[(0,E.jsx)(Ta,{className:"basket-card-thumb",description:x.description,photoUrl:x.pdpPhotoUrl,width:48,height:48}),(0,E.jsxs)("div",{className:"basket-card-info",children:[(0,E.jsx)("div",{className:"bom-component-name",children:x.description}),N&&q.costingMode!=="review"&&(0,E.jsxs)("button",{type:"button",className:"basket-calc-toggle",onClick:()=>Ze(O=>({...O,[x.lineId]:!O[x.lineId]})),"aria-expanded":!!ge[x.lineId],children:["How we calculated this",(0,E.jsx)("span",{className:`basket-calc-toggle-chevron${ge[x.lineId]?" basket-calc-toggle-chevron--open":""}`,children:(0,E.jsx)(yi,{})})]})]}),(0,E.jsx)("div",{className:"basket-card-actions",children:(0,E.jsx)("button",{type:"button",className:"mf-remove-small-btn basket-card-remove",onClick:()=>n(x.lineId),"aria-label":`Remove ${x.description}`,children:(0,E.jsx)(Dd,{})})})]}),c&&(0,E.jsxs)("div",{className:"results-detail-block basket-internal-detail",children:[(0,E.jsxs)("dl",{className:"results-detail-grid",children:[(0,E.jsxs)("div",{children:[(0,E.jsx)("dt",{children:"Conversion type"}),(0,E.jsx)("dd",{children:x.conversionType??"-"})]}),(0,E.jsxs)("div",{children:[(0,E.jsx)("dt",{children:"Conversion confidence"}),(0,E.jsx)("dd",{children:x.conversionConfidence??"-"})]}),(0,E.jsxs)("div",{children:[(0,E.jsx)("dt",{children:"Sales unit"}),(0,E.jsx)("dd",{children:x.salesUnitSize!=null?(0,E.jsxs)(E.Fragment,{children:[x.salesUnitSize," ",xa(x.salesUnitSizeUom,x.salesUnitSize)]}):"-"})]}),(0,E.jsxs)("div",{children:[(0,E.jsx)("dt",{children:"Coverage"}),(0,E.jsx)("dd",{children:x.coverageQty!=null?(0,E.jsxs)(E.Fragment,{children:[x.coverageQty," ",xa(x.coverageUom,x.coverageQty)]}):"-"})]}),(0,E.jsxs)("div",{children:[(0,E.jsx)("dt",{children:"Waste factor"}),(0,E.jsx)("dd",{children:x.wasteFactorDefault??"-"})]}),(0,E.jsxs)("div",{children:[(0,E.jsx)("dt",{children:"Rounding rule"}),(0,E.jsx)("dd",{children:x.roundingRule??"-"})]})]}),x.conversionNotes&&(0,E.jsx)("p",{className:"results-rerank-note",children:x.conversionNotes})]}),q.costingMode==="review"?(0,E.jsxs)("p",{className:"basket-calc-text basket-calc-text--review",children:[(0,E.jsx)("strong",{children:ze[x.lineId]===Un(x)?"Calculating order quantity\u2026":"Quantity needs confirmation."})," ",G_(q)]}):N&&ge[x.lineId]?(0,E.jsx)("p",{className:"basket-calc-text",children:Q_(x,q)}):null,(0,E.jsxs)("div",{className:"basket-card-stats",children:[(0,E.jsxs)("div",{className:"basket-stat",children:[(0,E.jsx)("span",{className:"basket-stat-label",children:"Requested qty"}),(0,E.jsxs)("div",{className:"basket-stat-value",children:[(0,E.jsxs)("div",{className:"basket-qty-field",children:[(0,E.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:U,disabled:X,onChange:O=>A(Z=>({...Z,[x.lineId]:O.target.value})),onBlur:O=>ue(x.lineId,O.target.value),onKeyDown:O=>{O.key==="Enter"&&O.target.blur()},"aria-label":`${x.description} requested quantity`}),(0,E.jsxs)("div",{className:"basket-qty-arrows",children:[(0,E.jsx)("button",{type:"button",className:"basket-qty-arrow",disabled:X,onClick:()=>Me(x.lineId,parseFloat(U)||0,1),"aria-label":`Increase ${x.description} quantity`,children:(0,E.jsx)(yi,{})}),(0,E.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",disabled:X,onClick:()=>Me(x.lineId,parseFloat(U)||0,-1),"aria-label":`Decrease ${x.description} quantity`,children:(0,E.jsx)(yi,{})})]})]}),(0,E.jsx)("span",{className:"basket-metric-unit",children:xa(q.requestedUnit,parseFloat(U)||0)})]})]}),(0,E.jsxs)("div",{className:"basket-stat basket-stat--right",children:[(0,E.jsx)("span",{className:"basket-stat-label",children:"Order qty"}),(0,E.jsxs)("div",{className:"basket-stat-value",children:[(0,E.jsxs)("div",{className:"basket-qty-field",children:[(0,E.jsx)("input",{className:"bom-qty-edit",type:"number",inputMode:"decimal",min:"0",placeholder:"-",value:G[x.lineId]??String(q.requiredSellUnits??""),onChange:O=>Y(Z=>({...Z,[x.lineId]:O.target.value})),onBlur:O=>jt(x.lineId,O.target.value),onKeyDown:O=>{O.key==="Enter"&&O.target.blur()},"aria-label":`${x.description} order quantity`}),(0,E.jsxs)("div",{className:"basket-qty-arrows",children:[(0,E.jsx)("button",{type:"button",className:"basket-qty-arrow",onClick:()=>qe(x.lineId,parseFloat(G[x.lineId]??String(q.requiredSellUnits??"0"))||0,1),"aria-label":`Increase ${x.description} order quantity`,children:(0,E.jsx)(yi,{})}),(0,E.jsx)("button",{type:"button",className:"basket-qty-arrow basket-qty-arrow--down",onClick:()=>qe(x.lineId,parseFloat(G[x.lineId]??String(q.requiredSellUnits??"0"))||0,-1),"aria-label":`Decrease ${x.description} order quantity`,children:(0,E.jsx)(yi,{})})]})]}),(0,E.jsx)("span",{className:"basket-metric-unit",children:xa(q.sellUnit,parseFloat(G[x.lineId]??String(q.requiredSellUnits??"0"))||0)})]})]}),(0,E.jsxs)("div",{className:"basket-stat basket-stat--total",children:[(0,E.jsx)("span",{className:"basket-stat-label",children:"Total"}),(0,E.jsxs)("div",{className:"basket-stat-value",children:[(0,E.jsx)("strong",{children:q.lineTotal!=null?nt(q.lineTotal):"-"}),q.lineTotal!=null&&(0,E.jsx)("span",{className:"basket-metric-unit",children:"ex. VAT"})]})]})]})]},x.lineId)})}),je>1&&(0,E.jsxs)("div",{className:"results-pagination",children:[(0,E.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(Oe-1)*cl+1,"\u2013",Math.min(Oe*cl,De.length)," of ",De.length]}),(0,E.jsxs)("div",{className:"results-pagination-controls",children:[(0,E.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>se(Oe-1),disabled:Oe===1,children:"Previous"}),(0,E.jsxs)("span",{className:"results-pagination-page",children:["Page ",Oe," of ",je]}),(0,E.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>se(Oe+1),disabled:Oe===je,children:"Next"})]})]})]}),(0,E.jsxs)("aside",{className:"basket-sidebar",children:[(0,E.jsx)("div",{className:"basket-sidebar-title",children:h?"Quote request summary":"Order summary"}),(0,E.jsxs)("div",{className:"basket-sidebar-row",children:[(0,E.jsx)("span",{children:h?"List price (ex. VAT)":"Subtotal (ex. VAT)"}),(0,E.jsx)("span",{children:Ge==null?"To confirm":nt(Ge)})]}),(0,E.jsxs)("div",{className:"basket-sidebar-row",children:[(0,E.jsx)("span",{children:"VAT (20%)"}),(0,E.jsx)("span",{children:vt==null?"To confirm":nt(vt)})]}),(0,E.jsxs)("div",{className:"basket-sidebar-row basket-sidebar-row--total",children:[(0,E.jsx)("span",{children:h?"List price (inc.\xA0VAT)":"Total"}),(0,E.jsx)("span",{children:z==null?"To confirm":nt(z)})]}),!h&&(0,E.jsx)("div",{className:"basket-summary-waste",children:(0,E.jsxs)("div",{className:"basket-waste-control",children:[(0,E.jsxs)("label",{className:"basket-global-waste",children:[(0,E.jsx)("input",{type:"checkbox",checked:Ue,onChange:x=>ve(x.target.checked)}),(0,E.jsx)("span",{children:"Add waste factor"})]}),(0,E.jsxs)("label",{className:"basket-global-waste-percent",children:[(0,E.jsx)("input",{type:"number",inputMode:"decimal",min:"0",step:"0.1",value:le,onChange:x=>ot(x.target.value),disabled:!Ue,"aria-label":"Waste factor percent"}),(0,E.jsx)("span",{children:"%"})]})]})}),(0,E.jsx)("label",{htmlFor:`${p}-basket-reference`,className:"basket-sidebar-label",children:h?"Enter email for your sharper quote":d?"Your email":"Your reference (optional)"}),(0,E.jsx)("input",{id:`${p}-basket-reference`,type:d?"email":"text",className:"basket-sidebar-input",value:R,onChange:x=>{L(x.target.value),d&&M("")},placeholder:d?"you@example.com":"PO number or job reference","aria-invalid":d&&v===zv,"aria-describedby":d&&v?`${p}-basket-reference-error`:void 0}),d&&v&&(0,E.jsx)("p",{id:`${p}-basket-reference-error`,className:"basket-quote-request-error",role:"alert",children:v}),d?(0,E.jsx)("button",{type:"button",className:"cta-btn",onClick:()=>{ke()},disabled:b||H>0||ne>0,"aria-busy":b,children:(0,E.jsx)("span",{children:b?"Sending\u2026":h?"Request our best quote":"Send basket"})}):(0,E.jsx)("button",{className:"cta-btn",onClick:()=>{f("downloaded",{type:"basket",items:g.length}),Mv(g)},"aria-label":"Download selection",children:(0,E.jsx)("span",{children:"Download Quote"})}),(0,E.jsxs)("p",{className:"basket-sidebar-disclaimer",children:[(0,E.jsx)("span",{"aria-hidden":"true",children:"\u26A0\uFE0F"}),h?"This is a quote request, not an order. We'll confirm our best price, availability and delivery before you approve.":d?"Sending your basket isn't an order. We'll confirm prices, availability and delivery before you approve.":"Prices and availability are estimates and should be confirmed before procurement."]})]})]}),(0,E.jsx)("div",{className:"btn-row results-actions",children:(0,E.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,E.jsx)(Vr,{}),(0,E.jsx)("span",{children:"Back to results"})]})})]})})]})})}var xe=$(Ye());function On(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,linkedContext:t.linkedContext}}var xi=$(W());function Qd(){return(0,xi.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,xi.jsx)("path",{d:"M3 12a9 9 0 0 1 15.36-6.36L21 8"}),(0,xi.jsx)("path",{d:"M21 3v5h-5"}),(0,xi.jsx)("path",{d:"M21 12a9 9 0 0 1-15.36 6.36L3 16"}),(0,xi.jsx)("path",{d:"M3 21v-5h5"})]})}var s=$(W()),Yd="__none__",pl=24,j_=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}];function Dv(e){return e==null?"low":e>=.7?"high":e>=.5?"medium":"low"}var Y_=e=>e.attrs.supply_nature==="labour_only"||e.attrs.supply_nature==="plant"||e.flags.includes("referential");function $_(e,t){if(t!==Yd){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)}}function Rv(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 V_({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 Ln(e,t){if(e==null)return"-";let a=ol(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function $d(e){return e&&e.length>0?e.join(" x "):"-"}function X_(e){return e==null?"-":Number.isInteger(e/1e3)?`${e/1e3}m`:`${(e/1e3).toFixed(1)}m`}function Bn(e){let t=(e??[]).map(a=>a.trim()).filter(Boolean);return t.length>0?t.join(", "):"-"}function Zr(e,t){let a=typeof e.description_original=="string"?e.description_original.trim():"";return(typeof e.customer_display_label=="string"?e.customer_display_label.trim():"")||a||"(no description)"}function Z_(e,t){return t>0||e==null?null:nt(e)}var Av=[{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 K_(e){let t=new Map;return[...new Set(e.filter(Kr).map(r=>r.linked_group_id))].forEach((r,n)=>{let i=n%26;t.set(r,{token:String.fromCharCode(65+i),bubbleStyle:Av[n%Av.length]})}),t}function Kr(e){return!1}function Hn(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 Gd({meta:e}){return e?(0,s.jsx)("span",{className:"results-linked-pill",style:e.bubbleStyle,children:`Link ${e.token}`}):null}function P_(e,t,a){let r=t?.rerank?.recommendedCandidateIds??[],n=new Map(e.map(c=>[c.product_id,c])),i=r.length>0?r.map(c=>n.get(c)).filter(c=>c!=null):e.slice(0,6),o=a?n.get(a):void 0,l=o?[o,...i.filter(({product_id:c})=>c!==o.product_id)]:i;return[...new Map(l.map(c=>[c.product_id,c])).values()].slice(0,6)}function jd(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 cc(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 J_({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:cc(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:cc(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:cc(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:cc(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 I_({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:$d(r.measurements_mm)}),(0,s.jsx)("td",{children:ol(r.price_basis)||"-"}),(0,s.jsx)("td",{children:r.bm25.toFixed(2)})]},`${r.product_id}-${n}`))})]})]},`${t.query}-${a}`))]})}function Uv({item:e,result:t}){let a=t?.retrieval_debug.map(n=>n.query).filter(Boolean)??[],r=[["Procurement intent",e.procurement_intent||"-"],["Procurement aliases",Bn(e.procurement_aliases)],["Retrieval queries",Bn(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)",$d(e.attrs.measurements_mm)],["Stock length",X_(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",Bn(e.installation_clues)],["System clues",Bn(e.system_clues)],["Component requirements",Bn(e.component_requirements)],["Linked group",Hn(e)||"-"],["Flags",Bn(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)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:n}),(0,s.jsx)("dd",{children:i})]},n))})]})}function F_({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)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Attempted"}),(0,s.jsx)("dd",{children:t.attempted?"yes":"no"})]}),(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Applied"}),(0,s.jsx)("dd",{children:t.applied?"yes":"no"})]}),(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Returned items"}),(0,s.jsx)("dd",{children:t.returned_item_count??"-"})]}),(0,s.jsxs)(xe.Fragment,{children:[(0,s.jsx)("dt",{children:"Reason"}),(0,s.jsx)("dd",{children:t.reason||"-"})]}),(0,s.jsxs)(xe.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 W_({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||"-"]];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)(xe.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 ex({item:e,decision:t,selectedProductId:a,result:r,showRetrievalDebug:n,reviewOnly:i=!1,linkedGroupMeta:o}){if(!t)return null;let l=a==null?"Needs review:":"Selected:";return i?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:l}),"\xA0",t.reason]}),Kr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",o?`Link ${o.token} - `:"",Hn(e)]}):null]}):null:!t.reason&&!n?(0,s.jsx)(Uv,{item:e,result:r}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Uv,{item:e,result:r}),n&&(0,s.jsx)(F_,{item:e}),n&&(0,s.jsx)(W_,{result:r}),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:l}),"\xA0",t.reason]}),Kr(e)?(0,s.jsxs)("p",{className:"results-row-meta",style:{marginTop:8},children:["Linked context: ",o?`Link ${o.token} - `:"",Hn(e)]}):null]}),n&&(0,s.jsx)(I_,{queries:r?.retrieval_debug??[]})]})}function tx({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:h=!1,forceReviewNote:d=!1,linkedGroupMeta:g}){let y=f||o==="detailed",R=h&&o==="detailed",L=y||d?(0,s.jsx)(ex,{item:e,decision:r,selectedProductId:i,result:a,showRetrievalDebug:R,reviewOnly:d&&!y,linkedGroupMeta:g}):null;if(n)return(0,s.jsxs)(s.Fragment,{children:[L,(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:[L,(0,s.jsx)("p",{className:"results-empty-hint",children:"No candidates were returned for this line item."})]});let m=p||f||o==="detailed"?t:P_(t,a,i);return(0,s.jsxs)(s.Fragment,{children:[L,(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"}),R&&(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((u,b)=>{let w=u.product_id===i;return(0,s.jsxs)("tr",{className:w?"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:$d(u.measurements_mm??u.debug?.candidate.measurements_mm)})}),(0,s.jsx)("td",{children:Ln(u.price,u.price_basis)}),R&&(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)(V_,{band:Dv(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:w?"Currently selected":"Use this candidate",children:[(0,s.jsx)("input",{type:"checkbox",checked:w,onChange:()=>{w?c?.():l(u)},"aria-label":w?`${u.description} selected`:`Use ${u.description}`}),(0,s.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},`${u.product_id}-${b}`)})})]})]})}function Vd({scheduleResult:e,onStartOver:t,cart:a,onAddToCart:r,onRemoveFromCart:n,onGoToBasket:i,cartSeeded:o,onCartSeeded:l,reviewGateComplete:c,onReviewGateComplete:p,internal:f=!1}){let h=!f&&Is()==="QZA6-MRA4",d=h?"quote":"basket",{results:g,lineItems:y,parseReport:R,timings:L}=e,[m,u]=(0,xe.useState)({}),b=En(),[w,v]=(0,xe.useState)({}),[M,T]=(0,xe.useState)({}),[A,G]=(0,xe.useState)(""),[Y,V]=(0,xe.useState)(null),[se,ge]=(0,xe.useState)(1),Ze=Dt().debug===!0,[Ue,ve]=(0,xe.useState)("simple"),[le,ot]=(0,xe.useState)(f?"list":"tile"),[ze,wt]=(0,xe.useState)(!1),[K,ue]=(0,xe.useState)(null),[Me,Ot]=(0,xe.useState)(""),[jt,qe]=(0,xe.useState)([]),[ke,De]=(0,xe.useState)(!1),[Ge,vt]=(0,xe.useState)(null),[z,H]=(0,xe.useState)(!1),[ne,de]=(0,xe.useState)(null),me=(0,xe.useRef)(null),[je,Oe]=(0,xe.useState)(new Set),[k,x]=(0,xe.useState)(new Set),[q,U]=(0,xe.useState)(!1);(0,xe.useEffect)(()=>{ge(1)},[A,Y,le]);let X=new Map(g.map(S=>[S.line_id,S])),N=K_(y),O=y.map(S=>{let Q=X.get(S.line_id),be=Q?.decision,ht=Y_(S),Pe=m[S.line_id],Za=$_(Q,Pe),Ai=a[S.line_id],v0=Pe===Yd?void 0:w[S.line_id]??(Ai&&Ai.productId!==Za?.product_id?Rv(Ai):Za),qm=ht?void 0:v0,y0=S.qty??0;return{item:S,result:Q,decision:be,unmatchable:ht,best:qm,qty:y0,band:Dv(qm?.scores?.overall)}}),pe=O.some(S=>!S.unmatchable&&!S.best&&!k.has(S.item.line_id))?null:sc(Object.values(a),{wasteFactorEnabled:!1,wasteFactorOverride:0}),Se=0;for(let S of O){if(S.unmatchable||!S.best)continue;let Q=a[S.item.line_id];(!Q||Ft(Q).lineTotal==null)&&(Se+=1)}Se>0&&(pe=null);let yt=Z_(pe,Se),ft=S=>!S.unmatchable&&!S.best&&jd(S.result).length>0,At=S=>S.best??jd(S.result)[0],Jr=O.filter(S=>!S.unmatchable&&!S.best).filter(S=>!k.has(S.item.line_id)),Ec=O.filter(S=>k.has(S.item.line_id)),Yt=O;if(A.trim()){let S=A.trim().toLowerCase();Yt=Yt.filter(Q=>Q.item.description_original?.toLowerCase().includes(S)||At(Q)?.description?.toLowerCase().includes(S))}if(Y){let S=Y==="asc"?1:-1;Yt=[...Yt].sort((Q,be)=>S*(Q.item.description_original||"").localeCompare(be.item.description_original||""))}let hr=Math.max(1,Math.ceil(Yt.length/pl)),_t=Math.min(se,hr),Zn=Yt.slice((_t-1)*pl,_t*pl),vm=Zn.filter(S=>!S.unmatchable&&S.best),Mc=Zn.filter(S=>!S.unmatchable&&S.best),ym=Zn.filter(S=>S.unmatchable||!S.best),J=K?O.find(S=>S.item.line_id===K)??null:null,d0=!f&&!c&&!J&&Jr.length>0,Kn=(0,xe.useRef)(null),Pn=()=>{let S=me.current;if(!S)return;let{top:Q,left:be,width:ht,height:Pe}=S.getBoundingClientRect(),Ai=S.querySelector(".bom-toolbar-btn")?.closest("td")?.getBoundingClientRect().left;de({top:Q,left:be,width:Ai?Ai-be:ht,height:Pe})};(0,xe.useEffect)(()=>(window.addEventListener("scroll",Pn,!0),window.addEventListener("resize",Pn),()=>{window.removeEventListener("scroll",Pn,!0),window.removeEventListener("resize",Pn)})),(0,xe.useEffect)(()=>{let S=Q=>{Kn.current&&!Q.composedPath().includes(Kn.current)&&Kn.current.removeAttribute("open")};return document.addEventListener("click",S),()=>document.removeEventListener("click",S)},[]);let zi=S=>{ue(S),Ot("")},m0=()=>{if(!K)return;let S=a[K];if(S){u(Q=>({...Q,[K]:S.productId})),v(Q=>({...Q,[K]:Rv(S)}));return}u(Q=>{let be={...Q};return delete be[K],be}),v(Q=>{let be={...Q};return delete be[K],be})},Xa=(S=!1)=>{let Q=K?a[K]:void 0;!S&&Q&&J?.best&&Q.productId!==J.best.product_id&&!window.confirm("You have selected a new product. Leave without updating it?")||(S||m0(),ue(null),U(!1))};rl(z,()=>H(!1)),rl(!!J&&!z,()=>Xa());let f0=S=>{if(Oe(Q=>new Set(Q).add(S)),Jr.some(Q=>Q.item.line_id!==S)){Xa(!0);return}p(),Xa(!0)},h0=S=>{if(Tc(S),x(Q=>new Set(Q).add(S)),Jr.some(Q=>Q.item.line_id!==S)){Xa(!0);return}p(),Xa(!0)},g0=()=>{x(S=>new Set([...S,...Jr.map(Q=>Q.item.line_id)])),p()},_m=()=>{J?.best&&(km(J.item.line_id,J.best),r(Jn(J)),q?f0(J.item.line_id):Xa(!0))},xm=ym.length>0?(0,s.jsxs)("section",{className:"results-tile-section results-tile-section--unmatched","aria-label":"Items needing review",children:[(0,s.jsxs)("div",{className:"results-tile-section__head",children:[(0,s.jsx)("h3",{children:"Needs review"}),(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:ym.map(S=>{let{item:Q,qty:be}=S;return(0,s.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>zi(Q.line_id),children:[(0,s.jsx)("span",{className:"results-unmatched-card__main",children:(0,s.jsx)("span",{className:"results-unmatched-card__title",children:Zr(Q,y)})}),(0,s.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},Q.line_id)})})]}):null,Tc=S=>{u(Q=>({...Q,[S]:Yd})),v(Q=>({...Q,[S]:void 0})),T(Q=>({...Q,[S]:void 0})),n(S)},zc=(S,Q)=>{u(be=>({...be,[S]:Q.product_id})),v(be=>({...be,[S]:Q}))},km=(S,Q)=>{Q.method==="catalogue_search"&&T(be=>({...be,[S]:Q}))};function Qx(){b("downloaded",{type:"schedule",lines:O.length}),Ev(O.map(({item:S,best:Q,qty:be,band:ht,unmatchable:Pe,decision:Za})=>({item:S,best:Q,qty:be,band:ht,unmatchable:Pe,decision:Za})))}function Jn(S){let Q=S.best;if(!Q)throw new Error("Cannot add a line item without a selected product.");return On(Q,{lineId:S.item.line_id,description:S.item.description_original,unit:S.item.unit,qty:S.qty,linkedContext:S.item.linked_group_role==="dependent"&&S.item.linked_group_id?y.filter(be=>be.linked_group_id===S.item.linked_group_id&&be.linked_group_role==="anchor").slice(0,1).map(be=>{let ht=a[be.line_id];return{line_id:be.line_id,product_id:ht?.productId??null,measurements_mm:ht?.measurementsMm??be.attrs.measurements_mm,description:ht?.description??be.description_original,qty:be.qty,unit:be.unit,role:"anchor"}}):void 0})}(0,xe.useEffect)(()=>{if(!o){for(let S of O)!S.unmatchable&&S.best&&r(Jn(S));l()}},[o]),(0,xe.useEffect)(()=>{if(!K){qe([]),vt(null),De(!1);return}let S=Me.trim();if(!S){qe([]),vt(null),De(!1);return}let Q=!1,be=window.setTimeout(async()=>{try{De(!0),vt(null);let ht=await fetch(Ma(`/api/catalogue/search?q=${encodeURIComponent(S)}`),{headers:bi()}),Pe=await Qa(ht);if(!ht.ok)throw new Error(Pe?.error||Pe?.message||"Failed to search catalogue");Q||qe(Array.isArray(Pe?.items)?Pe.items:[])}catch(ht){Q||(qe([]),vt(ht?.message||"Failed to search catalogue"))}finally{Q||De(!1)}},250);return()=>{Q=!0,window.clearTimeout(be)}},[Me,K]);let Rc=Object.keys(a).length,Na=Me.trim(),Ac=jd(J?.result),bl=!!J&&!J.best&&(J.result?.candidates.length===0||J.result?.rerank?.selectedCandidateId===null),Sm=J?.result?.rerank!=null,Nm=J?.decision?.reason??(bl?"No catalogue candidate found. Refine the request or search the catalogue.":null),b0=jt.map(S=>({product_id:S.product_id,description:S.description,source_list:S.source_list,price:S.price,price_basis:S.price_basis,uoi_count:S.uoi_count??null,uoi:S.uoi,pdp_photo_url:S.pdp_photo_url??null,conversion:S.conversion,measurements_mm:S.measurements_mm??[],scores:{dimension:0,grade:0,brand:0,fuzzy:0,bm25:0,overall:0},method:"catalogue_search"})),In=Na?b0:Ac,Ri=J?M[J.item.line_id]:void 0,Fn=!Na&&Ri&&!In.some(S=>S.product_id===Ri.product_id)?[...In,Ri]:In,Cm=(()=>{let S=Fn.slice(0,Na?12:6);return Na||!Ri||S.some(Q=>Q.product_id===Ri.product_id)?S:[...S,Ri]})(),wl=!!J?.best&&a[J.item.line_id]?.productId===J.best.product_id,w0=!!J?.best&&!!a[J.item.line_id]&&!wl;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:yt??"Review quantities"})," 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 ",h?"View Quote":"View Basket"," to continue."]})]}),(0,s.jsxs)("button",{type:"button",className:"results-total-action",onClick:i,disabled:Rc===0,"aria-label":h?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("small",{children:h?"View Quote":"View Basket"}),yt!=null&&(0,s.jsx)("strong",{children:yt})]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Qt,{})})]})]})}),(0,s.jsxs)("div",{className:"quick-order-panel",style:{paddingTop:16},children:[Ze&&(0,s.jsx)("div",{className:"results-summary",style:{marginBottom:12},children:(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn","aria-pressed":ze,onClick:()=>wt(S=>!S),children:ze?"Hide timings":"Show timings"})}),Ze&&ze&&(0,s.jsx)(J_,{...L}),!h&&(0,s.jsx)("div",{className:"results-toolbar-row",children:!J&&(0,s.jsx)("div",{className:"results-summary",style:{marginBottom:0},children:(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:A,onChange:S=>G(S.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${le==="tile"?" is-active":""}`,"aria-pressed":le==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>ot("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${le==="list"?" is-active":""}`,"aria-pressed":le==="list","aria-label":"List view",title:"List view",onClick:()=>ot("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"})]})})]}),Ze&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>ve(S=>S==="simple"?"detailed":"simple"),children:Ue==="detailed"?"Hide detailed view":"Show detailed view"}),(0,s.jsxs)("details",{ref:Kn,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:j_.map(S=>{let Q=Y===S.dir;return(0,s.jsxs)("button",{type:"button",className:`sort-menu-item${Q?" is-active":""}`,onClick:()=>{V(Q?null:S.dir),Kn.current?.removeAttribute("open")},children:[(0,s.jsx)("span",{className:"sort-menu-item__check",children:Q?"\u2713":""}),S.label]},S.dir)})})]})]})})}),le==="tile"||J?(0,s.jsxs)(s.Fragment,{children:[J?(0,s.jsx)("div",{className:"modal-backdrop quick-order-modal-backdrop",role:"dialog","aria-modal":"true","aria-label":"Product options",onClick:()=>Xa(),children:(0,s.jsxs)("section",{className:"quick-order-workflow-modal results-review-modal",onClick:S=>S.stopPropagation(),children:[(0,s.jsx)("button",{type:"button",className:"quick-order-workflow-close results-review-modal__close",onClick:()=>Xa(),"aria-label":"Close product options",children:(0,s.jsx)(il,{})}),(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:()=>Xa(),children:[(0,s.jsx)(Vr,{}),"Back to results"]}),(0,s.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[Ze&&(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>ve(S=>S==="simple"?"detailed":"simple"),children:Ue==="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:Me,onChange:S=>Ot(S.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:()=>Tc(J.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)(Ta,{className:"fill-img results-review-page__image",description:At(J)?.description||J.item.description_original,photoUrl:At(J)?.pdp_photo_url})}),(0,s.jsxs)("div",{className:"results-review-page__summary",children:[(0,s.jsx)("h2",{children:Zr(J.item,y)}),(0,s.jsxs)("p",{className:"results-review-page__meta",children:[vi(J.qty)," ",xa(J.item.unit,J.qty)]}),J.best?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:J.best.description}),J.best.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:Ln(J.best.price,J.best.price_basis)}):null]}):At(J)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-review-page__product",children:At(J)?.description}),At(J)?.price!=null?(0,s.jsx)("div",{className:"results-row-meta",children:Ln(At(J)?.price??null,At(J)?.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."}),Kr(J.item)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:8},children:[(0,s.jsx)(Gd,{meta:N.get(J.item.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:Hn(J.item)})]}):null,(0,s.jsx)("div",{className:"results-review-page__actions",children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[J.item.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[J.item.line_id]?n(J.item.line_id):(J.best&&km(J.item.line_id,J.best),r(Jn(J)))},disabled:!J.best,"aria-label":a[J.item.line_id]?f?"Remove from selection":`Remove from ${d}`:f?"Add to selection":`Add to ${d}`,children:a[J.item.line_id]?"\u2713 Added":f?"+ Add to selection":`Add to ${d}`})})]})]}),ke?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,!ke&&Ge?(0,s.jsx)("div",{className:"results-empty-card",children:Ge}):null,!ke&&!Ge&&Na&&In.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No candidate products match this database search."}):!ke&&!Ge?(0,s.jsx)(tx,{item:J.item,candidates:In,result:J.result,decision:J.decision,unmatchable:J.unmatchable,selectedProductId:J.best?.product_id??null,detailMode:Ue,linkedGroupMeta:Kr(J.item)?N.get(J.item.linked_group_id):void 0,onPick:S=>zc(J.item.line_id,S),onClear:()=>Tc(J.item.line_id),showAll:f||Ze||Na.length>0,internal:f,debugEnabled:Ze,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:Zr(J.item,y)||"Original request"})]}),Nm?(0,s.jsxs)("section",{className:"customer-review-ai",children:[(0,s.jsx)("strong",{children:bl?"No automatic match:":"AI review:"})," ",Nm]}):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:bl?Ac.length>0?"Choose a product":"No suitable product found":Sm?"Choose a product":"We couldn't review this item"}),(0,s.jsx)("p",{children:bl?Ac.length>0?"No product was selected automatically. Review these related options before adding one.":"Search the catalogue to choose an alternative.":Sm?`Select the option you want to add to your ${d}.`:"Search the catalogue to choose a product."})]})}),!Na&&Fn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:Cm.map(S=>{let Q=S.product_id===J.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${Q?" is-selected":""}`,onClick:()=>zc(J.item.line_id,S),"aria-pressed":Q,children:[(0,s.jsx)(Ta,{className:"customer-review-option__image",description:S.description,photoUrl:S.pdp_photo_url,width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:S.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:S.price!=null?`\xA3${Ln(S.price,S.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:Q?"Selected":"Choose"})]},S.product_id)})}):null,Fn.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:Me,onChange:S=>Ot(S.target.value),"aria-label":"Search catalogue"})]}),Na&&ke?(0,s.jsx)("div",{className:"results-empty-card",children:"Searching catalogue\u2026"}):null,Na&&!ke&&Ge?(0,s.jsx)("div",{className:"results-empty-card",children:Ge}):null,Na&&!ke&&!Ge&&Fn.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No products match this search."}):null,Na&&!ke&&!Ge&&Fn.length>0?(0,s.jsx)("div",{className:"customer-review-option-grid",children:Cm.map(S=>{let Q=S.product_id===J.best?.product_id;return(0,s.jsxs)("button",{type:"button",className:`customer-review-option${Q?" is-selected":""}`,onClick:()=>zc(J.item.line_id,S),"aria-pressed":Q,children:[(0,s.jsx)(Ta,{className:"customer-review-option__image",description:S.description,photoUrl:S.pdp_photo_url,width:64,height:64}),(0,s.jsx)("span",{className:"customer-review-option__copy",children:(0,s.jsx)("strong",{children:S.description})}),(0,s.jsx)("span",{className:"customer-review-option__price",children:S.price!=null?`\xA3${Ln(S.price,S.price_basis)}`:"-"}),(0,s.jsx)("span",{className:"customer-review-option__state",children:Q?"Selected":"Choose"})]},S.product_id)})}):null]}),J.best?w0?(0,s.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,s.jsx)("button",{type:"button",className:"cta-btn customer-review-add",onClick:()=>{_m()},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(J.item.line_id),children:(0,s.jsx)("span",{children:`Remove from ${d}`})})]}):(0,s.jsx)("button",{type:"button",className:`cta-btn customer-review-add${wl?" cta-btn-secondary":""}`,onClick:()=>{wl?n(J.item.line_id):_m()},children:(0,s.jsx)("span",{children:wl?`Remove from ${d}`:`Add selected product to ${d}`})}):null,q?(0,s.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary customer-review-skip",onClick:()=>h0(J.item.line_id),children:"Skip this item"}):null]})})]})}):null,(0,s.jsxs)("div",{className:"results-tile-layout",children:[Yt.length===0?(0,s.jsx)("div",{className:"results-empty-card",children:"No line items match the current search/filter."}):null,Mc.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:Mc.map(S=>{let{item:Q,best:be,qty:ht}=S,Pe=At(S);return(0,s.jsxs)("article",{className:"results-tile-card",children:[(0,s.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>zi(Q.line_id),"aria-label":`Review match for ${Zr(Q,y)||"item"}`,children:[(0,s.jsxs)("div",{className:"results-tile-card__media",children:[Kr(Q)?(0,s.jsx)("div",{className:"results-tile-card__badges",children:(0,s.jsx)(Gd,{meta:N.get(Q.linked_group_id)})}):null,(0,s.jsx)(Ta,{className:"fill-img results-tile-card__image",description:Pe?.description||Q.description_original,photoUrl:Pe?.pdp_photo_url})]}),(0,s.jsxs)("div",{className:"results-tile-card__body",children:[Pe?(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:Pe.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:Pe?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"results-tile-card__match-label",children:"\u21B3 matched from"}),(0,s.jsx)("div",{className:"results-tile-card__match-name",children:Zr(Q,y)}),Kr(Q)?(0,s.jsx)("div",{className:"results-row-meta",children:Hn(Q)}):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:()=>zi(Q.line_id),children:"Review"}),(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[Q.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>{a[Q.line_id]?n(Q.line_id):r(Jn(S))},disabled:!be,"aria-label":a[Q.line_id]?f?"Remove from selection":`Remove from ${d}`:f?"Add to selection":`Add to ${d}`,children:a[Q.line_id]?"\u2713 Added":f?"+ Add":`Add to ${d}`})]})]},Q.line_id)})})}):null,xm]})]}):(0,s.jsxs)(s.Fragment,{children:[ne&&(0,s.jsx)("div",{className:"results-table__hover-overlay",style:ne,"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"}}),Ue==="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"}),Ue==="simple"&&(0,s.jsx)("th",{style:{textAlign:"center"},children:f?"Selection":h?"Quote":"Basket"})]})}),(0,s.jsxs)("tbody",{children:[Yt.length===0&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:Ue==="simple"?4:3,className:"results-empty-hint",style:{padding:"16px 8px"},children:"No line items match the current search/filter."})}),Mc.map(S=>{let{item:Q,result:be,decision:ht,best:Pe}=S;return(0,s.jsxs)("tr",{className:"bom-row results-table__review-row",onClick:()=>zi(Q.line_id),onMouseEnter:Za=>{me.current=Za.currentTarget,Pn()},onMouseLeave:()=>{me.current=null,de(null)},children:[(0,s.jsxs)("td",{children:[(0,s.jsx)("div",{className:"bom-component-name",children:Zr(Q,y)}),Kr(Q)?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:4},children:[(0,s.jsx)(Gd,{meta:N.get(Q.linked_group_id)}),(0,s.jsx)("div",{className:"results-row-meta",style:{marginTop:0},children:Hn(Q)})]}):null]}),(0,s.jsx)("td",{children:Pe?(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"results-match-cell-text",title:Pe.description,children:Pe.description}),Ue==="detailed"&&ht&&(0,s.jsx)("div",{className:"results-row-meta",children:ht.selected_candidate_id===Pe.product_id?"Automatically selected":"Selected"})]}):(0,s.jsx)("span",{className:"results-empty-hint"})}),(0,s.jsx)("td",{style:{textAlign:"center"},children:Pe?.price!=null?Ln(Pe.price,Pe.price_basis):"-"}),Ue==="simple"&&(0,s.jsx)("td",{style:{textAlign:"center"},children:(0,s.jsx)("button",{type:"button",className:`bom-toolbar-btn${a[Q.line_id]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,style:{width:84,justifyContent:"center"},onClick:Za=>{Za.stopPropagation(),a[Q.line_id]?n(Q.line_id):r(Jn(S))},"aria-label":a[Q.line_id]?f?"Remove from selection":`Remove from ${d}`:f?"Add to selection":`Add to ${d}`,children:a[Q.line_id]?"\u2713 Added":f?"+ Add":`Add to ${d}`})})]},Q.line_id)})]})]})}),xm]}),!J&&hr>1&&(0,s.jsxs)("div",{className:"results-pagination",children:[(0,s.jsxs)("span",{className:"results-pagination-count",children:["Showing ",(_t-1)*pl+1,"\u2013",Math.min(_t*pl,Yt.length)," of ",Yt.length]}),(0,s.jsxs)("div",{className:"results-pagination-controls",children:[(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>ge(_t-1),disabled:_t===1,children:"Previous"}),(0,s.jsxs)("span",{className:"results-pagination-page",children:["Page ",_t," of ",hr]}),(0,s.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>ge(_t+1),disabled:_t===hr,children:"Next"})]})]}),(R.itemCount!=null||R.headingCount!=null||R.skippedCount!=null)&&(0,s.jsxs)("div",{className:"results-summary",style:{marginTop:16},children:[R.itemCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:R.itemCount})," items parsed"]}),R.headingCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:R.headingCount})," headings"]}),R.skippedCount!=null&&(0,s.jsxs)("span",{className:"summary-chip",children:[(0,s.jsx)("strong",{children:R.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."})]}),!J&&(0,s.jsxs)("div",{className:"btn-row results-actions",children:[(0,s.jsxs)("button",{className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",gap:10,justifyContent:"center"},onClick:()=>H(!0),"aria-label":"Start over",children:[(0,s.jsx)(Qd,{}),(0,s.jsx)("span",{children:"Start Over"})]}),(0,s.jsxs)("button",{className:"cta-btn",style:{flex:"0 1 70%"},onClick:i,disabled:Rc===0,"aria-label":f?"View selection":h?"View quote":"View basket",children:[(0,s.jsxs)("span",{children:[f?"View Selection":h?"View Quote":"View Basket"," (",Rc,")"]}),(0,s.jsx)("span",{className:"arrow",children:(0,s.jsx)(Qt,{})})]})]})]})]}),d0&&(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:Jr.map(S=>{let Q=je.has(S.item.line_id),be=ft(S);return(0,s.jsx)("div",{className:`review-gate-item${Q?" is-reviewed":""}`,children:(0,s.jsxs)("button",{type:"button",className:"review-gate-item__review",onClick:()=>{U(!0),zi(S.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Zr(S.item,y)}),(0,s.jsx)("span",{children:S.decision?.reason||(be?"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:Q?"Choice made":"Choose a product"})]})},S.item.line_id)})}),(0,s.jsx)("button",{type:"button",className:"review-gate-skip",onClick:g0,children:"Skip all"}),Ec.length>0?(0,s.jsxs)("div",{className:"review-gate-skipped",children:[(0,s.jsx)("strong",{children:"Skipped"}),Ec.map(S=>(0,s.jsxs)("button",{type:"button",className:"review-gate-item is-skipped",onClick:()=>{x(Q=>{let be=new Set(Q);return be.delete(S.item.line_id),be}),U(!0),zi(S.item.line_id)},children:[(0,s.jsxs)("span",{className:"review-gate-item__copy",children:[(0,s.jsx)("strong",{children:Zr(S.item,y)}),(0,s.jsx)("span",{children:`Not added to your ${d}.`})]}),(0,s.jsx)("span",{className:"review-gate-item__action",children:"Choose a product"})]},S.item.line_id))]}):null]})}),z&&(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 ",h?"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:()=>H(!1),children:"Cancel"}),(0,s.jsx)("button",{type:"button",className:"modal-btn modal-btn-danger",onClick:()=>{H(!1),t()},autoFocus:!0,children:"Start Over"})]})]})})]})}var Ya=$(W()),Xd="metron-quick-quote",ax=1440*60*1e3;function uc(e){return(0,Ya.jsx)(lc,{children:(0,Ya.jsx)(rx,{...e})})}function rx({fullPage:e=!1,hideHeader:t=!1,internal:a=!1}){let[r,n]=(0,He.useState)("entry"),[i,o]=(0,He.useState)(null),l=(0,He.useRef)(null),c=(0,He.useRef)(0),[p,f]=(0,He.useState)(0),[h,d]=(0,He.useState)(null),[g,y]=(0,He.useState)(!1),{cart:R,addToCart:L,addManyToCart:m,removeFromCart:u,updateCartQty:b,updateCartSellUnits:w,updateCartConversions:v,clearCart:M}=Dn(),[T,A]=(0,He.useState)(!1),[G,Y]=(0,He.useState)(null),V=()=>{Y(null);try{window.sessionStorage.removeItem(oc)}catch{}},se=(0,He.useRef)(null),ge=Js("quick-quote",se);(0,He.useEffect)(()=>{ge("viewed")},[ge]);let[Ze,Ue]=(0,He.useState)(!1);(0,He.useEffect)(()=>{vv();let qe=window.location.hash,ke=null;try{ke=JSON.parse(window.sessionStorage.getItem(Xd)??"null")}catch{}if(ke&&!(Date.now()-(ke.savedAt??0)<ax)&&(ke=null),ke?.scheduleResult)o("schedule"),d(ke.scheduleResult),y(ke.reviewGateComplete),A(ke.cartSeeded),m(Object.values(ke.cart)),qe==="#quote-request"?n("basket"):qe==="#matched-products"&&n("results");else if(qe==="#matched-products"||qe==="#quote-request"){let De=new URL(window.location.href);De.hash="",Rn("replaceState",window.history.state,De)}Ue(!0)},[]),(0,He.useEffect)(()=>{if(Ze)try{h?window.sessionStorage.setItem(Xd,JSON.stringify({savedAt:Date.now(),scheduleResult:h,reviewGateComplete:g,cartSeeded:T,cart:R})):window.sessionStorage.removeItem(Xd)}catch{}},[Ze,h,g,T,R]);let ve=(0,He.useCallback)(qe=>{if(typeof window>"u")return;let ke=new URL(window.location.href);ke.hash=qe==="basket"?"quote-request":"matched-products";let De=qe==="results"&&(window.location.hash==="#matched-products"||window.location.hash==="#quote-request");Rn(De?"replaceState":"pushState",{boqQuoteStage:qe},ke)},[]),le=(0,He.useRef)(!1);(0,He.useEffect)(()=>{let qe=()=>{le.current=!1;let ke=window.location.hash;ke==="#quote-request"?n("basket"):ke==="#matched-products"&&h?(o("schedule"),n("results")):n("entry")};return window.addEventListener("popstate",qe),()=>window.removeEventListener("popstate",qe)},[h]);let ot=(0,He.useCallback)(()=>{ve("basket"),n("basket")},[ve]),ze=(0,He.useCallback)(()=>{if(window.location.hash==="#quote-request"){if(le.current)return;le.current=!0,nc();return}n(h?"results":"entry")},[h]),wt=(0,He.useRef)(r);(0,He.useEffect)(()=>{wt.current!==r&&(wt.current=r,window.scrollTo(0,0))},[r]);let K=()=>{n("entry"),o(null),f(0),d(null),y(!1),M(),A(!1),V()},ue=(0,He.useCallback)(async(qe,ke,De=!0)=>{let Ge=++c.current;f(0);let vt=0,z=()=>{vt=Math.min(vt+1,3),f(vt)};try{let{jobId:H}=await Cw(qe,ke,De);if(Ge!==c.current)return;let{promise:ne,cancel:de}=Ew(()=>qw(H),5e3,z,"schedule");l.current=de;let me=await ne;if(me.status==="failed"||!me.result)throw new Error(me.error||"Failed to process schedule");let je=me.result.lineItems.length,Oe=me.result.results.filter(k=>k.candidates.length>0).length;ge("results_shown",{lines:je,matched:Oe,unmatched:je-Oe}),M(),A(!1),y(!1),d(me.result),ve("results"),n("results")}catch(H){if(Ge!==c.current)return;throw ge("error",{stage:"matching"}),H}finally{Ge===c.current&&(l.current?.(),l.current=null)}},[ve,ge,M]),Me=(0,He.useCallback)(()=>{c.current++,l.current?.(),l.current=null},[]),Ot=(0,He.useCallback)(async(qe,ke,De=!0)=>{if(!qe.trim())return;o("schedule");let Ge=new File([qe],"pasted-schedule.txt",{type:"text/plain"});await ue(Ge,ke,De)},[ue]),jt=(0,He.useCallback)(async qe=>{o("schedule"),await ue(qe)},[ue]);return(0,Ya.jsx)(tl.Provider,{value:ge,children:(0,Ya.jsx)("div",{ref:se,className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}${!e&&r==="processing"?" app-wrapper--loading":""}`,style:Dt().theme,children:(0,Ya.jsxs)("main",{className:"main-content",children:[r==="entry"&&(0,Ya.jsx)(Cd,{onPasteSchedule:Ot,onUploadSchedule:jt,onEntryModeChange:o,draft:G,onSubmitDraft:Y,onCancelMatch:Me}),r==="results"&&i==="schedule"&&h&&(0,Ya.jsx)(Vd,{scheduleResult:h,onStartOver:K,cart:R,onAddToCart:L,onRemoveFromCart:u,onGoToBasket:ot,cartSeeded:T,onCartSeeded:()=>A(!0),reviewGateComplete:g,onReviewGateComplete:()=>y(!0),internal:a}),r==="basket"&&(0,Ya.jsx)(ul,{cart:R,onUpdateQty:b,onUpdateSellUnits:w,onResolveConversions:v,onRemove:u,onBack:ze,onStartNewQuote:K,onQuoteRequested:()=>{d(null),y(!1),A(!1),M(),V()},internal:a})]})})})}var Va=$(Ye());var Si=$(Ye());var Ov={"NZ4Y-ZMSQ":{"brick-block":{"brick-common":"105499","brick-engineering-red":"1654","brick-engineering-blue":"1723",block:"501","mortar-cement":"1762 cement","mortar-sand":"564 building sand"},skirting:{"skirting-chamfered":"1525","skirting-ogee":"135 primed mdf ogee","skirting-pencil-round":"892","skirting-torus":"1941"},architrave:{"architrave-ogee":"134 primed mdf ogee","architrave-pencil-round":"1896","architrave-square-edge":"118 primed mdf square","architrave-torus":"1531"},plasterboard:{standard:"1647",moisture:"11 moisture plasterboard",fire:"14 fire plasterboard",sound:"1769",screws:"131160",tape:"1766",adhesive:"108439"},paint:{"paint-emulsion":"157217"},"concrete-aggregate":{cement:"1762 cement","sharp-sand":"563",gravel:"571",mot:"569"},insulation:{"insulation-floor":"152187","insulation-ground":"442","insulation-wall":"147","insulation-roof":"442","insulation-loft":"152180"},timber:{studs:"1213",joists:"208",battens:"1729"},fencing:{"panels-boundary-0.9":"66 lap fence panel","panels-boundary-1.2":"1450","panels-boundary-1.5":"1449","panels-boundary-1.8":"1448","panels-skyline-1.8":"1475","concrete-intermediate-8":"40197","concrete-end-8":"40198","timber-post-6":"141411","timber-post-8":"1709",postcrete:"12142","gate-boundary":"1984","gate-skyline":"40002","gravel-boards":"40200"},decking:{"boards-summit":"24322",joists:"208",screws:"131079"},paving:{"surface-council":"1669","surface-raj":"12363","surface-brindle":"304","surface-charcoal":"296","surface-pea":"431","sub-base":"569",bedding:"563"}}};function dl(e,t){let a=Ov[Dt().client??""]?.[e];if(!a)return null;let r=e==="plasterboard"&&t.key==="board"?t.label.split(" ")[0].toLowerCase():t.key;return a[r]??null}function ki(e,t){let a=Ov[Dt().client??""]?.[e];return!a||t in a}function Bv(e,t){let a=t.map(r=>{let n=dl(e,r);return n?{key:r.key,productId:n.split(" ")[0],search:n,qty:r.qty,unit:r.unit}:null});return a.length>0&&a.every(Boolean)?a:null}var te=$(W()),Lv=[{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"}],pc=e=>Number.parseFloat(e)||0,Hv=(e,t)=>pc(e)*(t==="m"?1:.3048),Zd=(e,t)=>pc(e.quantity)*(2*Hv(e.height,t)+Hv(e.width,t)),ix=()=>({quantity:"1",width:"",height:""});function nx({profile:e}){return(0,te.jsxs)("svg",{className:"architrave-calculator__profile-diagram",viewBox:"0 0 112 76","aria-hidden":"true",children:[(0,te.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,te.jsx)("line",{x1:"12",y1:"66",x2:"100",y2:"66"})]})}function Kd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,Si.useState)("m"),[i,o]=(0,Si.useState)({quantity:"1",width:"0.76",height:"1.98"}),[l,c]=(0,Si.useState)({quantity:"0",width:"1.52",height:"1.98"}),[p,f]=(0,Si.useState)([]),[h,d]=(0,Si.useState)("ogee"),[g,y]=(0,Si.useState)("2.4"),R=(v,M,T)=>{v(A=>({...A,[M]:T}))},L=Zd(i,r)+Zd(l,r)+p.reduce((v,M)=>v+Zd(M,r),0),m=pc(g)>0?Math.ceil(L/pc(g)):0,u=Lv.find(v=>v.id===h)?.label??"",b=[{key:`architrave-${h}`,label:`Architrave (${u})`,qty:L,unit:"m",query:`${u} architrave`,category:"architrave"}],w=(v,M,T,A)=>(0,te.jsxs)("div",{className:"architrave-calculator__opening-row",children:[(0,te.jsx)("span",{children:v}),(0,te.jsx)("input",{"aria-label":`${v} quantity`,type:"number",min:"0",step:"1",value:M.quantity,onChange:G=>T("quantity",G.target.value)}),(0,te.jsx)("input",{"aria-label":`${v} width`,type:"number",min:"0",step:"0.01",value:M.width,onChange:G=>T("width",G.target.value)}),(0,te.jsx)("input",{"aria-label":`${v} height`,type:"number",min:"0",step:"0.01",value:M.height,onChange:G=>T("height",G.target.value)}),A?(0,te.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:A,children:"Remove"}):null]});return(0,te.jsx)(te.Fragment,{children:(0,te.jsxs)("div",{className:"truss-estimator",children:[(0,te.jsxs)("div",{className:"quick-order-hero",children:[(0,te.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,te.jsx)("h1",{children:"Architrave Calculator"}),(0,te.jsx)("p",{children:"Estimate architrave lengths and board quantities for door openings."})]}),(0,te.jsxs)("div",{className:"truss-estimator__card architrave-calculator",children:[(0,te.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure your openings"}),(0,te.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,te.jsxs)("div",{className:"architrave-calculator__section",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Door openings"}),(0,te.jsx)("p",{className:"architrave-calculator__hint",children:"Each opening is calculated as two side pieces plus one head piece."}),(0,te.jsxs)("div",{className:"architrave-calculator__unit-row",children:[(0,te.jsx)("span",{children:"Units"}),(0,te.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,te.jsx)("button",{type:"button",className:r==="m"?"is-selected":"",onClick:()=>n("m"),children:"Metres"}),(0,te.jsx)("button",{type:"button",className:r==="ft"?"is-selected":"",onClick:()=>n("ft"),children:"Feet"})]})]}),(0,te.jsxs)("div",{className:"architrave-calculator__dimensions-header",children:[(0,te.jsx)("span",{children:"Opening"}),(0,te.jsx)("span",{children:"Qty"}),(0,te.jsxs)("span",{children:["Width (",r,")"]}),(0,te.jsxs)("span",{children:["Height (",r,")"]}),(0,te.jsx)("span",{})]}),w("Single doors",i,(v,M)=>R(o,v,M)),w("Double doors",l,(v,M)=>R(c,v,M)),p.map((v,M)=>w(`Alternative door ${M+1}`,v,(T,A)=>f(G=>G.map((Y,V)=>V===M?{...Y,[T]:A}:Y)),()=>f(T=>T.filter((A,G)=>G!==M)))),(0,te.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>f(v=>[...v,ix()]),children:"+ Add alternative-sized door"})]}),(0,te.jsxs)("div",{className:"architrave-calculator__section",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Standard profile"}),(0,te.jsx)("p",{className:"architrave-calculator__hint",children:"Choose the profile you plan to use. Length calculations are the same for each profile."}),(0,te.jsx)("div",{className:"architrave-calculator__profiles",children:Lv.filter(v=>ki("architrave",`architrave-${v.id}`)).map(v=>(0,te.jsxs)("button",{type:"button",className:`truss-estimator__option-card${h===v.id?" is-selected":""}`,onClick:()=>d(v.id),children:[(0,te.jsx)(nx,{profile:v.id}),(0,te.jsx)("div",{className:"truss-estimator__option-title",children:v.label}),(0,te.jsx)("div",{className:"truss-estimator__option-copy",children:v.blurb})]},v.id))})]}),(0,te.jsxs)("div",{className:"architrave-calculator__section",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,te.jsx)("div",{className:"architrave-calculator__options",children:(0,te.jsxs)("label",{className:"truss-estimator__field",children:[(0,te.jsx)("span",{children:"Board length (m)"}),(0,te.jsx)("input",{value:"4.40 m",disabled:!0})]})}),(0,te.jsx)("p",{className:"architrave-calculator__hint",children:"Waste allows for mitred corners, cuts and damaged lengths."})]}),(0,te.jsxs)("div",{className:"architrave-calculator__totals",children:[(0,te.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,te.jsxs)("div",{className:"architrave-calculator__result-grid",children:[(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:"Architrave needed"}),(0,te.jsxs)("strong",{children:[L.toFixed(2)," m"]})]}),(0,te.jsxs)("div",{children:[(0,te.jsx)("span",{children:"Board lengths"}),(0,te.jsx)("strong",{children:m})]})]})]}),(0,te.jsxs)("div",{className:"architrave-calculator__actions",children:[(0,te.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,te.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(b),disabled:L<=0,children:a})]})]})]})})}var Ni=$(Ye()),re=$(W()),Qv=60,Gv=10,ox=.02,lx=.012,jv=1,Yv=4,sx=1.33,cx=1440,ux=1600,Qn=e=>Number.parseFloat(e)||0,px=(e,t=2)=>e.toFixed(t);function Pd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,Ni.useState)("brick"),[i,o]=(0,Ni.useState)("engineering-red"),[l,c]=(0,Ni.useState)("metric"),[p,f]=(0,Ni.useState)(""),[h,d]=(0,Ni.useState)(""),[g,y]=(0,Ni.useState)(!0),R=l==="metric"?Qn(p)*Qn(h):Qn(p)*Qn(h)*.092903,m=R*(r==="brick"?Qv:Gv),u=Math.ceil(m),w=R*(r==="brick"?ox:lx)*sx/(jv+Yv),v=Math.ceil(w*jv*cx),M=Math.ceil(w*Yv*ux),T=l==="metric"?R:R*10.7639,A=[{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"},...g?[{key:"mortar-cement",label:"General purpose cement",qty:v,unit:"kg",query:"general purpose cement",category:"cement"},{key:"mortar-sand",label:"Building sand",qty:M,unit:"kg",query:"building sand",category:"aggregate"}]:[]],G=Y=>{if(Y===l)return;let V=Y==="imperial"?3.28084:.3048;f((Qn(p)*V).toFixed(2)),d((Qn(h)*V).toFixed(2)),c(Y)};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:"Brick and Block Calculator"}),(0,re.jsx)("p",{children:"Estimate masonry units, sand and cement for a wall."})]}),(0,re.jsxs)("div",{className:"truss-estimator__card brick-calculator",children:[(0,re.jsx)("h2",{className:"truss-estimator__step-title",children:"Wall area and masonry type"}),(0,re.jsx)("p",{className:"truss-estimator__step-sub",children:"Pick brick or block and enter the wall dimensions for unit counts plus the cement and sand for the mortar."}),(0,re.jsxs)("div",{className:"brick-calculator__section",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Masonry type"}),(0,re.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[["brick","Brick"],["block","Block"]].map(([Y,V])=>(0,re.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===Y?" is-selected":""}`,onClick:()=>n(Y),children:[(0,re.jsx)("div",{className:"truss-estimator__option-title",children:V}),(0,re.jsxs)("div",{className:"truss-estimator__option-copy",children:["Approx. ",Y==="brick"?Qv:Gv," per m\xB2"]})]},Y))})]}),r==="brick"&&(0,re.jsxs)("div",{className:"brick-calculator__section",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Brick type"}),(0,re.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(([Y,V,se])=>(0,re.jsxs)("button",{type:"button",className:`truss-estimator__option-card${i===Y?" is-selected":""}`,onClick:()=>o(Y),children:[(0,re.jsx)("div",{className:"truss-estimator__option-title",children:V}),(0,re.jsx)("div",{className:"truss-estimator__option-copy",children:se})]},Y))})]}),(0,re.jsxs)("div",{className:"brick-calculator__section",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,re.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,re.jsx)("button",{type:"button",className:l==="metric"?"is-selected":"",onClick:()=>G("metric"),children:"Metric"}),(0,re.jsx)("button",{type:"button",className:l==="imperial"?"is-selected":"",onClick:()=>G("imperial"),children:"Imperial"})]}),(0,re.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,re.jsxs)("label",{className:"truss-estimator__field",children:[(0,re.jsxs)("span",{children:["Height (",l==="metric"?"m":"ft",")"]}),(0,re.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:Y=>f(Y.target.value)})]}),(0,re.jsxs)("label",{className:"truss-estimator__field",children:[(0,re.jsxs)("span",{children:["Width (",l==="metric"?"m":"ft",")"]}),(0,re.jsx)("input",{type:"number",min:"0",step:"0.01",value:h,onChange:Y=>d(Y.target.value)})]})]})]}),(0,re.jsx)("div",{className:"brick-calculator__options",children:(0,re.jsxs)("label",{className:"brick-calculator__checkbox",children:[(0,re.jsx)("input",{type:"checkbox",checked:g,onChange:Y=>y(Y.target.checked)}),(0,re.jsx)("span",{children:"Include mortar (cement and building sand, mixed 1:4)"})]})}),(0,re.jsxs)("div",{className:"brick-calculator__totals",children:[(0,re.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,re.jsxs)("div",{className:"brick-calculator__result-grid",children:[(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:"Wall area"}),(0,re.jsxs)("strong",{children:[px(T)," ",l==="metric"?"m\xB2":"ft\xB2"]})]}),(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:r==="brick"?"Bricks":"Blocks"}),(0,re.jsx)("strong",{children:u.toLocaleString("en-GB")})]}),g?(0,re.jsxs)(re.Fragment,{children:[(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:"Cement"}),(0,re.jsxs)("strong",{children:[v," kg"]})]}),(0,re.jsxs)("div",{children:[(0,re.jsx)("span",{children:"Building sand"}),(0,re.jsxs)("strong",{children:[M," kg"]})]})]}):null]}),(0,re.jsx)("p",{className:"brick-calculator__note",children:"Estimate based on standard nominal sizes and 10mm joints. Mortar is a general purpose 1:4 cement and sand mix; quantities are approximate, so confirm the specification before ordering."})]}),(0,re.jsxs)("div",{className:"brick-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?.(A),disabled:R<=0,children:a})]})]})]})})}var Ci=$(Ye()),ee=$(W()),dx=1.54,mx=1440,Jd=e=>Number.parseFloat(e)||0,Pr={mot:{label:"MOT Type 1",blurb:"Sub-base for patios and driveways",density:1.7,query:"MOT type 1"},"sharp-sand":{label:"Sharp sand",blurb:"Bedding and general groundwork",density:1.6,query:"sharp sand"},gravel:{label:"20mm gravel",blurb:"Drainage and landscaping",density:1.6,query:"20mm gravel"}};function Id({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,Ci.useState)("m"),[i,o]=(0,Ci.useState)(""),[l,c]=(0,Ci.useState)(""),[p,f]=(0,Ci.useState)(""),[h,d]=(0,Ci.useState)("concrete"),[g,y]=(0,Ci.useState)("mot"),R=r==="m"?1:.3048,L=Jd(i)*R*Jd(l)*R*Jd(p)*(r==="m"?.01:.0254),m=Pr[g],u=L*dx/7,b=u*mx,w=u*2,v=u*4,M=(A,G)=>Math.ceil(A*G*1e3),T=h==="concrete"?[{key:"cement",label:"General purpose cement",qty:Math.ceil(b),unit:"kg",query:"general purpose cement"},{key:"sharp-sand",label:"Sharp sand",qty:M(w,Pr["sharp-sand"].density),unit:"kg",query:Pr["sharp-sand"].query},{key:"gravel",label:"20mm gravel",qty:M(v,Pr.gravel.density),unit:"kg",query:Pr.gravel.query}]:[{key:g,label:m.label,qty:M(L,m.density),unit:"kg",query:m.query}];return(0,ee.jsx)(ee.Fragment,{children:(0,ee.jsxs)("div",{className:"truss-estimator",children:[(0,ee.jsxs)("div",{className:"quick-order-hero",children:[(0,ee.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,ee.jsx)("h1",{children:"Concrete and Aggregate Calculator"}),(0,ee.jsx)("p",{children:"Calculate fixed site-mix concrete ingredients or aggregate bulk bags."})]}),(0,ee.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,ee.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose what you need"}),(0,ee.jsx)("p",{className:"truss-estimator__step-sub",children:"Enter the area and depth. The calculator works out the materials and adds them to your basket."}),(0,ee.jsxs)("div",{className:"materials-calculator__section",children:[(0,ee.jsx)("div",{className:"truss-estimator__section-heading",children:"Material type"}),(0,ee.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,ee.jsxs)("button",{type:"button",className:`truss-estimator__option-card${h==="concrete"?" is-selected":""}`,onClick:()=>d("concrete"),children:[(0,ee.jsx)("div",{className:"truss-estimator__option-title",children:"Site-mixed concrete"}),(0,ee.jsx)("div",{className:"truss-estimator__option-copy",children:"Cement, sharp sand and 20mm aggregate"})]}),(0,ee.jsxs)("button",{type:"button",className:`truss-estimator__option-card${h==="aggregate"?" is-selected":""}`,onClick:()=>d("aggregate"),children:[(0,ee.jsx)("div",{className:"truss-estimator__option-title",children:"Aggregates"}),(0,ee.jsx)("div",{className:"truss-estimator__option-copy",children:"MOT Type 1, sharp sand or 20mm gravel"})]})]})]}),h==="aggregate"&&(0,ee.jsxs)("div",{className:"materials-calculator__section",children:[(0,ee.jsx)("div",{className:"truss-estimator__section-heading",children:"Aggregate type"}),(0,ee.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.keys(Pr).map(A=>(0,ee.jsxs)("button",{type:"button",className:`truss-estimator__option-card${g===A?" is-selected":""}`,onClick:()=>y(A),children:[(0,ee.jsx)("div",{className:"truss-estimator__option-title",children:Pr[A].label}),(0,ee.jsx)("div",{className:"truss-estimator__option-copy",children:Pr[A].blurb})]},A))})]}),(0,ee.jsxs)("div",{className:"materials-calculator__section",children:[(0,ee.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and depth"}),(0,ee.jsxs)("div",{className:"materials-calculator__unit-row",children:[(0,ee.jsx)("span",{children:"Units"}),(0,ee.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,ee.jsx)("button",{type:"button",className:r==="m"?"is-selected":"",onClick:()=>n("m"),children:"Metric"}),(0,ee.jsx)("button",{type:"button",className:r==="ft"?"is-selected":"",onClick:()=>n("ft"),children:"Imperial"})]})]}),(0,ee.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ee.jsxs)("label",{className:"truss-estimator__field",children:[(0,ee.jsxs)("span",{children:["Length (",r,")"]}),(0,ee.jsx)("input",{type:"number",min:"0",step:"0.01",value:i,onChange:A=>o(A.target.value)})]}),(0,ee.jsxs)("label",{className:"truss-estimator__field",children:[(0,ee.jsxs)("span",{children:["Width (",r,")"]}),(0,ee.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:A=>c(A.target.value)})]})]}),(0,ee.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,ee.jsxs)("span",{children:["Depth (",r==="m"?"cm":"inches",")"]}),(0,ee.jsx)("input",{type:"number",min:"0",step:"0.1",value:p,onChange:A=>f(A.target.value)})]})]}),(0,ee.jsxs)("div",{className:"materials-calculator__totals",children:[(0,ee.jsx)("div",{className:"truss-estimator__section-heading",children:"Materials required"}),(0,ee.jsx)("div",{className:"materials-calculator__result-grid",children:h==="concrete"?(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{children:"Cement"}),(0,ee.jsxs)("strong",{children:[b.toFixed(0)," kg"]})]}),(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{children:"Sharp sand"}),(0,ee.jsxs)("strong",{children:[w.toFixed(2)," m\xB3"]})]}),(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{children:"20mm aggregate"}),(0,ee.jsxs)("strong",{children:[v.toFixed(2)," m\xB3"]})]})]}):(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{children:m.label}),(0,ee.jsxs)("strong",{children:[L.toFixed(2)," m\xB3"]})]}),(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{children:"Approx. weight"}),(0,ee.jsxs)("strong",{children:[(L*m.density).toFixed(2)," t"]})]}),(0,ee.jsx)("div",{})]})}),(0,ee.jsx)("p",{className:"materials-calculator__note",children:h==="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."})]}),(0,ee.jsxs)("div",{className:"materials-calculator__actions",children:[(0,ee.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,ee.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(T),disabled:L<=0,children:a})]})]})]})})}var $a=$(Ye());var D=$(W()),Gn=12,jn=8,dc=.56,$v=.21,za={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:{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}]}},qi=["range","grid","pictureFrame","substructure"],fx={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:""}},mc=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),fc=(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),hx=(e,t,a,r)=>{let n=mc(e,t,a),i=mc(e,t,r),o=mc(a,r,e),l=mc(a,r,t);return n===0&&fc(e,t,a)||i===0&&fc(e,t,r)||o===0&&fc(a,r,e)||l===0&&fc(a,r,t)?!0:n>0!=i>0&&o>0!=l>0},Fd=(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)&&hx(e[r],n,e[i],e[(i+1)%e.length]))return!0}return!1};function Wd({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,$a.useState)(0),[i,o]=(0,$a.useState)(fx),[l,c]=(0,$a.useState)(1),[p,f]=(0,$a.useState)({x:0,y:0}),[h,d]=(0,$a.useState)(null),g=(0,$a.useRef)(null),y=(0,$a.useRef)(null),R=(0,$a.useRef)(null),L=qi[r],m=i.range?za.ranges[i.range]:null,u=Gn/l,b=jn/l,w=(Gn-u)/2,v=(jn-b)/2,M=Math.max(-Gn,Math.min(Gn*2-u,w+p.x)),T=Math.max(-jn,Math.min(jn*2-b,v+p.y)),A=Number.parseFloat(i.quickLengthM),G=Number.parseFloat(i.quickWidthM),Y=A>0&&G>0,V=z=>Math.abs(z.reduce((H,ne,de)=>{let me=z[(de+1)%z.length];return H+ne.x*me.y-me.x*ne.y},0))/2,se=(z,H)=>Math.hypot(H.x-z.x,H.y-z.y),ge=i.isOutlineClosed?V(i.points):0,Ze=i.isOutlineClosed?i.points.reduce((z,H,ne)=>z+se(H,i.points[(ne+1)%i.points.length]),0):0,Ue=i.isOutlineClosed?i.points.reduce((z,H,ne)=>z+(i.wallSegments.has(ne)?0:se(H,i.points[(ne+1)%i.points.length])),0):0,ve=i.points.reduce((z,H)=>({x:z.x+H.x/i.points.length,y:z.y+H.y/i.points.length}),{x:0,y:0}),le=i.points.length>1?(()=>{let z=i.points[0],H=i.points[1],ne=se(z,H),de=ne?-(H.y-z.y)/ne:0,me=ne?(H.x-z.x)/ne:0,je=(z.x+H.x)/2,Oe=(z.y+H.y)/2,k=de*(je-ve.x)+me*(Oe-ve.y)>=0?1:-1;return{x:je+de*dc*k,y:Oe+me*dc*k}})():null,ze=(()=>{let z=i.range?za.ranges[i.range]:za.ranges.meridian,H=i.deckSizeMode==="quick"?A*G:ge,ne=i.deckSizeMode==="quick"?2*(A+G):Ue,de=i.direction==="diagonal"?za.wastage.diagonal:za.wastage.straight,me=i.pictureFrame==="yes"?za.pictureFrame.extraWastage:0,Oe=H/(z.boardWidthM+za.boardGapM)/z.boardLengthM,k=Math.ceil(Oe*(1+de+me)),x=Math.ceil(H*30*(1+de+me)/200),q=za.joist.spacingOptions.find(N=>N.id===i.joistSpacing)??za.joist.spacingOptions[1],U=H/q.spacingM,X=Math.ceil(U);return{range:z,area:H,boardCount:k,screwBoxes:x,joistMetres:X,spacing:q}})(),wt=ze?[{key:`boards-${i.range??"meridian"}`,label:`Deck boards (${ze.range.label})`,qty:Math.round(ze.boardCount*ze.range.boardLengthM*100)/100,unit:"m",query:"timber decking board",category:"decking",calculatorWasteIncluded:!0},{key:"joists",label:"Treated C24 joists",qty:ze.joistMetres,unit:"m",query:"treated joist",category:"timber",calculatorWasteIncluded:!0},{key:"screws",label:"Green decking screws (200/box)",qty:ze.screwBoxes,unit:"box",query:"green decking screws",category:"fixings",calculatorWasteIncluded:!0}]:[],K=()=>L==="range"?!!i.range:L==="grid"?i.deckSizeMode==="quick"?Y:i.isOutlineClosed&&ge>0:L==="pictureFrame"?!!i.pictureFrame&&!!i.direction:L==="substructure"?!!i.joistSpacing:!0,ue=r===qi.length-1?a:"Next",Me=(z,H,ne=!1)=>{let de=R.current?.getBoundingClientRect();if(!de)return null;let me=ne?1:.25;return{x:Math.round(Math.max(M,Math.min(M+u,M+(z-de.left)/de.width*u))/me)*me,y:Math.round(Math.max(T,Math.min(T+b,T+(H-de.top)/de.height*b))/me)*me}},Ot=z=>{if(i.isOutlineClosed){let ne=z.target;if(ne!==z.currentTarget&&!ne.classList.contains("deck-outline__grid"))return;y.current={startX:z.clientX,startY:z.clientY,startViewX:M,startViewY:T},z.currentTarget.setPointerCapture(z.pointerId);return}if(i.drawMode!=="outline")return;let H=Me(z.clientX,z.clientY,!0);H&&(d(null),o(ne=>{let de=[...ne.points,H];return Fd(de,!1)?{...ne,drawError:"Edges cannot cross. Choose another corner."}:{...ne,points:de,drawError:""}}))},jt=(z,H)=>{if(!i.isOutlineClosed){z.stopPropagation(),H===0&&i.points.length>=3&&o(ne=>({...ne,isOutlineClosed:!0,drawMode:"edges"}));return}z.stopPropagation(),g.current=H,z.currentTarget.setPointerCapture(z.pointerId)},qe=z=>{if(y.current){let de=R.current?.getBoundingClientRect();if(!de)return;let me=y.current,je=me.startViewX-(z.clientX-me.startX)/de.width*u,Oe=me.startViewY-(z.clientY-me.startY)/de.height*b;f({x:je-w,y:Oe-v});return}!i.isOutlineClosed&&i.drawMode==="outline"&&d(Me(z.clientX,z.clientY,!0));let H=g.current;if(H===null)return;let ne=Me(z.clientX,z.clientY);ne&&o(de=>{let me=de.points.map((je,Oe)=>Oe===H?ne:je);return Fd(me,!0)?{...de,drawError:"Edges cannot cross. Move the corner to a different position."}:{...de,points:me,drawError:""}})},ke=z=>{y.current=null,g.current=null,z.currentTarget.hasPointerCapture(z.pointerId)&&z.currentTarget.releasePointerCapture(z.pointerId)},De=z=>{o(H=>{let ne=new Set(H.wallSegments);return ne.has(z)?ne.delete(z):ne.add(z),{...H,wallSegments:ne}})},Ge=()=>{r===0?e():n(z=>z-1)},vt=()=>{K()&&(r===qi.length-1?t?.(wt):n(z=>z+1))};return(0,D.jsx)(D.Fragment,{children:(0,D.jsxs)("div",{className:"truss-estimator",children:[(0,D.jsxs)("div",{className:"quick-order-hero",children:[(0,D.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,D.jsx)("h1",{children:"Decking Calculator"}),(0,D.jsx)("p",{children:"Estimate timber boards, joists and screws for your deck."})]}),(0,D.jsxs)("div",{className:"truss-estimator__card",children:[(0,D.jsxs)("div",{className:"truss-estimator__body",children:[L==="range"?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",qi.length]}),(0,D.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your timber decking"}),(0,D.jsx)("p",{className:"truss-estimator__step-sub",children:"Both options are fixed, orderable pressure-treated timber boards."}),(0,D.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(za.ranges).filter(([z])=>ki("decking",`boards-${z}`)).map(([z,H])=>(0,D.jsxs)("button",{type:"button",className:`truss-estimator__option-card${i.range===z?" is-selected":""}`,onClick:()=>o(ne=>({...ne,range:z})),children:[(0,D.jsx)("div",{className:"truss-estimator__option-title",children:H.label}),(0,D.jsx)("div",{className:"truss-estimator__option-copy",children:H.blurb}),(0,D.jsxs)("div",{className:"truss-estimator__option-copy",children:[H.boardLengthM,"m boards"]})]},z))})]}):null,L==="grid"?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",qi.length]}),(0,D.jsx)("h2",{className:"truss-estimator__step-title",children:"Tell us your deck size"}),(0,D.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,D.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,D.jsx)("button",{type:"button",className:`truss-estimator__toggle${i.deckSizeMode==="quick"?" is-selected":""}`,onClick:()=>o(z=>({...z,deckSizeMode:"quick"})),children:"Quick estimate"}),(0,D.jsx)("button",{type:"button",className:`truss-estimator__toggle${i.deckSizeMode==="draw"?" is-selected":""}`,onClick:()=>o(z=>({...z,deckSizeMode:"draw",drawMode:"outline"})),children:"Draw your space"})]}),i.deckSizeMode==="quick"?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,D.jsxs)("label",{className:"truss-estimator__field",children:[(0,D.jsx)("span",{children:"Length (m)"}),(0,D.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:i.quickLengthM,onChange:z=>o(H=>({...H,quickLengthM:z.target.value}))})]}),(0,D.jsxs)("label",{className:"truss-estimator__field",children:[(0,D.jsx)("span",{children:"Width (m)"}),(0,D.jsx)("input",{type:"number",inputMode:"decimal",min:"0.1",step:"0.1",value:i.quickWidthM,onChange:z=>o(H=>({...H,quickWidthM:z.target.value}))})]})]}),(0,D.jsx)("div",{className:"truss-estimator__grid-hint",children:"For L-shaped decks, cut-outs, or sides against a wall, use Draw your space."}),Y?(0,D.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,D.jsxs)("div",{children:[(A*G).toFixed(2)," m\xB2 deck"]}),(0,D.jsxs)("div",{children:[(2*(A+G)).toFixed(2)," m perimeter"]})]}):null]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("div",{className:"truss-estimator__section-heading",children:"Draw your deck"}),(0,D.jsx)("p",{className:"truss-estimator__step-sub",children:"Click to add corners, then close the outline. Drag any handle to refine it."}),(0,D.jsxs)("div",{className:"deck-outline__toolbar",children:[i.isOutlineClosed?(0,D.jsxs)("div",{className:"deck-outline__summary",children:[(0,D.jsxs)("div",{children:[(0,D.jsx)("span",{children:"Deck area"}),(0,D.jsxs)("strong",{children:[ge.toFixed(2)," m\xB2"]})]}),(0,D.jsxs)("div",{children:[(0,D.jsx)("span",{children:"Perimeter"}),(0,D.jsxs)("strong",{children:[Ze.toFixed(2)," m"]})]}),(0,D.jsxs)("div",{children:[(0,D.jsx)("span",{children:"Wall edges"}),(0,D.jsx)("strong",{children:i.wallSegments.size>0?i.wallSegments.size:"None"})]}),(0,D.jsxs)("div",{children:[(0,D.jsx)("span",{children:"Visible edge"}),(0,D.jsxs)("strong",{children:[Ue.toFixed(2)," m"]})]})]}):null,(0,D.jsxs)("div",{className:"deck-outline__actions",children:[(0,D.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(z=>({...z,points:z.points.slice(0,-1)})),disabled:i.points.length===0||i.isOutlineClosed,children:"Undo"}),(0,D.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{d(null),o(z=>({...z,points:[],isOutlineClosed:!1,wallSegments:new Set,drawMode:"outline",drawError:""}))},disabled:i.points.length===0,children:"Clear"}),(0,D.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(z=>({...z,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,D.jsx)("div",{className:"deck-editor-layout",children:(0,D.jsxs)("div",{className:"deck-editor-layout__canvas-column",children:[(0,D.jsxs)("div",{className:"deck-outline",children:[(0,D.jsxs)("svg",{ref:R,className:`deck-outline__canvas${i.isOutlineClosed?" is-pan-mode":""}`,viewBox:`${M} ${T} ${u} ${b}`,preserveAspectRatio:"none","aria-label":"Deck outline drawing area",onPointerDown:Ot,onPointerMove:qe,onPointerUp:ke,onPointerLeave:()=>{d(null),y.current||(g.current=null)},children:[(0,D.jsx)("defs",{children:(0,D.jsx)("pattern",{id:"deck-outline-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,D.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,D.jsx)("rect",{x:-Gn,y:-jn,width:Gn*3,height:jn*3,className:"deck-outline__grid",fill:"url(#deck-outline-grid)"}),i.points.length>1?(0,D.jsx)("polyline",{className:"deck-outline__preview",points:i.points.map(z=>`${z.x},${z.y}`).join(" ")}):null,i.isOutlineClosed?(0,D.jsx)("polygon",{className:"deck-outline__shape",points:i.points.map(z=>`${z.x},${z.y}`).join(" "),stroke:"none"}):null,i.points.length>1?i.points.slice(0,i.isOutlineClosed?void 0:-1).map((z,H)=>{let ne=i.points[i.isOutlineClosed?(H+1)%i.points.length:H+1],de=se(z,ne),me=de?-(ne.y-z.y)/de:0,je=de?(ne.x-z.x)/de:0,Oe=(z.x+ne.x)/2,k=(z.y+ne.y)/2,x=me*(Oe-ve.x)+je*(k-ve.y)>=0?1:-1,q=Oe+me*dc*x,U=k+je*dc*x;return(0,D.jsxs)("g",{children:[(0,D.jsx)("line",{className:"deck-outline__edge-hit",x1:z.x,y1:z.y,x2:ne.x,y2:ne.y,onClick:i.isOutlineClosed?()=>De(H):void 0}),(0,D.jsx)("line",{className:`deck-outline__edge${i.wallSegments.has(H)?" is-wall":""}`,x1:z.x,y1:z.y,x2:ne.x,y2:ne.y,pointerEvents:"none"}),(0,D.jsxs)("text",{className:`deck-outline__edge-label${i.wallSegments.has(H)?" is-wall":""}`,x:q,y:U,textAnchor:"middle",dominantBaseline:"central",fontSize:$v/l,children:[de.toFixed(2)," m"]})]},`segment-${H}`)}):null,!i.isOutlineClosed&&i.points.length>0&&h?(()=>{let z=i.points[i.points.length-1],H=se(z,h);if(!H)return null;let ne=-(h.y-z.y)/H,de=(h.x-z.x)/H,me=(z.x+h.x)/2,je=(z.y+h.y)/2;return(0,D.jsxs)("g",{className:"deck-outline__live-measurement",children:[(0,D.jsx)("line",{x1:z.x,y1:z.y,x2:h.x,y2:h.y}),(0,D.jsxs)("text",{x:me+ne*.34,y:je+de*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:$v/l,children:[H.toFixed(2)," m"]})]})})():null,i.points.map((z,H)=>(0,D.jsx)("circle",{className:"deck-outline__point",cx:z.x,cy:z.y,r:"0.13",onPointerDown:ne=>jt(ne,H)},`point-${H}`))]}),(0,D.jsxs)("div",{className:"deck-outline__zoom","aria-label":"Zoom controls",children:[(0,D.jsx)("button",{type:"button",onClick:()=>c(z=>Math.max(.5,z-.25)),disabled:l===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,D.jsxs)("span",{children:[Math.round(l*100),"%"]}),(0,D.jsx)("button",{type:"button",onClick:()=>c(z=>Math.min(1,z+.25)),disabled:l===1,"aria-label":"Zoom in",children:"+"})]}),i.isOutlineClosed&&i.wallSegments.size===0&&le?(0,D.jsx)("div",{className:"deck-outline__edge-prompt",role:"status",style:{left:`${(le.x-M)/u*100}%`,top:`${(le.y-T)/b*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,D.jsx)("button",{type:"button",className:"deck-outline__close",onClick:()=>o(z=>Fd(z.points,!0)?{...z,drawError:"Edges cannot cross. Adjust the outline before finishing."}:{...z,isOutlineClosed:!0,drawMode:"edges",drawError:""}),children:"Finish outline"}):null]}),(0,D.jsxs)("div",{className:"deck-outline__supporting",children:[(0,D.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,D.jsx)("div",{className:"deck-outline__error",role:"alert",children:i.drawError}):null]})]})})]})]}):null,L==="pictureFrame"?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",qi.length]}),(0,D.jsx)("h2",{className:"truss-estimator__step-title",children:"Picture frame border?"}),(0,D.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,D.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(z=>(0,D.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${i.pictureFrame===z.id?" is-selected":""}`,onClick:()=>o(H=>({...H,pictureFrame:z.id})),children:[(0,D.jsx)("img",{className:"truss-estimator__visual-card-img",src:It(z.img),alt:""}),(0,D.jsx)("span",{children:z.label})]},z.id))}),(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("div",{className:"truss-estimator__section-heading",children:"Board direction"}),(0,D.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(z=>(0,D.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${i.direction===z.id?" is-selected":""}`,onClick:()=>o(H=>({...H,direction:z.id})),children:[(0,D.jsx)("img",{className:"truss-estimator__visual-card-img",src:It(z.img),alt:""}),(0,D.jsx)("span",{children:z.label})]},z.id))})]})]}):null,L==="substructure"?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",qi.length]}),(0,D.jsx)("h2",{className:"truss-estimator__step-title",children:"Substructure"}),(0,D.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,D.jsx)("div",{className:"truss-estimator__section-heading",children:"Joist spacing"}),(0,D.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:za.joist.spacingOptions.map(z=>(0,D.jsx)("button",{type:"button",className:`truss-estimator__option-card${i.joistSpacing===z.id?" is-selected":""}`,onClick:()=>o(H=>({...H,joistSpacing:z.id})),children:(0,D.jsx)("div",{className:"truss-estimator__option-title",children:z.label})},z.id))})]}):null]}),(0,D.jsxs)("div",{className:"truss-estimator__nav",children:[(0,D.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:Ge,children:"Back"}),(0,D.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:vt,disabled:!K(),children:[(0,D.jsx)("span",{children:ue}),(0,D.jsx)("span",{className:"arrow",children:(0,D.jsx)(Qt,{})})]})]})]})]})})}var Sa=$(Ye());var j=$(W()),Vv=12,Xv=30,Yn=12,$n=8,Zv=.56,ka={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 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}}},Ei=["range","height","gate","posts"],em=e=>Number(e)<=1.2?"6":"8",Kv=(e,t)=>ki("fencing",`panels-${e??"boundary"}-${t}`),Pv=(e,t)=>!t||ki("fencing",e==="concrete"?`concrete-intermediate-${em(t)}`:`timber-post-${em(t)}`),gx={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:""}},hc=(e,t,a)=>(t.x-e.x)*(a.y-e.y)-(t.y-e.y)*(a.x-e.x),gc=(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),bx=(e,t,a,r)=>{let n=hc(e,t,a),i=hc(e,t,r),o=hc(a,r,e),l=hc(a,r,t);return n===0&&gc(e,t,a)||i===0&&gc(e,t,r)||o===0&&gc(a,r,e)||l===0&&gc(a,r,t)?!0:n>0!=i>0&&o>0!=l>0},bc=(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)&&bx(e[r],e[(r+1)%e.length],e[n],e[(n+1)%e.length]))return!0;return!1};function tm({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,Sa.useState)(0),[i,o]=(0,Sa.useState)(gx),l=(0,Sa.useRef)(null),c=(0,Sa.useRef)(null),[p,f]=(0,Sa.useState)(1),[h,d]=(0,Sa.useState)({x:0,y:0}),[g,y]=(0,Sa.useState)(null),R=(0,Sa.useRef)(null),L=(0,Sa.useRef)(null),m=(0,Sa.useRef)(null),u=Ei[r],b=i.range?ka.ranges[i.range]:null,w=Yn/p,v=$n/p,M=(Yn-w)/2,T=($n-v)/2,A=Math.max(-Yn,Math.min(Yn*2-w,M+h.x)),G=Math.max(-$n,Math.min($n*2-v,T+h.y)),Y=i.boundaryPoints.reduce((k,x)=>({x:k.x+x.x/Math.max(1,i.boundaryPoints.length),y:k.y+x.y/Math.max(1,i.boundaryPoints.length)}),{x:0,y:0}),V=k=>{let x=new Set,q=[];return k.forEach(U=>{let[X,N]=U.split(",").map(Number),O=[{key:`H,${X},${N}`,type:"H",x:X,y:N},{key:`H,${X},${N+1}`,type:"H",x:X,y:N+1},{key:`V,${X},${N}`,type:"V",x:X,y:N},{key:`V,${X+1},${N}`,type:"V",x:X+1,y:N}],Z=[!k.has(`${X},${N-1}`),!k.has(`${X},${N+1}`),!k.has(`${X-1},${N}`),!k.has(`${X+1},${N}`)];O.forEach((pe,Se)=>{Z[Se]&&!x.has(pe.key)&&(x.add(pe.key),q.push(pe))})}),q},se=(k,x)=>V(k).filter(q=>!x.has(q.key)),ge=(k,x)=>se(k,x).length,Ze=(k,x)=>{let q={};se(k,x).forEach(X=>{var N,O,Z,pe;X.type==="H"?((q[N=`${X.x},${X.y}`]||(q[N]=[])).push("H"),(q[O=`${X.x+1},${X.y}`]||(q[O]=[])).push("H")):((q[Z=`${X.x},${X.y}`]||(q[Z]=[])).push("V"),(q[pe=`${X.x},${X.y+1}`]||(q[pe]=[])).push("V"))});let U=0;return Object.values(q).forEach(X=>{(X.length===1||X.length===2&&X[0]!==X[1]||X.length>=3)&&(U+=1)}),U},ve=(()=>{let k=i.range?ka.ranges[i.range]:ka.ranges.boundary,x=i.height??"1.8",q=i.boundaryMode==="quick"?Math.max(0,Number.parseFloat(i.quickLengthM)||0):i.boundaryClosed?i.boundaryPoints.slice(0,-1).reduce((Yt,hr,_t)=>Yt+(i.excludedBoundaryEdges.has(_t)?0:Math.hypot(i.boundaryPoints[_t+1].x-hr.x,i.boundaryPoints[_t+1].y-hr.y)),0):0,U=i.gateType&&i.gateType!=="none"?Number.parseFloat(i.gateWidthM)||ka.gate[i.gateType].widthDefault:0,X=Math.max(0,q-U),N=X>0?Math.ceil(X/k.panelWidthM):0,O=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,Z=i.boundaryMode==="quick"?X>0?2:0:i.boundaryClosed?i.boundaryPoints.slice(0,O?-1:void 0).reduce((Yt,hr,_t)=>{let Zn=_t>0&&!i.excludedBoundaryEdges.has(_t-1),vm=_t<i.boundaryPoints.length-1&&!i.excludedBoundaryEdges.has(_t);return Yt+(Zn||vm?1:0)},0):0,pe=X>0?Math.ceil(X/k.panelWidthM)+1:0,Se=Math.max(0,pe-Z),yt=i.mountingType?ka.mounting[i.mountingType]:ka.mounting.concrete,ft=i.gateType&&i.gateType!=="none"?2:0,At=Se+Z+ft,wm=i.mountingType==="postcrete"?At*ka.mounting.postcrete.bagsPerPost:0,Jr=i.gravelBoard==="yes"?N:0;return{range:k,height:x,totalEdgeM:q,fencedLengthM:X,gateWidthM:U,panelsCount:N,cornerPostCount:Z,intermediatePostCount:Se,gatePostCount:ft,totalPostCount:At,bagsCount:wm,gravelCount:Jr,capCount:At,mounting:yt}})(),le=i.gateType&&i.gateType!=="none"?ka.gate[i.gateType].label:null,ot=em(ve.height),ze=ve?[{key:`panels-${i.range??"boundary"}-${ve.height}`,label:`${ve.range.label} panels (${ve.height}m)`,qty:ve.panelsCount,unit:"each",query:"fence panel",category:"fencing"},...i.mountingType==="concrete"?[{key:`concrete-intermediate-${ot}`,label:"Intermediate concrete posts",qty:ve.intermediatePostCount,unit:"each",query:"concrete fence post",category:"fencing"},{key:`concrete-end-${ot}`,label:"End and corner concrete posts",qty:ve.cornerPostCount+ve.gatePostCount,unit:"each",query:"concrete end post",category:"fencing"}]:[{key:`timber-post-${ot}`,label:"Timber fence posts",qty:ve.totalPostCount,unit:"each",query:"timber fence post",category:"fencing"},{key:"postcrete",label:"Postcrete",qty:ve.bagsCount,unit:"bag",query:"postcrete",category:"cement"}],...le?[{key:`gate-${i.range??"boundary"}`,label:i.range==="skyline"?"Single feather edge gate":"Single lap gate",qty:1,unit:"each",query:i.range==="skyline"?"feather edge gate":"lap gate",category:"fencing"}]:[],...ve.gravelCount>0?[{key:"gravel-boards",label:"Concrete gravel boards",qty:ve.gravelCount,unit:"each",query:"gravel board",category:"fencing"}]:[]]:[],wt=()=>{if(u==="range"){let k=i.boundaryMode==="quick"?(Number.parseFloat(i.quickLengthM)||0)>0:i.boundaryClosed&&i.boundaryPoints.length>=2;return!!i.range&&k}return u==="height"?!!i.height&&!!i.gravelBoard:u==="gate"?!!i.gateType&&(i.gateType==="none"||i.gateWidthM.trim()!==""):u==="posts"?!!i.mountingType:!0},K=r===Ei.length-1?a:"Next",ue=k=>{o(x=>{let q=k(new Set(x.grid)),U=new Set([...x.excludedEdges].filter(X=>V(q).some(N=>N.key===X)));return{...x,grid:q,excludedEdges:U}})},Me=(k,x,q)=>{ue(U=>{let X=`${k},${x}`;return q?U.add(X):U.delete(X),U})},Ot=(k,x,q,U,X)=>{let N=k,O=x,Z=Math.abs(q-k),pe=k<q?1:-1,Se=-Math.abs(U-x),yt=x<U?1:-1,ft=Z+Se;for(;Me(N,O,X),!(N===q&&O===U);){let At=2*ft;At>=Se&&(ft+=Se,N+=pe),At<=Z&&(ft+=Z,O+=yt)}},jt=(k,x)=>{let q=c.current?.getBoundingClientRect();if(!q)return null;let U=Math.floor((k-q.left)/Xv),X=Math.floor((x-q.top)/Xv);return U<0||X<0||U>=Vv||X>=Vv?null:{x:U,y:X}},qe=k=>{if(i.gridMode!=="draw")return;let x=jt(k.clientX,k.clientY);if(!x)return;k.preventDefault();let q=`${x.x},${x.y}`,U=!i.grid.has(q);l.current={active:!0,paintValue:U,lastX:x.x,lastY:x.y},k.currentTarget.setPointerCapture(k.pointerId),Me(x.x,x.y,U)},ke=k=>{let x=l.current;if(!x?.active)return;let q=jt(k.clientX,k.clientY);q&&(q.x===x.lastX&&q.y===x.lastY||(Ot(x.lastX,x.lastY,q.x,q.y,x.paintValue),l.current={...x,lastX:q.x,lastY:q.y}))},De=k=>{l.current?.active&&(l.current=null,k.currentTarget.releasePointerCapture(k.pointerId))},Ge=(k,x,q=!1)=>{let U=m.current?.getBoundingClientRect();if(!U)return null;let X=q?1:.25;return{x:Math.round(Math.max(A,Math.min(A+w,A+(k-U.left)/U.width*w))/X)*X,y:Math.round(Math.max(G,Math.min(G+v,G+(x-U.top)/U.height*v))/X)*X}},vt=k=>{if(i.boundaryClosed){let q=k.target;if(q!==k.currentTarget&&!q.classList.contains("fence-boundary__grid"))return;L.current={startX:k.clientX,startY:k.clientY,startViewX:A,startViewY:G},k.currentTarget.setPointerCapture(k.pointerId);return}let x=Ge(k.clientX,k.clientY,!0);x&&(y(null),o(q=>{let U=[...q.boundaryPoints,x];return bc(U,!1)?{...q}:{...q,boundaryPoints:U}}))},z=(k,x)=>{if(k.stopPropagation(),!i.boundaryClosed){if(x!==0||i.boundaryPoints.length<3)return;o(q=>bc(q.boundaryPoints,!0)?q:{...q,boundaryPoints:[...q.boundaryPoints,q.boundaryPoints[0]],boundaryClosed:!0});return}R.current=x,k.currentTarget.setPointerCapture(k.pointerId)},H=k=>{if(L.current){let q=m.current?.getBoundingClientRect();if(!q)return;let U=L.current,X=U.startViewX-(k.clientX-U.startX)/q.width*w,N=U.startViewY-(k.clientY-U.startY)/q.height*v;d({x:X-M,y:N-T});return}if(i.boundaryClosed||y(Ge(k.clientX,k.clientY,!0)),R.current===null)return;let x=Ge(k.clientX,k.clientY);x&&o(q=>{let U=q.boundaryPoints.length>2&&q.boundaryPoints[0].x===q.boundaryPoints[q.boundaryPoints.length-1].x&&q.boundaryPoints[0].y===q.boundaryPoints[q.boundaryPoints.length-1].y,X=q.boundaryPoints.map((N,O)=>{let Z=O===R.current,pe=U&&R.current===0&&O===q.boundaryPoints.length-1;return Z||pe?x:N});return bc(X,!1)?q:{...q,boundaryPoints:X}})},ne=k=>{L.current=null,R.current=null,k.currentTarget.hasPointerCapture(k.pointerId)&&k.currentTarget.releasePointerCapture(k.pointerId)},de=k=>{o(x=>{let q=new Set(x.excludedBoundaryEdges);return q.has(k)?q.delete(k):q.add(k),{...x,excludedBoundaryEdges:q}})},me=()=>{r===0?e():n(k=>k-1)},je=()=>{wt()&&(r===Ei.length-1?t?.(ze):n(k=>k+1))},Oe=V(i.grid);return(0,j.jsx)(j.Fragment,{children:(0,j.jsxs)("div",{className:"truss-estimator",children:[(0,j.jsxs)("div",{className:"quick-order-hero",children:[(0,j.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,j.jsx)("h1",{children:"Fencing Calculator"}),(0,j.jsx)("p",{children:"Estimate panels, posts and cost for your fence line in a few steps."})]}),(0,j.jsxs)("div",{className:"truss-estimator__card",children:[(0,j.jsxs)("div",{className:"truss-estimator__body",children:[u==="range"?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ei.length]}),(0,j.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your fence panels"}),(0,j.jsx)("p",{className:"truss-estimator__step-sub",children:"The calculator uses fixed, orderable timber panels from the catalogue."}),(0,j.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(ka.ranges).map(([k,x])=>(0,j.jsxs)("button",{type:"button",className:`truss-estimator__option-card${i.range===k?" is-selected":""}`,onClick:()=>o(q=>({...q,range:k,height:q.height&&Kv(k,q.height)?q.height:null})),children:[(0,j.jsx)("div",{className:"truss-estimator__option-title",children:x.label}),(0,j.jsx)("div",{className:"truss-estimator__option-copy",children:x.blurb})]},k))})]}):null,u==="range"?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("div",{className:"truss-estimator__section-heading",children:"Measure your fence line"}),(0,j.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,j.jsxs)("div",{className:"truss-estimator__toggle-row",children:[(0,j.jsx)("button",{type:"button",className:`truss-estimator__toggle${i.boundaryMode==="quick"?" is-selected":""}`,onClick:()=>o(k=>({...k,boundaryMode:"quick"})),children:"Quick estimate"}),(0,j.jsx)("button",{type:"button",className:`truss-estimator__toggle${i.boundaryMode==="draw"?" is-selected":""}`,onClick:()=>o(k=>({...k,boundaryMode:"draw"})),children:"Draw your boundary"})]}),i.boundaryMode==="quick"?(0,j.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact fence-boundary__quick-field",children:[(0,j.jsx)("span",{children:"Total fence length (m)"}),(0,j.jsx)("input",{type:"number",min:"0",step:"0.1",value:i.quickLengthM,onChange:k=>o(x=>({...x,quickLengthM:k.target.value}))})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("div",{className:"fence-boundary__toolbar",children:(0,j.jsxs)("div",{className:"fence-boundary__actions",children:[(0,j.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(k=>({...k,boundaryPoints:k.boundaryPoints.slice(0,-1),boundaryClosed:!1,excludedBoundaryEdges:new Set})),disabled:i.boundaryPoints.length===0||i.boundaryClosed,children:"Undo"}),(0,j.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>{d({x:0,y:0}),y(null),o(k=>({...k,boundaryPoints:[],boundaryClosed:!1,excludedBoundaryEdges:new Set}))},disabled:i.boundaryPoints.length===0,children:"Clear"}),(0,j.jsx)("button",{type:"button",className:"deck-outline__action",onClick:()=>o(k=>({...k,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,j.jsxs)("div",{className:"fence-boundary",children:[(0,j.jsxs)("svg",{ref:m,className:`fence-boundary__canvas${i.boundaryClosed?" is-pan-mode":""}`,viewBox:`${A} ${G} ${w} ${v}`,preserveAspectRatio:"none","aria-label":"Fence boundary drawing area",onPointerDown:vt,onPointerMove:H,onPointerUp:ne,onPointerLeave:()=>{y(null),L.current||(R.current=null)},children:[(0,j.jsx)("defs",{children:(0,j.jsx)("pattern",{id:"fence-boundary-grid",width:"1",height:"1",patternUnits:"userSpaceOnUse",children:(0,j.jsx)("path",{d:"M 1 0 L 0 0 0 1",fill:"none",stroke:"currentColor",strokeWidth:"0.03"})})}),(0,j.jsx)("rect",{x:-Yn,y:-$n,width:Yn*3,height:$n*3,className:"fence-boundary__grid",fill:"url(#fence-boundary-grid)"}),i.boundaryPoints.length>1?(0,j.jsx)("polyline",{className:"fence-boundary__preview",points:i.boundaryPoints.map(k=>`${k.x},${k.y}`).join(" ")}):null,i.boundaryPoints.length>1?i.boundaryPoints.slice(0,-1).map((k,x)=>{let q=i.boundaryPoints[x+1],U=Math.hypot(q.x-k.x,q.y-k.y),X=U?-(q.y-k.y)/U:0,N=U?(q.x-k.x)/U:0,O=(k.x+q.x)/2,Z=(k.y+q.y)/2,pe=X*(O-Y.x)+N*(Z-Y.y)>=0?1:-1,Se=O+X*Zv*pe,yt=Z+N*Zv*pe;return(0,j.jsxs)("g",{children:[(0,j.jsx)("line",{className:"fence-boundary__edge-hit",x1:k.x,y1:k.y,x2:q.x,y2:q.y,onClick:i.boundaryClosed?()=>de(x):void 0}),(0,j.jsx)("line",{className:`fence-boundary__edge${i.excludedBoundaryEdges.has(x)?" is-excluded":""}`,x1:k.x,y1:k.y,x2:q.x,y2:q.y,pointerEvents:"none"}),(0,j.jsxs)("text",{className:`fence-boundary__edge-label${i.excludedBoundaryEdges.has(x)?" is-excluded":""}`,x:Se,y:yt,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[U.toFixed(2)," m"]})]},`fence-edge-${x}`)}):null,!i.boundaryClosed&&i.boundaryPoints.length>0&&g?(()=>{let k=i.boundaryPoints[i.boundaryPoints.length-1],x=Math.hypot(g.x-k.x,g.y-k.y);if(!x)return null;let q=-(g.y-k.y)/x,U=(g.x-k.x)/x,X=(k.x+g.x)/2,N=(k.y+g.y)/2;return(0,j.jsxs)("g",{className:"fence-boundary__live-measurement",children:[(0,j.jsx)("line",{x1:k.x,y1:k.y,x2:g.x,y2:g.y}),(0,j.jsxs)("text",{x:X+q*.34,y:N+U*.34,textAnchor:"middle",dominantBaseline:"central",fontSize:.21/p,children:[x.toFixed(2)," m"]})]})})():null,i.boundaryPoints.map((k,x)=>x>0&&x===i.boundaryPoints.length-1&&k.x===i.boundaryPoints[0]?.x&&k.y===i.boundaryPoints[0]?.y?null:(0,j.jsx)("circle",{className:`fence-boundary__point${!i.boundaryClosed&&x===0&&i.boundaryPoints.length>=3?" is-close-target":""}`,cx:k.x,cy:k.y,r:"0.13",onPointerDown:q=>z(q,x)},`fence-point-${x}`))]}),(0,j.jsxs)("div",{className:"fence-boundary__zoom","aria-label":"Zoom controls",children:[(0,j.jsx)("button",{type:"button",onClick:()=>f(k=>Math.max(.5,k-.25)),disabled:p===.5,"aria-label":"Zoom out",children:"\u2212"}),(0,j.jsxs)("span",{children:[Math.round(p*100),"%"]}),(0,j.jsx)("button",{type:"button",onClick:()=>f(k=>Math.min(1,k+.25)),disabled:p===1,"aria-label":"Zoom in",children:"+"})]}),!i.boundaryClosed&&i.boundaryPoints.length>=2?(0,j.jsx)("button",{type:"button",className:"fence-boundary__close",onClick:()=>o(k=>bc(k.boundaryPoints,!1)?k:{...k,boundaryClosed:!0}),children:"Finish fence line"}):null]}),(0,j.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,j.jsxs)("div",{className:"truss-estimator__grid-stats",children:[(0,j.jsx)("div",{children:i.boundaryMode==="quick"?`${(Number.parseFloat(i.quickLengthM)||0).toFixed(2)} m fence line`:`${ve.totalEdgeM.toFixed(2)} m fence line`}),i.boundaryMode==="draw"&&i.boundaryClosed?(0,j.jsxs)("div",{children:[ve.cornerPostCount," corner/end posts"]}):null]})]}):null,null,u==="height"?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ei.length]}),(0,j.jsx)("h2",{className:"truss-estimator__step-title",children:"Fence height"}),(0,j.jsx)("p",{className:"truss-estimator__step-sub",children:"Select the nearest available panel height."}),(0,j.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:ka.heights.filter(k=>Kv(i.range,k)).map(k=>(0,j.jsx)("button",{type:"button",className:`truss-estimator__visual-card${i.height===k?" is-selected":""}`,onClick:()=>o(x=>({...x,height:k,mountingType:x.mountingType&&Pv(x.mountingType,k)?x.mountingType:null})),children:(0,j.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--tall",src:It(`/fencing/height/${k}.webp`),alt:""})},k))}),(0,j.jsx)("div",{className:"truss-estimator__section-heading",children:"Gravel board?"}),(0,j.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(k=>(0,j.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${i.gravelBoard===k.id?" is-selected":""}`,onClick:()=>o(x=>({...x,gravelBoard:k.id})),children:[(0,j.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:It(k.img),alt:""}),(0,j.jsx)("span",{children:k.label})]},k.id))})]}):null,u==="gate"?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ei.length]}),(0,j.jsx)("h2",{className:"truss-estimator__step-title",children:"Do you need a gate?"}),(0,j.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,j.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(k=>(0,j.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${i.gateType===k.id?" is-selected":""}`,onClick:()=>o(x=>({...x,gateType:k.id,gateWidthM:k.id==="none"?"":String(ka.gate[k.id].widthDefault)})),children:[(0,j.jsx)("img",{className:"truss-estimator__visual-card-img truss-estimator__visual-card-img--mid",src:It(k.img),alt:""}),(0,j.jsx)("span",{children:k.label})]},k.id))}),i.gateType&&i.gateType!=="none"?(0,j.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,j.jsx)("span",{children:"Gate width (m)"}),(0,j.jsx)("input",{type:"text",inputMode:"decimal",value:i.gateWidthM,onChange:k=>o(x=>({...x,gateWidthM:k.target.value}))})]}):null]}):null,u==="posts"?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("div",{className:"truss-estimator__step-label",children:["Step ",r+1," of ",Ei.length]}),(0,j.jsx)("h2",{className:"truss-estimator__step-title",children:"Posts and fixing type"}),(0,j.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose how the posts will be set."}),(0,j.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Object.entries(ka.mounting).filter(([k])=>Pv(k,i.height)).map(([k,x])=>(0,j.jsxs)("button",{type:"button",className:`truss-estimator__option-card${i.mountingType===k?" is-selected":""}`,onClick:()=>o(q=>({...q,mountingType:k})),children:[(0,j.jsx)("div",{className:"truss-estimator__option-title",children:x.label}),(0,j.jsx)("div",{className:"truss-estimator__option-copy",children:x.blurb})]},k))})]}):null]}),(0,j.jsxs)("div",{className:"truss-estimator__nav",children:[(0,j.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:me,children:"Back"}),(0,j.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:je,disabled:!wt(),children:[(0,j.jsx)("span",{children:K}),(0,j.jsx)("span",{className:"arrow",children:(0,j.jsx)(Qt,{})})]})]})]})]})})}var wc=$(Ye()),we=$(W()),Jv={floor:{label:"Floor between rooms",product:"Knauf Acoustic Roll",thickness:"100mm",coverage:12.36},ground:{label:"Ground floor",product:"Rigid PIR insulation board",thickness:"100mm",coverage:2.88},wall:{label:"Cavity wall",product:"Celotex CW4100",thickness:"100mm",coverage:3.24},roof:{label:"Pitched roof",product:"Kingspan K107",thickness:"100mm",coverage:8.64},loft:{label:"Loft",product:"Knauf Loft Roll 44",thickness:"100mm",coverage:13.89}};function am({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,wc.useState)("floor"),[i,o]=(0,wc.useState)(""),[l,c]=(0,wc.useState)(""),p=Number.parseFloat(i)*Number.parseFloat(l)||0,f=Jv[r],h=Math.ceil(p/f.coverage),d=[{key:`insulation-${r}`,label:`${f.product} ${f.thickness}`,qty:Math.round(p*100)/100,unit:"m2",query:f.product,category:"insulation"}],g=Object.entries(Jv);return(0,we.jsx)(we.Fragment,{children:(0,we.jsxs)("div",{className:"truss-estimator",children:[(0,we.jsxs)("div",{className:"quick-order-hero",children:[(0,we.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,we.jsx)("h1",{children:"Insulation Calculator"}),(0,we.jsx)("p",{children:"Estimate insulation coverage and pack quantities for floors, walls, roofs and lofts."})]}),(0,we.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,we.jsx)("h2",{className:"truss-estimator__step-title",children:"Where and what you are insulating"}),(0,we.jsx)("p",{className:"truss-estimator__step-sub",children:"Choose the application and product, and enter the area, for coverage and pack quantities."}),(0,we.jsxs)("div",{className:"materials-calculator__section",children:[(0,we.jsx)("div",{className:"truss-estimator__section-heading",children:"Application"}),(0,we.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:g.map(([y,R])=>(0,we.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===y?" is-selected":""}`,onClick:()=>n(y),children:[(0,we.jsx)("div",{className:"truss-estimator__option-title",children:R.label}),(0,we.jsxs)("div",{className:"truss-estimator__option-copy",children:[R.product,", ",R.thickness]})]},y))})]}),(0,we.jsxs)("div",{className:"materials-calculator__section",children:[(0,we.jsx)("div",{className:"truss-estimator__section-heading",children:"Area"}),(0,we.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,we.jsxs)("label",{className:"truss-estimator__field",children:[(0,we.jsx)("span",{children:"Length (m)"}),(0,we.jsx)("input",{type:"number",min:"0",step:"0.01",value:i,onChange:y=>o(y.target.value)})]}),(0,we.jsxs)("label",{className:"truss-estimator__field",children:[(0,we.jsx)("span",{children:"Width (m)"}),(0,we.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:y=>c(y.target.value)})]})]})]}),(0,we.jsxs)("div",{className:"materials-calculator__totals",children:[(0,we.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,we.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,we.jsxs)("div",{children:[(0,we.jsx)("span",{children:"Insulated area"}),(0,we.jsxs)("strong",{children:[p.toFixed(2)," m\xB2"]})]}),(0,we.jsxs)("div",{children:[(0,we.jsx)("span",{children:f.product}),(0,we.jsxs)("strong",{children:[h," packs"]})]})]}),(0,we.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,we.jsxs)("div",{className:"materials-calculator__actions",children:[(0,we.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,we.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(d),disabled:p<=0,children:a})]})]})]})})}var Vn=$(Ye());var P=$(W()),wx=10,vx=1.9*.762,yx=1.9*1.524,vc=()=>({height:"",width:""}),yc=e=>Number.parseFloat(e)||0,Iv=({height:e,width:t})=>yc(e)*yc(t);function rm({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,Vn.useState)([vc()]),[i,o]=(0,Vn.useState)([vc()]),[l,c]=(0,Vn.useState)("0"),[p,f]=(0,Vn.useState)("0"),[h,d]=(0,Vn.useState)(1),g=r.reduce((v,M)=>v+Iv(M),0),y=i.reduce((v,M)=>v+Iv(M),0),R=yc(l)*vx+yc(p)*yx,L=Math.max(0,g-y-R),m=L*h/wx,u={key:"paint-emulsion",label:"Matt emulsion, brilliant white",qty:Math.round(m*10)/10,unit:"litres",query:"matt emulsion brilliant white"},b=dl("paint",u)!=null,w=(v,M,T,A)=>{v(G=>G.map((Y,V)=>V===M?{...Y,[T]:A}:Y))};return(0,P.jsx)(P.Fragment,{children:(0,P.jsxs)("div",{className:"truss-estimator",children:[(0,P.jsxs)("div",{className:"quick-order-hero",children:[(0,P.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,P.jsx)("h1",{children:"Paint Calculator"}),(0,P.jsx)("p",{children:"Estimate how much paint you need for your walls, including multiple coats and excluded areas."})]}),(0,P.jsxs)("div",{className:"truss-estimator__card paint-calculator",children:[(0,P.jsx)("h2",{className:"truss-estimator__step-title",children:"Walls, exclusions and coats"}),(0,P.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,P.jsxs)("div",{className:"paint-calculator__section",children:[(0,P.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall dimensions"}),(0,P.jsx)("p",{className:"paint-calculator__hint",children:"Enter the height and width of each wall you want to paint."}),(0,P.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,P.jsx)("span",{}),(0,P.jsx)("span",{children:"Height (m)"}),(0,P.jsx)("span",{children:"Width (m)"}),(0,P.jsx)("span",{})]}),r.map((v,M)=>(0,P.jsxs)("div",{className:"paint-calculator__row",children:[(0,P.jsxs)("span",{className:"paint-calculator__row-label",children:["Wall ",M+1]}),(0,P.jsxs)("label",{className:"truss-estimator__field",children:[(0,P.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,P.jsx)("input",{"aria-label":`Wall ${M+1} height in metres`,type:"number",min:"0",step:"0.01",value:v.height,onChange:T=>w(n,M,"height",T.target.value)})]}),(0,P.jsxs)("label",{className:"truss-estimator__field",children:[(0,P.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,P.jsx)("input",{"aria-label":`Wall ${M+1} width in metres`,type:"number",min:"0",step:"0.01",value:v.width,onChange:T=>w(n,M,"width",T.target.value)})]}),r.length>1?(0,P.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>n(T=>T.filter((A,G)=>G!==M)),children:"Remove"}):null]},`wall-${M}`)),(0,P.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>n(v=>[...v,vc()]),children:"+ Add another wall"})]}),(0,P.jsxs)("div",{className:"paint-calculator__section",children:[(0,P.jsx)("div",{className:"truss-estimator__section-heading",children:"Areas to exclude"}),(0,P.jsx)("p",{className:"paint-calculator__hint",children:"Add windows, sockets, skirting boards or other areas that will not be painted."}),(0,P.jsxs)("div",{className:"paint-calculator__dimensions-header","aria-hidden":"true",children:[(0,P.jsx)("span",{}),(0,P.jsx)("span",{children:"Height (m)"}),(0,P.jsx)("span",{children:"Width (m)"}),(0,P.jsx)("span",{})]}),i.map((v,M)=>(0,P.jsxs)("div",{className:"paint-calculator__row",children:[(0,P.jsxs)("span",{className:"paint-calculator__row-label",children:["Area ",M+1]}),(0,P.jsxs)("label",{className:"truss-estimator__field",children:[(0,P.jsx)("span",{className:"sr-only",children:"Height (m)"}),(0,P.jsx)("input",{"aria-label":`Area ${M+1} height in metres`,type:"number",min:"0",step:"0.01",value:v.height,onChange:T=>w(o,M,"height",T.target.value)})]}),(0,P.jsxs)("label",{className:"truss-estimator__field",children:[(0,P.jsx)("span",{className:"sr-only",children:"Width (m)"}),(0,P.jsx)("input",{"aria-label":`Area ${M+1} width in metres`,type:"number",min:"0",step:"0.01",value:v.width,onChange:T=>w(o,M,"width",T.target.value)})]}),i.length>1?(0,P.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>o(T=>T.filter((A,G)=>G!==M)),children:"Remove"}):null]},`excluded-${M}`)),(0,P.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>o(v=>[...v,vc()]),children:"+ Add another area"})]}),(0,P.jsxs)("div",{className:"paint-calculator__section",children:[(0,P.jsx)("div",{className:"truss-estimator__section-heading",children:"Doors and coats"}),(0,P.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,P.jsxs)("div",{className:"truss-estimator__field-grid paint-calculator__small-fields",children:[(0,P.jsxs)("label",{className:"truss-estimator__field",children:[(0,P.jsx)("span",{children:"Doors"}),(0,P.jsx)("input",{type:"number",min:"0",step:"1",value:l,onChange:v=>c(v.target.value)})]}),(0,P.jsxs)("label",{className:"truss-estimator__field",children:[(0,P.jsx)("span",{children:"Double doors"}),(0,P.jsx)("input",{type:"number",min:"0",step:"1",value:p,onChange:v=>f(v.target.value)})]})]}),(0,P.jsxs)("div",{className:"paint-calculator__coat-field",children:[(0,P.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,P.jsxs)("label",{className:"truss-estimator__field",children:[(0,P.jsx)("span",{children:"Number of coats"}),(0,P.jsxs)("select",{value:h,onChange:v=>d(Number(v.target.value)),children:[(0,P.jsx)("option",{value:"1",children:"1 coat"}),(0,P.jsx)("option",{value:"2",children:"2 coats"}),(0,P.jsx)("option",{value:"3",children:"3 coats"})]})]})]})]}),(0,P.jsxs)("div",{className:"paint-calculator__totals",children:[(0,P.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,P.jsxs)("div",{className:"paint-calculator__result-grid",children:[(0,P.jsxs)("div",{children:[(0,P.jsx)("span",{children:"Paintable area"}),(0,P.jsxs)("strong",{children:[L.toFixed(2)," m\xB2"]})]}),(0,P.jsxs)("div",{children:[(0,P.jsx)("span",{children:"Coverage"}),(0,P.jsxs)("strong",{children:[h," ",h===1?"coat":"coats"]})]}),(0,P.jsxs)("div",{children:[(0,P.jsx)("span",{children:"Paint required"}),(0,P.jsxs)("strong",{children:[m.toFixed(1)," litres"]})]})]}),(0,P.jsx)("p",{className:"paint-calculator__note",children:b?"Based on paint coverage of 10 m\xB2 per litre. Ordered as brilliant white matt emulsion, rounded up to whole tins.":"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,P.jsxs)("div",{className:"paint-calculator__actions",children:[(0,P.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),b?(0,P.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.([u]),disabled:m<=0,children:a}):(0,P.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",disabled:!0,children:"Paint products unavailable"})]})]})]})})}var fr=$(Ye()),ae=$(W()),_c=e=>Number.parseFloat(e)||0,im={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 nm({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)(""),[h,d]=(0,fr.useState)("100"),[g,y]=(0,fr.useState)("50"),[R,L]=(0,fr.useState)(!0),[m,u]=(0,fr.useState)(!0),b=_c(l)*_c(p),w=b,v=b*(_c(h)/1e3),M=b*.04,T=b*(_c(g)/1e3),A=Math.ceil(w/.36),G=Math.ceil(w/.1),Y=Math.ceil(v*1700/800),V=Math.ceil(M*1600/800),se=Math.ceil(T*1600/800),ge=r==="paving"?{qty:A,unit:"each"}:r==="block"?{qty:w,unit:"m2"}:{qty:se,unit:"bag"},Ze={paving:"paving slab",block:"block paver",gravel:"decorative gravel"}[r],Ue=[{key:`surface-${i}`,label:im[r].find(le=>le.id===i)?.label??"Surface material",qty:ge.qty,unit:ge.unit,query:Ze,category:"landscaping"},...R?[{key:"sub-base",label:"MOT Type 1 sub-base",qty:Y,unit:"bag",query:"MOT Type 1 sub base",category:"aggregate"}]:[],...m?[{key:"bedding",label:"Sharp sand bedding",qty:V,unit:"bag",query:"sharp sand",category:"aggregate"}]:[]];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:"Paving and Driveway Calculator"}),(0,ae.jsx)("p",{children:"Estimate paving, block paving, sub-base and bedding materials for outdoor areas."})]}),(0,ae.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,ae.jsx)("h2",{className:"truss-estimator__step-title",children:"Surface and ground build-up"}),(0,ae.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,ae.jsxs)("div",{className:"materials-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Surface material"}),(0,ae.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(([le,ot,ze])=>(0,ae.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===le?" is-selected":""}`,onClick:()=>{n(le),o(im[le][0].id)},children:[(0,ae.jsx)("div",{className:"truss-estimator__option-title",children:ot}),(0,ae.jsx)("div",{className:"truss-estimator__option-copy",children:ze})]},le))}),(0,ae.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,ae.jsx)("span",{children:"Finish"}),(0,ae.jsx)("select",{value:i,onChange:le=>o(le.target.value),children:im[r].map(le=>(0,ae.jsx)("option",{value:le.id,children:le.label},le.id))})]})]}),(0,ae.jsxs)("div",{className:"materials-calculator__section",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Area and groundwork"}),(0,ae.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,ae.jsxs)("label",{className:"truss-estimator__field",children:[(0,ae.jsx)("span",{children:"Length (m)"}),(0,ae.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:le=>c(le.target.value)})]}),(0,ae.jsxs)("label",{className:"truss-estimator__field",children:[(0,ae.jsx)("span",{children:"Width (m)"}),(0,ae.jsx)("input",{type:"number",min:"0",step:"0.01",value:p,onChange:le=>f(le.target.value)})]})]}),r==="gravel"&&(0,ae.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,ae.jsx)("span",{children:"Gravel depth (mm)"}),(0,ae.jsx)("input",{type:"number",min:"0",step:"10",value:g,onChange:le=>y(le.target.value)})]}),R&&(0,ae.jsxs)("label",{className:"truss-estimator__field materials-calculator__depth",children:[(0,ae.jsx)("span",{children:"Sub-base depth (mm)"}),(0,ae.jsx)("input",{type:"number",min:"0",step:"10",value:h,onChange:le=>d(le.target.value)})]}),(0,ae.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,ae.jsx)("input",{type:"checkbox",checked:R,onChange:le=>L(le.target.checked)}),(0,ae.jsx)("span",{children:"Include MOT Type 1 sub-base"})]}),(0,ae.jsxs)("label",{className:"brick-calculator__checkbox materials-calculator__waste",children:[(0,ae.jsx)("input",{type:"checkbox",checked:m,onChange:le=>u(le.target.checked)}),(0,ae.jsx)("span",{children:"Include sharp sand bedding"})]})]}),(0,ae.jsxs)("div",{className:"materials-calculator__totals",children:[(0,ae.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,ae.jsxs)("div",{className:"materials-calculator__result-grid",children:[(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Surface area"}),(0,ae.jsxs)("strong",{children:[b.toFixed(2)," m\xB2"]})]}),(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:r==="paving"?"Paving slabs":r==="block"?"Block paving":"Gravel"}),(0,ae.jsx)("strong",{children:r==="paving"?`${A} slabs`:r==="block"?`${w.toFixed(2)} m\xB2`:`${se} bulk bags`})]}),R&&(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"MOT Type 1"}),(0,ae.jsxs)("strong",{children:[Y," bulk bags"]})]}),m&&(0,ae.jsxs)("div",{children:[(0,ae.jsx)("span",{children:"Sharp sand"}),(0,ae.jsxs)("strong",{children:[V," bulk bags"]})]})]}),(0,ae.jsx)("p",{className:"materials-calculator__note",children:"Slab and block quantities use typical sizes. Confirm pack coverage and laying pattern before ordering."})]}),(0,ae.jsxs)("div",{className:"materials-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?.(Ue),disabled:b<=0,children:a})]})]})]})})}var ml=$(Ye()),ie=$(W()),_x=2.88,Fv=[{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"}],Wv=()=>({length:"",height:""}),om=e=>Number.parseFloat(e)||0;function lm({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,ml.useState)([Wv()]),[i,o]=(0,ml.useState)(""),[l,c]=(0,ml.useState)("standard"),[p,f]=(0,ml.useState)("screws"),h=r.reduce((M,T)=>M+om(T.length)*om(T.height),0),d=Math.max(0,h-om(i)),g=Math.ceil(d/_x),y=Math.ceil(d*12),R=Math.ceil(y/1e3),L=Math.ceil(d*1.2),m=Math.ceil(L/90),u=Math.ceil(d/3.5),b=Fv.find(M=>M.id===l)?.label??"Standard",w=[{key:"board",label:`${b} plasterboard`,qty:g,unit:"sheet",query:`${b} plasterboard`,category:"plasterboard"},...p==="screws"?[{key:"screws",label:"Drywall screws",qty:R,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:m,unit:"roll",query:"plasterboard joint tape",category:"plasterboard"}],v=(M,T,A)=>{n(G=>G.map((Y,V)=>V===M?{...Y,[T]:A}:Y))};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:"Plasterboard and Drylining Calculator"}),(0,ie.jsx)("p",{children:"Estimate boards, fixings and jointing materials for walls and ceilings."})]}),(0,ie.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,ie.jsx)("h2",{className:"truss-estimator__step-title",children:"Boards, fixings and jointing"}),(0,ie.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,ie.jsxs)("div",{className:"materials-calculator__section",children:[(0,ie.jsx)("div",{className:"truss-estimator__section-heading",children:"Board type"}),(0,ie.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:Fv.map(M=>(0,ie.jsxs)("button",{type:"button",className:`truss-estimator__option-card${l===M.id?" is-selected":""}`,onClick:()=>c(M.id),children:[(0,ie.jsx)("div",{className:"truss-estimator__option-title",children:M.label}),(0,ie.jsx)("div",{className:"truss-estimator__option-copy",children:M.blurb})]},M.id))})]}),(0,ie.jsxs)("div",{className:"materials-calculator__section",children:[(0,ie.jsx)("div",{className:"truss-estimator__section-heading",children:"Fixing method"}),(0,ie.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(([M,T,A])=>(0,ie.jsxs)("button",{type:"button",className:`truss-estimator__option-card${p===M?" is-selected":""}`,onClick:()=>f(M),children:[(0,ie.jsx)("div",{className:"truss-estimator__option-title",children:T}),(0,ie.jsx)("div",{className:"truss-estimator__option-copy",children:A})]},M))})]}),(0,ie.jsxs)("div",{className:"materials-calculator__section",children:[(0,ie.jsx)("div",{className:"truss-estimator__section-heading",children:"Wall and ceiling areas"}),(0,ie.jsx)("p",{className:"materials-calculator__hint",children:"Add each surface separately so different wall sizes are easy to measure."}),(0,ie.jsxs)("div",{className:"materials-calculator__dimensions-header",children:[(0,ie.jsx)("span",{children:"Surface"}),(0,ie.jsx)("span",{children:"Length (m)"}),(0,ie.jsx)("span",{children:"Height (m)"}),(0,ie.jsx)("span",{})]}),r.map((M,T)=>(0,ie.jsxs)("div",{className:"materials-calculator__surface-row",children:[(0,ie.jsxs)("span",{children:["Surface ",T+1]}),(0,ie.jsx)("input",{"aria-label":`Surface ${T+1} length`,type:"number",min:"0",step:"0.01",value:M.length,onChange:A=>v(T,"length",A.target.value)}),(0,ie.jsx)("input",{"aria-label":`Surface ${T+1} height`,type:"number",min:"0",step:"0.01",value:M.height,onChange:A=>v(T,"height",A.target.value)}),r.length>1?(0,ie.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>n(A=>A.filter((G,Y)=>Y!==T)),children:"Remove"}):null]},`surface-${T}`)),(0,ie.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>n(M=>[...M,Wv()]),children:"+ Add another surface"}),(0,ie.jsxs)("label",{className:"truss-estimator__field materials-calculator__openings",children:[(0,ie.jsxs)("span",{children:["Openings to deduct (m\xB2) ",(0,ie.jsx)("small",{children:"optional"})]}),(0,ie.jsx)("input",{type:"number",min:"0",step:"0.01",value:i,onChange:M=>o(M.target.value)})]})]}),(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:"Board area"}),(0,ie.jsxs)("strong",{children:[d.toFixed(2)," m\xB2"]})]}),(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:"2.4 x 1.2 m boards"}),(0,ie.jsx)("strong",{children:g})]}),(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:p==="screws"?"Drywall screws":"Board adhesive"}),(0,ie.jsx)("strong",{children:p==="screws"?`${y} (${R} boxes)`:`${u} bags`})]}),(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{children:"Joint tape"}),(0,ie.jsxs)("strong",{children:[L," m (",m," rolls)"]})]})]}),(0,ie.jsx)("p",{className:"materials-calculator__note",children:"Figures are estimates. Confirm board specification, fixing patterns and fire or acoustic requirements 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?.(w),disabled:d<=0,children:a})]})]})]})})}var fl=$(Ye());var _=$(W()),Rt={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}}}},xc=["range","pitchAndDimensions","quantityAndGirders","bracing"],xx={range:null,pitch:null,spanMM:"",overhangMM:"",roofLengthM:"",centres:null,girderCount:0,bracing:null,treatment:null,contact:{name:"",email:""}};function kx({degrees:e}){let a=e*Math.PI/180,n=82-Math.min(58,38*Math.tan(a));return(0,_.jsxs)("svg",{viewBox:"0 0 100 100",className:"truss-estimator__diagram truss-estimator__diagram--small","aria-hidden":"true",children:[(0,_.jsx)("line",{x1:"6",y1:"82",x2:"94",y2:"82",stroke:"var(--border)",strokeWidth:"2"}),(0,_.jsx)("polygon",{points:`12,82 88,82 50,${n}`,fill:"var(--accent-light)",stroke:"var(--accent)",strokeWidth:"3",strokeLinejoin:"round"})]})}function Sx({type:e}){let t="#b3835a",a="#5c3b22",r="#d9b48f",n="#d3d8de",i="#7c8494",o=(f,h,d,g,y=8,R)=>{let L=d-f,m=g-h,u=Math.hypot(L,m)||1,b=-m/u,w=L/u,v=y*.2;return(0,_.jsxs)("g",{children:[(0,_.jsx)("line",{x1:f,y1:h,x2:d,y2:g,stroke:a,strokeWidth:y+3,strokeLinecap:"square"}),(0,_.jsx)("line",{x1:f,y1:h,x2:d,y2:g,stroke:t,strokeWidth:y,strokeLinecap:"square"}),(0,_.jsx)("line",{x1:f-b*v,y1:h-w*v,x2:d-b*v,y2:g-w*v,stroke:r,strokeWidth:Math.max(1.5,y*.24),strokeLinecap:"round",opacity:"0.9"})]},R)},l=(f,h,d)=>(0,_.jsxs)("g",{children:[(0,_.jsx)("rect",{x:f-7.5,y:h-5.5,width:"15",height:"11",rx:"2",fill:n,stroke:i,strokeWidth:"1"}),(0,_.jsx)("circle",{cx:f-4,cy:h-2.5,r:"1",fill:i}),(0,_.jsx)("circle",{cx:f+4,cy:h-2.5,r:"1",fill:i}),(0,_.jsx)("circle",{cx:f-4,cy:h+2.5,r:"1",fill:i}),(0,_.jsx)("circle",{cx:f+4,cy:h+2.5,r:"1",fill:i}),(0,_.jsx)("circle",{cx:f,cy:h,r:"1",fill:i})]},d),c=(f,h)=>(0,_.jsx)("rect",{x:f-9,y:"110",width:"18",height:"10",fill:a},h),p=(0,_.jsx)("line",{x1:"6",y1:"122",x2:"194",y2:"122",stroke:"var(--border)",strokeWidth:"2"});return e==="attic"?(0,_.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,_.jsx)("rect",{x:"90",y:"82",width:"20",height:"24",fill:"#cfe3f2",stroke:a,strokeWidth:"2"}),(0,_.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,_.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,_.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,_.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 Nx({enabled:e}){return(0,_.jsxs)("svg",{viewBox:"0 0 200 130",className:"truss-estimator__diagram","aria-hidden":"true",children:[(0,_.jsx)("line",{x1:"6",y1:"122",x2:"194",y2:"122",stroke:"var(--border)",strokeWidth:"2"}),(0,_.jsx)("rect",{x:"17",y:"110",width:"18",height:"10",fill:"#5c3b22"}),(0,_.jsx)("rect",{x:"165",y:"110",width:"18",height:"10",fill:"#5c3b22"}),(0,_.jsx)("line",{x1:"26",y1:"112",x2:"100",y2:"34",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,_.jsx)("line",{x1:"26",y1:"112",x2:"100",y2:"34",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),(0,_.jsx)("line",{x1:"174",y1:"112",x2:"100",y2:"34",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,_.jsx)("line",{x1:"174",y1:"112",x2:"100",y2:"34",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),(0,_.jsx)("line",{x1:"26",y1:"112",x2:"174",y2:"112",stroke:"#5c3b22",strokeWidth:"11",strokeLinecap:"square"}),(0,_.jsx)("line",{x1:"26",y1:"112",x2:"174",y2:"112",stroke:"#b3835a",strokeWidth:"8",strokeLinecap:"square"}),e?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("line",{x1:"45",y1:"112",x2:"140",y2:"88",stroke:"var(--accent)",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"7 5"}),(0,_.jsx)("line",{x1:"155",y1:"112",x2:"60",y2:"88",stroke:"var(--accent)",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"7 5"})]}):null,(0,_.jsx)("rect",{x:"18.5",y:"106.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"}),(0,_.jsx)("rect",{x:"166.5",y:"106.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"}),(0,_.jsx)("rect",{x:"92.5",y:"28.5",width:"15",height:"11",rx:"2",fill:"#d3d8de",stroke:"#7c8494",strokeWidth:"1"})]})}function e0({treated:e}){let t=e?"#5a7a4a":"var(--accent)";return(0,_.jsxs)("svg",{viewBox:"0 0 100 100",className:"truss-estimator__diagram truss-estimator__diagram--small","aria-hidden":"true",children:[(0,_.jsx)("rect",{x:"10",y:"22",width:"80",height:"14",rx:"2",fill:t}),(0,_.jsx)("rect",{x:"10",y:"43",width:"80",height:"14",rx:"2",fill:e?"#8faf7a":"var(--accent-light)"}),(0,_.jsx)("rect",{x:"10",y:"64",width:"80",height:"14",rx:"2",fill:t})]})}function sm({onBack:e}){let[t,a]=(0,fl.useState)(0),[r,n]=(0,fl.useState)(xx),[i,o]=(0,fl.useState)(!1),[l,c]=(0,fl.useState)(!1),p=()=>{let m=Number.parseFloat(r.roofLengthM)||0,u=Number.parseFloat(r.centres??"");return m<=0||!u?0:Math.ceil(m*1e3/u)+1},h=(()=>{let m=r.range?Rt.ranges[r.range]:Rt.ranges.standard,u=r.pitch??"22.5",b=Rt.pitchMultipliers[u],w=(Number.parseFloat(r.spanMM)||0)/1e3,M=(Number.parseFloat(r.overhangMM)||0)>Rt.overhang.thresholdMM,T=p(),A=T+r.girderCount,G=Number.parseFloat(r.roofLengthM)||0,Y=r.treatment?Rt.treatment[r.treatment]:Rt.treatment.untreated,V=Rt.estimate.ranges[r.range??"standard"],se=V.supplyAt8m*Math.max(.7,w/8)*b*(1+Y.surchargePct)+(M?Rt.overhang.surchargePerTruss:0),ge=T*se,Ze=r.girderCount*se*Rt.estimate.girderMultiplier,Ue=r.bracing==="yes"?G*Rt.estimate.bracingPerMetre:0,ve=ge+Ze+Ue+Rt.estimate.delivery,le=Rt.estimate.design+T*V.installPerTruss+r.girderCount*40,ot=ve+le,ze=ot*.2;return{range:m,count:T,girderCount:r.girderCount,overhangApplies:M,overhangUnits:A,roofLengthM:G,treatment:Y,trussSupply:ge,bracingMaterials:Ue,delivery:Rt.estimate.delivery,labour:le,subtotal:ot,vat:ze,total:ot+ze}})(),d=()=>{let m=xc[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},g=t===xc.length-1?"View truss request":"Next",y=()=>{i?o(!1):t===0?e():a(m=>m-1)},R=()=>{d()&&(t===xc.length-1?(c(!1),o(!0)):a(m=>m+1))},L=()=>{let m=xc[t];return m==="range"?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"truss-estimator__step-label",children:"Step 1 of 4"}),(0,_.jsx)("h2",{className:"truss-estimator__step-title",children:"Choose your truss range"}),(0,_.jsx)("p",{className:"truss-estimator__step-sub",children:"Pricing shown is placeholder. Swap in your real engineering and pricing catalogue."}),(0,_.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--range",children:Object.entries(Rt.ranges).map(([u,b])=>(0,_.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r.range===u?" is-selected":""}`,onClick:()=>n(w=>({...w,range:u})),children:[(0,_.jsx)(Sx,{type:u}),(0,_.jsxs)("div",{className:"truss-estimator__option-info",children:[(0,_.jsx)("div",{className:"truss-estimator__option-title",children:b.label}),(0,_.jsx)("div",{className:"truss-estimator__option-copy",children:b.blurb})]})]},u))})]}):m==="pitchAndDimensions"?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"truss-estimator__step-label",children:"Step 2 of 4"}),(0,_.jsx)("h2",{className:"truss-estimator__step-title",children:"Span, overhang and roof pitch"}),(0,_.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,_.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,_.jsxs)("label",{className:"truss-estimator__field",children:[(0,_.jsx)("span",{children:"Span (mm)"}),(0,_.jsx)("input",{type:"text",inputMode:"numeric",value:r.spanMM,onChange:u=>n(b=>({...b,spanMM:u.target.value}))})]}),(0,_.jsxs)("label",{className:"truss-estimator__field",children:[(0,_.jsx)("span",{children:"Overhang (mm)"}),(0,_.jsx)("input",{type:"text",inputMode:"numeric",value:r.overhangMM,onChange:u=>n(b=>({...b,overhangMM:u.target.value}))}),(0,_.jsxs)("small",{children:["Overhangs beyond ",Rt.overhang.thresholdMM,"mm add a small surcharge per truss."]})]})]}),(0,_.jsx)("div",{className:"truss-estimator__section-heading",children:"Roof pitch"}),(0,_.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--pitch",children:Rt.pitches.map(u=>(0,_.jsxs)("button",{type:"button",className:`truss-estimator__visual-card${r.pitch===u?" is-selected":""}`,onClick:()=>n(b=>({...b,pitch:u})),children:[(0,_.jsx)(kx,{degrees:Number.parseFloat(u)}),(0,_.jsxs)("span",{children:[u,"\xB0"]})]},u))})]}):m==="quantityAndGirders"?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"truss-estimator__step-label",children:"Step 3 of 4"}),(0,_.jsx)("h2",{className:"truss-estimator__step-title",children:"Roof length"}),(0,_.jsx)("p",{className:"truss-estimator__step-sub",children:"Trusses are based on designs at 400mm or 600mm centres wherever possible."}),(0,_.jsxs)("label",{className:"truss-estimator__field truss-estimator__field--compact",children:[(0,_.jsx)("span",{children:"Roof length (m)"}),(0,_.jsx)("input",{type:"text",inputMode:"decimal",value:r.roofLengthM,onChange:u=>n(b=>({...b,roofLengthM:u.target.value}))})]}),(0,_.jsx)("div",{className:"truss-estimator__section-heading",children:"Truss centres"}),(0,_.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--centres",children:Rt.centresOptions.map(u=>(0,_.jsx)("button",{type:"button",className:`truss-estimator__option-card truss-estimator__option-card--compact${r.centres===u?" is-selected":""}`,onClick:()=>n(b=>({...b,centres:u})),children:(0,_.jsxs)("div",{className:"truss-estimator__option-title",children:[u,"mm centres"]})},u))}),(0,_.jsxs)("div",{className:"truss-estimator__stat",children:[p()," trusses estimated"]}),(0,_.jsx)("div",{className:"truss-estimator__section-heading",children:"Girder trusses"}),(0,_.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,_.jsxs)("div",{className:"truss-estimator__stepper",children:[(0,_.jsx)("button",{type:"button",onClick:()=>n(u=>({...u,girderCount:Math.max(0,u.girderCount-1)})),children:"\u2212"}),(0,_.jsx)("span",{children:r.girderCount}),(0,_.jsx)("button",{type:"button",onClick:()=>n(u=>({...u,girderCount:Math.min(3,u.girderCount+1)})),children:"+"})]})]}):m==="bracing"?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{className:"truss-estimator__step-label",children:"Step 4 of 4"}),(0,_.jsx)("h2",{className:"truss-estimator__step-title",children:"Bracing pack?"}),(0,_.jsx)("p",{className:"truss-estimator__step-sub",children:"A timber bracing pack stabilises the roof structure once trusses are erected."}),(0,_.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,_.jsxs)("button",{type:"button",className:`truss-estimator__visual-card truss-estimator__visual-card--wide${r.bracing===u.id?" is-selected":""}`,onClick:()=>n(b=>({...b,bracing:u.id})),children:[(0,_.jsx)(Nx,{enabled:u.id==="yes"}),(0,_.jsx)("span",{children:u.label})]},u.id))}),(0,_.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber treatment"}),(0,_.jsx)("p",{className:"truss-estimator__step-sub",children:"Tanalised timber protects against rot in exposed or damp locations."}),(0,_.jsxs)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--two",children:[(0,_.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,_.jsx)(e0,{treated:!1}),(0,_.jsx)("span",{children:"Untreated"})]}),(0,_.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,_.jsx)(e0,{treated:!0}),(0,_.jsx)("span",{children:"Treated (+8% cost)"}),(0,_.jsx)("small",{children:"Applies to trusses, girders and overhang"})]})]})]}):null};return i?(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 truss estimate"}),(0,_.jsx)("p",{children:"A provisional quantity and specification based on the dimensions you entered."})]}),(0,_.jsxs)("div",{className:"truss-estimator__card truss-request",style:{minHeight:0},children:[(0,_.jsxs)("div",{className:"truss-request__heading",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("div",{className:"truss-estimator__step-label",children:"Estimated requirement"}),(0,_.jsxs)("h2",{children:[h.range.label," roof trusses"]})]}),(0,_.jsxs)("strong",{children:[h.count,(0,_.jsx)("span",{children:"trusses"})]})]}),(0,_.jsxs)("div",{className:"truss-request__grid",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Span"}),(0,_.jsxs)("strong",{children:[r.spanMM," mm"]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Roof length"}),(0,_.jsxs)("strong",{children:[r.roofLengthM," m"]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Pitch"}),(0,_.jsxs)("strong",{children:[r.pitch,"\xB0"]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Centres"}),(0,_.jsxs)("strong",{children:[r.centres," mm"]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Overhang"}),(0,_.jsxs)("strong",{children:[r.overhangMM," mm"]})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Treatment"}),(0,_.jsx)("strong",{children:h.treatment.label})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Girder trusses"}),(0,_.jsx)("strong",{children:h.girderCount||"None"})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Bracing pack"}),(0,_.jsx)("strong",{children:r.bracing==="yes"?"Included":"Not included"})]})]}),(0,_.jsxs)("div",{className:"truss-request__price",children:[(0,_.jsx)("div",{className:"truss-estimator__step-label",children:"Indicative cost estimate"}),(0,_.jsxs)("div",{className:"truss-request__price-grid",children:[(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Truss supply allowance"}),(0,_.jsx)("strong",{children:nt(h.trussSupply)})]}),h.bracingMaterials>0&&(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Bracing materials allowance"}),(0,_.jsx)("strong",{children:nt(h.bracingMaterials)})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Delivery allowance"}),(0,_.jsx)("strong",{children:nt(h.delivery)})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Design and installation labour"}),(0,_.jsx)("strong",{children:nt(h.labour)})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"Subtotal (ex. VAT)"}),(0,_.jsx)("strong",{children:nt(h.subtotal)})]}),(0,_.jsxs)("div",{children:[(0,_.jsx)("span",{children:"VAT (20%)"}),(0,_.jsx)("strong",{children:nt(h.vat)})]}),(0,_.jsxs)("div",{className:"truss-request__price-total",children:[(0,_.jsx)("span",{children:"Estimated total"}),(0,_.jsx)("strong",{children:nt(h.total)})]})]}),(0,_.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,_.jsxs)("div",{className:"truss-request__notice",children:[(0,_.jsx)("strong",{children:"Before ordering"}),(0,_.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,_.jsxs)("div",{className:"truss-estimator__nav",children:[(0,_.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:y,children:"Back to calculator"}),(0,_.jsx)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",justifyContent:"center",marginTop:0},onClick:()=>c(!0),children:"Request order"})]}),l&&(0,_.jsx)("p",{className:"truss-request__demo",children:"Demo only \u2014 no order has been sent."})]})]})}):(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:"Roof Truss Calculator"}),(0,_.jsx)("p",{children:"Estimate trusses, girders and cost for your roof in a few steps."})]}),(0,_.jsxs)("div",{className:"truss-estimator__card",children:[(0,_.jsx)("div",{className:"truss-estimator__body",children:L()}),(0,_.jsxs)("div",{className:"truss-estimator__nav",children:[(0,_.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:y,children:"Back"}),(0,_.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:"0 1 70%",marginTop:0},onClick:R,disabled:!d(),children:[(0,_.jsx)("span",{children:g}),(0,_.jsx)("span",{className:"arrow",children:(0,_.jsx)(Qt,{})})]})]})]})]})})}var Mi=$(Ye()),F=$(W()),r0=e=>Number.parseFloat(e)||0,kc=(e,t)=>r0(e)*(t==="m"?1:.3048),t0=()=>({length:"",width:""}),a0=[{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 Cx({profile:e}){return(0,F.jsxs)("svg",{className:"skirting-calculator__profile-diagram",viewBox:"0 0 120 84","aria-hidden":"true",children:[(0,F.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,F.jsx)("line",{x1:"12",y1:"70",x2:"108",y2:"70"})]})}function cm({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,Mi.useState)("total"),[i,o]=(0,Mi.useState)("m"),[l,c]=(0,Mi.useState)(""),[p,f]=(0,Mi.useState)([t0()]),[h,d]=(0,Mi.useState)(""),[g,y]=(0,Mi.useState)("chamfered"),R="4.4",L=r==="total"?kc(l,i):p.reduce((v,M)=>v+2*(kc(M.length,i)+kc(M.width,i)),0),m=Math.max(0,L-kc(h,i)),u=Math.ceil(m/r0(R)),b=[{key:`skirting-${g}`,label:`${a0.find(v=>v.id===g)?.label} skirting board`,qty:m,unit:"m",query:"skirting board",category:"skirting"}],w=(v,M,T)=>{f(A=>A.map((G,Y)=>Y===v?{...G,[M]:T}:G))};return(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)("div",{className:"truss-estimator",children:[(0,F.jsxs)("div",{className:"quick-order-hero",children:[(0,F.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,F.jsx)("h1",{children:"Skirting Board Calculator"}),(0,F.jsx)("p",{children:"Work out how many skirting board lengths you need for one room or a whole project."})]}),(0,F.jsxs)("div",{className:"truss-estimator__card skirting-calculator",children:[(0,F.jsx)("h2",{className:"truss-estimator__step-title",children:"Measure by room or total length"}),(0,F.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,F.jsxs)("div",{className:"skirting-calculator__section",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"How would you like to measure?"}),(0,F.jsxs)("div",{className:"brick-calculator__unit-toggle skirting-calculator__mode-toggle",role:"group","aria-label":"Calculation method",children:[(0,F.jsx)("button",{type:"button",className:r==="total"?"is-selected":"",onClick:()=>n("total"),children:"Total length"}),(0,F.jsx)("button",{type:"button",className:r==="rooms"?"is-selected":"",onClick:()=>n("rooms"),children:"Room by room"})]})]}),(0,F.jsxs)("div",{className:"skirting-calculator__section",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"Measurements"}),(0,F.jsxs)("div",{className:"skirting-calculator__unit-row",children:[(0,F.jsx)("span",{children:"Units"}),(0,F.jsxs)("div",{className:"brick-calculator__unit-toggle",role:"group","aria-label":"Measurement units",children:[(0,F.jsx)("button",{type:"button",className:i==="m"?"is-selected":"",onClick:()=>o("m"),children:"Metres"}),(0,F.jsx)("button",{type:"button",className:i==="ft"?"is-selected":"",onClick:()=>o("ft"),children:"Feet"})]})]}),r==="total"?(0,F.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,F.jsxs)("span",{children:["Total skirting length (",i,")"]}),(0,F.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:v=>c(v.target.value)})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{className:"skirting-calculator__dimensions-header",children:[(0,F.jsx)("span",{children:"Room"}),(0,F.jsxs)("span",{children:["Length (",i,")"]}),(0,F.jsxs)("span",{children:["Width (",i,")"]}),(0,F.jsx)("span",{})]}),p.map((v,M)=>(0,F.jsxs)("div",{className:"skirting-calculator__room-row",children:[(0,F.jsxs)("span",{className:"skirting-calculator__room-label",children:["Room ",M+1]}),(0,F.jsx)("input",{"aria-label":`Room ${M+1} length in ${i}`,type:"number",min:"0",step:"0.01",value:v.length,onChange:T=>w(M,"length",T.target.value)}),(0,F.jsx)("input",{"aria-label":`Room ${M+1} width in ${i}`,type:"number",min:"0",step:"0.01",value:v.width,onChange:T=>w(M,"width",T.target.value)}),p.length>1?(0,F.jsx)("button",{type:"button",className:"paint-calculator__remove",onClick:()=>f(T=>T.filter((A,G)=>G!==M)),children:"Remove"}):null]},`room-${M}`)),(0,F.jsx)("button",{type:"button",className:"paint-calculator__add",onClick:()=>f(v=>[...v,t0()]),children:"+ Add another room"})]}),(0,F.jsxs)("label",{className:"truss-estimator__field skirting-calculator__single-field",children:[(0,F.jsxs)("span",{children:["Openings and doorways to deduct (",i,") ",(0,F.jsx)("small",{children:"optional"})]}),(0,F.jsx)("input",{type:"number",min:"0",step:"0.01",value:h,onChange:v=>d(v.target.value)})]})]}),(0,F.jsxs)("div",{className:"skirting-calculator__section",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"Profile"}),(0,F.jsx)("p",{className:"skirting-calculator__hint",children:"Choose the finish you want for the fixed 4.4m white-primed MDF boards."}),(0,F.jsx)("div",{className:"architrave-calculator__profiles",children:a0.map(v=>(0,F.jsxs)("button",{type:"button",className:`truss-estimator__option-card${g===v.id?" is-selected":""}`,onClick:()=>y(v.id),children:[(0,F.jsx)(Cx,{profile:v.id}),(0,F.jsx)("div",{className:"truss-estimator__option-title",children:v.label}),(0,F.jsx)("div",{className:"truss-estimator__option-copy",children:v.blurb})]},v.id))})]}),(0,F.jsxs)("div",{className:"skirting-calculator__section",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"Board and waste"}),(0,F.jsx)("div",{className:"truss-estimator__field-grid skirting-calculator__options-grid",children:(0,F.jsxs)("label",{className:"truss-estimator__field",children:[(0,F.jsx)("span",{children:"Board length"}),(0,F.jsx)("input",{value:"4.40 m",disabled:!0})]})}),(0,F.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,F.jsxs)("div",{className:"skirting-calculator__totals",children:[(0,F.jsx)("div",{className:"truss-estimator__section-heading",children:"Totals"}),(0,F.jsxs)("div",{className:"skirting-calculator__result-grid",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("span",{children:"Net skirting"}),(0,F.jsxs)("strong",{children:[m.toFixed(2)," m"]})]}),(0,F.jsxs)("div",{children:[(0,F.jsx)("span",{children:"Board lengths"}),(0,F.jsx)("strong",{children:u})]})]}),(0,F.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,F.jsxs)("div",{className:"skirting-calculator__actions",children:[(0,F.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary estimator-actions__back",onClick:e,children:"Back"}),(0,F.jsx)("button",{type:"button",className:"cta-btn estimator-actions__calculate",onClick:()=>t?.(b),disabled:m<=0,children:a})]})]})]})})}var Xn=$(Ye()),oe=$(W()),hl=e=>Number.parseFloat(e)||0;function um({onBack:e,onReview:t,submitLabel:a="Add to basket"}){let[r,n]=(0,Xn.useState)("studs"),[i,o]=(0,Xn.useState)(""),[l,c]=(0,Xn.useState)(""),[p,f]=(0,Xn.useState)("600"),[h,d]=(0,Xn.useState)("2.4"),g=i&&l&&p?Math.ceil(hl(l)/(hl(p)/1e3))+1:0,y=g*hl(i),R=hl(h)>0?Math.ceil(y/hl(h)):0,L=[{key:r,label:{studs:"Stud timber",joists:"Joist timber",battens:"Batten timber"}[r],qty:y,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"]},b={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,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:"Timber Calculator"}),(0,oe.jsx)("p",{children:"Estimate studs, joists or battens from a run length, width and spacing."})]}),(0,oe.jsxs)("div",{className:"truss-estimator__card materials-calculator",children:[(0,oe.jsx)("h2",{className:"truss-estimator__step-title",children:"Member size and spacing"}),(0,oe.jsxs)("p",{className:"truss-estimator__step-sub",children:[b.help," Enter the member length and centres to estimate the number of pieces and stock lengths."]}),(0,oe.jsxs)("div",{className:"materials-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Timber use"}),(0,oe.jsx)("div",{className:"truss-estimator__option-grid truss-estimator__option-grid--three",children:Object.keys(m).map(w=>(0,oe.jsxs)("button",{type:"button",className:`truss-estimator__option-card${r===w?" is-selected":""}`,onClick:()=>n(w),children:[(0,oe.jsx)("div",{className:"truss-estimator__option-title",children:m[w][0]}),(0,oe.jsx)("div",{className:"truss-estimator__option-copy",children:m[w][1]})]},w))})]}),(0,oe.jsxs)("div",{className:"materials-calculator__section",children:[(0,oe.jsx)("div",{className:"truss-estimator__section-heading",children:"Dimensions and spacing"}),(0,oe.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,oe.jsxs)("label",{className:"truss-estimator__field",children:[(0,oe.jsxs)("span",{children:[b.member," (m)"]}),(0,oe.jsx)("input",{type:"number",min:"0",step:"0.01",value:i,onChange:w=>o(w.target.value)})]}),(0,oe.jsxs)("label",{className:"truss-estimator__field",children:[(0,oe.jsxs)("span",{children:[b.overall," (m)"]}),(0,oe.jsx)("input",{type:"number",min:"0",step:"0.01",value:l,onChange:w=>c(w.target.value)})]})]}),(0,oe.jsxs)("div",{className:"truss-estimator__field-grid",children:[(0,oe.jsxs)("label",{className:"truss-estimator__field",children:[(0,oe.jsx)("span",{children:"Centres (mm)"}),(0,oe.jsxs)("select",{value:p,onChange:w=>f(w.target.value),children:[(0,oe.jsx)("option",{value:"300",children:"300 mm"}),(0,oe.jsx)("option",{value:"400",children:"400 mm"}),(0,oe.jsx)("option",{value:"450",children:"450 mm"}),(0,oe.jsx)("option",{value:"600",children:"600 mm"})]})]}),(0,oe.jsxs)("label",{className:"truss-estimator__field",children:[(0,oe.jsx)("span",{children:"Stock length (m)"}),(0,oe.jsxs)("select",{value:h,onChange:w=>d(w.target.value),children:[(0,oe.jsx)("option",{value:"2.4",children:"2.40 m"}),(0,oe.jsx)("option",{value:"3.6",children:"3.60 m"}),(0,oe.jsx)("option",{value:"4.8",children:"4.80 m"})]})]})]})]}),(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:b.count}),(0,oe.jsx)("strong",{children:g})]}),(0,oe.jsxs)("div",{children:[(0,oe.jsx)("span",{children:"Linear metres"}),(0,oe.jsxs)("strong",{children:[y.toFixed(2)," m"]})]}),(0,oe.jsxs)("div",{children:[(0,oe.jsxs)("span",{children:[h," m lengths"]}),(0,oe.jsx)("strong",{children:R})]})]}),(0,oe.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,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?.(L),disabled:y<=0,children:a})]})]})]})})}var pm=[{id:"truss",title:"Roof Truss Calculator",desc:"Estimate trusses, girders and roof structure costs.",imageUrl:"/tool-images/truss.webp",Component:sm},{id:"fencing",title:"Fencing Calculator",desc:"Estimate fence panels, posts, gravel boards and fixings.",imageUrl:"/tool-images/fencing.webp",Component:tm},{id:"decking",title:"Decking Calculator",desc:"Estimate boards, substructure and fixing quantities.",imageUrl:"/tool-images/decking.webp",Component:Wd},{id:"brick-block",title:"Brick and Block Calculator",desc:"Estimate masonry units and ready-mixed mortar for a wall.",imageUrl:"/tool-images/brick-block.webp",Component:Pd},{id:"paint",title:"Paint Calculator",desc:"Estimate paint for walls, doors and multiple coats.",imageUrl:"/tool-images/paint.webp",Component:rm},{id:"skirting",title:"Skirting Board Calculator",desc:"Estimate skirting lengths for rooms and wall runs.",imageUrl:"/tool-images/skirting.webp",Component:cm},{id:"architrave",title:"Architrave Calculator",desc:"Estimate architrave lengths for door and window openings.",imageUrl:"/tool-images/architrave.webp",Component:Kd},{id:"concrete-aggregate",title:"Concrete and Aggregate Calculator",desc:"Estimate concrete, MOT, sand and gravel quantities.",imageUrl:"/tool-images/concrete-aggregate.webp",Component:Id},{id:"plasterboard",title:"Plasterboard Calculator",desc:"Estimate plasterboard sheets, screws, tape and adhesive.",imageUrl:"/tool-images/plasterboard.webp",Component:lm},{id:"insulation",title:"Insulation Calculator",desc:"Estimate insulation packs for floors, walls, roofs and lofts.",imageUrl:"/tool-images/insulation.webp",Component:am},{id:"timber",title:"Timber Calculator",desc:"Estimate studs, joists and battens from spacing and lengths.",imageUrl:"/tool-images/timber.webp",Component:um},{id:"paving",title:"Paving and Driveway Calculator",desc:"Estimate paving, block paving, MOT and sharp sand.",imageUrl:"/tool-images/paving.webp",Component:nm}];var dm=$(Ye());var qx=new Set(["bag","box","roll","pack"]),Ex=new Set(["each","bag","box","roll","pack","tub"]);function gl(e,t){let r=(t?.conversion?.request_uoms_supported??"").split(",").map(o=>o.trim().toLowerCase()).includes("sales_unit");if(e==="each"){let o=(t?.uoi_count??1)===1&&(t?.conversion?.sales_unit_size??1)===1;return r&&o?"sales_unit":e}if(!qx.has(e))return e;if(r)return"sales_unit";let n=t?.uoi;return n!=null&&Ex.has(n.toLowerCase())&&(t?.uoi_count??1)===1?n:e}var i0=new Map;function Mx(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 Ti(e,t,a=12,r){let n=`${Dt().client??""}||${e}||${t??""}||${a}||${r??""}`,i=i0.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(Ma(`/api/catalogue/search?${o.toString()}`),{headers:bi()}),c=await Qa(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(Mx):[];return i0.set(n,p),p}async function n0(e,t,a){return await Promise.all(e.map(async n=>{try{let i=a?dl(a,n):null,[o,l]=await Promise.all([i?Ti(i,void 0,void 0,t).then(p=>p.find(f=>f.product_id===i.split(" ")[0]),()=>{}):void 0,Ti(n.query,n.category,void 0,t)]),c=o?[o,...l.filter(p=>p.product_id!==o.product_id)]:l;return{requirement:n,candidates:c}}catch{return{requirement:n,candidates:[]}}}))}async function o0(){let e=await fetch(Ma("/api/catalogue"),{headers:bi()});if(!e.ok)return{itemCount:0,uploadedAt:null};let t=await Qa(e);return{itemCount:Number(t?.itemCount)||0,uploadedAt:t?.uploadedAt??null}}var Wt=$(W()),Tx=1500;function l0(e){let{addManyToCart:t,clearCart:a,openBasket:r}=Dn(),[n,i]=(0,dm.useState)(!1),[o,l]=(0,dm.useState)(null);return{adding:n,basketError:o,addToBasket:async(p,f)=>{let h=Date.now();i(!0),l(null);try{let d=await Promise.all(p.filter(y=>y.qty>0).map(async y=>{let R=(await Ti(y.search)).find(L=>L.product_id===y.productId);if(!R)throw new Error("A selected product is no longer available in this catalogue.");return On(R,{lineId:`${e}:${y.key}`,description:R.description,unit:gl(y.unit??"each",R),qty:y.qty,calculatorWasteIncluded:f})})),g=Tx-(Date.now()-h);g>0&&await new Promise(y=>window.setTimeout(y,g)),a(),t(d),r()}catch(d){l(d instanceof Error?d.message:"Could not add the products to your basket.")}finally{i(!1)}}}}function s0({toolTitle:e}){return(0,Wt.jsx)(Wt.Fragment,{children:(0,Wt.jsxs)("div",{className:"truss-estimator",children:[(0,Wt.jsxs)("div",{className:"quick-order-hero",children:[(0,Wt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Wt.jsx)("h1",{children:"Your Materials"}),(0,Wt.jsxs)("p",{children:["Calculating quantities from the ",e,"."]})]}),(0,Wt.jsx)("div",{className:"truss-estimator__card",children:(0,Wt.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{flex:1,justifyContent:"center"},children:[(0,Wt.jsx)(wi,{}),(0,Wt.jsx)("p",{className:"banter-message is-visible",children:"Preparing your materials\u2026"})]})})]})})}var Nc=$(Ye());var Qe=$(Ye());var C=$(W()),zx=[{dir:"asc",label:"Description (A-Z)"},{dir:"desc",label:"Description (Z-A)"}],mm={wasteFactorEnabled:!0},Rx=3e3,c0=null;function Sc(e,t){let a=ol(t);return a?`${e.toFixed(2)} ${a}`:e.toFixed(2)}function Ax(e){return e&&e.length>0?e.join(" x "):"-"}function fm({toolId:e,requirements:t,ready:a,onBack:r,onTotalChange:n}){let i=yv(),o=`${e}~${t.map(N=>`${N.key}|${N.query}|${N.category??""}|${N.qty}`).join("~")}`,l=o!==c0,[c,p]=(0,Qe.useState)(null),[f,h]=(0,Qe.useState)([]),[d,g]=(0,Qe.useState)(l),[y,R]=(0,Qe.useState)(null),[L,m]=(0,Qe.useState)("tile"),[u,b]=(0,Qe.useState)(null),[w,v]=(0,Qe.useState)(""),[M,T]=(0,Qe.useState)(null),[A,G]=(0,Qe.useState)(""),[Y,V]=(0,Qe.useState)([]),[se,ge]=(0,Qe.useState)(new Set),[Ze,Ue]=(0,Qe.useState)(null),[ve,le]=(0,Qe.useState)(""),[ot,ze]=(0,Qe.useState)([]),wt=(0,Qe.useRef)(null),K=(0,Qe.useRef)(!1),ue=N=>`${e}:${N}`,Me=N=>On(N.chosen,{lineId:ue(N.requirement.key),description:N.requirement.label,unit:gl(N.requirement.unit,N.chosen),qty:N.requirement.qty}),Ot=(0,Qe.useMemo)(()=>t.map(N=>`${N.key}|${N.query}|${N.category??""}`).join("~"),[t]);(0,Qe.useEffect)(()=>{let N=!1;return o0().then(O=>{N||p(O.itemCount>0)}).catch(()=>{N||p(!1)}),()=>{N=!0}},[]),(0,Qe.useEffect)(()=>{if(!a||!c)return;let N=!1,O;l&&g(!0),R(null);let Z=Date.now();return(async()=>{let pe=null;try{pe=(await n0(t,void 0,e)).map(({requirement:yt,candidates:ft})=>({requirement:yt,candidates:ft,chosen:ft[0]??null}))}catch(Se){N||R(Se instanceof Error?Se.message:"Could not load products")}if(!N){if(c0=o,l){let Se=Rx-(Date.now()-Z);Se>0&&await new Promise(yt=>{O=window.setTimeout(yt,Se)})}N||(pe&&(h(pe),!K.current&&i&&(K.current=!0,i.addManyToCart(pe.filter(Se=>Se.chosen).map(Me)))),g(!1))}})(),()=>{N=!0,window.clearTimeout(O)}},[a,c,Ot]),(0,Qe.useEffect)(()=>{if(!M)return;let N=A.trim();if(!N){V([]);return}let O=!1,Z=window.setTimeout(()=>{Ti(N).then(pe=>{O||V(pe)}).catch(()=>{O||V([])})},250);return()=>{O=!0,window.clearTimeout(Z)}},[M,A]),(0,Qe.useEffect)(()=>{if(!Ze)return;let N=ve.trim();if(!N){ze([]);return}let O=!1,Z=window.setTimeout(()=>{Ti(N).then(pe=>{O||ze(pe)}).catch(()=>{O||ze([])})},250);return()=>{O=!0,window.clearTimeout(Z)}},[Ze,ve]);let jt=(0,Qe.useMemo)(()=>{let N=w.trim().toLowerCase(),O=N?f.filter(Z=>Z.requirement.label.toLowerCase().includes(N)||(Z.chosen?.description??"").toLowerCase().includes(N)||(Z.chosen?.product_id??"").toLowerCase().includes(N)):f;return u?[...O].sort((Z,pe)=>{let Se=Z.requirement.label.localeCompare(pe.requirement.label);return u==="asc"?Se:-Se}):O},[f,w,u]),qe=jt.filter(N=>N.chosen),ke=jt.filter(N=>!N.chosen),De=f.filter(N=>N.chosen),Ge=De.filter(N=>N.chosen?.price==null).length,vt=De.reduce((N,O)=>N+(Ft(Me(O),mm).lineTotal??0),0);if((0,Qe.useEffect)(()=>{n?.(vt)},[vt,n]),!a||c===!1)return null;let z=i?De.filter(N=>i.cart[ue(N.requirement.key)]).length:0,H=Ze?f.find(N=>N.requirement.key===Ze)??null:null,de=ve.trim()?ot:H?.candidates??[],me=N=>{let O=M===N.requirement.key;T(O?null:N.requirement.key),G(O?"":N.requirement.query)},je=(N,O)=>{let Z=f.find(pe=>pe.requirement.key===N);h(pe=>pe.map(Se=>Se.requirement.key===N?{...Se,chosen:O}:Se)),i&&Z&&i.cart[ue(N)]&&i.addToCart(Me({...Z,chosen:O})),T(null),G("")},Oe=N=>{h(O=>O.map(Z=>Z.requirement.key===N?{...Z,chosen:null}:Z)),i?.cart[ue(N)]&&i.removeFromCart(ue(N))},k=N=>{Ue(N.requirement.key),le(""),ze([])},x=()=>{Ue(null),le(""),ze([])},q=N=>{if(!i)return;let O=ue(N.requirement.key);i.cart[O]?i.removeFromCart(O):i.addToCart(Me(N))},U=N=>{ge(O=>{let Z=new Set(O);return Z.has(N)?Z.delete(N):Z.add(N),Z})},X=N=>{let O=Y.length>0?Y:N.candidates;return(0,C.jsxs)("div",{className:"estimator-products__picker",children:[(0,C.jsx)("input",{type:"text",className:"results-search-input",value:A,autoFocus:!0,placeholder:"Search products in catalogue...",onChange:Z=>G(Z.target.value),"aria-label":`Search a product for ${N.requirement.label}`}),(0,C.jsxs)("div",{className:"estimator-products__options",children:[O.map(Z=>(0,C.jsxs)("button",{type:"button",className:`estimator-products__option${Z.product_id===N.chosen?.product_id?" is-selected":""}`,onClick:()=>je(N.requirement.key,Z),children:[(0,C.jsx)("span",{children:Z.description}),(0,C.jsxs)("span",{className:"results-row-meta",children:[Z.product_id,Z.price!=null&&` \xB7 ${nt(Z.price)}`]})]},Z.product_id)),O.length===0&&(0,C.jsx)("p",{className:"results-empty-hint",children:"No matching products."})]})]})};return(0,C.jsxs)("section",{className:"estimator-products results-tile-section","aria-label":"Matched products",children:[!d&&(0,C.jsxs)("div",{className:"estimator-products__head",children:[(0,C.jsxs)("div",{className:"results-tile-section__head",children:[(0,C.jsx)("h3",{children:"Matched Products"}),(0,C.jsx)("p",{children:"Products matched to your estimate, check before adding to your basket."})]}),!H&&(0,C.jsx)("div",{className:"results-summary estimator-products__toolbar",children:(0,C.jsxs)("div",{className:"estimator-products__controls",children:[(0,C.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search description...",value:w,onChange:N=>v(N.target.value),"aria-label":"Search matched products"}),(0,C.jsxs)("div",{className:"results-view-toggle","aria-label":"Results view",children:[(0,C.jsx)("button",{type:"button",className:`results-view-toggle__btn${L==="tile"?" is-active":""}`,"aria-pressed":L==="tile","aria-label":"Tile view",title:"Tile view",onClick:()=>m("tile"),children:(0,C.jsxs)("svg",{width:"18",height:"12",viewBox:"0 0 15 10",fill:"currentColor",children:[(0,C.jsx)("rect",{x:"0.5",y:"0.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"5.5",y:"0.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"10.5",y:"0.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"0.5",y:"5.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"5.5",y:"5.5",width:"4",height:"4"}),(0,C.jsx)("rect",{x:"10.5",y:"5.5",width:"4",height:"4"})]})}),(0,C.jsx)("button",{type:"button",className:`results-view-toggle__btn${L==="list"?" is-active":""}`,"aria-pressed":L==="list","aria-label":"List view",title:"List view",onClick:()=>m("list"),children:(0,C.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 15 15",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",children:[(0,C.jsx)("line",{x1:"0.5",y1:"2.5",x2:"14.5",y2:"2.5"}),(0,C.jsx)("line",{x1:"0.5",y1:"7.5",x2:"14.5",y2:"7.5"}),(0,C.jsx)("line",{x1:"0.5",y1:"12.5",x2:"14.5",y2:"12.5"})]})})]}),(0,C.jsxs)("details",{ref:wt,style:{position:"relative"},children:[(0,C.jsx)("summary",{className:"bom-toolbar-btn sort-menu-summary","aria-label":"Sort materials",style:{fontSize:16},children:"\u21C5"}),(0,C.jsx)("div",{className:"sort-menu-panel",children:zx.map(N=>{let O=u===N.dir;return(0,C.jsxs)("button",{type:"button",className:`sort-menu-item${O?" is-active":""}`,onClick:()=>{b(O?null:N.dir),wt.current?.removeAttribute("open")},children:[(0,C.jsx)("span",{className:"sort-menu-item__check",children:O?"\u2713":""}),N.label]},N.dir)})})]})]})})]}),H&&(0,C.jsxs)("div",{className:"results-review-page",children:[(0,C.jsxs)("div",{className:"results-review-page__top",children:[(0,C.jsxs)("button",{type:"button",className:"bom-toolbar-btn bom-toolbar-btn--accent",onClick:x,children:[(0,C.jsx)(Vr,{}),"Back to results"]}),(0,C.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,C.jsx)("div",{className:"results-review-searchbar",children:(0,C.jsx)("input",{type:"text",className:"results-search-input",placeholder:"Search products in catalogue...",value:ve,onChange:N=>le(N.target.value),"aria-label":`Search a product for ${H.requirement.label}`})}),H.chosen&&(0,C.jsx)("div",{className:"results-candidate-actions",children:(0,C.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>Oe(H.requirement.key),children:"Clear selected product"})})]})]}),(0,C.jsxs)("div",{className:"results-review-page__hero",children:[(0,C.jsx)("div",{className:"results-review-page__image-wrap",children:(0,C.jsx)(Ta,{className:"fill-img results-review-page__image",description:H.chosen?.description||H.requirement.label,photoUrl:H.chosen?.pdp_photo_url})}),(0,C.jsxs)("div",{className:"results-review-page__summary",children:[(0,C.jsx)("h2",{children:H.requirement.label}),(0,C.jsxs)("p",{className:"results-review-page__meta",children:[vi(H.requirement.qty)," ",xa(H.requirement.unit,H.requirement.qty)]}),H.chosen?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"results-review-page__product",children:H.chosen.description}),(0,C.jsxs)("div",{className:"results-row-meta",children:[H.chosen.product_id,H.chosen.price!=null?` \xB7 ${Sc(H.chosen.price,H.chosen.price_basis)}`:""]})]}):(0,C.jsx)("div",{className:"results-empty-hint",children:"No product currently selected for this line."}),(0,C.jsx)("div",{className:"results-review-page__actions",children:(0,C.jsx)("button",{type:"button",className:`bom-toolbar-btn${i?.cart[ue(H.requirement.key)]?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>q(H),disabled:!H.chosen||!i,children:i?.cart[ue(H.requirement.key)]?"\u2713 Added":"+ Add to basket"})})]})]}),de.length===0?(0,C.jsx)("p",{className:"results-empty-hint",children:"No matching products."}):(0,C.jsxs)("table",{className:"score-breakdown-table",children:[(0,C.jsx)("thead",{children:(0,C.jsxs)("tr",{children:[(0,C.jsx)("th",{children:"Product"}),(0,C.jsx)("th",{children:"Dims (mm)"}),(0,C.jsx)("th",{children:"Price"}),(0,C.jsx)("th",{"aria-label":"Actions"})]})}),(0,C.jsx)("tbody",{children:de.map(N=>{let O=N.product_id===H.chosen?.product_id;return(0,C.jsxs)("tr",{className:O?"score-breakdown-row--best":"",children:[(0,C.jsxs)("td",{children:[(0,C.jsx)("div",{children:N.description}),(0,C.jsx)("div",{className:"results-row-meta",children:N.product_id})]}),(0,C.jsx)("td",{children:(0,C.jsx)("span",{className:"unit-badge",children:Ax(N.measurements_mm)})}),(0,C.jsx)("td",{children:N.price!=null?Sc(N.price,N.price_basis):"-"}),(0,C.jsx)("td",{children:(0,C.jsxs)("label",{className:"switch-toggle",title:O?"Currently selected":"Use this candidate",children:[(0,C.jsx)("input",{type:"checkbox",checked:O,onChange:()=>{O?Oe(H.requirement.key):je(H.requirement.key,N)},"aria-label":O?`${N.description} selected`:`Use ${N.description}`}),(0,C.jsx)("span",{className:"switch-toggle-track","aria-hidden":"true"})]})})]},N.product_id)})})]})]}),!H&&d&&(0,C.jsxs)("div",{className:"processing-container processing-variant-banter",role:"status","aria-label":"Loading",style:{padding:"32px 24px"},children:[(0,C.jsx)(wi,{}),(0,C.jsx)("p",{className:"banter-message is-visible",style:{fontSize:15,minHeight:0},children:"Matching your materials against the catalogue\u2026"})]}),!H&&y&&(0,C.jsx)("p",{className:"results-empty-hint estimator-products__error",children:y}),!H&&!d&&!y&&jt.length===0&&f.length>0&&(0,C.jsx)("p",{className:"results-empty-hint",children:"No materials match the current search."}),!H&&!d&&!y&&L==="tile"&&qe.length>0&&(0,C.jsx)("div",{className:"results-tile-grid",children:qe.map(N=>{let{requirement:O,chosen:Z}=N,pe=Z?Ft(Me(N),mm):null,Se=i?!!i.cart[ue(O.key)]:!1;return(0,C.jsxs)("article",{className:"results-tile-card",children:[(0,C.jsxs)("button",{type:"button",className:"results-tile-card__surface",onClick:()=>k(N),"aria-label":`Review match for ${O.label}`,children:[(0,C.jsx)("div",{className:"results-tile-card__media",children:(0,C.jsx)(Ta,{className:"fill-img results-tile-card__image",description:Z?.description||O.label,photoUrl:Z?.pdp_photo_url})}),(0,C.jsxs)("div",{className:"results-tile-card__body",children:[Z?(0,C.jsxs)("div",{className:"results-tile-card__heading",children:[(0,C.jsx)("div",{className:"results-tile-card__title",children:Z.description}),(0,C.jsxs)("div",{className:"results-tile-card__match-meta",children:[(0,C.jsx)("span",{children:Z.product_id}),Z.price!=null?(0,C.jsx)("span",{children:Sc(Z.price,Z.price_basis)}):null]})]}):(0,C.jsx)("div",{className:"results-empty-hint",children:"No product matched for this line."}),(0,C.jsxs)("div",{className:"results-tile-card__match",children:[(0,C.jsx)("div",{className:"results-tile-card__match-label",children:"\u21B3 calculated as"}),(0,C.jsx)("div",{className:"results-tile-card__match-name",children:O.label}),(0,C.jsxs)("div",{className:"results-tile-card__meta",children:[vi(O.qty)," ",xa(O.unit,O.qty)]}),pe?.requiredSellUnits!=null?(0,C.jsxs)("div",{className:"results-tile-card__meta estimator-products__order",children:["Order ",pe.requiredSellUnits," ",pe.sellUnit,pe.lineTotal!=null?` \xB7 ${nt(pe.lineTotal)}`:""]}):Z?(0,C.jsx)("div",{className:"results-row-meta",children:"Quantity needs review"}):null]})]})]}),(0,C.jsxs)("div",{className:"results-tile-card__actions",children:[(0,C.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>k(N),children:"Review"}),(0,C.jsx)("button",{type:"button",className:`bom-toolbar-btn${Se?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>q(N),disabled:!Z||!i,children:Se?"\u2713 Added":"+ Add"})]})]},O.key)})}),!H&&!d&&!y&&L==="list"&&qe.length>0&&(0,C.jsx)("div",{className:"bom-table-wrap",children:(0,C.jsxs)("table",{className:"bom-table results-table","aria-label":"Matched materials",children:[(0,C.jsxs)("colgroup",{children:[(0,C.jsx)("col",{style:{width:"56px"}}),(0,C.jsx)("col",{className:"col-item"}),(0,C.jsx)("col",{style:{width:"90px"}}),(0,C.jsx)("col",{style:{width:"80px"}}),(0,C.jsx)("col",{style:{width:"220px"}}),(0,C.jsx)("col",{style:{width:"110px"}})]}),(0,C.jsx)("thead",{children:(0,C.jsxs)("tr",{className:"bom-col-header",children:[(0,C.jsx)("th",{"aria-label":"Expand"}),(0,C.jsx)("th",{style:{textAlign:"left"},children:"Description"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Qty"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Unit"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Product Matched"}),(0,C.jsx)("th",{style:{textAlign:"center"},children:"Basket"})]})}),(0,C.jsx)("tbody",{children:qe.map(N=>{let{requirement:O,chosen:Z}=N,pe=Z?Ft(Me(N),mm):null,Se=i?!!i.cart[ue(O.key)]:!1,yt=se.has(O.key);return(0,C.jsxs)(Qe.Fragment,{children:[(0,C.jsxs)("tr",{className:"bom-row",children:[(0,C.jsx)("td",{className:"bom-actions",style:{textAlign:"center",paddingLeft:0,paddingRight:0},children:(0,C.jsx)("button",{type:"button",className:"link-btn",onClick:()=>U(O.key),"aria-expanded":yt,"aria-label":yt?"Collapse product options":"Expand product options",children:yt?"\u25BE":"\u25B8"})}),(0,C.jsxs)("td",{style:{paddingLeft:0},children:[(0,C.jsx)("div",{className:"bom-component-name",children:O.label}),pe?.requiredSellUnits!=null&&(0,C.jsxs)("div",{className:"results-row-meta",children:["Order ",pe.requiredSellUnits," ",pe.sellUnit,pe.lineTotal!=null?` \xB7 ${nt(pe.lineTotal)}`:""]})]}),(0,C.jsx)("td",{className:"bom-qty col-order",style:{textAlign:"center"},children:vi(O.qty)}),(0,C.jsx)("td",{style:{textAlign:"center"},children:xa(O.unit,O.qty)}),(0,C.jsx)("td",{style:{textAlign:"center"},children:Z?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("div",{className:"bom-component-name",children:Z.description}),(0,C.jsxs)("div",{className:"results-row-meta",children:[Z.product_id,Z.price!=null&&` \xB7 ${Sc(Z.price,Z.price_basis)}`]})]}):(0,C.jsx)("span",{className:"results-empty-hint",children:"No match"})}),(0,C.jsx)("td",{style:{textAlign:"center"},children:(0,C.jsx)("button",{type:"button",className:`bom-toolbar-btn${Se?" bom-toolbar-btn--added":" bom-toolbar-btn--accent"}`,onClick:()=>q(N),disabled:!Z||!i,children:Se?"\u2713 Added":"+ Add"})})]}),yt&&(0,C.jsx)("tr",{children:(0,C.jsx)("td",{colSpan:6,style:{paddingLeft:0,paddingRight:0},children:M===O.key?X(N):(0,C.jsxs)("div",{className:"estimator-products__picker",children:[(0,C.jsxs)("div",{className:"estimator-products__options",children:[N.candidates.map(ft=>(0,C.jsxs)("button",{type:"button",className:`estimator-products__option${ft.product_id===Z?.product_id?" is-selected":""}`,onClick:()=>je(O.key,ft),children:[(0,C.jsx)("span",{children:ft.description}),(0,C.jsxs)("span",{className:"results-row-meta",children:[ft.product_id,ft.price!=null&&` \xB7 ${nt(ft.price)}`]})]},ft.product_id)),N.candidates.length===0&&(0,C.jsx)("p",{className:"results-empty-hint",children:"No candidates found."})]}),(0,C.jsx)("button",{type:"button",className:"bom-toolbar-btn",onClick:()=>me(N),children:"Search the catalogue"})]})})})]},O.key)})})]})}),!H&&!d&&!y&&ke.length>0&&(0,C.jsxs)("section",{className:"results-tile-section results-tile-section--unmatched","aria-label":"Items requiring matching",children:[(0,C.jsxs)("div",{className:"results-tile-section__head",children:[(0,C.jsx)("h3",{children:"Require Matching"}),(0,C.jsx)("p",{children:"We couldn\u2019t confidently match these to a product. Open one to pick from the closest options."})]}),(0,C.jsx)("div",{className:"results-unmatched-list",children:ke.map(N=>(0,C.jsxs)("button",{type:"button",className:"results-unmatched-card",onClick:()=>k(N),children:[(0,C.jsxs)("span",{className:"results-unmatched-card__main",children:[(0,C.jsx)("span",{className:"results-unmatched-card__title",children:N.requirement.label}),(0,C.jsxs)("span",{className:"results-row-meta",children:[vi(N.requirement.qty)," ",xa(N.requirement.unit,N.requirement.qty)]})]}),(0,C.jsx)("span",{className:"bom-toolbar-btn results-unmatched-card__prompt",children:"Review"})]},N.requirement.key))})]}),!d&&!y&&f.length>0&&(0,C.jsxs)("div",{className:"disclaimer-box",style:{alignItems:"center"},children:[(0,C.jsx)("span",{className:"disclaimer-icon",children:"\u26A0\uFE0F"}),(0,C.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."})]}),!H&&!d&&!y&&(r||z>0)&&(0,C.jsxs)("div",{className:"btn-row estimator-products__footer",children:[r&&(0,C.jsx)("button",{type:"button",className:"cta-btn cta-btn-secondary",style:{flex:"0 1 30%",justifyContent:"center",marginTop:0},onClick:r,children:"Back"}),z>0&&i&&(0,C.jsxs)("button",{type:"button",className:"cta-btn",style:{flex:r?"0 1 70%":1,marginTop:0},onClick:i.openBasket,children:[(0,C.jsxs)("span",{children:["View Basket (",z,")"]}),(0,C.jsx)("span",{className:"arrow",children:(0,C.jsx)(Qt,{})})]})]})]})}var Gt=$(W());function hm({toolId:e,toolTitle:t,requirements:a,onBack:r}){let[n,i]=(0,Nc.useState)(0),o=(0,Nc.useCallback)(l=>i(l),[]);return(0,Gt.jsx)(Gt.Fragment,{children:(0,Gt.jsxs)("div",{className:"truss-estimator",children:[(0,Gt.jsxs)("div",{className:"quick-order-hero",children:[(0,Gt.jsx)("div",{className:"quick-order-eyebrow",children:"Estimating Tools"}),(0,Gt.jsxs)("div",{className:"quick-order-hero-title-row",children:[(0,Gt.jsx)("h1",{children:"Your Materials"}),n>0&&(0,Gt.jsxs)("span",{className:"summary-chip summary-chip--scope",children:[(0,Gt.jsx)("strong",{children:nt(n)})," Est. total"]})]}),(0,Gt.jsxs)("p",{children:["Quantities from the ",t,", matched against your merchant\u2019s catalogue."]})]}),(0,Gt.jsx)("div",{className:"truss-estimator__card",style:{minHeight:0},children:(0,Gt.jsx)(fm,{toolId:e,requirements:a,ready:!0,onBack:r,onTotalChange:o})})]})})}var Te=$(W());function Cc(e){let[t,a]=(0,Va.useState)(!1);return(0,Te.jsx)(lc,{onOpenBasket:()=>a(!0),children:(0,Te.jsx)(Ux,{...e,showBasket:t,onShowBasket:a})})}function Ux({fullPage:e=!1,hideHeader:t=!1,internal:a=!1,showBasket:r,onShowBasket:n}){let[i,o]=(0,Va.useState)(null),[l,c]=(0,Va.useState)(null),p=pm.find(A=>A.id===i),{cart:f,updateCartQty:h,updateCartSellUnits:d,updateCartConversions:g,removeFromCart:y,clearCart:R}=Dn(),{adding:L,basketError:m,addToBasket:u}=l0(p?.title??"calculator"),b=(0,Va.useRef)(null),w=Js("estimating-tools",b);(0,Va.useEffect)(()=>{w("viewed")},[w]);let v=r?"basket":L?"adding":l?"review":i??"list",M=(0,Va.useRef)(v);(0,Va.useEffect)(()=>{M.current!==v&&(M.current=v,window.scrollTo(0,0))},[v]);let T=A=>{if(!p)return;w("estimate_completed",{calculator:p.id,lines:A.length});let G=Bv(p.id,A);G?u(G,A[0]?.calculatorWasteIncluded??!1):c(A)};return(0,Te.jsx)(tl.Provider,{value:w,children:(0,Te.jsx)("div",{ref:b,className:`app-wrapper${e?"":" app-wrapper--embedded"}${t?" app-wrapper--no-header":""}${a?"":" estimating-tools--customer"}`,style:Dt().theme,children:(0,Te.jsx)("main",{className:"main-content",children:r?(0,Te.jsx)(ul,{cart:f,onUpdateQty:h,onUpdateSellUnits:d,onResolveConversions:g,onRemove:y,onBack:()=>n(!1),onStartNewQuote:()=>{R(),o(null),c(null),n(!1)},internal:a}):L&&p?(0,Te.jsx)(s0,{toolTitle:p.title}):p?(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)("div",{hidden:l!==null,children:(0,Te.jsx)(p.Component,{onBack:()=>o(null),onReview:T})}),m&&(0,Te.jsx)("p",{className:"results-empty-hint estimator-products__error",children:m}),l!==null&&(0,Te.jsx)(hm,{toolId:p.id,toolTitle:p.title,requirements:l,onBack:()=>c(null)})]}):(0,Te.jsx)(Te.Fragment,{children:(0,Te.jsxs)("div",{className:"quick-order-card",children:[(0,Te.jsxs)("div",{className:"quick-order-hero",children:[(0,Te.jsx)("div",{className:"quick-order-eyebrow",children:"Construction Services"}),(0,Te.jsx)("h1",{children:"Estimating Tools"}),(0,Te.jsx)("p",{children:"Trade-specific calculators for trusses, fencing, decking, masonry and painting. Dial in your specs and get an instant material estimate."})]}),(0,Te.jsxs)("div",{className:"quick-order-alt",children:[(0,Te.jsx)("div",{className:"quick-order-alt-title",children:"Choose a Calculator"}),(0,Te.jsx)("div",{className:"estimator-tools-grid",children:pm.map(A=>(0,Te.jsxs)("button",{type:"button",className:"estimator-tool-card",onClick:()=>{w("calculator_selected",{calculator:A.id}),o(A.id),c(null)},children:[(0,Te.jsx)("span",{className:"estimator-tool-card__image-wrap",children:(0,Te.jsx)("img",{className:"fill-img estimator-tool-card__image",src:It(A.imageUrl),alt:""})}),(0,Te.jsxs)("span",{className:"estimator-tool-card__content",children:[(0,Te.jsx)("span",{className:"estimator-tool-card__title",children:A.title}),(0,Te.jsx)("span",{className:"estimator-tool-card__desc",children:A.desc})]})]},A.id))})]})]})})})})})}var qc=$(W());function gm({config:e,children:t}){return yw(e),(0,qc.jsx)(qc.Fragment,{children:t})}var bm=$(W()),Dx="https://api.metronlabs.ai",Ox=["client","api-key","api-url","theme","hide-header","analytics"],Bx=["all","events-only","none"];function p0(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.73",this.id||(this.id=e),this.setAttribute("data-turbo-permanent",""),this.setAttribute("data-turbolinks-permanent",""),!this.root){let n=document.createElement("div"),i=document.createElement("style");i.textContent=`:host { display: block; }
|
|
6975
6975
|
:host > div { all: initial; display: block; }
|
|
6976
|
-
${
|
|
6976
|
+
${vw}`,this.shadowRoot.replaceChildren(i,n),this.root=(0,u0.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")||Dx,client:n,apiKey:i,theme:Hx(e,this.getAttribute("theme")),analytics:Lx(this.getAttribute("analytics"))};this.root.render((0,bm.jsx)(gm,{config:o,children:(0,bm.jsx)(t,{hideHeader:this.hasAttribute("hide-header")})}))}},a.observedAttributes=Ox,a))}function Lx(e){return Bx.find(t=>t===e)??"all"}function Hx(e,t){if(t)try{return JSON.parse(t)}catch{console.error(`<${e}> theme attribute isn't valid JSON; using the default colours.`);return}}p0("metron-labs-quick-quote",uc);p0("metron-labs-estimating-tools",Cc);
|
|
6977
6977
|
/*! Bundled license information:
|
|
6978
6978
|
|
|
6979
6979
|
scheduler/cjs/scheduler.production.js:
|